:root {
  --pink-50: #fff5f9;
  --pink-100: #ffe3ef;
  --pink-200: #ffc4dc;
  --pink-400: #ff6fa8;
  --pink-600: #d92d76;
  --rose: #9f174d;
  --berry: #6d153e;
  --plum: #401027;
  --cream: #fffaf5;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(159, 23, 77, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  color: var(--plum);
  font-family: "Nunito", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 196, 220, 0.85), transparent 34rem),
    linear-gradient(135deg, #fff5f9 0%, #ffe3ef 42%, #fffaf5 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

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

.petal-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -2rem;
  width: 0.85rem;
  height: 1.2rem;
  border-radius: 80% 20% 80% 20%;
  background: rgba(255, 111, 168, 0.55);
  animation: fall linear forwards;
  transform: rotate(20deg);
}

.falling-cookie {
  position: absolute;
  top: -9rem;
  width: clamp(5.5rem, 12vw, 8rem);
  height: auto;
  filter: drop-shadow(0 10px 10px rgba(109, 21, 62, 0.18));
  animation: cookie-fall linear forwards;
  will-change: transform;
}

@keyframes fall {
  to {
    transform: translate3d(var(--drift), 110vh, 0) rotate(380deg);
  }
}

@keyframes cookie-fall {
  to {
    transform: translate3d(var(--drift), 110vh, 0) rotate(12deg);
    opacity: 0.2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .petal,
  .falling-cookie {
    animation: none;
  }
}

.intro {
  position: fixed;
  inset: 0;
  right: auto;
  z-index: 20;
  width: 100vw;
  max-width: 100vw;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 1.5rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.8), transparent 20rem),
    linear-gradient(145deg, #ffbdd7 0%, #ff6fa8 46%, #ffd7e6 100%);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.intro.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.intro__content {
  position: absolute;
  left: 50vw;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 38rem;
  min-width: 0;
  text-align: center;
  color: var(--white);
  text-shadow: 0 2px 18px rgba(109, 21, 62, 0.28);
}

.intro__eyebrow,
.soft-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--pink-600);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro__content .intro__eyebrow {
  color: var(--white);
}

.intro__welcome[hidden],
.access-form[hidden] {
  display: none;
}

.access-form {
  display: grid;
  justify-items: center;
  width: min(100%, 25rem);
  margin: 0 auto;
}

.access-form h2 {
  margin: 1rem 0 0;
  font-family: "Great Vibes", cursive;
  font-size: clamp(3.3rem, 8vw, 5.2rem);
  font-weight: 400;
  line-height: 0.95;
}

.access-form p {
  margin: 1.1rem auto 1.5rem;
}

.access-form label {
  align-self: start;
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
  font-weight: 800;
}

.access-form input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 0.75rem;
  color: var(--rose);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(109, 21, 62, 0.16);
  font: inherit;
}

.access-form input:focus {
  outline: 3px solid rgba(255, 255, 255, 0.65);
  outline-offset: 3px;
}

.access-form .primary-button {
  width: 100%;
  margin-top: 0.5rem;
}

.access-form__error {
  min-height: 1.5rem;
  margin: 0.5rem 0 0;
  color: #fff4f8;
  font-size: 0.9rem;
  font-weight: 800;
}

