/* ============================================
   EVENTS PAGE — Bold Esports Aesthetic
   Font: Barlow Condensed (display) + Barlow (body)
   ============================================ */

/* ── Variables ─────────────────────────────── */
:root {
  --accent:       #00d4ff;
  --accent-dim:   rgba(0, 212, 255, 0.15);
  --accent-glow:  rgba(0, 212, 255, 0.4);
  --bg-deep:      #080b12;
  --bg-card:      #0d1320;
  --bg-card-alt:  #111827;
  --border:       rgba(255,255,255,0.07);
  --border-accent:rgba(0, 212, 255, 0.3);
  --text-primary: #f0f4ff;
  --text-muted:   #6b7a99;
  --text-dim:     #3d4a63;
  --gold:         #ffd700;
  --red:          #ff3b5c;
  --green:        #00ff88;
}

/* ── Base overrides ────────────────────────── */
body {
  background-color: var(--bg-deep);
  font-family: 'Barlow', sans-serif;
  color: var(--text-primary);
}

/* ── Hero Banner ───────────────────────────── */
#event-hero {
  position: relative;
  width: 100%;
  min-height: 140px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin-bottom: 0;
}

#event-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(0,212,255,0.08) 0%, transparent 50%),
    linear-gradient(to bottom, #0d1320 0%, var(--bg-deep) 100%);
  z-index: 0;
}

/* Animated grid lines in hero */
#event-hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridScroll 20s linear infinite;
}

/* Glowing orb top-right */
#event-hero-bg::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(0,212,255,0.12) 0%, transparent 70%);
  border-radius: 50%;
}

@keyframes gridScroll {
  from { background-position: 0 0; }
  to   { background-position: 40px 40px; }
}

#event-hero-content {
  position: relative;
  z-index: 1;
  padding: 22px 32px 18px;
  width: 100%;
}

#event-eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.7em;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.1s forwards;
}

#event h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(1.8em, 4vw, 3em);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--text-primary);
  margin: 0;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.2s forwards;
}

#event-hero-divider {
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin-top: 16px;
  animation: expandWidth 0.8s ease 0.4s forwards;
}

@keyframes expandWidth {
  to { width: min(600px, 80vw); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Main Layout ───────────────────────────── */
#event-main {
  padding: 16px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 100%;
  margin: 0 auto;
}

/* ── Section Cards ─────────────────────────── */
.event-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.4s ease forwards;
  opacity: 0;
}

.event-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 60%);
  opacity: 0.6;
}

.section-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Stagger section animations */
#placements-section  {width: 100%; overflow-x: auto; animation-delay: 0.15s; }
#event-mid-grid      { animation-delay: 0.25s; }
#tops-section        { animation-delay: 0.35s; }
#points-section      { animation-delay: 0.45s; }

/* ── Mid Grid (ScoreCard + Matchups) ───────── */
#event-mid-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  opacity: 0;
  animation: fadeUp 0.4s ease 0.25s forwards;
}

#scorecard-section,
#matchups-section {
  animation: none;
  opacity: 1;
}

/* ── Table Scroll Wrapper ──────────────────── */
.table-scroll {
  overflow-x: auto;
  border-radius: 8px;
}

/* ── Global Table Styles ───────────────────── */
#ScoreCard,
#matchups,
#TopScores,
#TopGoals,
#TopAssists,
#TopSaves,
#TopShots,
#pointsInfo table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Barlow', sans-serif;
}

/* Table headers */
#ScoreCard th,
#matchups th,
#TopScores th,
#TopGoals th,
#TopAssists th,
#TopSaves th,
#TopShots th,
#pointsInfo th {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  background: transparent;
  white-space: nowrap;
}
/* Fix link colors inside tables */
#ScoreCard td a,
#matchups td a,
#TopScores td a,
#TopGoals td a,
#TopAssists td a,
#TopSaves td a,
#TopShots td a,
#pointsInfo td a,
.section td a,
#majplacements td a {
  color: var(--text-primary);
}

/* Fix header colors */
#ScoreCard th,
#matchups th,
#TopScores th,
#TopGoals th,
#TopAssists th,
#TopSaves th,
#TopShots th,
#pointsInfo th {
  color: var(--text-muted);
}
/* Table cells */
#ScoreCard td,
#matchups td,
#TopScores td,
#TopGoals td,
#TopAssists td,
#TopSaves td,
#TopShots td,
#pointsInfo td {
  padding: 6px 12px;
  font-size: 0.85em;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  transition: background 0.15s;
}

/* Row hover */
#ScoreCard tbody tr:hover td,
#matchups tbody tr:hover td,
#TopScores tbody tr:hover td,
#TopGoals tbody tr:hover td,
#TopAssists tbody tr:hover td,
#TopSaves tbody tr:hover td,
#TopShots tbody tr:hover td {
  background: var(--accent-dim);
}

