:root {
  --cream: #fff8ef;
  --cream-deep: #f4e4d9;
  --paper: #fffdf7;
  --rose: #c86d66;
  --rose-dark: #a94d4b;
  --rose-mid: #d98b86;
  --rose-soft: #f3c2cb;
  --rose-pale: #f9d7de;
  --rose-light: #ffe7e5;
  --ink: #2b2630;
  --cat: #2d2830;
  --white: #fffdf8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, .86), transparent 24%),
    linear-gradient(135deg, var(--cream), var(--paper) 48%, var(--cream-deep));
  color: var(--ink);
  font-family: "Courier New", Consolas, monospace;
  image-rendering: pixelated;
}

body:has(.scene.is-locked) {
  background: #020205;
}

button {
  font: inherit;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  background:
    radial-gradient(circle at 50% 43%, rgba(255, 234, 234, .96), rgba(255, 248, 239, .9) 42%, rgba(244, 228, 217, .86)),
    linear-gradient(135deg, var(--paper), var(--cream-deep));
  opacity: 0;
  pointer-events: none;
  transition:
    opacity .22s ease,
    visibility .22s ease;
  visibility: hidden;
}

.loading-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

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

.heart {
  --loader-pixel: clamp(10px, 3.8vw, 20px);
  display: inline-grid;
  grid-template-columns: repeat(13, var(--loader-pixel));
  grid-template-rows: repeat(11, var(--loader-pixel));
  gap: 1px;
  padding: clamp(12px, 4vw, 20px);
  animation: heartbeat 2s infinite ease-in-out;
  filter: drop-shadow(0 18px 26px rgba(169, 77, 75, .22));
}

.pixel {
  width: var(--loader-pixel);
  height: var(--loader-pixel);
  transition: all .3s ease;
  transform: scale(1);
}

.pixel.pink {
  background: #e63946;
  animation: pinkPulse 2.5s infinite ease-in-out;
}

.pixel.soft-pink {
  background: #f1a1b4;
  animation: softPinkPulse 2.2s infinite ease-in-out;
}

.pixel.white {
  background: #ffeaea;
  animation: whitePulse 2.8s infinite ease-in-out;
}

.loading-text {
  margin: 0;
  color: var(--rose-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, .8);
}

.power-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #020205;
  contain: paint layout;
  transition:
    opacity .9s ease,
    visibility .9s ease;
}

.power-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 248, 220, .92), rgba(245, 203, 141, .28) 24%, transparent 62%),
    linear-gradient(135deg, rgba(255, 255, 255, .1), transparent);
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
}

.scene.is-switching .power-gate {
  animation: gateFade 4s cubic-bezier(.18, .72, .2, 1) 1s forwards;
}

.scene.is-switching .power-gate::before {
  animation: steadyGlow 4s cubic-bezier(.18, .72, .2, 1) 1s forwards;
}

.scene.is-ready .power-gate {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.scene.is-locked .intro-gallery,
.scene.is-locked .letter-card,
.scene.is-locked .love-window,
.scene.is-locked .love-window {
  visibility: hidden;
}

.scene.is-switching .intro-gallery {
  visibility: visible;
  opacity: 0;
  filter: blur(24px) brightness(.18);
  animation: contentGlowIn 4s cubic-bezier(.18, .72, .2, 1) 1s forwards;
  will-change: filter, opacity;
}

.scene.is-switching .letter-card,
.scene.is-switching .love-window {
  visibility: hidden;
}

.scene.is-locked .music-card,
.scene.is-switching .music-card {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.scene.is-switching .heart-field,
.scene.is-ready .heart-field {
  display: none !important;
}

.rocker {
  position: relative;
  z-index: 2;
  display: inline-block;
  width: 7em;
  height: 4em;
  overflow: hidden;
  border-bottom: .5em solid #eee;
  color: transparent;
  cursor: pointer;
  font-size: 2em;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, .48));
}

.rocker-small {
  margin: 1em;
  font-size: .9em;
}

.scene.is-switching .rocker {
  animation: switchVanish .62s ease forwards;
}

.rocker::before {
  content: "";
  position: absolute;
  inset: .5em 0 0;
  border: .5em solid #eee;
  border-bottom: 0;
  background-color: #999;
}

.rocker input {
  width: 0;
  height: 0;
  opacity: 0;
}

.rocker:focus-within {
  outline: 3px solid rgba(255, 240, 166, .78);
  outline-offset: 8px;
}

