:root {
  --ink: #15202b;
  --ink-soft: #3d4f5f;
  --paper: #f3f6f9;
  --panel: rgba(255, 255, 255, 0.82);
  --line: #c5d0db;
  --line-hover: #8aa0b5;
  --accent: #ff5a36;
  --accent-deep: #e03f1c;
  --dot-color: #1a2733;
  --shadow: 0 18px 50px rgba(21, 32, 43, 0.12);
  --radius: 18px;
  --font-display: "Syne", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --player-0: #ff5a36;
  --player-1: #0f9f8a;
  --player-2: #2f6bff;
  --player-3: #f0a202;
  --player-4: #c23a8a;
  --player-5: #6b4eff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #ffe4d8 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, #d7f3ee 0%, transparent 50%),
    linear-gradient(160deg, #eef3f8 0%, #f7f9fb 45%, #e9eef4 100%);
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(21, 32, 43, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 32, 43, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
  z-index: 0;
}

.screen {
  display: none;
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.screen.active {
  display: block;
  animation: rise 0.45s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.brand-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 5rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.brand-sm {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.tagline {
  margin: 0.75rem auto 0;
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.setup-panel,
.results-panel,
.scoreboard {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  border-radius: calc(var(--radius) + 4px);
}

.setup-panel {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  gap: 1.25rem;
}

.field-block {
  margin: 0;
  padding: 0;
  border: 0;
}

.field-block legend {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.player-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stepper {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: white;
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.stepper:hover:not(:disabled) {
  background: var(--ink);
  color: white;
  transform: scale(1.05);
}

.stepper:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.count-display {
  font-family: var(--font-body);
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1;
  min-width: 2rem;
  text-align: center;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

.palette-block {
  margin-bottom: 1rem;
}

.palette-label {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.palette-swatch {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    0 2px 6px rgba(21, 32, 43, 0.12);
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.palette-swatch:hover {
  transform: scale(1.08);
}

.palette-swatch:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.palette-swatch.taken:not(.mine) {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.palette-swatch.mine::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.player-fields {
  display: grid;
  gap: 0.65rem;
}

.player-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: center;
  position: relative;
}

.color-picker-wrap {
  position: relative;
}

.swatch {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.1),
    0 2px 6px rgba(21, 32, 43, 0.12);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.swatch:hover {
  transform: scale(1.06);
}

.swatch[aria-expanded="true"] {
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.1),
    0 0 0 3px rgba(21, 32, 43, 0.18);
}

.color-picker {
  display: none;
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  z-index: 20;
  width: max-content;
  max-width: min(18rem, calc(100vw - 3rem));
  padding: 0.65rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(21, 32, 43, 0.1);
  box-shadow: 0 14px 34px rgba(21, 32, 43, 0.16);
  animation: rise 0.18s ease both;
}

.color-picker.open {
  display: block;
}

.color-picker-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.palette-swatch {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 9px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    0 2px 6px rgba(21, 32, 43, 0.12);
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.palette-swatch:hover {
  transform: scale(1.08);
}

.palette-swatch:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.palette-swatch.taken:not(.mine) {
  opacity: 0.38;
}

.palette-swatch.mine::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.player-row input[type="text"] {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  background: white;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.player-row input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 90, 54, 0.18);
}

.size-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.size-card {
  cursor: pointer;
}

.size-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.size-label {
  display: grid;
  gap: 0.15rem;
  place-items: center;
  text-align: center;
  padding: 0.9rem 0.4rem;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: white;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.size-label strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.size-label small {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.size-card input:checked + .size-label {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 90, 54, 0.16);
  transform: translateY(-1px);
}

.size-card:hover .size-label {
  border-color: var(--ink-soft);
}

.custom-size-fields {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.65rem;
  align-items: end;
  margin-top: 0.85rem;
  padding: 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid var(--line);
}

.custom-size-fields[hidden] {
  display: none;
}

.custom-size-field {
  display: grid;
  gap: 0.35rem;
}

.custom-size-field span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.custom-size-field input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-variant-numeric: tabular-nums;
  background: white;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.custom-size-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 90, 54, 0.18);
}

.custom-size-x {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  padding-bottom: 0.65rem;
  color: var(--ink-soft);
}

.setup-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 24px rgba(255, 90, 54, 0.28);
}

.btn.primary:hover {
  background: var(--accent-deep);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid var(--line);
  color: var(--ink);
}

.btn-lg {
  width: 100%;
  padding: 0.95rem 1.2rem;
  font-size: 1.05rem;
}

.game-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.deal-note {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.deal-note[hidden] {
  display: none;
}

.edge.taken.dealt::before {
  background: #6d7d8c;
  box-shadow: none;
}

.turn-banner {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.turn-banner .name {
  font-weight: 800;
}

.game-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.scoreboard {
  padding: 1.15rem;
  position: sticky;
  top: 1rem;
}

.scoreboard h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.score-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.score-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.score-item.active {
  border-color: currentColor;
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(21, 32, 43, 0.08);
}

.score-item .rank {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  opacity: 0.55;
}

.score-item .player-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-item .score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
}

.progress-block {
  margin-top: 1rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(21, 32, 43, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ff9a45);
  transition: width 0.35s ease;
}

.order-list {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(21, 32, 43, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.order-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
}

.order-chip.active {
  color: white;
  border-color: transparent;
}

.board-wrap {
  overflow: auto;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  padding: 1rem;
  max-height: calc(100vh - 8rem);
}

.board {
  --cell: 48px;
  --dot-size: 10px;
  --gap: 6px;
  display: grid;
  width: max-content;
  margin: 0 auto;
  user-select: none;
  touch-action: manipulation;
}

.cell-dot {
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 50%;
  background: var(--dot-color);
  justify-self: center;
  align-self: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.edge {
  appearance: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: transparent;
  position: relative;
  border-radius: 999px;
}

.edge::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  background: var(--line);
  opacity: 0.55;
  border-radius: inherit;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.edge.h::before {
  height: 6px;
  width: 100%;
}

.edge.v::before {
  width: 6px;
  height: 100%;
}

.edge:not(.taken):hover::before,
.edge:not(.taken):focus-visible::before {
  background: var(--line-hover);
  opacity: 1;
  transform: scale(1.04);
}

.edge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.edge.taken {
  cursor: default;
  pointer-events: none;
}

.edge.taken::before {
  opacity: 1;
  background: var(--edge-color, var(--ink));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
  animation: place-line 0.22s ease;
}

@keyframes place-line {
  from {
    transform: scale(0.4);
    opacity: 0.2;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.box {
  position: relative;
  border-radius: 8px;
  overflow: visible;
  background: transparent;
  transition: background 0.25s ease, transform 0.25s ease;
}

.box.claimed {
  animation: claim-pop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.35);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 0 18px color-mix(in srgb, var(--claim-color, #ff5a36) 45%, transparent);
}

.box.claimed::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid color-mix(in srgb, var(--claim-color, #ff5a36) 80%, white);
  opacity: 0;
  pointer-events: none;
  animation: claim-ring 0.7s ease-out forwards;
}

.box.claimed::after {
  content: "";
  position: absolute;
  inset: 15%;
  border-radius: inherit;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.75) 0%,
    transparent 70%
  );
  opacity: 0;
  pointer-events: none;
  animation: claim-flash 0.55s ease-out forwards;
}

@keyframes claim-pop {
  0% {
    transform: scale(0.55) rotate(-4deg);
    opacity: 0.25;
    filter: brightness(1.8);
  }
  55% {
    transform: scale(1.12) rotate(2deg);
    opacity: 1;
    filter: brightness(1.25);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    filter: none;
  }
}

@keyframes claim-ring {
  0% {
    transform: scale(0.6);
    opacity: 1;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

@keyframes claim-flash {
  0% {
    opacity: 0.9;
    transform: scale(0.4);
  }
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 40;
}

.fx-confetti {
  position: absolute;
  width: var(--size, 8px);
  height: var(--size, 8px);
  background: var(--color, #ff5a36);
  border-radius: var(--radius, 2px);
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg);
  animation: confetti-fly var(--duration, 900ms) cubic-bezier(0.15, 0.75, 0.25, 1)
    forwards;
  animation-delay: var(--delay, 0ms);
}

.fx-confetti.ribbon {
  width: calc(var(--size, 8px) * 0.45);
  height: calc(var(--size, 8px) * 1.6);
  border-radius: 999px;
}

.fx-confetti.circle {
  border-radius: 50%;
}

@keyframes confetti-fly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(
        calc(-50% + var(--dx)),
        calc(-50% + var(--dy))
      )
      rotate(var(--spin))
      scale(0.55);
  }
}

.fx-spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color, #fff);
  box-shadow: 0 0 8px var(--color, #fff);
  transform: translate(-50%, -50%);
  animation: spark-fly var(--duration, 700ms) ease-out forwards;
}

@keyframes spark-fly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(
        calc(-50% + var(--dx)),
        calc(-50% + var(--dy))
      )
      scale(0.2);
  }
}

.fx-firework {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color, #ffd166);
  box-shadow: 0 0 10px var(--color, #ffd166);
  transform: translate(-50%, -50%);
  animation: firework-rise var(--rise, 420ms) ease-out forwards;
}

@keyframes firework-rise {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  100% {
    opacity: 0.9;
    transform: translate(-50%, calc(-50% + var(--rise-y, -70px)));
  }
}

.fx-burst {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    #fff 0%,
    var(--color, #ff5a36) 35%,
    transparent 70%
  );
  animation: burst-pop 0.55s ease-out forwards;
}

@keyframes burst-pop {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.3);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(4.5);
  }
}

.fx-blast-text {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  letter-spacing: -0.03em;
  color: var(--color, #ff5a36);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.85),
    0 8px 24px rgba(21, 32, 43, 0.2);
  animation: blast-text 900ms cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
  white-space: nowrap;
}

@keyframes blast-text {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.5);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -70%) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -120%) scale(0.95);
  }
}

.fx-screen-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--x, 50%) var(--y, 50%),
    color-mix(in srgb, var(--color, #ff5a36) 28%, transparent),
    transparent 55%
  );
  animation: screen-flash 500ms ease-out forwards;
}

@keyframes screen-flash {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.score-item.score-bump {
  animation: score-bump 0.45s ease;
}

@keyframes score-bump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1.02);
  }
}

.turn-banner.blast-pulse {
  animation: banner-pulse 0.55s ease;
}

@keyframes banner-pulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .box.claimed,
  .box.claimed::before,
  .box.claimed::after,
  .fx-confetti,
  .fx-spark,
  .fx-firework,
  .fx-burst,
  .fx-blast-text,
  .fx-screen-flash,
  .score-item.score-bump,
  .turn-banner.blast-pulse {
    animation: none !important;
  }

  .fx-layer {
    display: none;
  }
}

.results-panel {
  width: min(520px, 100%);
  margin: 4vh auto 0;
  padding: 2rem 1.5rem;
  text-align: center;
}

.final-scores {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  text-align: left;
}

.final-scores li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: white;
  border: 1.5px solid var(--line);
}

.final-scores li.winner {
  border-color: currentColor;
  box-shadow: 0 10px 24px rgba(21, 32, 43, 0.08);
}

@media (max-width: 860px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .scoreboard {
    position: static;
  }

  .size-options {
    grid-template-columns: 1fr;
  }

  .board {
    --cell: 36px;
    --dot-size: 8px;
  }

  .board-wrap {
    max-height: none;
  }
}

@media (max-width: 480px) {
  .board {
    --cell: 28px;
    --dot-size: 7px;
    --gap: 4px;
  }

  .game-top {
    flex-direction: column;
  }
}
