/* =========================================================
   HASIAN QUEST — a tiny birthday game
   Handcrafted HTML/CSS/JS. No framework, no external runtime.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --ink: #1b1233;
  --ink-2: #2b1b43;
  --ink-3: #3d2854;
  --night: #120c22;
  --night-soft: #1b1233;
  --cream: #fff4de;
  --paper: #fff9ee;
  --paper-deep: #f7ead4;
  --coral: #ff8f7f;
  --coral-deep: #e86c69;
  --rose: #ffb0b6;
  --gold: #ffd16b;
  --gold-deep: #e9a84d;
  --mint: #9ee7c8;
  --mint-deep: #5dbd9d;
  --sky: #9bd8e8;
  --lavender: #cdb6e5;
  --plum: #5b355f;
  --body-copy: #5b496a;

  --font-pixel: "Pixelify Sans", "Trebuchet MS", sans-serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-script: "Caveat", "Segoe Script", cursive;

  --line: rgba(255, 244, 222, 0.16);
  --line-strong: rgba(255, 244, 222, 0.3);
  --shadow-hard: 0 4px 0 var(--ink);
  --shadow-card: 0 7px 0 rgba(11, 6, 21, 0.42), 0 24px 55px rgba(4, 2, 11, 0.28);
  --hud-h: 64px;
  --page-max: 1240px;
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 300px;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--night);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse 70% 50% at 12% 2%, rgba(255, 143, 127, 0.12), transparent 65%),
    radial-gradient(ellipse 55% 45% at 94% 18%, rgba(158, 231, 200, 0.07), transparent 60%),
    radial-gradient(ellipse 70% 55% at 55% 100%, rgba(91, 53, 95, 0.35), transparent 65%),
    linear-gradient(160deg, #1e1436 0%, #150e28 52%, #0e091b 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

body.is-playing {
  overflow: hidden;
  overscroll-behavior: none;
}

body.is-dialog-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
label {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled),
label[for] {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 700;
}

::selection {
  background: var(--coral);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

[tabindex="-1"]:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 5000;
  transform: translateY(-180%);
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: translateY(0);
}

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

/* ---------- Shared bits ---------- */
.kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--gold);
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  line-height: 1.2;
  text-transform: uppercase;
}

.kicker::before {
  content: "✦";
  font-size: 0.86em;
  color: var(--coral);
}

.page-lead {
  max-width: 640px;
  margin-top: 14px;
  color: rgba(255, 244, 222, 0.68);
  font-size: 0.94rem;
  line-height: 1.8;
}

.btn {
  position: relative;
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: var(--cream);
  box-shadow: 0 4px 0 var(--ink), 0 8px 18px rgba(5, 3, 12, 0.16);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  transition: transform 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out), background 0.16s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--ink), 0 12px 24px rgba(5, 3, 12, 0.2);
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink), 0 5px 10px rgba(5, 3, 12, 0.15);
}

.btn:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
  box-shadow: 0 3px 0 var(--ink);
}

.btn:disabled:hover {
  transform: none;
  box-shadow: 0 3px 0 var(--ink);
}

.btn svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: currentColor;
}

.btn-primary {
  background: var(--coral);
  box-shadow: 0 4px 0 #8d3f4d, 0 8px 22px rgba(5, 3, 12, 0.2);
}

.btn-primary:hover {
  background: #ffa091;
  box-shadow: 0 6px 0 #8d3f4d, 0 12px 24px rgba(5, 3, 12, 0.22);
}

.btn-primary:active {
  box-shadow: 0 2px 0 #8d3f4d;
}

.btn-cream {
  background: var(--cream);
}

.btn-ghost {
  border-color: rgba(255, 244, 222, 0.34);
  background: rgba(255, 244, 222, 0.07);
  box-shadow: 0 4px 0 rgba(255, 244, 222, 0.15);
  color: var(--cream);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  border-color: rgba(255, 244, 222, 0.55);
  background: rgba(255, 244, 222, 0.12);
  box-shadow: 0 6px 0 rgba(255, 244, 222, 0.2);
}

.btn-ghost:active {
  box-shadow: 0 2px 0 rgba(255, 244, 222, 0.14);
}

.btn-large {
  min-height: 58px;
  padding: 0 28px;
  border-radius: 15px;
  font-size: 0.98rem;
}

.btn-small {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 10px;
  font-size: 0.76rem;
  box-shadow: 0 3px 0 var(--ink);
}

.btn-small:hover {
  box-shadow: 0 5px 0 var(--ink);
}

.btn-block {
  width: 100%;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 244, 222, 0.3);
  background: transparent;
  color: var(--cream);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.16s, border-color 0.16s;
}

.text-link:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.text-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: rgba(255, 244, 222, 0.62);
  font-family: var(--font-pixel);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.16s, transform 0.16s;
}

.back-link:hover {
  color: var(--cream);
  transform: translateX(-2px);
}

.back-link svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.round-btn {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 3px 0 var(--ink);
  color: var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
}

.round-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--ink);
}

.round-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--ink);
}

.round-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  z-index: 900;
  display: flex;
  width: calc(100% - 28px);
  max-width: var(--page-max);
  height: var(--hud-h);
  align-items: center;
  gap: 18px;
  padding: 0 10px;
  border: 2px solid var(--line);
  border-radius: 17px;
  background: rgba(20, 13, 36, 0.78);
  box-shadow: 0 3px 0 rgba(5, 3, 12, 0.35), inset 0 1px 0 rgba(255, 244, 222, 0.07);
  transform: translateX(-50%);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 4px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  transition: background 0.16s;
}

.brand:hover {
  background: rgba(255, 244, 222, 0.06);
}

.brand-mark {
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2));
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-copy b {
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: 1rem;
  letter-spacing: 0.035em;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--coral);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.star-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  padding: 6px 12px;
  border: 1px solid rgba(255, 244, 222, 0.13);
  border-radius: 999px;
  background: rgba(255, 244, 222, 0.045);
}

.star-progress-label {
  color: rgba(255, 244, 222, 0.5);
  font-family: var(--font-pixel);
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hud-stars {
  display: flex;
  gap: 3px;
}

.hud-star {
  width: 17px;
  height: 17px;
  fill: rgba(255, 244, 222, 0.14);
  stroke: rgba(255, 244, 222, 0.22);
  stroke-width: 1;
  transition: fill 0.3s, filter 0.3s, transform 0.3s var(--ease-bounce);
}

.hud-star.is-earned {
  fill: var(--gold);
  stroke: var(--gold);
  filter: drop-shadow(0 0 7px rgba(255, 209, 107, 0.5));
  transform: scale(1.05);
}

.star-count {
  min-width: 25px;
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: right;
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.hud-btn {
  position: relative;
  display: inline-flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 244, 222, 0.68);
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 0.16s, color 0.16s, transform 0.16s;
}

.hud-btn:hover {
  background: rgba(255, 244, 222, 0.08);
  color: var(--cream);
  transform: translateY(-1px);
}

.hud-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.hud-btn .sound-off {
  display: none;
}

.hud-btn.is-muted .sound-on {
  display: none;
}

.hud-btn.is-muted .sound-off {
  display: block;
}

.hud-btn.is-muted {
  color: var(--coral);
}

.hud-lock {
  position: absolute;
  top: 8px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 2px rgba(20, 13, 36, 0.94);
  transition: opacity 0.2s, background 0.2s;
}

.hud-lock.is-open {
  background: var(--mint);
}

/* ---------- Layout / screens ---------- */
.screen {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
}

.screen.is-active {
  animation: screen-in 0.65s var(--ease-out) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-screen {
  overflow: hidden;
}

.page-screen::before,
.page-screen::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(4px);
}

.page-screen::before {
  top: 60px;
  left: -220px;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(255, 143, 127, 0.11), transparent 66%);
}

.page-screen::after {
  right: -260px;
  bottom: -180px;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(158, 231, 200, 0.07), transparent 66%);
}

.page-shell {
  position: relative;
  width: min(var(--page-max), 100%);
  margin: 0 auto;
  padding: calc(var(--hud-h) + 58px + env(safe-area-inset-top)) 24px 42px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 38px;
}

.page-heading h1 {
  max-width: 800px;
  margin-top: 12px;
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: clamp(2.35rem, 5vw, 4.1rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 0.98;
  text-shadow: 0 4px 0 rgba(10, 6, 19, 0.4);
}

.page-heading h1 em {
  color: var(--coral);
  font-family: var(--font-script);
  font-size: 1.25em;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 54px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 244, 222, 0.1);
  color: rgba(255, 244, 222, 0.48);
  font-size: 0.76rem;
}

.page-footer > p:first-child {
  color: rgba(255, 244, 222, 0.66);
}

.page-footer span[aria-hidden] {
  color: var(--coral);
}

.footer-note {
  font-size: 0.68rem;
}

/* ---------- Intro ---------- */
.intro-screen {
  display: flex;
  min-height: 100svh;
  align-items: center;
  overflow: hidden;
  padding: calc(var(--hud-h) + 54px + env(safe-area-inset-top)) 24px 60px;
  isolation: isolate;
}

.intro-bg {
  position: absolute;
  inset: 0;
  z-index: -5;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  animation: intro-drift 26s ease-in-out infinite alternate;
}

@keyframes intro-drift {
  from {
    transform: scale(1.02) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.075) translate3d(-1.5%, -0.8%, 0);
  }
}

.intro-shade {
  position: absolute;
  inset: 0;
  z-index: -4;
  background:
    linear-gradient(90deg, rgba(16, 10, 30, 0.92) 0%, rgba(18, 12, 33, 0.77) 35%, rgba(20, 13, 36, 0.24) 65%, rgba(20, 13, 36, 0.3) 100%),
    linear-gradient(180deg, rgba(15, 10, 27, 0.5) 0%, transparent 26%, transparent 65%, rgba(13, 8, 23, 0.82) 100%);
}

.intro-grain {
  position: absolute;
  inset: 0;
  z-index: -3;
  opacity: 0.2;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='.4'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.intro-inner {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(var(--page-max), 100%);
  align-items: center;
  gap: 36px;
  margin: 0 auto;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
}

.intro-copy {
  max-width: 650px;
  padding-bottom: 10px;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 244, 222, 0.22);
  border-radius: 999px;
  background: rgba(20, 13, 36, 0.42);
  color: rgba(255, 244, 222, 0.8);
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  animation: fade-up 0.7s 0.1s var(--ease-out) both;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(158, 231, 200, 0.12);
  animation: live-pulse 2.2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(158, 231, 200, 0.1);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(158, 231, 200, 0.03);
  }
}

.intro-happy {
  margin: 25px 0 -10px 7px;
  color: var(--gold);
  font-family: var(--font-script);
  font-size: clamp(2rem, 4.2vw, 2.8rem);
  font-weight: 600;
  line-height: 1;
  transform: rotate(-2deg);
  animation: fade-up 0.7s 0.18s var(--ease-out) both;
}

.intro-title {
  position: relative;
  width: fit-content;
  margin: 0 0 20px;
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: clamp(4.2rem, 15.4vw, 9.2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 0.82;
  text-shadow: 5px 5px 0 #3b234e, 9px 9px 0 rgba(8, 4, 16, 0.32);
  animation: fade-up 0.8s 0.25s var(--ease-out) both;
}

.title-heart {
  display: inline-block;
  margin-left: 0.05em;
  color: var(--coral);
  font-family: var(--font-body);
  font-size: 0.24em;
  line-height: 1;
  vertical-align: 0.35em;
  text-shadow: none;
  animation: heart-beat 2.8s 1.4s var(--ease-bounce) infinite;
}

@keyframes heart-beat {
  0%,
  86%,
  100% {
    transform: scale(1);
  }
  90% {
    transform: scale(1.22);
  }
  94% {
    transform: scale(0.98);
  }
  97% {
    transform: scale(1.1);
  }
}

.intro-lead {
  max-width: 550px;
  color: rgba(255, 244, 222, 0.8);
  font-size: 0.96rem;
  line-height: 1.8;
  animation: fade-up 0.8s 0.35s var(--ease-out) both;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  animation: fade-up 0.8s 0.44s var(--ease-out) both;
}

.intro-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px dashed rgba(255, 244, 222, 0.17);
  animation: fade-up 0.8s 0.52s var(--ease-out) both;
}

