/* ==========================================================================
   QUEST — shared stylesheet of the game-style invitation templates.
   The world is drawn on #world by /assets/js/quest-engine.js; everything else
   here is the HTML layer on top of it: title screen, HUD, dialog sheet,
   reading mode, quest log, photo booth, lightbox. The invitation's sections
   live in #stations and are moved (not copied) into whichever overlay shows
   them. Colours and fonts are custom properties: each template's own
   css/style.css only overrides them (the defaults are Petualangan Joglo's).
   ========================================================================== */

:root {
  --ink: #2a1a10;
  --wood: #5a3519;
  --wood-2: #8a5a2b;
  --paper: #f7eed6;
  --paper-2: #efe1bd;
  --gold: #e8b64a;
  --gold-2: #f6d77d;
  --maroon: #8c2f1c;
  --leaf: #3e6b2a;
  --sky: #10202b;
  --px: 'Pixelify Sans', 'Courier New', monospace;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --disp: var(--px);
  --bg: #1d3317;
  --hud: rgba(42, 26, 16, .86);
  --line: rgba(138, 90, 43, .35);
  --scrim: rgba(10, 16, 10, .45);
  --card: #fffdf6;
  --on-accent: #fff3dc;
  --muted: #6f5236;
  --ok: #4f8a33;
  --bank-a: #3b2414;
  --bank-b: #6b4020;
  --booth-bg: #17110b;
  --booth-panel: #241a12;
  --cover-bg:
    radial-gradient(ellipse at 50% 40%, rgba(16, 32, 43, .35), rgba(16, 32, 43, .82) 70%),
    linear-gradient(180deg, rgba(10, 18, 12, .55), rgba(10, 18, 12, .2) 40%, rgba(10, 18, 12, .75));
  --vh: 1vh;
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body { overflow: hidden; overscroll-behavior: none; }

button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: var(--maroon); }
[hidden] { display: none !important; }

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

/* ---------- the world ---------- */
#game {
  position: fixed;
  inset: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: pointer;
}

/* ---------- pixel UI primitives ---------- */
.btn-px {
  --bg: var(--gold);
  --fg: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  min-height: 44px;
  padding: .6em 1.1em;
  border: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--px);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .02em;
  text-decoration: none;
  box-shadow:
    0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink),
    -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink),
    inset 0 -4px 0 0 rgba(0, 0, 0, .22),
    inset 0 3px 0 0 rgba(255, 255, 255, .35);
  margin: 3px;
  transition: transform .08s;
}
.btn-px:active { transform: translateY(2px); box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 0 3px 0 0 rgba(0, 0, 0, .25); }
.btn-px:focus-visible { outline: 3px dashed var(--gold-2); outline-offset: 5px; }
.btn-px:disabled { opacity: .6; cursor: wait; }
.btn-px--dark { --bg: var(--wood); --fg: var(--paper); }
.btn-px--red { --bg: var(--maroon); --fg: var(--on-accent); }
.btn-px--green { --bg: var(--ok); --fg: #fff; }
.btn-px--sm { min-height: 36px; padding: .4em .8em; font-size: 13px; }
.btn-px--block { display: flex; width: calc(100% - 6px); }

.frame {
  position: relative;
  background: var(--paper);
  box-shadow:
    0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink),
    -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink),
    inset 0 0 0 3px var(--gold),
    inset 0 0 0 6px var(--wood-2);
}

.px-title {
  font-family: var(--disp);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
}

/* ---------- title screen ---------- */
.cover {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    var(--cover-bg);
  overflow-y: auto;
  transition: opacity .7s ease, visibility .7s;
}
.cover.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }

