/* ============================================================
   NOMAD VOLLEYBALL — Design System
   Dark-mode-first, mobile-first, beach-ready
   ============================================================ */@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Russo+One&display=swap');

/* --- Custom Properties ------------------------------------ */
:root {
  /* Brand palette (Kinetic Brutalism with Logo Colours) */
  --brand-deep-blue: #1E293B;
  --brand-cyan: #00ACD2; /* Nomad Cyan */
  --brand-red: #E73744; 
  --brand-orange: #FF8A00; /* Nomad Orange */
  --brand-gold: #FCBD11; 
  --brand-sky: #3B82F6;
  --brand-light: #2563EB;
  --brand-dark: #000000;
  --brand-white: #FFFFFF;

  /* Surfaces */
  --bg-base: #0B0F19;      /* Clean Dark */
  --bg-surface: #111827;   /* Elevated Dark */
  --bg-raised: #1F2937;    /* Contrast slate */
  --bg-elevated: #00ACD2;  
  --bg-input: #1E293B;

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-on-brand: #000000;

  /* Semantic */
  --color-win: #00ACD2;
  --color-loss: #E73744;
  --color-draw: #FF8A00;
  --color-pending: #64748B;
  --color-active: var(--brand-cyan);
  --color-gold: #FCBD11;
  --color-silver: #94A3B8;
  --color-bronze: #FF8A00;
  --border-high-contrast: #FFFFFF;

  /* Spacing (8px grid) */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.5rem;   /* 24px */
  --space-6: 2rem;     /* 32px */
  --space-7: 2.5rem;   /* 40px */
  --space-8: 3rem;     /* 48px */

  /* Typography */
  --font-heading: 'Russo One', sans-serif;
  --font-body: 'Inter', sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3.5rem;

  /* Borders & Radius (Premium Soft UI) */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --border-subtle: 1px solid rgba(255, 255, 255, 0.08); /* Clean thin borders */
  --border-accent: 1px solid var(--brand-cyan);

  /* Shadows (Elegant & deep) */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2); 
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow-cyan: 0 0 24px rgba(0, 172, 210, 0.2);
  --shadow-glow-gold: 0 0 24px rgba(252, 189, 17, 0.2);
  --color-draw: #A0AAB2;

  /* Motion */
  --duration-fast: 100ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --nav-height: 4rem;
  --max-width: 960px;
}

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: var(--text-base);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-base);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-cyan); text-decoration: none; }
ul, ol { list-style: none; }

/* Focus */
:focus-visible {
  outline: 2px solid var(--brand-cyan);
  outline-offset: 2px;
}

/* --- Typography ------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

.score-text {
  font-family: var(--font-heading);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

/* --- App Shell -------------------------------------------- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: var(--border-subtle);
  padding: var(--space-3) var(--space-4);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: var(--max-width);
  margin: 0 auto;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-logo img {
  width: 4.5rem;
  height: auto;
}

.header-top .app-title {
  flex: 1 1 auto;
  text-align: center;
  font-family: var(--font-heading);
  font-size: clamp(1rem, 3.5vw, var(--text-2xl));
  font-weight: 400;
  text-transform: uppercase;
  color: var(--text-primary);
  white-space: nowrap;
  letter-spacing: 0.05em;
  margin: 0 1rem;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-team-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-raised);
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--brand-cyan);
  border: none;
  min-height: 2.75rem;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.logout-btn:hover {
  background: var(--color-loss);
  color: var(--brand-white);
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: var(--space-1);
  width: max-content;
  max-width: 100%;
  margin: var(--space-4) auto var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-surface);
  padding: 6px;
  border-radius: var(--radius-full);
  border: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex: 1;
  min-width: max-content;
  padding: var(--space-2) var(--space-5);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: all var(--duration-normal) var(--ease-out);
  min-height: 2.75rem;
  white-space: nowrap;
}

.tab-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: var(--bg-base);
  background: var(--brand-cyan);
  box-shadow: 0 4px 12px rgba(0, 172, 210, 0.25);
}

@media (max-width: 768px) {
  .app-header {
    padding-bottom: var(--space-3);
  }
  /* Floating Bottom Navigation */
  .tab-nav {
    position: fixed;
    bottom: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - var(--space-4));
    max-width: 400px;
    margin: 0;
    z-index: 999;
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    padding: var(--space-1);
    justify-content: space-between;
  }
  .tab-btn {
    flex-direction: column;
    gap: 4px;
    padding: var(--space-2) var(--space-1);
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    min-width: 0;
    white-space: normal;
  }
  .tab-icon {
    width: 20px;
    height: 20px;
  }
  .app-main {
    padding-bottom: calc(5rem + var(--space-4)) !important;
  }
  
}

/* Main Content */
.app-main {
  flex: 1;
  padding: var(--space-4);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.view { display: none; }
.view.active { display: block; }

/* --- Cards ------------------------------------------------ */
.card {
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-cyan);
  }
}

.card + .card { margin-top: var(--space-4); }

.card--elevated {
  background: var(--bg-raised);
  box-shadow: var(--shadow-md);
}

.card--match {
  padding: var(--space-4);
}

.match-hero-card {
  background: var(--brand-cyan);
  color: var(--bg-base);
  border: var(--border-subtle);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  padding: var(--space-5);
}

