:root {
  --ink: #221b2b;
  --paper: #fff5fb;
  --panel: #fffbff;
  --accent: #7e52c9;
  --accent-2: #e56ab5;
  --muted: #5f536d;
  --line: #ddd0ea;
  --success: #2e8f60;
  --danger: #be3b6f;
  --shadow: 0 10px 30px rgba(48, 23, 66, 0.1);
  --board-max-width: 390px;
  --board-gap: clamp(0.2rem, 0.62vw, 0.38rem);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, #ffd8ef 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, #e0d8ff 0%, transparent 35%),
    linear-gradient(160deg, var(--paper), #f5edff);
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.33;
  z-index: -1;
}

.bg-orb-a {
  width: 260px;
  height: 260px;
  background: #c07ff1;
  top: -80px;
  right: 5vw;
}

.bg-orb-b {
  width: 280px;
  height: 280px;
  background: #ff9fd5;
  bottom: -120px;
  left: 4vw;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.88rem clamp(0.85rem, 3vw, 2.1rem);
  gap: 0.8rem;
}

.brand {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.03em;
}

.site-nav {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 0.25rem 0.52rem;
  border-radius: 999px;
  font-size: 0.92rem;
}

.site-nav a:hover {
  background: rgba(126, 82, 201, 0.11);
}

.site-nav .nav-return {
  color: #fff;
  background: linear-gradient(135deg, #1197d8, #8459ff);
  box-shadow: 0 8px 16px rgba(79, 73, 202, 0.14);
}

.site-nav .nav-return:hover {
  background: linear-gradient(135deg, #0f8dcc, #7650ee);
}

.page {
  width: min(980px, 92vw);
  margin: 0 auto 1.9rem;
  flex: 1 0 auto;
}

.hero {
  background: linear-gradient(135deg, #fffefc, #f8f3ff);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 18px;
  padding: clamp(0.95rem, 2.3vw, 1.75rem);
}

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

h1,
h2 {
  margin: 0.2rem 0 0.8rem;
  font-family: "Baskervville", Georgia, serif;
  font-weight: 400;
}

h1 {
  font-size: clamp(1.2rem, 3vw, 1.95rem);
}

h2 {
  font-size: clamp(0.98rem, 2vw, 1.2rem);
}

.lede {
  max-width: 66ch;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.7rem;
}

.stack {
  display: grid;
  gap: 0.7rem;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.55rem;
  margin-top: 0.5rem;
}

.controls-grid label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.84rem;
}

.controls-row {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.controls-grid input,
.controls-grid select {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.4rem 0.52rem;
  background: #fff;
  width: 100%;
  min-height: 38px;
  line-height: 1.2;
  font-size: 0.88rem;
}

.is-hidden {
  display: none !important;
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.8rem;
}

.btn {
  border: 0;
  cursor: pointer;
  border-radius: 10px;
  padding: 0.42rem 0.72rem;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #9d73e2);
}

.btn-secondary {
  color: var(--ink);
  background: #f3eafe;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.status {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.play-stack {
  gap: 0.8rem;
}

.play-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.hero-status {
  display: grid;
  gap: 0.6rem;
  width: min(235px, 100%);
}

.status-card {
  border: 1px solid rgba(126, 82, 201, 0.14);
  border-radius: 12px;
  padding: 0.62rem 0.72rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 240, 255, 0.92));
}

.status-card .status {
  margin: 0.35rem 0 0;
}

.status-kicker {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.64rem;
  color: var(--accent);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel-head.compact {
  margin-bottom: 0.45rem;
}

.panel-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(0, 1fr) minmax(180px, 206px);
  align-items: start;
  gap: 0.8rem;
}

.play-main-column,
.play-setup-panel,
.play-sidebar {
  display: grid;
  gap: 0.7rem;
}

.connect4-controls {
  margin-top: 0.55rem;
}

.controls-grid-compact {
  margin-top: 0.6rem;
}

.inline-details {
  border: 1px solid rgba(126, 82, 201, 0.16);
  border-radius: 12px;
  padding: 0.58rem 0.68rem;
  background: rgba(248, 242, 255, 0.76);
}

.inline-details summary {
  cursor: pointer;
  font-weight: 600;
}

.train-form {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.6rem;
  align-items: end;
}

.train-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.84rem;
}

.form-actions {
  grid-column: 1 / -1;
  margin-top: 0.1rem;
}

.play-actions {
  margin-top: 0.4rem;
}

.play-actions .btn {
  flex: 1 1 104px;
}

.play-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34rem 0.58rem;
  border-radius: 999px;
  background: rgba(126, 82, 201, 0.09);
  color: var(--ink);
  font-size: 0.82rem;
}