.cover-card {
  width: 100%;
  max-width: 400px;
  margin: auto;
  padding: 26px 22px 22px;
  text-align: center;
  animation: coverIn .8s cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes coverIn { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }

.cover-kicker {
  margin: 0 0 6px;
  font-family: var(--px);
  font-size: 12px;
  letter-spacing: .25em;
  color: var(--maroon);
}
.cover-names {
  font-size: clamp(30px, 9vw, 40px);
  color: var(--ink);
  text-shadow: 3px 3px 0 var(--gold-2);
}
.cover-names .amp { display: block; font-size: .55em; color: var(--maroon); margin: 2px 0; text-shadow: none; }
.cover-date {
  margin: 12px 0 0;
  font-family: var(--px);
  font-size: 15px;
  color: var(--wood);
}
.cover-guest {
  margin: 16px auto 0;
  padding: 10px 12px;
  background: var(--paper-2);
  border: 2px dashed var(--wood-2);
}
.cover-guest p { margin: 0; font-size: 12px; color: var(--wood); }
.cover-guest .guest-name {
  margin-top: 2px;
  font-family: var(--px);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  word-break: break-word;
}
.cover-label {
  margin: 16px 0 6px;
  font-family: var(--px);
  font-size: 13px;
  color: var(--wood);
}
.avatar-pick { display: flex; justify-content: center; gap: 10px; }
.avatar-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 96px;
  padding: 8px 4px 6px;
  border: 3px solid var(--wood-2);
  background: var(--card);
  font-family: var(--px);
  font-size: 12px;
}
.avatar-opt canvas { width: 54px; height: 72px; image-rendering: pixelated; }
.avatar-opt[aria-pressed="true"] { border-color: var(--maroon); background: var(--gold-2); box-shadow: 0 0 0 2px var(--ink); }
.cover-start { margin-top: 18px; font-size: 17px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { filter: brightness(1.12); transform: scale(1.03); } }
.cover-alt {
  margin-top: 12px;
  background: none;
  border: 0;
  font-size: 13px;
  color: var(--wood);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px;
}
.cover-help { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 10px 0;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-quest {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 0;
  background: var(--hud);
  color: var(--paper);
  font-family: var(--px);
  font-size: 13px;
  text-align: left;
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px var(--ink);
  margin: 4px;
}
.hud-count { flex: none; color: var(--gold-2); font-weight: 700; }
.hud-goal { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-btn {
  flex: none;
  width: 40px; height: 40px;
  margin: 4px 2px;
  border: 0;
  background: var(--hud);
  color: var(--gold-2);
  font-family: var(--px);
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px var(--ink);
}
.hud-btn.is-off { color: #8b7a66; text-decoration: line-through; }

.hint {
  position: absolute;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 7px 12px;
  background: var(--hud);
  color: var(--paper);
  font-family: var(--px);
  font-size: 12.5px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--ink);
  transition: opacity .5s;
}
.hint.is-gone { opacity: 0; }

.act-btn {
  position: absolute;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  font-size: 16px;
  animation: actIn .25s ease-out both;
}
@keyframes actIn { from { transform: scale(.6); opacity: 0; } }

/* ---------- dialog sheet ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
}
.overlay-bg {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  animation: fadeIn .25s ease both;
}
@keyframes fadeIn { from { opacity: 0; } }

.sheet-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: calc(100% - 64px);
  margin: 4px;
  animation: sheetIn .32s cubic-bezier(.2, .9, .3, 1.1) both;
}
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } }

.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 3px dotted var(--wood-2);
}
.face {
  flex: none;
  width: 54px; height: 54px;
  background: #cfe3a8;
  box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 3px var(--gold);
  image-rendering: pixelated;
}
.sheet-who { flex: 1; min-width: 0; }
.sheet-speaker {
  margin: 0;
  font-family: var(--px);
  font-weight: 700;
  font-size: 14px;
  color: var(--maroon);
}
.sheet-line {
  margin: 3px 0 0;
  min-height: 2.6em;
  font-family: var(--px);
  font-size: 15px;
  line-height: 1.35;
  cursor: pointer;
}
.sheet-line.is-typing::after { content: '▌'; animation: blink .7s steps(1) infinite; color: var(--wood-2); }
@keyframes blink { 50% { opacity: 0; } }
.sheet-x {
  flex: none;
  width: 36px; height: 36px;
  border: 0;
  background: var(--ink);
  color: var(--gold-2);
  font-family: var(--px);
  font-size: 16px;
}
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px 18px 6px;
}
.sheet-foot {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 3px dotted var(--wood-2);
}
.sheet-foot .btn-px { flex: 1; }

/* ---------- reading mode / quest log / finale ---------- */
.overlay--full { align-items: stretch; padding: 0; }
.overlay--center { align-items: center; }
.reader {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: 0 0 0 4px var(--ink), inset 0 0 0 3px var(--gold);
  animation: fadeIn .3s ease both;
}
.reader-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: var(--ink);
  color: var(--gold-2);
}
.reader-bar h2 { flex: 1; font-size: 16px; }
.reader-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px 18px calc(30px + env(safe-area-inset-bottom));
}
.reader-scroll > .st { padding: 22px 0; border-bottom: 3px dotted var(--wood-2); }
.reader-scroll > .st:last-child { border-bottom: 0; }
.st-head { display: none; }
.reader-scroll .st-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.reader-scroll .st-head span {
  flex: none;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  background: var(--gold);
  font-family: var(--px);
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--ink);
}
.reader-scroll .st-head h3 { font-size: 18px; color: var(--maroon); }

