/* E-Nexus - Design System
   Dark + premium esports: neon brand, technical grid, mono accents.
   Variables -> base -> primitives -> shell -> utilities -> legacy.

   Responsive breakpoints (desktop-first, max-width):
     480px  - very small mobile (iPhone SE, narrow phones)
     768px  - mobile / tablet portrait (sidebar drawer kicks in)
     1024px - tablet landscape / small desktop (multi-column grids stack)
*/

/* ======== FONTS ======== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ======== VARIABLES ======== */
:root {
  /* Surface scale */
  --bg-0: #07070b;
  --bg-1: #0c0c14;
  --bg-2: #11111c;
  --bg-3: #181826;
  --bg-4: #1f1f30;
  --line-1: rgba(255,255,255,0.06);
  --line-2: rgba(255,255,255,0.10);
  --line-3: rgba(255,255,255,0.18);

  /* Text */
  --fg-0: #f5f5fa;
  --fg-1: #c8c8d4;
  --fg-2: #8c8c9e;
  --fg-3: #5a5a6e;

  /* Brand */
  --brand: #7c3aed;
  --brand-hi: #a78bfa;
  --brand-deep: #4c1d95;
  --brand-glow: rgba(124,58,237,0.45);
  --accent: #22d3ee;
  --ok: #34d399;
  --warn: #f59e0b;
  --err: #f87171;

  /* Type */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', ui-sans-serif, sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Geometry */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --topbar-h: 56px;
  --sidebar-w: 64px;
  --sidebar-w-expanded: 232px;

  /* Shadows */
  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 1px 2px rgba(0,0,0,0.3);
  --shadow-2: 0 12px 40px -12px rgba(0,0,0,0.6);
}

/* ======== RESET / BASE ======== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--fg-0);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

/* ======== BOOTSTRAP DARK OVERRIDES ======== */
[data-bs-theme="dark"] {
  --bs-primary: #7c3aed;
  --bs-primary-rgb: 124, 58, 237;
  --bs-link-color: var(--brand-hi);
  --bs-link-hover-color: #c4b5fd;
  --bs-body-bg: var(--bg-0);
  --bs-body-color: var(--fg-0);
  --bs-border-color: rgba(255,255,255,0.10);
}

/* ======== TYPE ======== */
.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--fg-0);
  margin: 0;
}
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-hi);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: currentColor;
  display: inline-block;
}
.page-sub { color: var(--fg-2); font-size: 14px; margin: 6px 0 0; max-width: 56ch; }
.mono-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.muted { color: var(--fg-2); }
.faint { color: var(--fg-3); }
.hi { color: var(--fg-0); }

/* ======== LAYOUT SHELL ======== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.app-shell.sidebar-expanded {
  grid-template-columns: var(--sidebar-w-expanded) minmax(0, 1fr);
}
.app-content { padding: 32px 40px 80px; min-width: 0; }

/* ======== SIDEBAR ======== */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  border-right: 1px solid var(--line-1);
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  transition: width 220ms cubic-bezier(.2,.7,.2,1);
  overflow: hidden;
  z-index: 40;
}
.sidebar.expanded { width: var(--sidebar-w-expanded); }

.sb-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 10px;
  border-bottom: 1px solid var(--line-1);
  flex-shrink: 0;
  text-decoration: none;
}
.sb-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 14px var(--brand-glow);
}
.sb-brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--fg-0);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 180ms, transform 180ms;
}
.sb-brand-word span { color: var(--fg-3); font-weight: 600; }
.sidebar.expanded .sb-brand-word { opacity: 1; transform: none; }

.sb-toggle {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--fg-2);
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 180ms;
}
.sidebar.expanded .sb-toggle { opacity: 1; }
.sb-toggle:hover { background: var(--bg-3); color: var(--fg-0); }

.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.sb-section {
  padding: 14px 12px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-3);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 180ms;
}
.sidebar.expanded .sb-section { opacity: 1; }
.sidebar:not(.expanded) .sb-section {
  padding: 14px 0 6px;
  text-align: center;
}
.sidebar:not(.expanded) .sb-section::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: var(--line-2);
  margin: 0 auto;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  height: 38px;
  border-radius: 8px;
  color: var(--fg-2);
  white-space: nowrap;
  position: relative;
  transition: background 120ms, color 120ms;
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
}
.sb-item:hover { background: var(--bg-3); color: var(--fg-0); }
.sb-item.active {
  background: linear-gradient(90deg, rgba(124,58,237,0.22), rgba(124,58,237,0.06));
  color: var(--fg-0);
}
.sb-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--brand-hi);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 12px var(--brand-glow);
}
.sb-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.sb-label {
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 180ms, transform 180ms;
}
.sidebar.expanded .sb-label { opacity: 1; transform: none; }

.sb-tip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-4);
  color: var(--fg-0);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  box-shadow: var(--shadow-2);
  opacity: 0;
  transition: opacity 120ms;
}
.sb-item:hover .sb-tip { opacity: 1; }
.sidebar.expanded .sb-tip { display: none !important; }

.sb-foot {
  border-top: 1px solid var(--line-1);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ======== TOPBAR ======== */
.topbar {
  height: var(--topbar-h);
  background: rgba(7,7,11,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-1);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-2);
}
.topbar-crumb b { color: var(--fg-0); font-weight: 600; }
.topbar-spacer { flex: 1; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  color: var(--fg-1);
  text-decoration: none;
}
.topbar-user:hover { border-color: var(--line-3); background: var(--bg-3); }
.topbar-user-name { font-size: 13px; font-weight: 500; color: var(--fg-0); }
.topbar-user-team { font-size: 11px; color: var(--fg-2); font-family: var(--font-mono); }