.intro-facts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 244, 222, 0.56);
  font-family: var(--font-pixel);
  font-size: 0.59rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-facts svg {
  width: 15px;
  height: 15px;
  fill: var(--coral);
}

.dialogue-box {
  display: grid;
  max-width: 570px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 13px 16px 13px 13px;
  border: 1px solid rgba(255, 244, 222, 0.16);
  border-radius: 15px;
  background: rgba(17, 11, 30, 0.68);
  box-shadow: 0 4px 0 rgba(5, 3, 12, 0.22);
  backdrop-filter: blur(14px);
  animation: fade-up 0.8s 0.6s var(--ease-out) both;
}

.dialogue-avatar {
  width: 37px;
  height: 37px;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2));
}

.dialogue-box p {
  color: rgba(255, 244, 222, 0.68);
  font-size: 0.75rem;
  line-height: 1.6;
}

.dialogue-box b {
  color: var(--cream);
}

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

.intro-gallery {
  position: relative;
  height: min(590px, 65vh);
  min-height: 440px;
  animation: fade-up 1s 0.45s var(--ease-out) both;
}

.orbit {
  position: absolute;
  border: 1px dashed rgba(255, 244, 222, 0.14);
  border-radius: 50%;
  pointer-events: none;
}

.orbit-one {
  top: 8%;
  left: 6%;
  width: 82%;
  aspect-ratio: 1;
  animation: orbit-spin 50s linear infinite;
}

.orbit-two {
  top: 20%;
  left: 17%;
  width: 62%;
  aspect-ratio: 1;
  border-color: rgba(255, 209, 107, 0.1);
  animation: orbit-spin 36s linear infinite reverse;
}

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

.float-photo {
  position: absolute;
  width: 48%;
  padding: 9px 9px 0;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 0 6px 0 rgba(8, 4, 17, 0.48), 0 24px 45px rgba(4, 2, 11, 0.34);
  transform: rotate(var(--tilt));
  transition: transform 0.35s var(--ease-bounce), box-shadow 0.35s;
}

.float-photo:hover {
  z-index: 20;
  box-shadow: 0 9px 0 rgba(8, 4, 17, 0.48), 0 30px 55px rgba(4, 2, 11, 0.4);
  transform: rotate(0deg) translateY(-8px) scale(1.03);
}

.float-photo img {
  width: 100%;
  aspect-ratio: 900 / 620;
  border-radius: 2px;
  object-fit: cover;
}

.float-photo figcaption {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 4px 10px;
  color: var(--ink);
  font-family: var(--font-pixel);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.float-photo figcaption span {
  color: var(--coral-deep);
  font-size: 0.55rem;
}

.float-photo-one {
  --tilt: -8deg;
  top: 2%;
  left: 2%;
  z-index: 2;
  animation: photo-float-one 7s ease-in-out infinite;
}

.float-photo-two {
  --tilt: 6deg;
  top: 25%;
  right: 0;
  z-index: 4;
  width: 52%;
  animation: photo-float-two 8s 0.4s ease-in-out infinite;
}

.float-photo-three {
  --tilt: -4deg;
  bottom: 1%;
  left: 15%;
  z-index: 3;
  width: 45%;
  animation: photo-float-three 7.5s 0.8s ease-in-out infinite;
}

@keyframes photo-float-one {
  0%,
  100% {
    transform: rotate(-8deg) translateY(0);
  }
  50% {
    transform: rotate(-7deg) translateY(-10px);
  }
}

@keyframes photo-float-two {
  0%,
  100% {
    transform: rotate(6deg) translateY(0);
  }
  50% {
    transform: rotate(5deg) translateY(-12px);
  }
}

@keyframes photo-float-three {
  0%,
  100% {
    transform: rotate(-4deg) translateY(0);
  }
  50% {
    transform: rotate(-3deg) translateY(-8px);
  }
}

.photo-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 64px;
  height: 21px;
  background: rgba(255, 209, 107, 0.72);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transform: translateX(-50%) rotate(-2deg);
  clip-path: polygon(4% 0, 96% 0, 100% 48%, 96% 100%, 4% 100%, 0 52%);
}

.floating-heart,
.floating-spark {
  position: absolute;
  z-index: 5;
  color: var(--coral);
  pointer-events: none;
  text-shadow: 0 2px 0 rgba(10, 6, 18, 0.3);
}

.fh-one {
  top: 12%;
  right: 2%;
  font-size: 1.35rem;
  animation: heart-float 5s ease-in-out infinite;
}

.fh-two {
  bottom: 30%;
  left: 0;
  font-size: 0.9rem;
  color: var(--gold);
  animation: heart-float 6s 1.2s ease-in-out infinite;
}

.fh-three {
  top: 46%;
  left: 2%;
  color: var(--mint);
  font-size: 1.1rem;
  animation: heart-float 4.5s 0.7s ease-in-out infinite;
}

@keyframes heart-float {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
    opacity: 0.75;
  }
  50% {
    transform: translateY(-14px) rotate(5deg);
    opacity: 1;
  }
}

.save-badge {
  position: absolute;
  right: 2%;
  bottom: 7%;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 244, 222, 0.18);
  border-radius: 9px;
  background: rgba(18, 11, 30, 0.7);
  box-shadow: 0 3px 0 rgba(5, 3, 12, 0.25);
  backdrop-filter: blur(10px);
}

.save-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 7px rgba(158, 231, 200, 0.7);
}

.save-badge span:last-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.save-badge b {
  color: rgba(255, 244, 222, 0.8);
  font-family: var(--font-pixel);
  font-size: 0.51rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.save-badge small {
  color: rgba(255, 244, 222, 0.42);
  font-family: var(--font-pixel);
  font-size: 0.44rem;
  letter-spacing: 0.04em;
}

.intro-footer {
  position: absolute;
  bottom: 22px;
  left: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 13px;
  color: rgba(255, 244, 222, 0.4);
  font-family: var(--font-pixel);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: translateX(-50%);
  white-space: nowrap;
}

.intro-footer-line {
  width: 32px;
  height: 1px;
  background: rgba(255, 244, 222, 0.2);
}

/* ---------- Map ---------- */
.map-heading {
  align-items: flex-end;
}

.progress-card {
  display: flex;
  min-width: 295px;
  flex: 0 0 auto;
  align-items: center;
  gap: 15px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 244, 222, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 244, 222, 0.04);
  backdrop-filter: blur(8px);
}

.progress-ring {
  position: relative;
  display: grid;
  width: 67px;
  height: 67px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--progress) * 1%), rgba(255, 244, 222, 0.1) 0);
  transition: background 0.5s;
}

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 244, 222, 0.1);
  border-radius: 50%;
  background: #1b1330;
}

.progress-ring span {
  position: relative;
  z-index: 1;
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.progress-ring span span {
  color: rgba(255, 244, 222, 0.4);
  font-size: 0.68rem;
}

.progress-card b {
  display: block;
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: 0.87rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.progress-card p {
  max-width: 180px;
  margin-top: 5px;
  color: rgba(255, 244, 222, 0.5);
  font-size: 0.68rem;
  line-height: 1.5;
}

.world-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.world-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  transform: rotate(var(--card-tilt, 0deg));
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s;
}

.world-card:nth-child(1) {
  --card-tilt: -0.5deg;
}

.world-card:nth-child(2) {
  --card-tilt: 0.35deg;
}

.world-card:nth-child(3) {
  --card-tilt: -0.3deg;
}

.world-card:hover {
  transform: rotate(0) translateY(-5px);
  box-shadow: 0 10px 0 rgba(11, 6, 21, 0.4), 0 34px 65px rgba(4, 2, 11, 0.34);
}

.world-art {
  position: relative;
  aspect-ratio: 1.45;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
  background: var(--plum);
}

.world-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(15, 9, 26, 0.03) 45%, rgba(15, 9, 26, 0.55) 100%);
  pointer-events: none;
}

.world-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.world-mountain .world-art::before {
  background: linear-gradient(145deg, rgba(27, 18, 51, 0.05), transparent 42%, rgba(255, 174, 120, 0.12));
  mix-blend-mode: soft-light;
}

.world-beach .world-art::before {
  background:
    radial-gradient(ellipse 58% 48% at 82% 62%, rgba(255, 174, 96, 0.48), transparent 70%),
    linear-gradient(180deg, rgba(255, 124, 116, 0.16), rgba(255, 201, 139, 0.3));
  mix-blend-mode: soft-light;
}

.world-run .world-art::before {
  background: linear-gradient(180deg, rgba(255, 209, 107, 0.14), transparent 46%, rgba(155, 216, 232, 0.1));
  mix-blend-mode: soft-light;
}

.world-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out);
}

.world-card:hover .world-art img {
  transform: scale(1.05);
}

.chapter-tag,
.world-status,
.world-height {
  position: absolute;
  z-index: 2;
  font-family: var(--font-pixel);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.chapter-tag {
  top: 12px;
  left: 12px;
  padding: 7px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  background: var(--cream);
  box-shadow: 0 2px 0 var(--ink);
  color: var(--ink);
  font-size: 0.57rem;
  letter-spacing: 0.08em;
}

.world-status {
  bottom: 12px;
  left: 12px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 244, 222, 0.2);
  border-radius: 6px;
  background: rgba(17, 11, 29, 0.72);
  color: rgba(255, 244, 222, 0.72);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}

.world-status.is-complete {
  border-color: rgba(255, 209, 107, 0.4);
  background: rgba(255, 209, 107, 0.16);
  color: var(--gold);
}

.world-star {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: rgba(17, 11, 29, 0.55);
  box-shadow: 0 2px 0 rgba(8, 4, 16, 0.4);
  backdrop-filter: blur(8px);
}

.world-star svg {
  width: 19px;
  height: 19px;
  fill: rgba(255, 244, 222, 0.22);
  stroke: rgba(255, 244, 222, 0.32);
  stroke-width: 1;
  transition: fill 0.35s, filter 0.35s, transform 0.4s var(--ease-bounce);
}

.world-star.is-earned {
  background: rgba(255, 209, 107, 0.18);
}

.world-star.is-earned svg {
  fill: var(--gold);
  stroke: var(--gold);
  filter: drop-shadow(0 0 8px rgba(255, 209, 107, 0.65));
  transform: rotate(-8deg) scale(1.08);
}

.world-height {
  right: 13px;
  bottom: 13px;
  color: rgba(255, 244, 222, 0.65);
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  text-transform: none;
}

.world-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px 19px 20px;
  color: var(--ink);
}

.world-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #8e789f;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.world-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.world-meta span + span::before {
  content: "·";
  color: #bfaec8;
}

.world-body h2 {
  margin-top: 9px;
  color: var(--ink);
  font-family: var(--font-pixel);
  font-size: clamp(1.55rem, 2.3vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.num {
  font-family: var(--font-body);
  font-size: 0.86em;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.world-body > p {
  min-height: 62px;
  margin-top: 9px;
  color: var(--body-copy);
  font-size: 0.78rem;
  line-height: 1.65;
}

.world-goal {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  margin: 14px 0 16px;
  padding: 6px 9px;
  border: 1px dashed rgba(27, 18, 51, 0.2);
  border-radius: 7px;
  background: rgba(27, 18, 51, 0.035);
  color: var(--plum);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
}

.world-goal svg {
  width: 14px;
  height: 14px;
  fill: var(--coral-deep);
}

.btn-world {
  width: 100%;
  margin-top: auto;
  background: var(--ink);
  box-shadow: 0 4px 0 #6e4c61;
  color: var(--cream);
}

.btn-world:hover {
  background: var(--ink-2);
  box-shadow: 0 6px 0 #6e4c61;
}

.btn-world:active {
  box-shadow: 0 2px 0 #6e4c61;
}

.world-card.is-complete .btn-world {
  background: var(--mint);
  box-shadow: 0 4px 0 #539581;
  color: var(--ink);
}

.world-card.is-complete .btn-world:hover {
  background: #b2f0d7;
  box-shadow: 0 6px 0 #539581;
}

.map-bottom {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 22px;
  margin-top: 30px;
}

.mini-card {
  position: relative;
  display: flex;
  min-height: 215px;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background:
    linear-gradient(135deg, rgba(255, 244, 222, 0.065), rgba(255, 244, 222, 0.025)),
    rgba(255, 244, 222, 0.02);
  box-shadow: inset 0 1px 0 rgba(255, 244, 222, 0.06);
  backdrop-filter: blur(8px);
}

.mini-card::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 209, 107, 0.09), transparent 65%);
  pointer-events: none;
}