.log-box, .finale-box {
  width: 100%;
  max-width: 460px;
  max-height: calc(100% - 20px);
  display: flex;
  flex-direction: column;
  margin: 4px;
  animation: sheetIn .3s ease both;
}
.log-head {
  display: flex;
  align-items: center;
  padding: 14px 14px 10px 18px;
  border-bottom: 3px dotted var(--wood-2);
}
.log-head h2 { flex: 1; font-size: 18px; color: var(--maroon); }
.log-list { list-style: none; margin: 0; padding: 8px 12px 14px; overflow-y: auto; }
.log-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 2px dashed var(--line);
}
.log-item:last-child { border-bottom: 0; }
.log-mark {
  flex: none;
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  font-family: var(--px);
  font-weight: 700;
  background: #d9c9a3;
  color: var(--wood);
  box-shadow: 0 0 0 2px var(--ink);
}
.log-item.is-done .log-mark { background: var(--ok); color: #fff; }
.log-item.is-next .log-mark { background: var(--gold); color: var(--ink); animation: pulse 1.4s infinite; }
.log-text { flex: 1; min-width: 0; }
.log-text b { display: block; font-family: var(--px); font-size: 14px; }
.log-text small { color: var(--wood); font-size: 12px; }
.log-acts { flex: none; display: flex; gap: 2px; }

.finale-box { text-align: center; padding: 24px 20px 18px; }
.finale-box .trophy { font-size: 46px; line-height: 1; margin-bottom: 8px; }
.finale-box h2 { font-size: 24px; color: var(--maroon); }
.finale-box p { margin: 10px 0 0; line-height: 1.55; }
.finale-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 16px; }

/* ---------- section content ---------- */
.st h4, .st .h4 {
  margin: 0 0 6px;
  font-family: var(--px);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
}
.st p { margin: 0 0 10px; line-height: 1.6; font-size: 15px; }
.st .muted { color: var(--muted); font-size: 13.5px; }
.st .center { text-align: center; }
.st .lead { font-size: 16px; }
.st .script {
  font-family: var(--px);
  font-size: 22px;
  color: var(--maroon);
  margin: 4px 0;
}

.verse {
  margin: 14px 0 4px;
  padding: 14px 16px;
  background: var(--paper-2);
  border-left: 5px solid var(--gold);
  font-style: italic;
  line-height: 1.65;
}
.verse cite { display: block; margin-top: 6px; font-style: normal; font-family: var(--px); font-size: 13px; color: var(--maroon); }