/* ======== MOBILE MENU ======== */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--fg-0);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: background 160ms, border-color 160ms, transform 80ms;
  flex-shrink: 0;
}
.mobile-menu-toggle:hover { background: var(--bg-3); border-color: var(--line-3); }
.mobile-menu-toggle:active { transform: scale(0.96); }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 45;
}
.sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
body.sidebar-locked { overflow: hidden; }

/* ======== AVATAR ======== */
.avatar {
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  line-height: 1;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-md { width: 32px; height: 32px; font-size: 12px; }

/* ======== DESIGN SYSTEM BUTTONS ======== */
.eva-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.005em;
  transition: background 120ms, border-color 120ms, color 120ms;
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  font-family: var(--font-sans);
  cursor: pointer;
}
.eva-btn-primary {
  background: linear-gradient(180deg, var(--brand-hi) 0%, var(--brand) 100%);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 6px 18px -6px var(--brand-glow);
}
.eva-btn-primary:hover { filter: brightness(1.08); color: #fff; }
.eva-btn-secondary {
  background: var(--bg-3);
  color: var(--fg-0);
  border-color: var(--line-2);
}
.eva-btn-secondary:hover { background: var(--bg-4); border-color: var(--line-3); color: var(--fg-0); }
.eva-btn-ghost { background: transparent; color: var(--fg-1); }
.eva-btn-ghost:hover { background: var(--bg-2); color: var(--fg-0); }
.eva-btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.eva-btn-lg { height: 44px; padding: 0 20px; font-size: 14px; border-radius: 10px; }

/* ======== DESIGN SYSTEM INPUTS ======== */
.eva-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  height: 38px;
  padding: 0 12px;
  color: var(--fg-0);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: 0;
  transition: border-color 120ms, box-shadow 120ms;
}
.eva-input:focus {
  border-color: var(--brand-hi);
  box-shadow: 0 0 0 3px var(--brand-glow);
  background: var(--bg-3);
}
.eva-input::placeholder { color: var(--fg-3); }

/* ======== DESIGN SYSTEM CARD ======== */
.eva-card {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

/* ======== PILL ======== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  color: var(--fg-1);
}
.pill.brand { background: rgba(124,58,237,0.15); border-color: rgba(124,58,237,0.35); color: var(--brand-hi); }
.pill.ok { background: rgba(52,211,153,0.12); border-color: rgba(52,211,153,0.30); color: var(--ok); }
.pill.warn { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.30); color: var(--warn); }
.pill.err { background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.30); color: var(--err); }

/* ======== STAT ======== */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); }
.stat-num { font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--fg-0); letter-spacing: -0.02em; }

/* ======== PAGE HEADER ======== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-1);
}

/* ======== UTILITIES ======== */
.ds-row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ======== DIVIDER ======== */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 20px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-1);
}

/* ======== FIELD ======== */
.eva-field { margin-bottom: 14px; }
.eva-field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-1);
  margin-bottom: 6px;
}

/* ======== SCROLLBAR ======== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 5px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); }

/* ======== RESPONSIVE ======== */
@media (max-width: 1024px) {
  .app-content { padding: 20px 16px 60px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar { padding: 0 12px; }
  .app-shell { grid-template-columns: 56px 1fr; }
  :root { --sidebar-w: 56px; }
}
@media (max-width: 768px) {
  .app-shell,
  .app-shell.sidebar-expanded { grid-template-columns: 1fr; }
  .app-content { padding: 20px 16px 80px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 16px; }

  .mobile-menu-toggle { display: inline-flex; }

  .sidebar,
  .sidebar.expanded {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: min(280px, 85vw);
    transform: translateX(-100%);
    transition: transform 240ms cubic-bezier(.2,.7,.2,1);
    z-index: 50;
    box-shadow: 8px 0 32px rgba(0,0,0,0.4);
  }
  .sidebar.mobile-open,
  .sidebar.expanded.mobile-open { transform: translateX(0); }

  .sidebar .sb-label { opacity: 1; transform: none; }
  .sidebar .sb-tip { display: none !important; }
  .sidebar .sb-brand-word { opacity: 1; }

  #sidebarToggle { display: none; }
}

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 16px 40px;
  border-bottom: 1px solid var(--line-1);
  background: rgba(7,7,11,0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 32px;
}
.landing-topbar nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13px;
  color: var(--fg-1);
}
.landing-topbar nav a:hover { color: var(--fg-0); }
.landing-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-hero {
  position: relative;
  padding: 120px 40px;
  overflow: hidden;
  text-align: center;
}
.landing-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) brightness(0.65) contrast(0.95);
  pointer-events: none;
}
.landing-hero-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, rgba(11,15,26,0.25) 0%, rgba(11,15,26,0.50) 70%, rgba(11,15,26,0.65) 100%);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .landing-hero-video { display: none; }
}
.landing-hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(124,58,237,0.18) 0%, transparent 60%);
}
.landing-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 80%);
}
.landing-hero-content {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
}
.landing-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--fg-0);
  margin: 20px 0;
}
.landing-hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-hero .hero-sub {
  font-size: 19px;
  color: var(--fg-2);
  max-width: 620px;
  margin: 0 auto 36px;
  line-height: 1.5;
}
.landing-hero .hero-note {
  font-size: 12px;
  color: var(--fg-3);
  margin-top: 14px;
}

