/* ==========================================
   --- FONTS ---
   ========================================== */
   @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Rajdhani:wght@500;600;700&display=swap');

   /* ==========================================
      --- VARIABLES & BASE ---
      ========================================== */
   :root {
     --bg-primary: #1a1a1a;
     --bg-secondary: #2a2a2a;
     --bg-input: #111111;
     --accent-orange: #ff5f00;
     --text-primary: #e0e0e0;
     --text-secondary: #999;
     --border: #444;
     
     /* Status Colors */
     --success: #4ade80;
     --error: #f87171;
     --draw: #60a5fa;
   
     /* HYBRID FONTS */
     --font-main: 'Inter', system-ui, -apple-system, sans-serif; /* For data & forms */
     --font-header: 'Rajdhani', sans-serif; /* For titles & buttons */
   }
   /* ==========================================
   --- SMOOTH SCROLLING BASE ---
   ========================================== */
html {
  scroll-behavior: smooth; /* Buttery smooth gliding when clicking links */
  scroll-padding-top: 80px; /* Prevents the sticky header from covering the section titles when you arrive! */
}

/* ==========================================
   --- STICKY NAVIGATION HEADER ---
   ========================================== */
   .sticky-app-header {
    position: sticky;
    top: 0;
    z-index: 1000; 
    background: rgba(18, 18, 18, 0.85); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    
    /* --- THE PROPER FULL-WIDTH FIX --- */
    /* This mathematical trick forces the header to be exactly the width of the screen, 
       ignoring any padding your body might have, without creating a horizontal scrollbar! */
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box; 
  }

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-header);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-orange);
  letter-spacing: 0.1em;
}

.header-brand-logo {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  display: block;
}

.header-nav {
  display: flex;
  gap: 1.5rem;
}

.header-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: var(--text-primary);
}

.header-log-btn {
  background: var(--accent-orange);
  color: #000;
  border: none;
  padding: 0.5rem 1rem;
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  transition: transform 0.2s, box-shadow 0.2s;
}

.header-log-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 95, 0, 0.3);
}

.hidden {
  display: none !important;
}

/* ==========================================
   --- PLAYER DISCORD TOOLTIP ---
   ========================================== */
.player-name-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.player-name-cell.js-player-name {
  cursor: pointer;
}

.player-name-cell.js-player-name:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
  border-radius: 2px;
}

.player-name-btn:hover {
  color: var(--accent-orange);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.player-name-btn:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
  border-radius: 2px;
}

.player-tooltip {
  position: absolute;
  z-index: 2500;
  background: rgba(18, 18, 18, 0.96);
  border: 1px solid rgba(255, 95, 0, 0.55);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
  color: var(--text-primary);
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  max-width: min(320px, 80vw);
  pointer-events: none;
}

/* ==========================================
   --- RESULTS TICKER ---
   ========================================== */
.results-ticker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(255, 95, 0, 0.28);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1.5rem;
  overflow: hidden;
}

.ticker-label {
  flex: 0 0 auto;
  font-family: var(--font-header);
  color: var(--accent-orange);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid rgba(255, 95, 0, 0.4);
  background: rgba(255, 95, 0, 0.08);
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
}

.ticker-marquee {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  white-space: nowrap;
  animation: ticker-scroll 45s linear infinite;
  will-change: transform;
}

.results-ticker:hover .ticker-track,
.results-ticker:focus-within .ticker-track {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.1rem 0;
  border-bottom: 1px solid transparent;
}

.ticker-item + .ticker-item {
  margin-left: 0.15rem;
  padding-left: 1rem;
  position: relative;
}

.ticker-item + .ticker-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 0.95rem;
  background: rgba(255, 255, 255, 0.28);
}

.ticker-item:hover {
  border-bottom-color: rgba(255, 95, 0, 0.45);
}

.ticker-player {
  font-size: 0.85rem;
  font-weight: 600;
}

.ticker-faction {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.ticker-score {
  font-family: var(--font-header);
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0.2rem;
}

.ticker-winner {
  color: var(--success);
}

.ticker-draw {
  color: var(--draw);
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none;
  }
}

@media (max-width: 600px) {
  .results-ticker {
    padding: 0.45rem 1rem;
    gap: 0.55rem;
  }

  .ticker-label {
    font-size: 0.68rem;
    padding: 0.14rem 0.45rem;
  }

  .ticker-player {
    font-size: 0.78rem;
  }

  .ticker-faction {
    font-size: 0.66rem;
  }

  .ticker-score {
    font-size: 0.8rem;
  }
}
/* ==========================================
   --- MOBILE HEADER COMPACTION ---
   ========================================== */
   @media (max-width: 600px) {
    .sticky-app-header {
      padding: 0.75rem 1rem 0.5rem 1rem; /* Slightly tighter bottom padding */
      flex-wrap: wrap; 
    }
    
    .header-brand {
      font-size: 1.15rem; /* Scaled down slightly to ensure the Log button fits */
    }
  
    .header-log-btn {
      padding: 0.4rem 0.75rem;
      font-size: 0.8rem;
    }
    
    /* --- The "App Tab Bar" Fix --- */
    .header-nav {
      order: 3; 
      width: 100%;
      display: flex;
      justify-content: space-evenly; /* Spreads them perfectly with equal gaps */
      padding-top: 0.5rem;
      margin-top: 0.5rem;
      border-top: 1px solid rgba(255, 255, 255, 0.1); /* Softer border line */
    }
    
    .header-nav a {
      font-size: 0.75rem; /* Crisper text size */
      padding: 0.5rem 0.25rem; /* MASSIVE UX FIX: Increases the invisible tap area for thumbs! */
      letter-spacing: 0.05em;
    }
  }
   * { box-sizing: border-box; }
   
   /* 1. Apply clean text to everything */
   body, input, select, button, textarea, table {
     font-family: var(--font-main);
     color: var(--text-primary);
   }
   
   /* 2. Apply layout ONLY to the body (Keeps tables tight!) */
   body {
     background: var(--bg-primary);
     margin: 0;
     position: relative;
     min-height: 100vh;
   }
   
   /* Background Grid Overlay */
   body::before {
     content: '';
     position: fixed;
     top: 0; left: 0; right: 0; bottom: 0;
     background-image: url('data:image/svg+xml;utf8,<svg width="100" height="86.6" xmlns="http://www.w3.org/2000/svg"><path d="M50 0L93.3 25v50L50 100L6.7 75V25z" stroke="%23333" fill="none"/></svg>');
     background-size: 100px 86.6px;
     opacity: 0.05;
     pointer-events: none;
     z-index: -1;
   }
   
   /* ==========================================
      --- TYPOGRAPHY ---
      ========================================== */
   h1, h2, h3, h4 {
     font-family: var(--font-header);
     text-transform: uppercase;
     color: var(--accent-orange); /* Restores the orange! */
     margin: 0;
   }
   
   h1 { 
     font-size: 2.5rem; 
     letter-spacing: 0.1em; 
     position: relative; 
     z-index: 1; 
   }
   
   h2 { 
     font-size: 1.8rem; 
     letter-spacing: 0.1em; 
     margin-bottom: 1rem; 
     border-bottom: 1px solid var(--border); 
     padding-bottom: 0.5rem; 
   }
   
   h3 {
     font-size: 1.3rem;
     letter-spacing: 0.05em;
   }
   
   .subtitle { 
     color: var(--text-secondary); 
     margin: 0.5rem 0 0; 
     font-size: 0.95rem; 
     letter-spacing: 0.1em; 
     position: relative; 
     z-index: 1; 
   }
   
   /* ==========================================
      --- HEADER & LAYOUT ---
      ========================================== */
   header {
     background: var(--bg-secondary);
     border-bottom: 2px solid var(--accent-orange);
     padding: 1.5rem;
     position: relative;
     overflow: hidden;
   }
   
   /* Scanline Animation */
   header::after {
     content: ''; position: absolute;
     top: 0; left: 0; right: 0; bottom: 0;
     background: linear-gradient(transparent 50%, rgba(255,95,0,0.05) 50%);
     background-size: 100% 4px;
     pointer-events: none;
     animation: scanline 8s linear infinite;
   }
   
   @keyframes scanline { 
     0% { transform: translateY(0); } 
     100% { transform: translateY(100%); } 
   }
   
   main { 
     padding: 2rem 1.5rem; 
     max-width: 1400px; 
     margin: 0 auto; 
   }
   
   section { 
     margin-bottom: 3rem; 
   }
   
   /* ==========================================
      --- BUTTONS ---
      ========================================== */
   .header-action-btn, .submit-btn {
     font-family: var(--font-header);
     font-weight: 700;
     letter-spacing: 0.15em;
     text-transform: uppercase;
     cursor: pointer;
     transition: all 0.2s;
   }
   
   .header-action-btn {
     position: absolute;
     top: 1.5rem; right: 1.5rem;
     background: var(--bg-primary);
     color: var(--accent-orange);
     border: 1px solid var(--accent-orange);
     padding: 0.6rem 1.2rem;
     font-size: 1.1rem;
     z-index: 2;
   }
   
   .header-action-btn:hover {
     background: rgba(255, 95, 0, 0.1);
     box-shadow: 0 0 10px rgba(255, 95, 0, 0.5);
   }
   
   .submit-btn {
     background: var(--accent-orange); 
     color: #000;
     border: none; 
     border-radius: 4px; 
     padding: 0.85rem 2.5rem;
     font-size: 1.2rem;
   }
   
   .submit-btn:hover { background: #ff8833; }
   .submit-btn:active { transform: scale(0.98); }
   .submit-btn:disabled { 
     background: var(--border); 
     color: var(--text-secondary); 
     cursor: not-allowed; 
   }
   
   /* ==========================================
      --- TABLES & MATRIX ---
      ========================================== */
   .table-wrap, .matrix-scroll { 
     overflow-x: auto; 
     -webkit-overflow-scrolling: touch; 
   }

  /* Give standings tier ribbon labels room on the left.
     The pseudo-element is positioned to the left of the first cell,
     and `table-wrap` clips horizontally via `overflow-x: auto`. */
  #standings .table-wrap {
    padding-left: 2.2rem;
    box-sizing: border-box;
  }
   
   table { 
     width: 100%; 
     border-collapse: collapse; 
     background: var(--bg-secondary); 
     font-size: 0.95rem; 
   }
   
   th {
     background: var(--bg-primary); 
     color: var(--accent-orange);
     padding: 0.85rem 0.75rem; 
     text-align: left; 
     border: 1px solid var(--border);
     cursor: pointer; 
     user-select: none; 
     font-weight: 700; 
     letter-spacing: 0.05em;
     text-transform: uppercase;
   }
   
   th:hover { background: rgba(255,95,0,0.1); }
   td { padding: 0.75rem; border: 1px solid var(--border); color: var(--text-primary); }
   tr:hover td,
   tr:hover th { background: rgba(255,95,0,0.05); }
   
  /* Matrix Specifics */
  #matrix-table {
    --matrix-name-col-width: 160px;
  --matrix-cell-width: 56px;
    min-width: calc(var(--matrix-name-col-width) + (var(--matrix-cell-width) * 6));
    width: 100%;
    table-layout: fixed;
    border: none;
  }
  #matrix-table th {
    text-align: center;
    width: var(--matrix-cell-width);
    min-width: var(--matrix-cell-width);
    max-width: var(--matrix-cell-width);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-header);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
 #matrix-table td {
   text-align: center;
   width: var(--matrix-cell-width);
   min-width: var(--matrix-cell-width);
   max-width: var(--matrix-cell-width);
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
   cursor: pointer;
   transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
   font-weight: 700;
   font-family: var(--font-header);
   letter-spacing: 0.04em;
 }
 #matrix-table thead th:first-child,
 #matrix-table tbody th:first-child {
   width: var(--matrix-name-col-width);
   min-width: var(--matrix-name-col-width);
   max-width: var(--matrix-name-col-width);
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
 }
  #matrix-table td:hover { background: rgba(255,95,0,0.2); box-shadow: inset 0 0 0 1px rgba(255,95,0,0.35); }
   #matrix-table th, #matrix-table td { border-top: none; border-left: none; }
   
   .cell-win { color: var(--success); }
   .cell-loss { color: var(--error); }
   .cell-draw { color: var(--draw); }
  .cell-pending { color: var(--text-secondary); font-style: italic; font-weight: normal; transition: background-color 0.2s, color 0.2s, box-shadow 0.2s; }
  .cell-pending:hover { background: rgba(255,95,0,0.1) !important; color: var(--accent-orange); box-shadow: inset 0 0 0 1px rgba(255,95,0,0.3); }
  .cell-self {
    color: rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.25);
    box-shadow: inset 0 0 0 1px rgba(255, 95, 0, 0.16);
    cursor: not-allowed;
    font-weight: 600;
  }
  .cell-self:hover {
    background: rgba(0, 0, 0, 0.25);
    box-shadow: inset 0 0 0 1px rgba(255, 95, 0, 0.16);
    transform: none;
  }

