.mechanics-demo{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#fffdf8;margin-top:28px}
.mechanics-tutorial{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#fffdf8;margin-top:24px}
.mechanics-tutorial>summary{padding:20px 24px;background:#e8eee7;font-size:17px;line-height:1.5}
.mechanics-tutorial>summary:focus-visible{outline:2px solid var(--teal);outline-offset:-4px}
.mechanics-tutorial>.tutorial-intro{margin:20px 24px;font-size:14px;line-height:1.75}
.mechanics-tutorial>.mechanics-demo{margin-top:0;border-width:1px 0 0;border-radius:0}
.mechanics-section + .bridge{margin-top:48px}
.mechanics-tabs{display:flex;flex-wrap:wrap;gap:4px;padding:9px;background:#e8eee7;border-bottom:1px solid var(--line)}
.mechanics-tabs button,.mechanic-phases button,.mechanic-playback button{font-family:inherit;font-size:12px;font-weight:600;line-height:1.4;cursor:pointer;border:1px solid transparent;border-radius:6px;padding:10px 12px;color:var(--teal);background:transparent}
.mechanics-tabs button{flex:1;white-space:nowrap;font-family:inherit}
.mechanics-tabs button[aria-selected=true]{background:var(--teal);color:#fff}
.mechanic-stage{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:24px 28px;padding:28px;align-items:start}
.mechanic-copy{grid-column:1/-1;min-width:0}
.mechanic-copy h3{font-size:23px;line-height:1.25;margin:0 0 15px}
.mechanic-copy p{font-size:14px;line-height:1.75;margin:0;max-width:none}
.mechanic-phases{display:flex;gap:8px;padding:18px 28px 0}
.mechanic-phases button{flex:1;position:relative;overflow:hidden;text-align:left;border-color:var(--line);font-size:11px;padding:10px 10px 14px;min-height:46px;background:#f5f7f2}
.mechanic-phases button::after{content:"";position:absolute;bottom:0;left:0;width:var(--progress,0%);height:4px;background:var(--teal)}
.mechanic-phases button[aria-pressed=true]{background:#dfeae1;border-color:#89ac98;color:#124e4d}
.mechanic-phases button[aria-pressed=false]::after{opacity:.4}
.mechanic-orders{min-width:0;background:#15242e;color:#dcebe5;border-radius:9px;overflow:hidden}
.mechanic-orders[hidden]{display:none}
.mechanic-order-heading{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 10px;padding:10px 14px;border-bottom:1px solid #395058;font-size:11px;line-height:1.6}
#mechanic-order-tick{color:#b5cfc4;font-variant-numeric:tabular-nums}
.mechanic-command{font:12px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;padding:16px 14px;white-space:pre-wrap;overflow-wrap:anywhere;margin:0;tab-size:2}
.mechanic-animation{min-width:0;container-type:inline-size}
.mechanic-stage[data-has-command=false] .mechanic-animation{grid-column:1/-1;max-width:624px;width:100%;justify-self:center}
.mechanic-animation iframe{display:block;width:100%;height:auto;border:0;border-radius:0;background:#0d1117}
.mechanic-map-header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 12px;padding:10px 12px;background:#15242e;color:#dcebe5;border-radius:9px 9px 0 0;font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;font-variant-numeric:tabular-nums}
#mechanic-perspective{color:#79c0ff}
#mechanic-tick{position:absolute;top:50%;left:50%;z-index:2;transform:translate(-50%,-50%);min-width:40px;padding:0 6px;background:#15242e;color:#dcebe5;font:11px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;font-variant-numeric:tabular-nums;text-align:center;white-space:nowrap;pointer-events:none;user-select:none}
.mechanic-map-legend{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:6px;margin-left:auto;font:11px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.mechanic-player{display:inline-block;padding:2px 6px;border-radius:2px;color:#0d1117;font-weight:750;text-align:center}
.mechanic-player.p1{background:#79c0ff}.mechanic-player.p2{background:#ff9a8b}
.mechanic-action-key{display:inline-flex;align-items:center;gap:2px;white-space:nowrap}
.mechanic-action-key svg{width:26px;height:14px}
.mechanic-action-key.move svg{color:rgba(35,134,54,.85)}.mechanic-action-key.attack svg{color:rgba(196,48,43,.85)}
.mechanic-status{min-height:40px;padding:10px 12px;background:#15242e;color:#dcebe5;font-size:11px;line-height:1.6}
.mechanic-status-item{display:inline-block}
.mechanic-status-separator{display:inline-block;margin:0 6px;color:#a0d3be;font-size:14px;font-weight:700;line-height:1;vertical-align:middle}
.mechanic-terrain-key{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.terrain-key{display:inline-block;width:13px;height:13px;border:1px solid #9aa8b0;border-radius:2px}
.terrain-key.high-ground{background:#2d3340}.terrain-key.ramp{background:#4a3d28}
.mechanic-playback{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:0 12px 12px;background:#15242e;border-radius:0 0 9px 9px}
.mechanic-transport{display:flex;align-items:center;gap:4px}
.mechanic-playback button{display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;padding:7px;border-color:#53726d;color:#e0eee7;background:#214b47}
.mechanics-demo .mechanic-playback button:disabled{opacity:.35;cursor:default;box-shadow:none}
.mechanics-demo .mechanic-playback button:focus-visible{outline-color:#a0d3be}
.mechanic-playback svg{width:20px;height:20px;fill:currentColor}
.mechanic-playback button[aria-pressed=true] .mechanic-play-icon,.mechanic-playback button[aria-pressed=false] .mechanic-pause-icon{display:none}
.mechanic-timeline{display:flex;align-items:center;gap:8px;min-width:0}
.mechanic-seek-track{position:relative;flex:1;min-width:0}
.mechanic-tick-marks{position:absolute;left:8px;right:8px;top:8px;height:12px;pointer-events:none}
.mechanic-tick-marks span{position:absolute;left:var(--tick-position);top:0;width:1px;height:12px;background:#9cbfb4;transform:translateX(-.5px)}
#mechanic-seek{position:relative;z-index:1;display:block;min-width:0;width:100%;height:28px;margin:0;cursor:pointer;appearance:none;background:transparent;--progress:0%}
#mechanic-seek::-webkit-slider-runnable-track{height:5px;border-radius:5px;background:linear-gradient(to right,#a0d3be var(--progress),#496268 var(--progress))}
#mechanic-seek::-moz-range-track{height:5px;border-radius:5px;background:linear-gradient(to right,#a0d3be var(--progress),#496268 var(--progress))}
#mechanic-seek::-webkit-slider-thumb{appearance:none;width:16px;height:16px;margin-top:-5.5px;border:2px solid #15242e;border-radius:50%;background:#d9f3e8;box-shadow:0 0 0 1px #a0d3be}
#mechanic-seek::-moz-range-thumb{width:12px;height:12px;border:2px solid #15242e;border-radius:50%;background:#d9f3e8;box-shadow:0 0 0 1px #a0d3be}
#mechanic-seek:focus-visible{outline:2px solid #a0d3be;outline-offset:3px;border-radius:4px}
#mechanic-seek:disabled{opacity:.4;cursor:wait}
.mechanics-demo button:hover{box-shadow:inset 0 0 0 1px #7ba594}
.mechanics-demo button:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
@media(max-width:800px){.mechanic-stage{padding:20px;gap:20px 16px}.mechanics-tabs button{flex:1 1 28%;padding:9px 5px}.mechanic-phases{padding:16px 20px 0;flex-wrap:wrap}.mechanic-phases button{flex:1 1 40%}}
@media(max-width:480px){.mechanic-stage{padding:14px;gap:18px 10px;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr)}.mechanic-command{font-size:10px;padding:12px 8px}.mechanic-order-heading,.mechanic-map-header{font-size:10px;padding:8px}.mechanic-map-legend{font-size:10px;gap:4px}.mechanic-status{padding:8px;font-size:10px}.mechanic-playback{padding:0 8px 8px;gap:8px}}
@container(max-width:420px){.mechanic-playback{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:0 8px 8px}.mechanic-playback button{width:28px;height:32px;flex-basis:28px;padding:4px}.mechanic-timeline{grid-row:2;grid-column:1/-1}}
