/* The Lily and the Marigold: night-garden storybook. One accent (gold), arch motif, soft motion. */
:root {
  --bg: #140D13;
  --bg-2: #1C131B;
  --panel: rgba(38, 26, 35, .62);
  --panel-solid: #251A23;
  --line: rgba(222, 186, 122, .22);
  --line-strong: rgba(222, 186, 122, .45);
  --text: #F3E7D9;
  --text-2: rgba(243, 231, 217, .70);
  --text-3: rgba(243, 231, 217, .45);
  --accent: #DEBA7A;
  --accent-2: #F0D49E;
  --accent-ink: #2A1B12;
  --accent-glow: rgba(222, 186, 122, .35);
  --rose: #E9A3A6;
  --paper: #F6EEE2;
  --paper-ink: #3A2630;
  --ok: #9ED3B4;
  --r-panel: 22px;
  --r-ctl: 14px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.55, 0, .75, .3);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
  --script: "Pinyon Script", cursive;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(90% 55% at 50% -5%, rgba(120, 60, 80, .38), transparent 70%),
    radial-gradient(70% 40% at 50% 105%, rgba(222, 186, 122, .10), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
#sky { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.grain { position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.hidden { display: none !important; }
::selection { background: var(--accent-glow); }

/* ---------- Top bar ---------- */
#topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 64px 18px;
  background: linear-gradient(to bottom, rgba(20, 13, 19, .92) 30%, rgba(20, 13, 19, 0));
}
.progress { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.crown-ico { width: 20px; height: 14px; flex: none; }
.dots { display: flex; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--line-strong); transition: background .8s var(--ease), border-color .8s var(--ease), box-shadow .8s var(--ease); }
.dot.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.dot.new { animation: dotIn 1.2s var(--ease); }
@keyframes dotIn { 0% { transform: scale(.2); box-shadow: 0 0 0 0 var(--accent-glow); } 50% { transform: scale(1.8); box-shadow: 0 0 18px 6px var(--accent-glow); } 100% { transform: scale(1); } }
#crownLabel { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 38px; }
.icon-btn {
  position: absolute; right: 16px; top: max(10px, calc(env(safe-area-inset-top) - 4px));
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(38, 26, 35, .5); color: var(--text-2); display: grid; place-items: center; cursor: pointer;
  transition: color .3s, border-color .3s;
}
.icon-btn.muted { color: var(--text-3); }
.icon-btn.muted .wave { opacity: 0; }

/* ---------- Stage + screens ---------- */
#stage {
  position: relative; z-index: 5; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 84px 20px 110px;
}
.screen { width: 100%; max-width: 420px; animation: enter .9s var(--ease) both; }
.screen.leaving { animation: leave .42s var(--ease-in) both; }
@keyframes enter { from { opacity: 0; transform: translateY(14px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes leave { to { opacity: 0; transform: translateY(-8px); filter: blur(6px); } }
.stagger > * { animation: enter .9s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .08s; } .stagger > *:nth-child(3) { animation-delay: .16s; }
.stagger > *:nth-child(4) { animation-delay: .24s; } .stagger > *:nth-child(5) { animation-delay: .32s; }
.stagger > *:nth-child(6) { animation-delay: .40s; } .stagger > *:nth-child(7) { animation-delay: .48s; }
.stagger > *:nth-child(n+8) { animation-delay: .56s; }

.panel {
  background: var(--panel);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 28px 22px 24px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 30px 60px -30px rgba(0, 0, 0, .7);
}
.bare { padding: 4px 4px 0; }

/* ---------- Type ---------- */
.eyebrow { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); text-align: center; margin: 0 0 14px; }
.display { font-family: var(--serif); font-weight: 500; font-size: 39px; line-height: 1.08; letter-spacing: -.01em; text-align: center; margin: 0 0 14px; text-wrap: balance; }
.title { font-family: var(--serif); font-weight: 500; font-size: 31px; line-height: 1.12; letter-spacing: -.01em; text-align: center; margin: 0 0 12px; text-wrap: balance; }
.q { font-family: var(--serif); font-weight: 500; font-size: 27px; line-height: 1.18; text-align: center; margin: 0 0 22px; text-wrap: balance; }
.body { font-size: 16px; line-height: 1.6; color: var(--text-2); text-align: center; margin: 0 0 16px; text-wrap: pretty; }
.small { font-size: 14px; line-height: 1.5; color: var(--text-3); text-align: center; margin: 8px 0 0; }
.script { font-family: var(--script); font-weight: 400; color: var(--accent-2); }
em.gold { font-style: italic; color: var(--accent-2); }

/* Narration: words drift in softly */
.narr-wrap { min-height: 46vh; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; padding: 0 6px; }
.narr { font-family: var(--serif); font-weight: 500; font-size: 29px; line-height: 1.32; text-align: center; letter-spacing: -.005em; text-wrap: balance; max-width: 340px; }
.narr .w { display: inline-block; opacity: 0; filter: blur(6px); transform: translateY(6px); animation: word .9s var(--ease) forwards; }
@keyframes word { to { opacity: 1; filter: none; transform: none; } }
.narr.out { animation: leave .35s var(--ease-in) forwards; }
.narr-tag { margin-bottom: 26px; }
.tap { margin-top: 34px; font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); opacity: 0; transition: opacity 1s var(--ease); }
.tap.show { opacity: 1; animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }
.act-num { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--accent); text-align: center; margin-bottom: 8px; }
.act-name { font-family: var(--serif); font-weight: 500; font-size: 49px; line-height: 1; text-align: center; letter-spacing: -.02em; }
.rule { width: 44px; height: 1px; background: var(--line-strong); margin: 22px auto; }

