/* =====================================================================
   FREE FIRE TOURNAMENT POINTS CALCULATOR - GAMING THEME STYLES
   Aesthetic: Dark Crimson & Carbon Black, Aggressive Esports & Sci-Fi
   Matching Reference: IMG_20261011_112403.jpg (NZ PAID SCRIMS)
===================================================================== */

:root {
  --bg-dark: #06070a;
  --bg-card: #0d0f14;
  --bg-card-hover: #131720;
  --bg-slot: #10131a;
  
  --crimson-primary: #e50914;
  --crimson-glow: #ff1e38;
  --crimson-dark: #7a060e;
  --crimson-gradient: linear-gradient(135deg, #ff1744 0%, #b30018 50%, #68000b 100%);
  --crimson-badge-grad: linear-gradient(135deg, #e50914 0%, #90030a 100%);
  --card-border-glow: rgba(229, 9, 20, 0.45);
  
  --text-white: #ffffff;
  --text-dim: #9ca3af;
  --text-darker: #6b7280;
  --text-gold: #ffbe0b;

  --font-display: 'Orbitron', -apple-system, sans-serif;
  --font-tech: 'Chakra Petch', sans-serif;
  --font-condensed: 'Rajdhani', sans-serif;

  --ease-cyber: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-tech);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(180, 0, 20, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(229, 9, 20, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(140, 0, 15, 0.3) 0%, transparent 55%),
    linear-gradient(180deg, #07080b 0%, #030406 100%);
}

/* Ambient glow and cyber grid background overlay */
.cyber-grid-overlay {
  position: fixed;
  inset: 0;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  pointer-events: none;
  z-index: 0;
}

.ambient-glow {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
}

.glow-top-left {
  top: -100px;
  left: -80px;
  width: 380px;
  height: 380px;
  background: rgba(229, 9, 20, 0.35);
}

.glow-top-right {
  top: -80px;
  right: -60px;
  width: 420px;
  height: 420px;
  background: rgba(255, 23, 68, 0.3);
}

.glow-bottom-center {
  bottom: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 350px;
  background: rgba(180, 0, 15, 0.2);
}

.app-container {
  position: relative;
  z-index: 1;
  max-width: 1260px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* =====================================================================
   HEADER SECTION - EXACT CUSTOM GRAPHIC BANNER
===================================================================== */
.scrims-header {
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: transparent;
  display: block;
}

.scrims-header-img-wrap {
  padding: 0;
  border: 1px solid rgba(229, 9, 20, 0.45);
  box-shadow: 
    0 12px 30px -10px rgba(0, 0, 0, 0.85),
    0 0 25px rgba(229, 9, 20, 0.25);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.scrims-header-img-wrap:hover {
  border-color: rgba(255, 23, 68, 0.7);
  box-shadow: 
    0 14px 35px -8px rgba(0, 0, 0, 0.9),
    0 0 35px rgba(229, 9, 20, 0.4);
}

.scrims-header-banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 7px;
}

/* =====================================================================
   SCREEN TOGGLE / LAYOUT
===================================================================== */
.screen-view {
  display: none;
  animation: fadeIn 0.4s var(--ease-cyber) forwards;
}

.screen-view.active {
  display: block;
}

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

.section-badge-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.badge-tag {
  background: var(--crimson-dark);
  color: #fff;
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 2px;
  padding: 0.25rem 0.75rem;
  border-left: 3px solid #ff1744;
}

.badge-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(229, 9, 20, 0.6), transparent);
}

.badge-code {
  font-family: monospace;
  font-size: 0.75rem;
  color: #f87171;
  letter-spacing: 1px;
}

/* =====================================================================
   SETUP SCREEN LAYOUT
===================================================================== */
.setup-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.setup-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

/* Cyber Cards */
.cyber-card {
  background: rgba(13, 16, 22, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(229, 9, 20, 0.3);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 12px 30px -8px rgba(0, 0, 0, 0.8),
    inset 0 0 15px rgba(229, 9, 20, 0.05);
}

.cyber-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--crimson-primary), transparent);
}

.card-header {
  padding: 1.1rem 1.35rem;
  background: linear-gradient(90deg, rgba(30, 10, 16, 0.85) 0%, rgba(13, 16, 22, 0.5) 100%);
  border-bottom: 1px solid rgba(229, 9, 20, 0.25);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-header h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fff;
  text-transform: uppercase;
}

.card-header-split {
  justify-content: space-between;
}

.header-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.roster-counter {
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  color: #f87171;
  background: rgba(229, 9, 20, 0.15);
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(229, 9, 20, 0.35);
  border-radius: 4px;
}

.card-body {
  padding: 1.35rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.35rem;
}

.form-group label {
  display: block;
  font-family: var(--font-tech);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #d1d5db;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.required-star {
  color: var(--crimson-glow);
  font-weight: 900;
}

.cyber-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cyber-input {
  width: 100%;
  background: rgba(6, 8, 12, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-family: var(--font-tech);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  outline: none;
  transition: all 0.25s ease;
}

.cyber-input:focus {
  border-color: var(--crimson-primary);
  background: rgba(14, 10, 14, 0.95);
  box-shadow: 
    0 0 0 2px rgba(229, 9, 20, 0.25),
    0 0 15px rgba(229, 9, 20, 0.3);
}

.cyber-input.num-input {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: #ff4d6d;
  letter-spacing: 2px;
  text-align: center;
}

.quick-match-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.chip-btn {
  background: rgba(20, 24, 32, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9ca3af;
  font-family: var(--font-tech);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.45rem 0.2rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.chip-btn:hover {
  border-color: var(--crimson-primary);
  color: #fff;
  background: rgba(40, 15, 20, 0.6);
}

.chip-btn.active {
  background: var(--crimson-primary);
  border-color: #ff334b;
  color: #fff;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

.field-hint {
  font-size: 0.76rem;
  color: var(--text-darker);
  margin-top: 0.45rem;
  font-style: italic;
}

/* Points Preset Rules Box */
.scoring-preset-box {
  background: rgba(18, 8, 12, 0.6);
  border: 1px solid rgba(229, 9, 20, 0.25);
  border-radius: 4px;
  padding: 0.85rem;
  margin-bottom: 1.35rem;
}

.preset-title {
  font-family: var(--font-tech);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #fca5a5;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid rgba(229, 9, 20, 0.2);
  padding-bottom: 0.35rem;
}

.preset-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem 0.5rem;
  font-size: 0.75rem;
}

.rule-chip {
  background: rgba(0, 0, 0, 0.35);
  padding: 0.2rem 0.45rem;
  border-radius: 3px;
  color: #d1d5db;
}

.rule-chip .k {
  color: #9ca3af;
  font-weight: 600;
}

.rule-chip .v {
  color: #fca5a5;
  font-weight: 700;
}

.rule-chip.kill-rule {
  grid-column: span 2;
  background: rgba(229, 9, 20, 0.15);
  border: 1px solid rgba(229, 9, 20, 0.3);
  text-align: center;
}

.rule-chip.kill-rule .v {
  color: #ff4d6d;
}

/* Quick Actions */
.quick-actions-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.action-ghost-btn {
  background: rgba(20, 24, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  font-family: var(--font-tech);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 0.6rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-ghost-btn:hover {
  background: rgba(30, 36, 48, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.action-ghost-btn.danger:hover {
  background: rgba(60, 10, 15, 0.8);
  border-color: var(--crimson-primary);
  color: #fca5a5;
}

/* =====================================================================
   12 TEAMS INPUT SLOTS GRID (RIGHT COLUMN)
===================================================================== */
.teams-instructions {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 0.85rem;
}

/* Roster Quick Actions Bar (Paste Slot List / Autofill / Clear) */
.roster-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
  padding: 0.65rem 0.85rem;
  background: rgba(18, 10, 15, 0.6);
  border: 1px solid rgba(229, 9, 20, 0.25);
  border-radius: 6px;
}

.paste-roster-btn {
  padding: 0.55rem 1.25rem !important;
  font-size: 0.82rem !important;
  letter-spacing: 1.5px !important;
}

.roster-sub-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ========================================================
   LEFT SIDEBAR: PASTE SLOTS & LINEUPS CARD (User Red Loop Area)
   ======================================================== */
.paste-roster-sidebar-card {
  background: rgba(13, 16, 22, 0.92);
  border: 1px solid rgba(229, 9, 20, 0.35);
  border-radius: 6px;
  box-shadow: 
    0 12px 30px -8px rgba(0, 0, 0, 0.8),
    inset 0 0 15px rgba(229, 9, 20, 0.05);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.paste-roster-sidebar-card:focus-within {
  border-color: rgba(229, 9, 20, 0.7);
  box-shadow: 
    0 12px 35px -6px rgba(0, 0, 0, 0.9),
    0 0 20px rgba(229, 9, 20, 0.25);
}

.paste-roster-sidebar-card .card-header {
  border-bottom: 1px solid rgba(229, 9, 20, 0.25);
  padding: 0.95rem 1.25rem;
}

.paste-roster-sidebar-card .card-body {
  padding: 1.15rem;
}

.importer-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.importer-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.importer-sparkle-icon {
  font-size: 1.15rem;
  color: #ff4d6d;
}

.importer-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: #fff;
  text-transform: uppercase;
  margin: 0;
}

.importer-sample-link {
  background: rgba(229, 9, 20, 0.15);
  border: 1px solid rgba(229, 9, 20, 0.35);
  border-radius: 4px;
  color: #fca5a5;
  font-family: var(--font-tech);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  padding: 0.25rem 0.65rem;
  transition: all 0.2s ease;
}

.importer-sample-link:hover {
  background: rgba(229, 9, 20, 0.3);
  color: #ffffff;
  border-color: #ff1744;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.4);
}

.importer-card-hint {
  color: #94a3b8;
  font-family: var(--font-tech);
  font-size: 0.8rem;
  line-height: 1.45;
  margin-bottom: 0.75rem;
  letter-spacing: 0.2px;
}

.importer-card-hint strong {
  color: #f87171;
}

.importer-textarea-container {
  width: 100%;
  position: relative;
}

.messy-slot-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(5, 7, 11, 0.95);
  border: 1px solid rgba(229, 9, 20, 0.35);
  border-radius: 5px;
  color: #ffffff;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.82rem;
  padding: 0.75rem 0.85rem;
  line-height: 1.45;
  resize: vertical;
  min-height: 175px;
  max-height: 320px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.messy-slot-textarea::placeholder {
  color: rgba(148, 163, 184, 0.5);
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.8rem;
}

.messy-slot-textarea:focus {
  border-color: #ff1744;
  box-shadow: 0 0 18px rgba(229, 9, 20, 0.35);
  background: rgba(9, 12, 18, 0.98);
}

.importer-sidebar-actions {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.clear-btn-sidebar {
  padding: 0.6rem 0.85rem !important;
  font-size: 0.78rem !important;
  white-space: nowrap;
}

.importer-clean-btn {
  background: linear-gradient(135deg, #e50914 0%, #b71c1c 100%);
  color: #ffffff;
  border: 1px solid #ff4d6d;
  border-radius: 5px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 1.2px;
  padding: 0.65rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(229, 9, 20, 0.4);
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.importer-clean-btn:hover {
  background: linear-gradient(135deg, #ff1744 0%, #d50000 100%);
  color: #ffffff;
  border-color: #ff8597;
  box-shadow: 0 0 24px rgba(255, 23, 68, 0.7);
  transform: translateY(-1px);
}

.importer-clean-btn:active {
  transform: translateY(0);
}

.add-to-teams-btn {
  flex: 1;
}

.btn-clean-sparkle {
  font-size: 0.95rem;
}

.importer-sidebar-status {
  font-family: var(--font-tech);
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.35;
}

.importer-sidebar-status .status-dot {
  color: #10b981;
  font-size: 0.65rem;
}

/* Subtle pulse glow animation on Competing Teams card when populated */
@keyframes rosterAddPulse {
  0% {
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(229, 9, 20, 0.05);
    border-color: rgba(229, 9, 20, 0.3);
  }
  40% {
    box-shadow: 0 0 35px rgba(229, 9, 20, 0.6), inset 0 0 25px rgba(229, 9, 20, 0.2);
    border-color: #ff1744;
  }
  100% {
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(229, 9, 20, 0.05);
    border-color: rgba(229, 9, 20, 0.3);
  }
}

.roster-updated-glow {
  animation: rosterAddPulse 1.2s ease-out;
}

/* Paste Slot List Modal & Textarea */
.paste-lineup-modal-card {
  max-width: 650px !important;
}

.cyber-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(8, 10, 15, 0.95);
  border: 1px solid rgba(229, 9, 20, 0.45);
  border-radius: 4px;
  color: #ffffff;
  font-family: var(--font-tech), monospace;
  font-size: 0.82rem;
  padding: 0.75rem;
  line-height: 1.45;
  resize: vertical;
  outline: none;
  transition: all 0.2s ease;
}

.cyber-textarea:focus {
  border-color: #ff1744;
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.5);
}

.preview-count-badge {
  font-family: var(--font-tech);
  font-size: 0.75rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.5);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  letter-spacing: 1px;
}

.preview-count-badge.has-slots {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.paste-detected-summary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 140px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.6rem 0.85rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: #9ca3af;
}

.paste-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  padding-bottom: 0.25rem;
}

.paste-summary-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.paste-item-team {
  font-weight: 800;
  color: #ffffff;
}

.paste-item-players {
  font-size: 0.7rem;
  color: #fca5a5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.teams-input-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1rem;
}

@media (max-width: 640px) {
  .teams-input-grid {
    grid-template-columns: 1fr;
  }
}

/* Team Slot Input Item matching image's parallelogram badge vibe */
.team-slot-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, rgba(20, 12, 16, 0.95) 0%, rgba(13, 16, 22, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.2s ease;
  position: relative;
}

.team-slot-card:focus-within {
  border-color: var(--crimson-primary);
  box-shadow: 
    0 0 14px rgba(229, 9, 20, 0.35),
    inset 0 0 10px rgba(229, 9, 20, 0.1);
  transform: translateY(-1px);
}

.team-slot-top-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.25);
}

/* Red parallelogram rank badge like the image */
.slot-badge {
  flex-shrink: 0;
  width: 54px;
  height: 44px;
  background: var(--crimson-badge-grad);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  clip-path: polygon(0 0, 100% 0, 75% 100%, 0 100%);
  padding-right: 10px;
  position: relative;
}

.slot-badge .crown-slot-icon {
  font-size: 0.65rem;
  line-height: 1;
  color: #ffeb3b;
  margin-bottom: 1px;
}

.slot-badge .slot-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.slot-input-wrap {
  flex: 1;
  padding: 0.25rem 0.65rem;
}

.team-name-input {
  width: 100%;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-tech);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 0.4rem 0.25rem;
  outline: none;
  text-transform: uppercase;
}

.team-name-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
  font-weight: 500;
}

/* 4 Players Inputs Section under Each Team */
.team-players-section {
  padding: 0.5rem 0.75rem 0.65rem 0.75rem;
  background: rgba(8, 10, 15, 0.6);
}

.team-players-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-tech);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #9ca3af;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.team-players-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem 0.5rem;
}