.cell-unscheduled {
  /* Subtle diagonal hatching for fixtures that are not scheduled. */
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.03) 10px,
    rgba(255, 255, 255, 0.03) 20px
  );
  background-color: rgba(0, 0, 0, 0.2);
  color: var(--text-secondary);
  cursor: not-allowed !important;
  border: 1px solid var(--border);
  font-weight: 600;
}

.cell-unscheduled:hover {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.03) 10px,
    rgba(255, 255, 255, 0.03) 20px
  ) !important;
  background-color: rgba(0, 0, 0, 0.2) !important;
  box-shadow: none !important;
  transform: none !important;
}
   
  /* Sticky Headers for Matrix */
  .matrix-scroll {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    border: 1px solid var(--border);
  }
#matrix-table thead th { position: sticky; top: 0; z-index: 2; background: var(--bg-primary); }
#matrix-table tbody th { position: sticky; left: 0; z-index: 2; background: var(--bg-primary); }
   #matrix-table thead th:first-child { position: sticky; left: 0; top: 0; z-index: 3; }

/* Header row accent */
#matrix-table thead th {
  border-bottom: 2px solid rgba(255, 95, 0, 0.35) !important;
}

/* Matrix: rotate top header names to fit more columns */
#matrix-table thead th.matrix-colhead {
  height: 96px;
  padding: 0.35rem 0.25rem;
  vertical-align: bottom;
}

#matrix-table thead th.matrix-colhead .matrix-colhead__text {
  display: inline-block;
  white-space: nowrap;
  transform: translate(8px, 0) rotate(-45deg);
  transform-origin: left bottom;
}

/* Matrix: right edge of first column — inset shadow so the divider stays visible
   when the name column is sticky during horizontal scroll (border can vanish). */
#matrix-table thead th:first-child,
#matrix-table tbody th:first-child {
  border-right: none;
  box-shadow: inset -2px 0 0 rgba(255, 95, 0, 0.28);
}


   
/* ==========================================
   --- FIXTURES & LISTS (UPGRADED UI) ---
   ========================================== */
   #fixtures-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
  }
  
  .round-section { 
    background: var(--bg-secondary); 
    border-top: 3px solid var(--accent-orange); /* Swapped from left border to top border for columns */
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
  }
  
  .round-header-box {
    padding: 1.25rem 1.5rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
  }
  
  .round-info { 
    color: var(--text-secondary); 
    margin-top: 0.5rem; 
    font-size: 0.85rem; 
    line-height: 1.4;
  }
  
  .fixture-grid {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  /* --- Interactive Fixture Cards --- */
  .fixture-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 0.85rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
  }

  /* Side-bar visual cues on played fixtures */
  .fixture-card.played.win-left::before,
  .fixture-card.played.win-right::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10px;
    pointer-events: none;
    opacity: 1;
  }

  .fixture-card.played.win-left::before {
    left: 0;
    background: rgba(74, 222, 128, 0.72);
  }

  .fixture-card.played.win-right::before {
    right: 0;
    background: rgba(74, 222, 128, 0.72);
  }

  .fixture-card.played.played-draw::before,
  .fixture-card.played.played-draw::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    pointer-events: none;
    opacity: 1;
    background: rgba(96, 165, 250, 0.72);
  }

  .fixture-card.played.played-draw::before {
    left: 0;
  }

  .fixture-card.played.played-draw::after {
    right: 0;
  }
  
  .fixture-card:hover {
    background: var(--bg-input);
    border-color: var(--accent-orange);
    transform: translateX(4px); /* Slides slightly to the right to indicate it can be interacted with */
    box-shadow: -4px 0 0 var(--accent-orange);
  }
  
  .fixture-matchup {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    min-width: 0;
    width: 100%;
  }
  
  .fixture-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
  }

  .fixture-side .player-name {
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .player-faction {
    margin-top: 0.15rem;
    width: 100%;
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
    letter-spacing: 0.02em;
  }

  .fixture-vs {
    font-family: var(--font-header);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
  }

  .fixture-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    gap: 0.1rem;
  }

  .fixture-upcoming-label {
    font-size: 0.6rem;
    color: var(--text-secondary);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1;
  }

  .fixture-card.played.played-win,
  .fixture-card.played.played-draw,
  .fixture-card.pending {
    background: var(--bg-primary);
    border-color: var(--border);
    opacity: 1;
  }

  .fixture-card.pending .fixture-vs {
    color: var(--accent-orange);
  }

  .fixture-score {
    font-family: var(--font-header);
    color: var(--accent-orange);
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
    padding: 0 0.15rem;
  }
  
  /* --- Status Badges --- */
  .fixture-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  
  .badge-played {
    background: rgba(74, 222, 128, 0.1);
    color: var(--success);
    border: 1px solid rgba(74, 222, 128, 0.3);
  }
  
  .badge-pending {
    background: rgba(255, 95, 0, 0.1);
    color: var(--accent-orange);
    border: 1px solid rgba(255, 95, 0, 0.3);
  }
  
  /* Mute pending matchups slightly so played ones stand out */
  .fixture-card.pending .fixture-matchup {
    color: var(--text-secondary);
  }
   
   /* ==========================================
      --- MODALS ---
      ========================================== */
   .modal {
     display: none; position: fixed; z-index: 5000;
     left: 0; top: 0; width: 100%; height: 100%;
     background: rgba(0,0,0,0.85); backdrop-filter: blur(4px);
     overflow-y: auto;
   }
   
   .modal-content {
     background: var(--bg-secondary);
     margin: 5% auto; padding: 2rem;
     border: 2px solid var(--accent-orange);
     width: 90%; max-width: 600px;
     box-shadow: 0 0 20px rgba(255, 95, 0, 0.4);
     position: relative;
   }
   
   .modal-content.form-modal { max-width: 800px; }
   
   .close {
     color: var(--accent-orange); position: absolute;
     right: 1.5rem; top: 1.5rem; font-size: 28px; font-weight: bold;
     cursor: pointer; line-height: 1; font-family: var(--font-header);
   }
   .close:hover { color: #ff8833; }
   
/* ==========================================
   --- UPGRADED MATCH DETAILS CARD ---
   ========================================== */
   .match-detail-expanded {
    margin-bottom: 2rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
  }
  
  .match-id-header {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-align: center;
    padding: 0.5rem;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border);
  }
  
  .vs-container {
    display: flex;
    flex-direction: column;
    position: relative;
  }
  
  @media (min-width: 600px) {
    .vs-container {
      flex-direction: row;
      align-items: stretch;
    }
  }
  
  .player-stat-card {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    text-align: center;
    position: relative;
  }
  
  .player-stat-card:first-child { border-bottom: 1px solid var(--border); }
  @media (min-width: 600px) {
    .player-stat-card:first-child { border-bottom: none; border-right: 1px solid var(--border); }
  }
  
