/* Parla — design tokens and components.
   Direction: Apple-clean surfaces; the one bold element is the letter tile,
   which shows every answer letter by letter. */

@font-face { font-family: "Nunito"; src: url("/fonts/nunito-800.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }

/* v0.2.3 "Soft clay" in Sky and sun colors (decision 0004). Variable names kept so every screen picks up the new look. */
:root {
  --paper: #FFFFFF;
  --page: #F3F8FF;          /* Mist page tint */
  --mist: #E9F2FF;          /* Mist: surfaces */
  --cloud: #BDE0FE;         /* Cloud: tiles, edges */
  --line: #D5E5FA;
  --ink: #102A43;
  --slate: #557089;
  --cobalt: #2563EB;        /* Sky: actions, current level */
  --cobalt-press: #1D4FC4;
  --cobalt-edge: #1A47B0;
  --cobalt-tint: #DCEAFF;
  --mint: #22A06B;          /* Fresh green: correct */
  --mint-edge: #17794F;
  --mint-tint: #DDF5EA;
  --coral: #FB8500;         /* Tangerine: mistakes, warm not alarming */
  --coral-ink: #B85F00;
  --coral-tint: #FFEBD6;
  --gold: #FFB703;          /* Sunflower: continue, rewards, streaks */
  --gold-edge: #D99A00;
  --gold-ink: #6B4A00;
  --gold-tint: #FFF3CC;
  --us-red: #B22234; --us-blue: #3C3B6E; --uk-blue: #012169; --uk-red: #C8102E;

  --display: ui-rounded, "SF Pro Rounded", "Nunito", -apple-system, system-ui, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, sans-serif;

  --r-tile: 16px; --r-card: 26px; --r-pill: 999px;
  --tab-h: 64px;
  --edge: 0 4px 0;          /* clay bottom edge */
  --shadow-lift: 0 2px 0 var(--line), 0 10px 24px rgba(37, 99, 235, .08);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #13254A; --page: #0B1730; --mist: #172C55; --cloud: #24427A; --line: #22396A;
    --ink: #EEF4FF; --slate: #9FB4D6;
    --cobalt: #4C86FF; --cobalt-press: #3B74F0; --cobalt-edge: #2452B8; --cobalt-tint: #1B3566;
    --mint: #34C084; --mint-edge: #1F8A5C; --mint-tint: #123A2B;
    --coral: #FF9A2E; --coral-ink: #FFB566; --coral-tint: #3D2610;
    --gold: #FFC533; --gold-edge: #C99400; --gold-ink: #2A1E00; --gold-tint: #3A3010;
    --shadow-lift: 0 2px 0 #08122A;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 17px/1.47 var(--text); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 8px; }
/* Every icon has a default size, so no screen can blow one up (v0.2.1 fix). */
.ic { width: 24px; height: 24px; flex: none; }
.row > .ic { color: var(--cobalt); }
.btn .ic { width: 20px; height: 20px; }
.node-dot .ic { width: 26px; height: 26px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  padding: calc(env(safe-area-inset-top) + 10px) 20px 10px;
}
.top-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.brand { font: 700 19px/1 var(--display); letter-spacing: -0.02em; margin-right: auto; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 26px; height: 26px; }
.brand-bare { margin-bottom: 16px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--cobalt); color: #fff; font: 700 15px/1 var(--display); display: grid; place-items: center; flex: none; }
.avatar[aria-current="page"] { box-shadow: 0 0 0 3px var(--cobalt-tint); }
.stat-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: var(--r-pill); background: var(--mist); font: 600 15px/1 var(--display); }
.stat-chip svg { width: 16px; height: 16px; }
.chip-streak { color: var(--gold); }
.chip-level { color: var(--cobalt); }

main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 20px 20px calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
main.bare { padding: calc(env(safe-area-inset-top) + 12px) 20px calc(env(safe-area-inset-bottom) + 16px); display: flex; flex-direction: column; }
main.bare > * { width: 100%; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs-inner { display: flex; width: 100%; max-width: 520px; }
.tab { flex: 1; height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--slate); font-size: 11px; font-weight: 600; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--cobalt); }

@media (min-width: 960px) {
  .tabs { top: 0; bottom: 0; right: auto; width: 96px; flex-direction: column; justify-content: center; border-top: 0; border-right: 1px solid var(--line); }
  .tabs-inner { flex-direction: column; }
  .tab { height: 76px; }
  .shell.has-tabs { padding-left: 96px; }
  main { padding-bottom: 60px; }
}

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.025em; margin: 0; }
h1 { font-size: 28px; line-height: 1.12; font-weight: 700; }
h2 { font-size: 21px; line-height: 1.18; font-weight: 700; }
h3 { font-size: 18px; line-height: 1.2; font-weight: 650; }
@media (min-width: 640px) { h1 { font-size: 36px; } h2 { font-size: 24px; } h3 { font-size: 19px; } }
p { margin: 0; }
.lede { color: var(--slate); font-size: 17px; line-height: 1.4; max-width: 34em; }
@media (min-width: 640px) { .lede { font-size: 19px; } }
.muted { color: var(--slate); }
.small { font-size: 14px; }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 22px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-title p { color: var(--slate); font-size: 15px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border-radius: var(--r-pill); border: 0;
  background: var(--cobalt); color: #fff; font-weight: 600; font-size: 17px;
  transition: transform .12s ease, background-color .12s ease; white-space: nowrap;
}
.btn:hover { background: var(--cobalt-press); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--mist); color: var(--ink); }
.btn.ghost:hover { background: var(--line); }
.btn.quiet { background: none; color: var(--cobalt); min-height: 44px; padding: 0 10px; }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 15px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--mist); display: inline-grid; place-items: center; color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- Letter tiles (signature element) ---------- */
.tiles { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tile {
  min-width: 40px; height: 52px; padding: 0 8px; border-radius: var(--r-tile);
  display: inline-grid; place-items: center;
  font: 650 26px/1 var(--display); background: var(--mist); color: var(--ink);
  border: 1.5px solid transparent;
}
.tile.ok { background: var(--mint-tint); color: var(--mint); }
.tile.bad { background: var(--coral-tint); color: var(--coral); border-color: color-mix(in srgb, var(--coral) 40%, transparent); }
.tile.missing { background: transparent; color: var(--coral); border: 1.5px dashed var(--coral); }
.tile.extra { background: transparent; color: var(--slate); text-decoration: line-through; }
.tile.hint { background: var(--paper); border: 1.5px solid var(--line); color: var(--slate); }
.tiles.small .tile { min-width: 30px; height: 40px; font-size: 20px; border-radius: 10px; }
.tiles.hero { flex-wrap: nowrap; gap: clamp(4px, 1.4vw, 8px); }
.tiles.hero .tile { min-width: 0; width: clamp(34px, 10.5vw, 56px); padding: 0; height: clamp(46px, 14vw, 72px); font-size: clamp(22px, 7vw, 38px); border-radius: clamp(10px, 3vw, 18px); }
.tiles.hero .gap { width: clamp(6px, 2vw, 14px); }
.tiles.hero .tile.lit { background: var(--cobalt); color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .tiles.hero .tile { animation: tile-in .5s cubic-bezier(.2, .9, .3, 1.2) both; }
  .tiles.reveal .tile { animation: tile-flip .32s ease both; }
}
@keyframes tile-in { from { opacity: 0; transform: translateY(14px) scale(.9); } }
@keyframes tile-flip { from { transform: rotateX(90deg); } }

/* ---------- Cards and lists ---------- */
.card { background: var(--mist); border-radius: var(--r-card); padding: 22px; }
.card.raised { background: var(--paper); box-shadow: var(--shadow-lift); border: 1px solid var(--line); }
.mission {
  background: var(--cobalt); color: #fff; border-radius: 24px; padding: 20px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center;
}
.mission h2 { color: #fff; }
.mission p { color: rgba(255, 255, 255, .82); }
.mission .btn { background: #fff; color: var(--cobalt); }
.mission .btn:hover { background: #F0F3FF; }
.ring { width: 76px; height: 76px; }
.ring circle { fill: none; stroke-width: 8; }
.ring .track { stroke: rgba(255, 255, 255, .25); }
.ring .fill { stroke: #fff; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .6s ease; }
.ring text { fill: #fff; font: 700 18px var(--display); }

.list { list-style: none; margin-left: 0; margin-right: 0; margin-bottom: 0; padding: 0; border-radius: var(--r-card); background: var(--mist); overflow: hidden; }
.list li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; min-height: 60px; width: 100%; background: none; border: 0; text-align: left; }
button.row:hover { background: color-mix(in srgb, var(--line) 50%, transparent); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; }
.row .sub { color: var(--slate); font-size: 14px; }
.word { font: 600 19px var(--display); letter-spacing: -0.01em; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mode { text-align: left; border: 0; border-radius: var(--r-card); background: var(--mist); padding: 18px; min-height: 132px; display: flex; flex-direction: column; gap: 8px; }
.mode:hover { background: var(--line); }
.mode svg { width: 28px; height: 28px; color: var(--cobalt); }
.mode .title { font: 650 17px var(--display); }
.mode .sub { color: var(--slate); font-size: 14px; line-height: 1.35; }

.metric { background: var(--mist); border-radius: var(--r-card); padding: 18px; }
.metric .value { font: 700 32px/1.1 var(--display); letter-spacing: -0.03em; }
.metric .label { color: var(--slate); font-size: 14px; margin-top: 4px; }

.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--cobalt); border-radius: 99px; }
.bar.mint > span { background: var(--mint); }

/* ---------- Journey path ---------- */
.journey { position: relative; padding: 4px 0; }
.chapter { margin-top: 28px; }
.chapter-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.chapter-head .flags { display: flex; gap: 4px; }
.chapter-head p { color: var(--slate); font-size: 15px; }
.path { position: relative; display: flex; flex-direction: column; gap: 14px; }
.path::before { content: ""; position: absolute; left: 31px; top: 24px; bottom: 24px; width: 3px; background: var(--line); border-radius: 3px; }
.node { position: relative; display: flex; align-items: center; gap: 16px; }
.node-dot {
  position: relative; z-index: 1; flex: none; width: 64px; height: 64px; border-radius: 20px;
  display: grid; place-items: center; font: 700 20px var(--display);
  background: var(--mist); color: var(--slate); border: 3px solid var(--paper);
}
.node.done .node-dot { background: var(--mint); color: #fff; }
.node.current .node-dot { background: var(--cobalt); color: #fff; box-shadow: 0 0 0 6px var(--cobalt-tint); }
.node.locked .node-dot { opacity: .55; }
.node.checkpoint .node-dot { border-radius: 50%; }
.node-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; padding: 4px 0; }
.node-body .title { font: 650 18px var(--display); }
.node-body .sub { color: var(--slate); font-size: 14px; }
.node-actions { display: flex; gap: 8px; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 99px; background: var(--mist); color: var(--slate); font-size: 12px; font-weight: 600; }
.tag.gold { background: var(--gold-tint); color: var(--gold); }

/* ---------- Exercise ---------- */
.ex { max-width: 560px; margin: 0 auto; }
.ex-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ex-top .bar { flex: 1; height: 10px; }
.ex-kind { color: var(--slate); font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.ex-prompt { font: 650 23px/1.25 var(--display); letter-spacing: -0.02em; }
.ex-sentence { font-size: 21px; line-height: 1.5; }
.blank { display: inline-block; min-width: 3.5em; border-bottom: 2.5px solid var(--cobalt); color: var(--cobalt); text-align: center; font-weight: 600; }
.speak { display: flex; justify-content: center; gap: 14px; margin: 18px 0; }
.speak-main { width: 80px; height: 80px; border-radius: 50%; border: 0; background: var(--cobalt); color: #fff; display: grid; place-items: center; }
.speak-main svg { width: 34px; height: 34px; }
.speak-main:active { transform: scale(.96); }
.speak-slow { align-self: center; }
.answer {
  width: 100%; height: 58px; border-radius: 18px; border: 2px solid var(--line); background: var(--paper);
  padding: 0 20px; font: 600 26px var(--display); letter-spacing: 0.01em; text-align: center;
}
.answer:focus { outline: none; border-color: var(--cobalt); }
.options { display: grid; gap: 10px; }
.option {
  min-height: 54px; border-radius: 18px; border: 2px solid var(--line); background: var(--paper);
  font: 600 21px var(--display); padding: 10px 18px; display: flex; align-items: center; gap: 12px; text-align: left;
}
.option:hover { border-color: var(--cobalt); }
.option.picked-ok { border-color: var(--mint); background: var(--mint-tint); color: var(--mint); }
.option.picked-bad { border-color: var(--coral); background: var(--coral-tint); color: var(--coral); }
.option.reveal-ok { border-color: var(--mint); }
.option .key { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--mist); display: grid; place-items: center; font: 600 14px var(--text); color: var(--slate); }

.feedback { margin-top: 14px; border-radius: 20px; padding: 16px; }
.feedback.ok { background: var(--mint-tint); }
.feedback.bad { background: var(--coral-tint); }
.feedback h3 { margin-bottom: 10px; }
.feedback.ok h3 { color: var(--mint); }
.feedback.bad h3 { color: var(--coral); }
.ex-actions { margin-top: 14px; display: flex; gap: 10px; }
.ex-actions .btn { flex: 1; }

/* Flashcards */
.flash { perspective: 1200px; }
.flash-card {
  position: relative; height: min(280px, 42dvh); border: 0; width: 100%; background: none; padding: 0;
  transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3, .7, .3, 1);
}
.flash-card.flipped { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; border-radius: 28px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px;
  background: var(--mist); text-align: center;
}
.flash-face.back { transform: rotateY(180deg); background: var(--cobalt-tint); }
.flash-word { font: 700 38px/1.1 var(--display); letter-spacing: -0.02em; }
@media (prefers-reduced-motion: reduce) { .flash-card { transition: none; } }

/* US/UK */
.side { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--slate); }
.flag { width: 28px; height: 19px; border-radius: 4px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px var(--line); }
.landmark { width: 64px; height: 64px; color: var(--ink); opacity: .85; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.duo .card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }

/* Onboarding */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 24px) 24px calc(env(safe-area-inset-bottom) + 24px); }
.welcome .tiles { justify-content: flex-start; }
.welcome.stack-lg > * + * { margin-top: 24px; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; }
.input { height: 54px; border-radius: 16px; border: 2px solid var(--line); background: var(--paper); padding: 0 18px; font-size: 19px; width: 100%; }
.input:focus { outline: none; border-color: var(--cobalt); }
.error { color: var(--coral); font-size: 15px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { min-height: 46px; padding: 0 18px; border-radius: 99px; border: 2px solid var(--line); background: var(--paper); font-weight: 600; }
.seg button[aria-pressed="true"] { border-color: var(--cobalt); background: var(--cobalt-tint); color: var(--cobalt); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.lvl-badge { width: 56px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 700 17px var(--display); background: var(--mist); }
.lvl-badge.done { background: var(--mint-tint); color: var(--mint); }
.lvl-badge.now { background: var(--cobalt); color: #fff; }

table.equiv { width: 100%; border-collapse: collapse; font-size: 15px; }
table.equiv th, table.equiv td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); }
table.equiv th { color: var(--slate); font-weight: 600; border-top: 0; }
table.equiv tr.you td { color: var(--cobalt); font-weight: 700; }

.chart { width: 100%; height: 140px; }
.chart rect.b { fill: var(--cobalt); }
.chart rect.z { fill: var(--line); }
.chart text { fill: var(--slate); font: 11px var(--text); }

.celebrate { text-align: center; padding-top: 12px; }
.big-num { font: 800 64px/1 var(--display); letter-spacing: -0.04em; color: var(--cobalt); }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 14px; font-weight: 600; z-index: 20; max-width: calc(100% - 40px); }
.empty { text-align: center; padding: 32px 20px; color: var(--slate); }

/* Weekly strip and badges (v0.2) */
.week { display: flex; gap: 6px; }
.week .day { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font: 600 13px var(--display); background: var(--paper); color: var(--slate); border: 1.5px solid var(--line); }
.week .day.met { background: var(--mint); color: #fff; border-color: var(--mint); }
.week .day.today { border-color: var(--cobalt); }
.week .day.on-dark { background: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .85); border-color: transparent; }
.week .day.on-dark.met { background: #fff; color: var(--cobalt); }
.week .day.on-dark.today { border-color: #fff; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; text-align: left; }
.badge { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 18px; background: var(--mist); color: var(--slate); }
.badge svg { width: 32px; height: 32px; flex: none; }
.badge .title { font: 650 16px var(--display); color: var(--ink); }
.badge .sub { font-size: 13px; }
.badge:not(.earned) .title { color: var(--slate); }
.badge.earned { background: var(--gold-tint); }
.badge.earned svg { color: var(--gold); }
.mission .small { color: rgba(255, 255, 255, .82); }
.mission-week { grid-column: 1 / -1; }
.week { flex-wrap: wrap; }

/* Inline mistake marks (v0.2.1): your answer is shown where you typed it, with each letter marked. */
.mark { margin: 4px 0 2px; }
.tiles.fit { flex-wrap: nowrap; gap: 4px; }
.tiles.fit .tile {
  min-width: 0; padding: 0; position: relative;
  width: min(44px, calc((min(100vw, 560px) - 48px) / var(--n) - 4px));
  height: min(56px, calc((min(100vw, 560px) - 48px) / var(--n) * 1.3));
  font-size: min(28px, calc((min(100vw, 560px) - 48px) / var(--n) * .62)); border-radius: 10px;
}
.tile .was { position: absolute; top: -9px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--paper); color: var(--slate); border: 1px solid var(--line); font: 600 11px/16px var(--text); text-decoration: line-through; }
.tiles.fit .tile.extra { background: var(--mist); color: var(--slate); text-decoration: line-through; text-decoration-thickness: 2px; }
.tiles.fit .tile.missing { background: var(--coral-tint); }
.mark-label { font-size: 13px; font-weight: 600; color: var(--slate); margin: 12px 0 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 13px; color: var(--slate); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; font-style: normal; }
.legend .k-bad { background: var(--coral); }
.legend .k-miss { border: 1.5px dashed var(--coral); }
.legend .k-extra { background: var(--slate); opacity: .5; }

/* Account (v0.2.1) */
.code-card { text-align: center; }
.code-big { font: 700 34px/1.1 var(--display); letter-spacing: .08em; margin: 8px 0 4px; user-select: all; }
.name-form { display: flex; gap: 10px; }
.name-form .input { flex: 1; height: 48px; font-size: 17px; }
.answer.is-ok { border-color: var(--mint); background: var(--mint-tint); color: var(--mint); }
.card .btn.ghost, .list .btn.ghost { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.card .btn.ghost:hover, .list .btn.ghost:hover { background: var(--line); }
.mark .tiles { justify-content: flex-start; }

/* ---------- v0.2.3 Soft clay ---------- */
.top { background: color-mix(in srgb, var(--page) 86%, transparent); }
.tabs { background: color-mix(in srgb, var(--paper) 90%, transparent); }
.tab[aria-current="page"] svg { filter: drop-shadow(0 2px 0 var(--cloud)); }
h1, h2, h3, .btn, .tile, .word, .option, .seg button { font-weight: 800; }

/* Puffy buttons with a darker bottom edge; they sink when pressed. */
.btn { box-shadow: var(--edge) var(--cobalt-edge), 0 10px 18px -8px color-mix(in srgb, var(--cobalt) 60%, transparent); transition: transform .08s ease, box-shadow .08s ease, background-color .12s ease; }
.btn:hover { background: var(--cobalt-press); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cobalt-edge); }
.btn.ghost, .card .btn.ghost, .list .btn.ghost { background: var(--paper); color: var(--ink); box-shadow: var(--edge) var(--cloud); border: 2px solid var(--cloud); }
.btn.ghost:hover, .card .btn.ghost:hover, .list .btn.ghost:hover { background: var(--mist); }
.btn.ghost:active { box-shadow: 0 1px 0 var(--cloud); }
.btn.quiet { box-shadow: none; }
.btn.quiet:active { transform: none; }
.btn.small { min-height: 40px; }
.btn:disabled { box-shadow: none; }
/* Sunflower for Continue and rewards */
[data-act="next"], [data-act="mission"], [data-act="done"], .celebrate .btn { background: var(--gold); color: var(--gold-ink); box-shadow: var(--edge) var(--gold-edge), 0 10px 18px -8px color-mix(in srgb, var(--gold) 70%, transparent); }
[data-act="next"]:hover, [data-act="mission"]:hover, [data-act="done"]:hover, .celebrate .btn:hover { background: #FFC21F; }
[data-act="next"]:active, [data-act="mission"]:active, [data-act="done"]:active, .celebrate .btn:active { box-shadow: 0 1px 0 var(--gold-edge); }
.icon-btn { background: var(--paper); border: 2px solid var(--cloud); box-shadow: 0 3px 0 var(--cloud); }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cloud); }
.speak-main { box-shadow: 0 6px 0 var(--cobalt-edge), 0 14px 26px -10px var(--cobalt); }
.speak-main:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--cobalt-edge); }
.avatar { box-shadow: 0 3px 0 var(--cobalt-edge); }
.stat-chip { background: var(--paper); border: 2px solid var(--cloud); }
.chip-streak { color: var(--gold-edge); }
@media (prefers-color-scheme: dark) { .chip-streak { color: var(--gold); } }