.mini-photo-stack {
  position: relative;
  width: 160px;
  height: 160px;
  flex: 0 0 160px;
}

.mini-photo-stack img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  aspect-ratio: 4 / 5;
  border: 2px solid var(--ink);
  border-radius: 2px;
  box-shadow: 0 3px 0 rgba(8, 4, 16, 0.3);
  object-fit: cover;
  transition: transform 0.35s var(--ease-bounce);
}

.mini-photo-stack img:nth-child(1) {
  z-index: 1;
  transform: translate(-65%, -50%) rotate(-11deg);
}

.mini-photo-stack img:nth-child(2) {
  z-index: 2;
  transform: translate(-48%, -52%) rotate(3deg);
}

.mini-photo-stack img:nth-child(3) {
  z-index: 3;
  transform: translate(-32%, -48%) rotate(12deg);
}

.mini-card:hover .mini-photo-stack img:nth-child(1) {
  transform: translate(-72%, -52%) rotate(-15deg);
}

.mini-card:hover .mini-photo-stack img:nth-child(3) {
  transform: translate(-26%, -48%) rotate(16deg);
}

.mini-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.mini-copy h3 {
  margin-top: 8px;
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: 1.32rem;
  line-height: 1.12;
}

.mini-copy > p:not(.kicker) {
  margin-top: 8px;
  color: rgba(255, 244, 222, 0.54);
  font-size: 0.74rem;
  line-height: 1.6;
}

.mini-copy .btn {
  margin-top: 15px;
}

.mini-envelope {
  position: relative;
  width: 145px;
  height: 103px;
  flex: 0 0 145px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #f0d3ae;
  box-shadow: 0 5px 0 rgba(8, 4, 16, 0.3);
  transform: rotate(-4deg);
}

.mini-envelope-flap {
  position: absolute;
  inset: 0;
  background: #e4bf94;
  clip-path: polygon(0 0, 100% 0, 50% 58%);
}

.mini-seal {
  position: absolute;
  top: 42%;
  left: 50%;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--coral-deep);
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: 1rem;
  transform: translate(-50%, -50%);
}

.letter-mini.is-unlocked {
  border-color: rgba(255, 209, 107, 0.35);
}

.letter-mini.is-unlocked::after {
  background: radial-gradient(circle, rgba(255, 209, 107, 0.18), transparent 65%);
}

.letter-mini.is-unlocked .mini-envelope {
  transform: rotate(3deg);
}

.letter-mini.is-unlocked .mini-envelope-flap {
  transform: rotateX(180deg);
  transform-origin: top;
}

.letter-mini.is-unlocked .mini-seal {
  background: var(--gold);
  color: var(--ink);
}

.mini-stars {
  display: flex;
  gap: 4px;
  margin-top: 12px;
}

.mini-stars svg {
  width: 15px;
  height: 15px;
  fill: rgba(255, 244, 222, 0.14);
  stroke: rgba(255, 244, 222, 0.22);
  stroke-width: 1;
}

.mini-stars svg.is-earned {
  fill: var(--gold);
  stroke: var(--gold);
}

/* ---------- Album ---------- */
.album-screen {
  background:
    radial-gradient(ellipse 60% 40% at 86% 4%, rgba(255, 143, 127, 0.09), transparent 65%),
    radial-gradient(ellipse 50% 45% at 8% 50%, rgba(255, 209, 107, 0.04), transparent 65%);
}

.album-screen .page-heading {
  align-items: center;
}

.album-counter {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 244, 222, 0.035);
}

.album-counter-number {
  color: var(--gold);
  font-family: var(--font-pixel);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 0.9;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
}

.album-counter > span:last-child {
  color: rgba(255, 244, 222, 0.5);
  font-family: var(--font-pixel);
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(22px, 3vw, 38px) clamp(18px, 2.5vw, 30px);
  align-items: start;
  padding: 10px 6px 4px;
}

.polaroid {
  position: relative;
  padding: 11px 11px 0;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 0 7px 0 rgba(10, 5, 19, 0.38), 0 22px 40px rgba(4, 2, 11, 0.24);
  transform: rotate(var(--polaroid-rot));
  transition: transform 0.35s var(--ease-bounce), box-shadow 0.35s;
}

.polaroid-one {
  --polaroid-rot: -2.2deg;
}

.polaroid-two {
  --polaroid-rot: 1.6deg;
  margin-top: 23px;
}

.polaroid-three {
  --polaroid-rot: -1.4deg;
}

.polaroid-four {
  --polaroid-rot: 1.8deg;
  margin-top: 10px;
}

.polaroid-five {
  --polaroid-rot: -1.7deg;
  margin-top: 27px;
}

.polaroid-six {
  --polaroid-rot: 2.2deg;
}

.polaroid:hover {
  z-index: 2;
  box-shadow: 0 11px 0 rgba(10, 5, 19, 0.38), 0 32px 55px rgba(4, 2, 11, 0.32);
  transform: rotate(0) translateY(-7px);
}

.polaroid-btn {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: #2a1b3f;
  aspect-ratio: 4 / 5;
  cursor: zoom-in;
}

.polaroid-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s var(--ease-out), filter 0.4s;
}

.polaroid:hover .polaroid-btn img {
  transform: scale(1.035);
}

.photo-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(180deg, transparent 52%, rgba(15, 9, 25, 0.56) 100%);
  opacity: 1;
}

.photo-cam {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1.5px solid rgba(255, 244, 222, 0.36);
  border-radius: 50%;
  background: rgba(17, 11, 29, 0.65);
  color: var(--cream);
  backdrop-filter: blur(6px);
  transition: transform 0.25s var(--ease-bounce), background 0.2s;
}

.photo-cam svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.polaroid:hover .photo-cam {
  background: var(--coral);
  color: var(--ink);
  transform: rotate(-8deg) scale(1.08);
}

.photo-overlay-text {
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
}

.polaroid:hover .photo-overlay-text,
.polaroid-btn:focus-visible .photo-overlay-text {
  opacity: 1;
  transform: translateY(0);
}

.polaroid figcaption {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 8px;
  padding: 12px 4px 15px;
  color: var(--ink);
}

.photo-number {
  grid-row: span 2;
  align-self: start;
  padding-top: 7px;
  color: var(--coral-deep);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  font-weight: 700;
}

.photo-caption {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-script);
  font-size: clamp(1.4rem, 2.1vw, 1.75rem);
  font-weight: 600;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-meta {
  overflow: hidden;
  margin-top: 4px;
  color: #9a839f;
  font-family: var(--font-pixel);
  font-size: 0.47rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.polaroid .photo-tape {
  top: -11px;
  height: 22px;
  width: 74px;
  background: rgba(255, 209, 107, 0.78);
  transform: translateX(-50%) rotate(-4deg);
}

.polaroid-two .photo-tape,
.polaroid-five .photo-tape {
  width: 58px;
  background: rgba(158, 231, 200, 0.65);
  transform: translateX(-50%) rotate(3deg);
}

.polaroid-three .photo-tape,
.polaroid-six .photo-tape {
  background: rgba(255, 176, 182, 0.7);
  transform: translateX(-50%) rotate(1deg);
}

.album-note {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 44px;
  padding: 18px 20px;
  border: 1px dashed rgba(255, 244, 222, 0.22);
  border-radius: 14px;
  background: rgba(255, 244, 222, 0.035);
}

.album-note-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 244, 222, 0.2);
  border-radius: 50%;
  color: var(--gold);
}

.album-note-icon svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.album-note p {
  color: rgba(255, 244, 222, 0.6);
  font-size: 0.76rem;
  line-height: 1.7;
}

.album-note b {
  color: var(--cream);
}

.album-note-heart {
  margin-left: auto;
  color: var(--coral);
  font-size: 1.2rem;
}

/* ---------- Letter ---------- */
.letter-screen {
  background:
    radial-gradient(ellipse 55% 50% at 82% 25%, rgba(255, 209, 107, 0.09), transparent 65%),
    radial-gradient(ellipse 55% 50% at 8% 80%, rgba(255, 143, 127, 0.07), transparent 65%);
}

.letter-layout {
  display: grid;
  min-height: 640px;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.9fr);
  align-items: center;
  gap: clamp(30px, 6vw, 90px);
}

.letter-intro h1 {
  margin-top: 12px;
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: clamp(2.8rem, 4.2vw, 4rem);
  line-height: 0.96;
  text-shadow: 0 4px 0 rgba(8, 4, 16, 0.35);
}

.letter-progress-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.letter-progress-stars {
  display: flex;
  gap: 5px;
}

.letter-progress-stars svg {
  width: 26px;
  height: 26px;
  fill: rgba(255, 244, 222, 0.12);
  stroke: rgba(255, 244, 222, 0.22);
  stroke-width: 1;
  transition: fill 0.35s, stroke 0.35s, filter 0.35s, transform 0.35s var(--ease-bounce);
}

.letter-progress-stars svg.is-earned {
  fill: var(--gold);
  stroke: var(--gold);
  filter: drop-shadow(0 0 8px rgba(255, 209, 107, 0.45));
  transform: translateY(-2px);
}

#letterLockStatus {
  color: rgba(255, 244, 222, 0.55);
  font-family: var(--font-pixel);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.letter-hint-box {
  display: flex;
  max-width: 430px;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 244, 222, 0.12);
  border-radius: 10px;
  background: rgba(255, 244, 222, 0.035);
}

.letter-hint-box > span {
  color: var(--mint);
  font-size: 0.9rem;
  line-height: 1.5;
}

.letter-hint-box p {
  color: rgba(255, 244, 222, 0.5);
  font-size: 0.71rem;
  line-height: 1.6;
}

.letter-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 10px 0 0;
}

.envelope-wrap {
  position: relative;
  width: min(390px, 80vw);
  aspect-ratio: 1.48;
  filter: drop-shadow(0 22px 30px rgba(4, 2, 10, 0.4));
  transition: transform 0.35s var(--ease-bounce), filter 0.35s;
  perspective: 900px;
}

.envelope-wrap.is-locked {
  filter: drop-shadow(0 18px 28px rgba(4, 2, 10, 0.35)) grayscale(0.35) brightness(0.85);
}

.envelope-wrap.is-wiggling {
  animation: envelope-wiggle 0.55s var(--ease-out);
}

@keyframes envelope-wiggle {
  0%,
  100% {
    transform: rotate(0);
  }
  22% {
    transform: rotate(-2.2deg) translateX(-5px);
  }
  44% {
    transform: rotate(2.2deg) translateX(5px);
  }
  66% {
    transform: rotate(-1.3deg) translateX(-3px);
  }
  82% {
    transform: rotate(1deg) translateX(2px);
  }
}

.envelope-back {
  position: absolute;
  inset: 0;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: #e8c59d;
  box-shadow: inset 0 -20px 0 rgba(123, 79, 72, 0.08);
}

.letter-peek {
  position: absolute;
  top: 4%;
  left: 7%;
  z-index: 1;
  display: flex;
  width: 86%;
  height: 86%;
  flex-direction: column;
  gap: 10px;
  padding: 24px 24px 15px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  transform: translateY(-11%);
  transition: transform 0.7s 0.1s var(--ease-out);
}

.letter-peek span {
  color: var(--ink);
  font-family: var(--font-script);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
}

.letter-peek i {
  width: 80%;
  height: 2px;
  border-radius: 2px;
  background: rgba(27, 18, 51, 0.18);
}

.letter-peek i:nth-of-type(2) {
  width: 65%;
}

.letter-peek i:nth-of-type(3) {
  width: 74%;
}

