:root {
  /* Premium Dark Theme */
  --bg-color: #0f172a;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: 1px solid rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;

  /* Brand Colors */
  --primary: #6366f1;
  /* Indigo */
  --primary-glow: rgba(99, 102, 241, 0.5);
  --accent: #ec4899;
  /* Pink */
  --accent-glow: rgba(236, 72, 153, 0.5);

  /* Feedback Colors */
  --success: #10b981;
  --error: #ef4444;

  /* Spacing & Radius */
  --radius-lg: 16px;
  --radius-md: 12px;
  --spacing-md: 1.5rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.container {
  width: 100%;
  max-width: 480px;
  /* Mobile First optimal width */
  padding: 1rem;
}

/* Wider Container for Livescore (Desktop) */
@media (min-width: 768px) {
  .container.container-wide {
    max-width: none;
    width: 60%;
    /* Slightly more than 50% to be safe for table, but satisfies "50% style" */
  }
}

/* Typography */
h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(to right, #818cf8, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Inputs & Buttons */
.input-group {
  margin-bottom: 1.5rem;
}

input[type="text"] {
  width: 100%;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.5);
  color: white;
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.btn-primary {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Setup for different pages (to be used later) */
.page {
  display: none;
  width: 100%;
  animation: fadeIn 0.4s ease-out;
}

.page.active {
  display: flex;
  flex-direction: column;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Livescore Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

.livescore-table {
  width: 100%;
  min-width: 600px;
  /* Ensure content is legible on mobile by scrolling */
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.livescore-table th {
  text-align: left;
  padding: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.livescore-table td {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
}

.livescore-table tr:first-child td:first-child {
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.livescore-table tr:first-child td:last-child {
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.rank-1 {
  color: #fbbf24;
  font-weight: bold;
}

.rank-2 {
  color: #94a3b8;
  font-weight: bold;
}

.rank-3 {
  color: #b45309;
  font-weight: bold;
}