/* ---------- design tokens ---------- */
:root {
  --background: oklch(0.965 0.021 350);
  --foreground: oklch(0.36 0.06 40);
  --card: oklch(0.975 0.012 80);
  --primary: oklch(0.71 0.19 5);
  --primary-foreground: oklch(0.99 0.005 80);
  --muted-foreground: oklch(0.56 0.06 36);
  --accent: oklch(0.57 0.18 358);
  --ink: oklch(0.44 0.06 40);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Karla", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.sr-only {
  font: var(--sans);
  font-size: 1.5rem;
}

.page { position: relative; z-index: 10; width: 100%; }

/* ---------- backdrop ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.backdrop-gradient,
.backdrop-veil {
  position: absolute;
  inset: 0;
}

.backdrop-gradient {
  background: radial-gradient(
    120% 80% at 50% 0%,
    oklch(0.985 0.012 350) 0%,
    oklch(0.955 0.028 350) 45%,
    oklch(0.93 0.045 355) 100%
  );
}

.backdrop-veil {
  background: radial-gradient(
    70% 55% at 50% 45%,
    oklch(0.99 0.008 350 / 0.88) 0%,
    oklch(0.99 0.008 350 / 0.5) 55%,
    transparent 100%
  );
}

.backdrop-blooms img {
  position: absolute;
  user-select: none;
}

/* ---------- flower rain / burst ---------- */
.rain,
.burst {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.rain { z-index: 0; }
.burst { z-index: 50; }

.rain img {
  position: absolute;
  top: 0;
  user-select: none;
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes fall {
  0%   { transform: translate3d(0, -20vh, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  100% {
    transform: translate3d(var(--drift, 0px), 115vh, 0) rotate(var(--spin, 360deg));
    opacity: 0.9;
  }
}

.images {
  display: flex;
  flex-direction: column;
}

.saf {
    background: color-mix(in oklch, var(--card) 70%, transparent);
  backdrop-filter: blur(2px);
  height: 15rem;
  /* width: auto; */
  border: 5px solid pink;
  border-radius: 5px;
  padding: 5px;
  /* position: relative; */
  margin-bottom: 3rem;
}

.line-divider {
  z-index: 6;
    border-bottom: 0.03rem solid #0003;
    width: 100%;
    height: 0;
    position: relative;
    inset: auto 0% 0%;
}

.sticker {
  position: absolute;
  width: 5rem;
  z-index:10;
  /* translate: ; */
}

#chick {
  transform: translate(200px,-375px)
}

#kitty {
  transform: translate(-200px,-150px)
}

#kuromi {
  transform: translate(0,-100px)
}

#hbd {
  transform: translate(0,-100px)
}

#cake {
  transform: translate(260px,00px)

}

#flower {
  transform: translate(200px,100px);
}

#pin {
  transform: translate(-200px,200px);
}

#excla {
  transform: translate(-100px,430px);
}

#swirl {
  transform: translate(190px,200px);
}
/* ---------- lockscreen ---------- */
.lockscreen {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 0 1.5rem;
}

.pixel-heart {
  display: grid;
  animation: heartbeat 1.4s ease-in-out infinite;
}

.pixel-heart span { display: block; }

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.12); }
  50% { transform: scale(0.98); }
}

.dots { display: flex; gap: 0.75rem; }

.dots span {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--muted-foreground) 40%, transparent);
  transition: all 0.2s ease;
}

.dots span.on {
  background: var(--primary);
  transform: scale(1.25);
}

.dots.shake { animation: shake 0.4s ease-in-out; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.keypad button {
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.5rem;
  box-shadow: 0 8px 20px rgba(190, 140, 120, 0.25);
  transition: transform 0.12s ease, background 0.2s ease;
}

.keypad button.small { font-family: var(--sans); font-size: 1.125rem; }
.keypad button:hover { background: color-mix(in oklch, var(--card) 80%, transparent); }
.keypad button:active { transform: scale(0.9); }

/* ---------- shared sections ---------- */
.unlocked {
  position: relative;
  z-index: 10;
  animation: fade-up 0.7s ease-out both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

.section {
  position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 3rem 1.5rem;
}

.section-exception {
    position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 3rem 1.5rem;
}

.heading {
  margin: 0;
  text-align: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  color: var(--ink);
}

.hint {
  margin: 0;
  max-width: 28rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* ---------- puzzle ---------- */
.puzzle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.puzzle-frame {
  border-radius: 1rem;
  padding: 0.5rem;
  background: color-mix(in oklch, var(--card) 70%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgba(200, 120, 140, 0.25);
}

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.25rem;
}
@media (min-width: 640px) { .puzzle-grid button { width: 5rem; height: 5rem; } }
@media (min-width: 768px) { .puzzle-grid button { width: 6rem; height: 6rem; } }

.puzzle-grid button {
  position: relative;
  width: 5rem;
  height: 5rem;
  padding: 0;
  border: 0;
  cursor: pointer;
  overflow: hidden;
  border-radius: 0.375rem;
  background-image: url("./assets/puzzle.jpg");
  background-size: 400%;
  transition: all ease;
}


.puzzle-grid button:active { transform: scale(0.95); }

.puzzle-grid button.selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.puzzle-grid.solved button { border-radius: 0; }

.puzzle-status {
  margin: 0;
  height: 1.5rem;
  font-family: var(--serif);
  font-size: 1.125rem;
  color: var(--primary);
}

/* ---------- letter ---------- */
.letter-card {
  width: 100%;
  max-width: 42rem;
  padding: 2.5rem;
  border-radius: 2px;
  background: color-mix(in oklch, var(--card) 70%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: 0 24px 70px rgba(200, 140, 150, 0.22);
}

@media (min-width: 768px) { .letter-card { padding: 3.5rem; } }

.letter-text {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.125rem, 2.2vw, 1.25rem);
  line-height: 1.75;
  color: var(--foreground);
}

.caret {
  display: inline-block;
  width: 1px;
  height: 1.25rem;
  margin-left: 2px;
  vertical-align: middle;
  background: var(--primary);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }

/* ---------- playlist ---------- */
.playlist {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  width: 100%;
  max-width: 56rem;
}

@media (min-width: 768px) { .playlist { grid-template-columns: repeat(2, 1fr); } }

.song {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 1rem;
  background: color-mix(in oklch, var(--card) 70%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 40px rgba(200, 140, 150, 0.2);
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.song.shown { opacity: 1; transform: none; }

.song .icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  font-size: 1.25rem;
  color: var(--primary);
  background: color-mix(in oklch, var(--primary) 15%, transparent);
}

.song h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--ink);
}

.song .artist { margin: 0; font-size: 0.875rem; color: var(--muted-foreground); }

.song .note {
  margin: 0.25rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--primary);
}

/* ---------- countdown ---------- */
.countdown {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.unit { display: flex; flex-direction: column; align-items: center; }

.unit .value {
  min-width: 5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: color-mix(in oklch, var(--card) 70%, transparent);
  backdrop-filter: blur(8px);
}

.unit .label {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink);
}

.countdown-note {
  max-width: 36rem;
  margin: 0;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.125rem, 2.4vw, 1.25rem);
  color: var(--foreground);
}

.back-btn {
  margin-top: 2rem;
  padding: 0.75rem 2rem;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font-size: 1.125rem;
  font-family: var(--sans);
  color: var(--primary-foreground);
  background: var(--primary);
  box-shadow: 0 10px 30px rgba(255, 92, 138, 0.4);
  transition: transform 0.15s ease;
}

.back-btn:hover { transform: scale(1.05); }
.back-btn:active { transform: scale(0.95); }