/* ==========================================================================
 * MATH_SPEED_CARDS_CARTRIDGE — styles.css
 * 2026-06-27 BUILD: Readability locked. No font below 16px. High contrast.
 * Phone-first tap targets. System font stack only — no external fonts/CDNs.
 * Shared byte-identical across DIRECT / APPLE / GOOGLE targets.
 * ========================================================================== */

:root {
  --bg: #0f1b2d;
  --panel: #16263f;
  --panel-2: #1d3252;
  --ink: #ffffff;
  --ink-soft: #dbe7f5;     /* still high contrast on dark panels */
  --accent: #ffd34d;
  --accent-ink: #2a1f00;
  --good: #43d39e;
  --bad: #ff7a7a;
  --line: #2c456b;
  --focus: #9ad0ff;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;            /* base — never below 16px anywhere */
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 40px;
  min-height: 100vh;
}

h1 { font-size: 30px; margin: 8px 0 6px; line-height: 1.2; }
h2 { font-size: 24px; margin: 22px 0 10px; }
h3 { font-size: 20px; margin: 16px 0 8px; }
p  { font-size: 18px; margin: 8px 0; color: var(--ink); }

.muted { color: var(--ink-soft); font-size: 18px; }

.brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 14px;
}
.brandbar .title { font-size: 22px; font-weight: 800; }

.hook {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  margin: 10px 0 14px;
}

.promise {
  font-size: 18px;
  color: var(--ink-soft);
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* Cards / panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}

.statgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.stat {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.stat .label { font-size: 16px; color: var(--ink-soft); }
.stat .value { font-size: 28px; font-weight: 800; margin-top: 4px; }

/* Buttons — large tap targets, min 48px tall */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  width: 100%;
  padding: 14px 18px;
  font-size: 20px;
  font-weight: 700;
  border-radius: var(--radius);
  border: 2px solid transparent;
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  margin: 8px 0;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.good { background: var(--good); color: #07291f; }
.btn.bad  { background: var(--bad); color: #2a0000; }

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Selectable option chips */
.options { display: grid; grid-template-columns: 1fr; gap: 10px; }
.option {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 12px 16px;
  font-size: 19px;
  border-radius: var(--radius);
  background: var(--panel-2);
  border: 2px solid var(--line);
  color: var(--ink);
  cursor: pointer;
}
.option.selected { border-color: var(--accent); background: #243a5e; }
.option:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Inputs */
label { font-size: 18px; display: block; margin: 10px 0 4px; }
input[type="text"],
input[type="number"],
input[type="tel"] {
  width: 100%;
  min-height: 54px;
  font-size: 22px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: #0c1626;
  color: var(--ink);
}
input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }

/* Play screen */
.play-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.timer {
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
}
.timer.low { color: var(--bad); }

.problem {
  font-size: 52px;
  font-weight: 800;
  text-align: center;
  margin: 18px 0;
  letter-spacing: 1px;
}

.livestats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.livestat {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  text-align: center;
}
.livestat .n { font-size: 24px; font-weight: 800; }
.livestat .k { font-size: 16px; color: var(--ink-soft); }
.livestat.correct .n { color: var(--good); }
.livestat.wrong .n { color: var(--bad); }

/* Results */
.big-result { font-size: 40px; font-weight: 800; text-align: center; margin: 10px 0; }
.badge {
  display: inline-block;
  font-size: 18px;
  font-weight: 800;
  background: var(--good);
  color: #07291f;
  padding: 6px 12px;
  border-radius: 999px;
  margin: 6px 0;
}

/* Review list */
.review-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 10px 0;
  background: var(--panel-2);
}
.review-item .q { font-size: 22px; font-weight: 700; }
.review-item .row { font-size: 18px; margin-top: 4px; }
.review-item .your { color: var(--bad); }
.review-item .right { color: var(--good); }

/* Settings */
.toast {
  font-size: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 12px 0;
}

.langtoggle { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (min-width: 560px) {
  .options { grid-template-columns: 1fr 1fr; }
}
