@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/baloo2-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/baloo2-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: 'Baloo 2'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/baloo2-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; }

:root {
  --ink: #2d2a4a;
  --ink-soft: #5d5a7a;
  --bg1: #fff4d6;
  --bg2: #dff4ff;
  --card: #ffffff;
  /* màu nền cho chữ trắng: tương phản ≥ 3.7:1 */
  --orange: #d95f0e; --orange-d: #a8470a;
  --teal: #0e8a7d;   --teal-d: #08655b;
  --purple: #7552e0; --purple-d: #5236b8;
  --pink: #d93368;   --pink-d: #a8224d;
  --blue: #1a73d1;   --blue-d: #12569e;
  --green: #1b8e48;  --green-d: #126a35;
  --yellow: #ffc533; --yellow-d: #d99d0b;
  --red: #d63b3b;    --red-d: #a82a2a;
  --radius: 22px;
  --tap: 56px;
  font-size: 20px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Baloo 2', 'Nunito', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg1) 0%, #fffaf0 40%, var(--bg2) 100%) fixed;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { max-width: 1100px; margin: 0 auto; padding: 0 14px 40px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  background: linear-gradient(180deg, rgba(255,244,214,.97) 70%, rgba(255,244,214,0));
}
.topbar h1 { flex: 1; min-width: 0; margin: 0; font-size: 1.25rem; line-height: 1.3; overflow-wrap: anywhere; }
.icon-btn {
  min-width: var(--tap); height: var(--tap); padding: 0 12px;
  border: 0; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 #e6d7b3;
  font-size: 1.5rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #e6d7b3; }
.icon-btn small { font-size: .85rem; }
.star-chip { background: #fff3c4; box-shadow: 0 4px 0 var(--yellow-d); font-size: 1.1rem; }
.star-chip.pop { animation: pop .5s ease; }

/* ---------- mascot guide ---------- */
.guide { display: flex; align-items: flex-end; gap: 10px; margin: 4px 0 14px; }
.owl { width: 86px; flex: none; filter: drop-shadow(0 4px 0 rgba(0,0,0,.08)); transform-origin: 50% 90%; }
.owl.happy { animation: hop .7s ease; }
.owl.think { animation: tilt .8s ease; }
.bubble {
  position: relative; flex: 1; min-width: 0;
  background: #fff; border-radius: var(--radius); padding: 10px 12px 10px 16px;
  box-shadow: 0 5px 0 #eadfc4;
  display: flex; align-items: center; gap: 10px;
}
.bubble::before { content: ''; position: absolute; left: -12px; bottom: 18px; border: 12px solid transparent; border-right-color: #fff; border-left: 0; }
.bubble .say { flex: 1; margin: 0; font-size: 1.1rem; font-weight: 600; }
.bubble .say .en { display: block; font-size: .85rem; color: var(--ink-soft); font-weight: 500; }
.bubble.flash { animation: pop .45s ease; }

.speak-btn {
  flex: none; width: var(--tap); height: var(--tap); border-radius: 50%; border: 0;
  background: var(--blue); color: #fff; font-size: 1.6rem; box-shadow: 0 4px 0 var(--blue-d);
  display: inline-flex; align-items: center; justify-content: center;
}
.speak-btn:active, .btn:active { transform: translateY(3px); box-shadow: none; }
.speak-btn.playing { animation: pulse 1s infinite; }

/* ---------- generic buttons ---------- */
.btn {
  min-height: var(--tap); padding: 8px 22px; border: 0; border-radius: 20px;
  font-size: 1.15rem; font-weight: 800; color: #fff; background: var(--blue); box-shadow: 0 5px 0 var(--blue-d);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
}
.btn.green { background: var(--green); box-shadow: 0 5px 0 var(--green-d); }
.btn.orange { background: var(--orange); box-shadow: 0 5px 0 var(--orange-d); }
.btn.purple { background: var(--purple); box-shadow: 0 5px 0 var(--purple-d); }
.btn.pink { background: var(--pink); box-shadow: 0 5px 0 var(--pink-d); }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 5px 0 #d9cfb8; }
.btn.big { font-size: 1.35rem; min-height: 68px; padding: 10px 30px; border-radius: 24px; }
.btn[disabled] { opacity: .45; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.center { text-align: center; }
.mt { margin-top: 18px; }

/* ---------- menu tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tiles.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tile {
  position: relative; min-height: 130px; border: 0; border-radius: 26px; padding: 16px 16px 14px;
  color: #fff; text-align: left; background: var(--c, var(--orange));
  box-shadow: 0 7px 0 var(--cd, var(--orange-d));
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; overflow: hidden;
  text-decoration: none;
}
.tile:active { transform: translateY(4px); box-shadow: 0 3px 0 var(--cd, var(--orange-d)); }
.tile .ic { position: absolute; right: 12px; top: 8px; font-size: 3.4rem; line-height: 1; filter: drop-shadow(0 3px 0 rgba(0,0,0,.12)); }
.tile .ic img { width: 84px; height: 84px; object-fit: contain; background: #fff; border-radius: 18px; padding: 6px; }
.tile b { font-size: 1.45rem; line-height: 1.1; max-width: 75%; }
.tile span.sub { font-size: .95rem; opacity: .95; font-weight: 600; }
.tile .done-mark { position: absolute; left: 12px; top: 10px; background: rgba(255,255,255,.9); color: var(--green-d); border-radius: 12px; padding: 0 8px; font-size: .9rem; font-weight: 800; }
.section-title { font-size: 1.15rem; margin: 22px 4px 10px; color: var(--ink-soft); }

/* ---------- picture cards ---------- */
.pic { background: #fff; border-radius: 18px; display: flex; align-items: center; justify-content: center; padding: 8px; }
.pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.choice {
  position: relative; border: 4px solid transparent; background: #fff; border-radius: 22px;
  box-shadow: 0 6px 0 #e1d6bd; padding: 8px; min-height: var(--tap);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: transform .12s;
}
.choice:active { transform: scale(.97); }
.choice img { width: 100%; height: 120px; object-fit: contain; pointer-events: none; }
.choice .lbl { font-weight: 800; font-size: 1.1rem; color: var(--ink-soft); }
.choice.selected { border-color: var(--blue); box-shadow: 0 6px 0 var(--blue-d); }
.choice.correct { border-color: var(--green); box-shadow: 0 6px 0 var(--green-d); background: #eafff1; }
.choice.wrong { border-color: var(--red); }
.choice.dim { opacity: .45; }
.choice .badge-num {
  position: absolute; top: -10px; right: -8px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--orange); color: #fff; font-weight: 800; font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 var(--orange-d); animation: pop .4s ease;
}
.choice .tickbox { position: absolute; top: 6px; right: 8px; font-size: 1.4rem; }
.choices { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choices.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.word-btn {
  min-height: 68px; border: 4px solid transparent; border-radius: 22px; background: #fff;
  box-shadow: 0 6px 0 #e1d6bd; font-size: 1.7rem; font-weight: 800; padding: 6px 16px;
}
.word-btn.selected { border-color: var(--blue); }
.word-btn.correct { border-color: var(--green); background: #eafff1; }
.word-btn.wrong { border-color: var(--red); }

/* ---------- question stage ---------- */
.stage { background: rgba(255,255,255,.6); border-radius: 28px; padding: 16px; box-shadow: inset 0 0 0 3px rgba(255,255,255,.9); }
.qhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.qnum { background: var(--purple); color: #fff; font-weight: 800; border-radius: 16px; padding: 4px 14px; font-size: 1.15rem; }
.qnum.ex { background: var(--yellow); color: var(--ink); }
.progress { flex: 1; min-width: 120px; height: 16px; border-radius: 10px; background: #fff; overflow: hidden; box-shadow: inset 0 0 0 2px #eee3c9; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--orange)); border-radius: 10px; transition: width .3s; }
.big-pic { width: min(320px, 70vw); height: 220px; margin: 0 auto; border-radius: 26px; box-shadow: 0 6px 0 #e1d6bd; border: 4px solid #fff; background: #fff; }
.sentence { font-size: 2rem; font-weight: 800; text-align: center; margin: 14px 0; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.tf { display: flex; gap: 22px; justify-content: center; }
.tf button { width: 120px; height: 100px; border: 0; border-radius: 26px; font-size: 3.2rem; font-weight: 800; color: #fff; }
.tf .yes { background: var(--green); box-shadow: 0 7px 0 var(--green-d); }
.tf .no { background: var(--red); box-shadow: 0 7px 0 var(--red-d); }
.tf button.selected { outline: 6px solid var(--blue); outline-offset: 3px; }
.tf button:active { transform: translateY(4px); box-shadow: none; }
.next-wrap { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; min-height: 68px; }
.play-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 16px; }
.play-btn { min-height: 72px; font-size: 1.4rem; padding: 8px 26px; border-radius: 36px; }
.play-btn.playing { animation: pulse 1s infinite; }
.note { text-align: center; color: var(--ink-soft); font-size: .95rem; margin: 8px 0 0; }
.script { text-align: center; font-size: 1.3rem; font-weight: 700; color: var(--teal-d); margin: 10px 0 0; }

/* ---------- flashcards ---------- */
.flash-wrap { perspective: 1200px; max-width: 460px; margin: 0 auto; }
.flash { position: relative; width: 100%; aspect-ratio: 4 / 3.4; border: 0; padding: 0; background: none; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3,1.4,.6,1); }
.flash.flipped { transform: rotateY(180deg); }
.flash .face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 30px; background: #fff; border: 6px solid var(--gc, var(--orange)); box-shadow: 0 8px 0 rgba(0,0,0,.1);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 6px;
}
.flash .face img { max-height: 70%; max-width: 85%; object-fit: contain; }
.flash .back { transform: rotateY(180deg); background: #fffdf6; }
.flash .tap-hint { position: absolute; bottom: 8px; font-size: .9rem; color: var(--ink-soft); }
.flash .letter { position: absolute; top: 10px; left: 14px; font-size: 2.2rem; font-weight: 800; color: var(--gc, var(--purple)); }
.flash .en { font-size: 3rem; font-weight: 800; line-height: 1; }
.flash .vi { font-size: 1.6rem; font-weight: 700; color: var(--teal-d); }
.flash .ex { font-size: 1.15rem; color: var(--ink-soft); text-align: center; }
.flash .back img { max-height: 36%; }
.card-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.card-nav .count { font-weight: 800; font-size: 1.2rem; min-width: 64px; text-align: center; }
.round-btn { width: 68px; height: 68px; border-radius: 50%; border: 0; background: var(--orange); color: #fff; font-size: 2rem; font-weight: 800; box-shadow: 0 5px 0 var(--orange-d); }
.round-btn:active { transform: translateY(3px); box-shadow: none; }
.round-btn[disabled] { opacity: .35; }

/* ---------- match game ---------- */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; max-width: 640px; margin: 0 auto; }
.match .col { display: flex; flex-direction: column; gap: 12px; }
.match .choice img { height: 84px; }
.match .word-btn { min-height: 100px; font-size: 1.6rem; }
.match .done { visibility: hidden; }
.match .matched { border-color: var(--green); background: #eafff1; pointer-events: none; }

/* ---------- writing ---------- */
.slots { display: flex; justify-content: center; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.slot {
  width: 64px; height: 76px; border-radius: 16px; border: 0; background: #fff;
  box-shadow: inset 0 -4px 0 #e6dcc4, 0 0 0 3px #e6dcc4; font-size: 2.4rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.slot.first { box-shadow: inset 0 -4px 0 #ffd36e, 0 0 0 3px var(--yellow); }
.slot.filled { color: var(--purple-d); }
.tiles-letters { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.ltile {
  width: 72px; height: 72px; border: 0; border-radius: 18px; background: var(--yellow); box-shadow: 0 6px 0 var(--yellow-d);
  font-size: 2.4rem; font-weight: 800; color: var(--ink);
}
.ltile.used { visibility: hidden; }
.ltile:active { transform: translateY(4px); box-shadow: none; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.bank button { min-height: var(--tap); border: 3px solid #e6dcc4; background: #fff; border-radius: 14px; padding: 4px 14px; font-size: 1.2rem; font-weight: 700; }
.bank button.used { text-decoration: line-through; color: #aaa; border-style: dashed; }
.answer-line {
  min-height: 76px; max-width: 420px; margin: 12px auto; border-radius: 18px; background: #fff;
  box-shadow: inset 0 0 0 3px #d8cdb4; background-image: repeating-linear-gradient(90deg, #cfc3a8 0 10px, transparent 10px 18px);
  background-size: 100% 2px; background-repeat: no-repeat; background-position: 0 70%;
  display: flex; align-items: center; justify-content: center; font-size: 2.6rem; font-weight: 800; letter-spacing: 3px; color: var(--purple-d);
}
.answer-line .caret { display: inline-block; width: 3px; height: 1em; background: var(--blue); margin-left: 4px; animation: blink 1s steps(2) infinite; }
.keyboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tap), 1fr)); gap: 8px; max-width: 900px; margin: 0 auto; }
.key { height: 60px; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 5px 0 #d9cfb8; font-size: 1.8rem; font-weight: 800; }
.key:active { transform: translateY(3px); box-shadow: none; }
.key.wide { grid-column: span 2; font-size: 1.2rem; }
.key.back { background: #ffe1e1; box-shadow: 0 5px 0 #f1a9a9; }
.key.ok { background: var(--green); color: #fff; box-shadow: 0 5px 0 var(--green-d); }

/* ---------- speaking ---------- */
.question-card { background: #fff; border-radius: 26px; padding: 18px; text-align: center; box-shadow: 0 6px 0 #e1d6bd; max-width: 560px; margin: 0 auto; }
.question-card .q { font-size: 2rem; font-weight: 800; }
.question-card .vi { color: var(--ink-soft); font-weight: 600; }
.mic {
  width: 112px; height: 112px; border-radius: 50%; border: 0; background: var(--pink); color: #fff; font-size: 3.2rem;
  box-shadow: 0 7px 0 var(--pink-d); display: inline-flex; align-items: center; justify-content: center;
}
.mic.listening { animation: pulse 1s infinite; background: var(--red); }
.mic[disabled] { opacity: .4; }
.heard { text-align: center; font-size: 1.25rem; min-height: 1.6em; margin: 8px 0; }
.sample { text-align: center; background: #effbf6; border-radius: 18px; padding: 10px; margin: 12px auto 0; max-width: 520px; font-size: 1.35rem; font-weight: 700; color: var(--teal-d); }
.self-check { margin-top: 12px; }

/* ---------- results ---------- */
.result-hero { text-align: center; background: #fff; border-radius: 30px; padding: 20px; box-shadow: 0 7px 0 #e1d6bd; }
.result-hero .score { font-size: 3.4rem; font-weight: 800; color: var(--orange-d); line-height: 1; }
.result-hero .stars { font-size: 3rem; letter-spacing: 6px; }
.result-hero .msg { font-size: 1.4rem; font-weight: 700; }
.skill-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.skill { background: #fff; border-radius: 20px; padding: 10px; text-align: center; box-shadow: 0 5px 0 #e1d6bd; font-weight: 700; }
.skill b { display: block; font-size: 1.6rem; }
.mistakes { display: grid; gap: 10px; }
.mistake { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; background: #fff; border-radius: 18px; padding: 10px; box-shadow: 0 4px 0 #f1c7c7; border-left: 8px solid var(--red); }
.mistake img { width: 84px; height: 70px; object-fit: contain; }
.mistake .lab { font-size: .9rem; color: var(--ink-soft); font-weight: 700; }
.mistake .yours { color: var(--red-d); }
.mistake .right { color: var(--green-d); font-weight: 800; }

/* ---------- badges ---------- */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge { background: #fff; border-radius: 20px; padding: 12px; text-align: center; box-shadow: 0 5px 0 #e1d6bd; }
.badge .bi { font-size: 2.8rem; }
.badge.locked { opacity: .45; filter: grayscale(1); }
.badge b { display: block; }
.badge small { color: var(--ink-soft); }

/* ---------- exam-mode (whole file) ---------- */
.player-bar { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 24px; padding: 10px 14px; box-shadow: 0 5px 0 #e1d6bd; margin-bottom: 14px; flex-wrap: wrap; }
.player-bar .progress { min-width: 140px; }
.player-bar .time { font-weight: 800; min-width: 92px; text-align: center; }
.exam-rows { display: grid; gap: 12px; }
.exam-row { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: center; background: #fff; border-radius: 20px; padding: 8px; box-shadow: 0 4px 0 #e1d6bd; }
.exam-row.now { box-shadow: 0 0 0 4px var(--yellow), 0 4px 0 #e1d6bd; }
.exam-row .rn { font-weight: 800; font-size: 1.3rem; text-align: center; }
.exam-row .choices { gap: 10px; }
.exam-row .choice img { height: 80px; }
.exam-row.ex-row { grid-template-columns: 150px 1fr; }
.exam-row.ex-row .pic { height: 96px; }
.numpad { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.numpad button { width: 64px; height: 64px; border-radius: 18px; border: 0; background: var(--orange); color: #fff; font-size: 1.8rem; font-weight: 800; box-shadow: 0 5px 0 var(--orange-d); }
.numpad button.clear { width: auto; padding: 0 14px; font-size: 1.1rem; background: #fff; color: var(--ink); box-shadow: 0 5px 0 #d9cfb8; }
.numpad-label { text-align: center; font-weight: 700; margin-top: 10px; }

/* ---------- celebration ---------- */
.celebrate { text-align: center; padding: 20px 10px; }
.celebrate .big { font-size: 5rem; animation: hop 1s ease infinite; display: inline-block; }
.celebrate h2 { font-size: 2rem; margin: 6px 0; }
.burst { position: fixed; pointer-events: none; z-index: 50; font-size: 1.8rem; animation: fly .9s ease-out forwards; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 18px; font-weight: 700; max-width: 90vw; text-align: center; animation: pop .4s ease; }

.shake { animation: shake .45s ease; }
.pop { animation: pop .45s ease; }

@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes hop { 0%,100% { transform: translateY(0); } 30% { transform: translateY(-18px) rotate(-4deg); } 60% { transform: translateY(0); } 75% { transform: translateY(-6px); } }
@keyframes tilt { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 60% { transform: rotate(6deg); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes blink { to { visibility: hidden; } }
@keyframes fly { 0% { opacity: 1; transform: translate(0,0) scale(.6); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.3); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- small phones (portrait) ---------- */
@media (max-width: 600px) {
  :root { font-size: 18px; }
  #app { padding: 0 10px 32px; }
  .owl { width: 64px; }
  .tiles, .tiles.three { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tile { min-height: 118px; padding: 12px; }
  .tile .ic { font-size: 2.6rem; right: 8px; }
  .tile .ic img { width: 60px; height: 60px; }
  .tile b { font-size: 1.15rem; max-width: 100%; }
  .tile span.sub { font-size: .8rem; }
  .choices.four, .choices.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .choices { gap: 10px; }
  .choice img { height: 86px; }
  .big-pic { height: 180px; }
  .sentence { font-size: 1.6rem; }
  .word-btn { font-size: 1.4rem; }
  .slot { width: 56px; height: 64px; font-size: 2rem; }
  .slots { gap: 6px; }
  .ltile { width: 62px; height: 62px; font-size: 2rem; }
  .flash .en { font-size: 2.4rem; }
  .exam-row { grid-template-columns: 1fr; }
  .exam-row .rn { text-align: left; padding-left: 6px; }
  .exam-row .choice img { height: 64px; }
  .exam-row.ex-row { grid-template-columns: 96px 1fr; }
  .exam-row.ex-row .pic { height: 76px; padding: 4px; }
  .exam-row.ex-row .sentence { font-size: 1.25rem; gap: 6px; }
  .topbar { gap: 6px; }
  .topbar h1 { font-size: 1.02rem; }
  .match { gap: 10px 12px; }
  .match .word-btn { font-size: 1.3rem; min-height: 96px; padding: 4px; }
  .question-card .q { font-size: 1.6rem; }
  .mistake { grid-template-columns: 64px 1fr; }
  .mistake img { width: 64px; }
}
@media (max-width: 360px) {
  .tiles, .tiles.three { grid-template-columns: 1fr; }
}
/* ---------- landscape phones (short screens) ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  .owl { width: 56px; }
  .guide { margin-bottom: 8px; }
  .bubble .say { font-size: 1rem; }
  .big-pic { height: 150px; }
  .choice img { height: 80px; }
  .tile { min-height: 104px; }
  .flash-wrap { max-width: 340px; }
}
