@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Orbitron:wght@400;700;900&display=swap');

:root {
  --bg-primary: #080b14;
  --bg-secondary: #0d1117;
  --bg-card: #0f1623;
  --bg-card-hover: #141d2e;
  --neon-cyan: #00f5ff;
  --neon-purple: #bf00ff;
  --neon-green: #00ff88;
  --neon-orange: #ff6b00;
  --neon-red: #ff3c3c;
  --text-primary: #e8eaf6;
  --text-muted: #8fa0c0;
  --border: #1a2540;
  --border-glow: rgba(0, 245, 255, 0.3);
}

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

html { scroll-behavior: smooth; }

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

/* ── Animated background grid ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,245,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,245,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 15rem;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-logo {
  padding: 28px 24px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 5px;
}

.sidebar-logo .logo-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-logo .logo-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-section {
  padding: 8px 16px 4px;
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  position: relative;
  border-left: 3px solid transparent;
}

.nav-item:hover, .nav-item.active {
  color: var(--neon-cyan);
  background: rgba(0, 245, 255, 0.05);
  border-left-color: var(--neon-cyan);
}

.nav-item i { width: 18px; text-align: center; font-size: 0.9rem; }

.sidebar-spacer {
  display: none;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

@media (max-height: 800px) {
  .sidebar-footer-top {
    flex-direction: row;
    justify-content: space-between;
  }
}

.sidebar-footer .version {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-align: center;
  margin-top: 5px;
}

/* ── Main content ── */
.main {
  margin-left: 15rem;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 36px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 11, 20, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-primary);
  text-transform: uppercase;
}

.topbar-actions { display: flex; gap: 12px; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 6px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), #0099cc);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 0 35px rgba(0, 245, 255, 0.6);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }

/* ── Page content ── */
.content { padding: 36px; }

.page-header { margin-bottom: 32px; }

.page-header h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 2px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 6px;
}

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.stat-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 20px rgba(0,0,0,0.2);
}

.stat-card .icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  background: rgba(255,255,255,0.05);
  color: var(--accent);
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.08);
}

.stat-card .value {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card .label {
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Panels grid ── */
.panels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-primary);
}

.panel-body { padding: 8px 0; }
.panel.collapsed .panel-body { display: none; }

/* ── List items ── */
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  transition: background 0.2s;
  border-bottom: 1px solid rgba(26,37,64,0.5);
}

.list-item:last-child { border-bottom: none; }
.list-item:hover { background: rgba(0,245,255,0.03); }

.list-item .rank {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
}

