/* ==========================================================================
   LigaPro — Offline Tournament Manager Design System
   Modern Stadium Champions Dark Aesthetics
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-primary: #070c18;
  --bg-secondary: #0d172e;
  --bg-card: rgba(16, 28, 56, 0.75);
  --bg-card-hover: rgba(22, 38, 76, 0.9);
  --bg-glass: rgba(13, 23, 46, 0.85);
  --bg-elevated: #162447;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 242, 254, 0.4);
  --border-gold: rgba(245, 158, 11, 0.4);

  /* Accents */
  --accent-cyan: #00f2fe;
  --accent-blue: #3b82f6;
  --accent-gold: #f59e0b;
  --accent-gold-light: #fef08a;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  /* Gradients */
  --grad-cyan-blue: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --grad-gold: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #d97706 100%);
  --grad-stadium: radial-gradient(circle at 50% 0%, rgba(30, 64, 175, 0.25) 0%, rgba(7, 12, 24, 0) 70%);
  --grad-card: linear-gradient(180deg, rgba(25, 42, 86, 0.6) 0%, rgba(13, 23, 46, 0.9) 100%);
  
  /* Text */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-gold: #fbbf24;

  /* Metrics & Elevation */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-cyan: 0 0 20px rgba(0, 242, 254, 0.25);
  --shadow-gold: 0 0 25px rgba(245, 158, 11, 0.35);

  --font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light / Android Material Clean Light */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-hover: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-elevated: #ffffff;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-active: rgba(37, 99, 235, 0.45);
  --border-gold: rgba(217, 119, 6, 0.4);
  --accent-cyan: #0284c7;
  --accent-blue: #2563eb;
  --accent-gold: #d97706;
  --accent-gold-light: #b45309;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-gold: #d97706;
  --grad-cyan-blue: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  --grad-card: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --grad-stadium: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.08) 0%, rgba(248, 250, 252, 0) 70%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
}

/* Emerald Pitch / Rumput Hijau Lapangan */
[data-theme="emerald"] {
  --bg-primary: #051a11;
  --bg-secondary: #0a261a;
  --bg-card: rgba(12, 41, 28, 0.78);
  --bg-card-hover: rgba(16, 54, 37, 0.9);
  --bg-glass: rgba(10, 38, 26, 0.88);
  --bg-elevated: #0f3825;
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-active: rgba(16, 185, 129, 0.45);
  --border-gold: rgba(250, 204, 21, 0.4);
  --accent-cyan: #34d399;
  --accent-blue: #10b981;
  --accent-gold: #facc15;
  --accent-gold-light: #fef08a;
  --accent-emerald: #10b981;
  --text-main: #f0fdf4;
  --text-muted: #86efac;
  --text-dim: #4ade80;
  --grad-cyan-blue: linear-gradient(135deg, #34d399 0%, #059669 100%);
  --grad-gold: linear-gradient(135deg, #facc15 0%, #eab308 100%);
  --grad-card: linear-gradient(180deg, rgba(16, 54, 37, 0.6) 0%, rgba(10, 38, 26, 0.9) 100%);
  --grad-stadium: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.25) 0%, rgba(5, 26, 17, 0) 70%);
  --shadow-cyan: 0 0 20px rgba(52, 211, 153, 0.25);
}

