@font-face { font-family: "Noto Serif Hebrew"; src: url("/fonts/NotoSerifHebrew-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
:root {
  --paper: #f6efe0; --paper2: #fffaf0; --ink: #1d2440; --mute: #5d6076; --line: #dccfb2;
  --saffron: #d9981b; --henna: #b23a2e; --teal: #1f7a7a; --indigo: #2b3a7a; --gold: #b8860b;
  --good: #1f7a4d; --bad: #b23a2e; --accent: var(--saffron);
  --ipa: "Charis SIL", "Gentium Plus", "Doulos SIL", "Noto Sans", "Segoe UI", "Lucida Sans Unicode", "DejaVu Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 Georgia, "Iowan Old Style", "Times New Roman", serif;
  background-image: radial-gradient(circle at 20% 0%, #fff8e6 0, transparent 45%), radial-gradient(circle at 100% 100%, #efe2c4 0, transparent 40%); min-height: 100vh; }
#app { max-width: 680px; margin: 0 auto; padding: 0 16px 48px; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--indigo); }
.he { font-family: "Noto Serif Hebrew", "SBL Hebrew", "Ezra SIL", "Times New Roman", serif; font-size: 1.25em; line-height: 1.5; unicode-bidi: isolate; }
.ipa { font-family: var(--ipa); white-space: nowrap; color: var(--indigo); font-weight: 600; }
.fine { font-size: .82em; color: var(--mute); }
.center { text-align: center; }
.big { font-size: 1.5em; }
.warn { color: var(--henna); font-weight: 600; }
.saffron { --accent: var(--saffron); } .henna { --accent: var(--henna); } .teal { --accent: var(--teal); } .indigo { --accent: var(--indigo); } .gold { --accent: var(--gold); }

/* home */
.hero { text-align: center; padding: 0 0 8px; }
.band { height: 18px; margin: 0 -16px 28px; background:
  repeating-linear-gradient(45deg, var(--henna) 0 9px, transparent 9px 18px),
  repeating-linear-gradient(-45deg, var(--saffron) 0 9px, var(--ink) 9px 18px); }
.kicker { text-transform: uppercase; letter-spacing: .18em; font: 600 .72em system-ui, sans-serif; color: var(--henna); margin: 0; }
h1 { font-size: clamp(2.6rem, 11vw, 4rem); margin: .1em 0 0; line-height: 1; letter-spacing: -.02em; }
h1 span { display: block; color: var(--saffron); font-size: .62em; margin-top: .1em; }
.sub { max-width: 30em; margin: .9em auto 1.2em; color: var(--mute); }
.rank { background: var(--ink); color: #fff; border-radius: 16px; padding: 14px 18px; text-align: left; }
.rank .he { color: #f3d58a; }
.rank small { color: #c9cce0; font: .8em system-ui, sans-serif; }
.bar, .prog, .meter { height: 10px; background: rgba(255,255,255,.18); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.bar i, .prog i, .meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--saffron), #f3d58a); border-radius: 99px; transition: width .25s; }
.path { display: grid; gap: 12px; margin-top: 22px; }
.lvl { display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: center; text-align: left; background: var(--paper2);
  border: 2px solid var(--line); border-bottom-width: 5px; border-radius: 18px; padding: 14px 16px; transition: transform .12s, border-color .12s; }
.lvl:hover, .lvl:focus-visible { transform: translateY(-2px); border-color: var(--accent); outline: none; }
.lvl:active { transform: translateY(2px); border-bottom-width: 2px; }
.lvl .num { width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font: 700 1.4em system-ui, sans-serif; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); }
.lvl .body b { font-size: 1.15em; } .lvl .lhe { margin-left: .5em; color: var(--accent); }
.lvl small { display: block; color: var(--mute); line-height: 1.35; font-size: .85em; }
.lvl.lab { --accent: var(--ink); }
.stars i { font-style: normal; color: #d8cdb4; font-size: 1.15em; } .stars i.on { color: var(--saffron); }
.stars.big { font-size: 2.6em; text-align: center; } .stars.big i.on { display: inline-block; animation: pop .5s both; }
.foot { margin-top: 28px; font: .8em/1.5 system-ui, sans-serif; color: var(--mute); text-align: center; }

/* chrome */
.top { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 12px 0; position: sticky; top: 0; background: var(--paper); z-index: 5; }
.top .x { border: 0; background: none; font-size: 1.2em; color: var(--mute); width: 40px; height: 40px; border-radius: 50%; }
.top .x:hover { background: var(--line); }
.ttl { font: 600 .9em system-ui, sans-serif; color: var(--mute); }
.prog { background: var(--line); height: 14px; margin: 0; }
.dots i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin-left: 5px; } .dots i.on { background: var(--ink); }
.hearts { color: var(--henna); font-size: 1.2em; letter-spacing: 2px; } .hearts s { color: var(--line); text-decoration: none; }
.hud { display: flex; justify-content: space-between; font: 600 .85em system-ui, sans-serif; color: var(--mute); min-height: 1.6em; }
.streak { color: var(--henna); }

/* cards */
.card, .stage { background: var(--paper2); border: 2px solid var(--line); border-top: 6px solid var(--accent); border-radius: 18px; padding: 20px 20px 22px; }
.card h2 { margin: .1em 0 .5em; font-size: 1.45em; line-height: 1.2; } .card.lab h2 { margin-top: 1.4em; } .card.lab h2:first-child { margin-top: .1em; }
.card p { margin: .7em 0; }
.hl { background: #fbeec9; border-left: 4px solid var(--saffron); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pill { border-radius: 14px; padding: 12px; display: grid; gap: 2px; color: #fff; }
.pill.pop { background: var(--henna); } .pill.hiss { background: var(--teal); }
.pill b { font-size: 1.25em; } .pill small { opacity: .85; font-size: .78em; } .pill span { font-size: .88em; line-height: 1.7; }
.snd { border: 2px solid var(--line); border-bottom-width: 4px; background: #fff; border-radius: 10px; padding: 1px 9px; margin: 1px; line-height: 1.5; }
.snd { white-space: nowrap; }
.snd::after { content: " ♪"; font-size: .7em; color: var(--saffron); }
.snd:hover { border-color: var(--saffron); } .snd.pulse { animation: pop .3s; }
.snd.huge { font-size: 2em; padding: 4px 18px; border-radius: 16px; }
ul.sym { padding-left: 1.1em; } ul.sym li { margin: .45em 0; }
table.grid { width: 100%; border-collapse: collapse; margin: .8em 0; font-size: .95em; }
table.grid td, table.grid th { border: 1px solid var(--line); padding: 7px 8px; text-align: center; vertical-align: middle; }
table.grid th { background: #f3e8cf; font: 600 .82em system-ui, sans-serif; } table.grid th .he { font-size: 1.7em; display: block; }
table.grid small { display: block; color: var(--mute); font: .74em/1.3 system-ui, sans-serif; font-weight: 400; }
table.vow td:last-child { text-align: left; font-size: .88em; }
.words { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.word { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; text-align: center; display: grid; }
.word b { font-weight: 400; font-size: 1.2em; } .word small { color: var(--mute); font: .72em system-ui, sans-serif; }
.actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.btn { background: var(--ink); color: #fff; border: 0; border-bottom: 4px solid #0b1026; border-radius: 14px; padding: 12px 22px; font: 700 1em system-ui, sans-serif; }
.btn:active { transform: translateY(2px); border-bottom-width: 2px; } .btn:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); border-bottom-width: 4px; }
.btn.mic { background: var(--henna); border-bottom-color: #7c241c; } .btn.live { animation: throb 1s infinite; }
.skip { display: block; margin: 12px auto 0; background: none; border: 0; color: var(--mute); text-decoration: underline; font: .85em system-ui, sans-serif; } .skip:empty { display: none; }
.end { text-align: center; margin-top: 20px; } .end .actions { justify-content: center; flex-wrap: wrap; } .bigemoji { font-size: 3em; } .score { font: 600 1.1em system-ui, sans-serif; color: var(--mute); }

/* challenges */
.q { font-size: 1.25em; font-weight: 700; margin: 0 0 .6em; line-height: 1.3; }
.bigletter { text-align: center; font-size: 4.4em; line-height: 1.25; margin: 0 0 .15em; } .bigletter .he { font-size: 1em; }
.bigletter.word { font-size: 2.6em; } .bigletter.verse { font-size: 1.5em; } .versei { font-size: .95em; } .versei .ipa { white-space: normal; }
.bigletter.pair { display: flex; justify-content: center; align-items: center; gap: .4em; } .bigletter.pair span { font: 600 .2em system-ui, sans-serif; color: var(--mute); }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.opts.raw, .opts.three { grid-template-columns: 1fr; } .opts.three { grid-template-columns: repeat(3, 1fr); }
.opt { background: #fff; border: 2px solid var(--line); border-bottom-width: 5px; border-radius: 14px; padding: 12px 10px; min-height: 64px; display: grid; place-items: center; text-align: center; transition: transform .1s; }
.opt:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.opt .ipa { font-size: 1.5em; } .opt.seg .ipa { font-size: 1.35em; } .opts.raw .opt .ipa { font-size: 1.3em; }
.opt small { display: block; color: var(--mute); font: .78em/1.3 system-ui, sans-serif; }
.opts.words2 .opt .he { font-size: 2em; }
.opt.right { border-color: var(--good); background: #e3f4ea; } .opt.wrong { border-color: var(--bad); background: #fbe5e2; }
.built { text-align: center; font-size: 1.7em; min-height: 1.6em; } .built u { color: var(--line); text-decoration: none; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .match > div { display: grid; gap: 8px; }
.m { background: #fff; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px; padding: 10px; font-size: 1.3em; }
.m.sel { border-color: var(--saffron); background: #fbeec9; } .m.paired { border-color: var(--good); background: #e3f4ea; opacity: .7; }
.shake { animation: shake .35s; }
.chips span { display: inline-block; background: var(--ink); color: #fff; border-radius: 99px; padding: 3px 12px; margin: 3px; font: 600 .78em system-ui, sans-serif; }
.micbox { margin: 12px 0; } .meter { background: var(--line); height: 16px; } .meter i { background: linear-gradient(90deg, var(--teal), #57c2a8); width: 0; transition: width .1s; }
.mlabel { text-align: center; font: 600 .88em system-ui, sans-serif; color: var(--mute); min-height: 1.5em; }
.microw { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 8px; } .microw .skip { margin-top: 6px; }
.gauge { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font: .75em system-ui, sans-serif; color: var(--mute); margin-top: 10px; }
.gauge div { height: 12px; border-radius: 99px; position: relative; background: linear-gradient(90deg, var(--teal) 0 30%, var(--henna) 34% 100%); }
#needle { position: absolute; top: -5px; left: 0; width: 6px; height: 22px; background: var(--ink); border-radius: 3px; transition: left .4s; }
.cal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.calstep { border: 2px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; display: grid; } .calstep b { font-size: 1.5em; } .calstep small { font: .72em system-ui, sans-serif; color: var(--mute); }
.calstep.on { border-color: var(--saffron); background: #fbeec9; } .tick { color: var(--good); font-weight: 700; min-height: 1.4em; }
.checks { display: grid; gap: 8px; margin: 14px 0; } .checks label { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: .92em; }
.checks input { width: 1.1em; height: 1.1em; vertical-align: -2px; margin-right: 6px; accent-color: var(--good); }
.decoder { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; } .decoder > div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.decoder small { display: block; font: .78em/1.35 system-ui, sans-serif; color: var(--mute); margin-top: 3px; }

/* feedback bar */
.fb { position: sticky; bottom: 0; margin: 14px -16px -48px; padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); display: flex; gap: 14px; align-items: center; justify-content: space-between; animation: rise .25s; }
.fb.good { background: #d6f0e0; color: #0f4a2e; } .fb.bad { background: #f9dcd8; color: #6e1d15; } .fb.skipd { background: #ece4d0; }
.fb p { margin: .2em 0 0; font-size: .92em; line-height: 1.4; } .fb .btn { flex: none; }
.fb.good .btn { background: var(--good); border-bottom-color: #0f4a2e; } .fb.bad .btn { background: var(--bad); border-bottom-color: #6e1d15; }

/* diagrams */
.mouth svg, .vmap svg { width: 100%; max-width: 420px; display: block; margin: 0 auto; }
.head { fill: #f0dcc0; stroke: var(--ink); stroke-width: 2; } .cavity { fill: #6b2a2a; } .tongue { fill: #e58f86; stroke: #a8544c; stroke-width: 1.5; }
.tooth { fill: #fff; stroke: #bbb; } .lip { fill: #d0655c; }
.station { cursor: pointer; outline: none; } .station .halo { fill: transparent; } .station .dot { fill: #fff; stroke: var(--ink); stroke-width: 2.5; }
.station:hover .halo, .station:focus-visible .halo, .station.sel .halo { fill: rgba(217,152,27,.45); } .station.sel .dot { fill: var(--saffron); }
.station.ridge .dot { fill: var(--henna); } .mouth.pick .station.ridge .dot { fill: #fff; }
.station.right .dot { fill: var(--good); } .station.right .halo { fill: rgba(31,122,77,.4); } .station.wrong .dot { fill: var(--bad); }
.link { fill: none; stroke: var(--henna); stroke-width: 2; stroke-dasharray: 5 4; }
.lbl { font: 600 10px system-ui, sans-serif; fill: var(--mute); } .lbl.warn { fill: var(--henna); }
.mouth-out { text-align: center; min-height: 2.6em; font-size: .92em; margin-top: 4px; }
.quad { fill: #fff; stroke: var(--line); stroke-width: 2; }
.vnode { cursor: pointer; outline: none; } .vnode circle { fill: var(--paper2); stroke: var(--ink); stroke-width: 2; } .vnode:hover circle, .vnode:focus-visible circle { fill: #fbeec9; }
.vnode .ring { fill: rgba(31,122,122,.14); stroke: var(--teal); stroke-dasharray: 5 4; animation: breathe 1.6s infinite; } .vnode.target circle:not(.ring) { fill: var(--teal); } .vnode.target .vipa { fill: #fff; }
.vipa { font: 600 17px var(--ipa); fill: var(--indigo); } .vhe { font: 15px "Noto Serif Hebrew", serif; fill: var(--mute); }
#vdot { fill: var(--henna); stroke: #fff; stroke-width: 3; transition: cx .09s linear, cy .09s linear; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; animation: fall linear forwards; }
@keyframes fall { to { top: 110%; transform: rotate(720deg) translateX(40px); } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
@keyframes breathe { 50% { opacity: .45; } }
@keyframes throb { 50% { box-shadow: 0 0 0 8px rgba(178,58,46,.25); } }
@media (max-width: 420px) { body { font-size: 16px; } .card, .stage { padding: 16px 14px 18px; } .bigletter { font-size: 3.6em; } .opts.three { gap: 6px; } .fb { flex-direction: column; align-items: stretch; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
