/* DPL — Dallas Premier League */
/* Hand-rolled design system, derived from the DPL lion crest palette. */

/* ================================================================
   TOKENS
   ================================================================ */

:root {
  /* Brand — derived from DPL logo */
  --c-primary:       #3D1452;   /* rich royal purple (logo body) */
  --c-primary-dark:  #2B0E3B;
  --c-primary-mid:   #5A2D70;
  --c-gold:          #B89968;   /* logo gold base */
  --c-gold-deep:     #8B6E3F;
  --c-accent-red:    #9C2A3D;   /* muted brick (logo crown) — used sparingly */
  --c-success:       #2F7547;   /* muted forest green for wins */
  --c-warn:          #B8860B;   /* dark goldenrod */

  /* Ink + surface */
  --c-ink:           #1F0F2A;
  --c-ink-mid:       #5A4A65;
  --c-ink-light:     #8E7E99;
  --c-bg:            #F8F5EE;   /* warm cream */
  --c-bg-card:       #FFFFFF;
  --c-bg-soft:       #F1ECE2;
  --c-border:        #E8E0D5;
  --c-border-mid:    #C9BDB0;

  /* Spacing (4px base) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px;

  /* Type */
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --nav-h: 64px;
}

/* ================================================================
   RESET + BASE
   ================================================================ */

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 450;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  padding-top: var(--nav-h);
}

.stat, .pts, td, th {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-gold-deep); }

/* ================================================================
   NAV
   ================================================================ */

.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--c-primary);
  z-index: 100;
  display: flex;
  align-items: stretch;
  border-bottom: 3px solid var(--c-gold);
}

.nav-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
}

/* Left-side white panel housing the logo */
.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
  background: #FFFFFF;
  padding: 0 var(--sp-6) 0 var(--sp-5);
  border-right: 3px solid var(--c-gold);
  position: relative;
  transition: background 0.12s;
}

.nav-brand:hover { background: #FBF8F0; }

.nav-brand img {
  height: 46px;
  width: auto;
  display: block;
}

.nav-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.nav-brand__text strong {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--c-primary);
  letter-spacing: 0.01em;
}

.nav-brand__text span {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-gold-deep);
  margin-top: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  flex: 1;
  gap: 0;
  padding: 0 var(--sp-5);
}

.nav-links a {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  transition: color 0.12s;
  white-space: nowrap;
  position: relative;
}

.nav-links a:hover { color: #FFFFFF; }
.nav-links a.active { color: #FFFFFF; }

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: var(--sp-4);
  right: var(--sp-4);
  height: 3px;
  background: var(--c-gold);
}

/* ================================================================
   PAGE SHELL
   ================================================================ */

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--sp-10) var(--sp-5) var(--sp-16);
}

.page-narrow {
  max-width: 920px;
  margin: 0 auto;
  padding: var(--sp-10) var(--sp-5) var(--sp-16);
}

/* ================================================================
   PAGE HEADER
   ================================================================ */

.page-header {
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--c-border);
}

.page-header__eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-gold-deep);
  margin-bottom: var(--sp-2);
}

.page-header__title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--c-primary);
  line-height: 1.05;
}

.page-header__subtitle {
  margin-top: var(--sp-2);
  color: var(--c-ink-mid);
  font-size: 0.9375rem;
}

/* ================================================================
   SECTION LABELS
   ================================================================ */

.section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-ink-mid);
  margin-bottom: var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

/* ================================================================
   STANDINGS TABLE
   ================================================================ */

.standings-table-wrap {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid var(--c-border);
  background: var(--c-bg-card);
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--c-bg-card);
}

.standings-table thead {
  background: var(--c-primary);
  color: rgba(255,255,255,0.7);
}