/* Cyber Neon / Midnight Violet */
[data-theme="cyber"] {
  --bg-primary: #090414;
  --bg-secondary: #140b29;
  --bg-card: rgba(28, 14, 56, 0.75);
  --bg-card-hover: rgba(42, 21, 84, 0.9);
  --bg-glass: rgba(20, 11, 41, 0.88);
  --bg-elevated: #26124d;
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-active: rgba(217, 70, 239, 0.45);
  --border-gold: rgba(251, 191, 36, 0.4);
  --accent-cyan: #d946ef;
  --accent-blue: #8b5cf6;
  --accent-gold: #f43f5e;
  --accent-gold-light: #fda4af;
  --accent-emerald: #06b6d4;
  --text-main: #faf5ff;
  --text-muted: #c084fc;
  --text-dim: #9333ea;
  --grad-cyan-blue: linear-gradient(135deg, #d946ef 0%, #8b5cf6 100%);
  --grad-card: linear-gradient(180deg, rgba(42, 21, 84, 0.6) 0%, rgba(20, 11, 41, 0.9) 100%);
  --grad-stadium: radial-gradient(circle at 50% 0%, rgba(217, 70, 239, 0.22) 0%, rgba(9, 4, 20, 0) 70%);
  --shadow-cyan: 0 0 20px rgba(217, 70, 239, 0.3);
}

/* Golden Trophy / World Cup Prestige */
[data-theme="gold"] {
  --bg-primary: #120c03;
  --bg-secondary: #1c1305;
  --bg-card: rgba(38, 25, 7, 0.78);
  --bg-card-hover: rgba(56, 37, 10, 0.9);
  --bg-glass: rgba(28, 19, 5, 0.88);
  --bg-elevated: #332209;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(245, 158, 11, 0.45);
  --border-gold: rgba(251, 191, 36, 0.55);
  --accent-cyan: #fbbf24;
  --accent-blue: #d97706;
  --accent-gold: #f59e0b;
  --accent-gold-light: #fef08a;
  --text-main: #fffbeb;
  --text-muted: #fcd34d;
  --text-dim: #b45309;
  --grad-cyan-blue: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  --grad-card: linear-gradient(180deg, rgba(56, 37, 10, 0.6) 0%, rgba(28, 19, 5, 0.9) 100%);
  --grad-stadium: radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.25) 0%, rgba(18, 12, 3, 0) 70%);
  --shadow-cyan: 0 0 22px rgba(245, 158, 11, 0.35);
}

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

html, body {
  min-height: 100%;
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  overflow-x: hidden;
}

/* Ambient Stadium Lighting */
.stadium-bg {
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(56, 189, 248, 0.15), transparent),
    radial-gradient(circle 400px at 15% 20%, rgba(99, 102, 241, 0.08), transparent),
    radial-gradient(circle 500px at 85% 80%, rgba(16, 185, 129, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}

/* App Wrapper */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Android Phone Frame Simulator (optional for desktop preview) */
body.simulating-android {
  background: #03060c;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
}

body.simulating-android .app-container {
  width: 412px;
  height: 870px;
  max-height: 94vh;
  border-radius: 44px;
  border: 10px solid #1e293b;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 2px rgba(255, 255, 255, 0.1);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Top Navigation Bar */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  box-shadow: var(--shadow-gold);
}

.brand-text h1 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--grad-cyan-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

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

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover, .icon-btn:active {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-1px);
}

.btn-install-app {
  background: var(--accent-emerald);
  color: #070c18;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: var(--transition);
}

.btn-install-app:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.btn-new-tournament {
  background: var(--grad-gold);
  color: #070c18;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  transition: var(--transition);
}

.btn-new-tournament:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45);
}

