/* ===================================================================
   ONIMS SPORT GALA 2026 — MANAGEMENT SYSTEM
   Brand: deep purple field + gold accents + holographic radar grid
   =================================================================== */

:root {
  /* Brand palette — light-to-dark vertical gradient (light at top for logo, deep at bottom) */
  --bg-deep:       #2a1c5e;   /* deepest purple — base color, fallback below the gradient */
  --bg-mid:        #3a2680;   /* mid-tone */
  --bg-soft:       #6b4ab8;   /* soft accent */
  --panel:         rgba(58, 38, 128, 0.55);
  --panel-2:       rgba(75, 50, 153, 0.45);
  --border:        rgba(220, 200, 255, 0.22);
  --border-strong: rgba(255, 200, 80, 0.5);

  --gold:          #ffc24a;
  --gold-deep:     #e89a18;
  --gold-soft:     #ffe199;

  --team-green:    #4ade80;
  --team-blue:     #5aa9ff;
  --team-red:      #ff5e6b;
  --team-yellow:   #ffd23f;

  --ink:           #f6f2ff;
  --ink-soft:      #c9bfee;
  --ink-mute:      #8c81b6;

  /* Typography */
  --font-display:  'Bebas Neue', 'Oswald', sans-serif;
  --font-body:     'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono:     'JetBrains Mono', monospace;
  --font-script:   'Caveat', cursive;

  /* Curves */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --shadow-soft:   0 12px 40px -12px rgba(0,0,0,0.5);
  --shadow-glow:   0 0 32px rgba(255, 194, 74, 0.25);
}

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

html, body {
  min-height: 100vh;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ===================== ANIMATED BACKGROUND ===================== */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background:
    /* Bright halo at top center — keeps the logo visible against purple */
    radial-gradient(700px 400px at 50% 0%, rgba(255, 255, 255, 0.5), transparent 60%),
    /* Soft side glows */
    radial-gradient(1000px 700px at 12% 12%, rgba(200, 170, 255, 0.28), transparent 60%),
    radial-gradient(900px 700px at 88% 18%, rgba(255, 210, 170, 0.16), transparent 60%),
    radial-gradient(1000px 900px at 50% 110%, rgba(120, 80, 200, 0.5), transparent 65%),
    /* Vertical gradient: light purple at top → strong purple at bottom.
       Top is light enough for the logo but not so bright that white text disappears. */
    linear-gradient(180deg,
      #b89cdd 0%,      /* light purple at the very top — logo area */
      #8c66c7 22%,     /* medium purple */
      #5d3aa8 50%,     /* mid-deep purple */
      #3a2680 78%,     /* strong purple */
      #2a1c5e 100%     /* deepest purple at the bottom */
    );
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.bg-radar {
  position: absolute;
  top: -200px; right: -200px;
  width: 700px; height: 700px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 60px, rgba(180,150,255,0.06) 60px 61px),
    conic-gradient(from 0deg, transparent 0deg, rgba(255,194,74,0.10) 30deg, transparent 60deg);
  animation: radarSpin 22s linear infinite;
  opacity: 0.5;
}

@keyframes radarSpin { to { transform: rotate(360deg); } }

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.32;
  animation: floatOrb 18s ease-in-out infinite;
}
.orb-1 { width: 380px; height: 380px; background: #b48cff; top: 10%; left: -100px; }
.orb-2 { width: 320px; height: 320px; background: #ffd6a8; bottom: 15%; right: -80px; animation-delay: -6s; }
.orb-3 { width: 260px; height: 260px; background: #6ee7a4; top: 60%; left: 35%; animation-delay: -12s; opacity: 0.15; }

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.1); }
}

/* ===================== SCREEN SYSTEM ===================== */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

.screen-login {
  display: none;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
}
.screen-login.active { display: grid; }

.app-shell { display: none; }
.app-shell.active { display: block; }

/* ===================== LOGIN SCREEN ===================== */
.login-wrap {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: fadeUp 0.7s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  position: relative;
  height: 96px;                /* slightly bigger so it's more prominent */
  max-width: 100%;
  width: auto;
  /* White halo behind logo — gives it contrast on any background */
  filter:
    drop-shadow(0 0 22px rgba(255, 255, 255, 0.55))
    drop-shadow(0 0 6px rgba(255, 255, 255, 0.85))
    drop-shadow(0 8px 28px rgba(255, 194, 74, 0.4));
  z-index: 1;
}

/* Soft round white "spotlight" wrapping the login logo */
.login-brand {
  position: relative;
}
.login-brand::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 200px;
  background: radial-gradient(ellipse at center,
              rgba(255, 255, 255, 0.55) 0%,
              rgba(255, 255, 255, 0.2) 35%,
              transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(8px);
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border-radius: 100px;
  background: rgba(255, 194, 74, 0.12);
  border: 1px solid rgba(255, 194, 74, 0.3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--gold-soft);
}
.brand-tag .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  50% { opacity: 0.4; transform: scale(1.3); }
}

.login-card {
  background: var(--panel);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 38px 34px 28px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.6;
}

.login-card-header { margin-bottom: 28px; }

.login-title {
  font-family: var(--font-display);
  font-size: 44px;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--ink);
}
.title-script {
  font-family: var(--font-script);
  font-size: 0.85em;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0;
}

.login-sub {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 14px;
}

/* Form fields */
.login-form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 7px; }

.field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  text-transform: uppercase;
}

.field-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 5, 30, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0 14px;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.field-wrap:focus-within {
  border-color: rgba(255, 194, 74, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 194, 74, 0.1);
  background: rgba(10, 5, 30, 0.75);
}

.field-icon {
  width: 18px; height: 18px;
  color: var(--ink-mute);
  flex-shrink: 0;
}
.field-wrap:focus-within .field-icon { color: var(--gold); }

.field-wrap input {
  flex: 1;
  padding: 14px 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0.01em;
}
.field-wrap input::placeholder { color: var(--ink-mute); opacity: 0.6; }

.eye-btn {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  color: var(--ink-mute);
  transition: color 0.2s, background 0.2s;
}
.eye-btn:hover { color: var(--gold); background: rgba(255,194,74,0.08); }
.eye-btn svg { width: 18px; height: 18px; }

/* Meta row */
.login-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 13px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.check input { accent-color: var(--gold); width: 14px; height: 14px; }
.link-muted {
  color: var(--ink-mute);
  transition: color 0.2s;
}
.link-muted:hover { color: var(--gold); }

/* Login button */
.btn-host {
  margin-top: 14px;
  position: relative;
  min-height: 52px;
}

.login-btn {
  position: relative;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #2a1500;
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 13px;
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(.34,1.56,.64,1),
              box-shadow 0.3s, filter 0.3s, top 0.4s, left 0.4s;
  box-shadow: 0 8px 24px -8px rgba(255, 194, 74, 0.6),
              inset 0 1px 0 rgba(255, 255, 255, 0.4);
  z-index: 5;
}
.login-btn:hover { filter: brightness(1.08); box-shadow: 0 12px 32px -8px rgba(255, 194, 74, 0.7); }
.login-btn:active { transform: scale(0.97); }

.login-btn .btn-arrow {
  width: 18px; height: 18px;
  transition: transform 0.3s;
}
.login-btn:hover .btn-arrow { transform: translateX(4px); }

.btn-glow {
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.login-btn:hover .btn-glow { opacity: 1; animation: shimmer 1.5s linear infinite; }
@keyframes shimmer {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(50%, 50%); }
}

/* DODGING STATE — button breaks free of layout */
.login-btn.dodging {
  position: fixed !important;
  width: 180px;
  z-index: 1000;
  transition: top 0.35s cubic-bezier(.34,1.56,.64,1),
              left 0.35s cubic-bezier(.34,1.56,.64,1),
              transform 0.35s, box-shadow 0.3s;
  box-shadow: 0 12px 40px -8px rgba(255, 100, 100, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: wobble 0.4s ease;
}
@keyframes wobble {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-4deg); }
  75%      { transform: rotate(4deg); }
}

