:root {
  --background: #f3efe4;
  --foreground: #151716;
  --ink: #151716;
  --paper: #fffaf0;
  --muted: #626a64;
  --line: #c8bdad;
  --board: #16894f;
  --board-dark: #05502e;
  --board-line: #074127;
  --board-light: #27b968;
  --board-cell: #179b58;
  --board-cell-hover: #1aa760;
  --board-cell-border: rgb(45 190 115 / 28%);
  --board-frame: #05070d;
  --stage-bg:
    linear-gradient(145deg, rgb(255 252 246 / 96%), rgb(229 235 226 / 92%));
  --panel-bg: rgb(255 250 240 / 90%);
  --setup-bg:
    repeating-linear-gradient(
      90deg,
      rgb(72 41 23 / 18%) 0 1px,
      transparent 1px 34px
    ),
    linear-gradient(116deg, rgb(45 24 13 / 92%) 0%, rgb(96 58 34 / 78%) 36%, rgb(244 238 225 / 94%) 100%);
  --wood: #6a3f26;
  --wood-dark: #2e170d;
  --wood-gold: #b9823d;
  --gold: #c69234;
  --red: #a34235;
  --blue: #315f7c;
  --shadow: 0 26px 70px rgb(23 19 12 / 22%);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  background:
    radial-gradient(circle at 28% 13%, rgb(255 255 255 / 78%), transparent 24%),
    radial-gradient(circle at 76% 12%, rgb(49 95 124 / 12%), transparent 28%),
    linear-gradient(135deg, rgb(255 250 240 / 88%), rgb(221 232 218 / 74%)),
    radial-gradient(circle at 14% 16%, rgb(198 146 52 / 22%), transparent 34%),
    #f3efe4;
}

body {
  min-height: 100vh;
  margin: 0;
  background: transparent;
  color: var(--foreground);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body[data-table="arcade"] {
  --board: #087c72;
  --board-dark: #053c50;
  --board-line: #041b25;
  --board-light: #22d2b6;
  --board-cell: #119f8f;
  --board-cell-hover: #17bca7;
  --board-cell-border: rgb(78 238 215 / 34%);
  --board-frame: #020712;
  --red: #b83a65;
  --blue: #2a74b8;
  --stage-bg:
    linear-gradient(145deg, rgb(242 255 250 / 95%), rgb(218 228 236 / 92%));
  --setup-bg:
    radial-gradient(circle at 18% 20%, rgb(34 210 182 / 32%), transparent 26%),
    linear-gradient(126deg, #111423 0%, #172940 48%, #eef8f3 100%);
}

body[data-table="boardroom"] {
  --board: #1c8b55;
  --board-dark: #103c2b;
  --board-line: #0d2419;
  --board-light: #35b977;
  --board-cell: #1b955d;
  --board-cell-hover: #24a96b;
  --board-cell-border: rgb(86 176 111 / 30%);
  --board-frame: #16100d;
  --red: #9a4532;
  --blue: #315f7c;
  --stage-bg:
    linear-gradient(145deg, rgb(255 249 238 / 96%), rgb(235 224 204 / 92%));
  --setup-bg:
    repeating-linear-gradient(
      90deg,
      rgb(255 235 194 / 8%) 0 1px,
      transparent 1px 28px
    ),
    linear-gradient(118deg, #2a160d 0%, #734423 47%, #f5ecdd 100%);
}

body[data-table="midnight"] {
  --background: #111719;
  --foreground: #eef4eb;
  --ink: #17201c;
  --muted: #657068;
  --line: #8d9b91;
  --board: #0e6a58;
  --board-dark: #092d31;
  --board-line: #071719;
  --board-light: #2fae96;
  --board-cell: #117762;
  --board-cell-hover: #159179;
  --board-cell-border: rgb(88 211 184 / 28%);
  --board-frame: #05070d;
  --red: #b85a46;
  --blue: #3a6f83;
  --stage-bg:
    linear-gradient(145deg, rgb(238 244 235 / 95%), rgb(218 228 223 / 90%));
  --setup-bg:
    radial-gradient(circle at 22% 22%, rgb(47 174 150 / 24%), transparent 26%),
    linear-gradient(124deg, #06080d 0%, #14242b 54%, #e7efe8 100%);
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid rgb(49 95 124 / 80%);
  outline-offset: 3px;
}

body[data-intro="open"],
body[data-setup="open"],
body[data-loading="open"] {
  overflow: hidden;
}

.intro-screen {
  position: fixed;
  inset: 0;
  display: grid;
  z-index: 20;
  place-items: center;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      90deg,
      rgb(72 41 23 / 18%) 0 1px,
      transparent 1px 34px
    ),
    linear-gradient(116deg, #2d180d 0%, #684024 38%, #f4eee1 100%),
    #f3efe4;
  opacity: 1;
  padding: 28px;
  transition:
    opacity 320ms ease,
    visibility 320ms ease;
}

.intro-screen[hidden] {
  display: none;
}

.intro-screen[data-state="closed"] {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.intro-screen::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(0 0 0 / 58%), rgb(0 0 0 / 20%) 48%, transparent 78%),
    linear-gradient(180deg, rgb(255 250 240 / 16%), transparent 44%, rgb(0 0 0 / 22%));
  content: "";
  pointer-events: none;
}

.intro-screen::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 66%, rgb(255 250 240 / 42%) 100%),
    repeating-linear-gradient(
      0deg,
      rgb(255 255 255 / 5%) 0 1px,
      transparent 1px 18px
    );
  content: "";
  mix-blend-mode: screen;
  opacity: 0.52;
  pointer-events: none;
}

.intro-screen__table {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 520px) minmax(340px, 420px);
  gap: 28px;
  align-items: center;
  width: min(1020px, 100%);
  z-index: 1;
}

.intro-board {
  position: relative;
  justify-self: center;
  width: min(100%, 520px, 72vh);
  aspect-ratio: 1;
  border: 10px solid #05070d;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 12%), transparent 28%),
    repeating-linear-gradient(
      90deg,
      transparent 0 calc(12.5% - 4px),
      #07130f calc(12.5% - 4px) 12.5%
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0 calc(12.5% - 4px),
      #07130f calc(12.5% - 4px) 12.5%
    ),
    linear-gradient(145deg, #1fad66, #12834c);
  box-shadow:
    inset 0 0 0 3px rgb(255 255 255 / 7%),
    0 12px 0 rgb(0 0 0 / 28%),
    0 34px 58px rgb(0 0 0 / 40%);
  animation: intro-board-arrive 760ms cubic-bezier(0.16, 0.84, 0.24, 1) both;
}

.intro-board::before {
  position: absolute;
  inset: 1.5%;
  border: 2px solid rgb(255 255 255 / 10%);
  border-radius: 3px;
  content: "";
  pointer-events: none;
}

.intro-board::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 42%, rgb(255 255 255 / 14%) 50%, transparent 58%),
    repeating-linear-gradient(
      45deg,
      transparent 0 24px,
      rgb(255 255 255 / 4%) 24px 26px
    );
  border-radius: 2px;
  content: "";
  opacity: 0.76;
  pointer-events: none;
}

