/* =============================================================================
   DADDY'S BIRTHDAY QUEST
   Two worlds: an 8-bit puzzle game, then a quiet short film.
   All copy/config lives in config.js — this file is only presentation.
   ============================================================================= */

:root {
  --pixel: "Press Start 2P", "Courier New", monospace;
  --mono: "Courier New", ui-monospace, monospace;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;

  --ink: #f4f1ff;
  --muted: #9d93bf;
  --bg: #08060f;
  --bg-2: #0e0a1c;
  --purple: #7b57d6;
  --gold: #ffd166;
  --pink: #ff8fa3;
  --green: #6ee7b7;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--sans);
  overscroll-behavior-y: none;
}

button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }

.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;
}

.is-hidden { display: none !important; }

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

/* =============================================================================
   LOADER — pure black terminal
   ============================================================================= */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: max(30px, calc(var(--safe-top) + 26px)) max(20px, calc(var(--safe-left) + 20px)) max(28px, var(--safe-bottom) + 24px);
  background: #000;
  transition: opacity .65s ease;
}
.loader.is-leaving { opacity: 0; pointer-events: none; }

.loader__inner {
  width: 100%;
  max-width: 820px;
  font-family: var(--pixel);
  font-size: clamp(8px, 2.35vw, 13px);
  line-height: 2.5;
  letter-spacing: .02em;
  color: #fff;
}

.loader__lines p { margin: 0; min-height: 1.5em; white-space: pre-wrap; word-break: break-word; }
.loader__lines p.dim { color: #9b9b9b; }
.loader__lines p.loud { color: #fff; letter-spacing: .05em; }
.loader__lines p.ok { color: #b9ffcf; }
.cmd-prompt { color: #707070; margin-right: .85em; white-space: nowrap; }
.caret {
  display: inline-block;
  width: .6em;
  height: 1.05em;
  margin-left: .12em;
  background: currentColor;
  vertical-align: -.18em;
  animation: blink .9s steps(1, end) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* =============================================================================
   GAME — retro pixel world
   ============================================================================= */
.game {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding:
    calc(24px + var(--safe-top))
    calc(16px + var(--safe-right))
    calc(18px + var(--safe-bottom))
    calc(16px + var(--safe-left));
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(96, 56, 170, .42), transparent 70%),
    radial-gradient(ellipse 70% 45% at 50% 110%, rgba(40, 20, 80, .5), transparent 75%),
    linear-gradient(180deg, #0b0818 0%, #08060f 55%, #0a0716 100%);
  overflow: hidden;
  transition: opacity .7s ease, transform .7s ease, filter .7s ease;
}
.game.is-gone { opacity: 0; transform: scale(1.04); filter: blur(6px); pointer-events: none; }

.stars {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.55) 50%, transparent 50%),
    radial-gradient(1px 1px at 78% 12%, rgba(255,255,255,.4) 50%, transparent 50%),
    radial-gradient(2px 2px at 64% 30%, rgba(190,160,255,.35) 50%, transparent 50%),
    radial-gradient(1px 1px at 32% 62%, rgba(255,255,255,.3) 50%, transparent 50%),
    radial-gradient(1px 1px at 88% 74%, rgba(255,255,255,.35) 50%, transparent 50%),
    radial-gradient(2px 2px at 20% 86%, rgba(255,255,255,.2) 50%, transparent 50%);
  background-size: 320px 320px;
  opacity: .8;
  animation: drift 26s linear infinite;
}
@keyframes drift { to { background-position: -320px 160px; } }

.game::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(0,0,0,.22) 3px 4px);
  opacity: .55;
  mix-blend-mode: multiply;
}

.game__header {
  text-align: center;
  width: 100%;
  max-width: 760px;
  position: relative;
  z-index: 2;
}

.eyebrow {
  font-family: var(--mono);
  font-size: clamp(9px, 2.5vw, 12px);
  letter-spacing: .18em;
  color: #7d6ba8;
  margin: 0 0 14px;
}

.game h1 {
  font-family: var(--pixel);
  font-size: clamp(14px, 4.55vw, 30px);
  line-height: 1.65;
  letter-spacing: .01em;
  margin: 0;
  color: #fff;
  text-shadow:
    0 0 0 #000,
    3px 3px 0 #3a1f66,
    0 0 24px rgba(167, 121, 255, .45);
}
.game h1 span { display: block; }
.game h1 span:first-child { color: var(--gold); text-shadow: 3px 3px 0 #6b4a00, 0 0 26px rgba(255,209,102,.4); }

.subtitle {
  font-family: var(--mono);
  font-size: clamp(11px, 3.1vw, 15px);
  color: #c3b6e6;
  margin: 15px 0 0;
}

.progress {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 9px 13px;
  border: 1px solid rgba(160, 130, 235, .28);
  background: rgba(18, 12, 36, .8);
  font-family: var(--pixel);
  font-size: 8px;
  color: #b9a8e0;
}
.progress__label { color: #74629e; }
.progress__pips { display: inline-flex; gap: 5px; }
.pip {
  width: 8px; height: 8px;
  background: #2b2046;
  box-shadow: inset 0 0 0 1px #46346e;
  transition: background .3s ease, box-shadow .3s ease;
}
.pip.is-on { background: var(--gold); box-shadow: 0 0 10px rgba(255,209,102,.8); }
.progress__count { color: var(--gold); }

/* ---------- Gift grid ---------- */
.gift-grid {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 720px;
  margin: auto 0;
  padding: 18px 0 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(10px, 3vw, 22px);
}

.gift {
  --body: #5632a8; --dark: #332064; --lid: #7b57d6; --ribbon: #ffd166; --glow: #a98bff;
  position: relative;
  flex: 0 0 calc(50% - 6px);
  max-width: 205px;
  min-height: 150px;
  padding: 10px 4px 9px;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  font-family: var(--pixel);
  transition: transform .2s ease, filter .2s ease;
}
.gift:nth-child(5) { flex-basis: calc(50% - 6px); }
.gift:active { transform: scale(.95); }
.gift:hover { filter: brightness(1.12); }

.gift__glow {
  position: absolute;
  left: 50%; top: 42%;
  width: 130px; height: 130px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 68%);
  opacity: .18;
  filter: blur(14px);
  pointer-events: none;
  transition: opacity .4s ease;
}
.gift:hover .gift__glow, .gift.is-unlocked .gift__glow { opacity: .38; }

.gift__float {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: bob 3.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -.62s);
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-9px) rotate(1deg); }
}

