.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) var(--gutter) 48px;
}

.intro { padding-top: 8px; }
.intro h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); margin: 10px 0 18px; }
.accent-blue { color: var(--amplifier); }
.lede { font-size: 1.08rem; color: var(--foreground-muted); max-width: 34rem; }

.stat-strip {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 28px 0 22px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.stat-strip div { padding: 14px 0 14px 16px; border-left: 1px solid var(--border); }
.stat-strip div:first-child { border-left: 0; padding-left: 0; }
.stat-strip dt { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--foreground-muted); }
.stat-strip dd { margin: 4px 0 0; font-size: 1.7rem; font-weight: 650; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }

.mode-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  max-width: 360px;
}
.segment {
  min-height: 40px; border: 0; border-radius: 999px; background: transparent;
  font: inherit; font-weight: 600; font-size: 0.94rem; color: var(--foreground-muted); cursor: pointer;
  transition: background-color 150ms, color 150ms;
}
.segment[aria-pressed="true"] { background: var(--surface); color: var(--foreground); box-shadow: 0 1px 2px oklch(0.2 0.01 260 / 0.08); }

.how { margin-top: 36px; }
.how h2 { font-size: 1.28rem; margin-bottom: 12px; }
.how ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.how li { display: flex; align-items: center; gap: 12px; }
.fine { margin-top: 14px; font-size: 0.86rem; color: var(--foreground-muted); }

.court-wrap { position: sticky; top: 20px; }
.court {
  position: relative;
  /* One fixed 2:3 court on every screen, so daily scores compare fairly. */
  aspect-ratio: 2 / 3;
  width: min(100%, calc(min(760px, 100svh - 200px) * 2 / 3));
  margin: 0 auto;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border), 0 24px 48px -32px oklch(0.2 0.02 260 / 0.35);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  outline-offset: 4px;
}
.court canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hud {
  position: absolute; top: 14px; left: 18px; right: 18px;
  display: flex; justify-content: space-between; align-items: baseline;
  pointer-events: none;
}
.hud-score { font-size: 2.4rem; font-weight: 650; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.hud-meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--foreground-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; padding: 24px;
  background: color-mix(in oklch, var(--surface) 78%, transparent);
  backdrop-filter: blur(2px);
}
.overlay[hidden] { display: none; }
.overlay-mark { width: 96px; height: 96px; margin-bottom: 6px; }
.overlay-title { font-size: 1.6rem; font-weight: 650; letter-spacing: -0.04em; }
.overlay-copy { color: var(--foreground-muted); margin-bottom: 8px; }
.end-score { font-size: clamp(3.6rem, 10vw, 5rem); font-weight: 650; letter-spacing: -0.06em; line-height: 1; font-variant-numeric: tabular-nums; }
.end-score small { display: block; font-size: 0.9rem; letter-spacing: 0; font-weight: 500; color: var(--foreground-muted); margin-top: 6px; }
.end-meta { font-family: var(--font-mono); font-size: 0.8rem; color: var(--foreground-muted); }
.end-best { font-weight: 600; color: var(--positive); min-height: 1.5em; }
.end-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }
.share-status { font-size: 0.86rem; color: var(--foreground-muted); min-height: 1.4em; }
.court-controls { display: flex; justify-content: center; margin-top: 12px; }
.court-controls .button { min-width: 112px; }
.court-controls .button:disabled { color: var(--foreground-muted); border-color: var(--border); cursor: default; transform: none; }
.court-help { margin-top: 12px; font-size: 0.82rem; color: var(--foreground-muted); text-align: center; }

.not-found { max-width: 640px; margin: 0 auto; padding: clamp(48px, 10vw, 120px) var(--gutter); }
.not-found h1 { font-size: clamp(2rem, 5vw, 3rem); }
.not-found p { margin: 20px 0 24px; color: var(--foreground-muted); }

@media (max-width: 1180px) {
  .game-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); }
}
@media (max-width: 760px) {
  .game-layout { grid-template-columns: 1fr; gap: 0; padding-top: 18px; }
  .intro { display: contents; }
  .intro .data-label { order: 1; }
  .intro h1 { order: 2; font-size: 1.9rem; margin: 4px 0 14px; }
  .court-wrap { order: 3; position: static; }
  .stat-strip { order: 4; margin: 18px 0 16px; }
  .mode-switch { order: 5; max-width: none; }
  .lede { order: 6; font-size: 1rem; margin-top: 22px; }
  .how { order: 7; margin-top: 22px; }
  .stat-strip dd { font-size: 1.35rem; }
  .court { width: min(100%, calc(64svh * 2 / 3)); }
  .court-help { display: none; }
}

.site-footer h2 { font-size: 1rem; margin-bottom: 8px; }
.site-footer p { max-width: 75ch; }