.envelope-front {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: linear-gradient(150deg, #f6dbb9 0%, #edcba4 56%, #dfb88e 100%);
  clip-path: polygon(0 0, 50% 50%, 100% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 0 1px rgba(27, 18, 51, 0.35));
}

.envelope-front::before,
.envelope-front::after {
  content: "";
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  border-top: 1.5px solid rgba(95, 58, 54, 0.22);
  opacity: 0.8;
}

.envelope-front::before {
  left: 0;
  background: linear-gradient(35deg, rgba(255, 255, 255, 0.14), transparent 65%);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.envelope-front::after {
  right: 0;
  background: linear-gradient(-35deg, rgba(255, 255, 255, 0.1), transparent 65%);
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  width: 100%;
  height: 57%;
  border: 2px solid var(--ink);
  border-radius: 9px 9px 2px 2px;
  background: linear-gradient(172deg, #f5d8b4, #dfb78a);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 2px 0 rgba(27, 18, 51, 0.4));
  transform-origin: top center;
  transition: transform 0.75s var(--ease-out), z-index 0s 0.4s;
  backface-visibility: hidden;
}

.envelope-wrap.is-open .envelope-flap {
  z-index: 0;
  transform: rotateX(180deg);
}

.envelope-address {
  position: absolute;
  bottom: 12%;
  left: 50%;
  z-index: 5;
  color: #674944;
  font-family: var(--font-script);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 244, 222, 0.35);
  transform: translateX(-50%) rotate(-1.5deg);
  transition: opacity 0.25s;
}

.envelope-wrap.is-open .envelope-address {
  opacity: 0;
}

.envelope-wrap.is-open .letter-peek {
  transform: translateY(-44%);
}

.wax-seal {
  position: absolute;
  top: 48%;
  left: 50%;
  z-index: 5;
  display: grid;
  width: 59px;
  height: 59px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #ffab97, transparent 42%),
    var(--coral-deep);
  box-shadow: 0 3px 0 rgba(89, 31, 41, 0.55), inset 0 0 0 3px rgba(255, 244, 222, 0.14);
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: 1.35rem;
  font-weight: 700;
  transform: translate(-50%, -50%) rotate(-8deg);
  transition: opacity 0.3s, transform 0.4s var(--ease-bounce);
}

.envelope-wrap.is-open .wax-seal {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(20deg) scale(0.7);
}

.envelope-stamp {
  position: absolute;
  top: 7%;
  right: 7%;
  z-index: 5;
  display: grid;
  width: 46px;
  height: 54px;
  place-items: center;
  border: 1.5px dashed rgba(27, 18, 51, 0.42);
  background: rgba(255, 244, 222, 0.62);
  color: var(--plum);
  transform: rotate(5deg);
}

.envelope-stamp svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}

.envelope-spark {
  position: absolute;
  z-index: 6;
  color: var(--gold);
  pointer-events: none;
  animation: heart-float 4s ease-in-out infinite;
}

.es-one {
  top: -18px;
  left: -14px;
  font-size: 1.4rem;
}

.es-two {
  right: -18px;
  bottom: 20%;
  color: var(--coral);
  font-size: 1rem;
  animation-delay: 1.1s;
}

.letter-stage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
}

.letter-lock-note {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 244, 222, 0.45);
  font-family: var(--font-pixel);
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.letter-lock-note svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.letter-lock-note.is-unlocked {
  color: var(--gold);
}

.btn.is-locked-cta {
  border-color: rgba(255, 244, 222, 0.24);
  background: rgba(255, 244, 222, 0.07);
  box-shadow: 0 4px 0 rgba(255, 244, 222, 0.14);
  color: rgba(255, 244, 222, 0.7);
}

.btn.is-locked-cta:hover {
  border-color: rgba(255, 244, 222, 0.4);
  background: rgba(255, 244, 222, 0.11);
  box-shadow: 0 6px 0 rgba(255, 244, 222, 0.18);
}

.btn.is-locked-cta:active {
  box-shadow: 0 2px 0 rgba(255, 244, 222, 0.12);
}

/* Letter opened */
.letter-reveal {
  animation: screen-in 0.7s var(--ease-out) both;
}

.letter-reveal-heading {
  margin-bottom: 20px;
  text-align: center;
}

.letter-reveal-heading .kicker {
  justify-content: center;
}

.letter-open-note {
  margin-top: 6px;
  color: rgba(255, 244, 222, 0.5);
  font-family: var(--font-script);
  font-size: 1.35rem;
}

.letter-paper {
  position: relative;
  width: min(860px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 5.6vw, 72px) clamp(22px, 6vw, 86px) clamp(28px, 5vw, 64px);
  border: 2px solid var(--ink);
  border-radius: 5px;
  background:
    repeating-linear-gradient(180deg, rgba(111, 79, 93, 0.035) 0, rgba(111, 79, 93, 0.035) 1px, transparent 1px, transparent 28px),
    radial-gradient(circle at 14% 4%, rgba(255, 255, 255, 0.7), transparent 32%),
    var(--paper);
  box-shadow: 0 10px 0 rgba(10, 5, 19, 0.4), 0 40px 90px rgba(4, 2, 11, 0.35);
  color: var(--ink);
  transform: rotate(-0.35deg);
}

.letter-paper::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(27, 18, 51, 0.08);
  border-radius: 2px;
  pointer-events: none;
}

.paper-tape {
  position: absolute;
  z-index: 2;
  width: 102px;
  height: 29px;
  background: rgba(255, 209, 107, 0.72);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  opacity: 0.9;
}

.paper-tape-one {
  top: -14px;
  left: 8%;
  transform: rotate(-4deg);
  clip-path: polygon(3% 0, 100% 2%, 97% 100%, 0 96%);
}

.paper-tape-two {
  top: -13px;
  right: 7%;
  background: rgba(158, 231, 200, 0.62);
  transform: rotate(3deg);
  clip-path: polygon(0 2%, 98% 0, 100% 97%, 2% 100%);
}

.paper-stamp {
  position: absolute;
  top: clamp(24px, 4vw, 48px);
  right: clamp(20px, 5vw, 54px);
  display: flex;
  width: 80px;
  height: 96px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1.5px dashed rgba(27, 18, 51, 0.3);
  background: rgba(255, 143, 127, 0.08);
  color: var(--coral-deep);
  transform: rotate(5deg);
}

.paper-stamp span {
  font-family: var(--font-pixel);
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.paper-stamp svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.paper-kicker {
  color: var(--coral-deep);
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.letter-paper h2 {
  max-width: 610px;
  margin-top: 14px;
  color: var(--ink);
  font-family: var(--font-script);
  font-size: clamp(3.2rem, 7vw, 5.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 0.88;
}

.letter-paper h2 span {
  color: var(--coral-deep);
}

.letter-body {
  max-width: 665px;
  margin-top: 31px;
  color: #493651;
  font-size: 0.96rem;
  line-height: 1.9;
}

.letter-body p + p {
  margin-top: 16px;
}

.letter-body > p:first-child {
  margin-bottom: 5px;
  color: var(--ink);
  font-family: var(--font-script);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
}

.letter-signature {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin-top: 34px;
  padding-right: 5%;
  color: #7b627c;
  font-family: var(--font-script);
  font-size: 1.55rem;
  line-height: 1.1;
}

.letter-signature strong {
  color: var(--coral-deep);
  font-size: 2.05rem;
  font-weight: 600;
}

.letter-signature i {
  font-style: normal;
}

.letter-ps {
  margin-top: 27px;
  padding-top: 17px;
  border-top: 1px dashed rgba(27, 18, 51, 0.16);
  color: #8b738d;
  font-size: 0.73rem;
  font-style: italic;
  line-height: 1.75;
}

.letter-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.letter-actions .btn-ghost {
  border-color: rgba(255, 244, 222, 0.28);
}

.finale {
  display: grid;
  width: min(980px, 100%);
  min-height: 390px;
  grid-template-columns: 1fr 0.9fr;
  align-items: center;
  gap: 24px;
  margin: 58px auto 0;
  padding: clamp(24px, 4.5vw, 52px);
  overflow: hidden;
  border: 1px solid rgba(255, 244, 222, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 82% 46%, rgba(255, 209, 107, 0.12), transparent 45%),
    linear-gradient(140deg, rgba(255, 244, 222, 0.07), rgba(255, 244, 222, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 244, 222, 0.08);
}

.finale-copy h2 {
  margin-top: 9px;
  color: var(--cream);
  font-family: var(--font-script);
  font-size: clamp(2.5rem, 5vw, 3.7rem);
  font-weight: 600;
  line-height: 0.94;
}

.finale-copy > p:not(.kicker):not(.wish-message) {
  max-width: 420px;
  margin-top: 13px;
  color: rgba(255, 244, 222, 0.6);
  font-size: 0.82rem;
  line-height: 1.75;
}

.finale-copy .btn {
  margin-top: 21px;
}

.wish-message {
  max-width: 390px;
  min-height: 22px;
  margin-top: 13px;
  color: var(--gold);
  font-family: var(--font-script);
  font-size: 1.25rem;
  line-height: 1.4;
}

.cake {
  position: relative;
  width: 320px;
  max-width: 100%;
  height: 300px;
  justify-self: center;
  border: 0;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.cake-glow {
  position: absolute;
  top: 15px;
  left: 50%;
  width: 230px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 120, 0.34), transparent 68%);
  transform: translateX(-50%);
  filter: blur(4px);
  transition: opacity 0.5s;
}

.cake-plate {
  position: absolute;
  bottom: 17px;
  left: 50%;
  width: 290px;
  height: 25px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #6e4b64;
  box-shadow: 0 5px 0 rgba(5, 3, 12, 0.35);
  transform: translateX(-50%);
}

.cake-layer {
  position: absolute;
  left: 50%;
  border: 2px solid var(--ink);
  border-radius: 12px 12px 7px 7px;
  transform: translateX(-50%);
  box-shadow: inset 0 -7px 0 rgba(103, 50, 59, 0.14);
}

.cake-bottom {
  bottom: 38px;
  width: 260px;
  height: 82px;
  background: var(--coral);
}

.cake-mid {
  bottom: 116px;
  width: 218px;
  height: 66px;
  background: var(--gold);
}

.cake-top {
  bottom: 178px;
  width: 174px;
  height: 53px;
  overflow: hidden;
  background: var(--paper);
}

.cake-drip {
  position: absolute;
  top: -2px;
  left: 50%;
  width: 100%;
  height: 17px;
  background: var(--rose);
  transform: translateX(-50%);
}

.cake-drip::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 12%;
  width: 76%;
  height: 16px;
  background:
    radial-gradient(circle at 10px 0, var(--rose) 9px, transparent 10px) 0 0 / 27px 18px repeat-x;
}

.cake-candles {
  position: absolute;
  bottom: 228px;
  left: 50%;
  z-index: 3;
  width: 122px;
  height: 61px;
  transform: translateX(-50%);
}

.candle {
  position: absolute;
  bottom: 0;
  width: 11px;
  height: 45px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: repeating-linear-gradient(45deg, var(--cream) 0 6px, var(--coral) 6px 11px);
}

.candle.c-one {
  left: 5px;
}

.candle.c-two {
  bottom: 8px;
  left: 55px;
  height: 50px;
}

.candle.c-three {
  right: 4px;
}

.flame {
  position: absolute;
  top: -21px;
  left: 50%;
  width: 13px;
  height: 20px;
  border-radius: 60% 40% 60% 40%;
  background: radial-gradient(circle at 50% 68%, #fff8c8 0 20%, #ffd36e 46%, #ff8e5f 100%);
  box-shadow: 0 0 18px rgba(255, 194, 95, 0.85), 0 0 38px rgba(255, 141, 88, 0.3);
  transform: translateX(-50%) rotate(4deg);
  transform-origin: bottom center;
  animation: flame-dance 0.7s ease-in-out infinite alternate;
}

.candle.c-two .flame {
  animation-delay: 0.15s;
}

.candle.c-three .flame {
  animation-delay: 0.3s;
}

@keyframes flame-dance {
  from {
    transform: translateX(-50%) rotate(-5deg) scaleY(0.92);
  }
  to {
    transform: translateX(-50%) rotate(6deg) scaleY(1.06);
  }
}

.cake.is-blown .flame {
  opacity: 0;
  transform: translateX(-50%) scale(0.1);
  transition: opacity 0.25s, transform 0.25s;
  animation: none;
}

.cake.is-blown .cake-glow {
  opacity: 0;
}

.cake-sprinkles {
  position: absolute;
  bottom: 192px;
  left: 50%;
  z-index: 2;
  width: 150px;
  height: 31px;
  transform: translateX(-50%);
}

.cake-sprinkles i {
  position: absolute;
  width: 8px;
  height: 3px;
  border-radius: 2px;
  background: var(--coral-deep);
}

.cake-sprinkles i:nth-child(1) {
  top: 5px;
  left: 8px;
  rotate: 24deg;
  background: var(--mint-deep);
}

.cake-sprinkles i:nth-child(2) {
  top: 14px;
  left: 36px;
  rotate: -30deg;
  background: var(--coral-deep);
}

.cake-sprinkles i:nth-child(3) {
  top: 4px;
  left: 62px;
  rotate: 14deg;
  background: var(--gold-deep);
}

.cake-sprinkles i:nth-child(4) {
  top: 17px;
  left: 92px;
  rotate: -20deg;
  background: var(--mint-deep);
}

.cake-sprinkles i:nth-child(5) {
  top: 7px;
  left: 122px;
  rotate: 30deg;
  background: var(--plum);
}

.cake-sprinkles i:nth-child(6) {
  top: 21px;
  left: 66px;
  rotate: 52deg;
  background: var(--coral-deep);
}

.cake-sprinkles i:nth-child(7) {
  top: 23px;
  left: 16px;
  rotate: -12deg;
  background: var(--gold-deep);
}

.cake-sprinkles i:nth-child(8) {
  top: 12px;
  left: 138px;
  rotate: 8deg;
  background: var(--coral-deep);
}

.hug-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.hug-row p {
  color: rgba(255, 244, 222, 0.38);
  font-size: 0.7rem;
}

.hug-row p span {
  color: var(--coral);
}

/* ---------- Game overlay ---------- */
.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 13px;
  background: #0c0717;
}

.game-frame {
  position: relative;
  display: flex;
  width: min(1480px, 100%);
  height: calc(100dvh - 26px);
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--night-soft);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
}

.game-chrome {
  position: relative;
  z-index: 50;
  display: flex;
  height: 62px;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 12, 31, 0.94);
  backdrop-filter: blur(12px);
}

