/* CSS DESIGN SYSTEM - QUINIELA MUNDIAL 2026 */

:root {
  --bg-main: #070913;
  --bg-card: rgba(18, 24, 48, 0.65);
  --bg-card-hover: rgba(26, 34, 68, 0.85);
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(245, 158, 11, 0.4);
  
  --color-text-main: #f8fafc;
  --color-text-muted: #94a3b8;
  
  /* Brand Colors */
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.3);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.3);
  --red: #ef4444;
  
  /* Gradients for Match Selection Buttons */
  --grad-local: linear-gradient(135deg, #2563eb, #06b6d4);
  --grad-draw: linear-gradient(135deg, #4b5563, #6b7280);
  --grad-visitor: linear-gradient(135deg, #7c3aed, #db2777);
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --shadow-gold: 0 0 20px rgba(245, 158, 11, 0.25);
  --radius-lg: 16px;
  --radius-md: 10px;
}

/* RESET & CORE STYLES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, hsla(242, 59%, 11%, 1) 0px, transparent 50%),
    radial-gradient(at 100% 0%, hsla(142, 69%, 7%, 0.15) 0px, transparent 50%),
    radial-gradient(at 50% 100%, hsla(271, 76%, 8%, 0.8) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--color-text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
}

/* GLASS PANEL UTILITY */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
}

/* BUTTONS */
.btn {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #d97706);
  color: #070913;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  filter: brightness(1.1);
}

.btn-success {
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: #070913;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
  filter: brightness(1.1);
}

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

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--color-text-muted);
}

.btn-block {
  width: 100%;
}

/* BADGES */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-error {
  background-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* TOAST NOTIFICATION SYSTEM */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  border-left: 4px solid var(--gold);
  border: 1px solid var(--border-glass);
  border-left-width: 4px;
  color: var(--color-text-main);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-premium);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  min-width: 280px;
  backdrop-filter: blur(10px);
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast.success {
  border-left-color: var(--emerald);
}

.toast.error {
  border-left-color: var(--red);
}

@keyframes slideIn {
  from {
    transform: translateX(100%) translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateX(0) translateY(0);
    opacity: 1;
  }
}

/* AUTHENTICATION SCREEN */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 450px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  padding: 2.5rem;
  transition: var(--transition-smooth);
}

.auth-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.logo i {
  font-size: 2.2rem;
  color: var(--gold);
  filter: drop-shadow(0 0 8px var(--gold-glow));
}

.logo h1 {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: -1px;
}

.logo h1 span {
  color: var(--gold);
}

.subtitle {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  padding: 0.6rem;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.auth-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-main);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Form Styles */
.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-group input {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  color: var(--color-text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
  background: rgba(0, 0, 0, 0.4);
}

/* MAIN APP STRUCTURE */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.app-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-glass);
  gap: 1.5rem;
}

.header-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.header-logo i {
  font-size: 2.2rem;
  color: var(--gold);
  animation: pulseGold 2s infinite alternate;
}

.header-logo h2 {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: -0.5px;
  text-align: center;
}

.header-logo h2 span {
  color: var(--gold);
}

/* Logo and User Profile alignment */
.logo-and-profile {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  align-items: center;
  padding-bottom: 0.25rem;
  width: 100%;
}

.user-profile-card {
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  padding: 0.4rem 0.9rem;
  border-radius: 12px;
  font-family: var(--font-title);
  font-size: 0.85rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: var(--transition-smooth);
}

.user-profile-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid var(--gold);
  object-fit: cover;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

.profile-username {
  color: var(--gold);
  font-weight: 700;
  font-family: var(--font-title);
  letter-spacing: 0.2px;
  font-size: 1.15rem;
  padding-top: 2px;
  margin-left: 0.85rem;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.profile-divider {
  width: 1px;
  height: 16px;
  background: var(--border-glass);
}

.btn-logout-mini {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-family: var(--font-title);
  transition: var(--transition-smooth);
}

.btn-logout-mini:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* Navbar Statistics block */
.user-stats-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  padding: 0.4rem 1.5rem;
  gap: 1.5rem;
  align-items: center;
  backdrop-filter: blur(10px);
}

.stat-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
}

.stat-item.highlight .stat-value {
  color: var(--gold);
}

.progress-stat {
  display: flex;
  flex-direction: column;
  min-width: 120px;
  gap: 0.2rem;
}

