/* Mundial '26 - CSS Stylesheet */

/* --- Design System Variables --- */
:root {
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Color Palette - Carbon Dark & Neon Glows */
  --bg-app: #0b0f19;
  --bg-surface: rgba(17, 24, 39, 0.7);
  --bg-surface-solid: #111827;
  --bg-surface-hover: rgba(31, 41, 55, 0.8);
  
  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.3);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.2);
  --accent-cyan: #06b6d4;
  --accent-red: #ef4444;
  
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(6, 182, 212, 0.5);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  --glass-blur: blur(12px);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
}

/* --- Base Resets & Global Styles --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(245, 158, 11, 0.05) 0%, transparent 40%);
}

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

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Header Component --- */
.app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 1.5rem 2rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-light);
  gap: 2rem;
  z-index: 10;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.logo-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 10px var(--accent-gold-glow));
  animation: float 4s ease-in-out infinite;
}
.logo-text h1 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.logo-text h1 .accent-gold {
  color: var(--accent-gold);
  text-shadow: 0 0 12px var(--accent-gold-glow);
}
.logo-text .subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.live-clock-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 1.25rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-light);
  text-align: center;
  max-width: 280px;
  margin: 0 auto;
}
.clock-label {
  font-size: 0.65rem;
  color: var(--accent-cyan);
  font-weight: 700;
  letter-spacing: 1px;
}
.clock-value {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0.15rem 0;
}
.clock-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.next-match-ticker {
  background: radial-gradient(circle at right, rgba(16, 185, 129, 0.1) 0%, transparent 80%), rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.5rem 1.25rem;
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.ticker-label {
  font-size: 0.65rem;
  color: var(--accent-emerald);
  font-weight: 700;
  letter-spacing: 1px;
}
.ticker-match {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
}
.ticker-timer {
  color: var(--accent-gold);
  font-family: var(--font-title);
  font-weight: 700;
  background: rgba(245, 158, 11, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

/* --- Layout Grid --- */
.app-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto 1fr;
  padding: 2rem;
  gap: 2rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* Navigation Tabs (Sidebar style) */
.tab-navigation {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  padding: 1.25rem;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-light);
  align-self: start;
}
.nav-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  transition: var(--transition-smooth);
}
.nav-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transform: translateX(3px);
}
.nav-tab.active {
  background: radial-gradient(circle at left, rgba(6, 182, 212, 0.15) 0%, transparent 80%), rgba(255, 255, 255, 0.03);
  border-color: rgba(6, 182, 212, 0.25);
  color: var(--accent-cyan);
  box-shadow: var(--shadow-sm);
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}
.tab-icon {
  font-size: 1.2rem;
}

/* Filters and Controls Area */
.controls-panel {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  padding: 1.5rem;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-light);
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 1.25rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}
.search-bar input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 3rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}
.search-bar input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
  background: rgba(0, 0, 0, 0.3);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.filter-item label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.filter-item select {
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.1rem;
  padding-right: 2.5rem;
}
.filter-item select:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: rgba(0, 0, 0, 0.4);
}

.settings-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  padding-top: 1.25rem;
}

.timezone-toggle-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.toggle-switch-wrapper {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-light);
}
.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.toggle-btn:hover {
  color: var(--text-primary);
}
.toggle-btn.active {
  background: var(--bg-surface-solid);
  color: var(--accent-cyan);
  box-shadow: var(--shadow-sm);
}

.reset-sim-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-md);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}
.reset-sim-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

/* --- Viewport Panels --- */
.content-viewport {
  grid-column: 2;
  grid-row: 2;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease-out;
}
.tab-pane.active {
  display: block;
}

.pane-header {
  margin-bottom: 1.5rem;
}
.pane-header h2 {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 700;
}
.pane-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Timeline/Schedule Grid */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

/* --- Match Card Component --- */
.match-card {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  transition: var(--transition-smooth);
  overflow: hidden;
}
.match-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: transparent;
  transition: var(--transition-smooth);
}
.match-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-lg);
}
.match-card.completed::before {
  background: var(--text-muted);
}
.match-card.live::before {
  background: var(--accent-red);
}
.match-card.scheduled::before {
  background: var(--accent-cyan);
}

/* Favorite Star Star Button */
.fav-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0.25rem;
  border-radius: 50%;
}
.fav-btn:hover {
  transform: scale(1.2);
  color: var(--accent-gold);
}
.fav-btn.active {
  color: var(--accent-gold);
  filter: drop-shadow(0 0 6px var(--accent-gold-glow));
}

/* Match Card Header */
.match-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stage-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}
.match-card-meta.live .stage-badge {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}
.status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.live .status-dot {
  background: var(--accent-red);
  animation: pulse 1.5s infinite;
}
.live .status-badge {
  color: var(--accent-red);
}
.completed .status-badge {
  color: var(--text-muted);
}
.scheduled .status-badge {
  color: var(--accent-cyan);
}
.scheduled .status-dot {
  background: var(--accent-cyan);
}

/* Match Card Teams Grid */
.match-card-teams {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 0.65rem;
  padding: 0.25rem 0;
}
.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.team-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.team-flag {
  font-size: 1.75rem;
  line-height: 1;
}
.team-name {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
}
.team-score {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 800;
  width: 2.5rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--border-radius-sm);
  padding: 0.1rem 0;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}
