:root {
  --bg: #0a0b0d;
  --bg-elev: #14161a;
  --bg-card: #1a1d23;
  --border: #2a2e36;
  --text: #e8e8e8;
  --text-dim: #9aa0a8;
  --accent: #ff3a3a;
  --accent-glow: rgba(255, 58, 58, 0.45);
  --accent-dark: #b30000;
  --hu-red: #ce2939;
  --hu-green: #477050;
  --font-display: 'Oxanium', 'Rajdhani', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(circle at 20% 0%, rgba(255, 58, 58, 0.08), transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(255, 58, 58, 0.05), transparent 40%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 11, 13, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 4px;
  color: var(--text);
}

.brand .logo-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 1px;
  clip-path: polygon(0 0, 100% 0, 100% 75%, 85% 100%, 0 100%);
  box-shadow: 0 0 16px var(--accent-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 6px 0;
  position: relative;
  transition: color 0.2s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.lang-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
}

.lang-toggle button {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-toggle button.active {
  background: var(--accent);
  color: #fff;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--text);
  cursor: pointer;
}

/* ============ HERO ============ */
.hero {
  position: relative;
  padding: 96px 0 80px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(10,11,13,0.6) 100%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0 2px, transparent 2px 8px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  text-align: center;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  margin-bottom: 24px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(48px, 10vw, 120px);
  letter-spacing: 8px;
  line-height: 1;
  margin-bottom: 16px;
  text-shadow: 0 0 40px var(--accent-glow);
}

.hero h1 .accent {
  color: var(--accent);
}

.hero-tagline {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 36px;
}

.cta-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-1px);
}

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

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

.btn-discord { background: #5865F2; color: #fff; }
.btn-discord:hover { background: #4752c4; box-shadow: 0 0 24px rgba(88, 101, 242, 0.4); }

/* ============ SECTIONS ============ */
.section {
  padding: 80px 0;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent);
  margin-top: 12px;
}

.section-subtitle {
  color: var(--text-dim);
  font-size: 16px;
  margin-bottom: 48px;
  max-width: 720px;
}

/* ============ ABOUT ============ */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.feature-card:hover::before {
  width: 100%;
}

.feature-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(255, 58, 58, 0.1);
  color: var(--accent);
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 22px;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-dim);
  font-size: 14px;
}

/* ============ ROSTER ============ */
.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.25s;
  position: relative;
}

.member-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.member-avatar {
  height: 220px;
  background:
    linear-gradient(135deg, rgba(255,58,58,0.15), rgba(20,22,26,0.95)),
    var(--bg-elev);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 72px;
  color: var(--accent);
  letter-spacing: 4px;
  border-bottom: 2px solid var(--accent);
  position: relative;
}

.member-avatar::after {
  content: attr(data-rank);
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 2px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 8px;
  border-radius: 2px;
}

.member-body {
  padding: 18px 20px 20px;
}

.member-handle {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 2px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-role {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: var(--font-display);
  font-weight: 600;
}

.flag {
  display: inline-block;
  width: 16px;
  height: 12px;
  background: linear-gradient(to bottom, #ce2939 0 33%, #fff 33% 66%, #477050 66%);
  border-radius: 1px;
}

/* ============ JOIN ============ */
.join-wrap {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.join-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 56px 32px;
  position: relative;
  overflow: hidden;
}

.join-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--hu-red), #fff, var(--hu-green));
}

.join-card h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.join-card p {
  color: var(--text-dim);
  margin-bottom: 32px;
}

.requirements {
  list-style: none;
  text-align: left;
  max-width: 480px;
  margin: 0 auto 32px;
}

.requirements li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
}

.requirements li::before {
  content: '▸';
  color: var(--accent);
  font-size: 18px;
}

/* ============ CONTACT / SOCIALS ============ */
.socials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 720px;
  margin: 0 auto;
}

.social-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 32px;
  text-align: center;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.social-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.social-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: rgba(255, 58, 58, 0.08);
  border-radius: 50%;
  color: var(--accent);
  font-size: 26px;
}

.social-card.discord .social-icon { background: rgba(88, 101, 242, 0.15); color: #5865F2; }
.social-card.tiktok .social-icon { background: rgba(255, 255, 255, 0.08); color: #fff; }

.social-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.social-card p {
  color: var(--text-dim);
  font-size: 14px;
}

/* ============ FOOTER ============ */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--text-dim);
  font-size: 13px;
  background: var(--bg-elev);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-stripe {
  height: 3px;
  background: linear-gradient(90deg, var(--hu-red) 33%, #fff 33% 66%, var(--hu-green) 66%);
  margin-bottom: 32px;
}

/* ============ AUTH SLOT ============ */
.auth-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 18px 6px 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
  max-width: 260px;
  line-height: 1;
}
.auth-pill:hover { border-color: var(--accent); background: var(--bg-elev); }
.auth-pill img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
}
.auth-pill span:not(.admin-badge) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  letter-spacing: 0.5px;
}