.landing-features {
  padding: 120px 40px;
}
.landing-features-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.landing-features-title {
  text-align: center;
  margin-bottom: 64px;
}
.landing-features-title h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  max-width: 780px;
  margin: 0 auto;
  line-height: 1.05;
}
.landing-features-title h2 span { color: var(--fg-3); }
.landing-feat-grid-top {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.landing-feat-grid-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.landing-feat-card {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
  min-height: 220px;
}
.landing-feat-card.big {
  min-height: 320px;
  background: linear-gradient(160deg, rgba(124,58,237,0.06) 0%, var(--bg-1) 60%);
}
.landing-feat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  color: var(--brand-hi);
  margin-bottom: 16px;
  font-size: 16px;
}
.landing-feat-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--fg-0);
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.landing-feat-card.big h3 { font-size: 24px; }
.landing-feat-card:not(.big) h3 { font-size: 18px; }
.landing-feat-card p {
  font-size: 13px;
  color: var(--fg-2);
  line-height: 1.55;
  max-width: 360px;
  margin: 0;
}

.landing-feat-card.has-media {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.landing-feat-card.has-media .landing-feat-body {
  flex: 0 0 auto;
}
.landing-feat-card.has-media .landing-feat-media {
  position: relative;
  flex: 1 1 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line-1);
  background: var(--bg-2);
  min-height: 160px;
}
.landing-feat-card.has-media .landing-feat-media img,
.landing-feat-card.has-media .landing-feat-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.landing-feat-card.big.has-media .landing-feat-media {
  min-height: 220px;
}
.landing-feat-card.big.has-media .landing-feat-media-video {
  background: #000;
}
.landing-feat-card.big.has-media .landing-feat-media-video video {
  object-fit: contain;
  object-position: center;
}
button.landing-feat-media {
  appearance: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: zoom-in;
}
.landing-feat-media-zoom {
  transition: border-color 0.15s ease, transform 0.2s ease;
}
.landing-feat-media-zoom:hover {
  border-color: var(--brand-hi);
}
.landing-feat-media-zoom:hover img {
  transform: scale(1.02);
}
.landing-feat-media-zoom img {
  transition: transform 0.3s ease;
}
.landing-feat-media-zoom-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(10, 10, 14, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  color: var(--fg-0);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.landing-feat-media-zoom:hover .landing-feat-media-zoom-icon,
.landing-feat-media-zoom:focus-visible .landing-feat-media-zoom-icon {
  opacity: 1;
}

/* Landing lightbox dialog */
.landing-lightbox {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 96vw;
  max-height: 96vh;
  width: auto;
  height: auto;
  overflow: visible;
  color: var(--fg-0);
}
.landing-lightbox::backdrop {
  background: rgba(5, 5, 10, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.landing-lightbox img {
  display: block;
  max-width: 96vw;
  max-height: 96vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.landing-lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  color: var(--fg-0);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.landing-lightbox-close:hover {
  background: var(--bg-2);
  transform: scale(1.05);
}

.landing-pricing {
  padding: 120px 40px;
  border-top: 1px solid var(--line-1);
}
.landing-pricing-inner {
  max-width: 980px;
  margin: 0 auto;
}
.landing-pricing-title {
  text-align: center;
  margin-bottom: 56px;
}
.landing-pricing-title h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 16px;
}
.landing-pricing-title h2 span { color: var(--fg-3); }
.landing-pricing-title p {
  font-size: 17px;
  color: var(--fg-2);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.5;
}
.landing-pricing-card {
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(124,58,237,0.08) 0%, var(--bg-1) 60%);
  padding: 40px;
}
.landing-pricing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.landing-pricing-feat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.30);
  display: grid;
  place-items: center;
  color: var(--brand-hi);
  margin-bottom: 14px;
  font-size: 16px;
}
.landing-pricing-feat h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--fg-0);
  margin: 0 0 6px;
}
.landing-pricing-feat p {
  font-size: 13px;
  color: var(--fg-2);
  line-height: 1.5;
  margin: 0;
}
.landing-pricing-footer {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.landing-cta {
  padding: 120px 40px;
}
.landing-cta-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 40px;
  border-radius: 24px;
  border: 1px solid var(--line-3);
  background: linear-gradient(135deg, rgba(124,58,237,0.18) 0%, rgba(34,211,238,0.10) 100%), var(--bg-1);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.landing-cta-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  max-width: 700px;
  margin: 0 auto 16px;
  line-height: 1.05;
}
.landing-cta-inner p {
  font-size: 16px;
  color: var(--fg-2);
  max-width: 480px;
  margin: 0 auto 32px;
}

.landing-footer {
  padding: 60px 40px 40px;
  border-top: 1px solid var(--line-1);
}
.landing-footer-grid {
  max-width: 1200px;
  margin: 0 auto 40px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}
.landing-footer-brand p {
  font-size: 12px;
  color: var(--fg-3);
  max-width: 280px;
  margin-top: 14px;
}
.landing-footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.landing-footer-col li { font-size: 13px; color: var(--fg-2); }
.landing-footer-col li a { color: var(--fg-2); }
.landing-footer-col li a:hover { color: var(--fg-0); }
.landing-footer-bottom {
  border-top: 1px solid var(--line-1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--fg-3);
  font-family: var(--font-mono);
  max-width: 1200px;
  margin: 0 auto;
}
.landing-footer-bottom a { color: var(--fg-2); }
.landing-footer-bottom a:hover { color: var(--fg-0); }