/* Subtle background glow - Keep this but make it slightly stronger */
.winner-card {
  background: radial-gradient(980px 360px at 100% 0%, rgba(74, 222, 128, 0.12), transparent 58%);
}

/* Make sure the winner's name still pops */
.winner-card h3 { color: var(--success) !important; }

/* ==========================================
   --- THE NEW VICTOR BADGE ---
   ========================================== */
.winner-badge {
  position: absolute;
  top: 0;
  right: 1.5rem; /* Match the card padding */
  background: var(--success); /* Use that bright green */
  color: #000; /* Black text for ultimate contrast */
  font-family: var(--font-header); /* Use the aggressive Rajdhani font */
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  transform: translateY(-50%); /* Make it hang over the top edge */
  
  /* Thematic angular cut (geometric KT aesthetic) */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 12% 100%);
}

/* Adjust the badge placement when the cards stack on mobile */
@media (max-width: 600px) {
  .winner-badge {
    top: 1rem; /* Sit slightly inside the card */
    transform: none; /* Don't hang over the edge on mobile */
    right: 1rem;
  }
}
  
  .card-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
  }
  
  .faction-label {
    font-size: 0.85rem;
    color: var(--accent-orange);
    font-family: var(--font-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
  }
  
  .vp-display {
    font-family: var(--font-header);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1.5rem 0;
    line-height: 1;
  }
  
  .vp-label {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-left: -4px;
  }
  
  .score-breakdown {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
  }
  
  .score-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    padding: 0.6rem;
    border-radius: 6px;
    min-width: 65px;
    border: 1px solid var(--border);
  }
  
  .score-item span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    letter-spacing: 0.05em;
    font-weight: 600;
  }
  
  .score-item strong {
    font-family: var(--font-header);
    font-size: 1.4rem;
    color: var(--accent-orange);
    line-height: 1;
  }
  
  .op-details {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.85rem;
    text-align: left;
    font-size: 0.85rem;
    margin-top: auto; /* Pushes it to the bottom so both sides align */
  }
  
  .op-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
  }
  .op-row:last-child { margin-bottom: 0; }
  
  .op-row span { color: var(--text-secondary); }
  .op-row strong { 
    color: var(--text-primary); 
    font-weight: 600; 
    text-align: right;
    max-width: 60%;
  }
  
/* ==========================================
   --- VS BADGE LAYOUT FIX ---
   ========================================== */
/* Reset the default (mobile) margins so it doesn't overlap text */
.vs-divider {
  margin: 1.5rem auto !important; 
}

/* Adjust for desktop (side-by-side) layout */
@media (min-width: 600px) {
  .vs-divider {
    margin: auto 1.5rem !important; /* Adds horizontal breathing room between the flat columns */
  }
}

/* Ensure the mobile size stays scaled down correctly */
@media (max-width: 600px) {
  .vs-divider {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.85rem !important;
    border-width: 2px !important;
  }
}
   /* ==========================================
      --- FORM CONTROLS ---
      ========================================== */
   .form-columns { 
     display: grid; 
     grid-template-columns: 1fr 1fr; 
     gap: 1.5rem; 
     margin-top: 1.5rem; 
   }
   
   .player-column { 
     background: var(--bg-primary); 
     padding: 1.5rem; 
     border-left: 3px solid var(--accent-orange); 
   }
   
   .player-column h3 { border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 1rem; }
   
   .score-grid { 
     display: grid; 
     grid-template-columns: repeat(3, 1fr); 
     gap: 0.75rem; 
   }
   
   .match-form label { 
     display: block; 
     margin-bottom: 1rem; 
     color: var(--text-primary); 
     font-size: 0.85rem; 
     font-weight: 600; 
     text-transform: uppercase;
     letter-spacing: 0.05em;
   }
   
   .match-form select, .match-form input {
     width: 100%;
     background: var(--bg-input); 
     border: 1px solid var(--border);
     border-radius: 4px;
     color: var(--text-primary);
     padding: 0.75rem;
     margin-top: 0.4rem;
     font-size: 0.95rem;
     transition: border-color 0.2s;
   }
   
   .match-form select:focus, .match-form input:focus { 
     outline: none; 
     border-color: var(--accent-orange); 
   }
   
   .match-form select:invalid { color: var(--text-secondary); }
   
   .form-footer { 
     text-align: center; 
     padding-top: 1.5rem; 
     border-top: 1px solid var(--border); 
     margin-top: 1.5rem; 
   }
   
   .winner-text { 
     font-family: var(--font-header); 
     font-size: 1.6rem; 
     color: var(--text-secondary); 
     margin-bottom: 1rem; 
     min-height: 1.8rem; 
     letter-spacing: 0.05em;
   }
   
   #submit-status { margin-top: 1rem; font-weight: bold; }
   .loading { color: var(--text-secondary); text-align: center; padding: 2rem; font-style: italic; }
   
   /* ==========================================
      --- RESPONSIVE ---
      ========================================== */
   @media (max-width: 768px) {
     h1 { font-size: 1.8rem; }
     main { padding: 1rem; }
     
     .header-action-btn { 
       position: static; 
       display: block; 
       margin-top: 1.5rem; 
       width: 100%; 
       text-align: center; 
     }
     
     .form-columns { grid-template-columns: 1fr; }
     .modal-content { width: 95%; margin: 5% auto; padding: 1.5rem; }
     
     table { font-size: 0.85rem; }
     th, td { padding: 0.6rem; }
   }

   optgroup {
    font-weight: 700;
    color: var(--accent-orange);
    background: var(--bg-secondary);
  }

  /* ==========================================
   --- UPGRADED FORM STYLING ---
   ========================================== */
.form-group {
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* ==========================================
   --- SCORE SELECTOR BOXES (FORM) ---
   ========================================== */
/* Center the labels specifically in the form */
.match-form .score-item {
  align-items: center; /* Forces the CRIT/TAC/KILL labels to center over the boxes */
  background: transparent;
  border: none;
  padding: 0;
  min-width: 70px;
}

.match-form .score-item span {
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
}

/* Style the 0-6 dropdowns to look like big stat numbers */
.match-form .score-select {
  appearance: none; /* STRIPS OUT THE NATIVE DROPDOWN ARROW */
  -webkit-appearance: none; /* For Safari/iOS */
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--accent-orange);
  font-family: var(--font-header);
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  padding: 0.5rem 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.match-form .score-select:hover {
  background: rgba(255, 95, 0, 0.05);
  border-color: #666;
}

.match-form .score-select:focus {
  border-color: var(--accent-orange);
  outline: none;
  box-shadow: 0 0 12px rgba(255, 95, 0, 0.3);
  transform: translateY(-2px); /* Tiny lift effect when typing/clicking */
}

/* ==========================================
   --- MOBILE FORM COMPACTION ---
   ========================================== */
   @media (max-width: 600px) {
    /* 1. Tighten the overall card padding */
    .match-form .player-stat-card {
      padding: 1rem;
    }
  
    /* 2. Shrink the massive player headers */
    .match-form .card-header {
      margin-bottom: 0.5rem !important;
    }
    .match-form .card-header h3 {
      font-size: 1.25rem;
    }
  
    /* 3. Reduce vertical space between all dropdowns */
    .match-form .form-group {
      margin-top: 0.5rem !important;
    }
    .match-form select {
      font-size: 0.9rem;
      padding: 0.4rem;
    }
  
    /* 4. Compact the Score Terminal Boxes */
    .match-form .score-breakdown {
      margin: 1rem 0 !important;
      gap: 0.4rem;
    }
    .match-form .score-item {
      min-width: 60px;
    }
    .match-form .score-item span {
      font-size: 0.65rem;
      margin-bottom: 0.2rem;
    }
    .match-form .score-select {
      font-size: 1.25rem;
      padding: 0.25rem 0;
    }
  
    /* 5. Shrink the Ops box at the bottom */
    .match-form .op-details {
      padding: 0.6rem;
    }
  
    /* 6. Shrink the VS Badge globally for mobile (helps the Results Modal too!) */
    .vs-divider {
      width: 32px;
      height: 32px;
      font-size: 0.85rem;
      margin: -16px auto; /* Exactly half the height to perfectly overlap the border */
      border-width: 3px;
    }
  }

  /* ==========================================
   --- GLOBAL DATA LEGIBILITY ---
   ========================================== */
/* Tabular Nums ensures '1' and '0' take up the exact same horizontal space */
table, .score-select, .matrix-table td {
  font-variant-numeric: tabular-nums;
}

/* Standings Table Row Tracking */
#league-table tbody tr {
  transition: background 0.2s;
}
#league-table tbody tr:hover {
  background: rgba(255, 95, 0, 0.08); /* Subtle orange highlight */
}

