/* ═══════════════════════════════════════════════
   Pedal to the World Series — Dark Theme
   Navy: #0a1628  Orange: #f57c20
   ═══════════════════════════════════════════════ */

:root {
  --navy: #0a1628;
  --navy-light: #12203a;
  --navy-lighter: #1a2d4d;
  --navy-card: #0f1c32;
  --orange: #f57c20;
  --orange-light: #ff9a44;
  --orange-dark: #d96a10;
  --white: #f0f2f5;
  --gray: #8899aa;
  --gray-light: #aabbcc;
  --success: #2ecc71;
  --danger: #e74c3c;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --max-width: 1100px;
  --radius: 12px;
  --radius-sm: 8px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--orange-light); text-decoration: none; }
a:hover { color: var(--orange); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* ── Nav ────────────────────────────────── */
.nav {
  background: rgba(10, 22, 40, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(245, 124, 32, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
}

.nav-logo { font-size: 1.8rem; }

.nav-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 2px;
  line-height: 1.1;
  color: var(--orange);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--gray-light);
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--white); }

.nav-toggle { display: none; background: none; border: none; color: var(--white); font-size: 1.5rem; cursor: pointer; }

/* ── Buttons ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-accent {
  background: var(--orange);
  color: var(--navy);
}

.btn-accent:hover {
  background: var(--orange-light);
  color: var(--navy);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(245, 124, 32, 0.3);
}

.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.85rem; }

.btn-lg { padding: 1rem 2.5rem; font-size: 1.1rem; }

.btn-outline {
  background: transparent;
  border: 2px solid var(--orange);
  color: var(--orange);
}

.btn-outline:hover {
  background: var(--orange);
  color: var(--navy);
}

.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.1);
}

.btn-ghost:hover { background: rgba(255,255,255,0.1); }

/* ── Cards ──────────────────────────────── */
.card {
  background: var(--navy-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.card-featured {
  border-color: var(--orange);
  box-shadow: 0 0 30px rgba(245, 124, 32, 0.1);
}

/* ── Progress Bar ───────────────────────── */
.progress-wrap {
  background: var(--navy-lighter);
  border-radius: 50px;
  height: 28px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange-dark), var(--orange), var(--orange-light));
  border-radius: 50px;
  transition: width 1.5s ease;
  min-width: 2px;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-size: 0.8rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ── Hero ───────────────────────────────── */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: 3px;
  color: var(--white);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.hero h1 .accent { color: var(--orange); }

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--gray);
  max-width: 600px;
  margin: 1rem auto 2rem;
}

/* ── Section ────────────────────────────── */
.section { padding: 3rem 0; }

.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
  color: var(--white);
}

.section-title .accent { color: var(--orange); }

/* ── Grid ───────────────────────────────── */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ── Stats ──────────────────────────────── */
.stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.stat {
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--orange);
  letter-spacing: 1px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Tier Cards ─────────────────────────── */
.tier-card {
  text-align: center;
  padding: 2rem 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
}

.tier-card .tier-price {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--orange);
  letter-spacing: 1px;
}

.tier-card .tier-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.tier-card .tier-desc {
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

.tier-card .btn { width: 100%; }

/* ── Donation Wall ──────────────────────── */
.donor-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--navy-card);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.04);
}

.donor-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navy-lighter);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--orange);
  flex-shrink: 0;
}

.donor-info { flex: 1; min-width: 0; }
.donor-name { font-weight: 600; }
.donor-amount { color: var(--orange); font-weight: 700; }
.donor-message { color: var(--gray); font-size: 0.85rem; margin-top: 0.25rem; }
.donor-tier {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: rgba(245, 124, 32, 0.15);
  color: var(--orange);
}

/* ── Form ───────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 500; margin-bottom: 0.4rem; font-size: 0.9rem; }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--navy-lighter);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245, 124, 32, 0.15);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-hint { font-size: 0.8rem; color: var(--gray); margin-top: 0.25rem; }

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

/* ── Footer ─────────────────────────────── */
.main-content { flex: 1; }

.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: var(--gray);
  font-size: 0.85rem;
  margin-top: 3rem;
}

.footer-sub { font-size: 0.75rem; margin-top: 0.25rem; }

/* ── Responsive ─────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy); padding: 1rem; gap: 1rem; border-bottom: 1px solid rgba(245, 124, 32, 0.15); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .hero h1 { font-size: 2.5rem; }
  .stats { gap: 1rem; }
  .stat-value { font-size: 2rem; }
  .grid-3 { grid-template-columns: 1fr; }
}

/* ── Tables ─────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray);
  font-weight: 600;
}

td { font-size: 0.9rem; }

tr:hover td { background: rgba(255,255,255,0.02); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-completed { background: rgba(46, 204, 113, 0.15); color: var(--success); }
.badge-pending { background: rgba(255, 193, 7, 0.15); color: #ffc107; }
.badge-current { background: rgba(245, 124, 32, 0.2); color: var(--orange); }
.badge-queued { background: rgba(136, 153, 170, 0.15); color: var(--gray); }

/* ── Utility ────────────────────────────── */
.text-center { text-align: center; }
.text-orange { color: var(--orange); }
.text-gray { color: var(--gray); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }

