@font-face { font-family: "Archivo Black"; src: url("../fonts/archivo-black-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("../fonts/work-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("../fonts/work-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("../fonts/work-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("../fonts/work-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --teal: #1F6F78;
  --teal-dark: #154F56;
  --orange: #F17A2A;
  --orange-dark: #D9661A;
  --cream: #F7F1E3;
  --paper: #FFFAF0;
  --line: #EADFC2;
  --sun: #E9C46A;
  --ink: #2B2B2B;
  --muted: #6B6459;
  --good: #2F7A4D;
  --good-bg: #E3F1E6;
  --bad: #B4472A;
  --bad-bg: #FBE6DE;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom);
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
h1, h2 { margin: 0; }
.mono { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; }

.page { max-width: 760px; margin: 0 auto; padding: 16px 16px 32px; }

/* ---------- header ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--teal);
  color: var(--cream);
  border-radius: 20px;
  padding: 20px 22px;
}
.hero-logo { flex: none; width: 72px; height: 70px; }
.hero-text { flex: 1 1 200px; min-width: 0; }
.eyebrow { font-weight: 700; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sun); }
.hero h1 { font-family: "Archivo Black", sans-serif; font-weight: 400; font-size: 36px; line-height: 1.05; margin: 2px 0 2px; }
.byline { font-weight: 600; font-size: 14px; color: var(--sun); }
.tagline { margin: 6px 0 0; font-size: 15px; opacity: 0.9; }
.install { flex: none; }

/* ---------- buttons ---------- */
.btn {
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 12px 20px;
  min-height: 48px;
  font-family: "Archivo Black", sans-serif;
  font-size: 15px;
}
.btn.primary { background: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-dark); }
.btn.secondary { background: var(--paper); color: var(--teal-dark); border-color: var(--teal); }
.btn.outline { background: transparent; color: var(--teal-dark); border-color: var(--teal); min-height: 44px; padding: 8px 18px; }
.btn.wide { width: 100%; }
.link { background: none; border: 0; padding: 0 0 0 10px; color: var(--teal); text-decoration: underline; font-size: inherit; }
.foot .link { padding: 0; }

/* ---------- tabs ---------- */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.tab {
  min-height: 56px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--teal-dark);
  font-family: "Archivo Black", sans-serif;
  font-size: 15px;
  padding: 8px;
}
.tab.active { background: var(--orange); border-color: var(--orange); color: #fff; }

/* ---------- card ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.card-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.label { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.help { font-size: 14px; color: var(--muted); margin-top: 6px; }

.sound-pick { margin-top: 16px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; background: #F1E8D0; padding: 5px; border-radius: 14px; }
.seg-btn { border: 0; background: transparent; border-radius: 10px; min-height: 46px; font-weight: 600; color: var(--teal-dark); }
.seg-btn.active { background: var(--teal); color: #fff; }

/* ---------- question stage ---------- */
.stage { text-align: center; padding: 20px 0 6px; }
.ask { font-family: "Archivo Black", sans-serif; font-weight: 400; font-size: 24px; line-height: 1.15; }
.pill { display: block; width: fit-content; margin: 10px auto 0; background: #E5EFEF; color: var(--teal-dark); font-weight: 600; font-size: 14px; padding: 5px 14px; border-radius: 999px; }
.play {
  display: flex; align-items: center; justify-content: center;
  width: 104px; height: 104px; margin: 16px auto 0;
  border: 0; border-radius: 50%;
  background: var(--orange); color: #fff;
  box-shadow: 0 6px 0 var(--orange-dark);
  padding-left: 6px;
}
.play:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--orange-dark); }
.play-label { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* ---------- answers ---------- */
.choices { display: grid; gap: 10px; margin-top: 18px; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choices.one { grid-template-columns: 1fr; }
.choice {
  display: flex; align-items: center; gap: 10px; text-align: left;
  min-height: 60px; padding: 10px 14px;
  background: #fff; border: 2px solid var(--line); border-radius: 14px;
  font-weight: 600; font-size: 17px;
}
.choice:not(:disabled):hover { border-color: var(--teal); }
.choice .num { flex: none; width: 24px; height: 24px; border-radius: 6px; background: #F1E8D0; color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.choice .mark { margin-left: auto; font-size: 20px; }
.choice.right { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.choice.wrong { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.choice.dim { opacity: 0.5; }

/* ---------- answer reveal ---------- */
.reveal { margin-top: 16px; border-radius: 16px; padding: 16px; border: 2px solid; }
.reveal.good { background: var(--good-bg); border-color: var(--good); }
.reveal.bad { background: var(--bad-bg); border-color: var(--bad); }
.verdict { font-family: "Archivo Black", sans-serif; font-size: 20px; }
.reveal.good .verdict { color: var(--good); }
.reveal.bad .verdict { color: var(--bad); }
.reveal-body { margin-top: 10px; }
.reveal-big { font-family: "Archivo Black", sans-serif; font-size: 28px; line-height: 1.1; }
.reveal-sub { margin: 4px 0 10px; color: var(--muted); font-size: 15px; }
.keys { display: block; width: 100%; height: auto; margin-top: 4px; }
.prog-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.prog-card { background: rgba(255,255,255,0.7); border-radius: 12px; padding: 10px; text-align: center; }
.prog-roman { font-family: "Archivo Black", sans-serif; color: var(--teal-dark); font-size: 15px; }
.prog-symbol { font-weight: 700; font-size: 18px; margin: 2px 0 6px; }
.reveal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* ---------- practising row ---------- */
.practise-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line); }
.summary { font-weight: 600; font-size: 16px; }

.tip { display: none; text-align: center; font-size: 13px; color: var(--muted); margin: 14px 0 0; }
@media (hover: hover) and (pointer: fine) { .tip { display: block; } }
.foot { text-align: center; font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ---------- sheets ---------- */
.overlay { position: fixed; inset: 0; background: rgba(43,43,43,0.55); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet { background: var(--paper); width: 100%; max-width: 580px; max-height: 90vh; max-height: 90dvh; display: flex; flex-direction: column; border-radius: 22px 22px 0 0; }
@media (min-width: 640px) { .overlay { align-items: center; } .sheet { border-radius: 22px; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 8px; }
.sheet-head h2 { font-family: "Archivo Black", sans-serif; font-weight: 400; font-size: 22px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-size: 16px; }
.sheet-body { overflow-y: auto; padding: 4px 18px 12px; }
.sheet-foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.hint { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { border: 2px solid var(--teal); background: transparent; color: var(--teal-dark); border-radius: 999px; padding: 8px 14px; min-height: 40px; font-weight: 600; font-size: 14px; }
.chip.active { background: var(--teal); color: #fff; }
.group-title { margin: 16px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal-dark); white-space: pre; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check-list { display: grid; gap: 8px; }
.check { display: flex; align-items: center; gap: 10px; text-align: left; min-height: 48px; padding: 8px 12px; background: #fff; border: 2px solid var(--line); border-radius: 12px; font-size: 15px; font-weight: 500; }
.check .box { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid #C9BD9B; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; }
.check.on { border-color: var(--teal); }
.check.on .box { background: var(--teal); border-color: var(--teal); }
.check:disabled { opacity: 0.75; }
.install-card { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 4px 14px 10px; margin-bottom: 10px; }
.install-card.mine { border-color: var(--orange); }
.install-card ol { margin: 0; padding-left: 20px; font-size: 15px; }
.install-card li { margin: 4px 0; }

@media (max-width: 480px) {
  .hero h1 { font-size: 30px; }
  .install { width: 100%; }
  .choices.two { gap: 8px; }
  .choice { font-size: 16px; padding: 8px 10px; }
  .check-grid { grid-template-columns: 1fr; }
  .reveal-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) { .play, .choice, .tab { transition: transform 0.08s, background 0.15s, border-color 0.15s; } }