.match-hero-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0; width: 6px;
  background: rgba(11, 15, 25, 0.15);
}

.match-hero-card .match-meta {
  color: rgba(11, 15, 25, 0.65);
}

.match-hero-card .badge {
  background: rgba(11, 15, 25, 0.08);
  color: rgba(11, 15, 25, 0.8);
}

.match-hero-card .match-team-name {
  font-size: clamp(var(--text-xl), 5vw, var(--text-3xl));
  color: var(--bg-base);
  text-transform: uppercase;
}

.match-hero-card .match-vs {
  font-size: var(--text-lg);
  color: rgba(11, 15, 25, 0.4);
  opacity: 1;
  font-weight: 800;
}

.card--winner {
  border-color: var(--color-win);
  box-shadow: 4px 4px 0px var(--color-win);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* --- Match Card ------------------------------------------- */
.match-card {
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-sm);
}

.match-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.match-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.match-teams {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.match-team {
  /* text-align relies on child specific overrides below */
}

.match-teams .match-team:first-child {
  align-self: flex-start;
  text-align: left;
}

.match-teams .match-vs {
  align-self: center;
}

.match-teams .match-team:last-child {
  align-self: flex-end;
  text-align: right;
}

.match-team-name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}

.match-team--winner .match-team-name {
  color: var(--color-win);
}

.match-team--loser .match-team-name {
  color: var(--text-muted);
}

.match-vs {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 600;
}

.match-scores {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.set-score {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--bg-base);
  border: var(--border-subtle);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-lg);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-lg);
  font-variant-numeric: tabular-nums;
}

.set-score-separator {
  color: var(--text-muted);
  margin: 0 var(--space-1);
}

.set-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: var(--space-1);
}

/* Score Input */
.score-input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: var(--border-subtle);
}

.score-input-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-2);
}

.score-input {
  width: 100%;
  text-align: center;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  min-height: 3.25rem;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--duration-fast) var(--ease-out);
  -moz-appearance: textfield;
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.score-input:focus {
  border-color: var(--brand-cyan);
  outline: none;
}

.score-input.error {
  border-color: var(--color-loss);
}

.score-input-divider {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--text-muted);
  font-weight: 600;
}

/* --- Round Tabs ------------------------------------------- */
.round-progress-bar {
  height: 4px;
  background: var(--bg-raised);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.round-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-cyan), var(--color-win));
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
  min-width: 2px;
}

.round-progress-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-4);
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.round-tabs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
}

.round-tabs::-webkit-scrollbar { display: none; }

.round-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  min-width: 3.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
}

.round-tab-number {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.round-tab-status {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.round-tab--active {
  border-color: var(--brand-cyan);
  background: rgba(0, 172, 210, 0.08);
  box-shadow: 0 0 12px rgba(0, 172, 210, 0.15);
}

.round-tab--active .round-tab-number {
  color: var(--brand-cyan);
}

.round-tab--done {
  border-color: rgba(34, 197, 94, 0.3);
}

.round-tab--done .round-tab-status {
  color: var(--color-win);
}

.round-tab--done.round-tab--active {
  border-color: var(--color-win);
  background: rgba(34, 197, 94, 0.06);
}

.round-tab--done.round-tab--active .round-tab-number {
  color: var(--color-win);
}

.round-tab-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-orange);
  animation: pulse 2s infinite;
}

/* Round Panels */
.round-panel {
  display: none;
}

.round-panel--active {
  display: block;
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

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

.round-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: var(--border-subtle);
}

/* "Your Match" label */
.my-match-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-cyan);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.my-match-label::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--brand-cyan);
  border-radius: var(--radius-full);
}

/* No match in this round */
.no-match-notice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.no-match-icon {
  font-size: var(--text-xl);
}

/* Other matches toggle */
.other-matches-toggle {
  margin-top: var(--space-4);
}

.other-matches-summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  list-style: none;
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
  min-height: 2.75rem;
}

.other-matches-summary::-webkit-details-marker { display: none; }

.other-matches-summary:hover {
  color: var(--text-secondary);
  background: var(--bg-raised);
}

.other-matches-summary svg {
  transition: transform var(--duration-fast) var(--ease-out);
}

.other-matches-toggle[open] .other-matches-summary svg {
  transform: rotate(180deg);
}

.other-matches-list {
  margin-top: var(--space-3);
}

/* Compact match card (other teams) */
.match-card--compact {
  padding: var(--space-3);
  opacity: 0.85;
}

.match-card--compact .match-team-name {
  font-size: var(--text-base);
}

.match-card--compact .match-vs {
  font-size: var(--text-xs);
}

/* Pending match label */
.match-pending-label {
  text-align: center;
  padding: var(--space-2) 0;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Pool headers within rounds (admin) */
.pool-match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  margin-top: var(--space-4);
  border-left: 3px solid var(--pool-color);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.pool-match-header:first-child {
  margin-top: 0;
}

.pool-match-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pool-color);
}

.pool-match-count {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* --- Phase Banners --------------------------------------- */
.phase-banner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.phase-banner--done {
  border-color: var(--color-win);
  box-shadow: 4px 4px 0px var(--color-win);
}

.phase-banner--knockout {
  border-color: var(--brand-orange);
  box-shadow: var(--shadow-md);
}

.phase-banner-icon {
  font-size: var(--text-2xl);
  flex-shrink: 0;
}

.phase-banner-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.phase-banner-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 1px;
}

