:root {
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-border: rgba(255, 255, 255, 0.1);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --accent: #10b981;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 12px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

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

body {
  background: radial-gradient(circle at top right, #1e1b4b 0%, #0f172a 50%, #020617 100%);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Standardized Breakpoints:
   • Mobile:  @media (max-width: 640px)
   • Tablet:  @media (max-width: 1024px) / (min-width: 641px) and (max-width: 1024px)
   • Desktop: @media (min-width: 1025px)
   ========================================================================== */

/* ===== Navigation Bar ===== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-card-border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

.navbar-brand-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 800;
  background: var(--brand-gradient, linear-gradient(135deg, #818cf8 0%, #c084fc 100%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--bg-card-border);
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 8px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  transition: var(--transition);
}

.navbar-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: var(--transition);
}

.navbar-toggle--open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar-toggle--open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.navbar-toggle--open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-auth-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

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

.nav-link-admin {
  color: #c084fc;
  font-weight: 600;
}

.nav-user-info {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.nav-user-name {
  color: var(--text-main);
  font-weight: 700;
}

.nav-logout-form {
  display: inline;
  margin: 0;
}

.lang-icon,
.lang-divider {
  color: var(--text-muted);
}

.lang-icon {
  margin-right: 0.2rem;
}

/* Tablet Navbar: max-width: 1024px */
@media (max-width: 1024px) {
  .navbar {
    padding: 1rem 1.5rem;
  }
  .nav-links {
    gap: 0.85rem;
    font-size: 0.88rem;
  }
  .nav-group {
    gap: 0.75rem;
  }
}

/* Mobile Navbar: max-width: 640px */
@media (max-width: 640px) {
  .navbar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }

  .navbar-brand-wrapper {
    width: 100%;
  }

  .navbar-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 1rem 0 0.5rem 0;
    margin-top: 0.75rem;
    border-top: 1px solid var(--bg-card-border);
  }

  .nav-links.nav-links--open {
    display: flex;
    animation: navSlideDown 0.2s ease-out;
  }

  .nav-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .nav-auth-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .nav-link {
    padding: 0.5rem 0;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-user-info {
    padding: 0.4rem 0;
    font-size: 0.88rem;
  }

  .nav-btn-logout {
    width: 100%;
    text-align: center;
  }

  .lang-selector {
    align-self: flex-start;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
  }
}

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

.main-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem) clamp(0.6rem, 2.5vw, 1.5rem);
  width: 100%;
}

.main-container--top {
  align-items: flex-start;
}

.auth-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
  transition: var(--transition);
}

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