/* ==========================================
   --- VALIDATION & SUCCESS UX ---
   ========================================== */
/* Red border for missing data in the form */
.missing-data {
  border-color: var(--error) !important;
  box-shadow: 0 0 5px rgba(239, 68, 68, 0.2);
}

/* Green flash for successful upload */
.submit-btn.success-state {
  background: var(--success) !important;
  color: white !important;
  border-color: var(--success) !important;
  box-shadow: 0 0 15px rgba(74, 222, 128, 0.4);
}

/* ==========================================
   --- MOBILE CONDENSING & COHERENCE ---
   ========================================== */
@media (max-width: 600px) {
  /* Compact the form spacing */
  .match-form .player-stat-card {
    padding: 0.75rem;
  }
  .match-form .form-group {
    margin-top: 0.35rem !important;
  }
  .match-form select {
    font-size: 0.85rem;
    padding: 0.4rem;
  }

  /* Matrix swipe fix */
  .matrix-container {
    overflow-x: auto;
    /* Smooth horizontal scrolling */
    -webkit-overflow-scrolling: touch;
  }
  /* Lock the player names to the left while scrolling scores! */
  .matrix-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    background: var(--bg-primary); /* Prevents text bleeding */
    border-right: 2px solid var(--accent-orange);
  }
}

/* ==========================================
   --- FORM UI COHERENCE FIXES ---
   ========================================== */

/* 1. Remove the nested black box and replace with a sleek divider */
.match-form .op-details {
  background: transparent !important;
  border: none !important;
  border-top: 1px dashed rgba(255, 255, 255, 0.1) !important;
  padding: 1rem 0 0 0 !important;
  margin-top: 1.5rem !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* 2. Unify all dropdowns to look like premium dark-mode inputs */
.match-form select {
  background: rgba(0, 0, 0, 0.2) !important; /* Subtle dark inset */
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: var(--text-primary);
  border-radius: 4px;
  transition: all 0.2s;
}

.match-form select:focus {
  border-color: var(--accent-orange) !important;
  box-shadow: 0 0 8px rgba(255, 95, 0, 0.2) !important;
  outline: none;
}

/* 3. Soften the Missing Data alert so it doesn't look overwhelming */
.missing-data {
  border-color: rgba(255, 255, 255, 0.1) !important; /* Keep the standard border */
  /* Use a sleek red line on the left edge instead of a full glowing box */
  box-shadow: inset 3px 0 0 var(--error) !important; 
  background: rgba(239, 68, 68, 0.02) !important; /* Very faint red tint */
}

/* 4. Ensure the Player Cards themselves don't look like floating boxes */
.match-form .player-stat-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Keep the labels crisp and clean */
.match-form .form-group label {
  color: var(--text-secondary);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

/* ==========================================
   --- LEAGUE TABLE MOBILE SHARPNESS ---
   ========================================== */

/* 1. Ensure the wrapper allows smooth horizontal swiping */
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 255, 255, 0.1); /* Matches your sleek dark UI */
  border-radius: 6px;
  background: var(--bg-secondary);
}

/* 2. Lock the table structure */
#league-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap; /* CRITICAL: Stops text from wrapping to a new line */
}

/* 3. Clean up the padding */
#league-table th, 
#league-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

/* 4. Truncate ONLY the Player Name (Column 2) */
#league-table td:nth-child(2) {
  max-width: 130px; /* Limits the width of long team names */
  overflow: hidden;
  text-overflow: ellipsis; /* Adds the "..." */
}

/* 5. Center all data EXCEPT the Player Name */
#league-table th:not(:nth-child(2)),
#league-table td:not(:nth-child(2)) {
  text-align: center;
}
/* ==========================================
   --- PREMIUM LEAGUE TABLE UI ---
   ========================================== */

/* 1. Ensure the wrapper allows smooth horizontal swiping */
#standings.table-container, 
#standings .table-container {
  width: 100%;
  overflow-x: auto;
  /* Left gutter so tier ribbon labels can render outside the table. */
  padding-left: 1.6rem;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 255, 255, 0.1); 
  border-radius: 6px;
  background: var(--bg-secondary);
}

/* 2. Lock the table structure */
#standings table {
  width: 100%;
  border-collapse: collapse;
}

/* 3. PREMIUM HEADERS: Restore Orange and Header Font */
#standings table th {
  color: var(--accent-orange) !important;
  font-family: var(--font-header);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--bg-primary) !important;
  padding: 1rem 0.75rem; /* Good breathing room */
  border-bottom: 2px solid rgba(255, 95, 0, 0.22); /* "Round header" accent bar */
}

/* 4. PREMIUM ROWS: Breathing room and center alignment */
#standings table td {
  padding: 0.85rem 0.75rem; /* Re-introduces vertical space so it isn't squished */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Softer row borders */
  color: var(--text-primary);
}

/* 5. Center all data EXCEPT the Player Name (Column 2) */
#standings table th:not(:nth-child(2)),
#standings table td:not(:nth-child(2)) {
  text-align: center;
}

/* 6. ZEBRA STRIPING: Subtle alternating row colors for readability */
#standings table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* Match the same zebra striping in the results matrix */
#matrix-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* Keep self cells visibly disabled on both odd and even rows. */
#matrix-table tbody td.cell-self,
#matrix-table tbody tr:nth-child(even) td.cell-self {
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 0 1px rgba(255, 95, 0, 0.16);
}

/* Keep unscheduled cells visually distinct on zebra rows. */
#matrix-table tbody td.cell-unscheduled,
#matrix-table tbody tr:nth-child(even) td.cell-unscheduled {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.03) 10px,
    rgba(255, 255, 255, 0.03) 20px
  );
  background-color: rgba(0, 0, 0, 0.2);
}

/* Ensure hover background wins over zebra striping (notably on even rows). */
#matrix-table tbody tr:hover td:not(.cell-self):not(.cell-unscheduled),
#matrix-table tbody td:not(.cell-self):not(.cell-unscheduled):hover {
  background: rgba(255, 95, 0, 0.2);
}

/* Keep sticky row headers consistent over zebra backgrounds */
#matrix-table tbody tr:nth-child(even) th {
  background: var(--bg-primary);
}

/* Matrix sticky name column should highlight with the row */
#matrix-table tbody tr:hover th,
#matrix-table tbody tr:active th {
  background: rgba(255, 95, 0, 0.05) !important;
}

/* ==========================================
   --- MOBILE TABLE ADJUSTMENTS ---
   ========================================== */
@media (max-width: 600px) {
  
  /* Prevent word stacking but keep standard text sizes */
  #standings table th,
  #standings table td {
    white-space: nowrap !important; 
    font-size: 0.85rem; 
  }

  /* The Sticky Name Column (Column 2) */
  #standings table th:nth-child(2),
  #standings table td:nth-child(2) {
    position: sticky;
    left: 0; 
    z-index: 5;
    background: var(--bg-secondary); 
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 3px 0 5px rgba(0,0,0,0.2); 
    max-width: 130px; 
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600; /* Makes the sticky player name pop */
  }
}

/* Make the League Points stand out */
.pt-main {
  font-weight: 700;
  color: var(--accent-orange) !important;
  font-size: 1.05rem; /* Makes it just a tiny bit larger than the rest of the row */
}

/* ==========================================
   --- MATCH DETAILS MODAL REWORK ---
   ========================================== */
#match-modal .match-detail-expanded {
  overflow: visible;
}

#match-modal .match-details-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: stretch;
  margin-top: 0;
}

#match-modal .match-player-card {
  position: relative;
  flex: 1;
}

#match-modal .victor-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: #000;
  font-family: var(--font-header);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0.38rem 0.65rem;
  border-radius: 4px;
  z-index: 4;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

#match-modal .match-vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

#match-modal .match-vs-divider span {
  font-family: var(--font-header);
  font-size: 1.2rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.08em;
  color: var(--accent-orange);
  line-height: 1;
}

#match-modal .match-vs-divider::before,
#match-modal .match-vs-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  margin: 0 0.45rem;
  background: rgba(255, 255, 255, 0.25);
}

@media (min-width: 650px) {
  #match-modal .match-details-wrapper {
    flex-direction: row;
    align-items: stretch;
    gap: 0.9rem;
  }

  #match-modal .match-vs-divider {
    flex-direction: column;
    min-width: 38px;
    gap: 0.35rem;
  }

  #match-modal .match-vs-divider::before,
  #match-modal .match-vs-divider::after {
    flex: 1;
    width: 1px;
    height: 100%;
    margin: 0;
  }
}

/* ==========================================
   --- MATCH MODAL FINAL OVERRIDES ---
   Keep this block last to beat legacy rules.
   ========================================== */
#match-modal .match-details-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}

#match-modal .match-player-card {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
}

#match-modal .match-player-inner {
  padding: 1.6rem 1rem 1rem;
}