/* --- Knockout Stage Headers ------------------------------ */
.ko-stage-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-left: 3px solid var(--brand-cyan);
  border-radius: var(--radius-md);
}

.ko-stage-header--final {
  border-left-color: var(--color-gold);
  background: linear-gradient(90deg, rgba(252, 189, 17, 0.06), transparent);
}

.ko-stage-header--bronze {
  border-left-color: var(--color-bronze);
}

.ko-stage-icon {
  font-size: var(--text-lg);
}

.ko-stage-label {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

/* Champion card (knockout) */
.ko-champion-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  background: var(--bg-surface);
  border: 4px solid var(--color-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow-gold);
}

.ko-champion-icon svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--color-gold);
}

.ko-champion-name {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-gold);
}

/* --- Situation Tips --------------------------------------- */
.situation-tip {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-3);
  margin-bottom: var(--space-2);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--brand-cyan);
  background: rgba(0, 172, 210, 0.06);
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

.situation-tip--success {
  border-left-color: var(--color-win);
  background: rgba(34, 197, 94, 0.06);
}

.situation-tip--warning {
  border-left-color: var(--brand-orange);
  background: rgba(252, 189, 17, 0.06);
}

.situation-tip--danger {
  border-left-color: var(--brand-red);
  background: rgba(231, 55, 68, 0.06);
}

.situation-tip--info {
  border-left-color: var(--brand-cyan);
  background: rgba(0, 172, 210, 0.06);
}

.situation-tip-icon {
  font-size: var(--text-base);
  flex-shrink: 0;
  line-height: 1.5;
}

.situation-tip-message {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  min-height: 2.75rem;
  transition: transform var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  touch-action: manipulation;
}

.btn:active { 
  transform: translate(2px, 2px); 
  box-shadow: var(--shadow-sm); 
}

.btn-primary {
  background: var(--brand-cyan);
  color: var(--bg-base);
}
.btn-primary:hover { background: var(--brand-cyan); }

.btn-secondary {
  background: var(--bg-raised);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-elevated); }

.btn-success {
  background: var(--color-win);
  color: var(--bg-base);
}
.btn-success:hover { background: var(--brand-cyan); }

.btn-danger {
  background: var(--color-loss);
  color: var(--bg-base);
}

.btn-small {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  min-height: 2.75rem;
}

.btn-block {
  display: flex;
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- Leaderboard / Table ---------------------------------- */
.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 var(--space-2);
}

.leaderboard-table th {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3);
  text-align: center;
  white-space: nowrap;
}

.leaderboard-table th:first-child,
.leaderboard-table td:first-child { text-align: center; }
.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) { text-align: left; }

.leaderboard-table--standings {
  table-layout: fixed;
  min-width: 760px;
}
.leaderboard-table--standings th:first-child,
.leaderboard-table--standings td:first-child { 
  width: 3.5rem; 
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-surface);
}

.leaderboard-table--standings th:nth-child(2),
.leaderboard-table--standings td:nth-child(2) {
  min-width: 120px;
  position: sticky;
  left: 3.5rem;
  z-index: 2;
  background: var(--bg-surface);
}

/* Subtle separator for sticky columns */
.leaderboard-table--standings th:nth-child(2)::after,
.leaderboard-table--standings td:nth-child(2)::after {
  content: '';
  position: absolute;
  top: 0;
  right: -1px;
  bottom: 0;
  width: 1px;
  background: var(--border-subtle);
}

.leaderboard-table--standings th:nth-child(n+3),
.leaderboard-table--standings td:nth-child(n+3) { width: 3.5rem; }

.leaderboard-row {
  background: var(--bg-surface);
  border: var(--border-subtle);
  margin-bottom: var(--space-2);
  transition: transform var(--duration-normal) var(--ease-spring),
              background var(--duration-fast) var(--ease-out);
}

.leaderboard-row td {
  padding: var(--space-3);
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.leaderboard-row td:first-child {
  border-left: 1px solid var(--border-subtle);
}

.leaderboard-row td:last-child {
  border-right: 1px solid var(--border-subtle);
}

.leaderboard-row:nth-child(1) { border-left: 3px solid var(--color-gold); }
.leaderboard-row:nth-child(2) { border-left: 3px solid var(--color-silver); }
.leaderboard-row:nth-child(3) { border-left: 3px solid var(--color-bronze); }

.position-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-lg);
  border: var(--border-subtle);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
}

.position-badge--1 { background: var(--brand-cyan); color: #000; }
.position-badge--2 { background: var(--text-muted); color: #000; }
.position-badge--3 { background: var(--brand-orange); color: #000; }
.position-badge--other { background: var(--bg-raised); color: var(--text-secondary); }

.team-name-cell {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-base);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-positive { color: var(--color-win); }
.stat-negative { color: var(--color-loss); }
.stat-neutral  { color: var(--text-secondary); }

/* --- Bracket ---------------------------------------------- */
.bracket {
  display: flex;
  flex-direction: column;
  overflow: visible;
  padding: var(--space-2) 0;
  gap: 0;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-6);
  min-width: 100%;
  margin-bottom: 0;
  padding: var(--space-5) 0;
  position: relative;
}

/* Gradient divider between rounds */
.bracket-round + .bracket-round::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(0, 172, 210, 0.4) 20%,
    rgba(241, 134, 30, 0.4) 50%,
    rgba(252, 189, 17, 0.4) 80%,
    transparent
  );
}

