/* ==========================================================================
 * 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; flex: 1 1 auto; min-width: 0; }
.brandbar-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.hdr-holder-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  text-decoration: none;
  color: #1a1300;
  white-space: nowrap;
  background: linear-gradient(180deg, #ffe08a 0%, #e8c04a 40%, #d4af37 100%);
  border: 1px solid #a07820;
  box-shadow:
    0 3px 0 #8a6a18,
    0 8px 14px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.hdr-holder-btn:hover { filter: brightness(1.04); }
.hdr-holder-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 #8a6a18;
}
.btn.btn-settings {
  width: auto;
  min-height: 44px;
  font-size: 16px;
  padding: 8px 14px;
  margin: 0;
}

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

/* Tagline under the 5-minute hook (moved from bottom of home) */
.tagline-promise {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 16px;
  line-height: 1.45;
  opacity: 0.95;
}

.promise {
  font-size: 16px;
  color: #ffffff;
  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 — depth only, no shimmer (no visual distraction) */
.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: 1px solid transparent;
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  margin: 8px 0;
  text-align: center;
  transition: transform .06s ease, filter .12s ease, box-shadow .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.btn.primary {
  color: var(--accent-ink);
  border-color: #8a6a18;
  background: linear-gradient(180deg, #ffe08a 0%, #e8c04a 38%, #d4af37 72%, #b8922a 100%);
  box-shadow:
    0 4px 0 #8a6a18,
    0 10px 18px rgba(0, 0, 0, .28),
    inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn.primary:hover { filter: brightness(1.03); }
.btn.ghost {
  color: var(--ink);
  border-color: var(--line);
  background: linear-gradient(180deg, #2a3a52 0%, #1a2740 55%, #142033 100%);
  box-shadow:
    0 3px 0 #0a1018,
    0 8px 14px rgba(0, 0, 0, .25),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}
.btn.ghost:hover { filter: brightness(1.04); }
.btn.good {
  color: #07291f;
  border-color: #0f5c40;
  background: linear-gradient(180deg, #6ee7b7 0%, #34d399 40%, #10b981 75%, #059669 100%);
  box-shadow:
    0 4px 0 #065f46,
    0 10px 16px rgba(0, 0, 0, .25),
    inset 0 1px 0 rgba(255, 255, 255, .4);
}
.btn.bad {
  color: #2a0000;
  border-color: #7f1d1d;
  background: linear-gradient(180deg, #fca5a5 0%, #f87171 40%, #ef4444 75%, #dc2626 100%);
  box-shadow:
    0 4px 0 #7f1d1d,
    0 10px 16px rgba(0, 0, 0, .25),
    inset 0 1px 0 rgba(255, 255, 255, .35);
}

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

/* Privacy notice — bottom placement, standard 16px (no fine print) */
.math1-banner {
  border: 2px solid #c9a227;
  margin: 20px auto 12px;
  padding: 14px 16px;
  max-width: 720px;
  color: #ffffff;
  background: #152238;
  font-size: 16px;
  line-height: 1.5;
  border-radius: 12px;
  box-sizing: border-box;
}

.store-footer {
  margin: 16px auto 32px;
  padding: 14px 16px;
  max-width: 720px;
  color: #ffffff;
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
}
.store-footer a { color: #ffe08a; font-weight: 800; }

/* Proper footer contrast on dark blue MATH1 (no grey-on-blue) */
.yiq-copy-2026 {
  color: #ffffff !important;
  opacity: 1 !important;
  font-size: 16px !important;
  line-height: 1.55 !important;
  background: #152238;
  border: 1px solid #2c456b;
  border-radius: 12px;
  max-width: 720px;
  margin: 16px auto 12px !important;
}
.yiq-copy-2026 strong {
  color: #ffd34d !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.yiq-legal-footer {
  color: #ffffff !important;
  border-top: 1px solid #2c456b !important;
  background: #152238 !important;
  border-radius: 12px;
  max-width: 720px;
  margin: 16px auto 28px !important;
}
.yiq-legal-footer,
.yiq-legal-footer * {
  color: #ffffff !important;
  font-size: 16px !important;
  line-height: 1.55 !important;
}
.yiq-legal-footer a,
.yiq-legal-footer .yiq-id-link,
.yiq-legal-footer .yiq-legal-sig a {
  color: #ffd34d !important;
  font-weight: 800 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}
.yiq-legal-footer .yiq-legal-nav a {
  color: #1a1300 !important;
  text-decoration: none !important;
}
.yiq-legal-hint {
  color: #dbe7f5 !important;
  opacity: 1 !important;
}

/* 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; }
}