/* Hint */
.hint {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
}
.hint code {
  padding: 2px 8px;
  background: rgba(255, 194, 74, 0.1);
  border: 1px solid rgba(255, 194, 74, 0.2);
  border-radius: 6px;
  color: var(--gold-soft);
}
.hint-key {
  padding: 2px 8px;
  background: rgba(180, 150, 255, 0.1);
  border-radius: 6px;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
}
.hint.error code { border-color: rgba(255, 100, 120, 0.5); color: #ff8090; background: rgba(255, 100, 120, 0.1); }

.login-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  text-transform: uppercase;
}

/* ===================== APP SHELL — TOPBAR ===================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 32px;
  background: rgba(42, 28, 94, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-logo {
  height: 40px;
  width: auto;
  filter:
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.5))
    drop-shadow(0 0 3px rgba(255, 255, 255, 0.8));
}
.topbar-title {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.topbar-title strong {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.topbar-title span {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--ink-mute);
  letter-spacing: 0.16em;
}

.topbar-nav {
  display: flex;
  gap: 4px;
  background: rgba(10, 5, 30, 0.5);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px;
}
.nav-link {
  padding: 9px 22px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  transition: color 0.2s, background 0.25s;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #2a1500;
  box-shadow: 0 4px 14px -4px rgba(255, 194, 74, 0.6);
}

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

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: rgba(40, 24, 88, 0.5);
  border: 1px solid var(--border);
  border-radius: 100px;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ff8a3c, #ffb347);
  color: #2a1500;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
}
.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.user-meta strong { font-size: 13px; color: var(--ink); }
.user-meta span { font-size: 10px; color: var(--ink-mute); letter-spacing: 0.1em; text-transform: uppercase; }

.logout-btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 100, 120, 0.1);
  border: 1px solid rgba(255, 100, 120, 0.25);
  color: #ff8090;
  transition: background 0.2s, transform 0.2s;
}
.logout-btn:hover { background: rgba(255, 100, 120, 0.22); transform: rotate(15deg); }
.logout-btn svg { width: 18px; height: 18px; }

/* ===================== PAGE HEROES ===================== */
.page-hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 32px 28px;
  text-align: center;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(180, 150, 255, 0.1);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.hero-tag .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 8px var(--gold);
}
.page-title {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 84px);
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 30%, #c9bfee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-title em {
  font-style: italic;
  font-family: var(--font-script);
  font-size: 0.6em;
  letter-spacing: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-sub {
  margin-top: 12px;
  color: var(--ink-soft);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Tier label */
.tier-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 40px 0 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--gold-soft);
}
.tier-label span {
  flex: 0 1 100px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,194,74,0.4), transparent);
}
.tier-label-thin {
  color: var(--ink-mute);
}
.tier-label-thin span {
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ===================== FOCAL PERSON CARD ===================== */
.focal-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.focal-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  padding: 32px 36px;
  background: linear-gradient(135deg, rgba(255,194,74,0.12), rgba(40,24,88,0.7));
  border: 1px solid rgba(255, 194, 74, 0.35);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,0.06);
}
.focal-card::before {
  content: '';
  position: absolute;
  top: -2px; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.focal-card::after {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 40px, rgba(255,194,74,0.06) 40px 41px);
  pointer-events: none;
}

.focal-avatar {
  width: 110px; height: 110px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #2a1500;
  font-family: var(--font-display);
  font-size: 42px;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 32px -4px rgba(255,194,74,0.5),
              inset 0 2px 0 rgba(255,255,255,0.4);
  position: relative;
  flex-shrink: 0;
}
.focal-avatar::before { content: attr(data-initials); }
.focal-avatar::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 194, 74, 0.4);
  animation: spin 24s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.focal-info { position: relative; z-index: 2; }

.focal-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(255, 194, 74, 0.18);
  border: 1px solid rgba(255, 194, 74, 0.4);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--gold-soft);
  text-transform: uppercase;
}
.focal-name {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 42px;
  letter-spacing: 0.03em;
  line-height: 1.05;
  color: var(--ink);
}
.focal-role {
  color: var(--gold-soft);
  font-size: 15px;
  margin-top: 4px;
  font-weight: 500;
}
.focal-meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-soft);
}
.focal-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.focal-meta svg { width: 14px; height: 14px; opacity: 0.7; }

/* ===================== MEMBERS GRID ===================== */
.members-grid {
  max-width: 1280px;
  margin: 0 auto 60px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.member-card {
  position: relative;
  padding: 22px 18px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  text-align: center;
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1),
              border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
  cursor: default;
  animation: cardIn 0.5s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.member-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 40px -16px rgba(0,0,0,0.6),
              0 0 0 1px rgba(255,194,74,0.2);
}

.member-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent, var(--gold));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  opacity: 0.85;
}

.member-avatar {
  width: 76px; height: 76px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 28px;
  color: #fff;
  letter-spacing: 0.04em;
  background: var(--avatar-bg, linear-gradient(135deg, #7b3fe4, #a060ff));
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.2),
              0 6px 18px -4px rgba(0,0,0,0.4);
  position: relative;
}
.member-avatar::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent, rgba(255,194,74,0.3));
  opacity: 0.45;
}

.member-name {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.1;
}
.member-role {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.member-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 2px 9px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  background: rgba(180, 150, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* Secretary gets a gold-tinted tag and subtle halo to match her rank */
.member-tag.tag-secretary {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  border-color: transparent;
  color: #2a1500;
  font-weight: 700;
  box-shadow: 0 4px 12px -4px rgba(255, 194, 74, 0.55);
}
.member-card.is-secretary {
  border-color: rgba(255, 194, 74, 0.38);
  background: linear-gradient(180deg, rgba(255, 194, 74, 0.08), var(--panel));
}
.member-card.is-secretary::before { background: var(--gold); }

/* ===================== MATCHES GRID ===================== */
.matches-grid {
  max-width: 1280px;
  margin: 20px auto 60px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.match-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(.34,1.56,.64,1),
              border-color 0.3s, box-shadow 0.3s;
  text-align: left;
  width: 100%;
  animation: cardIn 0.5s ease both;
}
.match-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent, var(--gold));
  box-shadow: 0 24px 48px -16px rgba(0,0,0,0.6),
              0 0 0 1px var(--accent, var(--gold));
}

.match-card-num {
  position: absolute;
  top: 16px; right: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--ink-mute);
}

.match-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--accent-soft, rgba(255,194,74,0.15));
  border: 1px solid var(--accent, var(--gold));
  color: var(--accent, var(--gold));
  transition: transform 0.4s;
}
.match-card:hover .match-icon { transform: rotate(-8deg) scale(1.05); }
.match-icon svg { width: 30px; height: 30px; }

.match-name {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--ink);
}
.match-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.match-meta-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent, var(--gold));
}

.match-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent, var(--gold));
  text-transform: uppercase;
  transition: gap 0.25s;
}
.match-card:hover .match-cta { gap: 12px; }
.match-cta svg { width: 14px; height: 14px; }

.match-card-bg {
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: var(--accent-soft, rgba(255,194,74,0.06));
  filter: blur(40px);
  pointer-events: none;
}

/* Poster band */
.poster-band {
  max-width: 1280px;
  margin: 0 auto 60px;
  padding: 0 32px;
}
.poster-band img {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: block;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  background: var(--panel);
  min-height: 120px;
  object-fit: cover;
}

