/* Compact work uses real raster stations, ItemIcons and active equipment only. */
.compact-skill-animation { display:none; }
html.gom-compact .compact-skill-animation { display:flex; align-items:center; gap:12px; min-height:112px; margin:12px; padding:10px 12px; min-width:0; box-sizing:border-box; border:1px solid var(--mg-border-muted); background:var(--mg-surface-panel); contain:layout paint style; }
html.gom-compact .compact-skill-art { position:relative; flex:0 0 132px; width:132px; height:94px; overflow:hidden; }
.compact-skill-scene { position:absolute; width:104px; height:88px; left:8px; bottom:0; object-fit:contain; }
.compact-skill-tool { position:absolute; width:57px; height:57px; top:0; left:70px; transform-origin:75% 70%; z-index:4; }
.compact-skill-tool-icon,.compact-skill-tool .item-composite-icon { width:57px; height:57px; object-fit:contain; }
.compact-skill-resource { position:absolute; width:30px; height:30px; right:4px; bottom:3px; z-index:5; }
.compact-skill-resource-icon,.compact-skill-resource .item-composite-icon { width:30px; height:30px; object-fit:contain; }
.compact-craft-ingredient { position:absolute; left:calc(18px + var(--craft-input)*19px); top:calc(30px + var(--craft-input)*5px); width:30px; height:30px; z-index:2; }
.compact-craft-input-icon,.compact-craft-ingredient .item-composite-icon { width:30px; height:30px; object-fit:contain; }
.compact-skill-animation-copy { display:grid; gap:6px; min-width:0; }
.compact-skill-animation-copy strong { font:19px/1.25 Georgia,serif; color:var(--mg-text-main); }
.compact-skill-animation-copy span { font-size:14px; line-height:1.4; color:var(--mg-text-muted); overflow-wrap:anywhere; }
.compact-skill-animation :is(.compact-skill-scene,.compact-skill-tool,.compact-skill-resource,.compact-craft-ingredient) { animation-duration:var(--compact-work-duration,1.8s); animation-iteration-count:infinite; animation-timing-function:ease-in-out; animation-play-state:paused; }
.compact-skill-animation[data-animation-running="true"] :is(.compact-skill-scene,.compact-skill-tool,.compact-skill-resource,.compact-craft-ingredient) { animation-play-state:running; }
.compact-skill-animation .compact-skill-resource { animation-name:compact-resource-bob; }
.compact-craft-ingredient { animation-name:compact-material-feed; animation-delay:calc(var(--craft-input)*-.15s); }
.compact-skill-animation:is([data-motion="chop"],[data-motion="strike"],[data-motion="dig"],[data-motion="tap"],[data-motion="adjust"]) .compact-skill-tool { animation-name:compact-tool-strike; }
.compact-skill-animation:is([data-motion="carve"],[data-motion="scrape"],[data-motion="saw"],[data-motion="cut"],[data-motion="stitch"],[data-motion="assemble"],[data-motion="finish"]) .compact-skill-tool { animation-name:compact-saw-work; }
.compact-skill-animation:is([data-motion="fish"],[data-motion="mix"],[data-motion="grind"],[data-motion="shape"]) .compact-skill-tool { animation-name:compact-stir-work; }
.compact-skill-animation:is([data-motion="chop"],[data-motion="gather"]) .compact-skill-scene { animation-name:compact-tree-sway; transform-origin:50% 95%; }
.compact-skill-animation:is([data-motion="strike"],[data-motion="dig"]) .compact-skill-scene { animation-name:compact-scene-impact; }
.compact-skill-animation:is([data-motion="fish"],[data-motion="cook"],[data-motion="step"]) .compact-skill-scene { animation-name:compact-scene-bob; }
.compact-skill-animation[data-processing-method]:not([data-processing-method=""]) .compact-skill-scene { animation:none; }
.compact-skill-animation[data-processing-method]:not([data-processing-method=""]) .compact-skill-tool { left:50px; top:29px; }
@keyframes compact-tool-strike { 0%,12%,100% { transform:translate(3px,-3px) rotate(24deg); } 36% { transform:translate(-9px,9px) rotate(-32deg); } 45% { transform:translate(-7px,7px) rotate(-25deg); } 66% { transform:translate(0,-2px) rotate(20deg); } }
@keyframes compact-tree-sway { 0%,30%,70%,100% { transform:rotate(0); } 39% { transform:rotate(-2deg); } 48% { transform:rotate(1deg); } }
@keyframes compact-scene-impact { 0%,30%,60%,100% { transform:translateY(0); } 38% { transform:translateY(2px); } 45% { transform:translateY(-1px); } }
@keyframes compact-saw-work { 0%,100% { transform:translateX(4px) rotate(-10deg); } 50% { transform:translateX(-13px) rotate(-10deg); } }
@keyframes compact-stir-work { 0%,100% { transform:translate(2px,0) rotate(-10deg); } 50% { transform:translate(-6px,4px) rotate(10deg); } }
@keyframes compact-scene-bob { 0%,100% { transform:translateY(0) rotate(-1deg); } 50% { transform:translateY(-3px) rotate(1deg); } }
@keyframes compact-resource-bob { 0%,100% { transform:translateY(0); opacity:.85; } 50% { transform:translateY(-4px); opacity:1; } }
@keyframes compact-material-feed { 0%,100% { transform:translate(-7px,-6px) scale(.9); opacity:1; } 65%,80% { transform:translate(13px,8px) scale(.7); opacity:.35; } }
@media(prefers-reduced-motion:reduce) { .compact-skill-animation :is(.compact-skill-scene,.compact-skill-tool,.compact-skill-resource,.compact-craft-ingredient) { animation:none !important; } }