.portrait {
  width: 180px;
  max-width: 70%;
  aspect-ratio: 4 / 5;
  margin: 2px auto 14px;
  padding: 6px;
  background: var(--wood);
  box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 3px var(--gold);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.person-name { font-family: var(--px); font-weight: 700; font-size: 22px; text-align: center; margin: 0 0 4px; }
.person-name em { font-style: normal; color: var(--maroon); }
.ig-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-family: var(--px);
  font-size: 13px;
}

.card {
  margin: 0 0 14px;
  padding: 14px 14px 12px;
  background: var(--card);
  box-shadow: 0 0 0 3px var(--wood-2), 4px 4px 0 3px rgba(42, 26, 16, .25);
}
.card-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 8px;
  background: var(--maroon);
  color: var(--on-accent);
  font-family: var(--px);
  font-size: 12px;
  letter-spacing: .05em;
}
.ev-date { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; }
.ev-day {
  flex: none;
  width: 58px;
  padding: 6px 0;
  text-align: center;
  background: var(--gold);
  font-family: var(--px);
  box-shadow: 0 0 0 2px var(--ink);
}
.ev-day b { display: block; font-size: 24px; line-height: 1; }
.ev-day small { font-size: 11px; }
.ev-meta { font-size: 14px; line-height: 1.5; }
.ev-meta b { font-family: var(--px); font-size: 15px; }
.ev-place { margin: 8px 0 10px; font-size: 14px; line-height: 1.55; }
.ev-place b { display: block; font-family: var(--px); font-size: 15px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 2px; }

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 4px 0 16px;
}
.countdown div {
  padding: 8px 0 6px;
  text-align: center;
  background: var(--ink);
  color: var(--gold-2);
  font-family: var(--px);
  box-shadow: inset 0 0 0 2px var(--gold);
}
.countdown b { display: block; font-size: 24px; line-height: 1.05; }
.countdown span { font-size: 11px; color: var(--paper); }

.timeline { position: relative; margin: 6px 0 0; padding: 0 0 0 22px; list-style: none; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 4px;
  background: repeating-linear-gradient(180deg, var(--wood-2) 0 6px, transparent 6px 10px);
}
.timeline li { position: relative; margin-bottom: 18px; }
.timeline li::before {
  content: '';
  position: absolute;
  left: -21px; top: 5px;
  width: 12px; height: 12px;
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--ink);
}
.timeline .tl-date { font-family: var(--px); font-size: 13px; color: var(--maroon); }
.timeline .tl-photo {
  margin: 8px 0;
  aspect-ratio: 16 / 10;
  box-shadow: 0 0 0 3px var(--ink);
  overflow: hidden;
}
.timeline .tl-photo img { width: 100%; height: 100%; object-fit: cover; }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gallery .ph {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--wood);
  box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 3px var(--gold);
  padding: 5px;
}
.gallery .ph:nth-child(3n + 1) { grid-column: span 2; aspect-ratio: 16 / 10; }
.gallery .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery .ph:hover img { transform: scale(1.04); }
.gallery .ph span {
  position: absolute;
  left: 5px; right: 5px; bottom: 5px;
  padding: 4px 8px;
  background: var(--hud);
  color: var(--paper);
  font-family: var(--px);
  font-size: 12px;
}
.gallery .ph span:empty { display: none; }

.media-play {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 3px var(--gold);
  margin-bottom: 14px;
}
.media-play img { width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.media-play b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--px);
  font-size: 18px;
  text-shadow: 2px 2px 0 #000;
}

.bank {
  margin: 0 0 12px;
  padding: 14px;
  background: linear-gradient(135deg, var(--bank-a), var(--bank-b));
  color: var(--paper);
  box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 2px var(--gold);
}
.bank-name { font-family: var(--px); font-weight: 700; color: var(--gold-2); font-size: 16px; }
.bank-no { margin: 8px 0 2px; font-family: var(--px); font-size: 21px; letter-spacing: .06em; word-break: break-all; }
.bank-holder { font-size: 13px; opacity: .85; margin-bottom: 8px; }

