/* ==========================================================================
   MATSIDE PRO - WRESTLING SCORING, ROSTER & BRACKET SUITE CSS
   ========================================================================== */

:root {
  /* Dark Mode Theme Palette */
  --bg-dark: #0a0c10;
  --bg-card: rgba(18, 22, 31, 0.75);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.04);
  
  --text-primary: #f0f4f8;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Corner Colors (Default Red & Green) */
  --color-red: #ff3b30;
  --color-red-glow: rgba(255, 59, 48, 0.35);
  --color-red-bg: rgba(255, 59, 48, 0.12);
  
  --color-green: #34c759;
  --color-green-glow: rgba(52, 199, 89, 0.35);
  --color-green-bg: rgba(52, 199, 89, 0.12);

  /* Status Colors */
  --color-accent: #38bdf8;
  --color-gold: #fbbf24;
  --color-orange: #f97316;
  --color-purple: #c084fc;
  
  /* Fonts */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Shadows & Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.15);
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
}

/* Reset & Basic Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 10% 10%, rgba(255, 59, 48, 0.05) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(52, 199, 89, 0.05) 0px, transparent 50%);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 40px;
}

/* App Header & Navigation Bar (Non-sticky to preserve video screen real estate) */
.app-header {
  align-items: center;
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-card-border);
  display: flex;
  justify-content: space-between;
  padding: 10px 24px;
  position: relative;
  z-index: 100;
}

.logo-badge {
  align-items: center;
  color: var(--color-accent);
  display: flex;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  gap: 8px;
  letter-spacing: 0.5px;
}

.logo-badge i {
  color: var(--color-gold);
  font-size: 1.4rem;
}

.subhead {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 10px;
}

/* Main Nav Tabs Bar */
.main-nav-tabs {
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  border-radius: 30px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.nav-tab {
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  gap: 8px;
  padding: 8px 18px;
  transition: all 0.2s ease;
}

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

.nav-tab.active {
  background: var(--color-accent);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
  color: #000;
}

.header-right {
  display: flex;
  gap: 10px;
}

/* Main Container Grid & Tab Views */
.main-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0 auto;
  max-width: 1300px;
  padding: 20px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: flex;
}

/* Base Card & Glassmorphism */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
}

.glass-card {
  backdrop-filter: blur(16px);
}

/* Buttons */
.btn {
  align-items: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  gap: 8px;
  justify-content: center;
  padding: 8px 16px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--color-accent);
  color: #000;
}
.btn-primary:hover {
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
  filter: brightness(1.15);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-accent {
  background: var(--color-gold);
  color: #000;
}

.btn-danger {
  background: var(--color-red);
  color: #fff;
}
.btn-danger:hover {
  box-shadow: 0 0 15px var(--color-red-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--bg-card-border);
  color: var(--text-primary);
}
.btn-outline:hover {
  background: var(--bg-glass);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 6px 12px;
}

.btn-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.85rem;
  gap: 6px;
  height: 36px;
  justify-content: center;
  min-width: 36px;
  padding: 0 10px;
  transition: all 0.2s ease;
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-accent);
}