.intro-copy {
  display: grid;
  width: min(420px, 100%);
  gap: 18px;
  color: #fffaf0;
  text-shadow: 0 2px 16px rgb(0 0 0 / 34%);
}

.intro-eyebrow {
  margin: 0;
  color: #ffe0a0;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.intro-copy h2 {
  margin: 0;
  color: #fffaf0;
  font-size: 88px;
  font-weight: 900;
  line-height: 0.92;
  text-shadow: 0 5px 24px rgb(0 0 0 / 52%);
}

.intro-tagline {
  max-width: 420px;
  margin: -4px 0 0;
  color: rgb(255 250 240 / 86%);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.intro-actions {
  display: grid;
  width: min(420px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.intro-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgb(255 250 240 / 58%);
  border-radius: 8px;
  background: rgb(255 250 240 / 92%);
  color: #171513;
  cursor: pointer;
  font-weight: 900;
  padding: 0 18px;
  box-shadow: 0 12px 28px rgb(0 0 0 / 22%);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.intro-button:hover {
  transform: translateY(-2px);
  border-color: #ffe0a0;
  background: #fffaf0;
}

.intro-button--primary {
  background: #a34235;
  border-color: #a34235;
  color: #fffaf0;
}

.intro-button--primary:hover {
  background: #b84c3e;
}

.intro-button__chip {
  width: 20px;
  aspect-ratio: 1;
  border: 2px solid #f3eadc;
  border-radius: 50%;
  background: linear-gradient(145deg, #fffdf8, #d8d0c3);
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 22%),
    inset 0 2px 0 rgb(255 255 255 / 52%);
  animation: intro-button-chip 1.6s ease-in-out infinite;
}

.intro-chip,
.intro-dot {
  --x: 0;
  --y: 0;
  --delay: 0ms;
  position: absolute;
  left: calc((var(--x) * 12.5%) + 1.35%);
  top: calc((var(--y) * 12.5%) + 1.35%);
  z-index: 2;
}

.intro-chip {
  width: 9.8%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: drop-shadow(0 5px 3px rgb(0 0 0 / 36%));
  perspective: 640px;
  transform: translateY(-22px) scale(0.92);
  animation: intro-chip-drop 760ms cubic-bezier(0.16, 0.84, 0.24, 1.16) both;
  animation-delay: var(--delay);
}

.intro-chip__body {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-style: preserve-3d;
}

.intro-chip__face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  backface-visibility: hidden;
  box-shadow:
    inset 0 2px 0 rgb(255 255 255 / 18%),
    inset 0 -3px 0 rgb(0 0 0 / 16%);
}

.intro-chip__face::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 32% 24%, rgb(255 255 255 / 35%) 0 16%, transparent 17%);
  content: "";
}

.intro-chip__face--black {
  border: 2px solid #050606;
  background: linear-gradient(145deg, #303233, #050606);
}

.intro-chip__face--white {
  border: 2px solid #d5ccbe;
  background: linear-gradient(145deg, #fffdf8, #d8d0c3);
  transform: rotateY(180deg);
}

.intro-chip--black .intro-chip__body {
  transform: rotateY(0deg);
}

.intro-chip--white .intro-chip__body {
  transform: rotateY(180deg);
}

.intro-chip--flipping .intro-chip__body {
  animation: intro-chip-flip 2.2s ease-in-out 900ms infinite;
}

.intro-chip--a {
  --x: 3;
  --y: 3;
  --delay: 220ms;
}

.intro-chip--b {
  --x: 4;
  --y: 3;
  --delay: 320ms;
}

.intro-chip--c {
  --x: 3;
  --y: 4;
  --delay: 420ms;
}

.intro-chip--d {
  --x: 4;
  --y: 4;
  --delay: 520ms;
}

.intro-chip--e {
  --x: 5;
  --y: 4;
  --delay: 680ms;
}

.intro-dot {
  width: 3.6%;
  aspect-ratio: 1;
  border: 1px solid rgb(255 238 185 / 72%);
  border-radius: 50%;
  background: rgb(255 231 142 / 78%);
  box-shadow:
    0 0 0 4px rgb(198 146 52 / 20%),
    0 0 16px rgb(255 224 160 / 42%);
  opacity: 0;
  transform: translate(87%, 87%) scale(0.8);
  animation: intro-dot-pulse 1.8s ease-in-out 1.05s infinite;
}

.intro-dot--a {
  --x: 2;
  --y: 3;
}

.intro-dot--b {
  --x: 5;
  --y: 2;
  animation-delay: 1.22s;
}

.intro-dot--c {
  --x: 4;
  --y: 5;
  animation-delay: 1.38s;
}

@media (max-width: 1180px), (max-height: 760px) {
  .intro-screen {
    padding: 22px;
  }

  .intro-screen__table {
    width: min(720px, 100%);
    grid-template-columns: 1fr;
    gap: 16px;
    justify-items: center;
  }

  .intro-board {
    width: min(100%, 420px, 46vh);
  }

  .intro-copy {
    justify-items: center;
    text-align: center;
  }

  .intro-copy h2 {
    font-size: 72px;
  }
}

.setup-screen,
.loading-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 26px;
}

.setup-screen {
  z-index: 22;
  background: var(--setup-bg);
}

.setup-screen[hidden],
.loading-screen[hidden] {
  display: none;
}

.setup-panel {
  display: grid;
  width: min(920px, 100%);
  gap: 20px;
  border: 1px solid rgb(255 232 169 / 36%);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgb(255 250 240 / 97%), rgb(239 246 236 / 94%));
  box-shadow: 0 34px 90px rgb(0 0 0 / 32%);
  padding: 24px;
  animation: setup-arrive 360ms cubic-bezier(0.16, 0.84, 0.24, 1) both;
}

.setup-heading {
  display: grid;
  gap: 6px;
}

.setup-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 42px;
  font-weight: 950;
  line-height: 1;
}