/* ---------- Controls ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; margin-top: 22px; padding: 14px 22px;
  border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--sans); font-size: 15px; font-weight: 600; letter-spacing: .02em;
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 10px 30px -12px var(--accent-glow), 0 1px 0 rgba(255,255,255,.35) inset;
  transition: transform .25s var(--ease), box-shadow .3s var(--ease), opacity .3s;
}
.btn:active { transform: scale(.975); box-shadow: 0 4px 14px -8px var(--accent-glow); }
.btn.ghost { background: transparent; color: var(--text-2); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:active { background: rgba(255,255,255,.03); }
.btn + .btn { margin-top: 10px; }
.btn.appear { animation: enter .8s var(--ease) both; }

.field {
  width: 100%; min-height: 56px; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0;
  background: transparent; color: var(--text); caret-color: var(--accent);
  font-family: var(--serif); font-size: 26px; font-weight: 500; text-align: center; outline: none;
  transition: border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.field::placeholder { color: var(--text-3); font-style: italic; }
.field:focus { border-bottom-color: var(--accent); box-shadow: 0 14px 18px -16px var(--accent-glow); }
input[type="date"].field { color-scheme: dark; font-size: 22px; }
.field.box { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 12px 14px; font-family: var(--sans); font-size: 16px; text-align: left; background: rgba(0,0,0,.18); min-height: 50px; }
.field.box:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(222,186,122,.10); }
textarea.field.box { min-height: 84px; resize: none; line-height: 1.5; }
.msg { min-height: 22px; margin-top: 14px; font-size: 14px; color: var(--rose); text-align: center; transition: opacity .3s; }
.soft-shake { animation: softShake .5s var(--ease); }
@keyframes softShake { 20% { transform: translateX(-6px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } 100% { transform: none; } }

/* ---------- Arch motif ---------- */
.arch { border-radius: 999px 999px 18px 18px; overflow: hidden; position: relative; }
.arch-frame { position: relative; padding: 7px; border-radius: 999px 999px 24px 24px; border: 1px solid var(--line-strong); }
.arch-frame::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: 0 0 40px -6px var(--accent-glow); pointer-events: none; }

