:root {
  color-scheme: dark;
  --ink: #eef4f8;
  --muted: #a9b6c2;
  --surface: #17212c;
  --surface-2: #202d3a;
  --line: #344556;
  --board-light: #c7b48d;
  --board-dark: #8c7655;
  --board-cell-size: 84px;
  --board-border-size: 6px;
  --board-total-size: 516px;
  --pawn-size: 72px;
  --a: #45a7e8;
  --a-soft: #7bc7f5;
  --a-dark: #17618f;
  --b: #ef8b42;
  --b-dark: #984719;
  --collector: #16191e;
  --accent: #f3cc63;
  --danger: #ef6a68;
  --success: #67d69a;
  --shadow: 0 22px 60px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, rgba(69, 167, 232, .12), transparent 32rem),
    radial-gradient(circle at 90% 0%, rgba(239, 139, 66, .11), transparent 34rem),
    #0d141c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button { font: inherit; }

button:focus-visible,
.cell:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.hidden { display: none !important; }

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 38px) 40px;
}

body.pre-game,
body.campaign-finale-open { overflow: hidden; }
body.pre-game .app-shell,
body.campaign-finale-open .app-shell {
  filter: blur(9px) saturate(.62) brightness(.68);
  transform: scale(1.012);
  pointer-events: none;
  user-select: none;
}

.start-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: auto;
  background: rgba(5, 10, 15, .48);
}

.start-card {
  width: min(900px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: clamp(16px, 2.5vw, 26px);
  border: 1px solid rgba(243, 204, 99, .6);
  border-radius: 20px;
  background: linear-gradient(155deg, rgba(28, 40, 52, .98), rgba(12, 20, 29, .985));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .72), inset 0 0 45px rgba(243, 204, 99, .035);
}

.collector-introduction {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 0 auto 14px;
  color: var(--muted);
  text-align: left;
}

.collector-introduction h2 { margin: 0 0 3px; color: var(--accent); font-size: 1.25rem; }
.collector-introduction p:last-child { margin: 0; font-size: .86rem; }
.start-collector-portrait {
  position: relative;
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: var(--collector);
  color: var(--accent);
  font-size: 1.7rem;
  font-weight: 1000;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .42);
}

.start-heading { margin-bottom: 14px; text-align: center; }
.start-heading h1 { font-size: clamp(1.55rem, 4vw, 2.35rem); }
.start-heading > p:last-child { margin: 5px 0 0; color: var(--muted); }
.start-team { display: grid; gap: 7px; }
.start-team-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.start-team-heading span { color: var(--muted); font-size: .65rem; font-weight: 900; letter-spacing: .14em; }
.start-team-heading h3 { margin: 0; font-size: .94rem; letter-spacing: .06em; text-transform: uppercase; }
.computer-team .start-team-heading h3 { color: var(--b); }
.player-team .start-team-heading h3 { color: var(--a); }

.start-roster {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 96px));
  justify-content: center;
  gap: clamp(4px, 1vw, 9px);
}

.start-pawn-card {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: white;
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: 1000;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .32), 0 5px 13px rgba(0, 0, 0, .25);
}

.computer-team .start-pawn-card { border-color: rgba(239, 139, 66, .72); }
.player-team .start-pawn-card { border-color: rgba(69, 167, 232, .75); }
.start-pawn-card .intro-image,
.start-collector-portrait .intro-image {
  display: none;
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}
.start-pawn-card.has-portrait .intro-image,
.start-collector-portrait.has-portrait .intro-image { display: block; }
.start-pawn-card.has-portrait .intro-fallback,
.start-collector-portrait.has-portrait .intro-fallback { display: none; }
.intro-fallback { position: relative; z-index: 0; }
.intro-number {
  position: absolute;
  z-index: 3;
  top: 4px;
  left: 4px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: rgba(10, 15, 21, .86);
  font-size: .78rem;
  line-height: 1;
  text-shadow: 0 1px 2px black;
}
.intro-role {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 14px 3px 4px;
  overflow: hidden;
  background: linear-gradient(transparent, rgba(5, 9, 13, .92));
  font-size: clamp(.52rem, 1.2vw, .68rem);
  font-weight: 850;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px black;
  white-space: nowrap;
}
.intro-rank {
  position: absolute;
  z-index: 3;
  top: 4px;
  right: 4px;
  padding: 3px 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #17140c;
  font-size: .62rem;
  line-height: 1;
}

.start-action { display: grid; place-items: center; padding: 13px 0; }
.start-game-button {
  min-width: min(300px, 80vw);
  padding: 13px 30px;
  border: 1px solid #ffe49b;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8d66f, #d9a92f);
  color: #17140c;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 1000;
  box-shadow: 0 8px 24px rgba(217, 169, 47, .3);
}
.start-game-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.start-game-button:active { transform: translateY(1px); }

.campaign-finale-overlay {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 12%, rgba(243, 204, 99, .15), transparent 32rem),
    rgba(4, 8, 13, .78);
}

.campaign-finale-card {
  width: min(1040px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: clamp(17px, 2.7vw, 30px);
  border: 1px solid rgba(243, 204, 99, .72);
  border-radius: 22px;
  background:
    linear-gradient(155deg, rgba(29, 42, 55, .985), rgba(10, 17, 25, .99));
  box-shadow: 0 30px 100px rgba(0, 0, 0, .82), inset 0 0 70px rgba(243, 204, 99, .045);
  animation: finale-reveal .55s cubic-bezier(.2, .8, .25, 1) both;
}

.finale-collector-introduction {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
  text-align: left;
}

.finale-collector-introduction h2 { margin: 0; color: var(--accent); font-size: 1.15rem; }
.finale-collector-introduction .eyebrow { margin-bottom: 3px; }
.finale-heading { margin-bottom: 16px; }
.finale-heading h1 { color: #fff4d0; text-shadow: 0 0 28px rgba(243, 204, 99, .22); }
.finale-heading > p:last-child { max-width: 760px; margin: 7px auto 0; line-height: 1.5; }

.finale-scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.finale-scoreboard > div {
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(32, 45, 58, .7);
}

.finale-scoreboard span { color: var(--muted); font-size: .65rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.finale-scoreboard strong { font-size: 1.75rem; line-height: 1; }
.finale-scoreboard .player-total strong { color: var(--a-soft); }
.finale-scoreboard .tie-total strong { color: var(--accent); }
.finale-scoreboard .computer-total strong { color: var(--b); }

.finale-report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(250px, .8fr);
  gap: 13px;
}

.finale-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17, 27, 37, .78);
}