/* ===================== DETAIL SCREEN ===================== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 28px 0 0 32px;
  padding: 10px 18px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.2s, gap 0.25s, border-color 0.2s;
}
.back-btn:hover { background: rgba(40,24,88,0.8); gap: 14px; border-color: var(--gold); color: var(--gold); }
.back-btn svg { width: 16px; height: 16px; }

.detail-hero {
  max-width: 1280px;
  margin: 32px auto 24px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
}

.detail-icon-large {
  width: 96px; height: 96px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  background: var(--accent-soft, rgba(255,194,74,0.15));
  border: 1px solid var(--accent, var(--gold));
  color: var(--accent, var(--gold));
}
.detail-icon-large svg { width: 48px; height: 48px; }

.detail-title-block { line-height: 1.05; }
.detail-tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.detail-title {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 64px);
  letter-spacing: 0.03em;
  color: var(--ink);
}
.detail-subtitle {
  color: var(--ink-soft);
  margin-top: 4px;
  font-size: 14px;
}

.detail-date-card {
  padding: 14px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-align: center;
}
.detail-date-card small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.detail-date-card strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold);
  letter-spacing: 0.04em;
}

/* Spec strip */
.spec-strip {
  max-width: 1280px;
  margin: 0 auto 32px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.spec-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.spec-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(180, 150, 255, 0.1);
  color: var(--gold);
}
.spec-icon svg { width: 18px; height: 18px; }
.spec-text small {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
  text-transform: uppercase;
  display: block;
}
.spec-text strong {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  letter-spacing: 0.04em;
}

/* Teams grid */
.teams-grid {
  max-width: 1280px;
  margin: 0 auto 40px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 20px;
}

.team-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  overflow: hidden;
  animation: cardIn 0.5s ease both;
}
.team-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--team-color);
  box-shadow: 0 0 16px var(--team-color);
}
.team-card::after {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 30px, rgba(180,150,255,0.04) 30px 31px);
  pointer-events: none;
}

.team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.team-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.team-name::before {
  content: '';
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--team-color);
  box-shadow: 0 0 12px var(--team-color);
}
.team-squad-count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
}
.team-squad-count strong { color: var(--gold); }

.captain-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(255,194,74,0.12), transparent);
  border: 1px solid rgba(255,194,74,0.3);
  border-radius: var(--r-md);
}
.captain-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #2a1500;
}
.captain-icon svg { width: 20px; height: 20px; }
.captain-info small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--gold-soft);
  text-transform: uppercase;
}
.captain-info strong {
  display: block;
  font-size: 17px;
  color: var(--ink);
  margin-top: 2px;
  font-weight: 600;
}
.captain-info span {
  display: block;
  font-size: 12px;
  color: var(--ink-mute);
}

.player-row-head {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  padding: 6px 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  text-transform: uppercase;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 4px;
}

.player-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 9px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 14px;
  transition: background 0.2s;
}
.player-row:last-of-type { border-bottom: none; }
.player-row:hover { background: rgba(180,150,255,0.04); }

.pos-badge {
  display: grid;
  place-items: center;
  height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.1em;
  border: 1px solid;
}
.pos-GK  { color: var(--gold);       border-color: rgba(255,194,74,0.4); background: rgba(255,194,74,0.08); }
.pos-DF  { color: var(--team-blue);  border-color: rgba(90,169,255,0.4); background: rgba(90,169,255,0.08); }
.pos-MF  { color: #c4a8ff;           border-color: rgba(196,168,255,0.4); background: rgba(196,168,255,0.08); }
.pos-C   { color: var(--team-green); border-color: rgba(74,222,128,0.4); background: rgba(74,222,128,0.08); }
.pos-A   { color: var(--team-red);   border-color: rgba(255,94,107,0.4); background: rgba(255,94,107,0.08); }
.pos-BT  { color: var(--team-blue);  border-color: rgba(90,169,255,0.4); background: rgba(90,169,255,0.08); }
.pos-B   { color: var(--team-red);   border-color: rgba(255,94,107,0.4); background: rgba(255,94,107,0.08); }
.pos-AR  { color: #c4a8ff;           border-color: rgba(196,168,255,0.4); background: rgba(196,168,255,0.08); }
.pos-WK  { color: var(--gold);       border-color: rgba(255,194,74,0.4); background: rgba(255,194,74,0.08); }
.pos-TBD { color: var(--ink-mute);   border-color: var(--border); background: rgba(180,150,255,0.05); }

.player-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
}
.player-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  margin-right: 4px;
}
.vc-badge {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.15em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255,194,74,0.15);
  border: 1px solid rgba(255,194,74,0.4);
  color: var(--gold-soft);
}

.dept-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(180,150,255,0.06);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  white-space: nowrap;
}

.reserves-block {
  margin-top: 16px;
  padding: 14px 14px 12px;
  background: rgba(10, 5, 30, 0.4);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
}
.reserves-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold-soft);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.reserves-head::before {
  content: '';
  width: 14px; height: 1px;
  background: var(--gold);
}
.reserve-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px;
  font-size: 13px;
  color: var(--ink-soft);
}
.reserve-row em { font-style: italic; opacity: 0.7; }

/* Empty state for sports without data */
.empty-state {
  max-width: 720px;
  margin: 0 auto 60px;
  padding: 60px 32px;
  text-align: center;
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: var(--r-xl);
}
.empty-icon {
  width: 80px; height: 80px;
  margin: 0 auto 18px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: var(--accent-soft, rgba(255,194,74,0.1));
  color: var(--accent, var(--gold));
}
.empty-icon svg { width: 36px; height: 36px; }
.empty-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.empty-text {
  margin-top: 8px;
  color: var(--ink-soft);
}

/* Position key */
.position-key {
  max-width: 1280px;
  margin: 0 auto 32px;
  padding: 16px 24px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}
.position-key strong {
  color: var(--gold-soft);
  letter-spacing: 0.2em;
  margin-right: 8px;
}
.key-item { display: inline-flex; align-items: center; gap: 6px; }

/* ===================================================================
   SCOREBOARD
   =================================================================== */

/* ---- Stats strip (games decided / in progress / reset) ---- */
.scoreboard-stats {
  max-width: 1280px;
  margin: 0 auto 28px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.stat-card small {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.stat-card strong {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1;
}
.stat-slash {
  font-size: 22px;
  color: var(--ink-mute);
  margin: 0 4px;
}
.stat-reset-wrap {
  justify-content: center;
  align-items: flex-end;
  padding: 18px;
}
.stat-reset-wrap .link-btn {
  margin: 0;
}

/* ---- Section block heads ---- */
.standings-wrap, .breakdown-wrap {
  max-width: 1280px;
  margin: 0 auto 36px;
  padding: 0 32px;
}
.block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.block-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.block-title svg { width: 20px; height: 20px; color: var(--gold); }
.block-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 100, 120, 0.08);
  border: 1px solid rgba(255, 100, 120, 0.25);
  border-radius: 100px;
  color: #ff8090;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.2s, color 0.2s;
}
.link-btn:hover { background: rgba(255, 100, 120, 0.18); color: #ffa0aa; }
.link-btn svg { width: 14px; height: 14px; }

/* ---- Standings table ---- */
.standings-table-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
}
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 560px;
}
.standings-table thead th {
  padding: 14px 12px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  text-transform: uppercase;
  background: rgba(10, 5, 30, 0.4);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.standings-table thead th.col-pos  { width: 70px; }
.standings-table thead th.col-team { text-align: left; padding-left: 22px; }
.standings-table thead th.col-pts  { color: var(--gold-soft); }

.standings-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.2s;
  animation: rowIn 0.4s ease both;
}
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.standings-table tbody tr:last-child { border-bottom: none; }
.standings-table tbody tr:hover { background: rgba(180,150,255,0.04); }