.legend-disc {
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.14);
}

.legend-disc.player {
  background: linear-gradient(135deg, #ffe47a, #ffbf44);
}

.legend-disc.ai {
  background: linear-gradient(135deg, #7f93ff, #4058db);
}

.board-panel {
  display: grid;
  gap: 0.7rem;
}

.board-panel-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.board-outcome {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.board-tip {
  margin: 0;
  max-width: 28ch;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: right;
  line-height: 1.38;
}

.board-tip-left {
  max-width: none;
  text-align: left;
}

.board-notes-panel {
  min-height: 114px;
  display: grid;
  align-content: start;
  gap: 0.32rem;
}

.board-shell {
  width: min(100%, var(--board-max-width));
  margin: 0 auto;
  display: grid;
  gap: 0.45rem;
}

.board-controls {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--board-gap);
}

.drop-btn {
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #9873df, #6b46bc);
  padding: 0.34rem 0.15rem;
  min-height: clamp(1.9rem, 4vw, 2.45rem);
  box-shadow: 0 8px 18px rgba(61, 32, 100, 0.16);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  display: grid;
  justify-items: center;
  gap: 0.08rem;
}

.drop-btn.recommended {
  background: linear-gradient(180deg, #17a889, #0d8e73);
}

.drop-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(61, 32, 100, 0.2);
}

.drop-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.drop-forecast {
  font-size: 0.82rem;
  line-height: 1;
}

.drop-label {
  font-size: 0.82rem;
  line-height: 1.1;
}

.drop-btn.chosen {
  box-shadow: 0 0 0 2px rgba(255, 238, 164, 0.55), 0 12px 24px rgba(20, 17, 61, 0.26);
}

.drop-btn.flash-choice {
  animation: columnFlash 360ms ease-out 1;
}

.board-grid {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--board-gap);
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.18), transparent 30%),
    linear-gradient(165deg, #4462d7, #6d45bc 56%, #a248bf);
  border-radius: 18px;
  padding: clamp(0.38rem, 1.1vw, 0.58rem);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    0 18px 34px rgba(52, 26, 99, 0.2);
}

.board-grid::before,
.board-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.board-grid::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 12%, transparent 82%, rgba(17, 17, 53, 0.16)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 18%, transparent 82%, rgba(17, 17, 53, 0.1));
}

.board-grid::after {
  inset: clamp(0.12rem, 0.32vw, 0.22rem);
  border-radius: 15px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 10px 16px rgba(255, 255, 255, 0.06),
    inset 0 -10px 16px rgba(11, 11, 35, 0.12);
}

.cell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  padding: clamp(0.13rem, 0.4vw, 0.24rem);
  background: rgba(23, 22, 59, 0.28);
  box-shadow:
    inset 0 8px 14px rgba(12, 10, 36, 0.3),
    inset 0 -2px 4px rgba(255, 255, 255, 0.05);
}

.cell-core {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.16) 16%, transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(235, 228, 247, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -4px 8px rgba(107, 79, 155, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.cell-core::before,
.cell-core::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.cell-core::before {
  background:
    radial-gradient(circle at 50% 52%, transparent 0 52%, rgba(255, 255, 255, 0.18) 57%, transparent 64%),
    radial-gradient(circle at 52% 56%, transparent 0 69%, rgba(0, 0, 0, 0.16) 74%, transparent 80%);
  opacity: 0.9;
}

.cell-core::after {
  inset: clamp(0.14rem, 0.45vw, 0.22rem);
  border: clamp(2px, 0.35vw, 4px) solid rgba(255, 255, 255, 0.24);
  border-bottom-color: rgba(0, 0, 0, 0.18);
  opacity: 0.7;
}

.cell.player .cell-core {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.2) 16%, transparent 28%),
    linear-gradient(180deg, #ffe57d, #ffc247 72%, #ffae2e);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.68),
    inset 0 -6px 12px rgba(179, 114, 8, 0.22),
    0 3px 8px rgba(88, 48, 4, 0.12);
}

.cell.ai .cell-core {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.12) 16%, transparent 28%),
    linear-gradient(180deg, #96a8ff, #5873f2 68%, #314bd2);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    inset 0 -6px 12px rgba(22, 38, 130, 0.28),
    0 3px 8px rgba(22, 34, 103, 0.14);
}

.cell.recent .cell-core {
  animation: piecePop 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.log-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 300px;
  overflow: auto;
  display: grid;
  gap: 0.4rem;
}

