/* OXIDPVP: launcher-style dark UI. Pure black, hot pink accent, soft glows, glassy panels. */
:root {
  color-scheme: dark;
  --bg: #000000;
  --bg-2: #070407;
  --surface: #0f0a0e;
  --surface-2: #171016;
  --surface-3: #21161f;
  --field: #070407;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --line-3: rgba(255, 255, 255, .22);
  --text: #f5eef3;
  --muted: #ab9aa7;
  --dim: #6b5b67;
  --on: #0a0508;
  --accent: #ff2e93;
  --accent-hi: #ff6fb5;
  --accent-lo: #c0136a;
  --accent-glow: rgba(var(--accent-rgb), .45);
  --accent-rgb: 255, 46, 147;
  --accent-hi-rgb: 255, 111, 181;
  --grad: linear-gradient(135deg, #ff8cc6 0%, #ff2e93 50%, #a3004f 100%);
  --p1: #ff5b3a;
  --p2: #4d8dff;
  --yellow: #facc15;
  --pink: #f472b6;
  --green: #22c55e;
  --danger: #f43f5e;
  --ok: #22c55e;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .8);
  --shadow-lg: 0 30px 80px -24px rgba(0, 0, 0, .9);
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* legacy names still used by a few game styles */
  --ink: var(--line-2);
  --border: var(--line);
  --border-strong: var(--line-2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: #000; border: 1.5px solid var(--accent);
  box-shadow: inset 0 0 10px -2px var(--accent-glow), 0 6px 20px -6px var(--accent-glow);
}
.brand-mark::after { content: ""; width: 10px; height: 10px; border: 3px solid var(--accent-hi); border-radius: 50%; box-shadow: 0 0 8px var(--accent-glow); }
.brand b { font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Hub: nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(0, 0, 0, .72); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.nav-in { max-width: 1160px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; gap: 22px; font-size: 14px; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); font-size: 12px; color: var(--muted);
}
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(34,197,94,.18); }

/* ---------- Hub: hero ---------- */
.hub { position: relative; overflow: hidden; isolation: isolate; }
.hub::before {
  content: ""; position: absolute; inset: -200px 0 auto; height: 760px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 320px at 22% 38%, rgba(var(--accent-rgb), .22), transparent 70%),
    radial-gradient(520px 300px at 78% 30%, rgba(var(--accent-hi-rgb), .10), transparent 70%);
}
.hub::after {
  content: ""; position: absolute; inset: 0 0 auto; height: 720px; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 20%, transparent 75%);
}
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 88px 0 72px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 6px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(16,10,15,.7); font-size: 13px; color: var(--muted); margin-bottom: 22px;
}
.eyebrow b { font-weight: 600; font-size: 11px; color: #fff; background: var(--grad); border-radius: 999px; padding: 2px 8px; }
.hero h1 { font-size: clamp(40px, 6.4vw, 72px); line-height: 1.02; letter-spacing: -0.045em; font-weight: 700; }
.grad-text { background: linear-gradient(100deg, #ffc2e0, #ff2e93 50%, #ff8cc6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { color: var(--muted); font-size: 17px; max-width: 480px; margin: 20px 0 32px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 28px; margin-top: 40px; flex-wrap: wrap; }
.hero-meta div { display: flex; flex-direction: column; }
.hero-meta b { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.hero-meta span { font-size: 13px; color: var(--dim); }

/* mock lobby window in the hero */
.mock {
  position: relative; border-radius: var(--r-lg); border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(26,16,23,.9), rgba(10,6,9,.95));
  box-shadow: var(--shadow-lg), 0 0 120px -40px var(--accent-glow);
  overflow: hidden; transform: perspective(1200px) rotateY(-8deg) rotateX(3deg);
}
.mock-bar { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.mock-bar span { margin-left: 10px; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.mock-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.mock-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); }
.mock-code { display: flex; gap: 8px; }
.mock-code span {
  flex: 1; height: 54px; display: grid; place-items: center; border-radius: 10px;
  font-family: var(--mono); font-size: 24px; font-weight: 600;
  background: var(--field); border: 1px solid var(--line-2);
}
.mock-code span:nth-child(2) { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.2); }
.mock-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.mock-row .avatar { width: 26px; height: 26px; font-size: 12px; }
.mock-row em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.mock-row em.on { color: var(--green); }
.mock-chat { display: flex; flex-direction: column; gap: 6px; font-size: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.mock-chat p { color: var(--muted); }
.mock-chat b { color: var(--accent-hi); font-weight: 600; margin-right: 6px; }

/* ---------- Hub: games ---------- */
.section { padding: 32px 0 24px; scroll-margin-top: 72px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.section-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.filters { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); flex-wrap: wrap; }
.filter { font-size: 13px; font-weight: 500; color: var(--muted); height: 32px; padding: 0 14px; border-radius: 8px; transition: background .15s, color .15s; }
.filter:hover { color: var(--text); }
.filter[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.game-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s, box-shadow .25s;
}
.game-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  background: radial-gradient(380px 220px at var(--mx, 50%) var(--my, 0%), rgba(var(--accent-hi-rgb),.13), transparent 60%);
  opacity: 0; transition: opacity .25s;
}
.game-card:hover { transform: translateY(-4px); border-color: rgba(var(--accent-hi-rgb),.35); box-shadow: 0 24px 60px -28px var(--accent-glow); }
.game-card:hover::before { opacity: 1; }
.card-art { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.card-art svg { width: 100%; height: 100%; display: block; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.game-card:hover .card-art svg { transform: scale(1.04); }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.game-card h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.game-card p { color: var(--muted); font-size: 14px; }
.badge-new {
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff;
  background: var(--grad); border-radius: 999px; padding: 2px 8px;
}
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.card-cta { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; }
.card-cta .arrow {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line-2); transition: background .2s, transform .2s, border-color .2s;
}
.game-card:hover .card-cta .arrow { background: var(--accent); border-color: var(--accent); transform: translateX(3px); }

.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.step .n {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 14px;
  font-family: var(--mono); font-weight: 600; font-size: 14px; color: var(--accent-hi);
  background: rgba(var(--accent-rgb),.12); border: 1px solid rgba(var(--accent-rgb),.3);
}
.step h4 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.step p { color: var(--muted); font-size: 14px; }

.hub-foot {
  margin-top: 64px; padding: 24px 0 40px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--dim);
}

/* ---------- Buttons ---------- */
.btn {
  height: 44px; padding: 0 18px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  font-weight: 600; font-size: 14px;
  transition: background .15s, border-color .15s, box-shadow .2s, transform .1s, filter .15s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { background: var(--surface-3); border-color: var(--line-3); }
.btn:active { transform: scale(.98); }
.btn.primary {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 8px 24px -10px var(--accent-glow);
}
.btn.primary:hover { filter: brightness(1.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 10px 30px -8px var(--accent-glow); }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.lg { height: 50px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .45; cursor: default; filter: none; transform: none; }

/* ---------- Game page ---------- */
.game-page {
  height: 100%; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(900px 500px at 50% -10%, rgba(var(--accent-rgb),.1), transparent 70%), var(--bg);
}
.topbar {
  flex: none; height: 60px; padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line); background: rgba(6,3,5,.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.topbar .back {
  font-size: 14px; color: var(--muted); display: inline-flex; gap: 8px; align-items: center;
  height: 34px; padding: 0 12px 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
}
.topbar .back:hover { color: var(--text); border-color: var(--line-2); }
.tb-title { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.scoreboard { display: flex; align-items: center; gap: 14px; padding: 5px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.scoreboard .side { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.scoreboard .name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoreboard .num { font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--text); min-width: 1.2ch; text-align: center; }
.scoreboard .sw { width: 10px; height: 10px; border-radius: 3px; }
.scoreboard .sep { color: var(--dim); }
.net { font-family: var(--mono); font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; min-width: 90px; justify-content: flex-end; }
.net .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.net.good .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.net.mid .dot { background: var(--yellow); }
.net.bad .dot { background: var(--danger); }

.stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 16px; position: relative; }
.stage canvas {
  display: block; border-radius: 14px; border: 1px solid var(--line-2);
  background: #0a0a0f; touch-action: none;
  box-shadow: var(--shadow-lg), 0 0 100px -50px var(--accent-glow);
}
.hint { flex: none; text-align: center; padding: 0 16px 16px; font-size: 12px; color: var(--dim); }
.hint kbd {
  font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--surface);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; margin: 0 2px;
}

/* ---------- Overlays (lobby + result) ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20;
  display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; overflow-y: auto;
  background: rgba(5, 5, 8, .7);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } }
.panel {
  position: relative; width: 100%; max-width: 420px;
  background: linear-gradient(180deg, rgba(24,14,21,.96), rgba(8,4,7,.98));
  border: 1px solid var(--line-2); border-radius: 20px;
  padding: 28px; box-shadow: var(--shadow-lg), 0 0 120px -50px var(--accent-glow);
  animation: rise .28s cubic-bezier(.2,.8,.2,1);
}
.panel::before {
  content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-hi-rgb),.7), transparent);
}
@keyframes rise { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.panel .back { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; }
.panel .back:hover { color: var(--text); }
.panel h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 6px; }
.panel .sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.panel .full { width: 100%; }
.or { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 12px; margin: 18px 0; text-transform: uppercase; letter-spacing: .12em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.join { display: flex; gap: 8px; }
.join input {
  flex: 1; min-width: 0; height: 44px; border-radius: 10px;
  background: var(--field); border: 1px solid var(--line-2); color: var(--text);
  font-family: var(--mono); font-size: 18px; font-weight: 500; letter-spacing: .3em; text-align: center; text-transform: uppercase;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.join input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.22); }
.join input::placeholder { color: var(--dim); letter-spacing: .3em; }

.invited {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 10px 12px; border-radius: 10px;
  background: rgba(var(--accent-rgb),.1); border: 1px solid rgba(var(--accent-rgb),.35); font-size: 14px;
}
.invited b { font-family: var(--mono); letter-spacing: .12em; color: var(--accent-hi); }
.invited-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-hi); box-shadow: 0 0 10px var(--accent); animation: pulse 1.2s ease-in-out infinite; flex: none; }

.wait { text-align: center; }
.wait .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }
.code {
  display: block; width: 100%; margin: 10px 0 12px; padding: 16px 0;
  font-family: var(--mono); font-size: 36px; font-weight: 600; letter-spacing: .3em; text-indent: .3em;
  border-radius: 12px; background: var(--field); border: 1px solid var(--line-2);
  transition: border-color .15s, box-shadow .15s;
}
.code:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.18); }
.hint-sm { font-size: 13px; margin-top: 10px; }
.wait .btn.ghost { margin-top: 16px; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 10px;
  background: var(--field); border: 1px solid var(--line-2); color: var(--text);
  font: inherit; font-weight: 500; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.22); }

.plist-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin: 20px 0 8px; }
.plist { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; text-align: left; }
.plist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); animation: rise .2s ease; }
.plist .pname { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptag { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 7px; }
.ptag.you { color: var(--accent-hi); border-color: rgba(var(--accent-rgb),.45); background: rgba(var(--accent-rgb),.1); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #db2777, #4d8dff); box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}

.status { min-height: 22px; margin-top: 16px; font-size: 13px; color: var(--muted); text-align: center; }
.status.error { color: var(--danger); }
.status.ok { color: var(--green); }
.status.pulse::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-hi); margin-right: 8px; vertical-align: 1px;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; } }

.result { text-align: center; }
.result .big { font-size: 44px; font-weight: 800; letter-spacing: -0.04em; }
.result .final { font-family: var(--mono); color: var(--muted); margin: 6px 0 24px; font-size: 18px; }
.result .row { display: flex; gap: 8px; }
.result .row > * { flex: 1; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: rgba(26,16,23,.95); border: 1px solid var(--line-2); border-radius: 12px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 10px 16px; font-size: 13px; font-weight: 500; z-index: 30; animation: rise .2s ease;
  box-shadow: var(--shadow); white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Chat ---------- */
.dock { position: fixed; right: 16px; bottom: 16px; z-index: 25; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.dock > * { pointer-events: auto; }
.dock-row { display: flex; gap: 8px; align-items: center; }
.dock-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; min-width: 42px; padding: 0 12px; border-radius: 999px;
  background: rgba(26,16,23,.92); border: 1px solid var(--line-2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 13px; font-weight: 600; color: var(--muted); box-shadow: var(--shadow); transition: border-color .15s, color .15s;
}
.dock-btn:hover { color: var(--text); border-color: var(--line-3); }
.dock-btn svg { width: 18px; height: 18px; }
.react-btn { font-size: 18px; padding: 0; }
.dock-pop {
  background: rgba(16,10,15,.97); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: rise .18s ease;
}
.react-pop { display: flex; gap: 2px; padding: 6px; }
.react-pop button { font-size: 24px; width: 44px; height: 44px; border-radius: 10px; transition: transform .1s, background .1s; }
.react-pop button:hover { background: var(--surface-3); transform: scale(1.15); }
.switch-pop { width: min(320px, calc(100vw - 32px)); max-height: min(460px, calc(100vh - 120px)); display: flex; flex-direction: column; overflow: hidden; }
.switch-list { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.switch-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; padding: 9px 12px; border-radius: 10px; border: 1px solid transparent; }
.switch-item b { font-weight: 600; font-size: 14px; }
.switch-item span { font-size: 12px; color: var(--muted); }
.switch-item:not(:disabled):hover { background: var(--surface-2); border-color: var(--line-2); }
.switch-item:disabled { opacity: .35; cursor: default; }
.react-float {
  position: fixed; bottom: 90px; z-index: 26; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  animation: floatUp 2.6s cubic-bezier(.2,.7,.3,1) forwards;
}
.react-float span { font-size: 44px; line-height: 1; filter: drop-shadow(0 6px 14px rgba(0,0,0,.5)); }
.react-float small { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: rgba(16,10,15,.9); border: 1px solid var(--line-2); }
@keyframes floatUp { 0% { transform: translateY(20px) scale(.5); opacity: 0; } 12% { transform: translateY(0) scale(1.1); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-220px) scale(1); opacity: 0; } }
.conn-banner {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 999px;
  background: rgba(250,204,21,.12); border: 1px solid rgba(250,204,21,.45); color: #fde68a;
  font-size: 13px; font-weight: 600; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow); max-width: calc(100vw - 32px); animation: rise .2s ease;
}
.conn-banner::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); animation: pulse 1s ease-in-out infinite; flex: none; }
.spectating .topbar::after {
  content: "Spectating"; position: absolute; right: 120px; top: 50%; transform: translateY(-50%);
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-hi);
  padding: 2px 10px; border-radius: 999px; background: rgba(var(--accent-rgb),.14); border: 1px solid rgba(var(--accent-rgb),.4);
}
.spectating .topbar { position: relative; }
.profile { display: flex; gap: 8px; }
.profile .name { flex: 1; min-width: 0; }
.av-btn {
  flex: none; width: 44px; height: 44px; border-radius: 12px; font-size: 22px; display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25); transition: transform .1s;
}
.av-btn:hover { transform: scale(1.05); }
.av-picker { margin: -4px 0 14px; padding: 10px; border-radius: 12px; background: var(--field); border: 1px solid var(--line-2); animation: rise .15s ease; }
.av-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.av-grid button { font-size: 18px; aspect-ratio: 1; border-radius: 8px; }
.av-grid button:hover { background: var(--surface-3); }
.av-grid button.on { background: rgba(var(--accent-rgb),.25); box-shadow: inset 0 0 0 1px var(--accent); }
.av-colors { display: flex; gap: 6px; margin-top: 8px; justify-content: center; }
.av-colors button { width: 22px; height: 22px; border-radius: 50%; }
.av-colors button.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.avatar.emoji { font-size: 15px; }
.avatar.xs { width: 20px; height: 20px; font-size: 11px; display: inline-grid; vertical-align: -5px; margin-right: 6px; }
.lobby-extra:empty { display: none; }
.lobby-extra { text-align: left; margin-bottom: 14px; }
.wait-msg { font-size: 13px; margin-top: 14px; }
.chat-toggle {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px;
  background: rgba(26,16,23,.92); border: 1px solid var(--line-2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow);
  transition: border-color .15s, background .15s;
}
.chat-toggle:hover { border-color: var(--line-3); }
.chat-toggle[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chat-toggle svg { width: 17px; height: 17px; }
.chat-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  animation: pop .3s cubic-bezier(.2,1.6,.4,1);
}
.chat-peek {
  max-width: min(300px, calc(100vw - 32px)); padding: 9px 14px; cursor: pointer; border-radius: 12px 12px 4px 12px;
  background: rgba(26,16,23,.95); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  animation: rise .2s ease;
}
.chat-panel {
  width: min(350px, calc(100vw - 32px)); height: min(420px, calc(100vh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  background: rgba(16,10,15,.97); border: 1px solid var(--line-2); border-radius: 18px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
  animation: rise .2s ease;
}
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.chat-close { font-size: 22px; line-height: 1; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); }
.chat-close:hover { background: var(--surface-2); color: var(--text); }
.chat-log { list-style: none; flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; overscroll-behavior: contain; }
.chat-log li { line-height: 1.4; overflow-wrap: anywhere; }
.chat-log li b { font-weight: 600; margin-right: 6px; color: var(--accent-hi); }
.chat-log li .avatar.xs { margin-right: 6px; }
.chat-log li.me b { color: var(--p2); }
.chat-log li.sys { font-size: 12px; color: var(--dim); text-align: center; }
.chat-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; }
.chat-quick button { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); }
.chat-quick button:hover { color: var(--text); border-color: var(--accent); }
.chat-form { display: flex; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.chat-form input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px;
  background: var(--field); border: 1px solid var(--line-2); color: var(--text); font: inherit; outline: none;
}
.chat-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.2); }
.chat-form .btn { height: 40px; padding: 0 14px; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 56px 0 40px; gap: 40px; }
  .mock { transform: none; max-width: 460px; }
  .steps3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { overflow-x: auto; scrollbar-width: none; gap: 16px; mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .topbar { padding: 0 10px; height: 54px; gap: 8px; }
  .topbar .back span, .scoreboard .name { display: none; }
  .scoreboard { padding: 4px 10px; gap: 10px; }
  .net { min-width: 0; }
  .stage { padding: 8px; }
  .dock { right: 10px; bottom: 10px; }
  .chat-toggle span, .switch-btn span { display: none; }
  .chat-toggle { padding: 0 13px; }
  .conn-banner { top: 62px; }
  .spectating .topbar::after { display: none; }
  .status-pill { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Hub: join by code, stats, features ---------- */
.code-join { display: flex; align-items: center; gap: 8px; margin-top: 22px; max-width: 420px; }
.code-join label { font-size: 14px; color: var(--muted); white-space: nowrap; }
.code-join input {
  flex: 1; min-width: 0; height: 44px; border-radius: 10px; padding: 0 12px;
  background: var(--field); border: 1px solid var(--line-2); color: var(--text);
  font-family: var(--mono); font-size: 17px; font-weight: 500; letter-spacing: .25em; text-transform: uppercase; outline: none;
}
.code-join input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.22); }
.code-join input::placeholder { color: var(--dim); }
.code-err { min-height: 20px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.card-record { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.stat { padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; }
.stat b { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.stat span { font-size: 13px; color: var(--muted); }
.stat-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.stat-game { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.stat-game:hover { border-color: var(--line-3); }
.stat-game span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.stat-game i { position: absolute; left: 0; bottom: 0; height: 2px; width: var(--p); background: var(--grad); }
.features { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.features span { font-size: 13px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
@media (max-width: 640px) {
  .stat-row { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; }
  .stat b { font-size: 22px; }
}
.pub-toggle { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--field); border: 1px solid var(--line-2); font-size: 13px; color: var(--muted); text-align: left; cursor: pointer; }
.pub-toggle input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.pub-toggle a { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Rooms + leaderboard pages ---------- */
.nav-links a[aria-current="page"] { color: var(--text); }
.page { padding-top: 48px; padding-bottom: 60px; min-height: 70vh; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(32px, 5vw, 44px); font-weight: 700; letter-spacing: -0.04em; }
.page-head p { max-width: 560px; margin-top: 6px; }
.page-head select {
  height: 40px; padding: 0 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font: inherit;
}
.room-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.room-card { padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; animation: rise .2s ease; }
.room-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.room-top b { font-size: 16px; }
.room-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.room-status.open { color: #86efac; border-color: rgba(34,197,94,.5); background: rgba(34,197,94,.1); }
.room-status.watch { color: var(--accent-hi); border-color: rgba(var(--accent-rgb),.5); background: rgba(var(--accent-rgb),.1); }
.room-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.room-card .btn.disabled { opacity: .4; pointer-events: none; }
.empty { text-align: center; padding: 60px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-ico { font-size: 48px; }
.empty h2 { font-size: 22px; }
.refresh { font-size: 12px; margin-top: 18px; }
.lb { border-radius: 16px; border: 1px solid var(--line); overflow: hidden; background: var(--surface); }
.lb-row { display: grid; grid-template-columns: 48px 1fr 56px 56px 56px 72px; gap: 8px; align-items: center; padding: 10px 16px; font-size: 14px; }
.lb-row + .lb-row, #rows .lb-row { border-top: 1px solid var(--line); }
.lb-row span:nth-child(n+3) { font-family: var(--mono); text-align: right; color: var(--muted); }
.lb-row span:nth-child(2) { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-head { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); background: var(--bg-2); }
.lb-head span { font-weight: 500 !important; color: var(--dim) !important; }
.lb-row.top span:nth-child(1) { font-size: 18px; }
.lb-row.t0 { background: rgba(250,204,21,.07); }
.lb-row.me { box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 520px) { .lb-row { grid-template-columns: 34px 1fr 40px 40px 0 56px; } .lb-row span:nth-child(5) { display: none; } }
.open-rooms a { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #86efac; }
.open-rooms i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.4s ease-in-out infinite; }

/* Sam corner: a tiny dot in the bottom-left of the home page. */
.sam-corner { position: fixed; left: 10px; bottom: 10px; z-index: 50; display: flex; align-items: center; gap: 8px; }
.sam-dot { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 50%; background: var(--line-3); cursor: pointer; opacity: .6; transition: opacity .2s, transform .2s; }
.sam-dot:hover, .sam-dot:focus-visible { opacity: 1; transform: scale(1.4); background: var(--accent); }
.sam-dot::before { content: ""; position: absolute; inset: -6px; } /* easier to tap */
.sam-dot { position: relative; }
.sam-msg { font: 500 12px/1 var(--mono); color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 10px; opacity: 0; transform: translateX(-4px); pointer-events: none; transition: opacity .2s, transform .2s; white-space: nowrap; }
.sam-msg.on { opacity: 1; transform: none; }

/* ---------- Touch controls ---------- */
body { touch-action: manipulation; }
.touch-ui { display: none; }
body.touching .touch-ui { display: block; }
.touch-ui .tz { position: fixed; bottom: 24px; z-index: 15; display: flex; align-items: flex-end; gap: 14px; }
.touch-ui .tz-left { left: 24px; }
.touch-ui .tz-right { right: 24px; bottom: 88px; flex-direction: row-reverse; }
.t-btn { -webkit-tap-highlight-color: transparent; touch-action: none; user-select: none; border: 1px solid var(--line-3); background: rgba(26,16,23,.72); backdrop-filter: blur(6px); color: var(--text); border-radius: 18px; }
.t-btn.on { background: var(--accent); border-color: var(--accent); }
.t-action { width: 76px; height: 76px; border-radius: 50%; font: 700 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.t-dpad { display: grid; grid-template: repeat(3, 58px) / repeat(3, 58px); gap: 4px; }
.t-dpad .t-btn { position: relative; }
.t-dpad .t-btn::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border: 9px solid transparent; }
.t-up { grid-area: 1 / 2; } .t-up::after { border-bottom-color: var(--text) !important; border-top-width: 0 !important; }
.t-down { grid-area: 3 / 2; } .t-down::after { border-top-color: var(--text) !important; border-bottom-width: 0 !important; }
.t-left { grid-area: 2 / 1; } .t-left::after { border-right-color: var(--text) !important; border-left-width: 0 !important; }
.t-right { grid-area: 2 / 3; } .t-right::after { border-left-color: var(--text) !important; border-right-width: 0 !important; }
.t-stick { position: relative; width: 132px; height: 132px; border-radius: 50%; border: 1px solid var(--line-3); background: rgba(26,16,23,.5); backdrop-filter: blur(6px); touch-action: none; display: grid; place-items: center; }
.t-stick i { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.22); border: 1px solid var(--line-3); pointer-events: none; }
.t-stick.on i { background: var(--accent); transition: none; }
.t-stick span { position: absolute; bottom: -20px; font: 600 10px/1 var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Themes: accent presets (html[data-accent]) and light mode (html[data-theme=light]) ---------- */
:root[data-accent="blue"] { --accent: #3b82f6; --accent-hi: #60a5fa; --accent-lo: #1d4ed8; --accent-rgb: 59, 130, 246; --accent-hi-rgb: 96, 165, 250; --grad: linear-gradient(135deg, #93c5fd 0%, #2563eb 55%, #1e3a8a 100%); }
:root[data-accent="green"] { --accent: #22c55e; --accent-hi: #4ade80; --accent-lo: #15803d; --accent-rgb: 34, 197, 94; --accent-hi-rgb: 74, 222, 128; --grad: linear-gradient(135deg, #86efac 0%, #16a34a 55%, #14532d 100%); }
:root[data-accent="violet"] { --accent: #8b5cf6; --accent-hi: #a78bfa; --accent-lo: #6d28d9; --accent-rgb: 139, 92, 246; --accent-hi-rgb: 167, 139, 250; --grad: linear-gradient(135deg, #a78bfa 0%, #7c3aed 55%, #5b21b6 100%); }
:root[data-accent="pink"] { --accent: #ec4899; --accent-hi: #f472b6; --accent-lo: #be185d; --accent-rgb: 236, 72, 153; --accent-hi-rgb: 244, 114, 182; --grad: linear-gradient(135deg, #f9a8d4 0%, #db2777 55%, #831843 100%); }
:root[data-accent="orange"] { --accent: #f97316; --accent-hi: #fb923c; --accent-lo: #c2410c; --accent-rgb: 249, 115, 22; --accent-hi-rgb: 251, 146, 60; --grad: linear-gradient(135deg, #fdba74 0%, #ea580c 55%, #7c2d12 100%); }
:root[data-accent="red"] { --accent: #ef4444; --accent-hi: #f87171; --accent-lo: #b91c1c; --accent-rgb: 239, 68, 68; --accent-hi-rgb: 248, 113, 113; --grad: linear-gradient(135deg, #fca5a5 0%, #dc2626 55%, #7f1d1d 100%); }
:root[data-accent="teal"] { --accent: #14b8a6; --accent-hi: #2dd4bf; --accent-lo: #0f766e; --accent-rgb: 20, 184, 166; --accent-hi-rgb: 45, 212, 191; --grad: linear-gradient(135deg, #99f6e4 0%, #0d9488 55%, #134e4a 100%); }
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fff5fa; --bg-2: #fce7f2; --surface: #ffffff; --surface-2: #fdf0f7; --surface-3: #f9e1ee; --field: #ffffff;
  --line: rgba(15, 15, 30, .08); --line-2: rgba(15, 15, 30, .14); --line-3: rgba(15, 15, 30, .24);
  --text: #16161d; --muted: #55556a; --dim: #8a8a9c; --on: #ffffff;
  --shadow: 0 10px 30px -14px rgba(20, 20, 40, .25); --shadow-lg: 0 30px 80px -30px rgba(20, 20, 40, .35);
}
:root[data-theme="light"] .nav { background: rgba(255, 245, 250, .82); }
:root[data-theme="light"] .topbar { background: rgba(255, 255, 255, .75); }
:root[data-theme="light"] .eyebrow { background: rgba(255, 255, 255, .8); }
:root[data-theme="light"] .mock { background: linear-gradient(180deg, #ffffff, #f3f3f7); }
:root[data-theme="light"] .overlay { background: rgba(230, 230, 240, .7); }
:root[data-theme="light"] .panel { background: linear-gradient(180deg, #ffffff, #f7f7fb); }
:root[data-theme="light"] .grad-text { background: linear-gradient(100deg, var(--accent-lo), var(--accent) 50%, #c0136a); -webkit-background-clip: text; background-clip: text; }
:root[data-theme="light"] .game-page { background: radial-gradient(900px 500px at 50% -10%, rgba(var(--accent-rgb), .1), transparent 70%), var(--bg); }
:root[data-theme="light"] .t-btn, :root[data-theme="light"] .t-stick { background: rgba(255, 255, 255, .8); }
/* Konami code party mode */
:root.party body { animation: party-hue 4s linear infinite; }
@keyframes party-hue { to { filter: hue-rotate(360deg); } }

/* ---------- Settings panel ---------- */
.settings-overlay { z-index: 60; }
.panel.settings { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; text-align: left; }
.set-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.set-top h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.settings section { padding: 14px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.settings h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.set-profile { display: flex; align-items: center; gap: 12px; }
.avatar.lg { width: 48px; height: 48px; font-size: 24px; flex: none; }
.set-name { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 10px; background: var(--field); border: 1px solid var(--line-2); color: var(--text); font: 600 16px var(--sans); outline: none; }
.set-name:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2); }
.set-emojis { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.set-emojis button { aspect-ratio: 1; border-radius: 8px; font-size: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.set-emojis button.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .18); }
.set-colors, .set-accents { display: flex; gap: 8px; flex-wrap: wrap; }
.set-colors button, .set-accents button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-2); }
.set-colors button.on, .set-accents button.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); }
.set-note { font-size: 12px; color: var(--dim); }
.settings .seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; }
.settings .seg button { padding: 6px 16px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.settings .seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.set-row input[type=range] { width: 180px; accent-color: var(--accent); }
.set-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.dock-btn.gear svg { width: 18px; height: 18px; }

/* ---------- Achievements ---------- */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ach { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); opacity: .55; filter: grayscale(1); }
.ach.got { opacity: 1; filter: none; border-color: rgba(var(--accent-rgb), .45); background: linear-gradient(135deg, rgba(var(--accent-rgb), .12), var(--surface)); }
.ach-i { font-size: 26px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); flex: none; }
.ach b { display: block; font-size: 14px; font-weight: 600; }
.ach small { font-size: 12px; color: var(--muted); }

/* ---------- Daily Word ---------- */
.dw { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 20px 12px 24px; }
.dw-num { font-family: var(--mono); color: var(--muted); font-weight: 500; margin-left: 6px; }
.dw-grid { display: grid; gap: 6px; }
.dw-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dw-row.shake { animation: dw-shake .35s; }
.dw-tile { width: clamp(46px, 11vw, 60px); aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; border: 2px solid var(--line-2); font: 800 clamp(22px, 5vw, 30px)/1 var(--sans); text-transform: uppercase; }
.dw-tile.typed { border-color: var(--line-3); animation: pop .12s; }
.dw-tile.g { background: #16a34a; border-color: #16a34a; color: #fff; }
.dw-tile.y { background: #ca8a04; border-color: #ca8a04; color: #fff; }
.dw-tile.x { background: var(--surface-3); border-color: var(--surface-3); color: var(--muted); }
.dw-tile.flip { animation: dw-flip .5s ease both; }
@keyframes dw-flip { 0% { transform: rotateX(90deg); } 100% { transform: none; } }
@keyframes dw-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.dw-keys { display: flex; flex-direction: column; gap: 6px; width: min(520px, 100%); margin-top: auto; }
.dw-krow { display: flex; gap: 5px; justify-content: center; }
.dw-key, .dw-krow button { flex: 1; max-width: 46px; height: 54px; border-radius: 8px; background: var(--surface-3); color: var(--text); font: 700 15px var(--sans); touch-action: manipulation; }
.dw-key.wide { max-width: 72px; flex: 1.5; font-size: 12px; }
.dw-key.g { background: #16a34a; color: #fff; } .dw-key.y { background: #ca8a04; color: #fff; } .dw-key.x { background: var(--surface); color: var(--dim); }
.dw-done { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.dw-done strong { font-size: 24px; font-weight: 800; }
.dw-done span { color: var(--muted); font-size: 14px; }
.dw-done small { font: 500 12px var(--mono); color: var(--dim); }
.dw-stats { display: flex; gap: 18px; margin: 6px 0; }
.dw-stats div { display: flex; flex-direction: column; align-items: center; }
.dw-stats b { font: 700 22px var(--mono); }
.dw-stats span { font-size: 11px; }
:root[data-theme="light"] .toast, :root[data-theme="light"] .dock-btn, :root[data-theme="light"] .chat-toggle, :root[data-theme="light"] .chat-peek { background: rgba(255, 255, 255, .94); }
:root[data-theme="light"] .dock-pop, :root[data-theme="light"] .chat-panel { background: rgba(255, 255, 255, .98); }

/* ---------- Friends ---------- */
.fr-me { display: flex; align-items: center; gap: 10px; }
.fr-code { font: 700 26px var(--mono); letter-spacing: .18em; padding: 6px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); }
.fr-add { display: flex; gap: 8px; }
.fr-add input { text-transform: uppercase; font-family: var(--mono); letter-spacing: .12em; }
.fr-list { display: flex; flex-direction: column; gap: 6px; }
.fr-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.fr-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); flex: none; }
.fr-row.on .fr-dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.fr-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fr-who b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-who small { font-size: 12px; color: var(--muted); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12px; }
.invite-card { position: fixed; top: 76px; right: 16px; z-index: 70; width: min(320px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid rgba(var(--accent-rgb), .5); box-shadow: var(--shadow-lg), 0 0 40px -12px var(--accent-glow); display: flex; flex-direction: column; gap: 4px; animation: rise .25s ease; }
.invite-card b { font-size: 15px; }
.invite-card span { font-size: 13px; color: var(--muted); }
.invite-card .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* Faster first paint: skip rendering off-screen game cards until they scroll into view. */
.cards .game-card { content-visibility: auto; contain-intrinsic-size: auto 400px; }

/* ---------- Suggestions + changelog ---------- */
.sg-sort { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.sg-sort button { padding: 6px 16px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.sg-sort button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.sg-form { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); margin-bottom: 18px; }
.sg-form textarea, .sg-form input { width: 100%; border-radius: 10px; background: var(--field); border: 1px solid var(--line-2); color: var(--text); font: 500 15px var(--sans); padding: 10px 12px; outline: none; resize: vertical; }
.sg-form textarea:focus, .sg-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2); }
.sg-row { display: flex; gap: 10px; align-items: center; }
.sg-row input { flex: 1; max-width: 240px; }
.sg-count { margin-left: auto; font: 500 12px var(--mono); color: var(--dim); }
.sg-err { color: var(--danger); font-size: 13px; min-height: 18px; }
.sg-total { margin-bottom: 10px; font-size: 13px; }
.sg-list { display: flex; flex-direction: column; gap: 8px; }
.sg-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.sg-vote { display: flex; flex-direction: column; align-items: center; min-width: 48px; padding: 6px 0; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); }
.sg-vote span { font-size: 12px; } .sg-vote b { font: 700 16px var(--mono); color: var(--text); }
.sg-vote.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .16); color: var(--accent-hi); }
.sg-body p { font-size: 15px; line-height: 1.45; word-break: break-word; }
.sg-body small { font-size: 12px; color: var(--dim); }
.cl-list { display: flex; flex-direction: column; gap: 14px; }
.cl-item { display: grid; grid-template-columns: 130px 1fr; gap: 18px; padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.cl-item:first-child { border-color: rgba(var(--accent-rgb), .45); }
.cl-meta { display: flex; flex-direction: column; gap: 4px; }
.cl-v { font: 700 15px var(--mono); color: var(--accent-hi); }
.cl-meta time { font-size: 12px; color: var(--dim); }
.cl-item h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.cl-item ul { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 14px; }
.nav-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); margin-left: 5px; vertical-align: 2px; }
@media (max-width: 640px) { .cl-item { grid-template-columns: 1fr; gap: 8px; } .sg-row { flex-wrap: wrap; } .sg-row input { max-width: none; } }

.nav-links a { white-space: nowrap; }
.nav-icon { width: 38px; padding: 0; display: inline-grid; place-items: center; }
.nav-icon svg { width: 18px; height: 18px; }
@media (max-width: 1340px) { .nav .status-pill { display: none; } .nav-links { gap: 18px; } }
@media (max-width: 1100px) { .nav-in { gap: 18px; } .nav-links { gap: 14px; font-size: 13px; } }
.nav .btn { white-space: nowrap; }
@media (max-width: 480px) { .nav .btn.primary { padding: 0 12px; } .nav-right { gap: 6px; } }
.bot-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bot-row .btn { justify-content: center; }

/* ---------- Daily hub tabs, sudoku, chess puzzle ---------- */
.dtabs { flex: none; display: flex; justify-content: center; gap: 6px; padding: 10px 12px 0; }
.dtabs a { padding: 7px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); border: 1px solid transparent; }
.dtabs a[aria-current="page"] { color: var(--text); background: var(--surface-2); border-color: var(--line-2); }
.sd-top { display: flex; justify-content: space-between; width: min(470px, 100%); font-size: 14px; color: var(--muted); }
.sd-time { font-family: var(--mono); color: var(--text); }
.sd-grid { display: grid; grid-template-columns: repeat(9, 1fr); width: min(470px, 94vw); aspect-ratio: 1; border: 3px solid var(--text); border-radius: 10px; overflow: hidden; background: var(--surface); }
.sd-cell { border: 1px solid var(--line-2); font: 600 clamp(18px, 4.6vw, 26px) var(--sans); color: var(--accent-hi); background: var(--surface); display: grid; place-items: center; padding: 0; }
.sd-cell.given { color: var(--text); font-weight: 800; }
.sd-cell.br { border-right: 2px solid var(--text); } .sd-cell.bb { border-bottom: 2px solid var(--text); }
.sd-cell.peer { background: var(--surface-2); }
.sd-cell.same { background: rgba(var(--accent-rgb), .22); }
.sd-cell.sel { background: rgba(var(--accent-rgb), .45); color: #fff; }
.sd-cell.wrong { color: var(--danger) !important; }
.sd-pad { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; width: min(470px, 94vw); }
.sd-pad button { height: 50px; border-radius: 10px; background: var(--surface-3); color: var(--text); font: 700 20px var(--sans); touch-action: manipulation; }
.sd-pad button.full { opacity: .3; }
.sd-streak { font-size: 13px; color: var(--dim); }
.dc-who { font-size: 18px; font-weight: 700; }
.dc-tries { font-size: 14px; color: var(--muted); min-height: 20px; }
.sq-c.bad { box-shadow: inset 0 0 0 4px var(--danger); }
@media (max-width: 480px) { .sd-pad { grid-template-columns: repeat(5, 1fr); } }
.avatar { flex: none; }

/* ---------- Levels + cosmetics ---------- */
.avatar { position: relative; }
.av-lvl { position: absolute; right: -5px; bottom: -5px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line-3); color: var(--text); font: 800 9px/14px var(--mono); font-style: normal; text-align: center; }
.avatar.fr-1 { box-shadow: 0 0 0 2px #b45309; }
.avatar.fr-2 { box-shadow: 0 0 0 2px #d4d4d8, 0 0 8px rgba(255,255,255,.35); }
.avatar.fr-3 { box-shadow: 0 0 0 2px #facc15, 0 0 12px rgba(250,204,21,.55); }
.avatar.fr-4 { box-shadow: 0 0 0 2px #22d3ee, 0 0 14px #22d3ee; }
.avatar.fr-5 { box-shadow: 0 0 0 2px transparent; background-clip: padding-box; outline: 2px solid transparent; animation: fr-rainbow 3s linear infinite; }
@keyframes fr-rainbow { 0% { box-shadow: 0 0 0 2px #ef4444, 0 0 12px #ef4444; } 33% { box-shadow: 0 0 0 2px #22c55e, 0 0 12px #22c55e; } 66% { box-shadow: 0 0 0 2px #3b82f6, 0 0 12px #3b82f6; } 100% { box-shadow: 0 0 0 2px #ef4444, 0 0 12px #ef4444; } }
.avatar.fr-6 { box-shadow: 0 0 0 2px #ec4899, 0 0 0 4px #f9a8d4; }
.avatar.fr-7 { box-shadow: 0 0 0 2px #0ea5e9, 0 0 0 4px #fde047; }
.avatar.sm { width: 24px; height: 24px; font-size: 13px; display: inline-grid; place-items: center; }
.set-level { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.set-level small { color: var(--dim); font-family: var(--mono); }
.lvl-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.lvl-track i { display: block; height: 100%; background: var(--grad); border-radius: inherit; }
.set-frames { display: flex; flex-wrap: wrap; gap: 6px; }
.set-frames button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--text); }
.set-frames button.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .16); }
.locked { opacity: .35; filter: grayscale(1); cursor: not-allowed !important; }
.lvl-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 700 12px var(--mono); }
.lvl-pill i { width: 34px; height: 5px; border-radius: 999px; background: linear-gradient(90deg, var(--accent) var(--p), var(--surface-3) var(--p)); }
.lvl-card { min-width: 240px; display: grid; gap: 6px; font-size: 13px; }
.lvl-card small { color: var(--dim); font-family: var(--mono); }
.wk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.wk { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.wk > div { flex: 1; display: grid; gap: 6px; }
.wk b { font-size: 14px; } .wk small { font: 500 12px var(--mono); color: var(--dim); }
.wk.done { border-color: rgba(34,197,94,.5); } .wk.done .lvl-track i { background: var(--green); }
.wk-i { font-size: 24px; }
@media (max-width: 640px) { .lvl-pill i { display: none; } }

/* ---------- Seasonal themes ---------- */
:root[data-season="halloween"]:not([data-accent]) { --accent: #f97316; --accent-hi: #fb923c; --accent-lo: #c2410c; --accent-rgb: 249, 115, 22; --accent-hi-rgb: 251, 146, 60; --grad: linear-gradient(135deg, #fdba74 0%, #ea580c 55%, #7c2d12 100%); }
:root[data-season="winter"]:not([data-accent]) { --accent: #38bdf8; --accent-hi: #7dd3fc; --accent-lo: #0369a1; --accent-rgb: 56, 189, 248; --accent-hi-rgb: 125, 211, 252; --grad: linear-gradient(135deg, #e0f2fe 0%, #38bdf8 55%, #0c4a6e 100%); }
.season-layer { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.season-layer i { position: absolute; top: -40px; font-style: normal; opacity: .55; animation: season-fall linear infinite; }
.season-layer.halloween i { animation-name: season-float; top: auto; bottom: -40px; opacity: .4; }
@keyframes season-fall { to { transform: translateY(110vh) rotate(360deg); } }
@keyframes season-float { 0% { transform: translate(0, 0); } 50% { transform: translate(30px, -55vh); } 100% { transform: translate(-20px, -115vh); } }
@media (prefers-reduced-motion: reduce) { .season-layer { display: none; } }
.pw-set { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; font-size: 13px; color: var(--muted); }
.pw-set input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: 9px; background: var(--field); border: 1px solid var(--line-2); color: var(--text); font: 500 14px var(--sans); outline: none; }
.pw-ask { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px solid rgba(var(--accent-rgb), .5); background: rgba(var(--accent-rgb), .08); font-size: 13px; }
.react-pop:not([hidden]) { display: grid; }
.react-pop { grid-template-columns: repeat(8, auto); max-width: min(420px, calc(100vw - 32px)); }
.react-pop button.txt { grid-column: span 2; font: 700 13px var(--sans); width: auto; padding: 0 10px; color: var(--text); }
.react-float.txt span { font: 800 22px var(--sans); color: #fff; padding: 6px 12px; border-radius: 12px; background: rgba(var(--accent-rgb), .85); }
.plist li.has-prof { cursor: pointer; } .plist li.has-prof:hover { background: var(--surface-2); }
.prof-pop { z-index: 70; }
.panel.prof { width: min(380px, 100%); text-align: center; }
.prof-top { display: flex; justify-content: center; margin-bottom: 10px; }
.avatar.xl { width: 84px; height: 84px; font-size: 44px; }
.avatar.xl .av-lvl { min-width: 26px; height: 26px; font-size: 12px; line-height: 24px; }
.prof-lvl { color: var(--muted); font-size: 13px; margin: 2px 0 14px; }
.prof-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.prof-stats div { padding: 10px 6px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.prof-stats b { font: 700 16px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .prof-stats span { font-size: 11px; color: var(--dim); }
.nf { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 60px; }
.nf h1 { font-size: clamp(28px, 5vw, 44px); letter-spacing: -0.03em; }
.nf canvas { width: min(900px, 100%); height: auto; border-radius: 16px; border: 1px solid var(--line-2); touch-action: manipulation; cursor: pointer; }
.nf-score { font: 700 16px var(--mono); }
.nf .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- Boss key cover ---------- */
.boss-cover { position: fixed; inset: 0; z-index: 9999; background: #f1f3f4; overflow: auto; color: #202124; font: 15px/1.6 Arial, Helvetica, sans-serif; }
.boss-page { max-width: 816px; min-height: 100%; margin: 24px auto; padding: 72px 90px; background: #fff; box-shadow: 0 1px 3px rgba(60,64,67,.3); }
.boss-page h1 { font: 400 26px Arial, sans-serif; margin-bottom: 4px; }
.boss-page h2 { font: 700 17px Arial, sans-serif; margin: 22px 0 6px; }
.boss-page ul { padding-left: 22px; } .boss-page li { margin: 4px 0; }
.boss-meta { color: #5f6368; font-size: 13px; margin-bottom: 18px; }

/* ---------- Low-data mode ---------- */
.lowfx *, .lowfx *::before, .lowfx *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.lowfx .season-layer, .lowfx .hub::before, .lowfx .hub::after { display: none !important; }
.lowfx .btn.primary, .lowfx .game-card, .lowfx .panel { box-shadow: none !important; }

/* ---------- Crate / pass frames ---------- */
.avatar.fr-8 { box-shadow: 0 0 0 2px #fbcfe8, 0 0 0 4px #ec4899, 0 0 12px rgba(236,72,153,.6); }
.avatar.fr-9 { box-shadow: 0 0 0 2px #e0f2fe, 0 0 0 4px #7dd3fc, 0 0 16px #bae6fd; }
.avatar.fr-10 { animation: fr-fire 1.2s ease-in-out infinite alternate; }
@keyframes fr-fire { from { box-shadow: 0 0 0 2px #f97316, 0 0 10px #ef4444; } to { box-shadow: 0 0 0 2px #facc15, 0 0 18px #f97316; } }
.avatar.fr-11 { box-shadow: 0 0 0 2px #6366f1, 0 0 0 4px #1e1b4b, 0 0 16px #a855f7; }
.avatar.fr-12 { box-shadow: 0 0 0 2px #ff2e93, 0 0 0 4px #000, 0 0 0 5px #ff2e93, 0 0 18px rgba(255,46,147,.7); }

/* ---------- Titles ---------- */
.plist .pname .ptitle { display: block; font-size: 11px; font-weight: 600; color: var(--accent-hi); letter-spacing: .02em; line-height: 1.2; }
.prof-title { color: var(--accent-hi); font-weight: 600; font-size: 13px; margin-top: 2px; }
.prof-title:empty { display: none; }
.set-title { width: 100%; height: 40px; border-radius: 10px; padding: 0 12px; background: var(--field); color: var(--text); border: 1px solid var(--line-2); font: inherit; }
.set-custom { width: 44px; height: 30px; border: 0; background: none; padding: 0; cursor: pointer; }
.set-row.on .set-custom { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }
.settings .seg.set-bg { flex-wrap: wrap; }

/* ---------- Backgrounds (Settings → Look) ---------- */
:root[data-bg="glow"] { --bg-img: radial-gradient(1100px 620px at 50% -12%, rgba(var(--accent-rgb), .22), transparent 70%), radial-gradient(800px 500px at 100% 110%, rgba(var(--accent-rgb), .12), transparent 70%); }
:root[data-bg="grid"] { --bg-img: linear-gradient(rgba(var(--accent-rgb), .07) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--accent-rgb), .07) 1px, transparent 1px); --bg-size: 40px 40px; }
:root[data-bg="hearts"] { --bg-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M28 38s-10-6.5-10-13a5.5 5.5 0 0 1 10-3 5.5 5.5 0 0 1 10 3c0 6.5-10 13-10 13z' fill='%23ff2e93' fill-opacity='.09'/%3E%3C/svg%3E"); --bg-size: 56px 56px; }
:root[data-bg="stars"] { --bg-img: radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,.5), transparent), radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,.4), transparent), radial-gradient(1.5px 1.5px at 45% 85%, rgba(var(--accent-hi-rgb),.6), transparent), radial-gradient(1px 1px at 85% 15%, rgba(255,255,255,.45), transparent); --bg-size: 180px 180px; }
:root[data-bg] body, :root[data-bg] .game-page { background: var(--bg-img), var(--bg); background-size: var(--bg-size, auto); background-attachment: fixed; }

/* ---------- Home: search, favorites, Game of the Day ---------- */
.game-tools { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; margin: -6px 0 20px; }
.game-search { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.game-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2); }
.game-search svg { width: 18px; height: 18px; flex: none; }
.game-search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-size: 15px; }
.gotd { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 46px; border-radius: 12px; border: 1px solid rgba(var(--accent-rgb), .55); background: linear-gradient(90deg, rgba(var(--accent-rgb), .22), rgba(var(--accent-rgb), .06)); box-shadow: 0 0 30px -12px var(--accent-glow); transition: transform .15s; }
.gotd:hover { transform: translateY(-1px); }
.gotd-i { font-size: 20px; }
.gotd small { display: block; font-size: 11px; color: var(--accent-hi); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; line-height: 1.1; }
.gotd b { font-size: 15px; line-height: 1.2; }
.gotd-x { margin-left: 6px; font: 700 12px var(--mono); padding: 4px 8px; border-radius: 999px; background: var(--accent); color: #fff; }
.badge-gotd { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(var(--accent-rgb), .18); color: var(--accent-hi); border: 1px solid rgba(var(--accent-rgb), .45); white-space: nowrap; }
.fav-btn { position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; color: rgba(255,255,255,.8); background: rgba(0,0,0,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.12); opacity: 0; transition: opacity .15s, transform .15s; }
.game-card:hover .fav-btn, .fav-btn.on, .fav-btn:focus-visible, .touching .fav-btn { opacity: 1; }
@media (hover: none) { .fav-btn { opacity: 1; } }
.fav-btn:hover { transform: scale(1.1); }
.fav-btn.on { color: #ffd23f; border-color: rgba(255,210,63,.5); }
.no-games { color: var(--muted); padding: 30px 0; text-align: center; }
.no-games button { color: var(--accent-hi); text-decoration: underline; }

/* ---------- Profile page ---------- */
.pf-hero { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; padding: 28px; border-radius: 22px; margin-bottom: 18px;
  background: radial-gradient(600px 240px at 0% 0%, rgba(var(--accent-rgb), .25), transparent 70%), var(--surface); border: 1px solid rgba(var(--accent-rgb), .35); }
.pf-av .avatar.xl { width: 104px; height: 104px; font-size: 54px; }
.pf-id { flex: 1 1 260px; min-width: 0; }
.pf-id h1 { font-size: clamp(26px, 5vw, 38px); letter-spacing: -0.03em; line-height: 1.1; overflow-wrap: anywhere; }
.pf-title { color: var(--accent-hi); font-weight: 600; margin: 4px 0 12px; }
.pf-lvl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; max-width: 420px; }
.pf-lvl small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.pf-code { margin-top: 10px; font-size: 13px; }
.pf-code b { font-family: var(--mono); color: var(--text); letter-spacing: .08em; }
.pf-actions { display: flex; flex-direction: column; gap: 8px; }
.pf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.pf-stats .stat b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-bottom: 18px; }
.pf-card { padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 18px; }
.pf-grid .pf-card { margin-bottom: 0; }
.pf-card h2 { font-size: 18px; margin-bottom: 12px; display: flex; gap: 10px; align-items: baseline; }
.pf-card h2 small { font-size: 13px; font-weight: 500; }
.pf-card > p.muted { margin: -6px 0 14px; font-size: 14px; }
.pf-chart { display: flex; gap: 6px; height: 150px; align-items: flex-end; padding-bottom: 20px; }
.pf-col { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 6px; background: rgba(var(--accent-rgb), .05); }
.pf-col i { display: block; border-radius: 4px; min-height: 4px; }
.pf-col i.w, .pf-legend i.w { background: var(--accent); }
.pf-col i.l, .pf-legend i.l { background: #4b3a47; }
.pf-col i.d, .pf-legend i.d { background: #a78b9f; }
.pf-col span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--dim); }
.pf-legend { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.pf-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.pf-hist { list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.pf-hist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.pf-hist li b { flex: 1; font-weight: 500; }
.pf-hist time { color: var(--dim); font-size: 12px; }
.pf-r { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font: 700 12px var(--mono); flex: none; }
.pf-r.win { background: var(--accent); color: #fff; }
.pf-r.loss { background: #3a2a36; color: var(--muted); }
.pf-r.draw { background: #5c4a58; color: #fff; }
.pf-titles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.pf-t { text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; transition: border-color .15s; }
.pf-t:hover:not(:disabled) { border-color: var(--accent); }
.pf-t b { font-size: 14px; }
.pf-t small { font-size: 12px; color: var(--muted); }
.pf-t.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .15); box-shadow: 0 0 20px -8px var(--accent-glow); }
.pf-t.locked { opacity: .5; cursor: default; }
.pf-note { text-align: center; font-size: 13px; margin: 8px 0 40px; }

/* ---------- Admin ---------- */
.ad-login { max-width: 440px; display: flex; flex-direction: column; gap: 10px; }
.ad-in { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 10px; background: var(--field); border: 1px solid var(--line-2); color: var(--text); font: inherit; outline: none; }
.ad-in:focus { border-color: var(--accent); }
.ad-err { color: var(--danger); font-size: 14px; min-height: 1.2em; }
.ad-row { display: flex; gap: 8px; }
.ad-filter { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 12px; }
.ad-filter button { padding: 6px 14px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.ad-filter button.on { background: var(--surface); color: var(--text); }
.ad-list { display: flex; flex-direction: column; gap: 8px; }
.ad-sg { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.ad-votes { font: 700 13px var(--mono); color: var(--accent-hi); min-width: 48px; }
.ad-sg-body { flex: 1 1 240px; min-width: 0; }
.ad-sg-body p { overflow-wrap: anywhere; }
.ad-sg-body small { color: var(--dim); font-size: 12px; }
.ad-sg select { height: 34px; border-radius: 8px; background: var(--field); color: var(--text); border: 1px solid var(--line-2); padding: 0 8px; font: inherit; font-size: 13px; }
.ad-del { height: 34px; font-size: 13px; }
.ad-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.ad-chip { padding: 4px 10px; border-radius: 999px; background: rgba(var(--accent-rgb), .15); border: 1px solid rgba(var(--accent-rgb), .4); font: 600 12px var(--mono); }
.ad-sub { margin-top: 18px; font-size: 15px !important; }
.ad-top { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.ad-top li { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); }
.ad-top b { font-family: var(--mono); color: var(--accent-hi); }

/* ---------- Announcement bar + suggestion status ---------- */
.announce { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 44px 10px 16px; position: relative; text-align: center; font-size: 14px; font-weight: 500;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .28), rgba(var(--accent-rgb), .12)); border-bottom: 1px solid rgba(var(--accent-rgb), .45); }
.announce button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 8px; font-size: 18px; color: var(--muted); }
.announce button:hover { color: var(--text); background: rgba(255,255,255,.08); }
.sg-status { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-left: 8px; vertical-align: 1px; text-transform: uppercase; letter-spacing: .04em; }
.sg-status.planned { background: rgba(250, 204, 21, .15); color: #facc15; border: 1px solid rgba(250, 204, 21, .4); }
.sg-status.done { background: rgba(34, 197, 94, .15); color: #4ade80; border: 1px solid rgba(34, 197, 94, .4); }

/* ---------- Season pass ---------- */
.ps-hero { display: flex; gap: 24px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; margin-bottom: 24px; }
.ps-hero > div:first-child { flex: 1 1 360px; }
.ps-hero h1 { font-size: clamp(32px, 5vw, 48px); letter-spacing: -0.04em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ps-hero p.muted { max-width: 560px; margin-top: 6px; }
.ps-kicker { font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--accent-hi); }
.ps-now { flex: 0 1 320px; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid rgba(var(--accent-rgb), .4); }
.ps-now b { font-size: 20px; }
.ps-now small { color: var(--muted); font-size: 13px; }
.ps-now .btn { margin-top: 6px; }
.ps-track { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ps-tier { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 12px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: center; opacity: .6; }
.ps-tier.open, .ps-tier.got { opacity: 1; }
.ps-tier.open { border-color: var(--accent); box-shadow: 0 0 24px -10px var(--accent-glow); }
.ps-tier.big { background: radial-gradient(circle at 50% 0%, rgba(var(--accent-rgb), .2), transparent 70%), var(--surface); }
.ps-n { position: absolute; top: 8px; left: 10px; font: 700 12px var(--mono); color: var(--dim); }
.ps-i { font-size: 36px; line-height: 1.1; }
.ps-tier small { font-size: 12px; color: var(--muted); min-height: 2.6em; }
.ps-tier .btn { width: 100%; height: 34px; font-size: 13px; }
.ps-tier.got .ps-i { filter: grayscale(.2); }
.lb-row.lb-3 { grid-template-columns: 48px 1fr 160px; }
.lb-row.lb-4 { grid-template-columns: 48px 1fr 90px 90px; }
.lb-row.lb-5 { grid-template-columns: 48px 1fr 80px 56px 56px; }
@media (max-width: 520px) { .lb-row.lb-3 { grid-template-columns: 34px 1fr 110px; } .lb-row.lb-5 { grid-template-columns: 34px 1fr 64px 40px 40px; } .lb-row.lb-5 span:nth-child(5) { display: block; } }

/* ---------- Stickers ---------- */
.react-stickers { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px; align-items: center; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; }
.react-stickers button { font-size: 28px; width: 48px; height: 48px; border-radius: 12px; transition: transform .1s, background .1s; }
.react-stickers button:hover { background: rgba(var(--accent-rgb), .15); transform: scale(1.15) rotate(-6deg); }
.react-more { margin-left: auto; font-size: 12px; color: var(--accent-hi); padding: 0 8px; }
.react-float.sticker span { font-size: 96px; animation: sticker-in .6s cubic-bezier(.2,1.6,.4,1), sticker-wobble 1.2s ease-in-out .6s infinite; filter: drop-shadow(0 10px 24px rgba(var(--accent-rgb), .55)); display: inline-block; }
@keyframes sticker-in { from { transform: scale(0) rotate(-40deg); } }
@keyframes sticker-wobble { 50% { transform: rotate(8deg) scale(1.06); } }

/* ---------- Vote for the next game ---------- */
.poll-card { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 60; width: min(420px, calc(100vw - 24px)); padding: 14px; border-radius: 18px;
  background: rgba(16,10,15,.97); border: 1px solid rgba(var(--accent-rgb), .55); box-shadow: var(--shadow-lg), 0 0 60px -20px var(--accent-glow); animation: pop .25s cubic-bezier(.2,1.4,.4,1); }
:root[data-theme="light"] .poll-card { background: rgba(255,255,255,.98); }
.poll-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.poll-time { font: 700 13px var(--mono); color: var(--accent-hi); }
.poll-opts { display: flex; flex-direction: column; gap: 6px; }
.poll-opt { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); text-align: left; font-size: 14px; }
.poll-opt i { position: absolute; inset: 0 auto 0 0; background: rgba(var(--accent-rgb), .22); transition: width .3s; z-index: 0; }
.poll-opt b, .poll-opt span { position: relative; z-index: 1; }
.poll-opt span { font: 700 13px var(--mono); }
.poll-opt:hover:not(:disabled) { border-color: var(--accent); }
.poll-opt.mine { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.poll-opt.won { border-color: #4ade80; box-shadow: 0 0 20px -6px rgba(74,222,128,.7); }
.poll-opt:disabled { cursor: default; }
.poll-foot { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.switch-item.vote { border-color: rgba(var(--accent-rgb), .55); background: rgba(var(--accent-rgb), .12); }

/* ---------- DMs ---------- */
.dm-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font: 700 11px/18px var(--sans); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.friends-btn, #navFriends, .fr-chat { position: relative; }
.fr-chat { width: 36px; padding: 0; }
.dm-view { display: flex; flex-direction: column; gap: 10px; }
.dm-top { display: flex; align-items: center; gap: 10px; }
.dm-top small { color: var(--dim); font-size: 12px; margin-left: auto; text-align: right; }
.dm-log { list-style: none; display: flex; flex-direction: column; gap: 6px; height: min(50vh, 380px); overflow: auto; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.dm-log li { max-width: 80%; align-self: flex-start; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface-3); font-size: 14px; overflow-wrap: anywhere; }
.dm-log li.me { align-self: flex-end; background: var(--accent); color: #fff; border-radius: 14px 14px 4px 14px; }
.dm-log li.sys { align-self: center; background: none; color: var(--dim); font-size: 12px; }
.dm-form { display: flex; gap: 8px; }
.dm-form input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: 10px; background: var(--field); border: 1px solid var(--line-2); color: var(--text); font: inherit; outline: none; }
.dm-form input:focus { border-color: var(--accent); }

/* ---------- Clans ---------- */
.cl-mine { border-color: rgba(var(--accent-rgb), .45); background: radial-gradient(500px 200px at 0% 0%, rgba(var(--accent-rgb), .18), transparent 70%), var(--surface); }
.cl-mine-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cl-mine-top > div { flex: 1; min-width: 200px; }
.cl-mine-top h2 { margin: 0; font-size: 24px; }
.cl-tag { display: inline-grid; place-items: center; min-width: 76px; height: 60px; padding: 0 12px; border-radius: 14px; background: #000; border: 2px solid var(--accent); color: var(--accent-hi); font: 800 22px var(--mono); letter-spacing: .06em; box-shadow: 0 0 24px -6px var(--accent-glow); }
.cl-invite { margin: 12px 0; font-size: 14px; }
.cl-invite b { font-family: var(--mono); color: var(--accent-hi); }
.cl-members { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.cl-members li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.cl-members li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-members li small { color: var(--dim); font-size: 11px; }
.cl-form { display: flex; flex-direction: column; gap: 10px; }
.cl-form h2 { margin-bottom: 2px; }
.cl-form .muted { font-size: 13px; }
.cl-row { cursor: pointer; }
.cl-row:hover { background: var(--surface-2); }
.pf-link:hover { border-color: rgba(var(--accent-rgb), .6); }
