/* ---------- 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 position 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;
}

.panel-heading {
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  opacity: 0.75;
  margin-bottom: 1rem;
}

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

.dc-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ---------- Offense / Defense side toggle ---------- */
.side-tabs {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  margin-bottom: 0.25rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

/* ---------- Personnel package tabs ---------- */
.package-tabs {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.package-tab {
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  padding: 0.6rem 1.4rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.package-tab:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.package-tab.active {
  background: #ffffff;
  color: #125740;
  border-color: #ffffff;
}

.package-summary {
  font-family: 'Anton', sans-serif;
  text-transform: none;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  opacity: 0.75;
}

/* ---------- Field diagram ---------- */
.dc-field-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  position: relative;
  width: 100%;
  max-width: 1100px;
  padding-bottom: 44%;
  border: 3px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  overflow: hidden;
  background-image: repeating-linear-gradient(
    90deg,
    #0e4934,
    #0e4934 8.33%,
    #114f39 8.33%,
    #114f39 16.66%
  );
}

.field-los {
  position: absolute;
  left: 0;
  right: 0;
  top: 46%;
  border-top: 2px dashed rgba(255, 255, 255, 0.55);
}

.field-tokens {
  position: absolute;
  inset: 0;
}

/* ---------- Player tokens ---------- */
.field-token {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: 88px;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
}

.field-token-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  color: #125740;
  border: 3px solid #f2c94c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  letter-spacing: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.field-token.no-link .field-token-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
}

.field-token:not(.no-link):hover .field-token-badge {
  transform: scale(1.08);
  box-shadow: 0 0 0 4px rgba(242, 201, 76, 0.35);
}

.field-token-name {
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.field-token-pos {
  font-size: 0.55rem;
  opacity: 0.75;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

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

.dc-note-dash {
  color: #f2c94c;
  opacity: 1;
}

@media (max-width: 700px) {
  /* Taller field on mobile gives every token more vertical breathing
     room in absolute pixels, even though positions stay the same
     percentages — the #1 fix for names blending into each other. */
  .field {
    padding-bottom: 66%;
  }

  .field-token {
    width: 68px;
  }

  .field-token-badge {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
    border-width: 2px;
  }

  .field-token-name {
    font-size: 0.5rem;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .field-token-pos {
    font-size: 0.42rem;
  }

  /* The 5-across offensive line is the tightest cluster on the field —
     drop straight to number-only badges here so labels stop fighting
     each other for space. Still tappable, still identifiable by
     number. */
  .field-token-compact .field-token-name,
  .field-token-compact .field-token-pos {
    display: none;
  }
}

@media (max-width: 460px) {
  .field {
    padding-bottom: 82%;
  }

  .field-token {
    width: 56px;
  }

  .field-token-badge {
    width: 24px;
    height: 24px;
    font-size: 0.62rem;
  }

  .field-token-name {
    font-size: 0.44rem;
  }

  /* Position label is the least essential label at this size — drop it
     to keep each token's footprint small and legible. */
  .field-token-pos {
    display: none;
  }
}

/* ---------- 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;
}


