/* Melrose × Old money · earth tones
   取材自餐廳門口：胡桃木牆板（直向立柱＋橫向腰線）、畫燈暖光、古銅拉絲銘牌、斜面黃銅框、四角十字螺絲。
   首屏＝站在門口（深色牆面＋燈＋銘牌＋姓名），往下＝入內的卡紙（米色、直角、黃銅細框）。 */
:root {
  --r: 2px;
  --r-sm: 2px;
  --r-pill: 999px;
  --fs-xs: 13px;
  --fs-s: 14px;
  --fs-m: 16px;
  --fs-l: 18px;
  --fs-xl: 22px;
  --paper: #efe6d6;
  --paper-hi: #f6efe2;
  --paper-deep: #e3d7c2;
  --ink: #2a211a;
  --ink-soft: #5e4f40;
  --olive: #5a3418;            /* 胡桃木：次要文字、連結 */
  --wall: #2f180b;             /* 牆面 */
  --accent: #4f2c15;           /* 深胡桃：姓名、桌號、主按鈕（對 --paper 約 11:1）*/
  --brass-line: #b08a4a;       /* 黃銅：線條、裝飾 */
  --label: #7a5a2c;            /* 深黃銅：卡紙上的小字（對比 5.2:1）*/
  --camel: #c9a35f;            /* 黃銅框；牆上小字（對 --wall 5.6:1）*/
  --bronze: #7a5a2c;
  --brass-deep: #6a4b22;
  --on-wall: #e6cf9c;          /* 牆上正文（對 --wall 8.7:1）*/
  --on-wall-soft: #d8b878;     /* 牆上次要字（7.0:1）*/
  --line: rgba(90, 52, 24, .28);
  --ok: #4e6b3a;
  --no: #8a4b3a;
  --serif-latin: 'Jost', 'Futura', 'Avenir Next', 'Helvetica Neue', sans-serif;  /* 與銘牌字體一致的幾何無襯線 */
  --serif-tc: 'Noto Serif TC', 'PMingLiU', 'Songti TC', serif;
  --sans-tc: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  /* 斜面黃銅框：左上受光、右下背光 */
  --brass-bevel: linear-gradient(135deg, #f4dca4 0%, #b8904b 28%, #e8c886 52%, #8d6631 78%, #c9a35f 100%);
  /* 銘牌四角的十字圓頭螺絲 */
  --screw: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cdefs%3E%3CradialGradient id='g' cx='.35' cy='.3' r='.8'%3E%3Cstop offset='0' stop-color='%23fbe7b0'/%3E%3Cstop offset='.5' stop-color='%23c39a52'/%3E%3Cstop offset='1' stop-color='%235e421c'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='10' cy='10' r='9' fill='url(%23g)' stroke='%23362510' stroke-width='.8'/%3E%3Cpath d='M10 4.6v10.8M4.6 10h10.8' stroke='%23362510' stroke-width='1.7' stroke-linecap='round'/%3E%3Cpath d='M10.9 5v10M5 10.9h10' stroke='%23fff1c8' stroke-width='.5' opacity='.55'/%3E%3C/svg%3E");
  /* 畫燈：壁座＋古銅燈管＋下緣發光縫 */
  --lamp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 64'%3E%3Cdefs%3E%3ClinearGradient id='b' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23685440'/%3E%3Cstop offset='.3' stop-color='%232c2118'/%3E%3Cstop offset='1' stop-color='%230e0a06'/%3E%3C/linearGradient%3E%3CradialGradient id='m' cx='.4' cy='.35' r='.75'%3E%3Cstop offset='0' stop-color='%234d3d2d'/%3E%3Cstop offset='1' stop-color='%23110c07'/%3E%3C/radialGradient%3E%3Cfilter id='f' x='-20%25' y='-300%25' width='140%25' height='700%25'%3E%3CfeGaussianBlur stdDeviation='2.6'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M106 22a14 14 0 0 1 28 0z' fill='url(%23m)'/%3E%3Crect x='116' y='18' width='8' height='16' rx='2' fill='%231a130c'/%3E%3Crect x='110' y='21' width='20' height='7' rx='3' fill='%23332619'/%3E%3Crect x='18' y='33' width='204' height='14' rx='7' fill='url(%23b)'/%3E%3Crect x='11' y='32' width='14' height='16' rx='4' fill='url(%23b)'/%3E%3Crect x='215' y='32' width='14' height='16' rx='4' fill='url(%23b)'/%3E%3Crect x='42' y='44' width='156' height='6' rx='3' fill='%23ffe9b8' filter='url(%23f)'/%3E%3Crect x='48' y='45' width='144' height='3' rx='1.5' fill='%23fffaf0'/%3E%3C/svg%3E");
  --stile: min(46vw, 400px);   /* 直向牆板接縫與畫面中心的距離 */
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
body {
  background-color: var(--wall);
  color: var(--ink);
  font-family: var(--serif-tc);
  font-size: var(--fs-m);
  line-height: 1.75;
  min-height: 100vh;
  line-break: strict;
  padding: 0 max(12px, env(safe-area-inset-left, 0px)) calc(clamp(24px, 4vw, 56px) + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-right, 0px));
  -webkit-text-size-adjust: 100%;
  /* 胡桃木牆：左右暗角、直向接縫（暗槽＋受光邊）、不規則木紋（純 CSS，不載圖） */
  background-image:
    linear-gradient(90deg, rgba(14,6,1,.45), transparent 16%, transparent 84%, rgba(14,6,1,.45)),
    linear-gradient(90deg,
      transparent calc(50% - var(--stile) - 3px), rgba(10,4,0,.55) calc(50% - var(--stile) - 3px),
      rgba(10,4,0,.55) calc(50% - var(--stile)), rgba(255,214,170,.12) calc(50% - var(--stile)),
      rgba(255,214,170,.12) calc(50% - var(--stile) + 1px), transparent calc(50% - var(--stile) + 1px),
      transparent calc(50% + var(--stile) - 1px), rgba(255,214,170,.08) calc(50% + var(--stile) - 1px),
      rgba(255,214,170,.08) calc(50% + var(--stile)), rgba(10,4,0,.55) calc(50% + var(--stile)),
      rgba(10,4,0,.55) calc(50% + var(--stile) + 3px), transparent calc(50% + var(--stile) + 3px)),
    repeating-linear-gradient(90deg, rgba(0,0,0,.035) 0 1px, transparent 1px 6px, rgba(255,220,180,.03) 6px 8px, transparent 8px 19px),
    repeating-linear-gradient(90deg, transparent 0 37px, rgba(0,0,0,.05) 37px 40px, transparent 40px 83px),
    repeating-linear-gradient(90deg, transparent 0 113px, rgba(255,210,160,.035) 113px 117px, transparent 117px 211px),
    linear-gradient(90deg, #2b1508, #3a1d0d 30%, #331909 60%, #3c1f0f 85%, #2b1508);
}
/* main#card 只是置中容器；卡紙樣式在 .paper */
.card { max-width: 640px; margin: 0 auto; }

/* ───── 門口：畫燈＋銘牌＋刻在牆上的姓名 ───── */
.door { position: relative; text-align: center; padding: clamp(10px, 3vw, 36px) 0 30px; isolation: isolate; }
/* 畫燈打在牆上的暖光（往下漸弱的光暈） */
.door::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  left: calc(50% - 50vw); top: clamp(40px, 9vw, 80px); width: 100vw; height: min(150vw, 760px);
  -webkit-mask-image: linear-gradient(transparent, #000 30px); mask-image: linear-gradient(transparent, #000 30px);
  background:
    radial-gradient(ellipse min(38vw, 260px) min(30vw, 200px) at 50% 4%, rgba(255,226,170,.40), transparent 70%),
    radial-gradient(ellipse min(80vw, 560px) 70% at 50% 0%, rgba(255,196,120,.30), rgba(255,170,90,.10) 55%, transparent 78%);
  animation: lamp-on 1.4s ease-out both;
}
.lamp { display: block; width: clamp(170px, 50vw, 236px); aspect-ratio: 240 / 64; margin: 0 auto; background: var(--lamp) center / contain no-repeat; }
@keyframes lamp-on { 0% { opacity: 0 } 18% { opacity: .55 } 26% { opacity: .2 } 100% { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
.door .plaque-wrap, .door .mono { animation: rise .9s .25s cubic-bezier(.22,1,.36,1) both; }
.door .eyebrow, .door .invite { animation: rise .9s .55s cubic-bezier(.22,1,.36,1) both; }

.mono {
  font-family: var(--serif-latin);
  font-size: clamp(44px, 10vw, 64px);
  line-height: 1;
  letter-spacing: .08em;
  color: var(--on-wall);
  margin: 18px 0 0;
  font-weight: 300;
}
.logo.plaque { display: block; width: clamp(130px, 34vw, 170px); height: auto; margin: 0; box-shadow: 0 22px 30px -8px rgba(0,0,0,.6), 0 2px 4px rgba(0,0,0,.35); }
/* 銘牌：古銅拉絲面＋斜面黃銅框＋四角螺絲＋落在牆上的陰影 */
.logo.wordmark, .plate {
  background:
    var(--screw) left 8px top 8px / 11px no-repeat,
    var(--screw) right 8px top 8px / 11px no-repeat,
    var(--screw) left 8px bottom 8px / 11px no-repeat,
    var(--screw) right 8px bottom 8px / 11px no-repeat,
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(255,220,160,.16), transparent 70%),
    #2a1d10 url(/static/brand/bronze.jpg) center / cover;
  border: 6px solid #b8904b;
  border-image: var(--brass-bevel) 1;
  border-radius: 0;
  box-shadow:
    0 0 0 1px #3a2610,
    inset 0 0 0 1px rgba(0,0,0,.6),
    inset 0 3px 8px rgba(0,0,0,.45),
    0 26px 30px -12px rgba(0,0,0,.7),
    0 4px 8px rgba(0,0,0,.35);
}
.logo.wordmark { display: block; width: clamp(236px, 68vw, 300px); height: auto; padding: 26px 32px; margin: 0; }
.plaque-wrap { position: relative; display: table; margin: 14px auto 0; }
/* 銘牌受光：燈亮後一道光掠過拉絲面，之後每隔幾秒低調再閃一次 */
.sheen { position: absolute; inset: 6px; overflow: hidden; pointer-events: none; }
.plaque-wrap .plaque + .sheen { inset: 0; }
.sheen::before, .plate::after {
  content: ''; position: absolute; top: -10%; bottom: -10%; left: 0; width: 38%; opacity: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 10%, rgba(255,238,196,.12) 35%, rgba(255,240,205,.5) 50%, rgba(255,238,196,.12) 65%, transparent 90%);
  mix-blend-mode: screen;
}
.sheen::before { animation: glint-loop 9s 1.5s ease-in-out infinite; }
@keyframes glint { from { opacity: 1; transform: translateX(-160%) skewX(-18deg) } to { opacity: 1; transform: translateX(330%) skewX(-18deg) } }
@keyframes glint-loop { 0% { opacity: 1; transform: translateX(-160%) skewX(-18deg) } 17%, 100% { opacity: 1; transform: translateX(330%) skewX(-18deg) } }
.eyebrow {
  font-family: var(--serif-latin);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--on-wall-soft);
  margin: 20px 0 0;
  padding-left: .32em; /* 抵銷字距造成的視覺偏右 */
}
.invite { text-align: center; margin-top: 26px; }
.invite .to { font-size: var(--fs-s); color: var(--on-wall-soft); margin: 0; letter-spacing: .5em; padding-left: .5em; }
/* 姓名：黃銅字，像嵌在牆上的名牌 */
.invite .name {
  font-size: clamp(32px, 8vw, 42px);
  font-weight: 600;
  line-height: 1.3;
  margin: 6px 0 14px;
  letter-spacing: .1em;
  color: #e9cf95;
  background: linear-gradient(180deg, #f8e6b8 0%, #e2c27f 45%, #c9a35f 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.55));
  text-wrap: balance;
}
.invite .lead { margin: 0; font-size: var(--fs-l); color: var(--on-wall); letter-spacing: .06em; text-wrap: balance; }
.invite .lead-sub { margin: 6px 0 0; font-family: var(--serif-latin); font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: var(--camel); overflow-wrap: anywhere; }
/* 日期：上下兩道黃銅細線夾住，像銘牌下方的刻字條 */
.invite .when { display: table; margin: 20px auto 0; padding: 8px 4px; font-size: var(--fs-m); color: var(--on-wall); letter-spacing: .06em; position: relative; text-wrap: balance; }
/* 兩道黃銅線由中央往兩側拉開 */
.invite .when::before, .invite .when::after { content: ''; position: absolute; left: 0; right: 0; height: 1px; background: rgba(201,163,95,.55); animation: draw 1.2s 1.05s cubic-bezier(.22,1,.36,1) both; }
.invite .when::before { top: 0; }
.invite .when::after { bottom: 0; }
@keyframes draw { from { transform: scaleX(0) } to { transform: scaleX(1) } }

/* 橫向腰線：照片下方那條橫木，滿版延伸 */
.rail { position: relative; height: 16px; margin: 0 0 30px; }
.rail::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: calc(50% - 50vw); width: 100vw;
  background: linear-gradient(180deg, rgba(10,4,0,.6) 0 2px, rgba(255,214,170,.14) 2px 3px, #40220f 3px, #341a0a 12px, rgba(10,4,0,.65) 12px 15px, rgba(255,214,170,.1) 15px 16px);
  box-shadow: 0 6px 12px rgba(0,0,0,.25);
}

/* ───── 卡紙 ───── */
.paper {
  position: relative;
  border-radius: var(--r);
  background: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,.015) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 0%, var(--paper-hi), var(--paper) 70%);
  border: 1px solid rgba(43,36,25,.35);
  box-shadow: 0 30px 60px rgba(0,0,0,.4), 0 2px 0 rgba(255,255,255,.08), inset 0 0 0 7px var(--paper), inset 0 0 0 8px var(--camel), inset 0 0 0 10px var(--paper), inset 0 0 0 11px rgba(201,163,95,.45);
  --pad-y: clamp(26px, 5vw, 56px); --pad-x: clamp(22px, 6vw, 56px);
  padding: var(--pad-y) var(--pad-x);
}
/* 室內照：裱框照片 */
.hero { margin: 0; overflow: hidden; border: 6px solid var(--paper-hi); box-shadow: 0 0 0 1px var(--brass-line), 0 8px 18px rgba(60,30,10,.16); }
.hero img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: center 60%; }
/* 穿越感：門開時室內照從近處退回定位 */
.fx .hero img { transform: scale(calc(1.16 - .16 * var(--p, 1))); transform-origin: 50% 40%; }