/* App footer (logged-in app, login, register) */
.app-footer {
  border-top: 1px solid var(--line-1);
  padding: 24px 28px;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 12px;
  color: var(--fg-3);
}
.app-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.app-footer-links a {
  color: var(--fg-2);
  font-size: 13px;
  text-decoration: none;
}
.app-footer-links a:hover { color: var(--fg-0); }
.app-footer-bottom {
  border-top: 1px solid var(--line-1);
  padding-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
}
.app-footer-bottom a { color: var(--fg-2); }
.app-footer-bottom a:hover { color: var(--fg-0); }
@media (max-width: 768px) {
  .app-footer { padding: 20px 16px; }
  .app-footer-bottom { flex-direction: column; gap: 8px; }
}

/* Landing responsive */
@media (max-width: 1024px) {
  .landing-topbar { padding: 16px 20px; gap: 16px; }
  .landing-topbar nav { display: none; }
  .landing-hero { padding: 60px 20px; }
  .landing-feat-grid-top,
  .landing-feat-grid-bottom { grid-template-columns: 1fr; }
  .landing-pricing-features { grid-template-columns: 1fr; }
  .landing-features { padding: 60px 20px; }
  .landing-pricing { padding: 60px 20px; }
  .landing-cta { padding: 60px 20px; }
  .landing-cta-inner { padding: 40px 20px; }
  .landing-footer-grid { grid-template-columns: 1fr; }
  .landing-footer { padding: 40px 20px 20px; }
  .landing-footer-bottom { flex-direction: column; gap: 8px; }
  .landing-pricing-footer { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .landing-topbar { gap: 12px; }
  .landing-topbar-actions { flex-direction: column; align-items: stretch; gap: 6px; }
  .landing-topbar-actions .eva-btn { white-space: nowrap; }
}

/* ============================================================
   AUTH SHELL (login / register split-screen)
   ============================================================ */
.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-0);
  color: var(--fg-0);
}
.auth-left {
  padding: 40px;
  display: flex;
  flex-direction: column;
}
.auth-left-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.auth-left-form {
  flex: 1;
  display: grid;
  place-items: center;
}
.auth-left-form-inner {
  width: 100%;
  max-width: 400px;
}
.auth-left-form-inner h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.auth-left-form-inner .auth-sub {
  color: var(--fg-2);
  font-size: 14px;
  margin: 0 0 28px;
}
.auth-left-footer {
  font-size: 12px;
  color: var(--fg-3);
  text-align: center;
}
.auth-left-footer a { color: var(--brand-hi); }

.auth-right {
  position: relative;
  background: var(--bg-2);
  border-left: 1px solid var(--line-2);
  overflow: hidden;
}
.auth-right-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124,58,237,0.30) 0%, rgba(7,7,11,0.85) 70%);
}
.auth-right-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
.auth-right-content {
  position: absolute;
  inset: 0;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.auth-right-content blockquote {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--fg-0);
  letter-spacing: -0.01em;
  line-height: 1.2;
  max-width: 460px;
  margin: 14px 0 0;
}

@media (max-width: 1024px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-right { display: none; }
  .auth-left { padding: 24px; }
}

@media (max-width: 480px) {
  .auth-left { padding: 16px; gap: 12px; }
  .auth-left-form { padding: 8px 0; }
  .auth-left-form-inner h1 { font-size: 28px; margin-bottom: 6px; }
  .auth-left-form-inner .auth-sub { margin-bottom: 18px; }
  .auth-divider { margin: 14px 0; }
  .eva-field { margin-bottom: 10px; }
}

/* ============================================================
   BOOTSTRAP COMPAT - Keep Bootstrap classes working
   ============================================================ */
.btn-primary {
  background: linear-gradient(180deg, var(--brand-hi) 0%, var(--brand) 100%) !important;
  border-color: rgba(167,139,250,0.40) !important;
  color: #fff !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 6px 18px -6px var(--brand-glow);
}
.btn-primary:hover {
  filter: brightness(1.08);
  background: linear-gradient(180deg, var(--brand-hi) 0%, var(--brand) 100%) !important;
  border-color: rgba(167,139,250,0.50) !important;
}
.btn-primary:active,
.btn-primary:focus {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%) !important;
  border-color: var(--brand) !important;
}

.btn-outline-primary {
  color: var(--brand-hi) !important;
  border-color: var(--brand-hi) !important;
  background-color: transparent !important;
}
.btn-outline-primary:hover {
  background-color: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}

.badge.bg-primary { background-color: var(--brand) !important; }
.border-primary { border-color: var(--brand) !important; }