#match-modal .match-player-card.is-victor {
  background: var(--bg-primary) !important;
}

#match-modal .match-player-card:first-child {
  border-right: none;
  border-bottom: none;
}

#match-modal .match-player-card .card-header {
  min-height: 62px;
}

#match-modal .match-player-card .vp-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.18em;
  margin: 0.8rem 0 1rem;
}

#match-modal .match-player-card .vp-label {
  font-size: 0.4em;
  margin-left: 0;
}

#match-modal .match-player-card .score-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0 0 1rem;
}

#match-modal .match-player-card .score-item {
  min-width: 0;
  width: 100%;
  padding: 0.5rem 0.35rem;
}

#match-modal .match-player-card .op-details {
  margin-top: 0;
}

#match-modal .victor-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  clip-path: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  z-index: 5;
}

#match-modal .match-vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

#match-modal .match-vs-divider::before,
#match-modal .match-vs-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.22);
  margin: 0 0.3rem;
}

#match-modal .match-vs-divider span {
  font-size: 1.45rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
}

@media (min-width: 650px) {
  #match-modal .match-details-wrapper {
    flex-direction: row;
    justify-content: center;
    gap: 0.9rem;
    padding: 0;
  }

  #match-modal .match-player-card {
    flex: 0 1 330px;
    max-width: 330px;
  }

  #match-modal .match-vs-divider {
    flex-direction: column;
    min-width: 28px;
    gap: 0.3rem;
  }

  #match-modal .match-vs-divider::before,
  #match-modal .match-vs-divider::after {
    flex: 1;
    width: 1px;
    height: auto;
    margin: 0;
  }
}

/* ==========================================
   --- UX AUDIT FIXES (1–5) ---
   ========================================== */

/* ----- Fix 1: Focus Visibility ----- */
.js-match-cell:focus-visible,
.js-log-match-cell:focus-visible,
.js-match-card:focus-visible,
.js-log-match-card:focus-visible,
.fixture-card:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 95, 0, 0.15);
  z-index: 1;
  position: relative;
}

#standings-table th[data-sort]:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: -2px;
}

.close:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
}

.header-nav a:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 4px;
  border-radius: 2px;
}

.header-log-btn:focus-visible,
.submit-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ----- Fix 2: Form Spacing Rhythm ----- */
.match-form .player-stat-card {
  gap: 1rem !important;
}

.match-form .player-stat-card > .card-header,
.match-form .player-stat-card > .form-group,
.match-form .player-stat-card > .score-breakdown {
  margin: 0 !important;
}

.match-form .player-stat-card > .op-details {
  margin: 0 !important;
  padding-top: 0.75rem !important;
}

@media (max-width: 600px) {
  .match-form .player-stat-card {
    gap: 0.75rem !important;
  }

  .match-form .player-stat-card:first-of-type {
    padding-bottom: 0.75rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }
}

/* ----- Fix 3: Touch Target Hardening ----- */
.close {
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  right: 1rem;
  top: 1rem;
  transition: background 0.2s, color 0.2s;
}

.close:hover {
  background: rgba(255, 95, 0, 0.1);
}

@media (max-width: 600px) {
  .header-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-log-btn {
    min-height: 44px;
    min-width: 88px;
  }

  #matrix-table td {
    min-height: 44px;
    min-width: 44px;
  }

  .fixture-card {
    min-height: 52px;
  }

  .match-form select,
  .match-form input {
    min-height: 44px;
    font-size: 16px !important;
  }

  .submit-btn {
    min-height: 48px;
    min-width: 200px;
  }
}

/* ----- Fix 4: Active Navigation ----- */
.header-nav a {
  position: relative;
}

.header-nav a.active {
  color: var(--accent-orange);
}

.header-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-orange);
  border-radius: 1px;
}

@media (max-width: 600px) {
  .header-nav a.active::after {
    bottom: 0;
  }
}

/* ----- Fix 5: Scroll Affordance & Touch ----- */
.table-wrap,
.matrix-scroll {
  position: relative;
}

@media (max-width: 600px) {
  .table-wrap:not(.scrolled-end),
  .matrix-scroll:not(.scrolled-end) {
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
    mask-image: linear-gradient(to right, #000 88%, transparent);
  }
}

@media (hover: none) and (pointer: coarse) {
  #matrix-table td:hover {
    /* Preserve a visible hover state when hover is still triggered
       (some environments report coarse pointers even with a mouse). */
    background: rgba(255, 95, 0, 0.2);
    transform: none;
  }

  .cell-pending:hover {
    background: rgba(255, 95, 0, 0.1) !important;
    color: var(--text-secondary);
    transform: none;
  }

  #matrix-table td:active {
    background: rgba(255, 95, 0, 0.2);
    transform: scale(1.05);
  }

  .cell-pending:active {
    background: rgba(255, 95, 0, 0.1) !important;
    color: var(--accent-orange);
    transform: scale(1.1);
  }

  .fixture-card:hover {
    background: var(--bg-primary);
    border-color: var(--border);
    transform: none;
    box-shadow: none;
  }

  .fixture-card:active {
    background: var(--bg-input);
    border-color: var(--accent-orange);
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--accent-orange);
    transition: all 0.1s;
  }
}

@media (hover: hover) and (pointer: fine) {
  .fixture-card.played:hover {
    border-color: var(--success);
    box-shadow: -4px 0 0 var(--success);
  }

  .fixture-card.pending:hover {
    border-color: var(--accent-orange);
    box-shadow: -4px 0 0 var(--accent-orange);
  }
}

/* ==========================================
   --- FEATURE: INLINE SCORES ---
   ========================================== */
.fixture-score {
  font-family: var(--font-header);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 0 0.35rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fixture-score.score-win {
  color: var(--text-primary);
}

.fixture-score.score-draw {
  color: var(--draw);
}

.fixture-winner {
  color: var(--success) !important;
  font-weight: 700;
}

.fixture-card.played .fixture-matchup {
  color: var(--text-primary);
}

.fixture-factions {
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fixture-faction-divider {
  color: var(--accent-orange);
  font-family: var(--font-header);
  font-weight: 700;
}

.badge-final {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
}

/* ==========================================
   --- FEATURE: FIXTURE FILTER ---
   ========================================== */
.fixture-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.fixture-filter:empty {
  display: none;
}

.filter-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-header);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-pill:hover {
  border-color: var(--accent-orange);
  color: var(--text-primary);
  background: rgba(255, 95, 0, 0.06);
}

.filter-pill.active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #000;
  font-weight: 700;
}

/* ==========================================
   --- FEATURE: UNDO TOAST ---
   ========================================== */
.undo-toast {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  z-index: 2000;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent-orange);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transition: transform 0.3s ease;
  min-width: 320px;
  max-width: 90vw;
}

.undo-toast.visible {
  transform: translateX(-50%) translateY(0);
}

.undo-toast-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.undo-toast-text {
  color: var(--success);
  font-family: var(--font-header);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.undo-btn {
  background: transparent;
  border: 1px solid var(--accent-orange);
  color: var(--accent-orange);
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.undo-btn:hover {
  background: var(--accent-orange);
  color: #000;
}

.undo-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.undo-timer-bar {
  height: 3px;
  background: var(--accent-orange);
  width: 100%;
}

.undo-timer-bar.running {
  animation: undo-countdown 6s linear forwards;
}

@keyframes undo-countdown {
  from { width: 100%; }
  to { width: 0%; }
}

/* ==========================================
   --- AMERICAN SPORTS STYLE REFRESH ---
   ========================================== */

/* Section headers — bold accent-bar treatment */
section > h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  border-bottom: 3px solid var(--accent-orange);
  border-left: 4px solid var(--accent-orange);
  padding-bottom: 0.6rem;
  padding-left: 0.75rem;
  margin-bottom: 1.25rem;
}

/* Heavier PTS column */
.pt-main {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
}

/* Round headers — sportier, compact */
.round-header-box {
  border-bottom: 2px solid var(--accent-orange);
  background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(255, 95, 0, 0.04) 100%);
}

.round-header-box h3 {
  letter-spacing: 0.15em;
  font-size: 1.15rem;
}

.round-info {
  letter-spacing: 0.04em;
}

.round-map-link {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.round-map-link:hover {
  color: var(--text-primary);
}

.round-map-link:focus-visible {
  outline: 2px solid var(--text-secondary);
  outline-offset: 2px;
  border-radius: 2px;
}

#map-modal .modal-content {
  max-width: 1100px;
}

.map-top-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  z-index: 10;
}

#map-modal .map-top-actions .close {
  position: static !important;
  right: auto !important;
  top: auto !important;
  margin: 0;
}

#map-modal .map-modal-link {
  margin: 0;
}

.map-modal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0.25rem 0 0.75rem;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: border-color 0.16s, color 0.16s, background 0.16s, transform 0.16s;
}

.map-modal-link:hover {
  color: var(--accent-orange);
  border-color: rgba(255, 95, 0, 0.52);
  background: rgba(255, 95, 0, 0.12);
  transform: translateY(-1px);
}

.map-modal-link:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
}

.map-modal-link svg {
  width: 18px;
  height: 18px;
  display: block;
}

.map-modal-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
}

/* Data legibility — tabular nums everywhere */
#standings-table td {
  font-variant-numeric: tabular-nums;
}