.player-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  padding: 0.15rem 0.4rem;
  transition: border-color 0.15s ease;
}

.player-input-wrap:focus-within {
  border-color: rgba(229, 9, 20, 0.6);
  background: rgba(20, 10, 14, 0.6);
}

.player-p-prefix {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 800;
  color: #ff4d6d;
  margin-right: 0.3rem;
  opacity: 0.85;
}

.player-name-input {
  width: 100%;
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-family: var(--font-tech);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0;
  outline: none;
}

.player-name-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.72rem;
}

/* Match Team Card Players Preview Bar */
.card-team-players-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 3px;
  border-left: 2px solid var(--crimson-primary);
  margin-top: -0.25rem;
}

.roster-prefix-tag {
  font-family: var(--font-tech);
  font-size: 0.68rem;
  font-weight: 800;
  color: #fca5a5;
  letter-spacing: 0.8px;
  margin-right: 0.2rem;
}

.roster-player-chip {
  font-family: var(--font-tech);
  font-size: 0.72rem;
  font-weight: 600;
  color: #d1d5db;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
}

/* =====================================================================
   START TOURNAMENT BUTTON
===================================================================== */
.start-action-wrapper {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.validation-error {
  display: none;
  background: rgba(180, 0, 20, 0.25);
  border: 1px solid var(--crimson-primary);
  color: #fca5a5;
  font-family: var(--font-tech);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-align: center;
  width: 100%;
}

.validation-error.show {
  display: block;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.cyber-btn {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 2.5px;
  cursor: pointer;
  border: none;
  outline: none;
  position: relative;
  transition: all 0.25s var(--ease-cyber);
}

.primary-start-btn {
  background: var(--crimson-gradient);
  color: #ffffff;
  padding: 1rem 3.5rem;
  border-radius: 4px;
  clip-path: polygon(15px 0, 100% 0, calc(100% - 15px) 100%, 0 100%);
  box-shadow: 
    0 8px 25px rgba(229, 9, 20, 0.5),
    0 0 20px rgba(255, 23, 68, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.primary-start-btn .btn-content {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.primary-start-btn .btn-arrow {
  width: 22px;
  height: 22px;
  transition: transform 0.25s ease;
}

.primary-start-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 12px 35px rgba(229, 9, 20, 0.7),
    0 0 35px rgba(255, 23, 68, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.primary-start-btn:hover .btn-arrow {
  transform: translateX(5px);
}

.primary-start-btn:active {
  transform: translateY(1px) scale(0.99);
}

/* Secondary & Danger Buttons */
.secondary-btn {
  background: rgba(20, 24, 34, 0.85);
  border: 1px solid rgba(229, 9, 20, 0.4);
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 1.5px;
  padding: 0.65rem 1.25rem;
  border-radius: 4px;
}

.secondary-btn:hover {
  background: rgba(35, 15, 22, 0.9);
  border-color: var(--crimson-primary);
  box-shadow: 0 0 15px rgba(229, 9, 20, 0.3);
}

.danger-btn {
  background: rgba(50, 10, 15, 0.7);
  border: 1px solid rgba(229, 9, 20, 0.3);
  color: #fca5a5;
  font-size: 0.82rem;
  letter-spacing: 1.5px;
  padding: 0.65rem 1.25rem;
  border-radius: 4px;
}

.danger-btn:hover {
  background: var(--crimson-dark);
  border-color: var(--crimson-primary);
  color: #fff;
}

/* =====================================================================
   SCREEN 2: TOURNAMENT DASHBOARD & LEADERBOARD
   Faithfully styling the table from IMG_20261011_112403.jpg
===================================================================== */
.tournament-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: rgba(13, 16, 22, 0.9);
  border: 1px solid rgba(229, 9, 20, 0.3);
  padding: 1.2rem 1.5rem;
  border-radius: 6px;
  margin-bottom: 2rem;
}

.active-tourney-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(229, 9, 20, 0.15);
  border: 1px solid rgba(229, 9, 20, 0.4);
  color: #ff4d6d;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  width: fit-content;
}

.blink-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff1744;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.85); }
}

#active-tournament-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
}

.meta-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.meta-stats b {
  color: #fff;
}

.meta-stats .status-ready {
  color: #34d399;
}

.tourney-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tourney-controls .cyber-btn {
  font-family: var(--font-tech), sans-serif !important;
  font-weight: 800 !important;
  font-size: 0.78rem !important;
  letter-spacing: 1px !important;
  padding: 0.55rem 0.9rem !important;
  border-radius: 4px !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
}

/* 1. Google Account Button (Clean Dark Blue) */
.tourney-controls #btn-google-account {
  background: rgba(30, 58, 138, 0.25) !important;
  border: 1px solid rgba(59, 130, 246, 0.6) !important;
  color: #93c5fd !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}
.tourney-controls #btn-google-account:hover {
  background: rgba(30, 58, 138, 0.55) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5) !important;
  transform: translateY(-1px);
}

/* 2. Sync Sheets Button (Clean Dark Emerald) */
.tourney-controls #btn-sync-sheets {
  background: rgba(6, 78, 59, 0.25) !important;
  border: 1px solid rgba(16, 185, 129, 0.6) !important;
  color: #6ee7b7 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}
.tourney-controls #btn-sync-sheets:hover {
  background: rgba(6, 78, 59, 0.55) !important;
  border-color: #34d399 !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5) !important;
  transform: translateY(-1px);
}

/* 3. Drive Backup Button (Dark Crimson) */
.tourney-controls #btn-cloud-backup {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.35) 0%, rgba(153, 27, 27, 0.45) 100%) !important;
  border: 1px solid rgba(239, 68, 68, 0.6) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}
.tourney-controls #btn-cloud-backup:hover {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.6) 0%, rgba(185, 28, 28, 0.7) 100%) !important;
  border-color: #ff334b !important;
  box-shadow: 0 0 15px rgba(229, 9, 20, 0.55) !important;
  transform: translateY(-1px);
}

/* 4. Edit Setup / Teams Button (Dark Steel) */
.tourney-controls #btn-back-setup {
  background: rgba(20, 24, 34, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #d1d5db !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}
.tourney-controls #btn-back-setup:hover {
  background: rgba(35, 15, 22, 0.85) !important;
  border-color: var(--crimson-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.35) !important;
  transform: translateY(-1px);
}

/* 5. Reset Tournament Button (Dark Crimson Danger) */
.tourney-controls #btn-reset-tournament {
  background: rgba(50, 10, 15, 0.65) !important;
  border: 1px solid rgba(229, 9, 20, 0.45) !important;
  color: #fca5a5 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}
.tourney-controls #btn-reset-tournament:hover {
  background: rgba(185, 28, 28, 0.6) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(229, 9, 20, 0.5) !important;
  transform: translateY(-1px);
}

/* LEADERBOARD POSTER FRAME (MATCHING THE UPLOADED IMAGE) */
.scrims-table-container {
  max-width: 960px;
  margin: 0 auto;
  position: relative;
}

.scrims-frame {
  background: #090b10;
  border: 2px solid var(--crimson-primary);
  border-radius: 12px;
  padding: 0.6rem 0.75rem 1rem;
  box-shadow: 
    0 0 25px rgba(229, 9, 20, 0.35),
    inset 0 0 20px rgba(0, 0, 0, 0.9);
  position: relative;
}

/* Red Chamfered Outer Corners like reference */
.scrims-frame::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 20px;
  right: 20px;
  height: 4px;
  background: linear-gradient(90deg, transparent, #ff1744 20%, #ff1744 80%, transparent);
}

/* HEADER ROW OF THE TABLE */
.scrims-table-header {
  display: grid;
  grid-template-columns: 100px 1fr 140px 160px 130px;
  align-items: center;
  background: linear-gradient(90deg, #b00610 0%, #15080c 45%, #15080c 60%, #b00610 100%);
  border: 1px solid rgba(255, 23, 68, 0.5);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.65rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-align: center;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 100%, 0 100%);
}

.col-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.col-rank .hash-tag {
  color: #ff4d6d;
  font-size: 1.1rem;
}

.col-team {
  text-align: left;
  padding-left: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.col-position, .col-elimination, .col-total {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.col-total .star-icon {
  color: #ff1744;
  font-size: 1.1rem;
}

/* LEADERBOARD ROWS */
.scrims-table-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.scrims-row {
  display: grid;
  grid-template-columns: 85px 1fr 140px 160px 115px;
  align-items: center;
  height: 48px;
  position: relative;
  transition: transform 0.15s ease;
}

/* UI Animations: Sequential slide-in from left */
.scrims-row.animate-slide-in {
  opacity: 0;
  transform: translateX(-40px);
  animation: gamingRowSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes gamingRowSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-50px) scale(0.97);
    filter: brightness(1.8) drop-shadow(-10px 0 15px rgba(255, 23, 68, 0.8));
  }
  60% {
    opacity: 1;
    transform: translateX(6px) scale(1.01);
    filter: brightness(1.2);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: brightness(1);
  }
}

.scrims-row:hover {
  transform: translateX(2px);
}

/* Rank Badge Pill (Left) */
.row-rank-badge {
  height: 40px;
  background: var(--crimson-badge-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 1px;
  clip-path: polygon(0 0, 100% 0, 75% 100%, 0 100%);
  padding-right: 12px;
  position: relative;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.4);
}

