@import url("https://fonts.googleapis.com/css2?family=ZCOOL+KuaiLe&family=Noto+Sans+SC:wght@500;700;900&display=swap");

:root {
  --pink: #ff70b7;
  --pink-dark: #ed4797;
  --purple: #8d68e8;
  --yellow: #ffd96a;
  --mint: #8ce4d3;
  --ink: #563d71;
  --paper: #fffdf8;
  font-family: "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: #fff4fb;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 15%, rgba(255, 255, 255, .95) 0 5%, transparent 5.2%),
    radial-gradient(circle at 85% 22%, rgba(255, 255, 255, .9) 0 4%, transparent 4.2%),
    linear-gradient(155deg, #ffe6f4 0%, #ebe4ff 48%, #dffaff 100%);
}

button, select { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.music-player {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 15;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 205px;
  min-height: 58px;
  padding: 8px 11px 8px 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, .86);
  border: 2px solid rgba(255, 255, 255, .95);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(76, 49, 106, .16);
  backdrop-filter: blur(14px);
  transition: transform .25s ease, box-shadow .25s ease;
}

.music-player:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(76, 49, 106, .2); }

.music-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: white;
  font-size: .82rem;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border: 0;
  border-radius: 50%;
  box-shadow: 0 5px 12px rgba(153, 83, 177, .25);
  cursor: pointer;
}

.music-player.playing .music-toggle { animation: music-pulse 1.8s ease-in-out infinite; }
.music-info { min-width: 0; display: grid; gap: 5px; }

.music-title {
  overflow: hidden;
  font-size: .72rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-player.music-missing .music-title::after { content: " "; color: var(--pink-dark); }

.volume-control { display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 5px; }
.volume-control span { font-size: .72rem; }

.music-volume, #music-volume {
  width: 100%;
  height: 4px;
  margin: 0;
  accent-color: var(--pink);
  cursor: pointer;
}

.sky-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.cloud {
  position: absolute;
  width: 170px;
  height: 55px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  filter: drop-shadow(0 12px 18px rgba(126, 102, 169, .12));
  animation: drift 12s ease-in-out infinite alternate;
}

.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  bottom: 8px;
  border-radius: 50%;
  background: inherit;
}

.cloud::before { width: 78px; height: 78px; left: 25px; }
.cloud::after { width: 92px; height: 92px; right: 24px; }
.cloud-one { top: 11%; left: -45px; }
.cloud-two { top: 64%; right: -60px; animation-delay: -4s; }

.star {
  position: absolute;
  color: var(--yellow);
  text-shadow: 0 3px 0 #fff;
  animation: twinkle 1.8s ease-in-out infinite alternate;
}

.star-one { top: 14%; right: 12%; font-size: 2rem; }
.star-two { top: 48%; left: 7%; font-size: 1.2rem; animation-delay: -.8s; }
.star-three { bottom: 14%; right: 8%; font-size: 1.6rem; animation-delay: -.3s; }

main { position: relative; z-index: 1; }

.screen {
  width: min(1100px, calc(100% - 32px));
  min-height: calc(100vh - 52px);
  margin: 0 auto;
  padding: 42px 0 70px;
}

.quiz-screen {
  display: grid;
  align-content: center;
  gap: 24px;
}

.character-strip {
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  align-items: end;
  gap: 18px;
}

.character-gif {
  width: 180px;
  height: 145px;
  object-fit: cover;
  border: 7px solid white;
  border-radius: 34px 34px 18px 34px;
  box-shadow: 0 16px 36px rgba(97, 70, 139, .2);
  animation: float 3s ease-in-out infinite;
}

.teenie-gif {
  border-radius: 34px 34px 34px 18px;
  animation-delay: -1.5s;
}

.logo-bubble {
  align-self: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  color: white;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border: 5px solid white;
  border-radius: 999px;
  box-shadow: 0 14px 30px rgba(140, 91, 190, .24);
  transform: rotate(-1deg);
}

.logo-bubble strong {
  font-family: "ZCOOL KuaiLe", cursive;
  font-size: clamp(1.35rem, 3vw, 2.25rem);
  letter-spacing: .06em;
}

.quiz-card {
  position: relative;
  width: min(760px, 100%);
  min-height: 420px;
  margin: 0 auto;
  padding: 46px clamp(24px, 6vw, 70px) 50px;
  text-align: center;
  background: rgba(255, 253, 248, .94);
  border: 6px solid white;
  border-radius: 42px;
  box-shadow: 0 24px 60px rgba(91, 64, 125, .2);
}

.quiz-card::before, .quiz-card::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  background: var(--yellow);
  border: 5px solid white;
  border-radius: 50%;
  z-index: -1;
}