.progress-container-mini {
  width: 100px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-mini {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--emerald));
  border-radius: 3px;
  transition: width 0.4s ease-out;
}

.stat-value-mini {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

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

.badge-admin {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  border: none;
  font-family: var(--font-title);
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

/* APP TABS NAV */
.app-tabs {
  display: flex;
  gap: 0.75rem;
  margin: 1.5rem 0;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  position: relative;
  transition: var(--transition-smooth);
}

.tab-btn:hover {
  color: var(--color-text-main);
  background: rgba(255,255,255,0.02);
}

.tab-btn.active {
  color: var(--gold);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 -2px 10px var(--gold-glow);
}

/* APP VIEW STRUCTURE */
.app-main {
  flex-grow: 1;
}

.tab-view {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

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

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

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 2rem;
  flex-wrap: wrap;
}

.view-title-group h3 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.view-title-group p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  max-width: 700px;
}

/* Progress Big Card */
.prediction-progress-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  min-width: 320px;
  box-shadow: var(--shadow-premium);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-muted);
}

.progress-percentage {
  color: var(--gold);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--emerald));
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* FILTER BAR */
.filter-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 2rem;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.filter-group label {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.filter-group select,
.filter-group input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  color: var(--color-text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-smooth);
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--gold);
}

/* MATCHES GRID & CARDS */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.match-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  gap: 1rem;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-premium);
}

.match-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.12);
}

.match-card.completed {
  border-color: rgba(16, 185, 129, 0.25);
}

.match-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  padding-bottom: 0.5rem;
}

.match-group {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-family: var(--font-title);
  color: var(--color-text-main);
}

.match-date {
  font-family: var(--font-body);
}

/* Match Teams area */
.match-teams-layout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  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-mock {
  width: 28px;
  height: 20px;
  border-radius: 3px;
  background: linear-gradient(135deg, #1e293b, #334155);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: #94a3b8;
  border: 1px solid rgba(255,255,255,0.1);
  text-transform: uppercase;
}

.team-name {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.2px;
}

.match-vs {
  align-self: center;
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 700;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  letter-spacing: 1px;
}

/* Prediction Option Buttons Container */
.match-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.opt-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--color-text-muted);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 0.25rem;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  transition: var(--transition-smooth);
  width: 100%;
  overflow: hidden;
}

.opt-btn .opt-team-name {
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.7;
  max-width: 95%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.opt-btn:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-main);
}

.opt-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.opt-btn.selected-L:disabled,
.opt-btn.selected-E:disabled,
.opt-btn.selected-V:disabled {
  opacity: 1;
  cursor: not-allowed;
}

/* Selected Button States */
.opt-btn.selected-L {
  background: var(--grad-local);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.opt-btn.selected-E {
  background: var(--grad-draw);
  color: #fff;
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

.opt-btn.selected-V {
  background: var(--grad-visitor);
  color: #fff;
  box-shadow: 0 4px 12px rgba(219, 39, 119, 0.4);
}

/* Real Match Result Banner inside Card */
.real-result-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.real-result-banner.correct {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.real-result-banner.incorrect {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.real-result-banner.pending {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--color-text-muted);
}

/* LEADERBOARD VIEW */
.rules-card {
  background: rgba(16, 185, 129, 0.03);
  border: 1px solid rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  min-width: 320px;
}

.rules-card h4 {
  font-family: var(--font-title);
  color: var(--emerald);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rules-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.rules-card ul li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-card {
  overflow-x: auto;
  margin-bottom: 3rem;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.leaderboard-table th {
  font-family: var(--font-title);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.leaderboard-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-family: var(--font-body);
}

.leaderboard-table tbody tr {
  transition: var(--transition-smooth);
}

.leaderboard-table tbody tr.clickable {
  cursor: pointer;
}

.leaderboard-table tbody tr.clickable:hover {
  background: rgba(255, 255, 255, 0.02);
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

/* Rank column styling */
.rank-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 800;
  font-family: var(--font-title);
  font-size: 0.9rem;
  margin: 0 auto;
}

.rank-1 {
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  color: #070913;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.rank-2 {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  color: #070913;
}

.rank-3 {
  background: linear-gradient(135deg, #fdba74, #ea580c);
  color: #fff;
}

.rank-other {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-muted);
}

.player-info-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.player-info-cell i {
  font-size: 1.2rem;
  color: var(--color-text-muted);
}

.player-info-cell.is-admin i {
  color: var(--gold);
}

.player-name {
  font-weight: 600;
  font-family: var(--font-title);
  font-size: 1.05rem;
}

/* ADMIN PANEL VIEW */
.admin-matches-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 3rem;
}

.admin-match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  gap: 2rem;
  flex-wrap: wrap;
  transition: var(--transition-smooth);
}

.admin-match-row:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.1);
}

.admin-match-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-grow: 1;
  min-width: 280px;
}