/* ───── 拉開帷幕：兩片深藍絲絨落地簾，捲動時往兩側收攏、以黃銅繩束起，全開後留在卡紙兩側 ───── */
.gate { display: none; }
/* 舞台（Apple 產品頁的 sticky 做法）：外框比舞台高 70svh，舞台 sticky 釘在畫面頂端，這 70svh 的捲動距離就拿來拉簾；
   舞台撐滿卡紙寬（吃掉卡紙內距）、至少一個畫面高，照片與主人的話置中 */
.fx .stage-track { margin: calc(-1 * var(--pad-y)) calc(-1 * var(--pad-x)) 0; }
/* 釘住的跑道：sticky 只在父層 content box 內移動，用 padding 不算，要實體墊高 */
.fx .stage-track::after { content: ''; display: block; height: 70vh; height: 70svh; height: calc(var(--vh, 100svh) * .7); }
.fx .stage {
  position: sticky; top: 0; min-height: 100vh; min-height: 100svh; min-height: var(--vh, 100svh); box-sizing: border-box; padding: var(--pad-y) var(--pad-x);
  display: flex; flex-direction: column; justify-content: center;
}
.fx .gate {
  display: block; position: absolute; z-index: 5; inset: 0;
  overflow: hidden; pointer-events: none;
}
/* 簾後透出的暖光（拉到一半最亮） */
.gate::before {
  content: ''; position: absolute; inset: 0; opacity: calc(var(--g, 0) * .7);
  background: radial-gradient(ellipse 55% 45% at 50% 38%, rgba(255,232,180,.95), rgba(255,200,120,.35) 55%, transparent 80%);
}
/* 頂端黃銅簾桿＋深藍簾頭 */
.gate::after {
  content: ''; position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: 30px;
  background:
    linear-gradient(180deg, transparent 0 7px, #5a3d18 7px, #f2d79c 9px, #b38a45 11px, #5e4019 13px, transparent 13px),
    repeating-linear-gradient(90deg, #0a1129 0 10px, #16204a 14px, #0a1129 20px);
  box-shadow: 0 6px 12px rgba(0,0,0,.55);
}
/* 收攏＝往外側壓縮（褶子跟著變密）；束起＝內緣在繩結高度往內縮成沙漏形（桌機）。只動 transform／clip-path，不用 filter */
.leaf {
  position: absolute; top: 0; bottom: 0; width: 51%; overflow: hidden; /* 手機沒有 clip-path，束繩陰影別溢到開口 */
  background:
    linear-gradient(180deg, rgba(0,0,0,.4), transparent 12%, transparent 80%, rgba(0,0,0,.5)),
    repeating-linear-gradient(90deg, #080e22 0, #0f1736 8px, #18234d 14px, #202d5c 16px, #16214a 20px, #0c1430 29px, #080e22 34px),
    #0e1634;
  transform: scaleX(calc(1 - var(--p, 0) * .89));
}
.leaf.l { left: 0; transform-origin: 0 50%; }
.leaf.r { right: 0; transform-origin: 100% 50%; }
/* 沙漏形只給桌機：clip-path 每格變形要整片重畫，手機（LINE／中低階 Android）會卡，手機只動 transform／opacity 交給 GPU */
@media (hover: hover) and (pointer: fine) {
  .leaf.l {
    clip-path: polygon(0 0, 100% 0,
      calc(100% - var(--p, 0) * 6%) 14%, calc(100% - var(--p, 0) * 24%) 28%,
      calc(100% - var(--p, 0) * 50%) 39%, calc(100% - var(--p, 0) * 60%) 45%,
      calc(100% - var(--p, 0) * 48%) 53%, calc(100% - var(--p, 0) * 28%) 70%,
      calc(100% - var(--p, 0) * 18%) 100%, 0 100%);
  }
  .leaf.r {
    clip-path: polygon(100% 0, 0 0,
      calc(var(--p, 0) * 6%) 14%, calc(var(--p, 0) * 24%) 28%,
      calc(var(--p, 0) * 50%) 39%, calc(var(--p, 0) * 60%) 45%,
      calc(var(--p, 0) * 48%) 53%, calc(var(--p, 0) * 28%) 70%,
      calc(var(--p, 0) * 18%) 100%, 100% 100%);
  }
}
/* 每格會變的元素各自成一層，捲動時只合成、不重畫 */
.fx .leaf, .fx .hero img { will-change: transform; }
.fx .shade, .fx .pull, .fx .gate::before, .fx .gate-hint { will-change: opacity; }
/* 不支援捲動驅動動畫的舊手機：學 alljoint.tw 用「觸發」——舞台一釘住就自己花 1.6 秒拉開、滑回去再自己合上（只動 transform／opacity，整段在合成器上跑），
   滑多快、來回滑都不用每格重算；中途反向會從當下位置平順倒轉。桌機仍跟著捲動緩動（見 effects()）
   transition 只掛在 .ran（第一次拉開才加）：載入時主視覺別先放大一次。合上時束繩先收、提示字最後才浮回來 */
.fx-tap .ran .leaf, .fx-tap .ran img { transition: transform 1.6s cubic-bezier(.65, 0, .35, 1); }
.fx-tap .ran .shade { transition: opacity 1.6s ease; }
.fx-tap .ran .pull { transition: opacity .4s ease; }
.fx-tap .ran .gate-hint { transition: opacity .4s ease 1.2s; }
.fx-tap .open .pull { transition: opacity .6s ease .8s; }
.fx-tap .open .gate-hint { transition: opacity .3s ease; }
.fx-tap .gate.open::before { animation: fx-glow 1.6s ease both; }
@keyframes fx-glow { 0%, 100% { opacity: 0 } 50% { opacity: .7 } }
/* 新手機：拉簾直接綁捲動位置（捲動驅動動畫在合成器上跑、跟手指同步，不經 JS）；--fx-a／--fx-b＝舞台釘住的捲動區間，由 JS 算好。
   只動 transform／opacity；數值與 JS 路徑的 --p 公式一致（簾 1-.89p、暗 .25p、繩 3p-1.4、暖光 .7(1-|2p-1|)、提示 1-5p、照片 1.16-.16p） */
.fx-sd .leaf, .fx-sd .shade, .fx-sd .pull, .fx-sd .gate::before, .fx-sd .gate-hint, .fx-sd .hero img {
  animation-duration: auto; animation-timing-function: linear; animation-fill-mode: both;
  animation-timeline: scroll(root); animation-range: var(--fx-a, 0px) var(--fx-b, 400px);
}
.fx-sd .leaf { animation-name: sd-leaf; } .fx-sd .shade { animation-name: sd-shade; } .fx-sd .pull { animation-name: sd-pull; }
.fx-sd .gate::before { animation-name: fx-glow; } .fx-sd .gate-hint { animation-name: sd-hint; } .fx-sd .hero img { animation-name: sd-hero; }
@keyframes sd-leaf { from { transform: scaleX(1) } to { transform: scaleX(.11) } }
@keyframes sd-shade { from { opacity: 0 } to { opacity: .25 } }
@keyframes sd-pull { 0%, 46.7% { opacity: 0 } 80%, 100% { opacity: 1 } }
@keyframes sd-hint { 0% { opacity: 1 } 20%, 100% { opacity: 0 } }
@keyframes sd-hero { from { transform: scale(1.16) } to { transform: scale(1) } }
/* 收攏變暗：疊黑只動 opacity，不用 filter（每格重算濾鏡在 LINE／中低階 Android 會掉幀）*/
.shade { position: absolute; inset: 0; background: #000; opacity: calc(var(--p, 0) * .25); pointer-events: none; }
/* 黃銅束繩：繩結高度一條扭繩，拉開過半才出現；寬度固定，桌機由 .leaf 的 clip-path 裁到繩結處（避免捲動時觸發 layout） */
.pull {
  position: absolute; top: calc(45% - 7px); height: 14px; left: 0; right: 0;
  background:
    repeating-linear-gradient(60deg, rgba(60,36,10,.55) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #5e4019, #f2d79c 35%, #b38a45 65%, #4a3112);
  box-shadow: 0 4px 8px rgba(0,0,0,.6);
  opacity: calc(var(--p, 0) * 3 - 1.4);
}
.gate-hint {
  position: absolute; z-index: 3; left: 0; right: 0; top: 44px; margin: 0; text-align: center;
  color: var(--on-wall); font-size: var(--fs-s); letter-spacing: .5em; padding-left: .5em;
  text-shadow: 0 1px 2px rgba(0,0,0,.8); opacity: calc(1 - var(--p, 0) * 5);
}
.gate-hint span { display: block; margin-top: 4px; font-family: var(--serif-latin); font-size: 11px; letter-spacing: .4em; text-transform: uppercase; color: var(--on-wall-soft); }
.gate-hint span::after { content: ''; display: block; width: 1px; height: 22px; margin: 8px auto 0; background: linear-gradient(var(--on-wall-soft), transparent); animation: nudge 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes nudge { 0%, 100% { transform: scaleY(.4); opacity: .4 } 50% { transform: scaleY(1); opacity: 1 } }

/* 捲動浮現（JS 加 .rv；無 IntersectionObserver 或減少動態時內容照常顯示） */
.fx .rv { opacity: 0; transform: translateY(22px); transition: opacity .9s ease-out, transform 1s cubic-bezier(.22,1,.36,1); }
.fx .rv.in { opacity: 1; transform: none; }
/* 桌號牌翻下來再掠光 */
.plate { position: relative; overflow: hidden; }
.fx #seat-wrap.in .plate { animation: plate-flip 1.1s .35s cubic-bezier(.2,.85,.25,1) both; transform-origin: 50% 0; }
.fx #seat-wrap.in .plate::after { animation: glint 1.3s 1.3s ease-in-out both; }
@keyframes plate-flip { from { opacity: 0; transform: perspective(700px) rotateX(-96deg) } 45% { opacity: 1 } to { opacity: 1; transform: perspective(700px) rotateX(0) } }
/* 重繪（切回前景重抓座位）時不重播入場 */
.played .door::before, .played .door .plaque-wrap, .played .door .mono, .played .door .eyebrow, .played .door .invite,
.played .invite .when::before, .played .invite .when::after { animation: none; }
/* 段落分隔：黃銅細線＋中央一顆螺絲 */
.rule { position: relative; height: 1px; margin: 34px 0; background: linear-gradient(90deg, transparent, var(--camel) 12%, var(--camel) 88%, transparent); }
.rule::before { content: ''; position: absolute; left: 50%; top: 50%; width: 13px; height: 13px; background: var(--screw) center / contain no-repeat; box-shadow: 0 0 0 7px var(--paper); border-radius: 50%; transform: translate(-50%, -50%) rotate(12deg); }
.letter { margin: 30px auto 0; max-width: 34em; padding: 0 4px; font-size: var(--fs-m); line-height: 2; color: var(--ink); text-align: center; text-wrap: pretty; line-break: strict; position: relative; }
.hero[hidden] + .letter { margin-top: 0; }
.nb { white-space: nowrap; }
.letter br + br { display: block; content: ''; margin-top: 8px; }
.letter::before, .letter::after { content: ''; display: block; width: 44px; height: 1px; background: var(--brass-line); margin: 0 auto 18px; opacity: .8; }
.letter::after { margin: 18px auto 0; }
/* 快速操作：像壁板一樣的分格按鈕列 */
.quick { display: flex; flex-wrap: wrap; gap: 1px; margin: 30px 0 0; background: var(--brass-line); border: 1px solid var(--brass-line); }
.qa { flex: 1 1 72px; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 6px; border: 0; border-radius: 0; color: var(--accent); text-decoration: none; font: inherit; font-size: var(--fs-s); letter-spacing: .1em; background: var(--paper-hi); cursor: pointer; white-space: nowrap; transition: background .15s; }
.qa:hover { background: #fbf6ec; }
.qa:active { background: var(--paper-deep); }
.qa:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.details { display: grid; gap: 0; margin: 30px 0 0; }
.d { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: baseline; border-top: 1px solid var(--line); padding: 14px 0; }
.d:last-child { border-bottom: 1px solid var(--line); }
.d .k { font-family: var(--serif-tc); font-size: var(--fs-xs); letter-spacing: .3em; color: var(--label); }
.d .v { font-size: var(--fs-l); margin: 0; }
.d .v small { display: block; font-size: var(--fs-s); color: var(--ink-soft); }
.d .v small + small { margin-top: 2px; }
.d .v a { color: var(--olive); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--camel); }
.vlinks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.vlinks a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; font-family: var(--serif-latin); font-size: var(--fs-s); letter-spacing: .04em; border: 1px solid var(--brass-line); border-radius: 0; text-decoration: none; background: var(--paper-hi); }
.notes { margin: 24px 0 0; padding: 16px 18px; border: 3px double rgba(176,138,74,.6); font-size: var(--fs-m); color: var(--ink-soft); white-space: pre-line; }
/* 區塊標題：英文小字 kicker ＋ 中文標題 */
h2 {
  font-family: var(--serif-tc);
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: .24em;
  padding-left: .24em;
  text-align: center;
  color: var(--accent);
  margin: 0 0 8px;
}
h2[data-en]::before { content: attr(data-en); display: block; margin-bottom: 4px; font-family: var(--serif-latin); font-size: 12px; font-weight: 400; letter-spacing: .32em; text-transform: uppercase; color: var(--label); }
.sub { text-align: center; color: var(--ink-soft); font-size: var(--fs-m); margin: 0 0 20px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  border: 1px solid var(--accent); background: var(--paper-hi); color: var(--accent); border-radius: 0;
  min-height: 56px; padding: 14px 10px; font: inherit; font-size: var(--fs-m); letter-spacing: .16em; cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.choice:hover { background: #fbf6ec; }
.choice[aria-pressed="true"] { background: var(--accent); color: var(--paper-hi); box-shadow: inset 0 0 0 3px var(--accent), inset 0 0 0 4px var(--camel); }
.choice[aria-pressed="true"]::before { content: '✓ '; color: var(--camel); }
.choice:focus-visible, .btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--brass-line); outline-offset: 2px; }
.field { display: grid; gap: 6px; margin-top: 18px; }
.field label { font-size: var(--fs-s); color: var(--ink-soft); letter-spacing: .08em; }
input, textarea, select {
  font: inherit; font-family: var(--sans-tc); font-size: var(--fs-m); color: var(--ink);
  background: rgba(255,253,248,.7); border: 1px solid rgba(90,52,24,.35); border-radius: 0; padding: 10px 12px; width: 100%;
  min-height: 46px;
}
input:focus, textarea:focus, select:focus { border-color: var(--brass-line); background: #fffdf8; }
textarea { min-height: 88px; resize: vertical; }
/* 主按鈕：深胡桃底＋內嵌黃銅細線（呼應銘牌框） */
.btn {
  display: inline-block; width: 100%; margin-top: 20px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--accent); color: var(--paper-hi); min-height: 52px; padding: 14px; font: inherit; font-size: var(--fs-s); letter-spacing: .14em;
  box-shadow: inset 0 0 0 3px var(--accent), inset 0 0 0 4px rgba(201,163,95,.75), 0 6px 14px rgba(60,30,10,.18);
  transition: background .15s;
}
.btn:hover { background: #5d3519; }
.btn[disabled] { opacity: .6; cursor: default; }
.status { margin: 14px 0 0; text-align: center; font-size: var(--fs-m); min-height: 1.5em; }
.status.ok { color: var(--ok); }
.status.err { color: var(--no); }
.answered { text-align: center; padding: 22px 18px; border: 1px solid var(--brass-line); background: var(--paper-hi); box-shadow: inset 0 0 0 4px var(--paper-hi), inset 0 0 0 5px rgba(176,138,74,.35); }
.answered .big { font-size: var(--fs-xl); margin: 0 0 4px; font-weight: 600; color: var(--accent); letter-spacing: .06em; }
.answered .meta { color: var(--ink-soft); font-size: var(--fs-s); margin: 0; }
.answered .acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.answered .acts .link { margin-top: 14px; text-decoration: none; display: inline-flex; align-items: center; }
.story-tip { margin: 6px 0 0; font-size: var(--fs-xs); line-height: 1.6; color: var(--ink-soft); text-align: center; text-wrap: balance; }
.link { background: none; border: 1px solid var(--brass-line); border-radius: 0; color: var(--accent); font: inherit; font-size: var(--fs-s); letter-spacing: .1em; cursor: pointer; padding: 8px 20px; margin-top: 12px; min-height: 44px; }
.link:hover { background: #fbf6ec; }
.seat { text-align: center; }
.seat .table-label { font-size: var(--fs-xs); letter-spacing: .3em; color: var(--label); font-family: var(--serif-tc); margin-top: 14px; }
/* 桌號：一塊小銘牌 */
.seat .table { display: inline-block; min-width: 132px; margin: 10px 0 4px; padding: 20px 30px 18px; font-family: var(--serif-latin); font-size: 52px; line-height: 1; font-weight: 300; letter-spacing: .06em; color: #f1d9a2; text-shadow: 0 1px 0 rgba(0,0,0,.7), 0 -1px 0 rgba(255,236,190,.18); }
.seat .mates { margin: 14px 0 0; color: var(--ink-soft); font-size: var(--fs-m); }
.seat .mates b { color: var(--ink); font-weight: 600; }
.plan { margin-top: 20px; }
.plan-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; border: 1px solid var(--brass-line); background: #3c1f10; box-shadow: inset 0 0 30px rgba(0,0,0,.45); }
.plan-scroll svg { width: 100%; min-width: 760px; height: auto; display: block; font-family: var(--serif-latin); }
.plan-scroll.zoomed svg { min-width: 1140px; }
.plan-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; }
.plan-hint { font-size: var(--fs-xs); color: var(--ink-soft); letter-spacing: .1em; flex-basis: 100%; text-align: center; }
.mini { font: inherit; font-size: var(--fs-s); min-height: 44px; padding: 6px 16px; border: 1px solid var(--brass-line); border-radius: 0; background: var(--paper-hi); color: var(--accent); letter-spacing: .08em; cursor: pointer; }
/* 座位平面圖：夜裡的餐廳，自己的桌子被燈照亮 */
.fp-zone rect { fill: rgba(255,220,170,.04); stroke: rgba(201,163,95,.35); stroke-width: 1; }
.fp-zone text { font-size: var(--fs-m); letter-spacing: .2em; fill: #c9a35f; }
.fp-zone .fp-door { stroke: #c9a35f; stroke-width: 5; stroke-linecap: round; } .fp-zone .fp-door-label { font-weight: 600; letter-spacing: .1em; fill: #e3c58a; }
.fp-table rect, .fp-table circle, .fp-table .fp-booth { fill: #5a321a; stroke: rgba(201,163,95,.55); stroke-width: 1; }
.fp-table .fp-booth { fill: #24304a; }  /* 卡座：對應餐廳午夜藍沙發 */
.fp-table .fp-name { font-size: var(--fs-m); fill: #d8c3a0; pointer-events: none; }
.fp-table.is-mine rect, .fp-table.is-mine circle, .fp-table.is-mine .fp-booth { fill: #f1d9a2; stroke: #fff3d6; stroke-width: 2; }
.fp-table.is-mine .fp-name { fill: #2a1a0c; font-weight: 600; font-size: var(--fs-m); }
@keyframes fp-glow { 0%, 100% { filter: drop-shadow(0 0 4px rgba(255,214,140,.7)) } 50% { filter: drop-shadow(0 0 14px rgba(255,214,140,1)) } }
.fp-table.is-mine > :first-child { animation: fp-glow 2.4s ease-in-out 4; } /* 濾鏡動畫每格重畫，閃幾次就停，別一直佔著手機 */
.chart { margin-top: 18px; }
.chart img { width: 100%; height: auto; border: 1px solid var(--brass-line); display: block; }
.chart a { display: flex; align-items: center; justify-content: center; min-height: 44px; text-align: center; margin-top: 8px; font-size: var(--fs-s); color: var(--accent); }
/* 右下角浮動「回覆出席」：精簡、不擋內文 */
.cta { position: fixed; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  min-height: 46px; padding: 8px 18px; border: 0; border-radius: 0; background: var(--accent); color: var(--paper-hi); font: inherit; font-size: var(--fs-s); letter-spacing: .14em;
  box-shadow: inset 0 0 0 3px var(--accent), inset 0 0 0 4px rgba(201,163,95,.8), 0 12px 28px rgba(0,0,0,.45); cursor: pointer; transition: opacity .2s, transform .2s; }
.cta.off { opacity: 0; pointer-events: none; transform: translateY(12px); }
/* 菜單：老派菜單卡，上下雙線、品名置中 */
#menu-list { border-block: 3px double var(--brass-line); }
.mcat + .mcat { border-top: 1px solid rgba(176,138,74,.5); }
.mcat summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 8px 2px; font-family: var(--serif-latin), var(--serif-tc); font-size: var(--fs-xs); letter-spacing: .28em; text-transform: uppercase; color: var(--label); }
.mcat summary::-webkit-details-marker { display: none; }
.mcat summary::before { content: '+'; visibility: hidden; font-size: var(--fs-l); letter-spacing: 0; } /* 對稱佔位，讓標題置中 */
.mcat summary::after { content: '+'; font-size: var(--fs-l); font-weight: 300; color: var(--brass-line); letter-spacing: 0; }
.mcat[open] summary::after { content: '−'; }
.mcat ul { list-style: none; margin: 0; padding: 4px 2px 18px; display: grid; gap: 16px; }
.msub { font-family: var(--serif-latin), var(--serif-tc); font-size: var(--fs-xs); letter-spacing: .2em; text-transform: uppercase; color: var(--label); margin-top: 4px; text-align: center; }
.mitem { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: baseline; }
#menu-list:not(.has-price) .mitem { grid-template-columns: 1fr; text-align: center; }
.mzh { font-size: var(--fs-l); font-weight: 600; letter-spacing: .04em; color: var(--accent); }
.men { grid-column: 1; font-family: var(--serif-latin), var(--serif-tc); font-size: var(--fs-s); letter-spacing: .1em; color: var(--ink-soft); }
.mprice { grid-column: 2; grid-row: 1 / span 2; font-family: var(--serif-latin); font-size: var(--fs-s); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.menu img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: #fff; }
.menu .menu-link { display: flex; justify-content: center; margin-top: 16px; }
.menu .menu-link a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 20px; border: 1px solid var(--brass-line); text-decoration: none; color: var(--accent); font-size: var(--fs-s); letter-spacing: .08em; background: var(--paper-hi); }
.sheet-bg { position: fixed; inset: 0; background: rgba(28,13,4,.66); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; background: var(--paper); border-top: 2px solid var(--brass-line); padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; box-shadow: 0 -10px 40px rgba(0,0,0,.35); }
.sheet-hint { margin: 0 4px 8px; font-size: var(--fs-xs); line-height: 1.7; color: var(--ink-soft); text-align: center; text-wrap: balance; }
.sheet-title { margin: 0 0 4px; text-align: center; font-size: var(--fs-s); letter-spacing: .2em; color: var(--label); font-family: var(--serif-tc); }
.sheet-opt { display: grid; min-height: 56px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 0; text-decoration: none; color: var(--ink); background: var(--paper-hi); align-content: center; font: inherit; text-align: left; cursor: pointer; }
.sheet-opt span { font-size: var(--fs-m); } .sheet-opt small { font-size: var(--fs-xs); color: var(--ink-soft); }
.sheet-opt:active { background: var(--paper-deep); }
.sheet-close { min-height: 48px; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: var(--fs-m); letter-spacing: .1em; cursor: pointer; }
@media (min-width: 600px) { .sheet-bg { align-items: center; } .sheet { border: 1px solid var(--brass-line); box-shadow: 0 30px 60px rgba(0,0,0,.4), inset 0 0 0 4px var(--paper), inset 0 0 0 5px rgba(176,138,74,.45); } }
/* 彩蛋：裱在黃銅框裡、四角螺絲（插圖本身不動） */
.egg-bg { position: fixed; inset: 0; background: rgba(28,13,4,.72); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 24px; }
.egg {
  width: min(100%, 340px); padding: 26px 24px 20px; text-align: center;
  background:
    var(--screw) left 10px top 10px / 11px no-repeat,
    var(--screw) right 10px top 10px / 11px no-repeat,
    var(--screw) left 10px bottom 10px / 11px no-repeat,
    var(--screw) right 10px bottom 10px / 11px no-repeat,
    radial-gradient(ellipse at 50% 0%, var(--paper-hi), var(--paper) 70%);
  border: 5px solid #b8904b; border-image: var(--brass-bevel) 1;
  box-shadow: 0 0 0 1px #3a2610, 0 30px 60px rgba(0,0,0,.5);
  animation: egg-in .5s cubic-bezier(.22,1,.36,1) both;
}
@keyframes egg-in { from { transform: translateY(40px) scale(.8); opacity: 0 } to { transform: none; opacity: 1 } }
.bear { width: 160px; height: 160px; display: block; margin: 0 auto; overflow: visible; }
.egg-img { display: block; width: 100%; max-height: 280px; object-fit: cover; margin: 0 auto 10px; border: 1px solid var(--brass-line); }
.bear-body { transform-origin: 100px 150px; animation: bear-bounce 1.6s ease-in-out infinite; }
.bear-arm { transform-origin: 150px 140px; animation: bear-cheers 1.6s ease-in-out infinite; }
@keyframes bear-bounce { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-3px) } }
@keyframes bear-cheers { 0%, 100% { transform: rotate(0) } 50% { transform: rotate(-6deg) } }
.egg-title { font-size: var(--fs-xl); font-weight: 600; color: var(--accent); letter-spacing: .06em; margin: 10px 0 4px; }
.egg-sub { font-size: var(--fs-s); color: var(--ink-soft); margin: 0 0 6px; }
.egg-btn { margin-top: 14px; }
.hint { display: block; font-size: var(--fs-xs); color: var(--ink-soft); margin-top: 6px; }
.party { margin-top: 18px; padding: 18px 16px; border: 1px solid var(--brass-line); background: var(--paper-hi); }
.party-title { margin: 0 0 4px; font-size: var(--fs-m); color: var(--accent); text-align: center; letter-spacing: .12em; }
.party-sub { word-break: keep-all; overflow-wrap: anywhere; margin: 0 0 12px; font-size: var(--fs-s); color: var(--ink-soft); line-height: 1.7; }
.prow { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; margin-top: 8px; }
/* 同行者編號：黃銅圓頭 */
.pidx { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fbe7b0, #c39a52 50%, #6a4b22); box-shadow: 0 0 0 1px #4a3416, 0 1px 2px rgba(0,0,0,.3); color: #2a1a0c; font-family: var(--serif-latin); font-size: var(--fs-xs); font-weight: 500; display: grid; place-items: center; }
.pshare { min-height: 46px; padding: 0 18px; border: 0; border-radius: 0; background: var(--accent); color: var(--paper-hi); font: inherit; font-size: var(--fs-s); letter-spacing: .14em; cursor: pointer; white-space: nowrap; box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 3px rgba(201,163,95,.7); }
.pshare:active { opacity: .85; }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: #2a1a0c; color: var(--on-wall); border: 1px solid rgba(201,163,95,.6); padding: 10px 18px; font-size: var(--fs-s); letter-spacing: .04em; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; }
#comp .field { text-align: left; }
#comp .btn { margin-top: 14px; }
.foot { text-align: center; margin-top: 40px; color: var(--ink-soft); font-size: var(--fs-xs); letter-spacing: .1em; }
/* 主人署名 */
.foot .host { font-size: var(--fs-l); color: var(--accent); letter-spacing: .2em; margin: 0 0 6px; }
.foot .host:not(:empty)::before { content: ''; display: block; width: 44px; height: 1px; margin: 0 auto 16px; background: var(--brass-line); }
/* 品牌署名＝信紙底部的製作者印記（像雕版師落款）：細線＋小鑽、英文小字、黃銅色 logo；logo 用 mask 上色以跟隨牆／紙兩種底色 */
.brand-credit { display: flex; flex-direction: column; align-items: center; margin-top: 18px; color: var(--label); font-family: var(--serif-tc); }
.brand-credit::before { content: '◆'; width: 72px; margin-bottom: 2px; font-size: 6px; line-height: 7px; text-align: center; opacity: .6; background:
  linear-gradient(currentColor, currentColor) left center / 30px 1px no-repeat,
  linear-gradient(currentColor, currentColor) right center / 30px 1px no-repeat; }
.brand-credit a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; transition: color .2s; }
.brand-credit a:hover { color: var(--accent); }
.brand-credit a:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
.credit-k { font-family: var(--serif-latin); font-size: 10px; letter-spacing: .34em; padding-left: .34em; text-transform: uppercase; }
/* 署名：同字級但較深、帶黃銅底線，暗示可點 */
.brand-credit .credit-who { margin-left: .2em; font-size: 11px; font-weight: 500; color: var(--accent); text-decoration: underline 1px var(--brass-line); text-underline-offset: 4px; }
.credit-n { gap: 8px; margin-top: -10px; font-size: 13px; letter-spacing: .24em; }
.credit-dot { opacity: .6; letter-spacing: 0; }
.aj-logo { display: block; width: 82px; aspect-ratio: 183.25 / 27; background: currentColor; -webkit-mask: url(/static/alljoint-logo.svg) center / contain no-repeat; mask: url(/static/alljoint-logo.svg) center / contain no-repeat; }
/* 載入中／載入失敗：還沒有卡紙，字直接在牆上 */
.skel { color: var(--on-wall); text-align: center; padding: 30vh 0 40px; letter-spacing: .1em; }
@media (max-width: 420px) {
  .d { grid-template-columns: 1fr; gap: 2px; }
  .paper { --pad-y: 28px; --pad-x: 20px; padding: 28px 20px; box-shadow: 0 20px 40px rgba(0,0,0,.4), inset 0 0 0 5px var(--paper), inset 0 0 0 6px var(--camel), inset 0 0 0 8px var(--paper), inset 0 0 0 9px rgba(201,163,95,.45); }
  .choice { letter-spacing: .1em; }
  .seat .table { font-size: 46px; }
}
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } html { scroll-behavior: auto; } }

p, li, .sub, .meta, .party-sub { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
#comp-meta { white-space: pre-line; }
.egg-sub .nb { display: block; white-space: normal; text-wrap: balance; }
#send:disabled { opacity: 1; background: rgba(79,44,21,.08); box-shadow: none; border: 1px solid rgba(79,44,21,.3); color: var(--ink-soft); cursor: not-allowed; }
#send-hint { text-align: center; }
body.has-cta .paper { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
/* 後台「預覽邀請函」提示條（只有管理員打開 /i/preview 才會出現） */
.preview-bar { position: fixed; inset: 0 0 auto 0; z-index: 30; padding: 8px 12px; background: #1f1006; color: #f1e6cf; border-bottom: 1px solid rgba(201,163,95,.5); font-size: var(--fs-xs); letter-spacing: .04em; text-align: center; box-shadow: 0 1px 6px rgba(0,0,0,.4); }
body.preview { padding-top: 40px; } /* 提示條一行高 */

/* ───── 首頁／找不到：整頁就是門口那面牆 ───── */
body.entry { min-height: 100svh; display: grid; place-items: center; padding: 16px 16px calc(64px + env(safe-area-inset-bottom, 0px)); }
.entry .door { width: 100%; max-width: 520px; padding-bottom: 0; }
.entry .door::before { top: 48px; }
.entry-title { font-family: var(--serif-latin); font-weight: 300; font-size: var(--fs-xl); letter-spacing: .28em; padding-left: .28em; text-transform: uppercase; margin: 26px 0 6px; color: var(--on-wall); animation: rise .9s .55s cubic-bezier(.22,1,.36,1) both; }
.entry-sub { margin: 0; font-family: var(--serif-latin); font-size: 12px; letter-spacing: .3em; padding-left: .3em; text-transform: uppercase; color: var(--camel); animation: rise .9s .65s cubic-bezier(.22,1,.36,1) both; }
.entry-msg { margin: 26px auto 0; padding: 14px 4px; max-width: 24em; color: var(--on-wall); font-size: var(--fs-m); line-height: 1.9; border-block: 1px solid rgba(201,163,95,.45); animation: rise .9s .8s cubic-bezier(.22,1,.36,1) both; }
.entry .foot { margin-top: 36px; }
.entry .brand-credit { color: var(--on-wall-soft); }
.entry .brand-credit a:hover, .entry .brand-credit .credit-who { color: var(--on-wall); }
/* 主人入口：刻意低調，賓客不易注意 */
.host-entry { position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: #d9cdb5; font-size: var(--fs-xs); letter-spacing: .08em; text-decoration: none; }
.host-entry:hover, .host-entry:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.prow .pname { min-width: 0; }

.story-img { display: block; width: min(56vw, 240px); margin: 0 auto 10px; border: 1px solid var(--brass-line); -webkit-touch-callout: default; }
.egg .link { display: block; margin: 8px auto 0; }
/* 常態問題 popup：沿用彩蛋的黃銅框，右上角叉 */
.ask { position: relative; width: min(100%, 360px); max-height: calc(100dvh - 48px); overflow-y: auto; }
.ask-x { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--accent); font-size: 26px; line-height: 1; cursor: pointer; }
.ask-item + .ask-item { margin-top: 18px; }
.ask-after { white-space: pre-line; font-size: var(--fs-m); line-height: 1.8; }
.choice.prank { position: relative; z-index: 1; transition: translate .25s ease-out, scale .25s, opacity .25s; }
.choice.grow { scale: 1.12; transition: scale .25s; }
.choice.flip { animation: flip .6s ease-in-out; }
.choice.shake { animation: shake .5s; }
.choice.spin { animation: spin .7s ease-in-out; }
@keyframes flip { 50% { transform: rotateX(90deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px) rotate(-3deg); } 40%, 80% { transform: translateX(8px) rotate(3deg); } }
@keyframes spin { to { transform: rotateY(720deg); } }
@media (prefers-reduced-motion: reduce) { .choice.prank, .choice.grow { transition: none; } .choice.flip, .choice.shake, .choice.spin { animation: none; } }
.ask-q { margin: 6px 0 14px; font-size: var(--fs-m); line-height: 1.7; color: var(--ink); text-wrap: balance; }

.prize-card { margin:20px auto; padding:16px; border:1px solid #b08a4a; color:#e3c58a; max-width:28rem; overflow-wrap:anywhere }
.prize-card strong { display:block; margin-top:8px; font-size:1.3em }
#recap-blocks .prize-card { color: var(--accent); background: var(--paper-hi); text-align: center; } /* 回顧時移到米色紙面上：改深胡桃字 */

/* 活動後回顧：會員卡＝古銅銘牌、票選／留言＝卡紙小卡、下一場＝胡桃木牆 */
.recap-blocks { min-width: 0; overflow-wrap: anywhere; }
.recap-blocks .acts { display: flex; justify-content: center; }
.recap-blocks a.btn { display: flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; }
.member-card {
  position: relative; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto auto; align-items: center; gap: 4px;
  width: min(100%, 360px); min-height: 215px; margin: 4px auto 0; padding: 22px 26px 18px; text-align: center; color: var(--on-wall);
  background:
    var(--screw) left 9px top 9px / 11px no-repeat, var(--screw) right 9px top 9px / 11px no-repeat,
    var(--screw) left 9px bottom 9px / 11px no-repeat, var(--screw) right 9px bottom 9px / 11px no-repeat,
    radial-gradient(ellipse 80% 70% at 50% 0%, rgba(255,220,160,.14), transparent 70%),
    linear-gradient(rgba(22,11,4,.42), rgba(22,11,4,.42)),
    #2a1d10 url(/static/brand/bronze.jpg) center / cover;
  border: 6px solid #b8904b; border-image: var(--brass-bevel) 1;
  box-shadow: 0 0 0 1px #3a2610, inset 0 0 0 1px rgba(0,0,0,.6), 0 22px 30px -14px rgba(40,18,6,.55);
}
.member-card .sheen { inset: 0; }
.mc-club { margin: 0; font-family: var(--serif-latin); font-size: 11px; letter-spacing: .3em; white-space: nowrap; padding-left: .3em; text-transform: uppercase; color: var(--on-wall-soft); }
@media (max-width: 379px) { .mc-club { font-size: 10px; letter-spacing: .16em; padding-left: .16em; } .member-card { padding-inline: 18px; } .member-card .mc-foot { letter-spacing: .08em; white-space: nowrap; } }
.mc-no { margin: 0; font-family: var(--serif-latin); font-weight: 300; line-height: 1; }
.mc-no small { display: block; font-size: 10px; letter-spacing: .32em; padding-left: .32em; text-transform: uppercase; color: var(--on-wall-soft); margin-bottom: 6px; }
.mc-no span { font-size: 44px; letter-spacing: .14em; padding-left: .14em; background: linear-gradient(180deg, #fbe7b0, #d8b878 55%, #a9813f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mc-name { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: .12em; color: #f3e6cc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-foot { display: flex; justify-content: space-between; gap: 8px; font-family: var(--serif-latin); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--on-wall-soft); }
.member-missed { padding: 22px 18px; text-align: center; font-size: var(--fs-l); color: var(--accent); border: 3px double rgba(176,138,74,.6); }
.fx #member-wrap.in .member-card { animation: plate-flip 1.1s .3s cubic-bezier(.2,.85,.25,1) both; transform-origin: 50% 0; }
/* 票選 */
.vote-progress { margin: -8px 0 14px; text-align: center; font-size: var(--fs-s); letter-spacing: .08em; color: var(--label); }
.poll-card { margin: 10px 0; border: 1px solid var(--brass-line); background: var(--paper-hi); }
.poll-card[open] { box-shadow: inset 0 0 0 3px var(--paper-hi), inset 0 0 0 4px rgba(176,138,74,.4); }
.poll-card summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 60px; padding: 12px 16px; cursor: pointer; list-style: none; }
.poll-card summary::-webkit-details-marker { display: none; }
.poll-card summary::after { content: ''; flex: none; width: 8px; height: 8px; margin-left: auto; border: solid var(--brass-deep); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .2s; }
.poll-card[open] summary::after { transform: rotate(-135deg); }
.poll-head { display: grid; min-width: 0; flex: 1; }
.poll-head strong { color: var(--accent); font-size: var(--fs-l); letter-spacing: .1em; }
.poll-head small { font-size: var(--fs-s); color: var(--ink-soft); line-height: 1.5; }
.poll-status { order: 3; flex-basis: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs); letter-spacing: .06em; color: var(--label); }
.poll-card.voted .poll-status { color: var(--ok); }
.poll-card.voted .poll-status::before { content: '✓ '; }
.poll-search { display: block; width: calc(100% - 32px); margin: 0 16px 8px; }
.poll-options { max-height: 340px; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 16px; display: grid; gap: 6px; }
.poll-options.dishes { max-height: none; }
.poll-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 14px; text-align: left; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 0; cursor: pointer; transition: background .15s, border-color .15s; }
.poll-option small { margin-left: auto; font-size: var(--fs-xs); color: var(--label); white-space: nowrap; }
.dishes .poll-option { flex-direction: column; align-items: flex-start; gap: 0; min-height: 64px; }
.dishes .poll-option span { font-size: var(--fs-l); color: var(--accent); }
.dishes .poll-option small { margin-left: 0; font-family: var(--serif-latin); letter-spacing: .06em; white-space: normal; }
.poll-option:hover { background: #fbf6ec; }
.poll-option[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--paper-hi); box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 3px var(--camel); }
.poll-option[aria-pressed="true"] span::before { content: '✓ '; color: var(--camel); }
.poll-option[aria-pressed="true"] small, .dishes .poll-option[aria-pressed="true"] span { color: var(--on-wall); }
.poll-option:disabled { cursor: progress; opacity: .7; }
.poll-option:focus-visible, .poll-card summary:focus-visible, .next-btn:focus-visible { outline: 2px solid var(--brass-line); outline-offset: 2px; }
.result-card { margin: 12px 0; padding: 18px 16px 12px; border: 1px solid var(--brass-line); background: var(--paper-hi); }
.result-card h3 { margin: 0 0 10px; text-align: center; font-size: var(--fs-l); letter-spacing: .14em; color: var(--accent); }
.result-empty { margin: 0 0 6px; text-align: center; color: var(--ink-soft); font-size: var(--fs-s); }
.rank { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.rank-no { display: grid; place-items: center; width: 34px; height: 34px; font-family: var(--serif-latin); font-size: 13px; letter-spacing: .04em; color: var(--brass-deep); border: 1px solid var(--brass-line); }
.r0 .rank-no { color: var(--wall); font-weight: 600; border: 0; background: var(--brass-bevel); text-shadow: 0 1px 0 rgba(255,240,210,.55); }
.r0 .rank-name strong { font-size: var(--fs-l); }
.rank-name { display: grid; gap: 6px; min-width: 0; }
.rank-name strong { font-weight: 600; color: var(--accent); }
.rank-bar { display: block; height: 4px; background: linear-gradient(90deg, var(--brass-line), var(--camel)); }
.rank-votes { font-size: var(--fs-s); color: var(--label); white-space: nowrap; }
/* 留言牆 */
.wall-form .btn { margin-top: 12px; }
.wall-items { margin-top: 22px; columns: 2 150px; column-gap: 10px; }
.wall-card { break-inside: avoid; margin: 0 0 10px; padding: 16px 14px 12px; background: var(--paper-hi); border: 1px solid rgba(176,138,74,.55); box-shadow: 0 6px 14px -10px rgba(60,30,10,.45); }
.wall-card blockquote { margin: 0; white-space: pre-wrap; line-height: 1.8; }
.wall-card blockquote::before { content: '“'; display: block; height: 22px; font-family: Georgia, serif; font-size: 34px; line-height: 1; color: var(--brass-line); }
.wall-card figcaption { margin-top: 8px; font-size: var(--fs-xs); letter-spacing: .1em; color: var(--label); }
.wall-card figcaption::before { content: '— '; }
.wall-empty { text-align: center; color: var(--ink-soft); font-size: var(--fs-s); column-span: all; }
/* 下一場：一小片胡桃木牆 */
.next-card { padding: 30px 22px 24px; text-align: center; color: var(--on-wall); background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,210,140,.16), transparent 70%), var(--wall); border: 6px solid #b8904b; border-image: var(--brass-bevel) 1; box-shadow: 0 0 0 1px #3a2610, 0 20px 30px -16px rgba(40,18,6,.6); }
.next-k { margin: 0 0 6px; font-family: var(--serif-latin); font-size: 11px; letter-spacing: .36em; padding-left: .36em; text-transform: uppercase; color: var(--on-wall-soft); }
.next-card h3 { margin: 0; font-size: var(--fs-xl); letter-spacing: .16em; padding-left: .16em; color: #f3e6cc; }
.next-date { margin: 10px 0 0; font-family: var(--serif-latin); font-size: var(--fs-l); letter-spacing: .14em; color: var(--camel); }
.next-text { margin: 12px 0 0; white-space: pre-line; line-height: 1.9; color: var(--on-wall); }
.next-btn { width: 100%; min-height: 52px; margin-top: 20px; padding: 12px; font: inherit; font-size: var(--fs-s); letter-spacing: .14em; cursor: pointer; color: var(--wall); background: var(--brass-bevel); border: 0; border-radius: 0; box-shadow: 0 6px 14px rgba(0,0,0,.3); }
.next-btn[aria-pressed="true"] { color: var(--on-wall); background: transparent; box-shadow: inset 0 0 0 1px var(--camel); }
.next-btn:disabled { opacity: .7; cursor: progress; }
@media (prefers-reduced-motion: reduce) { .fx #member-wrap.in .member-card { animation: none; } }

/* 那一晚：黃銅時間軸 */
.night-timeline { list-style: none; padding: 0 0 0 16px; margin: 24px 0; border-left: 1px solid var(--brass-line); }
.night-timeline li { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; margin: 0 0 22px; line-height: 1.8; }
.night-timeline li::before { content: ''; position: absolute; left: -20px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--brass-line); }
.night-timeline time, .wall-reply { font-size: var(--fs-xs); color: var(--label); }
.mc-arrival { margin: 12px 0 0; font-size: 12px; color: var(--on-wall-soft); text-align: center; }
/* 答完常態問題、還沒回覆出席：回覆區黃銅光暈閃兩下提示 */
#rsvp.ask-nudge { border-radius: 4px; animation: ask-nudge 1.1s ease-in-out 2; }
@keyframes ask-nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(176,138,74,0) } 50% { box-shadow: 0 0 0 3px rgba(176,138,74,.9), 0 0 24px 4px rgba(176,138,74,.45) } }
@media (prefers-reduced-motion: reduce) { #rsvp.ask-nudge { animation: none; } }

/* 照片票選：三欄方形縮圖＋名字（60 張也不會太長），點開全螢幕左右滑、在大圖上投；方角與全站一致 */
.photo-options { max-height: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.photo-pick { position: relative; display: block; min-width: 0; padding: 0; font: inherit; text-align: left; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 0; cursor: pointer; }
.photo-pick img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--paper-deep); }
.photo-pick span { display: block; padding: 5px 6px; font-size: var(--fs-xs); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-pick[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--camel); }
.photo-pick[aria-pressed="true"] span { color: var(--paper-hi); background: var(--accent); }
.photo-pick[aria-pressed="true"]::after { content: '✓'; position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: 14px; color: var(--paper-hi); background: var(--accent); box-shadow: 0 0 0 1px var(--camel); }
.photo-pick:disabled { cursor: progress; opacity: .7; }
.photo-pick:focus-visible { outline: 2px solid var(--brass-line); outline-offset: 2px; }
.photo-viewer { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; color: var(--on-wall); background: #140b05; }
.photo-viewer[open] { display: flex; flex-direction: column; }
.photo-viewer::backdrop { background: #140b05; }
.pv-head { display: flex; align-items: center; gap: 12px; padding: max(8px, env(safe-area-inset-top)) 4px 8px 16px; }
.pv-head div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pv-head span { font-size: var(--fs-xs); letter-spacing: .08em; color: var(--camel); }
.pv-head strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-x { flex: none; width: 48px; height: 48px; padding: 0; font-size: 30px; line-height: 1; color: inherit; background: none; border: 0; cursor: pointer; }
.pv-track { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.pv-track::-webkit-scrollbar { display: none; }
.pv-slide { position: relative; flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.pv-slide img { position: absolute; inset: 0 8px; width: calc(100% - 16px); height: 100%; object-fit: contain; }
.pv-foot { display: flex; gap: 8px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
.pv-pick { flex: 1; min-height: 52px; font: inherit; letter-spacing: .08em; color: var(--accent); background: var(--paper-hi); border: 1px solid var(--camel); border-radius: 0; cursor: pointer; }
.pv-pick[aria-pressed="true"] { color: var(--paper-hi); background: var(--accent); }
.pv-pick:disabled { cursor: progress; opacity: .7; }
.pv-nav { display: none; width: 52px; font-size: 28px; color: inherit; background: none; border: 1px solid rgba(176,138,74,.5); border-radius: 0; cursor: pointer; }
.pv-nav:disabled { opacity: .3; cursor: default; }
.photo-viewer button:focus-visible { outline: 2px solid var(--camel); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .pv-nav { display: block; } }
.photo-view { display: block; border: 0; padding: 0; background: none; cursor: pointer; width: 100%; min-height: 44px; }
.photo-view img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--brass-line); }
.photo-upload { padding: 14px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.photo-upload .photo-view { width: 90px; }
.photo-upload button { min-height: 44px; }
.photo-upload .photo-note { flex-basis: 100%; font-size: 13px; color: var(--label); }
.photo-pending { position: relative; width: 90px; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--brass-line); background: var(--paper-deep); }
.photo-pending img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .6; }
.photo-pending::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,240,210,.75) 50%, transparent 70%); transform: translateX(-100%); animation: photo-sheen 1.3s ease-in-out infinite; }
.photo-pending span { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 0; text-align: center; font-size: var(--fs-xs); color: var(--paper-hi); background: rgba(47,24,11,.72); }
@keyframes photo-sheen { to { transform: translateX(100%); } }
#vote-refresh { min-height: 44px; margin: -4px 0 4px; }
.photo-dialog { padding: 0; border: 0; max-width: 94vw; max-height: 90vh; background: transparent; }
.photo-dialog::backdrop { background: rgba(0,0,0,.8); }
.photo-dialog img { display: block; max-width: 94vw; max-height: 90vh; object-fit: contain; }
.rank-name .photo-view { width: 54px; margin-bottom: 6px; }

/* 回顧精選與自己的照片 */
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.gallery-grid .photo-view { min-width: 0; }
.gallery-grid .photo-view img { border: 0; }
.gallery-grid .gallery-hero { grid-column: 1 / -1; }
.gallery-grid .gallery-hero img { aspect-ratio: 4 / 3; }
.gallery-grid.mine { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.my-uploads { margin-top: 22px; }
.my-uploads h3 { font-weight: 500; margin: 0 0 4px; }
.pv-browse .pv-nav { display: block; }