.auth-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.2s;
  line-height: 1;
}
.auth-logout:hover { color: var(--accent); border-color: var(--accent); }

.admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 0 8px;
  height: 20px;
  border-radius: 3px;
  flex-shrink: 0;
  line-height: 1;
}

.btn-sm { padding: 8px 14px; font-size: 12px; }

/* ============ TEAMS LIST ============ */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.team-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 4px; padding: 24px;
  transition: all 0.2s; display: block; position: relative; overflow: hidden;
}
.team-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 4px; height: 100%; background: var(--accent);
  opacity: 0; transition: opacity 0.2s;
}
.team-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.team-card:hover::before { opacity: 1; }

.team-card-tag {
  font-family: var(--font-display); font-weight: 800;
  font-size: 12px; letter-spacing: 4px;
  color: var(--accent); margin-bottom: 4px;
}
.team-card-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px; letter-spacing: 1px; margin-bottom: 8px;
}
.team-card-meta { font-size: 13px; color: var(--text-dim); display: flex; gap: 4px; margin-bottom: 8px; }
.team-card-desc { font-size: 13px; color: var(--text-dim); }

/* ============ TEAM DETAIL ============ */
.team-header {
  display: flex; align-items: center; gap: 24px;
  margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.team-tag-large {
  font-family: var(--font-display); font-weight: 800;
  font-size: 36px; letter-spacing: 4px; color: var(--accent);
  background: var(--bg-card); border: 1px solid var(--accent);
  border-radius: 4px; padding: 16px 24px;
}
.team-name { font-family: var(--font-display); font-size: 36px; letter-spacing: 3px; }
.team-description { color: var(--text-dim); margin-top: 4px; }

.subhead {
  font-family: var(--font-display); font-weight: 700;
  font-size: 16px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--text-dim); margin: 32px 0 16px;
}

.tracker-link {
  display: inline-block; margin-top: 8px;
  font-size: 12px; letter-spacing: 1px;
  color: var(--accent); font-family: var(--font-display);
}

.member-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============ TOURNAMENTS LIST ============ */
.tournaments-list { display: flex; flex-direction: column; gap: 12px; }

.tournament-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; background: var(--bg-card);
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 4px; padding: 20px 24px; transition: all 0.2s;
}
.tournament-row:hover { border-color: var(--accent); transform: translateX(2px); }
.tournament-row-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 18px; letter-spacing: 1px; margin-bottom: 4px;
}
.tournament-row-meta { font-size: 13px; color: var(--text-dim); display: flex; gap: 6px; }

.status-badge {
  font-family: var(--font-display); font-weight: 700;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 2px;
  background: var(--bg-elev); border: 1px solid var(--border);
}
.status-badge.badge-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.status-badge.badge-success { background: #2d8c4d; color: #fff; border-color: #2d8c4d; }
.status-badge.badge-info { background: #2a5fb6; color: #fff; border-color: #2a5fb6; }
.status-badge.badge-muted { background: var(--bg-elev); color: var(--text-dim); }

/* ============ TOURNAMENT DETAIL ============ */
.tournament-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.tournament-meta {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-dim); font-size: 14px; flex-wrap: wrap;
}
.admin-controls { display: flex; gap: 8px; flex-wrap: wrap; }

.empty-card {
  background: var(--bg-card); border: 1px dashed var(--border);
  border-radius: 4px; padding: 48px; text-align: center; color: var(--text-dim);
}

.team-seeds, .standings {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 4px; padding: 20px 24px; margin-bottom: 24px;
}
.seed-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px;
}
.seed-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--bg-elev);
  border-radius: 2px; font-size: 14px;
}
.seed-row.eliminated { opacity: 0.4; text-decoration: line-through; }
.seed-num { font-family: var(--font-display); font-weight: 800; color: var(--accent); min-width: 24px; }
.seed-tag { font-family: var(--font-display); font-weight: 700; letter-spacing: 1px; }
.seed-name { color: var(--text-dim); font-size: 13px; }

.standings-table { width: 100%; border-collapse: collapse; }
.standings-table th, .standings-table td {
  padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border);
}
.standings-table th {
  font-family: var(--font-display); font-size: 12px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim);
}