.chrome-btn {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 244, 222, 0.045);
  color: var(--cream);
  transition: background 0.16s, border-color 0.16s, transform 0.16s;
}

.chrome-btn:hover {
  border-color: var(--line-strong);
  background: rgba(255, 244, 222, 0.1);
  transform: translateY(-1px);
}

.chrome-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.chrome-btn span {
  font-family: var(--font-pixel);
  font-size: 1rem;
  font-weight: 700;
}

.chrome-title {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  line-height: 1.1;
}

.chrome-title span {
  color: var(--gold);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chrome-title b {
  overflow: hidden;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chrome-goal {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 244, 222, 0.04);
  color: rgba(255, 244, 222, 0.7);
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.game-body {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background: var(--night);
}

.game-toast {
  position: absolute;
  bottom: 20px;
  left: 50%;
  z-index: 80;
  max-width: min(420px, calc(100% - 32px));
  padding: 9px 14px;
  border: 1px solid rgba(255, 244, 222, 0.24);
  border-radius: 9px;
  background: rgba(18, 12, 31, 0.92);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.24);
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s, transform 0.25s;
  backdrop-filter: blur(10px);
}

.game-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Mission / completion shared stage */
.mission-view,
.result-view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(16px, 3vw, 38px);
  isolation: isolate;
}

.mission-bg,
.result-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mission-view::after,
.result-view::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(12, 7, 23, 0.9) 0%, rgba(12, 7, 23, 0.62) 42%, rgba(12, 7, 23, 0.25) 100%),
    linear-gradient(180deg, rgba(12, 7, 23, 0.42), rgba(12, 7, 23, 0.55));
}

.mission-panel,
.result-panel {
  position: relative;
  width: min(480px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: clamp(22px, 3.4vw, 36px);
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 7px 0 rgba(7, 4, 14, 0.46), 0 30px 60px rgba(4, 2, 10, 0.36);
  color: var(--ink);
  scrollbar-width: thin;
}

.mission-view {
  justify-content: flex-start;
  padding-left: clamp(18px, 8vw, 120px);
}

.mission-panel .kicker,
.result-panel .kicker {
  color: var(--coral-deep);
}

.mission-panel h2,
.result-panel h2 {
  margin-top: 11px;
  color: var(--ink);
  font-family: var(--font-pixel);
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.96;
}

.mission-lead {
  margin-top: 14px;
  color: var(--body-copy);
  font-size: 0.84rem;
  line-height: 1.75;
}

.mission-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.mission-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid rgba(27, 18, 51, 0.12);
  border-radius: 6px;
  background: rgba(27, 18, 51, 0.035);
  color: var(--plum);
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0;
}

.mission-chip svg {
  width: 13px;
  height: 13px;
  fill: var(--coral-deep);
}

.how-to {
  display: grid;
  gap: 7px;
  margin: 17px 0 22px;
  padding: 0;
  list-style: none;
}

.how-to li {
  position: relative;
  padding-left: 22px;
  color: #6a5573;
  font-size: 0.74rem;
  line-height: 1.55;
}

.how-to li::before {
  content: "✦";
  position: absolute;
  top: 0;
  left: 2px;
  color: var(--coral-deep);
  font-size: 0.68rem;
}

.mission-panel .btn {
  width: 100%;
}

.mission-foot {
  margin-top: 11px;
  color: #9a839f;
  font-size: 0.65rem;
  line-height: 1.5;
  text-align: center;
}

.result-panel {
  width: min(540px, 100%);
  text-align: center;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(93, 189, 157, 0.16);
  color: #3f826d;
  font-family: var(--font-pixel);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-badge::before {
  content: "✓";
}

.result-star {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  margin: 10px auto 4px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 209, 107, 0.65), transparent 65%),
    var(--cream);
  box-shadow: 0 4px 0 var(--ink);
  animation: star-pop 0.7s 0.15s var(--ease-bounce) both;
}

.result-star svg {
  width: 40px;
  height: 40px;
  fill: var(--gold-deep);
  stroke: var(--ink);
  stroke-width: 0.8;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.15));
}

@keyframes star-pop {
  from {
    opacity: 0;
    transform: scale(0.45) rotate(-25deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.result-panel h2 {
  margin-top: 8px;
}

.result-copy {
  max-width: 450px;
  margin: 12px auto 0;
  color: var(--body-copy);
  font-size: 0.82rem;
  line-height: 1.7;
}

.result-reward {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 19px 0 20px;
  padding: 11px;
  border: 1px solid rgba(27, 18, 51, 0.12);
  border-radius: 11px;
  background: rgba(27, 18, 51, 0.035);
  text-align: left;
}

.reward-photo {
  position: relative;
  width: 92px;
  flex: 0 0 92px;
  padding: 5px 5px 7px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: #fffdf7;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
  transform: rotate(-3deg);
}

.reward-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.reward-tag {
  position: absolute;
  bottom: -8px;
  left: 50%;
  padding: 3px 6px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: translateX(-50%);
  white-space: nowrap;
}

.reward-copy b {
  display: block;
  color: var(--ink);
  font-family: var(--font-script);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1;
}

.reward-copy p {
  margin-top: 5px;
  color: #8a738e;
  font-size: 0.65rem;
  line-height: 1.5;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.result-actions .btn {
  flex: 1 1 150px;
}

.result-actions .btn-ghost,
.viewer-actions .btn-ghost {
  border-color: var(--ink);
  background: rgba(27, 18, 51, 0.04);
  box-shadow: 0 3px 0 var(--ink);
  color: var(--ink);
}

.result-actions .btn-ghost:hover,
.viewer-actions .btn-ghost:hover {
  border-color: var(--ink);
  background: rgba(27, 18, 51, 0.08);
  box-shadow: 0 5px 0 var(--ink);
}

.result-actions .btn-ghost:active,
.viewer-actions .btn-ghost:active {
  box-shadow: 0 1px 0 var(--ink);
}

/* ---------- Game: mountain ---------- */
.mountain-play,
.beach-play,
.runner-play {
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}

.play-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mountain-play::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 70% 35%, transparent 0 20%, rgba(12, 7, 23, 0.12) 70%),
    linear-gradient(180deg, rgba(12, 7, 23, 0.4) 0%, transparent 26%, transparent 64%, rgba(12, 7, 23, 0.62) 100%);
}

.altitude-meter {
  position: absolute;
  top: 24px;
  right: 18px;
  bottom: 110px;
  z-index: 6;
  width: 56px;
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.meter-track {
  position: absolute;
  top: 28px;
  bottom: 26px;
  left: 50%;
  width: 5px;
  border-radius: 5px;
  background: rgba(255, 244, 222, 0.18);
  transform: translateX(-50%);
  box-shadow: inset 0 0 0 1px rgba(255, 244, 222, 0.08);
}

.meter-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--p, 0%);
  border-radius: 5px;
  background: linear-gradient(0deg, var(--coral), var(--gold));
  box-shadow: 0 0 12px rgba(255, 209, 107, 0.45);
  transition: height 0.55s var(--ease-out);
}

.meter-climber {
  position: absolute;
  bottom: var(--p, 0%);
  left: 50%;
  z-index: 2;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 2px 0 rgba(8, 4, 16, 0.3);
  color: var(--ink);
  transform: translate(-50%, 50%);
  transition: bottom 0.55s var(--ease-out);
}

.meter-climber svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.meter-top,
.meter-bottom {
  position: absolute;
  left: 50%;
  white-space: nowrap;
  transform: translateX(-50%);
}

.meter-top {
  top: 0;
  color: var(--gold);
}

.meter-bottom {
  bottom: 0;
  color: rgba(255, 244, 222, 0.6);
}

.scene-progress {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 244, 222, 0.2);
  border-radius: 9px;
  background: rgba(16, 10, 28, 0.72);
  color: rgba(255, 244, 222, 0.7);
  font-family: var(--font-pixel);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  backdrop-filter: blur(10px);
}

.scene-progress b {
  color: var(--gold);
}

.firefly-field {
  position: absolute;
  inset: 74px 72px 94px 18px;
}

.firefly {
  position: absolute;
  top: var(--y);
  left: var(--x);
  z-index: 4;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transform: translate(-50%, -50%);
  animation: firefly-float var(--dur, 5s) var(--delay, 0s) ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}

.firefly::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 234, 155, 0.55), transparent 66%);
  animation: firefly-glow 1.9s var(--delay, 0s) ease-in-out infinite;
}

.firefly-core {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff5bd;
  box-shadow: 0 0 8px #ffe28d, 0 0 18px rgba(255, 216, 112, 0.8), 0 0 35px rgba(255, 194, 92, 0.4);
}

.firefly-core::before,
.firefly-core::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 246, 196, 0.8), transparent);
  transform: translate(-50%, -50%);
}

.firefly-core::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.firefly:hover {
  transform: translate(-50%, -50%) scale(1.25);
}

.firefly.is-hinted::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  animation: hint-ping 0.9s ease-out infinite;
}

.firefly.is-caught {
  pointer-events: none;
  animation: firefly-caught 0.5s var(--ease-out) forwards;
}

@keyframes firefly-float {
  0%,
  100% {
    transform: translate(-50%, -50%) translate(0, 0);
  }
  33% {
    transform: translate(-50%, -50%) translate(7px, -11px);
  }
  66% {
    transform: translate(-50%, -50%) translate(-6px, -5px);
  }
}

@keyframes firefly-glow {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes hint-ping {
  from {
    opacity: 1;
    transform: scale(0.9);
  }
  to {
    opacity: 0;
    transform: scale(1.8);
  }
}

@keyframes firefly-caught {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  45% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.5);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -85%) scale(0.2);
  }
}

.scene-caption {
  position: absolute;
  bottom: 22px;
  left: 20px;
  z-index: 7;
  display: flex;
  max-width: min(570px, calc(100% - 100px));
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 244, 222, 0.2);
  border-radius: 12px;
  background: rgba(16, 10, 28, 0.8);
  box-shadow: 0 3px 0 rgba(4, 2, 10, 0.22);
  backdrop-filter: blur(10px);
}

.caption-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--coral);
  color: var(--ink);
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  font-weight: 700;
}