/* Subtle round accent background glow */
.bracket-round--qf {
  background: radial-gradient(ellipse at top, rgba(0, 172, 210, 0.03) 0%, transparent 70%);
}

.bracket-round--sf {
  background: radial-gradient(ellipse at top, rgba(241, 134, 30, 0.03) 0%, transparent 70%);
}

.bracket-round--third {
  background: radial-gradient(ellipse at top, rgba(205, 127, 50, 0.03) 0%, transparent 70%);
}

.bracket-round--final {
  background: radial-gradient(ellipse at top, rgba(252, 189, 17, 0.04) 0%, transparent 70%);
}

.bracket-round-matches {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-6);
  flex: 1;
}

.bracket-match-pair {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-6);
  position: relative;
}



.bracket-round-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--brand-cyan);
  text-align: center;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-4);
  text-shadow: 0 2px 10px rgba(0, 172, 210, 0.3);
  position: relative;
}


.bracket-third-place .bracket-round-title {
  margin-bottom: var(--space-2);
}

.bracket-match-wrapper {
  position: relative;
  z-index: 2;
}



.bracket-match {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(0, 172, 210, 0.05);
  overflow: hidden;
  position: relative;
  transition: transform var(--duration-normal) var(--ease-spring),
              border-color var(--duration-fast),
              box-shadow var(--duration-normal);
}

@media (hover: hover) {
  .bracket-match:hover {
    transform: translateY(-4px);
    border-color: var(--brand-cyan);
    box-shadow: var(--shadow-md), 0 0 20px rgba(0, 172, 210, 0.15);
  }
}

.bracket-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #e0e6ed;
  min-height: 3.5rem;
  position: relative;
  transition: background var(--duration-fast), color var(--duration-fast);
}

/* Premium gradient divider instead of flat border */
.bracket-team:first-child::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text-muted);
}

.bracket-team--winner {
  background: var(--color-win);
  color: var(--bg-base);
}

.bracket-team--loser {
  color: var(--text-muted);
  opacity: 0.8;
}

.bracket-team--tbd {
  color: var(--text-muted);
  opacity: 0.4;
  font-style: italic;
  font-weight: 500;
}

.bracket-team--forecast {
  color: var(--text-secondary);
  opacity: 0.6;
  font-style: italic;
}

.bracket-team-name-inner {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: var(--space-3);
  max-width: 100%;
}

.bracket-team-score {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: var(--text-base);
  background: var(--bg-surface);
  border: var(--border-subtle);
  min-width: 3.5rem;
  min-height: 2.5rem;
  text-align: center;
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.bracket-team--winner .bracket-team-score {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.bracket-champion {
  text-align: center;
  padding: var(--space-6);
  background: var(--bg-surface);
  border: 4px solid var(--color-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow-gold);
  position: relative;
  overflow: hidden;
}

.bracket-champion::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(252, 189, 17, 0.2) 0%, transparent 60%);
  z-index: -1;
  animation: spin 20s linear infinite;
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.bracket-champion-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-gold);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
  letter-spacing: 0.05em;
  text-shadow: 0 0 20px rgba(252, 189, 17, 0.6);
}