.rank-1 { color: #ffd700 !important; }
.rank-2 { color: #c0c0c0 !important; }
.rank-3 { color: #cd7f32 !important; }

.avatar {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #000;
  flex-shrink: 0;
}

.list-item .avatar {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #000;
  flex-shrink: 0;
}

.list-item .info { flex: 1; min-width: 0; }

.list-item .name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item .meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.badge-cyan { background: rgba(0,245,255,0.1); color: var(--neon-cyan); border: 1px solid rgba(0,245,255,0.2); }
.badge-purple { background: rgba(191,0,255,0.1); color: var(--neon-purple); border: 1px solid rgba(191,0,255,0.2); }
.badge-green { background: rgba(0,255,136,0.1); color: var(--neon-green); border: 1px solid rgba(0,255,136,0.2); }
.badge-orange { background: rgba(255,107,0,0.1); color: var(--neon-orange); border: 1px solid rgba(255,107,0,0.2); }

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  gap: 12px;
}

.empty-state i { font-size: 2rem; opacity: 0.3; }
.empty-state p { font-size: 0.85rem; letter-spacing: 1px; }

/* ── Neon glow pulse animation ── */
@keyframes neon-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes count-up {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.animate-in {
  animation: slide-up 0.5s ease forwards;
  opacity: 0;
}

.stat-card { animation: slide-up 0.4s ease forwards; opacity: 0; }
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

.panel { animation: slide-up 0.7s ease forwards; opacity: 0; }

/* ── Live Feed ── */
.feed-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(26,37,64,0.5);
  animation: feed-in 0.4s ease;
  overflow: hidden;
}
.feed-item:last-child { border-bottom: none; }
@keyframes feed-in {
  from { opacity: 0; transform: translateY(-16px); max-height: 0; padding: 0 12px; }
  to   { opacity: 1; transform: translateY(0);     max-height: 70px; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.feed-winner { font-weight: 700; color: var(--neon-green); }
.feed-loser  { color: var(--text-muted); }
.feed-score  { font-family: 'Orbitron', sans-serif; font-size: 0.8rem; color: var(--neon-cyan); margin-left: auto; white-space: nowrap; }
.feed-arena  { font-size: 0.68rem; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }
.feed-time   { font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; }
.feed-dot    { width: 8px; height: 8px; border-radius: 50%; background: var(--neon-green); flex-shrink: 0; box-shadow: 0 0 6px var(--neon-green); }
.feed-live-badge { display: flex; align-items: center; gap: 6px; font-size: 0.68rem; color: var(--neon-green); letter-spacing: 1px; }
.feed-live-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--neon-green); animation: pulse 1.5s infinite; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-cyan); }

/* ── Responsive ── */
.hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 8px;
  flex-shrink: 0;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.hamburger:hover { border-color: var(--neon-cyan); }
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: all 0.25s;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--neon-cyan); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--neon-cyan); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hamburger { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .panels-grid { grid-template-columns: 1fr; }
  .topbar { padding: 14px 16px; gap: 12px; }
  .topbar-title { font-size: 0.8rem; letter-spacing: 1px; }
  .topbar-actions { gap: 6px; }
  .content { padding: 0 4px 40px; }
  .page-header { padding: 20px 16px 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .bracket-round { min-width: 160px; }
  .guide-tabs { gap: 6px; }
  .guide-tab { font-size: 0.72rem; padding: 7px 10px; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-actions .btn span, .topbar-actions .btn-text { display: none; }
  .topbar-actions .btn { padding: 7px 10px; }
  .guide-cards-grid { grid-template-columns: 1fr 1fr; }
  .bracket-container { overflow-x: auto; }
  .modal { margin: 12px; width: calc(100% - 24px) !important; max-width: none !important; }
  .panels-grid { gap: 12px; }
  .panel-header { padding: 14px 16px; }
  .panel-body { padding: 6px 0; }
  .list-item { padding: 10px 14px; }
  .page-header h1 { font-size: 1.4rem; }
  .guide-tab { padding: 6px 8px; letter-spacing: 0; }
  .guide-tab i { margin-right: 0; }
  .guide-tab span { display: none; }
}

/* ── Forms ── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 16px;
  color: var(--text-primary);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.1);
}

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

/* ── Alert ── */
.alert-error {
  background: rgba(255, 60, 60, 0.08);
  border: 1px solid rgba(255, 60, 60, 0.3);
  color: #ff6b6b;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Icon button (delete etc.) ── */
.btn-icon {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.8rem;
}

.btn-icon:hover {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.3);
  background: rgba(255, 107, 107, 0.08);
}

.delete-form { margin: 0; }

/* ── Language switcher ── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.lang-btn:hover { color: var(--neon-cyan); }

.lang-active {
  color: var(--neon-cyan) !important;
  border-color: rgba(0, 245, 255, 0.3);
  background: rgba(0, 245, 255, 0.05);
}

.lang-sep { color: var(--border); font-size: 0.7rem; }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 4px;
  border: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
  background: var(--bg-card-hover);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 245, 255, 0.2);
}

.tab-content { display: none; }
.tab-content.active { display: block; }
.vis-toggle { display:flex; gap:8px; }
.vis-btn { flex:1; padding:9px 12px; border-radius:8px; border:2px solid var(--border); background:var(--bg-primary); color:var(--text-muted); font-family:'Rajdhani',sans-serif; font-size:0.9rem; cursor:pointer; transition:all 0.2s; }
.vis-btn.active-public { border-color:var(--neon-green); color:var(--neon-green); background:rgba(0,255,136,0.08); }
.vis-btn.active-private { border-color:var(--neon-red); color:var(--neon-red); background:rgba(255,60,60,0.08); }
.option-pills { display:flex; flex-wrap:wrap; gap:8px; }
.option-pill { padding:7px 14px; border-radius:8px; border:2px solid var(--border); background:var(--bg-primary); color:var(--text-muted); font-family:'Rajdhani',sans-serif; font-size:0.85rem; cursor:pointer; transition:all 0.2s; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:180px; }
.option-pill.active { border-color:var(--neon-cyan); color:var(--neon-cyan); background:rgba(0,245,255,0.08); }


.hidden { display: none !important; }

/* ── Champion banner ── */
.champion-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: linear-gradient(135deg, rgba(255,183,0,0.08), rgba(255,107,0,0.08));
  border: 1px solid rgba(255,183,0,0.3);
  border-radius: 12px;
  padding: 20px 32px;
  margin-bottom: 32px;
  text-align: center;
}

.champion-banner i { font-size: 1.8rem; color: #ffd700; animation: neon-pulse 2s infinite; }
.champion-label { font-size: 0.7rem; letter-spacing: 3px; text-transform: uppercase; color: var(--text-muted); }
.champion-name { font-family: 'Orbitron', sans-serif; font-size: 1.4rem; font-weight: 700; color: #ffd700; }

/* ── Bracket ── */
.bracket-wrapper { overflow-x: auto; padding-bottom: 16px; }

.bracket {
  display: flex;
  gap: 0;
  align-items: stretch;
  min-width: max-content;
  padding: 8px 4px;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  min-width: 240px;
  position: relative;
}

.bracket-round + .bracket-round { margin-left: 32px; }

.round-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.bracket-matches {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  gap: 8px;
}

.bracket-match {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  transition: all 0.2s;
  position: relative;
}

.bracket-match.match-active {
  border-color: rgba(0, 245, 255, 0.3);
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.08);
}

.bracket-match.match-done { border-color: rgba(0, 255, 136, 0.2); }
.bracket-match.match-conflict {
  border-color: var(--neon-orange) !important;
  box-shadow: 0 0 10px rgba(255,107,0,0.3);
  animation: conflict-pulse 1.5s ease-in-out infinite;
}
@keyframes conflict-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255,107,0,0.3); }
  50% { box-shadow: 0 0 18px rgba(255,107,0,0.6); }
}
.edit-form .score-input { width: 44px; }

