/* ===== PIXEL SUNSET THEME ===== */
/* Palette from: parking lot at golden hour — night purple sky, burnt orange horizon, amber glow */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ice: #F0E4CC;
  --ice-mid: #CCB890;
  --blue: #3E1670;           /* deep purple */
  --blue-dark: #1C0B38;      /* night sky */
  --blue-light: #E8742A;     /* sunset orange (accent/links) */
  --gold: #F5C030;           /* amber */
  --gold-light: #FAD860;     /* bright amber */
  --red: #c0392b;
  --charcoal: #2a1545;
  --gray: #8a7a68;
  --gray-light: #EDE4D0;
  --win: #d5f5e3;
  --win-border: #27ae60;
  --loss: #fadbd8;
  --loss-border: #e74c3c;
  --ot: #fef9e7;
  --ot-border: #f39c12;
  --white: #FDF6E8;           /* warm parchment white */
  --text: #1A0E08;
  --text-muted: #6A5840;
  --shadow: 4px 4px 0 rgba(10,4,25,0.7);
  --shadow-lg: 5px 5px 0 rgba(10,4,25,0.75);
  --radius: 3px;
  --radius-lg: 5px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--blue-dark);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
}

a { color: var(--blue-light); text-decoration: none; }
a:hover { color: var(--gold); text-decoration: underline; }

/* ===== HEADER ===== */
.site-header {
  background: linear-gradient(180deg,
    #1C0B38 0%,
    #2E1258 20%,
    #6A2010 50%,
    #C04808 70%,
    #E8742A 84%,
    #F5A030 100%
  );
  color: var(--white);
  padding: 48px 24px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Pixel scanline overlay */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.07) 2px,
    rgba(0,0,0,0.07) 4px
  );
  pointer-events: none;
}

/* Amber glow line at base */
.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-light), var(--gold), transparent);
}

.header-inner { position: relative; max-width: 900px; margin: 0 auto; }

.team-name {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: clamp(3.2rem, 7vw, 5.5rem);
  font-weight: 400;
  letter-spacing: 3px;
  color: var(--gold-light);
  text-shadow: 3px 3px 0 rgba(0,0,0,0.65), 0 0 30px rgba(245,192,48,0.45);
  line-height: 1;
}
.team-formerly {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 1.35rem;
  color: rgba(240,228,200,0.82);
  letter-spacing: 1px;
  margin-top: 6px;
}
.header-league {
  font-size: 0.8rem;
  color: rgba(240,228,200,0.68);
  margin-top: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

.name-transition-badge {
  display: inline-block;
  background: rgba(245,192,48,0.18);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  border-radius: 3px;
  padding: 5px 14px;
  font-size: 0.82rem;
  margin-top: 14px;
}

.archive-notice {
  margin-top: 12px;
  font-size: 0.77rem;
  color: rgba(240,228,200,0.6);
}
.archive-notice span {
  background: rgba(0,0,0,0.28);
  border-radius: 3px;
  padding: 3px 10px;
}

/* ===== NAV ===== */
.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--blue-dark);
  border-bottom: 3px solid var(--gold);
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.sticky-nav::-webkit-scrollbar { display: none; }
.sticky-nav button {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--ice-mid);
  padding: 12px 22px;
  cursor: pointer;
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  font-weight: 400;
  white-space: nowrap;
  transition: all 0.15s;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
}
.sticky-nav button:hover { color: var(--white); background: rgba(245,192,48,0.08); }
.sticky-nav button.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold-light);
  background: rgba(245,192,48,0.1);
}