.bracket-champion-team {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* --- Bracket Round Accents -------------------------------- */
.bracket-round--qf .bracket-match {
  border-left: 3px solid var(--brand-cyan);
}

.bracket-round--sf .bracket-match {
  border-left: 3px solid var(--brand-orange);
}

.bracket-round--third .bracket-match {
  border-left: 3px solid var(--color-bronze);
}

.bracket-round--final .bracket-match {
  border-left: 3px solid var(--color-gold);
}

/* Staggered entrance animation for bracket matches */
.bracket-match-wrapper {
  animation: bracketSlideIn 0.4s var(--ease-out) both;
}

.bracket-match-pair .bracket-match-wrapper:nth-child(1) { animation-delay: 0.05s; }
.bracket-match-pair .bracket-match-wrapper:nth-child(2) { animation-delay: 0.1s; }

.bracket-round--sf .bracket-match-wrapper { animation-delay: 0.15s; }
.bracket-round--third .bracket-match-wrapper { animation-delay: 0.25s; }
.bracket-round--final .bracket-match-wrapper { animation-delay: 0.35s; }

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

/* Round title accents — match the round colour */
.bracket-round--qf .bracket-round-title {
  color: var(--brand-cyan);
  text-shadow: 0 2px 10px rgba(0, 172, 210, 0.3);
}

.bracket-round--sf .bracket-round-title {
  color: var(--brand-orange);
  text-shadow: 0 2px 10px rgba(241, 134, 30, 0.3);
}

.bracket-round--third .bracket-round-title {
  color: var(--color-bronze);
  text-shadow: 0 2px 10px rgba(205, 127, 50, 0.3);
}

.bracket-round--final .bracket-round-title {
  color: var(--color-gold);
  text-shadow: 0 2px 10px rgba(252, 189, 17, 0.3);
}

/* --- Info Banner ----------------------------------------- */
.info-banner {
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.info-banner-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.info-pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.info-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.info-pill svg {
  color: var(--brand-cyan);
  flex-shrink: 0;
}

.info-rules-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.info-rule-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.info-rule-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.info-rule-title {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.info-rule-desc {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

.info-pools {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.info-pool-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bg-base);
  background: var(--pool-color);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
}

/* --- Dashboard -------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.stat-card {
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--brand-cyan);
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.pool-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  margin-top: var(--space-3);
}

.pool-header:first-child {
  margin-top: 0;
}

.pool-header-label {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pool-color);
}

.pool-header-line {
  flex: 1;
  height: 1px;
  background: var(--pool-color);
  opacity: 0.3;
}

.pool-filter-btn {
  padding: var(--space-1) var(--space-3);
  border: 2px solid var(--pool-color, var(--text-muted));
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--pool-color, var(--text-secondary));
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s ease;
}

@media (hover: hover) {
  .pool-filter-btn:hover {
    background: color-mix(in srgb, var(--pool-color, var(--text-secondary)) 15%, transparent);
  }
}

.pool-filter-btn.active {
  background: var(--pool-color, var(--brand-cyan));
  color: var(--bg-base);
  border-color: var(--pool-color, var(--brand-cyan));
}

.team-grid .card + .card {
  margin-top: 0;
}

.team-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-4);
  min-height: 5.5rem;
  height: 100%;
  min-width: 0;
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  cursor: default;
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast);
}

@media (hover: hover) {
  .team-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-cyan);
  }
}

.team-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  min-width: 0;
}

.team-card-name {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.team-card-name strong {
  font-size: var(--text-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-card-wins {
  font-family: var(--font-mono, monospace);
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.team-card-roster {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.team-chip-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--brand-deep-blue);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-on-brand);
  flex-shrink: 0;
}

.team-chip-info {
  min-width: 0;
  flex: 1;
}

.team-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.team-chip-actions {
  flex-shrink: 0;
}

/* --- Admin Panel ------------------------------------------ */
.admin-panel {
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
}

.admin-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  color: var(--brand-orange);
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  text-transform: uppercase;
}

/* --- Forms ------------------------------------------------ */
.form-group {
  margin-bottom: var(--space-4);
  min-width: 0;
  max-width: 100%;
}

.form-label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  text-align: left !important;
  padding: var(--space-3);
  background: var(--bg-input);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--text-base);
  min-height: 2.75rem;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  color-scheme: dark;
}

.form-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--duration-fast);
}

.form-input[type="date"]::-webkit-datetime-edit,
.form-input[type="time"]::-webkit-datetime-edit {
  display: flex !important;
  justify-content: flex-start !important;
  padding: 0 !important;
}

.form-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.form-input:focus {
  border-color: var(--brand-cyan);
  outline: none;
  box-shadow: var(--shadow-glow-cyan);
}

.form-row {
  display: block;
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* --- Team Code Entry (Login) ------------------------------ */
.code-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: var(--space-6);
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
}

.code-entry-logo {
  width: 120px;
  margin-bottom: var(--space-5);
}

.code-entry-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.code-entry-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.code-input-wrapper {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.code-char-input {
  width: 3.5rem;
  height: 4rem;
  text-align: center;
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 600;
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--brand-cyan);
  text-transform: uppercase;
  transition: border-color var(--duration-fast) var(--ease-out);
  caret-color: var(--brand-cyan);
  box-shadow: var(--shadow-sm);
}

.code-char-input:focus {
  border-color: var(--brand-cyan);
  outline: none;
  box-shadow: var(--shadow-glow-cyan);
}

.code-error {
  color: var(--color-loss);
  font-size: var(--text-sm);
  font-weight: 600;
  min-height: 1.5em;
  margin-bottom: var(--space-3);
}

/* --- Status Badges ---------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-lg);
  border: var(--border-subtle);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-sm);
}

.badge--pending   { background: rgba(107, 114, 128, 0.15); color: var(--color-pending); }
.badge--active    { background: rgba(0, 172, 210, 0.15); color: var(--brand-cyan); }
.badge--in-progress { background: rgba(252, 189, 17, 0.15); color: var(--brand-orange); }
.badge--completed { background: rgba(34, 197, 94, 0.15); color: var(--color-win); }
.badge--round     { background: rgba(0, 89, 134, 0.3); color: var(--brand-sky); }

/* --- Section Headers -------------------------------------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: var(--text-xl);
  color: var(--text-primary);
}

/* --- Empty States ----------------------------------------- */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-3);
  opacity: 0.5;
  display: flex;
  justify-content: center;
}

.empty-state-text {
  font-size: var(--text-lg);
  font-weight: 500;
  margin-bottom: var(--space-4);
}

/* --- Match Status indicator ------------------------------- */
.match-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  margin-top: var(--space-3);
}

.match-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-pending);
}

.match-status-dot.completed { background: var(--color-win); }
.match-status-dot.active { background: var(--brand-cyan); animation: pulse 2s infinite; }

/* --- Animations ------------------------------------------- */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

@keyframes scoreFlash {
  0% { background: var(--bg-surface); }
  50% { background: rgba(0, 172, 210, 0.15); }
  100% { background: var(--bg-surface); }
}

.animate-slide-up {
  animation: slideUp var(--duration-normal) var(--ease-out) both;
}

.animate-score-flash {
  animation: scoreFlash 0.6s var(--ease-out);
}

