/* und.am games: one identity, two themes (owner choice 2026-11-23).
   Dark = "Calm Navy", light = "Polar". The phone setting decides; the toggle (theme.js) overrides and is remembered.
   Pages map their own colour names onto these tokens. Colour never carries meaning alone. */
:root {
  color-scheme: dark;
  --page: #0F1A2E; --page2: #0B1424; --panel: #17233B; --raised: #1F2D4A; --sunk: #0C1628;
  --line: #2A3A5C; --line-strong: #64759A;
  --ink: #F5F7FA; --dim: #B4BED0; --faint: #8D9EB8; --link: #9CC3FF;
  --pri-bg: #FFD43B; --pri-ink: #0A1220;          /* main action */
  --sel-bg: #FFD43B; --sel-ink: #0A1220;          /* selected option */
  --accent-text: #FFD43B;                         /* accent used as text (numbers, "your turn") */
  --tg-bg: #1F2D4A; --tg-ink: #F5F7FA; --tg-line: #64759A; --tg-icon: #6AA8FF;
  --warn: #FF9E1B; --err: #FFB4A8; --felt: transparent; --felt-desk: radial-gradient(ellipse at center,#1F3256 0%,#16243F 70%); --known: #A3AFC4; --stage: #132038;
  --shadow: 0 1px 2px rgba(0,0,0,.25); --shadow-pop: 0 12px 30px rgba(0,0,0,.45);
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #EDF1F6; --page2: #E3E8F0; --panel: #FFFFFF; --raised: #F5F7FA; --sunk: #E6EBF2;
  --line: #D3DAE5; --line-strong: #7F8CA3;
  --ink: #0E1B30; --dim: #4A5872; --faint: #5E6B83; --link: #1F56D6;
  --pri-bg: #1F56D6; --pri-ink: #FFFFFF;
  --sel-bg: #0E1B30; --sel-ink: #FFFFFF;
  --accent-text: #1F56D6;
  --tg-bg: #FFFFFF; --tg-ink: #0E1B30; --tg-line: #7F8CA3; --tg-icon: #1F56D6;
  --warn: #B85F00; --err: #B3261E; --felt: #DCE8E4; --felt-desk: #DCE8E4; --known: #7A879D; --stage: #F5F7FA;
  --shadow: 0 1px 2px rgba(14,27,48,.08); --shadow-pop: 0 12px 30px rgba(14,27,48,.18);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --page: #EDF1F6; --page2: #E3E8F0; --panel: #FFFFFF; --raised: #F5F7FA; --sunk: #E6EBF2;
    --line: #D3DAE5; --line-strong: #7F8CA3;
    --ink: #0E1B30; --dim: #4A5872; --faint: #5E6B83; --link: #1F56D6;
    --pri-bg: #1F56D6; --pri-ink: #FFFFFF;
    --sel-bg: #0E1B30; --sel-ink: #FFFFFF;
    --accent-text: #1F56D6;
    --tg-bg: #FFFFFF; --tg-ink: #0E1B30; --tg-line: #7F8CA3; --tg-icon: #1F56D6;
    --warn: #B85F00; --err: #B3261E; --felt: #DCE8E4; --felt-desk: #DCE8E4; --known: #7A879D; --stage: #F5F7FA;
    --shadow: 0 1px 2px rgba(14,27,48,.08); --shadow-pop: 0 12px 30px rgba(14,27,48,.18);
  }
}
/* the theme toggle (a sun in dark mode, a moon in light mode) */
.th-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; padding: 0; flex: none; }
.th-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.th-btn:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.th-btn .moon { display: none; }
:root[data-theme="light"] .th-btn .sun { display: none; }
:root[data-theme="light"] .th-btn .moon { display: block; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .th-btn .sun { display: none; } :root:not([data-theme="dark"]) .th-btn .moon { display: block; } }

/* iPhone home screen app (2026-11-24): keep page content below the clock and battery */
@media (display-mode: standalone) { @supports (-webkit-touch-callout: none) { html.und-sa body { padding-top: max(env(safe-area-inset-top), 44px); } } }
