/* ── Retro Pixel UI — Cyberpunk Neon ─────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=IBM+Plex+Mono:ital,wght@0,400;0,500;1,400&display=swap');

/* ── Variables ───────────────────────────────────────────────────────────── */
:root {
  /* ── Neon (matches MiSTerTransfer neon palette) ── */
  --neon-primary:   #00d4ff;
  --neon-secondary: #33ddff;
  --neon-accent:    #00cc88;
  --neon-hot:       #ff4466;
  --neon-blue:      #00d4ff;
  --neon-gold:      #ffd166;
  --neon-silver:    #aec6e0;
  --neon-bronze:    #e07a5f;

  --bg-void:        #07080f;
  --bg-panel:       #0c0e1c;
  --bg-surface:     #111428;
  --bg-hover:       #0e1020;

  --text-primary:   #dce8ff;
  --text-secondary: #5870a0;
  --text-muted:     #28304a;

  --color-success:  #00cc88;
  --color-warning:  #ffaa00;
  --color-danger:   #ff4466;
  --color-info:     #00aadd;

  --font-pixel: 'Press Start 2P', monospace;
  --font-body:  'VT323', monospace;
  --font-admin: 'IBM Plex Mono', 'Courier New', monospace;

  --px: 4px;
  --glow: none;

  /* Composite shadows — flat, no glow */
  --shadow-topbar:    0 1px 0 rgba(0, 212, 255, 0.2);
  --shadow-sidebar:   inset 0 0 0 1px rgba(0, 212, 255, 0.15);
  --shadow-table:     none;
  --shadow-presence:  none;
  --shadow-auth-card: inset 0 0 0 1px var(--neon-primary);
  --border:           rgba(0, 212, 255, 0.18);

  /* Text glows — all off */
  --glow-primary:   none;
  --glow-secondary: none;
  --glow-accent:    none;
  --glow-gold:      none;
  --glow-silver:    none;
  --glow-bronze:    none;

  /* No ambient background glow */
  --bg-panel-rgb: 12, 14, 28;
  --bg-glow-1: transparent;
  --bg-glow-2: transparent;
  --bg-glow-3: transparent;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Links ───────────────────────────────────────────────────────────────── */
a {
  color: var(--neon-primary);
  text-decoration: none;
}
a:not(.btn):not(.game-card):not(.dash-score-item):not(.group-card):not(.group-card-new):not(.event-card):not(.player-profile-group-tag):not(.fav-group-card):not(.dash-group-item):not(.dash-panel-link):hover {
  color: var(--neon-secondary);
  text-decoration: underline;
}

/* Card-type anchors — manage their own colors; no underline on hover */
a.game-card,
a.dash-score-item,
a.group-card,
a.group-card-new,
a.event-card,
a.player-profile-group-tag {
  color: inherit;
  text-decoration: none;
}
a.game-card:hover,
a.dash-score-item:hover,
a.group-card:hover,
a.group-card-new:hover,
a.event-card:hover,
a.player-profile-group-tag:hover {
  color: inherit;
  text-decoration: none;
}

/* ── Body — scanlines + void ─────────────────────────────────────────────── */
html, body {
  height: 100%;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.6rem;
  line-height: 1.5;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  image-rendering: pixelated;
}

html {
  background: var(--bg-void);
}

/* Arcade hall background — fixed pseudo-element never disappears on scroll */
html::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(8,17,29,0.88), rgba(8,17,29,0.88)),
    url('/arcade.png') center / cover;
}

html[data-bg="off"]::before {
  display: none;
}


/* ── CRT overlay (PVM-style thick scanlines + vignette) ──────────────────── */
html[data-crt="on"] body::before {
  content: '';
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.65) 100%
  );
}

/* Scanlines live only on .leaderboard-crt — not over the whole UI */
.leaderboard-crt {
  position: relative;
}

html[data-crt="on"] .leaderboard-crt::after {
  content: '';
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.28) 0px,
    rgba(0, 0, 0, 0.28) 1px,
    transparent 1px,
    transparent 2px
  );
}

/* ── App shell ───────────────────────────────────────────────────────────── */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.main-content { flex: 1; padding: 2rem 2rem 56px; }
.main-topbar  { padding-top: calc(60px + 2rem); }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  height: 60px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(var(--bg-panel-rgb), 0.88);
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
  box-shadow: none;
}

.topbar-brand {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--neon-primary);
  text-decoration: none;
  text-shadow: var(--glow-primary);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-brand-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.topbar-brand-mark {
  width: 26px; height: 26px;
  background: var(--neon-primary);
  color: var(--bg-void);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  font-family: var(--font-pixel);
  font-size: 0.44rem;
  padding: 0.5rem 0.875rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s, border-color 0.1s, transform 0.1s;
  image-rendering: pixelated;
}

.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--neon-primary);
  color: var(--bg-void);
}
.btn-primary:hover:not(:disabled) {
  background: var(--neon-secondary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.25);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--neon-primary);
}

.btn-danger {
  background: transparent;
  color: var(--color-danger);
  box-shadow: inset 0 0 0 1px rgba(224, 122, 95, 0.35);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(224, 122, 95, 0.08);
  box-shadow: inset 0 0 0 1px var(--color-danger);
}

.btn-full { width: 100%; }

/* ── Topbar nav buttons — stripped to plain links ─────────────────────────── */
.topbar .btn-ghost {
  box-shadow: none;
  padding: 0.3rem 0.5rem;
  font-size: 0.38rem;
  color: var(--text-secondary);
}
.topbar .btn-ghost:hover:not(:disabled) {
  box-shadow: none;
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.06);
}
.topbar .btn-primary {
  padding: 0.3rem 0.7rem;
  font-size: 0.38rem;
}

/* ── User dropdown menu ───────────────────────────────────────────────────── */
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.user-menu-trigger {
  font-size: 0.38rem;
  padding: 0.3rem 0.6rem;
}

.user-menu-drop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: var(--bg-panel);
  border: 1px solid rgba(0, 212, 255, 0.25);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 0.25rem 0;
}

.user-menu-item {
  display: block;
  width: 100%;
  padding: 0.55rem 0.9rem;
  font-family: var(--font-pixel);
  font-size: 0.34rem;
  color: var(--text-secondary);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
}
.user-menu-item:hover {
  background: rgba(0, 212, 255, 0.08);
  color: var(--text-primary);
}

.user-menu-item-muted {
  color: var(--text-muted);
  border-top: 1px solid rgba(0, 212, 255, 0.06);
  margin-top: 0.15rem;
  padding-top: 0.45rem;
}
.user-menu-item-muted:hover { color: var(--text-secondary); background: transparent; }

.user-menu-item-logout {
  color: var(--color-danger);
  border-top: 1px solid rgba(0, 212, 255, 0.1);
  margin-top: 0.25rem;
  padding-top: 0.55rem;
}
.user-menu-item-logout:hover {
  background: rgba(224, 122, 95, 0.08);
  color: var(--color-danger);
}

.user-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
}

/* ── Form controls ───────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }

label {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--neon-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.input {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.2;
  padding: 0.38rem 0.75rem;
  width: 100%;
  outline: none;
  border: none;
  box-shadow: inset 0 0 0 2px var(--text-muted);
  transition: box-shadow 0.15s;
}

.input::placeholder { color: var(--text-muted); }

.input:focus {
  box-shadow:
    inset 0 0 0 2px var(--neon-secondary),
    0 0 8px var(--neon-secondary);
}

/* ── Auth pages ──────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1rem 10rem;
  gap: 0.25rem;
  background: radial-gradient(ellipse 700px 560px at 50% 44%, rgba(0, 212, 255, 0.06) 0%, transparent 68%);
}

.auth-screen-label {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  color: var(--text-muted);
  letter-spacing: 0.25em;
  text-align: center;
  animation: auth-pulse 3.2s ease-in-out infinite;
}

@keyframes auth-pulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1; }
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: transparent;
  padding: 2rem 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: none;
  animation: flicker 0.2s ease both;
}

@keyframes flicker {
  0%   { opacity: 0; }
  50%  { opacity: 0.8; }
  75%  { opacity: 0.6; }
  100% { opacity: 1; }
}

/* Corner bracket decorations */
.auth-corner-tl,
.auth-corner-tr,
.auth-corner-bl,
.auth-corner-br {
  position: absolute;
  width: 20px;
  height: 20px;
  pointer-events: none;
}
.auth-corner-tl {
  top: 0; left: 0;
  border-top: 2px solid var(--neon-primary);
  border-left: 2px solid var(--neon-primary);
  filter: drop-shadow(0 0 5px rgba(0, 212, 255, 0.7));
}
.auth-corner-tr {
  top: 0; right: 0;
  border-top: 2px solid var(--neon-primary);
  border-right: 2px solid var(--neon-primary);
  filter: drop-shadow(0 0 5px rgba(0, 212, 255, 0.7));
}
.auth-corner-bl {
  bottom: 0; left: 0;
  border-bottom: 2px solid var(--neon-primary);
  border-left: 2px solid var(--neon-primary);
  filter: drop-shadow(0 0 5px rgba(0, 212, 255, 0.7));
}
.auth-corner-br {
  bottom: 0; right: 0;
  border-bottom: 2px solid var(--neon-primary);
  border-right: 2px solid var(--neon-primary);
  filter: drop-shadow(0 0 5px rgba(0, 212, 255, 0.7));
}

/* Staggered entrance */
@keyframes auth-fade-up {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-card .auth-brand         { animation: auth-fade-up 0.4s 0.08s ease both; }
.auth-card .auth-heading-block { animation: auth-fade-up 0.4s 0.16s ease both; }
.auth-card .success-msg,
.auth-card .error-msg          { animation: auth-fade-up 0.3s ease both; }
.auth-card .auth-fields        { animation: auth-fade-up 0.4s 0.24s ease both; }
.auth-card .btn                { animation: auth-fade-up 0.4s 0.32s ease both; }
.auth-card .auth-links         { animation: auth-fade-up 0.4s 0.40s ease both; }

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  position: relative;
}

.auth-brand::before {
  content: '';
  position: absolute;
  inset: -28px -48px;
  background: radial-gradient(ellipse at center, rgba(0, 212, 255, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.auth-brand-logo {
  width: 360px;
  height: 100px;
  display: block;
  object-fit: contain;
  position: relative;
  margin: 0.5rem auto;
}

.auth-brand-mark {
  width: 32px; height: 32px;
  background: var(--neon-primary);
  color: var(--bg-void);
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--neon-primary);
  flex-shrink: 0;
}

.auth-brand-name {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--neon-primary);
  text-shadow: 0 0 8px var(--neon-primary);
  letter-spacing: 0.05em;
}

.auth-heading-block { text-align: center; }

.auth-heading {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--neon-secondary);
  text-shadow: 0 0 10px var(--neon-secondary);
  text-align: center;
  letter-spacing: 0.06em;
  line-height: 1.8;
}

.auth-heading-sub {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.25rem;
  letter-spacing: 0.04em;
}

.auth-fields { display: flex; flex-direction: column; gap: 0.65rem; }

/* Terminal-style inputs in auth context */
.auth-fields .input {
  background: transparent;
  border: none;
  border-left: 2px solid rgba(0, 212, 255, 0.28);
  border-bottom: 1px solid rgba(0, 212, 255, 0.15);
  box-shadow: none;
  padding: 0.35rem 0.6rem 0.35rem 0.75rem;
  font-size: 1rem;
  transition: border-left-color 0.2s, border-bottom-color 0.2s, background 0.2s;
}
.auth-fields .input:focus {
  border-left-color: var(--neon-secondary);
  border-left-width: 3px;
  border-bottom-color: rgba(109, 204, 184, 0.35);
  background: rgba(0, 212, 255, 0.03);
  box-shadow: none;
}
.auth-fields .input::placeholder { color: var(--text-muted); opacity: 0.6; }

/* Submit button — ghost with shimmer sweep */
.auth-card .btn-primary {
  position: relative;
  overflow: hidden;
  background: transparent;
  color: var(--neon-primary);
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.45);
  transition: color 0.2s, box-shadow 0.2s, background 0.2s;
  letter-spacing: 0.12em;
}
.auth-card .btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 212, 255, 0.14) 50%, transparent 100%);
  transform: translateX(-110%);
  transition: transform 0.55s ease;
  pointer-events: none;
}
.auth-card .btn-primary:hover:not(:disabled) {
  background: rgba(0, 212, 255, 0.06);
  color: var(--neon-accent);
  box-shadow: inset 0 0 0 1px var(--neon-secondary);
}
.auth-card .btn-primary:hover:not(:disabled)::after {
  transform: translateX(110%);
}
.auth-card .btn-primary:disabled {
  color: var(--text-muted);
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.18);
  opacity: 0.55;
}

.pwd-rules {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
}
.pwd-rules li {
  color: var(--text-muted);
  padding-left: 1.1rem;
  position: relative;
}
.pwd-rules li::before {
  content: "✕";
  position: absolute;
  left: 0;
  color: var(--color-danger);
  font-size: 0.75rem;
}
.pwd-rules li.ok { color: var(--color-success); }
.pwd-rules li.ok::before { content: "✓"; color: var(--color-success); }

.auth-links {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.03em;
}

.auth-links a {
  color: var(--neon-secondary);
  text-decoration: none;
  text-shadow: 0 0 6px var(--neon-secondary);
}

.auth-links a:hover { text-shadow: 0 0 12px var(--neon-secondary), 0 0 24px var(--neon-secondary); }