/* ==========================================
   --- DIVISION / TIER RIBBON (GHOST THEME) ---
   ========================================== */

/* Base transparent border prevents layout shift when a row has no tier class. */
#standings-table td:first-child {
  border-left: 4px solid transparent;
  position: relative; /* Essential for aligning the floating labels */
}

/* 1. Monochromatic Left-Border Indicators (using opacities & styles) */
#standings-body tr.tier-cup td:first-child {
  border-left: 4px solid var(--accent-orange); /* 100% Solid */
}

#standings-body tr.tier-plate td:first-child {
  border-left: 4px solid rgba(255, 95, 0, 0.6); /* 60% Solid */
}

#standings-body tr.tier-bowl td:first-child {
  border-left: 4px dashed rgba(255, 95, 0, 0.4); /* 40% Dashed */
}

#standings-body tr.tier-spoon td:first-child {
  border-left: 4px dotted rgba(255, 95, 0, 0.2); /* 20% Dotted */
}

/* 2. Subtle hover backgrounds mapping to tier intensity */
#standings-body tr.tier-cup:hover td   { background: rgba(255, 95, 0, 0.12) !important; }
#standings-body tr.tier-plate:hover td { background: rgba(255, 95, 0, 0.08) !important; }
#standings-body tr.tier-bowl:hover td  { background: rgba(255, 95, 0, 0.05) !important; }
#standings-body tr.tier-spoon:hover td { background: rgba(255, 95, 0, 0.03) !important; }

/* 3. Vertical tier labels on the left (Ghost aesthetic) */
#standings-body tr.tier-cup td:first-child,
#standings-body tr.tier-plate td:first-child,
#standings-body tr.tier-bowl td:first-child,
#standings-body tr.tier-spoon td:first-child {
  /* Allow the vertical label to render in the gutter outside the table. */
  overflow: visible;
  padding-left: 1rem !important;
}

#standings-body tr.tier-group-start td:first-child::before {
  position: absolute;
  top: 50%;
  /* Anchor at the cell edge, then shift the whole label into the left gutter. */
  left: 0;
  transform: translate(-125%, -50%) rotate(180deg);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-header);
  font-weight: 700; /* Dropped from 900 to 700 to fit the sleeker ghost vibe */
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.82rem;
  pointer-events: none;
  z-index: 1;
  line-height: 1;
}

/* 4. Monochromatic text labels matching the border intensity */
#standings-body tr.tier-group-start.tier-cup td:first-child::before {
  content: "Cup";
  color: var(--accent-orange);
}

#standings-body tr.tier-group-start.tier-plate td:first-child::before {
  content: "Plate";
  color: rgba(255, 95, 0, 0.6);
}

#standings-body tr.tier-group-start.tier-bowl td:first-child::before {
  content: "Bowl";
  color: rgba(255, 95, 0, 0.4);
}

#standings-body tr.tier-group-start.tier-spoon td:first-child::before {
  content: "Spoon";
  color: rgba(255, 95, 0, 0.2);
}

/* Header brand — bolder sports lockup */
.header-brand {
  font-size: 1.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  .fixture-filter {
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }

  .filter-pill {
    font-size: 0.7rem;
    padding: 0.35rem 0.6rem;
  }

  .fixture-score {
    font-size: 1rem;
  }

  section > h2 {
    font-size: 1.3rem;
    padding-left: 0.6rem;
  }

  .header-brand {
    font-size: 1.2rem;
  }

  .undo-toast {
    min-width: 0;
    width: 95vw;
  }
}

/* ==========================================
   --- MODAL ENERGY + DESKTOP LAYOUT FIX ---
   ========================================== */

.modal {
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(255, 95, 0, 0.18), transparent 60%),
    radial-gradient(900px 420px at 100% 100%, rgba(255, 95, 0, 0.08), transparent 65%),
    rgba(8, 8, 10, 0.86);
  padding: clamp(1rem, 2.4vh, 1.6rem) 0 clamp(1.4rem, 3.2vh, 2.2rem);
}

.modal::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(transparent 50%, rgba(255, 95, 0, 0.035) 50%);
  background-size: 100% 4px;
  opacity: 0.28;
}

.modal-content {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(160deg, rgba(255, 95, 0, 0.07) 0%, rgba(255, 95, 0, 0.02) 18%, rgba(24, 24, 28, 0.97) 45%, rgba(34, 34, 38, 0.98) 100%),
    var(--bg-secondary);
  margin: clamp(2rem, 5vh, 4.25rem) auto;
  padding: clamp(1rem, 2.2vw, 1.75rem);
  border-radius: 12px;
  border: 1px solid rgba(255, 95, 0, 0.65);
  box-shadow:
    0 0 0 1px rgba(255, 95, 0, 0.18),
    0 18px 44px rgba(0, 0, 0, 0.7),
    0 0 28px rgba(255, 95, 0, 0.2);
}

.modal-content::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 95, 0, 0.72), transparent);
  pointer-events: none;
}

.modal-content h2,
.modal-content h3 {
  margin-right: 3rem;
}

/* Card headers inside modals should remain centered */
.modal-content .card-header h3 {
  margin-right: 0;
}

.modal-content h2 {
  border-bottom-color: rgba(255, 95, 0, 0.24);
  padding-bottom: 0.7rem;
  margin-bottom: 1rem;
}

.modal-content h3 {
  margin-bottom: 0.85rem;
}

.close {
  right: 0.75rem;
  top: 0.75rem;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.82);
  background: rgba(0, 0, 0, 0.28);
  font-size: 1.05rem;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: border-color 0.16s, color 0.16s, background 0.16s, transform 0.16s;
}

.close:hover {
  color: var(--accent-orange);
  border-color: rgba(255, 95, 0, 0.52);
  background: rgba(255, 95, 0, 0.12);
  transform: translateY(-1px);
}

#match-modal .modal-content {
  max-width: 760px;
}

#submit-modal .modal-content.form-modal {
  max-width: 960px;
  border-width: 2px;
}

#submit-modal h2 {
  border-bottom: 1px solid rgba(255, 95, 0, 0.22);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  letter-spacing: 0.14em;
}

#submit-modal .match-form .vs-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

#submit-modal .match-form .player-stat-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 65%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px;
  padding: 1rem !important;
}

#submit-modal .match-form .form-footer {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 95, 0, 0.2);
  display: grid;
  gap: 0.65rem;
  justify-items: center;
}

#submit-modal .winner-text {
  font-size: 1.8rem;
  letter-spacing: 0.07em;
}

#submit-modal .submit-btn {
  background: color-mix(in srgb, var(--accent-orange) 88%, #000 12%);
  border: 1px solid color-mix(in srgb, var(--accent-orange) 72%, #fff 28%);
  border-radius: 8px;
  box-shadow:
    0 6px 18px rgba(255, 95, 0, 0.26),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

#submit-modal .submit-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-orange) 94%, #000 6%);
  transform: translateY(-1px) scale(1.01);
  box-shadow:
    0 9px 22px rgba(255, 95, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.09) inset;
}

#submit-modal .submit-btn:disabled {
  background: #3b3b3f;
  border-color: #59595f;
  box-shadow: none;
}

#submit-modal .vs-divider {
  width: 44px !important;
  height: 44px !important;
  margin: 0 auto !important;
  border: 2px solid rgba(255, 95, 0, 0.75) !important;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 95, 0, 0.2), rgba(0, 0, 0, 0.3));
  box-shadow: 0 0 16px rgba(255, 95, 0, 0.18);
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.08em;
}

@media (max-width: 900px) {
  #submit-modal .match-form .vs-container {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  #submit-modal .vs-divider {
    margin: 0.4rem auto !important;
  }
}

/* Ensure modal selects never fall back to white system styles */
#submit-modal .match-form select {
  background: #17181c !important;
  color: var(--text-primary) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

#submit-modal .match-form select:focus {
  background: #1d1f24 !important;
  border-color: var(--accent-orange) !important;
}

#submit-modal .match-form select option,
#submit-modal .match-form select optgroup {
  background: #17181c;
  color: var(--text-primary);
}

/* Winner card emphasis + sharper top-right victor badge */
#match-modal .match-player-card.is-victor {
  /* Flush glow from top-right; fades to neutral earlier */
  background:
    radial-gradient(
      980px 420px at 100% 10%,
      rgba(74, 222, 128, 0.32) 0%,
      rgba(74, 222, 128, 0.15) 26%,
      rgba(26, 26, 26, 0) 46%
    ),
    var(--bg-primary) !important;
  box-shadow: none;
}

#match-modal .match-player-card.is-victor::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(820px 360px at 100% 12%, rgba(74, 222, 128, 0.20), transparent 48%);
  opacity: 0.40;
}

/* Draw visual identity in match cards */
#match-modal .match-player-card.is-draw {
  background:
    radial-gradient(
      980px 420px at 100% 10%,
      color-mix(in srgb, var(--draw) 42%, transparent) 0%,
      color-mix(in srgb, var(--draw) 18%, transparent) 26%,
      rgba(26, 26, 26, 0) 46%
    ),
    var(--bg-primary) !important;
  box-shadow: none;
}

/* Draw glow intentionally matches the draw badge placement (top-right) */

#match-modal .match-player-card.is-draw::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(820px 360px at 100% 12%, color-mix(in srgb, var(--draw) 28%, transparent), transparent 48%);
  opacity: 0.34;
}