.match-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.match-player.winner { background: rgba(0, 255, 136, 0.06); }
.match-player.loser { opacity: 0.4; }

.match-avatar {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
  overflow: hidden;
}
.match-avatar:not(:has(span)) {
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
}

.match-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-score {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--neon-cyan);
  min-width: 20px;
  text-align: center;
}

.match-crown { color: #ffd700; font-size: 0.75rem; margin-left: 4px; }

.match-vs {
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding: 2px 0;
}

/* Score form */
.score-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  justify-content: space-between;
}

.score-input {
  width: 56px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text-primary);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.score-input:focus { border-color: var(--neon-cyan); }
.score-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.score-sep {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: var(--text-muted);
}

/* ── Grand Prix ── */
.gp-row { transition: all 0.2s; }

.gp-first { background: linear-gradient(90deg, rgba(255,215,0,0.06), transparent); }
.gp-second { background: linear-gradient(90deg, rgba(192,192,192,0.04), transparent); }
.gp-third { background: linear-gradient(90deg, rgba(205,127,50,0.04), transparent); }

.gp-points {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
}

.gp-score {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--neon-cyan);
  line-height: 1;
}

.gp-label {
  font-size: 0.65rem;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ── Stats table ── */
.stats-table-wrapper { overflow-x: auto; }

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.stats-table thead tr {
  border-bottom: 2px solid var(--border);
}

.stats-table th {
  padding: 12px 16px;
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
}

.stats-table th:nth-child(1),
.stats-table th:nth-child(2) { text-align: left; }

.stats-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(26,37,64,0.5);
  vertical-align: middle;
}

.stats-table tbody tr { transition: background 0.15s; }
.stats-table tbody tr:hover { background: rgba(0,245,255,0.03); }
.stats-table tbody tr:last-child td { border-bottom: none; }

.row-gold td:first-child { border-left: 3px solid #ffd700; }
.row-silver td:first-child { border-left: 3px solid #c0c0c0; }
.row-bronze td:first-child { border-left: 3px solid #cd7f32; }

.rank-cell { width: 40px; text-align: center; }
.num-cell { text-align: center; }

/* Win rate bar */
.winrate-bar {
  position: relative;
  background: var(--bg-primary);
  border-radius: 4px;
  height: 20px;
  min-width: 80px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.winrate-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--neon-green), rgba(0,255,136,0.4));
  border-radius: 4px;
  transition: width 1s ease;
}

.winrate-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  z-index: 1;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,60,60,0.12), 0 0 40px rgba(255,60,60,0.06);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ff4444, #ff6b6b, #ff4444);
  box-shadow: 0 0 16px rgba(255, 68, 68, 0.6);
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-body {
  padding: 36px 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.modal-icon {
  width: 64px; height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,60,60,0.15), rgba(255,60,60,0.05));
  border: 1px solid rgba(255, 60, 60, 0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: #ff6b6b;
  margin-bottom: 20px;
  box-shadow: 0 0 24px rgba(255,60,60,0.2);
}