.scrims-row.rank-1 .row-rank-badge {
  background: linear-gradient(135deg, #ff1744 0%, #b30018 100%);
  box-shadow: 0 0 15px rgba(255, 23, 68, 0.7);
}

.scrims-row.rank-1 .row-rank-badge::before {
  content: '👑';
  position: absolute;
  top: -9px;
  left: 20px;
  font-size: 0.75rem;
}

/* Center Panel (Brushed dark metal slot) */
.row-team-panel {
  height: 40px;
  background: linear-gradient(90deg, #121620 0%, #171b26 50%, #121620 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  padding-left: 1.5rem;
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-transform: uppercase;
  position: relative;
  margin-left: -8px;
  margin-right: -8px;
  z-index: 1;
}

/* Subtle groove lines in team panel like in poster */
.row-team-panel::after {
  content: '';
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 2px;
  background: rgba(255, 255, 255, 0.07);
}

/* Metric values */
.row-pos-val, .row-elim-val {
  height: 40px;
  background: #141824;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: #e5e7eb;
  z-index: 1;
}

.row-pos-val {
  color: #93c5fd;
}

.row-elim-val {
  color: #fca5a5;
}

/* Total Points Badge (Right red trapezoid) */
.row-total-badge {
  height: 40px;
  background: var(--crimson-badge-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 1px;
  clip-path: polygon(25% 0, 100% 0, 100% 100%, 0% 100%);
  padding-left: 12px;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.4);
  z-index: 2;
  position: relative;
}

.scrims-row.rank-1 .row-total-badge {
  background: linear-gradient(135deg, #ff1744 0%, #b30018 100%);
  box-shadow: 0 0 15px rgba(255, 23, 68, 0.7);
  color: #fff;
}

/* Gaming Count-Up Number Glow Animation */
.row-total-badge .count-up-number {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  transition: transform 0.15s ease;
}

.row-total-badge.counting {
  text-shadow: 0 0 12px #ffffff, 0 0 25px #ff1744;
  animation: badgeCountPulse 0.4s ease-in-out infinite alternate;
}

@keyframes badgeCountPulse {
  from {
    filter: brightness(1.1);
    transform: scale(1);
  }
  to {
    filter: brightness(1.4);
    transform: scale(1.04);
  }
}

/* Table Footer matching the reference image bottom */
.scrims-table-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
  gap: 1rem;
}

.footer-center-tag {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-main-text {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(229, 9, 20, 0.8);
}

.red-line {
  display: inline-block;
  width: 40px;
  height: 2px;
  background: #ff1744;
}

.footer-sub-links {
  text-align: center;
  font-family: var(--font-tech);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: #9ca3af;
  margin-top: 0.5rem;
}

.sub-sep {
  color: #e50914;
  margin: 0 0.5rem;
}

/* Next phase info drawer */
.next-phase-banner {
  margin-top: 2rem;
  background: rgba(18, 12, 16, 0.8);
  border: 1px solid rgba(229, 9, 20, 0.35);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
}

.next-banner-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.next-icon {
  font-size: 2.2rem;
}

.next-banner-content h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ff4d6d;
  margin-bottom: 0.25rem;
}

.next-banner-content p {
  font-size: 0.85rem;
  color: #9ca3af;
}

/* Responsive adjustments for mobile view */
@media (max-width: 768px) {
  .scrims-table-header {
    grid-template-columns: 60px 1fr 70px 70px 75px;
    font-size: 0.7rem;
    padding: 0.5rem;
  }
  .scrims-row {
    grid-template-columns: 55px 1fr 70px 70px 70px;
    height: 42px;
  }
  .row-rank-badge {
    height: 36px;
    font-size: 0.95rem;
  }
  .row-team-panel {
    height: 36px;
    font-size: 0.85rem;
    padding-left: 0.8rem;
  }
  .row-pos-val, .row-elim-val {
    height: 36px;
    font-size: 0.9rem;
  }
  .row-total-badge {
    height: 36px;
    font-size: 0.95rem;
  }
}

/* =====================================================================
   MATCH INPUT INTERFACE STYLES (PROMPT 2)
===================================================================== */
.tournament-nav-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(229, 9, 20, 0.25);
  padding-bottom: 0.75rem;
}

.tourney-nav-btn {
  background: rgba(15, 18, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #9ca3af;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.25s var(--ease-cyber);
  position: relative;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.tourney-nav-btn:hover {
  color: #fff;
  border-color: var(--crimson-primary);
  background: rgba(30, 16, 22, 0.85);
}

.tourney-nav-btn.active {
  background: var(--crimson-gradient);
  border-color: #ff334b;
  color: #ffffff;
  box-shadow: 
    0 4px 15px rgba(229, 9, 20, 0.5),
    0 0 15px rgba(255, 23, 68, 0.3);
}

.match-progress-badge {
  font-family: var(--font-tech);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.4);
  color: #ffcdd2;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

.tourney-nav-btn.active .match-progress-badge {
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
}

.tourney-subview {
  display: none;
  animation: fadeIn 0.35s var(--ease-cyber) forwards;
}

.tourney-subview.active {
  display: block;
}

/* Match Input Card */
.match-input-card {
  padding: 1.5rem;
}

.match-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(229, 9, 20, 0.25);
  margin-bottom: 1.25rem;
}

.selector-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.selector-icon {
  font-size: 1.75rem;
}

.selector-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
}

.selector-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.match-dropdown-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.match-dropdown-wrap label {
  font-family: var(--font-tech);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fca5a5;
}

.cyber-select {
  background: rgba(8, 10, 15, 0.95);
  border: 1px solid rgba(229, 9, 20, 0.45);
  color: #ffffff;
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cyber-select:focus {
  border-color: #ff1744;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

/* =====================================================================
   MANUAL vs AUTO MATCH INPUT MODE
===================================================================== */
.match-mode-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0.6rem 0.85rem;
  background: rgba(15, 18, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  flex-wrap: wrap;
}

.match-mode-label {
  font-family: var(--font-tech);
  font-weight: 800;
  font-size: 0.8rem;
  color: #9ca3af;
  letter-spacing: 1.2px;
}

.match-mode-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.match-mode-btn {
  background: rgba(22, 27, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 1px;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.match-mode-btn:hover {
  border-color: #38bdf8;
  color: #ffffff;
  background: rgba(30, 41, 59, 0.9);
}

.match-mode-btn#btn-mode-manual.active {
  background: var(--crimson-badge-grad);
  border-color: #ff334b;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.5);
}

.match-mode-btn#btn-mode-auto.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.5);
}

.auto-match-panel {
  background: rgba(14, 17, 24, 0.85);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.auto-paste-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.auto-paste-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auto-paste-icon {
  font-size: 1.75rem;
}

.auto-paste-title {
  margin: 0;
  font-family: var(--font-tech);
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1px;
}

.auto-paste-subtitle {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: #38bdf8;
}

.auto-paste-textarea-wrap {
  margin-bottom: 1rem;
}

.auto-paste-textarea {
  width: 100%;
  min-height: 200px;
  background: rgba(8, 10, 15, 0.95);
  border: 1px solid rgba(14, 165, 233, 0.4);
  border-radius: 6px;
  color: #f1f5f9;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  padding: 0.85rem;
  box-sizing: border-box;
  resize: vertical;
  white-space: pre;
  overflow-x: auto;
}

.auto-paste-textarea:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.35);
}

.auto-paste-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.auto-paste-feedback-box {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-family: var(--font-tech);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.auto-paste-feedback-box.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.auto-paste-feedback-box.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.auto-paste-preview-wrap {
  margin-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
}

.auto-preview-title {
  margin: 0 0 0.75rem 0;
  font-family: var(--font-tech);
  font-size: 0.85rem;
  font-weight: 800;
  color: #cbd5e1;
  letter-spacing: 1px;
}

.auto-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-display);
  font-size: 0.82rem;
}

.auto-preview-table th {
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.auto-preview-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
}

.auto-preview-table tr:hover td {
  background: rgba(56, 189, 248, 0.08);
}

/* Match Tabs Strip */
.match-tabs-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.match-tab-btn {
  background: rgba(18, 22, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d1d5db;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  padding: 0.6rem 1.15rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.match-tab-btn:hover {
  border-color: var(--crimson-primary);
  color: #fff;
  background: rgba(30, 18, 24, 0.8);
}

.match-tab-btn.active {
  background: var(--crimson-badge-grad);
  border-color: #ff334b;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.5);
}

.match-tab-btn .tab-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6b7280;
}

.match-tab-btn.saved .tab-status-dot {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.match-tab-btn.active .tab-status-dot {
  background: #ffffff;
}

/* Prompt 7: Edit indicator pill inside tab */
.tab-edit-pill {
  font-size: 0.68rem;
  font-family: var(--font-tech);
  font-weight: 800;
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.6);
  color: #fbbf24;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-left: 0.25rem;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: all 0.2s ease;
}

.match-tab-btn:hover .tab-edit-pill {
  background: #f59e0b;
  color: #000;
  border-color: #fbbf24;
}

/* Prompt 7: Completed Matches Quick Edit Access Bar */
.completed-matches-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  background: rgba(18, 22, 32, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
}

.completed-bar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.completed-bar-header .bar-icon {
  font-size: 1rem;
}

.completed-bar-header .bar-title {
  font-family: var(--font-tech);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #f59e0b;
}

.completed-matches-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.match-edit-quick-btn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde68a;
  font-family: var(--font-tech);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.match-edit-quick-btn:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: #fbbf24;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.match-edit-quick-btn.active {
  background: #f59e0b;
  border-color: #fef08a;
  color: #0b0e14;
  font-weight: 900;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.no-completed-msg {
  font-family: var(--font-tech);
  font-size: 0.78rem;
  color: #9ca3af;
  font-style: italic;
}

/* Prompt 7: Edit Mode Alert Box */
.edit-mode-box {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  color: #fef3c7;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  animation: fadeIn 0.3s ease;
}

.edit-banner-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

.edit-banner-content strong {
  color: #fcd34d;
  letter-spacing: 1px;
}

/* Active Match Banner Edit State */
.active-match-banner.editing-saved-match {
  background: linear-gradient(90deg, rgba(60, 35, 10, 0.9) 0%, rgba(20, 16, 22, 0.9) 100%);
  border-color: #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.match-status-pill.editing {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fcd34d;
  animation: pulse 1.5s infinite;
}

/* Save button in edit mode */
.save-match-btn.btn-edit-mode {
  background: linear-gradient(135deg, #d97706 0%, #b45309 50%, #92400e 100%);
  box-shadow: 
    0 8px 25px rgba(217, 119, 6, 0.5),
    0 0 20px rgba(245, 158, 11, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.save-match-btn.btn-edit-mode:hover {
  box-shadow: 
    0 12px 35px rgba(217, 119, 6, 0.7),
    0 0 35px rgba(245, 158, 11, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Inline Edit Button for Tables / Modals */
.inline-edit-btn {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  font-family: var(--font-tech);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  margin-left: 0.35rem;
}

.inline-edit-btn:hover {
  background: #f59e0b;
  color: #000;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

/* Matrix Match Header Edit link */
.matrix-match-header-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.matrix-edit-link {
  font-size: 0.65rem;
  color: #f59e0b;
  text-decoration: none;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.matrix-edit-link:hover {
  background: #f59e0b;
  color: #000;
}

/* Active Match Banner */
.active-match-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: linear-gradient(90deg, rgba(35, 12, 18, 0.85) 0%, rgba(13, 16, 22, 0.85) 100%);
  border: 1px solid rgba(229, 9, 20, 0.35);
  border-radius: 4px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
}

.active-match-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.match-flame {
  font-size: 1.3rem;
}

#active-match-title-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
}

.match-status-pill {
  font-family: var(--font-tech);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  background: rgba(229, 9, 20, 0.2);
  border: 1px solid rgba(229, 9, 20, 0.4);
  color: #ff8093;
}

.match-status-pill.saved {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.match-tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Alerts */
.match-alert-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: 4px;
  margin-bottom: 1.25rem;
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.5px;
}

.match-alert-box.error {
  background: rgba(180, 0, 20, 0.25);
  border: 1px solid #ff1744;
  color: #fca5a5;
  animation: shake 0.3s ease;
}

.match-alert-box.success {
  background: rgba(6, 95, 70, 0.35);
  border: 1px solid #10b981;
  color: #6ee7b7;
  animation: fadeIn 0.3s ease;
}

.alert-icon {
  font-size: 1.25rem;
}

/* 12 Teams Match Form Grid */
.match-teams-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .match-teams-grid {
    grid-template-columns: 1fr;
  }
}

.match-team-form-card {
  background: linear-gradient(90deg, rgba(18, 22, 30, 0.9) 0%, rgba(13, 16, 22, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.match-team-form-card:hover {
  border-color: rgba(229, 9, 20, 0.35);
  background: linear-gradient(90deg, rgba(22, 26, 36, 0.9) 0%, rgba(16, 20, 28, 0.95) 100%);
}

.match-team-form-card.has-conflict {
  border-color: #ff1744 !important;
  background: rgba(60, 10, 18, 0.85) !important;
  box-shadow: 0 0 15px rgba(255, 23, 68, 0.45);
}

.match-team-form-card.has-conflict::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #ff1744;
}

/* Team Row Header */
.card-team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.team-meta-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.team-mini-badge {
  background: var(--crimson-badge-grad);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 0.2rem 0.5rem;
  clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%);
  padding-right: 0.65rem;
}

.team-label-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  text-transform: uppercase;
}

.team-pts-preview {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-tech);
  font-size: 0.8rem;
  font-weight: 800;
  color: #ff99aa;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  border: 1px solid rgba(229, 9, 20, 0.25);
}

.team-pts-preview b {
  color: #ff1744;
  font-family: var(--font-display);
  font-size: 0.95rem;
}

/* Form Inputs Flex Row */
.card-inputs-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 0.85rem;
  align-items: end;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-block label {
  font-family: var(--font-tech);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #9ca3af;
  text-transform: uppercase;
}

.placement-select {
  width: 100%;
  background: rgba(8, 10, 15, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.55rem 0.65rem;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.placement-select:focus {
  border-color: var(--crimson-primary);
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}

.placement-select.input-error {
  border-color: #ff1744 !important;
  background: rgba(45, 10, 15, 0.9);
  color: #fca5a5;
}

.kills-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.kills-input {
  width: 100%;
  background: rgba(8, 10, 15, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0.5rem 0.65rem 0.5rem 2rem;
  border-radius: 4px;
  outline: none;
  transition: all 0.2s ease;
}

.kills-input:focus {
  border-color: var(--crimson-primary);
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}

.skull-prefix {
  position: absolute;
  left: 0.55rem;
  font-size: 0.9rem;
  pointer-events: none;
  opacity: 0.8;
}

/* Minus Points / Penalty Deduction Input Row */
.card-minus-row {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.minus-field-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.minus-label {
  font-family: var(--font-tech);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 1.1px;
  color: #f87171;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.minus-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 120px;
}

.minus-input {
  width: 100%;
  background: rgba(25, 8, 12, 0.9);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0.45rem 0.65rem 0.45rem 2rem;
  border-radius: 4px;
  outline: none;
  transition: all 0.2s ease;
}

.minus-input:focus {
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.minus-prefix {
  position: absolute;
  left: 0.55rem;
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0.85;
}

.conflict-warning-tag {
  font-size: 0.74rem;
  color: #f87171;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* =====================================================================
   SQUAD PLAYER KILLS (MVP TRACKER) IN MATCH CARDS
===================================================================== */
.card-player-kills-section {
  margin-top: 0.65rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  padding: 0.55rem 0.65rem;
}

.player-kills-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-tech);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #fbbf24;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.player-kills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.45rem;
}

.player-kill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 18, 25, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 0.25rem 0.45rem;
  gap: 0.35rem;
}

.player-kill-name {
  font-family: var(--font-tech);
  font-size: 0.72rem;
  font-weight: 700;
  color: #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 85px;
}

.player-kill-counter {
  display: flex;
  align-items: center;
  gap: 2px;
}

.btn-kill-step {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 20px;
  height: 22px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.btn-kill-step:hover {
  background: var(--crimson-primary);
  border-color: #ff1744;
}

.player-kill-input {
  width: 28px;
  height: 22px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fef08a;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  border-radius: 3px;
  outline: none;
  padding: 0;
}

/* Save Footer */
.match-save-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(229, 9, 20, 0.25);
}

.save-status-info {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.save-match-btn {
  padding: 0.85rem 3rem;
  font-size: 1.05rem;
}

/* =====================================================================
   CUMULATIVE MATRIX & BREAKDOWN MODAL STYLES (PROMPT 3)
===================================================================== */
.scoring-formula-tag {
  background: rgba(229, 9, 20, 0.2);
  border: 1px solid rgba(229, 9, 20, 0.4);
  color: #fca5a5;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
}

.matrix-rules-banner {
  background: rgba(20, 10, 14, 0.6);
  border: 1px solid rgba(229, 9, 20, 0.25);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
}

.matrix-rules-title {
  font-family: var(--font-tech);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ff4d6d;
  margin-bottom: 0.5rem;
}

.matrix-rules-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.78rem;
  color: #d1d5db;
}

.matrix-rules-grid b {
  color: #ffffff;
}

/* Responsive Table Matrix */
.table-responsive-matrix {
  overflow-x: auto;
  border: 1px solid rgba(229, 9, 20, 0.25);
  border-radius: 6px;
  background: rgba(10, 12, 18, 0.9);
}

.cyber-matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-family: var(--font-tech);
  font-size: 0.88rem;
}

.cyber-matrix-table th {
  background: linear-gradient(180deg, rgba(35, 12, 18, 0.95) 0%, rgba(20, 8, 12, 0.95) 100%);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 0.85rem 0.65rem;
  border-bottom: 2px solid var(--crimson-primary);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.cyber-matrix-table td {
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
}

.cyber-matrix-table tr:hover {
  background: rgba(40, 15, 22, 0.4);
  cursor: pointer;
}

.cyber-matrix-table .col-rank-num {
  font-family: var(--font-display);
  font-weight: 900;
  color: #ff4d6d;
  width: 55px;
}

.cyber-matrix-table .col-team-name {
  text-align: left;
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: 0.95rem;
  padding-left: 1rem;
  color: #ffffff;
  white-space: nowrap;
}

.cyber-matrix-table .match-cell {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.cyber-matrix-table .match-cell-sub {
  font-size: 0.7rem;
  color: #94a3b8;
  display: block;
}

.cyber-matrix-table .col-total-place {
  font-weight: 800;
  color: #93c5fd;
}

.cyber-matrix-table .col-total-kills {
  font-weight: 800;
  color: #fca5a5;
}

.cyber-matrix-table .col-grand-total {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  color: #ffffff;
  background: rgba(229, 9, 20, 0.25);
  border-left: 1px solid rgba(229, 9, 20, 0.4);
  text-shadow: 0 0 10px rgba(229, 9, 20, 0.6);
}

.scrims-row {
  cursor: pointer;
}

/* Modal Popup for Team Breakdown */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: #0f131b;
  border: 1px solid var(--crimson-primary);
  border-radius: 8px;
  width: 100%;
  max-width: 600px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.9),
    0 0 30px rgba(229, 9, 20, 0.4);
  overflow: hidden;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.5rem;
  background: linear-gradient(90deg, rgba(35, 12, 18, 0.95) 0%, rgba(15, 19, 27, 0.95) 100%);
  border-bottom: 1px solid rgba(229, 9, 20, 0.35);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-crown {
  font-size: 1.3rem;
}

#modal-team-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 1.35rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s ease;
}

.modal-close-btn:hover {
  color: #ff1744;
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-match-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 22, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.65rem;
}

.modal-match-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.88rem;
  color: #ff4d6d;
}

.modal-breakdown-details {
  display: flex;
  gap: 1.25rem;
  font-size: 0.82rem;
  color: #d1d5db;
}

.modal-match-total {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  color: #ffffff;
  background: rgba(229, 9, 20, 0.25);
  padding: 0.2rem 0.65rem;
  border-radius: 3px;
  border: 1px solid rgba(229, 9, 20, 0.4);
}

.modal-summary-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(229, 9, 20, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-stat-label {
  font-family: var(--font-tech);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #9ca3af;
}

.summary-grand-total {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  color: #ff1744;
  text-shadow: 0 0 10px rgba(229, 9, 20, 0.6);
}

/* =====================================================================
   FINAL LEADERBOARD & POSTER STYLES (PROMPT 4)
===================================================================== */
.leaderboard-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: rgba(13, 16, 22, 0.95);
  border: 1px solid rgba(229, 9, 20, 0.35);
  border-radius: 6px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.actions-left-group, .actions-right-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.primary-action-btn {
  background: var(--crimson-gradient);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 0.65rem 1.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 0 15px rgba(229, 9, 20, 0.4);
}

.primary-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(255, 23, 68, 0.6);
}

.primary-action-btn .refresh-icon {
  font-size: 1rem;
  transition: transform 0.4s ease;
}

.primary-action-btn.refreshing .refresh-icon {
  transform: rotate(360deg);
}

.tiebreaker-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(229, 9, 20, 0.15);
  border: 1px solid rgba(229, 9, 20, 0.4);
  color: #fca5a5;
  font-family: var(--font-tech);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.45rem 0.75rem;
  border-radius: 4px;
}

.tiebreaker-pill b {
  color: #ffffff;
  letter-spacing: 1.2px;
}

.position-mode-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(20, 24, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.toggle-label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #9ca3af;
  margin-right: 0.25rem;
}

.mode-toggle-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-family: var(--font-tech);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-toggle-btn.active {
  background: var(--crimson-badge-grad);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(229, 9, 20, 0.5);
}

.poster-dl-btn {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.65rem 1rem;
}

/* =====================================================================
   EXACT PIXEL-PERFECT SLOT LIST POSTER (Free Fire Scrims Purple Template)
   Template dimensions: 935 x 1024
===================================================================== */
.slot-list-controls-bar {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  max-width: 620px !important;
  margin: 0 auto 1rem !important;
  padding: 0.75rem 1rem !important;
  background: rgba(18, 12, 32, 0.8) !important;
  border: 1px solid rgba(168, 85, 247, 0.35) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(168, 85, 247, 0.1) !important;
  backdrop-filter: blur(8px) !important;
}

.slot-list-info-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
}

.slot-list-icon {
  font-size: 1.5rem !important;
}

.slot-list-title {
  margin: 0 !important;
  font-family: var(--font-tech), sans-serif !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
}

.slot-list-subtitle {
  font-family: var(--font-display), monospace !important;
  font-size: 0.75rem !important;
  color: #c084fc !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
}

.slot-list-actions {
  display: flex !important;
  gap: 0.5rem !important;
}

.slot-list-exact-poster-container {
  position: relative !important;
  width: 100% !important;
  max-width: 620px !important;
  margin: 0 auto 1.5rem !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.95),
    0 0 35px rgba(168, 85, 247, 0.45) !important;
  border: 2px solid #a855f7 !important;
  background: #000000 !important;
  display: block !important;
}

.slot-list-template-bg {
  width: 100% !important;
  height: auto !important;
  display: block !important;
  user-select: none !important;
  pointer-events: none !important;
}

.slot-list-overlay-slots {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  pointer-events: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 10 !important;
}

/* Individual Slot Rows mapped to the 12 template slots */
.slot-overlay-row {
  position: absolute !important;
  left: 28.5% !important;
  width: 53.5% !important;
  height: 4.1% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: flex-start !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  padding-left: 6px !important;
  padding-right: 4px !important;
  border-radius: 3px !important;
  transition: background 0.15s ease !important;
  cursor: default !important;
}

.slot-overlay-row:hover {
  background: rgba(168, 85, 247, 0.12) !important;
}

.slot-overlay-row.slot-1  { top: 31.74% !important; }
.slot-overlay-row.slot-2  { top: 36.82% !important; }
.slot-overlay-row.slot-3  { top: 41.70% !important; }
.slot-overlay-row.slot-4  { top: 46.78% !important; }
.slot-overlay-row.slot-5  { top: 51.76% !important; }
.slot-overlay-row.slot-6  { top: 56.64% !important; }
.slot-overlay-row.slot-7  { top: 61.52% !important; }
.slot-overlay-row.slot-8  { top: 66.31% !important; }
.slot-overlay-row.slot-9  { top: 71.09% !important; }
.slot-overlay-row.slot-10 { top: 75.88% !important; }
.slot-overlay-row.slot-11 { top: 80.76% !important; }
.slot-overlay-row.slot-12 { top: 85.64% !important; }

.slot-team-name {
  font-family: var(--font-tech), sans-serif !important;
  font-weight: 800 !important;
  font-size: clamp(8px, 1.35vw, 13px) !important;
  color: #ffffff !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  width: 100% !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.8) !important;
  line-height: 1.15 !important;
}

.slot-team-roster {
  font-family: var(--font-display), monospace !important;
  font-weight: 600 !important;
  font-size: clamp(6.5px, 0.95vw, 9.5px) !important;
  color: #d8b4fe !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  width: 100% !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95) !important;
  line-height: 1.15 !important;
  letter-spacing: 0.3px !important;
}

.slot-empty-label {
  font-family: var(--font-tech), sans-serif !important;
  font-size: clamp(7.5px, 1.1vw, 11px) !important;
  font-weight: 700 !important;
  color: rgba(192, 132, 252, 0.4) !important;
  letter-spacing: 1.5px !important;
  text-transform: uppercase !important;
  font-style: italic !important;
}

.slot-list-bottom-export-panel {
  max-width: 620px !important;
  margin: 0 auto 2rem !important;
}

/* =====================================================================
   EXACT PIXEL-PERFECT TEMPLATE POSTER (Jack Sparrow Scrims)
   Renders the exact template image with live data placed directly inside
===================================================================== */
.scrims-exact-poster-container {
  position: relative !important;
  width: 100% !important;
  max-width: 620px !important;
  margin: 0 auto 1.5rem !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.95),
    0 0 35px rgba(229, 9, 20, 0.5) !important;
  border: 2px solid var(--crimson-primary) !important;
  background: #000000 !important;
  display: block !important;
}

.poster-template-bg {
  width: 100% !important;
  height: auto !important;
  display: block !important;
  user-select: none !important;
  pointer-events: none !important;
}

/* Dynamic Leaderboard Data Overlay (Directly positioned over the image slots) */
.poster-overlay-slots {
  position: absolute !important;
  /* Spans the 12 slot rows with equal top and bottom spacing */
  top: 34.7% !important;
  bottom: 13.05% !important;
  left: 0 !important;
  right: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  pointer-events: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 10 !important;
}

/* Individual Overlay Row aligned exactly to each of the 12 template slots */
.overlay-row {
  height: calc(100% / 12) !important;
  min-height: calc(100% / 12) !important;
  max-height: calc(100% / 12) !important;
  flex: 0 0 calc(100% / 12) !important;
  display: flex !important;
  align-items: center !important;
  position: relative !important;
  width: 100% !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  transition: background 0.15s ease !important;
  margin: 0 !important;
  padding: 0 !important;
}

.overlay-row:hover {
  background: rgba(255, 23, 68, 0.15) !important;
}

/* Sequential Gaming Slide-in Animation */
.overlay-row.animate-slide-in {
  opacity: 0;
  transform: translateX(-35px);
  animation: overlayRowSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes overlayRowSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-35px);
    filter: brightness(1.6) drop-shadow(-8px 0 10px rgba(255, 23, 68, 0.8));
  }
  60% {
    opacity: 1;
    transform: translateX(4px);
    filter: brightness(1.2);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
    filter: brightness(1);
  }
}

