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

:root {
  --navy: #1A3373;
  --navy-light: #2A4A99;
  --amber: #F5A623;
  --cream: #F8F5EE;
  --green: #2EB872;
}

html, body {
  min-height: 100vh;
  background: var(--navy);
  color: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.hidden { display: none !important; }

.state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

#scoreboard { justify-content: space-between; }

#live-indicator {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 16px);
  right: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4d4d;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(248, 245, 238, 0.2);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 20px;
}

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

.error-msg {
  font-size: 18px;
  max-width: 360px;
  line-height: 1.5;
  opacity: 0.9;
}

.sport-header {
  margin-top: 40px;
  font-size: 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.5px;
}

#sport-emoji { font-size: 28px; }

.scores {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1100px;
  gap: 16px;
  padding: 24px 0;
}

.team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.team-name {
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
  margin-bottom: 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-score {
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
}

.round-badge {
  background: var(--navy-light);
  border: 2px solid var(--amber);
  border-radius: 16px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.round-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
}

#round-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--amber);
}

.winner-banner {
  width: 100%;
  background: var(--green);
  color: white;
  padding: 18px 16px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(46, 184, 114, 0.3);
}

.cta {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: black;
  color: white;
  text-decoration: none;
  padding: 12px 32px;
  border-radius: 12px;
  margin: 16px 0 32px;
  border: 1px solid rgba(255,255,255,0.2);
  transition: transform 0.15s;
}

.cta:active { transform: scale(0.97); }
.cta-small { font-size: 11px; opacity: 0.9; }
.cta-big { font-size: 18px; font-weight: 600; }

@media (min-width: 768px) {
  .team-score { font-size: 144px; letter-spacing: -3px; }
  .team-name { font-size: 28px; }
  .sport-header { font-size: 28px; margin-top: 56px; }
  #sport-emoji { font-size: 36px; }
  .round-badge { padding: 16px 24px; }
  #round-num { font-size: 36px; }
  .round-label { font-size: 13px; }
  .winner-banner { font-size: 28px; padding: 22px; }
}

@media (max-width: 380px) {
  .team-score { font-size: 80px; }
  .team-name { font-size: 16px; }
}