.text-button {
  margin-top: 0.5rem;
  padding: 0.4rem 0.75rem;
  border: 0;
  color: var(--white);
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.intro h1,
.hero h1,
.section-heading h2,
.promise-card h2 {
  margin: 0;
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  line-height: 0.95;
}

.intro h1 {
  margin-top: 1rem;
  font-size: clamp(4.2rem, 11vw, 8.5rem);
}

.intro h1 span {
  display: block;
}

.intro p {
  width: 100%;
  margin: 1.3rem auto 2rem;
  max-width: 31rem;
  font-size: 1.1rem;
  line-height: 1.7;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0;
  backdrop-filter: blur(16px);
}

.brand {
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  color: var(--rose);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid rgba(217, 45, 118, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
}

.nav-links a {
  padding: 0.62rem 0.9rem;
  border-radius: 999px;
  color: var(--berry);
  font-weight: 800;
  font-size: 0.9rem;
}

.nav-links a:hover {
  background: var(--white);
}

.music-player {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem;
  border: 1px solid rgba(217, 45, 118, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 32px rgba(217, 45, 118, 0.12);
}

.music-player select {
  min-width: 0;
  max-width: 10.5rem;
  padding: 0.55rem 0.3rem 0.55rem 0.7rem;
  border: 0;
  color: var(--berry);
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.music-player select:focus-visible,
.music-button:focus-visible {
  outline: 0.18rem solid rgba(217, 45, 118, 0.42);
  outline-offset: 0.12rem;
}

.music-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  background: var(--pink-600);
  box-shadow: 0 12px 32px rgba(217, 45, 118, 0.28);
  cursor: pointer;
  font-size: 1.25rem;
}

.hero {
  position: relative;
  z-index: 2;
  min-height: 100svh;
}

.hero__inner {
  width: min(1180px, calc(100% - 2rem));
  min-height: calc(100svh - 5rem);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(21rem, 0.9fr);
  gap: clamp(2rem, 7vw, 5rem);
  align-items: center;
  padding: 2rem 0 5rem;
}

.hero__copy h1 {
  margin-top: 0.8rem;
  max-width: 48rem;
  color: var(--rose);
  font-size: clamp(4.8rem, 10vw, 9rem);
}

.hero__copy p {
  max-width: 42rem;
  margin: 1.3rem 0 0;
  color: rgba(64, 16, 39, 0.82);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.85;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.9rem 1.25rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.primary-button {
  color: var(--white);
  background: linear-gradient(135deg, var(--pink-600), var(--pink-400));
  box-shadow: 0 18px 36px rgba(217, 45, 118, 0.28);
}

.intro .primary-button {
  width: min(22rem, 100%);
}

.ghost-button {
  color: var(--rose);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(217, 45, 118, 0.18);
}

.hero__portrait {
  position: relative;
  min-height: 35rem;
}

.photo-card,
.mini-photo,
.gallery-grid figure {
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 196, 220, 0.52)),
    url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='120' height='120' fill='%23ffe3ef'/%3E%3Cpath d='M60 78c-12-10-28-19-28-35 0-9 7-16 16-16 5 0 10 3 12 8 2-5 7-8 12-8 9 0 16 7 16 16 0 16-16 25-28 35z' fill='%23ff6fa8' fill-opacity='.45'/%3E%3C/svg%3E");
  background-size: cover;
  box-shadow: var(--shadow);
}

.photo-card img,
.mini-photo img,
.gallery-grid img {
  opacity: 1;
}

.photo-card img[src$=".jpg"],
.mini-photo img[src$=".jpg"],
.gallery-grid img[src$=".jpg"] {
  background: transparent;
}

.photo-card--main {
  position: absolute;
  inset: 2rem 2rem 3rem 3rem;
  border: 0.8rem solid var(--white);
  border-radius: 2rem;
  transform: rotate(-3deg);
}

.photo-card--main span {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  color: var(--rose);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 900;
  font-size: 0.85rem;
}

.mini-photo {
  position: absolute;
  z-index: 2;
  width: 11rem;
  aspect-ratio: 1;
  border: 0.45rem solid var(--white);
  border-radius: 1.25rem;
}

.mini-photo--top {
  top: 0;
  right: 0;
  transform: rotate(8deg);
}

.mini-photo--bottom {
  left: 0;
  bottom: 0;
  transform: rotate(7deg);
}

.floating-note {
  position: absolute;
  z-index: 3;
  right: 1rem;
  bottom: 5rem;
  width: 11rem;
  padding: 1rem;
  border-radius: 1rem;
  color: var(--berry);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  font-weight: 900;
  line-height: 1.35;
}

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

section {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) 0;
}

.section-heading {
  max-width: 48rem;
  margin-bottom: 2rem;
}

.section-heading h2,
.promise-card h2 {
  margin-top: 0.7rem;
  color: var(--rose);
  font-size: clamp(3.1rem, 7vw, 5.8rem);
}

.love-letter {
  padding: clamp(1.4rem, 4vw, 3rem);
  border: 1px solid rgba(217, 45, 118, 0.16);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  color: rgba(64, 16, 39, 0.86);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.9;
}

.love-letter p:first-child {
  margin-top: 0;
  color: var(--rose);
  font-weight: 900;
}

.love-letter strong {
  color: var(--rose);
  font-size: 1.08em;
}

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

.memory-item {
  padding: 1.35rem;
  border-radius: 1.2rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 227, 239, 0.82));
  border: 1px solid rgba(217, 45, 118, 0.15);
}