.standings-table td {
  padding: 14px 12px;
  text-align: center;
  color: var(--ink-soft);
}
.standings-table td.cell-pos {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}
.standings-table td.cell-team {
  text-align: left;
  padding-left: 22px;
}
.standings-table td.cell-pts {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold);
  letter-spacing: 0.05em;
}
.standings-table td.cell-diff.positive { color: #6ee7a4; }
.standings-table td.cell-diff.negative { color: #ff8090; }

.team-cell {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.team-cell::before {
  content: '';
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--team-color);
  box-shadow: 0 0 10px var(--team-color);
}

.standings-table tbody tr.rank-1 {
  background: linear-gradient(90deg, rgba(255,194,74,0.10), transparent 60%);
}
.standings-table tbody tr.rank-1 td.cell-pos { color: var(--gold); }

.rank-badge {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  background: rgba(180, 150, 255, 0.06);
  border: 1px solid var(--border);
}
.rank-1 .rank-badge {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #2a1500;
  border-color: transparent;
  box-shadow: 0 4px 12px -4px rgba(255,194,74,0.6);
}

/* ---- Per-game breakdown list ---- */
.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.breakdown-row {
  display: grid;
  grid-template-columns: 1fr auto 150px;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}
.breakdown-row::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--border);
}
.breakdown-row.decided {
  border-color: rgba(74, 222, 128, 0.3);
}
.breakdown-row.decided::before {
  background: var(--team-green);
}
.breakdown-row.progress {
  border-color: rgba(255, 194, 74, 0.3);
}
.breakdown-row.progress::before {
  background: var(--gold);
}
.bk-name {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.bk-points {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-weight: 700;
  padding: 4px 10px;
  background: rgba(255,194,74,0.08);
  border: 1px solid rgba(255,194,74,0.22);
  border-radius: 100px;
}
.bk-winner {
  text-align: right;
  display: flex;
  justify-content: flex-end;
}
.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  background: rgba(180, 150, 255, 0.06);
  border: 1px solid var(--border);
  text-transform: uppercase;
}
.status-pill.progress {
  color: var(--gold);
  background: rgba(255,194,74,0.08);
  border-color: rgba(255,194,74,0.3);
}

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 4, 20, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: backdropIn 0.2s ease;
}
.modal-backdrop.open { display: flex; }
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;                /* never taller than the screen */
  display: flex;
  flex-direction: column;          /* so the body can scroll while head stays */
  background: linear-gradient(180deg, #4a3299, #3a2680);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.08);
  overflow: hidden;
  animation: modalIn 0.35s cubic-bezier(.34,1.56,.64,1);
}

/* Modal body scrolls internally when content exceeds the modal's max-height */
.modal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  /* Custom scrollbar that matches the theme */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 194, 74, 0.4) transparent;
}
.modal-body::-webkit-scrollbar          { width: 8px; }
.modal-body::-webkit-scrollbar-track    { background: transparent; }
.modal-body::-webkit-scrollbar-thumb    { background: rgba(255, 194, 74, 0.3); border-radius: 4px; }
.modal-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 194, 74, 0.55); }

/* Header stays fixed at the top while body scrolls beneath it */
.modal-head {
  flex-shrink: 0;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.modal-head {
  padding: 22px 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}
.modal-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold-soft);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.modal-head h3 {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.modal-close {
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(180, 150, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  transition: background 0.2s, color 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.modal-close:hover { background: rgba(255, 100, 120, 0.15); color: #ff8090; transform: rotate(90deg); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body { padding: 28px 24px 12px; }

.match-edit {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}
.team-edit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  background: rgba(10, 5, 30, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.team-edit .team-label {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.05em;
  color: var(--ink);
  flex: 1;
}
.team-edit .team-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--team-color);
  box-shadow: 0 0 12px var(--team-color);
  flex-shrink: 0;
}
.team-edit .score-input {
  width: 70px;
  padding: 10px 8px;
  background: rgba(10, 5, 30, 0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 26px;
  text-align: center;
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  -moz-appearance: textfield;
}
.team-edit .score-input::-webkit-outer-spin-button,
.team-edit .score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.team-edit .score-input:focus {
  border-color: var(--gold);
  background: rgba(10, 5, 30, 0.9);
}

.vs-divider {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--ink-mute);
  padding: 0 4px;
}

.modal-hint {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.modal-foot {
  padding: 16px 24px 22px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  background: rgba(10, 5, 30, 0.3);
  flex-wrap: wrap;
}
.btn-ghost, .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s, filter 0.2s;
  cursor: pointer;
}
.btn-ghost {
  background: rgba(180, 150, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--ink-soft);
}
.btn-ghost:hover { background: rgba(255, 100, 120, 0.12); color: #ff9090; border-color: rgba(255, 100, 120, 0.25); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #2a1500;
  border: none;
  box-shadow: 0 6px 18px -6px rgba(255, 194, 74, 0.6);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost svg, .btn-primary svg { width: 14px; height: 14px; }

/* Toast for save confirmation */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  z-index: 1100;
  padding: 12px 22px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #2a1500;
  border-radius: 100px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 30px -8px rgba(255, 194, 74, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1), opacity 0.3s;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast svg { width: 14px; height: 14px; }

/* Responsive scoreboard tweaks */
@media (max-width: 720px) {
  .standings-wrap, .breakdown-wrap, .scoreboard-stats { padding-left: 18px; padding-right: 18px; }
  .standings-table { font-size: 12px; }
  .standings-table thead th { padding: 10px 6px; font-size: 9px; letter-spacing: 0.16em; }
  .standings-table td { padding: 10px 6px; }
  .standings-table td.cell-team { padding-left: 14px; }
  .team-cell { font-size: 14px; gap: 8px; }
  .team-cell::before { width: 10px; height: 10px; }
  .standings-table td.cell-pts { font-size: 18px; }
  .fixtures-grid, .breakdown-row { grid-template-columns: 1fr; }
  .breakdown-row { text-align: left; }
  .bk-winner { justify-content: flex-start; }
  .scoreboard-stats { grid-template-columns: 1fr 1fr; }
  .stat-reset-wrap { grid-column: 1 / -1; }
  .modal-card { max-width: 100%; }
  .match-edit { grid-template-columns: 1fr; }
  .team-edit.right { flex-direction: row; text-align: left; }
  .vs-divider { text-align: center; padding: 4px 0; }
}

/* ===================== FOOTER ===================== */
.app-footer {
  margin-top: 60px;
  padding: 36px 32px 24px;
  background: rgba(10, 5, 30, 0.5);
  border-top: 1px solid var(--border);
}
.footer-row {
  max-width: 1280px;
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer-col strong {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold-soft);
  text-transform: uppercase;
}
.footer-col span { color: var(--ink); font-weight: 500; }
.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--ink-mute);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    padding: 12px 18px;
    gap: 12px;
  }
  .topbar-nav { order: 3; flex: 1 1 100%; justify-content: center; }
  .nav-link { padding: 8px 16px; font-size: 12px; }
  .user-meta { display: none; }

  .page-hero { padding: 36px 18px 20px; }
  .focal-section, .members-grid, .matches-grid, .poster-band,
  .detail-hero, .spec-strip, .teams-grid, .position-key { padding-left: 18px; padding-right: 18px; }

  .focal-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 28px 22px;
  }
  .focal-avatar { margin: 0 auto; }
  .focal-meta { justify-content: center; }

  .detail-hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 18px;
  }
  .detail-icon-large { margin: 0 auto; }

  .teams-grid { grid-template-columns: 1fr; }

  .back-btn { margin-left: 18px; }
}

@media (max-width: 540px) {
  .members-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .member-card { padding: 18px 12px 14px; }
  .member-avatar { width: 60px; height: 60px; font-size: 22px; }
  .member-name { font-size: 16px; }
  .matches-grid { grid-template-columns: 1fr; }
  .focal-name { font-size: 32px; }
  .player-row, .player-row-head { grid-template-columns: 42px 1fr auto; gap: 8px; font-size: 12px; }
  .dept-tag { font-size: 9px; padding: 2px 6px; }
  .login-card { padding: 28px 22px; }
  .login-title { font-size: 36px; }
}

