/* Banter Gym. Hardcourt teal, chalk-white court lines, one optic-yellow ball. */

@font-face { font-family: "Big Shoulders Display"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/big-shoulders-display-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-weight: 800; font-style: normal; font-display: swap; src: url("fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-weight: 900; font-style: normal; font-display: swap; src: url("fonts/big-shoulders-display-latin-900-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 100 900; font-style: normal; font-display: swap; src: url("fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2"); }

:root {
  --court: #0d3b42;
  --court-2: #12505a;
  --chalk: #f1f0e8;
  --dim: rgba(241, 240, 232, 0.74);
  --line: rgba(241, 240, 232, 0.9);
  --line-soft: rgba(241, 240, 232, 0.28);
  --faint: rgba(241, 240, 232, 0.07);
  --ball: #d4f23c;
  --on-ball: #0d3b42;
  --good: #6fe0b0;
  --near: #f5c451;
  --off: #ff8a73;
  --focus: #d4f23c;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 600px;
}

@media (prefers-color-scheme: light) {
  :root {
    --court: #f3f6f4;
    --court-2: #e3ebe8;
    --chalk: #0d3b42;
    --dim: rgba(13, 59, 66, 0.78);
    --line: rgba(13, 59, 66, 0.9);
    --line-soft: rgba(13, 59, 66, 0.26);
    --faint: rgba(13, 59, 66, 0.07);
    --ball: #d4f23c;
    --on-ball: #0d3b42;
    --good: #0f7a55;
    --near: #8f6500;
    --off: #b63a24;
    --focus: #0d3b42;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--court); color: var(--chalk); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--body); font-size: 17px; line-height: 1.5; font-weight: 450;
  background: transparent; color: var(--chalk);
  padding-bottom: env(safe-area-inset-bottom);
}
/* court markings, very quiet */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 50% 112%, transparent 0 47%, var(--faint) 47.2% 47.8%, transparent 48%),
    linear-gradient(var(--faint), var(--faint)) 0 78% / 100% 2px no-repeat;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { fill: currentColor; width: 1.25em; height: 1.25em; flex: none; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ball); color: var(--on-ball); padding: 10px 14px; border-radius: 8px; z-index: 50; font-weight: 700; }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }

/* -------------------------------------------------------------- header */
.top {
  max-width: var(--maxw); margin: 0 auto; padding: calc(10px + env(safe-area-inset-top)) 16px 10px 20px;
  display: flex; align-items: center; gap: 10px; border-bottom: 2px solid var(--line);
}
.brand { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1; letter-spacing: 0.01em; margin-right: auto; }
.icon { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; border-radius: 10px; color: var(--chalk); }
.icon:hover { background: var(--faint); }
.chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--dim);
  border: 1.5px solid var(--line-soft); border-radius: 999px; padding: 4px 11px 4px 9px; white-space: nowrap;
}
.chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--dim); }
.chip[data-state="on"]::before { background: var(--good); }
.chip[data-state="off"]::before { background: var(--near); }
.chip[data-state="code"]::before { background: var(--off); }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 40px; }
.screen { padding-top: 22px; }

.title { font-family: var(--display); font-weight: 900; font-size: clamp(36px, 10vw, 52px); line-height: 0.98; letter-spacing: 0.005em; }
.title.small { font-size: 34px; margin-bottom: 14px; }
.sec { font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.1; color: var(--dim); margin: 28px 0 10px; }
.goal { margin-top: 8px; color: var(--dim); }
.fine { font-size: 14.5px; line-height: 1.45; color: var(--dim); margin-top: 10px; }

/* ---------------------------------------------------------------- home */
.streak { display: flex; align-items: center; gap: 20px; padding: 6px 0 22px; }
.streak-num { display: flex; align-items: baseline; gap: 8px; color: var(--ball); font-family: var(--display); font-weight: 900; line-height: 0.82; }
.streak-num > span:first-child { font-size: clamp(104px, 30vw, 148px); }
.streak-unit { font-size: 28px; font-weight: 800; color: var(--chalk); }
.streak-side { min-width: 0; }
.streak-msg { font-size: 16px; line-height: 1.35; font-weight: 600; }
.week { display: flex; gap: 8px; margin-top: 12px; }
.week li { display: grid; justify-items: center; gap: 4px; font-size: 12.5px; color: var(--dim); }
.week i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-soft); display: block; }
.week li.done i { background: var(--ball); border-color: var(--ball); }
.week li.today i { border-color: var(--chalk); }
.week li.today { color: var(--chalk); font-weight: 700; }