/* Tournament Switcher Banner */
.tournament-bar {
  background: var(--grad-card);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.current-tournament-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mode-icon-tag {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.tournament-name-wrap h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tournament-name-wrap p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tournament-progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.progress-track {
  width: 80px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--grad-cyan-blue);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Navigation Tabs (Mobile Bottom Bar & Desktop Top Bar) */
.tab-navigation {
  display: flex;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-navigation::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  flex: 1;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.65rem 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.nav-tab svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  transition: var(--transition);
}

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

.nav-tab.active {
  color: var(--accent-cyan);
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--grad-cyan-blue);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 1rem;
  padding-bottom: 5rem;
}

/* Sections */
.tab-content {
  display: none;
  animation: fadeIn 0.25s ease-out;
}
.tab-content.active {
  display: block;
}

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

/* Cards & UI Blocks */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  backdrop-filter: blur(12px);
  margin-bottom: 1rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* Metric Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-item {
  background: rgba(13, 23, 46, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  text-align: center;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* Standings Table (Scrollable on Mobile) */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(10, 18, 36, 0.8);
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  white-space: nowrap;
}

.standings-table th {
  background: rgba(16, 28, 56, 0.95);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 0.65rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
}

.standings-table th.th-team {
  text-align: left;
  position: sticky;
  left: 0;
  background: rgba(16, 28, 56, 0.98);
  z-index: 2;
  min-width: 150px;
}

.standings-table td {
  padding: 0.7rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.standings-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.standings-table td.td-team {
  text-align: left;
  position: sticky;
  left: 0;
  background: rgba(10, 18, 36, 0.95);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.rank-indicator {
  font-weight: 700;
  width: 20px;
  display: inline-block;
  text-align: center;
  font-size: 0.8rem;
}

.rank-1 { color: #fbbf24; }
.rank-2 { color: #94a3b8; }
.rank-3 { color: #b45309; }

.team-badge-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.team-name-cell {
  font-weight: 600;
  color: var(--text-main);
}

.points-cell {
  font-weight: 800;
  color: var(--accent-cyan);
  font-size: 0.9rem;
}

/* Zone Highlights in Standings */
tr.zone-champion td {
  border-left: 3px solid var(--accent-gold);
}
tr.zone-ucl td {
  border-left: 3px solid var(--accent-cyan);
}
tr.zone-qualify td {
  border-left: 3px solid var(--accent-emerald);
}
tr.zone-relegation td {
  border-left: 3px solid var(--accent-rose);
}

/* Group Stage Tabs / Cards */
.group-nav-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.group-pill {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.group-pill.active {
  background: var(--grad-cyan-blue);
  color: #070c18;
  border-color: transparent;
  font-weight: 700;
  box-shadow: var(--shadow-cyan);
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

/* Fixtures & Matches */
.fixtures-filter-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
}

.match-round-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.25rem 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.match-round-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}

.match-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.match-card.finished {
  border-left: 3px solid var(--accent-emerald);
}

.match-card.pending {
  border-left: 3px solid var(--border-subtle);
}

.match-teams-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.team-info-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.team-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.match-card.finished .team-row.winner .team-title {
  color: var(--accent-gold-light);
  font-weight: 700;
}

.match-score-badge {
  font-size: 0.95rem;
  font-weight: 800;
  min-width: 28px;
  text-align: center;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
}

.match-card.finished .team-row.winner .match-score-badge {
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.match-meta-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.match-status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.match-status-badge.status-done {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.match-status-badge.status-pending {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.match-leg-badge {
  font-size: 0.65rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.match-penalty-note {
  font-size: 0.65rem;
  color: var(--accent-gold);
  font-weight: 600;
}

/* ==========================================================================
   KNOCKOUT BRACKET TREE
   ========================================================================== */
.bracket-container {
  overflow-x: auto;
  padding: 1.5rem 0.5rem;
}

.bracket-rounds-wrapper {
  display: flex;
  gap: 2rem;
  min-width: 800px;
  align-items: stretch;
}

.bracket-round-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.bracket-round-header {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  text-align: center;
  padding-bottom: 1rem;
  letter-spacing: 0.05em;
}

.bracket-matchups-list {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  height: 100%;
  gap: 1.5rem;
}

.bracket-matchup-node {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  position: relative;
  transition: var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.bracket-matchup-node:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: var(--shadow-cyan);
}

.bracket-team-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  font-size: 0.78rem;
}

.bracket-team-slot.winner {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-gold-light);
  font-weight: 700;
  border-left: 2px solid var(--accent-gold);
}

.bracket-team-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.bracket-team-score {
  font-weight: 800;
  font-size: 0.85rem;
  min-width: 20px;
  text-align: right;
}

.bracket-matchup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 4px;
  padding-top: 4px;
}

/* Champion Trophy Celebration Card */
.champion-celebration-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(13, 23, 46, 0.9) 100%);
  border: 2px solid rgba(245, 158, 11, 0.5);
  border-radius: var(--radius-xl);
  padding: 2rem 1rem;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-gold);
  position: relative;
  overflow: hidden;
}

.champion-celebration-card::before {
  content: '🏆';
  font-size: 8rem;
  position: absolute;
  top: -20px;
  right: -20px;
  opacity: 0.1;
  pointer-events: none;
}

.champion-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-gold);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.champion-team-name {
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(245, 158, 11, 0.5);
  margin-bottom: 0.5rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: var(--transition);
}

.modal-overlay.open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Score Input Modal Specifics */
.score-board-modal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.team-score-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
}

.score-stepper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stepper-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: var(--transition);
}

.stepper-btn:hover, .stepper-btn:active {
  background: var(--grad-cyan-blue);
  color: #070c18;
  border-color: transparent;
}

.score-input-number {
  width: 56px;
  height: 56px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--border-active);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
  outline: none;
  font-family: inherit;
}

.vs-separator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-weight: 800;
  color: var(--text-dim);
  font-size: 1rem;
}

.knockout-extra-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
}

.knockout-extra-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.penalty-inputs-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 1rem;
}