.switch-left,
.switch-right {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3em;
  height: 2.5em;
  cursor: pointer;
  transition:
    left .2s ease,
    right .2s ease,
    bottom .2s ease,
    width .2s ease,
    height .2s ease,
    transform .2s ease,
    background-color .2s ease;
  user-select: none;
}

.switch-left {
  left: .85em;
  bottom: .4em;
  width: 2.75em;
  height: 2.4em;
  background-color: #ddd;
  transform: rotate(15deg) skewX(15deg);
}

.switch-right {
  right: .5em;
  bottom: 0;
  background-color: #bd5757;
}

.switch-left::before,
.switch-right::before {
  content: "";
  position: absolute;
  bottom: -.45em;
  width: .4em;
  height: 2.45em;
  background-color: #ccc;
  transform: skewY(-65deg);
}

.switch-left::before {
  left: -.4em;
}

.switch-right::before {
  right: -.375em;
  background-color: transparent;
  transform: skewY(65deg);
}

.rocker input:checked + .switch-left {
  left: .5em;
  bottom: 0;
  width: 3em;
  height: 2.5em;
  background-color: #0084d0;
  transform: rotate(0deg) skewX(0deg);
}

.rocker input:checked + .switch-left::before {
  width: 3.0833em;
  background-color: transparent;
}

.rocker input:checked + .switch-left + .switch-right {
  right: .8em;
  bottom: .4em;
  width: 2.75em;
  height: 2.4em;
  background-color: #ddd;
  transform: rotate(-15deg) skewX(-15deg);
}

.rocker input:checked + .switch-left + .switch-right::before {
  background-color: #ccc;
}

.music-card {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  transition:
    right .38s cubic-bezier(.2, .9, .28, 1),
    bottom .38s cubic-bezier(.2, .9, .28, 1),
    width .38s cubic-bezier(.2, .9, .28, 1),
    height .38s cubic-bezier(.2, .9, .28, 1),
    padding .38s cubic-bezier(.2, .9, .28, 1),
    transform .38s cubic-bezier(.2, .9, .28, 1),
    box-shadow .22s ease;
}

.card {
  width: 260px;
  height: 138px;
  border: 3px solid rgba(200, 109, 102, .42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, .96), rgba(255, 231, 229, .94));
  box-shadow:
    7px 7px 0 rgba(169, 77, 75, .18),
    0 16px 26px rgba(43, 38, 48, .14);
  padding: 10px;
  color: var(--rose-dark);
  overflow: hidden;
}

.music-card:focus-visible {
  outline: 4px solid var(--rose-dark);
  outline-offset: 6px;
}

.music-card.is-compact {
  right: 50%;
  bottom: 12px;
  width: 184px;
  height: 48px;
  padding: 6px 10px;
  cursor: pointer;
  transform: translateX(50%);
  box-shadow:
    5px 5px 0 rgba(169, 77, 75, .18),
    0 10px 20px rgba(43, 38, 48, .12);
}

.top {
  position: relative;
  display: flex;
  width: 100%;
  gap: 10px;
  transition: gap .25s ease;
}

.music-card.is-compact .top {
  align-items: center;
  gap: 7px;
}

.pfp {
  position: relative;
  top: 5px;
  left: 5px;
  display: flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(200, 109, 102, .38);
  border-radius: 5px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .9), transparent 32%),
    linear-gradient(135deg, #fffdf8, #ffe0e4);
  box-shadow: 3px 3px 0 rgba(169, 77, 75, .16);
  transition:
    width .3s ease,
    height .3s ease,
    top .3s ease,
    left .3s ease;
}

.music-card.is-compact .pfp {
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
}

.title-1 {
  max-width: 182px;
  margin: 2px 0 0 5px;
  overflow: hidden;
  color: var(--rose-dark);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, .82);
  transition:
    max-width .25s ease,
    margin .25s ease,
    font-size .25s ease;
}

.music-card.is-compact .title-1 {
  max-width: 118px;
  margin: 0;
  font-size: 14px;
  line-height: 1.1;
}

.title-2 {
  max-width: 182px;
  margin: 0 0 0 5px;
  overflow: hidden;
  color: rgba(43, 38, 48, .74);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    max-width .25s ease,
    margin .25s ease,
    font-size .25s ease,
    opacity .2s ease;
}

.music-card.is-compact .title-2 {
  max-width: 118px;
  margin: 2px 0 0;
  font-size: 9px;
}

.time {
  position: absolute;
  left: 5%;
  bottom: 28px;
  display: block;
  width: 90%;
  height: 6px;
  border: 0;
  border-radius: 3px;
  background-color: rgba(169, 77, 75, .22);
  cursor: pointer;
  padding: 0;
  transition:
    opacity .18s ease,
    transform .22s ease;
}