/* Last row no border */
#ScoreCard tbody tr:last-child td,
#matchups tbody tr:last-child td,
#TopScores tbody tr:last-child td,
#TopGoals tbody tr:last-child td,
#TopAssists tbody tr:last-child td,
#TopSaves tbody tr:last-child td,
#TopShots tbody tr:last-child td {
  border-bottom: none;
}

/* ── Top Performers Grid ───────────────────── */
#tops-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.tops-panel {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.tops-panel:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.tops-panel-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 7px 12px 6px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}

/* Number ranks in tops tables */
#TopScores td:first-child,
#TopGoals td:first-child,
#TopAssists td:first-child,
#TopSaves td:first-child,
#TopShots td:first-child {
  color: var(--text-muted);
  font-size: 0.78em;
  width: 24px;
  padding-right: 4px;
}

/* ── Placements ────────────────────────────── */
.placements_horizontal_container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.section {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  min-width: 220px;
  max-width: 280px;
  flex: 0 1 220px;
  transition: border-color 0.2s;
}

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

.section th {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 7px 12px;
  background: rgba(0, 212, 255, 0.06);
  border-bottom: 1px solid var(--border-accent);
  text-align: left;
}

.section td {
  padding: 5px 12px;
  font-size: 0.84em;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  /* display: flex;
  justify-content: space-between;
  align-items: center; */
}

.section tr:last-child td {
  border-bottom: none;
}

.section tr:hover td {
  background: var(--accent-dim);
}

/* Points badge */
#points {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.8em;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  background: var(--accent-dim);
  padding: 1px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-accent);
  /* float: right;  ADD THIS BACK */
}

/* Champ section wider */
.champ_section {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  min-width: 260px;
}

/* Major placements */
#majplacements {
  width: 100%;
  border-collapse: collapse;
}

#border_box_white {
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  overflow: hidden;
}

/* ── Matchups specific ─────────────────────── */
#matchups th:nth-child(2),
#matchups td:nth-child(2) {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8em;
  width: 80px;
  white-space: nowrap;
}

/* VS indicator */
#matchups td:nth-child(2) {
  color: var(--accent);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.85em;
  letter-spacing: 0.08em;
}

/* Tighter padding on matchup team name cells */
#matchups td:nth-child(1),
#matchups td:nth-child(3) {
  padding: 6px 10px;
}

/* ── Loss indicator ────────────────────────── */
#lose {
  border-left: 3px solid var(--red);
}

/* ── Points Info ───────────────────────────── */
#pointsInfo {
  color: var(--text-primary);
}

#pointsInfo table {
  margin: 0;
}

/* ── ScoreCard redesign — grouped border boxes ─ */

/* Override global collapse — table uses inline border-collapse:separate set by JS */
/* Cell-level borders are removed; the tbody border (set inline) forms the group box */
#ScoreCard tbody td {
  background: var(--bg-card-alt);
  border-top: none;
  border-bottom: none;
  border-left: none;
  border-right: none;
}

/* Subtle inner row divider between player rows within a group */
#ScoreCard tbody tr:not(:last-child) td {
  border-bottom: 1px solid var(--border);
}

/* Override the shared "last row no border" rule — cell borders are gone anyway */
#ScoreCard tbody tr:last-child td {
  border-bottom: none;
}

/* Override shared first-row gold color */
#ScoreCard tbody tr:first-child td {
  color: var(--text-primary);
}

/* Member name cell */
#ScoreCard tbody td.g-name {
  font-weight: 600;
  white-space: nowrap;
}

/* Total cell */
#ScoreCard tbody td.g-total {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1em;
  color: var(--gold);
  text-align: center;
  white-space: nowrap;
}

/* Hover on data rows, skip name cell */
#ScoreCard tbody tr:hover td:not(.g-name) {
  background: var(--accent-dim);
}

/* ── Footer ────────────────────────────────── */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 0;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 1200px) {
  #event-mid-grid {
    grid-template-columns: 1fr;
  }

  #tops-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  #event-main {
    padding: 16px;
    gap: 16px;
  }

  #event-hero-content {
    padding: 24px 20px 20px;
  }

  #event h1 {
    font-size: 1.8em;
  }

  #tops-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .placements_horizontal_container {
    flex-direction: column;
  }

  .section {
    min-width: unset;
  }
}

@media (max-width: 480px) {
  #tops-grid {
    grid-template-columns: 1fr;
  }
}
/* ── Fix link colors in all tables ──────────── */
#ScoreCard td a,
#matchups td a,
#TopScores td a,
#TopGoals td a,
#TopAssists td a,
#TopSaves td a,
#TopShots td a,
#pointsInfo td a,
.section td a,
#majplacements td a {
  color: var(--text-primary) !important;
}