.gift__q {
  font-size: clamp(17px, 5vw, 24px);
  line-height: 1;
  color: var(--ribbon);
  text-shadow: 0 0 16px var(--glow);
  margin-bottom: 0;
  transition: transform .3s ease, opacity .3s ease;
}
.gift.is-unlocked .gift__q { color: var(--green); text-shadow: 0 0 16px var(--green); }

.gift__art {
  width: min(100%, 96px);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 8px 6px rgba(0,0,0,.55));
}
.gift__lid { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .5s steps(6, end); }
.gift.is-opening .gift__lid,
.gift.is-unlocked .gift__lid { transform: translate(-13px, -19px) rotate(-17deg); }

.spark {
  position: absolute;
  left: 50%; top: 46%;
  width: 5px; height: 5px;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.gift.is-opening .spark { animation: spark .75s steps(5, end) forwards; }
.gift.is-opening .s1 { --dx: -46px; --dy: -44px; animation-delay: .04s; background: var(--ribbon); }
.gift.is-opening .s2 { --dx: 42px;  --dy: -38px; animation-delay: .12s; background: #fff; }
.gift.is-opening .s3 { --dx: -30px; --dy: 26px;  animation-delay: .2s;  background: var(--glow); }
.gift.is-opening .s4 { --dx: 48px;  --dy: 18px;  animation-delay: .28s; background: var(--ribbon); }
@keyframes spark {
  0% { opacity: 1; transform: translate(0,0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.2); }
}

.gift__name {
  margin-top: 6px;
  font-size: clamp(7px, 2vw, 9px);
  line-height: 1.7;
  text-align: center;
  color: #e7e0ff;
  letter-spacing: .02em;
}
.gift__status {
  margin-top: 5px;
  font-size: clamp(6px, 1.8vw, 8px);
  letter-spacing: .06em;
  color: #6f608f;
}
.gift__status::before { content: "◇ "; }
.gift.is-unlocked .gift__status { color: var(--green); }
.gift.is-unlocked .gift__status::before { content: "◆ "; }
.gift.is-unlocked .gift__name { color: var(--green); }

/* Gifts that are still waiting for the previous one to be solved. */
.gift.is-locked { opacity: .5; filter: saturate(.45); cursor: not-allowed; }
.gift.is-locked:hover { filter: saturate(.45); }
.gift.is-locked:active { transform: none; }
.gift.is-locked .gift__glow { opacity: .04; }
.gift.is-locked .gift__status { color: #5b5075; }
.gift.is-locked .gift__status::before { content: "▣ "; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 60;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 13px 16px;
  background: #120b22;
  border: 2px solid #6b4bab;
  box-shadow: 0 0 26px rgba(123, 87, 214, .4);
  font-family: var(--pixel);
  font-size: 9px;
  line-height: 1.8;
  text-align: center;
  color: var(--gold);
  animation: toastIn .25s ease both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.gift:focus-visible,
.chip:focus-visible,
.btn:focus-visible,
.window__x:focus-visible,
.answer-input:focus-visible,
.finale-end__button:focus-visible,
.skip-btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

/* ---------- Footer ---------- */
.game__footer {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
}
.footer__hint {
  font-family: var(--mono);
  font-size: clamp(9px, 2.5vw, 12px);
  color: #5d5280;
  margin: 0 0 10px;
}
.chip-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.chip {
  border: 1px solid rgba(160,130,235,.32);
  background: rgba(20,14,40,.75);
  color: #b9a8e0;
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: .04em;
  padding: 11px 13px;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.chip:hover { color: #fff; border-color: var(--purple); background: rgba(40,25,75,.9); }
.chip.is-confirm { color: #ffb3b3; border-color: #a54d5c; }

/* =============================================================================
   WINDOWS (challenge + reveal)
   ============================================================================= */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(18px + var(--safe-top)) calc(14px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(14px + var(--safe-left));
  background: rgba(3, 2, 8, .86);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fadeIn .28s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.window {
  width: min(560px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  background: linear-gradient(180deg, #120c22 0%, #0b0716 100%);
  border: 3px solid #000;
  box-shadow:
    0 0 0 3px #6b4bab,
    0 0 0 6px #0a0714,
    0 0 40px rgba(123, 87, 214, .35),
    0 26px 70px rgba(0,0,0,.7);
  animation: windowIn .35s cubic-bezier(.2,.9,.2,1.2) both;
}
@keyframes windowIn {
  from { opacity: 0; transform: translateY(18px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.window__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  background: var(--purple);
  color: #fff;
  font-family: var(--pixel);
  font-size: clamp(8px, 2.2vw, 11px);
  line-height: 1.5;
}
.window__bar-deco { font-size: 10px; color: #ffd166; }
.window__x {
  flex: none;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  background: transparent;
  color: #fff;
  font-family: var(--mono);
  font-size: 20px;
  line-height: 1;
}
.window__x:hover { background: rgba(255,255,255,.18); }

.window__body { padding: clamp(18px, 5vw, 30px); }

.clue {
  font-family: var(--pixel);
  font-size: clamp(11px, 3.2vw, 15px);
  line-height: 1.95;
  color: #f1ecff;
  margin: 0 0 14px;
  padding: 14px;
  background: rgba(0, 0, 0, .3);
  text-shadow: 0 0 14px rgba(180,140,255,.2);
}
.instruction {
  font-family: var(--mono);
  font-size: clamp(12px, 3.2vw, 14px);
  line-height: 1.65;
  color: #a99acd;
  margin: 0 0 20px;
}

.answer-input {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  border: 2px solid #4c3a78;
  background: #090613;
  color: #fff;
  font-family: var(--mono);
  font-size: 16px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.answer-input::placeholder { color: #574c74; }
.answer-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,209,102,.12); }
.answer-input.is-wrong { animation: shake .35s ease; border-color: #ff6b81; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.feedback {
  min-height: 1.4em;
  margin: 10px 0 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: #ff8fa3;
}
.feedback.is-good { color: var(--green); }

.answer-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  border: 3px solid #000;
  padding: 14px 16px;
  font-family: var(--pixel);
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.4;
  box-shadow: 0 4px 0 #000;
  transition: transform .12s ease, box-shadow .12s ease, filter .2s ease;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.btn--primary { background: var(--gold); color: #241800; }
.btn--primary:hover { filter: brightness(1.1); }
.btn--ghost { background: transparent; color: #b9a8e0; box-shadow: 0 4px 0 #000, inset 0 0 0 2px #4c3a78; }
.btn--ghost:hover { color: #fff; }
.btn--wide { width: 100%; margin-top: 24px; }

.hint {
  margin: 20px 0 0;
  padding: 13px 14px;
  border-left: 3px solid var(--gold);
  background: rgba(255,209,102,.07);
  color: #e9dcb4;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  animation: fadeIn .3s ease both;
}

/* ---------- Reveal ---------- */
.reveal__body { text-align: center; }
.reveal__message {
  font-family: var(--pixel);
  font-size: clamp(12px, 3.4vw, 18px);
  line-height: 1.7;
  color: var(--gold);
  margin: 0 0 16px;
  animation: pop .45s cubic-bezier(.2,1.5,.3,1) both;
}
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.reveal__title {
  font-family: var(--pixel);
  font-size: clamp(13px, 3.8vw, 20px);
  line-height: 1.6;
  color: #fff;
  margin: 0 0 22px;
}
.reveal__content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
}
.reveal__content p {
  font-family: var(--mono);
  font-size: clamp(12px, 3.2vw, 14px);
  line-height: 1.75;
  color: #c4b7e4;
  margin: 0;
}
.reveal__content pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  background: #07050e;
  border: 1px solid #3b2c60;
  color: #86f0b5;
  font-family: var(--mono);
  font-size: clamp(10px, 2.9vw, 13px);
  line-height: 1.7;
  text-align: left;
}
.reveal__content img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,.16);
}
.reveal__content figure { margin: 0; }
.reveal__content figcaption {
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  color: #8f80b4;
}
.reveal-badge {
  border: 2px dashed rgba(255,209,102,.5);
  padding: 18px 14px;
  background: rgba(255,209,102,.05);
}
.reveal-badge__kicker {
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: .1em;
  color: var(--gold);
  margin: 0 0 12px;
}
.reveal-badge__title {
  font-family: var(--pixel);
  font-size: clamp(13px, 3.6vw, 18px);
  color: #fff;
  margin: 0 0 12px;
  line-height: 1.5;
}
.reveal-badge__text { font-family: var(--mono) !important; color: #c4b7e4 !important; }

/* =============================================================================
   FINALE — the other world
   ============================================================================= */
.finale {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #000;
  overflow: hidden;
  animation: fadeIn 1.1s ease both;
}

.message-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(28px + var(--safe-top)) calc(24px + var(--safe-right)) calc(28px + var(--safe-bottom)) calc(24px + var(--safe-left));
  pointer-events: none;
}
.finale-message {
  margin: 0;
  max-width: 22ch;
  text-align: center;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(25px, 6.4vw, 48px);
  line-height: 1.38;
  letter-spacing: .015em;
  color: #f6f2ee;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--fade, .9s) ease, transform var(--fade, .9s) ease;
  text-shadow: 0 0 42px rgba(255,255,255,.14);
}
.finale-message.is-visible { opacity: 1; transform: translateY(0); }
.finale-message.is-leaving { opacity: 0; transform: translateY(-10px); }

/* ---------- Rolling credits ---------- */
.credits {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  padding: 50vh max(18px, var(--safe-right)) calc(14vh + var(--safe-bottom)) max(18px, var(--safe-left));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(30px, 6vh, 62px);
  will-change: transform;
}
.credits.is-rolling { animation: creditRoll var(--roll, 52s) linear forwards; }
@keyframes creditRoll {
  0% { transform: translateY(0); }
  100% { transform: translateY(calc(-100% + 12vh)); }
}

/* The final on-screen message is moved into the track itself, so it keeps
   its exact look and physically travels upward as the first credit line. */
.credits .finale-message.is-credit {
  opacity: 1;
  transform: translateY(-50%);
  transition: none;
  max-width: 22ch;
  font-size: clamp(25px, 6.4vw, 48px);
  line-height: 1.38;
  letter-spacing: .015em;
  margin: 0;
}

.credit-line {
  margin: 0;
  max-width: 24ch;
  text-align: center;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(24px, 5.6vw, 42px);
  line-height: 1.35;
  letter-spacing: .02em;
  color: #f4f0eb;
}
.credit-line.is-italic { font-style: italic; font-size: clamp(21px, 4.8vw, 34px); color: #cfc7d8; }
.credit-space--small { height: 3vh; }
.credit-space--large { height: 7vh; }

.photo-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2.5vw, 24px);
  width: 100%;
}
.photo-group--pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  gap: clamp(14px, 2vw, 28px);
  width: min(92vw, 900px);
}
.photo-group--single { width: min(86vw, 640px); }

/* Photos are part of the moving track from frame one: they enter from the
   bottom edge on their own, with no pop-in fade or random timing.
   The real photos are portraits of different ratios, so height is capped
   and width is left automatic — nothing gets cropped or stretched. */
.credit-photo {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.credit-photo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 58vh;
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 22px 60px rgba(0,0,0,.8);
  background: #0d0d0f;
}
.credit-photo figcaption {
  margin-top: 11px;
  font-family: var(--sans);
  font-size: clamp(9px, 2.4vw, 11px);
  font-weight: 400;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: rgba(255,255,255,.42);
  text-align: center;
}

/* ---------- End card ---------- */
.finale-end {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(38px + var(--safe-bottom));
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  padding: 0 20px;
  animation: fadeIn 2s ease both;
  pointer-events: none;
}
.finale-end__text {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(19px, 5vw, 28px);
  letter-spacing: .02em;
  color: rgba(255,255,255,.8);
}
.finale-end__button {
  pointer-events: auto;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.7);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  padding: 12px 18px;
  transition: color .3s ease, border-color .3s ease;
}
.finale-end__button:hover { color: #fff; border-color: #fff; }

.skip-btn {
  position: fixed;
  top: calc(20px + var(--safe-top));
  right: calc(18px + var(--safe-right));
  z-index: 6;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.26);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  padding: 10px 4px;
  transition: color .3s ease;
}
.skip-btn:hover { color: rgba(255,255,255,.75); }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 599px) {
  /* Portrait photos need the full phone width one by one, not two tiny tiles. */
  .photo-group--pair { grid-template-columns: 1fr; width: min(80vw, 420px); }
  .credit-photo img { max-height: 56vh; }
}

@media (min-width: 600px) {
  .gift { flex-basis: 190px; min-height: 190px; }
  .gift-grid { gap: 24px; padding: 40px 0 30px; }
  .gift__q { font-size: 27px; }
  .gift__art { width: 124px; }
}

@media (min-width: 900px) {
  .game { padding-top: calc(50px + var(--safe-top)); }
  .game h1 { font-size: 30px; }
  .gift-grid { max-width: 820px; gap: 30px; }
  .photo-group--single { width: min(52vw, 620px); }
}

@media (max-width: 359px) {
  .gift { min-height: 150px; padding-inline: 2px; }
  .gift-grid { gap: 7px; padding-top: 24px; }
  .gift__art { width: 96px; }
  .progress { gap: 6px; padding: 8px 9px; font-size: 7px; }
  .photo-group--pair { grid-template-columns: 1fr; width: min(86vw, 380px); }
}

@media (max-height: 680px) and (max-width: 599px) {
  .game { padding-top: calc(14px + var(--safe-top)); padding-bottom: calc(10px + var(--safe-bottom)); }
  .eyebrow { margin-bottom: 8px; }
  .game h1 { font-size: clamp(12px, 4vw, 15px); line-height: 1.5; }
  .subtitle { margin-top: 10px; }
  .progress { margin-top: 10px; padding: 6px 9px; }
  .gift-grid { padding: 10px 0 8px; gap: 6px; }
  .gift { min-height: 126px; padding: 6px 2px 5px; }
  .gift__art { width: 76px; }
  .gift__q { font-size: 17px; }
  .gift__name { margin-top: 4px; }
  .gift__status { margin-top: 3px; }
  .footer__hint { display: none; }
}

/* =============================================================================
   REDUCED MOTION — still complete, just still
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .stars { display: none; }
  .caret { display: none; }
  .credits { transition: none !important; }
}

body.reduced-motion .game.is-gone { opacity: 0; transform: none; filter: none; }
body.reduced-motion .finale { overflow-y: auto; }
body.reduced-motion .message-stage { position: relative; min-height: 100dvh; }
body.reduced-motion .finale-message { transition: none; }
body.reduced-motion .credits {
  position: relative;
  top: auto;
  padding-top: 8vh;
  padding-bottom: 18vh;
  transform: none !important;
  animation: none !important;
  opacity: 1 !important;
}
body.reduced-motion .credit-photo { opacity: 1; transform: none; }
body.reduced-motion .credits .finale-message.is-credit { transform: none; }
body.reduced-motion .finale-end { position: relative; bottom: auto; padding: 20px 20px 60px; }
