:root {
  --bg: #0f1724;
  --card: #0b1220;
  --muted: #9aa4b2;
  --accent: #7c3aed;
  --accent-2: #06b6d4;
  --glass: rgba(255,255,255,0.03);
  --win: #10b981;
  --lose: #ef4444;
  --neutral: #f59e0b;
  --text-primary: #e6eef6;
  --text-secondary: #9aa4b2;
  --border: rgba(255,255,255,0.03);
  --border-light: rgba(255,255,255,0.04);
}

/* Utility Classes */
.header-text {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.data-text {
  font-size: 12px;
  color: var(--muted);
}

* {
  box-sizing: border-box;
}

body {
  font-family: Inter, system-ui, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  background: linear-gradient(180deg, #071029 0%, #071627 60%);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Warning Box */
.warning-box {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.1);
}

.warning-icon {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.warning-content h3 {
  color: #f59e0b;
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
}

.warning-content p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Header Styles */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.title {
  display: flex;
  gap: 14px;
  align-items: center;
  flex: 1;
  min-width: 300px;
}

.logo {
  width: 112px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(12,17,23,0.6);
  flex-shrink: 0;
  overflow: hidden;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

h1 {
  font-size: 24px;
  margin: 0;
  font-weight: 600;
}

.lead {
  margin: 5px 0 0 0;
  color: var(--muted);
  font-size: 14px;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--card);
  color: inherit;
  min-width: 220px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.search:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  padding: 12px 16px;
  border-radius: 10px;
  border: 0;
  background: linear-gradient(90deg, var(--accent), #5eead4);
  color: #042027;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Educational Section */
.educational-section {
  margin-top: 60px;
  margin-bottom: 40px;
  padding: 30px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), var(--glass));
  border-radius: 16px;
  border: 1px solid var(--border);
}

.educational-section h2 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--accent-2);
  font-size: 28px;
  font-weight: 600;
}

.method-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.method-card {
  background: var(--card);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.method-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.method-card h3 {
  color: var(--accent);
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
}

.method-card p {
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  font-size: 14px;
  line-height: 1.5;
}

.method-details {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.method-tag {
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(124, 58, 237, 0.2);
}

/* Grid and Match Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.match {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), var(--glass));
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(2,6,23,0.6);
  transition: transform 0.2s ease;
}

.match:hover {
  transform: translateY(-2px);
}

.match-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.teams {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

.meta {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

/* Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table-compact th {
  font-size: 12px !important;
  color: var(--muted) !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  background: rgba(255,255,255,0.02) !important;
}

/* Override mobile responsive rules for table headers */
@media (max-width: 768px) {
  .table-compact th {
    font-size: 12px !important;
    padding: 10px 8px !important;
  }
}

@media (max-width: 480px) {
  .table-compact th {
    font-size: 12px !important;
    padding: 10px 8px !important;
  }
}


/* Force styling for totals header */
table.table-compact tbody tr.totals-header th {
  background: rgba(255,255,255,0.02);
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Override .header-text class for totals header */
table.table-compact tbody tr.totals-header th.header-text {
  background: rgba(255,255,255,0.02);
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Override mobile responsive rules for totals header */
@media (max-width: 768px) {
  table.table-compact tbody tr.totals-header th {
    font-size: 12px;
    padding: 10px 8px;
  }
  table.table-compact tbody tr.totals-header th.header-text {
    font-size: 12px;
    padding: 10px 8px;
  }
}

@media (max-width: 480px) {
  table.table-compact tbody tr.totals-header th {
    font-size: 12px;
    padding: 10px 8px;
  }
  table.table-compact tbody tr.totals-header th.header-text {
    font-size: 12px;
    padding: 10px 8px;
  }
}

.sep {
  height: 12px;
  border: none;
}

.pct {
  font-weight: 700;
  font-size: 13px;
}

.badge {
  display: inline-block;
  padding: 6px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}

/* Color Rules */
.fav {
  background: linear-gradient(90deg, rgba(124,58,237,0.12), rgba(6,182,212,0.08));
  border: 1px solid rgba(124,58,237,0.12);
  border-radius: 4px;
}

.green {
  color: var(--win);
}

.red {
  color: var(--lose);
}

.orange {
  color: var(--neutral);
}

/* Loading and Error States */
.loading, .error {
  text-align: center;
  margin: 40px 0;
  padding: 30px;
  border-radius: 12px;
}

.loading {
  color: var(--muted);
}

.error {
  color: var(--lose);
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
}

/* Footer */
footer {
  margin-top: 50px;
  color: var(--muted);
  font-size: 14px;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 30px;
  text-align: center;
  line-height: 1.6;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.footer-content h3 {
  color: var(--accent-2);
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: 600;
}

.footer-content p {
  margin-bottom: 15px;
  font-size: 14px;
}

.disclaimer {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 20px;
}

.disclaimer h4 {
  color: var(--muted);
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}

.disclaimer p {
  margin-bottom: 8px;
  font-size: 13px;
}


.table-compact td {
  padding: 8px 6px;
}

/* Error message link styling */
#errorMessage a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

#errorMessage a:hover {
  color: #5eead4;
  border-bottom-color: var(--accent-2);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  
  .title {
    flex-direction: column;
    gap: 10px;
    min-width: auto;
  }
  
  h1 {
    font-size: 20px;
  }
  
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search {
    width: 100%;
    min-width: auto;
  }
  
  .grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .match {
    padding: 16px;
  }
  
  .match-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .meta {
    text-align: left;
  }
  
  .method-cards {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .method-card {
    padding: 20px;
  }
  
  .educational-section {
    padding: 20px;
  }
  
  .educational-section h2 {
    font-size: 24px;
  }
  
  table {
    font-size: 12px;
  }
  
  th, td {
    padding: 8px 4px;
  }
  
  .footer-content {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 10px;
  }
  
  h1 {
    font-size: 18px;
  }
  
  .logo {
    width: 128px;
    height: 48px;
    font-size: 16px;
  }
  
  .match {
    padding: 12px;
  }
  
  .method-card {
    padding: 16px;
  }
  
  .educational-section {
    padding: 15px;
  }
  
  .educational-section h2 {
    font-size: 20px;
  }
  
  table {
    font-size: 11px;
  }
  
  th, td {
    padding: 6px 3px;
  }
  
  .footer-content {
    padding: 15px;
  }
}

/* Print Styles */
@media print {
  .controls, .educational-section, footer {
    display: none;
  }
  
  .container {
    max-width: none;
    padding: 0;
  }
  
  .match {
    break-inside: avoid;
    margin-bottom: 20px;
  }
}