/* Stagger children */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 40ms; }
.stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; }
.stagger > *:nth-child(6) { animation-delay: 200ms; }
.stagger > *:nth-child(7) { animation-delay: 240ms; }
.stagger > *:nth-child(8) { animation-delay: 280ms; }
.stagger > *:nth-child(9) { animation-delay: 320ms; }
.stagger > *:nth-child(10) { animation-delay: 360ms; }

/* --- Toast ------------------------------------------------ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
  animation: slideUp var(--duration-normal) var(--ease-out);
  pointer-events: auto;
  min-width: 200px;
  max-width: 90vw;
  text-align: center;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.toast--success { 
  background: rgba(17, 24, 39, 0.85); /* bg-surface but 85% for glass effect */
  border: 1px solid var(--brand-cyan); 
  color: var(--text-primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 172, 210, 0.15);
}
.toast--error { 
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid var(--brand-red); 
  color: var(--text-primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(231, 55, 68, 0.15);
}

/* --- Modal / Overlay -------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) var(--ease-out),
              visibility var(--duration-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-surface);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6) var(--space-5);
  width: 100%;
  max-width: 720px;
  max-height: 85dvh;
  overflow-y: auto;
  transform: translateY(10px);
  transition: transform var(--duration-normal) var(--ease-spring);
}

.modal::-webkit-scrollbar {
  width: 8px;
}
.modal::-webkit-scrollbar-track {
  background: transparent;
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}
.modal::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}
.modal::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-5);
}

/* --- Utility ---------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.gap-3 { gap: var(--space-3); }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* --- Responsive ------------------------------------------- */

/* ---- Fluid Typography ------------------------------------ */
h1 { font-size: clamp(1.5rem, 4vw + 0.5rem, var(--text-4xl)); }
h2 { font-size: clamp(1.25rem, 3vw + 0.5rem, var(--text-3xl)); }
h3 { font-size: clamp(1.125rem, 2.5vw + 0.5rem, var(--text-2xl)); }

/* ---- Extra-small (< 480px) — phone screens --------------- */
@media (max-width: 479px) {
  :root {
    --nav-height: 3rem;
  }

  .app-header {
    padding: var(--space-2) var(--space-3);
  }

  .header-top .app-title {
    display: none;
  }
  
  .header-logo img {
    width: 3rem; /* Scale down logo on mobile to prevent collision */
  }
  
  .tab-label {
    display: none;
  }
  
  .tab-btn {
    padding: var(--space-2); /* tighter padding for just the icon */
    min-width: 3.5rem; /* Ensure minimum tap target area */
  }

  .header-team-badge {
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-2);
    min-height: 2.75rem;
  }

  .tab-btn {
    font-size: var(--text-xs);
    padding: var(--space-2);
    letter-spacing: 0.03em;
  }

  .app-main {
    padding: var(--space-3);
  }

  /* Stats grid: 2×2 on small phones with centered 5th item */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }
  .stats-grid > .stat-card:nth-last-child(1):nth-child(odd) {
    grid-column: 1 / -1;
  }

  /* Stack info rules smoothly on small mobile */
  .info-rules-row {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .stat-card {
    padding: var(--space-3);
  }

  .stat-value {
    font-size: var(--text-2xl);
  }

  /* Teams: single column on very narrow */
  .team-grid {
    grid-template-columns: 1fr;
  }
  
  .team-name-cell {
    max-width: 110px;
  }

  /* Match card compact */
  .match-team-name {
    font-size: var(--text-base);
  }

  .match-scores {
    flex-wrap: wrap;
  }

  .set-score {
    font-size: var(--text-base);
    padding: var(--space-1) var(--space-2);
  }

  /* Score inputs bigger touch targets */
  .score-input {
    font-size: var(--text-xl);
    min-height: 3rem;
    padding: var(--space-2);
  }

  /* Bracket is now fully responsive and vertical by default */

  /* Match cards: enhanced on mobile */
  .bracket-match {
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  /* Score pill: bolder on mobile */
  .bracket-team-score {
    min-width: 2.75rem;
    min-height: 2.25rem;
    font-weight: 700;
  }

  .bracket-champion {
    margin-top: var(--space-4);
  }

  .bracket-champion-title {
    font-size: var(--text-2xl);
  }

  .bracket-champion-team {
    font-size: var(--text-xl);
  }

  /* Leaderboard: compact text */
  .leaderboard-table th,
  .leaderboard-table td {
    padding: var(--space-2);
    font-size: var(--text-xs);
  }

  .team-name-cell {
    font-size: var(--text-xs);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .position-badge {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.625rem;
  }

  /* Modal: full-screen on small phones */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    max-width: 100%;
    max-height: 92dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--space-4);
  }

  /* Code entry */
  .code-entry {
    padding: var(--space-4);
    min-height: 100dvh;
  }

  .code-entry-logo {
    width: 80px;
  }

  .code-entry-title {
    font-size: var(--text-xl);
  }

  .code-char-input {
    width: 2.75rem;
    height: 3.25rem;
    font-size: var(--text-xl);
  }

  /* Admin panel */
  .admin-panel {
    padding: var(--space-4);
  }

  /* Team chip in admin — full width stack */
  .team-chip {
    font-size: var(--text-xs);
    padding: var(--space-2);
  }

  /* Form row now handled in max-width 768px query */

  /* Buttons: larger touch targets */
  .btn {
    min-height: 2.75rem;
    font-size: var(--text-sm);
  }

  .btn-small {
    min-height: 2.75rem;
  }

  /* Section headers */
  .section-title {
    font-size: var(--text-lg);
  }

  /* Toast */
  .toast-container {
    left: var(--space-3);
    right: var(--space-3);
    transform: none;
    bottom: var(--space-4);
  }


}