/* Rank 01 Crown Badge placed above #01 */
.overlay-crown-icon {
  position: absolute !important;
  left: 10.8% !important;
  top: -1px !important;
  font-size: clamp(7px, 1.1vw, 11px) !important;
  color: #ffeb3b !important;
  filter: drop-shadow(0 0 4px #ff1744) !important;
  pointer-events: none !important;
  z-index: 15 !important;
}

/* 1. Team Name Text Slot (Centered inside metal slot away from rank badges) */
.overlay-team-name {
  position: absolute !important;
  left: 20.0% !important;
  width: 23.8% !important;
  text-align: center !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-family: var(--font-tech), sans-serif !important;
  font-weight: 800 !important;
  font-size: clamp(7.5px, 1.35vw, 12px) !important;
  color: #ffffff !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.8) !important;
  line-height: 1 !important;
}

/* 2. Booyah Column Text Slot (x=45.0% to 57.0%, under BOOYAH header) */
.overlay-booyah-val {
  position: absolute !important;
  left: 45.0% !important;
  width: 12.0% !important;
  text-align: center !important;
  font-family: var(--font-display), monospace !important;
  font-weight: 800 !important;
  font-size: clamp(8px, 1.4vw, 12.5px) !important;
  color: #fef08a !important;
  text-shadow: 0 0 6px rgba(254, 240, 138, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
  line-height: 1 !important;
}

/* 3. Position Column Text Slot (x=57.0% to 68.3%, under POS header) */
.overlay-position-val {
  position: absolute !important;
  left: 57.0% !important;
  width: 11.3% !important;
  text-align: center !important;
  font-family: var(--font-display), monospace !important;
  font-weight: 800 !important;
  font-size: clamp(8px, 1.4vw, 12.5px) !important;
  color: #93c5fd !important;
  text-shadow: 0 0 6px rgba(147, 197, 253, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
  line-height: 1 !important;
}

/* 4. Elimination Kills Text Slot (x=68.3% to 79.5%, under ELIM header) */
.overlay-elimination-val {
  position: absolute !important;
  left: 68.3% !important;
  width: 11.2% !important;
  text-align: center !important;
  font-family: var(--font-display), monospace !important;
  font-weight: 800 !important;
  font-size: clamp(8px, 1.4vw, 12.5px) !important;
  color: #fca5a5 !important;
  text-shadow: 0 0 6px rgba(252, 165, 165, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
  line-height: 1 !important;
}

/* 5. Total Points Text Slot (Inside right red badge: x=80% to 95.5%) */
.overlay-total-val {
  position: absolute !important;
  left: 80% !important;
  width: 15.5% !important;
  text-align: center !important;
  font-family: var(--font-display), monospace !important;
  font-weight: 900 !important;
  font-size: clamp(8.5px, 1.6vw, 14px) !important;
  color: #ffffff !important;
  letter-spacing: 0.5px !important;
  text-shadow: 0 0 8px rgba(255, 23, 68, 0.95), 0 2px 4px rgba(0, 0, 0, 0.95) !important;
  line-height: 1 !important;
}

.overlay-total-val.counting {
  text-shadow: 0 0 14px #ffffff, 0 0 25px #ff1744 !important;
  animation: badgeCountPulse 0.4s ease-in-out infinite alternate !important;
}

/* =====================================================================
   POSTER THEME SELECTOR & DUAL TEMPLATE SUPPORT (RED & CYAN)
===================================================================== */
/* =====================================================================
   POSTER THEME SELECTOR & MULTI-TEMPLATE SUPPORT (7 THEMES)
===================================================================== */
.poster-theme-selector {
  max-width: 860px;
  margin: 0 auto 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: rgba(13, 16, 22, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 0.65rem 1rem;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .poster-theme-selector {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.theme-select-label {
  font-family: var(--font-tech);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #d1d5db;
  white-space: nowrap;
}

.theme-select-buttons {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.theme-pill-btn {
  background: rgba(20, 24, 34, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #9ca3af;
  font-family: var(--font-tech);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 0.32rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.theme-circle {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.red-circle {
  background: #ff1744;
  box-shadow: 0 0 6px #ff1744;
}

.cyan-circle {
  background: #06b6d4;
  box-shadow: 0 0 6px #06b6d4;
}

.green-circle {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.orange-circle {
  background: #f97316;
  box-shadow: 0 0 6px #f97316;
}

.pink-circle {
  background: #ec4899;
  box-shadow: 0 0 6px #ec4899;
}

.cyan-purple-circle {
  background: linear-gradient(135deg, #00e5ff 0%, #a855f7 100%);
  box-shadow: 0 0 6px #a855f7;
}

.purple-blue-circle {
  background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  box-shadow: 0 0 6px #8b5cf6;
}

.theme-pill-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.theme-pill-btn.active[data-theme="red"] {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.35) 0%, rgba(153, 27, 27, 0.5) 100%);
  border-color: #ff1744;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.5);
}

.theme-pill-btn.active[data-theme="cyan"] {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.35) 0%, rgba(14, 116, 144, 0.5) 100%);
  border-color: #06b6d4;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

.theme-pill-btn.active[data-theme="green"] {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.35) 0%, rgba(21, 128, 61, 0.5) 100%);
  border-color: #22c55e;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.theme-pill-btn.active[data-theme="orange"] {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.35) 0%, rgba(194, 65, 12, 0.5) 100%);
  border-color: #f97316;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.5);
}

.theme-pill-btn.active[data-theme="pink"] {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.35) 0%, rgba(190, 24, 93, 0.5) 100%);
  border-color: #ec4899;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.5);
}

.theme-pill-btn.active[data-theme="cyan-purple"] {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(6, 182, 212, 0.35) 100%);
  border-color: #a855f7;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}

.theme-pill-btn.active[data-theme="purple-blue"] {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35) 0%, rgba(59, 130, 246, 0.35) 100%);
  border-color: #8b5cf6;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
}

/* --- CYAN THEME EXACT POSTER OVERRIDES (725x1024) --- */
.scrims-exact-poster-container.theme-cyan {
  border-color: #06b6d4 !important;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.95),
    0 0 35px rgba(6, 182, 212, 0.45) !important;
}

.scrims-exact-poster-container.theme-cyan .poster-overlay-slots {
  top: 37.95% !important;
  bottom: 19.35% !important;
}

.scrims-exact-poster-container.theme-cyan .overlay-crown-icon {
  left: 12.8% !important;
  transform: translateX(-50%) !important;
  top: -2px !important;
  font-size: clamp(8px, 1.2vw, 12px) !important;
}

.scrims-exact-poster-container.theme-cyan .overlay-team-name {
  left: 21.5% !important;
  width: 25.5% !important;
  text-align: center !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: clamp(7.5px, 1.3vw, 12px) !important;
}

.scrims-exact-poster-container.theme-cyan .overlay-position-val {
  left: 48.2% !important;
  width: 10.2% !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #38bdf8 !important;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}

.scrims-exact-poster-container.theme-cyan .overlay-elimination-val {
  left: 58.5% !important;
  width: 11.4% !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #fb923c !important;
  text-shadow: 0 0 8px rgba(251, 146, 60, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}

.scrims-exact-poster-container.theme-cyan .overlay-booyah-val {
  left: 70.0% !important;
  width: 12.0% !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #fef08a !important;
  text-shadow: 0 0 8px rgba(254, 240, 138, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}

.scrims-exact-poster-container.theme-cyan .overlay-total-val {
  left: 83.0% !important;
  width: 11.9% !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #ffffff !important;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.95), 0 2px 4px rgba(0, 0, 0, 0.95) !important;
}

/* =====================================================================
   MODERN 847x1024 THEMES OVERRIDES (GREEN, ORANGE, PINK, CYAN-PURPLE, PURPLE-BLUE)
===================================================================== */
.scrims-exact-poster-container.theme-green {
  border-color: #22c55e !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(34, 197, 94, 0.45) !important;
}
.scrims-exact-poster-container.theme-orange {
  border-color: #f97316 !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(249, 115, 22, 0.45) !important;
}
.scrims-exact-poster-container.theme-pink {
  border-color: #ec4899 !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(236, 72, 153, 0.45) !important;
}
.scrims-exact-poster-container.theme-cyan-purple {
  border-color: #a855f7 !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(168, 85, 247, 0.45) !important;
}
.scrims-exact-poster-container.theme-purple-blue {
  border-color: #8b5cf6 !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(139, 92, 246, 0.45) !important;
}

/* Shared slot positioning for all 5 modern 847x1024 templates */
.scrims-exact-poster-container.theme-green .poster-overlay-slots,
.scrims-exact-poster-container.theme-orange .poster-overlay-slots,
.scrims-exact-poster-container.theme-pink .poster-overlay-slots,
.scrims-exact-poster-container.theme-cyan-purple .poster-overlay-slots,
.scrims-exact-poster-container.theme-purple-blue .poster-overlay-slots {
  top: 34.7% !important;
  bottom: 13.05% !important;
}

.scrims-exact-poster-container.theme-green .overlay-crown-icon,
.scrims-exact-poster-container.theme-orange .overlay-crown-icon,
.scrims-exact-poster-container.theme-pink .overlay-crown-icon,
.scrims-exact-poster-container.theme-cyan-purple .overlay-crown-icon,
.scrims-exact-poster-container.theme-purple-blue .overlay-crown-icon {
  left: 11.2% !important;
  transform: translateX(-50%) !important;
  top: -1px !important;
  font-size: clamp(8px, 1.2vw, 12px) !important;
}

/* Modern 847 columns alignment */
.scrims-exact-poster-container.theme-green .overlay-team-name,
.scrims-exact-poster-container.theme-orange .overlay-team-name,
.scrims-exact-poster-container.theme-pink .overlay-team-name,
.scrims-exact-poster-container.theme-cyan-purple .overlay-team-name,
.scrims-exact-poster-container.theme-purple-blue .overlay-team-name {
  left: 20.0% !important;
  width: 23.8% !important;
  text-align: center !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: clamp(7.5px, 1.3vw, 12px) !important;
}

.scrims-exact-poster-container.theme-green .overlay-position-val,
.scrims-exact-poster-container.theme-orange .overlay-position-val,
.scrims-exact-poster-container.theme-pink .overlay-position-val,
.scrims-exact-poster-container.theme-cyan-purple .overlay-position-val,
.scrims-exact-poster-container.theme-purple-blue .overlay-position-val {
  left: 45.0% !important;
  width: 11.0% !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

.scrims-exact-poster-container.theme-green .overlay-elimination-val,
.scrims-exact-poster-container.theme-orange .overlay-elimination-val,
.scrims-exact-poster-container.theme-pink .overlay-elimination-val,
.scrims-exact-poster-container.theme-cyan-purple .overlay-elimination-val,
.scrims-exact-poster-container.theme-purple-blue .overlay-elimination-val {
  left: 57.3% !important;
  width: 11.2% !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

.scrims-exact-poster-container.theme-green .overlay-booyah-val,
.scrims-exact-poster-container.theme-orange .overlay-booyah-val,
.scrims-exact-poster-container.theme-pink .overlay-booyah-val,
.scrims-exact-poster-container.theme-cyan-purple .overlay-booyah-val,
.scrims-exact-poster-container.theme-purple-blue .overlay-booyah-val {
  left: 68.6% !important;
  width: 11.8% !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

.scrims-exact-poster-container.theme-green .overlay-total-val,
.scrims-exact-poster-container.theme-orange .overlay-total-val,
.scrims-exact-poster-container.theme-pink .overlay-total-val,
.scrims-exact-poster-container.theme-cyan-purple .overlay-total-val,
.scrims-exact-poster-container.theme-purple-blue .overlay-total-val {
  left: 81.0% !important;
  width: 14.1% !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #ffffff !important;
}

/* Individual Color Accents per Theme */
/* TOXIC GREEN */
.scrims-exact-poster-container.theme-green .overlay-position-val {
  color: #4ade80 !important;
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}
.scrims-exact-poster-container.theme-green .overlay-elimination-val {
  color: #fb923c !important;
  text-shadow: 0 0 8px rgba(251, 146, 60, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}
.scrims-exact-poster-container.theme-green .overlay-booyah-val {
  color: #fef08a !important;
  text-shadow: 0 0 8px rgba(254, 240, 138, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}
.scrims-exact-poster-container.theme-green .overlay-total-val {
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.95), 0 2px 4px rgba(0, 0, 0, 0.95) !important;
}

/* FLAME ORANGE */
.scrims-exact-poster-container.theme-orange .overlay-position-val {
  color: #fdba74 !important;
  text-shadow: 0 0 8px rgba(253, 186, 116, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}
.scrims-exact-poster-container.theme-orange .overlay-elimination-val {
  color: #f87171 !important;
  text-shadow: 0 0 8px rgba(248, 113, 113, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}
.scrims-exact-poster-container.theme-orange .overlay-booyah-val {
  color: #fef08a !important;
  text-shadow: 0 0 8px rgba(254, 240, 138, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}
.scrims-exact-poster-container.theme-orange .overlay-total-val {
  text-shadow: 0 0 10px rgba(249, 115, 22, 0.95), 0 2px 4px rgba(0, 0, 0, 0.95) !important;
}

/* NEON MAGENTA / PINK */
.scrims-exact-poster-container.theme-pink .overlay-position-val {
  color: #f472b6 !important;
  text-shadow: 0 0 8px rgba(244, 114, 182, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}
.scrims-exact-poster-container.theme-pink .overlay-elimination-val {
  color: #fb923c !important;
  text-shadow: 0 0 8px rgba(251, 146, 60, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}
.scrims-exact-poster-container.theme-pink .overlay-booyah-val {
  color: #fef08a !important;
  text-shadow: 0 0 8px rgba(254, 240, 138, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}
.scrims-exact-poster-container.theme-pink .overlay-total-val {
  text-shadow: 0 0 10px rgba(236, 72, 153, 0.95), 0 2px 4px rgba(0, 0, 0, 0.95) !important;
}

/* CYBER VIOLET */
.scrims-exact-poster-container.theme-cyan-purple .overlay-position-val {
  color: #38bdf8 !important;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}
.scrims-exact-poster-container.theme-cyan-purple .overlay-elimination-val {
  color: #c084fc !important;
  text-shadow: 0 0 8px rgba(192, 132, 252, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}
.scrims-exact-poster-container.theme-cyan-purple .overlay-booyah-val {
  color: #fef08a !important;
  text-shadow: 0 0 8px rgba(254, 240, 138, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}
.scrims-exact-poster-container.theme-cyan-purple .overlay-total-val {
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.95), 0 2px 4px rgba(0, 0, 0, 0.95) !important;
}

/* ROYAL INDIGO */
.scrims-exact-poster-container.theme-purple-blue .overlay-position-val {
  color: #a78bfa !important;
  text-shadow: 0 0 8px rgba(167, 139, 250, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}
.scrims-exact-poster-container.theme-purple-blue .overlay-elimination-val {
  color: #60a5fa !important;
  text-shadow: 0 0 8px rgba(96, 165, 250, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}
.scrims-exact-poster-container.theme-purple-blue .overlay-booyah-val {
  color: #fef08a !important;
  text-shadow: 0 0 8px rgba(254, 240, 138, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9) !important;
}
.scrims-exact-poster-container.theme-purple-blue .overlay-total-val {
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.95), 0 2px 4px rgba(0, 0, 0, 0.95) !important;
}

/* =====================================================================
   TOURNAMENT MVP & TOP FRAGGERS SHOWCASE PANEL
===================================================================== */
.mvp-showcase-panel {
  max-width: 860px;
  margin: 0 auto 0.85rem;
  background: linear-gradient(135deg, rgba(26, 18, 10, 0.95) 0%, rgba(13, 16, 22, 0.98) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8), 0 0 20px rgba(245, 158, 11, 0.2);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.mvp-showcase-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fbbf24 30%, #f59e0b 70%, transparent);
}

.mvp-showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.mvp-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mvp-crown-icon {
  font-size: 1.1rem;
  filter: drop-shadow(0 0 6px #fbbf24);
}

.mvp-title-wrap h3 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fbbf24;
  margin: 0;
}

.mvp-live-tag {
  font-family: var(--font-tech);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.mvp-showcase-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mvp-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(35, 25, 12, 0.8) 0%, rgba(18, 14, 20, 0.8) 100%);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 5px;
  padding: 0.65rem 0.85rem;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.mvp-hero-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mvp-badge-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
  flex-shrink: 0;
}

.mvp-hero-info {
  display: flex;
  flex-direction: column;
}

.mvp-hero-label {
  font-family: var(--font-tech);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fde68a;
}

.mvp-hero-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffffff;
  margin: 0.1rem 0;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

.mvp-hero-team {
  font-family: var(--font-tech);
  font-size: 0.72rem;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: 0.8px;
}

.mvp-hero-stats {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.mvp-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 4px;
  padding: 0.3rem 0.65rem;
  min-width: 75px;
}

.mvp-stat-val {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  color: #fbbf24;
  line-height: 1.1;
}

.mvp-stat-lbl {
  font-family: var(--font-tech);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #d1d5db;
}

/* Top Fraggers Strip */
.mvp-top-fraggers-strip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.mvp-podium-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(20, 24, 34, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 0.25rem 0.55rem;
  font-family: var(--font-tech);
  font-size: 0.72rem;
  font-weight: 700;
  color: #d1d5db;
}

.mvp-podium-pill.rank-1 {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(45, 30, 15, 0.7);
  color: #fef08a;
}

.fragger-rank {
  font-weight: 800;
  color: #fbbf24;
}

.fragger-name {
  font-weight: 800;
  color: #ffffff;
}

.fragger-team {
  color: #9ca3af;
  font-size: 0.68rem;
}

.fragger-kills {
  font-weight: 800;
  color: #f87171;
}

/* =====================================================================
   ON-POSTER MVP BANNER STRIP
===================================================================== */
.poster-mvp-strip {
  position: absolute !important;
  bottom: 5.4% !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 86% !important;
  height: 3.4% !important;
  background: rgba(10, 14, 22, 0.92) !important;
  border: 1.5px solid var(--crimson-primary) !important;
  border-radius: 4px !important;
  box-shadow: 0 0 15px rgba(229, 9, 20, 0.5), inset 0 0 8px rgba(0, 0, 0, 0.8) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 25 !important;
  pointer-events: none !important;
}

.poster-mvp-content {
  display: flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  font-family: var(--font-tech), sans-serif !important;
  font-size: clamp(7.5px, 1.25vw, 12px) !important;
  font-weight: 800 !important;
  letter-spacing: 0.8px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}

.poster-mvp-trophy {
  font-size: clamp(9px, 1.4vw, 13px) !important;
  filter: drop-shadow(0 0 4px #fbbf24) !important;
}

.poster-mvp-tag {
  color: #fbbf24 !important;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.8) !important;
  font-weight: 900 !important;
}

.poster-mvp-name {
  color: #ffffff !important;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.9) !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
}

.poster-mvp-team {
  color: #9ca3af !important;
  font-weight: 700 !important;
}

.poster-mvp-kills {
  color: #fef08a !important;
  text-shadow: 0 0 8px rgba(254, 240, 138, 0.9) !important;
  font-weight: 900 !important;
}

/* Theme-specific MVP Strip Glows */
.scrims-exact-poster-container.theme-cyan .poster-mvp-strip {
  border-color: #06b6d4 !important;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.5), inset 0 0 8px rgba(0, 0, 0, 0.8) !important;
  bottom: 12.0% !important; /* Cyan 725x1024 footer slot */
}
.scrims-exact-poster-container.theme-green .poster-mvp-strip {
  border-color: #22c55e !important;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.5), inset 0 0 8px rgba(0, 0, 0, 0.8) !important;
}
.scrims-exact-poster-container.theme-orange .poster-mvp-strip {
  border-color: #f97316 !important;
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.5), inset 0 0 8px rgba(0, 0, 0, 0.8) !important;
}
.scrims-exact-poster-container.theme-pink .poster-mvp-strip {
  border-color: #ec4899 !important;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.5), inset 0 0 8px rgba(0, 0, 0, 0.8) !important;
}
.scrims-exact-poster-container.theme-cyan-purple .poster-mvp-strip {
  border-color: #a855f7 !important;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.5), inset 0 0 8px rgba(0, 0, 0, 0.8) !important;
}
.scrims-exact-poster-container.theme-purple-blue .poster-mvp-strip {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5), inset 0 0 8px rgba(0, 0, 0, 0.8) !important;
}

/* =====================================================================
   PROMINENT BOTTOM EXPORT RESULTS PANEL (PROMPT 5)
===================================================================== */
.leaderboard-bottom-export-panel {
  max-width: 620px !important;
  width: 100% !important;
  margin: 1rem auto 2rem !important;
  background: linear-gradient(135deg, rgba(25, 10, 16, 0.95) 0%, rgba(13, 16, 22, 0.95) 100%);
  border: 2px solid var(--crimson-primary);
  border-radius: 8px;
  padding: 0.75rem 1rem !important;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(229, 9, 20, 0.35);
  position: relative;
  overflow: hidden;
  box-sizing: border-box !important;
}

.leaderboard-bottom-export-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ff1744 30%, #ff1744 70%, transparent);
}

.export-panel-buttons-only {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  width: 100%;
}

.save-to-drive-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(180, 83, 9, 0.35) 100%);
  border: 2px solid #f59e0b;
  color: #fef3c7;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 1.2px;
  padding: 0.75rem 1.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.save-to-drive-btn:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: #fbbf24;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(180, 83, 9, 0.5) 100%);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5), 0 0 15px rgba(251, 191, 36, 0.4);
}

.share-results-prominent-btn {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(37, 99, 235, 0.35) 100%);
  border: 2px solid #3b82f6;
  color: #bfdbfe;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 1.2px;
  padding: 0.75rem 1.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.share-results-prominent-btn:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: #60a5fa;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.4) 0%, rgba(37, 99, 235, 0.55) 100%);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5), 0 0 15px rgba(96, 165, 250, 0.4);
}

/* Compact Aggressive Download Results Button matching poster size */
.download-results-prominent-btn {
  padding: 0.75rem 1.6rem !important;
  font-size: 0.95rem !important;
  letter-spacing: 1.5px !important;
  background: linear-gradient(135deg, #ff1744 0%, #b30018 50%, #68000b 100%);
  box-shadow: 
    0 8px 20px rgba(229, 9, 20, 0.5),
    0 0 15px rgba(255, 23, 68, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

.download-results-prominent-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 12px 30px rgba(229, 9, 20, 0.7),
    0 0 25px rgba(255, 23, 68, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.download-results-prominent-btn.downloading {
  opacity: 0.85;
  cursor: wait;
  animation: pulse-export 1s infinite alternate;
}

@keyframes pulse-export {
  from {
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.4);
    transform: scale(0.99);
  }
  to {
    box-shadow: 0 0 35px rgba(255, 23, 68, 0.9);
    transform: scale(1.01);
  }
}

.export-status-note {
  font-family: var(--font-tech);
  font-size: 0.75rem;
  color: #fca5a5;
  letter-spacing: 1px;
  text-align: center;
  margin-top: 0.4rem;
  width: 100%;
}

/* =====================================================================
   SHARED READ-ONLY PLAYER VIEW & SHARE LINK MODAL
===================================================================== */
.shared-viewer-banner {
  background: linear-gradient(90deg, rgba(16, 28, 48, 0.96) 0%, rgba(26, 18, 38, 0.96) 100%);
  border: 1.5px solid #3b82f6;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.35), inset 0 0 15px rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  padding: 0.85rem 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeIn 0.3s ease;
}

.shared-banner-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.shared-banner-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 8px #60a5fa);
  flex-shrink: 0;
}

.shared-banner-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-tech);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #93c5fd;
  flex-wrap: wrap;
}

.shared-banner-title b {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.shared-badge {
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid #3b82f6;
  color: #bfdbfe;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
}

.shared-banner-sub {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-top: 0.15rem;
}

.shared-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Share Results Modal */
.share-results-modal-card {
  max-width: 620px !important;
}

.share-modal-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.share-overview-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.85rem 1rem;
}

.share-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.share-overview-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1.2px;
}

.share-overview-badge {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
  font-family: var(--font-tech);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.share-overview-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.share-stat-pill {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  padding: 0.4rem 0.65rem;
  display: flex;
  flex-direction: column;
}

.share-stat-pill .stat-lbl {
  font-family: var(--font-tech);
  font-size: 0.62rem;
  color: #9ca3af;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.share-stat-pill .stat-val {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  color: #fef08a;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-link-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.share-link-label {
  font-family: var(--font-tech);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #93c5fd;
}

.share-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.share-url-input {
  font-family: var(--font-tech);
  font-size: 0.8rem;
  background: rgba(8, 11, 17, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #e2e8f0;
  padding: 0.65rem 0.85rem;
  border-radius: 4px;
  flex: 1;
  text-overflow: ellipsis;
}

.copy-share-btn {
  padding: 0.65rem 1.15rem;
  white-space: nowrap;
  font-size: 0.85rem;
}

.share-link-hint {
  font-size: 0.72rem;
  color: #9ca3af;
  line-height: 1.4;
}

.social-share-section {
  margin-top: 0.25rem;
}

.social-share-title {
  font-family: var(--font-tech);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #d1d5db;
  margin-bottom: 0.55rem;
}

.social-share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.social-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-tech);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.social-share-btn.whatsapp-btn {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(37, 211, 102, 0.4);
  color: #4ade80;
}
.social-share-btn.whatsapp-btn:hover {
  background: rgba(37, 211, 102, 0.3);
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.4);
  color: #ffffff;
}

.social-share-btn.telegram-btn {
  background: rgba(0, 136, 204, 0.15);
  border-color: rgba(0, 136, 204, 0.4);
  color: #38bdf8;
}
.social-share-btn.telegram-btn:hover {
  background: rgba(0, 136, 204, 0.3);
  box-shadow: 0 0 12px rgba(0, 136, 204, 0.4);
  color: #ffffff;
}

.social-share-btn.discord-btn {
  background: rgba(88, 101, 242, 0.15);
  border-color: rgba(88, 101, 242, 0.4);
  color: #a5b4fc;
}
.social-share-btn.discord-btn:hover {
  background: rgba(88, 101, 242, 0.3);
  box-shadow: 0 0 12px rgba(88, 101, 242, 0.4);
  color: #ffffff;
}

.share-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: rgba(10, 14, 20, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.share-compression-note {
  font-family: var(--font-tech);
  font-size: 0.72rem;
  color: #10b981;
  font-weight: 700;
}

/* =====================================================================
   PERSISTENCE & RESET MODAL STYLES (PROMPT 6)
===================================================================== */
.meta-pills-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.autosave-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
  font-family: var(--font-tech);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.15rem 0.55rem;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.autosave-pill.saving {
  background: rgba(229, 9, 20, 0.25);
  border-color: #ff1744;
  color: #fca5a5;
}

.autosave-pill.syncing-drive {
  background: rgba(59, 130, 246, 0.22);
  border-color: #3b82f6;
  color: #93c5fd;
  animation: pulse-border 1.2s infinite ease-in-out;
}

.autosave-pill.drive-synced {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #6ee7b7;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.autosave-pill .save-icon {
  font-size: 0.8rem;
}

/* Reset Confirmation Modal */
.reset-dialog-card {
  max-width: 520px;
  border-color: #ff1744;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.95),
    0 0 35px rgba(229, 9, 20, 0.5);
}

.reset-dialog-header {
  background: linear-gradient(90deg, rgba(50, 10, 16, 0.95) 0%, rgba(20, 8, 12, 0.95) 100%);
  border-bottom: 1px solid rgba(255, 23, 68, 0.4);
}

.reset-dialog-header .warning-icon {
  font-size: 1.4rem;
}

.reset-dialog-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #ff4d6d;
}

.reset-dialog-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.reset-warning-text {
  font-size: 0.9rem;
  color: #e5e7eb;
  line-height: 1.5;
}

.reset-warning-text b {
  color: #fca5a5;
}

.reset-info-box {
  background: rgba(10, 12, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--font-tech);
  font-size: 0.82rem;
}

.reset-info-box span {
  color: #9ca3af;
}

.reset-info-box b {
  color: #ffffff;
}

.reset-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 0.5rem;
}

.reset-execute-btn {
  background: linear-gradient(135deg, #e50914 0%, #7a0008 100%);
  box-shadow: 0 0 15px rgba(229, 9, 20, 0.6);
  font-size: 0.9rem;
  padding: 0.75rem 1.75rem;
}

.reset-execute-btn:hover {
  background: #ff1744;
  box-shadow: 0 0 25px rgba(255, 23, 68, 0.8);
}

/* =====================================================================
   PROMPT 8: MOBILE RESPONSIVENESS & TOUCH-FRIENDLY PHONE OPTIMIZATIONS
   Ensures seamless tournament admin workflow on all smartphones
===================================================================== */
@media (max-width: 768px) {
  /* Layout & Global Padding */
  body {
    font-size: 14px;
  }

  .app-container {
    padding: 0.65rem 0.5rem 2.5rem;
  }

  .site-header {
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
  }

  .logo-title-group h1 {
    font-size: 1.4rem;
    letter-spacing: 2px;
  }

  .logo-sub {
    font-size: 0.68rem;
    letter-spacing: 1.5px;
  }

  /* Screen 1: Setup Layout */
  .setup-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .teams-input-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .team-slot-card {
    height: auto !important;
    min-height: 44px;
    overflow: hidden;
  }

  .team-slot-top-row {
    height: 44px;
  }

  .slot-badge {
    width: 48px;
    height: 44px;
  }

  .slot-num {
    font-size: 0.85rem;
  }

  .team-players-section {
    display: block !important;
    padding: 0.5rem 0.65rem 0.65rem;
  }

  .team-players-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.35rem 0.5rem;
  }

  .player-name-input {
    font-size: 0.8rem;
    min-height: 32px;
  }

  .primary-start-btn {
    padding: 0.85rem 1.75rem;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    width: 100%;
    justify-content: center;
  }

  /* Screen 2: Tournament Top Bar */
  .tournament-top-bar {
    padding: 0.85rem 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .active-tourney-meta {
    text-align: center;
    align-items: center;
  }

  #active-tournament-title {
    font-size: 1.25rem;
  }

  .meta-stats {
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.72rem;
    gap: 0.4rem;
  }

  .tourney-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .tourney-controls .cyber-btn {
    padding: 0.55rem 0.65rem;
    font-size: 0.72rem;
    text-align: center;
    letter-spacing: 1px;
    display: flex;
    justify-content: center;
  }

  /* Subview Navigation Tabs (Sticky & Touch-Friendly) */
  .tournament-nav-tabs {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.35rem;
    padding-bottom: 0.35rem;
    margin-bottom: 1.25rem;
  }

  .tourney-nav-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.6rem 0.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    white-space: nowrap;
    text-align: center;
    justify-content: center;
  }

  /* Match Selector Dropdown & Tabs Strip */
  .match-selector-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .match-dropdown-wrap {
    width: 100%;
    justify-content: space-between;
  }

  .match-dropdown-wrap select {
    flex: 1;
  }

  .match-tabs-strip {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    gap: 0.4rem;
  }

  .match-tab-btn {
    flex-shrink: 0;
    padding: 0.5rem 0.85rem;
    font-size: 0.75rem;
  }

  /* Completed Matches Quick Edit Bar */
  .completed-matches-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
  }

  .completed-matches-pills {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
    flex-wrap: nowrap;
  }

  .match-edit-quick-btn {
    flex-shrink: 0;
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
  }

  /* Active Match Banner */
  .active-match-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
  }

  .active-match-indicator {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  #active-match-title-text {
    font-size: 0.92rem;
  }

  .match-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 0.5rem;
  }

  .match-tools .action-ghost-btn {
    justify-content: center;
    font-size: 0.72rem;
    padding: 0.45rem 0.5rem;
  }

  /* 12 Teams Match Form Grid (Mobile 1 column with spacious touch inputs) */
  .match-teams-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .match-team-form-card {
    padding: 0.75rem;
  }

  .card-team-header {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .team-label-name {
    font-size: 0.88rem;
  }

  .team-pts-preview {
    font-size: 0.74rem;
  }

  .card-inputs-row {
    grid-template-columns: 1fr 110px;
    gap: 0.5rem;
  }

  .placement-select, .kills-input, .minus-input {
    font-size: 0.88rem;
    padding: 0.55rem 0.5rem;
    min-height: 42px; /* Touch target minimum */
  }

  .minus-input-wrap {
    width: 110px;
  }

  .save-match-btn {
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-size: 0.92rem;
  }

  /* Leaderboard Top Controls */
  .leaderboard-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .actions-left-group, .actions-right-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .tiebreaker-pill {
    width: 100%;
    text-align: center;
    justify-content: center;
    font-size: 0.72rem;
    padding: 0.35rem 0.5rem;
  }

  .position-mode-toggle {
    width: 100%;
    justify-content: space-between;
  }

  /* LEADERBOARD POSTER: Mobile Card-Slot Flow */
  .scrims-poster-wrapper {
    padding: 0.85rem 0.5rem 1.25rem;
    border-radius: 8px;
  }

  .hero-scrims-title {
    font-size: 1.6rem;
    letter-spacing: 3px;
  }

  .hero-motto {
    font-size: 0.78rem;
    letter-spacing: 3px;
  }

  .hero-laser-line {
    width: 180px;
  }

  .scrims-frame {
    padding: 0.5rem 0.4rem 0.75rem;
  }

  /* Responsive Grid Columns for Scrims Table Header & Rows on Small Screens */
  .scrims-table-header {
    grid-template-columns: 50px 1fr 65px 75px 65px;
    font-size: 0.68rem;
    letter-spacing: 0.8px;
    padding: 0.5rem 0.35rem;
  }

  .col-team {
    padding-left: 0.5rem;
  }

  .scrims-row {
    grid-template-columns: 50px 1fr 65px 75px 65px;
    height: 44px;
  }

  .row-rank-badge {
    height: 38px;
    font-size: 0.95rem;
    padding-right: 6px;
  }

  .scrims-row.rank-1 .row-rank-badge::before {
    left: 10px;
    top: -7px;
    font-size: 0.65rem;
  }

  .row-team-panel {
    height: 38px;
    font-size: 0.82rem;
    letter-spacing: 0.8px;
    padding-left: 0.65rem;
    margin-left: -5px;
    margin-right: -5px;
  }

  .row-team-panel::after {
    display: none; /* Hide cosmetic groove on small screens */
  }

  .row-pos-val, .row-elim-val {
    height: 38px;
    font-size: 0.92rem;
  }

  .row-total-badge {
    height: 38px;
    font-size: 1.05rem;
    padding-right: 6px;
  }

  /* Poster Footer */
  .poster-footer-branding {
    margin-top: 1rem;
    padding-top: 0.75rem;
  }

  .footer-sub-motto {
    font-size: 0.65rem;
    letter-spacing: 1.2px;
  }

  /* Matrix Table Mobile Scroll Container */
  .matrix-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 4px;
  }

  .cyber-matrix-table th, .cyber-matrix-table td {
    padding: 0.55rem 0.45rem;
    font-size: 0.75rem;
  }

  /* Bottom Export Panel */
  .leaderboard-bottom-export-panel {
    padding: 1.15rem 1rem;
    margin-top: 1.25rem;
  }

  .export-panel-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .export-meta-info {
    min-width: 0;
  }

  .export-meta-info h3 {
    font-size: 1.1rem;
  }

  .download-results-prominent-btn {
    width: 100%;
    padding: 0.95rem 1.5rem;
    font-size: 1rem;
    letter-spacing: 1.5px;
  }

  /* Modal Dialogs */
  .modal-backdrop {
    padding: 0.75rem;
  }

  .modal-card {
    max-width: 100%;
  }

  .modal-header {
    padding: 0.85rem 1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .modal-summary-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    text-align: left;
  }

  .modal-summary-footer > div:last-child {
    text-align: left !important;
  }
}

/* Extra Small Phones (iPhone SE, Galaxy Mini, < 480px) */
@media (max-width: 480px) {
  .app-container {
    padding: 0.5rem 0.35rem 2rem;
  }

  .logo-title-group h1 {
    font-size: 1.2rem;
  }

  /* Header banner full-bleed */
  .scrims-header-img-wrap {
    margin-left: -0.35rem;
    margin-right: -0.35rem;
    border-radius: 0;
  }

  /* Section badge bar */
  .section-badge-bar {
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  .badge-tag {
    font-size: 0.72rem;
    padding: 0.2rem 0.45rem;
  }
  .badge-code {
    font-size: 0.65rem;
  }

  /* Card headers */
  .card-header {
    padding: 0.75rem 0.85rem;
    gap: 0.5rem;
  }
  .card-header h2 {
    font-size: 0.85rem;
    letter-spacing: 1px;
  }
  .card-body {
    padding: 0.85rem 0.65rem;
  }
  .card-header-split {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .scoring-formula-tag {
    font-size: 0.68rem;
    padding: 0.25rem 0.55rem;
  }

  /* Scoring rules box */
  .scoring-preset-box {
    padding: 0.65rem;
  }
  .preset-summary {
    gap: 0.3rem 0.5rem;
  }
  .rule-chip {
    font-size: 0.72rem;
    padding: 0.15rem 0.35rem;
  }

  /* Match form card inputs */
  .card-inputs-row {
    grid-template-columns: 1fr 95px;
    gap: 0.4rem;
  }

  .field-block label {
    font-size: 0.68rem;
  }

  .placement-select, .kills-input {
    font-size: 0.85rem;
    padding: 0.5rem;
    min-height: 44px;
  }

  .minus-input-wrap {
    width: 95px;
  }
  .minus-label {
    font-size: 0.68rem;
  }
  .minus-input {
    font-size: 0.85rem;
    min-height: 40px;
  }

  /* Team header in match form */
  .team-meta-group {
    gap: 0.4rem;
  }
  .team-mini-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    padding-right: 0.5rem;
  }
  .team-label-name {
    font-size: 0.82rem;
    letter-spacing: 0.5px;
  }
  .team-pts-preview {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
  }

  /* Leaderboard rows */
  .scrims-table-header {
    grid-template-columns: 42px 1fr 55px 65px 55px;
    font-size: 0.62rem;
  }

  .scrims-row {
    grid-template-columns: 42px 1fr 55px 65px 55px;
    height: 40px;
  }

  .row-rank-badge {
    height: 35px;
    font-size: 0.85rem;
  }

  .row-team-panel {
    height: 35px;
    font-size: 0.75rem;
    padding-left: 0.45rem;
  }

  .row-pos-val, .row-elim-val {
    height: 35px;
    font-size: 0.82rem;
  }

  .row-total-badge {
    height: 35px;
    font-size: 0.95rem;
  }

  /* Tournament nav */
  .tourney-controls {
    grid-template-columns: 1fr;
  }

  .tourney-nav-btn {
    min-width: 100px;
    padding: 0.5rem 0.55rem;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
  }

  /* Poster theme selector - horizontal scroll on small screens */
  .poster-theme-selector {
    padding: 0.5rem 0.65rem;
  }
  .theme-select-label {
    font-size: 0.68rem;
    letter-spacing: 1px;
  }
  .theme-select-buttons {
    gap: 0.3rem;
  }
  .theme-pill-btn {
    font-size: 0.65rem;
    padding: 0.25rem 0.45rem;
    letter-spacing: 0.5px;
  }
  .theme-circle {
    width: 7px;
    height: 7px;
  }

  /* Poster container scale down */
  .scrims-exact-poster-container {
    max-width: 100% !important;
  }

  /* Match save footer stacked on mobile */
  .match-save-footer {
    flex-direction: column;
    gap: 0.75rem;
  }
  .save-match-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* Export panel */
  .export-panel-inner {
    gap: 0.75rem;
  }
  .export-meta-info h3 {
    font-size: 1rem;
  }
  .download-results-prominent-btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* Matrix table scroll */
  .matrix-rules-grid {
    gap: 0.3rem 0.75rem;
    font-size: 0.72rem;
  }
  .matrix-rules-title {
    font-size: 0.75rem;
  }

  /* Messy Slot Importer */
  .paste-lineup-modal-card {
    max-height: 90vh;
  }
  .cyber-textarea {
    font-size: 0.85rem !important;
    min-height: 160px;
  }
  .preview-count-badge {
    font-size: 0.7rem;
  }

  /* Modal dialogs */
  .modal-backdrop {
    padding: 0.5rem;
  }
  .modal-header h3 {
    font-size: 0.92rem;
  }
  .modal-body {
    padding: 0.75rem;
  }

  /* Match tabs horizontal scroll */
  .match-tabs-strip {
    gap: 0.3rem;
  }
  .match-tab-btn {
    padding: 0.4rem 0.65rem;
    font-size: 0.7rem;
  }

  /* Active match banner */
  .active-match-banner {
    padding: 0.6rem 0.65rem;
  }
  #active-match-title-text {
    font-size: 0.85rem;
  }
  .match-tools {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

/* Very Small Phones (Galaxy Fold, small screens < 400px) */
@media (max-width: 400px) {
  .card-inputs-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .minus-field-block {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }
  .minus-input-wrap {
    width: 100%;
  }

  /* Full-width placement and kills on very small screens */
  .placement-select, .kills-input, .minus-input {
    min-height: 48px;
    font-size: 1rem;
    padding: 0.6rem 0.65rem;
  }
  .kills-input {
    padding-left: 2.2rem;
  }
  .minus-input {
    padding-left: 2.2rem;
  }

  /* Stack team header vertically */
  .card-team-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  /* Poster theme pills - 2-row grid */
  .theme-select-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
    width: 100%;
  }
  .theme-pill-btn {
    justify-content: center;
    text-align: center;
    padding: 0.3rem 0.25rem;
    font-size: 0.6rem;
  }

  /* Leaderboard even more compact */
  .scrims-table-header {
    grid-template-columns: 36px 1fr 48px 58px 48px;
    font-size: 0.58rem;
    padding: 0.35rem 0.25rem;
    letter-spacing: 0.5px;
  }
  .scrims-row {
    grid-template-columns: 36px 1fr 48px 58px 48px;
    height: 36px;
  }
  .row-rank-badge {
    height: 32px;
    font-size: 0.78rem;
  }
  .row-team-panel {
    height: 32px;
    font-size: 0.68rem;
    padding-left: 0.35rem;
    letter-spacing: 0.3px;
  }
  .row-pos-val, .row-elim-val {
    height: 32px;
    font-size: 0.75rem;
  }
  .row-total-badge {
    height: 32px;
    font-size: 0.85rem;
  }

  /* Tournament title */
  #active-tournament-title {
    font-size: 1.05rem;
    letter-spacing: 1px;
  }
  .meta-stats {
    font-size: 0.65rem;
  }

  /* Poster overlay text scale */
  .overlay-team-name {
    font-size: clamp(6px, 1.1vw, 10px) !important;
  }

  /* Hero title */
  .hero-scrims-title {
    font-size: 1.3rem;
    letter-spacing: 2px;
  }
  .hero-motto {
    font-size: 0.68rem;
    letter-spacing: 2px;
  }

  /* Share Modal & Banner on mobile */
  .shared-viewer-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem 0.75rem;
  }
  .shared-banner-actions {
    width: 100%;
    justify-content: stretch;
  }
  .shared-banner-actions .cyber-btn {
    flex: 1;
    font-size: 0.68rem;
    padding: 0.45rem 0.4rem;
  }
  .share-input-row {
    flex-direction: column;
    align-items: stretch;
  }
  .copy-share-btn {
    width: 100%;
  }
  .social-share-grid {
    grid-template-columns: 1fr;
  }
}

/* Tiny Fold Screens (Galaxy Fold closed, < 320px) */
@media (max-width: 320px) {
  .app-container {
    padding: 0.35rem 0.25rem 1.5rem;
  }

  .card-header h2 {
    font-size: 0.75rem;
    letter-spacing: 0.5px;
  }

  .tourney-nav-btn {
    min-width: 85px;
    padding: 0.4rem 0.4rem;
    font-size: 0.62rem;
    clip-path: none;
  }

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

  .scrims-table-header {
    grid-template-columns: 32px 1fr 42px 50px 42px;
    font-size: 0.55rem;
  }
  .scrims-row {
    grid-template-columns: 32px 1fr 42px 50px 42px;
    height: 34px;
  }
  .row-team-panel {
    font-size: 0.62rem;
  }
}

/* ==========================================================================
   3-LOBBY SELECTOR & MULTI-DATABASE CONTROLLER STYLES
   ========================================================================== */

.lobby-selector-bar {
  margin: 0.5rem 0 1.25rem;
  background: linear-gradient(180deg, rgba(20, 24, 34, 0.95) 0%, rgba(12, 15, 22, 0.98) 100%);
  border: 1px solid rgba(255, 51, 68, 0.28);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 10;
}

.lobby-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.lobby-bar-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lobby-icon {
  font-size: 1.15rem;
  color: #ff9900;
  filter: drop-shadow(0 0 6px rgba(255, 153, 0, 0.6));
  animation: pulseLobbyIcon 2s infinite ease-in-out;
}

@keyframes pulseLobbyIcon {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
}

.lobby-label-title {
  font-family: var(--font-header, 'Montserrat', sans-serif);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-transform: uppercase;
}

.lobby-label-sub {
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  color: #7b889b;
  text-transform: uppercase;
  font-weight: 600;
  padding-left: 0.25rem;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.lobby-tabs-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lobby-tab-btn {
  background: rgba(22, 28, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #aab5c6;
  font-family: var(--font-header, 'Montserrat', sans-serif);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.42rem 0.95rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}

.lobby-tab-btn:hover {
  border-color: rgba(255, 51, 68, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
  background: rgba(30, 38, 52, 0.98);
}

.lobby-tab-btn.active {
  background: linear-gradient(135deg, rgba(255, 42, 62, 0.35) 0%, rgba(180, 20, 35, 0.45) 100%);
  border-color: #ff3344;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(255, 34, 68, 0.5), inset 0 0 10px rgba(255, 51, 68, 0.25);
}

.lobby-tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #556276;
  transition: all 0.22s ease;
}

.lobby-tab-btn.active .lobby-tab-dot {
  background: #00ff88;
  box-shadow: 0 0 8px #00ff88;
}

.lobby-tab-db-tag {
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.5);
  color: #7b889b;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.lobby-tab-btn.active .lobby-tab-db-tag {
  background: rgba(255, 51, 68, 0.4);
  color: #ffebec;
}

.lobby-actions-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.lobby-cloud-sync-btn {
  background: rgba(16, 24, 38, 0.95);
  border: 1px solid rgba(0, 255, 204, 0.45);
  color: #00ffcc;
  font-family: var(--font-header, 'Montserrat', sans-serif);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 0.35rem 0.8rem;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.22s ease;
  user-select: none;
}

.lobby-cloud-sync-btn:hover {
  background: rgba(0, 255, 204, 0.15);
  border-color: #00ffcc;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.4);
  transform: translateY(-1px);
}

.lobby-reset-btn {
  background: rgba(45, 10, 16, 0.95);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #fca5a5;
  font-family: var(--font-header, 'Montserrat', sans-serif);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 0.35rem 0.8rem;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.22s ease;
  user-select: none;
}

.lobby-reset-btn:hover {
  background: rgba(185, 28, 28, 0.65);
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.5);
  transform: translateY(-1px);
}

.lobby-back-setup-btn {
  background: rgba(20, 24, 34, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #d1d5db;
  font-family: var(--font-header, 'Montserrat', sans-serif);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 0.35rem 0.8rem;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.22s ease;
  user-select: none;
}

.lobby-back-setup-btn:hover {
  background: rgba(35, 15, 22, 0.85);
  border-color: var(--crimson-primary);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.35);
  transform: translateY(-1px);
}

.sync-spin-icon {
  display: inline-block;
  font-size: 0.85rem;
  transition: transform 0.3s ease;
}

.sync-spin-icon.spinning {
  animation: spinIcon 1s linear infinite;
}

@keyframes spinIcon {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.lobby-sync-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #00ffaa;
  background: rgba(0, 255, 170, 0.08);
  border: 1px solid rgba(0, 255, 170, 0.28);
  padding: 0.32rem 0.75rem;
  border-radius: 4px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.lobby-sync-tag .active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00ffaa;
  box-shadow: 0 0 6px #00ffaa;
}

/* Tournament Screen Lobby Pill */
.lobby-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: #ff5263;
  background: rgba(255, 82, 99, 0.12);
  border: 1px solid rgba(255, 82, 99, 0.4);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.lobby-pill .active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff5263;
  box-shadow: 0 0 6px #ff5263;
}

@media (max-width: 768px) {
  .lobby-bar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .lobby-bar-label {
    justify-content: space-between;
  }
  .lobby-tabs-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    gap: 0.35rem;
  }
  .lobby-tab-btn {
    justify-content: center;
    padding: 0.4rem 0.3rem;
    font-size: 0.72rem;
  }
  .lobby-tab-db-tag {
    display: none;
  }
  .lobby-actions-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.lobby-cloud-sync-btn {
  background: rgba(16, 24, 38, 0.95);
  border: 1px solid rgba(0, 255, 204, 0.45);
  color: #00ffcc;
  font-family: var(--font-header, 'Montserrat', sans-serif);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 0.35rem 0.8rem;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.22s ease;
  user-select: none;
}

.lobby-cloud-sync-btn:hover {
  background: rgba(0, 255, 204, 0.15);
  border-color: #00ffcc;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.4);
  transform: translateY(-1px);
}

.lobby-reset-btn {
  background: rgba(45, 10, 16, 0.95);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #fca5a5;
  font-family: var(--font-header, 'Montserrat', sans-serif);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 0.35rem 0.8rem;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.22s ease;
  user-select: none;
}

.lobby-reset-btn:hover {
  background: rgba(185, 28, 28, 0.65);
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.5);
  transform: translateY(-1px);
}

.lobby-back-setup-btn {
  background: rgba(20, 24, 34, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #d1d5db;
  font-family: var(--font-header, 'Montserrat', sans-serif);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 0.35rem 0.8rem;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.22s ease;
  user-select: none;
}

.lobby-back-setup-btn:hover {
  background: rgba(35, 15, 22, 0.85);
  border-color: var(--crimson-primary);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.35);
  transform: translateY(-1px);
}

.sync-spin-icon {
  display: inline-block;
  font-size: 0.85rem;
  transition: transform 0.3s ease;
}

.sync-spin-icon.spinning {
  animation: spinIcon 1s linear infinite;
}

@keyframes spinIcon {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.lobby-sync-tag {
    justify-content: center;
  }
}






