/* ═══════════════════════════════════════════════════
   MLBB ARENA — Design System
   Based on THEME_REF.md
   ═══════════════════════════════════════════════════ */

/* Alpine.js - hide elements with x-cloak until Alpine initializes */
[x-cloak] { display: none !important; }

/* ── CSS Custom Properties ──────────────────────── */
:root {
  /* Backgrounds */
  --bg-primary:   #070f1a;
  --bg-secondary: #101b2b;
  --bg-card:      #18253a;
  --bg-card-hover:#20304a;
  --bg-elevated:  #253652;

  /* Borders */
  --border-subtle:  rgba(148,163,184,0.16);
  --border-default: rgba(125,211,252,0.22);
  --border-bright:  rgba(125,211,252,0.42);

  /* Accent */
  --accent-purple:       #14b8a6;
  --accent-purple-light: #5eead4;
  --accent-purple-dark:  #0f766e;
  --accent-cyan:         #f97316;
  --accent-cyan-light:   #fdba74;
  --accent-gold:         #f59e0b;

  /* Text */
  --text-primary:   #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted:     #94a3b8;

  /* Status */
  --status-draft:         #475569;
  --status-registration:  #14b8a6;
  --status-checkin:       #f59e0b;
  --status-ongoing:       #22c55e;
  --status-completed:     #0ea5e9;
  --status-cancelled:     #ef4444;
  --status-disputed:      #f97316;
  --status-pending:       #94a3b8;

  /* Spacing */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Glassmorphism */
  --glass-bg:     rgba(10,18,31,0.82);
  --glass-border: rgba(45,212,191,0.28);

  /* Dialogs & overlays */
  --overlay-backdrop: rgba(2,6,23,0.78);
  --overlay-panel-bg: rgba(15,23,42,0.96);
  --overlay-panel-border: rgba(148,163,184,0.26);
  --overlay-panel-shadow: 0 28px 70px rgba(2,6,23,0.62);
}

html[data-theme='light'] {
  --bg-primary:   #f4f7fb;
  --bg-secondary: #ffffff;
  --bg-card:      #ffffff;
  --bg-card-hover:#eef3fb;
  --bg-elevated:  #e8eef8;

  --border-subtle:  rgba(15,23,42,0.09);
  --border-default: rgba(15,23,42,0.16);
  --border-bright:  rgba(15,23,42,0.28);

  --accent-purple:       #0f766e;
  --accent-purple-light: #0d9488;
  --accent-purple-dark:  #115e59;
  --accent-cyan:         #ea580c;
  --accent-cyan-light:   #fb923c;
  --accent-gold:         #b45309;

  --text-primary:   #0f172a;
  --text-secondary: #334155;
  --text-muted:     #64748b;

  --status-draft:         #64748b;
  --status-registration:  #0f766e;
  --status-checkin:       #b45309;
  --status-ongoing:       #15803d;
  --status-completed:     #0f766e;
  --status-cancelled:     #dc2626;
  --status-disputed:      #c2410c;
  --status-pending:       #64748b;

  --glass-bg:     rgba(255,255,255,0.86);
  --glass-border: rgba(15,118,110,0.18);

  --overlay-backdrop: rgba(15,23,42,0.24);
  --overlay-panel-bg: rgba(255,255,255,0.96);
  --overlay-panel-border: rgba(15,23,42,0.16);
  --overlay-panel-shadow: 0 24px 56px rgba(15,23,42,0.18);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Manrope', 'Inter', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(20,184,166,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(249,115,22,0.12) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

html[data-theme='light'] body::before {
  background:
    radial-gradient(ellipse 85% 58% at 12% -8%, rgba(15,118,110,0.12) 0%, transparent 62%),
    radial-gradient(ellipse 70% 45% at 88% 108%, rgba(234,88,12,0.1) 0%, transparent 62%);
}

main.page-content { flex: 1; position: relative; z-index: 1; }

h1, h2, h3, h4, h5 {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

a { color: var(--accent-cyan); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-cyan-light); }

img { display: block; max-width: 100%; }

code { font-family: 'Courier New', monospace; background: var(--bg-elevated); padding: 2px 6px; border-radius: 4px; font-size: .85em; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent-purple-dark); border-radius: 3px; }

/* ── Typography Utilities ───────────────────────── */
.text-accent-cyan   { color: var(--accent-cyan); }
.text-accent-purple { color: var(--accent-purple); }
.text-muted         { color: var(--text-secondary); font-size: .875rem; }
.text-warning       { color: var(--accent-gold); }
.text-danger        { color: var(--status-cancelled); }
.required           { color: var(--status-cancelled); }

/* Glow effects */
.glow-cyan   { color: var(--accent-cyan);   text-shadow: 0 0 12px rgba(6,182,212,.6); }
.glow-purple { color: var(--accent-purple); text-shadow: 0 0 12px rgba(124,58,237,.6); }
.glow-gold   { color: var(--accent-gold);   text-shadow: 0 0 12px rgba(245,158,11,.6); }

/* ── NAVBAR ─────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  height: 64px;
}
.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
}
.brand-icon { font-size: 1.4rem; }
.brand-accent { color: var(--accent-cyan); }

.navbar-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  list-style: none;
  flex: 1;
}
.nav-link {
  color: var(--text-secondary);
  font-size: .9rem;
  font-weight: 500;
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,.06); }
.nav-link-admin { color: var(--accent-purple-light); }

.navbar-actions { display: flex; align-items: center; gap: .75rem; margin-left: auto; }

/* Notification Bell */
.notif-bell {
  position: relative;
  color: var(--text-secondary);
  padding: .4rem;
  border-radius: var(--radius-sm);
  transition: color .2s;
}
.notif-bell:hover { color: var(--text-primary); }
.notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--accent-purple);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* Avatar Dropdown */
.nav-dropdown { position: relative; }
.nav-avatar-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: .3rem .75rem .3rem .4rem;
  cursor: pointer;
  color: var(--text-primary);
  font-size: .9rem;
  transition: border-color .2s, background .2s;
}
.nav-avatar-btn:hover { border-color: var(--accent-purple); background: rgba(124,58,237,.1); }
.nav-avatar-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.nav-avatar-init {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  color: #fff;
}
.nav-username { font-weight: 500; }
.caret { transition: transform .2s; }
.nav-avatar-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  padding: .4rem;
  display: none;
  z-index: 200;
}
.nav-dropdown-menu.show { display: block; }
.dropdown-item {
  display: block;
  width: 100%;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: .875rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: color .15s, background .15s;
}
.dropdown-item:hover { color: var(--text-primary); background: rgba(255,255,255,.06); }
.dropdown-item-danger { color: var(--status-cancelled); }
.dropdown-item-danger:hover { background: rgba(239,68,68,.12); }
.dropdown-divider { height: 1px; background: var(--border-subtle); margin: .4rem 0; }

.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: .4rem; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text-secondary); border-radius: 2px; transition: .3s; }

/* ── FLASH MESSAGES ─────────────────────────────── */
.flash {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.25rem;
  font-size: .9rem;
  font-weight: 500;
  position: relative;
  z-index: 50;
}
.flash-success { background: rgba(34,197,94,.15); border-bottom: 1px solid rgba(34,197,94,.3); color: #86efac; }
.flash-error   { background: rgba(239,68,68,.15);  border-bottom: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.flash-info    { background: rgba(6,182,212,.12);  border-bottom: 1px solid rgba(6,182,212,.3);  color: #67e8f9; }
.flash-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: .7;
  line-height: 1;
}
.flash-close:hover { opacity: 1; }

/* ── BUTTONS ─────────────────────────────────────── */
.esports-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.14);
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
  background: linear-gradient(135deg, var(--accent-purple-dark), var(--accent-purple));
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(15,118,110,.24);
}
.esports-btn:hover {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-light));
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15,118,110,.28);
}

.esports-btn-primary {
  background: linear-gradient(135deg, var(--accent-purple-dark), var(--accent-purple));
  color: #ffffff;
  border-color: rgba(255,255,255,.14);
}
.esports-btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-light));
  color: #ffffff;
}

