:root {
  --bg: #0b1020;
  --bg-2: #111832;
  --panel: #151d3b;
  --panel-2: #1b2550;
  --line: #26315f;
  --text: #e8ecff;
  --muted: #8f9bc7;
  --accent: #4f8cff;
  --accent-2: #7c5cff;
  --good: #2fd27a;
  --bad: #ff5470;
  --warn: #ffb547;
  --gold: #ffd166;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #1b2a66 0%, transparent 60%), var(--bg);
  color: var(--text); font-size: 15px; line-height: 1.45;
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 20px;
  background: rgba(11, 16, 32, .85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; gap: 8px; align-items: center; font-size: 1.15rem; color: var(--text); font-weight: 600; }
.brand b { color: var(--accent); font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.5rem; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a, .nav button.linklike {
  color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 600; position: relative;
  background: none; border: 0; font: inherit; cursor: pointer;
}
.nav a:hover, .nav a.active { color: var(--text); background: var(--panel); text-decoration: none; }
.nav .me { display: flex; align-items: center; gap: 6px; }
.badge {
  display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad);
  color: #fff; font-size: 11px; font-weight: 700; align-items: center; justify-content: center; margin-left: 4px;
}
.btn-remove-ads { color: var(--gold) !important; }

/* ---------- Layout ---------- */
.layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; padding: 20px; max-width: 1400px; width: 100%; margin: 0 auto; }
.layout.no-sidebar { grid-template-columns: minmax(0, 1fr); }
.layout.fullscreen { padding: 0; max-width: none; gap: 0; }
@media (max-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr); } .sidebar { order: 2; } }
.view { min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.footer { display: flex; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

/* ---------- Panels, buttons, inputs ---------- */
.panel { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel.tight { padding: 12px; }
.panel h2:first-child, .panel h3:first-child { margin-top: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); padding: 10px 16px; border-radius: 10px; font: inherit; font-weight: 600;
  cursor: pointer; transition: transform .05s, background .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
.btn.good { background: var(--good); color: #062a16; border-color: transparent; }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: .85rem; border-radius: 8px; }
.btn.big { padding: 14px 22px; font-size: 1.1rem; border-radius: 12px; }
.btn.block { width: 100%; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 10px;
  padding: 10px 12px; font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 140, 255, .2); }
textarea { resize: vertical; min-height: 70px; }
label.field { display: block; }
label.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.error { color: var(--bad); font-size: .9rem; min-height: 1.2em; }

/* ---------- Users ---------- */
.avatar { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; background: var(--panel-2); align-items: center; justify-content: center; font-size: 18px; flex: none; position: relative; }
.avatar.lg { width: 84px; height: 84px; font-size: 46px; }
.avatar.sm { width: 26px; height: 26px; font-size: 14px; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg-2); background: #555c7a; }
.avatar .dot.on { background: var(--good); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.user-row:hover { background: rgba(255, 255, 255, .03); }
.user-row .name { font-weight: 600; color: var(--text); }
.user-list { display: flex; flex-direction: column; gap: 2px; }
.flag { width: 20px; height: 15px; border-radius: 2px; vertical-align: -2px; object-fit: cover; }
.crown { color: var(--gold); }

/* ---------- Home ---------- */
.hero { padding: 26px; border-radius: 18px; background: linear-gradient(135deg, rgba(79, 140, 255, .18), rgba(124, 92, 255, .18)); border: 1px solid var(--line); margin-bottom: 18px; }
.hero p { color: var(--muted); max-width: 640px; margin: 0; }
.mode-card { display: flex; flex-direction: column; gap: 12px; }
.mode-card .big-ico { font-size: 2.4rem; }
.stat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: .82rem; color: var(--muted); }
.chip b { color: var(--text); }
.rules li { margin-bottom: 6px; color: var(--muted); }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 420px; margin: 30px auto; }

/* ---------- Queue ---------- */
.queue-box { text-align: center; padding: 40px 20px; }
.radar { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 20px; border: 2px solid var(--accent); position: relative; overflow: hidden; background: radial-gradient(circle, rgba(79,140,255,.15), transparent 70%); }
.radar::after { content: ''; position: absolute; inset: 0; background: conic-gradient(from 0deg, rgba(79, 140, 255, .55), transparent 25%); animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.big-number { font-size: 3rem; font-weight: 800; }
.progress { height: 10px; border-radius: 6px; background: var(--bg); overflow: hidden; border: 1px solid var(--line); }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s; }

/* ---------- Lobby ---------- */
.lobby-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
@media (max-width: 900px) { .lobby-grid { grid-template-columns: 1fr; } }
.code-box { font-family: ui-monospace, Consolas, monospace; font-size: 1.6rem; letter-spacing: .2em; font-weight: 700; background: var(--bg); padding: 6px 14px; border-radius: 10px; border: 1px dashed var(--line); }
.chat-box { display: flex; flex-direction: column; height: 340px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 2px 10px; }
.chat-msg { font-size: .92rem; }
.chat-msg .who { font-weight: 700; margin-right: 6px; }
.chat-msg.system { color: var(--muted); font-style: italic; font-size: .85rem; }
.chat-form { display: flex; gap: 8px; }

/* ---------- Match ---------- */
.match { position: relative; height: 100vh; min-height: 480px; background: #000; overflow: hidden; }
.pano { position: absolute; inset: 0; }
.pano-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 30px; background: repeating-linear-gradient(45deg, #0e1530, #0e1530 20px, #111a3a 20px, #111a3a 40px); color: var(--muted); }
.hud { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 10px; align-items: flex-start; pointer-events: none; z-index: 5; }
.hud > * { pointer-events: auto; }
.hud-card { background: rgba(11, 16, 32, .82); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; backdrop-filter: blur(6px); }
.timer { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 90px; text-align: center; }
.timer.low { color: var(--bad); animation: pulse 1s infinite; }
/* Last 10 seconds of a timed game: pulsing red frame around the view, the clock card turns red, and a big countdown. */
.match.final-ten::after { content: ''; position: absolute; inset: 0; z-index: 5; pointer-events: none; border: 6px solid rgba(255, 84, 112, .95);
  box-shadow: inset 0 0 70px 18px rgba(255, 40, 70, .55); animation: final-flash 1s ease-in-out infinite; }
.match.final-three::after { border-width: 10px; animation-duration: .5s; }
.match.final-ten .hud-card:has(.timer) { background: rgba(200, 30, 55, .9); border-color: #ff5470; }
.match.final-ten .hud-card:has(.timer) .timer, .match.final-ten .hud-card:has(.timer) .label { color: #fff; }
@keyframes final-flash { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.final-count { position: absolute; left: 50%; top: 110px; transform: translateX(-50%); z-index: 6; pointer-events: none; font-size: 6rem; font-weight: 900;
  color: #fff; text-shadow: 0 0 24px rgba(255, 40, 70, .9), 0 4px 12px rgba(0, 0, 0, .6); font-variant-numeric: tabular-nums; line-height: 1; }
.final-count.tick { animation: final-pop 1s ease-out forwards; }
@keyframes final-pop { 0% { opacity: 0; transform: translateX(-50%) scale(1.6); } 15% { opacity: 1; transform: translateX(-50%) scale(1); } 80% { opacity: .9; } 100% { opacity: .35; transform: translateX(-50%) scale(.92); } }
@media (max-width: 700px) { .final-count { font-size: 4rem; top: 90px; } }
@media (prefers-reduced-motion: reduce) { .match.final-ten::after, .final-count.tick { animation: none; } }
@keyframes pulse { 50% { opacity: .55; } }
.hud .label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hud .value { font-size: 1.4rem; font-weight: 800; }
.live-board { position: absolute; top: 12px; right: 12px; width: 240px; max-height: calc(100% - 120px); overflow-y: auto; z-index: 5; }
.live-board .lb-row { display: flex; gap: 8px; align-items: center; padding: 3px 0; font-size: .88rem; }
.live-board .lb-row.me { color: var(--gold); font-weight: 700; }
.live-board .lb-row .score { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .live-board { display: none; } }
.guess-bar { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); z-index: 6; }
.guess-form { display: flex; gap: 8px; background: rgba(11, 16, 32, .9); padding: 10px; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.guess-form input { font-size: 1.1rem; padding: 12px 14px; }
.suggestions { position: absolute; bottom: 100%; left: 0; right: 0; margin-bottom: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.suggestions button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 14px; background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.suggestions button.active, .suggestions button:hover { background: var(--panel-2); }
.feedback { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-size: 1.6rem; font-weight: 800; padding: 14px 26px; border-radius: 14px; z-index: 7; pointer-events: none; animation: pop 2.4s ease forwards; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; width: max-content; max-width: min(92vw, 640px); }
.feedback .fb-flag { height: 56px; width: auto; border-radius: 6px; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); margin-bottom: 4px; }
.feedback .fb-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.feedback .fb-pts { font-size: 1.1rem; padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, .18); }
.feedback .fb-sub { font-size: .95rem; font-weight: 600; opacity: .9; }
.feedback .fb-sub:empty { display: none; }
.feedback.good { background: rgba(47, 210, 122, .92); color: #062a16; }
.feedback.close { background: rgba(255, 200, 61, .94); color: #2e2200; }
.feedback.bad { background: rgba(255, 84, 112, .92); color: #fff; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.9); } 6% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; background: rgba(11, 16, 32, .88); z-index: 10; text-align: center; }
.countdown { font-size: 7rem; font-weight: 800; color: var(--accent); }
.match-tools { position: absolute; left: 12px; bottom: 22px; z-index: 6; display: flex; gap: 6px; }

/* ---------- Results ---------- */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin: 10px 0 20px; }
.podium .step { text-align: center; width: 130px; }
.podium .block { border-radius: 12px 12px 0 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 10px; font-size: 1.6rem; font-weight: 800; background: var(--panel-2); border: 1px solid var(--line); }
.podium .p1 .block { height: 120px; background: linear-gradient(180deg, rgba(255, 209, 102, .35), var(--panel-2)); }
.podium .p2 .block { height: 85px; }
.podium .p3 .block { height: 60px; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.table tr.me td { background: rgba(255, 209, 102, .07); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.review { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.review .item { padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: .88rem; }
.review .item.good { border-color: rgba(47, 210, 122, .5); }
.review .item.bad { border-color: rgba(255, 84, 112, .5); }
.review .item.close { border-color: rgba(255, 200, 61, .6); }
.all-guesses .loc { padding: 10px 0; border-top: 1px solid var(--line); }
.all-guesses .loc:first-child { border-top: 0; }
.all-guesses .loc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.all-guesses .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .82rem; border: 1px solid var(--line); background: var(--bg); }
.gchip.good { border-color: rgba(47, 210, 122, .6); }
.gchip.close { border-color: rgba(255, 200, 61, .7); }
.gchip.bad { border-color: rgba(255, 84, 112, .5); }
.gchip .gp { font-weight: 700; }
.gchip.good .gp { color: #2fd27a; } .gchip.close .gp { color: #ffc83d; } .gchip.bad .gp { color: #ff5470; }
.gchip.me { box-shadow: 0 0 0 1px var(--accent) inset; }
.review .pts-chip { float: right; font-weight: 700; font-size: .8rem; padding: 1px 8px; border-radius: 999px; background: var(--line); }
.review .item.good .pts-chip { color: #2fd27a; }
.review .item.close .pts-chip { color: #ffc83d; }

/* ---------- Profile ---------- */
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat .v { font-size: 1.5rem; font-weight: 800; }
.stat .k { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 6px; }
.avatar-picker button { width: 44px; height: 44px; font-size: 22px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.avatar-picker button.sel { border-color: var(--accent); background: var(--panel-2); }

/* ---------- Messages ---------- */
.messenger { display: grid; grid-template-columns: 260px 1fr; gap: 0; height: calc(100vh - 220px); min-height: 420px; padding: 0; overflow: hidden; }
@media (max-width: 760px) { .messenger { grid-template-columns: 1fr; } .messenger.has-thread .convos { display: none; } .messenger:not(.has-thread) .thread { display: none; } }
.convos { border-right: 1px solid var(--line); overflow-y: auto; padding: 8px; }
.convo { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; color: var(--text); cursor: pointer; }
.convo:hover, .convo.active { background: var(--panel-2); text-decoration: none; }
.convo .preview { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.thread-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 70%; padding: 8px 12px; border-radius: 14px; background: var(--panel-2); align-self: flex-start; word-wrap: break-word; white-space: pre-wrap; }
.bubble.mine { align-self: flex-end; background: var(--accent); color: #fff; }
.bubble .t { display: block; font-size: .7rem; opacity: .7; margin-top: 2px; }
.thread-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }

/* ---------- Store ---------- */
.store-card { text-align: center; max-width: 480px; margin: 20px auto; }
.price { font-size: 3rem; font-weight: 800; }

/* ---------- Ads ---------- */
.ad-row { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; padding: 20px 20px 0; max-width: 1400px; width: 100%; margin: 0 auto; }
.ad-row > * { grid-column: 1; }
.ad-row.no-sidebar { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1000px) { .ad-row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .ad-row { padding: 12px 12px 0; } }
.ad-row:empty { display: none; }
.ad-slot { display: flex; align-items: center; justify-content: center; flex-direction: column; color: #6b76a6; font-size: .8rem; border: 1px dashed #2c3770; border-radius: 10px; background: repeating-linear-gradient(135deg, rgba(255,255,255,.015), rgba(255,255,255,.015) 10px, transparent 10px, transparent 20px); overflow: hidden; position: relative; }
.ad-slot.leaderboard { width: 100%; max-width: 728px; height: 90px; }
.ad-slot.rect { width: 100%; max-width: 300px; height: 250px; margin: 0 auto; }
.ad-slot.wide { width: 100%; height: 120px; }
.ad-slot .ad-label { position: absolute; top: 4px; left: 8px; font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; }
.ad-slot a { color: var(--gold); }
.ad-slot.live { border: 0; background: none; }
@media (max-width: 760px) { .ad-slot.leaderboard { height: 60px; } }

/* ---------- Toasts & modal ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: 360px; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); animation: slidein .2s ease; }
.toast.error { border-left-color: var(--bad); }
.toast.success { border-left-color: var(--good); }
.toast .actions { margin-top: 8px; display: flex; gap: 6px; }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; z-index: 90; padding: 16px; }
.modal { width: min(520px, 100%); max-height: 90vh; overflow-y: auto; }
.empty { color: var(--muted); text-align: center; padding: 18px 8px; font-size: .9rem; }

/* ---------- In-match & mobile ---------- */
body.in-match #ad-top, body.in-match #footer, body.admin-page #ad-top { display: none !important; }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
  .nav { width: 100%; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 10px; white-space: nowrap; }
  .layout { padding: 12px; }
  .match { height: calc(100vh - 54px); }
  .hud .timer { font-size: 1.5rem; min-width: 70px; }
  .hud-card { padding: 6px 10px; }
  h1 { font-size: 1.6rem; }
  .podium .step { width: 100px; }
}

/* ---------- Admin ---------- */
.admin-head { margin-bottom: 12px; }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.admin-tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.admin-tabs a:hover { color: var(--text); text-decoration: none; }
.admin-tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex-wrap: wrap; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer; }
.seg button.active { background: var(--panel-2); color: var(--text); }
.chip-admin { color: var(--accent); border-color: var(--accent); }
.chip-bad { color: var(--bad); border-color: rgba(255, 84, 112, .5); }
.chip-warn { color: var(--warn); border-color: rgba(255, 181, 71, .5); }
.chip-good { color: var(--good); border-color: rgba(47, 210, 122, .5); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.near { color: var(--warn); }
.stat .v.bad { color: var(--bad); }
.stat-link { color: var(--text); }
.stat-link:hover { border-color: var(--accent); text-decoration: none; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: pulse 1.5s infinite; }
.hour-bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding-top: 6px; }
.hour-bars > div { flex: 1; background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-radius: 3px 3px 0 0; min-width: 4px; }
.table-wrap { overflow-x: auto; }
.click-row { cursor: pointer; }
.click-row:hover td { background: rgba(255, 255, 255, .03); }
.report { margin-bottom: 12px; }
.report.resolved, .report.dismissed { opacity: .75; }
.evidence { margin-top: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .9rem; display: grid; gap: 4px; white-space: pre-wrap; word-break: break-word; }
.evidence .ev-target { color: var(--warn); }
.mini-report { padding: 6px 0; border-bottom: 1px solid var(--line); }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.spectate { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; }
@media (max-width: 900px) { .spectate { grid-template-columns: 1fr; } }
.spectate-view { position: relative; height: min(70vh, 640px); min-height: 360px; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line); }
.spectate-board { max-height: min(70vh, 640px); overflow-y: auto; }
.sp-row { display: flex; width: 100%; gap: 6px; align-items: center; background: none; border: 0; color: var(--text); font: inherit; padding: 6px 8px; border-radius: 8px; cursor: pointer; text-align: left; }
.sp-row:hover, .sp-row.active { background: var(--panel-2); }
.sp-row .sp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-feed { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 2px; }
.report-link { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .8rem; padding: 0 4px; }
.report-link:hover { color: var(--bad); }

/* ---------- Guest mode ---------- */
.guest-name { font-size: 1.6rem; font-weight: 800; padding: 14px; border-radius: 12px; background: var(--bg); border: 1px dashed var(--line); }
.guest-limits { text-align: left; background: var(--bg); border-radius: 10px; padding: 10px 12px; border: 1px solid var(--line); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ---------- Results notes ---------- */

/* ---------- Queue countdown ---------- */
.queue-clock { position: relative; width: 150px; height: 150px; margin: 0 auto 16px; }
.queue-clock svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.queue-clock circle { fill: none; stroke-width: 8; }
.queue-clock .track { stroke: var(--line); }
.queue-clock .arc { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.queue-clock-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.queue-clock-text .big { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.queue-count { margin-top: 14px; font-size: 1.1rem; }
.queue-tabs-note { margin: 12px auto 0; max-width: 460px; font-size: .85rem; color: var(--warn); background: rgba(255, 181, 71, .08); border: 1px solid rgba(255, 181, 71, .35); border-radius: 10px; padding: 8px 12px; }
.hour-bars > div.zero { background: var(--line); }
.queue-clock.waiting .arc { stroke-dashoffset: 0 !important; stroke: var(--line); }
.queue-clock.waiting .track { stroke: var(--accent); stroke-dasharray: 8 14; animation: spin 6s linear infinite; transform-origin: 60px 60px; }

/* ---------- Match chat ---------- */
.match-chat { display: flex; flex-direction: column; min-height: 0; }
.match-chat .mc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.match-chat .mc-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; min-height: 80px; max-height: 260px; padding-right: 4px; }
.match-chat .mc-msg { font-size: .9rem; line-height: 1.35; word-break: break-word; }
.match-chat .mc-msg .who { font-weight: 700; margin-right: 6px; }
.match-chat .mc-msg .t { font-size: .72rem; margin-left: 4px; }
.match-chat .guest-tag { font-size: .65rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0 5px; vertical-align: 1px; }
.match-chat .mc-form { display: flex; gap: 6px; margin-top: 8px; }
.match-chat .mc-form input { padding: 8px 10px; }
.match-chat-wrap { position: absolute; left: 12px; bottom: 110px; width: min(320px, calc(100% - 24px)); z-index: 11; background: rgba(11, 16, 32, .88); border: 1px solid var(--line); border-radius: 12px; padding: 10px; backdrop-filter: blur(6px); }
.match-chat.compact .mc-log { max-height: 180px; }
.match-tools .badge { margin-left: 2px; }
.results-chat .mc-log { max-height: 220px; }
@media (max-width: 760px) { .match-chat-wrap { bottom: 150px; } }
.sp-cam { position: absolute; left: 12px; bottom: 10px; z-index: 5; background: rgba(11, 16, 32, .8); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }

/* ---------- Modes, levels, leaderboards ---------- */
.section-title { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1000px) { .grid-3 { grid-template-columns: 1fr; } }
.opt { display: flex; flex-direction: column; gap: 6px; }
.opt-label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.seg-wide { display: flex; }
.seg-wide button { flex: 1 1 0; }
.seg button small { display: block; font-size: .7rem; font-weight: 600; color: var(--good); line-height: 1.1; min-height: .8rem; }
.seg button + button { border-left: 1px solid var(--line); }
.rank-note { padding: 6px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.warn { color: var(--warn); }
.lvl { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: .72rem; font-weight: 800; margin-left: 4px; vertical-align: middle; }
.mode-badge .label { color: var(--text); font-weight: 700; }
.lives { font-size: 1.3rem; letter-spacing: 2px; line-height: 1.4; }
.lives .off { opacity: .45; }
.lives.hit { animation: lives-hit .45s ease; }
@keyframes lives-hit { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.xp-box { max-width: 420px; margin: 14px auto 0; display: flex; flex-direction: column; gap: 6px; }
.xp-gain { font-size: 1.25rem; font-weight: 800; color: var(--good); }
.level-up { font-weight: 800; color: var(--warn); }
.xp-bar { height: 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.xp-bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s ease; }
.pb-note { margin: 6px 0; font-weight: 600; }
.level-panel { display: flex; align-items: center; gap: 16px; }
.level-badge { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 900; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 0 4px rgba(79, 140, 255, .2); }
.lb-tabs { margin: 8px 0 12px; }
.lb-filters { gap: 10px; margin-bottom: 4px; }
.table.bests td:first-child { white-space: nowrap; }

/* ---------- Public landing page ---------- */
.js #view.prerender { display: none; }
#view.prerender { padding: 20px; max-width: 900px; margin: 0 auto; }
.landing-hero { text-align: center; padding: 40px 24px; background: radial-gradient(ellipse at top, rgba(79, 140, 255, .18), transparent 70%), linear-gradient(180deg, var(--panel), var(--bg-2)); }
.landing-hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 8px 0 12px; letter-spacing: -.02em; }
.landing-hero .lead { max-width: 640px; margin: 0 auto 20px; color: var(--muted); font-size: 1.08rem; }
.landing-globe { font-size: 3.5rem; animation: spin-globe 12s linear infinite; display: inline-block; }
@keyframes spin-globe { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .landing-globe { animation: none; } }
.landing-cta { justify-content: center; margin-bottom: 16px; }
.landing-hero .stat-chips { justify-content: center; }
.landing-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.landing-steps h3 { margin: 8px 0 4px; }
.landing-steps p { margin: 0; }
.step-n { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.landing-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.landing-modes h3 { margin: 6px 0 4px; }
.landing-modes p { margin: 0; }
.landing-variants p { margin: 6px 0 0; }
@media (max-width: 900px) { .landing-steps, .landing-modes { grid-template-columns: 1fr; } }
.mini-board { list-style: none; margin: 10px 0 0; padding: 0; counter-reset: mb; }
.mini-board li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); counter-increment: mb; }
.mini-board li:first-child { border-top: 0; }
.mini-board li::before { content: counter(mb); color: var(--muted); width: 18px; font-weight: 700; }
.mini-board .name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:first-child { border-top: 0; padding-top: 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.landing-bottom { text-align: center; margin-top: 16px; display: flex; flex-direction: column; gap: 14px; align-items: center; padding: 28px; }

/* ---------- Footer links ---------- */
.footer { flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ---------- Legal pages ---------- */
.legal { max-width: 820px; margin: 0 auto; padding: 24px 20px 48px; }
.legal .panel { padding: 28px clamp(18px, 4vw, 40px); }
.legal h1 { margin: 0 0 4px; font-size: 2rem; }
.legal h2 { margin: 28px 0 8px; font-size: 1.2rem; }
.legal h3 { margin: 18px 0 6px; font-size: 1rem; }
.legal p, .legal li { line-height: 1.65; }
.legal ul { padding-left: 22px; }
.legal .updated { color: var(--muted); margin: 0 0 18px; }
.legal .summary { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.legal table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: .95rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px 10px; border-top: 1px solid var(--line); }
.legal th { color: var(--muted); font-weight: 600; }
.legal-nav { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 16px; }
.view-foot { margin-top: 20px; text-align: center; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--bad); cursor: pointer; text-decoration: underline; }
.landing-modes .big-ico { font-size: 2rem; line-height: 1; }

/* ===================== Miles, cosmetics, achievements ===================== */
.miles-ico { display: inline-flex; align-items: center; justify-content: center; width: 1.25em; height: 1.25em; border-radius: 50%;
  background: linear-gradient(135deg, #ffd166, #f4a52b); color: #3a2400; font-size: .8em; font-weight: 900; vertical-align: -2px; transform: rotate(-20deg); }
.miles-amt { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.miles-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255, 209, 102, .4);
  background: rgba(255, 209, 102, .08); color: var(--gold) !important; font-weight: 800; font-variant-numeric: tabular-nums; }
.miles-chip:hover { background: rgba(255, 209, 102, .16); text-decoration: none; }

/* Faces / icon animations */
.face { display: inline-block; line-height: 1; }
.ifx-spin { animation: ifx-spin 6s linear infinite; }
.ifx-pulse { animation: ifx-pulse 1.2s ease-in-out infinite; }
.ifx-float { animation: ifx-float 2.6s ease-in-out infinite; }
.ifx-sparkle { animation: ifx-sparkle 2s ease-in-out infinite; }
@keyframes ifx-spin { to { transform: rotate(360deg); } }
@keyframes ifx-pulse { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }
@keyframes ifx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12%); } }
@keyframes ifx-sparkle { 0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 220, 120, 0)); } 50% { filter: drop-shadow(0 0 6px rgba(255, 220, 120, .95)); } }

/* Frames */
.avatar.framed { box-shadow: 0 0 0 2px var(--frame, #9aa3c7), 0 0 0 4px rgba(0, 0, 0, .35); }
.avatar.lg.framed { box-shadow: 0 0 0 4px var(--frame, #9aa3c7), 0 0 0 7px rgba(0, 0, 0, .35); }
.frame-silver { --frame: #c9d1e6; }
.frame-gold { --frame: #ffc94a; }
.frame-emerald { --frame: #2fd27a; }
.frame-neon { --frame: #38e8ff; filter: drop-shadow(0 0 6px rgba(56, 232, 255, .7)); }
.frame-sunset { --frame: #ff7a59; background: linear-gradient(135deg, #3a1f4d, #5a2a36) !important; }
.frame-ember { --frame: #ff6a1a; animation: frame-ember 1.6s ease-in-out infinite; }
.avatar.frame-rainbow, .avatar.frame-centurion { box-shadow: none; }
.avatar.frame-rainbow::before, .avatar.frame-centurion::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; z-index: -1;
  background: conic-gradient(#ff5470, #ffb547, #ffe066, #2fd27a, #38e8ff, #7c5cff, #ff5470); animation: ifx-spin 4s linear infinite; }
.avatar.lg.frame-rainbow::before, .avatar.lg.frame-centurion::before { inset: -6px; }
.avatar.frame-centurion::before { background: conic-gradient(#fff3c4, #ffc94a, #b8860b, #ffc94a, #fff3c4, #ffc94a, #b8860b, #fff3c4); }
.avatar.framed { isolation: isolate; }
@keyframes frame-ember { 0%, 100% { filter: drop-shadow(0 0 3px rgba(255, 106, 26, .6)); } 50% { filter: drop-shadow(0 0 10px rgba(255, 140, 40, .95)); } }

/* Name effects */
.uname { font-weight: 700; }
.nfx-blue { color: #8ab8ff; text-shadow: 0 0 8px rgba(79, 140, 255, .9); }
.nfx-green { color: #8ff0b5; text-shadow: 0 0 8px rgba(47, 210, 122, .85); }
.nfx-pink { color: #ff9ad5; text-shadow: 0 0 8px rgba(255, 84, 180, .85); }
.nfx-gold { color: #ffd76a; text-shadow: 0 0 8px rgba(255, 190, 60, .9); }
.nfx-frost { color: #e6f7ff; text-shadow: 0 0 4px #9be7ff, 0 0 12px rgba(120, 210, 255, .9); }
.nfx-fire { background: linear-gradient(0deg, #ff4d00, #ffb300, #ffe680); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 4px rgba(255, 100, 0, .7)); animation: nfx-flicker 1.4s infinite; }
.nfx-ocean, .nfx-rainbow, .nfx-legendary, .nfx-prismatic { -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% auto; animation: nfx-shift 3s linear infinite; }
.nfx-ocean { background-image: linear-gradient(90deg, #38e8ff, #4f8cff, #2fd2b0, #38e8ff); }
.nfx-rainbow { background-image: linear-gradient(90deg, #ff5470, #ffb547, #ffe066, #2fd27a, #38e8ff, #7c5cff, #ff5470); }
.nfx-legendary { background-image: linear-gradient(90deg, #b8860b, #ffd76a, #fff6d1, #ffd76a, #b8860b); filter: drop-shadow(0 0 5px rgba(255, 200, 80, .6)); }
.nfx-prismatic { background-image: linear-gradient(90deg, #fff, #a0f0ff, #e0a8ff, #fff, #a0ffd0, #fff); filter: drop-shadow(0 0 5px rgba(200, 220, 255, .7)); }
@keyframes nfx-shift { to { background-position: 200% center; } }
@keyframes nfx-flicker { 0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 100, 0, .7)); } 50% { filter: drop-shadow(0 0 9px rgba(255, 160, 0, .95)); } }

/* Titles */
.utitle { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--muted); vertical-align: 2px; white-space: nowrap; }
.utitle.big { font-size: .82rem; padding: 2px 9px; }
.utitle.r-rare { color: #8ab8ff; border-color: rgba(79, 140, 255, .5); }
.utitle.r-epic { color: #c7a8ff; border-color: rgba(124, 92, 255, .6); }
.utitle.r-legendary { color: #ffd76a; border-color: rgba(255, 201, 74, .6); background: rgba(255, 201, 74, .08); }

/* Backgrounds (profile banners, player cards, store previews) */
.bg-ocean { background: linear-gradient(160deg, #0b3d6b, #0e6b8f 50%, #1aa3b8) !important; }
.bg-dunes { background: linear-gradient(170deg, #f6c177 0%, #e08b4f 45%, #9c4f2f 100%) !important; }
.bg-forest { background: linear-gradient(175deg, #1d3b2a, #24573a 55%, #3d7b4c) !important; }
.bg-sakura { background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .35) 0 3px, transparent 4px) 0 0/40px 40px, linear-gradient(160deg, #f7a8c4, #c9608c) !important; }
.bg-nightcity { background: linear-gradient(0deg, rgba(255, 196, 0, .25) 0 2px, transparent 2px) 0 0/22px 18px, linear-gradient(180deg, #0a0f2c, #1c1f4a 60%, #392b5c) !important; }
.bg-topo { background: repeating-radial-gradient(circle at 30% 40%, transparent 0 14px, rgba(160, 220, 180, .22) 15px 16px), linear-gradient(160deg, #1f3a33, #284b40) !important; }
.bg-starry { background: radial-gradient(circle, #fff 0 1px, transparent 1.5px) 0 0/34px 34px, radial-gradient(circle, rgba(255,255,255,.7) 0 1px, transparent 1.5px) 17px 13px/46px 46px, linear-gradient(180deg, #050816, #14163a) !important; }
.bg-volcano { background: radial-gradient(ellipse at 50% 110%, #ff5a1f 0%, #9c1d0b 35%, #2a0d0b 75%) !important; }
.bg-goldenhour { background: linear-gradient(170deg, #ffcf7a, #f08a4b 50%, #7a3b6e) !important; }
.bg-sunrise { background: linear-gradient(0deg, #ffb26b, #ff7b89 45%, #6a5acd) !important; }
.bg-aurora { background: linear-gradient(120deg, rgba(47, 210, 122, .55), rgba(56, 232, 255, .35), rgba(124, 92, 255, .55)), linear-gradient(180deg, #050b1f, #0e1a3a) !important;
  background-size: 300% 300%, auto !important; animation: bg-aurora 10s ease-in-out infinite; }
@keyframes bg-aurora { 0%, 100% { background-position: 0% 50%, 0 0; } 50% { background-position: 100% 50%, 0 0; } }
.profile-banner[class*="bg-"] { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.profile-banner[class*="bg-"] .muted { color: rgba(255, 255, 255, .85); }

/* Store */
.store-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.balance { text-align: right; }
.balance-n { font-size: 1.6rem; }
.store-tabs { margin: 16px 0; }
.pack-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .pack-grid { grid-template-columns: repeat(2, 1fr); } }
.pack { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; }
.pack.popular { border-color: var(--gold); }
.pack-flag { position: absolute; top: -10px; background: var(--gold); color: #3a2400; font-size: .7rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; }
.pack-miles { font-size: 1.8rem; font-weight: 900; color: var(--gold); margin-top: 8px; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.item-card { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.item-card.r-rare { border-color: rgba(79, 140, 255, .45); }
.item-card.r-epic { border-color: rgba(124, 92, 255, .55); }
.item-card.r-legendary { border-color: rgba(255, 201, 74, .6); box-shadow: 0 0 18px rgba(255, 201, 74, .08) inset; }
.item-card.owned { background: linear-gradient(180deg, rgba(47, 210, 122, .06), var(--bg)); }
.ipv { height: 92px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--panel-2); overflow: hidden; }
.ipv-bg { background-color: var(--panel-2); }
.ipv-text { padding: 0 8px; text-align: center; }
.pv-name { font-size: 1.15rem; }
.item-meta { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.rar { font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.rar.r-rare { color: #8ab8ff; } .rar.r-epic { color: #c7a8ff; } .rar.r-legendary { color: #ffd76a; }
.locked { color: var(--muted); text-align: center; padding: 6px 0; }
.pcard { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--panel-2); color: var(--text); }
.pcard.big { padding: 18px 20px; }
.pcard-name { font-size: 1.1rem; }
.pcard[class*="bg-"] { text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.locker-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.buy-preview { margin: 4px 0; }
.buy-modal { min-width: min(380px, 80vw); }

/* Achievements */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ach { display: flex; gap: 10px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); opacity: .75; }
.ach.done { opacity: 1; border-color: rgba(47, 210, 122, .45); background: linear-gradient(180deg, rgba(47, 210, 122, .07), var(--bg)); }
.ach-ico { font-size: 1.6rem; width: 36px; text-align: center; flex: none; filter: grayscale(1); }
.ach.done .ach-ico, .ach-unlock .ach-ico { filter: none; }
.ach-body { min-width: 0; flex: 1; }
.ach-bar { height: 6px; border-radius: 4px; background: var(--panel-2); margin: 6px 0 2px; overflow: hidden; }
.ach-bar > div { height: 100%; background: var(--accent); }
.ach-reward { margin-top: 4px; color: var(--gold); }
.rewards-box { max-width: 520px; margin: 12px auto 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.reward-line { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); flex-wrap: wrap; }
.reward-line > div { flex: 1; min-width: 0; }
.ach-unlock { border-color: rgba(255, 201, 74, .5); animation: pop-in .5s ease; }
@keyframes pop-in { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .ifx-spin, .ifx-pulse, .ifx-float, .ifx-sparkle, .nfx-fire, .nfx-ocean, .nfx-rainbow, .nfx-legendary, .nfx-prismatic, .bg-aurora,
  .avatar.frame-rainbow::before, .avatar.frame-centurion::before, .frame-ember, .ach-unlock { animation: none !important; }
}

/* ===================== Side menu (classic rail) ===================== */
:root { --rail-w: 248px; --rail-mini: 68px; }
.shell { display: flex; flex: 1; min-height: 100vh; }
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-left: var(--rail-w); }
/* The menu is fixed to the left edge and always runs the full height of the window, however far the page scrolls. */
.rail { position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; height: 100dvh; width: var(--rail-w); flex: none; z-index: 40; display: flex; flex-direction: column; gap: 2px;
  padding: 14px 12px; background: #0a0e20; border-right: 1px solid var(--line); overflow-x: hidden; overflow-y: auto;
  scrollbar-width: thin; transition: width .22s ease, box-shadow .22s ease; }
.rail-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text); padding: 2px 8px 10px; white-space: nowrap; }
.rail-brand:hover { text-decoration: none; }
.rail-brand b { color: var(--accent); }
.rail-brand .brand-mark { font-size: 1.4rem; width: 28px; text-align: center; flex: none; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-sec { font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 12px 10px 4px; white-space: nowrap; height: 30px; }
.rail-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.rail-item:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.rail-item.on { background: linear-gradient(90deg, rgba(79, 140, 255, .25), rgba(124, 92, 255, .1)); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.rail-item.cta { color: var(--gold); }
.rail-item .ico { width: 24px; text-align: center; font-size: 1.1rem; flex: none; display: inline-flex; justify-content: center; }
.rail-item .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.rail-grow { flex: 1; min-height: 12px; }
.rail-pin { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .8rem; cursor: pointer; white-space: nowrap; border-radius: 10px; }
.rail-pin:hover { color: var(--text); background: var(--panel-2); }
.rail-pin .sw { width: 30px; height: 17px; border-radius: 9px; background: var(--line); position: relative; flex: none; transition: background .2s; margin: 0 -3px; }
.rail-pin .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: left .2s; }
.rail-pin .sw.on { background: var(--accent); }
.rail-pin .sw.on::after { left: 15px; }
.rail-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--bg-2); display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.rail-me { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.rail-me:hover { text-decoration: none; }
.rail-me .avatar { width: 40px; height: 40px; font-size: 22px; }
.rail-me-name { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rail-me-name .uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-xp { height: 5px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.rail-xp i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.rail-foot { display: flex; align-items: center; gap: 8px; }
.rail-miles { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--gold) !important; font-variant-numeric: tabular-nums; }
.rail-out { margin-left: auto; background: none; border: 1px solid var(--line); color: #ff8a9d; border-radius: 8px; padding: 4px 10px; cursor: pointer; font: inherit; font-weight: 700; font-size: .78rem; }
.rail-out:hover { border-color: var(--bad); }
.rail-auth { padding: 8px; gap: 6px; }
.rail-auth .ico-only { display: none; }

/* Auto-hide (and during matches): an icon rail that slides open over the page when you point at it */
body.rail-autohide .rail, body.in-match .rail { position: fixed; left: 0; top: 0; width: var(--rail-mini); }
body.rail-autohide .shell-main, body.in-match .shell-main { margin-left: var(--rail-mini); }
body.rail-autohide .rail:hover, body.in-match .rail:hover { width: var(--rail-w); box-shadow: 24px 0 50px rgba(0, 0, 0, .5); }
:is(body.rail-autohide, body.in-match) .rail:not(:hover) :is(.lbl, .rail-item .badge) { display: none; }
:is(body.rail-autohide, body.in-match) .rail:not(:hover) .rail-sec span { visibility: hidden; }
:is(body.rail-autohide, body.in-match) .rail:not(:hover) .rail-sec { height: 12px; padding: 0; }
:is(body.rail-autohide, body.in-match) .rail:not(:hover) .rail-item.has-badge::after { content: ""; position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
:is(body.rail-autohide, body.in-match) .rail:not(:hover) .rail-card { padding: 4px 0; border-color: transparent; background: none; align-items: center; }
:is(body.rail-autohide, body.in-match) .rail:not(:hover) .rail-auth .ico-only { display: inline; }
:is(body.rail-autohide, body.in-match) .rail:not(:hover) .rail-auth .btn { padding: 8px 0; }
:is(body.rail-autohide, body.in-match) .rail:not(:hover) .rail-pin { justify-content: center; }

/* Mobile: a slim top bar with a menu button; the rail becomes a drawer */
.mobilebar { display: none; }
.rail-scrim { display: none; }
@media (max-width: 860px) {
  .mobilebar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; padding: 8px 12px; height: 54px;
    background: rgba(9, 13, 30, .96); border-bottom: 1px solid var(--line); }
  .mobilebar .rail-brand { padding: 0; font-size: 1.05rem; }
  .mb-menu { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 1.2rem; cursor: pointer; }
  .rail, body.rail-autohide .rail, body.in-match .rail { position: fixed; left: 0; top: 0; width: min(var(--rail-w), 82vw); transform: translateX(-105%); transition: transform .25s ease; box-shadow: none; }
  .shell-main, body.rail-autohide .shell-main, body.in-match .shell-main { margin-left: 0; }
  :is(body.rail-autohide, body.in-match) .rail:not(:hover) :is(.lbl, .rail-item .badge) { display: revert; }
  :is(body.rail-autohide, body.in-match) .rail:not(:hover) .rail-sec span { visibility: visible; }
  :is(body.rail-autohide, body.in-match) .rail:not(:hover) .rail-sec { height: 30px; padding: 12px 10px 4px; }
  :is(body.rail-autohide, body.in-match) .rail:not(:hover) .rail-card { padding: 10px; border-color: var(--line); background: var(--bg-2); align-items: stretch; }
  body.rail-open .rail { transform: none; box-shadow: 24px 0 50px rgba(0, 0, 0, .5); }
  body.rail-open .rail-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .5); }
  .rail-pin { display: none; }
}

/* Pages */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head > div:first-child { flex: 1; min-width: 220px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }

/* Nameplate showcase (emblem + name + title on the player's background) */
.nameplate { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.nameplate.big { padding: 24px; gap: 20px; min-height: 140px; }
.nameplate.big .np-name { font-size: 1.7rem; font-weight: 800; }
.nameplate .np-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nameplate .np-meta { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.nameplate .np-tag { position: absolute; top: 10px; right: 14px; font-size: .65rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.nameplate[class*="bg-"] { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 14px; }
@media (max-width: 1100px) { .slots { grid-template-columns: repeat(3, 1fr); } }
.slot { text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg); cursor: pointer; color: var(--text); font: inherit; }
.slot:hover { border-color: var(--accent); }
.slot.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--panel-2); }
.slot .k { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
.slot .v { font-weight: 700; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card .src { font-size: .65rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.item-card .src.src-ach { color: var(--gold); }
.item-card.equipped { border-color: var(--good); }
.ach-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.stat-card { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; }
.stat-card b { font-size: 1.3rem; }

/* ===================== Passport ===================== */
.passport-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.passport-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .passport-grid { grid-template-columns: minmax(0, 1fr); } }
.globe-panel { padding: 14px; }
.globe-wrap { position: relative; display: flex; justify-content: center; min-height: 280px; }
.globe-wrap canvas { cursor: grab; touch-action: none; display: block; }
.globe-wrap canvas:active { cursor: grabbing; }
.globe-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }
.globe-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; }
.lg-stamp { background: #f2b33d; } .lg-open { background: #2d4a9a; } .lg-none { background: #22305f; }
.globe-tip { position: absolute; z-index: 5; max-width: 300px; min-width: 220px; background: rgba(12, 18, 42, .97); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; box-shadow: 0 14px 36px rgba(0, 0, 0, .5); pointer-events: none; font-size: .85rem; }
.tip-head { display: flex; align-items: center; gap: 6px; }
.tip-stamp { margin-left: auto; font-size: .6rem; font-weight: 900; letter-spacing: .12em; color: #ff6b78; border: 2px solid #ff6b78; border-radius: 6px; padding: 1px 6px; transform: rotate(-6deg); }
.tip-sub { color: var(--muted); margin: 4px 0 6px; }
.tip-list { display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow: hidden; }
.tip-list > div { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; border-top: 1px solid rgba(255, 255, 255, .06); padding-top: 2px; }
.stamp-panel { max-height: 720px; overflow: auto; }
.stamp-list { display: flex; flex-direction: column; gap: 4px; }
.stamp-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.stamp-row:hover, .stamp-row.on { background: var(--panel-2); border-color: var(--line); }
.stamp-row .sr-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.stamp-mini { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #d43040; color: #ff6b78; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 900; transform: rotate(-12deg); flex: none; }

/* Home: live numbers strip */
.live-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 4px; }
.live-strip:empty { min-height: 46px; }
.live-pill { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), var(--bg-2)); color: var(--muted); font-size: .95rem; white-space: nowrap; }
.live-pill b { color: var(--text); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.live-pill .lp-ico { font-size: 1rem; }
@media (max-width: 560px) { .live-strip { gap: 8px; } .live-pill { padding: 8px 10px; font-size: .82rem; gap: 6px; } .live-pill .lp-ico { display: none; } }