.fld-label { display: block; margin: 12px 0 5px; font-family: var(--px); font-weight: 600; font-size: 14px; }
.fld {
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 0;
  background: var(--card);
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  box-shadow: 0 0 0 3px var(--wood-2);
  -webkit-appearance: none;
  appearance: none;
}
.fld:focus { outline: 0; box-shadow: 0 0 0 3px var(--maroon); }
.fld.is-invalid { box-shadow: 0 0 0 3px #c0392b; background: #fff0ee; }
textarea.fld { min-height: 88px; resize: vertical; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: block;
  padding: 10px 4px;
  text-align: center;
  background: var(--card);
  font-family: var(--px);
  font-size: 13px;
  box-shadow: 0 0 0 3px var(--wood-2);
  cursor: pointer;
}
.choice input:checked + span { background: var(--gold); box-shadow: 0 0 0 3px var(--ink); font-weight: 700; }
.choice input:focus-visible + span { outline: 3px dashed var(--maroon); outline-offset: 3px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper output { min-width: 40px; text-align: center; font-family: var(--px); font-weight: 700; font-size: 20px; }
.form-actions { margin-top: 16px; }
.rsvp-done { padding: 18px 12px; text-align: center; background: #eaf3dc; box-shadow: 0 0 0 3px var(--ok); }
.rsvp-done .h4 { color: #2f5d1c; }

.wishes { list-style: none; margin: 10px 0 0; padding: 0; max-height: 340px; overflow-y: auto; }
.wish { display: flex; gap: 10px; padding: 10px 2px; border-bottom: 2px dashed var(--line); }
.wish.is-new { animation: wishIn .6s ease both; }
@keyframes wishIn { from { background: var(--gold-2); } }
.wish-init {
  flex: none;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  background: var(--leaf);
  color: #fff;
  font-family: var(--px);
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--ink);
}
.wish-body { min-width: 0; flex: 1; }
.wish-name { margin: 0 !important; font-family: var(--px); font-weight: 700; font-size: 14px !important; word-break: break-word; }
.wish-tag { display: inline-block; margin-left: 4px; padding: 1px 6px; background: var(--ok); color: #fff; font-size: 11px; font-weight: 400; vertical-align: 1px; }
.wish-tag.is-no { background: #8b8b8b; }
.wish-tag.is-maybe { background: #c58a1d; }
.wish-text { margin: 3px 0 0 !important; font-size: 14px !important; word-break: break-word; white-space: pre-line; }
.wish-time { margin: 2px 0 0 !important; font-size: 11.5px !important; color: var(--muted); }
.wishes-empty { padding: 12px 0; color: var(--muted); font-size: 14px; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 10px 60px;
  background: rgba(8, 10, 8, .94);
}
.lb-media { width: 100%; max-width: 900px; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.lb-media img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 0 0 3px var(--gold); }
.lb-media iframe, .lb-media video { width: 100%; aspect-ratio: 16 / 9; max-height: 100%; border: 0; background: #000; }
.lb-cap { margin: 12px 0 0; min-height: 1.2em; color: var(--paper); font-family: var(--px); font-size: 14px; text-align: center; }
.lb-btn {
  position: absolute;
  width: 44px; height: 44px;
  border: 0;
  background: var(--hud);
  color: var(--gold-2);
  font-family: var(--px);
  font-size: 20px;
  box-shadow: 0 0 0 2px var(--gold);
}
.lb-close { top: calc(10px + env(safe-area-inset-top)); right: 12px; }
.lb-prev { left: 10px; top: 50%; margin-top: -22px; }
.lb-next { right: 10px; top: 50%; margin-top: -22px; }
.lightbox.is-video .lb-prev, .lightbox.is-video .lb-next, .lightbox.is-single .lb-prev, .lightbox.is-single .lb-next { display: none; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: calc(70px + env(safe-area-inset-top));
  z-index: 90;
  max-width: calc(100% - 30px);
  padding: 10px 14px;
  background: var(--ink);
  color: var(--gold-2);
  font-family: var(--px);
  font-size: 14px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--gold);
  transform: translate(-50%, -20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- noscript / loading ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--gold-2);
  font-family: var(--px);
  font-size: 16px;
  transition: opacity .4s;
}
.boot.is-done { opacity: 0; pointer-events: none; }
.boot i { display: inline-block; width: 10px; height: 10px; margin: 0 3px; background: var(--gold); animation: bootDot 1s infinite; }
.boot i:nth-child(2) { animation-delay: .15s; }
.boot i:nth-child(3) { animation-delay: .3s; }
@keyframes bootDot { 50% { transform: translateY(-8px); } }

@media (min-width: 720px) {
  .overlay { align-items: center; }
  .sheet-box { max-height: calc(100% - 40px); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .gallery .ph:nth-child(3n + 1) { grid-column: auto; aspect-ratio: 1; }
}

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

html.is-embedded { scrollbar-gutter: auto; scrollbar-width: none; }
html.is-embedded::-webkit-scrollbar { display: none; }

/* ---------- photo booth ---------- */
.booth-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.booth-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 2px 8px;
  border: 0;
  background: var(--card);
  font-family: var(--px);
  font-size: 12.5px;
  box-shadow: 0 0 0 3px var(--wood-2);
}
.booth-opt[aria-pressed="true"] { background: var(--gold); box-shadow: 0 0 0 3px var(--ink); font-weight: 700; }
.booth-opt:focus-visible { outline: 3px dashed var(--maroon); outline-offset: 4px; }
.booth-opt .g {
  display: grid;
  gap: 2px;
  width: 30px; height: 36px;
  padding: 3px;
  background: var(--ink);
}
.booth-opt .g b { background: var(--paper-2); }
.booth-opt .g1 { grid-template-columns: 1fr; }
.booth-opt .g2 { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
.booth-opt .g4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.booth-opt .g6 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; }

.booth {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  background: var(--booth-bg);
  color: var(--paper);
  animation: fadeIn .25s ease both;
}
.booth-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px 16px;
  background: var(--ink);
  box-shadow: 0 3px 0 var(--gold);
}
.booth-top h2 { flex: 1; font-size: 17px; color: var(--gold-2); }
.booth-count { font-family: var(--px); font-size: 14px; color: var(--paper); }
.booth-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 12px calc(16px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
.booth-stage {
  --ar: 1;
  position: relative;
  flex: none;
  width: min(94vw, 520px, calc(56vh * var(--ar)));
  aspect-ratio: var(--ar);
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 4px var(--gold), 0 0 0 7px var(--ink);
}
.booth-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: block;
}
.booth-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 20px;
  text-align: center;
  font-family: var(--px);
  font-size: 15px;
  line-height: 1.45;
  color: var(--paper);
  background: var(--booth-panel);
}
.booth-cd {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--px);
  font-weight: 700;
  font-size: min(30vw, 160px);
  color: #fff;
  text-shadow: 5px 5px 0 var(--ink);
  pointer-events: none;
}
.booth-cd:empty { display: none; }
.booth-cd b { animation: cdPop .9s ease-out both; }
@keyframes cdPop { from { transform: scale(1.6); opacity: 0; } 30% { transform: scale(1); opacity: 1; } }
.booth-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.booth-flash.is-on { animation: flash .45s ease-out; }
@keyframes flash { from { opacity: .95; } to { opacity: 0; } }
.booth-thumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.booth-thumb {
  border: 0;
  padding: 0;
  cursor: pointer;
  width: 54px;
  aspect-ratio: var(--ar, 1);
  max-height: 54px;
  background: var(--booth-panel);
  box-shadow: 0 0 0 2px var(--wood-2);
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: var(--px);
  font-size: 13px;
  color: #8b7a66;
}
.booth-thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.booth-thumb.is-done { box-shadow: 0 0 0 2px var(--gold); }
.booth-thumb.is-next { box-shadow: 0 0 0 2px var(--gold-2); color: var(--gold-2); }
.booth-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.booth-acts label { cursor: pointer; }
.booth-img {
  max-width: min(94vw, 520px);
  max-height: calc(100% - 120px);
  min-height: 0;
  object-fit: contain;
  box-shadow: 0 0 0 3px var(--gold), 0 0 0 6px var(--ink);
}
.booth-note { margin: 0; font-size: 12px; color: #b9a78f; text-align: center; }

/* ---------- couple: both profiles in one dialog ---------- */
.person { text-align: center; }
.person-tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 10px;
  background: var(--maroon);
  color: var(--on-accent);
  font-family: var(--px);
  font-size: 12px;
  letter-spacing: .05em;
}
.couple-amp {
  margin: 10px 0 14px !important;
  text-align: center;
  font-family: var(--px);
  font-weight: 700;
  font-size: 34px !important;
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--ink);
}
.face--wide { width: 96px; }
@media (min-width: 560px) {
  .st#couple { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; column-gap: 10px; }
  .st#couple .st-head { grid-column: 1 / -1; }
  .st#couple .couple-amp { align-self: center; }
}

.booth-msg.is-retry { cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- on-screen pad (touch screens; built by the engine) ---------- */
.pad { position: absolute; inset: auto 0 0 0; height: 0; pointer-events: none; }
.pad-dir {
  position: absolute;
  left: calc(14px + env(safe-area-inset-left));
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: 138px; height: 138px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.pad-k, .pad-hub {
  position: absolute;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  background: var(--hud);
  color: var(--gold-2);
  font-size: 17px;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px var(--ink);
  opacity: .9;
  transition: background .08s, color .08s;
}
.pad-up { left: 46px; top: 0; }
.pad-down { left: 46px; bottom: 0; }
.pad-left { left: 0; top: 46px; }
.pad-right { right: 0; top: 46px; }
.pad-hub { left: 46px; top: 46px; box-shadow: none; opacity: .75; }
.pad-k.is-on { background: var(--gold); color: var(--ink); opacity: 1; }
.pad-a {
  position: absolute;
  right: calc(18px + env(safe-area-inset-right));
  bottom: calc(46px + env(safe-area-inset-bottom));
  width: 72px; height: 72px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  background: var(--maroon);
  color: var(--on-accent);
  font-family: var(--px);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 0 0 3px var(--gold), 0 0 0 6px var(--ink), inset 0 -5px 0 rgba(0, 0, 0, .25);
}
.pad-a small { display: block; margin-top: 2px; font-size: 10px; font-weight: 600; letter-spacing: .04em; }
.pad-a:active { transform: translateY(2px); }
.pad-a.is-ready { background: var(--gold); color: var(--ink); animation: pulse 1.2s ease-in-out infinite; }
.pad-a.is-nope { animation: nope .35s ease; }
@keyframes nope { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
/* keep the hint clear of the pad */
body.has-pad .hint { bottom: calc(168px + env(safe-area-inset-bottom)); }

/* ---------- photo booth: frame orientation (portrait / landscape) ---------- */
.booth-pick-label { margin: 10px 0 6px; font-family: var(--px); font-size: 12px; letter-spacing: .04em; opacity: .8; }
.booth-pick-label:first-of-type { margin-top: 2px; }
.booth-pick--or { grid-template-columns: repeat(2, 1fr); margin-bottom: 4px; }
.booth-opt .o { display: block; background: var(--ink); box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 30px var(--paper-2); }
.booth-opt .o-port { width: 26px; height: 34px; }
.booth-opt .o-land { width: 40px; height: 28px; margin: 3px 0; }
/* shot-count icons follow the chosen orientation */
#booth.is-landscape .booth-opt .g { width: 42px; height: 30px; }
#booth.is-landscape .booth-opt .g2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
#booth.is-landscape .booth-opt .g6 { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