.finale-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.finale-section-heading .eyebrow { margin: 0; }
.finale-section-heading h2 { margin: 0; color: var(--ink); font-size: 1.05rem; }

.finale-match-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.finale-match-result {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #35495b;
  border-left: 3px solid var(--muted);
  border-radius: 9px;
  background: rgba(32, 45, 58, .72);
}

.finale-match-result.win { border-left-color: var(--a-soft); }
.finale-match-result.loss { border-left-color: var(--danger); }
.finale-match-result.tie { border-left-color: var(--accent); }
.finale-match-number { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #101923; color: var(--ink); font-size: .72rem; font-weight: 1000; }
.finale-match-result div { min-width: 0; }
.finale-match-result strong,
.finale-match-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finale-match-result strong { font-size: .73rem; }
.finale-match-result small { margin-top: 2px; color: var(--muted); font-size: .59rem; }
.finale-result-badge { padding: 4px 6px; border-radius: 999px; background: #111a23; font-size: .58rem; font-style: normal; font-weight: 1000; letter-spacing: .05em; }
.finale-match-result.win .finale-result-badge { color: var(--a-soft); }
.finale-match-result.loss .finale-result-badge { color: #ffaaa8; }
.finale-match-result.tie .finale-result-badge { color: var(--accent); }

.finale-souls-list { display: grid; gap: 8px; margin-top: 12px; }
.finale-no-souls { margin: 0; padding: 22px 12px; border: 1px dashed #415669; border-radius: 10px; color: var(--muted); font-size: .82rem; line-height: 1.45; text-align: center; }

.finale-soul-card {
  position: relative;
  min-height: 58px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  overflow: hidden;
  padding: 6px 9px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(32, 45, 58, .78);
}

.finale-soul-card.player-soul { border-color: rgba(69, 167, 232, .58); }
.finale-soul-card.computer-soul { border-color: rgba(239, 139, 66, .58); }
.finale-soul-portrait {
  display: none;
  position: absolute;
  z-index: 1;
  top: 6px;
  left: 6px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
}
.finale-soul-card.has-portrait .finale-soul-portrait { display: block; }
.finale-soul-number { position: relative; z-index: 2; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 8px; background: var(--collector); color: white; font-size: 1.15rem; font-weight: 1000; text-shadow: 0 1px 3px black; }
.finale-soul-card.has-portrait .finale-soul-number { align-self: end; justify-self: end; width: 18px; height: 18px; border: 1px solid white; border-radius: 50%; background: rgba(9, 14, 20, .94); font-size: .62rem; }
.finale-soul-card div { min-width: 0; }
.finale-soul-card strong,
.finale-soul-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finale-soul-card strong { font-size: .86rem; }
.finale-soul-card small { margin-top: 2px; color: var(--muted); font-size: .65rem; }
.finale-action { padding-bottom: 0; }

@keyframes finale-reveal {
  from { opacity: 0; transform: translateY(18px) scale(.975); }
  to { opacity: 1; transform: none; }
}

.topbar,
.campaign-strip,
.game-layout,
.player-banner,
.turn-card,
.log-heading,
.rules-header,
.final-score {
  display: flex;
  align-items: center;
}

.topbar { justify-content: space-between; gap: 20px; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.04em; }
h2 { margin-bottom: 8px; font-size: 1.45rem; }
h3 { color: var(--accent); }

.eyebrow,
.panel-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .15em;
}

.header-actions { display: flex; gap: 10px; }

.quiet-button,
.primary-button,
.action-choice {
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.quiet-button {
  padding: 9px 13px;
  background: rgba(32, 45, 58, .78);
}

.quiet-button.danger { color: #ffaaa8; }
.quiet-button:hover, .action-choice:hover { border-color: #70869b; transform: translateY(-1px); }

.primary-button {
  padding: 13px 18px;
  border-color: #e6c35c;
  background: linear-gradient(180deg, #f5d575, #cba23a);
  color: #1c1b16;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(243, 204, 99, .18);
}

.primary-button:hover { transform: translateY(-2px); }
.primary-button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.full { width: 100%; }

.campaign-strip {
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(14px, 5vw, 64px);
  margin: 22px 0;
  padding: 13px clamp(16px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(23, 33, 44, .72);
  box-shadow: var(--shadow);
}

.campaign-strip div { display: grid; gap: 2px; text-align: center; }
.campaign-strip span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.campaign-strip strong { font-size: 1.05rem; }
.campaign-strip .match-progress { gap: 1px; }
.match-progress em { color: var(--accent); font-size: .68rem; font-style: normal; font-weight: 800; letter-spacing: .04em; }

.campaign-strip .location-summary {
  min-width: 130px;
  align-content: center;
}

.location-summary strong { color: var(--accent); }

.campaign-strip .souls-summary {
  min-width: 205px;
  align-content: center;
}

.souls-list {
  min-height: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.souls-list em {
  color: var(--muted);
  font-size: .86rem;
  font-style: normal;
  font-weight: 650;
}

.campaign-strip .soul-token {
  position: relative;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .78);
  border-radius: 50%;
  color: white;
  font-size: .76rem;
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 1;
}

.soul-token.a { background: var(--a-dark); }
.soul-token.b { background: var(--b-dark); }

.soul-portrait {
  display: none;
  position: absolute;
  z-index: 1;
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.soul-token.has-portrait .soul-portrait { display: block; }

.soul-number {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  line-height: 1;
  text-shadow: 0 1px 2px black;
}

.soul-token.has-portrait .soul-number {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 15px;
  height: 15px;
  border: 1px solid white;
  border-radius: 50%;
  background: rgba(15, 21, 29, .94);
  font-size: .62rem;
}

.game-layout { align-items: flex-start; justify-content: center; gap: clamp(18px, 3vw, 42px); }

.board-panel {
  width: max-content;
  max-width: none;
  flex: 0 0 auto;
  padding-block: clamp(12px, 2vw, 22px);
  padding-left: clamp(48px, 4vw, 56px);
  padding-right: clamp(136px, 11vw, 148px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(23, 33, 44, .92);
  box-shadow: var(--shadow);
}

.player-banner {
  justify-content: space-between;
  padding: 8px 12px;
  color: var(--muted);
}

.player-banner div { display: flex; align-items: center; gap: 10px; }
.player-banner span { font-weight: 900; letter-spacing: .08em; }
.player-banner strong { min-width: 38px; color: var(--ink); font-size: 1.45rem; }
.player-a-banner span { color: var(--a); }
.player-b-banner span { color: var(--b); }

.player-a-banner {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto auto;
  gap: 12px;
}

.player-a-banner .interrogating-summary {
  min-width: 148px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px;
}

.player-a-banner .interrogating-summary > span {
  color: var(--muted);
  font-size: .62rem;
  letter-spacing: .1em;
}

.player-a-banner .interrogating-list {
  min-width: 34px;
  min-height: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: var(--ink);
  font-size: .72rem;
}

.interrogating-list em {
  color: var(--muted);
  font-size: .7rem;
  font-style: normal;
  font-weight: 650;
}

.interrogation-token {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .82);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--b), var(--b-dark));
  color: white;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .4);
}

.player-a-banner .interrogation-token {
  color: white;
  letter-spacing: 0;
}

.interrogation-portrait {
  display: none;
  position: absolute;
  z-index: 1;
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

.interrogation-token.has-portrait .interrogation-portrait { display: block; }

.interrogation-number {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  font-size: .7rem;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 1px 2px black;
}

.interrogation-token.has-portrait .interrogation-number {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 15px;
  height: 15px;
  border: 1px solid white;
  border-radius: 50%;
  background: rgba(15, 21, 29, .92);
  font-size: .52rem;
}

.player-b-banner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
}

.player-banner .exit-zone {
  min-width: 150px;
  display: grid;
  place-items: center;
  gap: 3px;
}

.player-banner .exit-zone > span {
  color: #71808d;
  font-size: .62rem;
  letter-spacing: .14em;
}

.exit-button {
  padding: 6px 12px;
  border: 1px solid #e6c35c;
  border-radius: 999px;
  background: linear-gradient(180deg, #f5d575, #cba23a);
  color: #1c1b16;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 950;
  box-shadow: 0 0 0 0 rgba(243, 204, 99, .22);
  animation: exit-ready 1s ease-in-out infinite alternate;
}

@keyframes exit-ready {
  to { box-shadow: 0 0 0 7px rgba(243, 204, 99, .2); transform: translateY(-1px); }
}

.player-banner .movement-hint {
  max-width: min(430px, 45vw);
  padding: 5px 9px;
  border: 1px solid rgba(243, 204, 99, .48);
  border-radius: 8px;
  background: rgba(243, 204, 99, .1);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.3;
}

.board-stage {
  position: relative;
  width: var(--board-total-size);
  height: var(--board-total-size);
  margin-inline: auto;
}

.xp-meter {
  position: absolute;
  z-index: 6;
  width: 32px;
  height: 226px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 4px;
  color: var(--ink);
  text-align: center;
  pointer-events: none;
}

.xp-computer {
  top: 0;
  right: calc(100% + 10px);
  --xp-color: var(--b);
  --xp-glow: rgba(239, 139, 66, .55);
}

.xp-player {
  bottom: 0;
  left: calc(100% + 10px);
  --xp-color: var(--a);
  --xp-glow: rgba(69, 167, 232, .55);
}

.xp-total {
  color: var(--xp-color);
  font-size: .72rem;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 0 8px var(--xp-glow);
}

.xp-label {
  color: var(--xp-color);
  font-size: .64rem;
  font-weight: 1000;
  letter-spacing: .1em;
  line-height: 1;
}

.xp-track {
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(20, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(9, 15, 21, .88);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, .65), 0 4px 12px rgba(0, 0, 0, .28);
}

.xp-segment {
  position: relative;
  min-height: 2px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 2px;
  background: rgba(255, 255, 255, .045);
}

.xp-segment::before {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  height: var(--xp-fill, 0%);
  background: linear-gradient(180deg, rgba(255, 255, 255, .82), var(--xp-color) 38%, var(--xp-color));
  box-shadow: 0 0 7px var(--xp-glow);
}

.xp-computer .xp-segment::before { top: 0; }
.xp-player .xp-segment::before { bottom: 0; }

.attack-meter {
  position: absolute;
  z-index: 6;
  width: 80px;
  height: 226px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 4px;
  color: var(--ink);
  text-align: center;
}

.attack-player {
  bottom: 0;
  left: calc(100% + 50px);
  --attack-color: var(--a);
  --attack-glow: rgba(69, 167, 232, .55);
}

.attack-computer {
  top: 0;
  right: calc(100% + 50px);
  display: none;
  --attack-color: var(--b);
  --attack-glow: rgba(239, 139, 66, .55);
}

.attack-title,
.attack-label {
  color: var(--attack-color);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 0 8px var(--attack-glow);
}

.attack-title { font-size: .72rem; }

.attack-label {
  font-size: .64rem;
  letter-spacing: .06em;
}

.attack-track {
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(20, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(9, 15, 21, .88);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, .65), 0 4px 12px rgba(0, 0, 0, .28);
}

.attack-segment {
  grid-row: span 2;
  min-height: 0;
  padding: 0 2px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 3px;
  background: rgba(255, 255, 255, .035);
  color: rgba(213, 222, 229, .38);
  font: inherit;
  font-size: .58rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  opacity: .72;
}

.attack-segment.ready {
  border-color: color-mix(in srgb, var(--attack-color) 76%, white);
  background: linear-gradient(180deg, color-mix(in srgb, var(--attack-color) 65%, white), var(--attack-color));
  color: #ffaaa8;
  opacity: 1;
  box-shadow: 0 0 8px var(--attack-glow);
}

.attack-segment.usable {
  color: #61ff8b;
  cursor: pointer;
  text-shadow: 0 0 5px rgba(54, 255, 112, .72);
  box-shadow: 0 0 9px var(--attack-glow), inset 0 0 0 1px rgba(97, 255, 139, .7);
}

.attack-segment.usable:hover { filter: brightness(1.12); }
.attack-segment.usable:focus-visible { outline: 2px solid #61ff8b; outline-offset: 1px; }
.attack-segment:disabled { cursor: default; }

.floating-collector {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: clamp(32px, 5vw, 48px);
  aspect-ratio: 1;
  margin: 0;
  border: 3px solid var(--accent);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--collector);
  color: var(--accent);
  font-weight: 1000;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
  transform: translate(-50%, -50%);
  overflow: hidden;
  pointer-events: none;
}

.collector-portrait {
  display: none;
  position: absolute;
  z-index: 1;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

.has-portrait > .collector-portrait { display: block; }
.has-portrait > .collector-fallback { display: none; }
.collector-fallback { position: relative; z-index: 2; }
.floating-collector .collector-portrait { inset: 0; width: 100%; height: 100%; border-radius: 50%; }

.floating-collector.preparing { animation: collector-ready-pulse .75s ease-in-out infinite alternate; }

.board {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(6, var(--board-cell-size));
  grid-template-rows: repeat(6, var(--board-cell-size));
  overflow: visible;
  border: var(--board-border-size) solid #55472f;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px #d4c39d, 0 12px 28px rgba(0, 0, 0, .35);
}

.board::before,
.board::after {
  content: "";
  position: absolute;
  z-index: 15;
  right: 2px;
  left: 2px;
  height: 3px;
  border-radius: 999px;
  pointer-events: none;
}

.board::before {
  top: 1px;
  background: color-mix(in srgb, var(--a) 82%, white);
  box-shadow: 0 0 7px rgba(69, 167, 232, .38);
}

.board::after {
  bottom: 1px;
  background: color-mix(in srgb, var(--b) 82%, white);
  box-shadow: 0 0 7px rgba(239, 139, 66, .38);
}

.board.has-background-image {
  background-image: var(--board-background-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.cell {
  position: relative;
  width: var(--board-cell-size);
  height: var(--board-cell-size);
  display: grid;
  place-items: center;
  min-width: 0;
  border: 0;
  padding: 5px;
  background: var(--board-light);
  cursor: default;
}

.cell.dark { background: var(--board-dark); }
.board.has-background-image .cell {
  background: color-mix(in srgb, var(--board-light) 58%, transparent);
}
.board.has-background-image .cell.dark {
  background: color-mix(in srgb, var(--board-dark) 64%, transparent);
}
.cell.selectable { cursor: pointer; }
.cell.selectable::after,
.cell.destination::after {
  content: "";
  position: absolute;
  inset: 9%;
  border: 3px solid var(--a-soft);
  border-radius: 14px;
  box-shadow: inset 0 0 20px rgba(69, 167, 232, .24), 0 0 8px rgba(69, 167, 232, .18);
}

.cell.destination { cursor: pointer; }
.cell.destination::after { inset: 28%; border-radius: 50%; background: rgba(123, 199, 245, .42); }
.cell.selected::after { border-color: white; box-shadow: 0 0 0 3px rgba(255, 255, 255, .3); }
.cell.last-move { box-shadow: inset 0 0 0 4px rgba(103, 214, 154, .6); }
.cell.ai-origin::before,
.cell.ai-target::before {
  content: "COMPUTER";
  position: absolute;
  z-index: 3;
  inset: 7%;
  display: grid;
  place-items: start center;
  border: 4px solid rgba(239, 139, 66, .92);
  border-radius: 14px;
  color: #251207;
  background: rgba(239, 139, 66, .20);
  font-size: clamp(.55rem, 1vw, .72rem);
  font-weight: 1000;
  letter-spacing: .08em;
  animation: ai-preview-pulse .8s ease-in-out infinite alternate;
  pointer-events: none;
}

.cell.collector-path::before,
.cell.collector-target::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 13%;
  border: 4px dashed rgba(243, 204, 99, .85);
  border-radius: 14px;
  background: rgba(22, 25, 30, .22);
  animation: collector-route-pulse .8s ease-in-out infinite alternate;
  pointer-events: none;
}

.cell.collector-target::before {
  content: "COLLECTOR";
  inset: 6%;
  display: grid;
  place-items: start center;
  border-style: solid;
  background: rgba(243, 204, 99, .28);
  color: #332709;
  font-size: clamp(.42rem, .8vw, .65rem);
  font-weight: 1000;
  letter-spacing: .04em;
}

.cell.ai-target::before {
  border-color: var(--accent);
  background: rgba(243, 204, 99, .28);
  color: #332709;
}

.pawn {
  position: relative;
  z-index: 1;
  width: var(--pawn-size);
  height: var(--pawn-size);
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .88);
  border-radius: 50%;
  color: white;
  font-size: 2rem;
  font-weight: 1000;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .4);
  box-shadow: 0 5px 12px rgba(0, 0, 0, .34), inset 0 -8px 18px rgba(0, 0, 0, .2);
}

.pawn.collector-lives-3 { border-color: rgba(255, 255, 255, .92); }
.pawn.collector-lives-2 { border-color: #ffe05d; }
.pawn.collector-lives-1 { border-color: #ff5d5a; }

.pawn.collector-lives-2::after,
.pawn.collector-lives-1::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -3px;
  border: 2px solid currentColor;
  border-radius: 50%;
  pointer-events: none;
}

.pawn.collector-lives-2::after {
  color: #ffe05d;
  animation: collector-life-yellow-pulse 1.25s ease-in-out infinite alternate;
}

.pawn.collector-lives-1::after {
  color: #ff5d5a;
  animation: collector-life-red-pulse .85s ease-in-out infinite alternate;
}

@keyframes collector-life-yellow-pulse {
  from { opacity: .48; box-shadow: 0 0 2px rgba(255, 224, 93, .28); }
  to { opacity: 1; box-shadow: 0 0 11px rgba(255, 224, 93, .92); }
}

@keyframes collector-life-red-pulse {
  from { opacity: .5; box-shadow: 0 0 3px rgba(255, 93, 90, .35); }
  to { opacity: 1; box-shadow: 0 0 14px rgba(255, 93, 90, 1); }
}

.pawn-portrait {
  display: none;
  position: absolute;
  z-index: 1;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

.pawn.has-portrait .pawn-portrait { display: block; }

.pawn-number {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
}

.pawn.has-portrait .pawn-number {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: 50%;
  background: rgba(15, 21, 29, .9);
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  text-shadow: 0 1px 2px black;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}

.pawn.a {
  background: var(--player-pawn-bg, linear-gradient(145deg, var(--a), var(--a-dark)));
  color: var(--player-pawn-text, white);
}
.pawn.b { background: linear-gradient(145deg, var(--b), var(--b-dark)); }
.pawn.collector { border-radius: 18%; background: var(--collector); color: var(--accent); transform: rotate(45deg); overflow: hidden; }
.pawn.collector .collector-fallback { transform: rotate(-45deg); }
.pawn.collector .collector-portrait {
  inset: -22%;
  width: 144%;
  height: 144%;
  transform: rotate(-45deg);
}
.pawn.collector.collector-traveling {
  animation: collector-travel .85s cubic-bezier(.2, .72, .25, 1) both;
}
.pawn.traveling {
  animation: pawn-travel .68s cubic-bezier(.2, .72, .25, 1) both;
}

.board[data-effects="full"] .cell.selected .pawn {
  animation: selected-pawn-pulse .75s ease-in-out infinite alternate;
}

.board[data-effects="full"] .pawn.role-2.traveling { animation-name: infiltrator-travel; }
.board[data-effects="full"] .pawn.role-6.traveling { animation-name: titan-travel; animation-duration: .78s; }
.board[data-effects="full"] .pawn.travel-capture { filter: drop-shadow(0 0 10px rgba(239, 106, 104, .85)); }
.board[data-effects="full"] .pawn.travel-breakup { animation-name: brute-travel; animation-duration: .84s; }
.board[data-effects="full"] .pawn.commanded-travel { box-shadow: 0 0 0 5px rgba(243, 204, 99, .28), 0 0 24px rgba(243, 204, 99, .9); }

.effect-ghost {
  position: absolute;
  z-index: 12;
  top: var(--effect-top);
  left: var(--effect-left);
  margin: calc(var(--pawn-size) / -2) 0 0 calc(var(--pawn-size) / -2);
  pointer-events: none;
}

.capture-victim { animation: capture-victim .92s ease-in both; }
.mutual-attacker { animation: mutual-attacker .96s cubic-bezier(.2, .7, .2, 1) both; }
.mutual-defender { animation: mutual-defender .96s ease-in both; }
.collector-victim { animation: collector-victim 1.02s cubic-bezier(.25, .65, .4, 1) both; }
.exit-ghost { animation: pawn-exit .9s ease-in both; }
.champion-sacrifice { animation: champion-sacrifice .86s ease-out both; }

.board-effect-burst {
  position: absolute;
  z-index: 16;
  top: var(--effect-top);
  left: var(--effect-left);
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.board-effect-burst::before {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  margin: -14px;
  border: 5px solid white;
  border-radius: 50%;
  animation: impact-ring .72s ease-out both;
}

.board-effect-burst i {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 8px currentColor;
  animation: effect-particle .82s ease-out var(--particle-delay) both;
}

.burst-capture, .burst-capture i { color: #ff745f; }
.burst-capture::before { border-color: #ff745f; }
.burst-mutual, .burst-mutual i { color: #fff5c2; }
.burst-mutual::before { border-color: #fff; box-shadow: 0 0 28px white; }
.burst-collector, .burst-collector i { color: #9f75da; }
.burst-collector::before { border-color: #3a214d; box-shadow: 0 0 25px #8d5cc1; }
.burst-exit, .burst-exit i { color: #67d69a; }
.burst-exit::before { border-color: #67d69a; }
.burst-champion, .burst-champion i { color: #f3cc63; }
.burst-champion::before { border-color: #ffe898; box-shadow: 0 0 24px #f3cc63; }
.burst-breakup, .burst-breakup i { color: #ef8b42; }
.burst-breakup::before { border-color: #ef8b42; border-width: 7px; }

.board-effect-line {
  position: absolute;
  z-index: 14;
  top: var(--line-top);
  left: var(--line-left);
  width: var(--line-length);
  height: 5px;
  border-radius: 999px;
  transform-origin: 0 50%;
  transform: rotate(var(--line-angle)) scaleX(0);
  pointer-events: none;
  animation: effect-line .76s ease-in-out both;
}

.line-command { background: #f3cc63; box-shadow: 0 0 11px #f3cc63, 0 0 22px rgba(243, 204, 99, .65); }
.line-ranger { background: #70d8ff; box-shadow: 0 0 11px #70d8ff, 0 0 20px rgba(112, 216, 255, .6); }
.line-champion { background: #fff0a6; box-shadow: 0 0 13px #f3cc63, 0 0 24px rgba(243, 204, 99, .8); }

.board-floating-score {
  position: absolute;
  z-index: 18;
  top: var(--effect-top);
  left: var(--effect-left);
  color: #d9ffe8;
  font-size: 1.5rem;
  font-weight: 1000;
  text-shadow: 0 2px 5px #07180e, 0 0 12px #67d69a;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: floating-score .92s ease-out both;
}

.pawn.collector-threatened { animation: collector-threat .68s ease-in-out infinite; }
.pawn.scatter-arrival { animation: scatter-arrival .85s cubic-bezier(.2, .75, .28, 1.2) both; }

.setting-note { margin: 9px 0 0; color: #8595a3; font-size: .7rem; line-height: 1.4; }

@keyframes pawn-travel {
  0% {
    opacity: .55;
    transform: translate(var(--travel-x), var(--travel-y)) scale(.9) rotate(-2deg);
    filter: brightness(.9);
  }
  65% { transform: translate(0, -8px) scale(1.06) rotate(1deg); filter: brightness(1.12); }
  82% { transform: translate(0, 3px) scale(.97); }
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    filter: brightness(1);
  }
}

@keyframes infiltrator-travel {
  0% { opacity: .18; transform: translate(var(--travel-x), var(--travel-y)) scale(.82); filter: blur(5px) brightness(1.35); box-shadow: 25px 0 0 -10px rgba(69, 167, 232, .25); }
  45% { opacity: .72; filter: blur(2px) brightness(1.2); box-shadow: 14px 0 0 -8px rgba(69, 167, 232, .4); }
  78% { transform: translate(0, -5px) scale(1.05); }
  100% { opacity: 1; transform: translate(0, 0) scale(1); filter: none; box-shadow: 0 5px 12px rgba(0, 0, 0, .34); }
}

@keyframes titan-travel {
  0% { opacity: .7; transform: translate(var(--travel-x), var(--travel-y)) scale(.94); }
  66% { transform: translate(0, -5px) scale(1.03); }
  79% { transform: translate(0, 5px) scale(1.08); filter: brightness(1.25); }
  90% { transform: translate(0, -2px) scale(.98); }
  100% { opacity: 1; transform: translate(0, 0) scale(1); filter: none; }
}

@keyframes brute-travel {
  0% { opacity: .65; transform: translate(var(--travel-x), var(--travel-y)) scale(.88) rotate(-4deg); }
  62% { transform: translate(0, -7px) scale(1.1) rotate(3deg); }
  78% { transform: translate(0, 5px) scale(1.12); filter: brightness(1.35); }
  100% { opacity: 1; transform: none; filter: none; }
}

@keyframes selected-pawn-pulse {
  from { transform: scale(.97); filter: brightness(1); }
  to { transform: scale(1.05); filter: brightness(1.18); box-shadow: 0 0 0 5px rgba(243, 204, 99, .22), 0 0 20px rgba(243, 204, 99, .45); }
}

@keyframes capture-victim {
  0%, 24% { transform: translateX(0) scale(1); opacity: 1; }
  8%, 20% { transform: translateX(-5px) rotate(-3deg); }
  14% { transform: translateX(6px) rotate(3deg); }
  48% { transform: scale(1.08); filter: saturate(.3) brightness(1.5); }
  100% { transform: scale(.08) rotate(170deg); opacity: 0; filter: grayscale(1) blur(6px); }
}

@keyframes mutual-attacker {
  0% { transform: translate(var(--travel-x), var(--travel-y)) scale(.9); opacity: .7; }
  38% { transform: translate(0, 0) scale(1.08); opacity: 1; filter: brightness(1.5); }
  62% { transform: translate(-5px, 2px) scale(1.13) rotate(-6deg); }
  100% { transform: scale(1.65) rotate(-24deg); opacity: 0; filter: brightness(3) blur(7px); }
}

@keyframes mutual-defender {
  0%, 38% { transform: scale(1); opacity: 1; }
  48% { transform: translate(6px, -2px) rotate(5deg) scale(1.12); filter: brightness(1.7); }
  100% { transform: scale(1.65) rotate(25deg); opacity: 0; filter: brightness(3) blur(7px); }
}

@keyframes collector-victim {
  0%, 22% { transform: translate(0) scale(1); opacity: 1; }
  8%, 18% { transform: translate(-5px, 2px) rotate(-4deg); }
  13% { transform: translate(6px, -2px) rotate(4deg); }
  45% { filter: grayscale(1) brightness(.7); box-shadow: 0 0 24px #6e4195; }
  100% { transform: scale(.03) rotate(540deg); opacity: 0; filter: grayscale(1) blur(8px) brightness(.2); }
}

@keyframes pawn-exit {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  35% { transform: translateY(-12px) scale(1.12); filter: brightness(1.5) drop-shadow(0 0 12px #67d69a); }
  100% { transform: translateY(-105px) scale(.65); opacity: 0; filter: brightness(2) blur(3px); }
}

@keyframes champion-sacrifice {
  0% { transform: scale(1); opacity: 1; filter: brightness(1); }
  42% { transform: scale(1.18) rotate(-8deg); filter: brightness(2.1) drop-shadow(0 0 18px #f3cc63); }
  100% { transform: scale(.05) rotate(180deg); opacity: 0; filter: brightness(3) blur(5px); }
}

@keyframes collector-threat {
  0%, 100% { transform: translateX(0); filter: grayscale(.25) brightness(.85); box-shadow: 0 0 0 0 rgba(70, 28, 84, .3); }
  25% { transform: translateX(-4px) rotate(-2deg); }
  50% { transform: translateX(4px) rotate(2deg); filter: grayscale(.75) brightness(.65); box-shadow: 0 0 0 8px rgba(70, 28, 84, .32); }
  75% { transform: translateX(-3px); }
}

@keyframes scatter-arrival {
  0% { transform: translate(var(--travel-x), var(--travel-y)) scale(.35) rotate(-160deg); opacity: .35; }
  72% { transform: translate(0, -4px) scale(1.08) rotate(8deg); opacity: 1; }
  100% { transform: none; }
}

@keyframes impact-ring {
  from { transform: scale(.2); opacity: 1; }
  to { transform: scale(4.2); opacity: 0; }
}

@keyframes effect-particle {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--particle-x), var(--particle-y)) scale(.15) rotate(180deg); opacity: 0; }
}

@keyframes effect-line {
  0% { transform: rotate(var(--line-angle)) scaleX(0); opacity: 0; }
  25%, 62% { transform: rotate(var(--line-angle)) scaleX(1); opacity: 1; }
  100% { transform: rotate(var(--line-angle)) scaleX(.15); opacity: 0; }
}

@keyframes floating-score {
  0% { transform: translate(-50%, -20%) scale(.7); opacity: 0; }
  22% { transform: translate(-50%, -80%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -210%) scale(.9); opacity: 0; }
}

@keyframes pawn-travel-reduced {
  from { transform: translate(var(--travel-x), var(--travel-y)); opacity: .6; }
  to { transform: translate(0, 0); opacity: 1; }
}

.board[data-effects="reduced"] .pawn.traveling,
.board[data-effects="off"] .pawn.traveling,
.board[data-effects="reduced"] .pawn.scatter-arrival,
.board[data-effects="off"] .pawn.scatter-arrival {
  animation: pawn-travel-reduced .36s ease-out both;
}

.board[data-effects="reduced"] .board-effect-burst i:nth-child(n+7) { display: none; }
.board[data-effects="reduced"] .board-effect-burst::before { animation-duration: .38s; }
.board[data-effects="reduced"] .board-effect-burst i { animation-duration: .42s; }
.board[data-effects="reduced"] .effect-ghost,
.board[data-effects="reduced"] .board-effect-line,
.board[data-effects="reduced"] .board-effect-burst,
.board[data-effects="reduced"] .board-floating-score { animation-duration: .48s; }
.board[data-effects="reduced"] .pawn.collector-threatened { animation: none; filter: grayscale(.6) brightness(.75); box-shadow: 0 0 0 6px rgba(70, 28, 84, .32); }

.board[data-effects="off"] .effect-ghost,
.board[data-effects="off"] .board-effect-line,
.board[data-effects="off"] .board-effect-burst,
.board[data-effects="off"] .board-floating-score { display: none; }
.board[data-effects="off"] .pawn.collector-threatened { animation: none; }

@keyframes ai-preview-pulse {
  from { opacity: .62; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes collector-ready-pulse {
  from { box-shadow: 0 8px 20px rgba(0, 0, 0, .45), 0 0 0 0 rgba(243, 204, 99, .15); }
  to { box-shadow: 0 8px 20px rgba(0, 0, 0, .45), 0 0 0 13px rgba(243, 204, 99, .28); }
}

@keyframes collector-route-pulse {
  from { opacity: .55; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes collector-travel {
  from {
    opacity: .55;
    transform: translate(var(--travel-x), var(--travel-y)) rotate(45deg) scale(.92);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) rotate(45deg) scale(1);
  }
}

.rank-badge,
.stack-badge {
  position: absolute;
  z-index: 3;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid white;
  border-radius: 999px;
  color: #111;
  font-size: .68rem;
  font-weight: 1000;
  text-shadow: none;
}

.rank-badge { top: -8px; right: -8px; background: var(--accent); }
.stack-badge { bottom: -8px; right: -8px; background: white; }

.legend {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 8px 15px;
  padding-top: 14px;
  color: var(--muted);
  font-size: .76rem;
}

.legend b { color: var(--ink); }
.legend .pawn-name { color: var(--muted); font-style: normal; font-weight: 850; }
.legend .status-active { color: var(--muted); }
.legend .status-captured { color: #ff9d48; }
.legend .status-collected { color: var(--danger); }
.legend .status-exited { color: var(--success); }
.legend .status-eliminated { color: #7f8b96; }

.status-color-key {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 13px;
  padding-top: 7px;
  color: #8897a5;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.status-color-key span { display: inline-flex; align-items: center; gap: 4px; }
.status-color-key i { width: 7px; height: 7px; border-radius: 50%; }
.status-color-key i.captured { background: #ff9d48; }
.status-color-key i.collected { background: var(--danger); }
.status-color-key i.exited { background: var(--success); }
.status-color-key i.eliminated { background: #7f8b96; }

.control-panel {
  width: min(390px, 32vw);
  display: grid;
  gap: 13px;
  position: sticky;
  top: 12px;
}

.turn-card,
.activation-panel,
.selection-card,
.match-result-panel,
.rules-panel,
.settings-panel,
.log-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(23, 33, 44, .94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}

.turn-card { display: block; }
.turn-card p:last-child, .activation-panel p:last-child, .selection-card p:last-child { margin-bottom: 0; color: var(--muted); line-height: 1.45; }

.match-result-panel {
  border-color: rgba(243, 204, 99, .7);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2), inset 0 0 30px rgba(243, 204, 99, .05);
}

.match-result-panel h2 { font-size: 1.65rem; }
.match-result-panel .final-score { margin: 16px 0; }
.match-result-panel .career-report { margin: 14px 0; }

.rules-panel {
  max-height: 68vh;
  overflow: auto;
}

.settings-panel h2 { margin-bottom: 0; font-size: 1.2rem; }
.setting-field { display: grid; gap: 6px; margin-top: 13px; color: var(--muted); font-size: .76rem; font-weight: 800; }
.setting-field select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
}

.board-theme-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 84px;
  height: 46px;
  margin: 12px auto 3px;
  overflow: hidden;
  border: 2px solid #667686;
  border-radius: 7px;
}

.board-theme-preview i:nth-child(1),
.board-theme-preview i:nth-child(4) { background: var(--preview-light, var(--board-light)); }
.board-theme-preview i:nth-child(2),
.board-theme-preview i:nth-child(3) { background: var(--preview-dark, var(--board-dark)); }
.color-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.color-settings input[type="color"] { width: 100%; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); cursor: pointer; }

.rules-panel .rules-columns { grid-template-columns: 1fr; }
.rules-panel .rules-columns section { padding: 11px; }
.rules-panel .rules-columns p,
.rules-panel .rules-columns li { font-size: .82rem; }

.dice-area { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.die {
  display: grid;
  place-items: center;
  min-height: 76px;
  border: 2px solid #697d90;
  border-radius: 14px;
  background: #f5f0e4;
  color: #17212c;
  font-size: 2.2rem;
  font-weight: 1000;
  box-shadow: inset 0 -6px 14px rgba(0, 0, 0, .12);
}

.primary-actions { display: grid; }
.selection-actions { display: grid; gap: 8px; margin-top: 12px; }

.action-choice {
  width: 100%;
  padding: 11px 12px;
  background: var(--surface-2);
  text-align: left;
}

.action-choice strong { display: block; }
.action-choice small { display: block; margin-top: 3px; color: var(--muted); }

.log-panel { min-height: 180px; max-height: 310px; overflow: hidden; }
.log-heading { justify-content: space-between; font-weight: 800; }
.log-heading button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
#battle-log { max-height: 236px; overflow: auto; margin: 12px 0 0; padding-left: 22px; color: var(--muted); font-size: .82rem; line-height: 1.45; }
#battle-log li { margin-bottom: 7px; padding-left: 3px; }
#battle-log li:first-child { color: var(--ink); }

.result-reason { color: var(--accent) !important; font-weight: 700; }
.final-score { justify-content: center; gap: 45px; margin: 20px 0; }
.final-score div { display: grid; }
.final-score span { color: var(--muted); }
.final-score strong { font-size: 2rem; }
.career-report { margin: 18px 0; padding: 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); text-align: left; font-size: .86rem; line-height: 1.5; }

.rules-header { justify-content: space-between; align-items: flex-start; }
.rules-columns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 30px; }
.rules-columns section { padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.rules-columns p, .rules-columns li { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.rules-columns ul { padding-left: 20px; }

@media (max-width: 900px) {
  .finale-report-grid { grid-template-columns: 1fr; }
  .finale-souls-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-layout { flex-direction: column; align-items: stretch; }
  .board-panel { width: max-content; max-width: none; align-self: center; }
  .control-panel { width: 100%; }
  .control-panel { position: static; grid-template-columns: repeat(2, 1fr); }
  .turn-card, .dice-area, .primary-actions, .activation-panel, .selection-card, .match-result-panel, .rules-panel, .settings-panel { grid-column: span 1; }
  .log-panel { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .start-overlay { padding: 6px; }
  .start-card { width: calc(100vw - 12px); max-height: calc(100vh - 12px); padding: 12px; border-radius: 14px; }
  .campaign-finale-overlay { padding: 6px; }
  .campaign-finale-card { width: calc(100vw - 12px); max-height: calc(100vh - 12px); padding: 12px; border-radius: 14px; }
  .finale-collector-introduction { gap: 10px; }
  .finale-scoreboard { gap: 5px; }
  .finale-scoreboard > div { padding: 8px 4px; }
  .finale-scoreboard span { font-size: .52rem; text-align: center; }
  .finale-scoreboard strong { font-size: 1.4rem; }
  .finale-match-list,
  .finale-souls-list { grid-template-columns: 1fr; }
  .finale-section-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .collector-introduction { gap: 10px; margin-bottom: 10px; }
  .start-collector-portrait { flex-basis: 58px; width: 58px; height: 58px; }
  .collector-introduction p:last-child { font-size: .72rem; }
  .start-heading { margin-bottom: 10px; }
  .start-heading > p:last-child { font-size: .78rem; }
  .start-roster { gap: 4px; }
  .intro-number { top: 2px; left: 2px; width: 20px; height: 20px; font-size: .63rem; }
  .intro-rank { top: 2px; right: 2px; padding: 2px 3px; font-size: .5rem; }
  .start-action { padding: 10px 0; }
  .app-shell { padding-inline: 9px; }
  .topbar { align-items: flex-start; }
  .header-actions { flex-direction: column; }
  .campaign-strip { gap: 10px; justify-content: space-between; }
  .campaign-strip strong { font-size: .85rem; }
  .board-panel { padding: 8px 132px 8px 46px; }
  .cell { padding: 2px; }
  .player-banner small { display: none; }
  .player-b-banner { grid-template-columns: 1fr auto; }
  .player-a-banner { grid-template-columns: auto 1fr; }
  .player-a-banner .interrogating-summary { justify-self: end; }
  .player-banner .exit-zone { min-width: 120px; }
  .control-panel { grid-template-columns: 1fr; }
  .turn-card, .dice-area, .primary-actions, .activation-panel, .selection-card, .match-result-panel, .rules-panel, .settings-panel, .log-panel { grid-column: 1; }
  .rules-columns { grid-template-columns: 1fr; }
  .legend { flex-wrap: wrap; gap: 6px 10px; }
  .player-banner .movement-hint { max-width: 62vw; }
}