.esports-btn-secondary,
.esports-btn-cyan {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-cyan-light));
  color: #111827;
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 8px 22px rgba(234,88,12,.24);
}
.esports-btn-secondary:hover,
.esports-btn-cyan:hover {
  background: linear-gradient(135deg, var(--accent-cyan-light), #fed7aa);
  color: #111827;
  transform: translateY(-1px);
}

.esports-btn-ghost,
.esports-btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-default);
  clip-path: none;
}
.esports-btn-ghost:hover,
.esports-btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--border-bright);
  background: rgba(148,163,184,.08);
}

.esports-btn-danger { background: rgba(239,68,68,.15); color: #fca5a5; border-color: rgba(239,68,68,.4); }
.esports-btn-danger:hover { background: rgba(239,68,68,.25); border-color: rgba(239,68,68,.7); color: #fff; }
.esports-btn-warning { background: rgba(245,158,11,.15); color: var(--accent-gold); border-color: rgba(245,158,11,.4); }
.esports-btn-warning:hover { background: rgba(245,158,11,.25); border-color: var(--accent-gold); }
.esports-btn:disabled, .esports-btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-sm,
.esports-btn-sm { padding: .35rem .9rem; font-size: .85rem; }
.btn-lg  { padding: .75rem 2rem; font-size: 1.1rem; }
.btn-xs  { padding: .2rem .6rem; font-size: .78rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-group { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ── CARDS ───────────────────────────────────────── */
.esports-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.esports-card-hover:hover {
  border-color: var(--accent-purple);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(124,58,237,.2);
  background: var(--bg-card-hover);
}
.card-banner {
  height: 140px;
  background: var(--bg-elevated);
  background-size: cover;
  background-position: center;
  position: relative;
}
.card-banner-placeholder {
  background: linear-gradient(135deg, var(--accent-purple-dark), var(--bg-elevated));
}
.card-body { padding: 1.1rem; flex: 1; }
.card-badges { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .4rem; }
.card-meta { display: flex; gap: .75rem; font-size: .8rem; color: var(--text-secondary); flex-wrap: wrap; }
.card-date { font-size: .78rem; color: var(--text-muted); margin-top: .4rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }

/* Card Panel (internal sections) */
.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.panel-title {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

/* ── BADGES ──────────────────────────────────────── */
.badge-status, .badge-format, .badge-role, .badge-region, .badge-count, .badge-sev {
  display: inline-flex;
  align-items: center;
  padding: .15rem .55rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Status badges */
.badge-status-draft        { background: rgba(71,85,105,.2); color: #94a3b8; border: 1px solid rgba(71,85,105,.4); }
.badge-status-registration { background: rgba(6,182,212,.15); color: var(--accent-cyan); border: 1px solid rgba(6,182,212,.4); }
.badge-status-checkin      { background: rgba(245,158,11,.15); color: var(--accent-gold); border: 1px solid rgba(245,158,11,.4); }
.badge-status-ongoing      { background: rgba(34,197,94,.15); color: #4ade80; border: 1px solid rgba(34,197,94,.4); }
.badge-status-completed    { background: rgba(124,58,237,.15); color: var(--accent-purple-light); border: 1px solid rgba(124,58,237,.4); }
.badge-status-cancelled    { background: rgba(239,68,68,.15); color: #fca5a5; border: 1px solid rgba(239,68,68,.4); }
.badge-status-disputed     { background: rgba(249,115,22,.15); color: #fb923c; border: 1px solid rgba(249,115,22,.4); }
.badge-status-pending      { background: rgba(148,163,184,.1); color: var(--text-secondary); border: 1px solid var(--border-default); }
.badge-status-registration_requested { background: rgba(6,182,212,.1); color: var(--accent-cyan-light); border: 1px solid rgba(6,182,212,.3); }
.badge-status-confirmed    { background: rgba(34,197,94,.15); color: #4ade80; border: 1px solid rgba(34,197,94,.4); }
.badge-status-rejected     { background: rgba(239,68,68,.15); color: #fca5a5; border: 1px solid rgba(239,68,68,.4); }
.badge-status-approved     { background: rgba(34,197,94,.15); color: #4ade80; border: 1px solid rgba(34,197,94,.4); }
.badge-status-paid         { background: rgba(124,58,237,.15); color: var(--accent-purple-light); border: 1px solid rgba(124,58,237,.4); }
.badge-status-open         { background: rgba(249,115,22,.15); color: #fb923c; border: 1px solid rgba(249,115,22,.35); }
.badge-status-triaged      { background: rgba(245,158,11,.15); color: var(--accent-gold); border: 1px solid rgba(245,158,11,.35); }
.badge-status-in_progress  { background: rgba(6,182,212,.12); color: var(--accent-cyan); border: 1px solid rgba(6,182,212,.3); }
.badge-status-resolved     { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.badge-status-wont_fix     { background: rgba(71,85,105,.2); color: #64748b; border: 1px solid rgba(71,85,105,.3); }

/* Format badges */
.badge-format          { background: rgba(124,58,237,.15); color: var(--accent-purple-light); border: 1px solid rgba(124,58,237,.3); }
.badge-format-se       { background: rgba(6,182,212,.12); color: var(--accent-cyan); border-color: rgba(6,182,212,.3); }
.badge-format-de       { background: rgba(245,158,11,.12); color: var(--accent-gold); border-color: rgba(245,158,11,.3); }
.badge-format-rrplayoffs,.badge-format-rr_playoffs { background: rgba(124,58,237,.15); color: var(--accent-purple-light); border-color: rgba(124,58,237,.3); }
.badge-format-swiss    { background: rgba(34,197,94,.12); color: #4ade80; border-color: rgba(34,197,94,.3); }
.badge-format-bo1      { background: rgba(148,163,184,.1); color: var(--text-secondary); border-color: var(--border-default); }
.badge-format-bo3      { background: rgba(6,182,212,.12); color: var(--accent-cyan); border-color: rgba(6,182,212,.3); }
.badge-format-bo5      { background: rgba(245,158,11,.12); color: var(--accent-gold); border-color: rgba(245,158,11,.3); }

/* Role badge */
.badge-role { background: rgba(124,58,237,.15); color: var(--accent-purple-light); border: 1px solid rgba(124,58,237,.3); text-transform: capitalize; }

/* Badge count */
.badge-count { background: var(--accent-purple); color: #fff; min-width: 18px; height: 18px; padding: 0 4px; font-size: .65rem; }

/* Severity */
.badge-sev-low      { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.badge-sev-medium   { background: rgba(245,158,11,.15); color: var(--accent-gold); border: 1px solid rgba(245,158,11,.4); }
.badge-sev-high     { background: rgba(249,115,22,.15); color: #fb923c; border: 1px solid rgba(249,115,22,.4); }
.badge-sev-critical { background: rgba(239,68,68,.2); color: #fca5a5; border: 1px solid rgba(239,68,68,.5); }

/* ── FORMS ───────────────────────────────────────── */
.form-group    { display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.form-row      { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-label    { font-size: .85rem; color: var(--text-secondary); font-weight: 500; }
.form-hint     { font-size: .75rem; color: var(--text-muted); }
.form-section-title { font-size: .95rem; font-weight: 700; color: var(--accent-purple); text-transform: uppercase; letter-spacing: .05em; margin: 1.5rem 0 .75rem; padding-bottom: .4rem; border-bottom: 1px solid var(--border-subtle); }
.form-section-title:first-child { margin-top: 0; }
.form-details  { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: .75rem 1rem; margin: .5rem 0; }
.form-details summary { cursor: pointer; color: var(--text-secondary); font-size: .85rem; user-select: none; }

.form-control {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: .55rem .9rem;
  font-size: .9rem;
  font-family: 'Inter', sans-serif;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,.2);
}
.form-control:disabled { opacity: .55; cursor: not-allowed; }
.form-control::placeholder { color: var(--text-muted); }
.form-control-xs { padding: .3rem .6rem; font-size: .8rem; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2.2rem; }
textarea.form-control { resize: vertical; line-height: 1.5; }
.input-with-toggle { position: relative; }
.input-with-toggle .form-control { padding-right: 2.5rem; }
.input-toggle-btn { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1rem; padding: 0; line-height: 1; }

.radio-group  { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.radio-label  { display: flex; align-items: center; gap: .4rem; cursor: pointer; color: var(--text-secondary); font-size: .9rem; }
.radio-label input[type="radio"] { accent-color: var(--accent-purple); width: 16px; height: 16px; }

.form-inline { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ── TABLES ──────────────────────────────────────── */
.esports-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); }
.esports-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.esports-table thead { background: var(--bg-elevated); }
.esports-table th {
  padding: .75rem 1rem;
  text-align: left;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.esports-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); vertical-align: middle; }
.esports-table tbody tr:last-child td { border-bottom: none; }
.esports-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.table-row-link { cursor: pointer; }
.table-row-link:hover td { background: rgba(124,58,237,.05); }
.vs-cell  { color: var(--text-muted); text-align: center; font-weight: 700; padding: 0 .25rem; }
.team-cell { font-weight: 600; color: var(--text-primary); }
.team-winner { color: var(--accent-cyan) !important; }

/* ── PAGE LAYOUT ─────────────────────────────────── */
.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.page-container-narrow { max-width: 720px; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}
.page-title { font-size: 2rem; font-family: 'Rajdhani', sans-serif; font-weight: 700; }
.page-sub   { font-size: .95rem; color: var(--text-muted); margin-top: .25rem; }

.section-block { max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.section-title { font-size: 1.5rem; font-family: 'Rajdhani', sans-serif; font-weight: 700; }
.section-link { font-size: .85rem; color: var(--accent-purple-light); }

/* ── HERO ────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 6rem 1.5rem 5rem;
  text-align: center;
  overflow: hidden;
}
.hero-bg-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(124,58,237,.2) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; max-width: 760px; margin: 0 auto; }
.hero-eyebrow { font-size: .8rem; letter-spacing: .15em; text-transform: uppercase; color: var(--accent-cyan); font-weight: 600; margin-bottom: .75rem; }
.hero-title { font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1.1; margin-bottom: 1.25rem; }
.hero-sub { color: var(--text-secondary); font-size: 1.1rem; max-width: 580px; margin: 0 auto 2.5rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── STATS STRIP ─────────────────────────────────── */
.stats-strip { background: var(--bg-card); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.stats-strip-inner { max-width: 1280px; margin: 0 auto; padding: 1.5rem; display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; }
.stat-item { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.stat-num { font-family: 'Rajdhani', sans-serif; font-size: 2rem; font-weight: 700; color: var(--accent-cyan); }
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }

/* ── LEADERBOARD ─────────────────────────────────── */
.leaderboard-list { display: flex; flex-direction: column; gap: .5rem; }
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color .2s, background .2s;
  text-decoration: none;
  color: var(--text-primary);
}
.leaderboard-row:hover { border-color: var(--accent-purple); background: var(--bg-card-hover); }
.lb-rank { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1rem; color: var(--text-muted); width: 2.5rem; flex-shrink: 0; }
.lb-rank-top { color: var(--accent-gold); text-shadow: 0 0 10px rgba(245,158,11,.5); }
.lb-logo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.lb-logo-init { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-purple-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: .9rem; }
.lb-name { font-weight: 600; flex: 1; font-size: .95rem; }
.lb-tag { color: var(--text-muted); font-size: .8rem; }
.lb-elo { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1rem; }
.lb-record { color: var(--text-secondary); font-size: .82rem; white-space: nowrap; }

/* ── NEWS GRID ───────────────────────────────────── */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .2s, transform .2s;
  text-decoration: none;
  color: var(--text-primary);
}
.news-card:hover { border-color: var(--accent-purple); transform: translateY(-2px); }
.news-card-thumb { height: 160px; background: var(--bg-elevated); background-size: cover; background-position: center; }
.news-thumb-placeholder { background: linear-gradient(135deg, var(--bg-elevated), var(--accent-purple-dark)); }
.news-card-body { padding: 1rem; flex: 1; }
.news-cat { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; padding: .15rem .5rem; border-radius: 4px; }
.news-cat-news          { background: rgba(6,182,212,.15); color: var(--accent-cyan); }
.news-cat-patch_notes   { background: rgba(245,158,11,.15); color: var(--accent-gold); }
.news-cat-highlights    { background: rgba(124,58,237,.15); color: var(--accent-purple-light); }
.news-cat-announcements { background: rgba(34,197,94,.12); color: #4ade80; }
.news-card-title { font-size: 1rem; font-weight: 700; margin: .5rem 0 .4rem; line-height: 1.3; }
.news-card-excerpt { font-size: .82rem; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-card-meta { font-size: .75rem; color: var(--text-muted); margin-top: .75rem; display: flex; gap: .4rem; flex-wrap: wrap; }

/* News categories for show page */
.news-cat-news.large, .news-cat-patch_notes.large, .news-cat-highlights.large, .news-cat-announcements.large { font-size: .78rem; padding: .25rem .75rem; }

/* ── ARTICLE PAGE ────────────────────────────────── */
.article-layout { max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem; }
.article-hero { height: 360px; background: var(--bg-elevated); background-size: cover; background-position: center; border-radius: var(--radius-lg); margin-bottom: 2rem; }
.article-header { margin-bottom: 2rem; }
.article-title { font-size: 2.2rem; line-height: 1.2; margin: .75rem 0 .5rem; }
.article-meta { color: var(--text-muted); font-size: .82rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.article-body { color: var(--text-secondary); line-height: 1.8; font-size: .95rem; }
.article-body h2, .article-body h3 { margin: 1.5rem 0 .5rem; color: var(--text-primary); }
.article-body p { margin-bottom: 1rem; }
.article-body ul, .article-body ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.article-body li { margin-bottom: .4rem; }
.article-body img { max-width: 100%; border-radius: var(--radius-md); margin: 1rem 0; }
.article-editor { font-family: 'Courier New', monospace; font-size: .875rem; }

/* Rich story typography (news detail redesign) */
.news-story-prose { color: var(--text-secondary); line-height: 1.85; font-size: .98rem; }
.news-story-prose > :first-child { margin-top: 0; }
.news-story-prose h2,
.news-story-prose h3,
.news-story-prose h4 {
  font-family: 'Rajdhani', sans-serif;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: .6rem;
  line-height: 1.2;
}
.news-story-prose h2 {
  font-size: 1.7rem;
  border-left: 3px solid rgba(124,58,237,.85);
  padding-left: .7rem;
}
.news-story-prose h3 {
  font-size: 1.35rem;
  color: #d8b4fe;
}
.news-story-prose p { margin-bottom: 1.05rem; }
.news-story-prose a { color: #67e8f9; text-decoration: underline; text-underline-offset: 2px; }
.news-story-prose a:hover { color: #a5f3fc; }
.news-story-prose blockquote {
  margin: 1.2rem 0;
  padding: .9rem 1rem;
  border-left: 4px solid rgba(124,58,237,.8);
  background: rgba(124,58,237,.08);
  color: var(--text-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.news-story-prose pre,
.news-story-prose code {
  font-family: Consolas, 'Courier New', monospace;
}
.news-story-prose pre {
  background: #0a1020;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: .9rem 1rem;
  overflow: auto;
  margin: 1rem 0;
}
.news-story-prose code {
  background: rgba(15,23,42,.9);
  border: 1px solid rgba(148,163,184,.2);
  border-radius: 5px;
  padding: .08rem .35rem;
  font-size: .9em;
}
.news-story-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: .92rem;
}
.news-story-prose th,
.news-story-prose td {
  border: 1px solid var(--border-subtle);
  padding: .55rem .65rem;
  text-align: left;
}
.news-story-prose th {
  background: rgba(124,58,237,.14);
  color: var(--text-primary);
}

/* Body editor feature classes */
.news-story-prose u {
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}
.news-story-prose .lead {
  font-size: 1.1rem;
  color: #dbe7ff;
}
.news-story-prose .callout {
  border-left: 4px solid rgba(34,211,238,.75);
  background: rgba(34,211,238,.08);
  padding: .75rem .9rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.news-story-prose .text-red { color: #f87171; }
.news-story-prose .text-orange { color: #fb923c; }
.news-story-prose .text-amber { color: #f59e0b; }
.news-story-prose .text-yellow { color: #facc15; }
.news-story-prose .text-green { color: #4ade80; }
.news-story-prose .text-cyan { color: #22d3ee; }
.news-story-prose .text-blue { color: #60a5fa; }
.news-story-prose .text-purple { color: #c084fc; }
.news-story-prose .text-pink { color: #f472b6; }
.news-story-prose .text-slate { color: #cbd5e1; }
.news-story-prose .text-white { color: #ffffff; }
.news-story-prose .text-muted { color: #94a3b8; }

.news-story-prose figure {
  margin: 1rem 0;
}
.news-story-prose figure img,
.news-story-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}
.news-story-prose figcaption {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .45rem;
  text-align: center;
}

.news-story-prose figure.img-left,
.news-story-prose img.img-left {
  float: left;
  width: min(46%, 320px);
  margin: .35rem 1rem .8rem 0;
}
.news-story-prose figure.img-right,
.news-story-prose img.img-right {
  float: right;
  width: min(46%, 320px);
  margin: .35rem 0 .8rem 1rem;
}
.news-story-prose figure.img-center,
.news-story-prose img.img-center {
  display: block;
  margin: 1rem auto;
  float: none;
}
.news-story-prose figure.img-wide,
.news-story-prose img.img-wide {
  width: 100%;
  float: none;
  margin: 1rem 0;
}
.news-story-prose figure.img-small,
.news-story-prose img.img-small {
  width: min(34%, 240px);
}
.news-story-prose::after {
  content: '';
  display: block;
  clear: both;
}

/* ── RICH LEGACY EDITOR ──────────────────────────── */
.rte-wrap {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
}
.rte-wrap:focus-within {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,.2);
}

/* Toolbar */
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px 8px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
  row-gap: 4px;
}
.rte-sep {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
  margin: 0 4px;
  flex-shrink: 0;
}
.rte-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1;
  min-width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.rte-btn:hover {
  background: rgba(255,255,255,.07);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.rte-btn.active {
  background: rgba(124,58,237,.25);
  color: var(--accent-purple-light);
  border-color: rgba(124,58,237,.5);
}
.rte-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: .78rem;
  height: 26px;
  padding: 0 6px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  max-width: 120px;
}
.rte-select:focus { outline: none; border-color: var(--accent-purple); color: var(--text-primary); }

/* Color swatch group */
.rte-color-group {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}
.rte-color-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.15);
  cursor: pointer;
  transition: transform .1s, border-color .1s;
  flex-shrink: 0;
}
.rte-color-swatch:hover { transform: scale(1.25); border-color: #fff; }

/* Line numbers wrapper */
.rte-editor-wrap {
  display: flex;
  flex: 1;
  min-height: 340px;
  max-height: 700px;
  overflow: hidden;
}
.rte-line-numbers {
  min-width: 38px;
  padding: 10px 6px 10px 8px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  text-align: right;
  font-family: Consolas, 'Courier New', monospace;
  font-size: .78rem;
  color: #475569;
  user-select: none;
  line-height: 1.65;
  overflow: hidden;
  flex-shrink: 0;
}
.rte-line-numbers span {
  display: block;
  line-height: inherit;
}

/* The editable area */
.rte-content {
  flex: 1;
  padding: 10px 14px;
  font-size: .93rem;
  font-family: 'Inter', sans-serif;
  line-height: 1.65;
  color: var(--text-primary);
  overflow-y: auto;
  max-height: 700px;
  outline: none;
}
.rte-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
  display: block;
}
/* styling inside the editor */
.rte-content h2 { font-family: 'Rajdhani',sans-serif; font-size: 1.45rem; color: #d8b4fe; margin-top: 1rem; margin-bottom: .3rem; }
.rte-content h3 { font-family: 'Rajdhani',sans-serif; font-size: 1.2rem; color: #a5f3fc; margin-top: .8rem; margin-bottom: .25rem; }
.rte-content h4 { font-family: 'Rajdhani',sans-serif; font-size: 1.05rem; margin-top: .7rem; margin-bottom: .2rem; }
.rte-content blockquote { border-left: 3px solid rgba(124,58,237,.8); padding-left: .75rem; margin: .6rem 0; color: #cbd5e1; }
.rte-content figure { margin: .8rem 0; }
.rte-content figure img, .rte-content img { max-width: 100%; border-radius: 6px; }
.rte-content figcaption { font-size: .75rem; color: #94a3b8; text-align: center; margin-top: .3rem; }
.rte-content code { font-family: Consolas, monospace; background: rgba(15,23,42,.9); padding: .05rem .3rem; border-radius: 4px; font-size: .88em; }

/* Status bar */
.rte-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  font-size: .72rem;
  color: #475569;
  gap: 1rem;
}
.rte-statusbar-left { display: flex; gap: .75rem; }

/* Image dialog */
.rte-img-dialog {
  display: none;
  position: absolute;
  z-index: 300;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1rem;
  min-width: 300px;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
}
.rte-img-dialog.show { display: block; }
.rte-img-dialog-backdrop { display: none; position: fixed; inset: 0; z-index: 299; }
.rte-img-dialog-backdrop.show { display: block; }

/* ── AUTH PAGES ──────────────────────────────────── */
.auth-container { display: flex; justify-content: center; align-items: flex-start; min-height: calc(100vh - 128px); padding: 3rem 1rem; }
.auth-card { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-xl); padding: 2.5rem; width: 100%; max-width: 420px; }
.auth-card-wide { max-width: 620px; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-icon { font-size: 2.5rem; display: block; margin-bottom: .75rem; }
.auth-title { font-size: 1.75rem; }
.auth-sub { color: var(--text-secondary); font-size: .9rem; margin-top: .4rem; }
.auth-form { display: flex; flex-direction: column; gap: 1.1rem; }
.auth-footer-links { margin-top: 1.5rem; text-align: center; font-size: .85rem; color: var(--text-muted); }
.auth-footer-links p { margin: .4rem 0; }

/* ── DEMO CREDENTIALS ────────────────────────────── */
.auth-container { flex-direction: column; align-items: center; gap: 2rem; }
.demo-credentials { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); padding: 2rem; width: 100%; max-width: 760px; }
.demo-creds-title { font-size: 1rem; margin-bottom: 1.2rem; color: var(--text-primary); }
.demo-creds-pw code { background: var(--bg-elevated); padding: .15rem .5rem; border-radius: 4px; font-size: .85rem; color: var(--accent-gold); }
.demo-creds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.demo-cred-card { background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1rem; cursor: pointer; transition: border-color .15s, transform .1s; display: flex; flex-direction: column; gap: .3rem; text-align: left; font-family: inherit; color: var(--text-primary); width: 100%; text-decoration: none; }
.demo-cred-card:hover { border-color: var(--accent-purple); transform: translateY(-2px); }
.demo-cred-card strong { font-size: .95rem; }
.demo-cred-card small { color: var(--text-muted); font-size: .75rem; }
.demo-cred-hint { font-size: .75rem; color: var(--text-secondary); margin-top: .2rem; }
.demo-creds-note { margin-top: 1rem; font-size: .8rem; color: var(--text-muted); text-align: center; }
.demo-cred-role { display: inline-block; padding: .15rem .5rem; border-radius: 4px; font-size: .7rem; font-weight: 700; text-transform: uppercase; margin-bottom: .2rem; }
.role-badge-admin { background: #7c3aed; color: #fff; }
.role-badge-staff { background: #0891b2; color: #fff; }
.role-badge-organizer { background: #059669; color: #fff; }
.role-badge-referee { background: #d97706; color: #fff; }
.role-badge-leader { background: #dc2626; color: #fff; }
.role-badge-player { background: #475569; color: #fff; }

/* ── PROFILE / ACCOUNT ───────────────────────────── */
.profile-grid { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; align-items: start; }
.profile-sidebar { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 2rem 1.5rem; text-align: center; }
.profile-avatar-wrap { margin-bottom: 1rem; }
.profile-avatar { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin: 0 auto; border: 3px solid var(--accent-purple); }
.profile-avatar-placeholder { width: 100px; height: 100px; border-radius: 50%; background: var(--accent-purple-dark); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; font-weight: 700; color: #fff; margin: 0 auto; border: 3px solid var(--accent-purple); }
.profile-name { font-size: 1.3rem; margin-bottom: .25rem; }
.profile-username { color: var(--text-muted); font-size: .85rem; margin-bottom: .75rem; }
.profile-meta { margin-top: 1rem; font-size: .8rem; color: var(--text-secondary); }
.profile-main { display: flex; flex-direction: column; gap: 1rem; }

/* Info list */
.info-list { display: flex; flex-direction: column; gap: .6rem; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--border-subtle); gap: 1rem; }
.info-row:last-child { border-bottom: none; }
.info-key { color: var(--text-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; flex-shrink: 0; }
.info-val { color: var(--text-primary); font-size: .9rem; text-align: right; }

/* ── TEAMS ───────────────────────────────────────── */
.team-banner { background: var(--bg-elevated); background-size: cover; background-position: center; min-height: 220px; position: relative; }
.team-banner-overlay { background: linear-gradient(to top, rgba(10,10,15,.95) 30%, rgba(10,10,15,.4)); padding: 2rem 3rem 2rem; display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; min-height: 220px; }
.team-identity { display: flex; align-items: flex-end; gap: 1.5rem; }
.team-logo-lg { width: 80px; height: 80px; border-radius: 12px; object-fit: cover; border: 2px solid var(--accent-purple); }
.team-logo-placeholder-lg { width: 80px; height: 80px; border-radius: 12px; background: var(--accent-purple-dark); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; color: #fff; }
.team-name { font-size: 2rem; line-height: 1.1; }
.team-tag { color: var(--accent-cyan); }
.team-elo { font-size: .9rem; margin-top: .4rem; }
.team-region { font-size: .82rem; color: var(--text-secondary); }
.team-description { color: var(--text-secondary); line-height: 1.6; margin-bottom: 1rem; }
.team-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

/* Lineup */
.lineup-list { display: flex; flex-direction: column; gap: .6rem; }
.lineup-player { display: flex; align-items: center; gap: .75rem; padding: .5rem; background: var(--bg-elevated); border-radius: var(--radius-sm); }
.lineup-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.lineup-role { font-size: .65rem; flex-shrink: 0; }
.lineup-name { font-weight: 600; flex: 1; }
.lineup-ign { font-size: .78rem; }

.lineup-form { display: flex; flex-direction: column; gap: 1rem; }
.lineup-slot { display: flex; flex-direction: column; gap: .4rem; }
.lineup-slot-label { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: .9rem; color: var(--accent-cyan); }

/* Match history */
.match-history-list { display: flex; flex-direction: column; gap: .4rem; }
.match-history-row { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; border-radius: var(--radius-sm); background: var(--bg-elevated); font-size: .85rem; text-decoration: none; color: var(--text-secondary); transition: background .2s; }
.match-history-row:hover { background: var(--bg-card-hover); }
.match-win .match-result { color: #4ade80; font-weight: 700; }
.match-loss .match-result { color: #fca5a5; font-weight: 700; }
.match-pending .match-result { color: var(--text-muted); }
.match-vs { flex: 1; font-weight: 600; }
.match-date { font-size: .75rem; color: var(--text-muted); }

/* ── H2H ─────────────────────────────────────────── */
.h2h-header { display: flex; align-items: center; justify-content: center; gap: 2rem; padding: 3rem 1.5rem; flex-wrap: wrap; }
.h2h-team { display: flex; flex-direction: column; align-items: center; gap: .75rem; text-align: center; }
.h2h-logo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.h2h-logo-init { width: 80px; height: 80px; border-radius: 50%; background: var(--accent-purple-dark); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; color: #fff; }
.h2h-score { display: flex; align-items: center; gap: 1.5rem; }
.h2h-score-num { font-family: 'Rajdhani', sans-serif; font-size: 3rem; font-weight: 700; min-width: 3rem; text-align: center; }
.h2h-vs { color: var(--text-muted); font-size: 1.25rem; font-weight: 700; }

/* ── MATCHES ─────────────────────────────────────── */
.page-header-match { padding: 2rem 1.5rem; max-width: 1280px; margin: 0 auto; }
.match-page-teams { display: flex; align-items: center; justify-content: center; gap: 2rem; flex-wrap: wrap; margin-bottom: 1rem; }
.match-page-team { display: flex; flex-direction: column; align-items: center; gap: .5rem; flex: 1; max-width: 300px; text-align: center; }
.match-team-logo { width: 70px; height: 70px; border-radius: 12px; object-fit: cover; }
.match-team-logo-init { width: 70px; height: 70px; border-radius: 12px; background: var(--accent-purple-dark); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 700; color: #fff; }
.match-winner h2 { color: var(--accent-cyan); }
.match-page-score { display: flex; align-items: center; gap: 1rem; }
.score-num { font-family: 'Rajdhani', sans-serif; font-size: 3.5rem; font-weight: 700; min-width: 2.5rem; text-align: center; }
.score-sep { color: var(--text-muted); font-size: 2rem; }
.match-page-badges { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.match-page-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.match-detail-grid { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.games-list { display: flex; flex-direction: column; gap: .5rem; }
.game-row { display: flex; align-items: center; gap: 1rem; padding: .6rem .75rem; background: var(--bg-elevated); border-radius: var(--radius-sm); }
.game-num { font-size: .78rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.game-winner { font-weight: 700; flex: 1; }

/* ── ROOM ────────────────────────────────────────── */
.room-body { background: var(--bg-primary); }
.room-navbar { display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; height: 56px; background: var(--glass-bg); border-bottom: 1px solid var(--glass-border); backdrop-filter: blur(16px); gap: 1rem; }
.room-brand { font-size: 1.1rem; }
.room-match-label { color: var(--text-secondary); font-size: .85rem; flex: 1; text-align: center; }
.room-layout { display: flex; flex-direction: column; height: calc(100vh - 56px); overflow: hidden; }
.room-score-banner { display: flex; align-items: center; justify-content: center; gap: 2rem; padding: 1.5rem; background: var(--bg-card); border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; }
.room-team { display: flex; align-items: center; gap: .75rem; flex: 1; justify-content: flex-end; }
.room-team:last-child { flex-direction: row-reverse; justify-content: flex-end; }
.room-team-logo { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.room-team-name { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1.1rem; }
.room-team-winner .room-team-name { color: var(--accent-cyan); }
.room-score { display: flex; align-items: center; gap: 1rem; }
.room-score-num { font-family: 'Rajdhani', sans-serif; font-size: 2.5rem; font-weight: 700; min-width: 2rem; text-align: center; transition: color .3s; }
.room-score-sep { color: var(--text-muted); font-size: 1.5rem; }
.room-meta-bar { display: flex; align-items: center; gap: .75rem; padding: .6rem 1.5rem; background: var(--bg-secondary); border-bottom: 1px solid var(--border-subtle); }
.room-code { font-size: .85rem; font-family: 'Rajdhani', sans-serif; letter-spacing: .08em; }
.room-main { display: flex; flex: 1; overflow: hidden; gap: 0; }
.room-panel { flex: 1; overflow-y: auto; padding: 1.5rem; }
.room-judge-panel { border-right: 1px solid var(--border-subtle); }
.room-panel-title { font-size: 1rem; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border-subtle); }
.room-feed { display: flex; flex-direction: column; gap: .5rem; }
.feed-event { padding: .5rem .75rem; border-radius: var(--radius-sm); font-size: .82rem; background: var(--bg-elevated); border-left: 3px solid var(--border-default); }
.feed-ts { font-size: .72rem; color: var(--text-muted); display: block; margin-bottom: .15rem; }
.feed-msg { color: var(--text-secondary); }
.feed-event-game_submitted { border-color: var(--accent-cyan); }
.feed-event-dispute_raised { border-color: var(--status-disputed); }
.feed-event-match_complete { border-color: #4ade80; }
.ended-banner { text-align: center; padding: 2rem; color: var(--text-secondary); }

/* ── CHALLENGES ──────────────────────────────────── */
.challenges-sections { max-width: 720px; margin: 0 auto; }
.challenge-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.25rem; display: flex; flex-direction: column; gap: .75rem; margin-bottom: .75rem; }
.challenge-incoming { border-color: rgba(124,58,237,.3); }
.challenge-outgoing { border-color: var(--border-subtle); }
.challenge-teams { display: flex; align-items: center; gap: 1rem; font-weight: 600; font-size: 1rem; }
.challenge-from { color: var(--text-primary); }
.challenge-to   { color: var(--accent-cyan); }
.challenge-arrow { color: var(--text-muted); }
.challenge-meta { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; font-size: .82rem; }
.challenge-msg { font-style: italic; color: var(--text-muted); }
.challenge-actions { display: flex; gap: .5rem; }

/* ── TOURNAMENTS PAGE ────────────────────────────── */
.tournament-banner { background: var(--bg-elevated); background-size: cover; background-position: center; min-height: 260px; position: relative; }
.tournament-banner-overlay { background: linear-gradient(to top, rgba(10,10,15,.96) 35%, rgba(10,10,15,.3)); padding: 2rem 3rem 2rem; display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; min-height: 260px; }
.tournament-identity { display: flex; align-items: flex-end; gap: 1.5rem; }
.tournament-logo { width: 90px; height: 90px; border-radius: 14px; object-fit: cover; border: 2px solid var(--accent-purple); }
.tournament-name { font-size: 2.2rem; line-height: 1.1; }
.tournament-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.tournament-banner-actions { display: flex; gap: .75rem; }
.tournament-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; padding: 2rem 0; }
.ruleset-body { white-space: pre-wrap; font-size: .85rem; color: var(--text-secondary); line-height: 1.6; background: var(--bg-elevated); padding: 1rem; border-radius: var(--radius-md); max-height: 300px; overflow-y: auto; }

/* Teams list in tournament */
.teams-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.teams-list-item { display: flex; align-items: center; gap: .75rem; padding: .4rem; font-size: .88rem; }

/* ── BRACKETS ────────────────────────────────────── */
.bracket-preview { overflow-x: auto; padding: 1rem 0; font-size: .8rem; color: var(--text-secondary); }

/* ── NOTIFICATIONS ───────────────────────────────── */
.notif-list { display: flex; flex-direction: column; gap: .4rem; }
.notif-item { display: flex; align-items: flex-start; gap: .75rem; padding: .9rem 1rem; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); cursor: pointer; transition: background .2s; }
.notif-unread { border-color: rgba(124,58,237,.3); background: rgba(124,58,237,.05); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex-shrink: 0; margin-top: 6px; }
.notif-unread .notif-dot { background: var(--accent-purple); box-shadow: 0 0 6px var(--accent-purple); }
.notif-body { flex: 1; }
.notif-title { font-weight: 600; font-size: .9rem; color: var(--text-primary); }
.notif-msg { font-size: .82rem; color: var(--text-secondary); margin-top: .2rem; }
.notif-time { font-size: .72rem; color: var(--text-muted); margin-top: .3rem; display: block; }
.notif-action { font-size: .78rem; color: var(--accent-purple-light); white-space: nowrap; }
.notif-dismiss { background: none; border: none; color: #6b7280; font-size: .85rem; cursor: pointer; padding: 0 .25rem; line-height: 1; }
.notif-dismiss:hover { color: #ef4444; }

/* Notification preferences */
.pref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .6rem; }
.pref-item { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .875rem; color: var(--text-secondary); }
.pref-item input[type="checkbox"] { accent-color: var(--accent-purple); width: 16px; height: 16px; }

/* ── FILTER BAR ──────────────────────────────────── */
.filter-bar { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.5rem; align-items: center; }
.filter-search { max-width: 320px; }

/* ── PAGINATION ──────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2rem; padding: 1rem; }
.page-btn { color: var(--accent-purple-light); font-size: .875rem; font-weight: 500; padding: .4rem .85rem; border: 1px solid var(--border-default); border-radius: var(--radius-sm); transition: all .2s; }
.page-btn:hover { border-color: var(--accent-purple); background: rgba(124,58,237,.1); color: var(--text-primary); }
.page-info { color: var(--text-muted); font-size: .85rem; }

/* ── EMPTY STATE ─────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 1.5rem; color: var(--text-muted); }
.empty-state p { font-size: 1rem; }
.empty-state p a { color: var(--accent-purple-light); }

/* ── INFO BANNER ─────────────────────────────────── */
.info-banner { background: rgba(6,182,212,.08); border: 1px solid rgba(6,182,212,.25); border-radius: var(--radius-md); padding: .875rem 1.25rem; font-size: .875rem; color: var(--text-secondary); }

/* ── MANAGE TABS ─────────────────────────────────── */
.manage-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border-subtle); margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab-btn { padding: .55rem 1.1rem; font-size: .875rem; font-weight: 500; background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-secondary); cursor: pointer; transition: color .2s, border-color .2s; margin-bottom: -1px; }
.tab-btn.active { color: var(--accent-purple-light); border-bottom-color: var(--accent-purple); }
.tab-btn:hover { color: var(--text-primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── ADMIN / DISPUTE CARDS ───────────────────────── */
.dispute-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 1.1rem 1.25rem; margin-bottom: .75rem; }
.dispute-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: .5rem; font-size: .9rem; margin-bottom: .5rem; }
.dispute-reason { background: rgba(249,115,22,.08); border: 1px solid rgba(249,115,22,.2); border-radius: var(--radius-sm); padding: .6rem .9rem; font-size: .85rem; color: #fb923c; }
.dispute-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }

/* Applications */
.applications-list { display: flex; flex-direction: column; gap: 1rem; }
.application-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; }
.application-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.application-body { font-size: .875rem; color: var(--text-secondary); line-height: 1.6; }
.application-body p { margin-bottom: .4rem; }
.application-actions { display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }

/* ── STATS GRID (Admin) ──────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.25rem; display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; }
.stat-card-warn { border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.05); }
.stat-card-num { font-family: 'Rajdhani', sans-serif; font-size: 2rem; font-weight: 700; color: var(--text-primary); }
.stat-card-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }

.admin-nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; }
.admin-nav-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 1rem 1.25rem; font-weight: 600; color: var(--text-secondary); transition: border-color .2s, color .2s, background .2s; display: flex; align-items: center; gap: .5rem; }
.admin-nav-card:hover { border-color: var(--accent-purple); color: var(--text-primary); background: var(--bg-card-hover); }

/* ── ERROR PAGES ─────────────────────────────────── */
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; padding: 3rem 1rem; gap: 1rem; }
.error-code { font-family: 'Rajdhani', sans-serif; font-size: 8rem; font-weight: 700; line-height: 1; }
.error-title { font-size: 2rem; }
.error-sub { color: var(--text-secondary); max-width: 380px; }
.error-stack { background: var(--bg-card); border: 1px solid var(--border-subtle); padding: 1rem; border-radius: var(--radius-md); font-size: .78rem; color: var(--text-secondary); max-width: 600px; text-align: left; overflow: auto; white-space: pre-wrap; }

/* ── FOOTER ──────────────────────────────────────── */
.site-footer { background: var(--bg-card); border-top: 1px solid var(--border-subtle); margin-top: auto; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 3rem 1.5rem; display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 2.5rem; }
.footer-brand .brand-icon { font-size: 1.3rem; }
.footer-brand strong { font-family: 'Rajdhani', sans-serif; font-size: 1.3rem; }
.footer-tagline { font-size: .82rem; color: var(--text-muted); margin-top: .5rem; line-height: 1.5; max-width: 220px; }
.footer-links-group h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: .75rem; }
.footer-links-group ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.footer-links-group a { font-size: .875rem; color: var(--text-secondary); transition: color .2s; }
.footer-links-group a:hover { color: var(--accent-cyan); }
.footer-bottom { border-top: 1px solid var(--border-subtle); padding: 1.25rem 1.5rem; text-align: center; font-size: .78rem; color: var(--text-muted); max-width: 1280px; margin: 0 auto; }

/* ── HERO FLOATING GAME ICONS ───────────────────── */
.hero-floating-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
  perspective: 1000px;
  transform-style: preserve-3d;
}

@keyframes hero-icon-float {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotateX(var(--rot-x, -10deg)) rotateY(var(--rot-y, 30deg)) rotateZ(var(--rot-z, 58deg));
  }
  50% {
    transform: translate3d(0, calc(var(--float-bob, 16px) * -1), 0) rotateX(var(--rot-x, -10deg)) rotateY(var(--rot-y, 30deg)) rotateZ(var(--rot-z, 58deg));
  }
}

.hero-floating-icon {
  position: absolute;
  width: var(--icon-size, 88px);
  height: var(--icon-size, 88px);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-color, #8b5cf6);
  background:
    linear-gradient(155deg, rgba(255,255,255,.1), rgba(255,255,255,.02)),
    rgba(var(--icon-rgb, 124,58,237), .08);
  border: 1px solid rgba(var(--icon-rgb, 124,58,237), .45);
  box-shadow:
    0 0 0 1px rgba(var(--icon-rgb, 124,58,237), .18) inset,
    0 10px 28px rgba(0,0,0,.45),
    0 0 28px rgba(var(--icon-rgb, 124,58,237), .25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transform-origin: center;
  transform-style: preserve-3d;
  animation: hero-icon-float var(--float-duration, 6.5s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
  will-change: transform;
  opacity: .56;
}

.hero-floating-icon::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 1px solid rgba(var(--icon-rgb, 124,58,237), .48);
  filter: blur(8px);
  opacity: .76;
}

.hero-floating-icon::after {
  content: '';
  position: absolute;
  inset: 10%;
  border-radius: 13px;
  background: radial-gradient(circle at 26% 20%, rgba(255,255,255,.18), transparent 65%);
  opacity: .7;
}

.hero-floating-img {
  position: relative;
  z-index: 1;
  width: 74%;
  height: 74%;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(var(--icon-rgb, 124,58,237), .65));
  transform: translateZ(10px);
}

.hero-floating-fallback {
  display: none;
  position: relative;
  z-index: 1;
  font-size: clamp(1.6rem, 1.25rem + 1vw, 2.4rem);
  line-height: 1;
  filter: drop-shadow(0 0 14px rgba(var(--icon-rgb, 124,58,237), .7));
  transform: translateZ(8px);
}

/* ── GAME BADGE INLINE (used on tournament/team pages) ── */
.game-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .22rem .7rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  background: rgba(var(--gc-rgb), .12);
  border: 1px solid rgba(var(--gc-rgb), .4);
  color: var(--gc, #7c3aed);
  transition: background .2s, border-color .2s;
}
.game-badge-inline:hover {
  background: rgba(var(--gc-rgb), .22);
  border-color: rgba(var(--gc-rgb), .65);
}
.game-badge-inline img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  border-radius: 2px;
}
/* Large variant: used in cards/info panels */
.game-badge-lg {
  font-size: .85rem;
  padding: .35rem 1rem;
  gap: .5rem;
}
.game-badge-lg img {
  width: 22px;
  height: 22px;
}

/* ── GAME SHOWCASE CARDS (3-D float + blur glow) ─── */
@keyframes game-float {
  0%, 100% { transform: translateY(0) rotateX(4deg); }
  50%       { transform: translateY(-14px) rotateX(-4deg); }
}
.games-scroll {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: .5rem .5rem 1.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,58,237,.3) transparent;
  justify-content: center;
  flex-wrap: wrap;
}
.games-scroll::-webkit-scrollbar { height: 4px; }
.games-scroll::-webkit-scrollbar-track { background: transparent; }
.games-scroll::-webkit-scrollbar-thumb { background: rgba(124,58,237,.4); border-radius: 2px; }
.game-card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .85rem;
  padding: 1.75rem 1.25rem 1.5rem;
  width: 148px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  cursor: pointer;
  /* Per-card accent colour injected via --gc / --gc-rgb inline style */
  background: rgba(var(--gc-rgb), .07);
  border: 1px solid rgba(var(--gc-rgb), .45);
  box-shadow:
    0 0 16px 4px  rgba(var(--gc-rgb), .28),
    0 0 42px 10px rgba(var(--gc-rgb), .10),
    inset 0 0 24px rgba(var(--gc-rgb), .06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  /* 3-D continuous float */
  perspective: 600px;
  transform-style: preserve-3d;
  animation: game-float 3.5s ease-in-out infinite;
  transition: box-shadow .3s, border-color .3s;
  will-change: transform;
}
.game-card:hover {
  animation-play-state: paused;
  border-color: rgba(var(--gc-rgb), .85);
  box-shadow:
    0 0 28px 8px  rgba(var(--gc-rgb), .55),
    0 0 72px 20px rgba(var(--gc-rgb), .20),
    inset 0 0 32px rgba(var(--gc-rgb), .10);
}
.game-card__logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(var(--gc-rgb), .6));
  pointer-events: none;
}
.game-card__icon {
  font-size: 2.6rem;
  color: rgba(var(--gc-rgb), 1);
  filter: drop-shadow(0 0 10px rgba(var(--gc-rgb), .7));
  line-height: 1;
}
.game-card__name {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: .8rem;
  text-align: center;
  color: var(--text-primary);
  letter-spacing: .06em;
  text-transform: uppercase;
}
/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) { .game-card { animation: none; } }

/* ── PLATFORM FEATURES GRID ──────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.feature-card:hover {
  border-color: rgba(124, 58, 237, .4);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, .12);
}
.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

/* ── GAME FILTER TABS ────────────────────────────── */
.game-filter-tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.game-tab {
  padding: .35rem .95rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.game-tab:hover, .game-tab.active {
  border-color: var(--accent-purple);
  color: var(--accent-purple-light);
  background: rgba(124, 58, 237, .12);
}

/* ── LIGHT MODE BRIDGING FOR TAILWIND UTILITIES ─── */
html[data-theme='light'] .bg-slate-950,
html[data-theme='light'] .bg-slate-900,
html[data-theme='light'] .bg-slate-900\/95,
html[data-theme='light'] .bg-slate-900\/80,
html[data-theme='light'] .bg-slate-900\/60,
html[data-theme='light'] .bg-slate-900\/40,
html[data-theme='light'] .bg-slate-800 {
  background-color: var(--bg-secondary) !important;
}

html[data-theme='light'] .bg-slate-800\/80,
html[data-theme='light'] .bg-slate-800\/60,
html[data-theme='light'] .bg-slate-800\/40,
html[data-theme='light'] .bg-slate-700,
html[data-theme='light'] .bg-slate-700\/60,
html[data-theme='light'] .bg-slate-700\/40 {
  background-color: var(--bg-card) !important;
}

html[data-theme='light'] .text-white,
html[data-theme='light'] .text-slate-100,
html[data-theme='light'] .text-slate-200,
html[data-theme='light'] .text-slate-300 {
  color: var(--text-primary) !important;
}

html[data-theme='light'] .text-slate-400,
html[data-theme='light'] .text-slate-500 {
  color: var(--text-secondary) !important;
}

html[data-theme='light'] .border-slate-800,
html[data-theme='light'] .border-slate-700,
html[data-theme='light'] .border-purple-900\/30,
html[data-theme='light'] .border-purple-900\/20,
html[data-theme='light'] .border-purple-900\/10 {
  border-color: rgba(15,23,42,.14) !important;
}

html[data-theme='light'] .from-purple-900\/60 {
  --tw-gradient-from: rgba(15,118,110,.22) var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgba(15,118,110,0) var(--tw-gradient-to-position) !important;
}

html[data-theme='light'] .to-slate-900,
html[data-theme='light'] .to-slate-900\/60 {
  --tw-gradient-to: rgba(226,232,240,.55) var(--tw-gradient-to-position) !important;
}

html[data-theme='light'] .shadow-xl,
html[data-theme='light'] .shadow-2xl {
  --tw-shadow-color: rgba(15,23,42,.18) !important;
}

/* ── POPUP/MODAL THEME BRIDGING ─────────────────── */
#sidebar-overlay {
  background: var(--overlay-backdrop) !important;
  backdrop-filter: blur(3px) !important;
}

#regModalBackdrop,
#openRegBackdrop,
.rte-img-dialog-backdrop {
  background: var(--overlay-backdrop) !important;
  backdrop-filter: blur(5px);
}

#regModalPanel,
#openRegPanel,
.rte-img-dialog {
  background: var(--overlay-panel-bg) !important;
  border-color: var(--overlay-panel-border) !important;
  box-shadow: var(--overlay-panel-shadow) !important;
  color: var(--text-primary);
}

#regModalClose,
#openRegClose {
  color: var(--text-muted) !important;
}

#regModalClose:hover,
#openRegClose:hover {
  color: var(--text-primary) !important;
  background: rgba(148,163,184,.14) !important;
}

.rte-img-dialog {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%);
  width: min(92vw, 420px);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}

html[data-theme='light'] #regModalPanel > div:first-child,
html[data-theme='light'] #openRegPanel .open-reg-header {
  border-bottom-color: rgba(15,23,42,.16) !important;
  background: linear-gradient(180deg, rgba(148,163,184,.2), rgba(148,163,184,.06)) !important;
}

html[data-theme='light'] #regModalPanel .reg-team-option {
  border-color: rgba(15,23,42,.14) !important;
  background: linear-gradient(135deg, rgba(248,250,252,.98), rgba(241,245,249,.96)) !important;
}

html[data-theme='light'] #regModalPanel .reg-team-option:hover {
  border-color: rgba(15,118,110,.35) !important;
  background: linear-gradient(135deg, rgba(236,253,245,.95), rgba(240,249,255,.96)) !important;
}

html[data-theme='light'] #regModalPanel .reg-team-option.is-selected {
  border-color: rgba(5,150,105,.4) !important;
  background: linear-gradient(135deg, rgba(220,252,231,.9), rgba(236,253,245,.94)) !important;
}

html[data-theme='light'] #regModalPanel #regSelectStep,
html[data-theme='light'] #regModalPanel #regDetailToolbar,
html[data-theme='light'] #regModalPanel .reg-team-details-panel,
html[data-theme='light'] #regModalPanel .reg-team-details-actions,
html[data-theme='light'] #regModalPanel .reg-team-details-scroll {
  background: rgba(248,250,252,.88) !important;
  border-color: rgba(15,23,42,.12) !important;
}

html[data-theme='light'] #regModalPanel [style*="color:#fff"],
html[data-theme='light'] #regModalPanel [style*="color:#f1f5f9"],
html[data-theme='light'] #regModalPanel [style*="color:#e2e8f0"],
html[data-theme='light'] #regModalPanel [style*="color:#cbd5e1"],
html[data-theme='light'] #openRegPanel [style*="color:#fff"],
html[data-theme='light'] #openRegPanel [style*="color:#f1f5f9"],
html[data-theme='light'] #openRegPanel [style*="color:#e2e8f0"],
html[data-theme='light'] #openRegPanel [style*="color:#cbd5e1"] {
  color: var(--text-primary) !important;
}

html[data-theme='light'] #regModalPanel [style*="color:#64748b"],
html[data-theme='light'] #regModalPanel [style*="color:#94a3b8"],
html[data-theme='light'] #regModalSubtitle,
html[data-theme='light'] #openRegPanel .open-reg-header-sub,
html[data-theme='light'] #openRegPanel [style*="color:#64748b"],
html[data-theme='light'] #openRegPanel [style*="color:#94a3b8"],
html[data-theme='light'] #openRegPanel [style*="color:#475569"] {
  color: var(--text-secondary) !important;
}

html[data-theme='light'] #openRegPanel .open-reg-header-title {
  color: var(--text-primary) !important;
}

html[data-theme='light'] #openRegPanel input:not([type='checkbox']):not([type='radio']):not([type='submit']):not([type='button']),
html[data-theme='light'] #openRegPanel select,
html[data-theme='light'] #openRegPanel textarea {
  background: #ffffff !important;
  color: var(--text-primary) !important;
  border-color: rgba(15,23,42,.2) !important;
}

html[data-theme='light'] #openRegPanel input::placeholder,
html[data-theme='light'] #openRegPanel textarea::placeholder {
  color: var(--text-muted) !important;
}

html[data-theme='light'] #openRegPanel .open-reg-roster-row {
  border-top-color: rgba(15,23,42,.09) !important;
  background: rgba(241,245,249,.74) !important;
}

html[data-theme='light'] #openRegPanel .open-reg-roster-table thead tr {
  background: rgba(15,118,110,.12) !important;
}

html[data-theme='light'] input[style*="background:#1e293b"],
html[data-theme='light'] input[style*="background: #1e293b"],
html[data-theme='light'] input[style*="background:#0f172a"],
html[data-theme='light'] input[style*="background: #0f172a"],
html[data-theme='light'] input[style*="background:rgba(15,23,42"],
html[data-theme='light'] input[style*="background: rgba(15,23,42"],
html[data-theme='light'] textarea[style*="background:#1e293b"],
html[data-theme='light'] textarea[style*="background: #1e293b"],
html[data-theme='light'] textarea[style*="background:#0f172a"],
html[data-theme='light'] textarea[style*="background: #0f172a"],
html[data-theme='light'] textarea[style*="background:rgba(15,23,42"],
html[data-theme='light'] textarea[style*="background: rgba(15,23,42"],
html[data-theme='light'] select[style*="background:#1e293b"],
html[data-theme='light'] select[style*="background: #1e293b"],
html[data-theme='light'] select[style*="background:#0f172a"],
html[data-theme='light'] select[style*="background: #0f172a"],
html[data-theme='light'] select[style*="background:rgba(15,23,42"],
html[data-theme='light'] select[style*="background: rgba(15,23,42"] {
  background: #ffffff !important;
  color: var(--text-primary) !important;
  border-color: rgba(15,23,42,.2) !important;
}

html[data-theme='light'] input[style*="background:#1e293b"]::placeholder,
html[data-theme='light'] input[style*="background: #1e293b"]::placeholder,
html[data-theme='light'] input[style*="background:#0f172a"]::placeholder,
html[data-theme='light'] input[style*="background: #0f172a"]::placeholder,
html[data-theme='light'] input[style*="background:rgba(15,23,42"]::placeholder,
html[data-theme='light'] input[style*="background: rgba(15,23,42"]::placeholder,
html[data-theme='light'] textarea[style*="background:#1e293b"]::placeholder,
html[data-theme='light'] textarea[style*="background: #1e293b"]::placeholder,
html[data-theme='light'] textarea[style*="background:#0f172a"]::placeholder,
html[data-theme='light'] textarea[style*="background: #0f172a"]::placeholder,
html[data-theme='light'] textarea[style*="background:rgba(15,23,42"]::placeholder,
html[data-theme='light'] textarea[style*="background: rgba(15,23,42"]::placeholder {
  color: var(--text-muted) !important;
}

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1024px) {
  .team-detail-grid, .match-detail-grid, .tournament-detail-grid, .profile-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .hero-floating-icon { opacity: .45; }
  .hero-floating-icon:nth-child(n + 7) { display: none; }
}
@media (max-width: 768px) {
  .navbar-links { display: none; flex-direction: column; position: fixed; top: 64px; left: 0; right: 0; background: var(--bg-card); border-bottom: 1px solid var(--border-subtle); padding: 1rem; z-index: 99; gap: .25rem; }
  .navbar-links.open { display: flex; }
  .hamburger { display: flex; }
  .hero { padding: 4rem 1rem 3rem; }
  .team-banner-overlay, .tournament-banner-overlay { padding: 1.5rem; flex-direction: column; align-items: flex-start; }
  .room-main { flex-direction: column; }
  .room-judge-panel { border-right: none; border-bottom: 1px solid var(--border-subtle); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .h2h-header { flex-direction: column; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-floating-layer { inset: 0 0 8% 0; }
  .hero-floating-icon {
    width: calc(var(--icon-size, 88px) * .78);
    height: calc(var(--icon-size, 88px) * .78);
    border-radius: 14px;
    opacity: .36;
  }
  .hero-floating-fallback { font-size: 1.4rem; }
  .hero-floating-icon:nth-child(n + 5) { display: none; }
}
@media (max-width: 480px) {
  .page-container, .section-block { padding: 1.5rem 1rem; }
  .page-title { font-size: 1.5rem; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .card-grid, .news-grid, .stats-grid, .admin-nav-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .features-grid { grid-template-columns: 1fr; }
  .hero-floating-icon:nth-child(n + 4) { display: none; }
  .hero-floating-icon { opacity: .3; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-floating-icon {
    animation: none;
    transform: rotateX(var(--rot-x, -10deg)) rotateY(var(--rot-y, 30deg)) rotateZ(var(--rot-z, 58deg));
  }
}
