:root {
  --ink: #0b0b2b;
  --ink-2: #1b1050;
  --magenta: #ff2bd6;
  --violet: #7a3cff;
  --cyan: #22e4ff;
  --gold: #ffd84d;
  --red: #ff3b5c;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.68);
  --glass: rgba(24, 12, 62, 0.46);
  --glass-strong: rgba(18, 9, 48, 0.72);
  --stroke: rgba(255, 255, 255, 0.16);
  --radius: 26px;
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-bottom, 0px));
  --ease: cubic-bezier(0.2, 0.9, 0.25, 1.15);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--text); font-family: var(--body); overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.ic { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: middle; }
.c-gold { color: var(--gold); }

#app { position: fixed; inset: 0; overflow: hidden; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.reel-live { display: none; }

.screen { position: absolute; inset: 0; display: none; padding: calc(var(--safe-top) + 14px) 16px calc(var(--safe-bottom) + 16px); }
.screen.active { display: flex; animation: screenIn 0.38s var(--ease-out) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }

.glass {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03) 42%), var(--glass);
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 18px 50px rgba(5, 0, 25, 0.35);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

/* Logo */
.logo {
  font-family: var(--display); font-weight: 900; letter-spacing: 0.04em; font-size: 34px; margin: 0;
  background: linear-gradient(100deg, #fff 0%, #ffd1f6 30%, #8ff4ff 70%, #fff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 43, 214, 0.55)) drop-shadow(0 4px 0 rgba(122, 60, 255, 0.55));
  animation: shimmer 6s linear infinite;
}
.logo.big { font-size: clamp(54px, 17vw, 96px); line-height: 1; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: 999px; font-family: var(--display); font-weight: 700; font-size: 15px;
  letter-spacing: 0.01em; transition: transform 0.18s var(--ease), filter 0.2s, background 0.2s; position: relative; white-space: nowrap;
}
.btn:active { transform: scale(0.95); }
.btn .ic { width: 20px; height: 20px; }
.btn.primary {
  background: linear-gradient(135deg, #ff4fd8 0%, #b13cff 55%, #6a3cff 100%);
  box-shadow: 0 10px 30px rgba(255, 43, 214, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -3px 0 rgba(40, 0, 90, 0.35);
}
.btn.primary::after { content: ''; position: absolute; inset: 2px 12% auto; height: 40%; border-radius: 999px; background: linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)); pointer-events: none; }
.btn.gold { background: linear-gradient(135deg, #ffe680, #ffb02e); color: #3a1d00; box-shadow: 0 10px 26px rgba(255, 176, 46, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn.glass { background: rgba(255, 255, 255, 0.1); border: 1px solid var(--stroke); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.lg { min-height: 60px; font-size: 17px; width: 100%; }
.btn.xl { min-height: 74px; font-size: 22px; width: 100%; max-width: 360px; }
.btn.xl .ic { width: 26px; height: 26px; }
.btn.small { min-height: 40px; font-size: 13px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.icon-btn { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; transition: transform 0.18s var(--ease); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn .ic { width: 22px; height: 22px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 10px; border-radius: 999px; font-family: var(--display); font-weight: 700; background: rgba(0, 0, 0, 0.32); border: 1px solid var(--stroke); }
.pill .ic { width: 22px; height: 22px; }
.spacer { flex: 1; }

/* Boot */
.boot { flex-direction: column; align-items: center; justify-content: flex-end; background: var(--ink); z-index: 100; padding-bottom: calc(var(--safe-bottom) + 70px); }
.boot.active { animation: none; }
.boot-art { position: absolute; inset: 0; background: url('/assets/bg/neon-city.webp') center / cover no-repeat, radial-gradient(circle at 50% 40%, #3a1470, var(--ink) 70%); opacity: 0.9; }
.boot-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 11, 43, 0.1) 40%, rgba(11, 11, 43, 0.95)); }
.boot-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.boot .logo { font-size: 52px; }
.bar { width: 220px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--magenta), var(--cyan)); box-shadow: 0 0 14px var(--magenta); transition: width 0.25s; }
.boot.out { animation: bootOut 0.5s ease forwards; }
@keyframes bootOut { to { opacity: 0; visibility: hidden; } }
.noscript { position: relative; color: var(--muted); }

/* Menu */
.menu { flex-direction: column; background: linear-gradient(180deg, rgba(11, 11, 43, 0.55) 0%, rgba(11, 11, 43, 0) 30%, rgba(11, 11, 43, 0) 52%, rgba(11, 11, 43, 0.82) 82%); }
.topbar { display: flex; align-items: center; gap: 10px; }
.hero { margin-top: 5vh; text-align: center; }
.tagline { margin: 10px 0 0; font-family: var(--display); font-weight: 500; font-size: 15px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); }
.banner { margin: 18px auto 0; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 18px; font-weight: 700; max-width: 360px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.03); } }
.menu-bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.best { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 14px; color: var(--muted); }
.best b { color: #fff; font-size: 18px; }
.menu-row { display: flex; gap: 10px; width: 100%; max-width: 360px; justify-content: center; }
.menu-row .btn { flex: 1; padding: 0 12px; font-size: 13px; }
#btnPlay { animation: breathe 2.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04); box-shadow: 0 14px 44px rgba(255, 43, 214, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.45); } }
.legal-links { display: flex; gap: 8px; justify-content: center; font-size: 12px; color: var(--muted); }
.legal-links a { text-decoration: none; }

/* Modal panels */
.modal { align-items: center; justify-content: center; background: rgba(8, 4, 30, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 20; }
.panel { position: relative; width: 100%; max-width: 420px; border-radius: 32px; padding: 26px 22px 22px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; animation: pop 0.45s var(--ease) both; }
.panel.narrow { max-width: 340px; }
.panel.wide { max-width: 460px; }
.panel.scroll { max-height: 100%; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
@keyframes pop { from { transform: scale(0.9) translateY(20px); opacity: 0; } }
.panel h2 { font-family: var(--display); font-weight: 800; font-size: 22px; margin: 4px 0 0; }
.lead { margin: 0; color: rgba(255, 255, 255, 0.86); line-height: 1.45; font-size: 15px; }
.close-x { position: absolute; top: 10px; right: 10px; color: var(--muted); }
.explainer-art img { width: 132px; height: 132px; object-fit: contain; filter: drop-shadow(0 12px 30px rgba(255, 43, 214, 0.55)); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }
.how { list-style: none; margin: 4px 0 6px; padding: 0; width: 100%; display: grid; gap: 8px; text-align: left; }
.how li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); font-size: 14px; font-weight: 600; }
.how-ic { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(255, 43, 214, 0.35), rgba(34, 228, 255, 0.25)); flex: none; }
.fine { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 2px 0 0; }