/* Form inputs dark styling */
.form-control,
.form-select {
  background-color: var(--bg-2);
  border-color: var(--line-2);
  color: var(--fg-0);
}
.form-control:focus,
.form-select:focus {
  background-color: var(--bg-3);
  border-color: var(--brand-hi);
  color: var(--fg-0);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

/* Accordion dark fix */
.accordion-button:not(.collapsed) {
  background-color: rgba(124,58,237,0.15);
  color: var(--fg-0);
}
.accordion-button::after { filter: invert(1); }
.accordion-button:focus { box-shadow: none; }

/* Video player */
video { max-height: 80vh; background-color: #000; }

/* ============================================================
   EXISTING FEATURE STYLES (preserved)
   ============================================================ */

/* Card hover effect */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

/* Planning grid */
.planning-cell {
  cursor: pointer;
  transition: background-color 0.15s ease;
  min-width: 80px;
  position: relative;
}
.planning-cell:hover { filter: brightness(1.2); }
.planning-cell.is-loading { pointer-events: none; }
.planning-cell.level-full { background-color: rgba(25, 135, 84, 0.3) !important; }
.planning-cell.level-majority { background-color: rgba(255, 193, 7, 0.2) !important; }
.planning-cell.level-few { background-color: rgba(220, 53, 69, 0.25) !important; }
.planning-cell.slot-off-peak {
  border-left: 3px solid rgba(108, 117, 125, 0.6) !important;
  opacity: 0.7;
}
.planning-cell.slot-off-peak:hover { opacity: 1; }

.planning-users {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-top: 2px;
}
.planning-users span { font-size: 0.6rem; line-height: 1.1; color: #a0a0b0; }
.planning-session-link {
  font-size: 0.65rem !important;
  padding: 1px 5px !important;
  margin-top: 3px;
  line-height: 1.3;
}

/* Planning mobile view */
.planning-mobile-tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.planning-mobile-tabs::-webkit-scrollbar { display: none; }
.planning-mobile-tabs .btn {
  min-width: 0;
  white-space: nowrap;
  font-size: 0.78rem;
  padding: 6px 2px;
}
.planning-mobile-slot {
  border-radius: 8px;
  min-height: 48px;
  margin-bottom: 6px;
  border: 1px solid rgba(63, 63, 70, 0.5);
}
.planning-mobile-slot:active { filter: brightness(1.2); }
.planning-mobile-time { min-width: 48px; font-size: 0.95rem; }
.planning-mobile-users {
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 4px !important;
  justify-content: flex-end;
}
.planning-mobile-users span { font-size: 0.85rem; }
.planning-mobile-slot i.bi-check-circle-fill,
.planning-mobile-slot i.bi-circle {
  font-size: 1.2rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Planning read-only mode (other room) */
.planning-readonly .planning-cell {
  cursor: default;
}
.planning-readonly .planning-cell:hover {
  filter: none;
}
.planning-readonly .planning-mobile-slot:active {
  filter: none;
}

/* Avatar navbar (legacy) */
.avatar-navbar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* Animated Strategy */
.animated-strategy-map-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 0.375rem;
}
.animated-strategy-map-container img {
  width: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.animated-strategy-player-marker {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--brand-hi);
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 10;
  transition: box-shadow 0.15s ease;
  user-select: none;
}
.animated-strategy-player-marker:hover {
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}
.animated-strategy-player-marker.is-view { cursor: default; }
.animated-strategy-player-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
}
.animated-strategy-player-initials {
  font-size: 0.65rem;
  font-weight: bold;
  color: var(--fg-0);
  pointer-events: none;
}
.animated-strategy-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--fg-0);
  font-size: 0.8rem;
  cursor: grab;
  user-select: none;
  transition: border-color 0.15s ease;
}
.animated-strategy-member-chip:hover { border-color: var(--brand-hi); }
.animated-strategy-member-chip img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}
.animated-strategy-member-chip .chip-initials {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: bold;
}
.animated-strategy-remove-zone {
  border: 2px dashed var(--err);
  border-radius: 0.375rem;
  padding: 12px;
  text-align: center;
  color: var(--err);
  font-size: 0.85rem;
  transition: background-color 0.15s ease;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.animated-strategy-remove-zone.drag-over {
  background-color: rgba(248, 113, 113, 0.15);
}
.animated-strategy-step-tab { min-width: 40px; }
.animated-strategy-step-tab.active {
  background-color: var(--brand) !important;
  border-color: var(--brand) !important;
}

/* Grenade markers */
.animated-strategy-grenade-marker {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  transform: translate(-50%, -50%);
  border: 2px solid #e85d2c;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 10;
  transition: box-shadow 0.15s ease;
  user-select: none;
  gap: 0;
}
.animated-strategy-grenade-marker:hover {
  box-shadow: 0 0 10px rgba(232, 93, 44, 0.5);
}
.animated-strategy-grenade-marker.is-view { cursor: default; }
.grenade-type-classic { border-color: #e85d2c; }
.grenade-type-classic:hover { box-shadow: 0 0 10px rgba(232, 93, 44, 0.5); }
.grenade-type-sticky { border-color: #3b82f6; }
.grenade-type-sticky:hover { box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }
.grenade-type-sonar { border-color: #22c55e; }
.grenade-type-sonar:hover { box-shadow: 0 0 10px rgba(34, 197, 94, 0.5); }
.animated-strategy-grenade-label {
  font-size: 0.5rem;
  font-weight: bold;
  color: var(--fg-0);
  line-height: 1;
  pointer-events: none;
}
.animated-strategy-grenade-type-icon {
  font-size: 0.5rem;
  line-height: 1;
  pointer-events: none;
}
.animated-strategy-grenade-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #e85d2c;
  background: var(--bg-2);
  color: var(--fg-0);
  font-size: 0.75rem;
  cursor: grab;
  user-select: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.animated-strategy-grenade-chip:hover {
  background-color: rgba(232, 93, 44, 0.15);
}
.animated-strategy-grenade-type-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  gap: 4px;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.animated-strategy-grenade-type-popover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--line-2);
}
.animated-strategy-grenade-type-btn {
  border: none;
  background: transparent;
  color: var(--fg-0);
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.animated-strategy-grenade-type-btn:hover {
  background: rgba(167, 139, 250, 0.2);
}
.animated-strategy-grenade-type-btn.active {
  background: rgba(167, 139, 250, 0.3);
}
.animated-strategy-grenade-remove-btn {
  color: #ef4444;
  border-left: 1px solid var(--line-2);
  margin-left: 2px;
  padding-left: 10px;
}
.animated-strategy-grenade-remove-btn:hover {
  background: rgba(239, 68, 68, 0.2) !important;
}

/* Legend */
.animated-strategy-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
}
.animated-strategy-legend-marker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--brand-hi);
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.animated-strategy-legend-marker img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.animated-strategy-legend-initials {
  font-size: 0.55rem;
  font-weight: bold;
  color: var(--fg-0);
}
.animated-strategy-legend-name {
  font-size: 0.85rem;
  color: var(--fg-0);
}

/* Shooting line markers */
.animated-strategy-shootingline-marker {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 10;
  transition: box-shadow 0.15s ease;
  user-select: none;
}
.animated-strategy-shootingline-marker:hover {
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}
.animated-strategy-shootingline-marker.is-view { cursor: default; }
.animated-strategy-shootingline-label {
  font-size: 0.45rem;
  font-weight: bold;
  color: #f59e0b;
  line-height: 1;
  pointer-events: none;
}
.animated-strategy-shootingline-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #f59e0b;
  background: var(--bg-2);
  color: var(--fg-0);
  font-size: 0.75rem;
  cursor: grab;
  user-select: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.animated-strategy-shootingline-chip:hover {
  background-color: rgba(245, 158, 11, 0.15);
}

/* Team editable badge */
.animated-strategy-team-badge {
  background-color: var(--brand-hi) !important;
  color: #fff;
  font-size: 0.7rem;
  vertical-align: middle;
}

.animated-strategy-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* Markdown body styling */
.markdown-body { line-height: 1.7; color: var(--fg-0); }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  color: var(--fg-0);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 0.3em;
}
.markdown-body h1 { font-size: 1.8rem; }
.markdown-body h2 { font-size: 1.5rem; }
.markdown-body h3 { font-size: 1.25rem; }
.markdown-body p { margin-bottom: 1em; }
.markdown-body a { color: var(--brand-hi); }
.markdown-body a:hover { color: #c4b5fd; }
.markdown-body code {
  background-color: var(--bg-2);
  color: var(--brand-hi);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}
.markdown-body pre {
  background-color: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 1em;
  overflow-x: auto;
}
.markdown-body pre code { background: none; padding: 0; color: var(--fg-0); }
.markdown-body blockquote {
  border-left: 4px solid var(--brand);
  padding-left: 1em;
  margin-left: 0;
  color: var(--fg-2);
}
.markdown-body table { width: 100%; border-collapse: collapse; margin-bottom: 1em; }
.markdown-body th, .markdown-body td { border: 1px solid var(--line-2); padding: 0.5em 0.75em; }
.markdown-body th { background-color: var(--bg-2); font-weight: 600; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5em; margin-bottom: 1em; }
.markdown-body li { margin-bottom: 0.25em; }
.markdown-body input[type="checkbox"] { margin-right: 0.5em; }
.markdown-body del { color: var(--fg-2); }
.markdown-body hr { border: none; border-top: 1px solid var(--line-2); margin: 1.5em 0; }
.markdown-body img { max-width: 100%; border-radius: 6px; }

/* OAuth buttons */
.btn-oauth-discord {
  background-color: #5865F2;
  border-color: #5865F2;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-oauth-discord:hover {
  background-color: #4752C4;
  border-color: #4752C4;
  color: #fff;
}
.btn-oauth-google {
  background-color: #fff;
  border-color: #dadce0;
  color: #3c4043;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-oauth-google:hover {
  background-color: #f8f9fa;
  border-color: #dadce0;
  color: #3c4043;
}

/* ============================================================
   REPLAYS
   ============================================================ */

/* --- Listing toolbar --- */
.replays-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 14px 16px;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-lg);
}
.room-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.room-picker select {
  background: var(--bg-2);
  color: var(--fg-0);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  min-width: 220px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-2) 50%),
                    linear-gradient(135deg, var(--fg-2) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.room-picker select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.replays-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.replays-stats .stat-num { font-size: 22px; }

/* --- Replay grid --- */
.replay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.replay-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.replay-card:hover {
  border-color: rgba(124,58,237,0.45);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  color: inherit;
}
.replay-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(124,58,237,0.30) 0%, transparent 60%),
    linear-gradient(135deg, var(--bg-3) 0%, var(--bg-2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line-1);
  overflow: hidden;
}
.replay-card-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line-1) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-1) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.6;
  pointer-events: none;
}
.replay-card-thumb i {
  font-size: 56px;
  color: var(--fg-0);
  opacity: 0.85;
  filter: drop-shadow(0 4px 18px rgba(124,58,237,0.5));
  z-index: 1;
}
.replay-card-thumb .play-fab {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  opacity: 0;
  transition: opacity 160ms ease;
  background: rgba(7,7,11,0.45);
}
.replay-card-thumb .play-fab i {
  font-size: 48px;
  color: #fff;
  filter: none;
  opacity: 1;
}
.replay-card:hover .play-fab { opacity: 1; }
.replay-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.replay-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--fg-0);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.replay-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.replay-card-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* --- Empty state --- */
.replays-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-1);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-lg);
  color: var(--fg-2);
}
.replays-empty i { font-size: 56px; color: var(--fg-3); }
.replays-empty h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 12px 0 6px;
  color: var(--fg-1);
}