.menu { border-bottom: 2px solid var(--line); }
.row {
  width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; text-align: left;
  padding: 18px 4px 18px 0; background: none; border: 0; border-top: 2px solid var(--line); color: var(--chalk);
}
.row:hover { background: var(--faint); }
.row-main { display: grid; gap: 4px; min-width: 0; }
.row-title { font-family: var(--display); font-weight: 800; font-size: 32px; line-height: 1; }
.row-sub { color: var(--dim); font-size: 16px; line-height: 1.4; }
.row-time { font-size: 14px; color: var(--dim); white-space: nowrap; padding-top: 8px; }
.row .who { display: block; font-size: 14.5px; color: var(--dim); }
.row[role="radio"] { position: relative; padding-left: 18px; }
.row[role="radio"]::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 5px; border-radius: 3px; background: transparent; }
.row[aria-checked="true"] { background: var(--faint); }
.row[aria-checked="true"]::before { background: var(--ball); }
.row[role="radio"] .row-title { font-size: 28px; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 13px 6px; font-weight: 700; min-height: 48px; }
.seg button + button { border-left: 2px solid var(--line); }
.seg button[aria-checked="true"] { background: var(--ball); color: var(--on-ball); }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 11px 20px;
  background: none; border: 2px solid var(--line); border-radius: 12px; font-weight: 700; color: var(--chalk);
}
.btn:hover { background: var(--faint); }
.btn.primary { background: var(--ball); color: var(--on-ball); border-color: var(--ball); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.quiet { border-color: transparent; color: var(--chalk); padding: 10px 12px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-soft); text-underline-offset: 4px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.actions .btn.primary { flex: 1 1 200px; }
.actions.sticky { position: sticky; bottom: 0; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--court) 28%); margin-top: 18px; }

/* --------------------------------------------------------------- stage */
.prompt { font-size: clamp(21px, 5.6vw, 26px); line-height: 1.32; font-weight: 650; margin-top: 16px; max-width: 30ch; }
.story-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.story-tools .btn.quiet { padding-left: 0; }
.timer { font-family: var(--display); font-weight: 800; font-size: 60px; line-height: 1; margin-right: auto; }
.timer .of { font-size: 20px; color: var(--dim); font-weight: 700; }

[data-mode="chat"] .only-story, [data-mode="chat"] .only-wit,
[data-mode="story"] .only-chat, [data-mode="story"] .only-wit,
[data-mode="wit"] .only-chat, [data-mode="wit"] .only-story { display: none; }

.log { display: grid; gap: 14px; margin-top: 20px; padding-bottom: 6px; }
.line { scroll-margin-bottom: 280px; max-width: 90%; padding: 2px 0 2px 14px; border-left: 4px solid var(--line-soft); }
.line .who { display: block; font-size: 13.5px; color: var(--dim); font-weight: 600; }
.line p { font-size: 18.5px; line-height: 1.38; }
.line.me { justify-self: end; border-left: 0; border-right: 4px solid var(--ball); padding: 2px 14px 2px 0; text-align: right; }
.line.typing p { color: var(--dim); }

.live { min-height: 1.6em; margin-top: 14px; color: var(--dim); font-style: italic; font-size: 17px; }
.hint { margin-top: 14px; padding: 4px 0 4px 14px; border-left: 4px solid var(--ball); }
.hint b { display: block; font-size: 13.5px; color: var(--dim); font-weight: 600; }
.hint p { font-size: 17.5px; }
.hint .why { font-size: 14.5px; color: var(--dim); }
.notice { margin-top: 14px; padding: 8px 0 8px 14px; border-left: 4px solid var(--near); font-size: 15.5px; line-height: 1.4; }
.notice.bad { border-left-color: var(--off); }

.typebox { display: grid; gap: 10px; margin-top: 14px; }
.typebox textarea { width: 100%; background: var(--court-2); border: 2px solid var(--line-soft); border-radius: 12px; padding: 12px 14px; resize: vertical; min-height: 72px; line-height: 1.4; }
.typebox textarea:focus { border-color: var(--line); outline: none; }