.penalty-input-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  background: rgba(10, 18, 36, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}

/* Mode Selection Cards */
.mode-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.mode-select-card {
  background: rgba(10, 18, 36, 0.6);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.mode-select-card:hover {
  background: rgba(22, 38, 76, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}

.mode-select-card.selected {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.08);
  box-shadow: var(--shadow-cyan);
}

.mode-select-card .mode-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.mode-select-card .mode-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.mode-select-card .mode-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: var(--grad-cyan-blue);
  color: #070c18;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 242, 254, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: var(--accent-rose);
  color: #fff;
}

.btn-sm {
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* Club Customization List in Creation Wizard */
.preset-chips-wrap {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.preset-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-color: var(--border-active);
}

.team-edit-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  background: rgba(10, 18, 36, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.team-edit-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 28, 56, 0.8);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
}

.team-edit-color-picker {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.team-edit-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
}

.team-edit-input:focus {
  border-color: var(--accent-cyan);
}

.team-edit-short {
  width: 60px;
  text-align: center;
  text-transform: uppercase;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: rgba(13, 23, 46, 0.95);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
  animation: slideToast 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* Mobile Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0;
  transition: var(--transition);
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  transition: var(--transition);
}

.bottom-nav-item.active {
  color: var(--accent-cyan);
}

.bottom-nav-item.active svg {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 6px rgba(0, 242, 254, 0.5));
}

/* Floating Action / Quick Simulator Button */
.fab-quick-sim {
  position: fixed;
  bottom: 4.8rem;
  right: 1.25rem;
  background: var(--grad-gold);
  color: #070c18;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  z-index: 90;
  transition: var(--transition);
}

.fab-quick-sim:hover {
  transform: translateY(-2px) scale(1.02);
}

/* Responsive tweaks - Desktop */
@media (min-width: 769px) {
  .bottom-nav {
    display: none !important;
  }
  .main-content {
    padding-bottom: 2rem;
  }
  .fab-quick-sim {
    bottom: 2rem;
  }
}

/* ==========================================================================
   THEME SELECTOR & WALKOVER (W.O) / DISQUALIFICATION STYLES
   ========================================================================== */

/* Theme Selector in Top Header */
.theme-select-header {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.theme-select-header:hover, .theme-select-header:focus {
  border-color: var(--accent-cyan);
  background: var(--bg-card-hover);
}

/* W.O (Walkover) Badges & Buttons */
.badge-wo {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.4);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-disqualified {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f43f5e;
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  letter-spacing: 0.03em;
}

/* Disqualified Team Row in Standings */
tr.team-disqualified-row td {
  opacity: 0.6;
  background: rgba(244, 63, 94, 0.05);
}

tr.team-disqualified-row .team-name-cell {
  text-decoration: line-through;
  color: var(--accent-rose);
}

/* W.O Quick Buttons in Score Modal */
.wo-quick-bar {
  background: rgba(244, 63, 94, 0.08);
  border: 1px dashed rgba(244, 63, 94, 0.35);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-wo-option {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fecdd3;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-wo-option:hover {
  background: var(--accent-rose);
  color: #ffffff;
  border-color: transparent;
}

/* Club Management & Disqualification in Settings Tab */
.club-management-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.club-management-item {
  background: rgba(10, 18, 36, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: var(--transition);
}

.club-management-item.is-disqualified {
  border-color: rgba(244, 63, 94, 0.5);
  background: rgba(244, 63, 94, 0.06);
}

.club-item-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.club-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.club-item-status {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.btn-disqualify {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-disqualify:hover {
  background: var(--accent-rose);
  color: #ffffff;
}

.btn-revert-disqualify {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-revert-disqualify:hover {
  background: var(--accent-emerald);
  color: #ffffff;
}

/* ==========================================================================
   LigaPro Cloud VPS & Authentication Styles
   ========================================================================== */

/* Login Fullscreen Overlay */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 12, 24, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), var(--shadow-cyan);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: modalPopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.login-logo {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--border-active);
}

.login-title {
  margin: 0;
  font-family: var(--font-family);
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--grad-cyan-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.login-alert {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-footer-note {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
}

.login-footer-note .lock-icon {
  font-size: 0.9rem;
  color: var(--accent-gold);
}

/* Header User Profile & Badges */
.cloud-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-cyan);
  transition: var(--transition);
}

.status-dot.yellow {
  background: var(--accent-gold);
  box-shadow: 0 0 6px var(--accent-gold);
}

.status-dot.red {
  background: var(--accent-rose);
  box-shadow: 0 0 6px var(--accent-rose);
}

.user-menu-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.8rem;
  color: var(--text-main);
}

.header-username {
  font-weight: 700;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent-blue);
  color: #ffffff;
  letter-spacing: 0.5px;
}

.btn-danger-ghost:hover {
  background: rgba(244, 63, 94, 0.2) !important;
  color: var(--accent-rose) !important;
  border-color: rgba(244, 63, 94, 0.4) !important;
}

/* Empty State */
.empty-state-wrap {
  text-align: center;
  padding: 4rem 1.5rem;
  max-width: 520px;
  margin: 2rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-icon-lg {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.3));
}

.empty-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.empty-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Header Login Button */
.btn-header-login {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  background: var(--grad-cyan-blue);
  color: #070c18 !important;
  border: none;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
  transition: var(--transition);
}

.btn-header-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.6);
}