.team-score:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-light);
  color: var(--accent-cyan);
}
.team-score.empty {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 1rem;
}
.team-row.loser {
  opacity: 0.5;
}
.team-row.winner .team-name {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Match Card Footer Details */
.match-card-footer {
  border-top: 1px solid var(--border-light);
  padding-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.match-venue {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.match-time {
  font-weight: 600;
  color: var(--text-secondary);
}

/* Simulate Button Overlay */
.sim-trigger-overlay {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-cyan);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid rgba(6, 182, 212, 0.1);
  transition: var(--transition-fast);
}
.sim-trigger-overlay:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.3);
  transform: scale(1.03);
}

/* --- Tab 2: Tournament Bracket Component --- */
.bracket-viewport {
  overflow-x: auto;
  padding: 1rem 0;
  cursor: grab;
}
.bracket-viewport:active {
  cursor: grabbing;
}
.bracket-container {
  display: flex;
  gap: 3rem;
  width: max-content;
  padding: 1.5rem;
  position: relative;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 1.5rem;
  min-width: 260px;
}
.bracket-round-title {
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
}

.bracket-match-node {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  width: 250px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  transition: var(--transition-smooth);
  cursor: pointer;
}
.bracket-match-node:hover {
  border-color: var(--border-focus);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.1);
  transform: translateX(2px);
}
.bracket-match-node::after {
  content: '';
  position: absolute;
  right: -1.5rem;
  top: 50%;
  width: 1.5rem;
  height: 2px;
  background: var(--border-light);
}
.bracket-round:last-of-type .bracket-match-node::after {
  display: none;
}
.bracket-match-node .team-flag {
  font-size: 1.25rem;
}
.bracket-match-node .team-name {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.bracket-match-node .team-score {
  font-size: 1.15rem;
  width: 1.8rem;
  padding: 0;
  background: rgba(0, 0, 0, 0.2);
}
.bracket-node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 0.25rem;
  margin-bottom: 0.15rem;
}

/* Connecting Lines (Connector classes if we want pixel perfect links) */
/* We will align bracket elements vertically using flex justify-content: space-around which aligns them neatly */

/* --- Tab 3: Group Standings Component --- */
.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 2rem;
}
.group-table-card {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
}
.group-table-card h3 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.4rem;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}
.standings-table th, .standings-table td {
  padding: 0.6rem 0.5rem;
}
.standings-table th {
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-light);
}
.standings-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}
.standings-table tr:last-child td {
  border-bottom: none;
}
.standings-table tr.qualify-top2 {
  position: relative;
}
/* Indicator borders for qualification zones */
.standings-table tr.qualify-top2 td:first-child {
  border-left: 3px solid var(--accent-emerald);
}
.standings-table tr.qualify-best3rd td:first-child {
  border-left: 3px solid var(--accent-gold);
}

.table-team {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
.table-num {
  text-align: center;
  font-family: var(--font-title);
  font-weight: 600;
}
.table-pts {
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-lg);
  margin-top: 1.5rem;
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.empty-state h3 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.empty-state p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 400px;
}

/* --- Simulation Score Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-focus);
  box-shadow: 0 0 40px rgba(6, 182, 212, 0.25);
  border-radius: var(--border-radius-lg);
  padding: 2.25rem;
  max-width: 580px;
  width: 90%;
  position: relative;
  transform: translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  transition: var(--transition-fast);
}
.modal-close:hover {
  color: var(--text-primary);
  transform: rotate(90deg);
}

.modal-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.modal-stage-badge {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-bottom: 0.5rem;
}
.modal-header h3 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
}
.modal-meta, .modal-meta-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.simulation-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}
.sim-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}
.sim-flag {
  font-size: 3.5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}
.sim-name {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
}
.sim-rating-bar {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.sim-score-inputs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.score-input-wrapper input {
  width: 4.5rem;
  height: 4.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-family: var(--font-title);
  font-size: 2.25rem;
  font-weight: 800;
  text-align: center;
  transition: var(--transition-smooth);
}
.score-input-wrapper input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}
/* Hide numeric arrows */
.score-input-wrapper input::-webkit-outer-spin-button,
.score-input-wrapper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.score-separator {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-muted);
}

.sim-penalties-wrapper {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-light);
  border-radius: var(--border-radius-md);
  padding: 1rem;
  margin-bottom: 1.75rem;
  text-align: center;
}
.sim-penalties-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}
.penalty-options {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.penalty-btn {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}
.penalty-btn:hover {
  border-color: var(--border-focus);
  color: var(--text-primary);
}
.penalty-btn.active {
  background: var(--accent-gold-glow);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 1.5rem;
}
.btn {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-primary {
  background: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #000000;
  flex: 1;
}
.btn-primary:hover {
  background: #00e5ff;
  transform: translateY(-1px);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Footer Section */
.app-footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* --- Animations & Pulses --- */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0px); }
}

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

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

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }
  .tab-navigation {
    grid-column: 1;
    grid-row: 1;
    flex-direction: row;
    overflow-x: auto;
    width: 100%;
    padding: 0.75rem;
  }
  .nav-tab {
    white-space: nowrap;
  }
  .controls-panel {
    grid-column: 1;
    grid-row: 2;
  }
  .content-viewport {
    grid-column: 1;
    grid-row: 3;
  }
  .app-header {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1rem;
    justify-items: center;
  }
  .next-match-ticker {
    width: 100%;
    max-width: 320px;
    align-items: center;
  }
}

@media (max-width: 768px) {
  .filters-grid {
    grid-template-columns: 1fr 1fr;
  }
  .settings-wrapper {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    text-align: center;
  }
  .timezone-toggle-container {
    justify-content: center;
  }
  .standings-grid {
    grid-template-columns: 1fr;
  }
}