/* The work bar uses authoritative work/order values, never character HP. */
html.gom-compact .compact-skill-art { height:108px; }
.compact-skill-work { display:grid; gap:5px; min-width:0; margin-top:2px; }
.compact-skill-work-label { display:flex; align-items:flex-end; justify-content:space-between; gap:6px; min-width:0; }
.compact-skill-work-label > span { color:var(--mg-text-muted); font-size:12px; line-height:1.25; }
.compact-skill-work-label > strong { flex:none; color:var(--mg-text-main); font:600 12px/1.25 sans-serif; white-space:nowrap; }
.compact-skill-work-bar { height:8px; width:100%; border:1px solid var(--mg-border-muted); border-radius:3px; overflow:hidden; box-sizing:border-box; background:#080a08; }
.compact-skill-work-fill { display:block; width:100%; height:100%; transform-origin:left center; background:linear-gradient(#a2a376,#727c4d); transition:transform .18s linear; }
[data-compact-work-kind="order"] .compact-skill-work-fill { background:linear-gradient(#d2ad65,#927037); }
.compact-skill-animation[data-animation-skill="MINING"] .compact-skill-work-fill { background:linear-gradient(#a5adb1,#78858d); }

/* Use desktop strike poses and whole-ItemIcon orientation, including composites.
   Axes work from the LEFT: metal blades need mirroring, the stone blade does not. */
.compact-skill-animation[data-animation-skill="WOODCUTTING"] .compact-skill-scene { left:28px; height:100px; animation-name:compact-tree-contact; }
.compact-skill-animation[data-animation-skill="WOODCUTTING"] .compact-skill-tool { left:12px; top:41px; width:64px; height:64px; transform-origin:18% 82%; animation-name:woodcuttingToolSwing; }
.compact-skill-animation[data-animation-skill="WOODCUTTING"] .compact-skill-tool-icon { transform:scaleX(-1); width:64px; height:64px; }
.compact-skill-animation[data-animation-skill="WOODCUTTING"] [data-tool-id="STONE_AXE"] { left:19px; top:43px; }
.compact-skill-animation[data-animation-skill="WOODCUTTING"] [data-tool-id="STONE_AXE"] .compact-skill-tool-icon { transform:none; }
.compact-skill-animation[data-animation-skill="MINING"][data-motion="strike"] .compact-skill-tool { left:42px; top:20px; transform-origin:82% 84%; --mining-rest-angle:2deg; --mining-lift-angle:22deg; --mining-strike-angle:-30deg; --mining-rebound-angle:-16deg; animation-name:miningPickStrike; }
.compact-skill-animation[data-animation-skill="MINING"][data-motion="strike"] [data-tool-id="STONE_PICKAXE"] { --mining-rest-angle:-24deg; --mining-lift-angle:-4deg; --mining-strike-angle:-60deg; --mining-rebound-angle:-46deg; }
.compact-skill-animation[data-animation-skill="MINING"] [data-tool-id="STONE_PICKAXE"] .compact-skill-tool-icon { transform:scaleX(-1); }
.compact-skill-animation[data-animation-skill="MINING"][data-motion="strike"] .compact-skill-scene { animation-name:compact-rock-contact; }
.compact-skill-animation[data-animation-skill="FISHING"] .compact-skill-tool { left:9px; top:14px; width:84px; height:84px; transform-origin:22% 84%; animation-name:fishingRodLift; }
.compact-skill-animation[data-animation-skill="FISHING"] .compact-skill-tool-icon { width:84px; height:84px; }
.compact-skill-animation[data-animation-skill="SURVIVAL"][data-motion="gather"] .compact-skill-tool { left:25px; top:26px; transform-origin:24% 78%; animation-name:survivalForageReach; }
.compact-skill-animation[data-animation-skill="SURVIVAL"] [data-tool-kind="knife"] .compact-skill-tool-icon { transform:rotate(180deg); }
.compact-skill-animation[data-animation-skill="SURVIVAL"][data-motion="gather"] .compact-skill-hands { left:18px; top:0; width:96px; height:96px; transform-origin:50% 50%; animation-name:compact-hand-gather; }
.compact-skill-hands-icon { width:100%; height:100%; object-fit:contain; }
@keyframes compact-hand-gather { 0%,100%{transform:translateY(-5px) rotate(-3deg)} 42%,58%{transform:translateY(6px) rotate(2deg)} 72%{transform:translateY(1px) rotate(0)} }
.compact-skill-animation[data-animation-skill="SURVIVAL"] .compact-skill-tool[data-tool-kind$="bow"] { transform-origin:50% 60%; animation-name:compact-hunting-ready; }
.compact-skill-animation[data-motion="dig"] .compact-skill-tool { left:38px; top:29px; transform-origin:26% 82%; animation-name:survivalShovelDig; }
.compact-skill-animation .compact-skill-tool[data-tool-kind="hammer"] { transform-origin:82% 84%; animation-name:smithingHammerIdle; }
.compact-skill-animation [data-tool-id="STONE_HAMMER"] .compact-skill-tool-icon { transform:scaleX(-1); }
.compact-skill-animation .compact-skill-tool[data-tool-kind="chisel"] { transform-origin:50% 80%; animation-name:compact-chisel-tap; }
.compact-skill-animation .compact-skill-tool[data-tool-kind="needle"] { transform-origin:50% 75%; animation-name:compact-needle-stitch; }
@keyframes compact-tree-contact { 0%,22%,64%,100%{transform:rotate(0)} 30%{transform:rotate(-2deg)} 42%{transform:rotate(1deg)} }
@keyframes compact-rock-contact { 0%,31%,60%,100%{transform:translateY(0)} 34%{transform:translateY(2px)} 42%{transform:translateY(-1px)} }
@keyframes compact-chisel-tap { 0%,100%{transform:translateY(-3px) rotate(-10deg)} 35%{transform:translateY(3px) rotate(-10deg)} 50%{transform:translateY(-1px) rotate(-10deg)} }
@keyframes compact-needle-stitch { 0%,100%{transform:translate(-4px,-2px) rotate(35deg)} 50%{transform:translate(5px,3px) rotate(47deg)} }
@keyframes compact-hunting-ready { 0%,100%{transform:rotate(-3deg)} 50%{transform:rotate(3deg)} }
@media(prefers-reduced-motion:reduce) { .compact-skill-work-fill { transition:none; } }

/* Gathering uses the desktop's confirmed-reward drop renderer. This small host
   is preserved across live card patches and stays inside the illustrated scene. */
html.gom-compact #main [data-compact-gathering="true"] .compact-gathering-loot-drop-layer {
  display: block !important;
  z-index: 6;
  --skill-activity-particle-left: 58%;
  --skill-activity-particle-bottom: 24px;
}
@media (prefers-reduced-motion: reduce) {
  html.gom-compact #main [data-compact-gathering="true"] .compact-gathering-loot-drop-layer { display: none !important; }
}

/* Full-screen windows cover the compact activity card. Release the hidden
   animation tracks while its label, progress and reward updates stay mounted. */
html.gom-compact:has(#uiCanvas > :is(#inventoryOverlay, #skillOverlay, #unlocksOverlay, #bankOverlay, #characterOverlay, #worldMapOverlay, #journalOverlay, #settingsOverlay, #travelConfirmOverlay, #emailReminderOverlay, #npcDialogOverlay):not(.hidden), dialog:modal)
  .compact-skill-animation :is(.compact-skill-scene, .compact-skill-tool, .compact-skill-resource, .compact-craft-ingredient),
html.gom-compact[data-visual-effects-quality="low"]
  .compact-skill-animation :is(.compact-skill-scene, .compact-skill-tool, .compact-skill-resource, .compact-craft-ingredient),
html.gom-compact[data-visual-effects-quality="medium"]
  .compact-skill-animation :is(.compact-skill-scene, .compact-skill-resource, .compact-craft-ingredient) {
  animation-name: none;
}