.setup-heading p:not(.intro-eyebrow) {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.setup-section {
  display: grid;
  gap: 10px;
}

.choice-grid {
  display: grid;
  gap: 10px;
}

.choice-grid--tables,
.choice-grid--opponents {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice-card {
  display: grid;
  min-height: 122px;
  min-width: 0;
  gap: 8px;
  align-content: start;
  border: 1px solid rgb(200 189 173 / 84%);
  border-radius: 8px;
  background: rgb(255 253 246 / 84%);
  color: var(--ink);
  cursor: pointer;
  padding: 13px;
  text-align: left;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.choice-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: 0 14px 28px rgb(23 19 12 / 12%);
}

.choice-card.active {
  border-color: var(--board-dark);
  background:
    linear-gradient(145deg, rgb(255 255 255 / 80%), rgb(223 241 229 / 88%));
  box-shadow:
    inset 0 0 0 2px rgb(22 96 68 / 18%),
    0 14px 32px rgb(22 96 68 / 12%);
}

.choice-card strong,
.choice-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.choice-card strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.1;
}

.choice-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.28;
}

.choice-swatch {
  display: block;
  width: 100%;
  height: 28px;
  border: 2px solid #05070d;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%);
}

.choice-swatch--classic {
  background:
    linear-gradient(90deg, #05070d 0 12%, transparent 12% 88%, #05070d 88%),
    linear-gradient(145deg, #1fad66, #12834c);
}

.choice-swatch--arcade {
  background:
    linear-gradient(90deg, #020712 0 12%, transparent 12% 88%, #020712 88%),
    linear-gradient(145deg, #22d2b6, #087c72);
}

.choice-swatch--boardroom {
  background:
    linear-gradient(90deg, #16100d 0 12%, transparent 12% 88%, #16100d 88%),
    linear-gradient(145deg, #2fb773, #6a3f26);
}

.choice-swatch--midnight {
  background:
    linear-gradient(90deg, #05070d 0 12%, transparent 12% 88%, #05070d 88%),
    linear-gradient(145deg, #2fae96, #092d31);
}

.setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.loading-screen {
  z-index: 30;
  background:
    radial-gradient(circle at 50% 42%, rgb(255 250 240 / 22%), transparent 28%),
    rgb(8 12 12 / 72%);
}

.loading-card {
  display: grid;
  width: min(360px, 100%);
  gap: 14px;
  justify-items: center;
  border: 1px solid rgb(255 232 169 / 42%);
  border-radius: 8px;
  background: rgb(255 250 240 / 96%);
  box-shadow: 0 28px 72px rgb(0 0 0 / 34%);
  padding: 22px;
}

.loading-card strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
}

.loading-board {
  display: grid;
  width: 92px;
  aspect-ratio: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  border: 5px solid #05070d;
  border-radius: 8px;
  background: #07130f;
  padding: 7px;
  transform: rotate(-4deg);
}

.loading-board span {
  border-radius: 50%;
  background: linear-gradient(145deg, #fffdf8, #d8d0c3);
  box-shadow: 0 4px 5px rgb(0 0 0 / 26%);
  animation: loading-flip 920ms ease-in-out infinite;
}

.loading-board span:nth-child(2),
.loading-board span:nth-child(3) {
  background: linear-gradient(145deg, #303233, #050606);
  animation-delay: 180ms;
}

.loading-bar {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(200 189 173 / 52%);
}

.loading-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--board-dark), var(--gold));
  animation: loading-bar 760ms ease-in-out infinite;
}

.othello-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.game-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 16px;
  align-items: end;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: 50px;
  font-weight: 900;
  line-height: 1;
}

.turn-panel {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 6px solid var(--ink);
  border-radius: 8px;
  background: rgb(255 250 240 / 86%);
  box-shadow: 0 12px 28px rgb(36 31 22 / 10%);
  padding: 12px 14px;
}

.turn-panel[data-player="white"] {
  border-left-color: #f8f1df;
}

.turn-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.turn-panel strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(300px, 760px) minmax(278px, 360px);
  gap: 18px;
  align-items: start;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.board-stage {
  position: relative;
  display: grid;
  min-width: 0;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgb(12 20 25 / 16%);
  border-radius: 8px;
  background: var(--stage-bg);
  box-shadow: 0 18px 42px rgb(23 19 12 / 14%);
  padding: 12px;
  perspective: none;
}

.board-stage::before {
  display: none;
}

.board-stage::after {
  display: none;
}

.move-callout {
  position: absolute;
  top: 26px;
  left: 50%;
  display: grid;
  min-width: min(78%, 360px);
  max-width: calc(100% - 44px);
  gap: 3px;
  z-index: 4;
  border: 1px solid rgb(255 232 169 / 58%);
  border-radius: 8px;
  background: rgb(255 250 240 / 94%);
  box-shadow: 0 18px 38px rgb(23 19 12 / 20%);
  padding: 11px 14px;
  text-align: center;
  transform: translateX(-50%);
  animation: callout-pop 1700ms ease both;
  pointer-events: none;
}

.move-callout[hidden] {
  display: none;
}

.move-callout strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.1;
}

.move-callout span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.crowd-burst {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 30;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgb(255 244 188 / 34%), rgb(163 66 53 / 16%) 28%, transparent 56%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.crowd-burst[data-state="active"] {
  opacity: 1;
}

.crowd-burst::before {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 50% 50%, rgb(255 255 255 / 78%) 0 7%, rgb(255 224 160 / 46%) 8% 22%, transparent 48%),
    conic-gradient(from 12deg, transparent, rgb(255 224 160 / 26%), transparent, rgb(39 185 104 / 18%), transparent);
  content: "";
  opacity: 0;
  transform: scale(0.18) rotate(0deg);
}

.crowd-burst[data-state="active"]::before {
  animation: crowd-flash 780ms ease-out both;
}

.crowd-burst__ring {
  position: absolute;
  width: min(56%, 360px);
  aspect-ratio: 1;
  border: 7px solid rgb(255 232 169 / 92%);
  border-radius: 50%;
  box-shadow:
    0 0 54px rgb(255 232 169 / 72%),
    inset 0 0 42px rgb(255 255 255 / 46%);
  animation: crowd-ring 850ms ease-out both;
}

.crowd-burst__message {
  display: grid;
  min-width: min(84%, 460px);
  gap: 3px;
  border: 2px solid rgb(255 232 169 / 86%);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(163 66 53 / 94%), rgb(198 146 52 / 94%));
  color: #fffaf0;
  box-shadow:
    0 0 0 8px rgb(255 250 240 / 18%),
    0 28px 72px rgb(23 19 12 / 42%);
  padding: 18px 20px;
  text-align: center;
  text-shadow: 0 2px 10px rgb(0 0 0 / 28%);
  animation: crowd-message 1050ms cubic-bezier(0.16, 0.84, 0.24, 1) both;
}

.crowd-burst__message strong {
  font-size: 36px;
  font-weight: 950;
  line-height: 1;
}

.crowd-burst__message span {
  font-size: 15px;
  font-weight: 900;
}

.crowd-burst__particle {
  --angle: 0deg;
  --distance: 160px;
  --size: 8px;
  --color: #ffe0a0;
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--size);
  aspect-ratio: 1;
  border-radius: 2px 999px 999px 2px;
  background: var(--color);
  box-shadow:
    0 0 24px var(--color),
    0 0 2px rgb(255 255 255 / 70%);
  animation: crowd-particle 980ms cubic-bezier(0.12, 0.72, 0.18, 1) both;
}

.board-wrap {
  position: relative;
  width: min(100%, 650px, calc(100svh - 180px));
  aspect-ratio: 1;
  z-index: 1;
  margin: 0;
  border: 8px solid var(--board-frame);
  border-radius: 6px;
  background: var(--board-frame);
  box-shadow:
    inset 0 0 0 2px rgb(255 255 255 / 8%),
    0 10px 0 rgb(0 0 0 / 22%),
    0 18px 24px rgb(0 0 0 / 18%);
  transform: none;
  transition:
    filter 180ms ease,
    transform 240ms ease;
}

.board-wrap::before,
.board-wrap::after {
  position: absolute;
  top: 11%;
  bottom: 11%;
  display: none;
  width: 15%;
  align-items: center;
  color: rgb(255 255 255 / 90%);
  content: "";
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 2px 5px rgb(0 0 0 / 58%);
  opacity: 0.48;
  transform: translateZ(-10px);
}

.board-wrap::before {
  left: -11%;
  justify-content: flex-start;
  border-radius: 999px 16px 16px 999px;
  background:
    radial-gradient(ellipse at 18% 44%, rgb(71 83 120 / 62%), transparent 48%),
    repeating-linear-gradient(
      0deg,
      rgb(255 255 255 / 92%) 0 6px,
      rgb(255 255 255 / 92%) 6px 9px,
      rgb(7 9 16 / 0%) 9px 14px
    ) 72% 50% / 34% 68% no-repeat,
    linear-gradient(90deg, #03050d, #12162d 56%, #02030a);
  box-shadow:
    inset 8px 0 16px rgb(99 112 163 / 24%),
    inset -10px 0 18px rgb(0 0 0 / 64%),
    0 20px 22px rgb(0 0 0 / 34%);
  padding-left: 16px;
}

.board-wrap::after {
  right: -11%;
  justify-content: flex-end;
  border-radius: 16px 999px 999px 16px;
  background:
    radial-gradient(ellipse at 86% 46%, rgb(71 83 120 / 62%), transparent 48%),
    repeating-linear-gradient(
      0deg,
      rgb(255 255 255 / 92%) 0 6px,
      rgb(255 255 255 / 92%) 6px 9px,
      rgb(7 9 16 / 0%) 9px 14px
    ) 28% 50% / 34% 68% no-repeat,
    linear-gradient(90deg, #02030a, #12162d 44%, #03050d);
  box-shadow:
    inset -8px 0 16px rgb(99 112 163 / 24%),
    inset 10px 0 18px rgb(0 0 0 / 64%),
    0 20px 22px rgb(0 0 0 / 34%);
  padding-right: 16px;
}

.board-wrap[data-busy="true"] {
  filter: saturate(0.92) brightness(0.98);
}

.board-wrap[data-moment="corner"],
.board-wrap[data-moment="big"],
.board-wrap[data-moment="pass"],
.board-wrap[data-moment="challenge"],
.board-wrap[data-moment="crowd"] {
  animation: board-moment 520ms ease;
}

.board-grid {
  display: grid;
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 4px;
  overflow: hidden;
  isolation: isolate;
  border: 4px solid var(--board-line);
  border-radius: 2px;
  background: var(--board-line);
  box-shadow:
    inset 0 0 0 1px rgb(34 176 105 / 18%);
  padding: 3px;
  transform: none;
}

.board-grid::before {
  display: none;
}

.board-grid::after {
  display: none;
}

.board-cell {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  border: 1px solid var(--board-cell-border);
  border-radius: 1px;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 8%), transparent 38%),
    var(--board-cell);
  box-shadow:
    inset 1px 1px 0 rgb(255 255 255 / 10%),
    inset -1px -1px 0 rgb(0 55 31 / 18%);
  cursor: pointer;
  transform: none;
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.board-cell::after {
  position: absolute;
  border-radius: 50%;
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: none;
}

.board-cell:disabled {
  cursor: default;
}

.board-cell[data-legal="true"]:not(:disabled) {
  background:
    radial-gradient(circle, rgb(255 238 156 / 46%) 0 13%, transparent 14%),
    linear-gradient(145deg, rgb(255 255 255 / 8%), transparent 38%),
    var(--board-cell);
}

.board-cell[data-legal="true"]:not(:disabled):hover {
  background:
    radial-gradient(circle, rgb(255 228 111 / 72%) 0 20%, transparent 21%),
    linear-gradient(145deg, rgb(255 255 255 / 10%), transparent 38%),
    var(--board-cell-hover);
  box-shadow:
    inset 1px 1px 0 rgb(255 255 255 / 14%),
    inset -1px -1px 0 rgb(0 55 31 / 20%),
    inset 0 0 0 3px rgb(255 235 169 / 44%);
  transform: none;
}

.board-cell[data-target="true"][data-legal="true"]:not(:disabled),
.board-cell[data-power-target="true"]:not(:disabled) {
  background:
    radial-gradient(circle, rgb(255 238 156 / 64%) 0 16%, transparent 17%),
    linear-gradient(145deg, var(--board-light), var(--board));
  box-shadow:
    inset 1px 1px 0 rgb(255 255 255 / 16%),
    inset -1px -1px 0 rgb(0 55 31 / 22%),
    inset 0 0 0 2px rgb(255 232 169 / 48%),
    0 0 22px rgb(255 232 169 / 34%);
}

.board-cell[data-power-target="true"]:not(:disabled) {
  animation: power-target-pulse 920ms ease-in-out infinite alternate;
}

.board-cell[data-power-target="true"]:not(:disabled)::before {
  position: absolute;
  inset: 9%;
  z-index: 3;
  border: 2px solid rgb(255 250 218 / 84%);
  border-radius: 50%;
  box-shadow:
    0 0 0 5px rgb(198 146 52 / 15%),
    0 0 24px rgb(255 232 169 / 42%);
  content: "";
  pointer-events: none;
}

.board-cell[data-last="true"]::after {
  inset: 11%;
  border: 2px solid rgb(255 232 169 / 82%);
  box-shadow:
    0 0 0 4px rgb(198 146 52 / 16%),
    inset 0 0 0 2px rgb(255 240 188 / 20%);
  animation: last-move-glow 1.45s ease-out;
}

.board-cell[data-changed="true"]::after {
  inset: 18%;
  border: 2px solid rgb(255 245 200 / 48%);
  box-shadow: none;
  animation: changed-cell-pulse 900ms ease-out;
}

.disc {
  --disc-tilt: rotateX(0deg);
  --disc-turn: 0deg;
  --disc-rise: 0px;
  --disc-light-x: 30%;
  --disc-light-y: 22%;
  position: relative;
  width: 78%;
  aspect-ratio: 1;
  z-index: 2;
  border-radius: 50%;
  filter: drop-shadow(0 3px 2px rgb(0 0 0 / 32%));
  perspective: 600px;
  transform: rotateZ(var(--disc-turn));
  transform-style: preserve-3d;
  transition:
    filter 180ms ease,
    transform 180ms ease;
}

.disc::before {
  display: none;
}

.disc__body {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 34%),
    inset 0 2px 0 rgb(255 255 255 / 12%),
    inset 0 -3px 0 rgb(0 0 0 / 18%);
  transform-style: preserve-3d;
  transition: transform 680ms cubic-bezier(0.2, 0.72, 0.18, 1);
}

.disc__body::before {
  display: none;
}

.disc__edge {
  display: none;
}

.disc__edge::after {
  display: none;
}

.disc__face {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: 50%;
  backface-visibility: hidden;
  box-shadow:
    inset 0 2px 0 rgb(255 255 255 / 16%),
    inset 0 -3px 0 rgb(0 0 0 / 14%);
  transform: translateZ(2px);
}

.disc__face::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 32% 24%, rgb(255 255 255 / 26%) 0 15%, transparent 16%);
  content: "";
  pointer-events: none;
}