.quiz-card::before { left: -25px; bottom: 55px; }
.quiz-card::after { right: -25px; top: 65px; background: var(--mint); }

.progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.progress-dot {
  width: 18px;
  height: 18px;
  border: 3px solid #e0d6eb;
  border-radius: 50%;
  background: white;
  transition: .35s ease;
}

.progress-dot.active { border-color: var(--pink); background: var(--pink); transform: scale(1.2); }
.progress-line { width: 86px; height: 4px; background: #e0d6eb; }

.question-panel { display: none; animation: pop-in .45s ease both; }
.question-panel.active { display: block; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--pink-dark);
  font-size: .88rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  font-family: "ZCOOL KuaiLe", "Noto Sans SC", sans-serif;
  line-height: 1.2;
}

.quiz-card h1, .quiz-card h2 { font-size: clamp(1.8rem, 5vw, 3rem); }
.hint { margin: 14px 0 28px; color: #947fa9; }

.date-selects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}

.date-selects label { display: grid; gap: 7px; text-align: left; font-weight: 800; }

select {
  width: 100%;
  padding: 13px 12px;
  color: var(--ink);
  background: #fff;
  border: 3px solid #eadcf3;
  border-radius: 16px;
  outline: none;
  cursor: pointer;
  transition: .2s ease;
}

select:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255, 112, 183, .16); }

