@font-face { font-family: 'Bodoni Moda'; src: url('fonts/bodoni-moda-latin.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Bodoni Moda'; src: url('fonts/bodoni-moda-italic-latin.woff2') format('woff2'); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('fonts/jost-latin.woff2') format('woff2'); font-weight: 400 600; font-style: normal; font-display: swap; }

:root {
  /* colour: a lacquered games box: oxblood and red lacquer, gold leaf, jade and ivory inlay */
  --night: #170b0a;
  --lacquer: #8e1b1f;
  --lacquer-hi: #a8282d;
  --lacquer-lo: #5e0f13;
  --gold: #c9a45c;
  --gold-hi: #e8cf94;
  --gold-lo: #8a6a2f;
  --hair: rgba(201, 164, 92, 0.5);
  --ivory: #f7f0e3;
  --ivory-2: #ebdfc4;
  --paper: #fffdf8;
  --jade: #2f6b57;
  --jade-hi: #4f8a72;
  --ink: #2a1714;
  --ink-soft: #6e5a50;
  --on-dark: #f3e8d4;
  --on-dark-soft: rgba(243, 232, 212, 0.72);
  --glass: rgba(23, 11, 10, 0.55);
  /* space: 4px scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --tap: 44px;
  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 12px;
  --radius-pill: 999px;
  /* the inset gold rule of a card, and its drop */
  --frame: inset 0 0 0 6px var(--ivory), inset 0 0 0 7px rgba(184, 146, 79, 0.55);
  --lift: 0 24px 48px rgba(0, 0, 0, 0.45);
  /* type */
  --display: 'Bodoni Moda', 'Bodoni 72', Didot, Georgia, serif;
  --ui: 'Jost', Futura, 'Century Gothic', system-ui, sans-serif;
  --han: 'Noto Serif CJK SC', 'Songti SC', STSong, 'Noto Sans CJK SC', 'PingFang SC', serif;
  /* layout */
  --stage-h: 100vh;
  --safe-t: max(var(--s3), env(safe-area-inset-top));
  --safe-b: max(var(--s4), env(safe-area-inset-bottom));
  --hud-h: calc(var(--safe-t) + var(--tap) + var(--s2));
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-back: cubic-bezier(0.34, 1.3, 0.64, 1);
  color-scheme: dark;
}
@supports (height: 100svh) { :root { --stage-h: 100svh; } }
@supports (height: 100dvh) { :root { --stage-h: 100dvh; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
/* Bodoni's display cut thins its hairlines to nothing on a phone; its text cut keeps every letter whole.
   Every `font` shorthand resets the axis, so it is set on each element (Jost has no such axis). */
*, *::before, *::after { font-variation-settings: 'opsz' 11 !important; }
/* Oxblood under a lacquer glow, with the faint gold lattice of a carved screen. */
body, .invite-dialog {
  background:
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(142, 27, 31, 0.5), transparent 72%),
    repeating-linear-gradient(45deg, rgba(201, 164, 92, 0.045) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(-45deg, rgba(201, 164, 92, 0.045) 0 1px, transparent 1px 26px),
    var(--night);
}
body { color: var(--on-dark); font: 400 16px/1.5 var(--ui); -webkit-font-smoothing: antialiased; overflow: hidden; -webkit-tap-highlight-color: transparent; }
html[lang="id"] [data-english], html:not([lang="id"]) [data-bahasa] { display: none; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
img { -webkit-user-drag: none; }

.stage { position: fixed; inset: 0; height: var(--stage-h); overflow: hidden; }

/* ---------- buttons ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 var(--s6); border: 1px solid var(--gold); border-radius: var(--radius-s); background: transparent; color: var(--gold-hi); font: 500 14px/1 var(--ui); letter-spacing: 0.18em; text-transform: uppercase; cursor: pointer; transition: transform 160ms, filter 160ms; }
.button:active { transform: translateY(1px); filter: brightness(0.94); }
.button-primary { border-color: var(--gold-hi); background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: var(--ink); box-shadow: 0 10px 28px rgba(201, 164, 92, 0.22); }
.button:disabled { opacity: 0.6; cursor: default; }
.link { min-height: var(--tap); padding: 0 var(--s3); border: 0; background: none; color: var(--on-dark-soft); font: 400 14px/1.2 var(--ui); letter-spacing: 0.06em; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--hair); cursor: pointer; }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 40px; padding: 0 var(--s4); border: 1px solid var(--hair); border-radius: var(--radius-pill); background: var(--glass); color: var(--on-dark); font: 500 13px/1 var(--ui); letter-spacing: 0.08em; text-decoration: none; cursor: pointer; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.chip:active { filter: brightness(0.9); }
.chip-round { width: var(--tap); height: var(--tap); padding: 0; }
.chip svg { width: 18px; height: 18px; fill: var(--gold-hi); stroke: var(--gold-hi); stroke-width: 0; }
.chip .sound-wave { fill: none; stroke-width: 1.6; stroke-linecap: round; }
.chip[aria-pressed="false"] .sound-wave { opacity: 0.2; }
.fine, .small { margin: 0; color: var(--on-dark-soft); font: 400 14px/1.5 var(--ui); }

/* On ivory (the cards, the invitation, gifts and wishes) the same controls are inked. */
:is(.card, .sheet-part, .leaf-dialog) .button-primary { border-color: var(--lacquer); background: linear-gradient(180deg, var(--lacquer-hi), var(--lacquer)); color: var(--ivory); box-shadow: 0 8px 20px rgba(94, 15, 19, 0.22); }
:is(.card, .sheet-part, .leaf-dialog) .button:not(.button-primary) { border-color: var(--gold-lo); color: var(--ink); }
:is(.sheet-part, .leaf-dialog) :is(.small, .fine) { color: var(--ink-soft); }
.chip-ink, .leaf-dialog .chip { border-color: rgba(138, 106, 47, 0.6); background: transparent; color: var(--ink); -webkit-backdrop-filter: none; backdrop-filter: none; }
.link-ink { color: var(--ink); text-decoration-color: rgba(138, 106, 47, 0.6); }

/* ---------- top of the screen ---------- */
.hud { position: absolute; z-index: 5; top: var(--safe-t); left: max(var(--s4), env(safe-area-inset-left)); display: flex; gap: var(--s2); }
.hud .chip { min-height: var(--tap); }
.lang { position: absolute; z-index: 5; top: var(--safe-t); right: max(var(--s4), env(safe-area-inset-right)); bottom: auto; left: auto; display: flex; margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--hair); border-radius: var(--radius-pill); background: var(--glass); color: var(--on-dark); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.lang [data-lang] { display: grid; place-items: center; width: var(--tap); height: 40px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--on-dark-soft); font: 500 12px/1 var(--ui); letter-spacing: 0.14em; cursor: pointer; }
.lang [data-lang][aria-pressed="true"] { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: var(--ink); }
dialog > .lang { position: fixed; }
.lunet-photos > .lang { top: max(var(--s2), env(safe-area-inset-top)); right: auto; left: max(var(--s2), env(safe-area-inset-left)); }
/* Opened from the collection, its way back sits at the top left: the buttons there move below it. */
.collection-return:not([hidden]) ~ .stage { --hud-h: calc(var(--safe-t) + 2 * var(--tap) + 3 * var(--s2)); }
.collection-return:not([hidden]) ~ .stage .hud { top: calc(var(--safe-t) + var(--tap) + var(--s2)); }

/* ---------- the box lid ---------- */
.title { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: var(--s6); padding: calc(var(--hud-h) + var(--s2)) var(--s4) calc(var(--safe-b) + var(--s3)); text-align: center; }
.title > * { flex: none; }
.title-lid { position: relative; width: min(100%, 380px); display: grid; justify-items: center; gap: var(--s3); padding: var(--s7) var(--s5) var(--s6); border: 1px solid var(--gold); border-radius: var(--radius-m); background: linear-gradient(165deg, #9e2327 0%, var(--lacquer) 45%, var(--lacquer-lo) 100%); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 220, 180, 0.18); animation: lid 900ms var(--ease-out) both; }
/* The lid's inner gold rule. */
.title-lid::before { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(232, 207, 148, 0.45); border-radius: var(--radius-s); pointer-events: none; }
.logo { margin: 0; color: var(--gold-hi); font: 500 12px/1 var(--ui); letter-spacing: 0.42em; text-indent: 0.42em; text-transform: uppercase; }
.title-faces { display: flex; align-items: center; margin-top: var(--s3); }
.title-faces img { width: 96px; height: 96px; border: 2px solid var(--gold-hi); border-radius: 50%; object-fit: cover; background: var(--lacquer-lo); box-shadow: 0 0 0 4px var(--lacquer-lo), 0 12px 24px rgba(0, 0, 0, 0.35); }
.seal { position: relative; z-index: 1; display: grid; place-items: center; width: 42px; height: 42px; margin: 0 -12px; border: 1px solid var(--gold-hi); border-radius: 50%; background: var(--lacquer-hi); color: var(--gold-hi); font: 22px/1 var(--han); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35); }
.title-names { margin: var(--s2) 0 0; color: var(--ivory); font: 400 clamp(32px, 10vw, 40px)/1.05 var(--display); letter-spacing: 0.005em; }
.title-names .amp, .couple-amp { color: var(--gold-hi); font-style: italic; }
.title-date { margin: 0; color: var(--gold-hi); font: 500 11px/1.6 var(--ui); letter-spacing: 0.26em; text-transform: uppercase; }
.title-for { margin: var(--s2) 0 0; padding: var(--s2) var(--s4); border-top: 1px solid rgba(232, 207, 148, 0.4); border-bottom: 1px solid rgba(232, 207, 148, 0.4); color: var(--ivory); font: italic 400 17px/1.4 var(--display); }
.title-for strong { font-weight: 600; }
.title-actions { display: grid; justify-items: center; gap: var(--s3); width: min(100%, 380px); animation: rise-in 800ms 250ms var(--ease-out) both; }
.title-line { margin: 0; max-width: 32ch; color: var(--on-dark); font: italic 400 18px/1.5 var(--display); }
.title-actions .button { width: min(100%, 300px); min-height: 56px; }

/* ---------- the game ---------- */
.game { --panel: 248px; position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s4); padding: calc(var(--hud-h) + var(--s2)) var(--s4) var(--safe-b); }
/* The board takes all the room the panel below it leaves. */
.board-wrap { position: relative; flex: none; width: min(100%, 720px, calc((var(--stage-h) - var(--hud-h) - var(--safe-b) - var(--panel)) * 1040 / 1132)); aspect-ratio: 1040 / 1132; border: 1px solid var(--gold-lo); border-radius: var(--radius-m); background: linear-gradient(160deg, #9b2226, #6d1216 60%, var(--lacquer-lo)); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 220, 180, 0.16); user-select: none; -webkit-user-select: none; }
.board { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.board .num { font: 500 22px var(--ui); fill: var(--ink); opacity: 0.55; letter-spacing: 0.5px; }
.board .num-gold { fill: var(--gold-hi); opacity: 1; }
.board .grid { stroke: rgba(138, 106, 47, 0.32); stroke-width: 1.5; }
.board .edge { stroke: var(--gold); stroke-width: 4; }
.board .heart { fill: var(--lacquer); }
.board .goal { font: 56px var(--han); fill: var(--gold-hi); text-anchor: middle; }
.board .strip { fill: rgba(0, 0, 0, 0.2); stroke: var(--gold-lo); stroke-width: 2; }
.board .strip-word { font: 500 24px var(--ui); fill: var(--gold-hi); letter-spacing: 8px; opacity: 0.85; }
.board .ladder path { fill: none; stroke-linecap: round; }
.board .ladder-shadow { stroke: rgba(30, 12, 8, 0.2); stroke-width: 12; }
.board .rail-edge { stroke: #5c4318; stroke-width: 12; }
.board .rail { stroke: #d4b06a; stroke-width: 6; }
.board .rung-edge { stroke: #5c4318; stroke-width: 9; }
.board .rung { stroke: #ecd49c; stroke-width: 4; }
.board .tongue { fill: none; stroke: var(--gold-hi); stroke-width: 3.5; stroke-linecap: round; }

.pawn { position: absolute; z-index: 2; width: 8.6%; aspect-ratio: 1; border: 2px solid var(--gold-hi); border-radius: 50%; background: var(--ivory); box-shadow: 0 0 0 2px var(--lacquer), 0 6px 12px rgba(0, 0, 0, 0.45); transform: translate(-50%, -54%); pointer-events: none; }
.pawn[data-who="groom"] { box-shadow: 0 0 0 2px var(--jade), 0 6px 12px rgba(0, 0, 0, 0.45); }
.pawn[data-moving="true"] { z-index: 3; }
.pawn img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pawn-both { width: 14.6%; aspect-ratio: 1.75; display: flex; align-items: center; padding: 1px; border-radius: var(--radius-pill); background: linear-gradient(180deg, var(--gold-hi), var(--gold)); box-shadow: 0 0 0 2px var(--lacquer-lo), 0 6px 14px rgba(0, 0, 0, 0.5); animation: pop 600ms var(--ease-back) both; }
.pawn-both img { flex: none; width: auto; height: 100%; aspect-ratio: 1; border: 2px solid var(--ivory); }
.pawn-both img + img { margin-left: -24%; }
.hearts { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.hearts span { position: absolute; color: var(--hue); font: clamp(16px, 3.4vw, 26px)/1 var(--display); text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45); opacity: 0; transform: translate(-50%, -50%); animation: float-heart 1.6s var(--delay) var(--ease-out) both; }

.panel { display: grid; justify-items: center; gap: var(--s3); width: min(100%, 420px); }
.players { display: flex; justify-content: center; gap: var(--s2); margin: 0; }
.player { display: flex; align-items: center; gap: var(--s2); margin: 0; padding: var(--s1); border: 1px solid var(--hair); border-radius: var(--radius-pill); background: var(--glass); color: var(--on-dark); font: 500 14px/1 var(--ui); letter-spacing: 0.04em; opacity: 0.5; transition: opacity 240ms, border-color 240ms, box-shadow 240ms; }
.player[data-active="true"] { opacity: 1; border-color: var(--gold-hi); box-shadow: 0 0 24px rgba(201, 164, 92, 0.28); }
.player img { width: 34px; height: 34px; border: 2px solid var(--lacquer-hi); border-radius: 50%; object-fit: cover; }
.player[data-who="groom"] img, .player-faces img + img { border-color: var(--jade-hi); }
.player-faces { display: flex; }
.player-faces img + img { margin-left: -10px; }
.player-at { min-width: 40px; padding: 0 var(--s3) 0 var(--s2); border-left: 1px solid var(--hair); color: var(--gold-hi); font: 600 18px/1 var(--display); text-align: center; }
.caption { min-height: calc(2 * 1.4em); margin: 0; max-width: 34ch; color: var(--on-dark); font: italic 400 17px/1.4 var(--display); text-align: center; }

.roll { position: relative; display: flex; align-items: center; gap: var(--s4); width: min(100%, 340px); min-height: 84px; padding: var(--s3) var(--s5) var(--s3) var(--s3); border: 1px solid var(--gold); border-radius: var(--radius-l); background: linear-gradient(180deg, #a3262b, #7a1519); color: var(--ivory); box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 220, 180, 0.2); text-align: left; cursor: pointer; transition: transform 140ms, filter 140ms, background 240ms; }
.roll::before { content: ''; position: absolute; inset: 5px; border: 1px solid rgba(232, 207, 148, 0.4); border-radius: var(--radius-m); pointer-events: none; }
.roll:active { transform: translateY(2px); filter: brightness(0.94); }
.roll[data-done="true"] { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: var(--ink); }
.roll[data-done="true"]::before { border-color: rgba(42, 23, 20, 0.25); }
.stage[data-busy="true"] .roll { pointer-events: none; filter: saturate(0.6) brightness(0.85); }
/* A pawn on the move finishes its turn before the invitation (and its "Play again") can open. */
.stage[data-busy="true"] #open-invite { pointer-events: none; opacity: 0.55; }
.roll-words { display: grid; gap: var(--s1); }
.roll-label { font: 500 25px/1.05 var(--display); }
.roll-who { color: var(--gold-hi); font: 500 11px/1.2 var(--ui); letter-spacing: 0.2em; text-transform: uppercase; }
.roll[data-done="true"] .roll-who { color: var(--lacquer); }
/* An ivory die, its one and four in red, as Chinese dice are. */
.die { flex: none; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); width: 58px; height: 58px; padding: 7px; border: 1px solid #b89a62; border-radius: var(--radius-l); background: linear-gradient(160deg, #fffaf0, #e9dcc0); box-shadow: inset 0 -3px 0 rgba(42, 23, 20, 0.12), 0 6px 14px rgba(0, 0, 0, 0.35); }
.die i { width: 10px; height: 10px; place-self: center; border-radius: 50%; background: var(--ink); visibility: hidden; }
.die[data-face="1"] i:nth-child(5),
.die[data-face="2"] :is(i:nth-child(3), i:nth-child(7)),
.die[data-face="3"] :is(i:nth-child(3), i:nth-child(5), i:nth-child(7)),
.die[data-face="4"] :is(i:nth-child(1), i:nth-child(3), i:nth-child(7), i:nth-child(9)),
.die[data-face="5"] :is(i:nth-child(1), i:nth-child(3), i:nth-child(5), i:nth-child(7), i:nth-child(9)),
.die[data-face="6"] :is(i:nth-child(1), i:nth-child(3), i:nth-child(4), i:nth-child(6), i:nth-child(7), i:nth-child(9)) { visibility: visible; }
.die[data-face="1"] i, .die[data-face="4"] i { background: var(--lacquer-hi); }
.die[data-face="1"] i:nth-child(5) { width: 15px; height: 15px; }
.die[data-rolling="true"] { animation: tumble 140ms linear infinite; }
.stage:not([data-busy="true"]) .roll:not([data-done="true"]) .die { animation: nudge 2.8s 1.2s ease-in-out infinite; }

/* Short or narrow phones: a smaller panel leaves more of the screen to the board. */
@media (max-height: 700px) {
  .game { --panel: 204px; gap: var(--s3); }
  .panel { gap: var(--s2); }
  .roll { min-height: 64px; padding: var(--s2) var(--s4) var(--s2) var(--s2); }
  .die { width: 46px; height: 46px; padding: 5px; }
  .die i { width: 8px; height: 8px; }
  .die[data-face="1"] i:nth-child(5) { width: 12px; height: 12px; }
  .roll-label { font-size: 21px; }
  .caption { font-size: 15px; }
}
@media (max-width: 360px) {
  .player { gap: 6px; font-size: 13px; }
  .player img { width: 28px; height: 28px; }
  .player-at { min-width: 32px; padding: 0 var(--s2) 0 6px; font-size: 16px; }
}
/* Wide screens: the board on the left, the panel beside it. */
@media (min-aspect-ratio: 5/4) {
  .game { flex-direction: row; gap: var(--s6); }
  .board-wrap { width: min(calc(100% - 300px - var(--s6)), calc((var(--stage-h) - var(--hud-h) - var(--safe-b) - var(--s4)) * 1040 / 1132)); }
  .panel { width: 300px; }
}

/* ---------- the story cards ---------- */
.card-dialog { width: min(calc(100% - 2 * var(--s4)), 380px); max-width: none; max-height: none; margin: auto; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
.card-dialog::backdrop, .leaf-dialog::backdrop { background: rgba(12, 5, 4, 0.66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.card-dialog[open] .card { animation: deal 560ms var(--ease-out) both; }
.card { --kind: var(--gold-lo); --pad: var(--s5); --media: min(40vh, 340px); display: flex; flex-direction: column; align-items: center; gap: var(--s3); max-height: calc(var(--stage-h) - var(--hud-h) - var(--s5)); margin: var(--hud-h) 0 0; padding: var(--s3) var(--pad) var(--pad); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--gold); border-radius: var(--radius-m); background: var(--ivory); box-shadow: var(--frame), var(--lift); text-align: center; }
.card[data-kind="ladder"] { --kind: var(--jade); }
.card[data-kind="snake"], .card[data-kind="finish"] { --kind: var(--lacquer); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); width: 100%; padding: var(--s2) 0 var(--s3); border-bottom: 1px solid var(--hair); }
.card-kind { color: var(--kind); font: 600 12px/1 var(--ui); letter-spacing: 0.3em; text-transform: uppercase; }
.card-square { color: var(--ink-soft); font: italic 400 16px/1.2 var(--display); white-space: nowrap; }
/* The words and the button always stay in view: on a short screen the photograph or film gives way. */
.card > * { flex: none; }
.card > .card-photo { flex: 0 1 auto; }
.card-photo { display: block; width: 100%; height: var(--media); min-height: 150px; margin: var(--s2) 0 0; padding: 0; border: 1px solid var(--gold); border-radius: var(--radius-s); overflow: hidden; background: var(--ivory-2); cursor: zoom-in; }
.card-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* The album of that time: one photograph at a time, swiped or stepped through by its dots. */
/* The album's parts sit straight in the card, so only the photograph's frame gives way on a short screen. */
.album { display: contents; }
.album > * { flex: none; width: 100%; }
.album-frame { position: relative; flex: 0 1 var(--media); height: var(--media); min-height: 150px; margin-top: var(--s2); }
.album-step { position: absolute; top: calc(50% - 20px); display: grid; place-items: center; width: 40px; height: 40px; margin: 0; padding: 0 0 3px; border: 1px solid var(--gold-hi); border-radius: 50%; background: rgba(23, 11, 10, 0.55); color: var(--gold-hi); font: 400 26px/1 var(--display); cursor: pointer; transition: opacity 200ms; }
.album-step[data-step="-1"] { left: var(--s2); }
.album-step[data-step="1"] { right: var(--s2); }
.album-step:disabled { opacity: 0; pointer-events: none; }
/* Phones swipe, so the arrows stay off the photograph there. */
@media (hover: none) and (pointer: coarse) { .album-step { display: none; } }
.album-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; border: 1px solid var(--gold); border-radius: var(--radius-s); background: var(--ivory-2); scrollbar-width: none; }
.album-track::-webkit-scrollbar { display: none; }
.album-slide { flex: 0 0 100%; margin: 0; padding: 0; border: 0; background: none; scroll-snap-align: center; cursor: zoom-in; }
.album-slide :is(img, video) { display: block; width: 100%; height: 100%; object-fit: cover; }
.album-slide[data-film] { position: relative; cursor: pointer; }
/* A small gold play mark says this one is a film. */
.album-slide[data-film]::after { content: ''; position: absolute; right: var(--s3); bottom: var(--s3); width: 34px; height: 34px; border: 1px solid var(--gold-hi); border-radius: 50%; background: rgba(23, 11, 10, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l8 5-8 5z' fill='%23e8cf94'/%3E%3C/svg%3E") center / 20px no-repeat; }
.album-caption { margin: 0; color: var(--ink-soft); font: italic 400 15px/1.3 var(--display); }
.album-dots { display: flex; justify-content: center; gap: var(--s1); }
.album-dots button { display: grid; place-items: center; width: 28px; height: 28px; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.album-dots button::before { content: ''; width: 7px; height: 7px; border: 1px solid var(--gold-lo); border-radius: 50%; transition: background 200ms, transform 200ms; }
.album-dots button[aria-current="true"]::before { background: var(--lacquer); border-color: var(--lacquer); transform: scale(1.2); }
.card-who { width: 104px; height: 104px; margin-top: var(--s4); border: 2px solid var(--gold); border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--lacquer), 0 10px 20px rgba(42, 23, 20, 0.2); }
.card-who[data-who="groom"] { box-shadow: 0 0 0 3px var(--jade), 0 10px 20px rgba(42, 23, 20, 0.2); }
/* A new slide's story fades in. */
.card :is(.card-title, .card-text).turn { animation: story-in 320ms var(--ease-out); }
@keyframes story-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.card-title { margin: var(--s1) 0 0; font: 500 28px/1.12 var(--display); }
.card-text { margin: 0; color: var(--ink-soft); font: 400 16px/1.6 var(--ui); }
.card .button { width: min(100%, 280px); margin-top: var(--s2); padding: 0 var(--s4); }
.card[data-kind="ladder"] .button-primary { border-color: var(--jade); background: linear-gradient(180deg, var(--jade-hi), var(--jade)); }
@media (max-width: 360px) { .card { --pad: var(--s4); } }
/* Short screens (an iPhone SE in Safari): a tighter card, so the story and the button still fit. */
@media (max-height: 700px) {
  .card { --pad: var(--s4); gap: var(--s2); padding-top: var(--s1); }
  .card-head { padding-bottom: var(--s2); }
  .card-photo, .album-frame { min-height: 96px; }
  .album-frame, .card-photo { margin-top: var(--s1); }
  .album-caption { font-size: 14px; }
  .album-dots button { height: 20px; }
  .card-title { font-size: 23px; }
  .card-text { font-size: 14.5px; line-height: 1.5; }
  .card .button { min-height: 46px; margin-top: var(--s1); }
}

/* ---------- square 100: the invitation ---------- */
.invite-dialog { width: 100%; max-width: 100%; height: var(--stage-h); max-height: none; margin: 0; padding: 0; border: 0; color: var(--ink); overflow: hidden; }
.invite-dialog::backdrop { background: rgba(12, 5, 4, 0.7); }
.invite-dialog[open] { animation: rise-in 560ms var(--ease-out) both; }
/* The close button and the language switch keep a band of their own above the scrolling sheet. */
.invite-dialog::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: var(--hud-h); border-bottom: 1px solid rgba(201, 164, 92, 0.3); }
.sheet { position: absolute; top: var(--hud-h); right: 0; bottom: 0; left: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: var(--s5); width: 100%; padding: var(--s5) max(var(--s4), calc((100% - 480px) / 2)) calc(var(--safe-b) + var(--s6)); }
.sheet-close { position: absolute; z-index: 2; top: var(--safe-t); left: max(var(--s4), env(safe-area-inset-left)); min-height: var(--tap); }
.sheet-part { display: grid; justify-items: center; gap: var(--s3); padding: var(--s6) var(--s5); border-radius: var(--radius-m); background: var(--ivory); box-shadow: var(--frame), 0 20px 40px rgba(0, 0, 0, 0.35); text-align: center; }
.badge { display: grid; place-items: center; width: 64px; height: 64px; margin: 0; border: 1px solid var(--gold-hi); border-radius: 50%; background: linear-gradient(165deg, var(--lacquer-hi), var(--lacquer-lo)); color: var(--gold-hi); font: 30px/1 var(--han); box-shadow: 0 0 0 4px var(--ivory), 0 0 0 5px var(--hair); }
.sheet-kicker { margin: var(--s2) 0 0; color: var(--gold-lo); font: 600 11px/1.4 var(--ui); letter-spacing: 0.32em; text-transform: uppercase; }
.sheet-lead { margin: 0; max-width: 32ch; font: italic 400 19px/1.5 var(--display); }
.sheet-title { margin: 0; font: 500 26px/1.15 var(--display); }
.couple { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: var(--s2); width: 100%; margin-top: var(--s3); }
.couple figure { display: grid; justify-items: center; gap: var(--s2); margin: 0; }
.couple img { width: 96px; height: 96px; border: 2px solid var(--gold); border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--jade), 0 10px 20px rgba(42, 23, 20, 0.18); }
.couple figure:last-child img { box-shadow: 0 0 0 3px var(--lacquer), 0 10px 20px rgba(42, 23, 20, 0.18); }
.couple figcaption { display: grid; gap: var(--s1); }
.couple strong { font: 600 19px/1.15 var(--display); }
.couple figcaption span { color: var(--ink-soft); font: 400 13px/1.45 var(--ui); }
.couple-amp { align-self: center; margin-top: -40px; color: var(--gold-lo); font: 400 40px/1 var(--display); }
.invite-for { margin: var(--s3) 0 0; padding: var(--s2) var(--s4); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); font: italic 400 17px/1.4 var(--display); }
.invite-date { margin: 0; font: 500 26px/1.2 var(--display); }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); width: 100%; max-width: 340px; }
.countdown p { display: grid; gap: 2px; margin: 0; padding: var(--s2) 0; border: 1px solid rgba(138, 106, 47, 0.45); border-radius: var(--radius-s); }
.countdown b { font: 600 26px/1 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.countdown span { color: var(--ink-soft); font: 500 10px/1.2 var(--ui); letter-spacing: 0.16em; text-transform: uppercase; }
.events { display: grid; gap: var(--s5); width: 100%; margin: 0; }
.events > div { display: grid; justify-items: center; gap: 2px; }
.events dt { color: var(--lacquer); font: italic 600 23px/1.2 var(--display); }
.events dd { margin: 0; color: var(--ink-soft); font: 400 15px/1.5 var(--ui); }
.events .events-time { color: var(--ink); font-weight: 500; letter-spacing: 0.08em; }
.events strong { display: block; color: var(--ink); font-weight: 500; }
.events > div + div { padding-top: var(--s5); border-top: 1px solid var(--hair); }
.events-map { margin-top: var(--s2); color: var(--lacquer); font: 600 11px/1 var(--ui); letter-spacing: 0.24em; text-transform: uppercase; text-decoration: none; padding: var(--s2) var(--s3); border: 1px solid rgba(142, 27, 31, 0.35); border-radius: var(--radius-pill); }
.sheet-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); }
.sheet-part.sheet-links { gap: var(--s3); }
.sheet-fine { text-align: center; padding: 0 var(--s4); }

/* the answer */
.rsvp-step { display: grid; justify-items: center; gap: var(--s3); width: 100%; }
.choices { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s3); width: 100%; }
.choices .button { flex: 1 1 200px; max-width: 280px; }
.stepper { display: flex; align-items: center; gap: var(--s4); }
.stepper-button { width: 48px; height: 48px; border: 1px solid var(--gold-lo); border-radius: 50%; background: transparent; color: var(--ink); font: 400 24px/1 var(--display); cursor: pointer; }
.stepper-count { min-width: 2ch; font: 500 40px/1 var(--display); text-align: center; }
textarea { width: 100%; padding: var(--s3); border: 1px solid #cdb88a; border-radius: var(--radius-s); background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--ui); resize: vertical; }
.wish-share { display: flex; align-items: center; gap: var(--s2); color: var(--ink-soft); font: 400 14px/1.3 var(--ui); cursor: pointer; }
.wish-share input { width: 18px; height: 18px; accent-color: var(--lacquer); }
.rsvp-line { margin: 0; font: italic 500 22px/1.3 var(--display); }
#rsvp-status[data-kind="failed"] { color: var(--lacquer); }
#rsvp-status[data-kind="sent"] { color: var(--jade); }
.pass canvas { width: 200px; height: 200px; padding: var(--s2); border: 1px solid var(--gold); border-radius: var(--radius-s); background: #fff; image-rendering: pixelated; }

/* angpao and wishes */
.leaf-dialog { width: min(calc(100% - 2 * var(--s4)), 420px); max-height: calc(var(--stage-h) - var(--hud-h) - var(--s5)); margin: var(--hud-h) auto auto; padding: var(--s6) var(--s5) var(--s5); border: 1px solid var(--gold); border-radius: var(--radius-m); background: var(--ivory); color: var(--ink); box-shadow: var(--frame), var(--lift); display: grid; justify-items: center; gap: var(--s3); overflow-y: auto; overscroll-behavior: contain; text-align: center; }
.leaf-dialog:not([open]) { display: none; }
.leaf-dialog[open] { animation: deal 500ms var(--ease-out) both; }
.leaf-dialog .button { min-width: 180px; margin-top: var(--s1); }
.leaf-dialog .small strong { display: block; color: var(--ink); font-weight: 500; }
.accounts { display: grid; gap: var(--s2); width: 100%; margin: 0; padding: 0; list-style: none; }
.accounts li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid #d9c79e; border-radius: var(--radius-s); background: var(--paper); text-align: left; }
.accounts p { display: grid; margin: 0; color: var(--ink-soft); font: 400 14px/1.4 var(--ui); }
.accounts strong { color: var(--lacquer); font: 600 12px/1.4 var(--ui); letter-spacing: 0.22em; }
.accounts span:first-of-type { color: var(--ink); font: 500 17px/1.3 var(--display); font-variant-numeric: lining-nums; letter-spacing: 0.04em; }
.wish-form { display: grid; gap: var(--s3); width: 100%; justify-items: center; }
.wish-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); width: 100%; }
.wish-list { display: grid; gap: var(--s2); width: 100%; margin: 0; padding: 0; list-style: none; text-align: left; }
.wish-list li { padding: var(--s3) var(--s4); border: 1px solid #d9c79e; border-radius: var(--radius-s); background: var(--paper); }
.wish-list li[data-own="true"] { background: #f3e6c6; }
.wish-list p { margin: 0; font: italic 400 16px/1.5 var(--display); }
.wish-list span { display: block; margin-top: var(--s1); color: var(--ink-soft); font: 500 11px/1.3 var(--ui); letter-spacing: 0.16em; text-transform: uppercase; }

.lunet-photos[data-theme="ular-tangga"] { --lp-bg: #120807; --lp-ink: var(--on-dark); --lp-muted: var(--on-dark-soft); --lp-control: rgba(201, 164, 92, 0.18); --lp-control-hover: rgba(201, 164, 92, 0.32); --lp-font: var(--ui); }

.noscript { position: fixed; inset: 0; display: grid; place-content: center; gap: var(--s2); padding: var(--s5); text-align: center; background: var(--night); }

@keyframes lid { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes deal { from { opacity: 0; transform: translateY(36px) rotate(-3deg) scale(0.95); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: translate(-50%, -54%) scale(0.4); } to { transform: translate(-50%, -54%) scale(1); } }
@keyframes tumble { 0% { transform: rotate(0) translateY(0); } 50% { transform: rotate(16deg) translateY(-6px); } 100% { transform: rotate(-12deg) translateY(0); } }
@keyframes nudge { 0%, 84%, 100% { transform: none; } 88% { transform: rotate(-9deg); } 92% { transform: rotate(7deg); } 96% { transform: rotate(-3deg); } }
@keyframes float-heart { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% - 120px)) scale(1.15); } }

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