:root {
  --bg1: #dff3ff;
  --bg2: #fff1d6;
  --ink: #26324b;
  --muted: #66728c;
  --card: #ffffff;
  --brand: #6c5ce7;
  --brand-dark: #4b3fc4;
  --good: #1fb86b;
  --good-bg: #dcf8ea;
  --bad: #ef5350;
  --bad-bg: #ffe3e2;
  --sun: #ffb703;
  --line: #e3e8f4;
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Trebuchet MS", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
  font-size: 18px;
  line-height: 1.45;
}
#app { max-width: 720px; margin: 0 auto; padding: 16px 16px 48px; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: 0 6px 0 rgba(38, 50, 75, .08), 0 12px 24px rgba(38, 50, 75, .08); margin-bottom: 16px; }
.muted { color: var(--muted); }
.center { text-align: center; }

.btn { border: 0; border-radius: 16px; padding: 14px 22px; font-weight: 800; background: var(--brand); color: #fff; box-shadow: 0 5px 0 var(--brand-dark); transition: transform .08s, box-shadow .08s; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--brand-dark); }
.btn.big { width: 100%; font-size: 1.2rem; padding: 18px; }
.btn.alt { background: #fff; color: var(--brand-dark); box-shadow: 0 5px 0 var(--line); border: 2px solid var(--line); }
.btn.green { background: var(--good); box-shadow: 0 5px 0 #138a4e; }
.btn.danger { background: var(--bad); box-shadow: 0 5px 0 #b32e2b; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

/* home */
.top { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; }
.mascot { font-size: 64px; line-height: 1; animation: bob 2.4s ease-in-out infinite; }
.bubble { position: relative; background: #fff; border-radius: 18px; padding: 12px 16px; font-weight: 700; box-shadow: 0 4px 0 rgba(38,50,75,.08); }
.bubble::before { content: ""; position: absolute; left: -8px; top: 24px; width: 16px; height: 16px; background: #fff; transform: rotate(45deg); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: 18px; padding: 10px 6px; text-align: center; box-shadow: 0 4px 0 rgba(38,50,75,.08); }
.stat b { display: block; font-size: 1.5rem; }
.stat span { font-size: .8rem; color: var(--muted); font-weight: 700; }
.xpbar { height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0 2px; }
.xpbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), #ff7b00); border-radius: 99px; transition: width .5s; }
.mission h2 { font-size: 1.5rem; margin-bottom: 4px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.pill { background: #f1eeff; color: var(--brand-dark); border-radius: 99px; padding: 3px 12px; font-size: .9rem; font-weight: 700; }
.pill.rev { background: #fff3d1; color: #946200; }
.stars { font-size: 2.2rem; letter-spacing: 4px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.badge { background: #fff; border-radius: 14px; padding: 6px 12px; font-weight: 700; font-size: .9rem; box-shadow: 0 3px 0 rgba(38,50,75,.08); }
.badge.locked { opacity: .35; filter: grayscale(1); }

/* learn card */
.dots { display: flex; gap: 5px; justify-content: center; margin: 4px 0 14px; flex-wrap: wrap; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--brand); }
.dots i.cur { background: var(--sun); transform: scale(1.35); }
.wcard { text-align: center; position: relative; animation: pop .25s ease-out; }
.tag { display: inline-block; font-size: .8rem; font-weight: 800; padding: 3px 12px; border-radius: 99px; background: #e5f7ff; color: #0a74a8; }
.tag.rev { background: #fff3d1; color: #946200; }
.word { font-size: clamp(2.2rem, 9vw, 3.4rem); color: var(--brand-dark); margin: 8px 0 0; letter-spacing: .5px; }
.pron { font-size: 1.2rem; color: var(--muted); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px; }
.spk { border: 0; background: #f1eeff; border-radius: 50%; width: 44px; height: 44px; font-size: 1.2rem; flex: none; }
.spk:hover { background: #e3dcff; }
.mean { font-size: 1.35rem; font-weight: 800; margin: 6px 0 12px; }
.chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border-radius: 99px; padding: 5px 14px; font-weight: 800; font-size: .95rem; }
.chip.syn { background: var(--good-bg); color: #0f7a46; }
.chip.ant { background: var(--bad-bg); color: #b32e2b; }
.ex { background: #fffbe9; border: 2px dashed #ffd66b; border-radius: 16px; padding: 12px 14px; text-align: left; display: flex; gap: 10px; align-items: center; }
.ex p { flex: 1; }
mark { background: linear-gradient(transparent 55%, #ffd66b 55%); color: inherit; font-weight: 800; padding: 0 2px; }
.blank { display: inline-block; min-width: 90px; border-bottom: 4px solid var(--brand); text-align: center; color: transparent; }
.blank.filled { color: var(--good); border-color: var(--good); font-weight: 800; }
.hint { font-size: .9rem; color: var(--muted); margin-top: 10px; }

/* quiz */
.qhead { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-weight: 800; }
.track { position: relative; flex: 1; height: 14px; background: #fff; border-radius: 99px; box-shadow: inset 0 2px 0 rgba(38,50,75,.1); }
.track .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #6c5ce7, #a29bfe); transition: width .4s; }
.track .runner { position: absolute; top: -14px; font-size: 24px; transform: translateX(-50%) scaleX(-1); transition: left .4s; }
.combo { color: #e65100; min-width: 70px; text-align: right; }
.qlabel { font-weight: 800; color: var(--muted); margin-bottom: 8px; }
.qlabel b { color: var(--brand-dark); font-size: 1.15em; }
.sentence { font-size: 1.3rem; font-weight: 700; display: flex; gap: 10px; align-items: flex-start; }
.sentence p { flex: 1; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: 12px 14px; font-weight: 700; box-shadow: 0 4px 0 var(--line); transition: transform .08s; }
.opt:hover:not([disabled]) { border-color: var(--brand); }
.opt .ltr { flex: none; width: 34px; height: 34px; border-radius: 10px; background: #f1eeff; color: var(--brand-dark); display: grid; place-items: center; font-weight: 800; }
.opt.right { border-color: var(--good); background: var(--good-bg); box-shadow: 0 4px 0 #9ee3bf; }
.opt.right .ltr { background: var(--good); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); box-shadow: 0 4px 0 #f5b5b3; animation: shake .35s; }
.opt.wrong .ltr { background: var(--bad); color: #fff; }
.opt[disabled] { cursor: default; }
.fb { margin-top: 14px; border-radius: 18px; padding: 14px 16px; animation: pop .2s ease-out; }
.fb.good { background: var(--good-bg); }
.fb.bad { background: var(--bad-bg); }
.fb h3 { margin-bottom: 4px; }
.fb .btn { margin-top: 12px; width: 100%; }

/* results */
.result .trophy { font-size: 72px; animation: bob 1.6s ease-in-out infinite; }
.score { font-size: 3rem; font-weight: 900; color: var(--brand-dark); }
.gain { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.gain span { background: #fff3d1; border-radius: 99px; padding: 6px 14px; font-weight: 800; }
.missed { text-align: left; margin-top: 14px; }
.missed li { margin: 6px 0; }
.confetti { position: fixed; top: -30px; font-size: 26px; pointer-events: none; animation: fall linear forwards; z-index: 10; }

/* word book / settings */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; }
.tab { flex: none; border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 14px; font-weight: 800; }
.tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
input[type=text], select { font: inherit; width: 100%; padding: 12px 14px; border: 3px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); }
.field { margin-bottom: 18px; }
.field > label, .field > .lbl { display: block; font-weight: 800; margin-bottom: 6px; }
.choices { display: flex; gap: 10px; }
.choices label { flex: 1; }
.choices input { position: absolute; opacity: 0; }
.choices span { display: block; text-align: center; padding: 12px; border: 3px solid var(--line); border-radius: 14px; background: #fff; font-weight: 800; cursor: pointer; }
.choices input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }
.choices input:focus-visible + span { outline: 3px solid var(--sun); }
.wb { padding: 0; overflow: hidden; margin-bottom: 10px; }
.wb > button { width: 100%; text-align: left; border: 0; background: none; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.wb .w { font-weight: 900; font-size: 1.15rem; flex: 1; }
.lvl { letter-spacing: 2px; color: var(--sun); font-size: .85rem; }
.wb .more { padding: 0 16px 14px; }
.wb .more .ex { margin-top: 8px; }
.back { margin-bottom: 12px; }
.small { font-size: .85rem; }

@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes pop { from { transform: scale(.94); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 420px) { body { font-size: 16px; } .mascot { font-size: 50px; } .row { flex-direction: column; } }

/* journey */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 10px; }
.day { aspect-ratio: 1; border-radius: 12px; background: #f1f3f9; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem; color: var(--muted); }
.day span { font-size: .5rem; line-height: 1; }
.day.done { background: var(--good-bg); color: #0f7a46; box-shadow: inset 0 0 0 2px var(--good); }
.day.today { outline: 3px solid var(--sun); }
.hrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hrow:last-of-type { border-bottom: 0; }

.link { border: 0; background: none; color: var(--brand-dark); font-weight: 800; text-decoration: underline; padding: 0 0 0 6px; }
.about summary { cursor: pointer; }
.about p { margin-top: 10px; font-size: .95rem; }
#foot { max-width: 720px; margin: 0 auto; padding: 0 16px 40px; color: var(--muted); font-size: .78rem; line-height: 1.5; }
#foot b { color: var(--ink); }
