html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  background-color: #0f172a;
  color: #e2e8f0;
}

/* Force light text everywhere */
h1, h2, h3, h4, h5, h6 {
  color: #f1f5f9;
}

p, span, small, label, strong, em, div {
  color: inherit;
}

a {
  color: #60a5fa;
}
a:hover {
  color: #93c5fd;
}

.card {
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  background-color: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

.card-header {
  background-color: #334155 !important;
  border-color: #475569;
  color: #f1f5f9 !important;
}

.card-body {
  color: #e2e8f0;
}

.badge {
  font-size: 0.85em;
}

/* Tables */
.table {
  color: #e2e8f0 !important;
  --bs-table-bg: transparent;
  --bs-table-color: #e2e8f0;
  --bs-table-striped-bg: rgba(255,255,255,0.03);
  --bs-table-striped-color: #e2e8f0;
  --bs-table-hover-bg: rgba(255,255,255,0.05);
  --bs-table-hover-color: #f1f5f9;
}

.table-bordered {
  --bs-table-border-color: #334155;
}

.table thead th {
  border-color: #475569 !important;
  color: #94a3b8 !important;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table td {
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

.table td strong {
  color: #f8fafc !important;
}

.table-warning,
.table-warning > td,
.table-warning > th {
  --bs-table-bg: rgba(250, 204, 21, 0.12) !important;
  --bs-table-border-color: #334155;
  --bs-table-color: #fde68a !important;
  color: #fde68a !important;
}

.table-warning td strong {
  color: #fef08a !important;
}

.table-secondary,
.table-secondary > td,
.table-secondary > th {
  --bs-table-bg: rgba(148, 163, 184, 0.1) !important;
  --bs-table-border-color: #334155;
  --bs-table-color: #e2e8f0 !important;
  color: #e2e8f0 !important;
}

.table-secondary td strong {
  color: #f1f5f9 !important;
}

.text-muted {
  color: #94a3b8 !important;
}

.text-dark {
  color: #e2e8f0 !important;
}

/* Forms */
.form-control, .form-select {
  background-color: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}
.form-control:focus, .form-select:focus {
  background-color: #1e293b;
  border-color: #60a5fa;
  color: #f1f5f9;
  box-shadow: 0 0 0 0.2rem rgba(96,165,250,0.25);
}
.form-control::placeholder {
  color: #64748b;
}
.form-control:disabled, .form-select:disabled {
  background-color: #0f172a;
  color: #64748b;
}
.form-label {
  color: #cbd5e1;
}
.form-control-color {
  background-color: #1e293b;
}

/* Alerts */
.alert-info {
  background-color: #1e3a5f;
  border-color: #2563eb;
  color: #93c5fd;
}

.alert-success {
  background-color: #14532d;
  border-color: #22c55e;
  color: #86efac;
}

.alert-danger {
  background-color: #450a0a;
  border-color: #dc2626;
  color: #fca5a5;
}

/* Buttons */
.btn-outline-danger {
  color: #f87171;
  border-color: #f87171;
}
.btn-outline-primary {
  color: #60a5fa;
  border-color: #60a5fa;
}
.btn-outline-secondary {
  color: #94a3b8;
  border-color: #94a3b8;
}

/* Nav */
.nav-link {
  color: #cbd5e1 !important;
}
.nav-link:hover {
  color: #f1f5f9 !important;
}

/* List groups / misc Bootstrap components */
.list-group-item {
  background-color: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

/* Collapse / accordion */
.collapse .card-body,
.collapsing .card-body {
  color: #e2e8f0;
}

/* Hero section */
.hero-section {
  text-align: center;
  padding: 2rem 0 1rem;
}

.hero-logo {
  width: 120px;
  height: 120px;
  animation: fadeInDown 0.8s ease-out;
}

.hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0.5rem 0 0.2rem;
  letter-spacing: 2px;
  animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
  color: #94a3b8;
  font-size: 0.9rem;
  animation: fadeInUp 1s ease-out;
}

/* General ranking podium */
.ranking-card {
  border: 2px solid #22c55e !important;
  background: linear-gradient(135deg, #1a2e1a 0%, #1e293b 100%) !important;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
  margin-bottom: 2rem !important;
}

.ranking-card .card-header {
  background: linear-gradient(90deg, #166534, #15803d) !important;
  border: none;
  font-size: 1.1rem;
  color: #f0fdf4 !important;
  padding: 0.75rem 1rem;
}

.ranking-card .card-body {
  padding: 0.75rem 1rem;
}

.ranking-card .table td {
  color: #f0fdf4 !important;
  padding: 0.6rem 0.5rem;
}

.ranking-row {
  transition: transform 0.2s;
}

.ranking-row:hover {
  transform: scale(1.01);
}

.rank-1 td { font-size: 1.1em; }
.rank-medal {
  font-size: 1.3em;
}

/* Game cards */
.game-card {
  transition: transform 0.15s ease;
  animation: fadeInUp 0.5s ease-out both;
  margin-bottom: 1.5rem !important;
  border-left: 4px solid var(--game-accent) !important;
}

/* Cycling accent colors for game cards */
.game-card:nth-child(6n+1) { --game-accent: #3b82f6; } /* blue */
.game-card:nth-child(6n+2) { --game-accent: #8b5cf6; } /* violet */
.game-card:nth-child(6n+3) { --game-accent: #10b981; } /* emerald */
.game-card:nth-child(6n+4) { --game-accent: #f59e0b; } /* amber */
.game-card:nth-child(6n+5) { --game-accent: #ec4899; } /* pink */
.game-card:nth-child(6n+6) { --game-accent: #06b6d4; } /* cyan */

.game-card .card-body {
  padding: 1rem 1.2rem;
}

.game-card .card-header {
  padding: 0.75rem 1rem;
}

.game-card h6 {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-card .table {
  margin-top: 0.5rem;
}

.game-card:hover {
  transform: translateY(-2px);
}

.game-status {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 20px;
}

.status-complete {
  background-color: #166534;
  color: #86efac;
}

.status-pending {
  background-color: #713f12;
  color: #fde68a;
}

.status-inprogress {
  background-color: #1e3a5f;
  color: #93c5fd;
}

/* Animations */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Stagger animation for game cards */
.game-card:nth-child(1) { animation-delay: 0.1s; }
.game-card:nth-child(2) { animation-delay: 0.2s; }
.game-card:nth-child(3) { animation-delay: 0.3s; }
.game-card:nth-child(4) { animation-delay: 0.4s; }
.game-card:nth-child(5) { animation-delay: 0.5s; }
.game-card:nth-child(6) { animation-delay: 0.6s; }
.game-card:nth-child(7) { animation-delay: 0.7s; }
.game-card:nth-child(8) { animation-delay: 0.8s; }

/* Navbar */
.navbar {
  background-color: #0f172a !important;
  border-bottom: 1px solid #1e293b;
}

/* Bonus flash */
.bonus-flash {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