.disc__face::after {
  position: absolute;
  inset: 9%;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 10%);
  content: "";
  pointer-events: none;
}

.disc__face--black {
  border: 2px solid #050606;
  background: linear-gradient(145deg, #303233 0%, #171819 46%, #050606 100%);
}

.disc__face--white {
  border: 2px solid #d5ccbe;
  background: linear-gradient(145deg, #fffdf8 0%, #f4efe5 52%, #d8d0c3 100%);
  transform: rotateY(180deg) translateZ(2px);
}

.disc__face--white::before {
  background: radial-gradient(circle at 32% 24%, rgb(255 255 255 / 56%) 0 15%, transparent 16%);
}

.disc[data-disc="black"] .disc__body {
  transform: rotateY(0deg);
}

.disc[data-disc="white"] .disc__body {
  transform: rotateY(180deg);
}

.disc[data-animating="true"] {
  animation: disc-lift 520ms cubic-bezier(0.2, 0.72, 0.18, 1);
}

.disc[data-new="true"] {
  animation: disc-drop 520ms cubic-bezier(0.16, 0.84, 0.24, 1.16);
}

.disc[data-animating="true"]::after {
  display: none;
}

.move-hint {
  position: relative;
  display: grid;
  width: 24%;
  min-width: 12px;
  z-index: 2;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgb(255 238 185 / 72%);
  border-radius: 50%;
  background: rgb(127 137 82 / 38%);
  color: #fff3c9;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    0 1px 0 rgb(0 0 0 / 20%),
    inset 0 0 0 1px rgb(255 245 209 / 22%);
  text-shadow: 0 1px 0 rgb(0 0 0 / 50%);
  transform: none;
}

@keyframes intro-board-arrive {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes intro-chip-drop {
  0% {
    opacity: 0;
    transform: translateY(-28px) scale(1.12);
  }

  56% {
    opacity: 1;
    transform: translateY(3px) scale(0.96);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes intro-chip-flip {
  0%,
  18% {
    transform: rotateY(0deg);
  }

  48%,
  64% {
    transform: rotateY(180deg);
  }

  94%,
  100% {
    transform: rotateY(360deg);
  }
}

@keyframes intro-dot-pulse {
  0%,
  100% {
    opacity: 0;
    transform: translate(87%, 87%) scale(0.68);
  }

  36%,
  58% {
    opacity: 1;
    transform: translate(87%, 87%) scale(1);
  }
}

@keyframes intro-button-chip {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-1px) scale(0.86);
  }
}

@keyframes disc-drop {
  0% {
    opacity: 0;
    transform: rotateZ(calc(var(--disc-turn) - 8deg)) scale(1.14);
  }

  56% {
    opacity: 1;
    transform: rotateZ(calc(var(--disc-turn) + 2deg)) scale(0.96);
  }

  76% {
    opacity: 1;
    transform: rotateZ(calc(var(--disc-turn) - 1deg)) scale(1.03);
  }

  100% {
    opacity: 1;
    transform: rotateZ(var(--disc-turn)) scale(1);
  }
}

@keyframes disc-lift {
  0% {
    transform: rotateZ(var(--disc-turn)) scale(1);
  }

  45% {
    transform: rotateZ(calc(var(--disc-turn) + 6deg)) scale(1.08);
  }

  100% {
    transform: rotateZ(var(--disc-turn)) scale(1);
  }
}

@keyframes lamp-breathe {
  0%,
  100% {
    opacity: 0.74;
    transform: translate3d(-1.5%, 0, 0) scale(1);
  }

  50% {
    opacity: 0.98;
    transform: translate3d(2%, 1%, 0) scale(1.05);
  }
}

@keyframes table-shadow-breathe {
  0%,
  100% {
    opacity: 0.88;
    transform: translate3d(-1%, 0, 0) scaleX(1);
  }

  50% {
    opacity: 1;
    transform: translate3d(1%, 2px, 0) scaleX(1.04);
  }
}

@keyframes felt-shimmer {
  0%,
  100% {
    opacity: 0.36;
    transform: translate3d(-12%, -2%, 0) rotate(0.001deg);
  }

  50% {
    opacity: 0.54;
    transform: translate3d(8%, 2%, 0) rotate(0.001deg);
  }
}

@keyframes last-move-glow {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }

  28% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.36);
  }
}

