:root {
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Arial Rounded MT Bold", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ink: #1f2a52;
  --ink-soft: #5a6590;
  --blue: #4c7dff;
  --blue-d: #2f5be0;
  --pink: #ff4f9a;
  --yellow: #ffd23f;
  --green: #22c55e;
  --green-d: #15a34a;
  --red: #ff5a5f;
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(31, 42, 82, 0.18);
  --r: 22px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font); color: var(--ink);
  background: radial-gradient(1200px 800px at 20% 0%, #8fd3ff 0%, transparent 60%), radial-gradient(900px 700px at 100% 100%, #ffb3dd 0%, transparent 55%), linear-gradient(160deg, #6aa8ff 0%, #7b6cff 55%, #c66bff 100%);
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font-family: inherit; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
.center { text-align: center; }

/* ---------- moving sky behind menus ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.sky span { position: absolute; font-size: 48px; opacity: 0.9; filter: drop-shadow(0 6px 10px rgba(0, 0, 40, 0.15)); }
.cloud { animation: drift 38s linear infinite; font-size: 90px !important; opacity: 0.75 !important; }
.c1 { top: 8%; left: -15%; } .c2 { top: 60%; left: -20%; animation-duration: 52s !important; animation-delay: -20s !important; } .c3 { top: 30%; left: -10%; animation-duration: 64s !important; animation-delay: -40s !important; }
.plane { animation: fly 22s linear infinite; }
.p1 { top: 18%; left: -10%; } .p2 { top: 75%; left: -10%; animation-duration: 30s !important; animation-delay: -12s !important; font-size: 36px !important; }
.float { animation: bob 6s ease-in-out infinite; opacity: 0.55 !important; font-size: 40px !important; }
.f1 { top: 12%; right: 10%; } .f2 { bottom: 14%; left: 8%; animation-delay: -1s !important; } .f3 { top: 46%; right: 4%; animation-delay: -2s !important; } .f4 { bottom: 6%; right: 30%; animation-delay: -3s !important; } .f5 { top: 70%; left: 30%; animation-delay: -4s !important; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(140vw); } }
@keyframes fly { from { transform: translate(0, 0) rotate(8deg); } 50% { transform: translate(60vw, -6vh) rotate(-4deg); } to { transform: translate(125vw, 2vh) rotate(8deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-18px) rotate(6deg); } }
body.playing .sky { display: none; }

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: none; touch-action: none; z-index: 1; }
body.playing #game { display: block; }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; z-index: 2; display: none; flex-direction: column; align-items: center; padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l)); }
.screen.active { display: flex; animation: screenIn 0.35s cubic-bezier(.2, .9, .3, 1.2); }
.screen.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen > * { flex-shrink: 0; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 22px; border-radius: 18px; font-weight: 800; font-size: 18px;
  background: #fff; color: var(--ink); box-shadow: 0 5px 0 rgba(31, 42, 82, 0.2), var(--shadow);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active, .tile:active, .country:active, .item:active, .choice:active, .who-card:active, .month:active { transform: translateY(4px) scale(0.98); box-shadow: 0 1px 0 rgba(31, 42, 82, 0.2); }
.btn.primary { background: linear-gradient(180deg, #5f8dff, var(--blue-d)); color: #fff; box-shadow: 0 6px 0 #1f3fa8, var(--shadow); }
.btn.go, .btn.play { background: linear-gradient(180deg, #4ade80, var(--green-d)); color: #fff; box-shadow: 0 7px 0 #0f7a37, var(--shadow); }
.btn.ghost { background: rgba(255, 255, 255, 0.25); color: #fff; box-shadow: none; border: 2px solid rgba(255, 255, 255, 0.6); }
.btn.big { min-height: 62px; font-size: 22px; padding: 14px 30px; border-radius: 22px; }
.btn.huge { min-height: 84px; font-size: 38px; padding: 16px 70px; border-radius: 30px; letter-spacing: 2px; }
.btn:disabled { opacity: 0.6; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.icon-btn { width: 46px; height: 46px; border-radius: 15px; background: rgba(255, 255, 255, 0.9); font-size: 22px; box-shadow: 0 4px 0 rgba(31, 42, 82, 0.2); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.back { align-self: flex-start; font-weight: 800; font-size: 17px; padding: 10px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.85); box-shadow: 0 4px 0 rgba(31, 42, 82, 0.15); }
.round { min-width: 52px; height: 52px; border-radius: 26px; background: #fff; font-weight: 900; font-size: 20px; box-shadow: 0 4px 0 rgba(31, 42, 82, 0.2); }

/* ---------- home ---------- */
#s-home { justify-content: center; gap: 22px; }
.logo { text-align: center; color: #fff; }
.logo-globe { font-size: 92px; animation: spin 10s linear infinite, bob 4s ease-in-out infinite; display: inline-block; filter: drop-shadow(0 14px 18px rgba(0, 0, 60, 0.3)); }
@keyframes spin { from { rotate: 0deg; } to { rotate: 360deg; } }
.logo h1, .lobby-title h1 { font-size: clamp(46px, 9vw, 84px); font-weight: 900; letter-spacing: -1px; text-shadow: 0 5px 0 rgba(31, 42, 120, 0.35), 0 14px 30px rgba(0, 0, 60, 0.3); color: #fff; }
.logo h1 b, .lobby-title h1 b { color: var(--yellow); }
.tag { font-weight: 800; font-size: 20px; margin: 4px 0 0; letter-spacing: 3px; text-transform: uppercase; opacity: 0.9; }
.home-actions { display: flex; flex-direction: column; gap: 12px; width: min(420px, 100%); }
.who { width: min(760px, 100%); }
.who-title { color: #fff; font-weight: 900; font-size: 24px; text-align: center; margin-bottom: 10px; text-shadow: 0 3px 0 rgba(0, 0, 60, 0.25); }
.who-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.who-card { width: 140px; padding: 16px 10px; border-radius: 24px; background: #fff; box-shadow: 0 6px 0 var(--c, #3a86ff), var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 4px; animation: popIn 0.5s backwards; }
.who-card.loading { opacity: 0.6; }
.who-card.guest { --c: #9aa3c7; }
.who-av { font-size: 56px; width: 84px; height: 84px; border-radius: 50%; background: var(--c, #3a86ff); display: flex; align-items: center; justify-content: center; border: 4px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
.who-name { font-weight: 900; font-size: 19px; }
.who-stars { font-weight: 700; color: var(--ink-soft); font-size: 14px; }
@keyframes popIn { from { opacity: 0; transform: scale(0.6); } }

/* ---------- forms ---------- */
.panel { background: rgba(255, 255, 255, 0.96); border-radius: 28px; padding: 22px; box-shadow: var(--shadow); width: min(760px, 100%); margin: 8px auto; }
.panel h3 { margin: 0 0 10px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { font-weight: 800; font-size: 17px; margin-top: 6px; }
.form h2 { font-size: 28px; }
.big-input { font-size: 26px; font-weight: 800; padding: 14px 18px; border-radius: 18px; border: 3px solid #d7defc; outline: none; text-align: center; color: var(--ink); background: #f6f8ff; width: 100%; -webkit-user-select: text; user-select: text; }
.big-input:focus { border-color: var(--blue); background: #fff; }
.note { font-weight: 700; color: var(--ink-soft); min-height: 20px; }
.error { color: #e11d48; font-weight: 800; min-height: 22px; text-align: center; }
.months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.month { padding: 10px 4px; border-radius: 16px; background: #f1f4ff; font-weight: 800; font-size: 15px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 4px 0 #d7defc; }
.month span { font-size: 24px; }
.month.on { background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-d); transform: scale(1.06); }
.year { display: flex; gap: 8px; align-items: center; justify-content: center; }
.year-num { font-size: 40px; font-weight: 900; min-width: 120px; text-align: center; }
.avatars { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.av { font-size: 40px; width: 70px; height: 70px; border-radius: 22px; background: #f1f4ff; box-shadow: 0 4px 0 #d7defc; }
.av.on { background: var(--yellow); box-shadow: 0 4px 0 #d9a800; transform: scale(1.1) rotate(-4deg); }
.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- lobby ---------- */
.topbar { display: flex; align-items: center; gap: 10px; width: min(1000px, 100%); flex-wrap: wrap; justify-content: space-between; }
.topbar h2 { color: #fff; font-size: 28px; text-shadow: 0 3px 0 rgba(0, 0, 60, 0.25); flex: 1; text-align: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, 0.95); border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: 18px; box-shadow: 0 4px 0 rgba(31, 42, 82, 0.15); }
.chip.bump, .bump { animation: bump 0.35s; }
@keyframes bump { 50% { transform: scale(1.25); } }
.me-chip { display: inline-flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 5px 16px 5px 5px; font-weight: 900; font-size: 19px; box-shadow: 0 4px 0 var(--c); }
.me-av { width: 42px; height: 42px; border-radius: 50%; background: var(--c); display: inline-flex; align-items: center; justify-content: center; font-size: 26px; border: 3px solid #fff; }
.lvl-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 800; box-shadow: 0 4px 0 rgba(31, 42, 82, 0.15); }
.lvl-bar { width: 80px; height: 12px; border-radius: 6px; background: #e8ecff; overflow: hidden; }
.lvl-fill { height: 100%; background: linear-gradient(90deg, #a78bfa, #7c3aed); border-radius: 6px; transition: width 0.6s; }
.chip.goal .chest { display: none; margin-left: 4px; }
.chip.goal.ready { background: linear-gradient(180deg, #fff6b0, #ffd23f); animation: pulse 1.2s infinite; }
.chip.goal.ready .chest { display: inline; animation: wiggle 0.6s infinite; }
@keyframes wiggle { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
.lobby-title { text-align: center; color: #fff; margin: 10px 0 6px; }
.lobby-title h1 { font-size: clamp(40px, 7vw, 66px); }
.lobby-title p { font-weight: 800; font-size: 18px; margin: 4px 0 0; opacity: 0.95; }
.countries::-webkit-scrollbar { display: none; }
.countries { scrollbar-width: none; display: flex; gap: 12px; overflow-x: auto; width: min(1000px, 100%); padding: 12px 6px 18px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.country { flex: none; width: 128px; scroll-snap-align: center; background: #fff; border-radius: 22px; padding: 12px 8px; box-shadow: 0 5px 0 rgba(31, 42, 82, 0.15); display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; transition: transform 0.15s; }
.country .flag { font-size: 52px; line-height: 1.1; }
.country .cname { font-weight: 900; font-size: 15px; text-align: center; }
.country .ccap { font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.country .ctag { position: absolute; top: -8px; right: -6px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.country.on { background: var(--yellow); transform: translateY(-6px) scale(1.06); box-shadow: 0 9px 0 #d9a800, var(--shadow); }
.country.taken { opacity: 0.55; }
.fact { display: flex; align-items: center; gap: 14px; background: rgba(255, 255, 255, 0.95); border-radius: 22px; padding: 12px 16px; width: min(640px, 100%); box-shadow: var(--shadow); }
.fact.pop { animation: popIn 0.35s; }
.fact-flag { font-size: 44px; }
.fact-head { font-weight: 900; font-size: 18px; }
.fact-body { font-weight: 700; color: var(--ink-soft); }
.fact > div:nth-child(2) { flex: 1; }
.play { margin: 18px 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; width: min(1000px, 100%); }
.tile { background: #fff; border-radius: 24px; padding: 14px 8px; box-shadow: 0 6px 0 rgba(31, 42, 82, 0.15); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tile-ic { font-size: 40px; }
.tile-name { font-weight: 900; font-size: 18px; }
.tile-sub { font-weight: 700; font-size: 13px; color: var(--ink-soft); }

/* ---------- locker ---------- */
.preview { position: relative; width: 240px; height: 140px; margin: 10px auto; }
.preview-land { position: absolute; inset: 0; width: 240px; height: 120px; filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.18)); }
.preview-puck { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -60%); width: 84px; height: 84px; border-radius: 50%; border: 5px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 50px; box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2); animation: bob 3s ease-in-out infinite; }
.preview-trail { position: absolute; bottom: -12px; left: 0; right: 0; text-align: center; color: #fff; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 60, 0.3); }
.tabs { display: flex; gap: 8px; margin: 18px 0 10px; flex-wrap: wrap; justify-content: center; }
.tab { padding: 10px 18px; border-radius: 999px; background: rgba(255, 255, 255, 0.5); font-weight: 900; font-size: 17px; color: #fff; }
.tab.on { background: #fff; color: var(--ink); box-shadow: 0 4px 0 rgba(31, 42, 82, 0.2); }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; width: min(1000px, 100%); padding-bottom: 20px; }
.item { background: #fff; border-radius: 20px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 5px 0 rgba(31, 42, 82, 0.15); position: relative; }
.item.locked .it-face { filter: grayscale(0.85) opacity(0.6); }
.item.eq { background: #e9fbe9; box-shadow: 0 5px 0 var(--green); }
.it-face { font-size: 46px; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; border-radius: 16px; }
.it-face.sw, .sw { border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1); }
.sw { display: inline-block; width: 18px; height: 18px; vertical-align: middle; }
.sw.big { width: 80px; height: 80px; }
.it-face.trail { font-size: 26px; background: #2b3a67; color: #fff; }
.it-name { font-weight: 800; font-size: 14px; }
.it-tag { font-weight: 800; font-size: 12px; color: var(--ink-soft); text-align: center; }
.big-face { font-size: 80px; text-align: center; font-weight: 900; }

/* ---------- badges & dashboard ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; width: min(1000px, 100%); margin: 14px 0; }
.stat { background: #fff; border-radius: 20px; padding: 12px; text-align: center; box-shadow: 0 5px 0 rgba(31, 42, 82, 0.15); }
.stat-ic { font-size: 30px; }
.stat-v { font-weight: 900; font-size: 24px; }
.stat-l { font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.badges { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; width: min(1000px, 100%); padding-bottom: 24px; }
.badge-card { background: #fff; border-radius: 22px; padding: 14px; display: flex; gap: 12px; box-shadow: 0 5px 0 var(--c); }
.badge-ic { font-size: 44px; width: 70px; height: 70px; border-radius: 20px; background: color-mix(in srgb, var(--c) 18%, white); display: flex; align-items: center; justify-content: center; flex: none; }
.badge-main { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.badge-name { font-weight: 900; font-size: 19px; }
.medals { font-size: 18px; letter-spacing: 2px; }
.bar { height: 14px; border-radius: 8px; background: #eef1fb; overflow: hidden; }
.bar.small { height: 10px; width: 90px; display: inline-block; vertical-align: middle; margin-right: 8px; }
.bar .fill { height: 100%; background: var(--c, var(--blue)); border-radius: 8px; transition: width 0.6s; }
.badge-sub { font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.badge-unlocks { font-size: 13px; font-weight: 700; }
table.dash { width: 100%; border-collapse: collapse; font-weight: 700; }
table.dash th { text-align: left; font-size: 13px; color: var(--ink-soft); padding: 6px; }
table.dash td { padding: 8px 6px; border-top: 1px solid #eef1fb; }
table.dash select, .setting select { font-size: 15px; padding: 6px; border-radius: 10px; border: 2px solid #d7defc; background: #fff; }
.panel.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel ul { margin: 0; padding-left: 18px; font-weight: 700; }
.mistakes li { margin-bottom: 6px; }
.setting { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid #eef1fb; font-weight: 800; }
.setting input[type=checkbox] { width: 26px; height: 26px; }
.setting input[type=range] { width: 50%; }
#s-parents .panel { -webkit-user-select: text; user-select: text; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(20, 24, 60, 0.45); opacity: 0; transition: opacity 0.2s; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal.show { opacity: 1; }
.modal-card { background: #fff; border-radius: 30px; padding: 26px; width: min(480px, 100%); max-height: 90vh; overflow: auto; position: relative; box-shadow: 0 20px 60px rgba(0, 0, 40, 0.35); transform: scale(0.85); transition: transform 0.3s cubic-bezier(.2, .9, .3, 1.4); }
.modal.show .modal-card { transform: none; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; background: #f1f4ff; font-size: 18px; font-weight: 900; }
.how-step { display: flex; align-items: center; gap: 12px; background: #f4f7ff; border-radius: 16px; padding: 8px 12px; }
.how-step span { font-size: 34px; }
.how-step p { margin: 0; font-weight: 800; font-size: 17px; }
.gym-subjects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gym-sub { background: color-mix(in srgb, var(--c, #8b5cf6) 15%, white); border-radius: 18px; padding: 14px; font-size: 30px; display: flex; align-items: center; gap: 10px; box-shadow: 0 4px 0 var(--c, #8b5cf6); }
.gym-sub span { font-size: 18px; font-weight: 900; }
.gym-sub.mix { grid-column: span 2; justify-content: center; --c: #8b5cf6; }
.chest-big { font-size: 110px; text-align: center; }
.shake-long { animation: wiggle 0.25s 5; }
.chest-result { text-align: center; font-weight: 900; font-size: 22px; min-height: 30px; }

/* ---------- quiz ---------- */
.quiz-overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: calc(12px + var(--safe-t)) 12px calc(12px + var(--safe-b)); background: rgba(30, 30, 90, 0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.25s; }
.quiz-overlay.show { opacity: 1; }
.quiz-overlay.mode-gym { background: linear-gradient(160deg, rgba(90, 120, 255, 0.95), rgba(170, 100, 255, 0.95)); }
.quiz-card { --subj: #4c7dff; background: #fff; border-radius: 32px; padding: 18px 20px 22px; width: min(640px, 100%); max-height: 100%; overflow: auto; box-shadow: 0 24px 70px rgba(0, 0, 40, 0.4), 0 8px 0 var(--subj); display: flex; flex-direction: column; gap: 12px; position: relative; }
.quiz-card.enter { animation: cardIn 0.45s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes cardIn { from { opacity: 0; transform: translateY(40px) scale(0.9) rotate(-2deg); } }
.quiz-top { display: flex; align-items: center; gap: 10px; }
.quiz-title { font-weight: 900; font-size: 20px; flex: 1; }
.quiz-dots { display: flex; gap: 6px; font-weight: 800; color: var(--ink-soft); }
.quiz-dots span { width: 14px; height: 14px; border-radius: 50%; background: #e3e8fb; }
.quiz-dots span.done { background: var(--green); }
.quiz-dots span.now { background: var(--subj); animation: pulse 1s infinite; }
.quiz-chip { align-self: flex-start; background: color-mix(in srgb, var(--subj) 16%, white); color: color-mix(in srgb, var(--subj) 70%, black); font-weight: 900; font-size: 14px; padding: 6px 12px; border-radius: 999px; }
.quiz-intro { background: #fff8db; border-radius: 16px; padding: 10px 14px; font-weight: 700; }
.quiz-prompt { font-size: clamp(22px, 4.2vw, 30px); font-weight: 900; line-height: 1.25; }
.quiz-visual { display: flex; justify-content: center; }
.quiz-visual svg { width: 100%; max-width: 400px; max-height: 32vh; height: auto; }
.quiz-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-choices.n2 { grid-template-columns: 1fr 1fr; }
.choice { min-height: 70px; border-radius: 20px; padding: 10px 12px; font-size: clamp(18px, 3.6vw, 24px); font-weight: 900; display: flex; align-items: center; gap: 10px; text-align: left; color: #fff; transition: transform 0.1s, opacity 0.2s; }
.choice .letter { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.choice .txt { flex: 1; }
.choice .txt.huge { font-size: 40px; line-height: 1; text-align: center; padding-right: 34px; }
.choice.c0 { background: #ff7a59; box-shadow: 0 6px 0 #d4532f; }
.choice.c1 { background: #4c7dff; box-shadow: 0 6px 0 #2f5be0; }
.choice.c2 { background: #f5a300; box-shadow: 0 6px 0 #c47f00; }
.choice.c3 { background: #9b5de5; box-shadow: 0 6px 0 #7739c2; }
.choice:disabled { opacity: 0.3; }
.choice.right, .choice.reveal { background: var(--green) !important; box-shadow: 0 6px 0 var(--green-d) !important; opacity: 1 !important; }
.choice.right { animation: rightPop 0.5s; }
.choice.reveal { animation: glow 1s infinite; }
.choice.wrong { background: #9aa3c7 !important; box-shadow: 0 6px 0 #7a83a8 !important; animation: shake 0.4s; }
@keyframes rightPop { 40% { transform: scale(1.08); } }
@keyframes glow { 0%, 100% { filter: brightness(1); transform: scale(1); } 50% { filter: brightness(1.15); transform: scale(1.04); } }
.quiz-explain { display: none; background: #eef6ff; border-radius: 18px; padding: 12px 14px; font-weight: 700; }
.quiz-explain.show { display: block; animation: popIn 0.3s; }
.ex-title { font-weight: 900; font-size: 18px; margin-bottom: 4px; }
.ex-tap { margin-top: 6px; color: var(--green-d); font-weight: 900; }
.quiz-praise { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-size: clamp(34px, 7vw, 54px); font-weight: 900; color: var(--green); text-shadow: 0 4px 0 #fff, 0 10px 24px rgba(0, 0, 0, 0.25); animation: praise 1.1s forwards; pointer-events: none; white-space: nowrap; }
.quiz-praise.learn { color: var(--blue); }
@keyframes praise { 0% { transform: translate(-50%, -50%) scale(0.3) rotate(-10deg); opacity: 0; } 30% { transform: translate(-50%, -50%) scale(1.15) rotate(3deg); opacity: 1; } 75% { opacity: 1; } 100% { transform: translate(-50%, -90%) scale(1); opacity: 0; } }
.result-stars { font-size: 56px; text-align: center; letter-spacing: 6px; animation: popIn 0.6s; }
.result-head { font-size: 36px; font-weight: 900; text-align: center; }
.result-sub, .result-keep { text-align: center; font-weight: 800; font-size: 19px; }
.keep-meter { height: 26px; border-radius: 14px; background: #eef1fb; overflow: hidden; box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.06); }
.keep-fill { height: 100%; border-radius: 14px; background: linear-gradient(90deg, #4ade80, #22c55e); transition: width 1.2s cubic-bezier(.2, .9, .3, 1); }
.mode-death .quiz-title::before { content: ''; }

/* ---------- death card ---------- */
.death { position: fixed; inset: 0; z-index: 39; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #fff; text-align: center; padding: 20px; background: radial-gradient(circle, rgba(255, 80, 120, 0.45), rgba(40, 20, 80, 0.75)); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.death.show { opacity: 1; }
.death-emoji { font-size: 110px; animation: popIn 0.5s cubic-bezier(.2, .9, .3, 1.6); }
.death-text { font-size: clamp(30px, 6vw, 50px); font-weight: 900; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
.death-sub { font-size: 20px; font-weight: 800; opacity: 0.95; }

/* ---------- HUD ---------- */
.hud { padding: 0; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-tl { position: absolute; top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; pointer-events: none; }
.hud-tl > * { pointer-events: auto; }
.hud-btns { display: flex; gap: 8px; }
.me-pill { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.92); border-radius: 999px; padding: 6px 16px; font-weight: 800; box-shadow: 0 4px 0 rgba(31, 42, 82, 0.2); font-size: 17px; }
.me-pill:empty { display: none; }
.me-pill .f { font-size: 24px; }
.me-pill b { font-size: 22px; }
.me-pill small { color: var(--ink-soft); }
.hud-feed { display: flex; flex-direction: column; gap: 4px; pointer-events: none !important; }
.feed-line { background: rgba(20, 30, 60, 0.6); color: #fff; font-weight: 800; padding: 4px 10px; border-radius: 10px; font-size: 14px; animation: popIn 0.3s; transition: opacity 0.5s; }
.feed-line b { text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); filter: brightness(1.3); }
.feed-line.out { opacity: 0; }
.hud-tc { position: absolute; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.hud-board { position: absolute; top: calc(10px + var(--safe-t)); right: calc(10px + var(--safe-r)); background: rgba(20, 30, 70, 0.55); border-radius: 18px; padding: 8px; display: flex; flex-direction: column; gap: 3px; min-width: 210px; pointer-events: none; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.brow { display: flex; align-items: center; gap: 6px; color: #fff; font-weight: 800; font-size: 14px; padding: 3px 8px; border-radius: 10px; border-left: 5px solid var(--c); background: rgba(255, 255, 255, 0.08); }
.brow.me { background: rgba(255, 255, 255, 0.95); color: var(--ink); }
.brow.dead { opacity: 0.5; }
.brow.gap { border: 0; justify-content: center; background: none; padding: 0; }
.br-rank { width: 16px; opacity: 0.8; }
.br-av { font-size: 16px; }
.br-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.br-pct { font-variant-numeric: tabular-nums; }
.hud-mini { position: absolute; left: calc(10px + var(--safe-l)); bottom: calc(10px + var(--safe-b)); border-radius: 14px; overflow: hidden; border: 3px solid rgba(255, 255, 255, 0.9); box-shadow: 0 6px 18px rgba(0, 0, 40, 0.3); pointer-events: none; }
#minimap { display: block; width: 300px; height: 106px; }
.hud-slots { position: absolute; right: calc(12px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); display: flex; gap: 10px; }
.slot { width: 76px; height: 76px; border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 900; }
.slot.empty { border: 3px dashed rgba(255, 255, 255, 0.6); color: rgba(255, 255, 255, 0.7); font-size: 28px; background: rgba(20, 30, 70, 0.25); }
.slot.full { color: #3b2a00; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25), 0 0 0 3px #fff; animation: slotIn 0.5s cubic-bezier(.2, .9, .3, 1.6), slotGlow 1.6s 0.5s infinite; }
.slot.full.speed { background: linear-gradient(180deg, #fff06b, #ffb300); }
.slot.full.shield { background: linear-gradient(180deg, #a6f4ff, #2fb5ff); }
.slot.full.bomb { background: linear-gradient(180deg, #ffb3d9, #ff4f9a); }
.slot.cool { filter: grayscale(1) brightness(0.8); animation: none; }
.slot-ic { font-size: 34px; line-height: 1; }
.slot-name { font-size: 12px; }
@keyframes slotIn { from { transform: scale(0) rotate(-40deg); } }
@keyframes slotGlow { 50% { transform: scale(1.07); } }
.hud-banner { position: absolute; top: 22%; left: 50%; transform: translate(-50%, -20px) scale(0.9); background: rgba(255, 255, 255, 0.96); border-radius: 26px; padding: 14px 24px; text-align: center; box-shadow: var(--shadow); opacity: 0; transition: all 0.4s cubic-bezier(.2, .9, .3, 1.4); pointer-events: none; max-width: min(560px, 90vw); }
.hud-banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.banner-head { font-weight: 900; font-size: 26px; }
.banner-body { font-weight: 700; color: var(--ink-soft); font-size: 17px; }
.hud-hint { position: absolute; bottom: calc(130px + var(--safe-b)); left: 50%; transform: translateX(-50%); color: #fff; font-weight: 800; background: rgba(20, 30, 70, 0.45); padding: 6px 14px; border-radius: 999px; font-size: 14px; pointer-events: none; animation: hintFade 9s forwards; white-space: nowrap; }
@keyframes hintFade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- toasts & bursts ---------- */
.toasts { position: fixed; top: calc(70px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: min(520px, 92vw); }
.toast { background: #fff; color: var(--ink); font-weight: 800; font-size: 17px; padding: 12px 18px; border-radius: 18px; box-shadow: var(--shadow); text-align: center; animation: toastIn 0.4s cubic-bezier(.2, .9, .3, 1.5); transition: all 0.4s; }
.toast.big { font-size: 20px; background: linear-gradient(180deg, #fffbe0, #fff); border: 3px solid var(--yellow); }
.toast.fire { background: linear-gradient(180deg, #ffedd5, #fff); border: 3px solid #fb923c; }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px) scale(0.8); } }
.burst-bit { position: fixed; z-index: 70; pointer-events: none; border-radius: 2px; }
.fly-bit { position: fixed; z-index: 70; pointer-events: none; font-weight: 900; font-size: 24px; color: #ffb300; text-shadow: 0 2px 0 #fff, 0 0 10px rgba(255, 255, 255, 0.8); white-space: nowrap; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .btn.huge { font-size: 30px; padding: 14px 50px; min-height: 72px; }
  .months { grid-template-columns: repeat(4, 1fr); }
  .panel.two { grid-template-columns: 1fr; }
  #minimap { width: 200px; height: 71px; }
  .hud-board { min-width: 150px; padding: 6px; }
  .brow { font-size: 12px; padding: 2px 6px; }
  .br-name { max-width: 72px; }
  .slot { width: 62px; height: 62px; border-radius: 20px; }
  .slot-ic { font-size: 28px; }
  .hud-tc { top: auto; bottom: calc(96px + var(--safe-b)); }
  .hud-tc .chip { font-size: 15px; padding: 6px 12px; }
  .me-pill { font-size: 14px; padding: 4px 12px; }
  .me-pill b { font-size: 18px; }
  .hud-hint { display: none; }
  .quiz-choices { gap: 8px; }
  .choice { min-height: 60px; }
}
@media (max-width: 500px) {
  #minimap { width: 138px; height: 49px; }
  .hud-mini { border-width: 2px; border-radius: 10px; }
  .slot { width: 54px; height: 54px; border-radius: 17px; }
  .slot-ic { font-size: 24px; }
  .slot-name { display: none; }
  .hud-slots { gap: 7px; }
  .hud-board { min-width: 0; width: 150px; }
  .br-name { max-width: 58px; }
  .br-flag { display: none; }
  .me-pill { gap: 6px; padding: 4px 10px; }
  .me-pill .k { display: none; }
  .hud-tc { bottom: calc(76px + var(--safe-b)); }
  .hud-banner { top: 30%; }
  .banner-head { font-size: 21px; }
}
@media (max-height: 520px) {
  .logo-globe { font-size: 56px; }
  .logo h1 { font-size: 44px; }
  .quiz-card { gap: 8px; padding: 12px 14px 16px; }
  .quiz-visual svg { max-height: 26vh; }
  .choice { min-height: 52px; }
  .hud-tc { top: calc(10px + var(--safe-t)); bottom: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .cloud, .plane, .float, .logo-globe, .pulse { animation: none !important; }
}