.auth-header h2 {
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

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

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

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

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.btn-primary {
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: var(--brand-gradient, linear-gradient(135deg, #6366f1 0%, #4f46e5 100%));
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 0.5rem;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-size: 0.875rem;
}

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

.alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-danger {
  background: var(--danger-bg);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
  background: var(--success-bg);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.field-error {
  color: #fca5a5;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-footer a {
  color: #818cf8;
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.dashboard-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.welcome-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2.5rem);
  margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, clamp(180px, 25vw, 240px)), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.stat-card h3 {
  font-size: 2.25rem;
  font-weight: 700;
  color: #818cf8;
  margin-bottom: 0.25rem;
}

.stat-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== Dashboard competition standing cards ===== */
.dashboard-standing-stats {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0;
  border-top: 1px solid var(--bg-card-border);
  border-bottom: 1px solid var(--bg-card-border);
  margin: 0.5rem 0;
}

.standing-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  flex: 1;
  text-align: center;
}

.standing-stat-value {
  display: block;
}

.standing-stat-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Dashboard header & extracted layout classes */
.welcome-username {
  color: var(--primary, #818cf8);
}

.welcome-subtitle {
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
}

.dashboard-section-header {
  margin-bottom: 1.25rem;
}

.dashboard-section-title {
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

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

.welcome-card--empty {
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.welcome-empty-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

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

.btn-browse-competitions {
  width: auto;
  padding: 0.6rem 1.5rem;
  margin-top: 0;
}

.competition-logo-fallback {
  font-size: 1.5rem;
}

.standing-points-badge {
  font-size: 1rem;
  padding: 0.3rem 0.75rem;
}

.standing-stat-label--spaced {
  margin-top: 0.35rem;
}

.stat-rank-value {
  font-size: clamp(1.2rem, 3vw, 1.4rem);
  font-weight: 800;
  color: var(--accent, #10b981);
}

.stat-exact-value {
  font-size: clamp(1.2rem, 3vw, 1.4rem);
  font-weight: 800;
  color: var(--text-main);
}

.competition-card-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr));
  gap: 0.5rem;
  margin-top: auto;
}

.card-action-btn {
  text-align: center;
  font-size: 0.85rem;
  padding: 0.5rem 0.6rem;
  justify-content: center;
  min-width: 0;
}

.card-action-btn--primary {
  grid-column: 1 / -1;
}

/* Standings plain card & empty notice */
.welcome-card--plain {
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.empty-notice {
  color: var(--text-muted);
  text-align: center;
  width: 100%;
}

.table-empty-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

.leaderboard-medal {
  font-size: 1.2rem;
}

.page-title {
  font-size: clamp(1.3rem, 3.5vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-title {
  font-size: 1.2rem;
}

.empty-subtitle {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--bg-card-border);
  background: rgba(15, 23, 42, 0.8);
}

.lang-selector {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.lang-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: var(--transition);
}

.lang-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.lang-link.active {
  color: #818cf8;
  background: rgba(129, 140, 248, 0.15);
}

/* ===== Admin styles ===== */
.admin-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.admin-action-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
}

.admin-action-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
  transform: translateY(-2px);
}

.admin-action-icon {
  font-size: 2.5rem;
}

.admin-action-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.admin-action-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== Table card ===== */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--bg-card-border);
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

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

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

/* ===== Status badges ===== */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-scheduled { background: rgba(99,102,241,0.2); color: #818cf8; }
.status-in_progress { background: rgba(251,191,36,0.2); color: #fbbf24; }
.status-completed { background: rgba(16,185,129,0.2); color: #10b981; }
.status-cancelled { background: rgba(239,68,68,0.2); color: #ef4444; }

.badge-active {
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(16,185,129,0.2);
  color: #10b981;
}

.knockout-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(192,132,252,0.2);
  color: #c084fc;
}

/* ===== Leagues grid ===== */
.leagues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.league-card {
  background: rgba(15,23,42,0.6);
  border: 1px solid var(--bg-card-border);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.league-badge {
  font-family: monospace;
  font-size: 0.85rem;
  color: #818cf8;
  background: rgba(129,140,248,0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* ===== Competitions list ===== */
.competitions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, clamp(260px, 30vw, 340px)), 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

.competition-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.competition-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
  transform: translateY(-2px);
}

.competition-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.competition-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.competition-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.competition-action {
  color: #818cf8;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: auto;
}

.competition-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.competition-logo--lg {
  width: clamp(36px, 5vw, 48px);
  height: clamp(36px, 5vw, 48px);
}

/* ===== Competition Detail Page ===== */
.competition-detail-main {
  align-items: flex-start;
  padding: clamp(1rem, 3vw, 2rem) clamp(0.6rem, 2.5vw, 1.5rem);
  width: 100%;
}

.competition-detail-container {
  max-width: 900px;
  width: 100%;
  padding-bottom: 5rem;
}

.competition-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  gap: clamp(1rem, 2vw, 1.5rem);
}

.competition-header-info {
  min-width: 0;
  flex: 1;
}

.competition-header-title-row {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
  margin-bottom: 0.25rem;
}

.competition-header-title {
  font-size: clamp(1.25rem, 3.5vw, 1.8rem);
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  line-height: 1.2;
}

.competition-header-subtitle {
  color: var(--text-muted);
  font-size: clamp(0.82rem, 1.8vw, 0.95rem);
  margin: 0;
}

.competition-header-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
  gap: clamp(0.4rem, 1.5vw, 0.75rem);
  align-items: center;
  flex-shrink: 0;
}

.competition-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: clamp(0.45rem, 1.5vw, 0.6rem) clamp(0.4rem, 1.5vw, 0.9rem);
  font-size: clamp(0.78rem, 1.8vw, 0.88rem);
  font-weight: 600;
  border-radius: var(--radius-sm, 8px);
  text-decoration: none;
  transition: var(--transition);
  text-align: center;
  min-width: 0;
}

/* ===== Fixture card ===== */
.fixture-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: clamp(0.85rem, 2.5vw, 1.5rem);
  margin-bottom: clamp(0.75rem, 2vw, 1.25rem);
  transition: var(--transition);
  overflow: hidden;
}

.fixture-header {
  margin-bottom: clamp(0.75rem, 2vw, 1.25rem);
}

.fixture-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(0.35rem, 1.8vw, 1rem);
  margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem);
  width: 100%;
}

