/* ============ Thème ============ */
:root {
  --bg: #fbf7ef;
  --surface: #ffffff;
  --surface-2: #f4eee2;
  --text: #2b2733;
  --muted: #6f6a78;
  --border: #e6dece;
  --primary: #7c5cc4;
  --primary-dark: #5f43a3;
  --primary-soft: #efe9fb;
  --sun: #f2b33d;
  --ok: #2f9e5b;
  --ok-dark: #227a45;
  --ok-bg: #e3f6ea;
  --ko: #d64545;
  --ko-dark: #a83232;
  --ko-bg: #fde8e8;
  --shadow: 0 2px 0 rgba(0, 0, 0, .06), 0 6px 18px rgba(60, 40, 20, .06);
  --radius: 18px;
  --tabbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1820;
    --surface: #24212c;
    --surface-2: #2d2936;
    --text: #f1edf7;
    --muted: #a7a1b3;
    --border: #3a3545;
    --primary: #9c80e6;
    --primary-dark: #7c5cc4;
    --primary-soft: #312a45;
    --ok: #46c17a;
    --ok-dark: #2f9e5b;
    --ok-bg: #1f3a2a;
    --ko: #ef6b6b;
    --ko-dark: #c94c4c;
    --ko-bg: #42232a;
    --shadow: 0 2px 0 rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.block { display: block; }
.center { text-align: center; }
.row-center { display: flex; gap: 12px; align-items: center; justify-content: center; }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }

.screen {
  padding: 20px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
body[data-view="onboarding"] .screen,
body[data-view="result"] .screen { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

/* ============ Boutons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px;
  border-radius: 14px; border: 2px solid transparent;
  font-weight: 800; font-size: 1rem; letter-spacing: .01em;
  transition: transform .08s ease, background-color .15s ease, opacity .15s;
  user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 0 var(--primary-dark); }
.btn-primary:active:not(:disabled) { box-shadow: 0 2px 0 var(--primary-dark); }
.btn-primary:disabled { background: var(--border); color: var(--muted); box-shadow: none; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ok { background: var(--ok); color: #fff; box-shadow: 0 4px 0 var(--ok-dark); }
.btn-ko { background: var(--ko); color: #fff; box-shadow: 0 4px 0 var(--ko-dark); }
.btn-danger { background: var(--ko); color: #fff; box-shadow: 0 4px 0 var(--ko-dark); }
.btn-danger-ghost { background: transparent; border-color: var(--ko); color: var(--ko); }
.btn-col { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  border-radius: 12px; border: none; background: transparent;
  font-size: 1.3rem; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); }

.speak {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--surface); color: var(--primary);
  vertical-align: middle; font-size: 1.1rem;
  transition: transform .1s, background-color .15s;
}
.speak:active { transform: scale(.94); }
.speak-big { width: 72px; height: 72px; background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 0 var(--primary-dark); }
.speak-big svg { width: 34px; height: 34px; }
.speak.is-speaking { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 92, 196, .45); }
  50% { box-shadow: 0 0 0 10px rgba(124, 92, 196, 0); }
}

/* ============ Champs ============ */
.text-input {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 2px solid var(--border); border-radius: 14px;
  background: var(--surface); font-size: 1rem;
}
.text-input:focus { border-color: var(--primary); outline: none; }
select.text-input { appearance: auto; }
.field-label { display: block; font-weight: 800; margin: 14px 0 8px; }
input[type="range"] { width: 100%; accent-color: var(--primary); margin: 4px 0 12px; }
.switch { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-weight: 600; }
.switch input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }

/* ============ Cartes ============ */
.card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.card-title { font-size: 1.1rem; font-weight: 900; margin-bottom: 4px; }
.card p + p { margin-top: 10px; }
.page-head h1 { font-size: 1.75rem; font-weight: 900; }

/* ============ Onboarding ============ */
.onboarding { min-height: 100vh; min-height: 100dvh; justify-content: space-between; }
.ob-body { display: flex; flex-direction: column; gap: 14px; padding-top: 4vh; }
.ob-hero { font-size: 4.5rem; text-align: center; line-height: 1; animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.ob-title { font-size: 2rem; font-weight: 900; text-align: center; color: var(--primary); }
.ob-oc-sub { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; color: var(--muted); }
.ob-text { text-align: center; font-size: 1.05rem; }
.ob-small { font-size: .875rem; color: var(--muted); text-align: center; }
.ob-warning {
  background: var(--ko-bg); color: var(--ko-dark); border-radius: 12px; padding: 12px 14px; font-weight: 600;
}
@media (prefers-color-scheme: dark) { .ob-warning { color: var(--ko); } }
.ob-list { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 10px; }
.ob-list li {
  display: flex; gap: 12px; align-items: center;
  background: var(--surface); border: 2px solid var(--border); border-radius: 14px; padding: 12px 14px; font-weight: 700;
}
.ob-list li span { font-size: 1.3rem; }
.ob-demo {
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; display: flex; flex-direction: column; gap: 10px;
}
.ob-demo-oc { font-size: 1.5rem; font-weight: 900; }
.ob-demo-fr { color: var(--muted); }
.ob-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.ob-nav > :last-child { justify-self: end; }
.ob-nav > :first-child { justify-self: start; }
.dots { display: flex; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: width .2s; }
.dot.active { width: 22px; border-radius: 4px; background: var(--primary); }

.goal-grid { display: flex; flex-direction: column; gap: 10px; }
.goal {
  display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 2px 12px;
  padding: 12px 16px; border-radius: 14px;
  border: 2px solid var(--border); background: var(--surface);
}
.goal-label { font-weight: 900; }
.goal-xp { font-weight: 800; color: var(--primary); }
.goal-desc { grid-column: 1 / -1; color: var(--muted); font-size: .875rem; }
.goal.active { border-color: var(--primary); background: var(--primary-soft); }

/* ============ Accueil ============ */
.home-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.greet-oc { font-size: 1.6rem; font-weight: 900; overflow-wrap: anywhere; }
.chips { display: flex; gap: 8px; flex: none; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--border); font-weight: 800;
}
.goal-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.goal-row { display: flex; justify-content: space-between; gap: 8px; }
.bar { height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; flex: 1; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--ok); transition: width .35s ease; min-width: 0; }
.bar-fill.sun { background: var(--sun); }

