:root {
  --vw: 1vw;
  --vh: 1vh; /* 1% of the app's height; set in px by app.js when the app is scaled */
  --ink: #1a1033;
  --paper: #fff8e1;
  --yellow: #ffd60a;
  --pink: #ff3d9a;
  --blue: #2f80ff;
  --green: #18d26e;
  --orange: #ff8a1f;
  --purple: #8b5cf6;
  --red: #ff4757;
  --cyan: #12d6f0;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 7px 7px 0 var(--ink);
  --r: 18px;
  --gap: clamp(12px, calc(var(--vh) * 2.2), 24px);
  --pad: clamp(14px, calc(var(--vh) * 2.6), 30px);
}

/* Everything is sized to the window: the page itself never scrolls. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 800;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 20%, #ffe066 0 120px, transparent 121px),
    radial-gradient(circle at 92% 80%, #7cf3ff 0 160px, transparent 161px),
    radial-gradient(circle at 85% 10%, #ffb3d9 0 90px, transparent 91px),
    var(--paper);
}
button { font: inherit; cursor: pointer; color: inherit; }
kbd {
  font-family: inherit; font-size: .75em; padding: 1px 7px; border: 2px solid currentColor;
  border-radius: 6px; opacity: .75; margin-left: 4px;
}
.hidden { display: none !important; }

/* ---------- Desktop-only gate ---------- */
#mobile-block { display: none; position: fixed; inset: 0; z-index: 999; background: var(--yellow); place-items: center; padding: 24px; }
body.is-mobile #mobile-block { display: grid; }
body.is-mobile #app { display: none; }
.mb-card { background: #fff; border: 4px solid var(--ink); box-shadow: var(--shadow-lg); border-radius: var(--r); padding: 32px; text-align: center; max-width: 360px; }
.mb-emoji { font-size: 64px; }
.mb-card h1 { font-family: 'Lilita One'; font-weight: 400; margin: 8px 0; }

/* ---------- Screens ---------- */
#app { height: 100vh; position: relative; transform-origin: 0 0; }
.screen { display: none; height: 100%; }
.screen.active { display: flex; flex-direction: column; }
#screen-register.active, #screen-queue.active, #screen-results.active { align-items: center; justify-content: center; padding: var(--pad); }

.pop { animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }

.logo { font-family: 'Lilita One'; font-size: 28px; letter-spacing: .5px; color: var(--ink); white-space: nowrap; }
.logo span { color: var(--pink); }
.logo.big { font-size: clamp(44px, calc(var(--vh) * 9), 72px); line-height: 1; text-shadow: 4px 4px 0 var(--yellow); }

/* ---------- Buttons ---------- */
.btn {
  border: 3px solid var(--ink); border-radius: 14px; padding: 10px 20px; font-weight: 900; font-size: 17px;
  background: #fff; box-shadow: var(--shadow); transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-go { background: var(--green); }
.btn-xl { font-size: clamp(19px, calc(var(--vh) * 3), 24px); padding: clamp(10px, calc(var(--vh) * 1.8), 16px) 28px; font-family: 'Lilita One'; font-weight: 400; letter-spacing: .5px; }
.btn-ghost { background: #fff; }
.btn.small { padding: 6px 12px; font-size: 15px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- Register ---------- */
.register-card { text-align: center; background: #fff; border: 4px solid var(--ink); box-shadow: var(--shadow-lg); border-radius: 28px; padding: clamp(24px, calc(var(--vh) * 5), 44px) 52px; width: 580px; max-height: 100%; }
.tag { font-size: clamp(16px, calc(var(--vh) * 2.4), 20px); margin: 10px 0 clamp(14px, calc(var(--vh) * 3), 26px); }
#auth-form { display: grid; gap: clamp(8px, calc(var(--vh) * 1.5), 14px); text-align: left; }
.register-card .tag { min-height: 1.3em; }
.field { display: grid; gap: 5px; }
.field > span:first-child { font-size: 14px; text-transform: uppercase; letter-spacing: .8px; opacity: .65; }
.field input {
  font: 800 clamp(17px, calc(var(--vh) * 2.6), 20px) 'Nunito', sans-serif; color: var(--ink); width: 100%;
  border: 4px solid var(--ink); border-radius: 14px; background: #fffbe6; padding: clamp(8px, calc(var(--vh) * 1.4), 12px) 14px; outline: none;
}
.field input:focus { background: #fff; box-shadow: 0 0 0 5px var(--cyan); }
.field-hint { font-size: 13px; opacity: .6; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 58px; }
.eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border: none; border-radius: 10px;
  background: transparent; display: grid; place-items: center; color: var(--ink); opacity: .65;
}
.eye:hover { opacity: 1; background: #fff3b0; }
.eye .eye-shut { display: none; }
.eye.on .eye-open { display: none; }
.eye.on .eye-shut { display: block; }
.eye.on { opacity: 1; color: var(--pink); }
.link { background: none; border: none; padding: 2px 0; font: inherit; font-weight: 900; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:hover { color: var(--pink); }
.forgot-row { text-align: right; margin-top: -4px; }
.auth-switch { justify-self: center; }
.ok-msg { color: #0b8f4a; text-align: center; }
.ok-msg:empty, .error:empty { display: none; }
#auth-form .error { text-align: center; min-height: 0; }
.mega-input {
  font: 400 clamp(28px, calc(var(--vh) * 5), 40px) 'Lilita One'; text-align: center; padding: clamp(8px, calc(var(--vh) * 1.6), 14px); border: 4px solid var(--ink);
  border-radius: 18px; background: #fffbe6; outline: none; color: var(--ink);
}
.mega-input:focus { background: #fff; box-shadow: 0 0 0 6px var(--cyan); }
.lang-label { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; opacity: .6; margin-bottom: -6px; }
.lang-pick { display: flex; gap: 10px; justify-content: center; }
.lang-btn { flex: 1; border: 3px solid var(--ink); border-radius: 14px; background: #fff; padding: 8px 10px; font-size: 16px; font-weight: 900; display: flex; align-items: center; justify-content: center; gap: 8px; }
.lang-btn .flag { font-size: 22px; }
.lang-btn:hover { background: #fff3b0; }
.lang-btn.on { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.lang-pick.big { max-width: 640px; }
.lang-pick.big .lang-btn { padding: 18px; font-size: 20px; }
.lang-pick.big .flag { font-size: 32px; }
.error { color: var(--red); min-height: 20px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 20px; padding: clamp(8px, calc(var(--vh) * 1.4), 14px) 24px; background: #fff;
  border-bottom: 4px solid var(--ink); flex: none;
}
.tabs { display: flex; gap: 6px; flex: 1; }
.tab { border: 3px solid transparent; background: none; padding: 8px 14px; border-radius: 12px; font-size: 16px; font-weight: 900; white-space: nowrap; }
.tab:hover { background: #fff3b0; }
.tab.active { background: var(--yellow); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.me-chip { display: flex; align-items: center; gap: 8px; }
.coin-pill, .trophy-pill, .ping-pill {
  border: 3px solid var(--ink); border-radius: 999px; padding: 4px 11px; background: #fff3b0; font-weight: 900; white-space: nowrap; font-size: 15px;
}
.coin-pill.inline { font-size: 18px; vertical-align: middle; margin-left: 10px; }
.trophy-pill { background: #e9ddff; }
.ping-pill { background: #dcfff0; display: flex; align-items: center; gap: 6px; }
.ping-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 2px solid var(--ink); }
.ping-pill.mid { background: #fff3b0; } .ping-pill.mid .dot { background: var(--yellow); }
.ping-pill.bad { background: #ffd6da; } .ping-pill.bad .dot { background: var(--red); }

/* Each tab fills exactly the space under the top bar. */
/* Compact profile badge (top-right). Click → profile editor. */
.me-badge {
  display: flex; align-items: center; gap: 10px; border: 3px solid var(--ink); border-radius: 999px; background: #fff;
  padding: 3px 8px 3px 3px; box-shadow: 3px 3px 0 var(--ink); transition: transform .08s, box-shadow .08s; max-width: 340px;
}
.me-badge:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); background: #fff8e1; }
.me-badge.active { background: var(--yellow); }
.mb-info { display: grid; text-align: left; line-height: 1.15; min-width: 0; }
.mb-name { font-size: 15px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-stats { display: flex; gap: 10px; font-size: 13px; white-space: nowrap; }
.me-badge .ping-pill { border: 2px solid var(--ink); padding: 1px 7px; font-size: 12px; gap: 4px; }
.me-badge .ping-pill .dot { width: 8px; height: 8px; }

.tab-body { flex: 1; min-height: 0; width: 100%; max-width: 1280px; margin: 0 auto; padding: var(--pad) 28px; display: flex; flex-direction: column; gap: var(--gap); }
.section-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; flex: none; }
.section-title { font-family: 'Lilita One'; font-weight: 400; font-size: clamp(28px, calc(var(--vh) * 4.4), 38px); margin: 0; }
.hint { margin: 0; opacity: .75; font-size: 16px; }

/* ---------- Play ---------- */
.play-head { display: flex; align-items: center; gap: 20px; flex: none; }
.play-head .hint { flex: 1; }
.mode-switch { display: flex; border: 4px solid var(--ink); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); flex: none; }
.mode-switch button { border: none; padding: 10px 20px; font-size: 18px; font-weight: 900; background: #fff; white-space: nowrap; }
.mode-switch button + button { border-left: 4px solid var(--ink); }
.mode-switch button.active { background: var(--pink); color: #fff; }
.online { font-size: 14px; background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 5px 12px; white-space: nowrap; }

.modes { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: var(--gap); padding: 0 7px 7px 0; }
.mode-card {
  position: relative; border: 4px solid var(--ink); border-radius: 24px; padding: clamp(14px, calc(var(--vh) * 2.4), 24px); box-shadow: var(--shadow-lg);
  text-align: left; color: #fff; overflow: hidden; transition: transform .1s, box-shadow .1s; min-height: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.mode-card:hover { transform: translate(-3px, -3px) rotate(-.5deg); box-shadow: 10px 10px 0 var(--ink); }
.mode-card:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.mode-card .sym { position: absolute; right: -6px; top: -22px; font: 400 clamp(90px, calc(var(--vh) * 17), 150px) 'Lilita One'; opacity: .28; line-height: 1; }
.mode-card .key { position: absolute; top: 12px; left: 14px; background: rgba(255,255,255,.95); color: var(--ink); border: 3px solid var(--ink); border-radius: 10px; width: 34px; height: 34px; display: grid; place-items: center; font-size: 17px; }
.mode-card h3 { font: 400 clamp(26px, calc(var(--vh) * 4.4), 38px) 'Lilita One'; margin: 0 0 2px; text-shadow: 3px 3px 0 rgba(0,0,0,.25); }
.mode-card .meta { font-size: clamp(13px, calc(var(--vh) * 1.9), 16px); opacity: .95; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: clamp(6px, calc(var(--vh) * 1.2), 10px); }
.chip { background: rgba(0,0,0,.22); padding: 3px 10px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
.kbd-hint { text-align: center; margin: 0; opacity: .7; flex: none; font-size: 15px; }

/* ---------- Avatars ---------- */
.avatar-wrap { width: var(--size); height: var(--size); border-radius: 50%; position: relative; isolation: isolate; flex: none; }
.profile-preview .avatar-wrap, .pod .avatar-wrap, .slot .avatar-wrap { margin: 8px auto; }
.avatar {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  font-size: calc(var(--size) * .58); border: 3px solid var(--ink); line-height: 1; position: relative;
}
.bg-sky { background: #8fe3ff; } .bg-sun { background: #ffe14d; } .bg-grape { background: #c39bff; }
.bg-lime { background: #b6ff5c; } .bg-sunset { background: linear-gradient(135deg, #ff7a59, #ff3d9a); }
.bg-ocean { background: linear-gradient(135deg, #12d6f0, #2f40ff); }
.bg-galaxy { background: radial-gradient(circle at 30% 30%, #ff9cf5 0 6%, transparent 7%), radial-gradient(circle at 70% 60%, #fff 0 3%, transparent 4%), linear-gradient(135deg, #2b0d6b, #7a1fa2 60%, #ff3d9a); }

.frame-mint > .avatar { box-shadow: 0 0 0 4px #5dffb3, 0 0 0 7px var(--ink); }
.frame-gold > .avatar { box-shadow: 0 0 0 4px #ffc400, 0 0 0 7px var(--ink); }
.frame-neon > .avatar { animation: neon 1.2s ease-in-out infinite alternate; }
@keyframes neon { from { box-shadow: 0 0 0 4px #12d6f0, 0 0 8px 6px #12d6f0; } to { box-shadow: 0 0 0 4px #ff3d9a, 0 0 18px 8px #ff3d9a; } }
.frame-fire > .avatar { box-shadow: 0 0 0 4px #ff8a1f, 0 0 14px 6px #ff4500; animation: flick .35s infinite alternate; }
@keyframes flick { to { box-shadow: 0 0 0 4px #ffd60a, 0 0 20px 9px #ff4500; } }
.frame-rainbow::before {
  content: ''; position: absolute; inset: -7px; border-radius: 50%; z-index: -1;
  background: conic-gradient(#ff4757, #ff8a1f, #ffd60a, #18d26e, #12d6f0, #8b5cf6, #ff4757); animation: spin 2s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.c-ink { color: var(--ink); } .c-blue { color: var(--blue); } .c-pink { color: var(--pink); } .c-green { color: #0fae56; }
.c-goldtext { color: #e0a100; text-shadow: 1px 1px 0 #7a5200; }
.c-rainbowtext { background: linear-gradient(90deg, #ff4757, #ff8a1f, #e0b800, #18d26e, #12a6f0, #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .nm { font-weight: 900; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-tag { font-size: 11px; background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 6px; margin-left: 6px; vertical-align: middle; }

/* ---------- Sub-tabs (shop & profile categories) ---------- */
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; flex: none; }
.subtab { border: 3px solid var(--ink); background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 900; font-size: 15px; }
.subtab:hover { background: #fff3b0; }
.subtab.on { background: var(--ink); color: #fff; }

/* ---------- Leaderboard ---------- */
.lb-sub { display: flex; gap: 18px; align-items: center; flex: none; margin-top: calc(var(--gap) * -0.5); }
.lb-sub .hint:first-child { font-weight: 900; opacity: .9; }
.pager { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.leaderboard { flex: 1; min-height: 0; background: #fff; border: 4px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; margin: 0 7px 7px 0; }
.lb-row { display: grid; grid-template-columns: 70px 1fr 80px 80px 80px 100px; align-items: center; height: 56px; padding: 0 20px; border-bottom: 3px solid #f0e6c8; font-size: 17px; }
.lb-row.head { background: var(--ink); color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .6px; height: 44px; border-bottom: none; }
.lb-row.me { background: #fff3b0; }
.lb-rank { font: 400 24px 'Lilita One'; }
.lb-row.r1 .lb-rank { color: #e0a100; } .lb-row.r2 .lb-rank { color: #8a95a5; } .lb-row.r3 .lb-rank { color: #c26a1b; }
.lb-pts { font: 400 22px 'Lilita One'; color: var(--purple); }
.empty { padding: 40px; text-align: center; opacity: .7; }

/* ---------- Profile ---------- */
.profile-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px 1fr; gap: 28px; }
.profile-preview { position: relative; background: #fff; border: 4px solid var(--ink); border-radius: 24px; box-shadow: var(--shadow-lg); padding: clamp(14px, calc(var(--vh) * 2.6), 28px); text-align: center; align-self: start; max-height: 100%; }
.pp-name .nm { font: 400 30px 'Lilita One'; }
.trophy-row { display: flex; justify-content: center; gap: 10px; margin: clamp(8px, calc(var(--vh) * 1.6), 16px) 0 4px; font-size: 20px; }
.trophy-row div { background: #fff8e1; border: 3px solid var(--ink); border-radius: 12px; padding: 4px 10px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; font-size: 14px; text-align: left; }
.stat-grid div { background: #f3edff; border-radius: 10px; padding: 6px 10px; }
.stat-grid b { display: block; font-size: 19px; }
.profile-side-head { display: flex; align-items: center; gap: 12px; flex: none; }
.profile-side-head .subtabs { flex: 1; }
.profile-side { display: flex; flex-direction: column; gap: var(--gap); min-height: 0; }
.picker { background: #fff; border: 4px solid var(--ink); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); flex: 1; min-height: 0; overflow: hidden; margin: 0 5px 5px 0; }
.picker-items { display: flex; flex-wrap: wrap; gap: 14px; align-content: flex-start; }
.pick {
  border: 3px solid var(--ink); background: #fff; border-radius: 14px; padding: 10px; display: grid; justify-items: center; align-content: center; gap: 6px;
  min-width: 96px; min-height: 96px; font-size: 13px;
}
.pick:hover { background: #fff3b0; }
.picker-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.pick { position: relative; min-width: 0; min-height: 112px; }
.pick-name { font-size: 12px; text-align: center; }
.pick-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #eee; white-space: nowrap; }
.pick-tag.on { background: var(--green); color: var(--ink); }
.pick-tag.price { background: var(--ink); color: #fff; }
.pick.locked { background: #f7f4ff; border-style: dashed; }
.pick.locked:hover { background: #fff3b0; border-style: solid; }
.pick.cant { opacity: .5; }
.pick.on { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.pick.more { border-style: dashed; font-size: 26px; }
.pick.more span { font-size: 13px; }

/* ---------- Shop ---------- */
.shop-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: min-content; gap: var(--gap); align-content: start; padding: 0 5px 5px 0; overflow: hidden; }
.shop-item { background: #fff; border: 4px solid var(--ink); border-radius: 20px; padding: 14px 12px 12px; text-align: center; box-shadow: var(--shadow); display: grid; gap: 8px; justify-items: center; }
.shop-item .nm { font-size: 15px; }
.shop-item .btn { padding: 6px 12px; font-size: 15px; width: 100%; }
.shop-item .btn.buy { background: var(--yellow); }
.shop-item .btn.owned { background: #e8e8e8; }
.shop-item .btn.equipped { background: var(--green); }
.shop-item.cant .btn.buy { opacity: .5; }
.preview-name { font: 400 20px 'Lilita One'; min-height: 56px; display: grid; place-items: center; }

/* ---------- Queue ---------- */
.queue-card { background: #fff; border: 4px solid var(--ink); border-radius: 28px; padding: clamp(20px, calc(var(--vh) * 4), 40px) 44px; text-align: center; width: 780px; max-height: 100%; box-shadow: var(--shadow-lg); }
.queue-mode { display: inline-block; font: 400 24px 'Lilita One'; padding: 6px 18px; border: 3px solid var(--ink); border-radius: 999px; color: #fff; box-shadow: var(--shadow); }
.searching { font: 400 clamp(32px, calc(var(--vh) * 6), 46px) 'Lilita One'; margin: clamp(12px, calc(var(--vh) * 2.4), 22px) 0 4px; }
.dots::after { content: ''; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.queue-sub { font-size: 16px; opacity: .75; margin: 0 0 clamp(14px, calc(var(--vh) * 3), 26px); min-height: 22px; }
.lobby-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: clamp(14px, calc(var(--vh) * 3), 28px); }
.slot { border: 4px dashed #c9bfa4; border-radius: 20px; height: clamp(120px, calc(var(--vh) * 21), 170px); display: grid; place-items: center; align-content: center; gap: 4px; padding: 8px; }
.slot.filled { border: 4px solid var(--ink); background: #fff8e1; box-shadow: var(--shadow); animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }
.slot .nm { font-size: 15px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .ping { font-size: 12px; opacity: .7; }
.slot.empty-slot::after { content: '?'; font: 400 48px 'Lilita One'; color: #d8cfb4; animation: bob 1s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(-8px); } }

/* ---------- Game ---------- */
#screen-game { background: var(--paper); position: relative; overflow: hidden; }
.game-top { display: flex; align-items: center; gap: 20px; padding: clamp(8px, calc(var(--vh) * 1.6), 16px) 24px; background: #fff; border-bottom: 4px solid var(--ink); flex: none; }
.game-mode { font: 400 20px 'Lilita One'; padding: 5px 14px; border: 3px solid var(--ink); border-radius: 999px; color: #fff; white-space: nowrap; }
.timer { flex: 1; height: clamp(30px, calc(var(--vh) * 5), 42px); border: 4px solid var(--ink); border-radius: 999px; background: #fff; position: relative; overflow: hidden; }
.timer-fill { position: absolute; inset: 0; background: linear-gradient(90deg, var(--green), var(--cyan)); transform-origin: left; }
.timer.low .timer-fill { background: linear-gradient(90deg, var(--red), var(--orange)); }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font: 400 22px 'Lilita One'; }
.timer.low span { animation: thump .5s infinite; }
@keyframes thump { 50% { transform: scale(1.15); } }

/* Layout: a short strip with "question = [answer]" side by side, then big race lanes. */
.game-top, .game-main { position: relative; z-index: 1; }
.game-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: clamp(10px, calc(var(--vh) * 2), 20px); padding: clamp(10px, calc(var(--vh) * 2), 22px) 28px clamp(14px, calc(var(--vh) * 2.4), 26px); }
.arena {
  flex: none; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: #fff; border: 5px solid var(--ink); border-radius: 28px; box-shadow: var(--shadow-lg);
  padding: clamp(8px, calc(var(--vh) * 1.6), 16px) 28px clamp(6px, calc(var(--vh) * 1.2), 12px);
}
.qa-row { display: flex; align-items: center; justify-content: center; gap: 22px; width: 100%; }
.question {
  font: 400 clamp(46px, calc(var(--vh) * 10.5), 104px) 'Lilita One'; line-height: 1.05; letter-spacing: 2px; color: var(--ink);
  text-shadow: 5px 5px 0 var(--yellow); white-space: nowrap;
}
.question.small { font-size: clamp(38px, calc(var(--vh) * 8.5), 86px); }
.question.enter { animation: qin .18s ease-out; }
@keyframes qin { from { transform: translateY(14px) scale(.94); opacity: 0; } }
.answer-input {
  width: 4.6em; font: 400 clamp(46px, calc(var(--vh) * 10.5), 104px) 'Lilita One'; line-height: 1.05; text-align: center; color: var(--ink);
  border: 6px solid var(--ink); border-radius: 24px; padding: 0 14px; outline: none; background: #fffbe6;
  box-shadow: var(--shadow); caret-color: var(--pink);
}
.answer-input:focus { background: #fff; box-shadow: var(--shadow), 0 0 0 8px rgba(18, 214, 240, .45); }
.answer-input.good { background: #b9ffd6; }
.answer-input.bad { background: #ffd0d6; animation: shake .3s; }
@keyframes shake { 20%, 60% { transform: translateX(-12px); } 40%, 80% { transform: translateX(12px); } }
.arena-foot { display: flex; gap: 18px; align-items: center; justify-content: center; min-height: 28px; }
.answer-hint { font-size: 14px; opacity: .6; }
.streak { font: 400 24px 'Lilita One'; color: var(--orange); }
.streak.bump { animation: pop .25s; }

/* Anti-cheat: no cursor, no text selection while a game is live */
#screen-game.live, #screen-game.live * { user-select: none; -webkit-user-select: none; }

/* Leave / resume popup */
.modal-back.fixed { position: absolute; z-index: 60; }
.modal.loc { width: min(560px, calc(var(--vw) * 92)); max-height: calc(var(--vh) * 92); display: flex; flex-direction: column; }
.modal .big-flag { font-size: 96px; line-height: 1.1; }
.modal-emoji.spin { display: inline-block; animation: spin 1.4s linear infinite; }
.modal .link { align-self: center; margin-top: 4px; }

/* Searchable country dropdown */
.cpick { display: flex; flex-direction: column; gap: 10px; min-height: 0; margin-top: 14px; text-align: left; }
.cpick-search { display: flex; align-items: center; gap: 8px; border: 4px solid var(--ink); border-radius: 14px; padding: 0 12px; background: #fffbe6; }
.cpick-search:focus-within { background: #fff; box-shadow: 0 0 0 5px var(--cyan); }
.cpick-search input { flex: 1; border: none; outline: none; background: none; font: 800 18px 'Nunito'; color: var(--ink); padding: 10px 0; }
.cpick-list { border: 4px solid var(--ink); border-radius: 14px; overflow-y: auto; height: clamp(170px, calc(var(--vh) * 34), 280px); background: #fff; }
.cpick-opt { display: flex; align-items: center; gap: 12px; width: 100%; border: none; background: none; padding: 8px 14px; font: 800 17px 'Nunito'; text-align: left; border-bottom: 2px solid #f3edd9; }
.cpick-opt:hover, .cpick-opt.active { background: #fff3b0; }
.cpick-opt.sel { background: var(--yellow); }
.cpick-opt b { margin-left: auto; }
.cflag { font-size: 24px; }
.cpick-empty { padding: 24px; text-align: center; opacity: .6; }
.country-tab { max-width: 560px; }
.country-tab .cpick-list { height: clamp(180px, calc(var(--vh) * 42), 340px); }

.flag-tag { margin-right: 5px; font-size: 1.05em; }
#logout { margin-top: 6px; font-size: 14px; }

.modal-back {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center;
  background: rgba(26, 16, 51, .55); backdrop-filter: blur(3px); animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(520px, calc(var(--vw) * 90)); background: #fff; border: 5px solid var(--ink); border-radius: 28px; box-shadow: 10px 10px 0 var(--ink);
  padding: 28px 36px 30px; text-align: center; animation: pop .3s cubic-bezier(.2, 1.6, .4, 1);
}
.modal-emoji { font-size: 56px; line-height: 1; }
.modal h2 { font: 400 40px 'Lilita One'; margin: 10px 0 6px; }
.modal p { margin: 0; font-size: 18px; }
.modal .modal-note { font-size: 15px; opacity: .6; margin-top: 6px; }
.modal-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; align-items: stretch; }
.btn-danger { background: var(--red); color: #fff; }
.btn:focus-visible { outline: 4px solid var(--cyan); outline-offset: 3px; }
.lock {
  position: absolute; inset: -5px; display: grid; place-items: center; text-align: center; padding: 20px;
  background: rgba(255, 71, 87, .94); color: #fff; font: 400 clamp(26px, calc(var(--vh) * 5), 42px) 'Lilita One';
  border: 5px solid var(--ink); border-radius: 28px; z-index: 5;
}
.away-tag { font-size: 12px; background: var(--red); color: #fff; padding: 2px 7px; border-radius: 6px; margin-left: 6px; white-space: nowrap; vertical-align: middle; }

/* ---- Race lanes ---- */
.lanes { --lane-gap: clamp(8px, calc(var(--vh) * 1.4), 14px); flex: 1; min-height: 0; position: relative; }
.lane {
  position: absolute; left: 0; right: 7px; display: flex; align-items: stretch; gap: 12px;
  transition: top .45s cubic-bezier(.3, 1.4, .5, 1);
}
.lane-rank {
  flex: none; width: clamp(48px, calc(var(--vh) * 7), 72px); display: grid; place-items: center; border: 4px solid var(--ink); border-radius: 18px;
  background: #fff; font: 400 clamp(26px, calc(var(--vh) * 5), 44px) 'Lilita One'; box-shadow: var(--shadow);
}
.lane-track {
  flex: 1; position: relative; overflow: hidden; border: 4px solid var(--ink); border-radius: 18px;
  background: repeating-linear-gradient(90deg, #fff 0 calc(10% - 2px), #f2ead2 calc(10% - 2px) 10%); box-shadow: var(--shadow);
}
.lane-fill {
  position: absolute; inset: 0 auto 0 0; width: 0; border-right: 4px solid var(--ink);
  background: #b9c6e8; transition: width .35s cubic-bezier(.3, 1.3, .5, 1);
}
.lane-who { position: absolute; inset: 0; display: flex; align-items: center; gap: 12px; padding: 0 16px; z-index: 1; min-width: 0; }
.lane-name { font-size: clamp(16px, calc(var(--vh) * 2.6), 22px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-name .nm { font-size: inherit; }
.lane-score {
  flex: none; width: clamp(70px, calc(var(--vh) * 10), 110px); display: grid; place-items: center; border: 4px solid var(--ink); border-radius: 18px;
  background: #fff; font: 400 clamp(30px, calc(var(--vh) * 6.4), 58px) 'Lilita One'; box-shadow: var(--shadow);
}
.ghost-icon { font-size: 30px; }

/* Me: unmistakable hot color, animated stripes, glow */
.lane.me .lane-fill {
  background: repeating-linear-gradient(-45deg, #ff3d9a 0 22px, #ff6fb5 22px 44px);
  background-size: 62px 62px; animation: stripes .8s linear infinite;
}
@keyframes stripes { to { background-position: 62px 0; } }
.lane.me .lane-track, .lane.me .lane-rank, .lane.me .lane-score { box-shadow: var(--shadow), 0 0 0 4px #ff3d9a, 0 0 22px 4px rgba(255, 61, 154, .55); }
.lane.me .lane-rank, .lane.me .lane-score { background: var(--yellow); }
.you-tag { background: var(--ink); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 8px; margin-left: 8px; vertical-align: middle; letter-spacing: 1px; }
.lane.ghost .lane-fill { background: repeating-linear-gradient(-45deg, #e7e0ff 0 14px, #d3c8ff 14px 28px); }
.lane.ghost { opacity: .75; }
.lane.left { opacity: .35; }
.lane.climb .lane-track { animation: climb .6s ease-out; }
@keyframes climb { 0% { transform: scale(1.04); filter: brightness(1.25); } 100% { transform: none; filter: none; } }

/* ---- Streak burst ---- */
#burst { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.spark { position: absolute; transform: translate(-50%, -50%); animation: spark .7s ease-out forwards; }
@keyframes spark { to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.4) rotate(200deg); opacity: 0; } }
.game-main.jolt { animation: jolt .18s; }
@keyframes jolt { 25% { transform: translate(-5px, 3px) rotate(-.4deg); } 75% { transform: translate(5px, -3px) rotate(.4deg); } }

/* ---- Psycho mode: the page changes mood as the streak grows ---- */
#screen-game::before { content: ''; position: absolute; inset: -50%; z-index: 0; opacity: 0; transition: opacity .4s; pointer-events: none; }
body.psycho-1 #screen-game::before, body.psycho-2 #screen-game::before, body.psycho-3 #screen-game::before { opacity: 1; }
body.psycho-1 #screen-game::before {
  background: linear-gradient(120deg, #ff8a1f, #ffd60a, #ff3d9a, #ff8a1f); background-size: 300% 300%;
  animation: psy-pan 3s linear infinite;
}
body.psycho-2 #screen-game::before {
  background: linear-gradient(120deg, #ff3d9a, #8b5cf6, #12d6f0, #18d26e, #ffd60a, #ff3d9a); background-size: 300% 300%;
  animation: psy-pan 1.6s linear infinite, psy-hue 4s linear infinite;
}
body.psycho-3 #screen-game::before {
  background: conic-gradient(from 0deg, #ff4757, #ff8a1f, #ffd60a, #18d26e, #12d6f0, #8b5cf6, #ff3d9a, #ff4757);
  animation: spin 2.2s linear infinite, psy-hue 2s linear infinite;
}
@keyframes psy-pan { to { background-position: 300% 0; } }
@keyframes psy-hue { to { filter: hue-rotate(360deg); } }
body.psycho-2 .game-top, body.psycho-3 .game-top { background: rgba(255, 255, 255, .85); }
body.psycho-2 .arena { animation: breathe .5s ease-in-out infinite alternate; }
body.psycho-3 .arena { animation: breathe .3s ease-in-out infinite alternate; }
@keyframes breathe { to { transform: scale(1.015); } }
body.psycho-2 .lane.me .lane-fill, body.psycho-3 .lane.me .lane-fill {
  background: linear-gradient(90deg, #ff4757, #ff8a1f, #ffd60a, #18d26e, #12d6f0, #8b5cf6, #ff3d9a); background-size: 200% 100%;
  animation: psy-pan .8s linear infinite;
}
body.psycho-1 .streak { font-size: 30px; color: #fff; -webkit-text-stroke: 2px var(--ink); }
body.psycho-2 .streak, body.psycho-3 .streak { font-size: 34px; color: var(--yellow); -webkit-text-stroke: 2px var(--ink); animation: thump .4s infinite; }

.psycho-banner {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.3); opacity: 0; pointer-events: none; z-index: 15;
  font: 400 clamp(54px, calc(var(--vh) * 13), 120px) 'Lilita One'; color: #fff; -webkit-text-stroke: 6px var(--ink); white-space: nowrap;
  text-shadow: 8px 8px 0 var(--ink);
}
.psycho-banner.show { animation: banner 1.3s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.psycho-banner.lvl2 { color: var(--yellow); } .psycho-banner.lvl3 { color: var(--pink); }
@keyframes banner {
  0% { transform: translate(-50%, -50%) scale(.3) rotate(-8deg); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1.1) rotate(3deg); opacity: 1; }
  75% { transform: translate(-50%, -50%) scale(1) rotate(-2deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

/* Respect "reduce motion": keep the colors, drop the spinning and shaking. */
@media (prefers-reduced-motion: reduce) {
  #screen-game::before, .arena, .game-main.jolt, .lane.me .lane-fill, .streak, .spark { animation: none !important; }
}

.countdown { position: absolute; inset: 0; background: rgba(26, 16, 51, .55); display: grid; place-items: center; z-index: 20; }
.countdown span { font: 400 clamp(140px, calc(var(--vh) * 32), 260px) 'Lilita One'; color: var(--yellow); -webkit-text-stroke: 8px var(--ink); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }

/* ---------- Results ---------- */
.results-card { background: #fff; border: 4px solid var(--ink); border-radius: 28px; padding: clamp(16px, calc(var(--vh) * 3), 32px) 44px; width: 800px; max-height: 100%; text-align: center; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.results-card h2 { font: 400 clamp(34px, calc(var(--vh) * 6), 50px) 'Lilita One'; margin: 0 0 clamp(6px, calc(var(--vh) * 1.6), 16px); }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 14px; margin-bottom: clamp(8px, calc(var(--vh) * 2), 18px); }
.pod { display: grid; justify-items: center; gap: 4px; width: 160px; }
.pod .block { width: 100%; border: 4px solid var(--ink); border-radius: 16px 16px 0 0; display: grid; place-items: center; font: 400 40px 'Lilita One'; color: #fff; box-shadow: var(--shadow); }
.pod.p1 .block { height: clamp(70px, calc(var(--vh) * 14), 130px); background: #ffc400; }
.pod.p2 .block { height: clamp(50px, calc(var(--vh) * 10), 95px); background: #a9b4c4; }
.pod.p3 .block { height: clamp(36px, calc(var(--vh) * 7), 70px); background: #e0853a; }
.pod .nm { font-size: 17px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .sc { font-size: 14px; opacity: .75; }
.pod .tro { font-size: 32px; height: 38px; }
.results-list { display: grid; gap: 6px; margin-bottom: clamp(8px, calc(var(--vh) * 1.6), 16px); }
.res-row { display: grid; grid-template-columns: 50px 1fr 90px 120px; align-items: center; padding: 6px 14px; border: 3px solid var(--ink); border-radius: 14px; text-align: left; font-size: 16px; }
.res-row.me { background: #fff3b0; }
.results-reward { font: 400 clamp(20px, calc(var(--vh) * 3.4), 26px) 'Lilita One'; margin-bottom: clamp(10px, calc(var(--vh) * 2.4), 22px); color: var(--purple); }
.results-actions { display: flex; gap: 16px; justify-content: center; align-items: center; }

/* ---------- Toast & confetti ---------- */
.toast { position: absolute; bottom: 30px; left: 50%; transform: translate(-50%, 120px); background: var(--ink); color: #fff; padding: 14px 24px; border-radius: 14px; font-size: 18px; transition: transform .25s; z-index: 50; }
.toast.show { transform: translate(-50%, 0); }
#confetti { position: absolute; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.conf { position: absolute; top: -20px; width: 12px; height: 18px; border: 2px solid var(--ink); animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(calc(var(--vh) * 110)) rotate(720deg); } }

/* Narrower desktop windows */
@media (max-width: 1150px) {
  .trophy-pill { display: none; }
  .play-head .hint { display: none; }
  .tab { padding: 8px 10px; font-size: 15px; }
}
.logo em { font-style: normal; color: var(--blue); font-size: .62em; }

/* Gear on the profile card + settings popup */
.gear {
  position: absolute; top: 12px; right: 12px; width: 46px; height: 46px; display: grid; place-items: center;
  border: 3px solid var(--ink); border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 3px 3px 0 var(--ink);
  transition: transform .15s, background .15s;
}
.gear:hover { background: var(--yellow); transform: rotate(45deg); }
.gear:active { transform: rotate(45deg) translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.gear:focus-visible { outline: 4px solid var(--cyan); outline-offset: 3px; }
.modal.settings { width: min(820px, calc(var(--vw) * 94)); max-height: calc(var(--vh) * 92); position: relative; text-align: left; display: flex; flex-direction: column; padding: 24px 30px 28px; }
.modal.settings > h2 { margin: 0 0 16px; }
.modal-x { position: absolute; top: 14px; right: 16px; width: 44px; height: 44px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; font: 900 20px 'Nunito'; }
.modal-x:hover { background: #ffd6d6; }
.set-grid { display: grid; grid-template-columns: 200px 1fr; gap: 24px; min-height: 0; flex: 1; }
.set-side { display: flex; flex-direction: column; gap: 8px; }
.set-tab { text-align: left; border: 3px solid var(--ink); background: #fff; border-radius: 14px; padding: 10px 14px; font: 900 16px 'Nunito'; }
.set-tab:hover { background: #fff3b0; }
.set-tab.on { background: var(--ink); color: #fff; }
.set-main { min-height: clamp(300px, calc(var(--vh) * 52), 440px); display: flex; flex-direction: column; min-width: 0; }
.set-main h3 { font: 400 26px 'Lilita One'; margin: 0 0 8px; }
.set-now { font-size: 16px !important; opacity: .75; margin-bottom: 10px !important; overflow-wrap: anywhere; }
.set-form { display: grid; gap: 12px; max-width: 440px; }
.set-form .btn { justify-self: start; }
.set-form .link { justify-self: start; }
.set-msg { min-height: 22px; font-weight: 900; color: var(--red); }
.set-msg.ok { color: #13a05a; }
.set-main .cpick { margin-top: 4px; }
.set-main .cpick-list { height: clamp(160px, calc(var(--vh) * 34), 300px); }
.set-main .lang-pick { justify-content: flex-start; }

/* Leaderboard lobby filter */
.lb-modes { display: flex; gap: 8px; flex-wrap: wrap; flex: none; }
.mchip { --mc: var(--ink); border: 3px solid var(--ink); background: #fff; border-radius: 12px; padding: 5px 12px; font: 900 14px 'Nunito'; }
.mchip b { font: 400 18px 'Lilita One'; color: var(--mc); }
.mchip:hover { background: #fff3b0; }
.mchip.on { background: var(--mc); color: #fff; box-shadow: 3px 3px 0 var(--ink); }
.mchip.on b { color: #fff; }

/* ---------- Landing ---------- */
#screen-landing { position: relative; overflow: hidden; }
#landing-3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.land-top, .land-main { position: relative; z-index: 1; }
.land-top { display: flex; align-items: center; justify-content: space-between; padding: clamp(14px, calc(var(--vh) * 2.6), 24px) clamp(20px, calc(var(--vw) * 3), 44px); padding-right: 230px; }
.land-top .logo { font-size: 32px; text-shadow: 3px 3px 0 var(--yellow); }
.land-right { display: flex; align-items: center; gap: 14px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 5px 12px; font-size: 14px; }
.live-pill i { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(24, 210, 110, .7); animation: livepulse 1.6s infinite; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 9px rgba(24, 210, 110, 0); } 100% { box-shadow: 0 0 0 0 rgba(24, 210, 110, 0); } }
.land-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.08fr 1fr; gap: clamp(24px, calc(var(--vw) * 4), 64px); align-items: center; padding: 0 clamp(24px, calc(var(--vw) * 5), 80px) clamp(18px, calc(var(--vh) * 4), 44px); }
.land-hero { position: relative; }
.land-hero::before { content: ''; position: absolute; inset: -12% -8%; z-index: -1; background: radial-gradient(closest-side, rgba(255, 248, 225, .95), rgba(255, 248, 225, .75) 60%, transparent); }
.land-kicker { display: inline-block; background: var(--ink); color: #fff; border-radius: 999px; padding: 7px 16px; font-size: clamp(14px, calc(var(--vh) * 2), 17px); }
.land-title { font: 400 clamp(52px, calc(var(--vh) * 11), 104px)/0.98 'Lilita One'; margin: clamp(10px, calc(var(--vh) * 2), 20px) 0 clamp(8px, calc(var(--vh) * 1.6), 16px); letter-spacing: .5px; visibility: hidden; }
.land-title.split { visibility: visible; }
.land-title .line { display: block; }
.land-title .l1 { color: var(--pink); text-shadow: 5px 5px 0 var(--ink); -webkit-text-stroke: 2px var(--ink); }
.land-title .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 4px 8px 0; margin-bottom: -8px; }
.land-title .w > span { display: inline-block; }
.land-sub { font-size: clamp(17px, calc(var(--vh) * 2.6), 22px); max-width: 560px; margin: 0 0 clamp(16px, calc(var(--vh) * 3), 28px); opacity: .85; }
.land-cta { font: 400 clamp(24px, calc(var(--vh) * 4.2), 34px) 'Lilita One'; padding: clamp(14px, calc(var(--vh) * 2.4), 20px) clamp(28px, calc(var(--vw) * 3), 42px); border-width: 4px; box-shadow: 7px 7px 0 var(--ink); border-radius: 20px; letter-spacing: .5px; }
.land-cta b { display: inline-block; transition: transform .2s; }
.land-cta:hover b { transform: translateX(6px); }
.land-cta:hover { box-shadow: 10px 10px 0 var(--ink); }
.land-free { margin-top: clamp(10px, calc(var(--vh) * 1.8), 16px); font-size: clamp(14px, calc(var(--vh) * 2), 16px); opacity: .75; }
.land-chips { display: flex; gap: 12px; margin-top: clamp(14px, calc(var(--vh) * 3), 30px); }
.land-chip { width: clamp(42px, calc(var(--vh) * 6.4), 56px); height: clamp(42px, calc(var(--vh) * 6.4), 56px); display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 14px; background: var(--c); color: #fff; font: 400 clamp(22px, calc(var(--vh) * 3.6), 30px) 'Lilita One'; box-shadow: 3px 3px 0 var(--ink); text-shadow: 2px 2px 0 var(--ink); }
.land-card { background: #fff; border: 5px solid var(--ink); border-radius: 30px; box-shadow: 12px 12px 0 var(--ink); padding: clamp(16px, calc(var(--vh) * 2.6), 26px); display: flex; flex-direction: column; gap: clamp(10px, calc(var(--vh) * 1.8), 16px); }
.slides { position: relative; overflow: hidden; height: clamp(300px, calc(var(--vh) * 52), 440px); border-radius: 18px; }
.slide { position: absolute; inset: 0; display: none; flex-direction: column; gap: clamp(10px, calc(var(--vh) * 2), 18px); }
.slide.on { display: flex; }
.slide-vis { flex: 1; min-height: 0; border: 4px solid var(--ink); border-radius: 20px; background: #fffbe6; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.slide-copy h3 { font: 400 clamp(26px, calc(var(--vh) * 4.4), 36px) 'Lilita One'; margin: 0 0 4px; }
.slide-copy p { margin: 0; font-size: clamp(15px, calc(var(--vh) * 2.3), 19px); opacity: .8; }
.slide-nav { display: flex; align-items: center; justify-content: space-between; }
.nav-arrow { width: 44px; height: 44px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; font: 400 28px/1 'Lilita One'; box-shadow: 3px 3px 0 var(--ink); }
.nav-arrow:hover { background: var(--yellow); }
.sdots { display: flex; gap: 8px; }
.sdot { width: 34px; height: 12px; border: 3px solid var(--ink); border-radius: 999px; background: #fff; padding: 0; overflow: hidden; position: relative; }
.sdot i { position: absolute; inset: 0; background: var(--pink); transform-origin: left; transform: scaleX(0); }
.sdot.on { width: 56px; }
/* slide visuals */
.race-vis { flex-direction: column; align-items: stretch; justify-content: center; gap: 12px; padding: 18px; background: #f3edff; }
.mini-lane { display: grid; grid-template-columns: 118px 1fr 40px; align-items: center; gap: 10px; font-size: 16px; }
.mini-track { height: 30px; border: 3px solid var(--ink); border-radius: 10px; background: #fff; overflow: hidden; }
.mini-fill { height: 100%; background: var(--blue); transform-origin: left; transform: scaleX(.04); }
.mini-lane:nth-child(3) .mini-fill { background: var(--orange); }
.mini-lane.me .mini-fill { background: repeating-linear-gradient(45deg, var(--pink) 0 12px, #ff6fb5 12px 24px); }
.mini-lane.me .mini-who b { color: var(--pink); }
.mini-n { font: 400 24px 'Lilita One'; text-align: right; }
.world-vis { flex-direction: column; gap: 16px; background: radial-gradient(circle at 50% 50%, #c9f6ff, #7cf3ff); }
.vs-row { display: flex; align-items: center; gap: 16px; }
.vs-card { background: #fff; border: 4px solid var(--ink); border-radius: 18px; box-shadow: 5px 5px 0 var(--ink); padding: 12px 18px; display: grid; justify-items: center; font-size: 46px; line-height: 1.1; }
.vs-card b { font-size: 18px; } .vs-card small { font-size: 14px; color: #0b8f4a; }
.vs-x { font: 400 40px 'Lilita One'; color: var(--pink); -webkit-text-stroke: 2px var(--ink); }
.vs-ok { background: var(--ink); color: #fff; border-radius: 999px; padding: 6px 16px; font-size: 16px; }
.trophy-vis { align-items: flex-end; gap: 12px; padding-bottom: 0; background: linear-gradient(#fff3b0, #ffe066); }
.pod-col { display: flex; flex-direction: column; align-items: center; }
.medal { font-size: 52px; }
.pod { width: 96px; border: 4px solid var(--ink); border-bottom: none; border-radius: 14px 14px 0 0; display: grid; place-items: start center; padding-top: 6px; font: 400 34px 'Lilita One'; color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.pod.p1 { height: 150px; background: #ffc300; } .pod.p2 { height: 110px; background: #a8b4c4; } .pod.p3 { height: 80px; background: #e08a3c; }
.psy-stage { --h: 40; flex-direction: column; background: conic-gradient(from calc(var(--h) * 1deg), hsl(calc(var(--h) * 1), 95%, 60%), hsl(calc(var(--h) * 1 + 120), 95%, 60%), hsl(calc(var(--h) * 1 + 240), 95%, 60%), hsl(calc(var(--h) * 1), 95%, 60%)); }
.streak { font: 400 76px 'Lilita One'; color: #fff; -webkit-text-stroke: 3px var(--ink); text-shadow: 5px 5px 0 var(--ink); }
.streak-n { display: inline-block; min-width: 1.2em; }
.psy-label { font: 400 26px 'Lilita One'; background: var(--ink); color: #fff; padding: 4px 16px; border-radius: 12px; }
.custom-vis { background: linear-gradient(135deg, #ffd6ec, #d9ccff); }
.cust-ring { width: 150px; height: 150px; border-radius: 50%; border: 10px solid var(--yellow); outline: 4px solid var(--ink); background: #fff; display: grid; place-items: center; font-size: 84px; transition: border-color .2s; }
.cust-av { display: inline-block; }
.cust-coin { position: absolute; right: 22%; top: 30%; font-size: 22px; background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 2px 10px; }
.practice-vis { gap: 14px; font: 400 54px 'Lilita One'; background: #e6fbef; }
.pr-a { min-width: 140px; border: 4px solid var(--ink); border-radius: 16px; background: #fff; padding: 2px 16px; text-align: center; min-height: 1.3em; box-shadow: 0 0 0 5px var(--cyan); }
.pr-ok { color: #13a05a; font-size: 50px; opacity: 0; }

/* Language menu (landing + sign-up, top-right corner) */
.lang-menu { position: absolute; top: clamp(14px, calc(var(--vh) * 2.6), 24px); right: clamp(20px, calc(var(--vw) * 3), 44px); z-index: 50; }
.lang-cur { display: flex; align-items: center; gap: 8px; border: 3px solid var(--ink); background: #fff; border-radius: 14px; padding: 7px 14px; font-weight: 900; font-size: 16px; box-shadow: 3px 3px 0 var(--ink); }
.lang-cur .flag { font-size: 22px; } .lang-cur b { font-size: 12px; opacity: .6; }
.lang-cur:hover { background: #fff3b0; }
.lang-list { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 5px 5px 0 var(--ink); padding: 6px; min-width: 190px; animation: pop .25s cubic-bezier(.2, 1.6, .4, 1); transform-origin: top right; }
.lang-opt { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none; border-radius: 10px; padding: 9px 12px; font-weight: 900; font-size: 16px; text-align: left; }
.lang-opt .flag { font-size: 22px; } .lang-opt b { margin-left: auto; }
.lang-opt:hover { background: #fff3b0; } .lang-opt.on { background: var(--yellow); }

/* Sign-up extras */
#screen-register { position: relative; }
.back-home { position: absolute; top: clamp(18px, calc(var(--vh) * 3), 30px); left: clamp(20px, calc(var(--vw) * 3), 44px); font-size: 17px; }
.pw-meter { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 6px; align-items: center; margin-top: 2px; }
.pw-meter i { height: 8px; border-radius: 999px; background: #e4dfd0; border: 2px solid transparent; transition: background .25s, border-color .25s; }
.pw-meter i.on { background: var(--green); border-color: var(--ink); }
.pw-meter small { font-size: 13px; opacity: .65; margin-left: 6px; white-space: nowrap; min-width: 150px; text-align: right; }
.pw-meter[data-level="3"] small { color: #0b8f4a; opacity: 1; }
.pw-match { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-weight: 900; font-size: 20px; }
.pw-match.yes { color: #13a05a; } .pw-match.no { color: var(--red); }
/* Tighter sign-up card now that it has a confirm field + strength meter */
.register-card { padding: clamp(18px, calc(var(--vh) * 3.4), 40px) 52px; }
.register-card .logo.big { font-size: clamp(40px, calc(var(--vh) * 7.4), 72px); }
.register-card .tag { margin: 8px 0 clamp(10px, calc(var(--vh) * 2.2), 24px); }
/* CTA: one line, steady (no pulsing), simple press feedback */
.land-cta { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; transition: transform .12s, box-shadow .12s; }
.land-cta:hover { transform: translate(-2px, -2px); }
.land-cta:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.land-cta:hover b { transform: none; }
.land-main { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
.land-card { min-width: 0; }

/* Labels that must stay on one line (the app scales down instead of wrapping) */
.land-kicker, .land-free, .land-cta, .land-top .logo, .lang-cur, .lang-opt, .tab, .subtab, .mchip, .me-badge, .btn, .set-tab,
.slide-copy h3, .mini-who, .vs-ok, .psy-label, .section-title, .coin-pill, .pick-tag, .pw-meter small { white-space: nowrap; }
/* Headline: each line stays on one line; size follows the layout width */
.land-title { font-size: clamp(48px, min(calc(var(--vh) * 11), calc(var(--vw) * 6.1)), 100px); }
.land-title .line { white-space: nowrap; }
/* Practice slide: question + answer always on one row */
.practice-vis { font-size: 46px; gap: 12px; padding: 0 16px; }
.pr-q, .pr-a, .pr-ok { flex: none; white-space: nowrap; }
.pr-a { min-width: 120px; }