/* Title envelope */
.title-wrap { display: flex; flex-direction: column; align-items: center; }
.title-arch { width: 74%; max-width: 280px; aspect-ratio: 9 / 13; }
.title-arch .arch { width: 100%; height: 100%; }
.title-arch .veil { position: absolute; inset: -10%; background: url(assets/veil.jpg) center 30% / cover; filter: blur(3px) saturate(.85) brightness(.8); }
.title-arch .veil-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(20,13,19,.05), rgba(20,13,19,.55) 70%, rgba(20,13,19,.85)); }
.seal {
  position: absolute; left: 50%; bottom: -38px; width: 84px; height: 84px; margin-left: -42px; border-radius: 50%;
  border: 0; cursor: pointer; z-index: 3;
  background: radial-gradient(circle at 34% 30%, #C8505D, #7E1F2E 72%);
  box-shadow: 0 12px 26px -8px rgba(0,0,0,.7), inset 0 -5px 10px rgba(0,0,0,.3), inset 0 2px 3px rgba(255,255,255,.18);
  display: grid; place-items: center; animation: sealGlow 3.2s ease-in-out infinite;
}
.seal span { font-family: var(--script); font-size: 46px; color: #F3DDB0; line-height: 1; margin: 8px 0 0 2px; }
@keyframes sealGlow { 50% { box-shadow: 0 0 0 10px rgba(200,80,93,.10), 0 0 40px 4px rgba(200,80,93,.25), 0 12px 26px -8px rgba(0,0,0,.7); } }
.seal.crack { animation: crack 1s var(--ease) forwards; }
@keyframes crack { 30% { transform: scale(1.12); } 100% { transform: scale(.4); opacity: 0; filter: blur(6px); } }
.title-names { margin-top: 60px; text-align: center; }
.title-names .script { font-size: 52px; line-height: 1.1; display: block; }

/* Portrait hall (arch with 3x4 tiles; each tile is 3:4 so the image keeps its shape) */
.hall { width: 108px; margin: 6px auto 8px; }
.hall .arch { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 999px 999px 10px 10px; box-shadow: 0 0 0 1px var(--line-strong), 0 0 26px -6px var(--accent-glow); }
.ph-tile { aspect-ratio: 3 / 4; background-image: url(assets/portrait.jpg); background-size: 300% 400%; background-repeat: no-repeat; }
.ph-tile.veiled { background-image: none; background-color: #2C1F29; box-shadow: inset 0 0 0 .5px rgba(222,186,122,.12); }
.ph-tile.fresh { animation: tileIn 1.8s var(--ease); }
@keyframes tileIn { 0% { filter: brightness(2.4) blur(5px); } 100% { filter: none; } }
.hall-cap { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); text-align: center; margin: 4px 0 0; }

/* Photos */
.photo { margin: 4px auto 16px; max-width: 290px; position: relative; animation: photoIn 1.3s var(--ease) both; }
.photo img { display: block; width: 100%; max-height: 40vh; object-fit: cover; object-position: center 35%; border-radius: 16px; box-shadow: 0 0 0 1px var(--line), 0 24px 50px -24px rgba(0,0,0,.8); }
.photo.tall img { border-radius: 999px 999px 16px 16px; aspect-ratio: 3 / 4; }
.photo.dreamy img { filter: sepia(.12) saturate(1.05) brightness(1.03); }
.photo figcaption { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--text-2); text-align: center; margin-top: 12px; }
@keyframes photoIn { from { opacity: 0; transform: translateY(16px) scale(.985); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
.heart-draw { display: block; margin: 0 auto 10px; width: 64px; height: 58px; }
.heart-draw path { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw 2.2s var(--ease) .3s forwards; filter: drop-shadow(0 0 6px var(--accent-glow)); }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Wardrobe ---------- */
.label { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); text-align: center; margin: 4px 0 14px; }
.swatches { display: flex; justify-content: center; gap: 16px; margin-bottom: 28px; }
.swatch { width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer; position: relative; transition: transform .4s var(--ease); }
.swatch::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid transparent; transition: border-color .4s var(--ease); }
.swatch.on { transform: scale(1.06); }
.swatch.on::after { border-color: var(--text-2); }
.swatch-name { text-align: center; font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--text-2); margin: -14px 0 24px; min-height: 24px; }
.crowns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.crown-opt { border-radius: var(--r-ctl); border: 1px solid var(--line); background: rgba(0,0,0,.15); padding: 14px 4px 10px; cursor: pointer; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--text-3); transition: all .4s var(--ease); }
.crown-opt.on { border-color: var(--line-strong); color: var(--text); background: rgba(222,186,122,.07); }
.crown-opt svg { width: 40px; height: 24px; display: block; margin: 0 auto 6px; }