/* Selection */
::selection { background: var(--gold); color: #2a1500; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(180,150,255,0.2); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,194,74,0.4); }


/* ===================================================================
   v2 ADDITIONS — SUB-EVENTS, ACTION BAR, BRACKET, INSTRUCTIONS
   =================================================================== */

/* ---- Race sub-events grid ---- */
.sub-events-grid {
  max-width: 1280px;
  margin: 0 auto 28px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.sub-event-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px 22px 18px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), border-color 0.25s, box-shadow 0.25s;
  opacity: 0;
  animation: fadeUp 0.45s ease forwards;
}
.sub-event-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 90%);
}
.sub-event-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.6), 0 0 0 1px var(--accent-soft);
}
.sub-event-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.sub-event-name {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.03em;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.15;
}
.sub-event-points {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.sub-event-card .match-cta {
  margin-top: 0;
}


/* ---- Action bar (Instructions + Reset) ---- */
.action-bar {
  max-width: 1280px;
  margin: 0 auto 20px;
  padding: 0 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s;
}
.action-btn:hover {
  color: var(--ink);
  border-color: var(--gold);
  transform: translateY(-2px);
}
.action-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.action-btn-reset {
  margin-left: auto;
  color: var(--ink-mute);
}
.action-btn-reset:hover {
  color: var(--team-red);
  border-color: var(--team-red);
}


/* ---- Bracket section ---- */
.bracket-section {
  max-width: 1280px;
  margin: 0 auto 28px;
  padding: 0 32px;
}
.bracket-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 14px;
  margin-top: 16px;
}
.match-cell {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 20px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  text-align: left;
}
.match-cell:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 16px 36px -16px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,194,74,0.18);
}
.match-cell.is-final {
  grid-column: 1 / -1;
  border-color: rgba(255,194,74,0.4);
  background: linear-gradient(180deg, rgba(255,194,74,0.06), var(--panel) 60%);
}
.match-cell.played {
  border-color: rgba(74,222,128,0.32);
}
.match-cell.played::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--team-green);
}
.match-cell.is-final.played::before { background: var(--gold); }
.match-cell.no-teams {
  cursor: not-allowed;
  opacity: 0.6;
}
.match-cell.no-teams:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

.match-cell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.cell-status {
  padding: 3px 9px;
  border-radius: 100px;
  background: rgba(180, 150, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  letter-spacing: 0.16em;
}
.cell-status.done {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.3);
  color: var(--team-green);
}
.cell-status.muted {
  color: var(--ink-mute);
  opacity: 0.8;
}

.match-cell-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.cell-team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.cell-team.right {
  flex-direction: row-reverse;
  text-align: right;
}
.team-dot {
  width: 12px; height: 12px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--team-color);
  box-shadow: 0 0 10px var(--team-color);
}
.team-label {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.05em;
  color: var(--ink);
  white-space: nowrap;
}
.cell-team.loser .team-label { color: var(--ink-mute); }
.cell-team.winner .team-label { color: var(--gold); }

.cell-score {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.04em;
  color: var(--ink);
  min-width: 70px;
  text-align: center;
}
.unplayed-label {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
  color: var(--gold-soft);
  padding: 4px 10px;
  background: rgba(255,194,74,0.08);
  border: 1px solid rgba(255,194,74,0.2);
  border-radius: 100px;
  white-space: nowrap;
}


/* ---- Champion banner ---- */
.champion-banner {
  margin-top: 16px;
  padding: 20px 26px;
  background: linear-gradient(135deg, var(--team-color)22, var(--panel) 80%);
  border: 1px solid var(--team-color);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 40px -20px var(--team-color);
}
.champion-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at right center, var(--team-color)22 0%, transparent 70%);
  pointer-events: none;
}
.champion-crown {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #2a1500;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px -6px rgba(255,194,74,0.5);
}
.champion-crown svg { width: 26px; height: 26px; }
.champion-banner small {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  text-transform: uppercase;
  display: block;
  margin-bottom: 3px;
}
.champion-banner strong {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.04em;
  color: var(--ink);
  display: block;
  margin-bottom: 3px;
}
.champion-banner span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--gold);
}


/* ---- Shared reserves (Badminton) ---- */
.shared-reserves {
  max-width: 1280px;
  margin: 16px auto 28px;
  padding: 18px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.shared-reserves .reserves-head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 10px;
}


/* ---- Wider modal variant for instructions ---- */
.modal-card-wide {
  max-width: 560px;
  /* Let the instructions modal grow up to 90% of the viewport, then scroll */
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-card-wide .modal-head {
  flex-shrink: 0;   /* keep header/close-button pinned at top */
}
.modal-card-wide .instr-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;    /* required so flex child respects overflow */
}
.instr-body { padding: 0 24px 24px; }