/* ============ BRACKET ============ */
.bracket-scroll { overflow-x: auto; padding-bottom: 16px; margin-bottom: 24px; }
.bracket {
  display: flex; gap: 32px; min-width: min-content; align-items: stretch;
}
.bracket-round {
  display: flex; flex-direction: column;
  justify-content: space-around; gap: 16px; min-width: 240px;
}
.bracket-round-title {
  font-family: var(--font-display); font-size: 12px;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--text-dim); text-align: center; margin-bottom: 8px;
}

.match-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 4px; overflow: hidden; transition: border-color 0.2s;
  position: relative;
}
.match-card.ready { border-color: var(--accent); }
.match-card.complete { border-color: #2d8c4d; }
.match-card.pending { opacity: 0.6; }

.match-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 14px;
}
.match-row:last-child { border-bottom: 0; }
.match-row.winner { background: rgba(45, 140, 77, 0.15); color: #fff; font-weight: 600; }
.match-row.tbd { color: var(--text-dim); font-style: italic; }
.match-team { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.match-score {
  font-family: var(--font-display); font-weight: 700;
  font-size: 16px; color: var(--accent); min-width: 24px; text-align: right;
}
.match-report-btn {
  width: 100%; background: var(--accent); border: 0; color: #fff;
  padding: 6px; font-family: var(--font-display);
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase; cursor: pointer;
}
.match-report-btn:hover { background: var(--accent-dark); }
.match-bye {
  text-align: center; padding: 8px; font-family: var(--font-display);
  letter-spacing: 4px; color: var(--text-dim); font-size: 12px;
}

.swiss-round {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 4px; padding: 20px; margin-bottom: 16px;
}
.swiss-round h4 {
  font-family: var(--font-display); letter-spacing: 2px;
  margin-bottom: 12px; color: var(--accent);
}
.swiss-matches {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px;
}
.match-card.compact .match-row { padding: 8px 12px; font-size: 13px; }

/* Double-elim layout: WB stacked over LB, GF column to the right */
.double-elim-wrap {
  display: flex;
  gap: 48px;
  align-items: stretch;
  min-width: min-content;
}
.double-elim-brackets {
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex: 1;
  min-width: 0;
}
.bracket-section .subhead { margin: 0 0 12px; }
.gf-column {
  align-self: center;
  min-width: 240px;
  border-left: 1px dashed var(--border);
  padding-left: 32px;
}
.gf-column .bracket { display: block; }
.gf-column .bracket-round { min-width: 220px; }

/* ============ ADMIN ============ */
.admin-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 4px; padding: 24px; margin-bottom: 24px;
}
.admin-form { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-form input, .admin-form select {
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text); padding: 8px 12px; border-radius: 2px;
  font-family: var(--font-body); font-size: 14px;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 10px; border-bottom: 1px solid var(--border);
  text-align: left; font-size: 14px;
}
.admin-table th {
  font-family: var(--font-display); font-size: 11px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim);
}

.manage-panel {
  margin-top: 24px; padding: 20px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 4px;
}
.manage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 720px) { .manage-grid { grid-template-columns: 1fr; } }
.manage-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.manage-list li {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 2px; padding: 8px 12px; font-size: 14px;
}

