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

html, body {
  height: 100%;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #08090c;
  color: #f5f5f5;
  min-height: 100dvh;
  max-height: 100dvh;
  overscroll-behavior: none;
}

/* Stadium-style gradient background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(20, 40, 70, 0.4) 0%, transparent 50%),
              radial-gradient(ellipse 80% 120% at 50% 100%, rgba(30, 25, 15, 0.25) 0%, transparent 50%),
              linear-gradient(180deg, #0a0c10 0%, #08090c 100%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ========== HEADER ========== */
.header {
  flex-shrink: 0;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  background: rgba(8, 9, 12, 0.6);
  backdrop-filter: blur(8px);
}

.how-to-btn {
  position: absolute;
  left: 1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #a0a0a0;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: all 0.2s ease;
}

.how-to-btn:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.home-btn {
  position: absolute;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #a0a0a0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
}

.home-btn:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Start screen */
#start-screen {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.start-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
}

.tagline {
  font-size: 1.35rem;
  font-weight: 600;
  font-style: italic;
  color: #c0c0c0;
  letter-spacing: 0.02em;
  margin-bottom: -0.25rem;
  line-height: 1.35;
  text-align: center;
  max-width: 280px;
}

.sport-prompt {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  color: #a0a0a0;
}

.sport-tabs {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.sport-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 5rem;
  min-height: 5.25rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.sport-card-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.sport-card-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.15em;
  color: #fff;
}

.sport-card-badge {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.05rem;
}

/* NFL - field green */
.sport-card--nfl {
  background: linear-gradient(145deg, rgba(16, 70, 40, 0.6) 0%, rgba(8, 45, 25, 0.8) 100%);
  border-color: rgba(34, 139, 34, 0.35);
}

.sport-card--nfl:hover {
  background: linear-gradient(145deg, rgba(20, 85, 50, 0.7) 0%, rgba(12, 55, 32, 0.9) 100%);
  border-color: rgba(34, 139, 34, 0.5);
}

.sport-card--nfl.selected {
  border-color: #22c55e;
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.25) 0%, rgba(22, 163, 74, 0.35) 100%);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

/* NBA - court orange */
.sport-card--nba {
  background: linear-gradient(145deg, rgba(80, 45, 25, 0.6) 0%, rgba(55, 30, 18, 0.8) 100%);
  border-color: rgba(255, 140, 60, 0.35);
}

.sport-card--nba:hover {
  background: linear-gradient(145deg, rgba(100, 55, 30, 0.7) 0%, rgba(70, 38, 22, 0.9) 100%);
  border-color: rgba(255, 140, 60, 0.5);
}

.sport-card--nba.selected {
  border-color: #f59e0b;
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.35) 100%);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

/* MLB - diamond navy/red */
.sport-card--mlb {
  background: linear-gradient(145deg, rgba(30, 40, 80, 0.6) 0%, rgba(20, 28, 60, 0.8) 100%);
  border-color: rgba(220, 80, 60, 0.35);
}

.sport-card--mlb:hover {
  background: linear-gradient(145deg, rgba(40, 50, 90, 0.7) 0%, rgba(28, 36, 70, 0.9) 100%);
  border-color: rgba(220, 80, 60, 0.5);
}

.sport-card--mlb.selected {
  border-color: #dc5040;
  background: linear-gradient(145deg, rgba(220, 80, 60, 0.25) 0%, rgba(180, 60, 50, 0.35) 100%);
  box-shadow: 0 0 20px rgba(220, 80, 60, 0.2);
}

.start-prompt {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.15em;
  color: #a0a0a0;
}

.mode-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  max-width: 300px;
}

.mode-options:has(.mode-card--nfl-only) {
  gap: 0.5rem;
}

.mode-options:has(.mode-card--nfl-only) .mode-card {
  padding: 0.85rem 1.1rem;
}

.mode-options:has(.mode-card--nfl-only) .mode-card-desc,
.mode-options:has(.mode-card--mlb-only) .mode-card-desc {
  font-size: 0.8rem;
}

.mode-card--mlb-only {
  display: none;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.mode-card-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.mode-card-badge--daily {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.mode-card-badge--unlimited {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.mode-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.mode-card.selected {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.mode-card-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.1em;
  color: #f0f0f0;
}

.mode-card.selected .mode-card-title {
  color: #f59e0b;
}

.mode-card-desc {
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.25rem;
}

.mode-card.selected .mode-card-desc {
  color: #b0a060;
}

.start-btn {
  padding: 1rem 3rem;
  font-size: 1.1rem;
  font-weight: 800;
  border: none;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
  transition: all 0.2s ease;
}

.start-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.45);
}

.start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: #fff;
}