.hero-card {
  --unit: var(--primary);
  background: var(--unit); color: #fff;
  border-radius: 22px; padding: 18px;
  display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center;
  box-shadow: var(--shadow);
}
.hero-card.done { background: linear-gradient(135deg, #f2b33d, #d9653b); }
.hero-icon { font-size: 2.4rem; width: 60px; height: 60px; display: grid; place-items: center; background: rgba(255,255,255,.22); border-radius: 16px; }
.hero-kicker { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }
.hero-title { font-size: 1.35rem; font-weight: 900; }
.hero-sub { opacity: .92; font-size: .95rem; }
.hero-card .btn { grid-column: 1 / -1; background: #fff; color: #2b2733; box-shadow: 0 4px 0 rgba(0,0,0,.18); }

.review-card {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
}
.review-icon { font-size: 1.6rem; }
.review-card > span:nth-child(2) { flex: 1; }
.chev { font-size: 1.6rem; color: var(--muted); }

.install-card {
  display: flex; align-items: center; gap: 12px; position: relative;
  background: var(--primary-soft); border: 2px solid var(--primary); border-radius: var(--radius); padding: 14px 40px 14px 14px;
}
.install-icon { font-size: 1.6rem; flex: none; }
.install-text { flex: 1; min-width: 0; }
.install-text .muted { font-size: .875rem; }
.btn-sm { min-height: 40px; padding: 6px 14px; font-size: .95rem; flex: none; }
.install-close { position: absolute; top: 2px; right: 2px; width: 36px; height: 36px; font-size: 1rem; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }

.unit { --unit: var(--primary); display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.unit-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-left: 5px solid var(--unit); padding-left: 12px; }
.unit-kicker { font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--unit); }
.unit-title { font-size: 1.25rem; font-weight: 900; }
.unit-sub { color: var(--muted); font-size: .9rem; }
.unit-count { font-weight: 800; color: var(--muted); flex: none; }
.lesson-list { display: flex; flex-direction: column; gap: 8px; }
.lesson-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--surface); border: 2px solid var(--border); border-radius: 16px; padding: 10px 14px;
  transition: transform .08s;
}
.lesson-row:active { transform: scale(.99); }
.lesson-icon { width: 46px; height: 46px; display: grid; place-items: center; font-size: 1.5rem; border-radius: 14px; background: var(--surface-2); flex: none; }
.lesson-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lesson-title { font-weight: 800; }
.lesson-sub { color: var(--muted); font-size: .875rem; }
.lesson-status { font-weight: 900; font-size: 1.2rem; width: 28px; text-align: center; flex: none; }
.lesson-row.done .lesson-status { color: var(--ok); }
.lesson-row.done .lesson-icon { background: var(--ok-bg); }
.lesson-row.current { border-color: var(--unit); box-shadow: 0 0 0 3px color-mix(in srgb, var(--unit) 20%, transparent); }
.lesson-row.current .lesson-status { color: var(--unit); }
.lesson-row.locked { opacity: .55; }