.modal-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.modal-message {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 20px 32px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  justify-content: flex-end;
}

.modal-cyan {
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(0,212,255,0.15), 0 0 40px rgba(0,212,255,0.06);
}
.modal-cyan::before {
  background: linear-gradient(90deg, var(--neon-cyan), #00aaff, var(--neon-cyan));
  box-shadow: 0 0 16px rgba(0,212,255,0.5);
}
.modal-cyan .modal-icon {
  background: radial-gradient(circle, rgba(0,212,255,0.15), rgba(0,212,255,0.05));
  border-color: rgba(0,212,255,0.25);
  color: var(--neon-cyan);
  box-shadow: 0 0 24px rgba(0,212,255,0.2);
}

.btn-danger {
  background: linear-gradient(135deg, #ff4444, #cc0000);
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}

.btn-danger:hover {
  box-shadow: 0 0 35px rgba(255, 68, 68, 0.5);
  transform: translateY(-1px);
}

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  pointer-events: all;
  animation: toast-in 0.3s ease forwards;
}

.toast.toast-out { animation: toast-out 0.3s ease forwards; }

.toast-success { border-left: 3px solid var(--neon-green); }
.toast-error   { border-left: 3px solid #ff6b6b; }
.toast-info    { border-left: 3px solid var(--neon-cyan); }

.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--neon-green); }
.toast-error   .toast-icon { color: #ff6b6b; }
.toast-info    .toast-icon { color: var(--neon-cyan); }

.toast-text { font-size: 0.88rem; font-weight: 500; flex: 1; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

/* ── Player picker (checkbox list) ── */
.player-search {
  position: relative;
  margin: 16px 0 8px;
}

.player-search input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px 9px 36px;
  color: var(--text-primary);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.player-search input:focus { border-color: var(--neon-cyan); }

.player-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
  pointer-events: none;
}

.player-picker {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
}

.player-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(26,37,64,0.4);
  user-select: none;
}

.player-picker-item:last-child { border-bottom: none; }
.player-picker-item:hover { background: rgba(0,245,255,0.04); }

.player-picker-item input[type="checkbox"] { display: none; }

.player-picker-item .check-box {
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  font-size: 0.65rem;
  color: transparent;
}

.player-picker-item.checked .check-box {
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
  color: #000;
  box-shadow: 0 0 8px rgba(0,245,255,0.4);
}

.player-picker-item .pick-avatar {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
}

.player-picker-item .pick-name {
  font-size: 0.9rem;
  font-weight: 500;
  flex: 1;
}

.picker-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ── Mode toggle ── */
.mode-toggle {
  display: flex;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.mode-toggle input[type="radio"] { display: none; }

.mode-toggle label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 6px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.mode-toggle input[value="individual"]:checked + label {
  background: rgba(0,245,255,0.08);
  color: var(--neon-cyan);
  border-color: rgba(0,245,255,0.25);
  box-shadow: 0 0 12px rgba(0,245,255,0.1);
}

.mode-toggle input[value="team"]:checked + label {
  background: rgba(191,0,255,0.08);
  color: var(--neon-purple);
  border-color: rgba(191,0,255,0.25);
  box-shadow: 0 0 12px rgba(191,0,255,0.1);
}

/* ── Picker select/deselect all ── */
.picker-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px 6px;
}

.select-all-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.select-all-btn:hover { color: var(--neon-cyan); }

/* ── Bracket zoom controls ── */
.bracket-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.bracket-wrapper {
  overflow: auto;
  padding-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}

.bracket-scale-container {
  display: inline-block;
}