.caption-text {
  min-width: 0;
}

.caption-text span {
  display: block;
  color: var(--gold);
  font-family: var(--font-pixel);
  font-size: 0.47rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.caption-text p {
  margin-top: 3px;
  color: rgba(255, 244, 222, 0.84);
  font-size: 0.75rem;
  line-height: 1.55;
}

.scene-hint {
  position: absolute;
  right: 95px;
  bottom: 25px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 244, 222, 0.22);
  border-radius: 7px;
  background: rgba(16, 10, 28, 0.64);
  color: rgba(255, 244, 222, 0.65);
  font-family: var(--font-pixel);
  font-size: 0.52rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
  transition: background 0.16s, color 0.16s;
}

.scene-hint:hover {
  background: rgba(255, 244, 222, 0.13);
  color: var(--cream);
}

.scene-hint svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

/* ---------- Game: beach ---------- */
.beach-play::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(12, 7, 23, 0.35), transparent 22%, transparent 76%, rgba(12, 7, 23, 0.38)),
    radial-gradient(circle at 50% 55%, transparent 40%, rgba(12, 7, 23, 0.2) 100%);
}

.beach-ui-top {
  position: absolute;
  top: 17px;
  right: 17px;
  left: 17px;
  z-index: 8;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.found-tray {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(255, 244, 222, 0.22);
  border-radius: 10px;
  background: rgba(16, 10, 28, 0.7);
  backdrop-filter: blur(10px);
}

.found-tray-label {
  padding: 0 5px 0 4px;
  color: rgba(255, 244, 222, 0.62);
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tray-slot {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px dashed rgba(255, 244, 222, 0.24);
  border-radius: 6px;
  background: rgba(255, 244, 222, 0.04);
  color: rgba(255, 244, 222, 0.2);
}

.tray-slot svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.tray-slot.is-filled {
  border-style: solid;
  border-color: rgba(255, 209, 107, 0.35);
  background: rgba(255, 209, 107, 0.14);
  color: var(--gold);
  animation: slot-pop 0.35s var(--ease-bounce);
}

@keyframes slot-pop {
  from {
    transform: scale(0.6);
  }
  to {
    transform: scale(1);
  }
}

.hint-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 244, 222, 0.24);
  border-radius: 8px;
  background: rgba(16, 10, 28, 0.68);
  color: rgba(255, 244, 222, 0.74);
  font-family: var(--font-pixel);
  font-size: 0.53rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  transition: background 0.16s, color 0.16s;
}

.hint-chip:hover {
  background: rgba(255, 244, 222, 0.14);
  color: var(--cream);
}

.hint-chip:disabled {
  opacity: 0.4;
  cursor: default;
}

.hint-chip svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.search-area {
  position: absolute;
  inset: 80px 16px 94px;
  z-index: 4;
}

.beach-item {
  position: absolute;
  top: var(--y);
  left: var(--x);
  z-index: 2;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  filter: drop-shadow(0 3px 2px rgba(71, 38, 37, 0.28));
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  transition: transform 0.2s var(--ease-bounce), filter 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.beach-item svg {
  width: 31px;
  height: 31px;
  overflow: visible;
  fill: currentColor;
}

.beach-item:hover {
  filter: drop-shadow(0 3px 2px rgba(71, 38, 37, 0.28)) brightness(1.1);
  transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(1.14);
}

.beach-item.is-hinted::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--cream);
  border-radius: 50%;
  box-shadow: 0 0 18px 6px rgba(255, 238, 185, 0.55);
  animation: hint-ping 0.9s ease-out infinite;
}

.beach-item.is-found {
  pointer-events: none;
  animation: item-found 0.65s var(--ease-out) forwards;
}

@keyframes item-found {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(1);
  }
  45% {
    opacity: 1;
    transform: translate(-50%, -85%) rotate(calc(var(--r, 0deg) + 10deg)) scale(1.35);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -160%) rotate(calc(var(--r, 0deg) + 35deg)) scale(0.4);
  }
}

.beach-caption {
  position: absolute;
  bottom: 18px;
  left: 18px;
  z-index: 8;
  max-width: min(490px, calc(100% - 36px));
  padding: 11px 15px;
  border: 1px solid rgba(255, 244, 222, 0.22);
  border-radius: 11px;
  background: rgba(16, 10, 28, 0.78);
  color: rgba(255, 244, 222, 0.82);
  font-size: 0.74rem;
  line-height: 1.55;
  backdrop-filter: blur(10px);
  box-shadow: 0 3px 0 rgba(4, 2, 10, 0.2);
}

.beach-caption b {
  color: var(--gold);
  font-family: var(--font-pixel);
  font-size: 0.56rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.beach-caption p {
  margin-top: 2px;
}

.beach-progress-note {
  position: absolute;
  right: 18px;
  bottom: 22px;
  z-index: 8;
  color: rgba(255, 244, 222, 0.55);
  font-family: var(--font-pixel);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.bottle-message {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 6, 20, 0.62);
  backdrop-filter: blur(5px);
  animation: screen-in 0.35s ease both;
}

.bottle-card {
  position: relative;
  width: min(430px, 100%);
  padding: 28px 26px 24px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 7px 0 rgba(5, 3, 12, 0.4), 0 30px 60px rgba(4, 2, 10, 0.4);
  color: var(--ink);
  text-align: center;
  transform: rotate(-1deg);
}

.bottle-card::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 90px;
  height: 25px;
  background: rgba(158, 231, 200, 0.6);
  transform: translateX(-50%) rotate(2deg);
  clip-path: polygon(2% 0, 100% 3%, 97% 100%, 0 94%);
}

.bottle-icon {
  font-size: 2rem;
  line-height: 1;
}

.bottle-card .kicker {
  justify-content: center;
  color: var(--coral-deep);
}

.bottle-card h3 {
  margin-top: 9px;
  color: var(--ink);
  font-family: var(--font-script);
  font-size: 2.3rem;
  font-weight: 600;
  line-height: 1;
}

.bottle-card p {
  margin-top: 10px;
  color: #5f4b67;
  font-size: 0.82rem;
  line-height: 1.7;
}

.bottle-card .btn {
  margin-top: 19px;
}

/* ---------- Game: run ---------- */
.runner-play {
  background: #2a1b3b;
  touch-action: none;
}

#runnerCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.runner-hud {
  position: absolute;
  top: 16px;
  right: 17px;
  left: 17px;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.run-distance,
.run-hearts {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 244, 222, 0.2);
  border-radius: 9px;
  background: rgba(16, 10, 28, 0.65);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.run-label {
  margin-right: 3px;
  color: var(--gold);
  font-family: var(--font-pixel);
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.run-distance b {
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1;
}

.run-distance small {
  color: rgba(255, 244, 222, 0.5);
  font-size: 0.54rem;
}

.run-distance > span:last-child {
  color: rgba(255, 244, 222, 0.4);
  font-size: 0.52rem;
}

.run-hearts {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.run-hearts b {
  font-weight: 800;
}

.run-hearts svg {
  width: 18px;
  height: 18px;
  fill: var(--coral);
  filter: drop-shadow(0 0 5px rgba(255, 143, 127, 0.35));
}

.runner-progress {
  position: absolute;
  top: 62px;
  right: 17px;
  left: 17px;
  z-index: 6;
  height: 5px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 244, 222, 0.16);
  pointer-events: none;
}

.runner-progress > div {
  width: 0%;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--coral), var(--gold));
  transition: width 0.2s linear;
}

.run-countdown {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 20;
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: clamp(5rem, 16vw, 9rem);
  font-weight: 700;
  line-height: 1;
  text-shadow: 5px 5px 0 var(--ink), 0 0 40px rgba(255, 209, 107, 0.3);
  transform: translate(-50%, -50%);
  animation: countdown-pop 0.8s var(--ease-out) both;
  pointer-events: none;
}

@keyframes countdown-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.runner-message {
  position: absolute;
  top: 51%;
  left: 50%;
  z-index: 15;
  width: min(490px, calc(100% - 34px));
  padding: 14px 18px;
  border: 1px solid rgba(255, 244, 222, 0.22);
  border-radius: 11px;
  background: rgba(16, 10, 28, 0.82);
  color: var(--cream);
  font-size: 0.78rem;
  line-height: 1.6;
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 0 rgba(4, 2, 10, 0.24);
  pointer-events: none;
}

.runner-message b {
  color: var(--gold);
}

.jump-btn {
  position: absolute;
  right: 22px;
  bottom: 23px;
  z-index: 10;
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  gap: 0;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 5px 0 var(--ink), 0 10px 22px rgba(4, 2, 10, 0.2);
  color: var(--ink);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  transition: transform 0.12s, box-shadow 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.jump-btn:hover {
  background: var(--gold);
}

.jump-btn:active,
.jump-btn.is-pressed {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--ink);
}

.jump-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.runner-tip {
  position: absolute;
  bottom: 28px;
  left: 20px;
  z-index: 7;
  color: rgba(255, 244, 222, 0.5);
  font-family: var(--font-pixel);
  font-size: 0.51rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.5;
  pointer-events: none;
}

.runner-finish-glow {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255, 226, 155, 0.35), transparent 42%);
  animation: finish-flash 0.7s ease-out both;
}

@keyframes finish-flash {
  from {
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.run-finish-banner {
  position: absolute;
  top: 44%;
  left: 50%;
  z-index: 18;
  color: var(--cream);
  font-family: var(--font-pixel);
  font-size: clamp(3rem, 10vw, 6.5rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 0.9;
  text-align: center;
  text-shadow: 4px 4px 0 var(--ink), 0 0 40px rgba(255, 209, 107, 0.45);
  transform: translate(-50%, -50%) rotate(-2deg);
  pointer-events: none;
}

.run-finish-banner.is-visible {
  animation: finish-callout 1.7s var(--ease-bounce) both;
}

@keyframes finish-callout {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.55) rotate(-8deg);
  }
  22% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05) rotate(-2deg);
  }
  36% {
    transform: translate(-50%, -50%) scale(0.97) rotate(-2deg);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(-2deg);
  }
}

.game-spark {
  position: absolute;
  z-index: 12;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(255, 218, 137, 0.9);
  animation: game-spark-fly 0.9s ease-out forwards;
}

@keyframes game-spark-fly {
  from {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(var(--dx, 20px), var(--dy, -30px)) scale(0.1);
  }
}

/* ---------- In-game help ---------- */
.game-help {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(9, 5, 18, 0.68);
  backdrop-filter: blur(4px);
  animation: screen-in 0.25s ease both;
}

.game-help-panel {
  width: min(390px, 100%);
  padding: 25px 24px 22px;
  border: 2px solid var(--ink);
  border-radius: 15px;
  background: var(--paper);
  box-shadow: 0 6px 0 rgba(5, 3, 12, 0.4), 0 30px 60px rgba(4, 2, 10, 0.4);
  color: var(--ink);
}

.game-help-panel .kicker {
  color: var(--coral-deep);
}

.game-help-panel h3 {
  margin-top: 8px;
  color: var(--ink);
  font-family: var(--font-pixel);
  font-size: 1.75rem;
  line-height: 1;
}

.game-help-panel .how-to {
  margin: 16px 0 20px;
}

.game-help-panel .how-to li {
  font-size: 0.74rem;
}

.game-help-panel .btn {
  width: 100%;
}

/* ---------- Photo dialog ---------- */
.photo-dialog {
  width: min(1040px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 100px rgba(0, 0, 0, 0.65);
}

.photo-dialog::backdrop {
  background: rgba(8, 5, 16, 0.84);
  backdrop-filter: blur(7px);
}

.photo-dialog[open] {
  animation: dialog-in 0.35s var(--ease-out);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.viewer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  max-height: calc(100dvh - 32px);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1.5px solid rgba(255, 244, 222, 0.32);
  border-radius: 50%;
  background: rgba(17, 11, 29, 0.55);
  color: var(--cream);
  backdrop-filter: blur(8px);
  transition: background 0.16s, transform 0.16s;
}

.dialog-close:hover {
  background: var(--coral);
  color: var(--ink);
  transform: rotate(8deg);
}

.dialog-close svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.viewer-media {
  position: relative;
  display: flex;
  min-height: 420px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 143, 127, 0.1), transparent 65%),
    #1a1129;
}