/* Calibration */
.calib { flex-direction: column; align-items: center; gap: 16px; background: radial-gradient(circle at 50% 35%, rgba(122, 60, 255, 0.35), rgba(11, 11, 43, 0.96) 70%); z-index: 15; }
.cal-title { font-family: var(--display); font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.cam-wrap { position: relative; width: min(74vw, 46vh, 340px); aspect-ratio: 1; margin-top: 2vh; }
#calCam { width: 100%; height: 100%; border-radius: 50%; display: block; background: rgba(255, 255, 255, 0.05); }
.cal-ring { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); transform: rotate(-90deg); }
.cal-ring circle { fill: none; stroke-width: 3; }
.cal-ring .trk { stroke: rgba(255, 255, 255, 0.14); }
.cal-ring .val { stroke: var(--cyan); stroke-linecap: round; stroke-dasharray: 295.3; stroke-dashoffset: 295.3; transition: stroke-dashoffset 0.15s linear; filter: drop-shadow(0 0 6px var(--cyan)); }
.cal-glyph { position: absolute; right: -6px; bottom: -6px; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--magenta), var(--violet)); box-shadow: 0 8px 24px rgba(255, 43, 214, 0.5); }
.cal-glyph canvas { width: 56px; height: 56px; }
.cal-glyph:empty { display: none; }
.cal-text { font-family: var(--display); font-weight: 800; font-size: clamp(20px, 6vw, 28px); text-align: center; min-height: 1.3em; text-shadow: 0 2px 20px rgba(255, 43, 214, 0.5); }
.cal-text.ok { color: var(--gold); }
.cal-loading { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.cal-noface { border-radius: 22px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; max-width: 340px; }
.cal-noface p { margin: 0; color: var(--muted); font-size: 14px; }
#btnCalSkip { margin-top: auto; }

/* HUD */
.hud { pointer-events: none; flex-direction: column; }
.hud button { pointer-events: auto; }
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; }
.hud-left { display: flex; flex-direction: column; gap: 2px; }
.hearts { display: flex; gap: 4px; color: #ff2b6a; filter: drop-shadow(0 0 8px rgba(255, 43, 106, 0.7)); }
.hearts .ic { width: 24px; height: 24px; }
.hearts .ic.empty { color: rgba(255, 255, 255, 0.28); filter: none; }
.hearts .ic.lost { animation: heartLost 0.5s ease; }
@keyframes heartLost { 30% { transform: scale(1.6); } }
.score { font-family: var(--display); font-weight: 900; font-size: 40px; line-height: 1.1; text-shadow: 0 3px 18px rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 43, 214, 0.35); font-variant-numeric: tabular-nums; }
.sub { font-family: var(--display); font-size: 13px; color: rgba(255, 255, 255, 0.85); display: flex; align-items: center; gap: 4px; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.sub .ic { width: 16px; height: 16px; }
.mult { align-self: flex-start; margin-top: 6px; padding: 4px 12px; border-radius: 99px; font-family: var(--display); font-weight: 900; font-size: 18px; color: #2b1600; background: linear-gradient(135deg, #ffe680, #ffb02e); box-shadow: 0 6px 20px rgba(255, 176, 46, 0.5); }
.mult.bump { animation: bump 0.45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.45) rotate(-4deg); } }
.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.rec { display: flex; align-items: center; gap: 4px; font-family: var(--display); font-size: 11px; font-weight: 800; padding: 4px 9px 4px 6px; border-radius: 99px; background: rgba(0, 0, 0, 0.45); }
.rec .ic { color: var(--red); width: 12px; height: 12px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.facehud { position: absolute; right: 16px; top: calc(var(--safe-top) + 120px); display: flex; flex-direction: column; align-items: center; gap: 6px; }
#faceHudCanvas { width: 84px; height: 84px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.5); box-shadow: 0 0 0 4px rgba(255, 43, 214, 0.25), 0 8px 24px rgba(0, 0, 0, 0.4); background: rgba(0, 0, 0, 0.3); }
.face-chips { display: flex; flex-direction: column; gap: 4px; }
.chip { display: flex; align-items: center; gap: 5px; font-family: var(--display); font-size: 9px; font-weight: 700; letter-spacing: 0.05em; padding: 3px 7px; border-radius: 99px; background: rgba(0, 0, 0, 0.42); color: rgba(255, 255, 255, 0.7); min-width: 80px; }
.chip .lvl { flex: 1; height: 4px; border-radius: 9px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.chip .lvl i { display: block; height: 100%; width: 0; background: var(--cyan); border-radius: inherit; }
.chip.on { color: #fff; background: rgba(255, 43, 214, 0.55); }
.chip.on .lvl i { background: var(--gold); }
.face-label { font-family: var(--display); font-weight: 900; font-size: 13px; color: var(--gold); min-height: 1em; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }

.meter { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 18px); display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: rgba(0, 0, 0, 0.38); }
.meter .ic { width: 18px; height: 18px; color: var(--gold); }
.meter-bar { width: 140px; height: 8px; border-radius: 9px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.meter-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffe680, #ffb02e); border-radius: inherit; transition: width 0.2s; }
.meter.full { animation: pulse 0.8s ease-in-out infinite; box-shadow: 0 0 24px rgba(255, 216, 77, 0.6); }

.gate-prompt { position: absolute; left: 50%; top: 24%; transform: translate(-50%, 0); display: flex; flex-direction: column; align-items: center; gap: 6px; animation: gateIn 0.35s var(--ease) both; }
@keyframes gateIn { from { transform: translate(-50%, 0) scale(0.4); opacity: 0; } }
#gateGlyph { width: 96px; height: 96px; filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.55)); }
.gate-prompt b { font-family: var(--display); font-weight: 900; font-size: 34px; letter-spacing: 0.02em; text-shadow: 0 0 22px currentColor, 0 4px 0 rgba(0, 0, 0, 0.35); }
.gate-hold { width: 120px; height: 6px; border-radius: 9px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.gate-hold i { display: block; height: 100%; width: 0; background: #fff; border-radius: inherit; }
.gate-prompt.urgent b { animation: shake 0.3s linear infinite; }
@keyframes shake { 25% { transform: translateX(-3px) rotate(-2deg); } 75% { transform: translateX(3px) rotate(2deg); } }

.hint { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); padding: 12px 20px; border-radius: 18px; font-weight: 800; font-size: 16px; text-align: center; background: rgba(10, 5, 35, 0.66); border: 1px solid var(--stroke); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); white-space: nowrap; animation: hintIn 0.4s var(--ease) both; }
@keyframes hintIn { from { transform: translate(-50%, 16px); opacity: 0; } }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 120px; text-shadow: 0 0 40px var(--magenta), 0 8px 0 rgba(0, 0, 0, 0.3); }
.countdown span { animation: countPop 0.8s var(--ease-out) both; }
.countdown.go span { font-size: 64px; color: var(--gold); text-shadow: 0 0 40px var(--gold); }
@keyframes countPop { from { transform: scale(2.2); opacity: 0; } 60% { opacity: 1; } to { transform: scale(0.9); opacity: 0.0; } }
.world-banner { position: absolute; left: 50%; top: 34%; transform: translateX(-50%); text-align: center; animation: worldIn 2.6s ease both; }
.world-banner small { display: block; font-family: var(--display); font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
.world-banner b { font-family: var(--display); font-weight: 900; font-size: 34px; white-space: nowrap; text-shadow: 0 0 30px var(--cyan); }
@keyframes worldIn { 0% { opacity: 0; transform: translateX(-50%) scale(0.7); } 15%, 75% { opacity: 1; transform: translateX(-50%) scale(1); } 100% { opacity: 0; transform: translateX(-50%) scale(1.1); } }
.popups { position: absolute; inset: 0; pointer-events: none; }
.popup { position: absolute; left: 50%; top: 46%; font-family: var(--display); font-weight: 900; font-size: 26px; color: #fff; text-shadow: 0 0 16px var(--magenta), 0 3px 0 rgba(0, 0, 0, 0.35); animation: floatUp 0.9s ease-out forwards; white-space: nowrap; }
.popup.gate { font-size: 40px; color: var(--gold); text-shadow: 0 0 24px var(--gold); }
.popup.gem { color: var(--cyan); }
.popup.bad { color: var(--red); }
@keyframes floatUp { from { transform: translate(-50%, 0) scale(0.6); opacity: 0; } 20% { transform: translate(-50%, -10px) scale(1.1); opacity: 1; } to { transform: translate(-50%, -80px) scale(1); opacity: 0; } }
.flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle, rgba(255, 59, 92, 0) 40%, rgba(255, 59, 92, 0.55)); }
.flash.on { animation: flash 0.45s ease; }
.flash.gold { background: radial-gradient(circle, rgba(255, 216, 77, 0) 30%, rgba(255, 216, 77, 0.45)); }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.face-lost, .touch-badge { position: absolute; left: 50%; top: calc(var(--safe-top) + 150px); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: rgba(255, 59, 92, 0.8); font-weight: 800; font-size: 13px; white-space: nowrap; }
.touch-badge { background: rgba(0, 0, 0, 0.4); top: auto; bottom: calc(var(--safe-bottom) + 64px); font-size: 11px; opacity: 0.8; }

/* Game over */
.over .panel { gap: 10px; }
.over-head { display: flex; align-items: center; gap: 10px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; font-family: var(--display); font-size: 12px; font-weight: 800; color: #2b1600; background: linear-gradient(135deg, #ffe680, #ffb02e); animation: bump 0.6s var(--ease) 0.3s both; }
.over-score { font-family: var(--display); font-weight: 900; font-size: 58px; line-height: 1; background: linear-gradient(180deg, #fff, #ffd1f6); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 22px rgba(255, 43, 214, 0.5)); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.stats div { padding: 10px 6px; border-radius: 16px; background: rgba(255, 255, 255, 0.07); display: flex; flex-direction: column; gap: 2px; }
.stats b { font-family: var(--display); font-size: 18px; }
.stats small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.clip-wrap { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
#clip { width: 46%; max-width: 190px; aspect-ratio: 9 / 16; border-radius: 18px; background: #000; object-fit: cover; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(255, 255, 255, 0.15); }
.clip-actions { display: flex; gap: 8px; width: 100%; }
.clip-actions .btn { flex: 1; }
.ad-row { display: flex; gap: 8px; width: 100%; }
.ad-row .btn { flex: 1; font-size: 13px; padding: 0 12px; }
.nick-form { display: flex; gap: 8px; width: 100%; }
.nick-form input { flex: 1; min-width: 0; height: 52px; border-radius: 999px; padding: 0 18px; font: 600 16px var(--body); color: #fff; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--stroke); outline: none; user-select: text; -webkit-user-select: text; }
.nick-form input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 228, 255, 0.25); }
.nick-form .btn { padding: 0 16px; font-size: 13px; }
.over .menu-row { max-width: 100%; }
.over .menu-row .btn { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 4px; min-height: 64px; padding: 8px 6px; font-size: 11px; white-space: normal; border-radius: 20px; line-height: 1.15; }
.rank-msg { min-height: 18px; font-weight: 700; font-size: 14px; color: var(--gold); }
.rank-msg.err { color: var(--red); }

/* Sheets */
.sheet { flex-direction: column; gap: 12px; background: linear-gradient(180deg, rgba(14, 7, 44, 0.94), rgba(8, 4, 30, 0.97)); z-index: 25; }
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-head h2 { font-family: var(--display); font-size: 20px; margin: 0; flex: 1; }
.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; overflow-y: auto; padding-bottom: 20px; touch-action: pan-y; overscroll-behavior: contain; }
.skin { position: relative; border-radius: 24px; padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--stroke); transition: transform 0.2s var(--ease); }
.skin:active { transform: scale(0.97); }
.skin img { width: 100%; aspect-ratio: 1; border-radius: 18px; object-fit: cover; background: radial-gradient(circle at 50% 40%, #3a1a7a, #120a34 70%); }
.skin b { font-family: var(--display); font-size: 13px; }
.skin .btn { width: 100%; min-height: 40px; font-size: 12px; }
.skin.equipped { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(34, 228, 255, 0.35), 0 10px 30px rgba(34, 228, 255, 0.2); }
.skin .lock { position: absolute; top: 18px; right: 18px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); }
.tabs { display: flex; gap: 8px; align-items: center; }
.tab { height: 38px; padding: 0 16px; border-radius: 99px; font-family: var(--display); font-weight: 700; font-size: 12px; background: rgba(255, 255, 255, 0.08); }
.tab.active { background: linear-gradient(135deg, #ff4fd8, #6a3cff); }
.toggle-mini { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.lb-list { list-style: none; margin: 0; padding: 0 0 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; touch-action: pan-y; overscroll-behavior: contain; }
.lb-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.06); font-weight: 700; }
.lb-list li .r { width: 30px; font-family: var(--display); font-size: 14px; color: var(--muted); text-align: center; }
.lb-list li:nth-child(1) .r { color: var(--gold); }
.lb-list li:nth-child(2) .r { color: #dfe7ff; }
.lb-list li:nth-child(3) .r { color: #ffb37a; }
.lb-list li .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.lb-list li .n .ic { width: 16px; height: 16px; color: var(--cyan); }
.lb-list li .s { font-family: var(--display); }
.lb-list li.me { background: rgba(255, 43, 214, 0.22); }
.lb-list .empty { justify-content: center; color: var(--muted); font-weight: 600; }
.settings-list { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; touch-action: pan-y; }
.set-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.06); font-weight: 700; }
.set-row > span { display: flex; align-items: center; gap: 10px; }
.seg { display: flex; flex-wrap: wrap; max-width: 100%; padding: 3px; border-radius: 99px; background: rgba(0, 0, 0, 0.35); }
.seg button { height: 32px; padding: 0 10px; border-radius: 99px; font-family: var(--display); font-size: 11px; font-weight: 700; color: var(--muted); }
.seg button.on { background: linear-gradient(135deg, #ff4fd8, #6a3cff); color: #fff; }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: rgba(255, 255, 255, 0.18); transition: background 0.2s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.25s var(--ease); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.switch input:checked + i { background: linear-gradient(135deg, #ff4fd8, #6a3cff); }
.switch input:checked + i::after { transform: translateX(22px); }
.ver { opacity: 0.6; }

.toast { position: absolute; left: 50%; bottom: calc(var(--safe-bottom) + 90px); transform: translate(-50%, 20px); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 18px; background: rgba(10, 5, 35, 0.9); border: 1px solid var(--stroke); font-weight: 700; font-size: 14px; text-align: center; opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s var(--ease); z-index: 90; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.debug { position: absolute; left: 8px; bottom: calc(var(--safe-bottom) + 60px); margin: 0; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.6); font: 11px/1.35 ui-monospace, monospace; color: #9ff; z-index: 95; pointer-events: none; white-space: pre-wrap; word-break: break-word; max-width: calc(100% - 16px); }

body.reel-mode .screen, body.reel-mode #gl, body.reel-mode .debug, body.reel-mode .toast { visibility: hidden; }
body.reel-mode .reel-live { display: block; position: fixed; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0b0b2b; z-index: 60; }

@media (min-width: 700px) {
  .menu-bottom { margin-bottom: 4vh; }
  .facehud { right: 24px; }
}
@media (max-height: 640px) {
  .hero { margin-top: 1vh; }
  .logo.big { font-size: 52px; }
  .btn.xl { min-height: 62px; }
  .explainer-art img { width: 90px; height: 90px; }
  .how li { padding: 7px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