.memory-item span {
  color: var(--pink-600);
  font-weight: 900;
}

.memory-item h3 {
  margin: 0.45rem 0;
  color: var(--rose);
  font-size: 1.35rem;
}

.memory-item p {
  margin: 0;
  line-height: 1.65;
}

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

.gallery-grid figure {
  margin: 0;
  min-height: 18rem;
  border: 0.55rem solid var(--white);
  border-radius: 1.1rem;
  position: relative;
}

.gallery-grid figure:nth-child(2),
.gallery-grid figure:nth-child(5) {
  transform: translateY(1.2rem);
}

.gallery-grid figcaption {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.8rem;
  color: var(--berry);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 900;
  line-height: 1.35;
}

.game-section .section-heading p {
  max-width: 42rem;
  margin: 1rem 0 0;
  color: rgba(64, 16, 39, 0.82);
  font-size: 1.05rem;
  line-height: 1.75;
}

.love-game {
  overflow: hidden;
  border: 1px solid rgba(217, 45, 118, 0.18);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid rgba(217, 45, 118, 0.15);
  background: rgba(255, 255, 255, 0.82);
}

.game-hud div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  padding: 1rem 1.25rem;
}

.game-hud div + div {
  border-left: 1px solid rgba(217, 45, 118, 0.15);
}

.game-hud span {
  color: rgba(64, 16, 39, 0.72);
  font-size: 0.88rem;
  font-weight: 800;
}

.game-hud strong {
  flex: 0 0 auto;
  color: var(--rose);
  font-size: 1.15rem;
}

.game-hud strong span {
  color: inherit;
  font-size: inherit;
}

.game-arena {
  position: relative;
  isolation: isolate;
  min-height: clamp(21rem, 48vw, 31rem);
  overflow: hidden;
  touch-action: manipulation;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.88), transparent 12rem),
    linear-gradient(145deg, #ffd6e6 0%, #ff9fc3 55%, #ffdae8 100%);
}

.game-arena::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.38;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 0.18rem, transparent 0.22rem),
    radial-gradient(circle, rgba(159, 23, 77, 0.24) 0 0.12rem, transparent 0.16rem);
  background-position: 1rem 1rem, 3.5rem 3.25rem;
  background-size: 5rem 5rem;
}

.game-screen {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 1.5rem;
  text-align: center;
  background: rgba(255, 236, 244, 0.72);
  backdrop-filter: blur(5px);
}

.game-screen[hidden],
.game-heart[hidden] {
  display: none;
}

.game-screen__heart {
  color: var(--pink-600);
  font-size: 3.5rem;
  line-height: 1;
  filter: drop-shadow(0 8px 16px rgba(159, 23, 77, 0.2));
}

.game-screen h3 {
  margin: 0.55rem 0 0;
  color: var(--rose);
  font-size: clamp(1.6rem, 4vw, 2.35rem);
}

.game-screen p {
  max-width: 32rem;
  margin: 0.6rem auto 1.25rem;
  color: rgba(64, 16, 39, 0.78);
  line-height: 1.65;
}

