* { margin: 0; padding: 0; box-sizing: border-box; }

/* UI root: wraps all lobby UI (not canvases). Zoom scales everything on mobile. */
#ui-root {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
#ui-root > * { pointer-events: auto; }

@media (pointer: coarse) {
  #ui-root { zoom: 0.6; }
}
@media (pointer: coarse) and (orientation: landscape) {
  #ui-root { zoom: 0.42; }
}

:root {
  --bg: #070707;
  --card: #111111;
  --card-border: #1e1e1e;
  --gold: #F0B429;
  --gold-dark: #c8841a;
  --green: #14F195;
  --purple: #7C3AED;
  --text: #ffffff;
  --muted: #6b7280;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  transition: opacity 0.65s ease;
}

#bg-canvas-2 {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.65s ease;
}

#snake-canvas {
  transition: opacity 0.65s ease;
}

#snake-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hidden { display: none !important; }

/* ── Decorative snakes ────────────────────────────────────────────────── */
.deco-snake {
  position: fixed;
  width: 280px;
  height: 140px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.75;
  animation: snake-float 4s ease-in-out infinite;
}
@keyframes snake-float {
  0%,100% { transform: translateY(0) rotate(0deg); }
  33%      { transform: translateY(-6px) rotate(1deg); }
  66%      { transform: translateY(4px) rotate(-1deg); }
}