/* Letter tiles: the signature element, now puffy */
.tile { background: var(--paper); border: 2px solid var(--cloud); box-shadow: 0 4px 0 var(--cloud); font-weight: 800; }
.tile.ok { background: var(--mint-tint); color: var(--mint-edge); border-color: var(--mint); box-shadow: 0 4px 0 var(--mint); }
.tile.bad { background: var(--coral-tint); color: var(--coral-ink); border-color: var(--coral); box-shadow: 0 4px 0 var(--coral); }
.tile.missing, .tiles.fit .tile.missing { background: var(--coral-tint); color: var(--coral-ink); border: 2px dashed var(--coral); box-shadow: none; }
.tile.extra, .tiles.fit .tile.extra { background: var(--mist); color: var(--slate); border-color: transparent; box-shadow: none; }
.tile.hint { background: var(--paper); color: var(--slate); }
.tiles.hero .tile { background: var(--paper); color: var(--cobalt); }
.tiles.hero .tile.lit { background: var(--gold); color: var(--gold-ink); border-color: var(--gold-edge); box-shadow: 0 5px 0 var(--gold-edge); }
.tiles.hero .tile:nth-child(3) { background: var(--cobalt); color: #fff; border-color: var(--cobalt-edge); box-shadow: 0 5px 0 var(--cobalt-edge); }
.tiles.hero .tile:nth-child(5) { background: var(--coral); color: #fff; border-color: #D96F00; box-shadow: 0 5px 0 #D96F00; }
@media (prefers-color-scheme: dark) { .tile.ok { color: var(--mint); } }
.tile .was { background: var(--paper); border-color: var(--cloud); }
.legend .k-bad { background: var(--coral); }
.legend .k-miss { border-color: var(--coral); }
.answer.is-ok { color: var(--mint-edge); }
@media (prefers-color-scheme: dark) { .answer.is-ok { color: var(--mint); } }

/* Surfaces */
.card, .list, .metric, .mode, .badge, .flash-face { background: var(--paper); border: 2px solid var(--line); box-shadow: var(--shadow-lift); }
.card.raised { border: 2px solid var(--line); }
.mode { box-shadow: 0 4px 0 var(--line); transition: transform .08s ease, box-shadow .08s ease; }
.mode:hover { background: var(--mist); }
.mode:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.mode svg { color: var(--cobalt); }
.flash-face.back { background: var(--cobalt-tint); }
.badge.earned { background: var(--gold-tint); border-color: var(--gold); }
.badge.earned svg { color: var(--gold-edge); }
@media (prefers-color-scheme: dark) { .badge.earned svg { color: var(--gold); } }
.tag.gold { color: var(--gold-ink); background: var(--gold); }

/* Mission card: sky with a sunflower button */
.mission { background: linear-gradient(160deg, #3B7BFF, var(--cobalt)); border-radius: 28px; box-shadow: 0 6px 0 var(--cobalt-edge), 0 18px 34px -16px var(--cobalt); }
.mission .btn { background: var(--gold); color: var(--gold-ink); }
.ring .fill { stroke: var(--gold); }
.week .day.on-dark.met { background: var(--gold); color: var(--gold-ink); }

/* Journey path */
.path::before { background: var(--cloud); width: 4px; }
.node-dot { border-radius: 22px; border: 0; background: var(--paper); box-shadow: 0 5px 0 var(--cloud), inset 0 0 0 2px var(--cloud); }
.node.done .node-dot { background: var(--mint); box-shadow: 0 5px 0 var(--mint-edge); }
.node.current .node-dot { background: var(--cobalt); box-shadow: 0 5px 0 var(--cobalt-edge), 0 0 0 6px var(--cobalt-tint); }
.lvl-badge.now { background: var(--cobalt); box-shadow: 0 3px 0 var(--cobalt-edge); }
.lvl-badge.done { color: var(--mint-edge); }

/* Choices, inputs, segmented controls */
.option, .answer, .input, .seg button { border: 2px solid var(--cloud); box-shadow: 0 4px 0 var(--cloud); background: var(--paper); }
.option { transition: transform .08s ease, box-shadow .08s ease; }
.option:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--cloud); }
.option:hover { border-color: var(--cobalt); }
.option .key { background: var(--mist); color: var(--cobalt); font-weight: 800; }
.option.picked-ok { box-shadow: 0 4px 0 var(--mint); color: var(--mint-edge); }
.option.picked-bad { box-shadow: 0 4px 0 var(--coral); color: var(--coral-ink); }
.answer:focus, .input:focus { border-color: var(--cobalt); box-shadow: 0 4px 0 var(--cobalt); }
.answer.is-ok { box-shadow: 0 4px 0 var(--mint); border-color: var(--mint); }
.seg button[aria-pressed="true"] { background: var(--cobalt); color: #fff; border-color: var(--cobalt-edge); box-shadow: 0 4px 0 var(--cobalt-edge); }
.feedback { border: 2px solid transparent; }
.feedback.ok { background: var(--mint-tint); border-color: var(--mint); }
.feedback.bad { background: var(--coral-tint); border-color: var(--coral); }
.feedback.ok h3 { color: var(--mint-edge); }
.feedback.bad h3 { color: var(--coral-ink); }
@media (prefers-color-scheme: dark) { .feedback.ok h3, .option.picked-ok, .lvl-badge.done { color: var(--mint); } }
.bar { background: var(--mist); }
.ex-top .bar > span { background: var(--gold); }
.week .day.met { background: var(--mint); border-color: var(--mint-edge); }
.big-num { color: var(--cobalt); }
.toast { border-radius: 16px; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.error { color: var(--coral-ink); }
@media (prefers-reduced-motion: reduce) { .btn, .option, .mode { transition: none; } .btn:active, .option:active, .mode:active { transform: none; } }