/* ============================================================
   REPLAY WATCH
   ============================================================ */

.watch-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-1);
}
.watch-header .watch-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.watch-header h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--fg-0);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.2;
}
.watch-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.watch-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
}
@media (max-width: 1024px) {
  .watch-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .watch-header { flex-direction: column; align-items: stretch; }
  .watch-actions { width: 100%; }
  .watch-actions .eva-btn { flex: 1; justify-content: center; }
}

.watch-player {
  background: #000;
  border: 1px solid var(--line-1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  position: relative;
}
.watch-player .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--fg-1);
  cursor: pointer;
  background:
    radial-gradient(80% 60% at 50% 40%, rgba(124,58,237,0.28) 0%, transparent 70%),
    #000;
  transition: background 200ms ease;
  text-align: center;
  padding: 16px;
}
.watch-player .placeholder:hover { background: radial-gradient(80% 60% at 50% 40%, rgba(124,58,237,0.45) 0%, transparent 70%), #000; }
.watch-player .placeholder i {
  font-size: 80px;
  color: #fff;
  filter: drop-shadow(0 6px 24px rgba(124,58,237,0.6));
  margin-bottom: 8px;
}
.watch-player .placeholder span {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-1);
}
.watch-player video { width: 100%; height: 100%; display: block; }