/* ============ PROFILE ============ */
.profile-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 4px; padding: 32px; max-width: 720px;
}
.profile-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 24px;
}
.profile-header img, .profile-avatar-fallback {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent); display: grid; place-items: center;
  color: #fff; font-family: var(--font-display);
  font-weight: 800; font-size: 24px;
}
[data-form="ubi"] { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
[data-form="ubi"] input, [data-form="ubi"] select {
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px; border-radius: 2px;
  flex: 1; min-width: 180px;
}
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.stat-block {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 4px; padding: 16px; text-align: center;
}
.stat-label {
  display: block; font-family: var(--font-display);
  font-size: 11px; letter-spacing: 2px; color: var(--text-dim);
  text-transform: uppercase; margin-bottom: 4px;
}
.stat-value {
  font-family: var(--font-display); font-weight: 800;
  font-size: 24px; color: var(--accent);
}

.muted { color: var(--text-dim); }
.small { font-size: 12px; }
.error { color: #ff7676; }

/* ============ ROSTER EDITOR ============ */
.team-actions { margin-bottom: 16px; }
.roster-edit-list { margin-bottom: 16px; }
.roster-edit-row {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 3px; padding: 8px; margin-bottom: 8px;
}
.roster-edit-form { gap: 6px; margin: 0; }
.roster-edit-form input,
.roster-edit-form select {
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text); padding: 6px 10px; border-radius: 2px;
  font-size: 13px; min-width: 0;
}
.roster-edit-form input[name="display_name"] { min-width: 140px; flex: 1; }
.roster-edit-form input[name="ubi_username"] { min-width: 140px; flex: 1; }

.roster-add-tabs {
  display: flex; gap: 4px; margin-bottom: 8px; margin-top: 16px;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  background: transparent; border: 0; color: var(--text-dim);
  font-family: var(--font-display); font-size: 12px; letter-spacing: 2px;
  text-transform: uppercase; cursor: pointer; padding: 8px 14px;
  border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn:hover { color: var(--text); }

/* ============ MEMBER CARD CLICK + AVATAR ============ */
.member-card { cursor: pointer; }
.member-card .member-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}

/* ============ STATS MODAL ============ */
.stats-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.stats-modal-backdrop.open { display: flex; }

.stats-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 28px;
  max-width: 560px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.stats-modal-close {
  position: absolute; top: 12px; right: 12px;
  background: transparent; border: 0;
  color: var(--text-dim);
  cursor: pointer; font-size: 20px;
  padding: 6px 10px;
}
.stats-modal-close:hover { color: var(--accent); }

.stats-modal-head {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.stats-modal-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  background: var(--bg-elev);
}
.stats-modal-avatar.fallback {
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800;
  font-size: 22px; color: var(--accent);
}

.stats-modal-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 2px;
}
.stats-modal-role {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.stats-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stats-modal-grid .stat-block {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 12px 10px;
  text-align: center;
}
.stats-modal-grid .stat-suffix {
  font-size: 13px; color: var(--text-dim); margin-left: 2px;
}

.stats-modal-footer { display: flex; justify-content: flex-end; }

.stats-modal-warning {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  padding: 16px;
  margin-bottom: 8px;
}
.stats-modal-warning p { margin-bottom: 8px; }
.stats-modal-warning code {
  background: rgba(255,58,58,0.1); color: var(--accent);
  padding: 2px 6px; border-radius: 2px; font-size: 12px;
}
.warn { color: #ffb84d; }

/* ============ DIVISION BADGES ============ */
.division-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  margin-left: 10px;
  vertical-align: middle;
  border: 1px solid;
}
.division-badge.div-rookie       { color: #c97a3a; border-color: #c97a3a; background: rgba(201,122,58,0.1); }
.division-badge.div-intermediate { color: #d4d4d4; border-color: #d4d4d4; background: rgba(212,212,212,0.08); }
.division-badge.div-advanced     { color: #4dc8ff; border-color: #4dc8ff; background: rgba(77,200,255,0.1); }
.division-badge.div-legend       { color: #ffd84d; border-color: #ffd84d; background: rgba(255,216,77,0.1); }

/* ============ PRIZE POOL ============ */
.prize-pool-card {
  background: linear-gradient(135deg, rgba(255,216,77,0.06), rgba(255,58,58,0.04));
  border: 1px solid var(--border);
  border-left: 3px solid #ffd84d;
  border-radius: 4px;
  padding: 24px;
  margin: 16px 0 8px;
}
.prize-pool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.prize-pool-label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.prize-pool-total {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 36px;
  letter-spacing: 2px;
  color: #ffd84d;
}
.prize-pool-note { margin-top: 4px; }

.prize-pool-split {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
}
.prize-split-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 12px;
  border-radius: 2px;
  background: var(--bg-elev);
  font-size: 14px;
}
.prize-split-row .prize-amount {
  font-family: var(--font-display);
  font-weight: 700;
}
.prize-split-row.gold   .prize-amount { color: #ffd84d; }
.prize-split-row.silver .prize-amount { color: #c0c0c0; }
.prize-split-row.bronze .prize-amount { color: #cd7f32; }

/* ============ PODIUM ============ */
.podium-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px 24px;
  margin: 0 0 16px;
}
.podium-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.podium-row:last-child { border-bottom: 0; }
.podium-pos {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2px;
  min-width: 90px;
}
.podium-row.gold   .podium-pos { color: #ffd84d; }
.podium-row.silver .podium-pos { color: #c0c0c0; }
.podium-row.bronze .podium-pos { color: #cd7f32; }
.podium-team {
  font-family: var(--font-display);
  font-weight: 600;
  flex: 1;
}

/* ============ MOBILE ============ */
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .auth-slot {
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    width: 100%;
  }
  .auth-pill { max-width: none; justify-content: flex-start; }
  .auth-pill span:not(.admin-badge) { max-width: none; }
  .hero { padding: 64px 0 56px; }
  .section { padding: 56px 0; }
}
