/* base.css — layout + component structure ONLY. NO colors, NO backgrounds here (spec §7 CSS rule):
   every visual value is a CSS custom property defined by the theme files (theme-minecraft.css /
   theme-ninja.css), swapped via :root[theme="..."]. This is what lets a new theme restyle the whole
   app with zero JS changes. Layout is a responsive column wrapping a fixed-aspect-ratio canvas. */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--g-bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* shared return2root top strip so the app reads as part of the one site */
.site-switch {
  position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 16px;
  background: var(--strip-bg); color: #fff; padding: 6px 22px; font-size: .82rem;
}
.site-switch-home { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; font-size: .72rem; }
.site-switch-links { display: flex; gap: 4px; margin-left: auto; }
.site-switch-link { color: #eaf3ea; text-decoration: none; padding: 4px 12px; border-radius: 999px;
  font-weight: 600; }
.site-switch-link:hover { background: rgba(255,255,255,.14); }

/* HUD: scores + controls above the table */
.hud {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; max-width: 520px; width: 100%; margin: 0 auto;
}
.score { font-size: 2rem; font-weight: 800; font-family: var(--font-display); letter-spacing: 1px; }
.score .me { color: var(--accent); }
.hud .mid { text-align: center; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.icon-btn {
  border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--ink);
  border-radius: 12px; padding: 8px 14px; font-size: 1rem; cursor: pointer; font-weight: 700;
}
.icon-btn:hover { background: var(--btn-hover); }

/* Playfield: fixed portrait aspect ratio, letterboxed by the renderer's fit math. */
.stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px; }
canvas#game {
  width: min(92vw, 46vh, 480px);
  aspect-ratio: 480 / 820;
  height: auto;
  border-radius: 18px;
  box-shadow: var(--shadow);
  touch-action: none;              /* stop the page scrolling under a touch drag */
  background: var(--g-table);
}

/* Overlays for LOBBY / MATCHMAKING / PAUSED_BREAK / MATCH_OVER — one component, theme-colored. */
.overlay {
  position: fixed; inset: 0; z-index: 40; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: var(--overlay-bg);
}
.overlay.show { display: flex; }
.panel {
  background: var(--panel-bg); border: 1px solid var(--btn-border); border-radius: 20px;
  padding: 28px 26px; max-width: 380px; width: 100%; text-align: center; box-shadow: var(--shadow);
}
.panel h1 { font-family: var(--font-display); font-size: 2.1rem; color: var(--accent); margin-bottom: 6px; }
.panel h2 { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 10px; }
.panel p { opacity: .85; margin-bottom: 18px; line-height: 1.5; }
.panel .row { display: flex; flex-direction: column; gap: 10px; }

.btn {
  border: none; border-radius: 12px; padding: 14px 18px; font-size: 1rem; font-weight: 700;
  cursor: pointer; background: var(--accent); color: var(--accent-ink); font-family: var(--font);
}
.btn:hover { filter: brightness(1.06); }
.btn.secondary { background: var(--btn-bg); color: var(--ink); border: 1px solid var(--btn-border); }

/* Segmented pickers (difficulty + theme) */
.seg { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; }
.seg button {
  flex: 1; padding: 10px 6px; border-radius: 10px; cursor: pointer; font-weight: 700;
  border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--ink);
}
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg-label { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; opacity: .65; margin-bottom: 4px; }

.pb { font-size: .82rem; opacity: .8; margin-top: 6px; }
.pb.new { color: var(--accent); font-weight: 800; opacity: 1; }

/* Optional account row (Phase 2). Muted, sits below the primary Play action so anonymous play stays
   the default path. */
.account { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--btn-border);
  display: flex; flex-direction: column; gap: 8px; align-items: center; }
.age-check { font-size: .85rem; display: flex; gap: 8px; align-items: center; cursor: pointer; }
.acct-note { font-size: .72rem; opacity: .6; }
.acct-status { font-size: .82rem; color: var(--accent); font-weight: 700; }
.linkbtn { background: none; border: none; color: var(--ink); opacity: .7; text-decoration: underline;
  cursor: pointer; font-size: .78rem; font-family: var(--font); }
.linkbtn:hover { opacity: 1; }
.btn.secondary:disabled { opacity: .45; cursor: not-allowed; }