.notes-section {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 24px;
}
.notes-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-1);
  background: var(--bg-2);
}
.notes-section-head h2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--fg-0);
  letter-spacing: 0.01em;
}
.notes-section-body { padding: 18px; }
.notes-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--fg-2);
}
.notes-empty i { font-size: 32px; color: var(--fg-3); }

.note-item {
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.note-item:last-child { margin-bottom: 0; }
.note-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.note-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-hi);
}
.note-author .avatar { width: 26px; height: 26px; font-size: 11px; }
.note-author .team-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--fg-2);
  letter-spacing: 0.04em;
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}
.note-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.note-content {
  color: var(--fg-1);
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  margin: 0;
}

.my-note-card {
  background: var(--bg-1);
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: sticky;
  top: 16px;
}
.my-note-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-1);
  background: linear-gradient(135deg, rgba(124,58,237,0.18) 0%, rgba(124,58,237,0.04) 100%);
}
.my-note-card-head h2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--fg-0);
}
.my-note-card-body { padding: 16px 18px 18px; }
.my-note-card textarea {
  width: 100%;
  min-height: 160px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--fg-0);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  padding: 12px;
  resize: vertical;
}
.my-note-card textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.my-note-card .form-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.my-note-card .form-foot small {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============================================================
   CHAMPIONSHIP
   ============================================================ */

.championship-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 32px 0 12px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-1);
}

.championship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.championship-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color 160ms, transform 160ms, box-shadow 160ms;
}
.championship-card:hover {
  border-color: rgba(124, 58, 237, 0.45);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  color: inherit;
}
.championship-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.championship-card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 4px 0 0;
  color: var(--fg-0);
}
.championship-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}
.championship-card-date,
.championship-card-teams {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.championship-card-winner {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.10);
  border: 1px solid rgba(52, 211, 153, 0.30);
  color: var(--ok);
  font-size: 12px;
  font-weight: 600;
}

/* --- Format choice --- */
.format-choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.format-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg-2);
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
  font-size: 13px;
  color: var(--fg-1);
}
.format-choice input { accent-color: var(--brand-hi); }
.format-choice:has(input:checked) {
  border-color: var(--brand-hi);
  background: rgba(124, 58, 237, 0.10);
  color: var(--fg-0);
}

/* --- Team builder --- */
.team-builder {
  padding: 22px;
}
.team-builder-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-1);
}
.team-builder-tab {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--fg-1);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 120ms, background 120ms;
}
.team-builder-tab:hover { border-color: var(--line-3); color: var(--fg-0); }
.team-builder-tab.active {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.45);
  color: var(--brand-hi);
}

/* --- Autocomplete results --- */
.ac-results {
  position: relative;
  display: none;
  flex-direction: column;
  margin-top: 6px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg-2);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
  z-index: 20;
}
.ac-results.is-open { display: flex; }
.ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--fg-1);
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  border-bottom: 1px solid var(--line-1);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover,
.ac-item.is-active {
  background: var(--bg-3);
  color: var(--fg-0);
}
.ac-item-empty {
  cursor: default;
  color: var(--fg-3);
  font-style: italic;
}
.ac-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.ac-label { flex: 1; }
.ac-room {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.04em;
}

/* --- Roster chips --- */
.roster-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 40px;
  padding: 8px;
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
  border-radius: 8px;
}
.roster-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: 20px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  color: var(--fg-0);
  font-size: 12px;
}
.roster-chip-remove {
  background: transparent;
  border: none;
  color: var(--fg-3);
  cursor: pointer;
  padding: 0 2px;
  display: inline-flex;
}
.roster-chip-remove:hover { color: var(--err); }

/* --- Championship teams list (right column) --- */
.champ-teams-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.champ-team-card {
  padding: 14px 16px;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius);
}
.champ-team-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.champ-team-card-head strong { color: var(--fg-0); font-family: var(--font-display); }
.champ-team-roster {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* --- Matchmaking preview --- */
.preview-round {
  margin-bottom: 18px;
}
.preview-round-head {
  margin-bottom: 8px;
}
.preview-round-pairs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preview-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--radius);
}
.preview-pair-team strong { color: var(--fg-0); }
.preview-pair-vs {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--brand-hi);
  letter-spacing: 0.12em;
}
.preview-pair-bye { opacity: 0.85; }

/* --- Prize card --- */
.prize-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(124, 58, 237, 0.05));
  border-color: rgba(245, 158, 11, 0.25);
  padding: 18px 22px;
  margin-bottom: 20px;
}
.prize-card > i {
  font-size: 22px;
  color: var(--warn);
}
.prize-card p {
  color: var(--fg-1);
  font-size: 13px;
  line-height: 1.55;
}

