/* --- Layout (matches athletic-elf) --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}

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

main.page {
  flex: 1 0 auto;
  margin: 2rem;
  max-width: 100%;
  min-width: 0;
}

.app-footer {
  flex-shrink: 0;
  padding: 1.25rem 2rem 2rem;
  border-top: 1px solid #eee;
  font-size: 0.875rem;
  color: #555;
}

.app-footer-text {
  margin: 0;
  max-width: 48rem;
}

.app-footer a {
  color: #06c;
}

main.page a {
  color: #06c;
}

time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.muted {
  color: #555;
  font-size: 0.9rem;
}

/* --- Countdown page --- */
.countdown-page {
  max-width: 40rem;
}

.countdown-page h1 {
  margin: 0 0 0.75rem 0;
}

.countdown-intro {
  margin: 0 0 2rem 0;
  max-width: 36rem;
  line-height: 1.55;
}

.countdown {
  margin-top: 0.5rem;
}

.countdown-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 6.5rem;
  padding: 1rem 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fafafa;
}

.countdown-value {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: #111;
}

.countdown-label {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.countdown-done {
  margin: 1.5rem 0 0 0;
  font-size: 1.05rem;
}

@media (max-width: 45rem) {
  main.page {
    margin: 1rem 0.75rem;
  }

  .app-footer {
    padding: 1rem 0.75rem 1.5rem;
  }

  h1 {
    font-size: 1.35rem;
    line-height: 1.25;
  }

  .countdown-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 28rem) {
  .countdown-unit {
    min-height: 5.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .countdown-value {
    transition: none;
  }
}
