html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(to bottom, #0a1f44, #000000);
  color: white;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-align: center;
}

.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  box-sizing: border-box;
}

h1 {
  margin-bottom: 3rem;
}

.main-title {
  display: block;
  font-size: 2.6rem;
  font-weight: 400;
  color: #60a5fa;
  letter-spacing: 1px;
}

.sub-title {
  display: block;
  font-size: 1.8rem;
  font-weight: 300;
  color: #93c5fd;
  margin-top: 0.5rem;
  opacity: 0.9;
}

.countdown {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2.5rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  padding: 0 1rem;
  box-sizing: border-box;
  overflow-x: hidden;
}

.time-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  flex: 1 1 auto;
  max-width: 180px;
}

.number {
  font-size: 7rem;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -2px;
  white-space: nowrap;
  color: white;
  animation: subtle-breathe 4s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(255,255,255,0.1);
}

@keyframes subtle-breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.97; }
}

.number.updated {
  animation: gentle-update 0.3s ease-out;
}

@keyframes gentle-update {
  0%   { opacity: 0.6; }
  100% { opacity: 1; }
}

.label {
  font-size: 1.1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #94a3b8;
  margin-top: 0.6rem;
}

.footer {
  font-size: 1rem;
  color: #64748b;
  margin-top: 3rem;
}

/* Small screens: 2×2 grid with better centering */
@media (max-width: 639px) {
  .countdown {
    gap: 2.5rem 2rem;
    justify-content: center;
    padding: 0 1rem;
    max-width: none;
    width: 100%;
  }

  .time-unit {
    min-width: 110px;
    max-width: 160px;
    flex: 1 1 45%;
  }

  .number {
    font-size: 5rem;
    letter-spacing: -2.5px;
  }

  .label {
    font-size: 0.9rem;
    letter-spacing: 2px;
  }

  .main-title { font-size: 2rem; }
  .sub-title  { font-size: 1.4rem; }
}

/* Desktop: force single row, tighter gap */
@media (min-width: 640px) {
  .countdown {
    flex-wrap: nowrap;
    gap: 2rem;
  }
  .time-unit {
    min-width: 0;
  }
}

/* Red flicker state for finished countdown */
.number.finished {
  color: #ff4d4d;           /* bright red */
  animation: slow-red-flicker 3s infinite ease-in-out;
}

@keyframes slow-red-flicker {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.65; }   /* gentle dimming pulse, not too aggressive */
}