/* ========== MODAL ========== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: linear-gradient(180deg, #16181d 0%, #12141a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 340px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.modal h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  color: #fff;
}

.modal p {
  font-size: 0.9rem;
  color: #b0b0b0;
  line-height: 1.6;
  margin-bottom: 0.6rem;
}

.modal p:last-of-type {
  margin-bottom: 1.25rem;
}

.modal-close {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.modal-close:hover {
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.modal-close:active {
  transform: scale(0.98);
}

/* ========== MAIN LAYOUT ========== */
.main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 1.25rem 1.25rem;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: flex;
}

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

/* ========== ROUND SCREEN ========== */
.round-header {
  flex-shrink: 0;
  margin-bottom: 1rem;
  text-align: center;
}

.header-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.position-badge,
.round-badge {
  display: inline-block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  padding: 0.35rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.blitz-timer {
  display: none;
}

.blitz-timer.visible {
  display: inline-block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  padding: 0.35rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.round-instruction {
  font-size: 0.95rem;
  font-weight: 600;
  color: #c0c0c0;
  margin-top: 0.6rem;
}

/* Matchup - player cards */
.matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}

.player {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 1rem 0.75rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.player::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #f59e0b, #d97706);
  border-radius: 4px 0 0 4px;
}

.player-name {
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
  color: #fff;
}

.player-meta {
  font-size: 0.95rem;
  font-weight: 600;
  color: #a8a8a8;
  margin-top: 0.4rem;
}

.vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

/* Stat picks - fill the space */
.stat-picks {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: space-evenly;
}

.stat-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #a0a0a0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.stat-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.stat-btn {
  min-height: 52px;
  padding: 0.65rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  color: #f0f0f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stat-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.stat-btn:active {
  transform: scale(0.98);
}

.stat-btn.selected,
.stat-btn.picked {
  border-color: #3b82f6;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.12) 100%);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.stat-btn .feedback-check {
  margin-left: 0.35rem;
  color: #22c55e;
  font-size: 1em;
}

.stat-btn .feedback-wrong {
  margin-left: 0.35rem;
  color: #ef4444;
  font-size: 1em;
}

.stat-row.revealed .stat-label {
  flex: none;
}

.stat-values {
  font-size: 0.7rem;
  color: #888;
}

/* Confirm button */
.confirm-btn {
  flex-shrink: 0;
  margin-top: 1rem;
  padding: 1rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.03em;
  border: none;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.confirm-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.45);
  transform: translateY(-1px);
}

.confirm-btn:active:not(:disabled) {
  transform: translateY(0);
}

.confirm-btn:disabled {
  background: rgba(255, 255, 255, 0.06);
  color: #666;
  cursor: not-allowed;
  box-shadow: none;
}

/* ========== RESULTS SCREEN ========== */
#results-screen {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.25rem;
  padding: 2rem 1.5rem;
}

.results-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  color: #a0a0a0;
}

.results-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 4rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 24px rgba(255, 255, 255, 0.1);
}

.results-streak {
  font-size: 1rem;
  font-weight: 600;
  color: #f59e0b;
}

.come-back-tomorrow {
  display: none;
  font-size: 1rem;
  font-weight: 600;
  color: #a0a0a0;
}

.come-back-tomorrow.visible {
  display: block;
}

.share-grid {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem;
  border-radius: 12px;
  white-space: pre;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.results-sport-toolbar {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.results-mode-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.results-sport-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.15s ease;
}

.results-sport-pill:hover:not(.coming-soon) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.results-sport-pill.selected {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}

.results-sport-pill.coming-soon {
  opacity: 0.5;
  cursor: default;
}

.results-mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.results-mode-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
}

.share-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.share-btn {
  flex: 1;
  max-width: 140px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
  color: #f0f0f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
}

.new-game-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  border: 2px solid #3b82f6;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
  color: #f0f0f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.new-game-btn:hover {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.3) 0%, rgba(59, 130, 246, 0.15) 100%);
  border-color: #60a5fa;
}

/* Desktop */
@media (min-width: 480px) {
  body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #08090c;
  }

  #app {
    width: 100%;
    max-width: 420px;
    min-height: 600px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}