/* ---- Small (480px – 767px) — large phone / small tablet --- */
@media (min-width: 480px) and (max-width: 767px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* form-row 2 cols moved to larger media query */

  .code-entry-logo { width: 100px; }
  .code-char-input { width: 3.25rem; height: 4rem; font-size: var(--text-2xl); }

  /* Modal: almost full screen with breathing room */
  .modal-overlay {
    padding: var(--space-3);
  }

  .modal {
    max-height: 90dvh;
  }



  /* Leaderboard: still compact */
  .leaderboard-table th,
  .leaderboard-table td {
    padding: var(--space-2) var(--space-2);
    font-size: var(--text-xs);
  }

  .team-name-cell {
    font-size: var(--text-sm);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ---- Medium (768px+) — tablet / small desktop ------------ */
@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .info-rules-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .team-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .match-teams {
    gap: var(--space-2);
  }

  .match-team-name {
    font-size: var(--text-xl);
  }

  .bracket {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-4);
  }

  /* Constraint grids for vertical layout */
  .bracket-round--qf .bracket-round-matches {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6) var(--space-4);
  }

  .bracket-round--sf .bracket-round-matches {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6) var(--space-4);
  }

  .bracket-round--third .bracket-round-matches,
  .bracket-round--final .bracket-round-matches {
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
  }

  /* Center the champion section */
  .bracket-champion {
    max-width: 440px;
    margin: var(--space-6) auto 0;
  }

  .code-entry-logo { width: 160px; }
  .code-char-input { width: 4rem; height: 5rem; font-size: var(--text-4xl); }

  /* Modal: proper centered card */
  .modal {
    border-radius: var(--radius-lg);
  }

  /* Two-column form */
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: var(--space-2) var(--space-3);
  }

  .team-name-cell {
    max-width: none;
    overflow: visible;
    white-space: normal;
  }
}

/* ---- Large (1024px+) — desktop --------------------------- */
@media (min-width: 1024px) {
  :root {
    --max-width: 1200px;
  }

  .stats-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-4);
  }

  .team-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .stat-card {
    padding: var(--space-5);
  }

  .stat-value {
    font-size: var(--text-4xl);
  }

  .bracket-round {
    min-width: 100%;
  }
}

/* Desktop hover effects — only for pointer devices */
@media (min-width: 1024px) and (hover: hover) {
  .leaderboard-row:hover {
    background: var(--bg-raised);
    transform: scale(1.01);
  }

  .card:hover {
    box-shadow: var(--shadow-md);
  }
}

/* ---- Touch helpers --------------------------------------- */
@media (hover: none) and (pointer: coarse) {
  /* Remove ALL hover effects on touch devices */
  .leaderboard-row:hover,
  .card:hover,
  .bracket-match:hover,
  .team-card:hover,
  .other-matches-summary:hover,
  .pool-filter-btn:hover {
    transform: none !important;
    box-shadow: var(--shadow-sm) !important;
    border-color: inherit !important;
  }

  /* Ensure all interactive elements meet 44px min tap target */
  .tab-btn,
  .btn,
  .header-team-badge,
  .score-input {
    min-height: 2.75rem;
  }

  /* Give score inputs generous padding */
  .score-input {
    padding: var(--space-3);
  }
}

/* ---- Safe area insets (notched phones) ------------------- */
@supports (padding: env(safe-area-inset-bottom)) {
  .app-header {
    padding-top: calc(var(--space-3) + env(safe-area-inset-top));
    padding-left: calc(var(--space-4) + env(safe-area-inset-left));
    padding-right: calc(var(--space-4) + env(safe-area-inset-right));
  }

  .app-main {
    padding-left: calc(var(--space-4) + env(safe-area-inset-left));
    padding-right: calc(var(--space-4) + env(safe-area-inset-right));
  }

  .toast-container {
    bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  }

  .modal {
    padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  }
}

/* ---- Landscape phone ------------------------------------- */
@media (max-height: 500px) and (orientation: landscape) {
  .code-entry {
    min-height: auto;
    padding: var(--space-4);
  }

  .code-entry-logo {
    width: 60px;
    margin-bottom: var(--space-3);
  }

  .code-entry-title {
    font-size: var(--text-lg);
    margin-bottom: var(--space-1);
  }

  .code-entry-subtitle {
    margin-bottom: var(--space-3);
  }

  .modal {
    max-height: 95dvh;
  }
}

/* --- Reduced Motion --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================================
   UTILITIES
   ========================================================================= */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}

/* Flexbox */
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }

/* Spacing */
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.ml-3 { margin-left: var(--space-3); }
.mr-2 { margin-right: 6px; }