/* ============ Barre d'onglets ============ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 2px solid var(--border);
}
.tab {
  flex: 1; max-width: 180px; min-height: 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: none; background: transparent; border-radius: 12px;
  font-size: .8rem; font-weight: 800; color: var(--muted);
}
.tab-icon { font-size: 1.3rem; filter: grayscale(.6); }
.tab.active { color: var(--primary); background: var(--primary-soft); }
.tab.active .tab-icon { filter: none; }

/* ============ Leçon ============ */
.lesson { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.lesson-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px 4px; }
.lesson-bar { height: 16px; }
.lesson-body { flex: 1; padding: 16px; }
.lesson-foot {
  position: sticky; bottom: 0; z-index: 5;
  background: var(--bg); border-top: 2px solid var(--border);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
}
.foot-inner { display: flex; gap: 12px; }
.foot-inner .btn-primary:not(.btn-block) { flex: 1; }
.foot-hint { color: var(--muted); font-weight: 700; text-align: center; width: 100%; padding: 12px 0; }

.ex { display: flex; flex-direction: column; gap: 18px; animation: slideIn .25s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(12px); } }
.ex-kicker { font-size: 1.35rem; font-weight: 900; }

.word-card {
  background: var(--surface); border: 2px solid var(--border); border-radius: 22px;
  padding: 28px 20px; display: flex; flex-direction: column; gap: 16px; text-align: center; box-shadow: var(--shadow);
}
.word-oc { font-size: 2.2rem; font-weight: 900; color: var(--primary); overflow-wrap: anywhere; }
.word-fr { font-size: 1.25rem; font-weight: 700; }
.word-note { color: var(--muted); font-size: .95rem; }
.tip {
  background: var(--primary-soft); border-radius: 16px; padding: 14px 16px; font-size: .95rem;
  border-left: 5px solid var(--primary);
}

.prompt { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.prompt.listen { justify-content: center; padding: 10px 0; }
.prompt-oc { font-size: 1.9rem; font-weight: 900; color: var(--primary); overflow-wrap: anywhere; }
.prompt-fr { font-size: 1.6rem; font-weight: 800; overflow-wrap: anywhere; }
.prompt-sentence {
  font-size: 1.25rem; font-weight: 700;
  background: var(--surface); border: 2px solid var(--border); border-radius: 16px; padding: 12px 16px;
}

.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; text-align: left;
  padding: 10px 14px; border-radius: 16px;
  border: 2px solid var(--border); background: var(--surface); box-shadow: 0 3px 0 var(--border);
  font-size: 1.1rem; font-weight: 700;
  transition: transform .08s, border-color .12s, background-color .12s;
}
.choice:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }
.choice .key {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center;
  border: 2px solid var(--border); border-radius: 8px; font-size: .8rem; color: var(--muted);
}
.choice.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 3px 0 var(--primary); }
.choice.selected .key { border-color: var(--primary); color: var(--primary); }
.choice.correct { border-color: var(--ok); background: var(--ok-bg); box-shadow: 0 3px 0 var(--ok); }
.choice.correct .key { border-color: var(--ok); color: var(--ok); }
.choice.wrong { border-color: var(--ko); background: var(--ko-bg); box-shadow: 0 3px 0 var(--ko); }
.choice.wrong .key { border-color: var(--ko); color: var(--ko); }
.choice:disabled:not(.correct):not(.wrong) { opacity: .6; }

.tile {
  min-height: 46px; padding: 8px 14px; border-radius: 12px;
  border: 2px solid var(--border); background: var(--surface); box-shadow: 0 3px 0 var(--border);
  font-size: 1.05rem; font-weight: 700;
}
.tile:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }
.tile.used { visibility: hidden; }