.admin-match-id {
  font-family: var(--font-title);
  font-weight: 800;
  color: var(--gold);
  font-size: 1.1rem;
  background: rgba(245, 158, 11, 0.1);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-match-teams {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-title);
  font-weight: 600;
}

.admin-team-l { text-align: right; min-width: 110px; }
.admin-team-v { text-align: left; min-width: 110px; }

.admin-match-meta {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.admin-match-meta .group-label {
  font-weight: 700;
  color: var(--color-text-main);
}

.admin-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.admin-result-buttons {
  display: flex;
  background: rgba(0,0,0,0.3);
  padding: 0.2rem;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
}

.admin-opt-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-title);
  font-weight: 700;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.admin-opt-btn:hover {
  color: var(--color-text-main);
  background: rgba(255,255,255,0.05);
}

.admin-opt-btn.active-L { background: var(--grad-local); color: #fff; }
.admin-opt-btn.active-E { background: var(--grad-draw); color: #fff; }
.admin-opt-btn.active-V { background: var(--grad-visitor); color: #fff; }

.admin-clear-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.5rem;
  transition: var(--transition-smooth);
}

.admin-clear-btn:hover {
  color: var(--red);
}

/* COMPARISON MODAL OVERLAY */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 5, 10, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem 1rem;
  animation: fadeIn 0.25s ease forwards;
}

.modal-content {
  width: 100%;
  max-width: 750px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: rgba(255,255,255,0.1);
  position: relative;
}

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

.modal-header h3 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
}

.modal-header p {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-smooth);
}

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

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
}

.modal-legend {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  padding-bottom: 1rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.ind-correct { background-color: var(--emerald); }
.ind-incorrect { background-color: var(--red); }
.ind-pending { background-color: var(--color-text-muted); }

.modal-comparison-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Card comparison row in Modal */
.comp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  gap: 1rem;
  transition: var(--transition-smooth);
}

.comp-row:hover {
  background: rgba(255,255,255,0.04);
}

.comp-row.correct {
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.02);
}

.comp-row.incorrect {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.02);
}

.comp-match-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-grow: 1;
}

.comp-match-id {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 700;
  width: 20px;
}