.game-heart {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: clamp(4rem, 8vw, 5.25rem);
  aspect-ratio: 1;
  padding: 0;
  border: 0.2rem solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  color: var(--white);
  background: linear-gradient(145deg, #f92f82, #ba155a);
  box-shadow: 0 12px 28px rgba(109, 21, 62, 0.3);
  cursor: pointer;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1;
  transition: left 0.18s ease, top 0.18s ease, transform 0.12s ease;
}

.game-heart:hover {
  transform: scale(1.08);
}

.game-heart:focus-visible {
  outline: 0.25rem solid var(--white);
  outline-offset: 0.2rem;
}

.game-heart.is-caught {
  animation: heart-caught 0.22s ease;
}

.game-spark {
  position: absolute;
  z-index: 1;
  color: var(--white);
  pointer-events: none;
  font-size: 1.2rem;
  font-weight: 900;
  animation: heart-spark 0.7s ease-out forwards;
}

.game-result {
  background: rgba(255, 241, 247, 0.88);
}

.game-status {
  min-height: 2.8rem;
  margin: 0;
  padding: 0.75rem 1.25rem;
  color: var(--berry);
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

@keyframes heart-caught {
  50% {
    transform: scale(0.75);
  }
}

@keyframes heart-spark {
  to {
    opacity: 0;
    transform: translateY(-3rem) scale(1.5) rotate(18deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-heart,
  .game-heart.is-caught,
  .game-spark {
    animation: none;
    transition: none;
  }
}

.snake-section .section-heading p {
  max-width: 44rem;
  margin: 1rem 0 0;
  color: rgba(64, 16, 39, 0.82);
  font-size: 1.05rem;
  line-height: 1.75;
}

.snake-console {
  width: min(58rem, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(217, 45, 118, 0.2);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.snake-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid rgba(217, 45, 118, 0.16);
  background: var(--white);
}

.snake-stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.snake-stats div + div {
  border-left: 1px solid rgba(217, 45, 118, 0.16);
}

.snake-stats span {
  color: rgba(64, 16, 39, 0.68);
  font-size: 0.88rem;
  font-weight: 800;
}

.snake-stats strong {
  color: var(--rose);
  font-size: 1.35rem;
}

.snake-play-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12rem;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  padding: clamp(1rem, 3vw, 2rem);
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.75), transparent 14rem),
    linear-gradient(145deg, #ffdce9, #ffafcc);
}

.snake-board-wrap {
  position: relative;
  width: min(100%, 32rem);
  aspect-ratio: 1;
  justify-self: center;
  overflow: hidden;
  border: 0.45rem solid var(--white);
  border-radius: 0.4rem;
  background: #fde8f0;
  box-shadow: 0 18px 42px rgba(109, 21, 62, 0.2);
}

.snake-board,
.snake-board canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.snake-board {
  aspect-ratio: 1;
  outline: none;
}

.snake-board:focus-visible {
  box-shadow: inset 0 0 0 0.3rem rgba(217, 45, 118, 0.55);
}

.snake-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 1.25rem;
  text-align: center;
  background: rgba(255, 239, 246, 0.88);
  backdrop-filter: blur(6px);
}

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

.snake-overlay img {
  width: clamp(5.5rem, 17vw, 8rem);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(109, 21, 62, 0.18));
}

.snake-overlay h3 {
  margin: 0.3rem 0 0;
  color: var(--rose);
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.snake-overlay p {
  max-width: 24rem;
  margin: 0.55rem auto 1rem;
  color: rgba(64, 16, 39, 0.78);
  line-height: 1.55;
}

.snake-controls {
  display: grid;
  grid-template-columns: repeat(3, 3.6rem);
  grid-template-rows: repeat(3, 3.6rem);
  justify-content: center;
  gap: 0.45rem;
}

.snake-control,
.snake-control__center {
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
}

.snake-control {
  border: 0;
  color: var(--white);
  background: var(--pink-600);
  box-shadow: 0 9px 20px rgba(109, 21, 62, 0.22);
  cursor: pointer;
  font: inherit;
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
}

.snake-control:hover {
  background: var(--rose);
}

.snake-control:active {
  transform: scale(0.92);
}

.snake-control:focus-visible {
  outline: 0.2rem solid var(--white);
  outline-offset: 0.2rem;
}

.snake-control--up {
  grid-column: 2;
  grid-row: 1;
}

.snake-control--left {
  grid-column: 1;
  grid-row: 2;
}

.snake-control__center {
  grid-column: 2;
  grid-row: 2;
  color: var(--pink-600);
  background: rgba(255, 255, 255, 0.72);
  font-size: 1.35rem;
}

.snake-control--right {
  grid-column: 3;
  grid-row: 2;
}

.snake-control--down {
  grid-column: 2;
  grid-row: 3;
}

.snake-status {
  min-height: 2.8rem;
  margin: 0;
  padding: 0.75rem 1rem;
  color: var(--berry);
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.tetris-section .section-heading p {
  max-width: 44rem;
  margin: 1rem 0 0;
  color: rgba(64, 16, 39, 0.82);
  font-size: 1.05rem;
  line-height: 1.75;
}

.tetris-console {
  width: min(50rem, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(217, 45, 118, 0.2);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.tetris-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid rgba(217, 45, 118, 0.16);
  background: var(--white);
}

.tetris-stats div {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.8rem 0.65rem;
}

.tetris-stats div + div {
  border-left: 1px solid rgba(217, 45, 118, 0.16);
}

.tetris-stats span,
.tetris-next-panel > span {
  color: rgba(64, 16, 39, 0.68);
  font-size: 0.82rem;
  font-weight: 800;
}

.tetris-stats strong {
  color: var(--rose);
  font-size: 1.25rem;
}

.tetris-play-area {
  display: grid;
  grid-template-columns: minmax(0, 19rem) 12rem;
  justify-content: center;
  align-items: center;
  gap: clamp(1rem, 4vw, 2.5rem);
  padding: clamp(1rem, 3vw, 2rem);
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.78), transparent 13rem),
    linear-gradient(145deg, #ffd9e8, #ff9fc3);
}

.tetris-board-wrap {
  position: relative;
  width: min(100%, 19rem);
  aspect-ratio: 1 / 2;
  justify-self: center;
  overflow: hidden;
  border: 0.4rem solid var(--white);
  border-radius: 0.4rem;
  background: #351126;
  box-shadow: 0 18px 42px rgba(109, 21, 62, 0.24);
}

.tetris-board,
.tetris-board canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.tetris-board {
  aspect-ratio: 1 / 2;
  outline: none;
}

.tetris-board:focus-visible {
  box-shadow: inset 0 0 0 0.3rem rgba(255, 196, 220, 0.75);
}

.tetris-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 1.1rem;
  color: var(--white);
  text-align: center;
  background: rgba(64, 16, 39, 0.86);
  backdrop-filter: blur(5px);
}

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

.tetris-overlay > span {
  color: var(--pink-200);
  font-size: clamp(3rem, 12vw, 5rem);
  line-height: 1;
  filter: drop-shadow(0 8px 18px rgba(255, 111, 168, 0.32));
}

.tetris-overlay h3 {
  margin: 0.55rem 0 0;
  color: var(--white);
  font-size: clamp(1.3rem, 4vw, 1.8rem);
}

.tetris-overlay p {
  max-width: 16rem;
  margin: 0.55rem auto 1rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  line-height: 1.55;
}

.tetris-side-panel {
  display: grid;
  gap: 1.35rem;
  justify-items: center;
}

.tetris-next-panel {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.85rem;
  border: 1px solid rgba(217, 45, 118, 0.15);
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.7);
}

.tetris-next {
  display: grid;
  grid-template-columns: repeat(4, 1.2rem);
  grid-template-rows: repeat(4, 1.2rem);
  gap: 0.16rem;
  min-height: 5.28rem;
}

.tetris-next span {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 0.18rem;
  background: rgba(217, 45, 118, 0.08);
}

.tetris-next span.is-filled {
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: var(--piece-color);
  box-shadow: inset 0 -0.2rem 0 rgba(109, 21, 62, 0.14);
}

.tetris-controls {
  display: grid;
  grid-template-columns: repeat(3, 3.4rem);
  grid-template-rows: repeat(3, 3.4rem);
  gap: 0.42rem;
}

.tetris-control {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  background: var(--pink-600);
  box-shadow: 0 9px 20px rgba(109, 21, 62, 0.22);
  cursor: pointer;
  font: inherit;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.tetris-control:hover {
  background: var(--rose);
}

.tetris-control:active {
  transform: scale(0.92);
}

.tetris-control:focus-visible {
  outline: 0.2rem solid var(--white);
  outline-offset: 0.2rem;
}

.tetris-control--rotate {
  grid-column: 2;
  grid-row: 1;
}

.tetris-control--left {
  grid-column: 1;
  grid-row: 2;
}

.tetris-control--down {
  grid-column: 2;
  grid-row: 2;
}

.tetris-control--right {
  grid-column: 3;
  grid-row: 2;
}

.tetris-control--drop {
  grid-column: 2;
  grid-row: 3;
  color: var(--berry);
  background: var(--pink-100);
}

.tetris-status {
  min-height: 2.8rem;
  margin: 0;
  padding: 0.75rem 1rem;
  color: var(--berry);
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.puzzle-section .section-heading p {
  max-width: 46rem;
  margin: 1rem 0 0;
  color: rgba(64, 16, 39, 0.82);
  font-size: 1.05rem;
  line-height: 1.75;
}

.puzzle-console {
  width: min(58rem, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(217, 45, 118, 0.2);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.puzzle-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 3.6rem;
  align-items: stretch;
  border-bottom: 1px solid rgba(217, 45, 118, 0.16);
  background: var(--white);
}

.puzzle-stats div {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.18rem;
  min-width: 0;
  min-height: 4.25rem;
  padding: 0.65rem 0.45rem;
}

.puzzle-stats div + div {
  border-left: 1px solid rgba(217, 45, 118, 0.16);
}

.puzzle-stats span {
  color: rgba(64, 16, 39, 0.68);
  font-size: 0.78rem;
  font-weight: 800;
}

.puzzle-stats strong {
  max-width: 100%;
  color: var(--rose);
  font-size: 1.15rem;
}

.puzzle-new-button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  align-self: center;
  justify-self: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  background: var(--pink-600);
  cursor: pointer;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 900;
}

.puzzle-new-button:disabled {
  cursor: wait;
  opacity: 0.48;
}

.puzzle-new-button:focus-visible {
  outline: 0.2rem solid var(--pink-200);
  outline-offset: 0.15rem;
}

.puzzle-stage-wrap {
  position: relative;
  width: min(100%, 42rem);
  aspect-ratio: 720 / 1140;
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(160deg, #ffd9e8, #f7a0c1);
  box-shadow: inset 0 0 0 0.4rem var(--white);
}

.puzzle-stage,
.puzzle-stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

.puzzle-stage {
  aspect-ratio: 720 / 1140;
  outline: none;
}

.puzzle-stage:focus-visible {
  box-shadow: inset 0 0 0 0.3rem rgba(217, 45, 118, 0.5);
}

.puzzle-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 1.5rem;
  color: var(--berry);
  text-align: center;
  background: rgba(255, 239, 246, 0.88);
  backdrop-filter: blur(7px);
}

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

.puzzle-overlay > span {
  color: var(--pink-600);
  font-size: clamp(4rem, 14vw, 7rem);
  line-height: 1;
  filter: drop-shadow(0 10px 22px rgba(159, 23, 77, 0.22));
}

.puzzle-overlay h3 {
  margin: 0.55rem 0 0;
  color: var(--rose);
  font-size: clamp(1.45rem, 4vw, 2.15rem);
}

.puzzle-overlay p {
  max-width: 25rem;
  margin: 0.65rem auto 1.15rem;
  color: rgba(64, 16, 39, 0.78);
  line-height: 1.6;
}

.puzzle-status {
  min-height: 2.8rem;
  margin: 0;
  padding: 0.75rem 1rem;
  color: var(--berry);
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.helix-section .section-heading p {
  max-width: 46rem;
  margin: 1rem 0 0;
  color: rgba(64, 16, 39, 0.82);
  font-size: 1.05rem;
  line-height: 1.75;
}

.helix-console {
  width: min(58rem, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(217, 45, 118, 0.2);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.helix-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid rgba(217, 45, 118, 0.16);
  background: var(--white);
}

.helix-stats div {
  display: grid;
  justify-items: center;
  gap: 0.18rem;
  min-width: 0;
  padding: 0.8rem 0.65rem;
}

.helix-stats div + div {
  border-left: 1px solid rgba(217, 45, 118, 0.16);
}

.helix-stats span {
  color: rgba(64, 16, 39, 0.68);
  font-size: 0.82rem;
  font-weight: 800;
}

.helix-stats strong {
  color: var(--rose);
  font-size: 1.25rem;
}

.helix-play-area {
  display: grid;
  grid-template-columns: minmax(0, 28rem) 14rem;
  justify-content: center;
  align-items: center;
  gap: clamp(1rem, 4vw, 2.5rem);
  padding: clamp(1rem, 3vw, 2rem);
  background:
    radial-gradient(circle at 85% 12%, rgba(255, 255, 255, 0.72), transparent 14rem),
    linear-gradient(145deg, #ffd8e8, #f78fb8);
}

.helix-board-wrap {
  position: relative;
  width: min(100%, 28rem);
  aspect-ratio: 540 / 760;
  justify-self: center;
  overflow: hidden;
  border: 0.4rem solid var(--white);
  border-radius: 0.5rem;
  background: #5e1740;
  box-shadow: 0 18px 42px rgba(109, 21, 62, 0.24);
}

.helix-board,
.helix-board canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

.helix-board {
  aspect-ratio: 540 / 760;
  outline: none;
  cursor: grab;
}

.helix-board:active {
  cursor: grabbing;
}

.helix-board:focus-visible {
  box-shadow: inset 0 0 0 0.3rem rgba(255, 196, 220, 0.72);
}

.helix-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 1.25rem;
  color: var(--white);
  text-align: center;
  background: rgba(64, 16, 39, 0.82);
  backdrop-filter: blur(6px);
}

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

.helix-overlay > span {
  display: grid;
  place-items: center;
  width: clamp(4.25rem, 13vw, 6.5rem);
  aspect-ratio: 1;
  border: 0.3rem solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  color: #ff5a9a;
  background: linear-gradient(145deg, #ff8fba, #d92d76);
  box-shadow: 0 14px 28px rgba(255, 111, 168, 0.3);
  font-size: 0;
}

.helix-overlay h3 {
  margin: 0.8rem 0 0;
  color: var(--white);
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.helix-overlay p {
  max-width: 22rem;
  margin: 0.6rem auto 1.1rem;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.6;
}

.helix-control-panel {
  display: grid;
  justify-items: center;
  gap: 1rem;
  color: var(--berry);
  text-align: center;
}

.helix-touch-hint,
.helix-desktop-hint {
  max-width: 13rem;
  margin: 0;
  padding: 0.9rem;
  border: 1px solid rgba(217, 45, 118, 0.15);
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.68);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.5;
}

.helix-desktop-hint,
.helix-desktop-controls {
  display: none;
}

.helix-desktop-controls {
  justify-content: center;
  gap: 0.75rem;
}

.helix-control {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  background: var(--pink-600);
  box-shadow: 0 10px 22px rgba(109, 21, 62, 0.24);
  cursor: pointer;
  font: inherit;
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
}

.helix-control:hover {
  background: var(--rose);
}

.helix-control:active {
  transform: scale(0.92);
}

.helix-control:focus-visible {
  outline: 0.2rem solid var(--white);
  outline-offset: 0.2rem;
}

.helix-status {
  min-height: 2.8rem;
  margin: 0;
  padding: 0.75rem 1rem;
  color: var(--berry);
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

@media (hover: hover) and (pointer: fine) {
  .helix-touch-hint {
    display: none;
  }

  .helix-desktop-hint,
  .helix-desktop-controls {
    display: flex;
  }
}

.video-section {
  padding-bottom: clamp(4.5rem, 10vw, 7rem);
}

.video-frame {
  overflow: hidden;
  border: 0.55rem solid var(--white);
  border-radius: 1rem;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.5), transparent 25rem),
    linear-gradient(145deg, var(--pink-400), var(--rose));
  box-shadow: var(--shadow);
}

.birthday-video {
  display: block;
  width: 100%;
  max-height: min(72vh, 43rem);
  aspect-ratio: 16 / 9;
  background: transparent;
  object-fit: contain;
}

.promise-section {
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
  background: linear-gradient(135deg, rgba(217, 45, 118, 0.12), rgba(255, 250, 245, 0.7));
}

.promise-card {
  width: min(980px, 100%);
  margin: 0 auto;
  text-align: center;
  padding: clamp(1.5rem, 5vw, 4rem);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(217, 45, 118, 0.14);
  box-shadow: var(--shadow);
}

.promise-card p {
  max-width: 45rem;
  margin: 1rem auto 0;
  color: rgba(64, 16, 39, 0.82);
  line-height: 1.8;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-top: 2rem;
}

.countdown div {
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 227, 239, 0.72);
}

.countdown strong {
  display: block;
  color: var(--rose);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
}

.countdown span {
  display: block;
  margin-top: 0.25rem;
  font-weight: 800;
  font-size: 0.86rem;
}

footer {
  position: relative;
  z-index: 2;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--rose);
  font-weight: 900;
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .helix-play-area {
    grid-template-columns: 1fr;
  }

  .helix-control-panel {
    max-width: 28rem;
    justify-self: center;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    padding-top: 1rem;
  }

  .hero__portrait {
    min-height: 31rem;
    order: -1;
  }

  .photo-card--main {
    inset: 1.5rem 1rem 3.5rem 2rem;
  }

  .memory-strip,
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .intro {
    padding: 1rem;
  }

  .intro__content {
    width: calc(100vw - 2rem);
    max-width: calc(100vw - 2rem);
  }

  .topbar {
    width: min(100% - 1rem, 1180px);
  }

  .brand {
    font-size: 1.8rem;
  }

  .music-player select {
    width: 7.8rem;
    font-size: 0.75rem;
  }

  .intro h1 {
    font-size: clamp(3rem, 13vw, 3.35rem);
    line-height: 1.02;
  }

  .intro p {
    width: min(16.5rem, 100%);
    max-width: 16.5rem;
    font-size: 1rem;
  }

  .intro .primary-button {
    width: min(15.5rem, 100%);
    max-width: 15.5rem;
  }

  .hero__copy h1 {
    font-size: 4.3rem;
  }

  .hero__actions,
  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .hero__portrait {
    min-height: 25rem;
  }

  .photo-card--main {
    inset: 1rem 0.4rem 3rem 1.1rem;
    border-width: 0.55rem;
    border-radius: 1.35rem;
  }

  .mini-photo {
    width: 8rem;
    border-width: 0.35rem;
  }

  .floating-note {
    right: 0;
    bottom: 3.2rem;
    width: 9.5rem;
    font-size: 0.85rem;
  }

  .memory-strip,
  .gallery-grid,
  .countdown {
    grid-template-columns: 1fr;
  }

  .game-hud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-hud div {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.2rem;
    padding: 0.7rem 0.35rem;
    text-align: center;
  }

  .game-hud div + div {
    border-top: 0;
    border-left: 1px solid rgba(217, 45, 118, 0.15);
  }

  .game-hud span {
    font-size: 0.74rem;
  }

  .game-hud strong {
    font-size: 1rem;
  }

  .game-arena {
    min-height: 24rem;
  }

  .snake-play-area {
    grid-template-columns: 1fr;
  }

  .snake-controls {
    grid-template-columns: repeat(3, 3.35rem);
    grid-template-rows: repeat(3, 3.35rem);
  }

  .snake-control,
  .snake-control__center {
    width: 3.35rem;
    height: 3.35rem;
  }

  .tetris-play-area {
    grid-template-columns: 1fr;
  }

  .tetris-side-panel {
    grid-template-columns: auto auto;
    align-items: center;
    gap: 1rem;
  }

  .tetris-next-panel {
    width: 7rem;
  }

  .tetris-controls {
    grid-template-columns: repeat(3, 3.15rem);
    grid-template-rows: repeat(3, 3.15rem);
  }

  .tetris-control {
    width: 3.15rem;
    height: 3.15rem;
  }

  .gallery-grid figure {
    min-height: 20rem;
  }

  .gallery-grid figure:nth-child(2),
  .gallery-grid figure:nth-child(5) {
    transform: none;
  }

  .video-frame {
    border-width: 0.4rem;
  }
}