.team {
  display: flex;
  align-items: center;
  gap: clamp(0.3rem, 1.5vw, 0.6rem);
  font-weight: 600;
  min-width: 0;
}

.team-right {
  flex-direction: row-reverse;
  text-align: right;
  justify-content: flex-start;
}

.team-logo {
  width: clamp(22px, 4vw, 32px);
  height: clamp(22px, 4vw, 32px);
  object-fit: contain;
  flex-shrink: 0;
}

.team .team-name {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  line-height: 1.25;
  font-size: clamp(0.74rem, 2vw, 1rem);
}

.fixture-score-display {
  font-size: clamp(1.05rem, 3.2vw, 1.5rem);
  font-weight: 800;
  color: var(--text-main);
  min-width: clamp(40px, 8vw, 72px);
  text-align: center;
  flex-shrink: 0;
  padding: 0 0.15rem;
}

.vs-badge {
  color: var(--text-muted);
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 600;
}

.actual-score {
  color: var(--accent);
}

.fixture-meta {
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 1.5vw, 0.75rem);
  flex-wrap: wrap;
  font-size: clamp(0.78rem, 1.8vw, 0.85rem);
  color: var(--text-muted);
}

.kickoff-time { color: var(--text-muted); }

/* ===== Prediction form ===== */
.prediction-form-container {
  border-top: 1px solid var(--bg-card-border);
  padding-top: clamp(0.85rem, 2vw, 1.25rem);
}

.score-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.4rem, 1.8vw, 0.75rem);
  margin-bottom: clamp(0.75rem, 2vw, 1rem);
}

.score-input {
  width: clamp(46px, 10vw, 64px);
  padding: clamp(0.4rem, 1.2vw, 0.6rem);
  background: rgba(15,23,42,0.8);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: var(--text-main);
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: var(--transition);
}

.score-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.score-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.score-separator {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-muted);
}

.score-team-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 36px;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-team-label.home-label {
  text-align: right;
}

.score-team-label.away-label {
  text-align: left;
}

/* ===== Knockout proceed selector ===== */
.proceed-selector {
  background: rgba(192,132,252,0.08);
  border: 1px solid rgba(192,132,252,0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  animation: fadeIn 0.2s ease;
}

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

.proceed-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #c084fc;
  margin-bottom: 0.75rem;
}

.proceed-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.proceed-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.proceed-option input[type=radio] {
  accent-color: #c084fc;
}

/* ===== Prediction footer ===== */
.prediction-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.countdown-timer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.countdown-value {
  font-weight: 600;
  color: var(--text-main);
}

.settled-result {
  border-top: 1px solid var(--bg-card-border);
  padding-top: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== Points badge ===== */
.points-badge {
  background: rgba(16,185,129,0.2);
  color: #10b981;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ===== Leaderboard ===== */
.leaderboard-top td {
  background: rgba(99,102,241,0.06);
}

code {
  background: rgba(255,255,255,0.08);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
}

/* ===== Competition Theme Variables ===== */

/* UEFA Champions League Theme */
.theme-uefa-champions {
  --theme-bg-image: url('/assets/champions.jpg');
  --bg-dark: #030b1e;
  --bg-gradient-start: #0a193c;
  --bg-gradient-end: #020712;
  --bg-card: rgba(10, 25, 60, 0.75);
  --bg-card-border: rgba(56, 189, 248, 0.2);
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(0, 240, 255, 0.35);
  --accent: #38bdf8;
  --brand-gradient: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
}

/* UEFA Europa League Theme */
.theme-uefa-europa {
  --theme-bg-image: url('/assets/europa.jpg');
  --bg-dark: #180e08;
  --bg-gradient-start: #26160d;
  --bg-gradient-end: #0d0704;
  --bg-card: rgba(38, 22, 13, 0.78);
  --bg-card-border: rgba(249, 115, 22, 0.25);
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-glow: rgba(249, 115, 22, 0.4);
  --accent: #f59e0b;
  --brand-gradient: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
}

/* UEFA Conference League Theme */
.theme-uefa-europa-conf {
  --theme-bg-image: url('/assets/conference.jpg');
  --bg-dark: #051b14;
  --bg-gradient-start: #0b2e22;
  --bg-gradient-end: #030f0b;
  --bg-card: rgba(11, 46, 34, 0.78);
  --bg-card-border: rgba(16, 185, 129, 0.25);
  --primary: #059669;
  --primary-hover: #047857;
  --primary-glow: rgba(16, 185, 129, 0.4);
  --accent: #34d399;
  --brand-gradient: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

/* ===== Layered background: image + dark gradient overlay ===== */

body[class*="theme-"] {
  position: relative;
  background-color: var(--bg-dark);
}

/* Base background image with reduced opacity */
body[class*="theme-"]::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--theme-bg-image);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 0.18;
  z-index: -2;
  pointer-events: none;
}

/* Dark radial gradient overlay for contrast */
body[class*="theme-"]::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top right, var(--bg-gradient-start) 0%, var(--bg-dark) 60%, var(--bg-gradient-end) 100%);
  opacity: 0.88;
  z-index: -1;
  pointer-events: none;
}

