/* ============================================================
   Thăng Long English — giao diện cho trẻ học tiếng Anh
   Chủ đề: "Giấy" (mặc định), "Bầu trời", "Ban đêm"
   ============================================================ */
:root {
  --font: 'Nunito', 'Quicksand', 'Segoe UI', 'Arial Rounded MT Bold', Arial, sans-serif;
  --paper: #fffaf0;
  --paper-2: #fff3dc;
  --paper-3: #fbe9c6;
  --ink: #3b2f22;
  --ink-2: #6b5a48;
  --ink-3: #9a8a76;
  --line: #e6d6ba;
  --line-2: #d2bf9c;
  --red: #d7263d; --red-d: #a91d2f;
  --gold: #f6b93b; --gold-d: #c98e13;
  --green: #3f9a4f; --green-d: #2d7439;
  --blue: #2b7fc3; --blue-d: #1f5f94;
  --purple: #7a5bd6; --purple-d: #5a3fb0;
  --orange: #f07c2b; --orange-d: #c25d16;
  --teal: #1f9a8a; --teal-d: #157268;
  --pink: #e8558f; --pink-d: #b83a6f;
  --gray: #8d8d8d; --gray-d: #6a6a6a;
  --ok-bg: #e4f5e6; --ok-ink: #22663a;
  --bad-bg: #fde4e6; --bad-ink: #9e1c2c;
  --shadow: 0 10px 30px rgba(60, 40, 10, .18);
  --radius: 18px;
  --scene-dim: 0;
}
:root[data-theme="bautroi"] {
  --paper: #f6fbff; --paper-2: #e6f2ff; --paper-3: #d3e7fb;
  --ink: #1f2f44; --ink-2: #44607f; --ink-3: #7b93ad;
  --line: #c9dcef; --line-2: #a9c3df;
  --shadow: 0 10px 30px rgba(20, 50, 90, .18);
}
:root[data-theme="bandem"] {
  --paper: #2a3140; --paper-2: #323a4b; --paper-3: #3c4557;
  --ink: #f3f0ea; --ink-2: #cfc8bb; --ink-3: #a39b8d;
  --line: #4a5467; --line-2: #5a667c;
  --ok-bg: #22463a; --ok-ink: #bfe9c9; --bad-bg: #4a2630; --bad-ink: #ffb8c2;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --scene-dim: .55;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #cfe9f7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
h1, h2, h3, h4 { margin: 0; font-weight: 800; }
p { margin: 0; }
::selection { background: var(--gold); color: #000; }

/* ---------- Cảnh nền ---------- */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.scene svg { width: 100%; height: 100%; display: block; }
.scene::after { content: ''; position: absolute; inset: 0; background: #0b1020; opacity: var(--scene-dim); transition: opacity .4s; }
#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Băng chạy Top 3 ---------- */
.ticker {
  background: linear-gradient(90deg, var(--gold) 0, #ffd56b 50%, var(--gold) 100%);
  color: #4a3000; font-size: 13px; font-weight: 700; height: 30px; display: flex; align-items: center; overflow: hidden; white-space: nowrap;
  border-bottom: 2px solid #c98e13;
}
.ticker-label { background: #4a3000; color: #ffd56b; padding: 0 12px; height: 100%; display: flex; align-items: center; gap: 6px; flex: none; letter-spacing: .5px; }
.ticker-track { display: flex; gap: 40px; padding-left: 20px; animation: ticker 28s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 6px; }
.ticker-item b { background: rgba(255,255,255,.55); border-radius: 999px; padding: 1px 8px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Thanh trên ---------- */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 12px 18px 0; }
.profile-chip {
  display: flex; align-items: center; gap: 10px; background: var(--paper); border: 2px solid var(--line-2); border-radius: 999px; padding: 6px 14px 6px 6px;
  box-shadow: 0 4px 0 var(--line-2); text-align: left; max-width: 340px; justify-self: start; transition: transform .1s;
}
.profile-chip:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line-2); }
.profile-chip .avatar { width: 46px; height: 46px; }
.profile-chip .pc-name { font-weight: 800; font-size: 15px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-chip .pc-lv { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.profile-chip .pc-streak { font-size: 11px; background: var(--orange); color: #fff; border-radius: 999px; padding: 2px 8px; font-weight: 800; white-space: nowrap; }
.xpbar { height: 8px; background: var(--paper-3); border-radius: 999px; overflow: hidden; margin-top: 4px; min-width: 110px; }
.xpbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #7cd08b); border-radius: 999px; transition: width .6s; }
.pc-xptext { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.logo { text-align: center; }
.logo-sign {
  display: inline-block; background: var(--paper); border: 3px solid var(--red); border-radius: 16px; padding: 6px 22px; box-shadow: 0 6px 0 var(--red-d), var(--shadow);
  font-size: clamp(22px, 4vw, 34px); font-weight: 900; letter-spacing: 1px; color: var(--red); line-height: 1.05; position: relative;
}
.logo-sign small { display: block; font-size: 11px; letter-spacing: 3px; color: var(--gold-d); font-weight: 800; }
.logo-sub { display: inline-block; margin-top: 8px; font-size: 12px; background: rgba(255,255,255,.75); border-radius: 999px; padding: 3px 12px; color: var(--ink-2); font-weight: 700; }
.topbar-actions { display: flex; gap: 8px; justify-self: end; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(0,0,0,.08); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.2); transition: transform .1s, box-shadow .1s; position: relative;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.icon-btn[data-tip]:hover::after { content: attr(data-tip); position: absolute; top: 110%; right: 0; background: #2b2b2b; color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 5; }
.icon-btn.green { background: var(--green); } .icon-btn.gold { background: var(--gold); color: #4a3000; } .icon-btn.purple { background: var(--purple); } .icon-btn.orange { background: var(--orange); } .icon-btn.blue { background: var(--blue); } .icon-btn.gray { background: var(--gray); } .icon-btn.red { background: var(--red); }
.icon-btn.off { opacity: .55; }

/* ---------- Nút 3D ---------- */
.btn3d {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 14px; padding: 12px 22px; font-weight: 800; font-size: 15px; color: #fff; letter-spacing: .3px;
  box-shadow: 0 5px 0 rgba(0,0,0,.25); transition: transform .08s, box-shadow .08s, filter .15s; text-transform: uppercase; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn3d:hover { filter: brightness(1.06); }
.btn3d:active, .btn3d.pressed { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn3d:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn3d.btn-green { background: var(--green); box-shadow: 0 5px 0 var(--green-d); }
.btn3d.btn-red { background: var(--red); box-shadow: 0 5px 0 var(--red-d); }
.btn3d.btn-blue { background: var(--blue); box-shadow: 0 5px 0 var(--blue-d); }
.btn3d.btn-purple { background: var(--purple); box-shadow: 0 5px 0 var(--purple-d); }
.btn3d.btn-orange { background: var(--orange); box-shadow: 0 5px 0 var(--orange-d); }
.btn3d.btn-gold { background: var(--gold); color: #4a3000; box-shadow: 0 5px 0 var(--gold-d); }
.btn3d.btn-teal { background: var(--teal); box-shadow: 0 5px 0 var(--teal-d); }
.btn3d.btn-pink { background: var(--pink); box-shadow: 0 5px 0 var(--pink-d); }
.btn3d.btn-gray { background: var(--gray); box-shadow: 0 5px 0 var(--gray-d); }
.btn3d.btn-paper { background: var(--paper); color: var(--ink); border: 2px solid var(--line-2); box-shadow: 0 4px 0 var(--line-2); }
.btn3d.sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; }
.btn3d.lg { padding: 15px 30px; font-size: 17px; }
.btn3d.block { width: 100%; }
.btn-link { background: none; border: none; color: var(--blue); text-decoration: underline; font-weight: 700; padding: 4px; }

/* ---------- Thẻ, nhãn ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; border: 1.5px solid; white-space: nowrap; }
.tag-purple { color: var(--purple); border-color: var(--purple); background: #f1ecff; }
.tag-green { color: var(--green-d); border-color: var(--green); background: #e6f6e8; }
.tag-gold { color: #7a5200; border-color: var(--gold); background: #fff3cf; }
.tag-red { color: var(--red-d); border-color: var(--red); background: #ffe3e6; }
.tag-blue { color: var(--blue-d); border-color: var(--blue); background: #e3f0fb; }
.tag-gray { color: #555; border-color: #bbb; background: #f0f0f0; }
:root[data-theme="bandem"] .tag { background: rgba(255,255,255,.08); }

.card { background: var(--paper); border: 2px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; }
.note { background: #fff6dc; border: 1.5px dashed var(--gold-d); color: #5a3f00; border-radius: 12px; padding: 10px 14px; font-size: 13px; font-weight: 600; }
:root[data-theme="bandem"] .note { background: #4a3f22; color: #ffe8b0; }
.muted { color: var(--ink-3); font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hidden { display: none !important; }

/* ---------- Avatar ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff, var(--paper-3)); border: 2px solid var(--gold); overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-emoji { font-size: 1.4em; line-height: 1; }
.avatar.lg { width: 84px; height: 84px; border-width: 3px; }
.avatar.lg .avatar-emoji { font-size: 2.6em; }
.avatar.xl { width: 110px; height: 110px; border-width: 4px; }
.avatar.xl .avatar-emoji { font-size: 3.4em; }
.avatar.girl { border-color: var(--pink); }

/* ---------- Trang chủ ---------- */
.view { flex: 1; padding: 18px; max-width: 1180px; width: 100%; margin: 0 auto; }
.home-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 18px; }
.game-card {
  background: var(--paper); border: 2px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow); padding: 0 0 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; overflow: hidden; position: relative; transition: transform .15s;
}
.game-card:hover { transform: translateY(-4px); }
.game-card .gc-band { width: 100%; height: 110px; display: flex; align-items: center; justify-content: center; font-size: 64px; position: relative; }
.game-card .gc-band::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 14px; background: var(--paper); border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.game-card.c-green .gc-band { background: linear-gradient(135deg, #cdeccf, #9ed8a5); }
.game-card.c-red .gc-band { background: linear-gradient(135deg, #ffd3d8, #ffa3ad); }
.game-card.c-orange .gc-band { background: linear-gradient(135deg, #ffe0c2, #ffbf86); }
.game-card.c-purple .gc-band { background: linear-gradient(135deg, #e3dbff, #c3b4ff); }
.game-card h3 { font-size: 21px; padding: 4px 14px 0; }
.game-card p { color: var(--ink-2); font-size: 13.5px; padding: 0 16px; min-height: 40px; }
.game-card .gc-num { position: absolute; top: 10px; left: 12px; background: rgba(255,255,255,.85); color: var(--ink-2); font-size: 11px; font-weight: 800; border-radius: 999px; padding: 2px 8px; }
.home-hero { text-align: center; margin-top: 4px; }
.home-hero .hero-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--paper); border: 2px solid var(--line-2); border-radius: 999px; padding: 6px 16px; font-weight: 700; color: var(--ink-2); font-size: 14px; box-shadow: 0 3px 0 var(--line-2); }
.daily-goal { margin-top: 18px; display: flex; justify-content: center; }
.daily-goal .card { display: flex; align-items: center; gap: 14px; padding: 10px 16px; max-width: 560px; width: 100%; }
.daily-goal .dg-bar { flex: 1; height: 12px; border-radius: 999px; background: var(--paper-3); overflow: hidden; }
.daily-goal .dg-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--gold)); border-radius: 999px; transition: width .6s; }

/* ---------- Chân trang ---------- */
.footer { text-align: center; padding: 14px 18px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.footer .foot-links { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.foot-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--paper); border: 2px solid var(--line-2); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 13px; color: var(--ink); box-shadow: 0 3px 0 var(--line-2); text-decoration: none; }
.foot-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line-2); }
.foot-copy { font-size: 12px; color: var(--ink-2); background: rgba(255,255,255,.7); border-radius: 999px; padding: 3px 14px; }
:root[data-theme="bandem"] .foot-copy { background: rgba(0,0,0,.35); }

/* ---------- Linh vật ---------- */
.mascot { position: fixed; bottom: 0; z-index: 2; width: 150px; pointer-events: none; animation: float 4s ease-in-out infinite; }
.mascot-left { left: 6px; }
.mascot-right { right: 6px; animation-delay: 1.5s; }
.mascot svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 6px rgba(0,0,0,.2)); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
body[data-view]:not([data-view="home"]) .mascot { display: none; }

/* ---------- Nút "Bạn đang chờ" ---------- */
.waiting-btn { position: fixed; right: 16px; bottom: 16px; z-index: 30; background: var(--paper); border: 2px solid var(--line-2); border-radius: 14px; padding: 10px 16px; font-weight: 800; box-shadow: 0 4px 0 var(--line-2), var(--shadow); display: inline-flex; gap: 8px; align-items: center; }
.waiting-btn .badge { background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }

/* ---------- Hộp thoại ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(40, 25, 10, .45); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity .16s; overflow-y: auto; }
.modal-overlay.open { opacity: 1; }
.modal-overlay.closing { opacity: 0; }
.modal { background: var(--paper); border: 3px solid var(--line-2); border-radius: 22px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.35); transform: scale(.96) translateY(8px); transition: transform .18s; margin: auto; }
.modal-overlay.open .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 10px; border-bottom: 2px dashed var(--line); }
.modal-title { display: flex; align-items: center; gap: 10px; }
.modal-title h2 { font-size: 20px; text-transform: uppercase; letter-spacing: .5px; }
.modal-icon { font-size: 24px; }
.modal-head-right { display: flex; align-items: center; gap: 10px; }
.modal-close { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--red); background: #ffe3e6; color: var(--red); font-weight: 900; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px 16px; border-top: 2px dashed var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.confirm-text { font-size: 15px; line-height: 1.5; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 44px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #2b2b2b; color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; opacity: 0; transform: translateY(-10px); transition: all .25s; box-shadow: var(--shadow); max-width: 90vw; }
.toast.show { opacity: 1; transform: none; }
.toast-ok { background: var(--green); } .toast-bad { background: var(--red); } .toast-warn { background: var(--orange); }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-2); }
.input { border: 2px solid var(--line-2); border-radius: 12px; padding: 11px 14px; background: #fff; font-size: 15px; outline: none; width: 100%; transition: border-color .15s, box-shadow .15s; color: #222; }
.input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(63,154,79,.2); }
:root[data-theme="bandem"] .input { background: #1f2531; color: #f3f0ea; }
textarea.input { min-height: 90px; resize: vertical; }
.seg { display: inline-flex; background: var(--paper-3); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: none; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 800; color: var(--ink-2); }
.seg button.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.help { font-size: 12px; color: var(--ink-3); }

/* ---------- Màn hình trò chơi ---------- */
.game-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.game-nav .gn-title { background: var(--paper); border: 2px solid var(--line-2); border-radius: 16px; padding: 8px 22px; text-align: center; box-shadow: 0 4px 0 var(--line-2); }
.game-nav .gn-title h2 { font-size: 22px; }
.game-nav .gn-title p { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.game-nav .gn-right { display: flex; gap: 8px; }

/* chọn chủ đề */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.topic-card { background: var(--paper); border: 2.5px solid var(--line-2); border-radius: 16px; padding: 16px 12px 12px; text-align: center; position: relative; transition: transform .12s, border-color .12s; box-shadow: 0 4px 0 var(--line-2); }
.topic-card:hover { transform: translateY(-3px); }
.topic-card.selected { border-color: var(--green); box-shadow: 0 4px 0 var(--green-d), 0 0 0 4px rgba(63,154,79,.18); }
.topic-card .tc-emoji { font-size: 44px; line-height: 1; }
.topic-card h4 { font-size: 16px; margin-top: 8px; }
.topic-card .tc-sub { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.topic-card .tc-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; border-top: 1.5px dashed var(--line); padding-top: 8px; }
.topic-card .tc-sel { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); }
.topic-card.random .tc-emoji { background: #fff1d6; border-radius: 50%; width: 70px; height: 70px; display: inline-flex; align-items: center; justify-content: center; }
.sticky-foot { position: sticky; bottom: 0; background: linear-gradient(180deg, transparent, rgba(255,250,240,.9) 30%); padding: 14px 0 6px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
:root[data-theme="bandem"] .sticky-foot { background: linear-gradient(180deg, transparent, rgba(42,49,64,.95) 30%); }

/* chọn cách luyện */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.mode-card { background: var(--paper-2); border: 2px solid var(--line-2); border-radius: 16px; padding: 24px 12px 14px; text-align: center; position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mode-card .mc-tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); }
.mode-card .mc-emoji { font-size: 46px; line-height: 1; }
.mode-card h4 { font-size: 16px; min-height: 40px; display: flex; align-items: center; }
.mode-card.disabled { opacity: .6; }

/* quiz */
.quiz-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 14px; }
.player-box { background: var(--paper); border: 2px solid var(--line-2); border-radius: 16px; padding: 8px 14px; display: flex; align-items: center; gap: 10px; box-shadow: 0 4px 0 var(--line-2); min-width: 160px; }
.player-box.right { justify-self: end; flex-direction: row-reverse; text-align: right; }
.player-box.left { justify-self: start; }
.player-box .pb-score { font-size: 28px; font-weight: 900; color: var(--purple); line-height: 1; }
.player-box .pb-name { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--ink-2); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-box.left .pb-score { color: var(--green); }
.player-box.right .pb-score { color: var(--blue); }
.player-box .avatar { width: 46px; height: 46px; }
.word-stage { text-align: center; }
.word-card { display: inline-block; background: var(--paper); border: 2.5px solid var(--line-2); border-radius: 16px; padding: 10px 36px; font-size: clamp(22px, 4vw, 34px); font-weight: 900; min-width: 260px; box-shadow: 0 6px 0 var(--line-2); position: relative; }
.word-card .wc-emoji { font-size: .9em; margin-right: 8px; }
.word-card .wc-speak { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: none; background: var(--blue); color: #fff; border-radius: 50%; width: 32px; height: 32px; font-size: 16px; }
.word-meta { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.pill { background: var(--paper); border: 1.5px solid var(--line-2); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 800; color: var(--ink-2); }
.timer-disc { width: 56px; height: 56px; border-radius: 50%; background: var(--paper); border: 3px solid var(--gold); display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 20px; box-shadow: 0 4px 0 var(--gold-d); position: relative; }
.timer-disc.urgent { border-color: var(--red); box-shadow: 0 4px 0 var(--red-d); animation: pulse .5s infinite alternate; color: var(--red); }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.08); } }
.answers-wrap { display: grid; grid-template-columns: 3fr 60px 2fr; gap: 10px; align-items: center; background: rgba(255,255,255,.55); border-radius: 20px; padding: 14px; border: 2px solid rgba(255,255,255,.8); }
:root[data-theme="bandem"] .answers-wrap { background: rgba(0,0,0,.25); border-color: rgba(255,255,255,.1); }
.answers-wrap.solo { grid-template-columns: 1fr; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ans {
  background: var(--paper); border: 2.5px solid var(--line-2); border-radius: 14px; padding: 22px 14px; font-size: 20px; font-weight: 800; text-align: center; min-height: 86px; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 5px 0 var(--line-2); transition: transform .08s, background .2s, border-color .2s; color: var(--ink);
}
.ans:hover:not(:disabled) { transform: translateY(-2px); }
.ans:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--line-2); }
.ans.correct { background: var(--green); border-color: var(--green-d); color: #fff; box-shadow: 0 5px 0 var(--green-d); }
.ans.wrong { background: var(--red); border-color: var(--red-d); color: #fff; box-shadow: 0 5px 0 var(--red-d); animation: shake .4s; }
.ans.reveal { border-color: var(--green); box-shadow: 0 5px 0 var(--green); }
.ans.dim { opacity: .55; }
.ans:disabled { cursor: default; }
.answers.mini .ans { padding: 12px 8px; font-size: 14px; min-height: 60px; }
.vs-badge { font-size: 26px; font-weight: 900; color: var(--purple); text-align: center; font-style: italic; text-shadow: 2px 2px 0 #fff; }
.ans-head { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; display: flex; justify-content: space-between; }
.float-pts { position: absolute; font-weight: 900; color: var(--gold-d); animation: floatUp 1s forwards; pointer-events: none; font-size: 18px; text-shadow: 0 1px 0 #fff; }
@keyframes floatUp { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-40px); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.feedback-bubble { display: inline-block; background: #e3f0fb; color: var(--blue-d); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 800; margin-bottom: 8px; }
.feedback-bubble.ok { background: var(--ok-bg); color: var(--ok-ink); }
.feedback-bubble.bad { background: var(--bad-bg); color: var(--bad-ink); }
.two-player .answers-wrap { grid-template-columns: 1fr 60px 1fr; }
.player-turnlabel { font-size: 12px; text-transform: uppercase; font-weight: 800; color: var(--ink-2); text-align: center; margin-bottom: 6px; }

/* kết quả */
.result-banner { text-align: center; margin-bottom: 16px; }
.result-banner .rb { display: inline-block; background: var(--paper); border: 3px solid var(--line-2); border-radius: 18px; padding: 10px 30px; box-shadow: 0 6px 0 var(--line-2); }
.result-banner h2 { font-size: clamp(22px, 4vw, 32px); color: var(--red); }
.result-banner p { color: var(--ink-2); font-weight: 700; }
.result-grid { display: grid; grid-template-columns: 1fr 60px 1fr; gap: 12px; align-items: start; }
.result-grid.solo { grid-template-columns: minmax(0, 520px); justify-content: center; }
.result-card { background: var(--paper); border: 2.5px solid var(--line-2); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); position: relative; }
.result-card.leading { border-color: var(--green); }
.result-card .lead-tag { position: absolute; top: -12px; right: 14px; }
.result-card .rc-head { display: flex; align-items: center; gap: 12px; }
.result-card .rc-name { font-weight: 900; font-size: 16px; text-transform: uppercase; color: var(--red); }
.result-card .rc-pts { font-size: 40px; font-weight: 900; line-height: 1; }
.result-card .rc-pts small { font-size: 14px; color: var(--ink-2); margin-left: 6px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.stat { background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; }
.stat b { font-size: 16px; }
.result-xp { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.review-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 12px; }
.review-item { background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.review-item.bad { border-color: var(--red); background: var(--bad-bg); }
.review-item.ok { border-color: var(--green); }
.review-item b { font-size: 14px; }
.result-actions { display: flex; justify-content: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* nối từ */
.chain-shell { background: var(--paper); border: 2.5px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: calc(100vh - 150px); min-height: 520px; }
.chain-head { padding: 14px 18px; border-bottom: 2px dashed var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.chain-head h2 { font-size: 20px; }
.chain-head .hearts { font-size: 14px; letter-spacing: 2px; }
.chain-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chain-msg { max-width: 78%; display: flex; gap: 10px; align-items: flex-end; }
.chain-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.chain-msg .cm-who { font-size: 11px; font-weight: 800; color: var(--ink-3); margin-bottom: 4px; }
.chain-msg .cm-card { background: var(--paper-2); border: 1.5px solid var(--line-2); border-radius: 14px; padding: 10px 14px; }
.chain-msg.me .cm-card { background: #e6f6e8; border-color: #9ed8a5; }
:root[data-theme="bandem"] .chain-msg.me .cm-card { background: #27483a; border-color: #3f9a4f; }
.chain-msg .cm-word { font-size: 22px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.chain-msg .cm-word .ipa { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.chain-msg .cm-vi { font-weight: 800; color: var(--purple); margin-top: 2px; }
.chain-msg .cm-def { font-size: 13px; color: var(--ink-2); margin-top: 6px; line-height: 1.4; }
.chain-msg .cm-ex { font-size: 12px; color: var(--ink-3); font-style: italic; margin-top: 4px; border-top: 1px dashed var(--line); padding-top: 4px; }
.chain-msg.sys { align-self: center; max-width: 90%; }
.chain-msg.sys .cm-card { background: #fff6dc; border-color: var(--gold); font-weight: 700; font-size: 13px; text-align: center; }
.chain-msg.sys.bad .cm-card { background: var(--bad-bg); border-color: var(--red); color: var(--bad-ink); }
.speak-btn { border: none; background: var(--blue); color: #fff; border-radius: 50%; width: 30px; height: 30px; font-size: 14px; flex: none; }
.chain-foot { padding: 12px 16px 16px; border-top: 2px dashed var(--line); }
.chain-foot .cf-hint { text-align: center; font-size: 13px; font-weight: 800; color: var(--ink-2); margin-bottom: 8px; }
.chain-foot .cf-hint .letter { display: inline-block; background: var(--red); color: #fff; border-radius: 6px; padding: 0 8px; margin-right: 6px; }
.input-row { display: flex; gap: 10px; }
.input-row .input { flex: 1; }

/* đoán từ */
.guess-shell { background: var(--paper); border: 2.5px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow); padding: 18px; max-width: 760px; margin: 0 auto; }
.guess-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; border-bottom: 2px dashed var(--line); padding-bottom: 10px; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.guess-top .gt-timer { background: var(--ok-bg); color: var(--ok-ink); border: 2px solid var(--green); border-radius: 999px; padding: 4px 12px; }
.guess-top .gt-timer.urgent { background: var(--bad-bg); color: var(--bad-ink); border-color: var(--red); }
.slots { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 16px; }
.slot { width: 44px; height: 50px; border: 2.5px solid var(--line-2); border-radius: 10px; background: var(--paper-2); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 900; text-transform: uppercase; box-shadow: 0 3px 0 var(--line-2); }
.slot.revealed { background: #fff6dc; border-color: var(--gold); }
.slot.space { border: none; background: none; box-shadow: none; width: 16px; }
.slot.found { background: var(--green); color: #fff; border-color: var(--green-d); }
.hint-box { background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.hint-box .hb-label { font-size: 11px; text-transform: uppercase; font-weight: 800; color: var(--orange-d); }
.hint-box .hb-vi { font-size: 20px; font-weight: 900; margin: 4px 0; }
.hint-box .hb-meta { font-size: 12px; color: var(--ink-2); display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.tried { font-size: 13px; color: var(--ink-2); margin-top: 10px; text-align: center; }
.tried span { display: inline-block; background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; margin: 2px; text-decoration: line-through; }
.combo-badge { display: inline-block; background: var(--gold); color: #4a3000; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 900; animation: popIn .3s; }
@keyframes popIn { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* góc luyện tập */
.practice-list { display: flex; flex-direction: column; gap: 12px; max-width: 760px; margin: 0 auto; }
.practice-item { display: flex; align-items: center; gap: 16px; background: var(--paper); border: 2.5px solid var(--line-2); border-radius: 16px; padding: 14px 18px; text-align: left; box-shadow: 0 4px 0 var(--line-2); transition: transform .12s; width: 100%; }
.practice-item:hover { transform: translateY(-2px); }
.practice-item .pi-icon { width: 64px; height: 64px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 34px; flex: none; }
.practice-item .pi-body { flex: 1; }
.practice-item .pi-tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.practice-item h3 { font-size: 19px; }
.practice-item p { font-size: 13px; color: var(--ink-2); }
.practice-item .pi-foot { font-size: 12px; font-weight: 800; margin-top: 4px; }
.practice-item .pi-arrow { font-size: 22px; color: var(--ink-3); }
.flashcard { perspective: 1200px; max-width: 460px; margin: 0 auto; height: 280px; cursor: pointer; }
.flashcard .fc-inner { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.flashcard.flipped .fc-inner { transform: rotateY(180deg); }
.flashcard .fc-face { position: absolute; inset: 0; backface-visibility: hidden; background: var(--paper); border: 3px solid var(--line-2); border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; box-shadow: var(--shadow); padding: 20px; text-align: center; }
.flashcard .fc-back { transform: rotateY(180deg); background: var(--paper-2); }
.flashcard .fc-emoji { font-size: 64px; line-height: 1; }
.flashcard .fc-word { font-size: 34px; font-weight: 900; }
.flashcard .fc-ipa { color: var(--ink-3); font-weight: 600; }
.flashcard .fc-vi { font-size: 28px; font-weight: 900; color: var(--purple); }
.flashcard .fc-ex { font-size: 14px; color: var(--ink-2); font-style: italic; }
.fc-actions { display: flex; justify-content: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.progress-dots { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; margin: 12px 0; }
.progress-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); display: inline-block; }
.progress-dots i.ok { background: var(--green); } .progress-dots i.bad { background: var(--red); } .progress-dots i.cur { background: var(--gold); transform: scale(1.3); }
.big-speak { width: 110px; height: 110px; border-radius: 50%; border: none; background: var(--blue); color: #fff; font-size: 48px; box-shadow: 0 8px 0 var(--blue-d); margin: 10px auto; display: flex; align-items: center; justify-content: center; }
.big-speak:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--blue-d); }

/* bảng xếp hạng */
.lb-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.lb-tab { flex: 1; border: 2px solid var(--line-2); background: var(--paper-2); border-radius: 12px; padding: 8px; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink-2); }
.lb-tab.is-active { background: var(--paper); border-color: var(--green); color: var(--ink); box-shadow: 0 3px 0 var(--green); }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 10px; align-items: end; margin-bottom: 14px; }
.podium-slot { background: var(--paper-2); border: 2px solid var(--line-2); border-radius: 14px; padding: 12px 8px 10px; text-align: center; position: relative; }
.podium-slot.rank-1 { background: #fff6dc; border-color: var(--gold); padding-top: 20px; }
.podium-slot.rank-2 { border-color: #b8c0cc; } .podium-slot.rank-3 { border-color: #d9a66f; }
.podium-slot .crown { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 26px; }
.podium-slot .rank-badge { display: inline-block; background: var(--ink); color: #fff; border-radius: 50%; width: 22px; height: 22px; font-size: 12px; font-weight: 900; line-height: 22px; margin-top: -12px; position: relative; }
.podium-slot .p-name { font-weight: 900; font-size: 14px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-slot .p-lv { font-size: 11px; color: var(--ink-2); font-weight: 700; }
.podium-slot .p-score { font-weight: 900; font-size: 16px; color: var(--purple); margin-top: 4px; }
.podium-slot .p-score small { font-size: 10px; color: var(--ink-3); }
.lb-list { display: flex; flex-direction: column; gap: 6px; }
.lb-row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 10px; background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.lb-row.me { border-color: var(--green); background: var(--ok-bg); }
.lb-row .lb-rank { font-weight: 900; color: var(--ink-2); }
.lb-row .lb-player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lb-row .lb-player b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .lb-player span { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.lb-row .lb-val { font-weight: 900; color: var(--purple); font-size: 16px; }
.lb-empty { text-align: center; padding: 20px; color: var(--ink-2); font-weight: 700; }

/* hồ sơ */
.learning-card { background: linear-gradient(135deg, #fff6dc, #ffe4e8); border: 3px solid var(--gold); border-radius: 18px; padding: 16px; position: relative; overflow: hidden; }
:root[data-theme="bandem"] .learning-card { background: linear-gradient(135deg, #4a3f22, #4a2630); }
.learning-card .lc-brand { font-size: 10px; letter-spacing: 3px; font-weight: 900; color: var(--red); text-transform: uppercase; }
.learning-card .lc-head { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.learning-card .lc-name { font-size: 22px; font-weight: 900; }
.learning-card .lc-title { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.learning-card .lc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.learning-card .lc-stat { background: rgba(255,255,255,.7); border-radius: 12px; padding: 8px; text-align: center; }
:root[data-theme="bandem"] .learning-card .lc-stat { background: rgba(0,0,0,.25); }
.learning-card .lc-stat b { display: block; font-size: 20px; }
.learning-card .lc-stat span { font-size: 11px; color: var(--ink-2); font-weight: 700; text-transform: uppercase; }
.milestones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.milestone { background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; font-size: 12px; font-weight: 700; opacity: .55; }
.milestone.done { opacity: 1; border-color: var(--green); background: var(--ok-bg); }
.milestone .m-emoji { font-size: 24px; display: block; }
.avatar-picker { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.avatar-picker button { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--paper); font-size: 24px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.avatar-picker button.is-active { border-color: var(--green); box-shadow: 0 0 0 3px rgba(63,154,79,.25); }
.profile-list { display: flex; flex-direction: column; gap: 8px; }
.profile-row { display: flex; align-items: center; gap: 10px; background: var(--paper-2); border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; width: 100%; text-align: left; }
.profile-row.is-active { border-color: var(--green); background: var(--ok-bg); }
.profile-row b { display: block; } .profile-row span { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.profile-row .pr-body { flex: 1; min-width: 0; }

/* lịch sử từ */
.word-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.word-item { background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.word-item .wi-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.word-item .wi-en { font-weight: 900; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.word-item .wi-vi { color: var(--purple); font-weight: 800; font-size: 14px; }
.word-item .wi-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 4px; }
.word-item .wi-stat { font-size: 11px; font-weight: 800; }
.word-item .wi-stat.ok { color: var(--ok-ink); } .word-item .wi-stat.bad { color: var(--bad-ink); }
.report-btn { border: 1.5px solid var(--red); background: #fff; color: var(--red); border-radius: 999px; font-size: 11px; font-weight: 800; padding: 2px 8px; }
.search-row { display: flex; gap: 8px; margin: 10px 0; }

/* cài đặt */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1.5px dashed var(--line); }
.setting-row:last-child { border-bottom: none; }
.setting-row .sr-label strong { display: block; font-size: 15px; }
.setting-row .sr-label small { color: var(--ink-2); font-size: 12px; }

/* lớp học */
.classroom { background: repeating-linear-gradient(90deg, #e7c48d 0 120px, #dcb77c 120px 240px); border: 3px solid #b88a4a; border-radius: 20px; min-height: 480px; position: relative; overflow: hidden; }
:root[data-theme="bandem"] .classroom { filter: brightness(.8); }
.classroom .board { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: #2f5d3a; color: #fff; border: 6px solid #8b5a2b; border-radius: 10px; padding: 10px 24px; text-align: center; font-weight: 900; letter-spacing: 1px; min-width: 240px; }
.classroom .board small { display: block; font-weight: 700; font-size: 11px; opacity: .85; }
.desks { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 18px; padding: 110px 20px 30px; }
.desk { text-align: center; }
.desk .desk-top { width: 90px; height: 42px; background: #c48a45; border: 3px solid #8b5a2b; border-radius: 10px 10px 4px 4px; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 5px 0 #8b5a2b; }
.desk .avatar { margin-top: -8px; }
.desk .desk-name { display: inline-block; background: rgba(255,255,255,.9); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 800; margin-top: 4px; color: #333; }
.desk.me .desk-name { background: var(--green); color: #fff; }
.desk.bot .desk-name { background: #e9e9e9; }
.chat-box { background: var(--paper); border: 2px solid var(--line-2); border-radius: 14px; display: flex; flex-direction: column; height: 100%; min-height: 300px; }
.chat-box .cb-head { padding: 10px 12px; border-bottom: 2px dashed var(--line); font-weight: 800; display: flex; justify-content: space-between; }
.chat-box .cb-log { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.chat-box .cb-msg b { color: var(--blue); }
.chat-box .cb-foot { padding: 8px; border-top: 2px dashed var(--line); display: flex; gap: 6px; }
.class-layout { display: grid; grid-template-columns: 1fr 300px; gap: 14px; }

/* nhập/báo lỗi */
.option-list { display: flex; flex-direction: column; gap: 8px; }
.option-row { display: flex; align-items: center; gap: 10px; background: var(--paper-2); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: left; width: 100%; }
.option-row.is-active { border-color: var(--green); background: var(--ok-bg); }

/* pháo giấy */
.confetti { position: fixed; inset: 0; z-index: 300; pointer-events: none; }

/* ---------- Màn hình nhỏ ---------- */
@media (max-width: 980px) {
  .home-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { grid-template-columns: 1fr auto; }
  .logo { grid-column: 1 / -1; order: -1; }
  .class-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .mascot { display: none; }
}
@media (max-width: 720px) {
  .view { padding: 12px; }
  .home-grid { grid-template-columns: 1fr; }
  .quiz-head { grid-template-columns: 1fr 1fr; }
  .quiz-head .word-stage { grid-column: 1 / -1; order: -1; }
  .answers-wrap { grid-template-columns: 1fr !important; }
  .vs-badge { display: none; }
  .answers.mini { grid-template-columns: repeat(4, 1fr); }
  .answers.mini .ans { min-height: 44px; font-size: 12px; padding: 6px 4px; }
  .result-grid { grid-template-columns: 1fr; }
  .result-grid .vs-badge { display: none; }
  .profile-chip .pc-xptext, .profile-chip .pc-streak { display: none; }
  .profile-chip { max-width: 200px; }
  .topbar-actions .icon-btn { width: 40px; height: 40px; font-size: 18px; }
  .modal { border-radius: 16px; }
  .ans { font-size: 17px; min-height: 70px; padding: 14px 10px; }
  .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
  .podium { grid-template-columns: 1fr 1fr 1fr; }
  .chain-shell { max-height: none; }
  .two-player .answers-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .answers { grid-template-columns: 1fr; }
  .grid3, .grid4 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