.standings-table thead th {
  padding: var(--sp-3) var(--sp-3);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.standings-table thead th:first-child,
.standings-table thead th.col-team {
  text-align: left;
}

.standings-table tbody tr {
  border-bottom: 1px solid var(--c-border);
  transition: background 0.1s;
}

.standings-table tbody tr:last-child { border-bottom: none; }
.standings-table tbody tr:hover { background: var(--c-bg-soft); }

.standings-table tbody tr.is-you {
  background: rgba(184, 153, 104, 0.08);
}

.standings-table tbody tr.is-you:hover {
  background: rgba(184, 153, 104, 0.14);
}

.standings-table td {
  padding: var(--sp-3);
  text-align: right;
  white-space: nowrap;
}

.standings-table td.col-pos {
  width: 36px;
  color: var(--c-ink-light);
  font-weight: 700;
  text-align: center;
}

.standings-table td.col-team {
  text-align: left;
  min-width: 200px;
}

.team-cell { line-height: 1.25; }

.team-cell__fantasy {
  font-weight: 700;
  color: var(--c-ink);
  font-size: 0.9375rem;
}

.team-cell__owner {
  font-size: 0.75rem;
  color: var(--c-ink-light);
  font-weight: 500;
  margin-top: 1px;
}

.col-pts { font-weight: 700; color: var(--c-ink); }

/* Form pips */
.form-guide {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.form-pip {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

.form-pip.w { background: var(--c-success); }
.form-pip.l { background: var(--c-accent-red); opacity: 0.85; }
.form-pip.t { background: var(--c-border-mid); color: var(--c-ink-mid); }

/* ================================================================
   GW RESULTS GRID (home page)
   ================================================================ */

.gw-results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);   /* always 2 per row */
  gap: 14px;
  margin-bottom: var(--sp-8);
}

.gw-results-grid > a {
  display: block;
  text-decoration: none;
}

.gw-results-grid .match-card {
  height: 100%;   /* every card fills its grid cell */
}

@media (max-width: 760px) {
  .gw-results-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   MATCH CARDS (scoreline)
   ================================================================ */

.match-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  overflow: hidden;
}

.match-card__header {
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-primary);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.match-card__body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
}

.match-team {
  padding: var(--sp-4);
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.match-team--away {
  text-align: right;
  align-items: flex-end;
}

.match-team__fantasy {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--c-ink);
  line-height: 1.25;
}

.match-team__owner {
  font-size: 0.75rem;
  color: var(--c-ink-light);
  margin-top: 2px;
}

/* Defensive: when match cards are wrapped in an anchor, keep them block-level and inherit layout */
a > .match-card { display: block; text-decoration: none; color: inherit; }

.match-score {
  padding: var(--sp-3) var(--sp-5);
  text-align: center;
  border-left: 1px solid var(--c-border);
  border-right: 1px solid var(--c-border);
  background: var(--c-bg-soft);
  min-width: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.match-score__pts {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--c-ink);
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.match-score__pts span {
  color: var(--c-border-mid);
  margin: 0 4px;
  font-weight: 300;
}

.match-score__label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-ink-light);
  margin-top: 4px;
}

.match-card.winner-a .match-team:first-child .match-team__fantasy,
.match-card.winner-b .match-team:last-child .match-team__fantasy {
  color: var(--c-primary);
}

/* ================================================================
   GW TILES
   ================================================================ */

.gw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--sp-2);
}

.gw-tile {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: var(--sp-3) var(--sp-2);
  text-align: center;
  color: var(--c-ink);
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.12s;
}

.gw-tile:hover {
  border-color: var(--c-gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(61, 20, 82, 0.06);
}

.gw-tile .gw-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-primary);
}

.gw-tile .gw-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-ink-light);
}

/* ================================================================
   CLUB CARDS
   ================================================================ */

.clubs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-4);
}

.club-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.12s;
  display: flex;
  flex-direction: column;
}

.club-card:hover {
  border-color: var(--c-gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(61, 20, 82, 0.08);
}

.club-card__body {
  padding: var(--sp-5);
  flex: 1;
}

.club-card__pos {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--c-gold-deep);
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}