/* ---------- Instagram mirror ---------- */
.story { border-radius: 20px; padding: 14px 14px 18px; margin-bottom: 24px; position: relative; overflow: hidden;
  background: linear-gradient(155deg, #F2A7B9 0%, #B58DE6 55%, #F1B27E 100%); box-shadow: 0 24px 50px -26px rgba(0,0,0,.8); }
.story-bars { display: flex; gap: 4px; margin-bottom: 12px; }
.story-bars i { flex: 1; height: 2px; border-radius: 2px; background: rgba(255,255,255,.45); }
.story-bars i.full { background: #fff; }
.story-head { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; font-size: 13px; margin-bottom: 16px; }
.story-head .av { width: 28px; height: 28px; border-radius: 50%; background: #fff url(assets/veil.jpg) center 30% / cover; border: 2px solid #fff; }
.qa { background: #fff; border-radius: 16px; overflow: hidden; text-align: center; margin: 0 4px; color: #262626; }
.qa .top { background: linear-gradient(90deg, #8B5CF6, #EC4899); color: #fff; font-weight: 600; font-size: 14px; padding: 9px; }
.qa .bodytext { padding: 14px 14px 16px; font-size: 15px; line-height: 1.45; }
.qa .anon { font-size: 11px; color: #8e8e8e; margin-top: 8px; }

/* ---------- Choice rows ---------- */
.opts { display: grid; gap: 10px; }
.opt { text-align: left; padding: 15px 18px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: rgba(0,0,0,.16); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.35; cursor: pointer; transition: border-color .4s var(--ease), background .4s var(--ease), opacity .4s; min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.opt::after { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; border: 1px solid var(--line); transition: all .4s var(--ease); }
.opt.right { border-color: var(--accent); background: rgba(222,186,122,.10); }
.opt.right::after { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.opt.wrong { opacity: .38; }
.count { font-size: 11px; font-weight: 600; letter-spacing: .18em; color: var(--text-3); text-align: center; margin-bottom: 10px; }

/* ---------- Road (night) ---------- */
.road { position: relative; height: 220px; border-radius: 18px; overflow: hidden; margin: 0 0 4px;
  background: radial-gradient(60% 50% at 18% 0%, rgba(240,200,120,.18), transparent 70%), radial-gradient(60% 50% at 82% 100%, rgba(240,200,120,.12), transparent 70%), #1E1820;
  box-shadow: 0 0 0 1px var(--line); }
.road .lane { position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: repeating-linear-gradient(90deg, rgba(243,231,217,.35) 0 22px, transparent 22px 44px); }
.road .zebra { position: absolute; top: 0; bottom: 0; left: 50%; width: 64px; margin-left: -32px; background: repeating-linear-gradient(0deg, rgba(243,231,217,.22) 0 12px, transparent 12px 24px); }
.car { position: absolute; left: 0; width: 64px; height: 26px; border-radius: 9px 12px 7px 7px; }
.car::before { content: ""; position: absolute; right: -26px; top: 6px; width: 30px; height: 14px; background: radial-gradient(ellipse at left, rgba(255,230,170,.55), transparent 70%); }
.car .win { position: absolute; top: 4px; left: 14px; width: 30px; height: 8px; border-radius: 3px; background: rgba(255,255,255,.35); }
.signal { position: absolute; right: 12px; top: 12px; width: 26px; padding: 5px; border-radius: 9px; background: #0F0B10; display: grid; gap: 5px; z-index: 3; box-shadow: 0 0 0 1px var(--line); }
.signal i { width: 16px; height: 16px; border-radius: 50%; background: #2a232b; transition: background .5s var(--ease), box-shadow .5s var(--ease); }
.signal i.r.on { background: #F06C6C; box-shadow: 0 0 12px #F06C6C; }
.signal i.g.on { background: #7EE0A0; box-shadow: 0 0 12px #7EE0A0; }
.pair { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 6px; transition: bottom 2.6s var(--ease); z-index: 2; }
.pair.crossed { bottom: 164px; }
.fig { width: 14px; height: 26px; border-radius: 7px 7px 4px 4px; position: relative; }
.fig::before { content: ""; position: absolute; top: -13px; left: 1px; width: 12px; height: 12px; border-radius: 50%; background: inherit; }

/* ---------- Cipher ---------- */
.code { font-family: var(--serif); font-weight: 500; font-size: 30px; letter-spacing: .14em; text-align: center; color: var(--text-2); margin: 0 0 6px; }
.decoded { font-family: var(--serif); font-weight: 600; font-size: 30px; letter-spacing: .14em; text-align: center; color: var(--text-3); min-height: 40px; transition: color .6s var(--ease), text-shadow .6s var(--ease); }
.decoded.lit { color: var(--accent-2); text-shadow: 0 0 22px var(--accent-glow); }
.wheel-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 16px 0 14px; }
.wheel { width: 136px; height: 136px; position: relative; border-radius: 50%; border: 1px solid var(--line-strong); box-shadow: inset 0 0 0 18px rgba(222,186,122,.05); transition: transform .7s var(--ease); }
.wheel span { position: absolute; left: 50%; top: 50%; font-family: var(--serif); font-weight: 600; font-size: 12px; color: var(--text-3); }
.wheel-key { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-weight: 500; font-size: 38px; color: var(--accent-2); pointer-events: none; }
.round { width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--line); background: rgba(0,0,0,.15); color: var(--text); font-size: 22px; font-weight: 300; cursor: pointer; transition: transform .25s var(--ease), border-color .3s; }
.round:active { transform: scale(.92); border-color: var(--accent); }

/* ---------- Station ---------- */
.station { position: relative; height: 200px; border-radius: 18px; overflow: hidden; margin-bottom: 14px;
  background: linear-gradient(#231A22 0 64%, #2E242C 64% 67%, #17111A 67%); box-shadow: 0 0 0 1px var(--line); }
.station .sign { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 6px; background: #12324F; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .14em; white-space: nowrap; box-shadow: 0 0 22px rgba(80,150,220,.35); }
.station .lamp { position: absolute; top: 0; width: 120px; height: 120px; background: radial-gradient(circle at top, rgba(240,200,130,.18), transparent 70%); }
.station .bench { position: absolute; left: 50%; bottom: 76px; width: 96px; height: 6px; margin-left: -48px; border-radius: 3px; background: #6A4F3A; }
.station .pair2 { position: absolute; left: 50%; bottom: 82px; transform: translateX(-50%); display: flex; gap: 4px; }
.train { position: absolute; bottom: 16px; left: 110%; width: 300px; height: 82px; border-radius: 12px 28px 6px 6px; background: linear-gradient(#D9D6D2 0 56%, var(--accent) 56% 62%, #CFCBC6 62%); }
.train .w { position: absolute; top: 12px; width: 34px; height: 24px; border-radius: 5px; background: #F2D9A6; box-shadow: 0 0 12px rgba(242,217,166,.6); }
.train .door { position: absolute; top: 10px; width: 26px; height: 64px; border-radius: 3px; background: #A9A5A0; transition: background .5s var(--ease); }
.train.open .door { background: #2A2026; }
.missed { font-family: var(--serif); font-size: 21px; font-weight: 500; text-align: center; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; margin: 0 0 6px; }
.bubble { max-width: 86%; padding: 11px 15px; border-radius: 18px; font-size: 16px; line-height: 1.45; animation: enter .7s var(--ease) both; }
.bubble.her { align-self: flex-start; background: #2B2029; border-bottom-left-radius: 6px; }
.bubble.him { align-self: flex-end; background: #1F4A3C; border-bottom-right-radius: 6px; }
.bubble .who { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--accent); margin-bottom: 3px; }
.inline-field { display: inline-block; width: 120px; min-height: 0; padding: 2px 4px; font-size: 20px; }

/* ---------- Tile puzzle ---------- */
.board-wrap { position: relative; }
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 18px; background: rgba(0,0,0,.25); box-shadow: 0 0 0 1px var(--line); touch-action: manipulation; transition: gap .8s var(--ease), padding .8s var(--ease); }
.tile { aspect-ratio: 1; background-size: 300% 300%; border-radius: 10px; cursor: pointer; transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-radius .8s var(--ease); }
.tile.sel { transform: scale(.93); box-shadow: 0 0 0 2px var(--accent), 0 0 18px var(--accent-glow); }
.board.solved { gap: 0; padding: 0; }
.board.solved .tile { border-radius: 0; }
.board.solved { border-radius: 18px; overflow: hidden; }
.peek-img { position: absolute; inset: 0; background-size: cover; border-radius: 18px; opacity: 0; transition: opacity .4s var(--ease); pointer-events: none; }
.board-wrap.peeking .peek-img { opacity: 1; }

/* ---------- Booth strip ---------- */
.strip { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; border-radius: 14px; background: rgba(243,231,217,.06); box-shadow: 0 0 0 1px var(--line); max-width: 300px; margin: 0 auto 18px; }
.strip img { width: 100%; display: block; border-radius: 6px; opacity: 0; transform: translateY(-10px); filter: blur(6px); transition: all .9s var(--ease); }
.strip img.in { opacity: 1; transform: none; filter: none; }

/* ---------- Paper (decree + letter) ---------- */
.paper { background: var(--paper); color: var(--paper-ink); border-radius: 6px; padding: 30px 24px 26px; position: relative;
  box-shadow: 0 30px 60px -28px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.4) inset;
  background-image: radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.6), transparent 60%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.paper .eyebrow { color: #A07A3E; }
.paper .title { color: var(--paper-ink); }
.paper label { display: block; font-family: var(--serif); font-size: 19px; font-weight: 600; margin: 16px 0 4px; color: var(--paper-ink); }
.paper .field.ink { font-family: var(--serif); font-size: 20px; text-align: left; color: var(--paper-ink); caret-color: #8E2333; border-bottom: 1px solid rgba(58,38,48,.25); min-height: 44px; padding: 6px 2px; }
.paper .field.ink::placeholder { color: rgba(58,38,48,.38); }
.paper .field.ink:focus { border-bottom-color: #8E2333; box-shadow: none; }
.paper textarea.field.ink { min-height: 64px; resize: none; line-height: 1.4; }
.paper .small { color: rgba(58,38,48,.55); }
.paper .msg { color: #A3344A; }
.letter { font-family: var(--serif); font-size: 20px; line-height: 1.62; white-space: pre-wrap; }
.sign { font-family: var(--script); font-size: 34px; color: #8E2333; display: block; text-align: right; margin-top: 14px; opacity: 0; transition: opacity 1.4s var(--ease); }
.sign.show { opacity: 1; }
.wax { width: 72px; height: 72px; border-radius: 50%; margin: 6px auto 16px; background: radial-gradient(circle at 34% 30%, #C8505D, #7E1F2E 72%); display: grid; place-items: center; animation: stamp .9s var(--ease) both; box-shadow: 0 10px 20px -8px rgba(0,0,0,.7), inset 0 -4px 8px rgba(0,0,0,.3); }
.wax span { font-family: var(--script); font-size: 38px; color: #F3DDB0; margin-top: 6px; }
@keyframes stamp { from { transform: scale(1.8); opacity: 0; filter: blur(4px); } }

/* ---------- Finale ---------- */
.doors { position: fixed; inset: 0; z-index: 30; display: flex; pointer-events: none; }
.door { flex: 1; background: linear-gradient(90deg, #1B1219, #2A1C26 50%, #1B1219); border: 1px solid var(--line-strong); transition: transform 2.8s cubic-bezier(.65,0,.25,1), opacity 2.8s var(--ease); position: relative; }
.door::before { content: ""; position: absolute; inset: 18px; border: 1px solid var(--line); border-radius: 999px 999px 8px 8px; }
.door.l { transform-origin: left; } .door.r { transform-origin: right; }
.doors.open .door.l { transform: perspective(1000px) rotateY(-96deg); opacity: 0; }
.doors.open .door.r { transform: perspective(1000px) rotateY(96deg); opacity: 0; }
.reveal { width: 86%; max-width: 330px; margin: 0 auto; animation: reveal 3s var(--ease) both; }
.reveal .arch { aspect-ratio: 9 / 16; }
.reveal img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes reveal { from { opacity: 0; filter: brightness(2) blur(14px); transform: scale(1.04); } to { opacity: 1; filter: none; transform: none; } }
.name-plate { text-align: center; margin-top: 22px; }
.name-plate .script { font-size: 38px; line-height: 1.1; display: block; white-space: nowrap; }
.name-plate .sub { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--text-2); margin-top: 6px; }

/* ---------- Feast ---------- */
.feast-head { text-align: center; margin-bottom: 22px; }
.menu { display: grid; gap: 1px; background: var(--line); border-radius: var(--r-panel); overflow: hidden; box-shadow: 0 0 0 1px var(--line); margin-bottom: 110px; }
.item { display: flex; gap: 14px; align-items: center; padding: 14px 14px; background: var(--panel-solid); }
.ico { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; background: rgba(222,186,122,.08); color: var(--accent); }
.ico svg { width: 30px; height: 30px; }
.item .info { flex: 1; min-width: 0; }
.item .name { font-weight: 600; font-size: 15px; }
.item .desc { font-size: 13px; color: var(--text-3); line-height: 1.4; margin-top: 2px; }
.item .price { font-size: 12px; font-weight: 600; color: var(--accent); margin-top: 5px; letter-spacing: .02em; }
.add { flex: none; width: 84px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; color: var(--accent-2); font-family: var(--sans); font-weight: 700; font-size: 13px; letter-spacing: .08em; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .35s var(--ease); }
.add.has { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); justify-content: space-between; padding: 0 2px; }
.add b { width: 28px; height: 32px; display: grid; place-items: center; font-size: 18px; font-weight: 600; }
.cartbar { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 25; max-width: 420px; margin: 0 auto; min-height: 56px; border: 0; border-radius: 999px; padding: 0 22px; display: flex; justify-content: space-between; align-items: center; font-family: var(--sans); font-size: 14px; font-weight: 600; cursor: pointer; color: var(--accent-ink); background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 16px 40px -14px rgba(0,0,0,.8), 0 0 30px -10px var(--accent-glow); transition: background .5s var(--ease), color .5s var(--ease); animation: enter .8s var(--ease) both; }
.cartbar.locked { background: #2E222B; color: var(--text-3); box-shadow: 0 0 0 1px var(--line), 0 16px 40px -14px rgba(0,0,0,.8); }
.dates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 110px; }
.date { border-radius: var(--r-ctl); border: 1px solid var(--line); background: rgba(0,0,0,.16); padding: 10px 2px 8px; text-align: center; cursor: pointer; font-family: var(--sans); color: var(--text); transition: all .35s var(--ease); }
.date .dw { font-size: 10px; font-weight: 700; letter-spacing: .12em; color: var(--text-3); text-transform: uppercase; }
.date .dd { font-family: var(--serif); font-size: 26px; font-weight: 500; line-height: 1.15; }
.date .dm { font-size: 11px; color: var(--text-3); }
.date.wknd .dw { color: var(--accent); }
.date.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 20px -4px var(--accent-glow); }
.date.on .dw, .date.on .dm { color: rgba(42,27,18,.7); }
.summary { border-top: 1px solid var(--line); margin: 6px 0 4px; }
.summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); font-size: 15px; }
.summary .row span { color: var(--text-2); }
.summary .row b { font-weight: 600; text-align: right; }
.stat { text-align: center; margin: 8px 0 18px; }
.stat .k { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); }
.stat .v { font-family: var(--serif); font-size: 49px; font-weight: 500; color: var(--accent-2); line-height: 1.1; font-variant-numeric: tabular-nums; }

/* ---------- Hint ---------- */
#raven { position: fixed; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 22; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 20px; pointer-events: none; }
#raven > * { pointer-events: auto; }
#ravenBtn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: rgba(28,19,27,.82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-radius: 999px; padding: 9px 16px; font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: .06em; color: var(--text-3); cursor: pointer; transition: color .5s var(--ease), border-color .5s var(--ease), box-shadow .5s var(--ease); }
#ravenBtn.ready { color: var(--accent-2); border-color: var(--line-strong); animation: hintGlow 2.8s ease-in-out infinite; }
@keyframes hintGlow { 50% { box-shadow: 0 0 22px -4px var(--accent-glow); } }
#ravenBubble { max-width: 340px; background: rgba(28,19,27,.94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid var(--line); color: var(--text); border-radius: 18px; padding: 14px 16px; font-size: 14px; line-height: 1.55; box-shadow: 0 20px 40px -18px rgba(0,0,0,.8); animation: enter .6s var(--ease) both; }
#ravenBubble b { color: var(--accent); font-weight: 600; }

#toast { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 40; background: rgba(28,19,27,.95); border: 1px solid var(--line); color: var(--text); padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; animation: enter .5s var(--ease) both; white-space: nowrap; }

.spark { position: fixed; pointer-events: none; z-index: 45; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 10px 2px var(--accent-glow); }

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