/* The physical layer (docs/UPGRADE-PLAN.md, stage 1): the app used outdoors, one-handed, in bright sun, sometimes gloved.
   Loaded last on purpose — it only tightens what the earlier sheets set. The numbers come from the research:
   44 px minimum target, ~64 px (about 2 cm) for what you press mid-round, 8 px between targets, 7:1 on scores and
   distances and 4.5:1 on everything else, no text under 13 px. tools/ui_audit.py checks all of it on every screen. */

/* ── 1. Targets ─────────────────────────────────────────────────────────────────────────────────────────────── */
button, [role="button"], .btn, .pill, .chip, select, input:not([type="checkbox"]):not([type="radio"]) { min-height: 44px; }
button, [role="button"] { min-width: 44px; }
.btn.sm { min-height: 44px; }
.btn.icon { min-width: 44px; }
.seg > button { min-height: 44px; }
.players .p, .play .players .p { min-height: 44px; }
.play .strip .h { width: 44px; }
.st-tab { min-width: 44px; }
.st-seg > button { min-height: 44px; }
/* Switches: the 44 px box is the tap target; the 50×30 track and knob are drawn inside it. */
.switch { width: 56px; height: 44px; background: transparent; }
.switch::before { content: ""; position: absolute; left: 3px; top: 7px; width: 50px; height: 30px; border-radius: 30px; background: var(--line-2); transition: background var(--dur); }
.switch::after { top: 10px; left: 6px; }
.switch[aria-checked="true"] { background: transparent; }
.switch[aria-checked="true"]::before { background: var(--brass); }
.wl-small a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; }
/* The Map / Satellite / 3D switch and its fit button on the course map. */
.play .map .views > * { min-height: 44px; line-height: 44px; }
.play .map .fit { width: 44px; height: 44px; top: 66px; }
/* Opaque, not glass: plates over the map are solid so nothing behind them can fight the text in sun. */
.play .map .views, .play .map .fit, .play .fcb { background: #121A15; -webkit-backdrop-filter: none; backdrop-filter: none; }
.play .fcb .l, .play .fcb .v.dim { color: #A6ADA4; }
.play .fcb .v.c { font-variation-settings: "opsz" 144; }

/* ── 2. What you press mid-round: ~2 cm ──────────────────────────────────────────────────────────────────────── */
.keypad { gap: 8px; }
.keypad button { min-height: 64px; }
.keypad button.txt { font-size: 15px; }
.tiles { gap: 8px; }
.tiles button { min-height: 64px; }
.play .nav { gap: 8px; }
.play .nav .btn { min-height: 64px; font-size: 17px; }
.bot-btn.on-course { width: 64px; height: 64px; flex: none; }
.bot-btn.on-course .gbot { width: 44px; height: 44px; }
.play .strip .h { padding: 8px 0; }

/* ── 3. Type floor: nothing under 13 px ──────────────────────────────────────────────────────────────────────── */
.label, .totals .cell .l, .card th, .card td.lab, .card th.lab, .flag, .tiles button .l, .saved, .play .fcb .l,
.play .strip .h .n, .tabbar a, .wl-logo .brand-ed, .soc-tag, .soc-you, .pl-badge, .brand-ed, .ed-line,
.st-label, .st-kicker, .st-axis, .st-marklabel, .st-celltext, .st-tip-title, .st-table thead th, .st-scale, .st-score-k,
.st-strip-row > span:first-child, .st-strip-row--head > span, .st-gn--key, .st-callout-title, .st-kn-l, .st-kn-d, .st-badge { font-size: 13px; }
.tabbar a { letter-spacing: 0; }
.play .map .views > * { font-size: 14px; }
@media (max-width: 380px) { .play .map .views > * { font-size: 13px; padding: 0 9px; } }
text { font-size: max(13px, 1em); }
.hint, .small { font-size: max(13px, 1em); }

/* ── 4. Big numbers use the large optical size ────────────────────────────────────────────────────────────── */
.play .holehead .hn, .play .score-now .v, .keypad button, .tiles button .n, .play .fcb .v { font-variation-settings: "opsz" 144; }
.play .score-now .v.blank { color: var(--quiet); opacity: 1; }

/* ── 5. Day and night on the course ───────────────────────────────────────────────────────────────────────── */
/* The course screen is light and opaque by day (it reads faster in bright sun) and dark after sunset at the course.
   js/sun.js picks the tone; Me → "Course screen" can pin it to Light or Dark. */
:root[data-scene="play"][data-tone="night"] { --quiet: #A6ADA4; --ink-2: #E4DFD2; }
:root[data-scene="play"][data-tone="day"] {
  --paper: #FBFCFA; --surface: #FFFFFF; --surface-2: #E7EFE4; --ink: #0A1F14; --ink-2: #233629; --quiet: #46584D;
  --line: #CBD8C7; --line-2: #A3B79F; --brass-soft: #F1E6CF; --s1: #0C7B60; --s2: #8A5E1E; --s3: #3A4A98; --s4: #8A3E2E;
  color-scheme: light;
}
:root[data-scene="play"][data-tone="day"] body { background: var(--paper); }
:root[data-scene="play"][data-tone="day"] .btn.primary { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
:root[data-scene="play"][data-tone="day"] .keypad button.sel, :root[data-scene="play"][data-tone="day"] .tiles button.sel { background: #C99438; border-color: #C99438; color: #0A1F14; }
:root[data-scene="play"][data-tone="day"] .play .holehead .lie { color: #7E5A24; }
:root[data-scene="play"][data-tone="day"] .play .holehead .lie.down { color: #1D6B45; }
:root[data-scene="play"][data-tone="day"] .play .map { background: #0E1612; }
@media (min-width: 700px) { :root[data-scene="play"][data-tone="day"] body { background: var(--surface-2); } }

/* ── 6. Short phones keep the targets, not the air ────────────────────────────────────────────────────────── */
@media (max-height: 720px) {
  .keypad button, .play .nav .btn, .tiles button { min-height: 56px; }
  .keypad { gap: 8px; }
  .bot-btn.on-course { width: 56px; height: 56px; }
}

/* Luke, 2026-10-11: by day too, the frame around the map stays black (never a white border). Only the page behind the map
   and the top bar change; the plates on the map and the score area keep their daytime look. */
:root[data-scene="play"][data-tone="day"] body, :root[data-scene="play"][data-tone="day"] .play { background: #0B0F0D; }
:root[data-scene="play"][data-tone="day"] .play .bar, :root[data-scene="play"][data-tone="day"] .play .bar a,
:root[data-scene="play"][data-tone="day"] .play .bar .btn, :root[data-scene="play"][data-tone="day"] .play .bar .title { color: #F3EEE2; }
:root[data-scene="play"][data-tone="day"] .play .bar .quiet, :root[data-scene="play"][data-tone="day"] .play .bar .small { color: #C9D2C8; }
@media (min-width: 700px) { :root[data-scene="play"][data-tone="day"] body { background: #050806; } }
:root[data-scene="play"][data-tone="day"] .play .bar .saved { color: #C9D2C8; }