.build-answer {
  min-height: 116px; padding: 10px 0; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px;
  border-bottom: 2px solid var(--border);
  background-image: linear-gradient(var(--border) 2px, transparent 2px);
  background-size: 100% 58px; background-position: 0 56px;
}
.build-answer.ok .tile { border-color: var(--ok); }
.build-answer.ko .tile { border-color: var(--ko); }
.placeholder { color: var(--muted); padding: 10px 0; }
.build-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match-col { display: flex; flex-direction: column; gap: 10px; }
.match-tile { width: 100%; min-height: 56px; overflow-wrap: anywhere; }
.match-tile.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 3px 0 var(--primary); }
.match-tile.done { opacity: .35; border-color: var(--ok); box-shadow: none; }
.match-tile.bad { border-color: var(--ko); background: var(--ko-bg); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.type-input { font-size: 1.2rem; min-height: 56px; }
.type-input.ok { border-color: var(--ok); background: var(--ok-bg); }
.type-input.ko { border-color: var(--ko); background: var(--ko-bg); }
.accents { display: flex; flex-wrap: wrap; gap: 8px; }
.accent {
  width: 44px; height: 44px; border-radius: 10px;
  border: 2px solid var(--border); background: var(--surface); font-weight: 800; font-size: 1.1rem;
}

.feedback { display: flex; flex-direction: column; gap: 12px; animation: rise .2s ease; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.lesson-foot:has(.feedback.ok) { background: var(--ok-bg); border-top-color: var(--ok); }
.lesson-foot:has(.feedback.ko) { background: var(--ko-bg); border-top-color: var(--ko); }
.feedback.ok .fb-title { color: var(--ok); }
.feedback.ko .fb-title { color: var(--ko); }
.fb-title { font-size: 1.3rem; font-weight: 900; display: block; }
.fb-answer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-size: 1.05rem; }
.feedback .speak { width: 38px; height: 38px; }

/* ============ Résultat ============ */
.result { align-items: stretch; text-align: left; position: relative; overflow: hidden; }
.result-hero { font-size: 5rem; text-align: center; margin-top: 4vh; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.result-title { font-size: 2rem; font-weight: 900; text-align: center; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  display: flex; flex-direction: column; align-items: center; padding: 14px 6px;
  background: var(--surface); border: 2px solid var(--border); border-radius: 16px;
}
.stat-val { font-size: 1.4rem; font-weight: 900; color: var(--primary); }
.stat-lbl { font-size: .8rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.banner { background: #fff4d6; color: #7a5300; border-radius: 14px; padding: 12px 14px; font-weight: 700; text-align: center; }
.banner.soft { background: var(--primary-soft); color: var(--text); }
@media (prefers-color-scheme: dark) { .banner { background: #3d3218; color: #ffd98a; } }
.section-title { font-size: 1.1rem; font-weight: 900; margin-top: 4px; }
.word-chips { display: grid; grid-template-columns: 1fr; gap: 8px; }
.word-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface); border: 2px solid var(--border); border-radius: 14px; padding: 8px 8px 8px 14px;
}
.word-chip .speak { width: 38px; height: 38px; }
.result-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; top: -20px; left: calc(var(--i) * 5.5%); width: 8px; height: 14px; border-radius: 2px;
  background: hsl(calc(var(--i) * 47), 80%, 60%);
  animation: fall calc(1.8s + var(--i) * .07s) ease-in calc(var(--i) * .05s) forwards;
  opacity: 0;
}
@keyframes fall {
  0% { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: 0; transform: translateY(70vh) rotate(540deg); }
}

/* ============ Lexique ============ */
.search { position: sticky; top: 0; z-index: 4; background: var(--bg); padding: 4px 0 8px; }
.lex-unit { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.lex-unit-title { font-size: .85rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--unit, var(--primary)); margin: 6px 0 2px; }
.lex-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 2px solid var(--border); border-radius: 14px; padding: 8px 8px 8px 14px;
}
.lex-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lex-oc { font-weight: 800; overflow-wrap: anywhere; }
.lex-fr { color: var(--muted); font-size: .92rem; }
.lex-badge { color: var(--ok); font-weight: 900; }
.lex-row .speak { width: 40px; height: 40px; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

.about p { font-size: .95rem; }

/* ============ Modale & toast ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(20, 15, 30, .45); animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 400px; background: var(--surface); border-radius: 22px; padding: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 10px;
}
.modal h2 { font-size: 1.3rem; font-weight: 900; }
.modal p { color: var(--muted); }
.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700;
  max-width: calc(100% - 32px); text-align: center;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 600px) {
  .word-chips { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}