.instr-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.instr-meta-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(180, 150, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.instr-meta-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,194,74,0.15), rgba(180,150,255,0.1));
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.instr-meta-icon svg { width: 18px; height: 18px; }
.instr-meta-card small {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
.instr-meta-card strong {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  display: block;
}

.instr-rules-block {
  padding: 16px 18px;
  background: rgba(180, 150, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.rules-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.rules-head svg { width: 14px; height: 14px; }
.rules-list {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}
.rules-list li::marker {
  color: var(--gold);
  font-family: var(--font-mono);
  font-weight: 700;
}


/* ---- Mobile overrides for new components ---- */
@media (max-width: 720px) {
  .bracket-grid { grid-template-columns: 1fr; }
  .match-cell.is-final { grid-column: 1; }
  .cell-score { font-size: 22px; min-width: 50px; }
  .team-label { font-size: 15px; }
  .champion-banner { flex-direction: column; text-align: center; gap: 12px; }
  .instr-meta-grid { grid-template-columns: 1fr; }
  .sub-events-grid { padding: 0 18px; grid-template-columns: 1fr; }
  .action-bar { padding: 0 18px; }
  .bracket-section { padding: 0 18px; }
  .action-btn-reset { margin-left: 0; }

  /* Fit standings table on narrow phones — no horizontal scroll */
  .standings-table { min-width: 0; font-size: 13px; }
  .standings-table thead th { padding: 12px 6px; font-size: 9px; letter-spacing: 0.14em; }
  .standings-table td { padding: 12px 6px; }
  .standings-table thead th.col-pos { width: 44px; }
  .standings-table td.cell-team, .standings-table thead th.col-team { padding-left: 10px; }
  .standings-table td.cell-pts { font-size: 18px; }
}


/* ===================================================================
   v3 ADDITIONS — PUBLIC / ADMIN MODE STYLES
   =================================================================== */

/* Hide admin-only elements when body is in public mode */
body.public-mode .admin-only       { display: none !important; }

/* Hide the "Reset all scores" button for students */
body.public-mode #resetScoresBtn   { display: none !important; }

/* Hide the logout button for students (they never logged in) */
body.public-mode #logoutBtn        { display: none !important; }

/* In public mode, match cells shouldn't look clickable */
body.public-mode .match-cell {
  cursor: default;
}
body.public-mode .match-cell:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}
body.public-mode .match-cell.played:hover {
  border-color: rgba(74, 222, 128, 0.32);
}

/* Disable text selection everywhere except form inputs (public mode only) */
body.public-mode {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
body.public-mode input,
body.public-mode textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Small subtle tag in the header for admin mode so admin knows they're in edit mode */
body.admin-mode .gala-title-wrap::after {
  content: "ADMIN";
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  padding: 2px 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #2a1500;
  border-radius: 100px;
  margin-left: 10px;
  font-weight: 700;
  vertical-align: middle;
}


/* ===================================================================
   v4 ADDITIONS — DISCIPLINARY COMMITTEE, POSITION PILL, LIVE SCREEN
   =================================================================== */

/* ---- Disciplinary committee grid (shown on every game's detail page) ---- */
.committee-grid {
  max-width: 1280px;
  margin: 0 auto 48px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.committee-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  animation: cardIn 0.5s ease both;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.committee-card:hover {
  border-color: rgba(255, 194, 74, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -18px rgba(0,0,0,0.55);
}
.committee-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.committee-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.committee-icon {
  width: 42px; height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #2a1500;
}
.committee-icon svg { width: 22px; height: 22px; }
.committee-head small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--gold-soft);
  text-transform: uppercase;
}
.committee-head strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.15;
}
.committee-resp,
.committee-members {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.committee-resp small,
.committee-members small {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.committee-resp span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.committee-members ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.committee-members li {
  font-size: 12px;
  padding: 4px 10px;
  background: rgba(180, 150, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--ink-soft);
}

/* ---- Position pill on the master scoreboard ---- */
.standings-table thead th.col-position {
  text-align: center;
  color: var(--gold-soft);
}
.standings-table td.cell-position {
  text-align: center;
  white-space: nowrap;
}
.position-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: rgba(180, 150, 255, 0.06);
  color: var(--ink-soft);
}
.position-pill.position-1 {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #2a1500;
  border-color: transparent;
  box-shadow: 0 4px 14px -4px rgba(255, 194, 74, 0.65);
}
.position-pill.position-2 {
  background: linear-gradient(135deg, #d4d4d4, #a3a3a3);
  color: #1f1f1f;
  border-color: transparent;
  box-shadow: 0 4px 12px -4px rgba(180, 180, 180, 0.5);
}
.position-pill.position-3 {
  background: linear-gradient(135deg, #d27d3a, #a85a1d);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px -4px rgba(210, 125, 58, 0.55);
}
.position-pill.position-4 {
  background: rgba(180, 150, 255, 0.1);
  color: var(--ink-mute);
}

/* ---- Live auto-rotating screen ---- */
.live-stage {
  max-width: 1280px;
  margin: 0 auto 60px;
  padding: 0 32px;
}

.live-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.live-progress-wrap {
  flex: 1;
  min-width: 220px;
  height: 4px;
  background: rgba(180, 150, 255, 0.15);
  border-radius: 100px;
  overflow: hidden;
}
.live-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  transition: width 0.12s linear;
  box-shadow: 0 0 12px rgba(255, 194, 74, 0.6);
}
.live-control-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}
.live-btn {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(180, 150, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  transition: background 0.2s, color 0.2s, transform 0.2s;
  cursor: pointer;
}
.live-btn:hover {
  background: rgba(255, 194, 74, 0.15);
  color: var(--gold);
  transform: scale(1.05);
}
.live-btn svg { width: 16px; height: 16px; }
.live-btn-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  text-transform: uppercase;
  padding: 0 10px;
}
.live-btn-counter strong { color: var(--gold); }

.live-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  padding: 36px 36px 32px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  animation: liveSlide 0.5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes liveSlide {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.live-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.live-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.live-icon-large {
  width: 80px; height: 80px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: var(--accent-soft, rgba(255,194,74,0.15));
  border: 1px solid var(--accent, var(--gold));
  color: var(--accent, var(--gold));
  flex-shrink: 0;
}
.live-icon-large svg { width: 44px; height: 44px; }
.live-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--gold-soft);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.live-eyebrow .pulse-dot {
  width: 8px; height: 8px;
  background: #ff5e6b;
  border-radius: 50%;
  box-shadow: 0 0 12px #ff5e6b;
  animation: pulse 1.2s ease-in-out infinite;
}
.live-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: 0.03em;
  color: var(--ink);
  line-height: 1;
}
.live-subtitle {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 14px;
}
.live-date-card {
  padding: 14px 20px;
  background: rgba(10, 5, 30, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-align: center;
  flex-shrink: 0;
}
.live-date-card small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.live-date-card strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold);
  letter-spacing: 0.04em;
}

/* Match line-up inside the live card */
.live-matches-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 12px;
  margin-bottom: 20px;
}
.live-match {
  background: rgba(10, 5, 30, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 18px;
}
.live-match.is-final {
  grid-column: 1 / -1;
  border-color: rgba(255, 194, 74, 0.4);
  background: linear-gradient(180deg, rgba(255, 194, 74, 0.08), rgba(10, 5, 30, 0.4) 70%);
}
.live-match-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.live-match-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.live-match-team {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.live-match-team.right { flex-direction: row-reverse; text-align: right; }
.live-match-team .team-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--team-color);
  box-shadow: 0 0 8px var(--team-color);
}
.live-match-team.winner { color: var(--gold); }
.live-match-team.loser  { color: var(--ink-mute); }
.live-match-score {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--ink);
  min-width: 60px;
  text-align: center;
}
.live-match-pending {
  font-size: 9px;
  font-family: var(--font-mono);
  letter-spacing: 0.16em;
  color: var(--gold-soft);
  padding: 3px 8px;
  background: rgba(255, 194, 74, 0.08);
  border: 1px solid rgba(255, 194, 74, 0.2);
  border-radius: 100px;
  white-space: nowrap;
}

/* Scoreboard mini-strip inside live card */
.live-mini-board {
  margin-top: 8px;
  padding: 18px 22px;
  background: rgba(10, 5, 30, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.live-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold-soft);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.live-mini-rows {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.live-mini-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: rgba(180, 150, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  text-align: center;
}
.live-mini-row.lead {
  border-color: rgba(255, 194, 74, 0.4);
  background: rgba(255, 194, 74, 0.08);
}
.live-mini-rank {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
}
.live-mini-row.lead .live-mini-rank { color: var(--gold); }
.live-mini-team {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.live-mini-team .team-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--team-color);
  box-shadow: 0 0 6px var(--team-color);
}
.live-mini-pts {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--gold);
}

/* Empty state when no live competitions left */
.live-empty {
  text-align: center;
  padding: 80px 32px;
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: var(--r-xl);
}
.live-empty-icon {
  width: 88px; height: 88px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #2a1500;
  box-shadow: 0 12px 32px -8px rgba(255, 194, 74, 0.6);
}
.live-empty-icon svg { width: 44px; height: 44px; }
.live-empty h3 {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 8px;
}
.live-empty p {
  color: var(--ink-soft);
  max-width: 420px;
  margin: 0 auto;
}

/* Mobile tweaks for the new components */
@media (max-width: 720px) {
  .live-stage { padding: 0 18px; }
  .live-card { padding: 24px 22px; }
  .live-card-head { grid-template-columns: 1fr; gap: 14px; text-align: center; }
  .live-icon-large { margin: 0 auto; }
  .live-matches-grid { grid-template-columns: 1fr; }
  .live-match.is-final { grid-column: 1; }
  .live-mini-rows { grid-template-columns: 1fr 1fr; }
  .committee-grid { padding: 0 18px; grid-template-columns: 1fr; }

  /* Position column on phones — keep label compact */
  .position-pill { font-size: 9px; padding: 4px 9px; letter-spacing: 0.12em; }
  .standings-table thead th.col-position { padding: 12px 4px; }
  .standings-table td.cell-position { padding: 10px 4px; }
}

/* Login screen logo got bigger; tighten its container on small phones */
@media (max-width: 540px) {
  .brand-logo { height: 80px; }
  .login-brand::before { width: 220px; height: 160px; top: -28px; }
}

/* ===================================================================
   GALA POSTER COMPONENT — embedded inside #matchesScreen
   ===================================================================
   Replaces the old static <img> poster-band. All class names are
   prefixed with `gp-` so they cannot clash with existing app styles
   (.match-card, .hero-tag, .tier-label, etc.).

   This file uses the design tokens already defined in :root of
   styles.css (--gold, --ink, --panel, --font-display, etc.) so it
   stays in sync with the rest of the management system.

   Append this file to your styles.css OR <link> it after styles.css.
   =================================================================== */