/* ── Game layout (sidebar + leaderboard) ─────────────────────────────────── */
.game-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 60px - 4rem);
  max-width: 1350px;
  margin: 0 auto;
}

/* ── Game sidebar ────────────────────────────────────────────────────────── */
.game-sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(var(--bg-panel-rgb), 0.82);
  box-shadow: var(--shadow-sidebar);
  align-self: flex-start;
  position: sticky;
  top: 76px;
}

.game-sidebar-header {
  font-family: var(--font-pixel);
  font-size: 0.42rem;
  color: var(--neon-primary);
  text-shadow: var(--glow-primary);
  letter-spacing: 0.12em;
  padding: 0.875rem 1rem;
  border-bottom: 2px solid var(--neon-primary);
  text-align: center;
}

.game-sidebar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.game-sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0, 212, 255, 0.08);
  cursor: pointer;
  transition: background 0.1s;
  text-align: left;
}

.game-sidebar-item:hover {
  background: var(--bg-hover);
}

.game-sidebar-item.active {
  background: rgba(0, 212, 255, 0.08);
  box-shadow: inset 2px 0 0 var(--neon-primary);
}

.game-cursor {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--neon-primary);
  text-shadow: var(--glow-primary);
  width: 12px;
  flex-shrink: 0;
  animation: blink 0.8s step-end infinite;
}

.game-sidebar-item:not(.active) .game-cursor {
  animation: none;
  opacity: 0;
}

.game-sidebar-name {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  line-height: 1.8;
}

.game-sidebar-item.active .game-sidebar-name {
  color: var(--neon-primary);
  text-shadow: var(--glow-primary);
}

.game-sidebar-item:hover .game-sidebar-name {
  color: var(--text-primary);
}

.game-sidebar-footer {
  margin-top: auto;
  padding: 0.875rem 1rem;
  border-top: 1px solid rgba(0, 212, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.game-sidebar-stat-label {
  font-family: var(--font-pixel);
  font-size: 0.32rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.game-sidebar-stat-value {
  font-family: var(--font-pixel);
  font-size: 0.42rem;
  color: var(--neon-accent);
  text-shadow: var(--glow-accent);
}

/* ── Leaderboard panel ───────────────────────────────────────────────────── */
.leaderboard-panel {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.leaderboard-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.leaderboard-title {
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  color: var(--neon-primary);
  text-shadow: var(--glow-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

.leaderboard-live {
  font-family: var(--font-pixel);
  font-size: 0.35rem;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.6rem;
  flex-shrink: 0;
}

.leaderboard-live.live-on {
  color: var(--neon-accent);
  text-shadow: var(--glow-accent);
  box-shadow: inset 0 0 0 1px var(--neon-accent);
  animation: blink 2s step-end infinite;
}

.leaderboard-live.live-off {
  color: var(--text-muted);
  box-shadow: inset 0 0 0 1px var(--text-muted);
}

/* ── Leaderboard (legacy standalone container) ───────────────────────────── */
.leaderboard-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(var(--bg-panel-rgb), 0.78);
  box-shadow: var(--shadow-table);
}

.leaderboard-table thead {
  background: rgba(22, 40, 68, 0.9);
}

.leaderboard-table th {
  font-family: var(--font-pixel);
  font-size: 0.42rem;
  color: var(--neon-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--neon-secondary);
}

.leaderboard-table td {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-primary);
  padding: 0.55rem 1rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.08);
  vertical-align: middle;
}

.leaderboard-table tbody tr {
  transition: background 0.1s;
}

.leaderboard-table tbody tr:hover {
  background: var(--bg-hover);
}

.leaderboard-table tbody tr:last-child td { border-bottom: none; }

/* Top 3 rank highlights */
.rank-gold td.rank {
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  color: var(--neon-gold);
  text-shadow: var(--glow-gold);
}

.rank-silver td.rank {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--neon-silver);
  text-shadow: var(--glow-silver);
}

.rank-bronze td.rank {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--neon-bronze);
  text-shadow: var(--glow-bronze);
}

.rank-gold   { background: rgba(255, 209, 102, 0.05); }
.rank-silver { background: transparent; }
.rank-bronze { background: transparent; }

/* Score column — pixel font always */
td.rank {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--text-secondary);
  width: 56px;
  text-align: center;
}

td.score {
  font-family: var(--font-pixel);
  font-size: 0.78rem;
  color: var(--neon-accent);
  text-shadow: var(--glow-accent);
  letter-spacing: 0.04em;
}

td.date {
  color: var(--text-muted);
  font-size: 1rem;
}

.score-tag {
  display: inline-block;
  margin-left: 0.4em;
  padding: 0 0.35em;
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--text-muted);
  border: 1px solid currentColor;
  vertical-align: middle;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.row-suspicious td {
  color: var(--color-warning) !important;
  opacity: 0.7;
}

/* ── Page layout ─────────────────────────────────────────────────────────── */
.page-container {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.page-title {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--neon-primary);
  letter-spacing: 0.04em;
  line-height: 1.8;
}

.page-subtitle {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* ── Alert / success box ─────────────────────────────────────────────────── */
.alert-success {
  background: rgba(94, 232, 180, 0.06);
  box-shadow: inset 0 0 0 1px var(--color-success);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--color-success);
}

.alert-success strong {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  letter-spacing: 0.05em;
  line-height: 2;
}

.raw-key-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-void);
  padding: 0.75rem 1rem;
  box-shadow: inset 0 0 0 1px var(--color-success);
  overflow-x: auto;
}

.raw-key-box code {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--neon-accent);
  word-break: break-all;
  flex: 1;
}

/* ── Loading / empty states ──────────────────────────────────────────────── */
.loading-state, .empty-state {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 4rem 1rem;
  letter-spacing: 0.08em;
  line-height: 2.5;
}

.loading-state::after {
  content: '...';
  display: block;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.app-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg-void);
}

.app-loading-text {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--neon-primary);
  text-shadow: 0 0 10px var(--neon-primary);
  animation: blink 1s step-end infinite;
  letter-spacing: 0.1em;
}

/* ── Error / success messages ────────────────────────────────────────────── */
.error-msg {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-danger);
  text-shadow: 0 0 6px var(--color-danger);
  padding: 0.5rem 0;
}

.success-msg {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-success);
  background: rgba(94, 232, 180, 0.05);
  box-shadow: inset 0 0 0 1px var(--color-success);
  padding: 0.625rem 0.875rem;
}

.invite-applied-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--neon-secondary, #5ee8b4);
  background: rgba(94, 232, 180, 0.06);
  box-shadow: inset 0 0 0 1px rgba(94, 232, 180, 0.3);
  padding: 0.35rem 0.75rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.auth-loading-dots {
  display: inline-block;
  color: var(--text-muted);
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  animation: blink-dots 1.2s step-start infinite;
}
@keyframes blink-dots { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }

/* ── About page ──────────────────────────────────────────────────────────── */
.about-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.about-hero {
  border-bottom: 2px solid var(--neon-primary);
  padding-bottom: 2rem;
}

.about-hero-title {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--neon-primary);
  text-shadow:
    0 0 10px var(--neon-primary),
    0 0 24px var(--neon-primary);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.about-hero-sub {
  font-family: var(--font-body);
  font-size: 1.5rem;
  color: var(--text-secondary);
}

.about-section { display: flex; flex-direction: column; gap: 1rem; }

.about-section-title {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--neon-secondary);
  text-shadow: 0 0 8px var(--neon-secondary);
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.about-body {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.7;
}

.about-body-muted { color: var(--text-muted); }

.about-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-left: 0;
}

.about-steps li {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--text-primary);
  line-height: 1.7;
}

.about-step-num {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--neon-accent);
  text-shadow: 0 0 6px var(--neon-accent);
  flex-shrink: 0;
  padding-top: 0.35rem;
  letter-spacing: 0.04em;
}

.about-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.about-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.about-bullet {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  color: var(--neon-primary);
  text-shadow: 0 0 6px var(--neon-primary);
  flex-shrink: 0;
  padding-top: 0.35rem;
}

.about-list code, .about-steps code {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--neon-accent);
  background: rgba(94, 232, 180, 0.06);
  box-shadow: inset 0 0 0 1px rgba(94, 232, 180, 0.2);
  padding: 0 0.4em;
}

.about-privacy-link {
  font-family: var(--font-pixel);
  font-size: 0.26rem;
  color: var(--text-muted);
  text-decoration: none;
  align-self: center;
  margin-left: auto;
  letter-spacing: 0.05em;
}
.about-privacy-link:hover { color: var(--text-secondary); }

.about-footer {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 212, 255, 0.12);
}