/* Themed accent for points and knockout badges */
body[class*="theme-"] .points-badge {
  background: rgba(from var(--accent) r g b / 0.2);
  color: var(--accent);
}

body[class*="theme-"] .knockout-badge {
  background: rgba(from var(--primary) r g b / 0.2);
  color: var(--accent);
}

/* ── Phase grouping ──────────────────────────── */
.phase-section {
  margin-bottom: 2.5rem;
}

.phase-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark, #1a3a6b) 100%);
  border-radius: 10px;
  margin-bottom: 1.25rem;
}

.phase-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Date sub-group ──────────────────────────── */
.date-group {
  margin-bottom: 1.5rem;
}

.date-group-header {
  padding: 0.4rem 1rem;
  background: var(--surface-2, rgba(255,255,255,0.05));
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  margin-bottom: 0.75rem;
}

.date-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Matchday Date Filter ────────────────────── */
.date-filter-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(12px);
}

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

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

.date-filter-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-filter-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-filter-action:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text-main);
}

.date-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--text-main);
}

.filter-pill.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

body[class*="theme-"] .filter-pill.active {
  background: rgba(from var(--accent) r g b / 0.18);
  border-color: var(--accent);
  color: var(--accent);
}

.filter-pill input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}

.date-filter-empty-message {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 10px;
  margin-bottom: 2rem;
  display: none;
}

/* ── Card Modified State ─────────────────────── */
.fixture-card {
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.fixture-card.is-modified {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.22);
}

body[class*="theme-"] .fixture-card.is-modified {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(from var(--accent) r g b / 0.28);
}

.fixture-card.is-saved-flash {
  animation: cardSavedPulse 1.2s ease;
}

@keyframes cardSavedPulse {
  0% {
    border-color: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.45);
  }
  100% {
    border-color: var(--bg-card-border);
    box-shadow: none;
  }
}