/* Borders & Backgrounds */
.border-accent-primary { border: 2px solid var(--accent-primary); }
.border-bg-raised { border: 1px solid var(--bg-raised); }
.border-top-subtle { border-top: 1px solid rgba(255,255,255,0.06); }
.border-radius-md { border-radius: var(--radius-md); }
.bg-raised { background: var(--bg-raised); }
.bg-brand-red { background: var(--brand-red); color: white; border-color: transparent; }
.bg-opacity-orange { background: rgba(241, 134, 30, 0.1); border: 1px solid var(--brand-orange); }

/* Text */
.text-accent-primary { color: var(--accent-primary); }
.color-win { color: var(--color-win); }
.color-orange { color: var(--brand-orange); }
.color-red { color: var(--brand-red); }
.color-cyan { color: var(--brand-cyan); }
.font-w600 { font-weight: 600; }
.font-w700 { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.1em; }

/* Generated Utility Classes */
.p-0 { padding: 0; }
.m-0 { margin: 0; }
.border-0 { border: 0; }
.p-3 { padding: var(--space-3); }
.py-5 { padding-top: var(--space-5); padding-bottom: var(--space-5); }
.pt-4 { padding-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mt-4 { margin-top: var(--space-4); }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.w-12 { width: 50px; }
.max-w-xs { max-width: 320px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-3 { gap: var(--space-3); }
.gap-6 { gap: var(--space-6); }
.cursor-pointer { cursor: pointer; }
.hidden { display: none; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-hidden { overflow-y: hidden; }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }

/* Banner Utilities */
.info-banner { border: 1px solid transparent; border-radius: var(--radius-md); padding: var(--space-4); }
.info-banner--info { background: rgba(0, 172, 210, 0.05); border-color: rgba(0, 172, 210, 0.2); margin-bottom: var(--space-4); }
.info-banner--success { background: rgba(34, 197, 94, 0.05); border-color: rgba(34, 197, 94, 0.2); margin-bottom: var(--space-4); display: flex; align-items: center; justify-content: space-between; }
.info-banner-icon { font-size: 1.5rem; }
.text-brand-cyan { color: var(--brand-cyan); display: block; }
.text-color-win { color: var(--color-win); display: block; }
.team-card { border-left: 3px solid var(--pool-color, transparent); }

/* Extracted Component Classes */
.projections-card { background: var(--bg-surface); border: var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-4); margin-bottom: var(--space-4); }
.projections-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.projections-title { display: flex; align-items: center; gap: 8px; }
.projections-title h4 { font-family: var(--font-heading); color: var(--brand-cyan); margin: 0; text-transform: uppercase; }
.projections-badge { background: rgba(0, 172, 210, 0.1); color: var(--brand-cyan); font-size: var(--text-xs); white-space: nowrap; padding: var(--space-1) var(--space-2); border-radius: var(--radius-lg); }
.projections-list { display: flex; flex-direction: column; gap: 6px; }
.projections-label { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 6px; margin-bottom: 2px; }
.projections-label--qualifying { color: var(--text-muted); }
.projections-label--bubble { color: var(--brand-orange); margin-top: var(--space-3); }
.projections-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 4px; }
.projections-row--qualifying { background: rgba(34, 197, 94, 0.05); border-left: 2px solid var(--color-win); }
.projections-row--bubble { background: rgba(241, 134, 30, 0.05); border-left: 2px solid var(--brand-orange); }
.projections-team-name { font-weight: 700; font-family: var(--font-heading); font-size: var(--text-base); }
.projections-row--bubble .projections-team-name { opacity: 0.9; }

.ko-status-placeholder { background: var(--bg-raised); border-radius: var(--radius-lg); padding: var(--space-4); text-align: center; opacity: 0.7; }
.ko-status-icon { font-size: 2rem; margin-bottom: var(--space-2); display: block; opacity: 0.5; }
.ko-status-text { color: var(--text-primary); font-weight: 600; margin-bottom: var(--space-2); }

.ko-underway-placeholder { background: rgba(0, 172, 210, 0.05); border: 1px solid rgba(0, 172, 210, 0.2); border-radius: var(--radius-lg); padding: var(--space-4); text-align: center; }
.ko-underway-icon { font-size: 2rem; margin-bottom: var(--space-2); display: block; }
.ko-underway-text { color: var(--brand-cyan); font-weight: 600; margin-bottom: var(--space-2); }

.stage-separator { background: var(--bg-surface); text-align: center; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; padding: var(--space-2) var(--space-3); color: var(--text-muted); border-top: var(--border-subtle); border-bottom: var(--border-subtle); }

.popup-container { text-align: center; padding: 10px 0; }
.popup-icon { font-size: 3rem; margin-bottom: var(--space-4); }
.popup-title { font-size: var(--text-2xl); margin-bottom: var(--space-3); color: var(--text-primary); }
.popup-tip { margin-bottom: var(--space-6); display: inline-flex; text-align: left; background-color: var(--bg-raised); padding: var(--space-3); border-radius: var(--radius-md); }
.popup-actions { display: flex; flex-direction: column; gap: var(--space-3); }

.admin-divider { border: 0; border-top: 1px solid rgba(255,255,255,0.06); margin: var(--space-5) 0; }
.admin-divider--lg { margin: var(--space-6) 0; }
.admin-section-title { margin-bottom: var(--space-4); }

.inline-edit-form { display: flex; flex-direction: column; gap: var(--space-2); width: 100%; }
.inline-edit-actions { display: flex; gap: var(--space-2); justify-content: flex-end; }
