:root {
  --bg: #f9f5f6;
  --surface: #ffffff;
  --surface-alt: #fff8fa;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #d90429;
  --primary-dark: #9d0208;
  --focus: #1d4ed8;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --waiting-bg: #fff3cd;
  --waiting-text: #92400e;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #ffe5ec, var(--bg));
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -2.5rem;
  background: #ffffff;
  color: #111827;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  z-index: 99;
}

.skip-link:focus {
  top: 1rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  background: linear-gradient(90deg, var(--primary), #ef233c);
  color: #ffffff;
}

.topbar__link {
  background: #ffffff26;
  color: #ffffff;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 700;
}

.page {
  width: min(1100px, 92%);
  margin: 1.2rem auto 2.8rem;
  display: grid;
  gap: 1.2rem;
}

.hero,
.message-wheel,
.timeline,
.memories {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.hero__eyebrow {
  color: var(--primary);
  font-weight: 700;
  margin: 0;
}

.hero h1 {
  margin: 0.4rem 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.hero__description {
  color: var(--muted);
  margin: 0 0 0.85rem;
}

.hero__next {
  margin: 0;
  background: #112f4e;
  color: #ffffff;
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font-weight: 600;
}

.message-wheel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  background: var(--primary-dark);
  outline: none;
}

.btn:focus-visible,
.topbar__link:focus-visible,
.skip-link:focus-visible {
  box-shadow: 0 0 0 3px var(--focus);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.btn--ghost {
  background: #ffe2e8;
  color: #7f1d1d;
  margin-top: 0.8rem;
}

.message-wheel__result {
  margin-top: 0.75rem;
  border: 1px dashed #f3a6b6;
  border-radius: 10px;
  background: #fff5f8;
  padding: 0.8rem;
  min-height: 3rem;
}

.message-wheel__result.is-loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #fda4af;
  border-top-color: var(--primary);
  display: inline-block;
  margin-right: 0.6rem;
  vertical-align: middle;
  animation: spin 0.8s linear infinite;
}

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

.timeline__grid,
.memories__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.year-card {
  background: var(--surface-alt);
  border: 1px solid #f7cad0;
  border-radius: 12px;
  padding: 0.85rem;
}

.year-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.badge {
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge--ok {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge--pending {
  background: var(--waiting-bg);
  color: var(--waiting-text);
}

.countdown {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.countdown__item {
  min-width: 68px;
  background: #ffffff;
  border: 1px solid #eedde1;
  border-radius: 10px;
  padding: 0.35rem 0.45rem;
  text-align: center;
}

.countdown__value {
  display: block;
  font-weight: 800;
}

.countdown__label {
  color: var(--muted);
  font-size: 0.8rem;
}

.hidden-year {
  display: none;
}

.hidden-year.show {
  display: block;
}

.memory-card {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #f7cad0;
  background: #ffffff;
}

.memory-card__photo {
  min-height: 200px;
  background: linear-gradient(135deg, #ffe5ec, #ffd6e0, #fff0f3);
  position: relative;
}

.memory-card__placeholder {
  min-height: 200px;
  display: grid;
  place-items: center;
  color: #475569;
}

.memory-card__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.memory-card__photo::after {
  content: "🌻";
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 1.2rem;
}

.memory-card__body {
  padding: 0.65rem 0.8rem;
}

.memory-card h3 {
  margin: 0;
}

.memory-card p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

@media (min-width: 740px) {
  .timeline__grid,
  .memories__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .memories__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