#match-modal .draw-badge {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.38rem 0.82rem 0.38rem 0.95rem;
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 14px 100%);
  background: linear-gradient(135deg, color-mix(in srgb, var(--draw) 65%, #fff 35%) 0%, var(--draw) 60%, color-mix(in srgb, var(--draw) 70%, #000 30%) 100%);
  color: #06121f;
  font-family: var(--font-header);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  z-index: 6;
}

#match-modal .victor-badge,
#match-modal .winner-badge {
  top: 0;
  left: auto;
  right: 0;
  transform: none;
  border-radius: 0;
  padding: 0.38rem 0.82rem 0.38rem 0.95rem;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 14px 100%);
  background: linear-gradient(135deg, #7cf1a8 0%, var(--success) 55%, #2fc267 100%);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  letter-spacing: 0.12em;
}

@media (max-width: 600px) {
  #match-modal .victor-badge,
  #match-modal .winner-badge {
    top: 0;
    right: 0;
  }
}

/* ==========================================
  --- FIXTURE PREP STATES ---
  ========================================== */
.fixture-card.pending.pending-revealed {
  border-color: var(--border);
}

.fixture-card.pending.pending-revealed .fixture-upcoming-label {
  color: var(--accent-orange);
}

.fixture-planned-date {
  margin-top: 0.55rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}

.cell-locked {
  color: var(--accent-orange);
  font-style: normal;
  font-weight: 700;
}

.cell-ready {
  color: var(--accent-orange);
  font-style: normal;
  font-weight: 700;
}

/* (old fixture-prep-modal generic classes removed — scoped to #fixture-prep-modal below) */


/* ==========================================
  --- MODAL SHELL FINAL OVERRIDES ---
  Keep this block last for consistency.
  ========================================== */
.modal {
  padding: clamp(1rem, 2.4vh, 1.6rem) 0 clamp(1.4rem, 3.2vh, 2.2rem) !important;
}

.modal-content {
  position: relative !important;
  isolation: isolate;
  margin: clamp(2rem, 5vh, 4.25rem) auto !important;
  padding: clamp(1rem, 2.2vw, 1.75rem) !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 95, 0, 0.65) !important;
  box-shadow:
    0 0 0 1px rgba(255, 95, 0, 0.18),
    0 18px 44px rgba(0, 0, 0, 0.7),
    0 0 28px rgba(255, 95, 0, 0.2) !important;
}

.modal-content::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 95, 0, 0.72), transparent);
  pointer-events: none;
}

.modal-content h2,
.modal-content h3 {
  margin-right: 3rem;
}

.close,
.close-submit {
  right: 0.75rem !important;
  top: 0.75rem !important;
  width: 40px;
  height: 40px;
  min-width: 40px !important;
  min-height: 40px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.82) !important;
  background: rgba(0, 0, 0, 0.28);
  font-size: 1.05rem !important;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: border-color 0.16s, color 0.16s, background 0.16s, transform 0.16s !important;
}

.close:hover,
.close-submit:hover {
  color: var(--accent-orange) !important;
  border-color: rgba(255, 95, 0, 0.52);
  background: rgba(255, 95, 0, 0.12);
  transform: translateY(-1px);
}

/* ==========================================
   --- FIXTURE PREP MODAL ---
   Persistent scaffold. Card inners crossfade
   between phases via .fp-fading. Bigger cards
   match the match-result modal proportions.
   ========================================== */

@keyframes fp-scanline {
  0%   { top: -4px; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: calc(100% + 4px); opacity: 0; }
}

@keyframes fp-pulse-classified {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

@keyframes fp-lock-flash {
  0%   { opacity: 0; }
  25%  { opacity: 0.3; }
  100% { opacity: 0; }
}

/* --- Modal shell ---------------------------------------------------------- */
#fixture-prep-modal .modal-content {
  max-width: 860px;
}

/* --- Top actions (Back + Close) ------------------------------------------ */
#fixture-prep-modal .fp-top-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  z-index: 10;
}

#fixture-prep-modal .fp-top-actions .close {
  position: static !important;
  right: auto !important;
  top: auto !important;
  margin: 0;
}

#fixture-prep-modal .fp-top-actions .close {
  display: flex;
  align-items: center;
  justify-content: center;
}

#fixture-prep-modal .fp-top-back {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  padding: 0.4rem 0.65rem;
  font-family: var(--font-header);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.16s, color 0.16s, background 0.16s, transform 0.16s;
}

#fixture-prep-modal .fp-top-back:hover {
  color: var(--accent-orange);
  border-color: rgba(255, 95, 0, 0.52);
  background: rgba(255, 95, 0, 0.12);
  transform: translateY(-1px);
}

@media (max-width: 520px) {
  #fixture-prep-modal .fp-top-back {
    /* Icon-only back control on mobile to avoid title overlap */
    padding: 0;
    letter-spacing: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0; /* Visually hide "← Change player" text */
    border-radius: 999px;
  }

  #fixture-prep-modal .fp-top-back::before {
    content: "←";
    font-size: 1.15rem;
    line-height: 1;
    color: currentColor;
  }
}

/* Ensure the fixture-prep title never collides with top actions */
@media (max-width: 600px) {
  #fixture-prep-modal .fp-title {
    padding-right: 5.5rem; /* space for back + close buttons */
  }
}

/* --- Wrapper: column → row at 650px -------------------------------------- */
#fixture-prep-modal .fp-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}

@media (min-width: 650px) {
  #fixture-prep-modal .fp-wrapper {
    flex-direction: row;
    justify-content: center;
    gap: 0.9rem;
  }

  #fixture-prep-modal .fp-wrapper .match-player-card {
    flex: 1 1 0;
  }

  #fixture-prep-modal .fp-wrapper .match-vs-divider {
    flex-direction: column;
    flex-shrink: 0;
    min-width: 28px;
    gap: 0.3rem;
  }

  #fixture-prep-modal .fp-wrapper .match-vs-divider::before,
  #fixture-prep-modal .fp-wrapper .match-vs-divider::after {
    flex: 1;
    width: 1px;
    height: auto;
    margin: 0;
  }
}

/* --- Card base ------------------------------------------------------------ */
#fixture-prep-modal .match-player-card {
  position: relative;
  min-height: 260px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, transform 0.16s ease;
}

#fixture-prep-modal .match-player-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.6rem 1.25rem 1.25rem;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

#fixture-prep-modal .match-player-inner.fp-fading {
  opacity: 0;
  transform: translateY(5px);
}

#fixture-prep-modal .match-player-card .card-header {
  min-height: 56px;
}

/* --- Badge (top-right clip-path, matches VICTOR badge) -------------------- */
#fixture-prep-modal .fp-badge {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.38rem 0.82rem 0.38rem 0.95rem;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 14px 100%);
  font-family: var(--font-header);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#fixture-prep-modal .fp-badge--visible { opacity: 1; }

#fixture-prep-modal .fp-badge--active {
  background: linear-gradient(135deg, #ffb347 0%, var(--accent-orange) 55%, #e64a00 100%);
  color: #000;
}

#fixture-prep-modal .fp-badge--dim {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  box-shadow: none;
}

#fixture-prep-modal .fp-badge--locked {
  background: linear-gradient(135deg, #7cf1a8 0%, var(--success) 55%, #2fc267 100%);
  color: #06121f;
}

/* --- Scanline ------------------------------------------------------------- */
#fixture-prep-modal .fp-scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  top: -4px;
  background: linear-gradient(90deg, transparent, rgba(255, 95, 0, 0.55), transparent);
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}

#fixture-prep-modal .match-player-card.is-selecting .fp-scanline {
  animation: fp-scanline 2.8s ease-in-out infinite;
}

/* --- Card state: is-selecting --------------------------------------------- */
#fixture-prep-modal .match-player-card.is-selecting {
  background: radial-gradient(
    650px 300px at 100% 8%,
    rgba(255, 95, 0, 0.18) 0%,
    rgba(255, 95, 0, 0.06) 30%,
    transparent 52%
  ), var(--bg-primary);
  border-color: rgba(255, 95, 0, 0.35);
}

/* --- Card state: is-opponent ---------------------------------------------- */
#fixture-prep-modal .match-player-card.is-opponent {
  border-color: rgba(255, 255, 255, 0.05);
}

/* --- Card state: is-locked ------------------------------------------------ */
#fixture-prep-modal .match-player-card.is-locked {
  background: radial-gradient(
    650px 300px at 100% 8%,
    rgba(74, 222, 128, 0.20) 0%,
    rgba(74, 222, 128, 0.06) 28%,
    transparent 50%
  ), var(--bg-primary);
  border-color: rgba(74, 222, 128, 0.30);
}

#fixture-prep-modal .match-player-card.is-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(74, 222, 128, 0.14);
  pointer-events: none;
  border-radius: 8px;
  animation: fp-lock-flash 0.6s ease-out forwards;
}

/* --- fp-action-card: clickable hub / identity cards ----------------------- */
#fixture-prep-modal .fp-action-card {
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  #fixture-prep-modal .fp-action-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 95, 0, 0.45);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
    outline: none;
    background: radial-gradient(
      500px 220px at 50% -15%,
      rgba(255, 95, 0, 0.12) 0%,
      transparent 60%
    ), var(--bg-primary);
  }
}