.comp-teams {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comp-team-l { text-align: right; min-width: 90px; }
.comp-team-v { text-align: left; min-width: 90px; }

.comp-results-block {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.comp-bet, .comp-real {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.comp-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.comp-val {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-align: center;
  min-width: 28px;
}

.comp-val.val-L { background: rgba(37, 99, 235, 0.2); color: #60a5fa; border: 1px solid rgba(37, 99, 235, 0.4); }
.comp-val.val-E { background: rgba(107, 114, 128, 0.2); color: #cbd5e1; border: 1px solid rgba(107, 114, 128, 0.4); }
.comp-val.val-V { background: rgba(219, 39, 119, 0.2); color: #f472b6; border: 1px solid rgba(219, 39, 119, 0.4); }
.comp-val.val-none { background: rgba(255, 255, 255, 0.05); color: var(--color-text-muted); }

.comp-score-badge {
  width: 48px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.8rem;
  text-align: center;
}

.comp-score-badge.pts-3 { color: var(--emerald); }
.comp-score-badge.pts-0 { color: var(--red); }
.comp-score-badge.pts-pending { color: var(--color-text-muted); }

/* FOOTER */
.app-footer {
  padding: 2.5rem 0;
  text-align: center;
  border-top: 1px solid var(--border-glass);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

/* KEYFRAMES FOR PULSES AND OTHER ANIMATIONS */
@keyframes pulseGold {
  from {
    filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.2));
  }
  to {
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.7));
  }
}

/* DASHBOARD SPLIT LAYOUT */
.dashboard-split-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
  margin-bottom: 3rem;
}

.matches-side {
  min-width: 0; /* Prevents flexbox/grid layout blow up */
}

.leaderboard-side {
  position: sticky;
  top: 1.5rem;
  width: 100%;
}

.side-panel {
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.side-panel-header {
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.75rem;
}

.side-panel-header h4 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.side-panel-header p {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 0.1rem;
}

.table-container-side {
  max-height: 600px;
  overflow-y: auto;
}

/* Side table adjustments */
.side-table thead th {
  padding: 0.75rem 0.5rem;
  font-size: 0.75rem;
}

.side-table tbody td {
  padding: 0.75rem 0.5rem;
  font-size: 0.85rem;
}

.side-table .rank-badge {
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
}

.side-table .player-name {
  font-size: 0.9rem;
}

.side-table .player-info-cell i {
  font-size: 1rem;
}

/* RESPONSIVE LAYOUT UPDATES */
@media (max-width: 1150px) {
  .dashboard-split-layout {
    grid-template-columns: 1fr;
  }
  
  .leaderboard-side {
    position: static;
    margin-bottom: 2rem;
  }
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 900px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    padding: 1rem 0;
  }
  
  .user-stats-bar {
    width: 100%;
    justify-content: space-around;
    padding: 0.5rem 1rem;
  }
  
  .header-actions {
    justify-content: space-between;
  }
  
  .view-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .prediction-progress-card {
    min-width: 100%;
  }
}

@media (max-width: 600px) {
  .matches-grid {
    grid-template-columns: 1fr;
  }
  
  .admin-match-row {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem;
  }
  
  .admin-controls {
    justify-content: space-between;
  }
  
  .comp-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem;
  }
  
  .comp-results-block {
    justify-content: space-between;
  }
  
  .comp-team-l, .comp-team-v {
    min-width: auto;
  }

  .header-logo h2 {
    font-size: 1.3rem;
  }
  
  .view-title-group h3 {
    font-size: 1.3rem;
  }

  .auth-card {
    padding: 1.5rem;
  }

  .logo h1 {
    font-size: 1.8rem;
  }

  .user-profile-card {
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.35rem 0.65rem;
  }

  .header-logo .btn-outline {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.75rem !important;
    gap: 0.25rem !important;
  }

  /* Compact table styles for mobile-first views */
  .table-card {
    overflow-x: hidden !important;
  }

  .leaderboard-table th, .leaderboard-table td {
    padding: 0.5rem 0.4rem !important;
    font-size: 0.75rem !important;
  }
  
  .rank-badge {
    width: 22px !important;
    height: 22px !important;
    font-size: 0.7rem !important;
  }

  .player-name {
    font-size: 0.8rem !important;
  }

  .player-info-cell i {
    font-size: 0.9rem !important;
  }
}

@media (max-width: 400px) {
  .header-logo h2 {
    font-size: 1.15rem;
  }

  .header-logo .btn-outline {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.7rem !important;
  }

  .user-stats-bar {
    gap: 0.75rem;
    padding: 0.4rem 0.75rem;
  }

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

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

  .app-tabs {
    gap: 0.5rem;
  }

  .tab-btn {
    padding: 0.6rem 0.9rem;
    font-size: 0.95rem;
  }
}

/* Registration Deadline Notice Alert */
.registration-deadline-notice {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: #fbbf24;
  line-height: 1.4;
}

.registration-deadline-notice i {
  font-size: 1.1rem;
  color: var(--gold);
  margin-top: 0.1rem;
}

/* Quiniela Completed Banner */
.quiniela-completed-banner {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: #34d399;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
  animation: pulseEmerald 3s infinite alternate ease-in-out;
}

.quiniela-completed-banner i {
  font-size: 2.2rem;
  color: var(--emerald);
  filter: drop-shadow(0 0 6px var(--emerald-glow));
}

.quiniela-completed-banner h4 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.quiniela-completed-banner p {
  font-size: 0.88rem;
  color: var(--color-text-main);
  opacity: 0.85;
}

@keyframes pulseEmerald {
  from {
    border-color: rgba(16, 185, 129, 0.2);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.05);
  }
  to {
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
  }
}

/* Floating Back to Top Button */
.back-to-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--gold);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              background 0.3s ease, 
              color 0.3s ease, 
              border-color 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-btn:hover {
  background: var(--gold);
  color: #070913;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
  border-color: var(--gold);
}

.back-to-top-btn:active {
  transform: translateY(-1px) scale(0.95);
}