/* ---------- OUTER POSTER FRAME ---------- */
.gp-poster {
  max-width: 1080px;
  margin: 0 auto 60px;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(700px 400px at 50% 0%,   rgba(255,255,255,0.45), transparent 60%),
    radial-gradient(900px 700px at 12% 14%,  rgba(200,170,255,0.28), transparent 60%),
    radial-gradient(900px 700px at 88% 22%,  rgba(255,210,170,0.16), transparent 60%),
    radial-gradient(900px 800px at 50% 105%, rgba(120, 80,200,0.45), transparent 65%),
    linear-gradient(180deg,
      #b89cdd 0%,
      #8c66c7 22%,
      #5d3aa8 50%,
      #3a2680 78%,
      #2a1c5e 100%);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5),
              inset 0 1px 0 rgba(255,255,255,0.06);
}

/* Holographic grid overlay */
.gp-poster::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

/* Radar sweep + floating orbs */
.gp-radar {
  position: absolute;
  top: -200px; right: -200px;
  width: 700px; height: 700px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 60px, rgba(180,150,255,0.06) 60px 61px),
    conic-gradient(from 0deg, transparent 0deg, rgba(255,194,74,0.1) 30deg, transparent 60deg);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.gp-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.32;
  pointer-events: none;
  z-index: 0;
}
.gp-orb-1 { width: 380px; height: 380px; background: #b48cff; top: 12%; left: -100px; }
.gp-orb-2 { width: 320px; height: 320px; background: #ffd6a8; bottom: 14%; right: -80px; }
.gp-orb-3 { width: 260px; height: 260px; background: #6ee7a4; top: 56%; left: 35%; opacity: 0.15; }


/* ---------- HEADER (full ONIMS lockup) ---------- */
.gp-header {
  position: relative;
  z-index: 1;
  padding: 28px 60px 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.gp-header img {
  width: 86%;
  max-width: 820px;
  height: auto;
  filter:
    drop-shadow(0 0 18px rgba(255,255,255,0.4))
    drop-shadow(0 0 6px rgba(255,255,255,0.6));
}


/* ---------- HERO ---------- */
.gp-hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 36px 40px 16px;
}

/* Circular seal as subtle watermark behind the title */
.gp-hero-seal {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 320px;
  opacity: 0.09;
  pointer-events: none;
  filter: drop-shadow(0 0 30px rgba(255,194,74,0.35));
  z-index: -1;
}

.gp-hero-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 18px;
  border-radius: 100px;
  background: rgba(255, 194, 74, 0.12);
  border: 1px solid rgba(255, 194, 74, 0.3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--gold-soft);
  margin-bottom: 16px;
  text-transform: uppercase;
}
.gp-hero-tag .gp-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

.gp-hero-title {
  position: relative;
  font-family: var(--font-display);
  font-size: 144px;
  line-height: 0.92;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
  background: linear-gradient(180deg, #fff 30%, #c9bfee 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gp-hero-title .gp-script {
  font-family: var(--font-script);
  font-size: 0.58em;
  letter-spacing: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  transform: translateY(-12px) rotate(-4deg);
  margin-left: 10px;
  font-weight: 600;
}

.gp-year-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}
.gp-year-line {
  width: 70px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.gp-year-line.gp-right {
  background: linear-gradient(90deg, var(--gold), transparent);
}
.gp-year-badge {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1;
  letter-spacing: 0.06em;
  padding: 6px 32px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #2a1500;
  box-shadow: 0 8px 28px -8px rgba(255, 194, 74, 0.6),
              inset 0 2px 0 rgba(255, 255, 255, 0.4);
}


/* ---------- META CHIPS ---------- */
.gp-meta-row {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
  padding: 0 40px;
}
.gp-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ink);
  text-transform: uppercase;
}
.gp-meta-chip .gp-icon {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  display: grid;
  place-items: center;
  color: #2a1500;
  flex-shrink: 0;
}
.gp-meta-chip .gp-icon svg { width: 14px; height: 14px; }


/* ---------- COMPETITIONS GRID ---------- */
.gp-comp-section {
  position: relative;
  z-index: 1;
  padding: 30px 50px 22px;
}
.gp-tier-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--gold-soft);
  text-transform: uppercase;
}
.gp-tier-label span {
  flex: 0 1 140px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 194, 74, 0.4), transparent);
}

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


/* ---------- INDIVIDUAL CARD ---------- */
.gp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 18px 16px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-align: left;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.gp-card-num {
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  z-index: 2;
}
.gp-card-bg {
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: var(--gp-accent);
  filter: blur(40px);
  opacity: 0.18;
  pointer-events: none;
}

.gp-photo {
  position: relative;
  width: 100%;
  height: 132px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--gp-accent);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4),
              inset 0 0 0 2px rgba(255, 255, 255, 0.04);
}
.gp-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gp-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(20, 8, 50, 0.5) 100%);
  pointer-events: none;
}

.gp-card-name {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.05em;
  color: var(--ink);
  line-height: 1;
  margin-top: 2px;
}
.gp-card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.gp-card-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gp-accent);
  box-shadow: 0 0 6px var(--gp-accent);
  flex-shrink: 0;
}


/* ---------- FOOTER ---------- */
.gp-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 22px 50px 22px;
  background: rgba(10, 5, 30, 0.5);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}
.gp-credit {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gp-credit-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: var(--gold-soft);
  text-transform: uppercase;
}
.gp-credit-name {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.05em;
  color: var(--ink);
  line-height: 1.05;
}
.gp-credit-role {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  margin-top: 2px;
}
.gp-footer-bottom {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-transform: uppercase;
}


/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .gp-hero-title { font-size: 96px; }
  .gp-year-badge { font-size: 42px; padding: 5px 24px; }
  .gp-header { padding: 22px 28px 18px; }
  .gp-hero { padding: 28px 24px 14px; }
  .gp-comp-section { padding: 24px 24px 18px; }
  .gp-footer { padding: 18px 24px; gap: 16px; }
}

@media (max-width: 720px) {
  .gp-poster { margin-bottom: 40px; }
  .gp-grid { grid-template-columns: 1fr 1fr; }
  .gp-hero-title { font-size: 72px; }
  .gp-year-badge { font-size: 34px; padding: 4px 20px; }
  .gp-meta-row { gap: 8px; }
  .gp-meta-chip { font-size: 10px; padding: 9px 14px; }
  .gp-tier-label span { flex-basis: 60px; }
  .gp-footer { grid-template-columns: 1fr 1fr; }
  .gp-footer-bottom { grid-column: 1 / -1; }
  .gp-hero-seal { width: 240px; height: 240px; top: 8px; }
}

@media (max-width: 540px) {
  .gp-grid { grid-template-columns: 1fr; }
  .gp-hero-title { font-size: 56px; }
  .gp-hero-title .gp-script { transform: translateY(-6px) rotate(-4deg); }
  .gp-year-badge { font-size: 28px; padding: 4px 18px; }
  .gp-year-line { width: 40px; }
  .gp-footer { grid-template-columns: 1fr; }
  .gp-credit { text-align: center; align-items: center; }
  .gp-photo { height: 160px; }
}


/* ===================================================================
   TEAMS SCREEN
   =================================================================== */
.team-selector {
  max-width: 1280px;
  margin: 0 auto 28px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.team-selector-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  color: #fff;
  cursor: pointer;
  transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
  text-align: left;
  overflow: hidden;
}
.team-selector-btn::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 0% 0%, var(--team-color, #fff) 0%, transparent 55%);
  opacity: .08;
  transition: opacity .25s ease;
  pointer-events: none;
}
.team-selector-btn:hover {
  transform: translateY(-3px);
  border-color: var(--team-color, rgba(255,255,255,0.2));
  box-shadow: 0 14px 32px -16px var(--team-color, rgba(0,0,0,0.4));
}
.team-selector-btn:hover::before { opacity: .18; }
.team-selector-btn.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--team-color) 18%, transparent), rgba(255,255,255,0.04));
  border-color: var(--team-color);
  box-shadow: 0 0 0 1px var(--team-color), 0 18px 40px -18px var(--team-color);
}
.team-selector-btn.active::before { opacity: .25; }
.ts-emoji {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
}
.ts-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ts-brand {
  font-family: "Bebas Neue", sans-serif;
  font-size: 20px;
  letter-spacing: 1px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ts-color {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: var(--team-color, rgba(255,255,255,0.7));
  letter-spacing: 1px;
}

/* Team detail card */
.team-detail-card {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero */
.team-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 36px 32px;
  border-radius: 24px;
  background:
    radial-gradient(60% 100% at 0% 50%, color-mix(in srgb, var(--team-color) 26%, transparent), transparent),
    linear-gradient(135deg, rgba(20,22,28,0.85), rgba(12,14,18,0.95));
  border: 1px solid color-mix(in srgb, var(--team-color) 40%, rgba(255,255,255,0.08));
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6);
  margin-bottom: 28px;
}
.team-hero-emoji {
  font-size: 92px;
  line-height: 1;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,0.5));
  flex-shrink: 0;
}
.team-hero-text { flex: 1; min-width: 0; }
.team-hero-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--team-color);
  margin-bottom: 6px;
}
.team-hero-brand {
  font-family: "Bebas Neue", sans-serif;
  font-size: 56px;
  line-height: 1;
  letter-spacing: 2px;
  color: #fff;
  margin: 0 0 8px 0;
}
.team-hero-tagline {
  font-size: 15px;
  color: rgba(255,255,255,0.65);
  font-style: italic;
  margin: 0;
}