/* ── Floating Batch Save Dock ────────────────── */
.batch-save-bar {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  width: min(calc(100vw - 1.5rem), 560px);
  max-width: 560px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid var(--accent, #38bdf8);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 24px rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  padding: 0.75rem 1.25rem;
  z-index: 2500;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  box-sizing: border-box;
}

.batch-save-bar.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.batch-save-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.batch-save-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.batch-save-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.batch-save-text {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-save-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.btn-batch-save {
  width: auto;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 8px;
}

.btn-batch-discard {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 8px;
}

/* ── Toast Notification ──────────────────────── */
.toast-notification {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--accent, #38bdf8);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 3000;
  animation: slideToast 0.3s ease;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  box-sizing: border-box;
}

.toast-notification.toast-error {
  border-color: var(--danger, #ef4444);
}

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

/* ── Mobile Responsive Optimizations for Batch Save (Mobile: max-width: 640px) ── */
@media (max-width: 640px) {
  .batch-save-bar {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    transform: translateY(110%);
    border-radius: 18px 18px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top: 1.5px solid var(--accent, #38bdf8);
    padding: 0.75rem 1rem max(0.75rem, env(safe-area-inset-bottom));
    box-sizing: border-box;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.85), 0 0 20px rgba(56, 189, 248, 0.2);
    overflow: hidden;
  }

  .batch-save-bar.visible {
    transform: translateY(0);
  }

  .batch-save-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .batch-save-info {
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .batch-save-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
  }

  .batch-save-text {
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
    white-space: normal;
    word-break: break-word;
  }

  .batch-save-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .btn-batch-discard {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.65rem 0.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    justify-content: center;
    border-radius: 10px;
    white-space: nowrap;
    box-sizing: border-box;
  }

  .btn-batch-save {
    flex: 2 1 0;
    min-width: 0;
    padding: 0.65rem 0.75rem;
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
    justify-content: center;
    border-radius: 10px;
    white-space: nowrap;
    box-sizing: border-box;
  }

  .toast-notification {
    left: 1rem;
    right: 1rem;
    top: 1rem;
    justify-content: center;
  }
}

/* ── Interactive Score Display Inputs ────────── */
.score-display-input {
  cursor: pointer;
  user-select: none;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  width: 52px;
  height: 44px;
  text-align: center;
  transition: all 0.2s ease;
}

.score-display-input:hover:not(:disabled) {
  border-color: var(--accent, #38bdf8);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

.score-display-input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.score-picker-trigger {
  display: inline-flex;
}

/* ── Score Clock Dial Modal ──────────────────── */
.score-clock-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  overflow: hidden;
}

.score-clock-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.score-clock-content {
  position: relative;
  width: 100%;
  max-width: 340px;
  box-sizing: border-box;
  background: var(--bg-card, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(56, 189, 248, 0.22);
  border-radius: 20px;
  padding: 1.1rem 1.1rem 1.25rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  max-height: 94dvh;
  overflow-y: auto;
  animation: clockModalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes clockModalIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(15px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.score-clock-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.score-clock-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.score-clock-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.score-clock-close-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.18);
}

/* Team selection tabs in clock modal */
.score-clock-teams {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  box-sizing: border-box;
}

.team-tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.5rem 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.team-tab:hover {
  background: rgba(255, 255, 255, 0.1);
}

.team-tab.active {
  background: rgba(56, 189, 248, 0.14);
  border-color: var(--accent, #38bdf8);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.team-tab-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  width: 100%;
  text-align: center;
}

.team-tab.active .team-tab-name {
  color: var(--text-main);
}

.team-tab-score {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.team-tab.active .team-tab-score {
  color: var(--accent, #38bdf8);
}

.score-clock-vs {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-muted);
}

.score-clock-prompt {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  text-align: center;
  min-height: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* ── 0-9 Clock Face Dial ─────────────────────── */
.score-clock-dial-container {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-sizing: border-box;
}

.score-clock-dial {
  position: relative;
  width: 216px;
  height: 216px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

/* Center score hub & pivot */
.clock-pivot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid var(--accent, #38bdf8);
  transform: translate(-50%, -50%);
  z-index: 5;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.clock-pivot-score {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent, #38bdf8);
}

.clock-hand {
  position: absolute;
  bottom: 50%;
  left: calc(50% - 1.5px);
  width: 3px;
  height: 76px;
  background: var(--accent, #38bdf8);
  transform-origin: bottom center;
  transform: rotate(0deg);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease;
  z-index: 4;
  border-radius: 3px 3px 0 0;
  pointer-events: none;
}

.clock-hand::after {
  content: '';
  position: absolute;
  top: -17px;
  left: calc(50% - 17px);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.2);
  border: 2px solid var(--accent, #38bdf8);
  box-shadow: 0 0 12px var(--accent, #38bdf8);
}

/* Numbers 0-9 arranged in circle */
.clock-number {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  margin-left: -17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  transition: all 0.15s ease;
  padding: 0;
}

.clock-number:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent, #38bdf8);
  transform: scale(1.15);
}

.clock-number.active {
  background: var(--accent, #38bdf8);
  color: #0f172a;
  border-color: var(--accent, #38bdf8);
  font-weight: 800;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

/* 10 positions (36deg increments) radius = 76px */
.clock-number[data-val="0"] { transform: rotate(0deg) translateY(-76px) rotate(0deg); }
.clock-number[data-val="1"] { transform: rotate(36deg) translateY(-76px) rotate(-36deg); }
.clock-number[data-val="2"] { transform: rotate(72deg) translateY(-76px) rotate(-72deg); }
.clock-number[data-val="3"] { transform: rotate(108deg) translateY(-76px) rotate(-108deg); }
.clock-number[data-val="4"] { transform: rotate(144deg) translateY(-76px) rotate(-144deg); }
.clock-number[data-val="5"] { transform: rotate(180deg) translateY(-76px) rotate(-180deg); }
.clock-number[data-val="6"] { transform: rotate(216deg) translateY(-76px) rotate(-216deg); }
.clock-number[data-val="7"] { transform: rotate(252deg) translateY(-76px) rotate(-252deg); }
.clock-number[data-val="8"] { transform: rotate(288deg) translateY(-76px) rotate(-288deg); }
.clock-number[data-val="9"] { transform: rotate(324deg) translateY(-76px) rotate(-324deg); }

.score-clock-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-sizing: border-box;
}

.score-clock-quick-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-clock-step {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clock-step:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--accent, #38bdf8);
}

.btn-clock-done {
  padding: 0.45rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 700;
  width: auto;
  cursor: pointer;
}

/* ── Mobile Drawer Adaptation for Clock Modal (Mobile: max-width: 640px) ── */
@media (max-width: 640px) {
  .score-clock-modal {
    align-items: flex-end;
    padding: 0;
  }
  .score-clock-content {
    max-width: 100%;
    width: 100%;
    margin: 0;
    border-radius: 20px 20px 0 0;
    padding: 1.1rem 1rem max(1.1rem, env(safe-area-inset-bottom));
    animation: clockDrawerIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes clockDrawerIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ── Competition Detail View Responsive Adaptations ── */
/* Tablet: max-width: 1024px */
@media (max-width: 1024px) {
  .competition-detail-main {
    padding: clamp(1rem, 2vw, 1.25rem) clamp(0.75rem, 2vw, 1rem) !important;
  }

  .competition-detail-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .competition-header-title {
    font-size: clamp(1.35rem, 2.8vw, 1.6rem);
    word-break: break-word;
  }

  .competition-header-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
    gap: 0.5rem;
    width: 100%;
  }

  .competition-action-btn {
    width: 100%;
    padding: 0.55rem 0.5rem;
    font-size: 0.84rem;
    text-align: center;
    justify-content: center;
    box-sizing: border-box;
  }
}

/* Mobile: max-width: 640px */
@media (max-width: 640px) {
  .competition-detail-main {
    padding: 0.75rem 0.5rem !important;
  }

  .competition-detail-container {
    padding-bottom: 6rem;
  }

  .competition-logo--lg {
    width: clamp(28px, 6vw, 36px);
    height: clamp(28px, 6vw, 36px);
  }

  .competition-header-title-row {
    gap: 0.5rem;
  }

  .competition-header-title {
    font-size: clamp(1.15rem, 4vw, 1.35rem);
  }

  .competition-header-subtitle {
    font-size: 0.82rem;
  }

  .competition-header-actions {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, clamp(95px, 28vw, 130px)), 1fr));
    gap: 0.4rem;
    width: 100%;
  }

  .competition-action-btn {
    padding: 0.5rem 0.3rem;
    font-size: clamp(0.74rem, 2vw, 0.8rem);
    white-space: normal;
    word-break: normal;
    line-height: 1.2;
    min-height: 38px;
    border-radius: 8px;
    text-align: center;
    justify-content: center;
  }

  /* Fixture card mobile optimization */
  .fixture-card {
    padding: clamp(0.75rem, 2.5vw, 1rem) clamp(0.5rem, 2vw, 0.75rem);
    margin-bottom: 0.85rem;
    border-radius: 12px;
  }

  .fixture-header {
    margin-bottom: 0.85rem;
  }

  .fixture-teams {
    gap: clamp(0.25rem, 1.5vw, 0.4rem);
    margin-bottom: 0.6rem;
  }

  .team {
    gap: clamp(0.25rem, 1.5vw, 0.4rem);
    font-size: clamp(0.74rem, 2.5vw, 0.85rem);
  }

  .team-logo {
    width: clamp(22px, 5.5vw, 26px);
    height: clamp(22px, 5.5vw, 26px);
  }

  .team .team-name {
    font-size: clamp(0.72rem, 2.5vw, 0.85rem);
    line-height: 1.2;
  }

  .fixture-score-display {
    min-width: clamp(40px, 10vw, 48px);
    font-size: clamp(1.05rem, 3.5vw, 1.15rem);
    padding: 0 0.15rem;
  }

  .vs-badge {
    font-size: 0.85rem;
  }

  .actual-score {
    font-size: 1.15rem;
  }

  .fixture-meta {
    font-size: 0.78rem;
    gap: 0.4rem;
    justify-content: space-between;
  }

  .prediction-form-container {
    padding-top: 0.85rem;
  }

  .score-input-row {
    gap: 0.4rem;
    margin-bottom: 0.75rem;
  }

  .score-input {
    width: clamp(46px, 12vw, 54px);
    padding: clamp(0.35rem, 1vw, 0.45rem) 0.25rem;
    font-size: clamp(1.05rem, 3vw, 1.15rem);
  }

  .score-separator {
    font-size: 1.25rem;
  }

  .score-team-label {
    min-width: 28px;
    max-width: 55px;
    font-size: 0.72rem;
  }

  .proceed-selector {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .proceed-label {
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
  }

  .proceed-options {
    gap: 0.6rem;
    flex-direction: column;
  }

  .proceed-option {
    font-size: 0.82rem;
  }

  .prediction-footer {
    gap: 0.5rem;
  }

  .countdown-timer {
    font-size: 0.8rem;
  }

  .settled-result {
    font-size: 0.82rem;
    padding-top: 0.75rem;
  }

  .phase-header {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.85rem;
    border-radius: 8px;
  }

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

  .date-group {
    margin-bottom: 1.25rem;
  }

  .date-group-header {
    padding: 0.35rem 0.65rem;
    margin-bottom: 0.6rem;
  }

  .date-label {
    font-size: 0.78rem;
  }

  .date-filter-card {
    padding: 0.85rem 0.75rem;
    margin-bottom: 1.25rem;
  }

  .date-filter-title {
    font-size: 0.88rem;
  }

  .filter-pill {
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
  }
}

/* ===== Settings & Security ===== */
.settings-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

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

.settings-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--bg-card-border);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

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

.tab-btn.active {
  background: var(--brand-gradient, linear-gradient(135deg, #6366f1 0%, #4f46e5 100%));
  color: #ffffff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

.settings-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

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

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.policy-hint {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.policy-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.policy-hint ul {
  list-style-type: none;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.4rem;
}

.policy-hint li {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.policy-hint li::before {
  content: "•";
  color: #818cf8;
  font-weight: bold;
}

.invite-link-box {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.invite-link-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.invite-link-code {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.9rem;
  color: #818cf8;
  word-break: break-all;
  flex: 1;
}

.temp-pass-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.temp-pass-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 0.25rem;
}

.temp-pass-warning {
  color: #fbbf24;
  font-size: 0.825rem;
  margin-top: 0.6rem;
  font-weight: 600;
}

.btn-danger {
  padding: 0.45rem 0.9rem;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: 6px;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #ef4444;
  color: #ffffff;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.badge-admin {
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(192, 132, 252, 0.2);
  color: #c084fc;
}

.badge-user {
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

.badge-used {
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

.badge-expired {
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-size: 0.95rem;
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
}

/* ===== Official Competition League Standings ===== */
.standings-card {
  padding: 1.5rem;
}

.standings-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.standings-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.standings-table th.sortable:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.standings-table th.active-sort {
  color: var(--primary, #818cf8);
}

.th-content {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.sort-icon {
  font-size: 0.7rem;
  display: inline-block;
  min-width: 0.8rem;
  color: var(--primary, #818cf8);
}

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

.standings-table .col-rank {
  width: 50px;
}

.standings-table .col-team {
  min-width: 180px;
}

.standings-table .col-stat {
  width: 55px;
}

.standings-table .col-pts {
  width: 65px;
}

.rank-cell {
  font-weight: 700;
  color: var(--text-muted);
}

.rank-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.team-cell {
  font-weight: 600;
}

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

.team-logo-sm {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.team-name {
  color: var(--text-main);
  font-size: 0.95rem;
}

.qualification-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: 0.25rem;
}

.gd-positive {
  color: var(--success, #10b981);
  font-weight: 600;
}

.gd-negative {
  color: var(--danger, #ef4444);
  font-weight: 600;
}

.pts-cell {
  background: rgba(255, 255, 255, 0.02);
}

.points-highlight {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary, #818cf8);
}

.standings-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-card-border);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