/* ═══════════════════════════════════════════════
   Team page
   ═══════════════════════════════════════════════ */

.section-alt { background: var(--navy-light); }
.section-cta { padding: 4rem 0; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-light) 100%); }

.team-hero {
  padding: 3.5rem 0 3rem;
  background: var(--navy-light);
  text-align: center;
}

/* The team photo renders at its natural aspect ratio — no cover-crop, so no
   kid gets cut off. Height is bounded by max-height rather than by cropping,
   which letterboxes into the navy background instead of losing the frame. */
.team-photo-feature {
  margin: 2rem auto 0;
  max-width: 820px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--navy-lighter);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  line-height: 0;
}
.team-photo-feature img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 68vh;
  object-fit: contain;
  background: var(--navy);
}

.team-eyebrow {
  font-family: var(--font-display);
  letter-spacing: 0.18em;
  color: var(--orange);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.team-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 9vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
}
.team-hero h1 .accent { color: var(--orange); }

.team-hero .subtitle {
  color: var(--gray-light);
  margin-top: 0.75rem;
  font-size: 1.05rem;
}

.team-record {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.4rem 1.1rem;
  border: 1px solid var(--orange);
  border-radius: 999px;
  color: var(--orange-light);
  font-weight: 700;
  font-size: 0.95rem;
}

.team-hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.team-story { max-width: 760px; margin: 0 auto; }
.team-story-body { color: var(--gray-light); font-size: 1.05rem; }
.team-story-body p { margin-bottom: 1rem; }
.team-story-body p:last-child { margin-bottom: 0; }

/* ── Roster grid ─────────────────────────── */

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.player-grid-coaches { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.player-card {
  background: var(--navy-card);
  border: 1px solid var(--navy-lighter);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.player-card:hover { transform: translateY(-4px); border-color: var(--orange); }

.player-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--navy-lighter);
}
.player-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.player-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 3.5rem;
  opacity: 0.25;
}

.player-number {
  position: absolute;
  bottom: -0.5rem;
  right: 0.75rem;
  font-family: var(--font-display);
  font-size: 2.75rem;
  line-height: 1;
  color: var(--orange);
  text-shadow: 0 2px 12px rgba(10, 22, 40, 0.9);
}

.player-body { padding: 1rem 1rem 1.25rem; }

.player-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

.player-role { color: var(--orange-light); font-size: 0.85rem; font-weight: 600; margin-top: 0.15rem; }
.player-positions { color: var(--gray-light); font-size: 0.9rem; font-weight: 600; margin-top: 0.15rem; }
.player-meta { color: var(--gray); font-size: 0.8rem; margin-top: 0.35rem; }
.player-fact { color: var(--gray-light); font-size: 0.85rem; margin-top: 0.6rem; line-height: 1.5; }

.player-quote {
  margin-top: 0.75rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--orange);
  color: var(--white);
  font-size: 0.85rem;
  font-style: italic;
}

/* ── Gallery ─────────────────────────────── */

.team-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--navy-card);
}
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.gallery-item figcaption { padding: 0.6rem 0.75rem; font-size: 0.8rem; color: var(--gray); }

/* ── Squares explainer ───────────────────── */

.squares-blurb {
  max-width: 560px;
  margin: 0.75rem auto 0;
  color: var(--gray-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

.team-teaser-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.team-teaser-strip img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--navy-lighter);
}

@media (max-width: 600px) {
  .player-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
  .player-name { font-size: 1.25rem; }
  .player-number { font-size: 2rem; }
}

/* ═══════════════════════════════════════════════
   Squares grid cells + message tooltip
   ═══════════════════════════════════════════════ */

.sq-cell {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-radius: 4px;
  padding: 2px;
  font-size: 0.62rem;
  line-height: 1.15;
  color: var(--gray-light);
  text-align: center;
  overflow: hidden;
}

/* Names wrap to two lines: first above, surname below. Both clip with an
   ellipsis rather than spilling out of the cell. */
.sq-first, .sq-last {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sq-first { font-weight: 700; color: var(--white); }
.sq-last { font-size: 0.92em; color: var(--gray-light); }

/* A square carrying a note gets a dot, so it's discoverable without hovering
   every cell to find out which ones have something behind them. */
.sq-msg-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 1px rgba(10, 22, 40, 0.6);
}

.sq-cell.has-message { cursor: pointer; }
.sq-cell.has-message:hover, .sq-cell.has-message:focus-visible {
  border-color: var(--orange) !important;
  outline: none;
}

/* ── Tooltip ─────────────────────────────── */

#sq-tooltip {
  position: fixed;
  z-index: 300;
  max-width: 280px;
  padding: 0.7rem 0.85rem;
  background: var(--navy-lighter);
  border: 1px solid var(--orange);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
#sq-tooltip[data-open="true"] { opacity: 1; transform: translateY(0); }

#sq-tooltip .tip-name {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--orange-light);
}
#sq-tooltip .tip-coords {
  font-size: 0.72rem;
  color: var(--gray);
  margin-top: 0.1rem;
}
#sq-tooltip .tip-msg {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: var(--white);
  font-style: italic;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.msg-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--gray);
}
.msg-legend .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--orange); display: inline-block;
}

@media (max-width: 700px) {
  .sq-cell { font-size: 0.55rem; }
}