/* ── Hero banner ─────────────────────────────────────────── */
.hero-banner {
  position: relative;
  background: linear-gradient(135deg, rgba(0,245,255,0.06), rgba(189,0,255,0.08));
  border: 1px solid rgba(0,245,255,0.15);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 28px;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(0,245,255,0.12), transparent 70%);
  pointer-events: none;
}
.hero-content {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}
.hero-icon {
  font-size: 2.2rem;
  color: var(--neon-cyan);
  filter: drop-shadow(0 0 12px var(--neon-cyan));
  flex-shrink: 0;
}
.hero-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.hero-tag {
  font-size: 0.7rem;
  color: var(--neon-cyan);
  border: 1px solid rgba(0,245,255,0.3);
  border-radius: 4px;
  padding: 2px 8px;
  vertical-align: middle;
  letter-spacing: 1px;
}
.hero-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 560px;
}
.hero-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-badges span {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-badges span i { color: var(--neon-cyan); }

/* ── Guide ───────────────────────────────────────────────── */
.guide-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.guide-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}
.guide-tab:hover { border-color: rgba(0,245,255,0.3); color: var(--text-primary); }
.guide-tab.active { background: rgba(0,245,255,0.1); border-color: var(--neon-cyan); color: var(--neon-cyan); }

.guide-panel { display: none; animation: guide-in 0.3s ease; padding: 0 4px; }
.guide-panel.active { display: block; }
@keyframes guide-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* hero */
.guide-hero {
  position: relative;
  text-align: center;
  padding: 48px 32px 36px;
  background: linear-gradient(135deg, rgba(0,245,255,0.05), rgba(189,0,255,0.07));
  border: 1px solid rgba(0,245,255,0.12);
  border-radius: 16px;
  margin-bottom: 32px;
  overflow: hidden;
}
.guide-hero-glow {
  position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(0,245,255,0.1), transparent 70%);
  pointer-events: none;
}
.guide-hero-icon {
  font-size: 3rem;
  color: var(--neon-cyan);
  filter: drop-shadow(0 0 16px var(--neon-cyan));
  display: block;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.guide-hero h2 { font-family:'Orbitron',sans-serif; font-size:1.4rem; margin-bottom:10px; }
.guide-hero p  { color: var(--text-muted); max-width: 500px; margin: 0 auto; line-height:1.7; }

/* flow */
.guide-flow {
  display: flex;
  align-items: flex-start;
  gap: 0;
  flex-wrap: wrap;
  justify-content: center;
}
.guide-flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 130px;
  gap: 10px;
  padding: 16px 8px;
  border-radius: 12px;
  transition: background 0.2s;
}
.guide-flow-step:hover { background: rgba(255,255,255,0.03); }
.guide-flow-num {
  font-family:'Orbitron',sans-serif;
  font-size:0.65rem;
  color: var(--c);
  letter-spacing:1px;
}
.guide-flow-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  background: color-mix(in srgb, var(--c) 10%, transparent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: var(--c);
  filter: drop-shadow(0 0 6px var(--c));
}
.guide-flow-label { font-size:0.8rem; font-weight:600; color:var(--text-primary); }
.guide-flow-desc  { font-size:0.72rem; color:var(--text-muted); line-height:1.4; }
.guide-flow-arrow {
  color: var(--text-muted);
  font-size: 0.8rem;
  padding-top: 36px;
  flex-shrink: 0;
}

/* section header */
.guide-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: var(--c);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--c) 20%, transparent);
}

/* steps */
.guide-steps { display: flex; flex-direction: column; gap: 16px; }
.guide-step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 20px 24px;
  transition: border-color 0.2s, transform 0.2s;
}
.guide-step:hover { border-color: rgba(255,255,255,0.12); transform: translateX(4px); }
.guide-step-badge {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--c) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  color: var(--c);
  font-weight: 700;
}
.guide-step-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 6px; }
.guide-step-desc  { color: var(--text-muted); font-size: 0.85rem; line-height: 1.6; }
.guide-tip {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(255,213,0,0.06);
  border-left: 3px solid #ffd700;
  border-radius: 0 8px 8px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.guide-tip i { color: #ffd700; margin-right: 6px; }
.guide-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 7px 16px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--c, var(--neon-cyan)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--neon-cyan)) 35%, transparent);
  color: var(--c, var(--neon-cyan));
  font-size: 0.8rem;
  text-decoration: none;
  transition: background 0.2s;
}
.guide-cta:hover { background: color-mix(in srgb, var(--c, var(--neon-cyan)) 20%, transparent); }