.music-card.is-compact .time {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.elapsed {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 3px;
  background-color: var(--rose);
}

.controls {
  position: absolute;
  bottom: 43px;
  left: 0;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--rose-dark);
  transition:
    opacity .18s ease,
    transform .22s ease;
}

.music-card.is-compact .controls {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.music-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  transition: color .1s;
}

.play-toggle {
  width: 32px;
  height: 32px;
}

.music-icon:hover,
.music-icon:focus-visible {
  color: #ef5da8;
  outline: 0;
}

.play-icon,
.music-card.is-paused .pause-icon {
  display: none;
}

.music-card.is-paused .play-icon {
  display: block;
}

.volume {
  position: relative;
  width: 42px;
  height: 18px;
  margin-right: 2px;
  opacity: 0;
  transition: opacity .2s;
}

.volume input {
  position: absolute;
  inset: -7px 0;
  z-index: 2;
  width: 100%;
  cursor: pointer;
  opacity: 0;
}

.air {
  width: 42px;
  height: 100%;
}

.volume .slider {
  display: block;
  width: 80%;
  height: 4px;
  margin-top: 7px;
  margin-left: 10%;
  border-radius: 2px;
  background-color: rgba(169, 77, 75, .22);
}

.volume .slider .green {
  display: block;
  width: 50%;
  height: 100%;
  border-radius: 3px;
  background-color: var(--rose);
}

.volume .circle {
  position: absolute;
  top: 5px;
  left: calc(10% + 40% - 3px);
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background-color: var(--rose-dark);
}

.volume_button:hover ~ .volume,
.volume_button:focus-visible ~ .volume,
.volume:hover,
.volume:focus-within {
  opacity: 1;
}

.timetext {
  position: absolute;
  margin: 0;
  color: var(--rose-dark);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, .74);
  transition: opacity .18s ease;
}

.music-card.is-compact .timetext {
  opacity: 0;
}

.time_now {
  bottom: 13px;
  left: 13px;
}

.time_full {
  right: 13px;
  bottom: 13px;
}

.playing {
  position: relative;
  display: flex;
  width: 30px;
  height: 20px;
  justify-content: center;
  gap: 1px;
  transition: transform .25s ease;
}

.music-card.is-compact .playing {
  transform: scale(.78);
}

.greenline {
  position: relative;
  width: 2px;
  height: 20px;
  background-color: var(--rose);
  transform-origin: bottom;
}

.line-1 {
  animation: infinite playing 1s ease-in-out;
  animation-delay: .2s;
}

.line-2 {
  animation: infinite playing 1s ease-in-out;
  animation-delay: .5s;
}

.line-3 {
  animation: infinite playing 1s ease-in-out;
  animation-delay: .6s;
}

.line-4 {
  animation: infinite playing 1s ease-in-out;
  animation-delay: 0s;
}

.line-5 {
  animation: infinite playing 1s ease-in-out;
  animation-delay: .4s;
}

.music-card.is-paused .greenline {
  animation-play-state: paused;
  transform: scaleY(.18);
}

.scene {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.heart-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: .76;
  contain: paint layout;
  will-change: filter, opacity;
}

.heart-field::before {
  content: "";
  position: absolute;
  inset: -240px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='200' viewBox='0 0 240 200'%3E%3Cg fill='%23a94d4b'%3E%3Crect x='13' y='8' width='2' height='2'/%3E%3Crect x='17' y='8' width='2' height='2'/%3E%3Crect x='11' y='10' width='2' height='2'/%3E%3Crect x='15' y='10' width='2' height='2'/%3E%3Crect x='19' y='10' width='2' height='2'/%3E%3Crect x='13' y='12' width='6' height='2'/%3E%3Crect x='15' y='14' width='2' height='2'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='200' viewBox='0 0 240 200'%3E%3Cg fill='%23c86d66'%3E%3Crect x='158' y='123' width='2' height='2'/%3E%3Crect x='162' y='123' width='2' height='2'/%3E%3Crect x='156' y='125' width='2' height='2'/%3E%3Crect x='160' y='125' width='2' height='2'/%3E%3Crect x='164' y='125' width='2' height='2'/%3E%3Crect x='158' y='127' width='6' height='2'/%3E%3Crect x='160' y='129' width='2' height='2'/%3E%3C/g%3E%3C/svg%3E");
  background-position: 0 0, 120px 100px;
  background-size: 240px 200px, 240px 200px;
  animation: heartDrift 32s linear infinite;
  will-change: transform;
}