.viewer-media img {
  width: 100%;
  height: 100%;
  max-height: calc(100dvh - 32px);
  object-fit: contain;
}

.viewer-number {
  position: absolute;
  bottom: 14px;
  left: 16px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 244, 222, 0.22);
  border-radius: 4px;
  background: rgba(17, 11, 29, 0.55);
  color: rgba(255, 244, 222, 0.7);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.viewer-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 4vw, 46px) clamp(22px, 3.5vw, 38px);
  overflow-y: auto;
}

.viewer-info .kicker {
  color: var(--coral-deep);
}

.viewer-info h2 {
  margin-top: 10px;
  color: var(--ink);
  font-family: var(--font-script);
  font-size: clamp(2.4rem, 4.3vw, 3.5rem);
  font-weight: 600;
  line-height: 0.95;
}

.viewer-meta {
  margin-top: 6px;
  color: #927c99;
  font-family: var(--font-pixel);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.viewer-desc {
  margin-top: 16px;
  color: var(--body-copy);
  font-size: 0.8rem;
  line-height: 1.7;
}

.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.viewer-actions .btn {
  flex: 1 1 auto;
}

.viewer-note {
  margin-top: 9px;
  color: #a18ba5;
  font-size: 0.62rem;
  line-height: 1.5;
}

.viewer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 27px;
  padding-top: 19px;
  border-top: 1px solid rgba(27, 18, 51, 0.1);
}

#photoCounter {
  color: #97819e;
  font-family: var(--font-pixel);
  font-size: 0.63rem;
  font-weight: 700;
}

/* ---------- Toasts & FX ---------- */
.toast-container {
  position: fixed;
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 16px));
  left: 50%;
  z-index: 4000;
  display: flex;
  width: min(420px, calc(100% - 30px));
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 10px 15px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--cream);
  box-shadow: 0 3px 0 var(--ink);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.4;
  animation: toast-in 0.3s var(--ease-bounce);
}

.toast.is-leaving {
  animation: toast-out 0.25s ease forwards;
}

.toast-icon {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--coral);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 800;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 3500;
  overflow: hidden;
  pointer-events: none;
}

.fx-heart,
.fx-confetti,
.fx-spark {
  position: absolute;
  display: block;
  pointer-events: none;
  will-change: transform, opacity;
}

.fx-heart {
  width: 14px;
  height: 14px;
  background: var(--coral);
  clip-path: path("M7 13C2.7 10.3 0 7.5 0 4.6 0 2.1 1.8 0 4.2 0 5.4 0 6.4.6 7 1.4 7.6.6 8.6 0 9.8 0 12.2 0 14 2.1 14 4.6 14 7.5 11.3 10.3 7 13Z");
  animation: fx-float 1.3s var(--ease-out) forwards;
}

.fx-confetti {
  width: 8px;
  height: 13px;
  border-radius: 2px;
  animation: confetti-fall 2.8s cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
}

.fx-spark {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 9px var(--gold);
  animation: spark-fly 0.85s ease-out forwards;
}

@keyframes fx-float {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(0);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -70%) scale(1) rotate(8deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift, 0px)), -160px) scale(0.7) rotate(var(--rot, 25deg));
  }
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translate3d(0, -20px, 0) rotate(0);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 0px), 105vh, 0) rotate(var(--rot, 540deg));
  }
}

@keyframes spark-fly {
  from {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(var(--dx, 20px), var(--dy, -30px)) scale(0.1);
  }
}

/* ---------- Misc ---------- */
.noscript {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 5000;
  padding: 16px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 700;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .intro-inner {
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.75fr);
    gap: 20px;
  }

  .intro-gallery {
    height: min(520px, 60vh);
    min-height: 400px;
  }

  .hud-btn span {
    display: none;
  }

  .hud-btn {
    width: 40px;
    padding: 0;
  }

  .hud-btn svg {
    width: 19px;
    height: 19px;
  }

  .hud-lock {
    top: 7px;
    right: 6px;
  }

  .world-meta span:last-child {
    display: none;
  }

  .progress-card {
    min-width: 270px;
  }
}

@media (max-width: 980px) {
  .intro-screen {
    align-items: flex-start;
    padding-top: calc(var(--hud-h) + 64px + env(safe-area-inset-top));
  }

  .intro-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .intro-copy {
    max-width: 680px;
  }

  .intro-gallery {
    width: min(570px, 100%);
    height: 350px;
    min-height: 0;
    margin: 12px auto 0;
  }

  .float-photo-one {
    width: 39%;
  }

  .float-photo-two {
    width: 42%;
    top: 18%;
  }

  .float-photo-three {
    width: 37%;
    left: 22%;
  }

  .save-badge {
    right: 0;
    bottom: 3%;
  }

  .intro-footer {
    display: none;
  }

  .map-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 24px;
  }

  .progress-card {
    width: 100%;
    min-width: 0;
  }

  .progress-card p {
    max-width: none;
  }

  .world-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .world-card:nth-child(3) {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
  }

  .world-card:nth-child(3) .world-art {
    height: 100%;
    aspect-ratio: auto;
    border-right: 2px solid var(--ink);
    border-bottom: 0;
  }

  .world-card:nth-child(3) .world-body {
    justify-content: center;
  }

  .world-card:nth-child(3) .world-body > p {
    min-height: 0;
  }

  .map-bottom {
    grid-template-columns: 1fr;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-caption {
    font-size: 1.7rem;
  }

  .polaroid-two,
  .polaroid-three,
  .polaroid-four,
  .polaroid-five,
  .polaroid-six {
    margin-top: 0;
  }

  .polaroid-two,
  .polaroid-four {
    margin-top: 24px;
  }

  .letter-layout {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 42px;
  }

  .letter-intro h1 br {
    display: none;
  }

  .letter-stage {
    padding-bottom: 20px;
  }

  .envelope-wrap {
    width: min(380px, 74vw);
  }

  .finale {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-bottom: 34px;
    text-align: center;
  }

  .finale-copy .kicker {
    justify-content: center;
  }

  .finale-copy > p:not(.kicker):not(.wish-message) {
    margin-right: auto;
    margin-left: auto;
  }

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

  .wish-message {
    text-align: center;
  }

  .cake {
    margin-top: 8px;
  }

  .viewer {
    grid-template-columns: 1fr;
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
  }

  .viewer-media {
    min-height: 0;
    max-height: 46vh;
  }

  .viewer-media img {
    max-height: 46vh;
  }

  .viewer-info {
    overflow: visible;
    padding: 25px 24px 30px;
    justify-content: flex-start;
  }

  .game-frame {
    border-radius: 16px;
  }
}