/* SECTION 1: VIDEO PLAYER HUD */
.video-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.video-container {
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  max-height: 480px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.video-container video, 
.video-container canvas {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

/* Video Broadcast HUD Overlay */
.video-overlay-hud {
  align-items: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  display: flex;
  justify-content: space-between;
  left: 0;
  padding: 12px 20px;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 10;
}

.hud-wrestler {
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  font-family: var(--font-heading);
  gap: 12px;
  overflow: hidden;
  padding: 4px 12px;
}

.hud-red {
  border-left: 5px solid var(--color-red);
}
.hud-green {
  border-right: 5px solid var(--color-green);
}

.hud-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-score {
  font-size: 1.4rem;
  font-weight: 900;
}

.hud-center {
  align-items: center;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  padding: 4px 16px;
}

.hud-period {
  color: var(--color-gold);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.hud-clock {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 900;
}

/* Clip Flash Notice */
.clip-flash-notice {
  align-items: center;
  background: rgba(56, 189, 248, 0.9);
  border-radius: 30px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
  color: #000;
  display: flex;
  font-family: var(--font-heading);
  font-weight: 800;
  gap: 10px;
  left: 50%;
  opacity: 0;
  padding: 8px 20px;
  pointer-events: none;
  position: absolute;
  top: 70px;
  transform: translateX(-50%) translateY(-10px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 20;
}

.clip-flash-notice.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.recording-pulse {
  animation: pulse 1s infinite;
  color: #e11d48;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}

/* Video Placeholder State */
.video-placeholder {
  align-items: center;
  background: radial-gradient(circle, rgba(18,24,38,1) 0%, rgba(10,12,16,1) 100%);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 5;
}

.placeholder-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 460px;
  text-align: center;
}

.placeholder-icon {
  color: var(--color-accent);
  font-size: 3rem;
  margin-bottom: 4px;
}

.placeholder-content h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
}

.placeholder-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.video-source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

/* Video Scrubber & Controls Bar */
.video-controls-bar {
  align-items: center;
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 100%;
  overflow: hidden;
  padding: 8px 12px;
}

.video-controls-left, .video-controls-right {
  align-items: center;
  display: flex;
  gap: 8px;
}

.video-time-display {
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.85rem;
  min-width: 90px;
}

.video-scrubber-container {
  flex: 1;
  position: relative;
}

.video-scrubber-container input[type="range"] {
  accent-color: var(--color-accent);
  cursor: pointer;
  height: 6px;
  width: 100%;
}

.scrubber-bookmarks {
  height: 100%;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
}

.scrubber-mark {
  background: var(--color-gold);
  border-radius: 2px;
  bottom: 2px;
  height: 12px;
  position: absolute;
  width: 4px;
}

/* SECTION 2: PERIOD & MATCH CLOCK CONTROLS */
.period-clock-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.period-selector-bar {
  align-items: center;
  display: flex;
  gap: 16px;
}

.section-label {
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.period-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.period-btn {
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 18px;
  transition: all 0.2s ease;
}

.period-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.period-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
  color: #000;
}

.period-btn.ot-btn {
  border-color: rgba(251, 191, 36, 0.3);
  color: var(--color-gold);
}
.period-btn.ot-btn.active {
  background: var(--color-gold);
  color: #000;
}

/* Clock Display Box */
.clock-display-container {
  display: grid;
  gap: 20px;
  grid-template-columns: 2fr 1.5fr 1fr;
}

.main-clock-box {
  align-items: center;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 20px;
}

.clock-digits {
  color: var(--color-gold);
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1;
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

.clock-controls {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.btn-clock {
  flex: 1;
  font-weight: 700;
  padding: 8px;
}

.btn-success {
  background: var(--color-green);
  color: #000;
}

/* Choice Box */
.choice-box {
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.choice-title {
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.choice-buttons {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr 1fr;
}

.btn-choice {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 8px;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-choice:hover, .btn-choice.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--color-accent);
  color: var(--text-primary);
}

/* Special Timers Box */
.special-timers-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timer-mini {
  align-items: center;
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
}

.timer-mini span {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.timer-val {
  color: var(--color-accent);
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 700;
}

.btn-mini {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 4px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 4px 8px;
}

/* SECTION 3: DUAL WRESTLER SCORING PANELS */
.scoring-panels-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
}

.wrestler-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: border-color 0.3s ease;
}

.wrestler-red {
  border-top: 5px solid var(--color-red);
}

.wrestler-green {
  border-top: 5px solid var(--color-green);
}

.wrestler-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.corner-badge {
  align-items: center;
  border-radius: 20px;
  display: flex;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  gap: 8px;
  letter-spacing: 1px;
  padding: 4px 14px;
}

.red-corner-badge {
  background: var(--color-red-bg);
  border: 1px solid rgba(255, 59, 48, 0.4);
  color: var(--color-red);
}

.green-corner-badge {
  background: var(--color-green-bg);
  border: 1px solid rgba(52, 199, 89, 0.4);
  color: var(--color-green);
}

.color-picker-dropdown {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  font-size: 0.8rem;
  gap: 6px;
}

.select-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  outline: none;
  padding: 4px 8px;
}

.wrestler-input-wrapper {
  align-items: center;
  display: flex;
  gap: 8px;
  width: 100%;
}

.wrestler-name-input {
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: #fff;
  flex: 1;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  outline: none;
  padding: 8px 14px;
  transition: border-color 0.2s ease;
}
.wrestler-name-input:focus {
  border-color: var(--color-accent);
}

/* Score Display Box */
.score-display-box {
  align-items: center;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  padding: 16px 28px;
  position: relative;
}

.score-number {
  font-family: var(--font-heading);
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.2s ease;
}

.wrestler-red .score-number {
  color: var(--color-red);
  text-shadow: 0 0 25px var(--color-red-glow);
}

.wrestler-green .score-number {
  color: var(--color-green);
  text-shadow: 0 0 25px var(--color-green-glow);
}

.score-adjust-mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-score-mod {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  height: 36px;
  transition: all 0.2s ease;
  width: 44px;
}
.btn-score-mod:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Warning & Stalling Dots */
.warnings-row {
  align-items: center;
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  display: flex;
  padding: 6px 12px;
}

.warning-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.margin-left {
  margin-left: 16px;
}

.warning-dots {
  display: flex;
  gap: 6px;
  margin-left: 6px;
}

.dot {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  height: 12px;
  width: 12px;
}

.dot.active-caution {
  background: var(--color-gold);
  box-shadow: 0 0 8px var(--color-gold);
}

.dot.active-stall {
  background: var(--color-orange);
  box-shadow: 0 0 8px var(--color-orange);
}

/* Scoring Action Buttons Grid */
.scoring-actions-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
}

.score-action-btn {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 8px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.score-action-btn:hover {
  transform: translateY(-2px);
}

.score-action-btn:active {
  transform: translateY(1px) scale(0.98);
}

.action-title {
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.action-pts {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 900;
  margin-top: 2px;
}

/* Specific Scoring Button Themes */
.wrestler-red .action-takedown {
  background: var(--color-red-bg);
  border-color: rgba(255, 59, 48, 0.4);
}
.wrestler-red .action-takedown .action-pts {
  color: var(--color-red);
}

.wrestler-green .action-takedown {
  background: var(--color-green-bg);
  border-color: rgba(52, 199, 89, 0.4);
}
.wrestler-green .action-takedown .action-pts {
  color: var(--color-green);
}

.action-escape {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.2);
}
.action-escape .action-pts {
  color: var(--color-accent);
}

.action-reversal {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.2);
}
.action-reversal .action-pts {
  color: var(--color-gold);
}

.action-nearfall {
  background: rgba(192, 132, 252, 0.08);
  border-color: rgba(192, 132, 252, 0.2);
}
.action-nearfall .action-pts {
  color: var(--color-purple);
}

.action-penalty, .action-stalling {
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.2);
}
.action-penalty .action-pts, .action-stalling .action-pts {
  color: var(--color-orange);
}

/* Pin / Victory Bar */
.victory-actions-bar {
  margin-top: 4px;
}

.btn-pin {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 12px;
  width: 100%;
}

/* SECTION 4: HIGHLIGHT CLIPS LIST */
.clips-log-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-header-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.section-title {
  align-items: center;
  display: flex;
  gap: 10px;
}

.section-title i {
  color: var(--color-accent);
  font-size: 1.2rem;
}

.section-title h2, .section-title h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
}

.badge {
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
}

.badge-accent {
  background: rgba(56, 189, 248, 0.15);
  color: var(--color-accent);
}

/* Clips Grid */
.clips-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.empty-clips-message {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
}

.empty-clips-message i {
  font-size: 2.5rem;
}

/* Individual Clip Card */
.clip-card {
  align-items: center;
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  position: relative;
  transition: all 0.2s ease;
}

.clip-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.clip-card.clip-red {
  border-left: 4px solid var(--color-red);
}

.clip-card.clip-green {
  border-left: 4px solid var(--color-green);
}

.clip-play-icon {
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  color: var(--color-accent);
  display: flex;
  font-size: 0.9rem;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.clip-card-info {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.clip-wrestler-action {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 800;
}

.clip-time-tag {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 2px;
}

.clip-time-range {
  color: var(--color-gold);
  font-family: monospace;
  font-size: 0.75rem;
  font-weight: 700;
}


/* ==========================================================================
   TAB 2: WRESTLER DATABASE & ROSTER STYLES
   ========================================================================== */

.roster-header-row, .tournament-header-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.roster-actions, .tournament-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.roster-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.wrestler-card {
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  position: relative;
  transition: all 0.2s ease;
}

.wrestler-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.wrestler-card-top {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
}

.wrestler-avatar {
  align-items: center;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 50%;
  color: var(--color-accent);
  display: flex;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.wrestler-meta {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-left: 12px;
}

.wrestler-full-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
}

.wrestler-team {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.wrestler-card-badges {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.badge-weight {
  background: rgba(251, 191, 36, 0.15);
  color: var(--color-gold);
}

.badge-grade {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.wrestler-stats-row {
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-around;
  padding: 8px 12px;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.stat-val {
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.wrestler-assign-btns {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-top: 4px;
}

.btn-assign-red {
  background: var(--color-red-bg);
  border: 1px solid rgba(255, 59, 48, 0.4);
  color: var(--color-red);
}
.btn-assign-red:hover {
  background: var(--color-red);
  color: #fff;
}

.btn-assign-green {
  background: var(--color-green-bg);
  border: 1px solid rgba(52, 199, 89, 0.4);
  color: var(--color-green);
}
.btn-assign-green:hover {
  background: var(--color-green);
  color: #fff;
}


/* ==========================================================================
   TAB 3: TOURNAMENT BRACKET STYLES
   ========================================================================== */

.bracket-tree-container {
  display: flex;
  gap: 30px;
  overflow-x: auto;
  padding: 20px 10px;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: space-around;
  min-width: 260px;
}

.round-header {
  color: var(--color-gold);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 10px;
  text-align: center;
  text-transform: uppercase;
}

.bracket-match-card {
  background: var(--bg-glass);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: all 0.2s ease;
}

.bracket-match-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

.bracket-match-card.active-match {
  border-color: var(--color-gold);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.35);
}

.match-slot {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
}

.match-slot:first-child {
  border-bottom: 1px solid var(--bg-card-border);
}

.match-slot.winner-slot {
  background: rgba(52, 199, 89, 0.15);
  font-weight: 800;
}

.match-slot-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
}

.match-slot-score {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 800;
}

.match-load-btn {
  background: rgba(56, 189, 248, 0.15);
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px;
  text-align: center;
  transition: background 0.2s ease;
}
.match-load-btn:hover {
  background: var(--color-accent);
  color: #000;
}


/* MODALS */
.modal-overlay {
  align-items: center;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  bottom: 0;
  display: none;
  justify-content: center;
  left: 0;
  opacity: 0;
  position: fixed;
  right: 0;
  top: 0;
  transition: opacity 0.3s ease;
  z-index: 200;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: #12161f;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  max-width: 500px;
  padding: 24px;
  width: 90%;
}

.modal-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.flex-1 {
  flex: 1;
}

.form-group label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-group label {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 8px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.center-footer {
  justify-content: center;
}

.victory-card {
  text-align: center;
}

.victory-icon {
  color: var(--color-gold);
  font-size: 4rem;
  margin-bottom: 10px;
}

.victory-body h3 {
  color: var(--color-accent);
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-top: 10px;
}

.victory-details {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 6px;
}

.final-score-display {
  color: #fff;
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 900;
  margin: 16px 0;
}

/* SECTION 3: DUAL WRESTLER SCORING PANELS (SPLIT SCREEN ALWAYS) */
.scoring-panels-grid {
  display: grid !important;
  gap: 12px;
  grid-template-columns: 1fr 1fr !important;
  width: 100% !important;
  box-sizing: border-box;
}

.wrestler-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0 !important;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* HUD REC Tag */
.hud-rec-tag {
  align-items: center;
  background: rgba(225, 29, 72, 0.9);
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.6);
  color: #fff;
  display: inline-flex;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 800;
  gap: 4px;
  margin-top: 4px;
  padding: 2px 8px;
}

.rec-dot {
  animation: recPulse 1s infinite;
  color: #fff;
  font-size: 0.5rem;
}

@keyframes recPulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

/* RESPONSIVE LAYOUT & MOBILE TOUCH SIZING */
@media (max-width: 900px) {
  .clock-display-container {
    grid-template-columns: 1fr;
  }
  .app-header {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .main-container {
    gap: 8px;
    padding: 6px 4px;
  }

  /* Make Video Container Bigger at Top in Mobile Vertical Mode */
  .video-section {
    padding: 8px;
  }

  .video-container {
    aspect-ratio: auto;
    height: 38vh;
    min-height: 240px;
    max-height: 400px;
  }

  /* Compact Period & Clock Section directly below Video */
  .period-clock-section {
    gap: 8px;
    padding: 8px;
  }

  .period-selector-bar {
    gap: 4px;
  }

  .period-btn {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  .main-clock-box {
    padding: 6px 12px;
  }

  .clock-digits {
    font-size: 2.2rem;
  }

  .btn-clock {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  /* Choice and Special Timers compact in mobile */
  .choice-box, .special-timers-box {
    padding: 6px;
  }

  .btn-choice {
    font-size: 0.7rem;
    padding: 4px 6px;
  }

  /* Mobile Video Controls Bar Stacking */
  .video-controls-bar {
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    width: 100%;
  }

  .video-controls-left, .video-controls-right {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: space-between;
    width: 100%;
  }

  .video-scrubber-container {
    margin: 4px 0;
    width: 100%;
  }

  .speed-select-label {
    font-size: 0.75rem;
  }

  #cameraSelect {
    font-size: 0.75rem;
    max-width: 110px !important;
  }
  
  /* Strict 50/50 Dual Side-by-Side Split Screen on Phones Directly Under Clock */
  .scoring-panels-grid {
    gap: 6px !important;
    grid-template-columns: 1fr 1fr !important;
    margin-top: 4px;
  }

  .wrestler-panel {
    gap: 6px;
    padding: 8px 6px;
  }

  .wrestler-header {
    flex-direction: column;
    gap: 2px;
  }

  .corner-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
  }

  .color-picker-dropdown label {
    display: none;
  }

  .wrestler-name-input {
    font-size: 0.85rem;
    padding: 4px 6px;
  }

  .score-display-box {
    padding: 6px 8px;
  }

  .score-number {
    font-size: 2.4rem;
  }

  .btn-score-mod {
    font-size: 0.75rem;
    height: 24px;
    width: 28px;
  }

  .warnings-row {
    font-size: 0.65rem;
    padding: 3px 4px;
  }

  .warning-dots {
    gap: 3px;
    margin-left: 2px;
  }

  .dot {
    height: 8px;
    width: 8px;
  }

  .scoring-actions-grid {
    gap: 4px;
    grid-template-columns: repeat(2, 1fr);
  }

  .score-action-btn {
    padding: 6px 2px;
  }

  .action-title {
    font-size: 0.6rem;
    letter-spacing: 0;
  }

  .action-pts {
    font-size: 0.95rem;
    margin-top: 0;
  }

  .btn-pin {
    font-size: 0.7rem;
    padding: 6px 2px;
  }

  /* VERTICAL MATCH OVERLAY MODE (Activated on Match START) */
  #tab-scorer.match-overlay-active .video-container {
    height: 60vh !important;
    max-height: 65vh !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  #tab-scorer.match-overlay-active .period-clock-section {
    padding: 6px;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 0;
    margin-top: -6px;
    z-index: 40;
  }

  #tab-scorer.match-overlay-active .scoring-panels-grid {
    background: rgba(10, 12, 16, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--bg-card-border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.8);
    margin-top: 0;
    padding: 8px;
    z-index: 50;
  }

  #tab-scorer.match-overlay-active .hud-overlay-toggle {
    display: inline-flex !important;
    background: var(--color-gold);
    color: #000;
    font-weight: 800;
  }
}