@keyframes changed-cell-pulse {
  0% {
    opacity: 0;
    transform: scale(0.74);
  }

  42% {
    opacity: 0.85;
  }

  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}

@keyframes power-target-pulse {
  from {
    filter: brightness(1) saturate(1.02);
    transform: translateY(0);
  }

  to {
    filter: brightness(1.14) saturate(1.22);
    transform: translateY(-1px);
  }
}

@keyframes callout-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -12px) scale(0.96);
  }

  16%,
  82% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.98);
  }
}

@keyframes crowd-ring {
  0% {
    opacity: 0.95;
    transform: scale(0.3);
  }

  100% {
    opacity: 0;
    transform: scale(1.9);
  }
}

@keyframes crowd-flash {
  0% {
    opacity: 0;
    transform: scale(0.18) rotate(0deg);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.1) rotate(24deg);
  }
}

@keyframes crowd-message {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.82);
  }

  18%,
  72% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
}

@keyframes crowd-particle {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(8px) scale(0.7);
  }

  14% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--distance)) scale(0.12);
  }
}

@keyframes board-moment {
  0%,
  100% {
    transform: scale(1);
  }

  42% {
    transform: scale(1.012);
  }
}

@keyframes recap-in {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes glint {
  0%,
  25% {
    opacity: 0;
    transform: translateX(-34%) rotate(12deg);
  }

  52% {
    opacity: 0.88;
  }

  100% {
    opacity: 0;
    transform: translateX(36%) rotate(12deg);
  }
}

@keyframes setup-arrive {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes loading-flip {
  0%,
  100% {
    transform: rotateY(0deg);
  }

  50% {
    transform: rotateY(180deg);
  }
}

@keyframes loading-bar {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(250%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-board,
  .intro-chip,
  .intro-chip--flipping .intro-chip__body,
  .intro-dot,
  .intro-button__chip,
  .board-stage::before,
  .board-stage::after,
  .crowd-burst,
  .crowd-burst__ring,
  .crowd-burst__message,
  .crowd-burst__particle,
  .board-grid::after,
  .board-cell::after,
  .board-cell[data-power-target="true"],
  .board-wrap[data-moment],
  .move-callout,
  .endgame-recap__panel,
  .disc,
  .disc__body,
  .disc[data-animating="true"],
  .disc[data-new="true"],
  .disc[data-animating="true"]::after,
  .setup-panel,
  .loading-board span,
  .loading-bar span {
    animation: none;
    transition-duration: 0.01ms;
  }
}

.control-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  padding: 12px;
}

.score-meter {
  display: grid;
  gap: 7px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.score-meter__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.score-meter__row--light {
  color: #736957;
}

.score-meter__row strong {
  font-size: 26px;
  line-height: 1;
}

.score-meter__track {
  position: relative;
  height: 12px;
  overflow: hidden;
  border: 1px solid #d5c9b8;
  border-radius: 6px;
  background: #f6ecda;
}

.score-meter__black {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #111, #323232);
  transition: width 220ms ease;
}

.result-line {
  margin: 4px 0 0;
  border-radius: 6px;
  background: rgb(163 66 53 / 10%);
  color: var(--red);
  font-size: 15px;
  font-weight: 900;
  padding: 8px 10px;
}

.arena-card {
  display: grid;
  gap: 7px;
  border: 1px solid rgb(198 146 52 / 38%);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(163 66 53 / 14%), transparent 46%),
    linear-gradient(145deg, rgb(255 253 246 / 84%), rgb(244 236 217 / 82%));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 38%);
  padding: 10px;
}

.arena-card__top {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.arena-card__top strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.hype-meter {
  position: relative;
  height: 13px;
  overflow: hidden;
  border: 1px solid rgb(129 87 42 / 28%);
  border-radius: 999px;
  background: rgb(66 44 27 / 16%);
}

.hype-meter span {
  display: block;
  width: 28%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--board-light));
  box-shadow: 0 0 18px rgb(198 146 52 / 34%);
  transition: width 260ms ease;
}

