/* --- Page baseline --- */
html, body {
  height: 100%;
}

body {
  margin: 0;
  background: #000;
  color: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* --- Top bar --- */
.topbar {
  background: #00869D;          /* teal/blue like your screenshot */
  height: 86px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  box-sizing: border-box;
}

/* Logo area */
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-right: 34px;
}

.topbar .brand img {
  height: 54px;                 /* matches that chunky logo size */
  width: auto;
  display: block;
}

/* Navigation */
.topbar nav {
  display: flex;
  align-items: center;
  gap: 54px;                     /* spacing between HOME / STATS / etc */
}

.topbar a {
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  letter-spacing: 1.5px;
  font-size: 22px;
  text-transform: uppercase;
  opacity: 0.95;
}

.topbar a:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* Optional: keep nav from wrapping too early */
@media (max-width: 800px) {
  .topbar {
    height: auto;
    padding: 16px;
    gap: 16px;
    flex-wrap: wrap;
  }

  .topbar nav {
    gap: 22px;
    flex-wrap: wrap;
  }

  .topbar a {
    font-size: 18px;
  }
}

/* Dropdown container */
.dropdown {
  position: relative;
  display: inline-block;
}

/* The top button/link */
.dropbtn {
  display: inline-block;
  padding: 14px 18px;
  border-radius: 16px;
  background: transparent;
  color: #fff;
  text-decoration: none;
}

.dropdown:hover .dropbtn {
  background: rgba(10, 70, 95, 0.55); /* the pill */
}

/* Dropdown menu */
.dropdown-content {
  display: none;
  position: absolute;
  left: 0;
  top: 48px;
  min-width: 180px;
  background: #5F69AC; /* menu blue */
  border-radius: 14px;
  padding: 10px 0;
  box-shadow: 0 12px 25px rgba(0,0,0,0.35);
  z-index: 9999;
}

/* Dropdown links */
.dropdown-content a {
  display: block;
  padding: 8px 18px;
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  line-height: 1.1;
}

.dropdown-content a:hover {
  background: rgba(255,255,255,0.08);
}

/* Show on hover */
.dropdown:hover .dropdown-content {
  display: block;
}

/* ---------------- Stats ---------------- */
.stats-wrap {
  max-width: 1450px;      /* pick your preferred card width */
  margin: 0 auto;
  padding: 0 12px;
}

.stats-title {
  color: white;
  font-size: 42px;
  margin: 0 0 14px;
}

.stats-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.stats-subtitle {
  color: rgba(255,255,255,0.65);
  font-size: 0.95rem;
}

/* ONE unified stats-table definition */
.stats-table {
  background: rgba(0, 70, 90, 0.70); /* a bit more opaque to reduce artifacts */
  padding: 18px 22px 10px;
  border-radius: 6px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden
}

/* grid layout */
.stats-header-row, .stats-row {
  display: grid;
  grid-template-columns: 2fr 2fr 2fr 1.6fr 1.6fr;
  column-gap: 18px;
  align-items: center;

  /* important for clean separator rendering */
  position: relative;
  padding: 0;          /* padding now on cells */
  background: transparent;
  min-width: 1450px;
}

/* Row backgrounds live on the cell elements to stop “boxes”/bleed */
.stats-header-row > *, .stats-row > * {
  background: rgba(0, 45, 60, 0.35);
  padding: 10px 6px;
}

/* Teams page needs an extra column (events played) */
.stats-table.team-table .stats-header-row,
.stats-table.team-table .stats-row {
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
  min-width: 1450px;
}

/* Header slightly stronger */
.stats-header-row > * {
  background: rgba(0, 45, 60, 0.45);
}

/* Pink separators drawn as overlays (no border-bottom artifacts) */
.stats-header-row::after,
.stats-row::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: #e14c84;
}

.stats-header-row .th,
.stats-header-row .th-btn {
  font-size: 30px;   /* try 30–34 */
  font-weight: 600;  /* optional: makes them pop */
  line-height: 1.15;
}

/* remove last pink line */
#eventTableBody .stats-row:last-child::after {
  display: none;
}

.th {
  color: #fff;
  font-size: 30px;
  text-decoration: none;
}

.th:hover {
  text-decoration: underline;
}

.td {
  color: #fff;
  font-size: 30px;
  background: transparent !important;
  box-shadow: none !important;
}

.td.num {
  text-align: center; /* or right if you want */
  font-variant-numeric: tabular-nums;
}