/* Leadership */
.team-leadership { margin-bottom: 28px; }
.leadership-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.leadership-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.08);
}
.leadership-card.lc-gala    { border-left: 4px solid #ffc24a; }
.leadership-card.lc-head    { border-left: 4px solid var(--team-color); }
.leadership-card.lc-student { border-left: 4px solid rgba(255,255,255,0.35); }
.lc-icon {
  font-size: 28px;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  flex-shrink: 0;
}
.lc-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lc-info small {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}
.lc-info strong {
  font-size: 15px;
  color: #fff;
  font-weight: 600;
}

/* Members */
.team-members { margin-bottom: 28px; }
.team-members-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.team-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  transition: border-color .2s ease, background .2s ease;
}
.team-member-chip:hover {
  border-color: var(--team-color);
  background: color-mix(in srgb, var(--team-color) 10%, rgba(255,255,255,0.04));
}
.tmc-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--team-color);
  box-shadow: 0 0 8px var(--team-color);
}

/* Competitions */
.team-comp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 14px;
}
.team-comp-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.08);
  border-top: 3px solid var(--team-color);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tcc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.tcc-name {
  font-family: "Bebas Neue", sans-serif;
  font-size: 22px;
  letter-spacing: 1px;
  color: #fff;
}
.tcc-points {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 194, 74, 0.12);
  color: #ffc24a;
  border: 1px solid rgba(255, 194, 74, 0.3);
}
.tcc-list { display: flex; flex-direction: column; gap: 4px; }
.tcc-row {
  display: grid;
  grid-template-columns: 28px auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}
.tcc-row:nth-child(even) { background: rgba(255,255,255,0.035); }
.tcc-row.is-captain {
  grid-template-columns: 28px 1fr auto;
  background: color-mix(in srgb, var(--team-color) 10%, rgba(255,255,255,0.02));
  border: 1px solid color-mix(in srgb, var(--team-color) 30%, transparent);
}
.tcc-cap-badge {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #ffd166, #ffc24a);
  color: #0a0a0a;
  font-family: "Bebas Neue", sans-serif;
  font-size: 13px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(255, 194, 74, 0.4);
}
.tcc-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}
.tcc-pos {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
}
.tcc-pname { color: #fff; font-weight: 500; }
.tcc-dept {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.5);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
}
.tcc-reserves {
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 8px;
}
.tcc-reserves small {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.45);
  display: block;
  margin-bottom: 6px;
}
.tcc-reserve-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tcc-reserve {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
}
.tcc-reserve em {
  font-style: normal;
  color: rgba(255,255,255,0.45);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  margin-left: 4px;
}
.tcc-empty {
  text-align: center;
  padding: 18px;
  color: rgba(255,255,255,0.4);
  font-style: italic;
  font-size: 13px;
}

/* Responsive */
@media (max-width: 980px) {
  .team-selector { grid-template-columns: repeat(2, 1fr); }
  .leadership-grid { grid-template-columns: 1fr; }
  .team-hero-brand { font-size: 42px; }
  .team-hero-emoji { font-size: 72px; }
}
@media (max-width: 640px) {
  .team-selector { grid-template-columns: 1fr; }
  .team-hero { flex-direction: column; text-align: center; padding: 28px 20px; }
  .team-comp-grid { grid-template-columns: 1fr; }
  .team-hero-brand { font-size: 36px; }
}

/* ===================================================================
   TEAM BRAND LABELS — color shown in parentheses next to brand name
   =================================================================== */

/* Bracket cells */
.team-color-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.5);
  margin-left: 4px;
  font-weight: 400;
}

/* Champion banner */
.champion-color {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
}

/* Team line-up card header */
.team-name-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 1.5px;
  color: var(--team-color, rgba(255,255,255,0.5));
  margin-top: 2px;
  text-transform: uppercase;
}

/* Standings + breakdown — color tag inside the team pill */
.team-cell-color {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  opacity: 0.65;
  margin-left: 4px;
  font-weight: 400;
}

/* Live screen tag */
.live-team-color {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  font-style: normal;
  color: rgba(255,255,255,0.5);
  margin-left: 3px;
}

/* ===================================================================
   TEAM SKIPPED (Did Not Participate)
   =================================================================== */
.team-card-skipped {
  opacity: 0.85;
}
.not-played-notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 36px 20px;
  text-align: center;
  border-top: 1px dashed rgba(255,255,255,0.12);
  margin-top: 14px;
}
.not-played-notice svg {
  width: 38px;
  height: 38px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 4px;
}
.not-played-notice strong {
  font-family: "Bebas Neue", sans-serif;
  font-size: 22px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.75);
}
.not-played-notice span {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  font-style: italic;
  max-width: 220px;
}

/* ===================== NOV 2026 ADDITIONS ===================== */
.tier-label b, .gp-tier-label b { font-weight: inherit; }
.gp-meta-chip i, .focal-meta i { font-style: normal; }

.prev-gala-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 100px;
  background: rgba(255, 194, 74, 0.08);
  border: 1px solid var(--border-strong);
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}
.prev-gala-link:hover { background: rgba(255, 194, 74, 0.18); }
.prev-gala-link svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 720px) {
  .prev-gala-link span { display: none; }
  .prev-gala-link { padding: 8px; }
}

.reg-card {
  max-width: 1080px;
  margin: 0 auto 8px;
  padding: 28px 32px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, rgba(255, 194, 74, 0.12), rgba(58, 38, 128, 0.55));
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 60px rgba(10, 4, 40, 0.35);
}
.reg-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 100px;
  background: rgba(255, 194, 74, 0.15);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
}
.reg-head h3 {
  margin: 14px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.03em;
  color: var(--ink);
}
.reg-head p { margin: 0; color: var(--ink-soft); line-height: 1.6; max-width: 760px; }
.reg-houses {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}
.reg-house {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid var(--team-color);
  background: color-mix(in srgb, var(--team-color) 14%, transparent);
  color: var(--ink);
  font-weight: 600;
}
.reg-house-emoji { font-size: 18px; }
.reg-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.reg-meta > div {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: rgba(40, 24, 88, 0.5);
  border: 1px solid var(--border);
}
.reg-meta small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
  margin-bottom: 4px;
}
.reg-meta strong { color: var(--gold-soft); font-size: 15px; }
@media (max-width: 720px) {
  .reg-card { margin: 0 16px 8px; padding: 22px 18px; }
}

.lineup-pending {
  max-width: 1280px;
  margin: 0 auto 24px;
  padding: 28px;
  text-align: center;
  border-radius: var(--r-lg);
  border: 1px dashed var(--border);
  background: rgba(40, 24, 88, 0.4);
  color: var(--ink-soft);
}

.avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  background: var(--bg-mid);
}

/* Player avatars in line-ups: photo if given, otherwise initials */
.player-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: color-mix(in srgb, var(--team-color, #7b3fe4) 38%, #2a1c5e);
  border: 1px solid color-mix(in srgb, var(--team-color, #7b3fe4) 60%, transparent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.03em;
  line-height: 1;
}
.player-avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.player-avatar.lg { width: 46px; height: 46px; font-size: 18px; border-width: 2px; border-color: var(--gold); }
.player-avatar .avatar-photo { object-position: center 25%; }
.tcc-pname, .tcc-reserve, .reserve-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tcc-reserve { gap: 6px; }
.captain-photo { position: relative; flex: none; }
.captain-crown {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #2a1500;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.captain-crown svg { width: 12px; height: 12px; }