.arena-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.arena-stats span {
  display: grid;
  min-width: 0;
  gap: 2px;
  border: 1px solid rgb(200 189 173 / 68%);
  border-radius: 7px;
  background: rgb(255 255 255 / 58%);
  padding: 6px 7px;
}

.arena-stats strong,
.arena-stats small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arena-stats strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
}

.arena-stats small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.arena-card p {
  margin: 0;
  border-radius: 7px;
  background: rgb(21 23 22 / 8%);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  padding: 7px 9px;
}

.mission-card {
  display: grid;
  gap: 7px;
  border: 1px solid rgb(22 96 68 / 28%);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(22 96 68 / 10%), transparent 56%),
    rgb(255 253 246 / 74%);
  padding: 10px;
}

.mission-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mission-card li {
  position: relative;
  min-height: 32px;
  overflow: hidden;
  border: 1px solid rgb(200 189 173 / 72%);
  border-radius: 7px;
  background: rgb(255 255 255 / 58%);
  color: var(--ink);
}

.mission-card li button {
  display: block;
  width: 100%;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  padding: 7px 9px 7px 30px;
  text-align: left;
}

.mission-card li button:disabled {
  cursor: default;
  opacity: 0.55;
}

.mission-card li:hover:has(button:not(:disabled)) {
  border-color: var(--gold);
  box-shadow: 0 10px 22px rgb(198 146 52 / 14%);
}

.mission-card li::before {
  position: absolute;
  top: 50%;
  left: 9px;
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border: 1px solid rgb(98 106 100 / 38%);
  border-radius: 50%;
  color: transparent;
  content: "";
  font-size: 10px;
  line-height: 1;
  transform: translateY(-50%);
}

.mission-card li[data-done="true"] {
  border-color: rgb(22 96 68 / 34%);
  background: rgb(22 96 68 / 11%);
  color: var(--board-dark);
}

.mission-card li[data-active="true"] {
  border-color: rgb(198 146 52 / 62%);
  background:
    linear-gradient(135deg, rgb(198 146 52 / 16%), transparent 52%),
    rgb(255 253 246 / 92%);
  box-shadow: 0 0 0 3px rgb(198 146 52 / 12%);
}

.mission-card li[data-active="true"] button {
  color: var(--board-dark);
  text-shadow: 0 1px 0 rgb(255 250 240 / 70%);
}

.mission-card li[data-done="true"]::before {
  border-color: var(--board-dark);
  background: var(--board-dark);
  color: #fffaf0;
  box-shadow: inset 0 0 0 3px #fffaf0;
}