/* ── Privacy page ───────────────────────────────────────────────────────── */
.privacy-updated {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.privacy-def-list {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0.55rem 1.25rem;
  align-items: baseline;
  margin: 0.75rem 0 1rem;
}

.privacy-def-list-wide {
  grid-template-columns: 220px 1fr;
}

.privacy-def-term {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  color: var(--text-muted);
  letter-spacing: 0.07em;
  padding-top: 0.15rem;
}

.privacy-def-val {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.privacy-ext-link {
  color: var(--neon-primary);
  text-decoration: none;
  font-size: 0.82rem;
  margin-left: 0.25rem;
}
.privacy-ext-link:hover { text-decoration: underline; }

.privacy-int-link {
  color: var(--neon-primary);
  text-decoration: none;
}
.privacy-int-link:hover { text-decoration: underline; }

/* ── Site footer ─────────────────────────────────────────────────────────── */
.site-footer {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.site-footer-link {
  font-family: var(--font-pixel);
  font-size: 0.26rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.14s;
}
.site-footer-link:hover { color: var(--neon-primary); }

/* ── Admin page font scale + soft UI overrides ───────────────────────────── */
/* All scoped to .admin-page so the public retro theme is untouched.          */
.admin-page { font-size: 1rem; }

.admin-page .page-title {
  font-family: var(--font-admin);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: none;
}
.admin-page .page-subtitle {
  font-family: var(--font-admin);
  font-size: 0.9rem;
}

.admin-page .btn {
  font-family: var(--font-admin);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  border-radius: 6px;
}
.admin-page .btn-sm {
  font-size: 0.72rem;
  border-radius: 4px;
}

.admin-page .badge {
  font-family: var(--font-admin);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
}
.admin-page .badge-role,
.admin-page .badge-private,
.admin-page .badge-joined {
  font-family: var(--font-admin);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  border-radius: 4px;
}

.admin-page .empty-state,
.admin-page .loading-state {
  font-family: var(--font-admin);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.admin-page .form-label-sm {
  font-family: var(--font-admin);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.admin-page .input-sm {
  font-family: var(--font-admin);
  font-size: 0.85rem;
}

/* ── Admin / Account tabs ────────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 0.25rem;
  margin-bottom: 1rem;
}

.admin-tab {
  font-family: var(--font-admin);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.45rem 0.9rem;
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.admin-tab:hover {
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.28);
}

.admin-tab.active {
  color: var(--neon-secondary);
  background: rgba(51, 221, 255, 0.1);
  border-color: var(--neon-secondary);
  text-shadow: 0 0 6px rgba(51, 221, 255, 0.4);
}

/* ── Admin table ─────────────────────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(var(--bg-panel-rgb), 0.78);
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.12);
}

.admin-table th {
  font-family: var(--font-admin);
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.75rem 0.875rem;
  text-align: left;
  border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.admin-table td {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-primary);
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

.admin-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.admin-table td.mono       { font-family: var(--font-admin); color: var(--text-secondary); font-size: 0.75rem; }
.admin-table td.score      { font-family: var(--font-admin); font-size: 0.82rem; font-weight: 500; color: var(--neon-accent); }
.admin-table td.reason     { color: var(--text-secondary); font-size: 0.82rem; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-table td.warn       { color: var(--color-warning); font-family: var(--font-admin); font-size: 0.75rem; font-weight: 500; }
.admin-table td.date       { color: var(--text-muted); font-family: var(--font-admin); font-size: 0.72rem; }
.admin-table td.actions              { display: flex; gap: 0.4rem; align-items: center; flex-wrap: nowrap; }
.admin-table td.actions .btn         { font-size: 0.65rem; padding: 0.2rem 0.45rem; }
.admin-table td.actions .input-sm    { font-size: 0.68rem; padding: 0.2rem 0.4rem; width: 86px; }
.admin-table td.actions select       { font-size: 0.68rem; padding: 0.2rem 0.35rem; width: 86px; }
.admin-page .btn-icon      { padding: 0.3rem 0.5rem; min-width: 1.8rem; text-align: center; }
.admin-table .row-banned td { opacity: 0.5; }
.ban-expand-row td          { padding: 0.5rem 0.75rem; background: rgba(255,60,60,0.04); border-bottom: 1px solid rgba(255,60,60,0.15); }
.ban-expand                 { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.badge {
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.5rem;
}
.badge-ok     { color: var(--neon-accent);    box-shadow: inset 0 0 0 1px var(--neon-accent); }
.badge-used   { color: #4fa3e0;              box-shadow: inset 0 0 0 1px rgba(79,163,224,.45); }
.badge-danger { color: var(--color-danger);  box-shadow: inset 0 0 0 1px var(--color-danger); }
.badge-warn   { color: var(--color-warning); box-shadow: inset 0 0 0 1px var(--color-warning); }

.btn-sm {
  font-size: 0.36rem;
  padding: 0.3rem 0.6rem;
}

.btn-warn {
  color: var(--color-warning);
  box-shadow: inset 0 0 0 1px var(--color-warning);
}
.btn-warn:hover {
  background: rgba(255,170,0,0.08);
  box-shadow: inset 0 0 0 1px var(--color-warning), 0 0 10px rgba(255,170,0,0.2);
}

.input-sm { padding: 0.3rem 0.5rem; font-size: 0.85rem; min-width: 0; }

.form-label-sm {
  font-size: 0.5rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.2rem;
}

/* ── Account sections ────────────────────────────────────────────────────── */
.account-section {
  background: rgba(var(--bg-panel-rgb), 0.82);
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.1);
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.account-section-title {
  font-family: var(--font-admin);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--neon-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.account-data-card {
  background: var(--bg-surface);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.08);
}

.account-data-row  { display: flex; gap: 1.5rem; align-items: baseline; }
.account-data-grid { display: grid; grid-template-columns: 160px 1fr; row-gap: 0.6rem; column-gap: 1rem; align-items: baseline; }
.account-data-mono { font-family: var(--font-body); font-size: 0.75rem; color: var(--text-muted); word-break: break-all; }

.account-data-label {
  font-family: var(--font-pixel);
  font-size: 0.32rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  min-width: 140px;
  flex-shrink: 0;
}

.account-data-value {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
}

.danger-zone {
  box-shadow: inset 0 0 0 1px rgba(224, 122, 95, 0.3);
}

.danger-title { color: var(--color-danger) !important; text-shadow: 0 0 8px var(--color-danger) !important; }

/* ── API key cards (mobile-first) ───────────────────────────────────────── */
.apikey-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.apikey-card {
  background: var(--bg-surface);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.12);
}

.apikey-card-revoked {
  opacity: 0.55;
  box-shadow: inset 0 0 0 1px rgba(224, 122, 95, 0.2);
}

.apikey-card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
}

.apikey-card-head {
  justify-content: space-between;
}

.apikey-card-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.apikey-card-name {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.apikey-edit-btn {
  opacity: 0.4;
  padding: 0.1rem 0.35rem !important;
}
.apikey-edit-btn:hover { opacity: 1; }

.apikey-card-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.apikey-card-info {
  border-top: 1px solid rgba(0, 212, 255, 0.08);
  padding-top: 0.55rem;
}

.apikey-card-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 140px;
}

.apikey-card-field-label {
  font-family: var(--font-admin, var(--font-body));
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.apikey-card-field-value {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.apikey-hostname {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.apikey-card-muted {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.apikey-card-foot {
  border-top: 1px solid rgba(0, 212, 255, 0.08);
  padding-top: 0.55rem;
  justify-content: space-between;
}

.apikey-card-dates {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 0.2rem 0.55rem;
  align-items: baseline;
  font-size: 0.72rem;
}

.apikey-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

@media (min-width: 640px) {
  .apikey-card {
    padding: 1rem 1.25rem;
    gap: 0.75rem;
  }
  .apikey-card-dates {
    grid-template-columns: auto auto auto auto;
    gap: 0.3rem 1.2rem;
  }
}

.delete-confirm-box {
  background: rgba(224, 122, 95, 0.06);
  box-shadow: inset 0 0 0 1px var(--color-danger);
  padding: 1.25rem 1.5rem;
}

/* ── My Scores page ──────────────────────────────────────────────────────── */
.my-scores-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(var(--bg-panel-rgb), 0.6);
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.1);
}

.my-scores-summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.my-scores-summary-value {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--neon-accent);
  text-shadow: 0 0 6px var(--neon-accent);
}

.my-scores-summary-label {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.my-scores-summary-sep {
  color: var(--text-muted);
  font-size: 1.2rem;
}

.my-scores-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.my-scores-card {
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.1);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.my-scores-card-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.my-scores-game-link {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  color: var(--neon-primary);
  text-decoration: none;
  flex: 1;
  letter-spacing: 0.06em;
}

.my-scores-game-link:hover {
  color: var(--neon-accent);
  text-shadow: 0 0 6px var(--neon-accent);
}

.my-scores-pb-label {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.my-scores-pb-value {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--neon-gold);
  text-shadow: 0 0 6px var(--neon-gold);
  white-space: nowrap;
}

.my-scores-table {
  width: 100%;
  border-collapse: collapse;
}

.my-scores-table th {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-align: left;
  padding-bottom: 0.3rem;
}

.my-scores-table td {
  padding: 0.18rem 0;
  border-bottom: 1px solid rgba(0, 212, 255, 0.05);
}

.my-scores-table .mss-score {
  font-family: var(--font-pixel);
  font-size: 0.42rem;
  color: var(--text-secondary);
}

.my-scores-best-row .mss-score {
  color: var(--neon-accent);
  text-shadow: 0 0 4px var(--neon-accent);
}

.my-scores-table .mss-star {
  color: var(--neon-gold);
  font-size: 0.9rem;
  line-height: 1;
  width: 1.2rem;
  text-align: center;
}

.my-scores-table .mss-date {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
}

.my-scores-count {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-align: right;
  margin-top: auto;
}

@media (min-width: 640px) {
  .my-scores-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .my-scores-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Leaderboard flag voting ─────────────────────────────────────────────── */
th.flag-col, td.flag-col {
  width: 48px;
  text-align: center;
  padding: 0.4rem 0.5rem;
}

.btn-flag {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  padding: 0.2rem 0.4rem;
  transition: color 0.1s, text-shadow 0.1s;
  line-height: 1;
}

.btn-flag:hover:not(:disabled) {
  color: var(--color-warning);
  text-shadow: 0 0 8px var(--color-warning);
}

.btn-flag:disabled { opacity: 0.4; cursor: default; }

.flag-indicator {
  color: var(--color-warning);
  text-shadow: 0 0 6px var(--color-warning);
  font-size: 1rem;
  opacity: 0.8;
  cursor: default;
  title: "You flagged this score";
}

.flag-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.flag-reason-input {
  min-width: 120px;
  max-width: 180px;
}

/* ── Player name cell ────────────────────────────────────────────────────── */
td.player-name {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Top-3 left border accents ───────────────────────────────────────────── */
.rank-gold   td:first-child { border-left: 3px solid var(--neon-gold); }
.rank-silver td:first-child { border-left: 2px solid var(--neon-silver); }
.rank-bronze td:first-child { border-left: 2px solid var(--neon-bronze); }

/* ── Rank 1 champion — gold player name, larger score ────────────────────── */
.rank-gold td.player-name {
  font-family: var(--font-pixel);
  font-size: 0.44rem;
  color: var(--neon-gold);
  text-shadow: var(--glow-gold);
  letter-spacing: 0.04em;
}
.rank-gold td.score { font-size: 0.92rem; }

/* ── Podium separator: subtle line before the pack ───────────────────────── */
.leaderboard-table tbody tr:nth-child(4) td {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 0.9rem;
}

/* ── Row entrance stagger ────────────────────────────────────────────────── */
@keyframes lb-row-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.leaderboard-table tbody tr { animation: lb-row-in 0.22s ease both; }
.leaderboard-table tbody tr:nth-child(1)   { animation-delay: 0.00s; }
.leaderboard-table tbody tr:nth-child(2)   { animation-delay: 0.05s; }
.leaderboard-table tbody tr:nth-child(3)   { animation-delay: 0.10s; }
.leaderboard-table tbody tr:nth-child(4)   { animation-delay: 0.15s; }
.leaderboard-table tbody tr:nth-child(5)   { animation-delay: 0.19s; }
.leaderboard-table tbody tr:nth-child(6)   { animation-delay: 0.23s; }
.leaderboard-table tbody tr:nth-child(7)   { animation-delay: 0.27s; }
.leaderboard-table tbody tr:nth-child(8)   { animation-delay: 0.31s; }
.leaderboard-table tbody tr:nth-child(n+9) { animation-delay: 0.35s; }

/* ── Focus ───────────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--neon-secondary);
  outline-offset: 2px;
  box-shadow: 0 0 8px var(--neon-secondary);
}

/* ── Theme toggle ────────────────────────────────────────────────────────── */
.theme-toggle {
  font-size: 1rem;
  line-height: 1;
  padding: 0.375rem 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
}

/* ── Text helpers ────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-secondary); font-size: 1rem; }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb { background: var(--neon-primary); box-shadow: 0 0 6px var(--neon-primary); }
::-webkit-scrollbar-thumb:hover { background: var(--neon-secondary); }

/* ── Hamburger button ────────────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--neon-primary);
  box-shadow: 0 0 6px var(--neon-primary);
  transition: transform 0.2s, opacity 0.2s;
  transform-origin: center;
}

.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Desktop nav visible, mobile right hidden */
.topbar-desktop     { display: flex; }
.topbar-mobile-right { display: none; align-items: center; gap: 0.5rem; }

/* ── Mobile nav overlay ──────────────────────────────────────────────────── */
.mobile-nav-overlay {
  position: fixed;
  inset: 60px 0 0 0;
  z-index: 999;
  background: rgba(0,0,0,0.7);
}

.mobile-nav {
  position: absolute;
  top: 0; right: 0;
  width: min(280px, 85vw);
  background: var(--bg-panel);
  box-shadow:
    inset 0 0 0 1px var(--neon-primary),
    -4px 0 20px rgba(14, 30, 51, 0.6);
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}

.mobile-nav-link {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.08);
  display: block;
  transition: color 0.1s, background 0.1s;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--neon-primary);
  text-shadow: 0 0 8px var(--neon-primary);
  background: rgba(0, 212, 255, 0.06);
}

.mobile-nav-link-btn {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0, 212, 255, 0.08);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.mobile-nav-link-primary { color: var(--neon-primary); text-shadow: 0 0 6px var(--neon-primary); }
.mobile-nav-link-muted   { color: var(--color-text-muted); font-size: 0.38rem; opacity: 0.7; }

/* ── Online Now / Presence ───────────────────────────────────────────────── */
.presence-panel {
  max-width: 1350px;
  margin: 0 auto 2.5rem;
  background: rgba(var(--bg-panel-rgb), 0.82);
  box-shadow: var(--shadow-presence);
}

.presence-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.12);
}

.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.presence-dot-live {
  background: var(--neon-secondary);
  box-shadow: 0 0 6px var(--neon-secondary), 0 0 12px var(--neon-secondary);
  animation: blink 2s step-end infinite;
}

.presence-title {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  color: var(--neon-secondary);
  text-shadow: 0 0 8px var(--neon-secondary);
  letter-spacing: 0.12em;
}

.presence-count {
  font-family: var(--font-pixel);
  font-size: 0.32rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.presence-empty {
  font-family: var(--font-pixel);
  font-size: 0.32rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  padding: 0.875rem 1rem;
  text-align: center;
}

.presence-list {
  display: flex;
  flex-direction: row;
  gap: 0;
  overflow-x: auto;
}

.presence-card {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.6rem 1rem;
  border-right: 1px solid rgba(0, 212, 255, 0.08);
  min-width: 140px;
  flex-shrink: 0;
}

.presence-card:last-child {
  border-right: none;
}

.presence-player {
  font-family: var(--font-pixel);
  font-size: 0.36rem;
  color: var(--neon-secondary);
  text-shadow: 0 0 6px var(--neon-secondary);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.presence-game {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--neon-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.presence-since {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Presence column (right sidebar, authenticated only) ─────────────────── */
.presence-col {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(var(--bg-panel-rgb), 0.82);
  box-shadow: var(--shadow-presence);
  align-self: flex-start;
  position: sticky;
  top: 76px;
}

.presence-col .presence-list {
  flex-direction: column;
  overflow-x: unset;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

.presence-col .presence-card {
  border-right: none;
  border-bottom: 1px solid rgba(0, 212, 255, 0.08);
  min-width: unset;
}

.presence-col .presence-card:last-child { border-bottom: none; }

/* ── Theme switch button ──────────────────────────────────────────────────── */
.theme-switch {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  letter-spacing: 0.06em;
  padding: 0.375rem 0.6rem;
}

/* ── Theme: Miami 80s (white + hot pink + magenta) ───────────────────────── */
html[data-theme="miami"] {
    --bg-void:        #fafafa;
    --bg-panel:       #ffffff;
    --bg-surface:     #fdf0f6;
    --bg-hover:       #fce4ee;
    --text-primary:   #1a0a2e;
    --text-secondary: #8b2252;
    --text-muted:     #d4a0b8;
    --neon-primary:   #ff2d78;
    --neon-secondary: #d946ef;
    --neon-accent:    #d946ef;
    --neon-hot:       #ff007f;
    --neon-gold:      #f5a623;
    --neon-silver:    #c0b8d4;
    --neon-bronze:    #e87080;
    --color-success:  #30d158;
    --color-warning:  #f5a623;
    --color-danger:   #ff2d78;
    --color-info:     #d946ef;
    --glow-primary:   none;
    --glow-secondary: none;
    --glow-accent:    none;
    --shadow-topbar:  0 1px 0 rgba(255,45,120,0.15);
    --shadow-card:    0 2px 8px rgba(255,45,120,0.06);
    --shadow-modal:   0 4px 24px rgba(0,0,0,0.12);
    --border:         rgba(255,45,120,0.2);
    --bg-panel-rgb:   255, 255, 255;
}

/* Crisp white overlay with a hint of pink so the arcade bg glows through */
html[data-theme="miami"]::before {
    background:
        linear-gradient(rgba(255,255,255,0.84), rgba(252,230,242,0.80)),
        url('/arcade.png') center / cover;
}

html[data-theme="miami"] .topbar                             { border-bottom-color: rgba(255,45,120,0.16); box-shadow: 0 1px 0 rgba(255,45,120,0.08); }
html[data-theme="miami"] .stats-strip                        { border-bottom-color: rgba(255,45,120,0.12); }
html[data-theme="miami"] .stats-strip-item + .stats-strip-item { border-left-color: rgba(255,45,120,0.08); }
html[data-theme="miami"] .game-card                          { border-color: rgba(255,45,120,0.12); }
html[data-theme="miami"] .game-card:hover                    { border-color: rgba(255,45,120,0.32); background: var(--bg-surface); }
html[data-theme="miami"] .game-card-header                   { border-bottom-color: rgba(255,45,120,0.08); }
html[data-theme="miami"] .game-card-score-row + .game-card-score-row { border-top-color: rgba(255,45,120,0.06); }
html[data-theme="miami"] .game-card-footer                   { border-top-color: rgba(255,45,120,0.08); }
html[data-theme="miami"] .game-card-link                     { border-color: rgba(255,45,120,0.22); }
html[data-theme="miami"] .presence-strip                     { border-top-color: rgba(255,45,120,0.12); }
html[data-theme="miami"] .presence-strip-label               { border-right-color: rgba(255,45,120,0.1); }
html[data-theme="miami"] .presence-strip-item                { border-right-color: rgba(255,45,120,0.07); }
html[data-theme="miami"] .dashboard-side                     { border-left-color: rgba(255,45,120,0.12); }
html[data-theme="miami"] .dash-panel                         { border-bottom-color: rgba(255,45,120,0.08); }
html[data-theme="miami"] .dash-panel-header                  { border-bottom-color: rgba(255,45,120,0.08); }
html[data-theme="miami"] .dash-online-item                   { border-bottom-color: rgba(255,45,120,0.05); }
html[data-theme="miami"] .dash-group-item                    { border-bottom-color: rgba(255,45,120,0.05); }
html[data-theme="miami"] .dash-score-item                    { border-bottom-color: rgba(255,45,120,0.05); }
html[data-theme="miami"] .dash-panel-link                    { border-top-color: rgba(255,45,120,0.06); }
html[data-theme="miami"] .leaderboard-page-header            { border-bottom-color: rgba(255,45,120,0.14); }
html[data-theme="miami"] .group-card                         { border-color: rgba(255,45,120,0.12); }
html[data-theme="miami"] .group-card:hover                   { border-color: rgba(255,45,120,0.32); }
html[data-theme="miami"] .group-card-new                     { border-color: rgba(255,45,120,0.12); border-top-color: rgba(255,45,120,0.38); }
html[data-theme="miami"] .group-card-new:hover               { border-color: rgba(255,45,120,0.3); border-top-color: var(--neon-primary); }
html[data-theme="miami"] .group-card-header                  { background: rgba(255,45,120,0.05); }
html[data-theme="miami"] .group-card-footer                  { border-top-color: rgba(255,45,120,0.1); }
html[data-theme="miami"] .create-panel                       { border-color: rgba(255,45,120,0.18); }
html[data-theme="miami"] .group-leaderboard-header           { border-bottom-color: rgba(255,45,120,0.12); }
html[data-theme="miami"] .game-tab                           { border-color: rgba(255,45,120,0.18); }
html[data-theme="miami"] .game-tab:hover                     { border-color: rgba(255,45,120,0.42); }
html[data-theme="miami"] .game-tab.active                    { background: rgba(255,45,120,0.08); border-color: var(--neon-primary); }
html[data-theme="miami"] .btn-primary                        { background: var(--neon-primary); box-shadow: none; color: #fff; }
html[data-theme="miami"] .btn-primary:hover:not(:disabled)   { background: #e0105a; box-shadow: none; }
html[data-theme="miami"] .btn-ghost:hover:not(:disabled)     { box-shadow: inset 0 0 0 1px var(--neon-primary); color: var(--neon-primary); }
html[data-theme="miami"] .input                              { background: rgba(255,255,255,0.9); border-color: rgba(255,45,120,0.2); color: var(--text-primary); }
html[data-theme="miami"] .input:focus                        { box-shadow: inset 0 0 0 1px var(--neon-primary); }
html[data-theme="miami"] .style-toggle-row                   { border-bottom-color: rgba(255,45,120,0.08); }
html[data-theme="miami"] .style-toggle-btn                   { border-color: rgba(255,45,120,0.2); }
html[data-theme="miami"] .style-toggle-btn:hover             { border-color: rgba(255,45,120,0.45); color: var(--text-primary); }
html[data-theme="miami"] .leaderboard-live.live-on           { box-shadow: none; }
html[data-theme="miami"] .presence-dot-live                  { box-shadow: none; }
html[data-theme="miami"] :focus-visible                      { box-shadow: 0 0 0 1px var(--neon-primary); }
html[data-theme="miami"] ::-webkit-scrollbar-thumb           { background: var(--neon-primary); box-shadow: none; }
html[data-theme="miami"] .rank-gold td.player-name           { text-shadow: none; }

/* ── Home layout (legacy) ────────────────────────────────────────────────── */
.home-layout {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
  margin: -2rem -2rem 0;
}

/* ── Dashboard root ──────────────────────────────────────────────────────── */
.dashboard-root {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
  margin: -2rem -2rem 0;
}

.dashboard-body {
  display: grid;
  grid-template-columns: 1fr 260px;
  flex: 1;
  align-items: start;
}

.dashboard-main {
  min-width: 0;
}

.dashboard-side {
  border-left: 1px solid rgba(0, 212, 255, 0.1);
  position: sticky;
  top: 60px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 212, 255, 0.15) transparent;
}

/* ── Dashboard sidebar panels ────────────────────────────────────────────── */
.dash-panel {
  border-bottom: 1px solid rgba(0, 212, 255, 0.08);
}

.dash-panel-header {
  padding: 0.6rem 1rem;
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(0, 212, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-panel);
  position: sticky;
  top: 0;
}

.dash-panel-empty {
  padding: 0.65rem 1rem;
  font-family: var(--font-body);
  font-size: 0.55rem;
  color: var(--text-muted);
}

.dash-panel-link {
  display: block;
  padding: 0.45rem 1rem;
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-decoration: none;
  border-top: 1px solid rgba(0, 212, 255, 0.05);
  transition: color 0.15s;
}
.dash-panel-link:hover { color: var(--neon-primary); }

/* Online now panel */
.dash-online-item {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.04);
}
.dash-online-item:last-child { border-bottom: none; }

.dash-online-name {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  color: var(--text-primary);
  display: block;
}

.dash-online-game {
  font-family: var(--font-body);
  font-size: 0.58rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.08rem;
}

/* My groups panel */
.dash-group-item {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(0, 212, 255, 0.04);
  transition: background 0.1s;
}
.dash-group-item:last-of-type { border-bottom: none; }
.dash-group-item:hover { background: var(--bg-hover); text-decoration: none; }

.dash-group-name {
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: var(--text-primary);
  display: block;
}

.dash-group-meta {
  font-family: var(--font-body);
  font-size: 0.5rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.06rem;
}

/* My scores panel */
.dash-score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.04);
  text-decoration: none;
  transition: background 0.1s;
}
.dash-score-item:last-child { border-bottom: none; }
.dash-score-item:hover { background: var(--bg-hover); }

.dash-score-game {
  font-family: var(--font-body);
  font-size: 0.62rem;
  color: var(--text-secondary);
}

.dash-score-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-score-val {
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  color: var(--neon-primary);
}

.dash-score-rank {
  font-family: var(--font-pixel);
  font-size: 0.26rem;
  color: var(--text-muted);
}

/* ── Game card flash on live update ─────────────────────────────────────── */
@keyframes card-flash {
  0%   { border-color: var(--neon-accent); box-shadow: 0 0 8px rgba(94, 232, 180, 0.25); }
  60%  { border-color: var(--neon-accent); box-shadow: 0 0 8px rgba(94, 232, 180, 0.25); }
  100% { border-color: rgba(0, 212, 255, 0.1); box-shadow: none; }
}

.game-card-updated {
  animation: card-flash 1.2s ease forwards;
}

/* ── Stats strip ─────────────────────────────────────────────────────────── */
.stats-strip {
  background: rgba(var(--bg-panel-rgb), 0.82);
  border-bottom: 1px solid rgba(0, 212, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  height: 36px;
  overflow: hidden;
  font-family: var(--font-pixel);
  font-size: 0.34rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.stats-strip-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.25rem;
  height: 100%;
}

.stats-strip-item + .stats-strip-item {
  border-left: 1px solid rgba(0, 212, 255, 0.08);
}

.stats-strip-value {
  color: var(--text-secondary);
}

/* ── Game card grid ──────────────────────────────────────────────────────── */
.game-grid {
  flex: 1;
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  align-content: start;
}

.game-card {
  background: rgba(var(--bg-panel-rgb), 0.82);
  border: 1px solid rgba(0, 212, 255, 0.1);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, background 0.15s;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.game-card:hover {
  border-color: rgba(0, 212, 255, 0.28);
  background: var(--bg-surface);
}

.game-card-marquee {
  position: relative;
  width: 100%;
  aspect-ratio: 3.5 / 1;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 212, 255, 0.08);
  background: #0a0a0f;
}

.game-card-marquee img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: saturate(1.1) contrast(1.05);
  transition: transform 0.3s ease;
}

.game-card:hover .game-card-marquee img {
  transform: scale(1.03);
}

.game-card-marquee-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle, rgba(0, 212, 255, 0.07) 1px, transparent 1px),
    #070d14;
  background-size: 18px 18px, auto;
  font-family: var(--font-pixel);
  font-size: 0.42rem;
  color: rgba(0, 212, 255, 0.28);
  letter-spacing: 0.14em;
  text-align: center;
  padding: 0.5rem 1rem;
  text-transform: uppercase;
}

.game-card-live-overlay {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  background: rgba(0,0,0,0.55);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

.game-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.08);
}


.game-card-title {
  font-family: var(--font-pixel);
  font-size: 0.44rem;
  color: var(--neon-primary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}

.game-card-live {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  color: var(--neon-accent);
  letter-spacing: 0.06em;
  animation: blink 2s step-end infinite;
}

.game-card-scores {
  flex: 1;
}

.game-card-score-row {
  display: grid;
  grid-template-columns: 40px auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
}

.game-card-score-row + .game-card-score-row {
  border-top: 1px solid rgba(0, 212, 255, 0.05);
}

.game-card-rank {
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  text-align: center;
  letter-spacing: 0.04em;
}

.game-card-rank.rank-1 { color: var(--neon-gold); }
.game-card-rank.rank-2 { color: var(--neon-silver); }
.game-card-rank.rank-3 { color: var(--neon-bronze); }

.game-card-player {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-card-score-val {
  font-family: var(--font-pixel);
  font-size: 0.48rem;
  color: var(--neon-accent);
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-shadow: var(--glow-accent);
}

.game-card-empty {
  padding: 1.25rem 1rem;
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  line-height: 2.2;
}

.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-top: 1px solid rgba(0, 212, 255, 0.08);
}

.game-card-meta {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.game-card-link {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  color: var(--neon-primary);
  text-decoration: none;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(0, 212, 255, 0.2);
  transition: border-color 0.1s, color 0.1s;
}

.game-card-link:hover {
  color: var(--neon-secondary);
  border-color: var(--neon-secondary);
}

/* ── Presence strip (home page bottom) ───────────────────────────────────── */
.presence-strip {
  border-top: 1px solid rgba(0, 212, 255, 0.1);
  background: var(--bg-panel);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 44px;
  overflow-x: auto;
  flex-shrink: 0;
}

.presence-strip-label {
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  flex-shrink: 0;
  padding-right: 1.25rem;
  border-right: 1px solid rgba(0, 212, 255, 0.08);
  margin-right: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 44px;
}

.presence-strip-empty {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  padding-left: 1.25rem;
}

.presence-strip-item {
  flex-shrink: 0;
  padding: 0 1.25rem;
  border-right: 1px solid rgba(0, 212, 255, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 44px;
}

.presence-strip-player {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  color: var(--neon-secondary);
  letter-spacing: 0.04em;
}

.presence-strip-game {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ── Leaderboard detail page ──────────────────────────────────────────────── */
.leaderboard-page {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.leaderboard-page-marquee {
  width: 100%;
  aspect-ratio: 5 / 1;
  overflow: hidden;
  border: 1px solid rgba(0, 212, 255, 0.1);
  background: #070d14;
}

.leaderboard-page-marquee img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: saturate(1.1) contrast(1.05);
}

.breadcrumb {
  font-family: var(--font-pixel);
  font-size: 0.32rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb a {
  color: var(--neon-primary);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--neon-secondary); }

.leaderboard-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.12);
}

.leaderboard-page-title {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--neon-primary);
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
}

.leaderboard-page-sub {
  font-family: var(--font-body);
  font-size: 1.15rem;
  color: var(--text-muted);
}

/* ── Groups page ──────────────────────────────────────────────────────────── */
.group-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.group-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: rgba(var(--bg-panel-rgb), 0.82);
  border: 1px solid rgba(0, 212, 255, 0.1);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}

.group-card:hover {
  border-color: rgba(0, 212, 255, 0.28);
  background: var(--bg-surface);
}

.group-card-avatar {
  width: 40px;
  height: 40px;
  object-fit: cover;
  flex-shrink: 0;
}

.group-card-avatar-placeholder {
  width: 40px;
  height: 40px;
  background: var(--bg-surface);
  border: 1px solid rgba(0, 212, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--neon-primary);
  flex-shrink: 0;
  text-transform: uppercase;
}

.group-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.group-card-name {
  font-family: var(--font-pixel);
  font-size: 0.42rem;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.group-card-desc {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.group-card-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.badge-role {
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.4rem;
  color: var(--neon-secondary);
  box-shadow: inset 0 0 0 1px var(--neon-secondary);
}

/* ── Groups toolbar (search + create button) ─────────────────────────────── */
.groups-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.groups-search {
  flex: 1;
  max-width: 340px;
}

/* ── View toggle (grid / list) ───────────────────────────────────────────── */
.view-toggle-group {
  display: flex;
  border: 1px solid rgba(0, 212, 255, 0.2);
  flex-shrink: 0;
}

.view-toggle-btn {
  background: transparent;
  border: none;
  border-left: 1px solid rgba(0, 212, 255, 0.15);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.view-toggle-btn:first-child { border-left: none; }
.view-toggle-btn:hover  { color: var(--text-secondary); background: rgba(0, 212, 255, 0.08); }
.view-toggle-btn.active { color: var(--neon-primary);   background: rgba(0, 212, 255, 0.1); }

/* ── Groups grid (tile layout) ───────────────────────────────────────────── */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 290px);
  gap: 1rem;
}

/* ── List view ───────────────────────────────────────────────────────────── */
.groups-grid.list-view {
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.groups-grid.list-view .group-card-new {
  width: 100%;
  min-height: 80px;
  height: 80px;
  flex-direction: row;
  align-items: stretch;
}

.groups-grid.list-view .group-card-new:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 212, 255, 0.1);
}

/* Header zone — left column */
.groups-grid.list-view .group-card-new .group-card-header {
  flex: 0 0 220px;
  height: auto;
  border-bottom: none;
  border-right: 1px solid rgba(0, 212, 255, 0.1);
  justify-content: center;
  padding: 0.5rem 0.8rem;
}

.groups-grid.list-view .group-card-new .group-card-header-name {
  -webkit-line-clamp: 1;
}

/* Body zone — middle */
.groups-grid.list-view .group-card-new .group-card-body {
  flex: 1;
  padding: 0 0.8rem;
  justify-content: center;
  overflow: hidden;
}

.groups-grid.list-view .group-card-new .group-card-desc-new {
  -webkit-line-clamp: 2;
}

/* Footer zone — right column */
.groups-grid.list-view .group-card-new .group-card-footer {
  flex: 0 0 auto;
  min-width: 110px;
  border-top: none;
  border-left: 1px solid rgba(0, 212, 255, 0.1);
  padding: 0 0.8rem;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ── Group card (square tile) ───────────────────────────────────────────── */
.group-card-new {
  display: flex;
  flex-direction: column;
  width: 290px;
  min-height: 268px;
  background: rgba(var(--bg-panel-rgb), 0.88);
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-top: 2px solid rgba(0, 212, 255, 0.28);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s, transform 0.14s, box-shadow 0.15s;
}

.group-card-new:hover {
  background: rgba(var(--bg-panel-rgb), 0.96);
  border-color: rgba(0, 212, 255, 0.3);
  border-top-color: var(--neon-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.12);
}

.group-card-mine {
  border-top-color: rgba(109, 204, 184, 0.45);
}

.group-card-mine:hover {
  border-color: rgba(109, 204, 184, 0.25);
  border-top-color: var(--neon-secondary);
  box-shadow: 0 4px 16px rgba(109, 204, 184, 0.1);
}

/* Header zone */
.group-card-header {
  position: relative;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.65rem 0.75rem 0.55rem;
  background: rgba(0, 0, 0, 0.22);
  flex-shrink: 0;
  gap: 0.18rem;
}

.group-card-header-sub {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1rem;
}

.group-card-header-name {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  transition: color 0.14s;
}

.group-card-new:hover .group-card-header-name  { color: var(--neon-primary); }
.group-card-mine:hover .group-card-header-name { color: var(--neon-secondary); }

.group-card-flag-icon {
  font-size: 1rem;
  line-height: 1;
  display: inline-block;
  border-radius: 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.group-card-flag-icon {
  font-size: 1rem;
  line-height: 1;
  display: inline-block;
  border-radius: 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Body zone */
.group-card-body {
  flex: 1;
  padding: 0.55rem 0.65rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overflow: hidden;
}

.group-card-name-new {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.14s;
}

.group-card-new:hover .group-card-name-new   { color: var(--neon-primary); }
.group-card-mine:hover .group-card-name-new  { color: var(--neon-secondary); }

.group-card-desc-new {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer zone */
.group-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.65rem;
  border-top: 1px solid rgba(0, 212, 255, 0.1);
  flex-shrink: 0;
}

.group-card-members-stat {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.group-card-stat-count {
  font-family: var(--font-pixel);
  font-size: 0.34rem;
  color: var(--neon-primary);
}

.group-card-mine .group-card-stat-count { color: var(--neon-secondary); }

.group-card-stat-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ── Private badge ───────────────────────────────────────────────────────── */
.badge-private {
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.4rem;
  color: var(--neon-accent);
  box-shadow: inset 0 0 0 1px var(--neon-accent);
}

/* ── Private group wall ──────────────────────────────────────────────────── */
.private-group-wall {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 2rem;
  background: rgba(var(--bg-panel-rgb), 0.6);
  border: 1px solid rgba(0, 212, 255, 0.12);
  margin: 1.5rem 0;
  text-align: center;
}

.private-group-wall-icon {
  font-size: 2.5rem;
  color: var(--neon-accent);
  opacity: 0.5;
  line-height: 1;
}

.private-group-wall-title {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.private-group-wall-sub {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 36ch;
  margin: 0;
}

/* ── Group settings row ──────────────────────────────────────────────────── */
.group-settings-row {
  padding: 0.5rem 0;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
}

/* ── Suspended banner ────────────────────────────────────────────────────── */
.suspended-banner {
  background: rgba(255, 60, 60, 0.12);
  border: 1px solid rgba(255, 60, 60, 0.5);
  color: #ff6060;
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  letter-spacing: 0.08em;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  border-radius: 2px;
}

/* ── Report group form ───────────────────────────────────────────────────── */
.report-form-panel {
  background: rgba(255, 60, 60, 0.05);
  border: 1px solid rgba(255, 60, 60, 0.3);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: 2px;
}

.report-form-title {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: #ff6060;
  margin: 0 0 0.5rem;
  letter-spacing: 0.06em;
}

.report-form-hint {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
}

/* ── Admin link ──────────────────────────────────────────────────────────── */
.admin-link {
  color: var(--neon-primary);
  text-decoration: none;
}

.admin-link:hover {
  text-decoration: underline;
}

.toggle-label input[type="checkbox"] {
  accent-color: var(--neon-primary);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.form-group-inline {
  flex-direction: row;
  align-items: center;
}

/* ── Create group panel ───────────────────────────────────────────────────── */
.create-panel {
  background: rgba(var(--bg-panel-rgb), 0.82);
  border: 1px solid rgba(0, 212, 255, 0.15);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.create-panel-title {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  margin: 0;
}

.form-hint {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: normal;
}

/* ── Group detail page ────────────────────────────────────────────────────── */
/* ── Group detail — new layout ───────────────────────────────────────────── */
.group-detail-layout {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.group-detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: rgba(var(--bg-panel-rgb), 0.85);
  border-bottom: 2px solid rgba(0, 212, 255, 0.2);
}

.group-detail-hero-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  min-width: 0;
}

.group-detail-hero-name {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--neon-primary);
  letter-spacing: 0.05em;
  margin: 0;
  line-height: 1.3;
  text-shadow: var(--glow-primary);
}

.group-hero-flag {
  font-size: 0.75rem;
  display: inline-block;
  vertical-align: middle;
  border-radius: 1px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.group-detail-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Custom confirm dialog */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.confirm-dialog {
  background: var(--bg-panel);
  border: 1px solid rgba(0, 212, 255, 0.25);
  box-shadow: 0 0 32px rgba(0, 212, 255, 0.12);
  padding: 1.75rem 2rem;
  min-width: 280px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.confirm-msg {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-primary);
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.btn-fav-active {
  color: var(--neon-gold) !important;
  box-shadow: inset 0 0 0 1px var(--neon-gold) !important;
}

/* Favorite group card */
.fav-group-card {
  display: block;
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 2px solid var(--neon-gold);
  background: rgba(255, 209, 102, 0.05);
  transition: background 0.15s;
}
.fav-group-card:hover {
  background: rgba(255, 209, 102, 0.1);
  text-decoration: none;
}
.fav-group-label {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  letter-spacing: 0.12em;
  color: var(--neon-gold);
  margin-bottom: 0.35rem;
}
.fav-group-name {
  font-family: var(--font-pixel);
  font-size: 0.36rem;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}
.fav-group-meta {
  font-family: var(--font-body);
  font-size: 0.52rem;
  color: var(--text-muted);
}

/* Info tab panel */
.group-info-tab {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-width: 480px;
}

/* Mobile-only group info block (hidden on desktop) */
.group-info-mobile {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Sidebar activity feed */
.group-sidebar-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 440px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 212, 255, 0.15) transparent;
}

.activity-entry-compact {
  flex-wrap: wrap;
  padding: 0.4rem 0;
  gap: 0.4rem;
}

.activity-entry-compact .activity-time {
  margin-left: 0;
  flex-basis: 100%;
}

/* Body: sidebar left + main right */
.group-detail-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: stretch;
}

/* SIDEBAR */
.group-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.group-sidebar-avatar {
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid rgba(0, 212, 255, 0.2);
  display: block;
}

.group-sidebar-heading {
  font-family: var(--font-pixel);
  font-size: 0.26rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.1);
  margin-bottom: 0.1rem;
}

.group-sidebar-desc {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.group-sidebar-stat {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.group-sidebar-stat-count {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  color: var(--neon-primary);
}

.group-sidebar-stat-label {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.group-sidebar-country {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.group-sidebar-flag {
  font-size: 1rem;
  display: inline-block;
  border-radius: 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

.group-sidebar-btn {
  width: 100%;
}

/* MAIN */
.group-detail-main {
  min-width: 0;
  flex: 1;
}

/* Desktop: sidebar left, main right */
@media (min-width: 640px) {
  .group-info-mobile {
    display: none;
  }

  .group-detail-body {
    flex-direction: row;
    align-items: flex-start;
  }

  .group-detail-sidebar {
    width: 200px;
    flex-shrink: 0;
  }

  .group-sidebar-avatar {
    max-width: 200px;
  }

  .activity-entry-compact .activity-time {
    margin-left: auto;
    flex-basis: auto;
  }
}

/* ── Group detail — legacy header (keep for backward compat) ─────────────── */
.group-detail-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.group-detail-avatar {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.group-detail-info { flex: 1; min-width: 0; }

.group-detail-meta {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.group-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
  flex-shrink: 0;
}

.group-flag {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  display: inline-block;
  border-radius: 2px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.45);
}

.group-card-flag {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  display: inline-block;
}

.group-status-text {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Full-width leaderboard ──────────────────────────────────────────────── */
.group-leaderboard-full {
  margin-bottom: 1.5rem;
}

/* ── Section tabs: HIGHSCORES | EVENTS | MEMBERS | INFO | SETTINGS ──────── */
.group-section-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-top: 0;
  border-bottom: 1px solid rgba(0, 212, 255, 0.18);
  overflow-x: auto;
  scrollbar-width: none;
}
.group-section-tabs::-webkit-scrollbar { display: none; }

.group-section-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  letter-spacing: 0.12em;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.12s, border-color 0.12s;
  margin-bottom: -1px;
  white-space: nowrap;
  flex-shrink: 0;
}
.group-section-tab:hover  { color: var(--text-secondary); border-bottom-color: rgba(0, 212, 255, 0.35); }
.group-section-tab.active { color: var(--neon-primary);   border-bottom-color: var(--neon-primary); }

/* Slim divider between primary and secondary tab groups */
.group-tabs-sep {
  flex-shrink: 0;
  width: 1px;
  margin: 0.35rem 0.5rem;
  background: rgba(0, 212, 255, 0.15);
  align-self: stretch;
}

.tab-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  flex-shrink: 0;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.tab-count {
  font-family: var(--font-body);
  font-size: 0.6rem;
  line-height: 1.2;
  padding: 0.05em 0.5em;
  background: rgba(0, 212, 255, 0.12);
  color: var(--neon-primary);
  border: 1px solid rgba(0, 212, 255, 0.28);
  border-radius: 2px;
}
.tab-count-alert {
  background: rgba(224, 122, 95, 0.12);
  color: var(--color-danger);
  border-color: rgba(224, 122, 95, 0.35);
}

.group-section-panel {
  padding: 1.25rem 0;
}

/* Members tab list */
.members-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  overflow: hidden;
}

.member-role-small {
  font-family: var(--font-pixel);
  font-size: 0.26rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Description textarea */
.textarea-tab {
  width: 100%;
  box-sizing: border-box;
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
  font-family: var(--font-body);
}

/* Horizontal game tab strip */
.game-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.game-tab {
  background: transparent;
  border: 1px solid rgba(0, 212, 255, 0.18);
  color: var(--text-secondary);
  font-family: var(--font-pixel);
  font-size: 0.32rem;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
  text-transform: uppercase;
}

.game-tab:hover {
  border-color: rgba(0, 212, 255, 0.4);
  color: var(--neon-primary);
}

.game-tab.active {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--neon-primary);
  color: var(--neon-primary);
}

/* Group leaderboard section */
.group-leaderboard { margin-bottom: 1.5rem; }

.group-leaderboard-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.group-leaderboard-title {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--neon-primary);
  letter-spacing: 0.06em;
  margin: 0;
}

.group-leaderboard-sub {
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* Group scoreboard — smaller text so the table stays compact */
.group-leaderboard .leaderboard-table td {
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
}
.group-leaderboard .rank-gold   td.rank { font-size: 0.58rem; }
.group-leaderboard .rank-silver td.rank { font-size: 0.5rem;  }
.group-leaderboard .rank-bronze td.rank { font-size: 0.46rem; }

/* Generic section blocks */
.group-section { margin-top: 2rem; }

.section-heading {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
}

.section-heading-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.section-heading-row .section-heading { margin-bottom: 0; }

.section-sub {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Group activity feed ──────────────────────────────────────────────────── */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-entry {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(0, 212, 255, 0.08);
  font-size: 0.82rem;
}

.activity-entry:last-child { border-bottom: none; }

.activity-badge {
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  letter-spacing: 0.1em;
  padding: 0.18em 0.55em;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.activity-badge-newgrouprecord  { background: rgba(255, 50, 50, 0.15); color: #ff5252; border: 1px solid rgba(255, 50, 50, 0.4); }
.activity-badge-beatmemberscore { background: rgba(255, 165, 0, 0.12); color: #ffaa33; border: 1px solid rgba(255, 165, 0, 0.35); }
.activity-badge-newpersonalbest { background: rgba(0, 212, 255, 0.12); color: var(--neon-primary); border: 1px solid rgba(0, 212, 255, 0.3); }
.activity-badge-memberjoined    { background: rgba(50, 205, 50, 0.1); color: #7fff00; border: 1px solid rgba(50, 205, 50, 0.3); }

.activity-text {
  flex: 1;
  color: var(--text-secondary);
  line-height: 1.4;
}

.activity-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: auto;
}

/* ── Event card-new (shares group-card-new structure) ────────────────────── */
.event-card-live     { border-top-color: rgba(94, 232, 180, 0.45); }
.event-card-upcoming { border-top-color: rgba(255, 209, 102, 0.45); }
.event-card-ended    { border-top-color: rgba(90, 110, 130, 0.35); }

.event-card-live:hover     { border-top-color: var(--color-success); box-shadow: 0 4px 16px rgba(94,232,180,0.12); }
.event-card-upcoming:hover { border-top-color: var(--neon-gold);     box-shadow: 0 4px 16px rgba(255,209,102,0.10); }
.event-card-ended:hover    { border-top-color: var(--text-muted); }

.event-card-live .group-card-header     { background: rgba(94, 232, 180, 0.07); }
.event-card-upcoming .group-card-header { background: rgba(255, 209, 102, 0.07); }
.event-card-ended .group-card-header    { background: rgba(58, 90, 122, 0.12); }

.event-card-live:hover .group-card-header-name     { color: var(--color-success); }
.event-card-upcoming:hover .group-card-header-name { color: var(--neon-gold); }
.event-card-ended:hover .group-card-header-name    { color: var(--text-muted); }

.event-card-status-badge-sm {
  font-family: var(--font-pixel);
  font-size: 0.26rem;
  padding: 0.15em 0.45em;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.event-card-status-badge-sm.live     { background: rgba(94,232,180,0.15);  color: var(--color-success); border: 1px solid var(--color-success); }
.event-card-status-badge-sm.upcoming { background: rgba(255,209,102,0.12); color: var(--neon-gold);    border: 1px solid var(--neon-gold); }
.event-card-status-badge-sm.ended    { background: rgba(58,90,122,0.2);    color: var(--text-muted);   border: 1px solid var(--text-muted); }

.event-card-game-pill {
  font-family: var(--font-pixel);
  font-size: 0.26rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.event-card-date-range .group-card-stat-count { color: var(--text-secondary); }

/* ── Event detail sidebar ────────────────────────────────────────────────── */
.event-sidebar-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.event-sidebar-meta-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.event-sidebar-meta-val {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.event-sidebar-back {
  font-family: var(--font-pixel);
  font-size: 0.26rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-decoration: none;
  margin-top: auto;
  padding-top: 0.5rem;
  transition: color 0.14s;
}
.event-sidebar-back:hover { color: var(--neon-primary); }

.event-participants-section { margin-top: 1rem; }
.event-participants-list {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.event-participant-item {
  font-size: 0.72rem;
  color: var(--text-secondary);
  padding: 0.15rem 0;
  border-bottom: 1px solid var(--border);
}
.event-participant-item:last-child { border-bottom: none; }

.event-card-details {
  padding: 0.5rem 1rem 0.75rem 1rem;
}
.event-card-games {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

/* ── Events (legacy — kept for EventDetailPage) ──────────────────────────── */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.event-card {
  background: rgba(var(--bg-panel-rgb), 0.82);
  border: 1px solid var(--border);
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.event-card:hover {
  border-color: var(--neon-primary);
  background: var(--bg-surface);
}

.event-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.event-card-name {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}
.event-card-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.event-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.event-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.event-meta-label {
  font-size: 0.42rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.event-meta-value {
  font-size: 0.7rem;
  color: var(--text-primary);
}
.event-card-footer {
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  margin-top: 0.25rem;
}
.event-view-link {
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  color: var(--neon-primary);
  letter-spacing: 0.1em;
}

/* Status badges */
.event-status-badge {
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  padding: 0.25em 0.55em;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.event-status-badge.live     { background: rgba(94,232,180,0.15); color: var(--color-success); border: 1px solid var(--color-success); }
.event-status-badge.ended    { background: rgba(58,90,122,0.2);   color: var(--text-muted);    border: 1px solid var(--text-muted); }
.event-status-badge.upcoming { background: rgba(255,209,102,0.12); color: var(--neon-gold);   border: 1px solid var(--neon-gold); }
.event-status-badge-lg { font-size: 0.35rem; }

/* Event detail page */
.event-detail-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.event-detail-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.event-detail-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}
.event-meta-sep { color: var(--text-muted); }
.event-meta-date { font-size: 0.65rem; color: var(--text-secondary); }
.event-meta-type { font-size: 0.55rem; color: var(--neon-primary); }
.event-meta-games { font-size: 0.65rem; color: var(--text-muted); }

/* Aggregated leaderboard */
.event-aggregated-table .event-game-col { font-size: 0.35rem; white-space: nowrap; }
.event-game-score {
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  font-size: 0.75rem;
}
.event-rank-badge {
  font-size: 0.38rem;
  color: var(--text-muted);
}

/* Event list (used in GroupDetailPage) */
.event-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* When event-admin-row lives inside an event-list, give it card styling
   and stack the action buttons so the Games dropdown expands downward */
.event-list .event-admin-row {
  background: rgba(var(--bg-panel-rgb), 0.82);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.event-list .event-admin-actions {
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}
.event-list .event-manage-games-body {
  right: 0;
  left: auto;
}
.event-list-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.12s;
}
.event-list-item:hover { border-color: var(--neon-primary); }
.event-list-name {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}
.event-list-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Event mini leaderboard (inline in group events list) */
.event-mini-board {
  padding: 0.75rem 1rem 0.75rem 1rem;
  background: rgba(var(--bg-panel-rgb), 0.5);
  border: 1px solid var(--border);
  border-top: none;
  margin-top: -0.5rem;
}

.event-mini-final {
  font-family: var(--font-pixel);
  font-size: 0.35rem;
  color: var(--neon-primary);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.event-mini-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.event-mini-tab {
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
}
.event-mini-tab:hover { border-color: var(--neon-primary); color: var(--text-primary); }
.event-mini-tab.active { border-color: var(--neon-primary); color: var(--neon-primary); }

.event-mini-table {
  margin: 0;
  font-size: 0.78rem;
}
.event-mini-table td { padding: 0.25rem 0.5rem; }
.event-mini-table .rank { font-size: 0.65rem; }

.event-winner-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 215, 0, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.25);
}
.event-winner-crown { color: #ffd700; font-size: 0.9rem; }
.event-winner-name  { font-family: var(--font-pixel); font-size: 0.35rem; color: #ffd700; letter-spacing: 0.05em; }
.event-winner-score { font-family: var(--font-mono); font-size: 0.8rem; color: #ffd700; margin-left: auto; }

.event-mini-see-all {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  letter-spacing: 0.05em;
  color: var(--neon-primary);
  text-decoration: none;
}
.event-mini-see-all:hover { text-decoration: underline; }

/* Event create / edit forms */
.event-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: rgba(var(--bg-panel-rgb), 0.6);
  border: 1px solid rgba(0, 212, 255, 0.15);
}

.event-create-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}
.form-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.form-label {
  font-size: 0.55rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Admin events tab */
.event-admin-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.event-admin-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.event-admin-name {
  font-family: var(--font-pixel);
  font-size: 0.35rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}
.event-admin-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex-shrink: 0;
}
.event-manage-games {
  position: relative;
}
.event-manage-games summary {
  cursor: pointer;
  list-style: none;
}
.event-manage-games summary::-webkit-details-marker { display: none; }
.event-manage-games-body {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 100;
  min-width: 260px;
  background: var(--bg-panel);
  border: 1px solid rgba(0, 212, 255, 0.25);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.event-game-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  padding: 0.2em 0.5em;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-inline-remove {
  background: none;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  font-size: 0.9em;
  padding: 0;
  line-height: 1;
}
.event-add-game-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  width: 100%;
}
.input-field {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.2;
  padding: 0.38em 0.55em;
  border: 1px solid var(--text-muted);
  outline: none;
  color-scheme: dark;
}
.input-field:focus { border-color: var(--neon-secondary); }
.input-field option { background: var(--bg-void); color: var(--text-primary); }
.input-field-sm { font-size: 0.85rem; padding: 0.2em 0.4em; }

/* NVM config guide */
.nvm-guide {
  line-height: 1.8;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.nvm-table {
  margin-top: 0.4rem;
  border-collapse: collapse;
  width: 100%;
  font-size: 0.65rem;
}

.nvm-table thead { color: var(--text-primary); }
.nvm-table th   { text-align: left; padding: 0.2rem 0.4rem; }
.nvm-table td   { padding: 0.15rem 0.4rem; }

/* ── Group detail two-column layout ─────────────────────────────────────── */
.group-main-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 2rem;
}

/* ── Members sidebar ─────────────────────────────────────────────────────── */
.group-members-sidebar {
  border: 1px solid var(--border);
  background: rgba(var(--bg-panel-rgb), 0.82);
  position: sticky;
  top: calc(60px + 1rem);
  max-height: calc(100vh - 80px - 2rem);
  overflow-y: auto;
}

.group-members-sidebar-header {
  padding: 0.55rem 0.85rem;
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.member-loading {
  padding: 0.6rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.55rem;
  color: var(--text-muted);
}

.member-item {
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 212, 255, 0.06);
  transition: background 0.1s;
}
.member-item:last-child { border-bottom: none; }
.member-item:hover      { background: var(--bg-hover); }
.member-item.expanded   { background: rgba(0, 212, 255, 0.04); }

.member-item-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.member-online-dot,
.member-offline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.member-online-dot {
  background: var(--neon-accent);
  box-shadow: 0 0 5px var(--neon-accent);
}

.member-offline-dot { background: var(--text-muted); }

.member-name {
  font-family: var(--font-body);
  font-size: 0.6rem;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-member-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  padding: 0 0.2rem;
  flex-shrink: 0;
}
.btn-member-remove:hover { color: var(--color-danger); }

.member-expand-panel {
  padding: 0.55rem 0.85rem 0.7rem;
  border-top: 1px solid rgba(0, 212, 255, 0.08);
}

.member-role-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-pixel);
  font-size: 0.26rem;
  color: var(--neon-primary);
  border: 1px solid rgba(0, 212, 255, 0.3);
  margin-bottom: 0.55rem;
}

.member-scores-loading {
  font-family: var(--font-body);
  font-size: 0.5rem;
  color: var(--text-muted);
}

.member-scores-mini {
  width: 100%;
  border-collapse: collapse;
}
.member-scores-mini td {
  font-family: var(--font-body);
  font-size: 0.5rem;
  padding: 0.15rem 0;
  color: var(--text-secondary);
}
.member-scores-mini td:last-child {
  text-align: right;
  color: var(--neon-primary);
}

.member-admin-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.leaderboard-row-clickable { cursor: pointer; }
.leaderboard-row-clickable:hover td { background: rgba(0, 212, 255, 0.04); }

/* ── Mobile (≤ 768px) ────────────────────────────────────────────────────── */
@media (max-width: 1050px) {
  .admin-table thead      { display: none; }
  .admin-table,
  .admin-table tbody      { display: block; }
  .admin-table tr {
    display: block;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.4rem;
  }
  .admin-table td {
    display: block;
    padding: 0.1rem 0;
    border: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .admin-table td.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-top: 0.4rem;
    margin-top: 0.25rem;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .ban-expand-row td { display: block; white-space: normal; }

  /* Section tabs — wrap into 2-column grid below 1050px */
  .group-section-tabs        { flex-wrap: wrap; gap: 0.3rem; border-bottom: none; padding-bottom: 0; margin-bottom: 0.75rem; overflow: visible; }
  .group-tabs-sep            { display: none; }
  .group-section-tab         { flex: 1 1 calc(50% - 0.3rem); padding: 0.5rem 0.4rem; font-size: 0.28rem; text-align: center; border: 1px solid rgba(255,255,255,0.08); border-radius: 3px; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .group-section-tab:hover   { border-color: rgba(0, 212, 255, 0.35); }
  .group-section-tab.active  { border-color: var(--neon-primary); border-bottom-color: var(--neon-primary); background: rgba(0, 212, 255, 0.06); }
}

@media (max-width: 768px) {
  /* Navbar */
  .topbar { padding: 0 0.75rem; }
  .topbar-brand-name { display: none; }
  .topbar-desktop      { display: none; }
  .topbar-mobile-right { display: flex; }

  /* Main */
  .main-content { padding: 1rem 0.75rem 56px; }
  .main-topbar  { padding-top: calc(60px + 1rem); }

  /* Hamburger visible */
  .hamburger { display: flex; }

  /* Game layout — stack vertically */
  .game-layout {
    flex-direction: column;
    min-height: unset;
  }

  .game-sidebar {
    width: 100%;
    position: static;
    box-shadow: inset 0 0 0 2px var(--neon-primary);
  }

  /* Presence column stacks below leaderboard on mobile */
  .presence-col {
    order: 3;
  }

  .game-sidebar-list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .game-sidebar-item {
    border-bottom: none;
    border-right: 1px solid rgba(0, 212, 255, 0.08);
    padding: 0.5rem 0.75rem;
    width: auto;
  }

  .game-sidebar-footer { flex-direction: row; gap: 0.75rem; align-items: center; }

  .leaderboard-panel { padding: 1rem 0.75rem 2rem; }
  .leaderboard-crt   { overflow-x: auto; }

  /* Presence panel / column */
  .presence-col {
    width: 100%;
    position: static;
    box-shadow: inset 0 0 0 1px var(--neon-secondary);
  }
  .presence-col .presence-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: unset;
    max-height: unset;
  }
  .presence-col .presence-card {
    border-bottom: none;
    border-right: 1px solid rgba(0, 212, 255, 0.08);
    min-width: 130px;
  }
  .presence-list { flex-wrap: wrap; }
  .presence-card { min-width: 130px; }

  /* Leaderboard — compact on mobile, hide DATE column */
  .leaderboard-table td.date,
  .leaderboard-table th:last-child { display: none; }
  .leaderboard-table th { padding: 0.55rem 0.5rem; font-size: 0.34rem; }
  .leaderboard-table td { padding: 0.4rem 0.5rem; font-size: 0.9rem; }
  td.score       { font-size: 0.6rem; }
  td.rank        { font-size: 0.42rem; width: 40px; }
  td.player-name { font-size: 0.82rem; max-width: 130px; }
  .rank-gold td.player-name { font-size: 0.32rem; }
  .rank-gold td.score       { font-size: 0.7rem; }

  /* Auth card */
  .auth-card { max-width: 100%; padding: 1.75rem 1.25rem; }
  .auth-page  { padding: 4.5rem 0.75rem 2rem; }

  /* Page containers */
  .page-container { gap: 1.25rem; }
  .about-page     { padding: 1.5rem 0.75rem 3rem; gap: 2rem; }
  .about-hero-title { font-size: 0.65rem; }

  /* Account */
  .account-section { padding: 1.25rem 1rem; }
  .account-data-row { flex-direction: column; gap: 0.25rem; }
  .account-data-label { min-width: unset; }

  /* Admin — tighter tabs on mobile */
  .admin-tab { padding: 0.4rem 0.65rem; font-size: 0.6rem; }

  /* Flag form */
  .flag-form { flex-wrap: wrap; }
  .flag-reason-input { min-width: 100px; }

  /* Home / Dashboard layout */
  .home-layout { margin: -1rem -0.75rem 0; }
  .dashboard-root { margin: -1rem -0.75rem 0; }
  .dashboard-body { grid-template-columns: 1fr; }
  .dashboard-side {
    position: static;
    max-height: unset;
    border-left: none;
    border-top: 1px solid rgba(0, 212, 255, 0.1);
  }
  .dash-panel-header { position: static; }
  .game-grid { grid-template-columns: 1fr; padding: 1rem 0.75rem; gap: 0.75rem; }
  .stats-strip { font-size: 0.28rem; }
  .presence-strip { padding: 0 0.75rem; }
  .leaderboard-page { gap: 1rem; }

  /* Group detail */
  .group-detail-header { flex-wrap: wrap; }
  .group-actions { flex-direction: row; align-items: center; flex-wrap: wrap; width: 100%; }
  .game-tabs { gap: 0.3rem; }
  .nvm-table { display: block; overflow-x: auto; white-space: nowrap; }

  /* Group two-column layout stacks on mobile */
  .group-main-grid {
    grid-template-columns: 1fr;
  }
  .group-members-sidebar {
    position: static;
    max-height: none;
  }

  /* Activity feed */
  .activity-entry { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .activity-time  { margin-left: 0; }

  /* Events */
  .event-grid { grid-template-columns: 1fr; }
  .event-card-meta { flex-wrap: wrap; gap: 0.5rem; }
  .event-detail-title-row { flex-wrap: wrap; gap: 0.5rem; }
  .event-aggregated-table { display: block; overflow-x: auto; white-space: nowrap; }
  .event-admin-row { flex-wrap: wrap; gap: 0.5rem; }

}

/* ── Style settings panel (admin) ───────────────────────────────────────── */
.style-settings-panel {
  padding: 1.5rem 0;
  max-width: 560px;
}

.style-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0, 212, 255, 0.08);
}

.style-toggle-row:last-child { border-bottom: none; }

.style-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.style-toggle-label {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  color: var(--text-primary);
  letter-spacing: 0.06em;
}

.style-toggle-desc {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.style-toggle-btn {
  font-family: var(--font-pixel);
  font-size: 0.36rem;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.9rem;
  background: transparent;
  border: 1px solid rgba(0, 212, 255, 0.25);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  min-width: 80px;
}

.style-toggle-btn.active {
  border-color: var(--neon-secondary);
  color: var(--neon-secondary);
  text-shadow: 0 0 6px var(--neon-secondary);
}

.style-toggle-btn:hover {
  border-color: rgba(0, 212, 255, 0.5);
  color: var(--text-primary);
}

/* ── Theme picker ────────────────────────────────────────────────────────── */
.theme-picker {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.theme-swatch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  background: transparent;
  border: 1px solid rgba(0, 212, 255, 0.2);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.theme-swatch:hover {
  border-color: var(--neon-primary);
  color: var(--text-primary);
}

.theme-swatch.active {
  border-color: var(--neon-primary);
  color: var(--neon-primary);
}

.swatch-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Glass card mode (data-cards="glass") ────────────────────────────────── */
html[data-cards="glass"] .topbar {
  background: rgba(var(--bg-panel-rgb), 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html[data-cards="glass"] .game-card,
html[data-cards="glass"] .stats-strip,
html[data-cards="glass"] .dash-panel,
html[data-cards="glass"] .group-card,
html[data-cards="glass"] .group-card-new,
html[data-cards="glass"] .event-card {
  background: rgba(var(--bg-panel-rgb), 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html[data-cards="glass"] .game-card:hover {
  background: rgba(var(--bg-panel-rgb), 0.62);
}

html[data-cards="glass"] .leaderboard-table {
  background: rgba(var(--bg-panel-rgb), 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html[data-cards="glass"] .leaderboard-table thead {
  background: rgba(22, 40, 68, 0.5);
}

html[data-cards="glass"] .leaderboard-table tbody tr:hover {
  background: rgba(0, 212, 255, 0.1);
}

html[data-cards="glass"] .admin-table {
  background: rgba(var(--bg-panel-rgb), 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html[data-cards="glass"] .admin-table th {
  background: rgba(22, 40, 68, 0.5);
}

html[data-cards="glass"] .auth-page {
  background: transparent;
}
html[data-cards="glass"] .auth-card {
  background: rgba(var(--bg-panel-rgb), 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html[data-cards="glass"] .player-profile-hero,
html[data-cards="glass"] .player-profile-bio,
html[data-cards="glass"] .player-profile-section {
  background: rgba(var(--bg-panel-rgb), 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Event participation ─────────────────────────────────────────── */
.event-participant-count {
  font-size: 0.55rem;
  color: var(--text-muted);
  font-family: var(--font-body);
}

/* ── Events sub-tabs (EVENTS / MANAGE) ───────────────────────────── */
.event-sub-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.18);
}
.event-sub-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.event-sub-tab:hover  { color: var(--text-secondary); border-bottom-color: rgba(0, 212, 255, 0.35); }
.event-sub-tab.active { color: var(--neon-primary);   border-bottom-color: var(--neon-primary); }

/* ── Event member row (view sub-tab) ─────────────────────────────── */
.event-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}
.event-member-row:last-child { border-bottom: none; }
.event-member-row-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.event-member-row-action { flex-shrink: 0; }

.event-joined-btn {
  color: var(--neon-primary) !important;
  border-color: var(--neon-primary) !important;
}

.badge-joined {
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.4rem;
  color: var(--neon-primary);
  box-shadow: inset 0 0 0 1px var(--neon-primary);
}

.event-join-section {
  margin-bottom: 0.75rem;
}

/* ── My Events sidebar panel ─────────────────────────────────────── */
.dash-event-result-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.04);
  gap: 0 0.5rem;
}
.dash-event-result-item:last-child { border-bottom: none; }
.dash-event-result-name {
  font-family: var(--font-body);
  font-size: 0.62rem;
  color: var(--text-secondary);
  grid-column: 1;
  grid-row: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-event-result-right {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.dash-event-result-rank {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--neon-primary);
}
.dash-event-result-score {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--text-primary);
}
.dash-event-result-date {
  font-family: var(--font-body);
  font-size: 0.55rem;
  color: var(--text-muted);
  grid-column: 1 / -1;
  grid-row: 2;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PLAYER PROFILE PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Hero card ────────────────────────────────────────────────────────────── */
.player-profile-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "avatar identity"
    "meta   meta";
  gap: 0.75rem 1.25rem;
  padding: 1.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  position: relative;
}
.player-profile-hero::before,
.player-profile-hero::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--neon-primary);
  border-style: solid;
  opacity: 0.45;
}
.player-profile-hero::before { top: 0; left: 0; border-width: 2px 0 0 2px; }
.player-profile-hero::after  { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.player-profile-avatar {
  grid-area: avatar;
  width: 56px; height: 56px;
  background: var(--bg-surface);
  border: 2px solid var(--neon-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  color: var(--neon-primary);
  text-shadow: var(--glow-primary);
  flex-shrink: 0;
  align-self: center;
}

.player-profile-identity {
  grid-area: identity;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  justify-content: center;
  min-width: 0;
}

.player-profile-name {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--text-primary);
  text-shadow: var(--glow-primary);
  line-height: 1.6;
  word-break: break-word;
}

.player-profile-slug-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-profile-slug {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

.player-hero-flag {
  display: inline-block;
  flex-shrink: 0;
}

.player-profile-meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.player-profile-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.player-profile-meta-label {
  font-family: var(--font-pixel);
  font-size: 0.27rem;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.player-profile-meta-value {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--neon-secondary);
  text-shadow: var(--glow-secondary);
}

/* ── Bio ──────────────────────────────────────────────────────────────────── */
.player-profile-bio {
  padding: 0.9rem 1.25rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--neon-secondary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* ── Body — mobile: single column, desktop: two columns ──────────────────── */
.player-profile-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.player-profile-main,
.player-profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 960px) {
  .player-profile-body {
    flex-direction: row;
    align-items: flex-start;
  }
  .player-profile-main    { flex: 1.7; min-width: 0; }
  .player-profile-sidebar { flex: 1;   min-width: 0; }
}

/* ── Section cards ────────────────────────────────────────────────────────── */
.player-profile-section {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  overflow: hidden;
}

.player-profile-section-title {
  font-family: var(--font-pixel);
  font-size: 0.36rem;
  color: var(--neon-primary);
  text-shadow: var(--glow-primary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.55rem 1.25rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

/* ── Empty / hidden placeholder ───────────────────────────────────────────── */
.player-profile-empty {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem;
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.player-profile-empty-icon {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Strip double-border from tables sitting inside a section card */
.player-profile-section .leaderboard-crt {
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* ── Groups ───────────────────────────────────────────────────────────────── */
.player-profile-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
}

.player-profile-group-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.player-profile-group-tag:hover {
  border-color: var(--neon-primary);
  color: var(--neon-primary);
}

.player-profile-group-role {
  font-family: var(--font-pixel);
  font-size: 0.22rem;
  color: var(--neon-secondary);
  text-shadow: var(--glow-secondary);
  padding: 0.12rem 0.28rem;
  background: rgba(109, 204, 184, 0.08);
  border: 1px solid rgba(109, 204, 184, 0.15);
}

/* ── Active events sidebar list ───────────────────────────────────────────── */
.player-profile-event-list {
  display: flex;
  flex-direction: column;
}

.player-profile-event-row {
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.player-profile-event-row:last-child { border-bottom: none; }

.player-profile-event-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.player-profile-event-name a {
  font-family: var(--font-pixel);
  font-size: 0.32rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.player-profile-event-name a:hover { color: var(--neon-primary); }

.player-profile-event-dates {
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ── Report zone ──────────────────────────────────────────────────────────── */
.player-profile-report-zone {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* ── Mobile tweaks ────────────────────────────────────────────────────────── */
@media (max-width: 639px) {
  .player-profile-hero {
    padding: 1rem;
    gap: 0.5rem 0.75rem;
  }
  .player-profile-avatar {
    width: 44px; height: 44px;
    font-size: 0.7rem;
  }
  .player-profile-name { font-size: 0.5rem; }
  .player-profile-section-title { padding: 0.5rem 1rem; }
  .player-profile-groups { padding: 0.75rem 1rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LeaderboardPageV2 — marquee banner
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Marquee banner (CSS art fallback, also frames real marquee images) ───── */
.lb-marquee {
  position: relative;
  aspect-ratio: 3.5 / 1;  /* mobile */
  overflow: hidden;
  /* bleed to leaderboard-panel edges (panel has padding: 1.5rem 2rem 3rem) */
  margin: -1.5rem -2rem 0;
  /* default gradient for unknown game slugs */
  background: linear-gradient(135deg, #0a0a1e 0%, #1a2a3a 50%, #0a1a2a 100%);
}

@media (min-width: 640px) {
  .lb-marquee { aspect-ratio: 5 / 1; }
}

/* scanline overlay */
.lb-marquee::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, 0.25) 3px,
    rgba(0, 0, 0, 0.25) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* real marquee image (sits beneath scanlines, covers gradient art) */
.lb-marquee-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* game name overlay */
.lb-marquee-title {
  position: absolute;
  bottom: 0.75rem;
  left: 1.25rem;
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8), 2px 2px 0 rgba(0, 0, 0, 0.6);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 3;
}

/* ── Per-game gradient art ────────────────────────────────────────────────── */
.lb-mq-dkong    { background: linear-gradient(135deg, #c02020 0%, #ff6b00 40%, #8b4513 100%); }
.lb-mq-galaga   { background: linear-gradient(135deg, #001a3a 0%, #0044aa 50%, #00d4ff 100%); }
.lb-mq-puckman  { background: linear-gradient(135deg, #1a1a00 0%, #cc9900 50%, #ffee00 100%); }
.lb-mq-mspacman { background: linear-gradient(135deg, #1a1a00 0%, #cc9900 50%, #ffee00 100%); }
.lb-mq-tapper   { background: linear-gradient(135deg, #2a0000 0%, #8b1a1a 50%, #cc4400 100%); }
.lb-mq-gng      { background: linear-gradient(135deg, #0a0a1e 0%, #4a0080 50%, #8a2be2 100%); }
.lb-mq-sf2ce    { background: linear-gradient(135deg, #0a1520 0%, #1a4a6e 50%, #00d4ff 100%); }
.lb-mq-centiped { background: linear-gradient(135deg, #0a1a0a 0%, #1a5a1a 50%, #00ff41 100%); }
.lb-mq-frogger  { background: linear-gradient(135deg, #0a150a 0%, #2a5a1a 50%, #5a9a2a 100%); }
.lb-mq-robotron { background: linear-gradient(135deg, #1a0a00 0%, #8b4500 50%, #ff8c00 100%); }
.lb-mq-defender { background: linear-gradient(135deg, #000a1a 0%, #001a8b 50%, #0066ff 100%); }
.lb-mq-tempest  { background: linear-gradient(135deg, #0a0a00 0%, #5a5a00 50%, #ffff00 100%); }
.lb-mq-missile  { background: linear-gradient(135deg, #0a0a0a 0%, #1a3a1a 50%, #00cc44 100%); }
.lb-mq-asteroids { background: linear-gradient(135deg, #0a0a14 0%, #14142a 50%, #6666cc 100%); }
.lb-mq-joust    { background: linear-gradient(135deg, #1a0a00 0%, #663300 50%, #cc6600 100%); }
.lb-mq-qbert    { background: linear-gradient(135deg, #200020 0%, #6600aa 50%, #cc44ff 100%); }
.lb-mq-berzerk  { background: linear-gradient(135deg, #0a1a0a 0%, #005500 50%, #00aa00 100%); }
.lb-mq-mrdo     { background: linear-gradient(135deg, #1a001a 0%, #660066 50%, #dd00dd 100%); }

/* ── Game select — hidden on desktop, shown on mobile ─────────────────────── */
.game-mobile-select {
  display: none;
  width: 100%;
  padding: 0.7rem 2.5rem 0.7rem 1rem;
  font-family: var(--font-pixel);
  font-size: 0.34rem;
  color: var(--neon-primary);
  background-color: var(--bg-panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%2300d4ff' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 10px;
  border: none;
  border-bottom: 2px solid var(--neon-primary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  letter-spacing: 0.06em;
}
.game-mobile-select:focus {
  outline: none;
  border-bottom-color: var(--neon-accent);
}
.game-mobile-select option {
  background: var(--bg-panel);
  color: var(--text-primary);
}

/* ── Mobile: sidebar replaced by select dropdown ──────────────────────────── */
@media (max-width: 639px) {
  .game-layout        { display: block; }
  .game-sidebar       { display: none; }
  .game-mobile-select { display: block; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LandingPage — hero, app mockup, stats belt
   ═══════════════════════════════════════════════════════════════════════════ */

/* Missing keyframes used by landing page */
@keyframes fade-up-a {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes blink-step {
  0%, 49%  { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ── Page root ────────────────────────────────────────────────────────────── */
.landing-page {
  /* bleed to main-content edges; -56px bottom absorbs main-content padding-bottom so the hero fills the viewport exactly */
  margin: -2rem -2rem -56px;
  background:
    linear-gradient(rgba(7, 8, 15, 0.88), rgba(7, 8, 15, 0.88)),
    url('/arcade.png') center / cover;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.landing-hero {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 3rem;
  padding: 3.5rem 1.5rem 3rem;
  min-height: calc(100vh - 60px);
}

@media (min-width: 960px) {
  .landing-hero {
    grid-template-columns: 1fr 1.1fr;
    gap: 3.5rem;
    padding: 5rem 3.75rem 4rem;
  }
}

.lh-overline {
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  color: var(--text-secondary);
  letter-spacing: 0.15em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  animation: fade-up-a 0.5s ease both 0.1s;
}

.lh-overline::before {
  content: '◆';
  color: var(--neon-primary);
  font-size: 0.2rem;
}

.lh-title {
  font-family: var(--font-pixel);
  line-height: 1.85;
  margin-bottom: 1.5rem;
  animation: fade-up-a 0.5s ease both 0.2s;
}

.lh-title .t1 { display: block; font-size: 1.5rem; color: var(--neon-gold); }
.lh-title .t2 { display: block; font-size: 0.9rem; color: var(--neon-primary); }

.lh-tagline {
  font-family: var(--font-body);
  font-size: 1.4rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 400px;
  margin-bottom: 1.5rem;
  animation: fade-up-a 0.5s ease both 0.3s;
}

.lh-online {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  color: var(--neon-accent);
  margin-bottom: 2rem;
  animation: fade-up-a 0.5s ease both 0.35s;
}

.lh-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon-accent);
  animation: blink 1.3s ease-in-out infinite;
}

.lh-btns {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  animation: fade-up-a 0.5s ease both 0.4s;
}

.lh-register-hint {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  animation: fade-up-a 0.5s ease both 0.5s;
}
.lh-register-hint a {
  color: var(--color-accent);
  text-decoration: none;
}
.lh-register-hint a:hover {
  text-decoration: underline;
}

.lh-panel-footer-links {
  padding: 6px 8px 2px 0;
  font-size: 0.65rem;
  color: var(--color-text-muted);
  opacity: 0.45;
  text-align: right;
}
.lh-panel-footer-links a {
  color: inherit;
  text-decoration: none;
}
.lh-panel-footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}
.lh-panel-footer-links span {
  margin: 0 0.35rem;
}

/* ── App mockup ───────────────────────────────────────────────────────────── */
.lh-app {
  display: none; /* hidden on mobile */
  height: 480px;
  border: 1px solid var(--border);
  background: rgba(var(--bg-panel-rgb), 0.82);
  overflow: hidden;
  animation: flicker 0.3s ease both 0.2s;
}

@media (min-width: 960px) {
  .lh-app { display: flex; }
}

.lh-sidebar {
  width: 120px;
  flex-shrink: 0;
  border-right: 1px solid rgba(0, 212, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
}

.lh-sb-hdr {
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.12);
  font-family: var(--font-pixel);
  font-size: 0.26rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
}

.lh-sb-item {
  display: flex;
  align-items: flex-start;
  gap: 0.28rem;
  padding: 0.58rem 0.7rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.05);
}

.lh-sb-item.on { background: rgba(0, 212, 255, 0.06); }

.lh-sb-cur {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  color: var(--neon-primary);
  width: 9px;
  flex-shrink: 0;
  margin-top: 0.1rem;
  animation: blink 0.8s step-end infinite;
}

.lh-sb-item:not(.on) .lh-sb-cur { animation: none; opacity: 0; }

.lh-sb-name {
  font-family: var(--font-pixel);
  font-size: 0.26rem;
  line-height: 1.8;
}

.lh-sb-item.on     .lh-sb-name { color: var(--neon-primary); }
.lh-sb-item:not(.on) .lh-sb-name { color: var(--text-secondary); }

.lh-sb-foot {
  margin-top: auto;
  padding: 0.65rem 0.7rem;
  border-top: 1px solid rgba(0, 212, 255, 0.12);
}

.lh-sb-slbl {
  font-family: var(--font-pixel);
  font-size: 0.24rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  display: block;
}

.lh-sb-sval {
  font-family: var(--font-pixel);
  font-size: 0.34rem;
  color: var(--neon-accent);
  display: block;
  margin-top: 0.2rem;
}

.lh-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lh-panel-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
  flex-shrink: 0;
}

.lh-panel-title {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--neon-primary);
  letter-spacing: 0.08em;
}

.lh-panel-scroll {
  flex: 1;
  overflow-y: auto;
}

.lh-panel-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  font-size: 0.3rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* ── Compact mini-table (landing app mockup only) ─────────────────────────── */
.lb-t {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.lb-t thead { background: rgba(22, 40, 68, 0.9); }

.lb-t th {
  font-family: var(--font-pixel);
  font-size: 0.32rem;
  color: var(--neon-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 2px solid var(--neon-secondary);
}

.lb-t td {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-primary);
  padding: 0.42rem 0.8rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.07);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-t tbody tr:hover { background: var(--bg-hover); }
.lb-t tbody tr.rg    { background: rgba(255, 209, 102, 0.05); }

.lb-t td.rk {
  font-family: var(--font-pixel);
  text-align: center;
  font-size: 0.45rem;
  color: var(--text-secondary);
  width: 38px;
}

.lb-t tr.rg td.rk { color: var(--neon-gold);   font-size: 0.62rem; }
.lb-t tr.rs td.rk { color: var(--neon-silver); font-size: 0.55rem; }
.lb-t tr.rb td.rk { color: var(--neon-bronze); font-size: 0.5rem;  }

.lb-t td.sc {
  font-family: var(--font-pixel);
  font-size: 0.56rem;
  color: var(--neon-accent);
  letter-spacing: 0.04em;
}

.lb-t td.dt { color: var(--text-muted); font-size: 1rem; }

/* ── Stats belt ───────────────────────────────────────────────────────────── */
.land-belt {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(7, 8, 15, 0.94);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(0, 212, 255, 0.18);
  padding: 10px 0;
  overflow: hidden;
}

.belt-track {
  display: flex;
  width: max-content;
  animation: marquee 26s linear infinite;
}

.belt-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 2rem;
  border-right: 1px solid rgba(0, 212, 255, 0.12);
  white-space: nowrap;
}

.belt-lbl {
  font-family: var(--font-pixel);
  font-size: 0.26rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.belt-val {
  font-family: var(--font-pixel);
  font-size: 0.35rem;
  color: var(--neon-primary);
}

/* ── DashboardOverviewPage (/dashboard2) ────────────────────────────────────── */
.dash-overview {
  max-width: 900px;
  margin: 0 auto;
}

.dash-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.dash-overview-greeting {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: var(--neon-primary);
  letter-spacing: 0.08em;
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.35);
}

.dash-overview-fav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-pixel);
  font-size: 0.26rem;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.22);
  padding: 0.3rem 0.65rem;
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: background 0.15s ease;
}

.dash-overview-fav:hover { background: rgba(255, 215, 0, 0.12); }

.dash-overview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 640px) {
  .dash-overview-greeting { font-size: 0.5rem; }

  .dash-overview-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid rgba(0, 212, 255, 0.1);
  }

  .dash-overview-grid .dash-panel {
    border-bottom: 1px solid rgba(0, 212, 255, 0.08);
    border-right: 1px solid rgba(0, 212, 255, 0.08);
  }

  .dash-overview-grid .dash-panel:nth-child(even) { border-right: none; }
  .dash-overview-grid .dash-panel:nth-last-child(-n+2) { border-bottom: none; }
}

.dash-panel-live-badge {
  margin-left: auto;
  font-size: 0.26rem;
}

.dash-activity-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.06);
}

.dash-activity-item:last-child { border-bottom: none; }

.dash-activity-text {
  flex: 1;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.dash-activity-time {
  font-family: var(--font-pixel);
  font-size: 0.24rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