/* --- Winner banner --- */
.champ-winner-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  margin-bottom: 24px;
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.18) 0%, rgba(52, 211, 153, 0.05) 100%);
  border: 1px solid rgba(52, 211, 153, 0.40);
  border-radius: var(--radius-lg);
  color: var(--fg-0);
}
.champ-winner-banner i { font-size: 22px; color: var(--ok); }
.champ-winner-banner span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-2); }
.champ-winner-banner strong { font-family: var(--font-display); font-size: 18px; }

/* --- Bracket (single elimination) --- */
.bracket-wrap {
  overflow-x: auto;
  padding: 16px 0;
}
.bracket {
  display: inline-flex;
  gap: 32px;
  padding: 16px 8px;
  min-width: 100%;
}
.bracket-round {
  display: flex;
  flex-direction: column;
  min-width: 220px;
}
.bracket-round-head {
  margin-bottom: 12px;
  text-align: center;
}
.bracket-round-matches {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 12px;
  flex: 1;
}
.bracket-match {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  overflow: hidden;
  min-height: 64px;
}
.bracket-match-side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--fg-1);
  border-bottom: 1px solid var(--line-1);
}
.bracket-match-side:last-child { border-bottom: none; }
.bracket-match-side.is-winner {
  color: var(--fg-0);
  background: rgba(52, 211, 153, 0.08);
  font-weight: 600;
}
.bracket-match-side.is-winner::before {
  content: '\F26B';
  font-family: 'bootstrap-icons';
  margin-right: 6px;
  color: var(--ok);
}
.bracket-match-team { flex: 1; }
.bracket-match-score {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--brand-hi);
}
.bracket-match-bye {
  opacity: 0.8;
  border-style: dashed;
}
.bracket-match-action {
  position: absolute;
  top: 6px;
  right: 6px;
  color: var(--brand-hi);
  background: var(--bg-3);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 12px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 120ms;
}
.bracket-match-action:hover { opacity: 1; color: var(--brand-hi); }
.bracket-match-action-edit { color: var(--fg-3); }

/* Bracket connectors */
.bracket-round:not(:last-child) .bracket-match::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -16px;
  width: 16px;
  border-top: 1px solid var(--line-3);
}
.bracket-round:not(:last-child) .bracket-match:nth-child(odd)::before {
  content: '';
  position: absolute;
  top: 50%;
  right: -16px;
  height: calc(100% + 12px);
  border-right: 1px solid var(--line-3);
}

@media (max-width: 768px) {
  .bracket { flex-direction: column; gap: 16px; }
  .bracket-round { min-width: 100%; }
  .bracket-match::after,
  .bracket-match::before { display: none !important; }
}

/* --- Round-robin --- */
.rr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rr-table th,
.rr-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-1);
}
.rr-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  background: var(--bg-2);
}
.rr-table tr:last-child td { border-bottom: none; }
.rr-table .rr-leader {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.10), transparent);
}
.rr-table .rr-leader strong { color: var(--ok); }

.rr-matchday {
  margin-bottom: 18px;
}
.rr-matchday-head { margin-bottom: 8px; }
.rr-matchday-matches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

/* --- Team generator --- */
.generator-teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.generator-team-card {
  padding: 14px;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius);
}
.generator-team-name {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-weight: 600;
}

/* ============================================================
   RESPONSIVE UTILITIES
   Reusable split layouts, table wrappers and visibility helpers.
   See breakpoint reference at the top of this file.
   ============================================================ */

.eva-split { display: grid; gap: 28px; }
.eva-split--feature-left  { grid-template-columns: 1.2fr 1fr; }
.eva-split--feature-right { grid-template-columns: 1fr 1.2fr; }
.eva-split--rr            { grid-template-columns: 1fr 1.4fr; }

.eva-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

.mobile-only { display: none; }

@media (max-width: 1024px) {
  .eva-split,
  .eva-split--feature-left,
  .eva-split--feature-right,
  .eva-split--rr { grid-template-columns: 1fr; gap: 20px; }

  .my-note-card { position: static !important; top: auto !important; }
}

@media (max-width: 768px) {
  .mobile-only  { display: block; }
  .desktop-only { display: none; }

  .markdown-body { overflow-x: auto; }
  .markdown-body table { font-size: 13px; min-width: 100%; }

  /* Planning tabs scroll affordance */
  .planning-mobile-tabs {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  }

  /* Prevent iOS Safari auto-zoom on focus by ensuring form fields are at least 16px */
  input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']):not([type='file']),
  select,
  textarea,
  .eva-input,
  .form-control,
  .form-select {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  /* Topbar: keep avatar only, collapse user text */
  .topbar-user-text { display: none !important; }
  .topbar-crumb {
    font-size: 13px;
    max-width: 60vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Page titles fluid sizing */
  .page-title { font-size: clamp(20px, 6vw, 28px); line-height: 1.2; }
  .page-eyebrow { font-size: 11px; }

  /* Auth: stack OAuth buttons */
  .auth-oauth-row { flex-direction: column !important; }
  .auth-oauth-row > * { width: 100%; }

  /* Account avatar fluid sizing (handles both <img> and bootstrap icon) */
  img.account-avatar {
    width: clamp(80px, 22vw, 120px) !important;
    height: clamp(80px, 22vw, 120px) !important;
  }
  i.account-avatar { font-size: clamp(80px, 22vw, 120px) !important; }

  /* Topbar tighter padding */
  .topbar { padding: 0 8px; gap: 8px; }
}