/* mode cards */
.guide-mode-cards { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.guide-mode-card {
  flex: 1; min-width: 140px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  background: color-mix(in srgb, var(--c) 6%, transparent);
  display: flex; flex-direction: column; gap: 6px;
}
.guide-mode-card i { font-size: 1.3rem; color: var(--c); }
.guide-mode-card span { font-weight: 700; font-size: 0.88rem; }
.guide-mode-card small { color: var(--text-muted); font-size: 0.78rem; line-height: 1.4; }

/* bracket demo */
.guide-bracket-demo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  padding: 24px;
  background: rgba(0,0,0,0.2);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
  justify-content: center;
}
.gbd-round { display: flex; flex-direction: column; gap: 10px; }
.gbd-match {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 110px;
}
.gbd-final { border-color: rgba(0,245,255,0.3); }
.gbd-p { font-size: 0.8rem; color: var(--text-muted); padding: 2px 0; }
.gbd-p.win { color: var(--neon-green); font-weight: 700; }
.gbd-arrow { color: var(--text-muted); font-size: 1rem; }
.gbd-champion {
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(255,165,0,0.15), rgba(255,213,0,0.1));
  border: 1px solid rgba(255,213,0,0.3);
  border-radius: 12px;
  color: #ffd700;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex; align-items: center; gap: 8px;
  animation: float 3s ease-in-out infinite;
}

/* info cards grid */
.guide-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 0 2px;
}
.guide-info-card {
  padding: 24px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--c) 25%, transparent);
  background: color-mix(in srgb, var(--c) 6%, transparent);
  transition: transform 0.2s, border-color 0.2s;
}
.guide-info-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.guide-info-card > i { font-size: 1.6rem; color: var(--c); margin-bottom: 12px; display: block; }
.guide-info-title { font-weight: 700; margin-bottom: 6px; }
.guide-info-desc  { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }

/* feature cards (overview highlights) */
.guide-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.guide-feature-card {
  padding: 24px 20px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--c) 25%, transparent);
  background: color-mix(in srgb, var(--c) 6%, transparent);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  display: flex; flex-direction: column; gap: 6px;
}
.guide-feature-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.guide-feature-card > i { font-size: 1.5rem; color: var(--c); }
.guide-feature-title { font-weight: 700; font-size: 0.9rem; }
.guide-feature-desc  { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; flex: 1; }
.guide-feature-link  { font-size: 0.78rem; color: var(--c); margin-top: 4px; }