.intro-gallery {
  position: absolute;
  display: grid;
  width: min(840px, calc(100vw - 28px));
  height: min(580px, calc(100vh - 28px));
  place-items: center;
  z-index: 5;
}

.intro-gallery.is-hidden {
  display: none;
}

.intro-stack {
  position: relative;
  width: min(360px, 88vw);
  aspect-ratio: 4 / 5.85;
  transition: transform .22s ease;
  contain: layout style;
}

.intro-stack:hover {
  transform: rotate(1.5deg) translateY(-3px);
}

.post-card {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(43, 38, 48, .16);
  border-radius: 8px;
  background: #fff;
  box-shadow:
    0 18px 34px rgba(169, 77, 75, .18),
    0 4px 0 rgba(43, 38, 48, .08);
  opacity: 0;
  pointer-events: none;
  transform:
    translateY(var(--stack-y, 0))
    scale(var(--stack-scale, 1))
    rotate(var(--tilt, 0deg));
  transform-origin: center;
  transition:
    opacity .18s ease,
    transform .24s cubic-bezier(.2, .9, .28, 1);
  will-change: transform, opacity;
  contain: layout style paint;
}

.post-card.is-active,
.post-card.is-next,
.post-card.is-third {
  opacity: 1;
}

.post-card.is-active {
  z-index: 7;
  pointer-events: auto;
  --stack-y: 0;
  --stack-scale: 1;
}

.post-card.is-next {
  z-index: 6;
  --stack-y: 11px;
  --stack-scale: .965;
}

.post-card.is-third {
  z-index: 5;
  --stack-y: 22px;
  --stack-scale: .93;
}

.post-card.is-exiting {
  opacity: 0;
  pointer-events: none;
  transform:
    translate3d(var(--exit-x, 130vw), var(--exit-y, -14vh), 0)
    rotate(var(--exit-rotate, 22deg))
    scale(.92);
  transition:
    opacity .34s ease,
    transform .58s cubic-bezier(.58, -.12, .44, 1);
}

.post-hitbox {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  text-align: left;
  touch-action: manipulation;
}

.post-hitbox:focus-visible {
  outline: 4px solid var(--rose-dark);
  outline-offset: 8px;
}

.post-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid rgba(43, 38, 48, .11);
  padding: 9px 12px;
}

.profile-dot {
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 50%;
  background:
    linear-gradient(135deg, var(--accent), #ffd7e4 58%, #ffe8b3);
  box-shadow: 0 0 0 2px var(--accent);
}

.profile-name,
.post-count {
  font-size: 12px;
  font-weight: 900;
}

.post-menu {
  color: rgba(43, 38, 48, .68);
  font-size: 16px;
  line-height: 1;
}

.post-photo {
  position: relative;
  display: grid;
  aspect-ratio: 1 / 1;
  margin: 0;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(43, 38, 48, .1);
  background-color: #f0eef3;
  background-size: cover;
  background-position: center;
}

.post-photo::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px dashed rgba(255, 255, 255, .72);
  border-radius: 4px;
}

.post-photo span {
  position: relative;
  display: inline-grid;
  min-width: 108px;
  min-height: 36px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 999px;
  background: rgba(255, 255, 255, .68);
  color: rgba(43, 38, 48, .72);
  font-size: 13px;
  font-weight: 900;
}