/* ===== MAIN CONTAINER ===== */
.main-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ===== SECTIONS ===== */
.section {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.18);
}
.section-header {
  background: linear-gradient(135deg, #3E1670 0%, #7A2B10 100%);
  color: var(--white);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-left: 4px solid var(--gold);
}
.section-header h2 {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: 1px;
}
.section-body { padding: 0; }

/* ===== CHART ===== */
.chart-wrapper {
  padding: 20px 24px;
  background: var(--gray-light);
}
#season-chart { max-height: 260px; }

/* ===== TABLES ===== */
.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
thead th {
  background: var(--blue-dark);
  color: var(--ice-mid);
  padding: 10px 12px;
  text-align: left;
  font-family: 'VT323', 'Courier New', monospace;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
}
thead th:hover { color: var(--gold-light); }
thead th.sorted { color: var(--gold); }
thead th.sorted::after { content: ' ↕'; font-size: 0.7em; }
tbody tr { border-bottom: 1px solid var(--gray-light); transition: background 0.1s; }
tbody tr:hover { background: rgba(232,116,42,0.07); }
tbody tr:last-child { border-bottom: none; }
td { padding: 9px 12px; vertical-align: middle; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.name-cell { font-weight: 600; }
td.team-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Highlight our team in standings */
tr.our-team { background: rgba(245,192,48,0.1) !important; }
tr.our-team td { font-weight: 600; }

/* ===== SEASON TABLE RESULT COLORS ===== */
tr.season-win { background: var(--win); }
tr.season-loss { background: var(--loss); }
tr.season-mid { background: var(--ot); }

/* ===== GAME ROWS ===== */
tr.game-win td:first-child { border-left: 3px solid var(--win-border); }
tr.game-loss td:first-child { border-left: 3px solid var(--loss-border); }
tr.game-ot td:first-child { border-left: 3px solid var(--ot-border); }
tr.game-pending td { color: var(--gray); }
.badge {
  display: inline-block;
  border-radius: 3px;
  padding: 2px 7px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-w { background: var(--win-border); color: #fff; }
.badge-l { background: var(--loss-border); color: #fff; }
.badge-ot { background: var(--ot-border); color: #fff; }
.badge-playoff { background: var(--blue); color: #fff; margin-left: 4px; font-size: 0.65rem; }
.badge-home { background: var(--blue-light); color: #fff; font-size: 0.7rem; }
.badge-away { background: var(--gray); color: #fff; font-size: 0.7rem; }

/* ===== SOURCE LINKS ===== */
.source-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--blue-light);
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}
.source-link:hover { color: var(--gold); text-decoration: underline; }
.source-link svg { flex-shrink: 0; }

/* ===== SEASON BROWSER ===== */
.season-selector {
  padding: 16px 24px;
  background: var(--gray-light);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.season-selector select {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 2px solid var(--ice-mid);
  font-size: 0.95rem;
  background: var(--white);
  cursor: pointer;
}
.season-selector select:focus { outline: none; border-color: var(--blue-light); }

.season-card {
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  border-bottom: 1px solid var(--gray-light);
}
.season-stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.stat-pill {
  background: var(--ice);
  border: 2px solid var(--ice-mid);
  border-radius: var(--radius);
  padding: 8px 14px;
  text-align: center;
  min-width: 64px;
  box-shadow: 2px 2px 0 rgba(10,4,25,0.2);
}
.stat-pill .val {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 1.65rem;
  font-weight: 400;
  color: var(--blue-dark);
  line-height: 1;
}
.stat-pill .lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 2px;
}
.standing-badge {
  background: var(--gold);
  color: var(--blue-dark);
  border-radius: var(--radius);
  padding: 10px 16px;
  text-align: center;
  font-weight: 700;
  white-space: nowrap;
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 1.5rem;
  box-shadow: 3px 3px 0 rgba(10,4,25,0.3);
}
.standing-badge .lbl {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  display: block;
  letter-spacing: 0.5px;
}

.source-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 24px;
  background: rgba(62,22,112,0.04);
  border-bottom: 1px solid var(--gray-light);
}

.section-sub-header {
  padding: 10px 24px 8px;
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--gray-light);
  background: var(--gray-light);
}

/* ===== CAREER PLAYER EXPAND ===== */
.player-row { cursor: pointer; }
.player-row:hover td { background: rgba(232,116,42,0.07) !important; }
.player-expand-row { display: none; background: var(--ice) !important; }
.player-expand-row.open { display: table-row; }
.player-expand-cell { padding: 0 !important; }
.player-expand-inner {
  padding: 12px 24px;
  font-size: 0.84rem;
}
.player-season-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}
.player-season-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 4px 8px;
  text-align: left;
  background: none;
  position: static;
  cursor: default;
}
.player-season-table td { padding: 4px 8px; border-bottom: 1px solid var(--ice-mid); }
.player-season-table tr:last-child td { border-bottom: none; }

/* ===== SHOW MORE BUTTON ===== */
.show-more-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--gray-light);
  border: none;
  color: var(--blue-light);
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s;
}
.show-more-btn:hover { background: var(--ice-mid); color: var(--blue-dark); }

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 0.8rem;
  color: rgba(240,228,200,0.5);
}
footer a { color: rgba(240,228,200,0.72); }
footer a:hover { color: var(--gold-light); }

/* ===== NAV ICON/TEXT SPANS ===== */
.nav-icon { font-size: 1em; }
.nav-short { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .sticky-nav { gap: 0; }
  .sticky-nav button {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 7px 2px 5px;
    gap: 2px;
    min-width: 0;
    font-size: 0.95rem;
  }
  .nav-icon { font-size: 1.45rem; line-height: 1; }
  .nav-text { display: none; }
  .nav-short {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    font-weight: 600;
    white-space: nowrap;
    color: inherit;
  }

  .season-card { grid-template-columns: 1fr; }
  .section-header { padding: 14px 16px; }
  td, th { padding: 8px 8px; }
  .season-selector { padding: 12px 16px; }
  .source-links-grid { padding: 10px 16px; }
  .player-expand-inner { padding: 10px 16px; }
  .stat-pill { min-width: 52px; padding: 6px 10px; }
  .stat-pill .val { font-size: 1.3rem; }
}