.coach-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgb(49 95 124 / 28%);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(49 95 124 / 11%), transparent 48%),
    rgb(255 253 246 / 76%);
  padding: 10px;
}

.coach-card p {
  min-height: 0;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.coach-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.coach-stats span {
  display: grid;
  min-width: 0;
  gap: 2px;
  border: 1px solid rgb(49 95 124 / 18%);
  border-radius: 7px;
  background: rgb(255 255 255 / 52%);
  padding: 6px 7px;
}

.coach-stats strong,
.coach-stats small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coach-stats strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.coach-stats small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.match-card {
  display: grid;
  gap: 9px;
  border: 1px solid rgb(198 146 52 / 28%);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(198 146 52 / 10%), transparent 52%),
    rgb(255 253 246 / 72%);
  padding: 12px;
}

.settings-drawer {
  position: relative;
  border: 1px solid rgb(200 189 173 / 76%);
  border-radius: 8px;
  background: rgb(255 253 246 / 66%);
}

.settings-drawer summary {
  display: grid;
  min-height: 42px;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) auto;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 0 12px;
}

.settings-drawer summary::-webkit-details-marker {
  display: none;
}

.settings-drawer summary::after {
  color: var(--muted);
  content: "+";
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
}

.settings-drawer[open] summary::after {
  content: "-";
}

.settings-drawer summary span,
.settings-drawer summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-drawer summary span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.settings-drawer summary strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.settings-drawer__body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid rgb(200 189 173 / 64%);
  padding: 8px;
}

.settings-drawer .match-card,
.settings-drawer .utility-row {
  grid-column: 1 / -1;
}

.settings-drawer .match-card {
  gap: 7px;
  padding: 9px;
}

.settings-drawer .control-group {
  gap: 6px;
  min-width: 0;
}

@media (min-width: 981px) {
  .settings-drawer {
    z-index: 5;
  }

  .settings-drawer[open] {
    z-index: 10;
  }

  .settings-drawer__body {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    left: 0;
    max-height: min(520px, calc(100svh - 140px));
    overflow: auto;
    border: 1px solid rgb(200 189 173 / 76%);
    border-radius: 8px;
    background: rgb(255 250 240 / 98%);
    box-shadow: 0 20px 44px rgb(23 19 12 / 22%);
  }
}

.match-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.match-pills span {
  display: grid;
  min-width: 0;
  gap: 2px;
  border: 1px solid rgb(200 189 173 / 70%);
  border-radius: 7px;
  background: rgb(255 255 255 / 54%);
  padding: 8px;
}

.match-pills strong,
.match-pills small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-pills strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.match-pills small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.control-group {
  display: grid;
  gap: 8px;
}

.control-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.segmented-control button,
.icon-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf6;
  color: var(--ink);
  font-weight: 900;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.segmented-control button:not(:disabled),
.icon-button:not(:disabled) {
  cursor: pointer;
}

.segmented-control button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--blue);
}

.segmented-control button.active {
  border-color: var(--board-dark);
  background: var(--board-dark);
  color: #fffaf0;
}

.segmented-control button:disabled {
  opacity: 0.48;
}

.action-row {
  display: grid;
  grid-template-columns: 46px 46px 46px minmax(0, 1fr);
  gap: 7px;
  padding-top: 2px;
}

.icon-button {
  display: inline-grid;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.icon-button--wide {
  grid-template-columns: auto minmax(0, auto);
  background: var(--red);
  color: #fffaf0;
}

.icon-button--wide span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button:disabled {
  opacity: 0.45;
}

.utility-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.utility-button {
  min-height: 36px;
  min-width: 0;
  border: 1px solid rgb(200 189 173 / 84%);
  border-radius: 8px;
  background: rgb(255 253 246 / 78%);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  padding: 0 10px;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.utility-button:hover {
  transform: translateY(-1px);
  border-color: var(--blue);
  background: #fffdf6;
}

.utility-button[data-active="true"] {
  border-color: var(--board-dark);
  background: rgb(22 96 68 / 12%);
}

.tour-button,
.challenge-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgb(49 95 124 / 38%);
  border-radius: 8px;
  color: #fffaf0;
  cursor: pointer;
  font-weight: 900;
  padding: 0 14px;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.settings-drawer .segmented-control button,
.settings-drawer .utility-button,
.settings-drawer .tour-button,
.settings-drawer .challenge-button {
  min-height: 36px;
  font-size: 12px;
}

.tour-button {
  background:
    linear-gradient(135deg, rgb(22 96 68 / 92%), rgb(49 95 124 / 92%));
}

.challenge-button {
  border-color: rgb(198 146 52 / 46%);
  background:
    linear-gradient(135deg, rgb(163 66 53 / 94%), rgb(198 146 52 / 92%));
}

.tour-button:hover,
.challenge-button:hover {
  transform: translateY(-1px);
  border-color: #ffe0a0;
  box-shadow: 0 12px 22px rgb(49 95 124 / 18%);
}

.tour-button:disabled,
.challenge-button:disabled {
  cursor: default;
  opacity: 0.58;
  transform: none;
}

.tour-button svg,
.challenge-button svg {
  width: 19px;
  height: 19px;
}

.tour-button svg {
  fill: currentColor;
}

.challenge-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
}

.judge-tour {
  position: fixed;
  right: 24px;
  bottom: 24px;
  left: 24px;
  display: grid;
  max-width: 760px;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 14px;
  align-items: start;
  z-index: 12;
  margin: 0 auto;
  border: 1px solid rgb(49 95 124 / 26%);
  border-radius: 8px;
  background: rgb(255 250 240 / 96%);
  box-shadow: 0 22px 58px rgb(23 19 12 / 22%);
  padding: 16px;
}

.judge-tour[hidden] {
  display: none;
}

.judge-tour p {
  margin: 5px 0 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.35;
}

.tour-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(200 189 173 / 42%);
}

.tour-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--board-dark), var(--blue));
  transition: width 260ms ease;
}

.tour-close {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf6;
  color: var(--ink);
  cursor: pointer;
}

.tour-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.endgame-recap {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 16;
  background:
    radial-gradient(circle at 50% 42%, rgb(255 250 240 / 36%), transparent 34%),
    rgb(21 23 22 / 48%);
  padding: 18px;
}

.endgame-recap[hidden] {
  display: none;
}