.td.team {
  text-align: left; /* or right if you want */
  font-variant-numeric: tabular-nums;
}

/* Sorting headers look like links but are buttons */
.th-btn {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap; /* keep headers on one line */
}

/* Reserve a little space so ▲/▼ never causes wrapping */
.th-btn .th-arrow {
  width: 1.1em;
  display: inline-block;
  text-align: center;
  line-height: 1;
}
.th-btn.is-active.dir-asc  .th-arrow::before { content: "▲"; }
.th-btn.is-active.dir-desc .th-arrow::before { content: "▼"; }

/* Column alignment for clickable headers */
.th-btn.team { justify-content: flex-start; }
.th-btn.num  { justify-content: center; width: 100%; }

/* Team name row toggle should look like text (not a button box) */
.team-toggle {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.team-toggle:hover { text-decoration: underline; }
.team-toggle:focus { outline: none; }

.th-btn:hover {
  text-decoration: underline;
}

/* Optional: reduce anti-alias artifacts on some GPUs */
.stats-table, .stats-row, .stats-header-row, .td {
  transform: translateZ(0);
}

/* ---------------- Events list ---------------- */

/* THIS fixes stacking: make event cards a row */
.event-list {
  display: flex;
  flex-wrap: wrap;     /* wraps nicely on smaller screens */
  gap: 14px;
  align-items: flex-start;
  margin: 10px 0 22px;
}

.event-card {
  border: 0;
  cursor: pointer;
  text-align: left;

  display: inline-flex;        /* makes them behave like “cards” inline */
  align-items: center;
  justify-content: flex-start;

  min-width: 260px;            /* adjust to taste */
  max-width: 360px;

  background: rgba(0, 70, 90, 0.55);
  border-radius: 12px;
  padding: 14px 16px;
  color: white;
  text-decoration: none;
}

.event-card:hover {
  background: rgba(0, 70, 90, 0.75);
}

.event-name {
  font-size: 28px;
}

.event-meta {
  opacity: 0.8;
  margin-top: 4px;
}

/* clickable team name (looks like normal text, NOT a button) */

/* Clickable team name (we use a <span>, not a <button>) */
.team-link {
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  opacity: 0.95;
}

.team-link:hover {
  opacity: 1;
}

.team-link:focus-visible {
  outline: 2px solid #e14c84;
  outline-offset: 2px;
  border-radius: 4px;
}

.team-name {
  /* inert team name (no hover affordance) */
  cursor: default;
}

/* drawer container under each row */
.team-detail-wrap {
  overflow: hidden;
  max-height: 0;
  transition: max-height 220ms ease;
  background: transparent;
}

.team-detail-wrap.open {
  /* big enough to fit content; adjust if you add more fields */
  max-height: 1200px;
}

/* drawer card */
.team-detail {
  background: rgba(0, 45, 60, 0.35);
  border-top: 3px solid #e14c84;
  padding: 14px 18px 16px;
  font-size: 18px;
  line-height: 1.35;
}

/* 3-column layout inside drawer */
.team-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  align-items: start;
  text-align: left;
}

.team-detail-title {
  font-size: 22px;
  font-weight: 650;
  margin-bottom: 10px;
}

.team-detail-section {
  text-align: left;
}

.detail-kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.detail-kv .k {
  opacity: 0.85;
}

.detail-kv .k::after {
  content: ":";
}

.detail-kv .v {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.detail-muted {
  opacity: 0.7;
  padding: 6px 0;
}

.killer-img {
  width: 180px;
  height: auto;
  display: block;
}

.killer-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-top: 10px;
}

.killer-left {
  flex: 0 0 auto;
}

.killer-right {
  flex: 1 1 auto;
  min-width: 0;
}

.killer-name {
  font-weight: 650;
  font-size: 20px;
  line-height: 1.1;
}

.killer-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.killer-stats .detail-kv {
  display: grid;
  grid-template-columns: 180px 1fr; /* label / value */
  gap: 10px;
  align-items: baseline;
  margin: 6px 0;
}

.killer-stats .detail-kv .k {
  opacity: 0.9;
}

.killer-stats .detail-kv .v {
  text-align: right;  /* right-align the numbers */
  font-variant-numeric: tabular-nums;
}

/* stack the 3 sections on smaller screens */
@media (max-width: 980px) {
  .team-detail-grid {
    grid-template-columns: 1fr;
  }
}