.log-list li {
  margin: 0;
  padding: 0.55rem 0.62rem;
  border-radius: 12px;
  background: rgba(126, 82, 201, 0.08);
  border: 1px solid rgba(126, 82, 201, 0.12);
}

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

.score-card {
  border-radius: 12px;
  padding: 0.64rem 0.68rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 240, 255, 0.95));
  border: 1px solid rgba(126, 82, 201, 0.12);
  display: grid;
  gap: 0.25rem;
}

.score-card strong {
  font-size: clamp(1rem, 2.2vw, 1.34rem);
  font-weight: 700;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.score-card-wide {
  grid-column: 1 / -1;
}

.score-label {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meter {
  margin-top: 0.55rem;
  width: 100%;
  height: 0.72rem;
  border-radius: 999px;
  background: rgba(126, 82, 201, 0.12);
  overflow: hidden;
}

.meter-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 220ms ease;
}

.metrics {
  margin: 0.65rem 0 0;
  border-radius: 12px;
  border: 1px solid rgba(126, 82, 201, 0.12);
  background: rgba(248, 242, 255, 0.72);
  padding: 0.65rem;
  font-size: 0.78rem;
  line-height: 1.4;
  overflow: auto;
}

.metrics-compact {
  margin-top: 0;
  min-height: 0;
  white-space: pre-wrap;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.5rem 0.35rem;
  border-bottom: 1px solid rgba(126, 82, 201, 0.12);
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #c45379, #a7365e);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
}

.info-card {
  display: grid;
  gap: 0.3rem;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(126, 82, 201, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 240, 255, 0.95));
}

.info-card h3 {
  margin: 0;
  font-family: "Baskervville", Georgia, serif;
  font-weight: 400;
  font-size: 0.98rem;
}

.info-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.info-card-wide {
  grid-column: 1 / -1;
}

.help-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.04rem;
  height: 1.04rem;
  border-radius: 999px;
  border: 1px solid rgba(126, 82, 201, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(242, 233, 255, 0.95));
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.site-footer {
  padding: 0 0 1.15rem;
}

.footer-inner {
  width: min(980px, 92vw);
  margin: 0 auto;
  padding: 0.8rem 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 251, 255, 0.94);
  box-shadow: var(--shadow);
}

.footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.copyleft-mark {
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  flex: 0 0 auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--ink);
  padding: 0.24rem 0.54rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  font-size: 0.88rem;
}

.footer-links a:hover {
  background: rgba(126, 82, 201, 0.11);
}

