/* Melrose × Old money · earth tones
   取材自餐廳門口銘牌：胡桃木牆板、古銅拉絲面板、黃銅框與字、畫燈暖光 */
:root {
  --r: 14px;
  --r-sm: 8px;
  --r-pill: 999px;
  --fs-xs: 13px;
  --fs-s: 14px;
  --fs-m: 16px;
  --fs-l: 18px;
  --fs-xl: 22px;
  --paper: #efe6d6;
  --paper-deep: #e3d7c2;
  --ink: #2a211a;
  --ink-soft: #5e4f40;
  --olive: #5a3418;            /* 胡桃木（取自木牆 #613213）：次要標題 */
  --wall: #4a2614;             /* 頁面底色：胡桃木牆板 */
  --accent: #4f2c15;           /* 深胡桃：姓名、桌號、主按鈕（對 --paper 約 11:1）*/
  --brass-line: #b08a4a;       /* 黃銅：線條、裝飾 */
  --label: #7a5a2c;            /* 深黃銅：小標文字（對比 5.2:1）*/
  --camel: #c9a35f;            /* 黃銅外框 #caa263：線條、小標、我的桌子 */
  --bronze: #7a5a2c;           /* 深黃銅：小標、Eyebrow（對比 ≥4.5:1）*/
  --brass-deep: #6a4b22;       /* 按鈕底色 */
  --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;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: 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: clamp(12px, 3vw, 40px) 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:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(255,205,130,.30), transparent 70%),
    radial-gradient(ellipse at 50% 120%, rgba(0,0,0,.35), transparent 60%),
    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),
    linear-gradient(90deg, #47240f, #5a2f17 30%, #52290f 60%, #5c3118 85%, #47240f);
  background-attachment: fixed;
}
.card {
  border-radius: var(--r);
  max-width: 640px;
  margin: 0 auto;
  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%, #f5efe2, var(--paper) 70%);
  border: 1px solid rgba(43,36,25,.35);
  box-shadow: 0 30px 60px rgba(0,0,0,.35), inset 0 0 0 6px var(--paper), inset 0 0 0 7px var(--camel);
  padding: clamp(22px, 5vw, 56px) clamp(20px, 6vw, 56px);
}
.hdr { text-align: center; }
.gable { display: block; width: 150px; max-width: 60%; height: auto; margin: 0 auto 6px; color: var(--camel); }
.mono {
  font-family: var(--serif-latin);
  font-size: clamp(44px, 10vw, 64px);
  line-height: 1;
  letter-spacing: .08em;
  color: var(--accent);
  margin: 0;
  font-weight: 300;
}
.logo.plaque { display: block; width: clamp(130px, 34vw, 170px); height: auto; margin: 0 auto; box-shadow: 0 14px 30px rgba(0,0,0,.35), 0 2px 4px rgba(0,0,0,.25); }
/* 字標做成門口那塊古銅銘牌：拉絲古銅面 + 黃銅框 */
.logo.wordmark { display: block; width: clamp(220px, 64vw, 290px); height: auto; padding: 24px 28px; margin: 4px auto 0; background: #2a1d10 url(/static/brand/bronze.jpg) center / cover; border: 3px solid #b8914a; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.45), 0 0 0 1px #7a5a2c, 0 12px 26px rgba(40,20,5,.35); }
.hero { margin: 18px 0 0; }
.hero img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: center 60%; border: 1px solid var(--line); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.eyebrow {
  font-family: var(--serif-latin);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: .12em;
  margin-top: 16px;

  color: var(--label);
  margin: 10px 0 0;
}
.rule { position: relative; height: 1px; margin: 22px 0; background: var(--camel); }
.rule::before { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; background: var(--camel); box-shadow: 0 0 0 5px var(--paper); transform: translate(-50%, -50%) rotate(45deg); }
.invite { text-align: center; }
.invite .to { font-size: var(--fs-m); color: var(--ink-soft); margin: 0; letter-spacing: .1em; }
.invite .name {
  font-size: clamp(30px, 7vw, 40px);
  font-weight: 600;
  margin: 2px 0 10px;
  letter-spacing: .08em;
  color: var(--accent);
  text-wrap: balance;
}
.invite .lead { margin: 0; font-size: var(--fs-l); color: var(--ink-soft); text-wrap: balance; }
.invite .lead-sub { margin: 4px 0 0; font-family: var(--serif-latin); font-size: var(--fs-xs); letter-spacing: .04em; color: var(--bronze); overflow-wrap: anywhere; }
.invite .when { margin: 10px 0 0; font-size: var(--fs-s); color: var(--ink-soft); text-wrap: balance; }
.letter { margin: 22px auto 0; max-width: 34em; padding: 0 4px; font-size: var(--fs-m); line-height: 1.9; color: var(--ink); text-align: center; text-wrap: pretty; line-break: strict; position: relative; }
.nb { white-space: nowrap; }
.letter br + br { display: block; content: ''; margin-top: 8px; }
.letter::before, .letter::after { content: ''; display: block; width: 36px; height: 1px; background: var(--brass-line); margin: 0 auto 14px; opacity: .8; }
.letter::after { margin: 14px auto 0; }
.quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 22px 0 0; }
.qa { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--olive); text-decoration: none; font-size: var(--fs-s); letter-spacing: .06em; background: rgba(255,255,255,.35); }
.qa:active { background: var(--paper-deep); }
.details { display: grid; gap: 18px; margin: 30px 0 0; }
.d { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: baseline; border-top: 1px solid var(--line); padding-top: 12px; }
.d .k { font-family: var(--serif-tc); font-size: var(--fs-xs); letter-spacing: .12em;  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-size: var(--fs-s); border: 1px solid var(--line); border-radius: var(--r-pill); text-decoration: none; background: rgba(255,255,255,.35); }
.notes { margin: 24px 0 0; padding: 16px 18px; border: 1px dashed var(--line); font-size: var(--fs-m); color: var(--ink-soft); white-space: pre-line; }
h2 {
  font-family: var(--serif-latin);
  font-size: var(--fs-xl);
  font-weight: 400;
  letter-spacing: .12em;

  text-align: center;
  color: var(--accent);
  margin: 0 0 6px;
}
.sub { text-align: center; color: var(--ink-soft); font-size: var(--fs-m); margin: 0 0 18px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
  padding: 14px 10px; font: inherit; font-size: var(--fs-m); letter-spacing: .12em; cursor: pointer;
  transition: background .15s, color .15s;
}
.choice[aria-pressed="true"] { background: var(--accent); color: var(--paper); }
.choice:focus-visible, .btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--camel); outline-offset: 2px; }
.field { display: grid; gap: 6px; margin-top: 16px; }
.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,255,255,.45); border: 1px solid var(--line); padding: 10px 12px; width: 100%;
}
textarea { min-height: 84px; resize: vertical; }
.btn {
  display: inline-block; width: 100%; margin-top: 18px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--paper); padding: 14px; font: inherit; font-size: var(--fs-m); letter-spacing: .12em;
}
.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: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.3); }
.answered .big { font-size: var(--fs-xl); margin: 0 0 4px; font-weight: 600; }
.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: 12px; text-decoration: none; display: inline-flex; align-items: center; }
.link { background: none; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--bronze); font: inherit; font-size: var(--fs-m); cursor: pointer; padding: 8px 20px; margin-top: 12px; min-height: 44px; }
.seat { text-align: center; }
.seat .table { font-family: var(--serif-latin); font-size: 64px; line-height: 1; color: var(--accent); margin: 6px 0 0; font-weight: 300; letter-spacing: .04em; }
.seat .table-label { font-size: var(--fs-xs); letter-spacing: .12em; color: var(--label);  font-family: var(--serif-tc); }
.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: 18px; }
.plan-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; border: 1px solid var(--line); background: rgba(255,255,255,.25); }
.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: 8px; }
.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(--line); border-radius: var(--r-pill); background: rgba(255,255,255,.35); color: var(--olive); cursor: pointer; }
.fp-zone rect { fill: rgba(255,255,255,.28); stroke: var(--line); stroke-width: 1; }
.fp-zone text { font-size: var(--fs-m); letter-spacing: .12em; fill: var(--bronze);  }
.fp-table rect, .fp-table circle, .fp-table .fp-booth { fill: var(--paper-deep); stroke: var(--ink-soft); stroke-width: 1; }
.fp-table .fp-booth { fill: rgba(27,36,51,.12); }  /* 卡座保留海軍藍：對應餐廳午夜藍沙發 */
.fp-table .fp-name { font-size: var(--fs-m); fill: var(--ink-soft); pointer-events: none; }
.fp-table.is-mine rect, .fp-table.is-mine circle { fill: var(--camel); stroke: var(--olive); stroke-width: 2; }
.fp-table.is-mine .fp-booth { fill: var(--camel); stroke: var(--olive); }
.fp-table.is-mine .fp-name { fill: var(--ink); font-weight: 600; font-size: var(--fs-m); }
@keyframes fp-pulse { 0%, 100% { stroke-opacity: .9 } 50% { stroke-opacity: .2 } }
.fp-table.is-mine > :first-child { animation: fp-pulse 2s ease-in-out infinite; }
.chart { margin-top: 18px; }
.chart img { border-radius: var(--r-sm); width: 100%; height: auto; border: 1px solid var(--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(--bronze); }
.cta { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  min-height: 48px; padding: 10px 28px; border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--paper); font: inherit; font-size: var(--fs-m); letter-spacing: .12em;
  box-shadow: 0 10px 24px rgba(0,0,0,.35); cursor: pointer; transition: opacity .2s, transform .2s; }
