/* ---------- Reset & base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #125740;
  color: #ffffff;
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  min-height: 100vh;
}

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

/* ---------- Header (shared with other pages) ---------- */
.page-header {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
  flex-wrap: wrap;
}

.back-link {
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  opacity: 0.9;
  transition: opacity 0.15s ease;
}

.back-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.page-title {
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

.position-nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.position-link {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  opacity: 0.6;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.position-link:hover {
  opacity: 0.9;
}

.position-link.active {
  opacity: 1;
  border-bottom-color: #f2c94c;
}

/* ---------- Layout ---------- */
.cap-layout {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ---------- Summary tiles ---------- */
.cap-summary {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.cap-tile {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem 1.75rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  min-width: 220px;
}

.cap-tile-label {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.cap-tile-value {
  font-size: 2rem;
  letter-spacing: 0.03em;
  color: #f2c94c;
}

.cap-tile-value-used {
  color: #ffffff;
}

/* ---------- Note text ---------- */
.cap-note {
  font-family: 'Anton', sans-serif;
  text-transform: none;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  line-height: 1.5;
  opacity: 0.7;
  max-width: 800px;
}

.cap-note-link {
  color: #f2c94c;
  opacity: 1;
}

.cap-note-link:hover {
  text-decoration: underline;
}

.cap-section-heading {
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
  margin-top: 1rem;
}

/* ---------- Tables (scrolls both ways, sticky header + name column) ---------- */
.cap-table-wrap {
  width: 100%;
  max-height: 75vh;
  overflow: auto;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

.cap-table-wrap-dead {
  max-height: none;
}

.cap-table {
  border-collapse: collapse;
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  white-space: nowrap;
  width: 100%;
}

.cap-table th,
.cap-table td {
  padding: 0.6rem 0.85rem;
  text-align: right;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
}

.cap-table thead th {
  background: #0e4934;
  position: sticky;
  top: 0;
  z-index: 3;
  letter-spacing: 0.03em;
  text-align: right;
}

.cap-th-player {
  text-align: left;
}

.cap-th-sub {
  opacity: 0.6;
  font-size: 0.62rem;
  text-transform: uppercase;
}

/* Sticky player-name column */
.sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #125740;
  text-align: left;
  border-right: 2px solid rgba(255, 255, 255, 0.25);
}

.cap-table thead th.sticky-col {
  background: #0e4934;
  z-index: 5;
}

.cap-name-cell {
  min-width: 180px;
}

.cap-player-link {
  color: #f2c94c;
  transition: opacity 0.15s ease;
}

.cap-player-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.cap-player-noLink {
  opacity: 0.85;
}

.cap-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

.cap-table tbody tr:nth-child(even) td.sticky-col {
  background: #163f30;
}

.cap-total-cell {
  color: #f2c94c;
}

.cap-total-row td {
  background: rgba(242, 201, 76, 0.12);
  color: #f2c94c;
  font-size: 0.85rem;
  border-top: 2px solid rgba(242, 201, 76, 0.35);
}

.cap-total-row td.sticky-col {
  background: rgba(242, 201, 76, 0.18);
}

@media (max-width: 700px) {
  .cap-layout {
    padding: 1.25rem;
  }

  .cap-summary {
    flex-direction: column;
  }

  .cap-tile {
    min-width: 0;
    padding: 1rem 1.1rem;
  }

  .cap-tile-value {
    font-size: 1.6rem;
  }

  .cap-table th,
  .cap-table td {
    padding: 0.45rem 0.6rem;
    font-size: 0.68rem;
  }

  .cap-name-cell {
    min-width: 130px;
  }
}

/* ---------- Player Stats dropdown ---------- */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0 0 0.2rem;
  margin: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  opacity: 0.6;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.nav-dropdown-trigger:hover {
  opacity: 0.9;
}

.nav-dropdown-trigger.active {
  opacity: 1;
  border-bottom-color: #f2c94c;
}

.nav-dropdown-caret {
  font-size: 0.7em;
  line-height: 1;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.9rem;
  background: #0e4934;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  min-width: 200px;
  max-width: calc(100vw - 2rem);
  z-index: 30;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: flex;
}

.nav-dropdown-link {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  opacity: 0.75;
  padding: 0.55rem 0.75rem;
  border-radius: 5px;
  white-space: nowrap;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.nav-dropdown-link:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

.nav-dropdown-link.active {
  opacity: 1;
  color: #f2c94c;
}

.nav-dropdown-trigger:focus-visible,
.nav-dropdown-link:focus-visible {
  outline: 2px solid #f2c94c;
  outline-offset: 2px;
}