@keyframes piecePop {
  0% {
    transform: translateY(-16%) scale(0.88);
  }

  60% {
    transform: translateY(0) scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes columnFlash {
  0% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }

  40% {
    transform: translateY(-3px) scale(1.05);
    filter: brightness(1.18);
  }

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

@media (max-width: 1080px) {
  .play-layout {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 240px);
  }

  .play-setup-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .play-hero,
  .board-panel-top,
  .panel-head {
    flex-direction: column;
  }

  .board-tip {
    max-width: none;
    text-align: left;
  }

  .play-layout {
    grid-template-columns: 1fr;
  }

  .board-shell {
    width: min(100%, 620px);
  }
}

@media (max-width: 700px) {
  .page {
    width: min(1180px, 96vw);
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav a {
    background: rgba(126, 82, 201, 0.09);
  }

  .score-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-inner {
    width: min(96vw, 980px);
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .hero-status {
    width: 100%;
  }

  .play-actions .btn {
    flex-basis: 100%;
  }

  .score-grid {
    grid-template-columns: 1fr;
  }
}

/* Compact lab UI pass. */
:root {
  --shadow: 0 7px 18px rgba(48, 23, 66, 0.08);
  --board-max-width: 320px;
  --board-gap: clamp(0.14rem, 0.42vw, 0.26rem);
}

body {
  font-size: 0.86rem;
}

.bg-orb {
  filter: blur(42px);
  opacity: 0.2;
}

.bg-orb-a {
  width: 195px;
  height: 195px;
  top: -70px;
}

.bg-orb-b {
  width: 210px;
  height: 210px;
  bottom: -95px;
}

.site-header {
  padding: 0.62rem clamp(0.65rem, 2vw, 1.35rem);
  gap: 0.55rem;
}

.brand {
  font-size: 0.82rem;
}

.site-nav {
  gap: 0.42rem;
}

.site-nav a {
  padding: 0.18rem 0.4rem;
  font-size: 0.8rem;
}

.page {
  width: min(900px, 94vw);
  margin: 0 auto 1.25rem;
}

.hero {
  border-radius: 12px;
  padding: clamp(0.7rem, 1.6vw, 1.1rem);
}

.eyebrow,
.status-kicker,
.score-label {
  letter-spacing: 0.08em;
  font-size: 0.62rem;
}

h1 {
  font-size: clamp(1.05rem, 2.2vw, 1.52rem);
}

h2 {
  font-size: clamp(0.88rem, 1.5vw, 1.04rem);
}

.lede,
p,
li,
.status,
.panel-note,
.board-tip,
.info-card p {
  font-size: 0.82rem;
  line-height: 1.36;
}

.grid {
  margin-top: 0.62rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.52rem;
}

.stack,
.play-stack,
.play-main-column,
.play-setup-panel,
.play-sidebar,
.board-panel,
.hero-status,
.info-card {
  gap: 0.52rem;
}

.card,
.panel {
  border-radius: 10px;
  padding: 0.62rem;
}

.panel-head {
  gap: 0.55rem;
}

.panel-head.compact {
  margin-bottom: 0.28rem;
}

.controls-grid,
.train-form,
.info-grid {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 0.42rem;
}

.train-form {
  margin-top: 0.48rem;
  align-items: start;
}

.train-field,
.train-form label,
.controls-grid label {
  display: grid;
  gap: 0.24rem;
  min-width: 0;
  font-size: 0.78rem;
}

.train-field-model {
  align-self: stretch;
  gap: 0.3rem;
}

.label-line {
  gap: 0.22rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.28;
}

.controls-grid input,
.controls-grid select,
.train-form input,
.train-form select {
  min-height: 2.05rem;
  border-radius: 7px;
  padding: 0.28rem 0.42rem;
  font-size: 0.82rem;
}

.btn {
  min-height: 2.05rem;
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  font-size: 0.82rem;
}

.train-form > .btn {
  grid-column: 1 / -1;
  justify-self: start;
}

.help-dot {
  width: 0.82rem;
  height: 0.82rem;
  font-size: 0.58rem;
}

.play-layout {
  grid-template-columns: minmax(160px, 190px) minmax(0, 1fr) minmax(155px, 182px);
  gap: 0.58rem;
}

.status-card,
.inline-details,
.score-card,
.info-card,
.metrics {
  border-radius: 9px;
  padding: 0.48rem 0.55rem;
}

.board-shell {
  gap: 0.32rem;
}

.board-grid {
  border-radius: 12px;
  padding: clamp(0.28rem, 0.72vw, 0.42rem);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 10px 22px rgba(52, 26, 99, 0.16);
}

.board-grid::after {
  border-radius: 10px;
}

.cell {
  padding: clamp(0.08rem, 0.26vw, 0.16rem);
}

.drop-btn {
  min-height: clamp(1.45rem, 3vw, 1.85rem);
  border-radius: 7px;
  padding: 0.22rem 0.12rem;
}

.drop-label,
.drop-forecast {
  font-size: 0.68rem;
}

.score-grid {
  gap: 0.42rem;
}

.score-card strong {
  font-size: clamp(0.88rem, 1.7vw, 1.05rem);
}

.meter {
  margin-top: 0.38rem;
  height: 0.52rem;
}

.metrics {
  margin-top: 0.45rem;
  font-size: 0.72rem;
  line-height: 1.32;
}

.data-table {
  font-size: 0.78rem;
}

.data-table th,
.data-table td {
  padding: 0.34rem 0.28rem;
}

.footer-inner {
  width: min(900px, 94vw);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  gap: 0.48rem;
}

.footer-copy,
.footer-links a {
  font-size: 0.76rem;
}

@media (max-width: 1080px) {
  .play-layout {
    grid-template-columns: minmax(0, 1fr) minmax(185px, 215px);
  }
}

@media (max-width: 820px) {
  .play-layout,
  .train-form {
    grid-template-columns: 1fr;
  }

  .board-shell {
    width: min(100%, 520px);
  }
}

@media (max-width: 700px) {
  body {
    overflow-x: hidden;
  }

  .page {
    width: calc(100vw - 0.8rem);
    overflow-x: hidden;
  }

  .hero,
  .panel,
  .card {
    max-width: 100%;
  }

  .controls-grid,
  .controls-grid-compact,
  .score-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .controls-row > *,
  .play-actions .btn,
  .train-form > .btn {
    width: 100%;
  }

  .play-actions {
    display: grid;
    gap: 0.38rem;
  }

  .table-wrap,
  .panel {
    overflow-x: auto;
  }

  .lede,
  p,
  .status,
  .panel-note,
  .board-tip {
    overflow-wrap: anywhere;
  }
}