.cta.off { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(12px); }
.mcat { border-top: 1px solid var(--brass-line); }
.mcat:last-of-type { border-bottom: 1px solid var(--brass-line); }
.mcat summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 8px 2px; font-family: var(--serif-latin); font-size: var(--fs-s); letter-spacing: .12em;  color: var(--label); }
.mcat summary::-webkit-details-marker { display: none; }
.mcat summary::after { content: '+'; font-size: var(--fs-xl); font-weight: 300; color: var(--brass-line); }
.mcat[open] summary::after { content: '−'; }
.mcat ul { list-style: none; margin: 0; padding: 0 2px 12px; display: grid; gap: 10px; }
.msub { font-family: var(--serif-latin); font-size: var(--fs-xs); letter-spacing: .12em;  color: var(--label); margin-top: 4px; }
.mitem { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: baseline; }
.mzh { font-size: var(--fs-m); color: var(--ink); }
.men { grid-column: 1; font-family: var(--serif-latin); font-size: var(--fs-xs); letter-spacing: .1em; color: var(--accent);  }
.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: 10px; }
.menu .menu-link a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 18px; border: 1px solid var(--line); border-radius: var(--r-pill); text-decoration: none; color: var(--accent); font-size: var(--fs-s); background: rgba(255,255,255,.35); }
.qa { font: inherit; cursor: pointer; }
.sheet-bg { position: fixed; inset: 0; background: rgba(36,18,6,.6); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; background: var(--paper); border-radius: var(--r) var(--r) 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; box-shadow: 0 -10px 40px rgba(0,0,0,.3); }
.sheet-title { margin: 0 0 4px; text-align: center; font-size: var(--fs-s); letter-spacing: .12em; color: var(--label); font-family: var(--serif-latin);  }
.sheet-opt { display: grid; min-height: 56px; padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); background: rgba(255,255,255,.4); align-content: center; }
.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); cursor: pointer; }
@media (min-width: 600px) { .sheet-bg { align-items: center; } .sheet { border-radius: var(--r); } }
.egg-bg { position: fixed; inset: 0; background: rgba(36,18,6,.65); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 24px; }
.egg { background: var(--paper); border-radius: var(--r); padding: 22px 22px 18px; width: min(100%, 340px); text-align: center; box-shadow: 0 30px 60px rgba(0,0,0,.4), inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--camel); 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 8px; border-radius: var(--r-sm); }
.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); margin: 8px 0 4px; }
.egg-sub { font-size: var(--fs-s); color: var(--ink-soft); margin: 0 0 6px; }
.egg-btn { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .bear-body, .bear-arm, .egg { animation: none; } }
.hint { display: block; font-size: var(--fs-xs); color: var(--ink-soft); margin-top: 4px; }
.party { margin-top: 18px; padding: 16px; border: 1px solid var(--brass-line); border-radius: var(--r); background: rgba(255,255,255,.3); }
.party-title { margin: 0 0 4px; font-size: var(--fs-m); color: var(--accent); text-align: center; letter-spacing: .08em; }
.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: 28px 1fr auto; gap: 8px; align-items: center; margin-top: 8px; }
.pidx { width: 28px; height: 28px; border-radius: var(--r-pill); border: 1px solid var(--brass-line); color: var(--label); font-family: var(--serif-latin); font-size: var(--fs-xs); display: grid; place-items: center; }
.pshare { min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--paper); font: inherit; font-size: var(--fs-m); letter-spacing: .1em; cursor: pointer; white-space: nowrap; }
.pshare:active { opacity: .85; }
.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: var(--r-pill); font-size: var(--fs-s); 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: 34px; color: var(--ink-soft); font-size: var(--fs-xs); letter-spacing: .1em; }
/* 品牌署名沿用紙色與深棕小字，保留完整觸控區與鍵盤焦點 */
.brand-credit { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; min-height: 44px; max-width: 100%; padding: 8px; color: var(--ink-soft); background: var(--paper); font-family: var(--serif-latin), var(--serif-tc); font-size: var(--fs-xs); letter-spacing: .04em; text-decoration: none; }
.brand-credit img { display: block; flex-shrink: 0; }
.brand-credit:hover { text-decoration: underline; text-underline-offset: 3px; }
.brand-credit:focus-visible { outline: 2px solid var(--ink-soft); outline-offset: 3px; }
.foot .host { font-size: var(--fs-m); color: var(--ink); margin: 0 0 4px; }
.skel { color: var(--ink-soft); text-align: center; padding: 40px 0; }
@media (max-width: 420px) {
  .d { grid-template-columns: 1fr; gap: 2px; }
  .card { padding: 26px 18px; box-shadow: 0 20px 40px rgba(0,0,0,.35), inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--camel); }
  .choice { font-size: var(--fs-m); letter-spacing: .08em; }
  .seat .table { font-size: 56px; }
}
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { * { 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: transparent; border: 1px solid rgba(79,44,21,.4); color: var(--ink-soft); cursor: not-allowed; }
#send-hint { text-align: center; }
body.has-cta .card { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
body.entry { min-height: 100svh; display: grid; place-items: center; padding: 16px; }
.entry .card { width: 100%; text-align: center; }
.entry-title { font-family: var(--serif-latin), var(--serif-tc); font-weight: 300; font-size: var(--fs-xl); letter-spacing: .06em; margin: 18px 0 4px; color: var(--ink); }
/* 主人入口：刻意低調，賓客不易注意 */
.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; }