/* ── Top bar ──────────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-snake-icon { font-size: 1.3rem; }
.topbar-welcome { font-size: 0.9rem; color: #aaa; }
.topbar-welcome strong { color: var(--gold); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
#topbar-user { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: #ccc; }
#topbar-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.btn-google-top {
  display: flex; align-items: center; gap: 6px;
  background: #fff; color: #333;
  border: none; border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: opacity 0.2s;
}
.btn-google-top:hover { opacity: 0.9; }

/* ── Login screen ─────────────────────────────────────────────────────── */
.screen-center {
  position: relative; z-index: 5;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 32px;
}
.login-title { text-align: center; }
.login-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 32px 40px;
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
  min-width: 320px;
}
.login-desc { color: var(--muted); font-size: 0.9rem; text-align: center; }
.login-online { color: #444; font-size: 0.8rem; }
.login-online span { color: var(--green); font-weight: 700; }
.btn-google {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 13px 20px;
  background: #fff; color: #333;
  border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: opacity 0.2s;
  justify-content: center;
}
.btn-google:hover { opacity: 0.92; }

/* ── Game title ───────────────────────────────────────────────────────── */
.game-title {
  font-size: 3.8rem;
  font-weight: 900;
  letter-spacing: 3px;
  font-style: italic;
  text-transform: uppercase;
  color: #fff;
  line-height: 1;
  filter: drop-shadow(0 0 30px rgba(240,180,41,0.3));
}
.game-title span { color: var(--gold); }
.game-subtitle {
  font-size: 0.8rem;
  letter-spacing: 4px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 4px;
}

/* ── Lobby page ───────────────────────────────────────────────────────── */
.lobby-page {
  position: fixed;
  top: 52px; left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  padding: 24px 16px;
  gap: 20px;
}
.lobby-title-block { text-align: center; }

/* ── Three column grid ────────────────────────────────────────────────── */
/* Exact fixed widths: 260 + 14gap + 360 + 14gap + 260 = 908px total     */
/* Center of center column = 260+14+180 = 454px = half of 908px           */
/* So JOIN GAME button is always at exact horizontal center of screen      */
.lobby-grid {
  display: grid;
  grid-template-columns: 260px 360px 260px;
  gap: 14px;
  flex-shrink: 0;
}
.lobby-col { display: flex; flex-direction: column; gap: 14px; }
.lobby-col > .card:last-child { flex: 1; }
.lobby-col-center { }

/* ── Card ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
}
.card-header-left { display: flex; align-items: center; gap: 8px; }
.card-icon { font-size: 1rem; }
.card-title { font-size: 0.9rem; font-weight: 700; letter-spacing: 0.5px; }
.badge-live {
  font-size: 0.7rem; color: var(--green);
  background: rgba(20,241,149,0.12);
  border: 1px solid rgba(20,241,149,0.25);
  border-radius: 20px; padding: 2px 8px;
  font-weight: 600;
}
.btn-text-sm {
  background: none; border: none; color: var(--muted);
  font-size: 0.78rem; cursor: pointer; transition: color 0.2s;
}
.btn-text-sm:hover { color: #fff; }

/* ── Leaderboard ──────────────────────────────────────────────────────── */
.leaderboard-list {
  list-style: none; display: flex; flex-direction: column; gap: 6px;
}
.leaderboard-list li {
  display: flex; align-items: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  font-size: 0.85rem;
}
.rank { color: #444; width: 22px; font-weight: 700; }
.lb-name { flex: 1; margin-left: 6px; }
.lb-score { color: var(--gold); font-weight: 700; }

/* ── Account card ─────────────────────────────────────────────────────── */
.account-row {
  display: flex; align-items: center; gap: 10px;
}
.account-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #ff4444, #ff8800);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; flex-shrink: 0;
}
.account-avatar-img {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.account-info { flex: 1; min-width: 0; }
.account-name { font-weight: 700; font-size: 0.95rem; truncate: ellipsis; white-space: nowrap; overflow: hidden; }
.account-email { font-size: 0.72rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 0.95rem; opacity: 0.6; transition: opacity 0.2s; flex-shrink: 0; }
.btn-icon:hover { opacity: 1; }
.account-stats { display: flex; gap: 10px; }
.stat-box { flex: 1; background: rgba(255,255,255,0.04); border-radius: 8px; padding: 10px; text-align: center; }
.stat-val { font-size: 1.3rem; font-weight: 700; color: var(--gold); }
.stat-lbl { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.btn-signout {
  display: block; text-align: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 9px;
  color: var(--muted); font-size: 0.85rem;
  text-decoration: none; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-signout:hover { background: rgba(255,50,50,0.12); color: #ff7777; }

/* ── Play card ────────────────────────────────────────────────────────── */
.play-card { gap: 16px; }
.play-profile {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding-bottom: 4px;
}
.play-avatar-wrap {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #ff4444, #ff8800);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 0 3px rgba(240,180,41,0.3);
}
.play-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.play-avatar-fallback { font-size: 1.8rem; font-weight: 700; }
.play-username { font-size: 1.2rem; font-weight: 700; text-align: center; }
.name-input {
  width: 100%; display: block;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 11px 14px;
  color: #fff; font-size: 0.95rem;
  outline: none; transition: border-color 0.2s;
}
.name-input:focus { border-color: var(--gold); }
.name-input::placeholder { color: #444; }
.lobby-type-row {
  display: flex; gap: 8px; width: 100%;
}
.btn-lobby-type {
  flex: 1; padding: 11px 6px;
  background: transparent;
  border: 2px solid var(--gold);
  border-radius: 8px;
  color: var(--gold);
  font-size: 0.92rem; font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.5px;
}
.btn-lobby-type:hover { background: rgba(240,180,41,0.12); }
.btn-lobby-type.active {
  background: var(--gold);
  color: #000;
}

.btn-play {
  width: 100%; padding: 18px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
  border: none; border-radius: 10px;
  font-size: 1.15rem; font-weight: 900;
  cursor: pointer; letter-spacing: 2px;
  text-transform: uppercase;
  transition: transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(240,180,41,0.35);
  text-align: center;
}
.btn-play:hover { box-shadow: 0 6px 32px rgba(240,180,41,0.55); }
.btn-play:active { transform: scale(0.98); }
.server-stats-row {
  display: flex; align-items: center; justify-content: center;
  gap: 0; background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border); border-radius: 10px;
  overflow: hidden; width: 100%;
}
.global-winnings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(20,241,149,0.05);
  border: 1px solid rgba(20,241,149,0.15);
  border-radius: 10px;
  padding: 10px 16px;
  width: 100%;
  margin-top: 2px;
}
.global-winnings-lbl {
  font-size: 0.78rem;
  color: #9ca3af;
  font-weight: 500;
}
.global-winnings-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--green);
}
.server-stat { flex: 1; padding: 14px; text-align: center; }
.server-stat-val { font-size: 1.4rem; font-weight: 800; color: var(--gold); }
.server-stat-lbl { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 3px; }
.server-stat-divider { width: 1px; background: var(--card-border); height: 40px; }

/* ── Region row ───────────────────────────────────────────────────────── */
.server-region-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px 2px;
  width: 100%;
}
.region-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 20px;
  letter-spacing: 0.4px;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.region-na   { background: rgba(99,102,241,0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); opacity: 0.45; transition: opacity 0.2s, box-shadow 0.2s; }
.region-eu   { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); opacity: 0.45; transition: opacity 0.2s, box-shadow 0.2s; }
.region-na:hover, .region-eu:hover { opacity: 0.75; }
.region-selected { opacity: 1 !important; box-shadow: 0 0 0 2px currentColor; }
.region-asia { background: rgba(239,68,68,0.08);  color: #6b7280; border: 1px solid rgba(239,68,68,0.15); text-decoration: line-through; opacity: 0.3; cursor: default; pointer-events: none; }

/* ── Wallet card ──────────────────────────────────────────────────────── */
.wallet-balance-block { text-align: center; padding: 8px 0; }
.wallet-balance-usd {
  font-size: 1.8rem; font-weight: 800; color: var(--gold);
  text-shadow: 0 0 24px rgba(240,180,41,0.3);
  line-height: 1.1;
}
.wallet-balance-sol {
  font-size: 0.82rem; color: #666; margin-top: 3px;
}
.wallet-action-row { display: flex; gap: 8px; width: 100%; }
.btn-add-funds {
  flex: 1; padding: 11px;
  background: transparent;
  border: 2px solid var(--green);
  border-radius: 8px; color: var(--green);
  font-size: 0.88rem; font-weight: 700;
  cursor: pointer; transition: background 0.2s;
  text-align: center;
}
.btn-add-funds:hover { background: rgba(20,241,149,0.1); }
.btn-cash-out {
  flex: 1; padding: 11px;
  background: var(--purple);
  border: none; border-radius: 8px;
  color: #fff; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; transition: opacity 0.2s;
  text-align: center;
}
.btn-cash-out:hover { opacity: 0.88; }
.wallet-status-msg { font-size: 0.78rem; min-height: 14px; text-align: center; color: var(--muted); }

/* ── Modals ───────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #141828;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 28px;
  width: 320px;
  display: flex; flex-direction: column; gap: 14px;
}
.modal h3 { font-size: 1.1rem; }
.modal input[type="text"],
.modal input[type="number"] {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; padding: 10px 14px;
  color: #fff; font-size: 0.95rem; outline: none;
}
.modal-btns { display: flex; gap: 8px; }
.btn-small {
  flex: 1; padding: 10px;
  border: none; border-radius: 8px;
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.btn-cancel { background: rgba(255,255,255,0.1); color: #fff; }
.btn-confirm { background: var(--gold); color: #000; }

/* ── Receive modal ────────────────────────────────────────────────────── */
.modal-receive { width: 360px; max-width: 95vw; }
.receive-header { display: flex; align-items: center; gap: 12px; }
.btn-back-modal {
  background: rgba(255,255,255,0.1); border: none; color: #fff;
  font-size: 1rem; width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; flex-shrink: 0; line-height: 1;
}
.receive-subtitle { font-size: 1.1rem; font-weight: 700; }
.receive-desc { font-size: 0.8rem; color: #888; line-height: 1.5; }
#receive-qr { display: flex; justify-content: center; padding: 6px 0; }
#receive-qr canvas, #receive-qr img { border-radius: 10px; border: 4px solid rgba(255,255,255,0.15); }
.receive-wallet-label { font-size: 0.7rem; color: #555; text-transform: uppercase; letter-spacing: 1px; }
.receive-address-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(20,241,149,0.07);
  border: 1px solid rgba(20,241,149,0.2);
  border-radius: 10px; padding: 10px 14px;
}
.receive-address-short { flex: 1; font-family: monospace; font-size: 1rem; color: var(--green); letter-spacing: 1px; }
.btn-copy {
  background: rgba(20,241,149,0.15); border: 1px solid rgba(20,241,149,0.35);
  color: var(--green); border-radius: 6px; padding: 4px 12px;
  font-size: 0.8rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.2s;
}
.btn-copy:hover { background: rgba(20,241,149,0.28); }
.btn-confirm-deposit {
  width: 100%; padding: 12px;
  background: var(--green); color: #000;
  font-weight: 700; font-size: 0.95rem;
  border: none; border-radius: 10px; cursor: pointer; transition: opacity 0.2s;
}
.btn-confirm-deposit:hover { opacity: 0.85; }

/* ── Customize card ───────────────────────────────────────────────────────── */
.cust-mini-canvas {
  display: block; width: 100%; height: 100px;
  border-radius: 8px; background: rgba(255,255,255,0.03);
}
#customize-preview-2.cust-mini-canvas {
  width: 100px; height: 100px;
  margin: 0 auto;
  border-radius: 50%;
}
.btn-change-appearance {
  width: 100%; padding: 11px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px; color: #fff;
  font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
  text-align: center;
}
.btn-change-appearance:hover { background: rgba(255,255,255,0.12); }

/* ── Customize modal ──────────────────────────────────────────────────────── */
.modal-cust {
  width: min(860px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  gap: 0;
  padding: 0;
  background: #111;
  border: 1px solid #222;
}
.cust-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #222;
}
.cust-header-left { display: flex; align-items: center; gap: 10px; font-size: 1rem; }
.btn-cust-close {
  background: none; border: none; color: #888; font-size: 1.1rem;
  cursor: pointer; line-height: 1; transition: color 0.2s;
}
.btn-cust-close:hover { color: #fff; }

/* top tabs (Inventory / Shop) */
.cust-top-tabs {
  display: flex; gap: 0;
  padding: 14px 22px 0;
}
.cust-top-tab {
  flex: 1; padding: 11px;
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: background 0.2s;
}
.cust-top-tab:first-child { border-radius: 8px 0 0 8px; }
.cust-top-tab:last-child  { border-radius: 0 8px 8px 0; }
.cust-top-tab.ctt-active  { background: var(--gold); color: #000; }

/* snake preview canvas */
.cust-snake-canvas {
  display: block; width: 100%; height: 130px;
  margin: 14px 0 0;
  background: rgba(255,255,255,0.02);
}

/* category tabs (Skins / Hats / Boosts) */
.cust-cat-bar {
  display: flex; gap: 8px;
  padding: 14px 22px;
  border-bottom: 1px solid #222;
}
.cust-cat {
  padding: 9px 18px;
  background: transparent;
  border: 2px solid var(--gold);
  border-radius: 8px; color: var(--gold);
  font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: background 0.2s;
}
.cust-cat.cc-active { background: var(--gold); color: #000; }

/* body layout */
.cust-body {
  display: flex;
  padding: 16px 22px 22px;
  gap: 16px;
  min-height: 320px;
}
.cust-grid-wrap { flex: 1; overflow-y: auto; }
.cust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.cust-swatch {
  aspect-ratio: 1;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  border: 3px solid transparent;
  transition: border-color 0.15s, transform 0.1s;
  overflow: hidden;
}
.cust-swatch:hover   { transform: scale(1.04); }
.cust-swatch.cs-sel  { border-color: var(--gold); }
.cust-swatch.cs-lock {
  filter: brightness(0.35);
  cursor: default;
}
.cust-swatch.cs-lock::after {
  content: '🔒';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  filter: brightness(2.5);
}
.cust-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: #444; font-size: 0.85rem; padding: 20px;
  grid-column: 1 / -1;
}

/* details panel */
.cust-details {
  width: 160px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding-top: 4px;
}
.cust-det-swatch {
  width: 90px; height: 90px;
  border-radius: 12px;
  background: #222;
  border: 2px solid #333;
}
.cust-det-name  { font-size: 0.92rem; font-weight: 700; text-align: center; }
.cust-det-badge {
  background: rgba(20,241,149,0.15);
  border: 1px solid rgba(20,241,149,0.35);
  color: var(--green);
  border-radius: 20px; padding: 3px 12px;
  font-size: 0.75rem; font-weight: 700;
}
.cust-det-divider {
  font-size: 0.68rem; color: #555;
  text-transform: uppercase; letter-spacing: 1.5px;
  align-self: stretch; padding-top: 6px;
  border-top: 1px solid #222;
}
.cust-det-row {
  display: flex; justify-content: space-between;
  align-self: stretch; font-size: 0.82rem; color: #aaa;
}
.cust-det-row strong { color: #fff; }
.btn-equip {
  width: 100%; padding: 10px;
  background: var(--gold); color: #000;
  border: none; border-radius: 8px;
  font-size: 0.88rem; font-weight: 800;
  cursor: pointer; transition: opacity 0.2s; margin-top: auto;
}
.btn-equip:hover { opacity: 0.85; }

/* ── Shop panel ───────────────────────────────────────────────────────────── */
.cust-shop-panel {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 18px;
  padding: 10px 20px 20px;
  text-align: center;
}
.cust-shop-badge {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000; font-weight: 800; font-size: 0.95rem;
  padding: 6px 20px; border-radius: 20px;
  letter-spacing: 1px;
}
.cust-shop-price {
  font-size: 2.6rem; font-weight: 900; color: var(--gold);
  line-height: 1;
}
.cust-shop-price span {
  font-size: 1rem; font-weight: 500; color: #888;
}
.cust-shop-perks {
  list-style: none;
  display: flex; flex-direction: column; gap: 12px;
  width: 100%; max-width: 340px;
  background: rgba(255,255,255,0.03);
  border: 1px solid #222;
  border-radius: 12px;
  padding: 18px 22px;
  text-align: left;
}
.cust-shop-perks li {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.92rem; color: #ddd;
}
.perk-icon { font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0; }
.btn-subscribe {
  width: 100%; max-width: 340px;
  padding: 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000; border: none; border-radius: 10px;
  font-size: 1.05rem; font-weight: 900;
  cursor: pointer; letter-spacing: 1px;
  transition: opacity 0.2s;
  box-shadow: 0 4px 20px rgba(240,180,41,0.35);
}
.btn-subscribe:hover { opacity: 0.88; }
.cust-shop-note { font-size: 0.75rem; color: #555; }

/* Leaderboard open button inside the card */
.btn-leaderboard-open {
  display: block;
  width: 100%;
  padding: 10px 0;
  background: linear-gradient(135deg, rgba(255,200,0,0.15), rgba(255,200,0,0.05));
  border: 1px solid rgba(255,200,0,0.3);
  border-radius: 10px;
  color: #ffe066;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: background 0.15s, transform 0.1s;
}
.btn-leaderboard-open:hover {
  background: linear-gradient(135deg, rgba(255,200,0,0.28), rgba(255,200,0,0.1));
  transform: translateY(-1px);
}

/* All-time leaderboard rows in modal */
#lobby-alltime-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: #ddd;
  font-size: 0.9rem;
}
#lobby-alltime-list li:first-child { background: rgba(255,200,0,0.12); color: #ffe066; }
#lobby-alltime-list li:nth-child(2) { background: rgba(200,200,200,0.07); color: #ccc; }
#lobby-alltime-list li:nth-child(3) { background: rgba(180,100,30,0.1); color: #e8a060; }
#lobby-alltime-list .al-rank  { min-width: 28px; font-weight: 700; color: #666; }
#lobby-alltime-list li:first-child .al-rank { color: #ffe066; }
#lobby-alltime-list .al-name  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lobby-alltime-list .al-score { font-weight: 600; color: #7dd3fc; }

/* ── Discord button ─────────────────────────────────────────────────────── */
.btn-discord {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #5865F2;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(88,101,242,0.45);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn-discord:hover { background: #4752c4; box-shadow: 0 6px 24px rgba(88,101,242,0.6); }
.btn-discord:active { transform: scale(0.97); }
.discord-logo { width: 22px; height: 22px; fill: #fff; flex-shrink: 0; }

/* ── Lobby navigation arrows ───────────────────────────────────────────── */
.lobby-nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 300;
  background: none;
  border: none;
  cursor: pointer;
  display: none; /* shown only when lobby is visible */
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  animation: arrow-pulse 1.4s ease-in-out infinite;
}
.lobby-nav-arrow.visible { display: flex; }
.lobby-nav-arrow-left  { left: 18px; }
.lobby-nav-arrow-right { right: 18px; }

.lobby-nav-arrow svg {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 0 10px rgba(20,241,149,0.7));
}
.lobby-nav-arrow span {
  font-size: 0.62rem;
  letter-spacing: 2px;
  font-weight: 700;
  color: #14F195;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(20,241,149,0.8);
}

@keyframes arrow-pulse {
  0%,100% { transform: translateY(-50%) scale(1);   opacity: 0.75; }
  50%      { transform: translateY(-50%) scale(1.18); opacity: 1;    }
}

/* ── Lobby slide transitions ───────────────────────────────────────────── */
.lobby-page { transition: none; }

@keyframes slideOutLeft {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(-80px); opacity: 0; }
}
@keyframes slideInRight {
  from { transform: translateX(80px);  opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes slideOutRight {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(80px);  opacity: 0; }
}
@keyframes slideInLeft {
  from { transform: translateX(-80px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.slide-out-left  { animation: slideOutLeft  0.32s cubic-bezier(0.4,0,0.6,1) forwards; }
.slide-in-right  { animation: slideInRight  0.32s cubic-bezier(0.4,0,0.6,1) forwards; }
.slide-out-right { animation: slideOutRight 0.32s cubic-bezier(0.4,0,0.6,1) forwards; }
.slide-in-left   { animation: slideInLeft   0.32s cubic-bezier(0.4,0,0.6,1) forwards; }

/* ── Lobby 2 (Arena) — clean light theme matching agar.io world ────────── */
#lobby-screen-2 { --accent: #6366f1; }

/* Cards: white, crisp, light shadow */
#lobby-screen-2 .card {
  background: rgba(255,255,255,0.93);
  border: 1px solid rgba(99,102,241,0.18);
  box-shadow: 0 4px 28px rgba(0,0,0,0.10);
  backdrop-filter: blur(4px);
  color: #1e1b4b;
}
#lobby-screen-2 .card h4,
#lobby-screen-2 .card-title,
#lobby-screen-2 .account-name,
#lobby-screen-2 .stat-lbl,
#lobby-screen-2 .server-stat-lbl { color: #374151; }
#lobby-screen-2 .account-email   { color: #6b7280; }
#lobby-screen-2 .stat-val,
#lobby-screen-2 .server-stat-val { color: #6366f1; }
#lobby-screen-2 .account-avatar  { background: #6366f1; color: #fff; border-color: #a5b4fc; }
#lobby-screen-2 .leaderboard-list li { color: #374151; }
#lobby-screen-2 .lb-score        { color: #6366f1; }
#lobby-screen-2 .rank            { color: #9ca3af; }

/* Title on light bg */
#lobby-screen-2 .game-title      { color: #1e1b4b; text-shadow: none; }
#lobby-screen-2 .game-title span { color: #6366f1; }
#lobby-screen-2 .game-subtitle   { color: #6b7280; }
#lobby-screen-2 .lobby-title-block { text-align: center; }

/* Play username / name input */
#lobby-screen-2 .play-username   { color: #1e1b4b; }
#lobby-screen-2 .name-input      { background: #f3f4f6; color: #111; border-color: rgba(99,102,241,0.3); }
#lobby-screen-2 .name-input::placeholder { color: #9ca3af; }

/* Lobby type buttons — same size as lobby 1 */
#lobby-screen-2 .btn-lobby-type-2 {
  flex: 1; padding: 11px 6px;
  background: #f3f4f6; color: #374151;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.78rem; font-weight: 700;
  cursor: pointer; text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.15s;
}
#lobby-screen-2 .btn-lobby-type-2:hover { background: rgba(99,102,241,0.08); }
#lobby-screen-2 .btn-lobby-type-2.active { background: rgba(99,102,241,0.15); border-color: #6366f1; color: #6366f1; }

/* Play button */
#lobby-screen-2 .btn-play { background: linear-gradient(135deg,#6366f1,#818cf8); color: #fff; box-shadow: 0 4px 20px rgba(99,102,241,0.35); }
#lobby-screen-2 .btn-play:hover { box-shadow: 0 6px 28px rgba(99,102,241,0.55); }

/* Wallet */
#lobby-screen-2 .wallet-balance-usd { color: #1e1b4b; }
#lobby-screen-2 .wallet-balance-sol  { color: #6b7280; }
#lobby-screen-2 .btn-add-funds       { background: linear-gradient(135deg,#6366f1,#818cf8); color: #fff; }
#lobby-screen-2 .btn-cash-out        { background: #f3f4f6; color: #6366f1; border-color: rgba(99,102,241,0.3); }
#lobby-screen-2 .btn-text-sm         { color: #6366f1; }
#lobby-screen-2 .btn-leaderboard-open { color: #6366f1; border-color: rgba(99,102,241,0.3); background: rgba(99,102,241,0.08); }
#lobby-screen-2 .btn-change-appearance { background: rgba(99,102,241,0.1); color: #6366f1; border-color: rgba(99,102,241,0.25); }
#lobby-screen-2 .server-stat-divider  { background: #d1d5db; }

/* Arrows on light background */
.lobby-nav-arrow[data-theme="light"] svg polyline { stroke: #6366f1; }
.lobby-nav-arrow[data-theme="light"] span { color: #6366f1; text-shadow: none; }
.lobby-nav-arrow[data-theme="light"] svg { filter: drop-shadow(0 0 8px rgba(99,102,241,0.5)); }

/* ── Name input row (input + save button) ───────────────────────────── */
.name-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.name-input-row .name-input { flex: 1; }
.btn-save-name {
  flex-shrink: 0;
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  height: 38px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-save-name:hover { opacity: 0.85; }
.btn-save-name:disabled { opacity: 0.45; cursor: default; }
.name-error-msg {
  font-size: 0.8rem;
  font-weight: 600;
  min-height: 1.1em;
  margin: 4px 0 0;
  text-align: center;
}
.name-error-msg.is-error   { color: #ef4444; }
.name-error-msg.is-success { color: var(--green); }

/* ── Mute button ─────────────────────────────────────────────────────── */
.btn-mute-icon {
  background: none;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #ccc;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.btn-mute-icon:hover { border-color: var(--green); color: var(--green); background: rgba(20,241,149,0.08); }
.btn-mute-icon.muted { color: #ef4444; border-color: rgba(239,68,68,0.4); }
.btn-mute-icon.muted:hover { border-color: #ef4444; background: rgba(239,68,68,0.08); }

/* ── Profile icon button ─────────────────────────────────────────────── */
.btn-profile-icon {
  background: none;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #ccc;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.btn-profile-icon:hover {
  border-color: var(--green);
  color: var(--green);
  background: rgba(20,241,149,0.08);
}

/* ── Profile Modal ───────────────────────────────────────────────────── */
.modal-profile {
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
  border-radius: 14px;
}

.profile-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--card-border);
}
.pm-avatar-wrap { position: relative; flex-shrink: 0; }
.pm-avatar-img, .pm-avatar-fallback {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
}
.pm-avatar-fallback {
  background: var(--card-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700; color: var(--green);
}
.profile-modal-info { flex: 1; }
.pm-name { font-size: 1.15rem; font-weight: 700; color: #fff; }
.pm-sub  { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.pm-stats-row {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--card-border);
}
.pm-stat {
  flex: 1;
  padding: 16px 12px;
  text-align: center;
  border-right: 1px solid var(--card-border);
}
.pm-stat:last-child { border-right: none; }
.pm-stat-val { font-size: 1.1rem; font-weight: 700; color: var(--green); }
.pm-stat-lbl { font-size: 0.72rem; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

.pm-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 20px 6px;
}

/* Tab bar */
.pm-tab-bar {
  display: flex;
  border-bottom: 1px solid var(--card-border);
}
.pm-nav-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 10px 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.02em;
}
.pm-nav-tab:hover { color: #ccc; }
.pm-nav-tab.active { color: var(--green); border-bottom-color: var(--green); }

/* Tab panels */
.pm-tab-panel { padding-bottom: 4px; }

/* Chart */
.pm-chart {
  display: block;
  width: calc(100% - 40px);
  height: 160px;
  margin: 0 20px 4px;
  border-radius: 8px;
}

/* Leaderboard panel */
.pm-lb-list {
  list-style: none;
  padding: 0 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pm-lb-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: 0.85rem;
}
.pm-lb-rank { color: var(--muted); font-size: 0.75rem; width: 22px; flex-shrink: 0; }
.pm-lb-name { flex: 1; font-weight: 600; color: #e5e7eb; }
.pm-lb-val  { color: var(--green); font-weight: 700; font-size: 0.83rem; }

/* Search panel */
.pm-search-wrap {
  padding: 16px 20px 10px;
}
.pm-search-field {
  position: relative;
}
.pm-search-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  padding: 9px 14px;
  outline: none;
  transition: border-color 0.15s;
}
.pm-search-input:focus { border-color: var(--green); }
.pm-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #161616;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  list-style: none;
  overflow: hidden;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.pm-search-dropdown li {
  padding: 9px 14px;
  font-size: 0.88rem;
  color: #ccc;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.pm-search-dropdown li:hover,
.pm-search-dropdown li.active {
  background: rgba(20,241,149,0.1);
  color: var(--green);
}
#pm-search-result { padding: 0 20px 16px; }

/* Search result card */
.pm-search-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 14px 16px;
}
.pm-search-card .pm-sc-name { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.pm-search-card .pm-sc-row  { display: flex; justify-content: space-between; font-size: 0.82rem; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.pm-search-card .pm-sc-row:last-child { border-bottom: none; }
.pm-search-card .pm-sc-lbl  { color: var(--muted); }
.pm-search-card .pm-sc-val  { color: #e5e7eb; font-weight: 600; }

/* Friends / coming soon */
.pm-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 10px;
  text-align: center;
}
.pm-cs-icon { font-size: 2.4rem; }
.pm-cs-text { font-size: 1rem; font-weight: 700; color: #ccc; }
.pm-cs-sub  { font-size: 0.82rem; color: var(--muted); max-width: 260px; line-height: 1.5; }

.pm-names-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 20px 20px;
}
.pm-name-tag {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.85rem;
  color: #ccc;
}

/* ── Appearance / Customize Screen ─────────────────────────────────────────── */
#appearance-screen {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#appearance-screen.hidden { display: none; }
#appearance-screen.ap-cell-mode {
  background: #f0f4ff;
  background-image:
    repeating-linear-gradient(rgba(99,102,241,0.13) 0px, rgba(99,102,241,0.13) 1px, transparent 1px, transparent 60px),
    repeating-linear-gradient(90deg, rgba(99,102,241,0.13) 0px, rgba(99,102,241,0.13) 1px, transparent 1px, transparent 60px);
}

.ap-header {
  width: 100%;
  max-width: 780px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 14px;
  border-bottom: 1px solid #1a1a28;
}
.ap-back-btn {
  background: none;
  border: 1.5px solid #2e2e42;
  color: #aaa;
  padding: 8px 18px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.ap-back-btn:hover { border-color: #14F195; color: #14F195; }
.ap-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 3px;
}
.ap-htabs { display: flex; gap: 8px; }
.ap-htab {
  background: none;
  border: 1.5px solid #2e2e42;
  color: #777;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.ap-htab.ap-htab-active {
  border-color: #14F195;
  color: #14F195;
  background: rgba(20,241,149,0.08);
}

.ap-catbar {
  display: flex;
  gap: 12px;
  padding: 18px 28px 6px;
}
.ap-cat {
  background: none;
  border: 1.5px solid #252535;
  color: #666;
  padding: 9px 26px;
  border-radius: 22px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.ap-cat.ap-cat-active {
  border-color: #14F195;
  color: #14F195;
  background: rgba(20,241,149,0.09);
}

.ap-preview-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px 6px;
  min-height: 0;
}
.ap-canvas {
  width: 100%;
  height: 100%;
  max-height: 420px;
  display: block;
  background: transparent;
}

.ap-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 10px 28px 4px;
  width: 100%;
  max-width: 480px;
}
.ap-arrow {
  background: none;
  border: 2px solid #2e2e42;
  color: #ccc;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  flex-shrink: 0;
}
.ap-arrow:hover { border-color: #14F195; color: #14F195; }
.ap-arrow:disabled { border-color: #1e1e2e; color: #333; cursor: default; }
.ap-sel-info { flex: 1; text-align: center; }
.ap-sel-name {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.ap-sel-lock {
  color: #f59e0b;
  font-size: 0.8rem;
  margin-top: 4px;
}

.ap-save-row {
  padding: 14px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.ap-save-btn {
  background: #14F195;
  color: #000;
  border: none;
  padding: 14px 60px;
  border-radius: 13px;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  letter-spacing: 1.5px;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
}
.ap-save-btn:hover { background: #0fd980; transform: scale(1.03); }
.ap-save-btn:disabled { background: #1e3028; color: #2a5040; cursor: default; transform: none; }
.ap-saved-msg {
  font-size: 0.85rem;
  color: #14F195;
  font-weight: 700;
  min-height: 18px;
}

.ap-shop-wrap {
  flex: 1;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 28px 40px;
  text-align: center;
  gap: 16px;
}
.ap-shop-wrap.hidden { display: none; }

/* ── Settings Modal ──────────────────────────────────────────────────── */
.modal-settings {
  width: 500px;
  max-width: 95vw;
  max-height: 88vh;
  overflow-y: auto;
  padding: 0;
  border-radius: 14px;
}
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--card-border);
}
.settings-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}
.st-panel { padding: 6px 0 16px; }
.st-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 14px 20px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.st-coming-pill {
  background: rgba(255,255,255,0.07);
  color: #888;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
}
.st-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.st-info-key { font-size: 0.83rem; color: #aaa; }
.st-info-val { font-size: 0.83rem; color: #fff; font-weight: 600; text-align: right; max-width: 60%; word-break: break-all; }
.st-mono { font-family: monospace; font-size: 0.75rem; color: var(--green); }
.st-link { color: var(--green); text-decoration: none; }
.st-link:hover { text-decoration: underline; }

/* Slider rows */
.st-slider-row {
  padding: 10px 20px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.st-slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
  color: #ddd;
  margin-bottom: 6px;
}
.st-slider-val { color: var(--green); font-weight: 700; }
.st-slider-desc { font-size: 0.72rem; color: #666; margin-top: 4px; }
.st-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: rgba(255,255,255,0.12);
  outline: none;
}
.st-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--green);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(20,241,149,0.5);
}
.st-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--green);
  cursor: pointer;
  border: none;
}

/* Toggle rows */
.st-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.st-toggle-name { font-size: 0.83rem; color: #ddd; }
.st-toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.st-toggle-switch input { opacity: 0; width: 0; height: 0; }
.st-toggle-slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}
.st-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.st-toggle-switch input:checked + .st-toggle-slider { background: var(--green); }
.st-toggle-switch input:checked + .st-toggle-slider::before { transform: translateX(18px); }

/* Disabled (coming soon) rows */
.st-disabled { opacity: 0.38; pointer-events: none; }

/* Legal */
.st-legal-link {
  display: flex;
  align-items: center;
  padding: 11px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.st-legal-link:hover { background: rgba(20,241,149,0.06); }
.st-legal-body {
  font-size: 0.8rem;
  color: #888;
  line-height: 1.6;
  padding: 6px 20px 2px;
  margin: 0;
}
.st-legal-body strong { color: #bbb; }

/* ── Mobile Joystick & Boost Button ─────────────────────────────────────── */
.joystick-zone,
.boost-btn {
  display: none; /* hidden on desktop */
}

@media (pointer: coarse) {
  .joystick-zone {
    display: block;
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
    touch-action: none;
  }
  .joystick-base {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.25);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .joystick-knob {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(20, 241, 149, 0.7);
    box-shadow: 0 0 14px rgba(20, 241, 149, 0.5);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: background 0.1s;
    pointer-events: none;
  }
  .boost-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: rgba(20, 241, 149, 0.15);
    border: 2px solid rgba(20, 241, 149, 0.4);
    color: #14F195;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    touch-action: none;
    cursor: pointer;
    transition: background 0.1s, transform 0.1s;
  }
  .boost-btn.active {
    background: rgba(20, 241, 149, 0.35);
    transform: scale(0.94);
  }
}

/* Fullscreen button — mobile only */
.btn-fullscreen-lobby { display: none; }
@media (pointer: coarse) {
  .btn-fullscreen-lobby { display: flex; }
}

/* ── Mobile tweaks ───────────────────────────────────────────────────────── */
@media (pointer: coarse) {
  .btn-discord { bottom: 14px; }
}