.photo-one {
  background-image:
    radial-gradient(circle at 28% 26%, rgba(255, 255, 255, .86) 0 9%, transparent 10%),
    linear-gradient(145deg, #ef5da8, #f7b2c4 48%, #fff2a8);
}

.photo-two {
  background-image:
    radial-gradient(circle at 72% 28%, rgba(255, 255, 255, .78) 0 8%, transparent 9%),
    linear-gradient(135deg, #ff7a59, #ffd166 45%, #fef7dc);
}

.photo-three {
  background-image:
    radial-gradient(circle at 30% 72%, rgba(255, 255, 255, .82) 0 10%, transparent 11%),
    linear-gradient(145deg, #43b0f1, #bde7ff 48%, #fffdf7);
}

.photo-four {
  background-image:
    radial-gradient(circle at 62% 34%, rgba(255, 255, 255, .82) 0 9%, transparent 10%),
    linear-gradient(135deg, #8e6df7, #f0b6ff 48%, #ffe4ea);
}

.photo-five {
  background-image:
    radial-gradient(circle at 35% 32%, rgba(255, 255, 255, .82) 0 10%, transparent 11%),
    linear-gradient(145deg, #24b47e, #9ce7c6 46%, #fff1bd);
}

.post-footer {
  min-height: 112px;
  padding: 10px 12px 13px;
}

.post-actions {
  display: inline-block;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.post-count {
  float: right;
  color: rgba(43, 38, 48, .6);
  line-height: 1.7;
}

.post-footer p {
  clear: both;
  margin: 9px 0 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.letter-card {
  position: absolute;
  display: grid;
  width: min(840px, calc(100vw - 28px));
  height: min(520px, calc(100vh - 28px));
  place-items: center;
  border: 4px solid rgba(255, 255, 255, .86);
  border-radius: 8px;
  background: rgba(255, 248, 239, .72);
  box-shadow: 0 18px 0 rgba(169, 77, 75, .1);
  z-index: 2;
}

.letter-card.is-hidden {
  display: none;
}

.letter-seal {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: 700 16px/1.2 "Courier New", Consolas, monospace;
  transform: translateY(-4px);
  animation: floaty 1.8s ease-in-out infinite;
}

.letter-seal:hover .envelope,
.letter-seal:focus-visible .envelope {
  transform: translateY(-6px) rotate(-2deg);
}

.letter-seal:focus-visible {
  outline: 4px solid var(--rose-dark);
  outline-offset: 8px;
}

.envelope {
  position: relative;
  display: block;
  width: 130px;
  height: 100px;
  margin: 0 auto 14px;
  transition: transform .16s steps(2, end);
}

.envelope-art {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.envelope-shadow {
  fill: rgba(169, 77, 75, .35);
}

.envelope-body {
  fill: #ffe7dc;
  stroke: var(--rose);
  stroke-linejoin: miter;
  stroke-width: 7;
}

.envelope-fold {
  fill: none;
  stroke: var(--rose);
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 6;
}

.envelope-flap-shape {
  fill: #ffd6d7;
  stroke: var(--rose);
  stroke-linejoin: miter;
  stroke-width: 6;
}

.envelope-heart-icon {
  fill: var(--rose-dark);
  transform: translate(45px, 44px) scale(2.45);
  transform-box: fill-box;
  transform-origin: 0 0;
}

.cat-heart,
.window-hearts span,
.burst-heart,
.tiny-heart {
  position: absolute;
  background: var(--rose-dark);
  transform: rotate(45deg);
}

.cat-heart::before,
.cat-heart::after,
.window-hearts span::before,
.window-hearts span::after,
.burst-heart::before,
.burst-heart::after,
.tiny-heart::before,
.tiny-heart::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.seal-text {
  text-shadow: 2px 2px 0 var(--white);
}

.love-window {
  position: relative;
  width: min(464px, calc(100vw - 28px));
  min-height: 374px;
  border: 8px solid var(--rose);
  background: var(--rose-pale);
  box-shadow:
    9px 9px 0 rgba(169, 77, 75, .35),
    -4px -4px 0 rgba(255, 255, 255, .7) inset;
  transform-origin: center;
  animation: popIn .48s steps(4, end);
  z-index: 3;
}

.love-window.is-hidden {
  display: none;
}

.window-bar {
  display: flex;
  height: 45px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 6px solid var(--rose);
  background: #f1c0ce;
  padding: 0 10px;
}

.window-title {
  color: var(--rose);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 4px;
  text-shadow: 4px 0 0 rgba(200, 109, 102, .45);
}

.window-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.window-controls span {
  display: block;
  width: 20px;
  height: 15px;
  border: 5px solid var(--rose);
}

.window-controls .minimize {
  height: 5px;
  border-width: 0 0 5px;
}

.window-controls .close {
  position: relative;
  border: 0;
}

.window-controls .close::before,
.window-controls .close::after {
  content: "";
  position: absolute;
  left: 7px;
  top: -1px;
  width: 6px;
  height: 20px;
  background: var(--rose);
}

.window-controls .close::before {
  transform: rotate(45deg);
}

.window-controls .close::after {
  transform: rotate(-45deg);
}

.window-hearts {
  position: relative;
  display: flex;
  justify-content: space-around;
  height: 72px;
  padding: 19px 60px 0;
  border-bottom: 6px solid var(--rose);
}

.window-hearts span {
  position: relative;
  width: 27px;
  height: 27px;
  background: var(--rose);
  animation: pulse 1.35s ease-in-out infinite;
}

.window-hearts span:nth-child(2) {
  animation-delay: .2s;
}

.window-hearts span:nth-child(3) {
  animation-delay: .4s;
}

.window-hearts span::before,
.window-hearts span::after {
  width: 27px;
  height: 27px;
}

.window-hearts span::before {
  left: -13px;
}

.window-hearts span::after {
  top: -13px;
}

.window-body {
  position: relative;
  min-height: 253px;
  overflow: hidden;
  padding: 15px 20px 25px;
  background-color: #f8ccd5;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, .28) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, .28) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, .28) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, .28) 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  text-align: center;
}

h1 {
  position: relative;
  z-index: 4;
  max-width: 100%;
  margin: 0 auto 7px;
  font-size: clamp(13px, 3.45vw, 17px);
  font-weight: 900;
  line-height: 1.4;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, .7);
}

.cat-stage {
  position: relative;
  height: 134px;
  margin: 2px auto 8px;
}

.pixel-cat {
  position: absolute;
  top: 2px;
  left: 50%;
  display: block;
  width: min(128px, 40vw);
  height: 126px;
  object-fit: contain;
  object-position: center;
  transform: translateX(-50%);
  image-rendering: auto;
  content-visibility: auto;
}

.cat-face {
  position: absolute;
  top: 12px;
  left: 24px;
  width: 60px;
  height: 52px;
  border-radius: 10px 10px 6px 6px;
  background: var(--cat);
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, .18),
    0 4px 0 rgba(0, 0, 0, .12);
  z-index: 3;
}

.cat-ear {
  position: absolute;
  top: 5px;
  width: 24px;
  height: 24px;
  background: var(--cat);
  transform: rotate(45deg);
  z-index: 2;
}

.cat-ear.left {
  left: 23px;
}

.cat-ear.right {
  right: 20px;
}

.cat-ear::after {
  content: "";
  position: absolute;
  inset: 7px;
  background: #f2a6b2;
}

.cat-eye {
  position: absolute;
  top: 18px;
  width: 15px;
  height: 15px;
  border: 3px solid var(--white);
  background: #19161c;
  animation: blink 4s steps(1, end) infinite;
}

.cat-eye.left {
  left: 11px;
}

.cat-eye.right {
  right: 11px;
}

.cat-eye::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 4px;
  height: 4px;
  background: var(--white);
}

.cat-nose {
  position: absolute;
  top: 34px;
  left: 27px;
  width: 7px;
  height: 6px;
  background: #ffc9d1;
}

.cat-mouth {
  position: absolute;
  top: 43px;
  left: 22px;
  width: 20px;
  height: 5px;
  border-bottom: 3px solid var(--white);
}

.cat-body {
  position: absolute;
  top: 58px;
  left: 31px;
  width: 50px;
  height: 58px;
  border-radius: 18px 18px 8px 8px;
  background: var(--cat);
  z-index: 2;
}

.cat-paw {
  position: absolute;
  top: 82px;
  width: 13px;
  height: 20px;
  border-radius: 8px;
  background: var(--cat);
  z-index: 6;
}

.cat-paw.left {
  left: 36px;
  transform: rotate(-18deg);
}

.cat-paw.right {
  right: 36px;
  transform: rotate(18deg);
}

.cat-tail {
  position: absolute;
  top: 58px;
  right: 8px;
  width: 19px;
  height: 56px;
  border: 10px solid var(--cat);
  border-bottom: 0;
  border-left: 0;
  border-radius: 0 27px 0 0;
  transform-origin: bottom left;
  animation: tailWiggle 1s steps(3, end) infinite;
}

.cat-heart {
  top: 76px;
  left: 33px;
  width: 38px;
  height: 38px;
  background: #a84d48;
  animation: heartBeat .9s ease-in-out infinite;
  z-index: 5;
}

.cat-heart::before,
.cat-heart::after {
  width: 38px;
  height: 38px;
}

.cat-heart::before {
  left: -19px;
}

.cat-heart::after {
  top: -19px;
}

.buttons {
  z-index: 8;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.pixel-btn {
  min-width: 68px;
  height: 40px;
  border: 5px solid var(--rose);
  background: var(--rose-light);
  color: var(--rose);
  cursor: pointer;
  font: 900 17px/1 "Courier New", Consolas, monospace;
  box-shadow: 5px 5px 0 rgba(169, 77, 75, .32);
  transition: transform .08s steps(2, end), box-shadow .08s steps(2, end);
  touch-action: manipulation;
}

.pixel-btn:hover,
.pixel-btn:focus-visible {
  background: var(--white);
  outline: 0;
  transform: translate(-2px, -2px);
}

.pixel-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 rgba(169, 77, 75, .32);
}

.yes-btn {
  position: relative;
  z-index: 10;
}

.yes-btn::after {
  content: "";
  position: absolute;
  inset: -9px;
}

.no-btn {
  position: relative;
  z-index: 9;
}

.no-btn.is-running {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  transform:
    translate3d(var(--no-x, 50vw), var(--no-y, 50vh), 0)
    rotate(var(--no-rotate, 0deg))
    scale(var(--no-scale, 1));
  transition:
    transform .42s cubic-bezier(.2, 1.05, .34, 1),
    background-color .12s steps(2, end);
  will-change: transform;
}

.no-btn.is-teasing {
  animation: tease .32s steps(2, end);
}

.final-text {
  position: relative;
  z-index: 4;
  max-width: 96%;
  margin: 8px auto 0;
  padding: 8px 10px;
  border: 4px solid rgba(200, 109, 102, .55);
  background: rgba(255, 255, 255, .76);
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 900;
  line-height: 1.35;
  box-shadow: 4px 4px 0 rgba(169, 77, 75, .16);
}

.love-window.is-success h1 {
  font-size: clamp(18px, 5vw, 25px);
}

.love-window.is-success .window-body {
  min-height: 262px;
}

.love-window.is-success .pixel-cat {
  top: 3px;
  width: min(116px, 38vw);
  height: 126px;
}

.burst-heart {
  position: fixed;
  left: var(--x);
  top: var(--y);
  width: 14px;
  height: 14px;
  pointer-events: none;
  background: var(--rose-dark);
  animation: burst .95s ease-out forwards;
  z-index: 99;
}

.burst-heart::before,
.burst-heart::after {
  width: 14px;
  height: 14px;
}

.burst-heart::before {
  left: -7px;
}

.burst-heart::after {
  top: -7px;
}

.tiny-heart {
  width: 10px;
  height: 10px;
  opacity: .85;
  animation: tinyFloat 1.4s ease-out forwards;
  z-index: 4;
}

.tiny-heart::before,
.tiny-heart::after {
  width: 10px;
  height: 10px;
}

.tiny-heart::before {
  left: -5px;
}

.tiny-heart::after {
  top: -5px;
}

@keyframes drift {
  to {
    background-position: 240px 200px, 360px 300px;
  }
}

@keyframes heartDrift {
  to {
    transform: translate3d(240px, 200px, 0);
  }
}

@keyframes steadyGlow {
  from {
    opacity: 0;
  }
  to {
    opacity: .72;
  }
}

@keyframes gateFade {
  from {
    opacity: 1;
  }
  42% {
    opacity: .72;
  }
  72% {
    opacity: .32;
  }
  to {
    visibility: hidden;
    opacity: 0;
  }
}

@keyframes switchVanish {
  45% {
    transform: translateY(3px) scale(.98);
    opacity: 1;
  }
  to {
    transform: translateY(10px) scale(.88);
    opacity: 0;
  }
}

@keyframes contentGlowIn {
  from {
    opacity: 0;
    filter: blur(24px) brightness(.18);
  }
  35% {
    opacity: .28;
    filter: blur(20px) brightness(.34);
  }
  64% {
    opacity: .68;
    filter: blur(12px) brightness(.64);
  }
  84% {
    opacity: .9;
    filter: blur(4px) brightness(.88);
  }
  to {
    opacity: 1;
    filter: blur(0) brightness(1);
  }
}

@keyframes roomGlow {
  from {
    opacity: 0;
    filter: blur(18px) brightness(.18);
  }
  58% {
    opacity: .38;
    filter: blur(12px) brightness(.56);
  }
  84% {
    opacity: .66;
    filter: blur(4px) brightness(.86);
  }
  to {
    opacity: .76;
    filter: blur(0) brightness(1);
  }
}

@keyframes floaty {
  50% {
    transform: translateY(8px);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(.72);
  }
  70% {
    transform: scale(1.05);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  50% {
    transform: rotate(45deg) scale(1.12);
  }
}

@keyframes heartBeat {
  50% {
    transform: rotate(45deg) scale(1.1);
  }
}

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

@keyframes pinkPulse {
  0%,
  100% {
    background: #ff6b81;
    transform: scale(1);
    box-shadow: 0 0 0 rgba(230, 57, 70, 0);
  }
  50% {
    background: #e63946;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(230, 57, 70, .6);
  }
}

@keyframes softPinkPulse {
  0%,
  100% {
    background: #e63946;
    transform: scale(1);
    box-shadow: 0 0 0 rgba(241, 161, 180, 0);
  }
  50% {
    background: #f1a1b4;
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(241, 161, 180, .6);
  }
}

@keyframes whitePulse {
  0%,
  100% {
    background: #ffe3e3;
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 234, 234, 0);
  }
  50% {
    background: #ffeaea;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 234, 234, .8);
  }
}

@keyframes catBob {
  50% {
    transform: translateX(-50%) translateY(5px);
  }
}

@keyframes blink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }
  94% {
    transform: scaleY(.1);
  }
}

@keyframes tailWiggle {
  50% {
    transform: rotate(12deg);
  }
}

@keyframes celebrate {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateX(-50%) translateY(-9px) rotate(4deg);
  }
}

@keyframes successHeart {
  50% {
    transform: translateY(-5px) scale(1.2);
  }
}

@keyframes tease {
  50% {
    filter: hue-rotate(25deg);
  }
}

@keyframes burst {
  to {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) rotate(45deg) scale(.45);
  }
}

@keyframes tinyFloat {
  to {
    opacity: 0;
    transform: translateY(-70px) rotate(45deg) scale(.4);
  }
}

@keyframes playing {
  0% {
    transform: scaleY(.1);
  }

  33% {
    transform: scaleY(.6);
  }

  66% {
    transform: scaleY(.9);
  }

  100% {
    transform: scaleY(.1);
  }
}

@media (max-width: 520px) {
  .scene {
    padding: 12px;
  }

  .music-card {
    right: 50%;
    bottom: 10px;
    transform: translateX(50%) scale(.88);
    transform-origin: bottom center;
  }

  .music-card.is-compact {
    bottom: 8px;
    transform: translateX(50%) scale(.88);
  }

  .intro-gallery {
    height: min(560px, calc(100vh - 24px));
  }

  .intro-stack {
    width: min(330px, 90vw);
  }

  .post-header {
    min-height: 44px;
  }

  .profile-dot {
    width: 26px;
    height: 26px;
  }

  .post-footer {
    min-height: 104px;
  }

  .letter-card {
    height: min(500px, calc(100vh - 24px));
  }

  .love-window {
    min-height: 344px;
    border-width: 6px;
  }

  .window-bar {
    height: 40px;
  }

  .window-title {
    font-size: 22px;
  }

  .window-controls {
    gap: 5px;
  }

  .window-controls span {
    width: 16px;
    height: 13px;
    border-width: 4px;
  }

  .window-hearts {
    height: 62px;
    padding-inline: 42px;
  }

  .window-hearts span {
    width: 22px;
    height: 22px;
  }

  .window-hearts span::before,
  .window-hearts span::after {
    width: 22px;
    height: 22px;
  }

  .window-hearts span::before {
    left: -11px;
  }

  .window-hearts span::after {
    top: -11px;
  }

  .window-body {
    min-height: 242px;
    padding-inline: 12px;
  }

  .cat-stage {
    height: 126px;
  }

  .pixel-btn {
    min-width: 60px;
    height: 38px;
    font-size: 15px;
  }
}

@media (max-height: 430px) {
  .love-window {
    transform: scale(.86);
  }

  .letter-card {
    height: calc(100vh - 24px);
  }
}

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

  .heart-field::before {
    animation: heartDrift 48s linear infinite !important;
  }

  .scene.is-switching .power-gate {
    animation: gateFade 4s cubic-bezier(.18, .72, .2, 1) 1s forwards !important;
  }

  .scene.is-switching .power-gate::before {
    animation: steadyGlow 4s cubic-bezier(.18, .72, .2, 1) 1s forwards !important;
  }

  .scene.is-switching .intro-gallery {
    animation: contentGlowIn 4s cubic-bezier(.18, .72, .2, 1) 1s forwards !important;
  }

  .scene.is-switching .heart-field,
  .scene.is-ready .heart-field {
    display: none !important;
  }

  .scene.is-switching .rocker {
    animation: switchVanish .62s ease forwards !important;
  }
}

/* Sakura Falling Field and Petals */
.sakura-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1; /* Behind UI cards (z-index 5+), in front of background */
}

.sakura-petal {
  position: absolute;
  top: -40px;
  background-color: #ffccd5;
  background-image: linear-gradient(135deg, #ffccd5 0%, #ffb7d5 100%);
  border-radius: 15px 2px 15px 15px;
  transform-origin: left top;
  animation: sakuraFall linear forwards, sakuraSway ease-in-out infinite alternate;
}

.sakura-petal::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: inherit;
  border-radius: inherit;
  transform: rotate(-15deg);
  opacity: 0.8;
}

@keyframes sakuraFall {
  0% {
    top: -40px;
    transform: rotate(0deg) rotateY(0deg);
  }
  100% {
    top: 105vh;
    transform: rotate(360deg) rotateY(180deg);
  }
}

@keyframes sakuraSway {
  0% {
    margin-left: 0;
  }
  100% {
    margin-left: var(--drift);
  }
}