.controls {
  position: sticky; bottom: 0; margin: 18px -20px 0; padding: 18px 20px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--court) 22%); text-align: center;
}
.mic-wrap { display: grid; place-items: center; padding: 14px 0 6px; }
.mic {
  --lvl: 0; position: relative; width: 104px; height: 104px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--chalk); color: var(--court); transition: background 0.15s;
}
.mic-icon { width: 44px; height: 44px; position: relative; }
.mic-ring {
  position: absolute; inset: -9px; border-radius: 50%; border: 3px solid var(--line); opacity: 0.55;
  transform: scale(calc(1 + var(--lvl) * 0.32)); transition: transform 0.08s linear, opacity 0.15s, border-color 0.15s;
}
.mic[aria-pressed="true"] { background: var(--ball); color: var(--on-ball); }
.mic[aria-pressed="true"] .mic-ring { border-color: var(--ball); opacity: 1; }
.mic[data-pulse="1"] .mic-ring { animation: pulse 1.4s ease-in-out infinite; }
.mic[disabled] { opacity: 0.45; cursor: not-allowed; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
.mic-label { margin-top: 12px; font-weight: 650; min-height: 1.5em; }
.sub { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px 6px; margin-top: 4px; }

/* ------------------------------------------------------------- results */
.headline { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 8.6vw, 44px); line-height: 1.04; }
.try { margin-top: 22px; padding: 2px 0 6px 16px; border-left: 6px solid var(--ball); }
.try .sec { margin-top: 0; }
.try p { font-size: 20px; line-height: 1.38; font-weight: 600; }
.plain { display: grid; gap: 10px; }
.plain li { padding-left: 14px; border-left: 3px solid var(--line-soft); }
.quote { font-size: 20px; line-height: 1.38; padding-left: 14px; border-left: 3px solid var(--ball); font-weight: 600; }
.ideas { display: grid; gap: 14px; }
.ideas li { padding-left: 14px; border-left: 3px solid var(--ball); }
.ideas .move { display: block; font-size: 13.5px; color: var(--dim); font-weight: 600; }
.ideas p { font-size: 19px; line-height: 1.36; font-weight: 600; }

.metrics { border-bottom: 2px solid var(--line); }
.metric { border-top: 2px solid var(--line); padding: 14px 0 16px; display: grid; gap: 8px; }
.metric-head { display: flex; align-items: center; gap: 12px; }
.metric-name { font-weight: 700; margin-right: auto; }
.metric-big { display: flex; align-items: baseline; gap: 10px; }
.metric-val { font-family: var(--display); font-weight: 900; font-size: 52px; line-height: 0.9; }
.metric-unit { font-size: 15px; color: var(--dim); font-weight: 600; }
.metric-zone { font-size: 13.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 2px solid currentColor; }
.metric[data-zone="good"] .metric-zone, .metric[data-zone="good"] .pin { color: var(--good); }
.metric[data-zone="near"] .metric-zone, .metric[data-zone="near"] .pin { color: var(--near); }
.metric[data-zone="off"] .metric-zone, .metric[data-zone="off"] .pin { color: var(--off); }
.metric[data-zone="none"] .metric-val { color: var(--dim); }
.bar { position: relative; height: 10px; border-radius: 5px; background: var(--faint); box-shadow: inset 0 0 0 1.5px var(--line-soft); margin: 6px 0 2px; }
.band { position: absolute; top: 0; bottom: 0; background: var(--line-soft); border-radius: 5px; }
.pin { position: absolute; top: -6px; width: 6px; height: 22px; margin-left: -3px; border-radius: 3px; background: currentColor; box-shadow: 0 0 0 2px var(--court); }
.metric-note { font-size: 15px; color: var(--dim); line-height: 1.4; }

/* -------------------------------------------------------------- dialog */
dialog { background: var(--court-2); color: var(--chalk); border: 2px solid var(--line); border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); }
dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.dlg { padding: 22px 20px 20px; display: grid; gap: 16px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--ball); flex: none; }
.check > span { display: grid; gap: 2px; }
.check .fine { margin-top: 0; }
.field { display: grid; gap: 6px; }
.field input { background: var(--court); border: 2px solid var(--line-soft); border-radius: 10px; padding: 11px 12px; }
.field input:focus { border-color: var(--line); outline: none; }
.dlg .actions { margin-top: 4px; }

@media (min-width: 700px) {
  .screen { padding-top: 34px; }
  .row-title { font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.title + .menu { margin-top: 20px; }
