/* Slotbound — pixel fantasy war table. Pixelify Sans (OFL) for display text, system fonts for reading. */
@font-face {
  font-family: 'Pixelify Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/pixelify-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Pixelify Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/pixelify-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --ink: #120b10;
  --night: #19121a;
  --plum: #271d27;
  --plum-2: #342734;
  --plum-3: #4a3a48;
  --parchment: #ead7a8;
  --parchment-2: #d7bd84;
  --parchment-3: #a8854f;
  --brass: #b58a45;
  --gold: #f2b53a;
  --gold-light: #ffe08a;
  --red: #c8382f;
  --red-dark: #7a1a17;
  --green: #7fd36a;
  --sky: #7cc8f0;
  --text: #f4ead6;
  --muted: #b9a9a3;
  --faint: #857479;
  --display: 'Pixelify Sans', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --body: system-ui, -apple-system, 'Segoe UI', 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --bevel: inset 0 2px 0 #ffffff14, inset 0 -3px 0 #00000059;
  --drop: 0 4px 0 #0000006b;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  font: 15px/1.45 var(--body);
  background:
    radial-gradient(ellipse 70% 520px at 50% -60px, #3a2433 0%, transparent 100%),
    repeating-linear-gradient(0deg, #ffffff04 0 2px, transparent 2px 4px),
    var(--night);
}
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
button:disabled:focus-visible { outline: none; }
p, h1, h2, h3, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only, .skip:not(:focus) { position: absolute; overflow: hidden; width: 1px; height: 1px; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 90; top: 12px; left: 12px; padding: 10px 15px; color: var(--ink); background: var(--gold-light); border: 2px solid var(--ink); }
.portrait { display: inline-block; flex: none; background-repeat: no-repeat; image-rendering: pixelated; }

/* Header */

.site-header { position: relative; z-index: 10; border-bottom: 3px solid var(--ink); background: linear-gradient(#2e2230, #231a24); box-shadow: inset 0 -2px 0 #ffffff0d, 0 3px 0 #0000004d; }
.site-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1320px; margin: 0 auto; padding: 9px 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { display: inline-grid; grid-template-columns: repeat(3, 10px); gap: 2px; padding: 3px; background: var(--ink); border: 2px solid var(--brass); }
.brand-mark i { display: block; height: 15px; background: linear-gradient(#fff6 0 3px, transparent 3px), var(--sky); }
.brand-mark i:nth-child(2) { background: linear-gradient(#fff6 0 3px, transparent 3px), var(--gold); }
.brand-mark i:nth-child(3) { background: linear-gradient(#fff6 0 3px, transparent 3px), var(--red); }
.brand-word { color: var(--text); font: 700 23px/1 var(--display); letter-spacing: .04em; text-shadow: 0 2px 0 var(--ink); }
.brand-word b { color: var(--gold); }
.utility { display: flex; align-items: center; gap: 8px; }
.quiet-button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 11px;
  color: var(--text); font: 600 14px/1 var(--body); border: 2px solid var(--ink); background: var(--plum-2); box-shadow: var(--bevel), 0 2px 0 #0007;
}
.quiet-button:hover { background: var(--plum-3); }
.quiet-button:active { transform: translateY(1px); }
.assist-icon { display: grid; place-items: center; width: 17px; height: 17px; color: var(--ink); font: 700 12px/1 var(--body); background: var(--gold); box-shadow: inset 0 -2px 0 #0004; }
.sound-icon { position: relative; display: inline-block; width: 18px; height: 14px; }
.sound-icon::before { content: ''; position: absolute; left: 0; top: 2px; width: 10px; height: 10px; background: currentColor; clip-path: polygon(0 30%, 35% 30%, 100% 0, 100% 100%, 35% 70%, 0 70%); }
.sound-icon::after { content: ''; position: absolute; right: 0; top: 2px; width: 5px; height: 10px; border: 2px solid currentColor; border-left: 0; border-radius: 0 8px 8px 0; }
.sound-toggle[aria-pressed="false"] { color: var(--muted); }
.sound-toggle[aria-pressed="false"] .sound-icon::after { top: 6px; width: 8px; height: 2px; border: 0; border-radius: 0; background: var(--red); transform: rotate(45deg); }

/* Intro */

.page { max-width: 1320px; margin: 0 auto; padding: 0 16px 28px; }
.intro { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); align-items: end; column-gap: 26px; row-gap: 4px; padding: 16px 2px 14px; }
.kicker { grid-column: 1 / -1; color: var(--gold); font: 600 12px/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase; }
.kicker b { font-weight: 600; }
.kicker::before { content: ''; display: inline-block; width: 8px; height: 8px; margin: 0 8px 1px 0; background: var(--red); box-shadow: 0 0 0 2px var(--ink); }
h1 { font: 700 clamp(25px, 3.1vw, 38px)/1.04 var(--display); letter-spacing: .01em; text-shadow: 0 3px 0 var(--ink); }
h1 em { color: var(--gold); font-style: normal; }
.subhead { max-width: 64ch; padding-bottom: 3px; color: var(--muted); font-size: 14px; line-height: 1.45; }

/* War table: HUD across the top, cabinet left, battlefield right */

.war-table { display: grid; grid-template-columns: 350px minmax(0, 1fr); grid-template-areas: 'hud hud' 'cabinet field'; gap: 12px; align-items: stretch; }
.hud, .cabinet, .battlefield, .panel {
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, var(--plum-2), var(--plum) 60%);
  box-shadow: var(--bevel), var(--drop);
}
.section-label { color: var(--gold); font: 600 11px/1.2 var(--body); letter-spacing: .16em; text-transform: uppercase; }

/* HUD */

.hud { grid-area: hud; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 8px 10px; }
.hud-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.stat { position: relative; display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 11px 4px 8px; background: #1a1219; border: 2px solid var(--ink); box-shadow: inset 0 1px 0 #ffffff12, inset 0 -2px 0 #0000004d; }
.stat dt { display: flex; align-items: center; gap: 7px; color: var(--muted); font: 600 10px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; }
.stat dd { min-width: 2ch; color: var(--text); font: 700 21px/1 var(--display); white-space: nowrap; text-shadow: 0 2px 0 var(--ink); font-variant-numeric: tabular-nums; }
.stat dd small { color: var(--faint); font-size: 13px; }
.stat-gold dd { color: var(--gold-light); }
.stat-lives dd { color: #ff9a92; }
.icon { display: inline-block; flex: none; width: 20px; height: 20px; }
.icon svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 2px 0 #0008); }
/* The sixteen-battle road gets its own row under the stats. */
.route-wrap { display: flex; flex: 1 0 100%; order: 3; align-items: center; justify-content: center; gap: 10px; min-width: 0; }
.route-label { color: var(--muted); font: 600 11px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.route-label b { display: inline-block; margin-left: 4px; color: var(--text); font-size: 16px; letter-spacing: .02em; }
.route { display: flex; align-items: center; }
.route-chapter {
  display: grid; place-items: center; min-width: 20px; height: 20px; margin-left: 8px; padding: 0 4px;
  color: var(--faint); font: 700 11px/1 var(--display); letter-spacing: .04em; background: #0f0a0e; border: 2px solid #00000080; cursor: help;
}
.route-chapter:first-child { margin-left: 0; }
.route-chapter.done { color: #a6ff8a; border-color: #4f8f44; }
.route-chapter.current { color: var(--ink); background: var(--gold); border-color: var(--ink); }
.route-node {
  position: relative; display: grid; place-items: center; width: 22px; height: 22px; margin-left: 7px;
  color: var(--faint); font: 700 11px/1 var(--body); background: #1a1219; border: 2px solid var(--ink); box-shadow: inset 0 -2px 0 #0006;
}
.route-node::before { content: ''; position: absolute; right: calc(100% + 2px); top: 50%; width: 7px; height: 4px; margin-top: -2px; background: var(--ink); }
.route-chapter + .route-node { margin-left: 5px; }
.route-chapter + .route-node::before { display: none; }
.route-node svg { width: 15px; height: 15px; opacity: .55; }
.route-node.done { color: var(--ink); background: var(--green); box-shadow: inset 0 2px 0 #fff6, inset 0 -2px 0 #0004; }
.route-node.done::before { background: #4f8f44; }
.route-node.done svg { opacity: 1; }
.route-node.boss { width: 26px; height: 26px; background: #3a1418; }
.route-node.boss[data-boss="lich"] { background: #24183a; }
.route-node.boss[data-boss="dragon"] { background: #3a1a0a; }
.route-node.current { width: 28px; height: 28px; color: var(--ink); font-size: 14px; background: var(--gold); box-shadow: inset 0 2px 0 #fff8, inset 0 -3px 0 #0004, 0 0 0 2px var(--gold-light), 0 0 16px #f2b53a88; animation: route-glow 1.4s ease-in-out infinite alternate; }
.route-node.current svg { opacity: 1; }
.route-node.boss.current { background: var(--red); box-shadow: inset 0 2px 0 #fff6, 0 0 0 2px #ff9a92, 0 0 18px #c8382faa; animation: none; }
.route-node.endless { font-size: 18px; }
/* Chapters you are not fighting in shrink to pips, so the whole sixteen-battle road fits beside the stats. */
.route-node.far { width: 10px; height: 10px; margin-left: 3px; font-size: 0; box-shadow: none; }
.route-node.far::before { width: 3px; height: 2px; margin-top: -1px; }
.route-node.far svg { display: none; }
.route-node.boss.far { width: 14px; height: 14px; }
.route-chapter + .route-node.far { margin-left: 4px; }
@keyframes route-glow { to { box-shadow: inset 0 2px 0 #fff8, inset 0 -3px 0 #0004, 0 0 0 2px var(--gold-light), 0 0 26px #f2b53acc; } }
.hud-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.phase-tag { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 4px 9px; color: var(--text); font: 600 12px/1 var(--body); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; background: #1a1219; border: 2px solid var(--ink); }
.phase-tag i { width: 9px; height: 9px; background: var(--sky); box-shadow: 0 0 0 2px #0008, 0 0 10px var(--sky); }
.phase-tag[data-phase="battle"] i { background: #ff5a4e; box-shadow: 0 0 0 2px #0008, 0 0 12px #ff5a4e; animation: blink 520ms steps(2, jump-none) infinite; }
.phase-tag[data-phase="reward"] i { background: var(--gold); box-shadow: 0 0 0 2px #0008, 0 0 12px var(--gold); }
.phase-tag[data-phase="won"] i { background: var(--green); box-shadow: 0 0 0 2px #0008, 0 0 12px var(--green); }
.phase-tag[data-phase="lost"] i { background: #6f6469; box-shadow: 0 0 0 2px #0008; }
@keyframes blink { 50% { opacity: .35; } }
.speed-toggle { min-width: 44px; min-height: 30px; padding: 3px 9px; color: var(--muted); font: 700 14px/1 var(--body); background: #1a1219; border: 2px solid var(--ink); box-shadow: inset 0 -2px 0 #0006; }
.speed-toggle:hover { color: var(--text); }
.speed-toggle[aria-pressed="true"] { color: var(--ink); background: var(--gold); box-shadow: inset 0 2px 0 #fff8, inset 0 -2px 0 #0004; }

/* Cabinet: the slot machine */

.cabinet {
  grid-area: cabinet; position: relative; display: flex; flex-direction: column; gap: 12px; padding: 30px 14px 14px;
  background:
    linear-gradient(90deg, #00000030, transparent 12%, transparent 88%, #00000030),
    repeating-linear-gradient(90deg, #0000 0 22px, #00000012 22px 24px),
    linear-gradient(180deg, #4a3242, #2c1f2a 55%, #241922);
}
.cabinet::before, .cabinet::after { content: ''; position: absolute; top: 8px; width: 8px; height: 8px; background: var(--brass); box-shadow: 0 0 0 2px var(--ink), inset -2px -2px 0 #0005; }
.cabinet::before { left: 8px; }
.cabinet::after { right: 8px; }
.cabinet-crest { position: absolute; top: -15px; left: 50%; width: 92px; height: 30px; transform: translateX(-50%); display: grid; place-items: center; background: linear-gradient(#cfa45c, #8a6230); border: 3px solid var(--ink); clip-path: polygon(14% 0, 86% 0, 100% 50%, 86% 100%, 14% 100%, 0 50%); }
.cabinet-crest span { width: 14px; height: 14px; background: radial-gradient(circle at 35% 30%, #ff9c8c, var(--red) 50%, var(--red-dark)); box-shadow: 0 0 0 2px var(--ink); transform: rotate(45deg); }
.cabinet-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cabinet-heading h2 { font: 700 21px/1.05 var(--display); text-shadow: 0 2px 0 var(--ink); }
.machine { display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: stretch; gap: 6px; }
.reels-frame {
  --pad: 9px; position: relative; margin: 6px; padding: var(--pad);
  background: #0f0a0e; border: 3px solid var(--ink);
  box-shadow: 0 0 0 3px var(--brass), 0 0 0 6px var(--ink), inset 0 8px 18px #000a;
  transition: box-shadow 160ms ease;
}
.reels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 7px; row-gap: 3px; }
.reel {
  position: relative; display: block; aspect-ratio: 1; min-width: 0; padding: 0; overflow: hidden; container-type: size;
  background: linear-gradient(180deg, #a99fae 0%, #e8e1ea 20%, #f7f3f5 50%, #e8e1ea 80%, #a99fae 100%);
  border: 0; box-shadow: inset 0 0 0 2px #00000040, inset 0 6px 6px -4px #0006, inset 0 -6px 6px -4px #0006;
}
.reel:not(:disabled):hover { box-shadow: inset 0 0 0 2px var(--gold), inset 0 6px 6px -4px #0006, inset 0 -6px 6px -4px #0006; }
.reel-strip { position: absolute; top: 0; left: 0; right: 0; display: flex; flex-direction: column; will-change: transform; }
.reel.spinning .reel-strip { filter: url(#reel-blur); }
.reel-symbol { position: relative; display: grid; flex: none; place-items: center; height: 100cqh; }
.reel-symbol:not([data-type=""])::before { content: ''; position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(color-mix(in srgb, var(--unit, var(--gold)) 40%, transparent), transparent 70%); }
.reel-symbol .portrait { position: relative; filter: drop-shadow(0 2px 0 #0005); }
.reel-placeholder { color: #8a7f8c; font: 700 26px/1 var(--display); }
.reel.held { box-shadow: inset 0 0 0 3px var(--gold), inset 0 0 18px #f2b53a77; }
.reel.held::after {
  content: attr(data-hold-label); position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 0 1px;
  color: var(--ink); font: 700 10px/1.2 var(--body); letter-spacing: .14em; text-align: center; text-transform: uppercase; background: var(--gold);
}
.reel.matched { background: linear-gradient(180deg, color-mix(in srgb, var(--unit, var(--gold)) 55%, #a99fae) 0%, color-mix(in srgb, var(--unit, var(--gold)) 22%, #fff) 50%, color-mix(in srgb, var(--unit, var(--gold)) 55%, #a99fae) 100%); }
.reel[data-unit="knight"] { --unit: #7cc8f0; }
.reel[data-unit="archer"] { --unit: #f2c45a; }
.reel[data-unit="mage"] { --unit: #a48cff; }
.reel[data-unit="cleric"] { --unit: #86e07c; }
.reel[data-unit="rider"] { --unit: #f08a5d; }
.reel[data-unit="pikeman"] { --unit: #5fd0c0; }
.reel[data-unit="frostmage"] { --unit: #c58cff; }
.reel[data-unit="assassin"] { --unit: #4fb7a8; }
.reel[data-unit="musketeer"] { --unit: #e0c070; }
.reel[data-unit="berserker"] { --unit: #e06a4a; }
.reel[data-unit="ballista"] { --unit: #c9a36a; }
.reel[data-unit="banner"] { --unit: #ffd34d; }
.reel.tense { animation: tense 260ms ease-in-out infinite alternate; }
@keyframes tense { from { box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 10px #f2b53a66; } to { box-shadow: inset 0 0 0 4px var(--gold-light), inset 0 0 26px #ffcf5acc; } }
.reels-frame.tense { box-shadow: 0 0 0 3px var(--gold-light), 0 0 0 6px var(--ink), 0 0 26px #f2b53a99, inset 0 8px 18px #000a; }
.reels-frame.revealing .reel:not(.matched) { filter: brightness(.55) saturate(.6); transition: filter 160ms ease; }
.line-layer { position: absolute; top: var(--pad); left: var(--pad); width: calc(100% - 2 * var(--pad)); height: calc(100% - 2 * var(--pad)); overflow: visible; pointer-events: none; }
.reel-line { fill: none; stroke: var(--line, var(--gold)); stroke-width: 7; stroke-linecap: square; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 5px var(--line, var(--gold))) drop-shadow(0 2px 0 #000a); animation: draw-line 260ms ease-out forwards; }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
.lever { position: relative; min-height: 120px; padding: 0; border: 0; background: none; }
.lever-slot { position: absolute; left: 50%; top: 50%; width: 14px; height: 46px; margin: -23px 0 0 -7px; background: #0c070a; border: 2px solid var(--ink); box-shadow: 0 0 0 2px var(--brass), inset 0 3px 0 #0009; }
.lever-arm { position: absolute; left: 50%; bottom: 50%; width: 7px; height: 40%; margin-left: -3.5px; transform-origin: 50% 100%; background: linear-gradient(90deg, #6d6a78, #e8e6ee 45%, #8b8896); box-shadow: 0 0 0 2px var(--ink); }
.lever-knob { position: absolute; top: -24px; left: 50%; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #ffb0a2 0 12%, #e2473b 30%, #9c1f19 70%, #5b0f0c); box-shadow: 0 0 0 2px var(--ink), 0 3px 0 #0008; }
.lever:not(:disabled):hover .lever-knob { filter: brightness(1.15); }
.lever:disabled .lever-knob { filter: saturate(.45) brightness(.8); }
.lever.pulled .lever-arm { animation: lever-pull 620ms cubic-bezier(.3, .7, .3, 1); }
@keyframes lever-pull { 0% { transform: scaleY(1); } 28% { transform: scaleY(-.82); } 45% { transform: scaleY(-.82); } 78% { transform: scaleY(1.06); } 100% { transform: scaleY(1); } }
.primary-button {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 8px 18px;
  color: #2a1404; font: 700 19px/1 var(--display); letter-spacing: .04em; text-transform: uppercase;
  background: linear-gradient(180deg, #ffe08a, #f2b53a 48%, #d68d1f); border: 3px solid var(--ink);
  box-shadow: inset 0 3px 0 #fff7, inset 0 -4px 0 #00000040, 0 4px 0 var(--ink);
  text-shadow: 0 1px 0 #fff6;
}
.primary-button:not(:disabled):hover { filter: brightness(1.08); }
.primary-button:not(:disabled):active { transform: translateY(3px); box-shadow: inset 0 3px 0 #fff7, inset 0 -2px 0 #00000040, 0 1px 0 var(--ink); }
.primary-button:disabled { color: #4a4044; background: linear-gradient(180deg, #8c8085, #6a5f64); text-shadow: none; box-shadow: inset 0 2px 0 #fff3, inset 0 -3px 0 #0003, 0 4px 0 var(--ink); }
.button-icon { font-size: 21px; }
.spin-button { width: 100%; }
.price { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; padding: 3px 8px 4px; color: var(--gold-light); font-size: 15px; text-shadow: 0 1px 0 #000; background: #3a2412; box-shadow: inset 0 2px 0 #0006; }
.primary-button:disabled .price { color: #c2b5b0; background: #403538; }
.nudge:not(:disabled) { animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { box-shadow: inset 0 3px 0 #fff7, inset 0 -4px 0 #00000040, 0 4px 0 var(--ink), 0 0 0 4px #ffe08a88, 0 0 26px #f2b53aaa; } }
.reel-note { min-height: 2.9em; color: var(--muted); font-size: 13px; line-height: 1.45; }
.unit-key { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: auto; padding-top: 10px; border-top: 2px dashed #0000005c; }
.unit-key p { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 3px 5px 3px 2px; color: var(--text); font: 600 12px/1.1 var(--body); background: #1a121980; border-left: 3px solid var(--unit, var(--gold)); cursor: help; }
.unit-key p span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-key .wild-key { color: var(--gold-light); }
.council-button {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 6px 12px;
  color: var(--text); font: 600 14px/1 var(--body); letter-spacing: .04em; background: var(--plum-3); border: 2px solid var(--ink); box-shadow: var(--bevel);
}
.council-button:not(:disabled):hover { background: #5d4a5b; }
.council-button:disabled { color: var(--faint); }
.council-button.has-news:not(:disabled) { box-shadow: var(--bevel), 0 0 0 2px var(--gold), 0 0 16px #f2b53a88; }
.council-new { padding: 3px 6px 2px; color: var(--ink); font: 700 10px/1 var(--body); letter-spacing: .12em; background: var(--gold); animation: blink 900ms steps(2, jump-none) infinite; }
.coin-flight { display: block; width: 100%; height: 100%; }
.coin-flight svg { display: block; width: 100%; height: 100%; }

/* Battlefield */

.battlefield { grid-area: field; display: grid; align-content: start; gap: 10px; min-width: 0; padding: 10px; }
.arena { position: relative; padding: 6px; background: linear-gradient(180deg, var(--parchment), var(--parchment-2)); border: 3px solid var(--ink); box-shadow: inset 0 0 0 2px #fff3cf, inset 0 -4px 0 var(--parchment-3), 0 4px 0 #0007; }
.arena::before, .arena::after { content: ''; position: absolute; z-index: 1; top: -9px; width: 20px; height: 20px; background: var(--parchment); border: 3px solid var(--ink); box-shadow: inset 0 -3px 0 var(--parchment-3); transform: rotate(45deg); }
.arena::before { left: -9px; }
.arena::after { right: -9px; }
.arena.jolt { animation: jolt 220ms ease-out; }
@keyframes jolt { 0% { box-shadow: inset 0 0 0 2px #ff9a92, inset 0 -4px 0 var(--parchment-3), 0 4px 0 #0007, 0 0 0 3px #c8382f99; } }
.arena-stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; container-type: inline-size; background: #2f4a2c; border: 3px solid #4a3220; box-shadow: 0 0 0 2px var(--ink); will-change: transform; }
#scene { position: absolute; inset: 0; display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.stage-overlay { position: absolute; inset: 0; pointer-events: none; font-family: var(--body); }
.stage-overlay > * { position: absolute; }

.map-plate {
  top: 2.6%; left: 1.6%; z-index: 3; max-width: 29%; padding: .5cqw 1.1cqw .65cqw;
  color: var(--ink); background: linear-gradient(180deg, var(--parchment), var(--parchment-2)); border: 2px solid var(--ink);
  box-shadow: inset 0 0 0 2px #fff3cf88, 0 3px 0 #0007;
}
.map-plate .section-label { color: var(--red-dark); font-size: clamp(8px, 1cqw, 11px); }
.map-plate h2 { margin-top: .15em; font: 700 clamp(14px, 2.1cqw, 24px)/1 var(--display); cursor: help; pointer-events: auto; }

.formation, .enemy-formation { inset: 0; }
.slot { position: absolute; padding: 0; border: 0; background: none; pointer-events: auto; -webkit-tap-highlight-color: transparent; }
.slot:disabled { pointer-events: none; }
.slot-tile {
  position: absolute; left: 4%; right: 4%; bottom: 3%; height: 24%; border-radius: 50%;
  background: #00000024; border: 2px dashed #ffffff4d; transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.slot.occupied .slot-tile { background: radial-gradient(color-mix(in srgb, var(--unit) 55%, transparent), color-mix(in srgb, var(--unit) 18%, transparent) 70%); border: 2px solid color-mix(in srgb, var(--unit) 70%, #000); }
.slot:not(:disabled):hover .slot-tile { border-color: var(--gold-light); background: #ffe08a33; }
.slot.selected .slot-tile { border: 3px solid var(--gold-light); background: radial-gradient(#ffe08a88, #f2b53a33 70%); box-shadow: 0 0 16px #ffe08a; transform: scale(1.08); }
.slot.selected::before { content: ''; position: absolute; left: 50%; top: -6%; border: .7cqw solid transparent; border-top: .9cqw solid var(--gold-light); transform: translateX(-50%); filter: drop-shadow(0 2px 0 #000); animation: bounce 600ms ease-in-out infinite alternate; }
@keyframes bounce { to { translate: 0 18%; } }
.slot.droppable .slot-tile { border: 2px dashed var(--gold-light); background: #ffe08a22; animation: drop-pulse 900ms ease-in-out infinite alternate; }
@keyframes drop-pulse { to { background: #ffe08a55; } }
.slot.mergeable .slot-tile { border: 3px solid #a6ff8a; background: radial-gradient(#a6ff8a88, #a6ff8a22 70%); animation: drop-pulse 600ms ease-in-out infinite alternate; }
.slot.mergeable::after { content: '+'; position: absolute; top: 4%; left: 50%; transform: translateX(-50%); color: #a6ff8a; font: 700 clamp(12px, 2cqw, 22px)/1 var(--display); text-shadow: 0 2px 0 #000; }
.slot.incoming .slot-tile { opacity: .3; }
.slot-stars { position: absolute; left: 0; right: 0; top: 2%; color: var(--gold-light); font: 700 clamp(7px, 1cqw, 12px)/1 var(--mono); letter-spacing: -.05em; text-align: center; text-shadow: 0 1px 0 #000, 0 0 4px #000; }
.slot.mergeable .slot-stars { opacity: 0; }
.links { position: absolute; right: -10%; top: 16%; display: grid; gap: 2px; }
.links i {
  display: grid; place-items: center; width: clamp(10px, 1.35cqw, 17px); height: clamp(10px, 1.35cqw, 17px);
  color: #fff; font: 700 clamp(7px, .95cqw, 12px)/1 var(--mono); font-style: normal; border: 1px solid var(--ink); box-shadow: 0 1px 0 #0008;
}
.link-guard { background: #4a89c8; }
.link-guard::before { content: '◆'; }
.link-covered { background: #d39b2a; }
.link-covered::before { content: '➶'; }
.link-blessed { background: #3f9d4b; }
.link-blessed::before { content: '✚'; }
.link-resonance { background: #7d5fd6; }
.link-resonance::before { content: '✦'; }
.link-flank { background: #d0613a; }
.link-flank::before { content: '»'; }
.enemy-slot { position: absolute; }
.enemy-slot.occupied { pointer-events: auto; cursor: help; }
.enemy-slot.occupied::after { content: ''; position: absolute; left: 6%; right: 6%; bottom: 3%; height: 22%; border-radius: 50%; background: radial-gradient(#ff4b3e55, #ff4b3e14 70%); border: 2px solid #8a1d1888; }
.enemy-slot.elite::after { border: 2px solid #ffcf5a; box-shadow: 0 0 10px #ffcf5a88; }
.arena-stage.in-battle .formation, .arena-stage.in-battle .enemy-formation { visibility: hidden; }

.boss-bar { top: 3%; left: 50%; z-index: 4; width: min(35%, 400px); transform: translateX(-50%); display: grid; gap: .35em; color: #ffd2cc; font: 700 clamp(9px, 1.25cqw, 14px)/1 var(--body); letter-spacing: .16em; text-align: center; text-transform: uppercase; text-shadow: 0 2px 0 #000; }
.boss-bar i { position: relative; display: block; height: clamp(8px, 1.2cqw, 14px); overflow: hidden; background: #2a0e10; border: 2px solid var(--ink); box-shadow: 0 0 0 2px #7a1a17, 0 3px 0 #0008; }
.boss-bar b { position: absolute; left: 0; top: 0; bottom: 0; }
.boss-bar .trail { width: var(--trail, 100%); background: #ffe1a8; }
.boss-bar .fill { width: var(--health, 100%); background: linear-gradient(180deg, #ff7a6b, #d1302a 55%, #8f1913); box-shadow: inset 0 2px 0 #fff5; }
.boss-bar.enraged { color: #ffb0a2; }
.boss-bar.enraged .fill { background: linear-gradient(180deg, #ffb06b, #ff3d22 55%, #a5120a); animation: enraged 380ms ease-in-out infinite alternate; }
@keyframes enraged { to { filter: brightness(1.45); } }

.arena-banner {
  left: 0; right: 0; top: 36%; z-index: 6; display: grid; justify-items: center; gap: .45em; padding: 1.1cqw 2cqw; text-align: center; opacity: 0;
  background: linear-gradient(90deg, transparent, #140c12e6 16%, #140c12e6 84%, transparent);
}
.arena-banner strong { color: var(--gold-light); font: 700 clamp(16px, 3.6cqw, 46px)/1.05 var(--display); letter-spacing: .05em; text-shadow: 0 3px 0 #000, 0 0 22px #f2b53a88; }
.arena-banner span { color: var(--parchment); font: 600 clamp(9px, 1.3cqw, 15px)/1.25 var(--body); letter-spacing: .12em; text-transform: uppercase; }
.arena-banner.show { animation: banner 1.5s ease forwards; }
.arena-banner.boss.show { animation-duration: 2s; }
.arena-banner.alert.show { animation-duration: 1.3s; }
.arena-banner.boss strong, .arena-banner.alert strong, .arena-banner.loss strong { color: #ff9a8c; text-shadow: 0 3px 0 #000, 0 0 26px #ff3d22; }
.arena-banner.boss { background: linear-gradient(90deg, transparent, #2a0a0ce8 14%, #2a0a0ce8 86%, transparent); }
.arena-banner.win strong { color: #c8ffb4; text-shadow: 0 3px 0 #000, 0 0 26px #5ff08a; }
@keyframes banner { 0% { opacity: 0; transform: scaleY(.2); } 10% { opacity: 1; transform: scaleY(1.08); } 16% { transform: none; } 84% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateX(3%); } }

.wave-caption {
  top: 2.6%; right: 1.6%; z-index: 3; display: grid; justify-items: end; gap: .35em; max-width: 40%;
  color: var(--text); font: 700 clamp(9px, 1.2cqw, 14px)/1.1 var(--body); letter-spacing: .07em; text-align: right;
}
.wave-caption > span:first-child { padding: .35em .7em; background: #140c12d9; border: 2px solid var(--ink); box-shadow: 0 3px 0 #0007; pointer-events: auto; cursor: help; }
.wave-mods { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .3em; }
.wave-mods:empty { display: none; }
.modifier-chip { padding: .25em .55em; color: #ffd0c8; font-size: .82em; letter-spacing: .06em; background: #5a1814e6; border: 2px solid var(--ink); pointer-events: auto; cursor: help; }
.enemy-count { padding: .25em .6em; color: #ffb6aa; font-size: .85em; background: #140c12c2; border: 2px solid var(--ink); }

.deploy-bar { display: flex; align-items: stretch; gap: 10px; }
.reserve { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; padding: 6px 9px; background: #1a1219; border: 2px solid var(--ink); box-shadow: inset 0 3px 0 #0006; }
.reserve-heading { display: grid; flex: none; justify-items: center; gap: 5px; }
.reserve-heading h3 { color: var(--muted); font: 600 11px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; }
#reserve-count { display: grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; color: var(--ink); font: 700 12px/1 var(--body); background: var(--parchment-2); }
.reserve-units { display: flex; flex: 1; align-items: center; gap: 6px; min-width: 0; min-height: 58px; overflow-x: auto; scrollbar-width: thin; padding: 1px 0; counter-reset: muster; }
.reserve-unit {
  position: relative; display: grid; flex: none; place-items: center; width: 56px; height: 56px; padding: 0;
  background: radial-gradient(color-mix(in srgb, var(--unit) 30%, #2a1f29), #241922 75%); border: 2px solid var(--ink);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--unit) 55%, transparent), inset 0 -3px 0 #0006;
  counter-increment: muster;
}
/* Reinforcements march in in this order. */
.reserve-unit::before { content: counter(muster); position: absolute; top: 2px; left: 2px; min-width: 14px; color: var(--ink); font: 700 10px/14px var(--body); text-align: center; background: var(--parchment-2); }
.reserve-unit.sent { opacity: .3; filter: grayscale(1); }
.reserve-unit:not(:disabled):hover { filter: brightness(1.15); }
.reserve-unit[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--gold-light), 0 0 14px #ffe08a99; transform: translateY(-2px); }
.reserve-unit.incoming { opacity: .35; }
.reserve-unit .tier { position: absolute; left: 0; right: 0; bottom: 1px; color: var(--gold-light); font: 700 10px/1 var(--mono); letter-spacing: -.08em; text-align: center; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.reserve-bank { flex: none; min-height: 44px; padding: 6px 11px; color: var(--text); font: 600 13px/1.15 var(--body); background: var(--plum-3); border: 2px solid var(--ink); box-shadow: var(--bevel); }
.reserve-bank:not(:disabled):hover { background: #5d4a5b; }
.sell-button { color: var(--gold-light); background: #4a3218; }
.sell-button:not(:disabled):hover { background: #5e4020; }
.reserve-empty { color: var(--faint); font-size: 13px; line-height: 1.35; }
.skill-bar { display: flex; flex: none; align-items: stretch; gap: 6px; }
.skill-bar[hidden] { display: none; }
.skill-button {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 4px; width: 84px; min-height: 64px; padding: 12px 4px 6px;
  color: var(--text); font: 600 11px/1.1 var(--body); background: linear-gradient(180deg, #3d2c3c, #241922); border: 2px solid var(--ink);
  box-shadow: inset 0 2px 0 #fff2, inset 0 -3px 0 #0006, 0 3px 0 var(--ink); transition: transform 100ms ease, filter 120ms ease;
}
.skill-button:not(:disabled):hover { filter: brightness(1.15); }
.skill-icon { display: grid; place-items: center; width: 26px; height: 26px; }
.skill-icon svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 2px 0 #0008); }
.skill-name { display: -webkit-box; max-width: 100%; overflow: hidden; font-size: 10px; line-height: 1.1; text-align: center; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.skill-key { position: absolute; top: 3px; left: 4px; color: var(--faint); font: 700 10px/1 var(--mono); }
.skill-uses { position: absolute; top: 3px; right: 4px; color: var(--gold-light); font: 700 11px/1 var(--body); }
.skill-button.empty { color: var(--faint); }
.skill-button.empty .skill-icon { color: var(--faint); font: 700 20px/1 var(--display); border: 2px dashed #ffffff33; }
.skill-button.ready { border-color: var(--gold); animation: skill-ready 1.1s ease-in-out infinite alternate; }
@keyframes skill-ready { to { box-shadow: inset 0 2px 0 #fff3, inset 0 -3px 0 #0006, 0 3px 0 var(--ink), 0 0 0 2px #ffe08a66, 0 0 18px #f2b53aaa; } }
.skill-button.queued { transform: translateY(2px); box-shadow: inset 0 0 0 2px var(--gold-light), 0 0 20px #ffe08a; animation: none; }
.skill-button.spent { opacity: .38; filter: grayscale(1); animation: none; }
.skill-button:disabled:not(.spent) { opacity: .7; }
.launch-button { flex: none; align-self: center; min-height: 62px; min-width: 190px; padding-inline: 20px; font-size: 20px; color: #fff; background: linear-gradient(180deg, #f2675a, #c8382f 50%, #8f1f19); text-shadow: 0 2px 0 #4a0c09; }
.launch-button.nudge:not(:disabled) { animation-name: nudge-red; }
@keyframes nudge-red { 50% { box-shadow: inset 0 3px 0 #fff7, inset 0 -4px 0 #00000040, 0 4px 0 var(--ink), 0 0 0 4px #ff9a8c88, 0 0 26px #ff4b3eaa; } }
.field-note { color: var(--muted); font-size: 13px; }

/* Run panels */

.run-panels { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.panel { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 12px 14px 14px; }
.panel h2 { font: 700 17px/1.1 var(--display); text-shadow: 0 2px 0 var(--ink); }
.panel-hint { color: var(--muted); font-size: 13px; }
.trait-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.trait { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; padding: 5px 8px 5px 5px; background: #1a121999; border: 2px solid var(--ink); opacity: .72; cursor: help; }
.trait.active { opacity: 1; background: color-mix(in srgb, var(--unit, var(--gold)) 16%, #1a1219); box-shadow: inset 3px 0 0 var(--unit, var(--gold)); }
.trait.max { box-shadow: inset 3px 0 0 var(--gold-light), 0 0 0 1px var(--gold), 0 0 12px #f2b53a55; }
.trait-copy { display: grid; min-width: 0; }
.trait-copy strong { overflow: hidden; font: 600 13px/1.15 var(--body); text-overflow: ellipsis; white-space: nowrap; }
.trait-copy small { color: var(--muted); font-size: 11px; }
.pips { display: flex; gap: 3px; }
.pips i { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 3px; color: var(--faint); font: 700 11px/1 var(--body); font-style: normal; background: #0f0a0e; border: 1px solid var(--ink); }
.pips i.on { color: var(--ink); background: var(--gold); box-shadow: inset 0 1px 0 #fff8; }
.doctrine-list { display: flex; flex-wrap: wrap; gap: 6px; }
.doctrine-badge { padding: 5px 9px; color: var(--ink); font: 600 13px/1.1 var(--body); background: linear-gradient(var(--parchment), var(--parchment-2)); border: 2px solid var(--ink); box-shadow: 0 2px 0 #0007; cursor: help; }
.run-log ol { display: grid; gap: 5px; }
.run-log li { position: relative; padding-left: 14px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.run-log li::before { content: ''; position: absolute; left: 0; top: .5em; width: 6px; height: 6px; background: var(--faint); }
.run-log li:first-child { color: var(--text); }
.run-log li:first-child::before { background: var(--gold); }

/* Footer */

.site-footer { display: grid; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 3px solid #0000004d; }
.footer-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.footer-brand { color: var(--faint); font: 700 16px/1 var(--display); letter-spacing: .14em; }
.footer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.languages { position: relative; z-index: 4; }
.languages summary { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 11px; color: var(--muted); font: 600 13px/1 var(--body); list-style: none; border: 2px solid var(--ink); background: var(--plum); cursor: pointer; }
.languages summary::-webkit-details-marker { display: none; }
.languages summary::after { content: '▴'; font-size: 11px; }
.languages summary:hover, .languages[open] summary { color: var(--text); background: var(--plum-2); }
.language-links { position: absolute; bottom: calc(100% + 6px); left: 0; display: grid; min-width: 180px; max-height: 320px; overflow-y: auto; padding: 5px; background: var(--plum); border: 3px solid var(--ink); box-shadow: var(--drop); }
.language-links a { display: block; padding: 6px 9px; color: var(--muted); font-size: 14px; }
.language-links a:hover, .language-links a[aria-current="page"] { color: var(--text); background: var(--plum-3); }
.language-links a:focus-visible { outline-offset: -2px; }
.text-button { min-height: 34px; padding: 5px 11px; color: var(--muted); font: 600 13px/1 var(--body); background: none; border: 2px solid transparent; }
.text-button:hover { color: var(--text); border-color: var(--ink); background: var(--plum); }
.fan-disclosure { max-width: 92ch; color: var(--faint); font-size: 12px; line-height: 1.5; }
.load-status { margin-top: 10px; color: var(--muted); font: 600 13px/1.3 var(--body); }

/* Dialogs */

.dialog {
  width: min(500px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 20px 20px 22px; color: var(--text);
  background: linear-gradient(180deg, var(--plum-2), var(--plum)); border: 3px solid var(--ink);
  box-shadow: 0 0 0 3px var(--brass), 0 0 0 6px var(--ink), 0 30px 90px #000c;
}
.dialog::backdrop { background: #070406a6; }
.dialog[open] { animation: dialog-in 260ms cubic-bezier(.2, .9, .3, 1.2); }
.dialog[open]::backdrop { animation: fade-in 200ms ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(.95); } }
@keyframes fade-in { from { opacity: 0; } }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.dialog h2 { font: 700 26px/1.08 var(--display); color: var(--gold-light); text-shadow: 0 3px 0 var(--ink); }
.dialog-copy { margin: 10px 0 16px; color: var(--muted); line-height: 1.5; }
.close-button { display: grid; flex: none; place-items: center; width: 34px; height: 34px; padding: 0 0 3px; color: var(--text); font: 700 22px/1 var(--display); background: var(--plum-3); border: 2px solid var(--ink); box-shadow: var(--bevel); }
.close-button:hover { background: var(--red); }
.guide-list { display: grid; gap: 9px; margin: 14px 0 18px; counter-reset: guide; }
.guide-list li { position: relative; padding: 8px 10px 9px 44px; color: var(--muted); font-size: 14px; line-height: 1.45; background: #1a121999; border: 2px solid var(--ink); counter-increment: guide; }
.guide-list li::before { content: counter(guide); position: absolute; left: 8px; top: 8px; display: grid; place-items: center; width: 26px; height: 26px; color: var(--ink); font: 700 15px/1 var(--body); background: var(--gold); box-shadow: inset 0 -2px 0 #0004; }
.guide-list strong { display: block; margin-bottom: 2px; color: var(--text); font: 600 15px/1.2 var(--body); }
.guide-ready { width: 100%; }
.reward-choices { display: grid; gap: 8px; }
.doctrine-option {
  display: grid; gap: 3px; width: 100%; padding: 11px 13px; color: var(--muted); font-size: 13px; line-height: 1.4; text-align: left;
  background: #1a1219; border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px #ffffff0a, 0 3px 0 #0007;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.doctrine-option strong { color: var(--gold-light); font: 600 16px/1.2 var(--display); }
.doctrine-option:hover, .doctrine-option:focus-visible { transform: translateY(-2px); background: #2a1f29; box-shadow: inset 0 0 0 2px var(--gold), 0 5px 0 #0007; }
.doctrine-option.with-art { grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 12px; }
.doctrine-option .portrait { background-color: color-mix(in srgb, var(--unit, var(--gold)) 22%, #0f0a0e); box-shadow: inset 0 0 0 2px var(--ink); }
.option-icon { display: grid; place-items: center; width: 64px; height: 64px; background: #0f0a0e; box-shadow: inset 0 0 0 2px var(--ink); }
.option-icon svg { width: 40px; height: 40px; }
.option-copy { display: grid; gap: 3px; }
.finish-score { margin: -4px 0 16px; color: var(--gold-light); font: 700 20px/1.3 var(--display); }
.finish-actions { display: grid; gap: 8px; }
.endless-button { color: #fff; background: linear-gradient(180deg, #b48cff, #7d5fd6 50%, #4f3596); text-shadow: 0 2px 0 #241448; }
.share-button { justify-self: center; }
.council-dialog { width: min(700px, calc(100% - 24px)); }
.council-news { display: grid; gap: 8px; margin: 12px 0 4px; padding: 10px 12px 12px; background: linear-gradient(180deg, #3a2614, #2a1a10); border: 2px solid var(--gold); box-shadow: 0 0 18px #f2b53a44; }
.council-news[hidden] { display: none; }
.council-news h3, .council-section h3 { color: var(--gold-light); font: 700 15px/1.2 var(--display); letter-spacing: .03em; }
.news-item { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 10px; }
.news-item .portrait, .news-item .option-icon { width: 48px; height: 48px; background-color: color-mix(in srgb, var(--unit, var(--gold)) 22%, #0f0a0e); box-shadow: inset 0 0 0 2px var(--ink); }
.news-item .option-icon svg { width: 30px; height: 30px; }
.choice-copy { display: grid; gap: 2px; min-width: 0; }
.choice-copy strong { color: var(--text); font: 600 14px/1.2 var(--body); }
.choice-copy small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.choice-copy small:empty { display: none; }
.choice-copy em { color: var(--gold-light); font-size: 12px; font-style: normal; }
.council-section { display: grid; gap: 6px; margin: 14px 0 4px; }
.council-section h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--text); }
.council-section h3 b { color: var(--gold-light); font: 700 14px/1 var(--body); }
.council-hint { color: var(--muted); font-size: 13px; line-height: 1.4; }
.council-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 6px; }
.council-grid.skill-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.council-choice {
  position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 7px; padding: 5px 8px 5px 5px;
  color: var(--muted); text-align: left; background: #1a1219; border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px #ffffff08, 0 3px 0 #0007;
  transition: transform 100ms ease, background 120ms ease;
}
.council-choice .portrait { background-color: color-mix(in srgb, var(--unit, var(--gold)) 18%, #0f0a0e); box-shadow: inset 0 0 0 2px var(--ink); }
.council-choice .skill-icon { width: 34px; height: 34px; justify-self: center; }
.council-choice .choice-copy strong { font-size: 13px; overflow-wrap: break-word; hyphens: auto; }
.council-choice:not(:disabled):hover { transform: translateY(-2px); background: #2a1f29; }
.council-choice[aria-pressed="true"] { background: color-mix(in srgb, var(--unit, var(--gold)) 22%, #1a1219); box-shadow: inset 0 0 0 2px var(--unit, var(--gold)), 0 3px 0 #0007; }
.council-choice[aria-pressed="true"]::after { content: '✓'; position: absolute; top: 2px; right: 3px; display: grid; place-items: center; width: 16px; height: 16px; color: var(--ink); font: 700 11px/1 var(--body); background: var(--unit, var(--gold)); }
.council-choice.locked { opacity: .5; filter: grayscale(.85); cursor: not-allowed; }
.council-choice.locked .choice-copy small { color: var(--gold-light); }
#council-confirm { margin-top: 14px; }

/* Effects */

.fx-layer { position: fixed; inset: 0; z-index: 70; overflow: hidden; pointer-events: none; }
.fx-particle { position: absolute; z-index: 30; width: 6px; height: 6px; background: var(--spark); box-shadow: 0 0 6px var(--spark); pointer-events: none; }
.fx-spark { position: absolute; z-index: 30; width: 12px; height: 12px; transform: translate(-50%, -50%) rotate(45deg); background: var(--spark); box-shadow: 0 0 10px var(--spark); }
.fx-number { position: absolute; z-index: 40; color: #fff; font: 700 15px/1 var(--body); white-space: nowrap; pointer-events: none; text-shadow: 0 2px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000; }
.fx-number.hurt { color: #ff9a8c; }
.fx-number.heal { color: #a6ff8a; }
.fx-number.big { color: var(--gold-light); font-size: 21px; }
.fx-shot { position: absolute; z-index: 35; width: 14px; height: 4px; background: linear-gradient(90deg, #fff0, #fff, var(--gold)); box-shadow: 0 0 8px var(--gold); pointer-events: none; }
.fx-shot.arc { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(#fff, #b48cff 55%, #7d5fd600 72%); box-shadow: 0 0 12px #7d5fd6; }
.fx-shot.bomb { width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(#fff3c2, #ff9a4a 60%, #b8421c); box-shadow: 0 0 10px #ff9a4a; }
.fx-shot.heal { width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(#fff, #a6ff8a 60%, #a6ff8a00 75%); box-shadow: 0 0 10px #7fd36a; }
.fx-zap { position: absolute; z-index: 34; height: 2px; transform-origin: 0 50%; background: linear-gradient(90deg, #d8c4ff, #fff, #7d5fd6); box-shadow: 0 0 8px #7d5fd6; pointer-events: none; }
.fx-ring { position: absolute; z-index: 5; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; }
.fx-ring.telegraph { border: 2px dashed #ff6b5a; background: radial-gradient(#ff3d2233, #ff3d2212 62%, transparent 72%); animation: telegraph 260ms ease-in-out infinite alternate; }
@keyframes telegraph { to { border-color: #ffd0c8; box-shadow: 0 0 18px #ff3d2288; } }
.fx-ring.slam { border: 3px solid #ffb38a; animation: slam 560ms ease-out forwards; }
@keyframes slam { 0% { opacity: 1; scale: .6; } 100% { opacity: 0; scale: 1.25; } }
.fx-flight { position: absolute; z-index: 60; display: grid; place-items: center; pointer-events: none; filter: drop-shadow(0 0 10px #ffe08a) drop-shadow(0 3px 0 #0008); }
.fx-chip { position: absolute; left: 50%; top: -12px; z-index: 5; padding: 3px 6px; font: 700 13px/1 var(--body); white-space: nowrap; pointer-events: none; border: 2px solid var(--ink); }
.fx-chip.gain { color: #0f2410; background: #a6ff8a; }
.fx-chip.spend { color: var(--gold-light); background: #3a2412; }
.fx-chip.loss { color: #2a0b0a; background: #ff9a8c; }

/* Feedback pops (fx.pop adds and removes these classes) */

.reel.landed .portrait { animation: reel-land 260ms cubic-bezier(.3, 1.6, .5, 1); }
@keyframes reel-land { 0% { transform: translateY(-14%) scale(1.06, .9); } 60% { transform: translateY(4%) scale(.96, 1.05); } }
.reel.line-hit { animation: line-hit 420ms ease-out; }
.reel.line-hit .portrait { animation: line-pop 380ms cubic-bezier(.3, 1.6, .5, 1); }
@keyframes line-hit { 25% { filter: brightness(1.5); } }
@keyframes line-pop { 40% { transform: scale(1.22) rotate(-4deg); } }
.miss { animation: miss 280ms ease-out; }
@keyframes miss { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
.reels-frame.surge { animation: surge 760ms ease-out; }
@keyframes surge { 20% { box-shadow: 0 0 0 3px var(--gold-light), 0 0 0 6px var(--ink), 0 0 50px #ffd35acc, inset 0 0 40px #ffd35a66; } }
.lock { animation: lock 220ms cubic-bezier(.3, 1.6, .5, 1); }
.unlock { animation: lock 180ms ease-out reverse; }
@keyframes lock { 0% { transform: scale(.9); } }
.deny { animation: deny 300ms ease-out; }
@keyframes deny { 20% { transform: translateX(-5px); filter: drop-shadow(0 0 6px #ff3d22); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } }
.press { animation: press 170ms ease-out; }
@keyframes press { 40% { transform: translateY(3px) scale(.98); } }
.arrive { animation: arrive 380ms cubic-bezier(.3, 1.7, .5, 1); }
@keyframes arrive { 0% { transform: scale(1.3); filter: brightness(1.8); } }
.merge { animation: merge 460ms cubic-bezier(.3, 1.6, .5, 1); }
.merge-max { animation: merge 600ms cubic-bezier(.3, 1.6, .5, 1); filter: drop-shadow(0 0 14px #ffe08a); }
@keyframes merge { 0% { transform: scale(.7); filter: brightness(2.2); } 50% { transform: scale(1.2); } }
.hud-gain { animation: hud-gain 380ms ease-out; }
.hud-hurt { animation: hud-hurt 420ms ease-out; }
@keyframes hud-gain { 40% { box-shadow: inset 0 0 0 2px #a6ff8a, 0 0 16px #a6ff8a66; } }
@keyframes hud-hurt { 20% { transform: translateX(-3px); box-shadow: inset 0 0 0 2px #ff9a8c; } 40% { transform: translateX(3px); } 60% { transform: translateX(-2px); } }

/* Scripts with tall glyphs */

:lang(th) body, :lang(th) .reel-note, :lang(th) .panel-hint { line-height: 1.6; }
:lang(th) h1, :lang(th) .dialog h2, :lang(th) .cabinet-heading h2 { line-height: 1.3; }
:lang(zh-Hant) .kicker, :lang(ko) .kicker, :lang(th) .kicker { letter-spacing: .06em; }

/* Layout breakpoints */

@media (max-width: 1080px) {
  .war-table { grid-template-columns: 310px minmax(0, 1fr); }
  .run-panels { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .run-panels .traits { grid-column: 1 / -1; }
  .launch-button { min-width: 150px; font-size: 17px; }
}
@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; }
  .war-table { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'hud' 'field' 'cabinet'; }
  .machine, .spin-button, .reel-note, .unit-key, .council-button, .cabinet-heading { width: 100%; max-width: 430px; justify-self: center; }
  .route-wrap { order: 3; flex-basis: 100%; }
}
@media (max-width: 620px) {
  .page { padding: 0 10px 24px; }
  .site-bar { padding: 8px 10px; }
  .brand-word { font-size: 19px; }
  .quiet-button { padding: 5px 8px; }
  .quiet-button > span:last-child:not(.assist-icon):not(.sound-icon) { position: absolute; overflow: hidden; width: 1px; height: 1px; clip-path: inset(50%); }
  .intro { padding: 12px 0 10px; }
  .subhead { font-size: 13px; }
  .hud { gap: 8px; padding: 7px; }
  .hud-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); flex: 1 1 100%; }
  .stat { justify-content: center; gap: 5px; padding: 4px 5px; }
  .stat dt span:last-child { position: absolute; overflow: hidden; width: 1px; height: 1px; clip-path: inset(50%); }
  .stat dd { font-size: 17px; }
  .stat dd small { font-size: 11px; }
  .route-wrap { order: 3; flex: 1 1 100%; justify-content: center; gap: 7px; }
  .route-label { font-size: 0; letter-spacing: 0; }
  .route-label b { margin-left: 0; font-size: 15px; }
  .route-node { width: 19px; height: 19px; margin-left: 4px; font-size: 10px; }
  .route-node::before { width: 3px; }
  .route-node.far { display: none; }
  .route-chapter { min-width: 18px; height: 18px; margin-left: 6px; padding: 0 3px; font-size: 10px; }
  .route-chapter + .route-node { margin-left: 4px; }
  .route-node.current, .route-node.boss { width: 23px; height: 23px; }
  .hud-tools { margin-left: auto; }
  .battlefield { padding: 6px; gap: 8px; }
  .arena { padding: 4px; }
  .arena::before, .arena::after { display: none; }
  .map-plate { max-width: 46%; }
  .wave-caption { max-width: 52%; }
  .deploy-bar { flex-direction: column; }
  .launch-button { align-self: stretch; width: 100%; min-height: 50px; }
  .skill-bar { width: 100%; }
  .skill-button { flex: 1 1 0; width: auto; min-width: 0; }
  .council-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .council-grid.skill-grid { grid-template-columns: minmax(0, 1fr); }
  .cabinet { padding: 26px 10px 12px; }
  .machine { max-width: 330px; }
  .unit-key { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .run-panels { grid-template-columns: minmax(0, 1fr); }
  .trait-list { grid-template-columns: minmax(0, 1fr); }
  .dialog { padding: 16px 14px 18px; }
  .dialog h2 { font-size: 22px; }
}
@container (max-width: 520px) {
  .wave-caption .enemy-count { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .arena-banner.show { animation: none; opacity: 1; }
  .arena-stage { will-change: auto; }
}
