: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; }
/* #app is scaled down with a transform in small windows (fitToWindow), but a transform does not
   shrink its layout box: it stays 1280px wide (and taller than the window), so body ends up with
   hidden-but-scrollable overflow and focusing a control could scroll it, shifting the whole UI.
   `clip` (unlike `hidden`) makes body not a scroll container at all. app.js resets it on older browsers. */
body { overflow: clip; }
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: rgba(26, 16, 51, .6); backdrop-filter: blur(3px); place-items: center; padding: 24px; }
body.show-mobile-note #mobile-block { display: grid; }
.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 .mb-title { font: 400 30px 'Lilita One'; margin: 8px 0; }
.mb-card p { margin: 0 0 18px; }
.mb-card .btn { width: 100%; margin-bottom: 10px; }

/* ---------- 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 input::placeholder { color: #b9b2a0; font-weight: 700; }
.name-hint { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; min-height: 0; margin: -4px 0 2px; font: 800 13px 'Nunito', sans-serif; white-space: nowrap; overflow: hidden; }
.name-hint:empty { display: none; }
.name-hint.ok { color: var(--green, #1a9e4b); }
.name-hint.taken { color: var(--red); }
.name-sug { font: 900 13px 'Nunito', sans-serif; color: var(--ink); background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 2px 10px; cursor: pointer; flex: none; }
.name-sug:hover { background: 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; }
/* Ranked / Practice switch: a thumb slides under the active option, blue for Ranked, pink for Practice. */
.mode-switch { --k: var(--blue); position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 5px; background: #fff; border: 4px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); flex: none; }
.mode-switch[data-kind="practice"] { --k: var(--pink); }
.mode-switch button { position: relative; z-index: 1; border: none; padding: 9px 20px; font-size: 18px; font-weight: 900; background: transparent; color: var(--ink); opacity: .45; white-space: nowrap; border-radius: 12px; cursor: pointer; transition: opacity .2s, color .2s; }
.mode-switch button:hover { opacity: .75; }
.mode-switch button.active { opacity: 1; color: #fff; text-shadow: 0 2px 0 rgba(26, 16, 51, .35); cursor: default; }
.ms-thumb { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border: 3px solid var(--ink); border-radius: 12px; background: var(--k); box-shadow: 0 3px 0 var(--ink); transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), background .25s; }
.mode-switch[data-kind="practice"] .ms-thumb { transform: translateX(100%); }
#play-hint { flex: 0 1 auto; opacity: 1; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 6px 14px 6px 10px; }
#play-hint::before { content: ''; flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: var(--blue); }
#tab-play[data-kind="practice"] #play-hint::before { background: var(--pink); }
.mode-card .kind-tag { position: absolute; top: 12px; left: 56px; height: 34px; display: flex; align-items: center; padding: 0 12px; background: rgba(255, 255, 255, .95); color: var(--ink); border: 3px solid var(--ink); border-radius: 10px; font-size: 15px; font-weight: 900; 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; }
.leaderboard { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; border: 4px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; margin: 0 7px 7px 0; }
.lb-list { position: relative; flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.lb-row { display: grid; grid-template-columns: 90px 1fr 110px 120px; align-items: center; height: 56px; padding: 0 20px; border-bottom: 3px solid #f0e6c8; font-size: 17px; flex: none; }
.lb-row > :nth-child(3), .lb-row > :nth-child(4) { text-align: right; }
.lb-row.head { background: var(--ink); color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .6px; height: 44px; border-bottom: none; padding-right: 40px; }
.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-games { font-weight: 800; opacity: .6; }
.lb-pts { font: 400 24px 'Lilita One'; color: var(--purple); }
/* My own place, pinned under the list when I'm outside the top 100 (or not rated yet). */
.lb-pin { flex: none; border-top: 4px solid var(--ink); background: #fff3b0; padding-right: 20px; }
.lb-pin .lb-row { border-bottom: none; height: 60px; }
.lb-row.unrated { grid-template-columns: 90px auto 1fr; }
.lb-nudge { text-align: right; font-weight: 900; font-size: 15px; opacity: .75; }
.leaderboard > .empty { flex: 1; }
.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; }
.pp-rating { display: inline-flex; flex-direction: column; align-items: center; margin: clamp(8px, calc(var(--vh) * 1.6), 16px) auto 4px; background: #fff8e1; border: 3px solid var(--ink); border-radius: 14px; padding: 4px 18px 6px; box-shadow: 3px 3px 0 var(--ink); }
.pp-rating span { font: 400 28px 'Lilita One'; color: var(--purple); line-height: 1.1; }
.pp-rating small { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; opacity: .65; }
/* Profile > Stats: private rating and medal breakdown. */
.my-stats { display: grid; gap: 6px; }
.ps-note { font-size: 13px; font-weight: 900; opacity: .6; margin-bottom: 2px; }
.ps-row { display: grid; grid-template-columns: minmax(130px, 1.4fr) minmax(110px, 1fr) repeat(3, 62px) 62px; align-items: center; gap: 6px; padding: 8px 12px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; font-size: 16px; }
.ps-row.head { border: none; background: none; padding: 0 12px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; opacity: .6; }
.ps-row.all { background: #fff3b0; box-shadow: 3px 3px 0 var(--ink); }
.ps-cat { font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-cat b { font: 400 20px 'Lilita One'; margin-right: 4px; }
.ps-rating { font: 400 20px 'Lilita One'; color: var(--purple); display: flex; flex-direction: column; line-height: 1.1; }
.ps-rating small { font: 800 12px 'Nunito'; color: var(--ink); opacity: .6; }
.ps-m { font-weight: 800; }
.ps-tot { font: 400 22px 'Lilita One'; text-align: right; }
.ps-empty { text-align: center; padding: 14px; opacity: .7; font-weight: 800; }
.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 10px 18px 18px; box-shadow: var(--shadow); flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; 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; }

/* Chunky game-style scrollbars for the long option lists. */
/* Chrome ignores the ::-webkit-scrollbar styles when scrollbar-color is set, so only Firefox gets it. */
@supports not selector(::-webkit-scrollbar) { .picker, .shop-grid, .lb-list { scrollbar-color: var(--pink) #fff3b0; } }
.picker::-webkit-scrollbar, .shop-grid::-webkit-scrollbar, .lb-list::-webkit-scrollbar { width: 16px; }
.picker::-webkit-scrollbar-track, .shop-grid::-webkit-scrollbar-track, .lb-list::-webkit-scrollbar-track { background: #fff3b0; border: 3px solid var(--ink); border-radius: 999px; margin: 6px 0; }
.picker::-webkit-scrollbar-thumb, .shop-grid::-webkit-scrollbar-thumb, .lb-list::-webkit-scrollbar-thumb { background: var(--pink); border: 3px solid var(--ink); border-radius: 999px; min-height: 40px; }
.picker::-webkit-scrollbar-thumb:hover, .shop-grid::-webkit-scrollbar-thumb:hover, .lb-list::-webkit-scrollbar-thumb:hover { background: var(--yellow); }
.picker::-webkit-scrollbar-thumb:active, .shop-grid::-webkit-scrollbar-thumb:active, .lb-list::-webkit-scrollbar-thumb:active { background: #ff79b8; }

/* ---------- 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 8px 5px 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.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 26px 'Lilita One'; min-height: 56px; display: grid; place-items: center; max-width: 100%; overflow: hidden; white-space: nowrap; }

/* ---------- 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-who > :first-child { flex: none; transition: scale .35s cubic-bezier(.34, 1.56, .64, 1), margin .35s cubic-bezier(.34, 1.56, .64, 1); }
.lane.lead .lane-who > :first-child { scale: 1.4; margin: 0 10px; }
.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: 880px; 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; }
/* Ranked results: a wide stage. The winner stands big in the middle with their full profile;
   2nd and 3rd flank them. No custom backdrop: the player's own frame, avatar and name effect are the show. */
#screen-results.ranked-res .results-card { width: 1160px; padding: clamp(14px, calc(var(--vh) * 2.4), 28px) 40px clamp(14px, calc(var(--vh) * 2.6), 30px); }
.ranked-res .podium { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 36px; }
.ranked-res .pod.p2 { justify-self: end; }
.ranked-res .pod.p3 { justify-self: start; }
.ranked-res .podium { align-items: center; }
.ranked-res .pod.runner { position: relative; width: 220px; padding: 30px 14px 18px; gap: 2px; background: #fff; border: 4px solid var(--ink); border-radius: 24px; box-shadow: var(--shadow); align-self: center; margin-top: clamp(30px, calc(var(--vh) * 6), 60px); }
.ranked-res .pod.runner.me { background: #fff8d6; }
.ranked-res .pod.runner .avatar-wrap { margin: 4px auto 6px; }
.run-chip { position: absolute; top: -19px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 400 20px 'Lilita One'; padding: 3px 16px 4px; border: 3px solid var(--ink); border-radius: 999px; color: #fff; text-shadow: 0 2px 0 rgba(26,16,51,.35); box-shadow: 0 3px 0 var(--ink); }
.pod.p2 .run-chip { background: #9aa6b8; }
.pod.p3 .run-chip { background: #e0853a; }
.ranked-res .pod .nm { font-size: 20px; max-width: 200px; }
.ranked-res .pod.spot { width: auto; min-width: 320px; gap: 4px; padding: 0; }
.spot-tag { letter-spacing: .1em; }
/* room above for frames that stick out (Royal's crown, Inferno's flames, Math Orbit) */
.spot-av { margin: clamp(46px, calc(var(--vh) * 10), 92px) 0 clamp(12px, calc(var(--vh) * 2.6), 26px); }
.spot-av .avatar-wrap { margin: 0 auto; --size: clamp(150px, calc(var(--vh) * 30), 240px) !important; }
.spot-name { max-width: 100%; }
.ranked-res .pod.spot .spot-name .nm { font-size: clamp(34px, calc(var(--vh) * 6), 50px); max-width: none; overflow: visible; white-space: nowrap; }
.spot-sub { font: 400 20px 'Lilita One'; opacity: .6; }
.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 { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: clamp(12px, calc(var(--vh) * 2.6), 24px); }
.rew-chip { font: 400 clamp(18px, calc(var(--vh) * 3), 22px) 'Lilita One'; padding: 6px 18px 7px; background: #fff3b0; border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 4px 0 var(--ink); }
.rew-none { font: 400 20px 'Lilita One'; opacity: .6; }
.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; }
  .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; }
.lpod { 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); }
.lpod.p1 { height: 150px; background: #ffc300; } .lpod.p2 { height: 110px; background: #a8b4c4; } .lpod.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%)); }
.lstreak { 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; }

/* ---------- Phones: the landing page as a scrolling pitch ---------- */
body.is-mobile, body.is-mobile html { overflow: auto; height: auto; }
html:has(body.is-mobile) { overflow: auto; height: auto; }
body.is-mobile #app { height: auto; min-height: 100vh; }
body.is-mobile #screen-landing { height: auto; min-height: 100vh; overflow: visible; }
body.is-mobile #landing-3d { position: fixed; }
body.is-mobile .land-top { padding: 14px 16px; padding-right: 150px; }
body.is-mobile .land-top .logo { font-size: 24px; }
body.is-mobile .lang-menu { position: absolute; top: 12px; right: 12px; }
body.is-mobile .lang-cur { padding: 6px 10px; font-size: 14px; }
body.is-mobile #land-login { display: none; }
body.is-mobile .land-main { display: flex; flex-direction: column; gap: 28px; padding: 8px 16px 40px; }
body.is-mobile .land-title { font-size: clamp(40px, 12.5vw, 60px); }
body.is-mobile .land-title .line { white-space: normal; }
body.is-mobile .land-sub { font-size: 17px; }
body.is-mobile .land-kicker, body.is-mobile .land-free { white-space: normal; }
body.is-mobile .land-cta { font-size: 22px; width: 100%; justify-content: center; }
body.is-mobile .land-chips { flex-wrap: wrap; }
body.is-mobile .land-show { width: 100%; }
body.is-mobile .land-card { box-shadow: 7px 7px 0 var(--ink); padding: 14px; }
body.is-mobile .slides { height: 360px; }
body.is-mobile .slide-copy h3 { font-size: 24px; white-space: normal; }
body.is-mobile .mini-lane { grid-template-columns: 96px 1fr 32px; font-size: 14px; }
body.is-mobile .practice-vis { font-size: 30px; }
body.is-mobile .pr-a { min-width: 80px; }
body.is-mobile .lpod { width: 74px; }
body.is-mobile .vs-card { font-size: 36px; padding: 10px 12px; }
body.is-mobile .lstreak { font-size: 58px; }
body.is-mobile .cust-ring { width: 120px; height: 120px; font-size: 64px; }

/* ---------- Tablets: keypad beside the race (body.is-tablet is never set on desktop) ---------- */
.keypad[hidden] { display: none; }
body.is-tablet .game-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto minmax(0, 1fr); column-gap: 24px; }
body.is-tablet .arena { grid-column: 1; grid-row: 1; }
body.is-tablet .lanes { grid-column: 1; grid-row: 2; }
body.is-tablet .keypad {
  grid-column: 2; grid-row: 1 / span 2; align-self: center; height: 100%;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 12px;
  max-height: 640px; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.keypad button {
  font: 400 44px 'Lilita One'; color: var(--ink); background: #fff; border: 4px solid var(--ink); border-radius: 18px;
  box-shadow: 0 6px 0 var(--ink); min-height: 64px; cursor: pointer; transition: transform .06s, box-shadow .06s, background .06s;
}
.keypad button.kp-soft { background: #fff3b0; font-size: 36px; }
.keypad button:active, .keypad button.hit { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink); background: var(--cyan); }
/* The question area is narrower next to the keypad: smaller question and answer box so nothing clips. */
body.is-tablet .question, body.is-tablet .answer-input { font-size: clamp(40px, calc(var(--vh) * 8.5), 76px); }
body.is-tablet .question.small { font-size: clamp(34px, calc(var(--vh) * 7), 62px); }
body.is-tablet .answer-input { width: 4em; }
body.is-tablet .qa-row { gap: 16px; }

/* Tablets held upright get a "turn it sideways" card over everything. */
#rotate-note { display: none; position: fixed; inset: 0; z-index: 1000; background: var(--cream, #fff6dc); place-items: center; padding: 24px; text-align: center; }
@media (orientation: portrait) { body.is-tablet #rotate-note { display: grid; } }
.rotate-icon {
  width: 84px; height: 120px; margin: 0 auto 18px; border: 6px solid var(--ink); border-radius: 16px; background: #fff;
  box-shadow: 5px 5px 0 var(--ink); animation: turn 2.2s ease-in-out infinite;
}
@keyframes turn { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
@media (prefers-reduced-motion: reduce) { .rotate-icon { animation: none; transform: rotate(-90deg); } }

/* ---------- First-visit "make it yours" popup ---------- */
.modal.welcome { width: 600px; padding: 0 36px 26px; overflow: hidden; }
.wel-stage {
  position: relative; height: 270px; margin: 0 -36px 6px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 60%, #ff7ac0, #8b5cf6 55%, #3b1d8f); border-bottom: 5px solid var(--ink);
}
.wel-rays {
  position: absolute; width: 900px; height: 900px; left: 50%; top: 60%; margin: -450px 0 0 -450px; opacity: .22;
  background: repeating-conic-gradient(#fff 0 9deg, transparent 9deg 22.5deg);
  -webkit-mask: radial-gradient(closest-side, #000 20%, transparent 70%); mask: radial-gradient(closest-side, #000 20%, transparent 70%);
}
.wel-hero { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 18px; }
.wel-av { perspective: 600px; }
.wel-name { font: 900 26px 'Nunito'; background: #fff; border: 4px solid var(--ink); border-radius: 999px; padding: 2px 18px; box-shadow: 4px 4px 0 var(--ink); }
.wel-name span { display: inline-block; }
.wel-chip {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; display: grid; place-items: center;
  font-size: 28px; background: #fff; border: 4px solid var(--ink); border-radius: 16px; box-shadow: 3px 3px 0 var(--ink);
}
.wel-star { position: absolute; left: 50%; top: 45%; z-index: 4; color: #fff36b; font-size: 20px; pointer-events: none; text-shadow: 0 0 8px #fff; }
.wel-title { font: 400 44px 'Lilita One'; margin: 16px 0 6px; }
.wel-word { display: inline-block; }
.wel-word:nth-child(3n+1) { color: var(--pink); }
.wel-body { font-size: 18px; max-width: 470px; margin: 0 auto !important; }
.wel-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.wel-pill { border: 3px solid var(--ink); border-radius: 999px; padding: 4px 12px; font-size: 15px; background: #fff3b0; }
.wel-pill:nth-child(2) { background: #c7f5ff; } .wel-pill:nth-child(3) { background: #ffd6ea; } .wel-pill:nth-child(4) { background: #d8ffcf; }
.wel-go { position: relative; overflow: hidden; }
.wel-go::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 60px; left: -80px; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: wel-shine 2.6s ease-in-out 1.8s infinite;
}
@keyframes wel-shine { 0% { left: -80px; } 45%, 100% { left: 110%; } }
@media (prefers-reduced-motion: reduce) { .wel-go::after { animation: none; } }

/* =================== Animated frames & names (shop items) =================== */
@property --a { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
@keyframes spinA { to { --a: 360deg; } }

.fx > :not(.avatar) { position: absolute; border-radius: 50%; pointer-events: none; }
.fx > .avatar { z-index: 2; }
/* A ring of thickness --T hugging the avatar (the avatar sits on top, hiding the inner part). */
.ringed { inset: calc(var(--T) * -1);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - var(--T) - var(--size) * .04), #000 calc(100% - var(--T) - var(--size) * .04 + 1px));
          mask: radial-gradient(closest-side, transparent calc(100% - var(--T) - var(--size) * .04), #000 calc(100% - var(--T) - var(--size) * .04 + 1px)); }
.edge { inset: calc(var(--T) * -1); box-shadow: 0 0 0 max(1.5px, calc(var(--size) * .022)) var(--ink); z-index: 1; }

/* ---------- 1. Aurora: flowing colour ring + soft breathing glow ---------- */
.fx.frame-aurora { --T: calc(var(--size) * .085); animation: spinA 5s linear infinite; }
.fx.frame-aurora .ring { z-index: 1; background: conic-gradient(from var(--a), #12d6f0, #6d5cff, #ff3d9a, #ffb21f, #12d6f0); }
.fx.frame-aurora .glow { inset: calc(var(--size) * -.13); z-index: -1; background: conic-gradient(from var(--a), #12d6f0, #6d5cff, #ff3d9a, #ffb21f, #12d6f0);
  filter: blur(calc(var(--size) * .09)); animation: fx-breathe 2.6s ease-in-out infinite alternate; }
.fx.frame-aurora .sheen { inset: calc(var(--T) * -1); z-index: 1; background: conic-gradient(from calc(var(--a) * -2), transparent 0 70%, rgba(255,255,255,.85) 80%, transparent 90%); }
@keyframes fx-breathe { from { opacity: .35; transform: scale(.94); } to { opacity: .85; transform: scale(1.06); } }

/* ---------- 2. Comet: two light trails chasing round a dark ring ---------- */
.fx.frame-comet { --T: calc(var(--size) * .075); animation: spinA 2.4s cubic-bezier(.45, .05, .55, .95) infinite; }
.fx.frame-comet .ring { z-index: 0; background: #241848; }
.fx.frame-comet .tail { z-index: 1;
  background:
    conic-gradient(from var(--a), transparent 0 52%, rgba(18,214,240,.12) 62%, #12d6f0 93%, #e8fdff 99.5%, transparent 99.6%),
    conic-gradient(from calc(var(--a) + 180deg), transparent 0 52%, rgba(255,61,154,.12) 62%, #ff3d9a 93%, #fff0f7 99.5%, transparent 99.6%); }
.fx.frame-comet .halo { inset: calc(var(--size) * -.2); z-index: -1; filter: blur(calc(var(--size) * .06)); }
.fx.frame-comet .halo i { position: absolute; inset: 0; border-radius: 50%;
  background:
    conic-gradient(from var(--a), transparent 0 70%, #12d6f0 97%, transparent 100%),
    conic-gradient(from calc(var(--a) + 180deg), transparent 0 70%, #ff3d9a 97%, transparent 100%);
  -webkit-mask: radial-gradient(closest-side, transparent 62%, #000 66%, #000 90%, transparent 100%);
          mask: radial-gradient(closest-side, transparent 62%, #000 66%, #000 90%, transparent 100%); }
.fx.frame-comet .heads { inset: calc(var(--T) * -1); z-index: 3; transform: rotate(var(--a)); }
.fx.frame-comet .heads::before, .fx.frame-comet .heads::after { content: ''; position: absolute; left: 50%; width: calc(var(--T) * 1.25); height: calc(var(--T) * 1.25);
  margin-left: calc(var(--T) * -.625); border-radius: 50%; background: #fff; }
.fx.frame-comet .heads::before { top: calc(var(--T) * -.12); box-shadow: 0 0 calc(var(--size) * .06) calc(var(--size) * .02) #12d6f0; }
.fx.frame-comet .heads::after { bottom: calc(var(--T) * -.12); box-shadow: 0 0 calc(var(--size) * .06) calc(var(--size) * .02) #ff3d9a; }

/* ---------- 3. Inferno: real rising flames behind the avatar + embers ---------- */
.fx.frame-inferno { --T: calc(var(--size) * .07); }
.fx.frame-inferno .heat { inset: calc(var(--size) * -.18); z-index: -2; background: radial-gradient(closest-side, rgba(255,120,0,.65), rgba(255,60,0,.25) 60%, transparent);
  filter: blur(calc(var(--size) * .05)); animation: heat 1.7s ease-in-out infinite alternate; }
@keyframes heat { from { opacity: .55; transform: scale(.96); } to { opacity: 1; transform: scale(1.06) translateY(calc(var(--size) * -.03)); } }
.fx.frame-inferno .flames { inset: 0; z-index: -1; border-radius: 0; overflow: visible; }
.fx.frame-inferno .ring { z-index: 1; background: conic-gradient(from 200deg, #ff2d00, #ff8a1f, #ffd60a, #ff8a1f, #ff2d00, #ff8a1f, #ffd60a, #ff2d00); animation: flicker 2.1s steps(1) infinite; }
.fx.frame-inferno .embers { inset: 0; z-index: 3; border-radius: 0; overflow: visible; }
@keyframes flicker { 0%, 100% { filter: brightness(1); } 23% { filter: brightness(1.2); } 41% { filter: brightness(.92); } 67% { filter: brightness(1.15); } 82% { filter: brightness(1); } }
.flayer { position: absolute; inset: 0; filter: url(#goo-l); }
.fx.lite .flayer { filter: url(#goo-s); }
.flayer.r { color: #ff3a00; } .flayer.o { color: #ff9a00; } .flayer.y { color: #ffe45c; }
.fl { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--w); margin: calc(var(--w) / -2) 0 0 calc(var(--w) / -2);
  border-radius: 50%; background: currentColor;
  animation: rise var(--dur) cubic-bezier(.35, .1, .7, 1) var(--del) infinite; will-change: transform; }
@keyframes rise {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(var(--dx), calc(var(--size) * var(--up) * -1)) scale(0); }
}
.em { position: absolute; left: var(--x); top: var(--y); width: max(2px, calc(var(--size) * .028)); height: max(2px, calc(var(--size) * .028)); border-radius: 50%;
  background: #ffd23f; box-shadow: 0 0 calc(var(--size) * .03) calc(var(--size) * .015) #ff5a00;
  animation: ember var(--dur) ease-out var(--del) infinite; opacity: 0; }
@keyframes ember {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: 1; }
  60% { transform: translate(calc(var(--dx) * .6), calc(var(--size) * -.45)); }
  100% { transform: translate(var(--dx), calc(var(--size) * -.85)); opacity: 0; }
}

/* ---------- 4. Royal: polished gold ring, shine sweep, crown, twinkles ---------- */
@property --sh { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
@keyframes shine { 0% { --sh: -40deg; } 55%, 100% { --sh: 320deg; } }
.fx.frame-royal { --T: calc(var(--size) * .085); animation: shine 3.2s cubic-bezier(.6, 0, .3, 1) infinite; }
.fx.frame-royal .ring { z-index: 1; background: conic-gradient(from 20deg, #fff2b3, #ffc400, #a86f00, #ffd84d, #fff6cf, #d99a00, #ffe27a, #a86f00, #fff2b3); }
.fx.frame-royal .shine { z-index: 1; background: conic-gradient(from var(--sh), transparent 0 84%, rgba(255,255,255,.95) 91%, transparent 98%); }
.fx.frame-royal .crown { inset: auto; border-radius: 0; z-index: 4; width: calc(var(--size) * .58); left: calc(var(--size) * .21); top: calc(var(--size) * -.33);
  transform-origin: 50% 100%; animation: crown 3.2s ease-in-out infinite; filter: drop-shadow(0 calc(var(--size) * .018) 0 rgba(26,16,51,.3)); }
.fx.frame-royal .crown svg { display: block; width: 100%; overflow: visible; }
@keyframes crown { 0%, 100% { transform: rotate(-7deg) translateY(0); } 50% { transform: rotate(-3deg) translateY(calc(var(--size) * -.035)); } }
.tw { position: absolute; z-index: 5; width: var(--w); height: var(--w); left: var(--x); top: var(--y); margin: calc(var(--w) / -2) 0 0 calc(var(--w) / -2);
  animation: twinkle 2.4s ease-in-out var(--del) infinite; transform: scale(0); }
.tw svg { display: block; width: 100%; height: 100%; overflow: visible; }
@keyframes twinkle { 0%, 55%, 100% { transform: scale(0) rotate(0); } 70% { transform: scale(1) rotate(45deg); } 85% { transform: scale(.2) rotate(90deg); } }

/* ---------- 5. Orbit: maths symbols orbiting in 3D, passing behind the head ---------- */
.fx.frame-orbit { --T: calc(var(--size) * .05); isolation: auto; transform-style: preserve-3d; perspective: calc(var(--size) * 5); animation: spinA 7s linear infinite; }
.fx.frame-orbit > .avatar { transform: translateZ(0); box-shadow: 0 0 0 calc(var(--size) * .04) #8b5cf6, 0 0 0 calc(var(--size) * .062) var(--ink), 0 0 calc(var(--size) * .14) calc(var(--size) * .02) rgba(139,92,246,.55); }
.fx.frame-orbit.lite .sym { transform: rotateZ(calc(var(--a) + var(--o))) translateX(calc(var(--size) * .72)) rotateZ(calc((var(--a) + var(--o)) * -1)) rotateY(12deg) rotateX(-72deg); }
.fx.frame-orbit.lite .plane { inset: calc(var(--size) * -.22); }
.fx.frame-orbit .plane { inset: calc(var(--size) * -.34); transform-style: preserve-3d; transform: rotateX(72deg) rotateY(-12deg); }
.fx.frame-orbit .track { position: absolute; inset: 0; border-radius: 50%; border: max(1.5px, calc(var(--size) * .018)) dashed rgba(139,92,246,.6); }
.fx.frame-orbit .sym { position: absolute; left: 50%; top: 50%; width: calc(var(--size) * .26); height: calc(var(--size) * .26); margin: calc(var(--size) * -.13) 0 0 calc(var(--size) * -.13);
  border-radius: 30%; background: var(--c); border: max(1.5px, calc(var(--size) * .022)) solid var(--ink);
  display: grid; place-items: center; font: 400 calc(var(--size) * .19) / 1 'Lilita One'; color: #fff;
  -webkit-text-stroke: max(1px, calc(var(--size) * .012)) var(--ink); paint-order: stroke fill;
  transform: rotateZ(calc(var(--a) + var(--o))) translateX(calc(var(--size) * .84)) rotateZ(calc((var(--a) + var(--o)) * -1)) rotateY(12deg) rotateX(-72deg); }

/* ---------- 6. Cyber: HUD rings, RGB split, glitch bursts ---------- */
@keyframes glitchJump {
  0%, 88%, 100% { transform: none; clip-path: none; }
  89% { transform: translate(calc(var(--size) * .04), 0); clip-path: inset(10% 0 55% 0); }
  91% { transform: translate(calc(var(--size) * -.05), 0); clip-path: inset(60% 0 8% 0); }
  93% { transform: translate(calc(var(--size) * .03), 0); clip-path: inset(30% 0 40% 0); }
  95% { transform: translate(calc(var(--size) * -.02), 0); clip-path: inset(0 0 80% 0); }
}
.fx.frame-cyber { --T: calc(var(--size) * .055); animation: spinA 9s linear infinite; }
.fx.frame-cyber .ring { z-index: 1; background: conic-gradient(from 90deg, #12d6f0, #6d5cff, #ff3d9a, #6d5cff, #12d6f0); }
.fx.frame-cyber .rgbA, .fx.frame-cyber .rgbB { z-index: 0; background: #12d6f0; animation: rgb 3s steps(1) infinite; }
.fx.frame-cyber .rgbB { background: #ff3d9a; animation-delay: -.05s; }
@keyframes rgb { 0%, 87%, 97%, 100% { transform: none; opacity: 0; } 88% { transform: translate(calc(var(--size) * -.05), calc(var(--size) * .01)); opacity: .9; } 92% { transform: translate(calc(var(--size) * .04), calc(var(--size) * -.02)); opacity: .9; } }
.fx.frame-cyber .rgbB { animation-name: rgbB; }
@keyframes rgbB { 0%, 87%, 97%, 100% { transform: none; opacity: 0; } 88% { transform: translate(calc(var(--size) * .05), 0); opacity: .9; } 92% { transform: translate(calc(var(--size) * -.04), calc(var(--size) * .02)); opacity: .9; } }
.fx.frame-cyber .ticks { --T: calc(var(--size) * .04); inset: calc(var(--size) * -.17); z-index: 1;
  background: repeating-conic-gradient(from var(--a), #12d6f0 0 6deg, transparent 6deg 15deg);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - var(--T)), #000 calc(100% - var(--T) + 1px));
          mask: radial-gradient(closest-side, transparent calc(100% - var(--T)), #000 calc(100% - var(--T) + 1px)); opacity: .9; }
.fx.frame-cyber .arcs { --T: calc(var(--size) * .028); inset: calc(var(--size) * -.25); z-index: 1;
  background: conic-gradient(from calc(var(--a) * -2), #ff3d9a 0 50deg, transparent 50deg 180deg, #ff3d9a 180deg 230deg, transparent 230deg);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - var(--T)), #000 calc(100% - var(--T) + 1px));
          mask: radial-gradient(closest-side, transparent calc(100% - var(--T)), #000 calc(100% - var(--T) + 1px));
  filter: drop-shadow(0 0 calc(var(--size) * .03) #ff3d9a); }
.fx.frame-cyber .glowc { inset: calc(var(--size) * -.1); z-index: -1; background: radial-gradient(closest-side, rgba(18,214,240,.55), transparent); filter: blur(calc(var(--size) * .05)); }
.fx.frame-cyber > .avatar { animation: glitchJump 3s steps(1) infinite; }
.fx.frame-cyber .ghost { inset: 0; z-index: 3; border-radius: 50%; display: grid; place-items: center; overflow: hidden; font-size: calc(var(--size) * .58); line-height: 1;
  border: max(2px, calc(var(--size) * .03)) solid transparent; mix-blend-mode: screen; opacity: 0; animation: ghost 3s steps(1) infinite; }
.fx.frame-cyber .ghost.g1 { color: transparent; text-shadow: calc(var(--size) * -.04) 0 0 #12d6f0; }
.fx.frame-cyber .ghost.g2 { color: transparent; text-shadow: calc(var(--size) * .04) 0 0 #ff3d9a; animation-delay: -.06s; }
@keyframes ghost { 0%, 87%, 96%, 100% { opacity: 0; clip-path: none; } 88% { opacity: 1; clip-path: inset(20% 0 50% 0); } 91% { opacity: 1; clip-path: inset(55% 0 15% 0); } 94% { opacity: 1; clip-path: inset(5% 0 75% 0); } }

/* ===================================================================
   NAMES
   =================================================================== */
.fxn { position: relative; display: inline-block; white-space: nowrap; line-height: 1.15; }
.fxn-ink { filter: drop-shadow(.05em .06em 0 var(--ink)); }

/* 1. Aurora flow */
.fxn-aurora { background: linear-gradient(90deg, #0bb5d6, #6d4dff, #ff2e88, #ff8a1f, #0bb5d6) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: flow 4s linear infinite; }
@keyframes flow { to { background-position: 150% 0; } }

/* 2. Chrome with shine sweep */
.fxn-chrome { background:
    linear-gradient(105deg, transparent 42%, rgba(255,255,255,.95) 50%, transparent 58%) -150% 0 / 200% 100% no-repeat,
    linear-gradient(180deg, #ffffff 0%, #c9d3e0 38%, #6d7a92 52%, #b9c4d4 70%, #eef2f8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: sweep 3s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes sweep { 0% { background-position: -150% 0, 0 0; } 60%, 100% { background-position: 250% 0, 0 0; } }

/* 3. Inferno */
.fxn-inferno { background: linear-gradient(0deg, #e81e00, #ff6a00 30%, #ffb21f 55%, #fff1a8 75%, #ff6a00 100%) 0 0 / 100% 300%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: burn 1.6s linear infinite; }
@keyframes burn { to { background-position: 0 -150%; } }
.fxn-inferno-wrap { position: relative; display: inline-block; filter: drop-shadow(.05em .06em 0 var(--ink)) drop-shadow(0 0 .18em rgba(255,90,0,.55)); }


/* 4. Glitch */
.fxn-glitch { color: var(--ink); }
.fxn-glitch::before, .fxn-glitch::after { content: attr(data-text); position: absolute; inset: 0; opacity: 0; }
.fxn-glitch::before { color: #12d6f0; animation: gA 2.8s steps(1) infinite; }
.fxn-glitch::after { color: #ff3d9a; animation: gB 2.8s steps(1) infinite; }
@keyframes gA { 0%, 85%, 97%, 100% { opacity: 0; transform: none; clip-path: none; } 86% { opacity: 1; transform: translate(-.06em, 0); clip-path: inset(0 0 55% 0); } 90% { opacity: 1; transform: translate(.05em, 0); clip-path: inset(60% 0 0 0); } 94% { opacity: 1; transform: translate(-.03em, 0); clip-path: inset(35% 0 30% 0); } }
@keyframes gB { 0%, 85%, 97%, 100% { opacity: 0; transform: none; clip-path: none; } 87% { opacity: 1; transform: translate(.06em, 0); clip-path: inset(45% 0 10% 0); } 91% { opacity: 1; transform: translate(-.05em, 0); clip-path: inset(0 0 70% 0); } 95% { opacity: 1; transform: translate(.03em, 0); clip-path: inset(70% 0 0 0); } }
.fxn-glitch { animation: gMain 2.8s steps(1) infinite; }
@keyframes gMain { 0%, 85%, 97%, 100% { transform: none; } 88% { transform: translate(.02em, 0) skewX(-8deg); } 92% { transform: translate(-.02em, 0); } }

/* 5. Wave */
.fxn-wave span { display: inline-block; animation: wave 1.8s ease-in-out infinite; animation-delay: calc(var(--i) * -.09s);
  color: hsl(calc(320 - var(--i) * 14), 90%, 58%); }
@keyframes wave { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-.16em) rotate(-4deg); } 50% { transform: translateY(0); } }

/* 6. Starlight gold */
.fxn-star-wrap { position: relative; display: inline-block; }
.fxn-star { background: linear-gradient(100deg, #ffe680 0%, #ffc400 25%, #d48800 45%, #fff3b0 55%, #ffc400 75%, #ffe680 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: flow 3.5s linear infinite; }
.fxn-star-wrap .tw { z-index: 2; }


.fxn-sparks { position: absolute; inset: 0; pointer-events: none; }
.fxn-sparks .em { --size: 1.6em; }
.fxn-sparks .tw { --size: 1em; }
/* Players who asked their system for less motion get the still version. */
@media (prefers-reduced-motion: reduce) {
  .fx, .fx *, .fxn, .fxn *, .fxn::before, .fxn::after, .tw { animation: none !important; }
  .fl, .em { display: none; }
}

/* =================== Dark set =================== */
/* Venom: black ring with a toxic green current and drips */
.fx.frame-venom { --T: calc(var(--size) * .085); animation: spinA 3s linear infinite; }
.fx.frame-venom .ring { z-index: 1; background: conic-gradient(from var(--a), #050805, #0f2a12, #39ff14, #b6ff00 8%, #0f2a12 18%, #050805 40%, #0f2a12 60%, #39ff14 75%, #050805 90%); }
.fx.frame-venom .glow { inset: calc(var(--size) * -.16); z-index: -1; background: radial-gradient(closest-side, rgba(57,255,20,.85) 55%, rgba(57,255,20,0) 100%);
  filter: blur(calc(var(--size) * .04)); animation: fx-breathe 1.6s ease-in-out infinite alternate; }
.fx.frame-venom .drips { inset: 0; z-index: 3; border-radius: 0; }
.dr { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: calc(var(--w) * 1.6); margin-left: calc(var(--w) / -2);
  border-radius: 50% 50% 50% 50% / 35% 35% 65% 65%; background: radial-gradient(circle at 40% 70%, #d9ff7a, #39ff14 45%, #0b8f00);
  border: max(1px, calc(var(--size) * .012)) solid #0a1a05; box-shadow: 0 0 calc(var(--size) * .04) #39ff14; transform-origin: 50% 0; animation: drip var(--dur) cubic-bezier(.5, 0, .9, .6) var(--del) infinite; opacity: 0; }
@keyframes drip {
  0% { transform: scale(.2, 0); opacity: 0; } 10% { opacity: 1; }
  45% { transform: scale(1, 1); opacity: 1; }
  100% { transform: translateY(calc(var(--size) * .45)) scale(.6, .9); opacity: 0; }
}

/* Void Flame: the Inferno engine with black-violet fire */
.fx.frame-voidfire { --T: calc(var(--size) * .07); }
.fx.frame-voidfire .heat { inset: calc(var(--size) * -.18); z-index: -2; background: radial-gradient(closest-side, rgba(120,0,255,.6), rgba(40,0,90,.3) 60%, transparent);
  filter: blur(calc(var(--size) * .05)); animation: heat 1.7s ease-in-out infinite alternate; }
.fx.frame-voidfire .flames { inset: 0; z-index: -1; border-radius: 0; overflow: visible; }
.fx.frame-voidfire .flayer.r { color: #3a0088; } .fx.frame-voidfire .flayer.o { color: #8a2be2; } .fx.frame-voidfire .flayer.y { color: #e6ccff; }
.fx.frame-voidfire .ring { z-index: 1; background: conic-gradient(from 200deg, #0a0014, #4b00b3, #b47cff, #4b00b3, #0a0014, #4b00b3, #b47cff, #0a0014); animation: flicker 2.1s steps(1) infinite; }
.fx.frame-voidfire .embers { inset: 0; z-index: 3; border-radius: 0; overflow: visible; }
.fx.frame-voidfire .em { background: #e3ccff; box-shadow: 0 0 calc(var(--size) * .03) calc(var(--size) * .015) #7a00ff; }

/* Thunder: storm ring with lightning bolts striking at random */
.fx.frame-thunder { --T: calc(var(--size) * .075); animation: spinA 1.2s linear infinite; }
.fx.frame-thunder .ring { z-index: 1; background: conic-gradient(from 30deg, #070b1f, #13235e, #070b1f, #1c3a8f, #070b1f); box-shadow: 0 0 calc(var(--size) * .08) rgba(54,184,255,.6); }
.fx.frame-thunder .spark { z-index: 1; background: conic-gradient(from var(--a), transparent 0 80%, #36b8ff 92%, #fff 97%, transparent 98%); }
.fx.frame-thunder .flash { inset: calc(var(--size) * -.16); z-index: -1; background: radial-gradient(closest-side, rgba(80,190,255,.85), transparent 75%);
  filter: blur(calc(var(--size) * .04)); opacity: 0; animation: storm 2.2s steps(1) infinite; }
@keyframes storm { 0%, 100% { opacity: 0; } 8% { opacity: .9; } 11% { opacity: .1; } 14% { opacity: .7; } 20% { opacity: 0; } 52% { opacity: .8; } 56% { opacity: 0; } }
.fx.frame-thunder .bolt { inset: auto; border-radius: 0; z-index: 3; left: 50%; top: 50%; width: calc(var(--size) * .26); height: calc(var(--size) * .5);
  margin: calc(var(--size) * -.25) 0 0 calc(var(--size) * -.13);
  transform: rotate(var(--r)) translateY(calc(var(--size) * -.68)) rotate(12deg); opacity: 0; animation: strike 2.2s steps(1) var(--del) infinite;
  filter: drop-shadow(0 0 calc(var(--size) * .03) #36b8ff); }
.fx.frame-thunder .bolt svg { display: block; width: 100%; height: 100%; }
@keyframes strike { 0%, 100% { opacity: 0; } 8% { opacity: 1; } 11% { opacity: .2; } 14% { opacity: 1; } 22% { opacity: 0; } }

/* Reaper: black ring, red arcs hunting round it, skull sticker */
.fx.frame-reaper { --T: calc(var(--size) * .08); animation: spinA 2.6s cubic-bezier(.6, 0, .4, 1) infinite; }
.fx.frame-reaper .ring { z-index: 1; background: conic-gradient(from 0deg, #0b0b0b, #2a0a0e, #0b0b0b, #2a0a0e, #0b0b0b); }
.fx.frame-reaper .arcs2 { z-index: 1; background: conic-gradient(from var(--a), #ff1f3d 0 18%, transparent 18% 50%, #ff1f3d 50% 68%, transparent 68%);
  filter: drop-shadow(0 0 calc(var(--size) * .04) #ff1f3d); }
.fx.frame-reaper .glow { inset: calc(var(--size) * -.12); z-index: -1; background: radial-gradient(closest-side, rgba(255,20,50,.55), transparent 75%);
  filter: blur(calc(var(--size) * .04)); animation: fx-breathe 1.1s ease-in-out infinite alternate; }
.fx.frame-reaper .skull { inset: auto; border-radius: 0; z-index: 4; right: calc(var(--size) * -.12); bottom: calc(var(--size) * -.08); font-size: calc(var(--size) * .34); line-height: 1;
  filter: drop-shadow(0 0 calc(var(--size) * .03) #ff1f3d) drop-shadow(calc(var(--size) * .015) calc(var(--size) * .02) 0 #1a1033); animation: wobble 2.4s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(8deg) scale(1.08); } }

/* GG: carbon-fibre ring with a neon line and a GG sticker */
.fx.frame-gg { --T: calc(var(--size) * .085); animation: spinA 4s linear infinite; }
.fx.frame-gg .ring { z-index: 1; background:
    repeating-linear-gradient(45deg, #1c1c22 0 3px, #2c2c36 3px 6px),
    #1c1c22; }
.fx.frame-gg .line { --T: calc(var(--size) * .03); z-index: 1; background: conic-gradient(from var(--a), #12d6f0, #ff3d9a, #12d6f0); }
.fx.frame-gg .sticker { inset: auto; border-radius: calc(var(--size) * .07); z-index: 4; right: calc(var(--size) * -.16); top: calc(var(--size) * -.08);
  padding: calc(var(--size) * .02) calc(var(--size) * .07); font: 400 calc(var(--size) * .2) / 1 'Lilita One'; color: #fff;
  background: linear-gradient(135deg, #ff3d9a, #8b5cf6); border: max(1.5px, calc(var(--size) * .022)) solid #1a1033;
  box-shadow: calc(var(--size) * .02) calc(var(--size) * .02) 0 #1a1033; -webkit-text-stroke: max(1px, calc(var(--size) * .01)) #1a1033; paint-order: stroke fill;
  animation: stick 3s cubic-bezier(.2, 1.6, .4, 1) infinite; }
@keyframes stick { 0%, 70%, 100% { transform: rotate(12deg) scale(1); } 78% { transform: rotate(-6deg) scale(1.25); } 86% { transform: rotate(14deg) scale(.95); } }

/* Sheesh: black and gold with a SHEESH banner */
@keyframes shine2 { 0% { --sh: -40deg; } 55%, 100% { --sh: 320deg; } }
.fx.frame-sheesh { --T: calc(var(--size) * .085); animation: shine2 2.8s cubic-bezier(.6, 0, .3, 1) infinite; }
.fx.frame-sheesh .ring { z-index: 1; background: conic-gradient(from 0deg, #0b0b0b, #3a2a00, #ffc400, #3a2a00, #0b0b0b, #3a2a00, #ffd84d, #3a2a00, #0b0b0b); }
.fx.frame-sheesh .shine { z-index: 1; background: conic-gradient(from var(--sh), transparent 0 84%, rgba(255,255,255,.95) 91%, transparent 98%); }
.fx.frame-sheesh .glow { inset: calc(var(--size) * -.1); z-index: -1; background: radial-gradient(closest-side, rgba(255,196,0,.45), transparent 75%); filter: blur(calc(var(--size) * .04)); }
.fx.frame-sheesh .banner { inset: auto; border-radius: calc(var(--size) * .05); z-index: 4; left: 50%; bottom: calc(var(--size) * -.14); transform: translateX(-50%) rotate(-4deg);
  padding: calc(var(--size) * .015) calc(var(--size) * .06); font: 400 calc(var(--size) * .15) / 1.1 'Lilita One'; letter-spacing: .04em; color: #1a1033; white-space: nowrap;
  background: linear-gradient(180deg, #fff2a8, #ffc400 55%, #d99a00); border: max(1.5px, calc(var(--size) * .02)) solid #1a1033;
  box-shadow: calc(var(--size) * .015) calc(var(--size) * .02) 0 #1a1033; animation: hype 1.4s ease-in-out infinite; }
@keyframes hype { 0%, 100% { transform: translateX(-50%) rotate(-4deg) scale(1); } 50% { transform: translateX(-50%) rotate(2deg) scale(1.08); } }

/* ---- Dark names ---- */
.fxn-toxic { background: linear-gradient(90deg, #1fd400, #b6ff00, #39ff14, #00b84a, #1fd400) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: flow 3s linear infinite;
  filter: drop-shadow(.05em .06em 0 #0a1a05) drop-shadow(0 0 .14em rgba(57,255,20,.75)); }
.fxn-blackout { color: #0d0d10; animation: blackout 1.8s ease-in-out infinite alternate; }
@keyframes blackout { from { text-shadow: 0 0 .08em #ff1f3d, 0 0 .2em rgba(255,31,61,.5); } to { text-shadow: 0 0 .14em #ff1f3d, 0 0 .45em rgba(255,31,61,.8); } }
.fxn-electric { color: #e6f7ff; animation: neonfail 3.2s steps(1) infinite;
  text-shadow: -.045em 0 #0b2a5a, .045em 0 #0b2a5a, 0 -.045em #0b2a5a, 0 .045em #0b2a5a, .05em .07em 0 #0b2a5a, 0 0 .25em #36b8ff, 0 0 .5em #36b8ff; }
@keyframes neonfail { 0%, 100% { opacity: 1; } 61% { opacity: .35; } 63% { opacity: 1; } 66% { opacity: .5; } 68% { opacity: 1; } 90% { opacity: .7; } 91% { opacity: 1; } }
.fxn-shadow { background:
    linear-gradient(105deg, transparent 42%, rgba(190,130,255,.95) 50%, transparent 58%) -150% 0 / 200% 100% no-repeat,
    linear-gradient(180deg, #6b6b80 0%, #2a2a35 45%, #0b0b10 55%, #3c3c4a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: sweep 2.8s cubic-bezier(.6, 0, .3, 1) infinite; }

/* ---- Slang tags ---- */
.fxn-tag { display: inline-block; margin-left: .35em; padding: .06em .4em .02em; vertical-align: .12em; border-radius: .4em;
  font: 400 .62em/1.1 'Lilita One'; letter-spacing: .03em; border: .12em solid #1a1033; box-shadow: .1em .12em 0 #1a1033; white-space: nowrap;
  animation: tagpop 3.2s cubic-bezier(.2, 1.6, .4, 1) infinite; transform-origin: 50% 80%; }
@keyframes tagpop { 0%, 75%, 100% { transform: rotate(-6deg) scale(1); } 82% { transform: rotate(4deg) scale(1.22); } 90% { transform: rotate(-8deg) scale(.96); } }
.tag-goat { background: linear-gradient(180deg, #fff2a8, #ffc400); color: #1a1033; }
.tag-nocap { background: #111; color: #fff; }
.tag-ez { background: #39ff14; color: #0a1a05; }
@media (prefers-reduced-motion: reduce) { .dr, .fx .bolt { display: none; } .fxn-tag { animation: none; } }

/* Practice results: stat tiles */
.pstats-head { font: 400 22px 'Lilita One'; margin-bottom: 4px; }
.pstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pstat { display: grid; justify-items: center; gap: 2px; padding: clamp(8px, calc(var(--vh) * 1.6), 14px) 8px; border: 3px solid var(--ink); border-radius: 18px; background: #fff8e1; box-shadow: 4px 4px 0 var(--ink); }
.pstat:nth-child(2) { background: #e6f9ff; } .pstat:nth-child(3) { background: #ffe6f2; } .pstat:nth-child(4) { background: #fff0d9; } .pstat:nth-child(5) { background: #eaffe0; } .pstat:nth-child(6) { background: #f1e8ff; }
.pstat-i { font-size: 24px; line-height: 1; }
.pstat b { font: 400 clamp(26px, calc(var(--vh) * 4.6), 38px) 'Lilita One'; line-height: 1.05; }
.pstat span:last-child { font-size: 14px; opacity: .7; }

/* ---------- Stickers: dock (queue + results) and stamps ---------- */
.stk-dock { position: absolute; right: 24px; bottom: 22px; z-index: 70; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.stk-btn { position: relative; overflow: hidden; display: flex; align-items: center; gap: 8px; font: 400 20px 'Lilita One'; color: var(--ink); background: #fff; border: 4px solid var(--ink); border-radius: 999px; padding: 8px 20px 9px 14px; box-shadow: var(--shadow); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.stk-btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.stk-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.stk-btn[aria-expanded="true"] { background: #fff3b0; }
.stk-btn-i { font-size: 24px; line-height: 1; }
.stk-cd { position: absolute; left: 0; bottom: 0; height: 5px; width: 100%; background: var(--pink); transform-origin: 0 50%; transform: scaleX(0); }
@keyframes stk-cd { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.stk-tray { display: grid; grid-template-columns: repeat(4, 76px); gap: 6px; padding: 12px; max-height: 340px; overflow-y: auto; background: #fff; border: 4px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow-lg); transform-origin: 100% 100%; animation: stk-tray .22s cubic-bezier(.34, 1.56, .64, 1); }
.stk-tray.hidden { display: none; }
@keyframes stk-tray { from { transform: scale(.6) translateY(20px); opacity: 0; } }
.stk-pick { width: 76px; height: 76px; padding: 6px; border: 0; border-radius: 16px; background: transparent; cursor: pointer; transition: transform .15s cubic-bezier(.34, 1.56, .64, 1), background .15s, opacity .2s; }
.stk-pick:hover { background: #fff3b0; transform: scale(1.12) rotate(-4deg); }
.stk-pick:active { transform: scale(.92); }
.stk-pick img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.stk-dock.cooling .stk-pick { opacity: .4; filter: grayscale(.6); }
.stk-layer { position: absolute; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.stk-stamp { position: absolute; width: 128px; display: grid; justify-items: center; gap: 4px; transform: translate(-50%, -50%) rotate(var(--rot)); animation: stk-stamp 3.4s cubic-bezier(.2, .8, .3, 1) forwards; will-change: transform, opacity; }
.stk-stamp img { width: 128px; height: 128px; object-fit: contain; filter: drop-shadow(0 6px 0 rgba(26, 16, 51, .22)); }
.stk-from { font: 400 16px 'Lilita One'; background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 1px 12px 2px; white-space: nowrap; box-shadow: 0 3px 0 var(--ink); max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.stk-stamp.mine .stk-from { background: #fff3b0; }
@keyframes stk-stamp {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--rot)) scale(2.6); }
  9% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--rot)) scale(.86); }
  14% { transform: translate(-50%, -50%) rotate(var(--rot)) scale(1.08); }
  19%, 86% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--rot)) scale(1); }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 18px)) rotate(var(--rot)) scale(.85); }
}
@media (prefers-reduced-motion: reduce) {
  .stk-stamp { animation-name: stk-stamp-calm; }
  @keyframes stk-stamp-calm { 0%, 100% { opacity: 0; } 8%, 88% { opacity: 1; } }
}

/* Illustrated avatar personas: the art is transparent, so the chosen background still shows. */
.avatar.has-img { overflow: hidden; }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; transform: scale(1.08) translateY(4%); }
.ghost img { width: 100%; height: 100%; border-radius: 50%; }

/* Stickers v2: brighter dock button with sticker art, captions (in the viewer's language) */
.stk-btn {
  color: #fff; background: linear-gradient(135deg, var(--pink), var(--purple)); padding: 5px 20px 5px 5px; gap: 10px;
  font-size: 22px; text-shadow: 2px 2px 0 var(--ink); box-shadow: var(--shadow-lg);
}
.stk-btn:hover { transform: translate(-2px, -3px) rotate(-1.5deg); box-shadow: 9px 10px 0 var(--ink); }
.stk-btn[aria-expanded="true"] { background: linear-gradient(135deg, var(--purple), var(--blue)); }
.stk-btn-i { width: 52px; height: 52px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--ink); display: grid; place-items: center; overflow: hidden; font-size: 28px; text-shadow: none; }
.stk-btn-i img { width: 48px; height: 48px; animation: stk-wiggle 3.2s ease-in-out infinite; }
.stk-btn:hover .stk-btn-i img { animation: none; transform: rotate(-14deg) scale(1.12); }
@keyframes stk-wiggle { 0%, 82%, 100% { transform: none; } 86% { transform: rotate(-12deg) scale(1.08); } 92% { transform: rotate(10deg) scale(1.08); } }
.stk-tray { grid-template-columns: repeat(5, 84px); max-height: min(430px, calc(var(--vh) * 62)); }
.stk-pick { width: 84px; height: auto; padding: 4px 2px; display: grid; justify-items: center; gap: 2px; }
.stk-pick img { width: 68px; height: 68px; }
.stk-cap { font-size: 11px; line-height: 1.15; min-height: 2.3em; display: flex; align-items: center; text-align: center; color: var(--ink); }
.stk-say { font: 400 22px 'Lilita One'; color: #fff; text-shadow: 2px 2px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink); margin-top: -10px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .stk-btn-i img { animation: none; } }

/* Logo (kie art, art/brand): image wordmark replaces the text logo */
.logo-img { display: block; height: 62px; width: auto; margin: -10px 0; }
.logo.big .logo-img { height: clamp(84px, calc(var(--vh) * 15), 140px); margin: 0 auto; filter: drop-shadow(4px 4px 0 rgba(26, 16, 51, .18)); }
