/* Pamokos — playful sticker style. Tokens first, then layout, components, games. */

@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/baloo2-normal-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/baloo2-normal-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url(../fonts/nunito-normal-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url(../fonts/nunito-normal-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: italic; font-weight: 300 900; font-display: swap;
  src: url(../fonts/nunito-italic-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-style: italic; font-weight: 300 900; font-display: swap;
  src: url(../fonts/nunito-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ink: #24123f;
  --ink-soft: #4a3a66;
  --paper: #fff6e5;
  --paper-2: #ffecc7;
  --card: #ffffff;
  --grape: #7b4dff;  --grape-d: #5a2fe0;  --grape-l: #e9e1ff;
  --sun: #ffc83d;    --sun-d: #e3a400;    --sun-l: #fff1c4;
  --tomato: #ff5d5d; --tomato-d: #d63c3c; --tomato-l: #ffe0dc;
  --mint: #1fc79f;   --mint-d: #0f9877;   --mint-l: #d5f7ec;
  --sky: #38a6ff;    --sky-d: #1b7fd6;    --sky-l: #dcefff;
  --pink: #ff7ec0;   --pink-d: #e0519d;   --pink-l: #ffe1f0;
  --leaf: #7fcf3a;   --leaf-d: #58a11c;   --leaf-l: #e8f8d6;
  --clay: #d9773b;   --clay-l: #fbe3d1;
  --accent: var(--grape);
  --accent-d: var(--grape-d);
  --accent-l: var(--grape-l);
  --radius: 22px;
  --border: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --font-head: "Baloo 2", "Comic Sans MS", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font: 500 18px/1.55 var(--font-body);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(36, 18, 63, 0.09) 1.6px, transparent 1.7px);
  background-size: 24px 24px;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--grape-d); font-weight: 700; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.12; margin: 0 0 0.4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); font-weight: 800; }
h3 { font-size: 1.45rem; font-weight: 800; }
h4 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 0.8em; }
b, strong { font-weight: 800; }
.mark { background: linear-gradient(transparent 55%, var(--sun) 55%, var(--sun) 92%, transparent 92%); padding: 0 0.1em; }
.mark-pink { background: linear-gradient(transparent 55%, var(--pink-l) 55%); }
.muted { color: var(--ink-soft); }
.small { font-size: 0.88rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- layout ---------- */
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.stack > * + * { margin-top: 14px; }
.spacer { height: 28px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: var(--border);
  box-shadow: 0 4px 0 rgba(36, 18, 63, 0.12);
}
.topbar .wrap { display: flex; align-items: center; gap: 10px; padding-top: 8px; padding-bottom: 8px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font: 800 1.35rem var(--font-head); }
.logo .logo-badge { width: 40px; height: 40px; }
.topbar .grow { flex: 1; min-width: 0; }
.topbar .lesson-name { font: 700 1.05rem var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: var(--border); border-radius: 999px; background: var(--card);
  padding: 2px 12px; font: 700 0.95rem var(--font-head); white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.chip.sun { background: var(--sun-l); }
.chip.mint { background: var(--mint-l); }
.chip.tomato { background: var(--tomato-l); }
.chip.grape { background: var(--grape-l); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 14px; border: var(--border); background: var(--card);
  box-shadow: var(--shadow-sm); font-size: 1.25rem; cursor: pointer; display: grid; place-items: center;
  color: var(--ink); text-decoration: none; padding: 0; flex: none;
}
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.progress-track {
  height: 16px; border: var(--border); border-radius: 999px; background: var(--card); overflow: hidden; min-width: 80px;
}
.progress-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: repeating-linear-gradient(-45deg, var(--mint), var(--mint) 10px, #43dbb6 10px, #43dbb6 20px);
  transition: width 0.6s cubic-bezier(.2, 1.4, .4, 1);
}

/* ---------- buttons ---------- */
.btn {
  --b: var(--grape); --bd: var(--ink); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--b); color: var(--fg);
  border: var(--border); border-radius: 16px;
  box-shadow: 0 5px 0 var(--bd);
  font: 800 1.15rem var(--font-head); letter-spacing: 0.01em;
  padding: 0.55em 1.3em 0.45em; cursor: pointer; text-decoration: none;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--bd); }
