/* Mind Gym shared look: color tokens (light and dark), fonts with offline fallbacks, base page and buttons.
   Each room keeps its own component styles and its own room tokens in its page. */
:root {
  --bg: #f3f4f7;
  --panel: #ffffff;
  --ink: #1b2130;
  --soft: #5b6478;
  --line: #d9dde6;
  --accent: #2f5bd3;
  --good: #1b7a43;
  --bad: #c2412d;
  --ctl: #7d8699;       /* control borders: at least 3 to 1 on the page and on panels */
  --on-accent: #ffffff; /* text on an accent background */
  --f-display: "Space Grotesk", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --f-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --f-mono: "JetBrains Mono", Consolas, "Cascadia Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #12151c; --panel: #1b202b; --ink: #e8ebf2; --soft: #9aa3b8; --line: #2c3342;
  --accent: #7d9cf2; --good: #4cc282; --bad: #ef7a64; --ctl: #6b7590; --on-accent: #10131a;
  color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #12151c; --panel: #1b202b; --ink: #e8ebf2; --soft: #9aa3b8; --line: #2c3342;
  --accent: #7d9cf2; --good: #4cc282; --bad: #ef7a64; --ctl: #6b7590; --on-accent: #10131a;
  color-scheme: dark }
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 24px 48px;
  overflow-wrap: break-word }
h1 { font-family: var(--f-display); font-size: 2rem; margin: 0; letter-spacing: -0.01em }
button.b, select { font: inherit; font-size: 0.95rem; border: 1px solid var(--ctl); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 7px 13px; cursor: pointer }
button.b.primary, a.b.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent) }
button.b:disabled { opacity: .45; cursor: default }
/* One focus ring for everything you can reach with the keyboard, in the page's accent (3 to 1 or more in both themes). */
:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible,
[tabindex]:focus-visible, [role=button]:focus-visible, [role=tab]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px }
/* Form fields show their edge clearly too. */
input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea { border-color: var(--ctl) }
/* Less motion when the person asks for it: no slides, fades or smooth scrolling. Timers still count down. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important }
}

/* The back bar at the top of every room: a back arrow to the gym home and, while a round or session is open, a second
   button back to the room's main screen (GYM.roomBack in settings.js). It stays on screen as the page scrolls. */
html { scroll-padding-top: 64px }
.gymbar { font-family: var(--f-display); font-size: 0.9rem; position: sticky; top: 0; z-index: 40; background: var(--bg);
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 2px 0; border-bottom: 1px solid var(--line) }
.gymbar a { color: var(--soft); text-decoration: none; gap: 6px; padding: 0 4px }
.gymbar a:hover { color: var(--ink); text-decoration: underline }
.gymbar .roomback { font-family: var(--f-display); font-size: 0.9rem }
.gymbar .roomback[hidden] { display: none }

/* Tap targets: every control is at least 44 by 44 CSS px to the finger (tablets), whatever it looks like. */
button, select, summary, [role=button], [role=tab], a.b { min-height: 44px; min-width: 44px }
button.b, a.b { display: inline-flex; align-items: center; justify-content: center; gap: 6px }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]), textarea { min-height: 44px }
summary { padding-block: 10px }
/* links inside text keep their sentence but get a full-height tap box */
a[href]:not(.b) { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; vertical-align: middle }
label:has(> input[type=checkbox]), label:has(> input[type=radio]) { min-height: 44px }

/* The one line shown when this browser keeps nothing (GYM.save could not write). */
.nostore { color: var(--ink); border-left: 4px solid var(--bad); background: var(--panel); padding: 8px 12px; border-radius: 0 8px 8px 0; margin: 0; max-width: 76ch }
/* The line shown when a timed call was left mid-way and thrown away. */
.away { color: var(--ink); border-left: 3px solid var(--accent); padding: 2px 10px; margin: 0; max-width: 76ch }
/* The build stamp at the foot of the home page. */
.stamp { color: var(--soft); font-family: var(--f-mono); font-size: 0.72rem; margin: 0 }

/* The one donation line, shown where a session has just finished. Never a gate. */
.donate { color: var(--soft); font-size: 0.85rem; margin: 0; max-width: 70ch }
.donate a { color: var(--accent) }

/* The version switch every room shares (assets/profile.js makes it): the same skill taught another way. */
.vbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center }
.vbar .vlab { font-family: var(--f-display); font-size: 0.9rem; color: var(--soft) }
.vswitch { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--ctl); border-radius: 8px; overflow: hidden; max-width: 100% }
.vswitch button { font: inherit; font-size: 0.9rem; border: 0; border-right: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 6px 13px; cursor: pointer;
  min-height: 44px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; text-align: left; line-height: 1.2 }
.vswitch button:last-child { border-right: 0 }
.vswitch button small { font-size: 0.74rem; color: var(--soft) }
.vswitch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent) }
.vswitch button[aria-pressed="true"] small { color: inherit }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .vswitch button[aria-pressed="true"] { color: #10131a } }
:root[data-theme="dark"] .vswitch button[aria-pressed="true"] { color: #10131a }
.vline { color: var(--soft); font-size: 0.9rem; margin: 0; max-width: 76ch }
.vline.check { color: var(--ink); border-left: 3px solid var(--accent); padding: 2px 10px }