.magic-button {
  min-width: 190px;
  padding: 14px 28px;
  color: white;
  font-weight: 900;
  letter-spacing: .04em;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border: 0;
  border-radius: 999px;
  box-shadow: 0 10px 0 #c54e98, 0 16px 24px rgba(181, 71, 148, .22);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.magic-button:hover { transform: translateY(-3px); box-shadow: 0 13px 0 #c54e98, 0 20px 30px rgba(181, 71, 148, .26); }
.magic-button:active { transform: translateY(7px); box-shadow: 0 3px 0 #c54e98; }

.answer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.answer-card {
  display: grid;
  gap: 10px;
  padding: 22px 12px;
  color: var(--ink);
  font-weight: 900;
  background: white;
  border: 3px solid #eadcf3;
  border-radius: 22px;
  box-shadow: 0 8px 16px rgba(115, 83, 149, .08);
  cursor: pointer;
  transition: .2s ease;
}

.answer-card:hover { transform: translateY(-6px) rotate(-1deg); border-color: var(--pink); box-shadow: 0 14px 22px rgba(255, 112, 183, .18); }
.answer-emoji { font-size: 2.3rem; }

.wrong-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  text-align: center;
  color: white;
  background: rgba(92, 42, 91, .68);
  backdrop-filter: blur(7px);
}

.wrong-overlay[hidden] { display: none; }

.wrong-mark {
  width: min(55vw, 300px);
  height: min(55vw, 300px);
  display: grid;
  place-items: center;
  margin: auto;
  font-size: clamp(11rem, 32vw, 20rem);
  font-weight: 900;
  line-height: .8;
  color: #ff4f73;
  text-shadow: 0 12px 0 white, 0 24px 40px rgba(62, 16, 60, .4);
  animation: wrong-pop .5s cubic-bezier(.18,.89,.32,1.28);
}

.wrong-overlay p { margin-top: 40px; font-size: 1.25rem; font-weight: 900; }

.story-screen {
  --chapter-accent: #ed4797;
  --chapter-soft: #ffe5f3;
  position: relative;
  padding-top: 70px;
}

.story-screen[data-theme="1"] { --chapter-accent: #ff7c67; --chapter-soft: #fff0c9; }
.story-screen[data-theme="2"] { --chapter-accent: #28bda5; --chapter-soft: #d9fff5; }
.story-screen[data-theme="3"] { --chapter-accent: #7f62e8; --chapter-soft: #ece5ff; }
.story-screen[data-theme="4"] { --chapter-accent: #ef5ca8; --chapter-soft: #ffe0f1; }
.story-screen[data-theme="5"] { --chapter-accent: #f39a35; --chapter-soft: #fff1cb; }
.story-screen[data-theme="6"] { --chapter-accent: #438de4; --chapter-soft: #dff3ff; }
.story-screen[data-theme="7"] { --chapter-accent: #7457d5; --chapter-soft: #e6e0ff; }

.story-header { text-align: center; }
.story-header h1 { font-size: clamp(2.5rem, 7vw, 5rem); }
.story-header h1 span { color: var(--chapter-accent); transition: color .4s ease; }
.story-header h1 b { font-weight: inherit; }
.story-header > p:last-child { color: #8e77a5; }

.timeline-line {
  width: 6px;
  height: 86px;
  margin: 24px auto 0;
  background: repeating-linear-gradient(to bottom, var(--chapter-accent) 0 8px, transparent 8px 15px);
  transition: background .4s ease;
}

.unlock-note {
  width: fit-content;
  margin: 12px auto 10px;
  padding: 11px 20px;
  color: white;
  font-family: "ZCOOL KuaiLe", cursive;
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  background: linear-gradient(135deg, #7457d5, #ef5ca8);
  border: 4px solid white;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(94, 68, 156, .22);
  animation: float 2.8s ease-in-out infinite;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 400px));
  justify-content: center;
  gap: clamp(26px, 7vw, 76px);
  padding: 20px 0 50px;
}

.photo-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px 18px 28px;
  color: var(--ink);
  background: #fffdf8;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 22px 40px rgba(78, 55, 103, .22);
  transform: rotate(-2deg);
  cursor: zoom-in;
  transition: transform .25s ease, box-shadow .25s ease;
}

.photo-card.tilted { transform: rotate(2.5deg); margin-top: 42px; }
.photo-card:hover { transform: rotate(0) translateY(-8px); box-shadow: 0 30px 55px rgba(78, 55, 103, .28); }

.tape {
  position: absolute;
  z-index: 2;
  top: -14px;
  left: 50%;
  width: 90px;
  height: 32px;
  background: rgba(255, 222, 108, .78);
  transform: translateX(-50%) rotate(-3deg);
  clip-path: polygon(3% 7%, 98% 0, 94% 100%, 0 91%);
}

.photo-frame {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, var(--chapter-soft), #ddd2ff);
}

.photo-frame img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(16px) saturate(.8);
  transform: scale(1.08);
  transition: filter .35s ease;
}

.missing-photo {
  display: none;
  grid-area: 1 / 1;
  place-self: center;
  padding: 20px;
  color: #8d70a8;
  line-height: 1.7;
}

.photo-card.missing .missing-photo { display: block; }
.photo-card.missing img { display: none; }
.photo-caption { font-family: "ZCOOL KuaiLe", cursive; font-size: 1.25rem; }

.locked-watermark {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 20px;
  color: white;
  font-family: "ZCOOL KuaiLe", cursive;
  font-size: clamp(1.25rem, 4vw, 2rem);
  line-height: 1.45;
  text-shadow: 0 3px 12px rgba(72, 45, 123, .7);
  background: linear-gradient(135deg, rgba(116, 87, 213, .35), rgba(239, 92, 168, .28));
}

.viewed-stamp {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 9px;
  color: #fff;
  font-size: .75rem;
  font-weight: 900;
  background: #62cdb8;
  border-radius: 8px;
  opacity: 0;
  transform: rotate(-8deg) scale(.6);
  transition: .25s ease;
}

.photo-card.viewed .viewed-stamp { opacity: 1; transform: rotate(-8deg) scale(1); }

.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 40px;
  background: rgba(55, 34, 73, .86);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity .32s ease, backdrop-filter .32s ease;
}

.photo-modal[hidden] { display: none; }

.photo-modal.open { opacity: 1; }

.modal-stage {
  display: grid;
  place-items: center;
  transform: translateY(30px) scale(.88);
  opacity: 0;
  transition: transform .42s cubic-bezier(.2, .8, .2, 1), opacity .28s ease;
}

.photo-modal.open .modal-stage { transform: translateY(0) scale(1); opacity: 1; }

.photo-modal img {
  max-width: min(980px, 92vw);
  max-height: 84vh;
  object-fit: contain;
  border: 10px solid white;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}

.modal-blank {
  width: min(900px, 88vw);
  aspect-ratio: 4 / 3;
  max-height: 80vh;
  background: linear-gradient(135deg, #fffdf8, #f8f3ff);
  border: 10px solid white;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}

.close-modal {
  position: fixed;
  top: 18px;
  right: 24px;
  width: 52px;
  height: 52px;
  color: white;
  font-size: 2rem;
  background: var(--pink);
  border: 3px solid white;
  border-radius: 50%;
  cursor: pointer;
}

.next-year-wrap { padding: 18px 0 80px; text-align: center; animation: pop-in .5s ease both; }
.next-year-wrap p { font-weight: 900; }
.next-button { font-size: 1.15rem; }

.final-message {
  width: min(800px, 100%);
  margin: 20px auto 70px;
  padding: clamp(28px, 6vw, 55px);
  text-align: center;
  background: rgba(255, 255, 255, .84);
  border: 5px solid white;
  border-radius: 36px;
  box-shadow: 0 24px 55px rgba(84, 57, 130, .2);
  animation: pop-in .55s ease both;
}

.final-message > span { display: block; font-size: 3rem; animation: twinkle 1.8s ease-in-out infinite alternate; }
.final-message p {
  margin: 14px 0 0;
  color: #654b8c;
  font-family: "ZCOOL KuaiLe", "Noto Sans SC", sans-serif;
  font-size: clamp(1.35rem, 4vw, 2.4rem);
  line-height: 1.5;
}

.year-transition {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  clip-path: circle(0 at 50% 50%);
}

.year-transition span {
  font-size: clamp(7rem, 28vw, 18rem);
  filter: drop-shadow(0 20px 30px rgba(73, 46, 106, .25));
}

.year-transition.active { animation: chapter-reveal 1s ease-in-out both; }
.transition-0 { background: linear-gradient(135deg, #ffd96a, #ff8fc7); }
.transition-1 { background: radial-gradient(circle, #fff3c8, #ff9eae); }
.transition-2 { background: linear-gradient(135deg, #8ce4d3, #8ebdff); }
.transition-3 { background: conic-gradient(from 45deg, #bca8ff, #ffadd5, #8ce4d3, #bca8ff); }

.transition-1 span { animation: transition-bounce .9s ease both; }
.transition-2 span { animation: transition-spin .9s ease both; }
.transition-3 span { animation: transition-zoom .9s ease both; }
.transition-0 span { animation: transition-float .9s ease both; }

.story-screen.chapter-leaving > :not(.year-transition) { animation: chapter-out .4s ease both; }
.story-screen.chapter-entering > :not(.year-transition) { animation: chapter-in .58s cubic-bezier(.2, .8, .2, 1) both; }

@keyframes chapter-reveal {
  0% { opacity: 0; clip-path: circle(0 at 50% 50%); }
  35%, 62% { opacity: 1; clip-path: circle(75% at 50% 50%); }
  100% { opacity: 0; clip-path: circle(75% at 50% 50%); }
}

footer {
  position: relative;
  z-index: 1;
  padding: 14px 20px 24px;
  color: #927fa3;
  font-size: .72rem;
  text-align: center;
}

footer a { color: inherit; }

@keyframes float { 50% { transform: translateY(-10px) rotate(1deg); } }
@keyframes drift { to { transform: translateX(45px) translateY(14px); } }
@keyframes twinkle { to { transform: scale(1.35) rotate(16deg); opacity: .55; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes wrong-pop { from { transform: scale(.15) rotate(-30deg); } }
@keyframes photo-open { from { opacity: 0; transform: scale(.8) rotate(-2deg); } }
@keyframes music-pulse { 50% { transform: scale(1.08); box-shadow: 0 7px 18px rgba(153, 83, 177, .38); } }
@keyframes chapter-out { to { opacity: 0; transform: translateY(-20px) scale(.98); filter: blur(5px); } }
@keyframes chapter-in { from { opacity: 0; transform: translateY(28px) scale(.98); filter: blur(6px); } }
@keyframes transition-bounce { 0% { transform: translateY(-80vh) rotate(-20deg); } 65% { transform: translateY(4vh) rotate(8deg); } }
@keyframes transition-spin { from { transform: scale(.2) rotate(-540deg); } to { transform: scale(1) rotate(0); } }
@keyframes transition-zoom { from { transform: scale(0); } 60% { transform: scale(1.25); } to { transform: scale(1); } }
@keyframes transition-float { from { transform: translateX(-100vw) rotate(-25deg); } to { transform: translateX(0) rotate(0); } }

@media (max-width: 760px) {
  .music-player { top: 8px; left: 8px; width: 174px; min-height: 50px; grid-template-columns: 34px minmax(0, 1fr); padding: 7px; border-radius: 15px; }
  .music-toggle { width: 34px; height: 34px; font-size: .72rem; }
  .music-title { font-size: .65rem; }
  .screen { width: min(100% - 22px, 620px); padding-top: 24px; }
  .character-strip { grid-template-columns: 92px 1fr 92px; gap: 7px; }
  .character-gif { width: 92px; height: 94px; border-width: 4px; border-radius: 22px; }
  .logo-bubble { padding: 13px 10px; gap: 4px; border-width: 3px; }
  .logo-bubble strong { font-size: 1.1rem; }
  .quiz-card { min-height: 470px; padding: 38px 20px; border-radius: 30px; }
  .date-selects { grid-template-columns: 1fr; }
  .answer-grid { grid-template-columns: 1fr; }
  .answer-card { grid-template-columns: auto 1fr; align-items: center; padding: 13px 20px; text-align: left; }
  .answer-emoji { font-size: 1.8rem; }
  .photo-grid { grid-template-columns: minmax(0, 420px); padding-inline: 10px; }
  .photo-card.tilted { margin-top: 6px; }
  .photo-modal { padding: 18px; }
  .story-header h1 { font-size: clamp(2rem, 11vw, 3.5rem); }
  .story-header h1 b { display: block; margin-top: 4px; white-space: nowrap; }
  .final-message { margin-bottom: 40px; border-radius: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