.btn[disabled], .btn.disabled { filter: grayscale(0.9) opacity(0.55); cursor: not-allowed; transform: none; box-shadow: 0 5px 0 var(--bd); }
.btn.sun { --b: var(--sun); --fg: var(--ink); }
.btn.mint { --b: var(--mint); }
.btn.tomato { --b: var(--tomato); }
.btn.sky { --b: var(--sky); }
.btn.pink { --b: var(--pink); }
.btn.white { --b: var(--card); --fg: var(--ink); }
.btn.big { font-size: 1.4rem; padding: 0.6em 1.6em 0.5em; border-radius: 20px; }
.btn.small { font-size: 0.95rem; padding: 0.35em 0.9em 0.28em; border-radius: 12px; box-shadow: 0 3px 0 var(--bd); }
.btn.small:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--bd); }
.btn.wiggle { animation: wiggle 2.2s ease-in-out infinite; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; position: relative;
}
.card + .card { margin-top: 22px; }
.card.tint { background: var(--accent-l); }
.card.sun { background: var(--sun-l); }
.card.mint { background: var(--mint-l); }
.card.sky { background: var(--sky-l); }
.card.pink { background: var(--pink-l); }
.card.grape { background: var(--grape-l); }
.card.tomato { background: var(--tomato-l); }
.card h3:first-child, .card h2:first-child { margin-top: 0; }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-title .emoji { font-size: 2rem; line-height: 1; }
.card-title h3 { margin: 0; }
.badge {
  display: inline-block; font: 800 0.78rem var(--font-head); text-transform: uppercase; letter-spacing: 0.06em;
  border: 2.5px solid var(--ink); border-radius: 999px; padding: 1px 10px; background: var(--card); vertical-align: middle;
}
.badge.req { background: var(--tomato); color: #fff; }
.badge.opt { background: var(--sky-l); }
.badge.exam { background: var(--sun); }
.badge.done { background: var(--mint); color: #fff; }

/* sticker label that sits on the card edge */
.sticker {
  position: absolute; top: -16px; right: 18px; transform: rotate(3deg);
  background: var(--sun); border: var(--border); border-radius: 12px; padding: 2px 12px;
  font: 800 0.95rem var(--font-head); box-shadow: var(--shadow-sm);
}
.sticker.left { right: auto; left: 18px; transform: rotate(-3deg); }
.sticker.pink { background: var(--pink); color: #fff; }
.sticker.mint { background: var(--mint); color: #fff; }
.sticker.sky { background: var(--sky); color: #fff; }
.sticker.tomato { background: var(--tomato); color: #fff; }

/* fact card: "Pasigirk!" */
.fact {
  background: var(--sun-l); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 22px 20px; position: relative; transform: rotate(-0.6deg);
}
.fact:nth-of-type(even) { transform: rotate(0.6deg); }
.fact .fact-head { display: flex; gap: 10px; align-items: center; font: 800 1.15rem var(--font-head); margin-bottom: 6px; }
.fact .fact-head .emoji { font-size: 1.9rem; }
.fact .fact-src { font-size: 0.8rem; color: var(--ink-soft); margin-top: 6px; }
.fact .tape {
  position: absolute; top: -14px; left: 50%; width: 110px; height: 28px; transform: translateX(-50%) rotate(-3deg);
  background: rgba(255, 126, 192, 0.55); border: 2px dashed rgba(36, 18, 63, 0.25);
}

/* exam box: what the test asks */
.exam-box {
  border: 3px dashed var(--ink); border-radius: var(--radius); background: #fff; padding: 18px 20px; position: relative;
}
.exam-box::before {
  content: "🎯 Kontroliniam"; position: absolute; top: -15px; left: 16px; background: var(--sun);
  border: var(--border); border-radius: 999px; padding: 0 12px; font: 800 0.9rem var(--font-head);
}

/* term cards (flip) */
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.term {
  perspective: 900px; cursor: pointer; min-height: 150px; border: none; background: none; padding: 0; font: inherit; color: inherit; text-align: left;
}
.term-inner { position: relative; width: 100%; height: 100%; min-height: 150px; transition: transform 0.55s cubic-bezier(.3, 1.4, .5, 1); transform-style: preserve-3d; }
.term.flipped .term-inner { transform: rotateY(180deg); }
.term-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 14px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
}
.term-front { background: var(--accent-l); }
.term-front .t-emoji { font-size: 2.2rem; line-height: 1.1; }
.term-front .t-word { font: 800 1.35rem var(--font-head); }
.term-front .t-hint { font-size: 0.75rem; color: var(--ink-soft); }
.term-back { background: #fff; transform: rotateY(180deg); font-size: 0.98rem; line-height: 1.35; }
.term-back b { display: block; font-family: var(--font-head); font-size: 1.05rem; margin-bottom: 4px; }

/* figure / photo */
.photo { margin: 0; }
.photo img { border: var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); width: auto; max-width: 100%; height: auto; max-height: 400px; margin: 0 auto; background: #eee; }
.photo figcaption { text-align: center; }
.photo figcaption { font-size: 0.86rem; color: var(--ink-soft); margin-top: 8px; line-height: 1.35; }
.photo figcaption .credit { display: block; font-size: 0.72rem; opacity: 0.85; }
.photo.polaroid { background: #fff; border: var(--border); padding: 10px 10px 4px; border-radius: 6px; box-shadow: var(--shadow-sm); transform: rotate(-1.5deg); }
.photo.polaroid img { border: 2px solid var(--ink); border-radius: 3px; box-shadow: none; }
.photo.polaroid:nth-child(even) { transform: rotate(1.5deg); }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; }

/* speech bubble + mascot */
.say { display: flex; gap: 12px; align-items: flex-end; margin: 6px 0 16px; }
.say .mascot { width: 92px; flex: none; }
.say.right { flex-direction: row-reverse; }
.bubble {
  position: relative; background: #fff; border: var(--border); border-radius: 20px; padding: 12px 16px; box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.bubble::after {
  content: ""; position: absolute; left: -14px; bottom: 16px; width: 22px; height: 22px; background: #fff;
  border-left: var(--border); border-bottom: var(--border); transform: rotate(45deg) skew(10deg, 10deg); border-radius: 0 0 0 6px;
}
.say.right .bubble::after { left: auto; right: -14px; transform: rotate(-135deg) skew(10deg, 10deg); }
.mascot svg { width: 100%; height: auto; overflow: visible; }
.mascot.bob svg { animation: bob 2.6s ease-in-out infinite; }

/* lists */
.ticks { list-style: none; padding: 0; margin: 0 0 0.8em; }
.ticks li { padding-left: 34px; position: relative; margin: 0 0 8px; }
.ticks li::before {
  content: "★"; position: absolute; left: 0; top: -1px; width: 25px; height: 25px; border-radius: 50%;
  background: var(--sun); border: 2.5px solid var(--ink); display: grid; place-items: center; font-size: 0.8rem;
}
.qa { display: grid; gap: 10px; }
.qa-item { border: var(--border); border-radius: 16px; background: #fff; overflow: hidden; }
.qa-item summary { cursor: pointer; padding: 12px 16px; font: 700 1.08rem var(--font-head); list-style: none; display: flex; gap: 10px; align-items: center; }
.qa-item summary::-webkit-details-marker { display: none; }
.qa-item summary::before { content: "❓"; }
.qa-item[open] summary::before { content: "💡"; }
.qa-item[open] summary { background: var(--sun-l); border-bottom: var(--border); }
.qa-item .qa-body { padding: 12px 16px; }

/* ---------- home ---------- */
.hero { padding: 34px 0 18px; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.hero .mascot { width: 170px; }
.hero h1 .wave { display: inline-block; animation: wave 1.8s ease-in-out infinite; transform-origin: 70% 70%; }
.lesson-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; padding-bottom: 40px; }
.lesson-card {
  display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink);
  background: #fff; border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.lesson-card:hover { transform: translate(-2px, -3px) rotate(-0.4deg); box-shadow: 9px 10px 0 var(--ink); }
.lesson-card .lc-top { background: var(--accent); color: #fff; padding: 18px 18px 14px; position: relative; border-bottom: var(--border); min-height: 128px; }
.lesson-card .lc-emoji { font-size: 3rem; position: absolute; right: 14px; bottom: 6px; filter: drop-shadow(3px 3px 0 rgba(36, 18, 63, 0.35)); }
.lesson-card .lc-subject { font: 800 0.85rem var(--font-head); text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.9; }
.lesson-card .lc-title { font: 800 1.55rem/1.1 var(--font-head); margin-top: 4px; max-width: 80%; }
.lesson-card .lc-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.lesson-card .lc-meta { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- mission map ---------- */
.map-head { padding: 26px 0 8px; }
.quest-map { position: relative; margin: 10px auto 40px; max-width: 720px; }
.quest-map svg.path { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.quest-node {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; width: min(100%, 470px);
  margin: 0 0 34px; text-decoration: none; color: var(--ink); cursor: pointer; background: none; border: none; padding: 0; font: inherit; text-align: left;
}
.quest-node:nth-child(odd of .quest-node) { margin-left: auto; flex-direction: row-reverse; text-align: right; }
.quest-node .qn-circle {
  flex: none; width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--ink); background: var(--c, var(--grape));
  display: grid; place-items: center; font-size: 2.6rem; box-shadow: 0 7px 0 var(--ink); position: relative;
  transition: transform 0.15s;
}
.quest-node:hover .qn-circle { transform: translateY(-3px) scale(1.04); }
.quest-node.locked { cursor: not-allowed; }
.quest-node.locked .qn-circle { background: #d8d2e3; filter: grayscale(1); }
.quest-node.locked .qn-circle::after { content: "🔒"; position: absolute; right: -6px; bottom: -6px; font-size: 1.5rem; background: #fff; border: 3px solid var(--ink); border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; }
.quest-node.current .qn-circle { animation: pulse-ring 1.8s infinite; }
.quest-node.done .qn-circle::after { content: "✓"; position: absolute; right: -6px; bottom: -6px; font: 800 1.4rem var(--font-head); color: #fff; background: var(--mint); border: 3px solid var(--ink); border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; }
.quest-node .qn-text { background: #fff; border: var(--border); border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow-sm); flex: 1; }
.quest-node .qn-kicker { font: 800 0.8rem var(--font-head); text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-soft); }
.quest-node .qn-title { font: 800 1.25rem/1.15 var(--font-head); }
.quest-node .qn-meta { font-size: 0.85rem; color: var(--ink-soft); }
.stars { letter-spacing: 2px; font-size: 1.05rem; }
.stars .off { filter: grayscale(1) opacity(0.35); }

/* ---------- mission view ---------- */
.mission-head { padding: 22px 0 6px; }
.mission-head .kicker { font: 800 0.95rem var(--font-head); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-d); }
.steps-bar { display: flex; gap: 6px; margin: 10px 0 18px; flex-wrap: wrap; }
.steps-bar .dot { width: 26px; height: 12px; border-radius: 99px; border: 2.5px solid var(--ink); background: #fff; cursor: pointer; padding: 0; }
.steps-bar .dot.done { background: var(--mint); }
.steps-bar .dot.here { background: var(--sun); width: 40px; }
.steps-bar .dot.check { border-radius: 4px; }
.section { animation: pop-in 0.45s cubic-bezier(.2, 1.4, .4, 1) both; }
.section-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 22px 0 40px; flex-wrap: wrap; }
.need-hint { font-weight: 700; color: var(--tomato-d); font-size: 0.95rem; }

/* ---------- questions ---------- */
.q { display: flex; flex-direction: column; gap: 14px; }
.q-prompt { font: 800 1.35rem/1.25 var(--font-head); }
.q-sub { color: var(--ink-soft); margin-top: -8px; }
.q-img { max-width: 340px; }
.opts { display: grid; gap: 10px; }
.opts.cols-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  border: var(--border); border-radius: 16px; background: #fff; padding: 12px 16px; cursor: pointer;
  font: 700 1.08rem var(--font-body); color: var(--ink); box-shadow: 0 4px 0 var(--ink); transition: transform 0.08s, background 0.15s;
  touch-action: manipulation;
}
.opt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.opt .opt-key {
  flex: none; width: 34px; height: 34px; border-radius: 10px; border: 2.5px solid var(--ink); display: grid; place-items: center;
  font: 800 1rem var(--font-head); background: var(--paper);
}
.opt.selected { background: var(--grape-l); }
.opt.selected .opt-key { background: var(--grape); color: #fff; }
.opt.correct { background: var(--mint-l); }
.opt.correct .opt-key { background: var(--mint); color: #fff; }
.opt.wrong { background: var(--tomato-l); animation: shake 0.4s; }
.opt.wrong .opt-key { background: var(--tomato); color: #fff; }
.opt.locked { pointer-events: none; }
.opt img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 2px solid var(--ink); }
.q-input {
  font: 700 1.3rem var(--font-body); border: var(--border); border-radius: 14px; padding: 10px 14px; width: min(100%, 420px);
  background: #fff; color: var(--ink); box-shadow: inset 0 3px 0 rgba(36, 18, 63, 0.08);
}
.q-input:focus { outline: 4px solid var(--sun); outline-offset: 2px; }
.q-input.correct { background: var(--mint-l); }
.q-input.wrong { background: var(--tomato-l); animation: shake 0.4s; }
.q-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.feedback {
  border: var(--border); border-radius: 16px; padding: 12px 16px; font-weight: 600; animation: pop-in 0.35s both;
  display: flex; gap: 12px; align-items: flex-start;
}
.feedback .fb-emoji { font-size: 1.8rem; line-height: 1; }
.feedback.ok { background: var(--mint-l); }
.feedback.bad { background: var(--tomato-l); }
.feedback .fb-title { font: 800 1.15rem var(--font-head); display: block; }

/* tap-to-place items (sort, order, match) */
.chips { display: flex; flex-wrap: wrap; gap: 10px; min-height: 52px; }
.tile {
  display: inline-flex; align-items: center; gap: 8px; border: var(--border); border-radius: 14px; background: #fff;
  padding: 8px 14px; font: 700 1.02rem var(--font-body); cursor: grab; box-shadow: 0 4px 0 var(--ink); user-select: none; -webkit-user-select: none;
  touch-action: none; color: var(--ink); transition: background 0.15s, transform 0.1s; position: relative;
}
.tile .t-emo { font-size: 1.5rem; line-height: 1; }
.tile img.t-img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; border: 2px solid var(--ink); }
.tile.picked { background: var(--sun); transform: translateY(-3px) rotate(-2deg); }
.tile.correct { background: var(--mint-l); }
.tile.wrong { background: var(--tomato-l); animation: shake 0.4s; }
.tile.dragging { position: fixed; z-index: 1000; pointer-events: none; transform: rotate(-4deg) scale(1.06); box-shadow: 6px 8px 0 var(--ink); }
.tile.ghost { opacity: 0.35; }
.buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.bucket {
  border: 3px dashed var(--ink); border-radius: 20px; background: rgba(255, 255, 255, 0.7); padding: 12px; min-height: 150px;
  transition: background 0.15s, transform 0.15s; cursor: pointer;
}
.bucket.hover, .bucket.can-drop { background: var(--sun-l); }
.bucket.hover { transform: scale(1.02); }
.bucket-head { font: 800 1.2rem var(--font-head); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bucket-head .b-emo { font-size: 1.8rem; }
.bucket .chips { min-height: 60px; }
.pool { border: var(--border); border-radius: 20px; background: var(--paper-2); padding: 12px; }
.pool-label { font: 800 0.9rem var(--font-head); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin-bottom: 6px; }
.order-slots { display: grid; gap: 8px; counter-reset: slot; }
.order-slot {
  border: 3px dashed var(--ink); border-radius: 14px; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 4px 8px;
  background: rgba(255, 255, 255, 0.7); counter-increment: slot;
}
.order-slot::before { content: counter(slot); font: 800 1.2rem var(--font-head); width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; background: var(--sun); flex: none; }
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; align-items: stretch; }
.match-col { display: grid; gap: 10px; align-content: start; }
.match-item {
  border: var(--border); border-radius: 14px; background: #fff; padding: 10px 12px; cursor: pointer; font: 700 1rem var(--font-body);
  box-shadow: 0 4px 0 var(--ink); text-align: left; color: var(--ink); display: flex; align-items: center; gap: 8px; min-height: 56px;
  touch-action: manipulation;
}
.match-item.picked { background: var(--sun); }
.match-item .pair-dot { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--ink); flex: none; background: #fff; }
.match-item.correct { outline: 4px solid var(--mint); }
.match-item.wrong { outline: 4px solid var(--tomato); animation: shake 0.4s; }
.fix-sentence { font: 700 1.2rem/2.1 var(--font-body); }
.fix-word { border: 2px solid transparent; border-radius: 8px; padding: 1px 4px; cursor: pointer; background: none; font: inherit; color: inherit; }
.fix-word:hover { background: var(--sun-l); border-color: var(--ink); }
.fix-word.picked { background: var(--tomato-l); border-color: var(--tomato-d); text-decoration: line-through; }
.fix-word.fixed { background: var(--mint-l); border-color: var(--mint-d); text-decoration: none; }

/* timeline */
.tl-wrap { overflow-x: auto; padding: 6px 2px 10px; }
.tl { position: relative; height: 150px; min-width: 600px; margin: 0 44px; }
.tl-line { position: absolute; left: 0; right: 0; top: 70px; height: 12px; background: var(--sky); border: 2.5px solid var(--ink); border-radius: 99px; overflow: hidden; }
.tl-line .bc { position: absolute; left: 0; top: 0; bottom: 0; background: var(--tomato); }
.tl-tick { position: absolute; top: 62px; width: 3px; height: 26px; background: var(--ink); transform: translateX(-50%); border-radius: 2px; }
.tl-tick.minor { top: 68px; height: 14px; width: 2px; }
.tl-label { position: absolute; top: 92px; transform: translateX(-50%); font: 700 0.82rem/1.1 var(--font-head); text-align: center; white-space: nowrap; }
.tl-era { position: absolute; top: 4px; font: 800 0.85rem var(--font-head); padding: 0 10px; border: 2px solid var(--ink); border-radius: 99px; background: #fff; transform: translateX(-50%); white-space: nowrap; }
.tl-marker {
  position: absolute; top: 24px; transform: translateX(-50%); width: 36px; height: 36px; border-radius: 10px; border: 3px solid var(--ink);
  background: var(--sun); font: 800 1.15rem var(--font-head); display: grid; place-items: center; cursor: pointer; box-shadow: 0 3px 0 var(--ink); padding: 0; color: var(--ink);
}
.tl-marker::after { content: ""; position: absolute; left: 50%; top: 34px; width: 3px; height: 14px; background: var(--ink); transform: translateX(-50%); }
.tl-marker.selected { background: var(--grape); color: #fff; }
.tl-marker.correct { background: var(--mint); color: #fff; }
.tl-marker.wrong { background: var(--tomato); color: #fff; }
.tl-flag {
  position: absolute; top: 14px; transform: translateX(-50%); font: 800 0.8rem var(--font-head); background: var(--mint); color: #fff; border: 2.5px solid var(--ink);
  border-radius: 8px; padding: 1px 6px; white-space: nowrap;
}
.tl-click { position: absolute; left: 0; right: 0; top: 40px; height: 60px; cursor: crosshair; }

/* ---------- check / boss ---------- */
.check-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.check-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.check-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--ink); background: #fff; }
.check-dots span.ok { background: var(--mint); }
.check-dots span.bad { background: var(--tomato); }
.check-dots span.here { background: var(--sun); transform: scale(1.25); }
.result-card { text-align: center; }
.result-card .big-emoji { font-size: 4.5rem; line-height: 1; animation: pop-in 0.6s cubic-bezier(.2, 1.6, .4, 1) both; }
.result-card .score { font: 800 3rem var(--font-head); }
.big-stars { font-size: 3rem; letter-spacing: 8px; }
.big-stars span { display: inline-block; animation: star-pop 0.5s cubic-bezier(.2, 1.8, .4, 1) both; }
.big-stars span:nth-child(2) { animation-delay: 0.25s; }
.big-stars span:nth-child(3) { animation-delay: 0.5s; }

/* diploma */
.diploma {
  background: #fffdf5; border: 6px double var(--ink); border-radius: 18px; padding: 34px 26px; text-align: center; position: relative;
  box-shadow: var(--shadow); background-image: radial-gradient(circle at 10% 10%, var(--sun-l), transparent 30%), radial-gradient(circle at 90% 90%, var(--grape-l), transparent 35%);
}
.diploma .seal { width: 110px; height: 110px; margin: 0 auto 10px; border-radius: 50%; background: var(--tomato); border: 4px solid var(--ink); display: grid; place-items: center; font-size: 3.4rem; box-shadow: 0 6px 0 var(--ink); }
.diploma h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.diploma .name { font: 800 clamp(2.2rem, 7vw, 3.4rem) var(--font-head); color: var(--grape-d); }

/* ---------- modal / toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(36, 18, 63, 0.55); z-index: 200; display: grid; place-items: center; padding: 16px; animation: fade-in 0.2s both; }
.modal { max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; animation: pop-in 0.4s cubic-bezier(.2, 1.4, .4, 1) both; }
.toast-zone { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; width: min(92vw, 460px); }
.toast { background: var(--ink); color: #fff; border-radius: 16px; padding: 10px 16px; font-weight: 700; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25); animation: pop-in 0.35s both; display: flex; gap: 10px; align-items: center; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 400; }
.xp-pop { position: fixed; z-index: 450; font: 800 1.6rem var(--font-head); color: var(--mint-d); pointer-events: none; animation: float-up 1s ease-out forwards; text-shadow: 2px 2px 0 #fff; }

/* ---------- parent dashboard ---------- */
.pd-table { width: 100%; border-collapse: separate; border-spacing: 0; border: var(--border); border-radius: 16px; overflow: hidden; background: #fff; font-size: 0.95rem; }
.pd-table th, .pd-table td { padding: 8px 10px; border-bottom: 2px solid #eee4f7; text-align: left; vertical-align: top; }
.pd-table th { background: var(--grape-l); font-family: var(--font-head); }
.pd-table tr:last-child td { border-bottom: none; }
.pill { display: inline-block; border-radius: 99px; padding: 0 10px; font: 800 0.85rem var(--font-head); border: 2px solid var(--ink); }
.pill.ok { background: var(--mint); color: #fff; }
.pill.mid { background: var(--sun); }
.pill.no { background: #eee; }
.pill.bad { background: var(--tomato); color: #fff; }

/* footer */
.footer { padding: 30px 0 50px; text-align: center; font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- animations ---------- */
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }
@keyframes wiggle { 0%, 88%, 100% { transform: rotate(0); } 91% { transform: rotate(-4deg); } 94% { transform: rotate(4deg); } 97% { transform: rotate(-2deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-8deg); } }
@keyframes pulse-ring { 0% { box-shadow: 0 7px 0 var(--ink), 0 0 0 0 rgba(255, 200, 61, 0.9); } 70% { box-shadow: 0 7px 0 var(--ink), 0 0 0 18px rgba(255, 200, 61, 0); } 100% { box-shadow: 0 7px 0 var(--ink), 0 0 0 0 rgba(255, 200, 61, 0); } }
@keyframes star-pop { from { opacity: 0; transform: scale(0.2) rotate(-40deg); } to { opacity: 1; transform: none; } }
@keyframes float-up { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -60px); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .card { padding: 18px 16px; }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero .mascot { width: 130px; margin: 0 auto; order: -1; }
  .quest-node, .quest-node:nth-child(odd of .quest-node) { flex-direction: row; text-align: left; margin-left: 0; width: 100%; }
  .quest-node .qn-circle { width: 76px; height: 76px; font-size: 2rem; }
  .topbar .lesson-name { display: none; }
  .match-grid { gap: 8px 10px; }
  .match-item { font-size: 0.92rem; padding: 8px; }
  .say .mascot { width: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media print {
  .topbar, .section-nav, .footer, .no-print, .toast-zone { display: none !important; }
  body { background: #fff; }
  .diploma { box-shadow: none; }
}

/* narrated scenes */
.listen { background: linear-gradient(135deg, #f1ebff, #fff6e5); }
.listen-stage { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.listen-cast { display: flex; gap: 10px; }
.listen-avatar { text-align: center; width: 92px; transition: transform 0.2s; }
.listen-avatar .la-img svg { width: 100%; height: auto; }
.listen-avatar .la-name { font: 800 0.9rem var(--font-head); }
.listen-avatar.speaking { transform: translateY(-6px) scale(1.06); }
.listen-avatar.speaking .la-img { animation: bob 0.6s ease-in-out infinite; }
.listen-avatar.speaking .la-name { background: var(--sun); border-radius: 99px; border: 2px solid var(--ink); }
.listen-controls { display: flex; gap: 14px; align-items: center; }
.listen-play { flex: none; width: 74px; height: 74px; border-radius: 50%; border: 4px solid var(--ink); background: var(--grape); color: #fff; font-size: 2rem; cursor: pointer; box-shadow: 0 6px 0 var(--ink); }
.listen-play:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.listen.playing .listen-play { background: var(--tomato); }
.listen-right { flex: 1; min-width: 0; display: grid; gap: 6px; }
.listen-bar { height: 16px; border: var(--border); border-radius: 99px; background: #fff; overflow: hidden; cursor: pointer; }
.listen-fill { height: 100%; width: 0; background: var(--grape); }
.listen-time { font: 700 0.85rem var(--font-head); color: var(--ink-soft); }
.listen-script { margin-top: 14px; }
.listen-script summary { cursor: pointer; font: 800 1rem var(--font-head); }
.listen-lines { display: grid; gap: 10px; margin-top: 10px; }
.listen-line { display: flex; gap: 10px; align-items: flex-start; }
.listen-line .ll-av { width: 46px; flex: none; }
.listen-line .ll-av svg { width: 100%; height: auto; }
.listen-line .bubble { font-weight: 600; flex: 1; }
.listen-line.now .bubble { background: var(--sun-l); }
@media (max-width: 640px) { .listen-stage { grid-template-columns: 1fr; } .listen-cast { justify-content: center; } }
.result-card .mascot, .modal .mascot { width: 130px; margin: 0 auto 8px; }