@media (max-width: 760px) {
  :root {
    --hud-h: 58px;
  }

  body {
    font-size: 15px;
  }

  .hud {
    width: calc(100% - 20px);
    gap: 4px;
    padding: 0 6px;
    border-radius: 14px;
  }

  .brand {
    gap: 7px;
    padding: 4px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
  }

  .brand-copy b {
    font-size: 0.88rem;
  }

  .brand-copy small {
    font-size: 0.46rem;
    letter-spacing: 0.18em;
  }

  .star-progress {
    gap: 4px;
    margin: 0 auto;
    padding: 5px 8px;
  }

  .star-progress-label {
    display: none;
  }

  .hud-star {
    width: 15px;
    height: 15px;
  }

  .star-count {
    min-width: 22px;
    font-size: 0.6rem;
  }

  .hud-actions {
    gap: 0;
  }

  .hud-btn {
    width: 34px;
    height: 38px;
    padding: 0;
  }

  .hud-btn svg {
    width: 18px;
    height: 18px;
  }

  .hud-lock {
    top: 5px;
    right: 4px;
  }

  .page-shell {
    padding: calc(var(--hud-h) + 44px + env(safe-area-inset-top)) 17px 30px;
  }

  .page-heading {
    gap: 18px;
    margin-bottom: 27px;
  }

  .page-heading h1 {
    font-size: clamp(2rem, 9.6vw, 3.15rem);
  }

  .page-lead {
    font-size: 0.84rem;
    line-height: 1.75;
  }

  .back-link {
    margin-bottom: 19px;
    font-size: 0.58rem;
  }

  .kicker {
    font-size: 0.62rem;
  }

  .intro-screen {
    padding: calc(var(--hud-h) + 40px + env(safe-area-inset-top)) 18px 36px;
  }

  .intro-shade {
    background:
      linear-gradient(180deg, rgba(16, 10, 30, 0.78) 0%, rgba(18, 12, 33, 0.65) 42%, rgba(16, 10, 30, 0.82) 100%),
      linear-gradient(90deg, rgba(16, 10, 30, 0.55), transparent);
  }

  .intro-bg {
    object-position: 58% 62%;
  }

  .eyebrow-pill {
    padding: 7px 11px;
    font-size: 0.52rem;
    letter-spacing: 0.09em;
  }

  .intro-happy {
    margin-top: 22px;
    margin-left: 4px;
    font-size: 2.1rem;
  }

  .intro-title {
    font-size: clamp(4rem, 20.5vw, 5.9rem);
    margin-bottom: 17px;
    text-shadow: 3px 3px 0 #3b234e, 6px 6px 0 rgba(8, 4, 16, 0.3);
  }

  .intro-lead {
    font-size: 0.86rem;
    line-height: 1.72;
  }

  .intro-actions {
    margin-top: 22px;
    gap: 9px;
  }

  .intro-actions .btn {
    flex: 1 1 100%;
  }

  .btn-large {
    min-height: 54px;
    font-size: 0.9rem;
  }

  .intro-facts {
    gap: 13px;
    margin-top: 20px;
    padding-top: 15px;
  }

  .intro-facts span {
    font-size: 0.53rem;
  }

  .dialogue-box {
    margin-top: 20px;
    padding: 11px 12px;
  }

  .dialogue-box p {
    font-size: 0.69rem;
  }

  .dialogue-avatar {
    width: 32px;
    height: 32px;
  }

  .intro-gallery {
    height: 260px;
    margin-top: 8px;
  }

  .float-photo {
    padding: 6px 6px 0;
    box-shadow: 0 4px 0 rgba(8, 4, 17, 0.45), 0 15px 30px rgba(4, 2, 11, 0.28);
  }

  .float-photo figcaption {
    padding: 5px 3px 7px;
    font-size: 0.54rem;
  }

  .float-photo-one {
    top: 3%;
    left: 2%;
    width: 45%;
  }

  .float-photo-two {
    top: 20%;
    right: 1%;
    width: 47%;
  }

  .float-photo-three {
    bottom: 1%;
    left: 18%;
    width: 42%;
  }

  .save-badge,
  .orbit {
    display: none;
  }

  .fh-one {
    top: 0;
  }

  .fh-two {
    bottom: 22%;
  }

  .progress-card {
    padding: 12px 14px;
  }

  .progress-ring {
    width: 56px;
    height: 56px;
  }

  .progress-ring span {
    font-size: 1.05rem;
  }

  .progress-card b {
    font-size: 0.77rem;
  }

  .progress-card p {
    font-size: 0.62rem;
  }

  .world-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 19px;
  }

  .world-card:nth-child(3) {
    display: flex;
    grid-column: auto;
  }

  .world-card:nth-child(3) .world-art {
    height: auto;
    aspect-ratio: 1.45;
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }

  .world-card:nth-child(3) .world-body > p {
    min-height: 0;
  }

  .world-card {
    transform: none;
  }

  .world-body {
    padding: 16px 17px 18px;
  }

  .world-body h2 {
    font-size: 1.7rem;
  }

  .world-body > p {
    min-height: 0;
    font-size: 0.77rem;
  }

  .world-goal {
    margin: 12px 0 15px;
  }

  .mini-card {
    min-height: 180px;
    gap: 15px;
    padding: 20px 17px;
  }

  .mini-photo-stack {
    width: 110px;
    height: 125px;
    flex-basis: 110px;
  }

  .mini-photo-stack img {
    width: 88px;
  }

  .mini-copy h3 {
    font-size: 1.1rem;
  }

  .mini-copy > p:not(.kicker) {
    font-size: 0.68rem;
  }

  .mini-envelope {
    width: 100px;
    height: 71px;
    flex-basis: 100px;
  }

  .mini-seal {
    width: 29px;
    height: 29px;
    font-size: 0.8rem;
  }

  .page-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-top: 38px;
    font-size: 0.7rem;
  }

  .album-screen .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .album-counter {
    padding: 8px 13px;
  }

  .album-counter-number {
    font-size: 1.7rem;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 19px 13px;
    padding: 6px 2px;
  }

  .polaroid {
    padding: 7px 7px 0;
  }

  .polaroid:hover {
    transform: rotate(var(--polaroid-rot)) translateY(-2px);
  }

  .polaroid figcaption {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 5px;
    padding: 8px 2px 11px;
  }

  .photo-number {
    padding-top: 4px;
    font-size: 0.45rem;
  }

  .photo-caption {
    font-size: 1.3rem;
  }

  .photo-meta {
    font-size: 0.39rem;
  }

  .photo-overlay {
    padding: 7px;
  }

  .photo-overlay-text {
    display: none;
  }

  .photo-cam {
    width: 27px;
    height: 27px;
  }

  .photo-cam svg {
    width: 13px;
    height: 13px;
  }

  .polaroid .photo-tape {
    width: 49px;
    height: 16px;
    top: -8px;
  }

  .album-note {
    align-items: flex-start;
    gap: 11px;
    margin-top: 29px;
    padding: 14px;
  }

  .album-note p {
    font-size: 0.7rem;
  }

  .album-note-heart {
    display: none;
  }

  .album-note-icon {
    width: 32px;
    height: 32px;
  }

  .letter-layout {
    gap: 28px;
  }

  .letter-intro h1 {
    font-size: clamp(1.8rem, 8.6vw, 3.35rem);
  }

  .letter-progress-line {
    margin-top: 21px;
  }

  .letter-progress-stars svg {
    width: 22px;
    height: 22px;
  }

  .letter-hint-box {
    margin-top: 17px;
  }

  .envelope-wrap {
    width: min(340px, 82vw);
  }

  .wax-seal {
    width: 49px;
    height: 49px;
    font-size: 1.1rem;
  }

  .letter-stage-actions {
    gap: 8px;
  }

  .letter-stage-actions .btn {
    flex: 1 1 auto;
  }

  .letter-paper {
    padding: 40px 22px 33px;
    transform: none;
  }

  .paper-stamp {
    top: 20px;
    right: 16px;
    width: 58px;
    height: 70px;
  }

  .paper-stamp svg {
    width: 17px;
    height: 17px;
  }

  .letter-paper h2 {
    padding-right: 20px;
    font-size: clamp(2.75rem, 13vw, 4rem);
  }

  .letter-body {
    margin-top: 23px;
    font-size: 0.87rem;
    line-height: 1.85;
  }

  .letter-body > p:first-child {
    font-size: 1.7rem;
  }

  .letter-signature strong {
    font-size: 1.7rem;
  }

  .letter-ps {
    font-size: 0.68rem;
  }

  .letter-actions {
    gap: 9px;
  }

  .letter-actions .btn {
    flex: 1 1 100%;
  }

  .finale {
    margin-top: 38px;
    padding: 27px 18px 20px;
  }

  .finale-copy h2 {
    font-size: 2.55rem;
  }

  .cake {
    transform: scale(0.86);
    transform-origin: center bottom;
    margin: -20px auto -14px;
  }

  .hug-row {
    flex-direction: column;
    gap: 7px;
  }

  .game-overlay {
    padding: 0;
  }

  .game-frame {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .game-chrome {
    height: 56px;
    gap: 8px;
    padding: 0 10px;
  }

  .chrome-btn {
    width: 34px;
    height: 34px;
  }

  .chrome-title span {
    font-size: 0.48rem;
  }

  .chrome-title b {
    font-size: 0.82rem;
  }

  .chrome-goal {
    padding: 5px 8px;
    font-size: 0.52rem;
  }

  .mission-view {
    align-items: flex-end;
    justify-content: center;
    padding: 15px;
  }

  .mission-view::after {
    background: linear-gradient(180deg, rgba(12, 7, 23, 0.18), rgba(12, 7, 23, 0.8) 68%);
  }

  .mission-panel {
    width: 100%;
    max-height: 82%;
    padding: 22px 19px;
    border-radius: 15px;
  }

  .mission-panel h2 {
    font-size: 2.15rem;
  }

  .mission-lead {
    font-size: 0.79rem;
  }

  .how-to {
    margin: 14px 0 17px;
  }

  .how-to li {
    font-size: 0.7rem;
  }

  .result-view {
    padding: 13px;
  }

  .result-panel {
    padding: 23px 18px;
    border-radius: 15px;
    max-height: 94%;
  }

  .result-star {
    width: 62px;
    height: 62px;
    margin-top: 4px;
  }

  .result-star svg {
    width: 33px;
    height: 33px;
  }

  .result-panel h2 {
    font-size: 2.15rem;
  }

  .result-copy {
    font-size: 0.77rem;
  }

  .result-reward {
    gap: 11px;
    margin: 15px 0 16px;
  }

  .reward-photo {
    width: 75px;
    flex-basis: 75px;
  }

  .reward-copy b {
    font-size: 1.35rem;
  }

  .reward-copy p {
    font-size: 0.6rem;
  }

  .altitude-meter {
    top: auto;
    right: 16px;
    bottom: 91px;
    left: 16px;
    width: auto;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 9px;
    border: 1px solid rgba(255, 244, 222, 0.2);
    border-radius: 8px;
    background: rgba(16, 10, 28, 0.64);
    backdrop-filter: blur(8px);
  }

  .meter-track {
    top: 50%;
    right: 57px;
    bottom: auto;
    left: 57px;
    width: auto;
    height: 5px;
    transform: translateY(-50%);
  }

  .meter-fill {
    width: var(--p, 0%);
    height: 100%;
    transition: width 0.55s var(--ease-out);
  }

  .meter-climber {
    top: 50%;
    bottom: auto;
    left: var(--p, 0%);
    width: 27px;
    height: 27px;
    transform: translate(-50%, -50%);
    transition: left 0.55s var(--ease-out);
  }

  .meter-climber svg {
    width: 14px;
    height: 14px;
  }

  .meter-top,
  .meter-bottom {
    top: 50%;
    bottom: auto;
    left: auto;
    transform: translateY(-50%);
  }

  .meter-top {
    left: 0;
    color: var(--gold);
    font-size: 0.46rem;
  }

  .meter-bottom {
    right: 0;
    font-size: 0.46rem;
  }

  .scene-progress {
    top: 12px;
    left: 12px;
    font-size: 0.51rem;
  }

  .firefly-field {
    inset: 48px 12px 142px;
  }

  .firefly {
    width: 43px;
    height: 43px;
  }

  .scene-caption {
    right: 12px;
    bottom: 14px;
    left: 12px;
    max-width: none;
    padding: 10px 12px;
  }

  .caption-text p {
    font-size: 0.69rem;
  }

  .scene-hint {
    top: 57px;
    right: 12px;
    bottom: auto;
  }

  .beach-ui-top {
    top: 10px;
    right: 10px;
    left: 10px;
    align-items: center;
  }

  .found-tray {
    gap: 3px;
    padding: 5px;
  }

  .found-tray-label {
    display: none;
  }

  .tray-slot {
    width: 25px;
    height: 25px;
  }

  .tray-slot svg {
    width: 16px;
    height: 16px;
  }

  .hint-chip {
    padding: 7px 9px;
    font-size: 0.48rem;
  }

  .search-area {
    inset: 55px 7px 90px;
  }

  .beach-item {
    width: 47px;
    height: 47px;
  }

  .beach-item svg {
    width: 29px;
    height: 29px;
  }

  .beach-caption {
    right: 10px;
    bottom: 11px;
    left: 10px;
    max-width: none;
    padding: 9px 11px;
    background: rgba(16, 10, 28, 0.95);
    font-size: 0.67rem;
    backdrop-filter: none;
  }

  .beach-progress-note {
    display: none;
  }

  .bottle-card {
    padding: 25px 19px 21px;
  }

  .runner-hud {
    top: 10px;
    right: 10px;
    left: 10px;
  }

  .run-distance,
  .run-hearts {
    padding: 6px 9px;
  }

  .run-distance b {
    font-size: 1rem;
  }

  .runner-progress {
    top: 48px;
    right: 10px;
    left: 10px;
  }

  .jump-btn {
    right: 16px;
    bottom: max(18px, env(safe-area-inset-bottom));
    width: 68px;
    height: 68px;
  }

  .runner-tip {
    bottom: max(24px, calc(env(safe-area-inset-bottom) + 6px));
    left: 14px;
    max-width: 58%;
    font-size: 0.45rem;
  }

  .runner-message {
    top: 48%;
    padding: 11px 13px;
    font-size: 0.72rem;
  }

  .photo-dialog {
    width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .viewer {
    max-height: 100dvh;
    height: 100%;
  }

  .viewer-media {
    max-height: 43vh;
    min-height: 0;
    flex: 0 0 auto;
    background: #130d20;
  }

  .viewer-media img {
    max-height: 43vh;
  }

  .viewer-info {
    padding: 23px 18px 30px;
    justify-content: flex-start;
  }

  .viewer-info h2 {
    font-size: 2.65rem;
  }

  .viewer-desc {
    margin-top: 12px;
    font-size: 0.77rem;
  }

  .viewer-actions {
    margin-top: 16px;
  }

  .viewer-nav {
    margin-top: 20px;
    padding-top: 15px;
  }

  .dialog-close {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    z-index: 20;
  }

  .toast-container {
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .toast {
    font-size: 0.72rem;
  }
}

@media (max-width: 420px) {
  .brand-copy small {
    display: none;
  }

  .brand-copy b {
    font-size: 0.8rem;
  }

  .brand-mark {
    width: 29px;
    height: 29px;
  }

  .star-progress {
    padding: 5px 6px;
  }

  .hud-btn {
    width: 31px;
  }

  .intro-title {
    font-size: clamp(3.8rem, 20vw, 5rem);
  }

  .intro-happy {
    font-size: 1.9rem;
  }

  .intro-gallery {
    height: 225px;
  }

  .float-photo-one {
    width: 46%;
  }

  .float-photo-two {
    width: 48%;
  }

  .float-photo-three {
    width: 43%;
  }

  .photo-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 360px;
    margin: 0 auto;
  }

  .polaroid-two,
  .polaroid-four {
    margin-top: 0;
  }

  .photo-caption {
    font-size: 1.6rem;
  }

  .photo-meta {
    font-size: 0.45rem;
  }

  .photo-number {
    font-size: 0.5rem;
  }

  .mini-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .mini-photo-stack {
    width: 100%;
    height: 100px;
  }

  .mini-photo-stack img {
    width: 78px;
  }

  .mini-photo-stack img:nth-child(1) {
    transform: translate(-22%, -50%) rotate(-10deg);
  }

  .mini-photo-stack img:nth-child(2) {
    transform: translate(-50%, -52%) rotate(2deg);
  }

  .mini-photo-stack img:nth-child(3) {
    transform: translate(-78%, -48%) rotate(11deg);
  }

  .letter-mini {
    flex-direction: row;
    align-items: center;
  }

  .mini-envelope {
    flex-basis: 86px;
    width: 86px;
    height: 61px;
  }

  .cake {
    transform: scale(0.75);
    margin: -32px auto -28px;
  }
}

@media (max-height: 720px) and (min-width: 981px) {
  .intro-gallery {
    height: 440px;
    min-height: 340px;
  }

  .intro-copy {
    padding-bottom: 0;
  }

  .intro-happy {
    margin-top: 17px;
  }

  .intro-lead {
    font-size: 0.88rem;
  }

  .intro-facts {
    margin-top: 18px;
    padding-top: 14px;
  }

  .dialogue-box {
    margin-top: 17px;
  }

  .intro-footer {
    display: none;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .intro-bg {
    animation: none;
    transform: scale(1.03);
  }

  .float-photo,
  .floating-heart,
  .floating-spark,
  .save-dot,
  .live-dot,
  .title-heart {
    animation: none !important;
  }

  .fx-confetti,
  .fx-heart,
  .fx-spark {
    display: none;
  }
}
