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

:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #0f3460;
  --text-primary: #e8e8e8;
  --text-secondary: #a8a8b8;
  --accent: #e94560;
  --accent-hover: #ff6b81;
  --success: #2ecc71;
  --border: #2a2a4a;
  --font-mono: 'Courier New', Courier, monospace;
}

html {
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

header {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--bg-secondary);
  border-bottom: 3px solid var(--accent);
}

header h1 {
  font-size: clamp(1.5rem, 5vw, 3rem);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Countdown */
#countdown-section {
  text-align: center;
  margin-bottom: 3rem;
}

.countdown-grid {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.countdown-unit {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  min-width: 100px;
  border: 1px solid var(--border);
}

.countdown-number {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: bold;
  color: var(--accent);
}

.countdown-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.25rem;
}

.target-date {
  color: var(--text-secondary);
  font-size: 1rem;
}

#season-live {
  font-size: 1.8rem;
  color: var(--success);
  font-weight: bold;
}

/* Team Section */
#team-section {
  margin-bottom: 2rem;
}

#team-section h2 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.team-selector {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.autocomplete-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.autocomplete-wrapper input {
  width: 100%;
  font-size: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.autocomplete-wrapper input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  list-style: none;
  z-index: 100;
  margin: 0;
  padding: 0;
}

.autocomplete-dropdown li {
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  color: var(--text-primary);
}

.autocomplete-dropdown li:hover,
.autocomplete-dropdown li.highlighted {
  background: var(--bg-card);
  color: var(--accent-hover);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Record Display */
.record-display {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.record-display .record-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.record-display .record-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.record-display .stat {
  font-size: 1.1rem;
}

.record-display .stat-value {
  font-weight: bold;
  font-family: var(--font-mono);
  color: var(--accent);
}

/* Schedule Table */
.schedule-display h3 {
  text-align: center;
  margin-bottom: 1rem;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border-radius: 10px;
  overflow: hidden;
}

.schedule-table thead {
  background: var(--bg-card);
}

.schedule-table th,
.schedule-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.schedule-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

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

.schedule-table tr:hover {
  background: rgba(233, 69, 96, 0.1);
}

.game-result.win {
  color: var(--success);
  font-weight: bold;
}

.game-result.loss {
  color: var(--accent);
  font-weight: bold;
}

/* Loading & Error */
.hidden {
  display: none !important;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--text-secondary);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-display {
  text-align: center;
  padding: 1rem;
  background: rgba(233, 69, 96, 0.15);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent-hover);
  margin-top: 1rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

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

/* Responsive */
@media (max-width: 600px) {
  .countdown-unit {
    min-width: 70px;
    padding: 1rem 0.5rem;
  }

  .schedule-table th,
  .schedule-table td {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  .record-display .record-stats {
    gap: 1rem;
  }
}