.login-overlay.hidden {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ==========================================================================
   MOBILE & TABLET OPTIMIZATION (MAX-WIDTH: 768px)
   Eliminates UI clipping, overflowing elements, and redundant navigation
   ========================================================================== */
@media (max-width: 768px) {
  /* Navigation: Hide duplicate top tab nav, use ergonomic bottom nav */
  .tab-navigation {
    display: none !important;
  }

  .bottom-nav {
    display: flex !important;
  }

  .main-content {
    padding: 0.75rem 0.65rem calc(4.8rem + env(safe-area-inset-bottom, 0px)) 0.65rem;
  }

  /* Header adjustments */
  .top-header {
    padding: 0.45rem 0.65rem;
    gap: 0.4rem;
    flex-wrap: wrap;
  }

  .brand-wrapper {
    gap: 0.45rem;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
  }

  .brand-text h1 {
    font-size: 0.95rem;
  }

  .header-actions {
    gap: 0.35rem;
    flex-wrap: wrap;
  }

  .theme-select-header {
    padding: 0.3rem 0.45rem;
    font-size: 0.72rem;
    max-width: 105px;
  }

  .btn-new-tournament {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    gap: 0.25rem;
  }

  .btn-header-login {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.75rem !important;
  }

  .user-pill {
    padding: 0.25rem 0.45rem;
    font-size: 0.72rem;
  }

  .header-username {
    max-width: 65px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
  }

  .user-role-badge {
    font-size: 0.58rem;
    padding: 1px 4px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }

  /* Tournament Overview Bar */
  .tournament-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    padding: 0.55rem 0.65rem;
  }

  .current-tournament-info {
    width: 100%;
    min-width: 0;
  }

  .tournament-name-wrap {
    min-width: 0;
    flex: 1;
  }

  .tournament-name-wrap h2 {
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .tournament-bar > div:last-child {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  #select-switch-tournament {
    flex: 1;
    min-width: 0;
    font-size: 0.76rem;
    padding: 0.38rem 0.55rem;
  }

  .tournament-progress {
    flex-shrink: 0;
    min-width: 80px;
    gap: 0.35rem;
  }

  .progress-track {
    width: 45px;
  }

  #header-progress-text {
    font-size: 0.68rem;
  }

  /* Standings Table */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
  }

  .standings-table {
    font-size: 0.72rem;
  }

  .standings-table th,
  .standings-table td {
    padding: 0.45rem 0.3rem;
  }

  .standings-table th.th-team,
  .standings-table td.td-team {
    min-width: 105px;
    max-width: 125px;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    gap: 0.35rem;
  }

  .team-name-cell {
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
    font-size: 0.75rem;
  }

  .team-badge-circle {
    width: 20px;
    height: 20px;
    font-size: 0.56rem;
    flex-shrink: 0;
  }

  .rank-indicator {
    width: 14px;
    font-size: 0.7rem;
    flex-shrink: 0;
  }

  .points-cell {
    font-weight: 800;
    color: var(--accent-gold);
  }

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

  /* Fixtures & Match Cards */
  .fixtures-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .fixtures-filter-bar select {
    width: 100%;
  }

  .match-round-title {
    font-size: 0.76rem;
    padding: 0.35rem 0.5rem;
    margin: 0.65rem 0 0.35rem 0;
  }

  .match-card {
    padding: 0.6rem 0.65rem;
    margin-bottom: 0.45rem;
    gap: 0.4rem;
  }

  .match-teams-box {
    min-width: 0;
    flex: 1;
    gap: 0.35rem;
  }

  .team-row {
    gap: 0.3rem;
  }

  .team-info-left {
    gap: 0.35rem;
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }

  .team-title {
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
  }

  .match-score-badge {
    font-size: 0.82rem;
    min-width: 22px;
    padding: 2px 4px;
  }

  .match-meta-box {
    padding-left: 0.45rem;
    min-width: 60px;
    gap: 0.2rem;
  }

  .match-status-badge {
    font-size: 0.56rem;
    padding: 2px 4px;
  }

  .match-leg-badge, .match-penalty-note {
    font-size: 0.56rem;
  }

  /* Knockout Brackets */
  .bracket-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem 0.25rem;
  }

  .bracket-rounds-wrapper {
    gap: 1rem;
    min-width: 660px;
  }

  .bracket-matchup-node {
    padding: 0.45rem;
    min-width: 160px;
  }

  .bracket-team-name {
    max-width: 95px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
  }

  /* Cards, Overview & Stats */
  .card {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius-md);
  }

  .card-header {
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .card-title {
    font-size: 0.9rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
  }

  .stat-item {
    padding: 0.55rem 0.35rem;
  }

  .stat-value {
    font-size: 1.15rem;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  .club-management-list {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .club-management-item {
    padding: 0.55rem;
    gap: 0.45rem;
  }

  .club-item-title {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
  }

  .btn-disqualify, .btn-revert-disqualify {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
    white-space: nowrap;
  }

  /* Floating Action Button */
  .fab-quick-sim {
    bottom: calc(4.1rem + env(safe-area-inset-bottom, 0px));
    right: 0.75rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.74rem;
  }

  /* Modals */
  .modal-overlay {
    padding: 0.4rem;
  }

  .modal-dialog {
    max-width: 100%;
    width: 100%;
    max-height: 88dvh;
    border-radius: var(--radius-lg);
    margin: auto;
  }

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

  .modal-title {
    font-size: 0.95rem;
  }

  .modal-body {
    padding: 0.85rem 0.75rem;
  }

  .modal-footer {
    padding: 0.65rem 0.75rem;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .modal-footer .btn {
    flex: 1;
    min-width: 90px;
    justify-content: center;
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
  }

  .mode-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .mode-select-card {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 0.65rem;
    padding: 0.65rem;
  }

  .mode-select-card .mode-icon {
    margin-bottom: 0;
    font-size: 1.5rem;
    flex-shrink: 0;
  }

  .mode-select-card .mode-title {
    font-size: 0.82rem;
    margin-bottom: 0.1rem;
  }

  .mode-select-card .mode-desc {
    font-size: 0.68rem;
  }

  /* Score Modal on Mobile */
  .score-board-modal {
    gap: 0.4rem;
    margin-bottom: 1rem;
  }

  .team-score-side {
    gap: 0.45rem;
  }

  #modal-home-badge, #modal-away-badge {
    width: 36px;
    height: 36px;
    font-size: 0.78rem;
  }

  #modal-home-team-name, #modal-away-team-name {
    font-size: 0.8rem;
    max-width: 95px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stepper-btn {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }

  .score-input-number {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
  }

  .wo-quick-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .btn-wo-option {
    flex: 1;
    text-align: center;
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem;
  }

  #form-add-user {
    grid-template-columns: 1fr !important;
  }

  .login-card {
    padding: 1.5rem 1.15rem !important;
    border-radius: var(--radius-lg) !important;
  }

  .empty-state {
    padding: 2rem 1rem;
    margin: 1rem auto;
  }
}

/* Extra small mobile screens (e.g. <= 400px width) */
@media (max-width: 400px) {
  .btn-new-tournament span {
    display: none;
  }

  .btn-new-tournament {
    padding: 0.38rem 0.5rem;
  }

  .brand-text span {
    display: none;
  }

  .theme-select-header {
    max-width: 75px;
    font-size: 0.68rem;
  }

  .team-title {
    max-width: 85px;
  }

  .team-name-cell {
    max-width: 58px;
  }

  .stepper-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .score-input-number {
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
  }
}