.endgame-recap__panel {
  display: grid;
  width: min(440px, 100%);
  gap: 14px;
  border: 1px solid rgb(255 232 169 / 42%);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(255 250 240 / 98%), rgb(237 244 234 / 96%));
  box-shadow: 0 28px 72px rgb(0 0 0 / 30%);
  padding: 20px;
  animation: recap-in 320ms ease both;
}

.endgame-recap h2 {
  margin: 0;
  color: var(--ink);
  font-size: 38px;
  font-weight: 950;
  line-height: 1;
}

.recap-score {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.recap-score span,
.recap-stats div {
  display: grid;
  min-width: 0;
  gap: 3px;
  border: 1px solid rgb(200 189 173 / 78%);
  border-radius: 8px;
  background: rgb(255 255 255 / 58%);
  padding: 12px;
}

.recap-score strong {
  color: var(--ink);
  font-size: 36px;
  line-height: 1;
}

.recap-score small,
.recap-stats dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.recap-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.recap-stats dd {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 950;
}

.recap-rating {
  display: grid;
  gap: 3px;
  justify-items: center;
  border: 1px solid rgb(198 146 52 / 36%);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(198 146 52 / 13%), transparent 58%),
    rgb(255 255 255 / 58%);
  padding: 12px;
}

.recap-rating span {
  color: var(--gold);
  font-size: 26px;
  line-height: 1;
  text-shadow: 0 2px 0 rgb(0 0 0 / 10%);
}

.recap-rating strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.recap-achievements {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recap-achievements li {
  border: 1px solid rgb(22 96 68 / 28%);
  border-radius: 999px;
  background: rgb(22 96 68 / 10%);
  color: var(--board-dark);
  font-size: 12px;
  font-weight: 950;
  padding: 6px 10px;
}

.recap-share-card {
  margin: 0;
  border: 1px solid rgb(49 95 124 / 20%);
  border-radius: 8px;
  background: rgb(49 95 124 / 8%);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  padding: 10px 12px;
}

.recap-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.recap-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf6;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  padding: 0 10px;
}

.recap-actions button:first-child {
  border-color: var(--red);
  background: var(--red);
  color: #fffaf0;
}

.move-strip {
  display: grid;
  gap: 6px;
  min-height: 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.move-strip ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.move-strip li {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #dccfbc;
  border-radius: 8px;
  background: rgb(255 255 255 / 54%);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.move-strip li span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  font-size: 10px;
}

.move-strip li span[data-player="black"] {
  background: #111;
  color: #fffaf0;
}

.move-strip li span[data-player="white"] {
  border: 1px solid #d6cbbd;
  background: #fffaf0;
  color: #4f4537;
}

.move-strip .empty-move {
  grid-column: 1 / -1;
  color: var(--muted);
}

@media (max-width: 980px) {
  .othello-shell {
    padding: 20px;
  }

  .setup-panel {
    width: min(720px, 100%);
  }

  .choice-grid--tables,
  .choice-grid--opponents {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-header,
  .game-layout {
    grid-template-columns: 1fr;
  }

  .game-header {
    align-items: start;
  }
}

@media (min-width: 981px) and (max-height: 860px) {
  .othello-shell {
    gap: 12px;
    padding: 14px;
  }

  h1 {
    font-size: 42px;
  }

  .eyebrow {
    margin-bottom: 2px;
    font-size: 12px;
  }

  .turn-panel {
    padding: 10px 12px;
  }

  .turn-panel strong {
    font-size: 16px;
  }

  .board-wrap {
    width: min(100%, 650px, calc(100svh - 144px));
  }

  .control-panel {
    gap: 8px;
    padding: 10px;
  }

  .score-meter__row strong {
    font-size: 23px;
  }

  .arena-card,
  .mission-card,
  .coach-card {
    padding: 9px;
  }

  .mission-card li,
  .mission-card li button {
    min-height: 29px;
  }

  .mission-card li button {
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .move-strip {
    display: none;
  }
}

@media (max-width: 620px) {
  .othello-shell {
    gap: 14px;
    padding: 12px;
  }

  .intro-screen {
    padding: 14px;
  }

  .intro-board {
    width: min(100%, 420px, 48vh);
    border-width: 7px;
  }

  .intro-copy h2 {
    font-size: 56px;
  }

  .intro-tagline {
    max-width: 300px;
    font-size: 15px;
  }

  .intro-actions {
    display: grid;
    width: min(100%, 420px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intro-button {
    min-height: 44px;
    width: auto;
    padding: 0 10px;
  }

  .setup-screen,
  .loading-screen {
    padding: 14px;
  }

  .setup-panel {
    gap: 15px;
    padding: 16px;
  }

  .setup-heading h2 {
    font-size: 32px;
  }

  .choice-grid--tables,
  .choice-grid--opponents {
    grid-template-columns: 1fr;
  }

  .choice-card {
    min-height: 0;
  }

  .setup-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 40px;
  }

  .turn-panel strong {
    font-size: 16px;
  }

  .board-stage,
  .control-panel {
    padding: 10px;
  }

  .move-callout {
    top: 18px;
    max-width: calc(100% - 28px);
    padding: 9px 11px;
  }

  .move-callout strong {
    font-size: 15px;
  }

  .move-callout span {
    font-size: 12px;
  }

  .board-wrap {
    width: min(100%, 520px);
    margin: 0 0 8px;
    border-width: 6px;
    border-radius: 6px;
    transform: none;
  }

  .board-wrap::before,
  .board-wrap::after {
    display: none;
  }

  .board-grid {
    gap: 3px;
    border-width: 3px;
    border-radius: 2px;
    padding: 3px;
  }

  .board-cell {
    border-radius: 4px;
  }

  .move-hint {
    border-width: 1px;
    font-size: 10px;
  }

  .move-strip ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-drawer__body {
    grid-template-columns: 1fr;
  }

  .settings-drawer summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .settings-drawer summary strong {
    display: none;
  }

  .judge-tour {
    right: 10px;
    bottom: 10px;
    left: 10px;
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 10px;
    padding: 12px;
  }

  .judge-tour p {
    font-size: 14px;
  }

  .tour-close {
    width: 38px;
    height: 38px;
  }

  .endgame-recap {
    padding: 12px;
  }

  .endgame-recap__panel {
    gap: 11px;
    padding: 14px;
  }

  .endgame-recap h2 {
    font-size: 30px;
  }

  .recap-score strong {
    font-size: 30px;
  }

  .recap-stats,
  .recap-actions {
    grid-template-columns: 1fr;
  }

  .match-pills,
  .utility-row {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 520px) and (max-width: 620px) {
  .choice-grid--tables,
  .choice-grid--opponents {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