#fixture-prep-modal .fp-action-card:focus-visible {
  outline: 2px solid rgba(255, 95, 0, 0.85);
  outline-offset: 2px;
}

/* --- Hub/identity text ---------------------------------------------------- */
#fixture-prep-modal .fp-cta-label {
  margin-top: auto;
  padding-top: 1.25rem;
  font-family: var(--font-header);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.16s;
}

@media (hover: hover) and (pointer: fine) {
  #fixture-prep-modal .fp-action-card:hover .fp-cta-label {
    color: var(--accent-orange);
  }
}

#fixture-prep-modal .fp-label-dim { color: var(--text-secondary); }

/* --- Classified (opponent card) ------------------------------------------- */
#fixture-prep-modal .fp-classified {
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  font-style: italic;
}

#fixture-prep-modal .fp-classified-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 80px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

#fixture-prep-modal .fp-encrypted-faction {
  font-family: var(--font-header);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 0 14px rgba(255, 95, 0, 0.16);
}

#fixture-prep-modal .fp-classified-text {
  font-family: var(--font-header);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-secondary);
  animation: fp-pulse-classified 3s ease-in-out infinite;
}

#fixture-prep-modal .fp-encrypted-hint {
  margin: 0;
  margin-top: 0.9rem;
  max-width: 14rem;
  text-align: center;
  font-size: 0.74rem;
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.62);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

#fixture-prep-modal .fp-encrypted-hint.fp-encrypted-hint--occluded {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

/* --- Confirm sealing state -------------------------------------------------- */
#fixture-prep-modal .fp-confirm-body.fp-confirm--sealing {
  opacity: 0.9;
}

#fixture-prep-modal .fp-confirm-body.fp-confirm--sealing .fp-confirm-label::after {
  content: "...";
  display: inline-block;
  margin-left: 0.25rem;
  letter-spacing: 0.2em;
  animation: fp-sealing-dots 1.1s steps(3, end) infinite;
}

@keyframes fp-sealing-dots {
  0%,
  20% {
    opacity: 0;
  }
  40% {
    opacity: 0.4;
  }
  60% {
    opacity: 0.7;
  }
  80%,
  100% {
    opacity: 1;
  }
}

/* --- VS divider ----------------------------------------------------------- */
#fixture-prep-modal .match-vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 40px;
}

#fixture-prep-modal .match-vs-divider span {
  font-size: 1.45rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.08em;
  color: var(--accent-orange);
  line-height: 1;
  font-family: var(--font-header);
}

#fixture-prep-modal .match-vs-divider::before,
#fixture-prep-modal .match-vs-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.22);
  margin: 0 0.3rem;
}

/* --- Faction picker ------------------------------------------------------- */
#fixture-prep-modal .faction-picker-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

#fixture-prep-modal .premium-dropdown {
  appearance: none;
  width: 100%;
  background: #17181c;
  color: var(--text-primary);
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.9rem;
  transition: border-color 0.16s;
}

#fixture-prep-modal .premium-dropdown:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 2px rgba(255, 95, 0, 0.16);
}

#fixture-prep-modal .premium-dropdown option,
#fixture-prep-modal .premium-dropdown optgroup {
  background: #17181c;
  color: var(--text-primary);
}

/* --- Buttons -------------------------------------------------------------- */
#fixture-prep-modal .btn-lock-faction {
  width: 100%;
  border: none;
  border-radius: 6px;
  padding: 0.9rem 1rem;
  background: var(--accent-orange);
  color: #000;
  font-family: var(--font-header);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

#fixture-prep-modal .btn-lock-faction:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 95, 0, 0.22);
}

#fixture-prep-modal .btn-lock-faction:disabled {
  background: #3b3b3f;
  color: var(--text-secondary);
  cursor: not-allowed;
  box-shadow: none;
}

#fixture-prep-modal .fp-btn-cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-secondary);
}

#fixture-prep-modal .fp-btn-cancel:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.30);
  transform: none;
  box-shadow: none;
}

#fixture-prep-modal .fp-btn-confirm {
  background: var(--error);
  color: #fff;
}

#fixture-prep-modal .fp-btn-confirm:hover:not(:disabled) {
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.28);
}

#fixture-prep-modal .fp-btn-proceed {
  background: var(--success);
  color: #06121f;
}

#fixture-prep-modal .fp-btn-proceed:hover:not(:disabled) {
  box-shadow: 0 8px 20px rgba(74, 222, 128, 0.22);
}

/* --- Confirm / Locked body ------------------------------------------------ */
#fixture-prep-modal .fp-confirm-body,
#fixture-prep-modal .fp-locked-body {
  margin-top: 1.25rem;
}

#fixture-prep-modal .confirm-btn-group {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.5rem;
}

/* --- Status labels -------------------------------------------------------- */
#fixture-prep-modal .fp-confirm-label {
  margin: 0 0 0.5rem;
  font-family: var(--font-header);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--error);
}

#fixture-prep-modal .fp-locked-label {
  margin: 0.4rem 0 0.75rem;
  font-family: var(--font-header);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
}

#fixture-prep-modal .fp-inline-error {
  color: var(--error);
  font-family: var(--font-header);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  margin: -0.25rem 0 0;
}

/* --- Back controls -------------------------------------------------------- */
#fixture-prep-modal .fp-back {
  margin-top: 0.9rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font-family: var(--font-header);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

#fixture-prep-modal .fp-back:hover {
  border-color: rgba(255, 95, 0, 0.45);
  color: var(--accent-orange);
}

#fixture-prep-modal .fp-back--corner {
  position: absolute;
  left: 1.05rem;
  bottom: 1rem;
  margin-top: 0;
}

/* Back buttons are no longer used in-card (kept for safety, hidden) */
#fixture-prep-modal .fp-back,
#fixture-prep-modal .fp-back--corner {
  display: none !important;
}

/* --- Confirm + sealed faction emphasis ----------------------------------- */
#fixture-prep-modal .fp-confirm-faction {
  margin: 0.35rem 0 0.75rem;
  text-align: center;
  font-family: var(--font-header);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-orange);
}

#fixture-prep-modal .fp-sealed-faction {
  margin-top: 0.25rem;
  text-align: center;
  font-family: var(--font-header);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

#fixture-prep-modal .fp-reveal-faction {
  margin-top: 1.1rem;
  text-align: center;
  font-family: var(--font-header);
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-orange);
}

/* --- Encrypted opponent look --------------------------------------------- */
#fixture-prep-modal .fp-encrypted {
  letter-spacing: 0.24em;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 0 12px rgba(255, 95, 0, 0.18);
}

/* ==========================================
   --- REGULAR SEASON + PLAYOFF FORMAT ---
   ========================================== */
.cell-unscheduled {
  color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.03);
  cursor: not-allowed !important;
  font-style: normal;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

#matrix-table td.cell-unscheduled:hover {
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: none;
}

#playoffs-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.playoffs-status {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  grid-column: 1 / -1;
}

.playoff-round-section .round-header-box {
  border-bottom: 2px solid var(--accent-orange);
}

/* Playoff cards: subheading (match title, map, crit op) above the matchup row */
.playoff-round-section .fixture-card {
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  border: 1px solid var(--border);
}

.playoff-fixture-meta {
  width: 100%;
  padding-bottom: 0.5rem;
  margin-bottom: 0.1rem;
  border-bottom: 1px solid rgba(255, 95, 0, 0.2);
  text-align: center;
}

.playoff-fixture-meta__title {
  font-family: var(--font-header);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-orange);
  line-height: 1.3;
}

.playoff-fixture-meta__details {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  line-height: 1.4;
}

.playoff-fixture-meta__pair {
  display: inline;
}

.playoff-fixture-meta__key {
  color: var(--text-primary);
  font-weight: 600;
  margin-right: 0.25rem;
}

.playoff-fixture-meta__sep {
  margin: 0 0.45rem;
  opacity: 0.45;
}

.playoff-card-disabled {
  cursor: not-allowed;
  opacity: 0.72;
  border-style: solid;
}

.playoff-card-disabled:hover,
.playoff-card-disabled:active {
  background: var(--bg-primary);
  border-color: var(--border);
  transform: none;
  box-shadow: none;
}

.playoff-card-disabled .fixture-vs,
.playoff-card-disabled .fixture-upcoming-label {
  color: var(--text-secondary);
}

.playoff-round-section .fixture-card.playoff-card-final,
.playoff-round-section .fixture-card.is-final {
  border: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(255, 95, 0, 0.15) 0%, var(--bg-secondary) 100%);
  box-shadow: inset 3px 0 0 rgba(255, 95, 0, 0.9);
}

.playoff-round-section .fixture-card.playoff-card-final:hover,
.playoff-round-section .fixture-card.is-final:hover {
  border-color: var(--border);
  box-shadow: inset 3px 0 0 rgba(255, 95, 0, 1), -3px 0 0 rgba(255, 95, 0, 0.5);
}

.playoff-round-section .fixture-card.playoff-card-final .playoff-fixture-meta,
.playoff-round-section .fixture-card.is-final .playoff-fixture-meta {
  border-bottom-color: rgba(255, 95, 0, 0.35);
}

.playoff-round-section .fixture-card.playoff-card-final .playoff-fixture-meta__title,
.playoff-round-section .fixture-card.is-final .playoff-fixture-meta__title {
  text-shadow: 0 0 8px rgba(255, 95, 0, 0.5);
}