.club-card__fantasy {
  font-weight: 800;
  font-size: 1.0625rem;
  color: var(--c-ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.club-card__owner {
  font-size: 0.8125rem;
  color: var(--c-ink-light);
  margin-top: 4px;
}

.club-card__record {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-ink-mid);
  display: flex;
  justify-content: space-between;
}

.club-card__record b { color: var(--c-ink); font-weight: 700; }

/* ================================================================
   BADGES
   ================================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge--win  { background: rgba(47, 117, 71, 0.14);  color: var(--c-success); }
.badge--loss { background: rgba(156, 42, 61, 0.12);  color: var(--c-accent-red); }
.badge--gw   { background: var(--c-primary);         color: var(--c-gold); }
.badge--gold { background: var(--c-gold);            color: var(--c-primary-dark); }

/* Position colours — DB uses M/D/F/GK */
.pos-GK { background: #C28A2A; color: #2B1A04; }
.pos-D  { background: #2A6FB2; color: #FFFFFF; }
.pos-M  { background: #2F7547; color: #FFFFFF; }
.pos-F  { background: #9C2A3D; color: #FFFFFF; }

/* ================================================================
   STAT BAR
   ================================================================ */

.stat-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: var(--sp-6);
}

.stat-cell {
  background: var(--c-bg-card);
  padding: var(--sp-4) var(--sp-5);
}

.stat-cell__value {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--c-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-cell__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-ink-light);
  margin-top: var(--sp-2);
}

.stat-cell__sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-ink-mid);
  margin-top: 2px;
}

/* ================================================================
   FEATURED TEAM CARD
   ================================================================ */

.featured-card {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
  border-radius: 8px;
  padding: var(--sp-8);
  margin-bottom: var(--sp-10);
  position: relative;
  overflow: hidden;
}

.featured-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 280px;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(184, 153, 104, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.featured-card__eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: var(--sp-3);
  position: relative;
}

.featured-card__headline {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #FFFFFF;
  line-height: 1.15;
  position: relative;
}

.featured-card__sub {
  margin-top: var(--sp-2);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  position: relative;
}

.featured-card__body {
  margin-top: var(--sp-5);
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.65;
  max-width: 760px;
  position: relative;
}

.featured-card__stats {
  margin-top: var(--sp-6);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--sp-4);
  position: relative;
}

.featured-card__stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-gold);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.featured-card__stat-lab {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 6px;
}

.featured-card__cta {
  margin-top: var(--sp-6);
  display: inline-block;
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-gold);
  color: var(--c-primary-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  position: relative;
}

.featured-card__cta:hover {
  background: #D2B07F;
  color: var(--c-primary-dark);
}

/* ================================================================
   AWARDS GRID (stats / awards page)
   ================================================================ */

.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.award-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: var(--sp-5);
  position: relative;
  overflow: hidden;
}

.award-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--c-gold);
}

.award-card__title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-gold-deep);
  margin-bottom: var(--sp-2);
}

.award-card__value {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--c-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.award-card__meta {
  margin-top: var(--sp-2);
  font-size: 0.8125rem;
  color: var(--c-ink-mid);
}

.award-card__meta strong { color: var(--c-ink); }

/* ================================================================
   SUBSCRIBE BLOCK
   ================================================================ */

.subscribe-block {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: var(--sp-6) var(--sp-8);
  margin-top: var(--sp-10);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-6);
  align-items: center;
}

.subscribe-block__title {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--c-primary);
  letter-spacing: -0.01em;
}

.subscribe-block__sub {
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--c-ink-mid);
}

.subscribe-block__form {
  display: flex;
  gap: var(--sp-2);
}

.subscribe-block input[type="email"] {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 10px 14px;
  border: 1px solid var(--c-border-mid);
  border-radius: 4px;
  background: var(--c-bg);
  color: var(--c-ink);
  outline: none;
  min-width: 240px;
}

.subscribe-block input[type="email"]:focus {
  border-color: var(--c-gold);
  background: #FFFFFF;
}

.subscribe-block button {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 20px;
  background: var(--c-primary);
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s;
}

.subscribe-block button:hover {
  background: var(--c-primary-dark);
}

@media (max-width: 720px) {
  .subscribe-block { grid-template-columns: 1fr; }
  .subscribe-block__form { flex-direction: column; }
  .subscribe-block input[type="email"] { min-width: 0; width: 100%; }
}

/* ================================================================
   FOOTER
   ================================================================ */

.site-footer {
  background: var(--c-primary-dark);
  border-top: 3px solid var(--c-gold);
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.04em;
}

.site-footer a { color: rgba(255,255,255,0.65); }
.site-footer a:hover { color: var(--c-gold); }

/* ================================================================
   UTILITY
   ================================================================ */

.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.color-gold { color: var(--c-gold-deep); }
.color-success { color: var(--c-success); }
.color-loss { color: var(--c-accent-red); }
.color-muted { color: var(--c-ink-light); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 760px) {
  .nav-links a {
    padding: var(--sp-2);
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
  }
  .nav-brand__text { display: none; }
  .standings-table .col-hide-sm { display: none; }
}
