/* ============================================
   NDL — National Dake League
   Core stylesheet
   ============================================ */

:root {
  --bg: #131315;
  --bg-elevated: #1b1b1e;
  --bg-card: #1f1f23;
  --border: #2c2c31;
  --text: #e8e8ea;
  --text-dim: #9a9aa2;
  --navy: #0b2955;
  --navy-bright: #123a75;
  --red: #d61f26;
  --red-bright: #ef2b32;
  --gold: #f2c14e;
  --radius: 10px;
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(19, 19, 21, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  height: 44px;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text .brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

.brand-text .brand-sub {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.main-nav {
  display: flex;
  gap: 4px;
}

.main-nav a {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.main-nav a:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.main-nav a.active {
  color: var(--text);
  background: var(--navy);
  border-color: var(--navy-bright);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  width: 40px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ---------- Layout ---------- */

main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.page-heading {
  margin-bottom: 28px;
}

.page-heading h1 {
  font-size: 1.9rem;
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}

.page-heading p {
  color: var(--text-dim);
  margin: 0;
  font-size: 0.95rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(242, 193, 78, 0.1);
  border: 1px solid rgba(242, 193, 78, 0.35);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

/* ---------- Home / Hero ---------- */

.hero {
  text-align: center;
  padding: 70px 20px 50px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.hero img.hero-logo {
  height: 150px;
  width: auto;
  margin: 0 auto 24px;
}

.hero h1 {
  font-size: 2.4rem;
  margin: 0 0 10px;
  letter-spacing: 0.03em;
}

.hero p {
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 auto;
  font-size: 1rem;
}

.home-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.home-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.home-card:hover {
  border-color: var(--navy-bright);
  transform: translateY(-2px);
}

.home-card h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--text);
}

.home-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.home-card .home-card-arrow {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Standings ---------- */

.standings-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.standings-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.standings-status.live .dot {
  background: #3ecf6a;
}

.standings-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.standings-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.standings-row:hover {
  border-color: var(--navy-bright);
  transform: translateX(2px);
}

.standings-rank {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-dim);
  text-align: center;
}

.standings-row:nth-child(1) .standings-rank { color: var(--gold); }

.standings-card-img {
  display: block;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.standings-card-img:hover {
  opacity: 0.88;
  transform: scale(1.01);
}

.standings-card-img img {
  width: 100%;
  height: auto;
}

.standings-record {
  text-align: right;
  min-width: 92px;
}

.standings-record .rec {
  font-weight: 700;
  font-size: 0.95rem;
}

.standings-record .pts {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Roster ---------- */

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--text);
}

.roster-banner {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.roster-banner img {
  width: 100%;
  height: auto;
  display: block;
}

#roster-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.roster-manager {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: normal;
}

/* Field formation for starters */

.field {
  position: relative;
  background:
    linear-gradient(rgba(10, 40, 20, 0.0), rgba(10, 40, 20, 0.0)),
    repeating-linear-gradient(
      0deg,
      #163d24,
      #163d24 40px,
      #14401f 40px,
      #14401f 80px
    );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow: hidden;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.special-teams {
  margin-top: 20px;
}

.special-teams h2,
.roster-group h2 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin: 0 0 12px;
}

.special-teams .field-row {
  justify-content: flex-start;
}

.player-chip {
  width: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.player-chip-photo {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: var(--bg-card);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.player-chip-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.player-chip.empty .player-chip-photo {
  opacity: 0.4;
  border-style: dashed;
}

.player-chip-pos {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 5px;
  padding: 1px 5px;
  white-space: nowrap;
}

.player-chip-name {
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.player-chip-meta {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Bench / taxi / IR grids (reuse the same chip style) */

.roster-group {
  margin-bottom: 28px;
}

.bench-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* ---------- News ---------- */

.news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.news-item .news-date {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 6px;
}

.news-item h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.news-item p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.92rem;
}

/* ---------- Trade Wire ---------- */

.trade-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 22px;
}

.trade-date {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 6px;
}

.trade-title {
  margin: 0 0 18px;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}

.trade-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.trade-side {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.trade-side-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 0.95rem;
}

.trade-side-header img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--border);
}

.trade-assets {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
}

.trade-none {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin: 0;
}

.asset-chip {
  width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.asset-chip-photo {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  overflow: visible;
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.asset-chip-photo img:first-child {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
}

.asset-chip-photo.pick-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
}

.asset-badge {
  position: absolute;
  bottom: -4px;
  right: -6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 2px solid var(--bg-elevated);
}

.asset-chip-name {
  margin-top: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.15;
}

.asset-chip-sub {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 1px;
}

.trade-grade {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.trade-grade .grade-letter {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--gold);
  flex-shrink: 0;
  min-width: 34px;
}

.trade-grade p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.4;
}

@media (max-width: 640px) {
  .trade-sides {
    grid-template-columns: 1fr;
  }
}

.empty-state {
  text-align: center;
  padding: 70px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
}

.empty-state h2 {
  color: var(--text);
  margin: 0 0 8px;
}

/* ---------- Placeholder ---------- */

.placeholder-box {
  text-align: center;
  padding: 90px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.placeholder-box h1 {
  margin: 0 0 10px;
  font-size: 1.6rem;
}

.placeholder-box p {
  color: var(--text-dim);
  margin: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 8px;
    display: none;
  }

  .main-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .standings-row {
    grid-template-columns: 32px 1fr;
  }

  .standings-record {
    grid-column: 1 / -1;
    text-align: left;
    padding-left: 44px;
    display: flex;
    gap: 10px;
    align-items: baseline;
  }

  .hero h1 {
    font-size: 1.8rem;
  }
}
