/* ═══════════════════════════════════════════════════════════
   global.css — Stop Time Games
   Shared styles for header, nav, back button, subnav,
   hero banners, page titles, and common buttons.
   Include on every page: <link rel="stylesheet" href="/global.css">
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;900&display=swap');

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:    #e10600;
  --red2:   #ff1e00;
  --dark:   #0d0d0d;
  --dark2:  #141414;
  --dark3:  #1c1c1c;
  --border: #252525;
  --border-color: #2e2e2e;
  --text:   #ffffff;
  --muted:  #888888;
  --accent: #e10600;
  --card-bg: #141414;

  /* ── Leaderboard / trophy accent ── */
  --gold:   #ff9800;
  --gold2:  #ffb74d;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════════ */
header {
  background: rgba(0, 0, 0, 0.85);
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-img {
  height: 40px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}

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

/* ── HEADER BUTTONS ───────────────────────────────────────── */
.back-link {
  color: #aaaaaa;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
}

.back-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

.nav-link {
  color: #aaaaaa;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}

.nav-home {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.nav-home:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

.logout-btn {
  background: transparent;
  color: #aaaaaa;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid rgba(225, 6, 0, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.logout-btn:hover {
  color: #ffffff;
  border-color: var(--red);
  background: rgba(225, 6, 0, 0.1);
}

.logout-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════════
   SUBNAV BAR
══════════════════════════════════════════════════════════ */
.nav-bar {
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid #2e2e2e;
  padding: 0 32px;
  display: flex;
  gap: 4px;
  position: sticky;
  top: 68px;
  z-index: 90;
  backdrop-filter: blur(8px);
}

.nav-bar-link {
  color: #777;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 11px 16px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-bar-link:hover {
  color: #fff;
  border-bottom-color: rgba(225, 6, 0, 0.5);
}

.nav-bar-link.active {
  color: #fff;
  border-bottom-color: #e10600;
}

.nav-bar-sep {
  color: #fff;
  font-size: 20px;
  font-weight: 400;
  display: flex;
  align-items: center;
  padding: 0 2px;
}

/* ══════════════════════════════════════════════════════════
   HERO BANNER
   Usage:
     <div class="hero">
       <div class="hero-inner">
         <div class="hero-text">
           <p class="hero-eyebrow">Section label</p>
           <h1 class="hero-title">Page Title</h1>
           <p class="hero-desc">Optional subtitle</p>
         </div>
         <!-- optional right-side action, e.g. btn-leaderboard -->
       </div>
     </div>
══════════════════════════════════════════════════════════ */
.hero {
  background: var(--dark2);
  border-bottom: 1px solid var(--border);
  padding: 22px 24px 18px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 100% at 0% 50%, rgba(225,6,0,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-text { flex: 1; }

/* Eyebrow — small red ALL-CAPS label above the title */
.hero-eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 5px;
  opacity: 0.9;
}

/*
  Hero title — 700 weight keeps the Inter letterforms clean and
  on-brand without the heavy slab look that 900 produces.
  clamp() scales smoothly from mobile to wide desktop.
*/
.hero-title {
  font-size: clamp(14px, 2vw, 20px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 4px;
}

/* Subtitle / description beneath the title */
.hero-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════
   LEADERBOARD BUTTON
   Matches the visual language of .card-btn-enter but uses
   the gold accent so it stands apart from primary red actions.

   Usage:
     <a class="btn-leaderboard" href="leaderboard.html">Leaderboard</a>
══════════════════════════════════════════════════════════ */
.btn-leaderboard {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--gold);
  border: 1.5px solid rgba(255, 152, 0, 0.55);
  padding: 9px 18px;
  border-radius: 6px;
  background: rgba(255, 152, 0, 0.07);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}



.btn-leaderboard:hover {
  background: rgba(255, 152, 0, 0.16);
  border-color: var(--gold);
  color: var(--gold2);
}

/* ── Legacy alias — keeps existing leaderboard-link markup working ── */
.leaderboard-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--gold);
  border: 1.5px solid rgba(255, 152, 0, 0.55);
  padding: 9px 18px;
  border-radius: 6px;
  background: rgba(255, 152, 0, 0.07);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  font-family: 'Inter', sans-serif;
}



.leaderboard-link:hover {
  background: rgba(255, 152, 0, 0.16);
  border-color: var(--gold);
  color: var(--gold2);
}

/* ══════════════════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════════════════ */
.page { flex: 1; }

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 28px 80px;
  width: 100%;
}

/* ══════════════════════════════════════════════════════════
   PAGE TITLE  (non-hero pages)
   A lighter-weight title treatment for pages that don't use
   the full hero banner — consistent with hero-title weight.
══════════════════════════════════════════════════════════ */
.page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

/* ══════════════════════════════════════════════════════════
   GRID
══════════════════════════════════════════════════════════ */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 800px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════════════════════
   CARD
══════════════════════════════════════════════════════════ */
.card {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(225, 6, 0, 0.15);
  border-color: var(--red);
}

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.card-title { font-weight: 700; font-size: 15px; color: #fff; line-height: 1.3; }
.card-desc { font-size: 12px; color: var(--muted); margin-bottom: 8px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: 12px; color: var(--muted); line-height: 1.9; }
.card-meta span { color: #cccccc; font-weight: 600; }
.card-footer { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; align-items: center; }

.card-action-row { display: flex; gap: 8px; margin: 10px 0 6px; align-items: stretch; }
.card-action-btn { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; font-weight: 700; font-family: 'Inter', sans-serif; text-transform: uppercase; letter-spacing: 1px; color: var(--red) !important; border: 1.5px solid var(--red); border-radius: 4px; padding: 7px 0; text-decoration: none !important; transition: all 0.2s; background: transparent; cursor: pointer; line-height: 1; box-sizing: border-box; }
.card-action-btn:hover { background: var(--red) !important; color: #fff !important; }

/* Leaderboard modifier — gold accent */
.card-action-btn--leaderboard {
  color: #ff9800 !important;
  border-color: rgba(255,152,0,0.5) !important;
  background: rgba(255,152,0,0.06) !important;
}
.card-action-btn--leaderboard:hover {
  background: rgba(255,152,0,0.16) !important;
  border-color: #ff9800 !important;
  color: #ffb74d !important;
}

/* Join / lineups modifier — green accent */
.card-action-btn--join {
  color: #4db850 !important;
  border-color: rgba(76,175,80,0.55) !important;
  background: rgba(76,175,80,0.07) !important;
}
.card-action-btn--join:hover {
  background: rgba(76,175,80,0.18) !important;
  border-color: #4db850 !important;
  color: #66bb6a !important;
}

.info-btn { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--red); border: 1.5px solid var(--red); border-radius: 4px; padding: 3px 8px; text-decoration: none; white-space: nowrap; transition: all 0.2s; flex-shrink: 0; }
.info-btn:hover { background: var(--red); color: #fff; }

.enter-events-btn { width: 100%; padding: 10px; background: var(--red); color: #fff; border: none; border-radius: 6px; font-weight: 700; font-size: 12px; cursor: pointer; transition: background 0.2s; text-transform: uppercase; letter-spacing: 1px; font-family: inherit; text-decoration: none; display: block; text-align: center; }
.enter-events-btn:hover { background: var(--red2); }

.btn-row { display: flex; gap: 8px; width: 100%; align-items: stretch; }
.btn-row .enter-events-btn,
.btn-row .enter-events-btn-outline,
.btn-row .card-action-btn { flex: 1; width: auto; box-sizing: border-box; }

.enter-events-btn-outline { padding: 10px; background: transparent; color: var(--red); border: 2px solid var(--red); border-radius: 6px; font-weight: 700; font-size: 12px; cursor: pointer; transition: all 0.2s; text-transform: uppercase; letter-spacing: 1px; font-family: inherit; text-decoration: none; display: block; text-align: center; }
.enter-events-btn-outline:hover { background: var(--red); color: #fff; }

/* ── PLAYER BADGE ────────────────────────────────────────── */
.player-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 600; }

/* ── STATUS / ERROR ──────────────────────────────────────── */
.status-msg { text-align: center; padding: 2rem; color: var(--muted); font-size: 1rem; font-weight: 600; }
.error-msg { color: #ff6b6b; text-align: center; padding: 1.5rem; font-weight: 600; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--red); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   COLLAPSIBLE SECTIONS
══════════════════════════════════════════════════════════ */
.section-wrap { margin-bottom: 20px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.section-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; background: var(--dark2); border: none; color: #fff; font-family: inherit; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; cursor: pointer; border-bottom: 2px solid transparent; transition: border-color 0.2s; }
.section-toggle:hover { border-bottom-color: var(--red); }
.section-toggle-left { display: flex; align-items: center; gap: 10px; }
.section-count { background: var(--dark3); border: 1px solid var(--border); border-radius: 10px; padding: 2px 8px; font-size: 11px; color: var(--muted); font-weight: 700; }
.toggle-icon { font-size: 10px; transition: transform 0.25s; display: inline-block; }
.section-toggle[aria-expanded="true"] .toggle-icon { transform: rotate(180deg); }
.section-body { display: none; padding: 20px; background: var(--dark); }
.section-body.open { display: block; }

/* ══════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════ */
footer {
  background: rgba(0, 0, 0, 0.7);
  padding: 18px;
  border-top: 1px solid rgba(225, 6, 0, 0.15);
  margin-top: auto;
}

.footer-inner { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; }
.footer-link { color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 500; letter-spacing: 0.3px; transition: color 0.15s; padding: 0 10px; border-right: 1px solid #333; line-height: 1.6; }
.footer-link:last-child { border-right: none; }
.footer-link:hover { color: #fff; }
.footer-copy { color: #555; font-size: 11px; letter-spacing: 0.5px; text-align: center; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .hero { padding: 18px 16px 14px; }
}

@media (max-width: 480px) {
  header { padding: 12px 16px; }
  .container { padding: 0 16px 60px; }
  .nav-bar { padding: 0 8px; overflow-x: auto; }
  .nav-bar-link { font-size: 12px; padding: 10px 11px; }
}

/* ── SUB-SUBNAV BAR (second-level tabs, e.g. email-manager) ── */
.sub-nav-bar {
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  position: sticky;
  top: 110px;   /* header ~68px + nav-bar ~42px */
  z-index: 80;
  backdrop-filter: blur(8px);
}

/* ══════════════════════════════════════════════════════════
   SPACING HELPERS
══════════════════════════════════════════════════════════ */
.nav-bar + * { margin-top: 16px; }
.sub-nav-bar + * { margin-top: 0; }
.sub-nav-bar ~ .page { padding-top: 24px; }
.sub-nav-bar ~ #detail-page { padding-top: 24px; }

/* ── FINISHERS PODIUM ─────────────────────────────────────────────────────── */

.finishers {
  margin: 8px 0 4px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: 'Inter', sans-serif;
}
.finisher-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 5px;
  line-height: 1;
}
.finisher-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
}
.finisher-rank {
  font-size: 12px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}
.finisher-rank.rank-1 { color: #FFD700; }
.finisher-rank.rank-2 { color: #C0C0C0; }
.finisher-rank.rank-3 { color: #CD7F32; }
.finisher-name {
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.finisher-stats {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 10px;
}
.finisher-pts {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