/* ── Light theme (gaming) ────────────────────────────────── */
[data-theme="light"] {
  --bg-primary:    #eef2fa;
  --bg-secondary:  #dce4f4;
  --bg-card:       #ffffff;
  --bg-card-hover: #e4ecf8;
  --text-primary:  #060a14;
  --text-muted:    #1e2e50;
  --border:        #9aaac8;
  --border-glow:   rgba(0, 160, 200, 0.5);
  --neon-cyan:     #0077aa;
  --neon-purple:   #7700cc;
  --neon-green:    #007740;
  --neon-orange:   #cc4400;
}
[data-theme="light"] body {
  background: var(--bg-primary);
  color: var(--text-primary);
}
[data-theme="light"] .sidebar {
  background: var(--bg-secondary);
  border-right-color: var(--border);
}
[data-theme="light"] .topbar {
  background: var(--bg-secondary);
  border-bottom-color: var(--border);
}
[data-theme="light"] .panel,
[data-theme="light"] .stat-card,
[data-theme="light"] .form-input,
[data-theme="light"] .list-item {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}
[data-theme="light"] .form-input {
  color: var(--text-primary);
}
[data-theme="light"] .form-input::placeholder { color: var(--text-muted); }
[data-theme="light"] .nav-item:hover,
[data-theme="light"] .nav-item.active {
  background: rgba(0,180,220,0.12);
}
[data-theme="light"] .modal-overlay { background: rgba(0,0,0,0.4); }
[data-theme="light"] .modal {
  background: var(--bg-card);
  border-color: var(--border);
}
[data-theme="light"] .badge {
  filter: brightness(0.85) saturate(1.2);
}
[data-theme="light"] .page-header h1 { color: var(--text-primary); }
[data-theme="light"] .panel-title { color: var(--text-primary); }
[data-theme="light"] .meta { color: var(--text-muted); }
[data-theme="light"] .name { color: var(--text-primary); }
[data-theme="light"] .info .name { color: var(--text-primary); }
[data-theme="light"] .stat-card .label { color: var(--text-muted); }
[data-theme="light"] .stat-card .value { color: var(--text-primary); }
[data-theme="light"] .nav-item { color: var(--text-muted); }
[data-theme="light"] .nav-item.active,
[data-theme="light"] .nav-item:hover { color: var(--neon-cyan); }
[data-theme="light"] .nav-section-title { color: var(--text-muted); }
[data-theme="light"] .topbar-title { color: var(--text-primary); }
[data-theme="light"] .form-label { color: var(--text-primary); }
[data-theme="light"] .form-hint { color: var(--text-muted); }
[data-theme="light"] .section-title { color: var(--text-primary); }
[data-theme="light"] .rank { color: var(--text-primary); }
[data-theme="light"] .avatar { color: var(--text-primary); }
[data-theme="light"] .page-header p { color: var(--text-muted); }
[data-theme="light"] .btn-ghost { color: var(--text-muted); border-color: var(--border); }
[data-theme="light"] .btn-ghost:hover { color: var(--text-primary); border-color: var(--text-muted); }
[data-theme="light"] .version { color: var(--text-muted); }
[data-theme="light"] .version a { color: var(--text-muted); }
[data-theme="light"] table th,
[data-theme="light"] table td { color: var(--text-primary); border-color: var(--border); }
[data-theme="light"] .alert-error { background: rgba(255,60,60,0.1); color: #c0000a; border-color: rgba(255,60,60,0.3); }
[data-theme="light"] .alert-success { background: rgba(0,200,100,0.1); color: #006630; border-color: rgba(0,200,100,0.3); }
[data-theme="light"] .empty-state { color: var(--text-muted); }
[data-theme="light"] .tab-btn { color: var(--text-muted); border-color: var(--border); }
[data-theme="light"] .tab-btn.active { color: var(--neon-cyan); border-color: var(--neon-cyan); }
[data-theme="light"] .toast { background: var(--bg-card); color: var(--text-primary); border-color: var(--border); }
[data-theme="light"] .cursor-trail { opacity: 0.5; }

/* ── Flatpickr dark theme override ──────────────────────── */
.flatpickr-calendar {
  background: var(--bg-card) !important;
  border: 1px solid rgba(0,245,255,0.2) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
  font-family: inherit !important;
}
.flatpickr-months { padding: 8px 0 4px; }
.flatpickr-month, .flatpickr-current-month, .flatpickr-monthDropdown-months {
  background: transparent !important;
  color: var(--text-primary) !important;
  fill: var(--text-primary) !important;
}
.flatpickr-current-month input.cur-year,
.flatpickr-current-month .flatpickr-monthDropdown-months {
  color: var(--neon-cyan) !important;
  font-family: 'Orbitron', sans-serif !important;
  font-size: 0.8rem !important;
}
.flatpickr-monthDropdown-months { background: var(--bg-card) !important; }
.flatpickr-prev-month, .flatpickr-next-month { fill: var(--text-muted) !important; }
.flatpickr-prev-month:hover svg, .flatpickr-next-month:hover svg { fill: var(--neon-cyan) !important; }
.flatpickr-weekdays { background: transparent !important; }
span.flatpickr-weekday {
  background: transparent !important;
  color: var(--text-muted) !important;
  font-size: 0.72rem !important;
}
.flatpickr-day {
  color: var(--text-primary) !important;
  border-radius: 8px !important;
  border: 1px solid transparent !important;
}
.flatpickr-day:hover {
  background: rgba(0,245,255,0.1) !important;
  border-color: rgba(0,245,255,0.3) !important;
}
.flatpickr-day.selected, .flatpickr-day.selected:hover {
  background: var(--neon-cyan) !important;
  border-color: var(--neon-cyan) !important;
  color: #000 !important;
  font-weight: 700 !important;
}
.flatpickr-day.today { border-color: rgba(0,245,255,0.4) !important; }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay {
  color: rgba(255,255,255,0.15) !important;
}

/* ── Cookie banner ── */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 3000;
  background: var(--bg-card);
  border: 1px solid rgba(0,245,255,0.2);
  border-radius: 14px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 600px;
  width: calc(100% - 48px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,245,255,0.06);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.cookie-banner.show { transform: translateX(-50%) translateY(0); }
.cookie-banner-text { flex: 1; font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.cookie-banner-text strong { color: var(--text-primary); }
.cookie-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 600px) {
  .cookie-banner { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px 18px; bottom: 16px; }
  .cookie-banner-actions { justify-content: center; }
  .cookie-banner-actions .btn { flex: 1; justify-content: center; }
}

/* ── Toggle switch ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 0.9rem; font-weight: 600; }
.toggle-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid transparent;
  box-sizing: border-box;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(0,245,255,0.2); border: 1px solid var(--neon-cyan); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateY(-50%) translateX(20px); background: var(--neon-cyan); box-shadow: 0 0 8px var(--neon-cyan); }

/* ── Font size slider ── */
.pref-slider {
  width: 100%;
  accent-color: var(--neon-cyan);
  cursor: pointer;
  margin-top: 8px;
}

/* ── Accent color picker ── */
.accent-options {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.accent-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.accent-swatch:hover { transform: scale(1.15); }
.accent-swatch.active { border-color: #fff; transform: scale(1.15); }

/* ── Prefs locked overlay ── */
.prefs-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.prefs-locked i { font-size: 1.8rem; opacity: 0.4; }

/* ── High contrast mode ── */
body.high-contrast {
  --text-muted: #c8d8f0;
}
[data-theme="light"] body.high-contrast {
  --text-muted:   #1a2a4a;
  --text-primary: #000000;
  --bg-card:      #ffffff;
  --border:       #7a8fbb;
}

/* ── Avatar picker ── */
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.avatar-option input { display: none; }
.avatar-preview {
  width: 50px; height: 50px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.avatar-option input:checked + .avatar-preview {
  border-color: var(--neon-cyan);
  background: rgba(0,245,255,0.1);
  color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0,245,255,0.3);
}
.avatar-preview:hover {
  border-color: var(--neon-cyan);
  transform: scale(1.05);
}

#current-avatar:hover {
  transform: scale(1.05);
  border-color: var(--neon-cyan);
}

.avatar-icon-opt.selected {
  border-color: var(--neon-cyan) !important;
  background: rgba(0,245,255,0.1) !important;
  color: var(--neon-cyan) !important;
  box-shadow: 0 0 12px rgba(0,245,255,0.3);
}

.avatar-icon-opt:hover {
  border-color: var(--neon-cyan);
  transform: scale(1.05);
}

.avatar-color-opt.selected {
  border-color: #fff !important;
  transform: scale(1.15);
  box-shadow: 0 0 16px currentColor !important;
}

.avatar-color-opt:hover {
  transform: scale(1.1);
}

/* ── Color picker ── */
.color-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.color-option input { display: none; }
.color-swatch {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.color-option input:checked + .color-swatch {
  border-color: #fff;
  transform: scale(1.15);
  box-shadow: 0 0 16px currentColor;
}
.color-swatch:hover {
  transform: scale(1.1);
}

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
}

.auth-glow-1 {
  width: 500px; height: 500px;
  top: -100px; left: -100px;
  background: radial-gradient(circle, var(--neon-cyan), transparent 70%);
}

.auth-glow-2 {
  width: 400px; height: 400px;
  bottom: -80px; right: -80px;
  background: radial-gradient(circle, var(--neon-purple), transparent 70%);
}

.auth-card {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,245,255,0.06);
  animation: slide-up 0.4s ease forwards;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo .logo-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 6px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-logo .logo-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 4px;
}

.auth-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.auth-form { display: flex; flex-direction: column; gap: 0; }

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.auth-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 5px;
  letter-spacing: 0.3px;
}



/* ── Share view responsive ── */
@media (max-width: 900px) {
  .share-container { padding: 20px 16px; }
  .share-container .panels-grid { grid-template-columns: 1fr; }
  .share-container .stats-table-wrapper { overflow-x: auto; }
  .share-container .bracket-round { min-width: 150px; }
}

@media (max-width: 600px) {
  .share-container { padding: 14px 10px; }
  .share-container h1 { font-size: 1.2rem !important; letter-spacing: 1px !important; }
  .share-container .page-header { padding: 0; margin-bottom: 16px; }
  .share-container .badge { font-size: 0.65rem !important; }
  .share-container .panel-header { padding: 12px 14px; }
  .share-container .panel-body { padding: 4px 0; }
  .share-container .list-item { padding: 9px 12px; }
  .share-container .stats-table th,
  .share-container .stats-table td { padding: 6px 8px; font-size: 0.78rem; }
  .share-container .winrate-bar { min-width: 50px; }
  .share-container .avatar { width: 28px; height: 28px; font-size: 0.65rem; }
  .share-container .bracket-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .share-container .bracket-match { min-width: 130px; }
  .share-container .match-name { font-size: 0.75rem; }
}
