/* 包場大網站：A1 午夜放映廳（11/14 選定）。粉絲頁暗色，配色參考 ONCE JAPAN（杏黃→粉紅漸層、暖咖啡）。
   主辦後台、網站管理在 <body class="light"> 用亮色，表格比較好讀。 */
:root {
  --paper: #1f1515; --card: #2f2121; --card2: #261a1a; --ink: #fdf3f0; --muted: #c9aaa6;
  --line: #5a4242; --line2: #6b4d4d; --accent: #F288B9; --accent2: #FDD89E; --deep: #3d2b2b; --deep2: #4a3535;
  --link: #FDD89E; --btn: #3d2b2b; --btn-ink: #fdf3f0; --field: #fdf3f0; --field-ink: #2f2121; --on-accent: #1f1515;
  --grad: linear-gradient(100deg, #FDD89E, #F288B9);
  --top: radial-gradient(ellipse at 50% 0%, #5a2f3c 0%, #1f1515 75%);
  --ok: #7fdcaa; --ok-bg: #1f3d2e; --warn: #FDD89E; --bad: #ff8a80; --danger: #b42318;
  --chip: #4a3535; --chip-ink: #f5e0dc; --soft: #3a2626;
  --ink2: #f0d9d6; --hair: #3a2828; --top-ink: #fff; --placeholder: #8a6a66; --pool-ink: #a88c88;
  --draw-bg: linear-gradient(140deg, #5a2f3c, #2f2121); --glass: rgba(255, 255, 255, .08); --glass-line: rgba(255, 255, 255, .14);
  --grad-text: linear-gradient(100deg, #FDD89E, #F288B9);
  --radius: 14px;
}
/* 粉絲頁亮色（11/16，theme.js 依手機設定或「開燈」按鈕設 data-theme）：ONCE JAPAN 亮色版——米白粉底、暖咖啡字。
   淺底上原本的杏黃、粉紅當文字太淡，改深一點的同色系；漸層按鈕維持原色。 */
html[data-theme="light"] body:not(.light) {
  --paper: #fff6f1; --card: #fff; --card2: #fffaf7; --ink: #2f2121; --muted: #85605b;
  --line: #f3d5d0; --line2: #e6bcb6; --accent: #c2306e; --accent2: #b4561c; --deep: #fde6e1; --deep2: #f7d4ce;
  --link: #b0306e; --btn: #2f2121; --btn-ink: #fddddd; --field: #fff; --field-ink: #2f2121; --on-accent: #2f2121;
  --top: radial-gradient(ellipse at 50% 0%, #ffd3d3 0%, #fff6f1 78%);
  --ok: #1f8a5b; --ok-bg: #e3f5ec; --warn: #b4561c; --bad: #b42318;
  --chip: #fddddd; --chip-ink: #2f2121; --soft: #ffe8ef;
  --ink2: #5e4440; --hair: #f3d5d0; --top-ink: #2f2121; --placeholder: #a88a86; --pool-ink: #b08a85;
  --draw-bg: linear-gradient(140deg, #ffd3d3, #fff2e0); --glass: rgba(255, 255, 255, .65); --glass-line: rgba(47, 33, 33, .12);
  --grad-text: linear-gradient(100deg, #d9792b, #d6487f);
}
html.theme-anim body, html.theme-anim body * { transition: background-color .4s, color .4s, border-color .4s !important; }
.theme-btn {
  background: transparent; color: var(--ink); border: 1.5px solid var(--line2); padding: 7px 14px; font-size: 14px; font-weight: 700; min-height: 40px; margin-right: 4px;
}
body.light {
  --paper: #f7f1e8; --card: #fffaf2; --card2: #fff; --ink: #2a2230; --muted: #6f6575;
  --line: #e3d8c9; --line2: #e3d8c9; --accent: #ff5fa2; --accent2: #ff9a3c; --deep: #3b1f4a; --deep2: #4a2a5c;
  --link: #3b1f4a; --btn: #3b1f4a; --btn-ink: #fff; --field: #fff; --field-ink: #2a2230; --on-accent: #fff;
  --grad: linear-gradient(135deg, #ff5fa2, #ff9a3c);
  --top: #3b1f4a;
  --ok: #1f8a5b; --ok-bg: #e3f5ec; --warn: #c2410c; --bad: #b42318; --danger: #b42318;
  --chip: #efe6f3; --chip-ink: #3b1f4a; --soft: #fff0f6;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", system-ui, sans-serif; line-height: 1.7; -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.num { font-family: "Bebas Neue", sans-serif; letter-spacing: .04em; font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* 頁首：放映廳 */
.top { background: var(--top); color: var(--top-ink); position: relative; overflow: hidden; }
.top::after {
  content: ""; position: absolute; inset: auto -10% -70% -10%; height: 120%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 95, 162, .32), transparent 60%);
}
.top .wrap { position: relative; z-index: 1; padding-top: 28px; padding-bottom: 36px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-family: "Bebas Neue", sans-serif; letter-spacing: .16em; font-size: 17px; color: var(--accent2); }
.top h1 { font-size: clamp(26px, 6vw, 40px); line-height: 1.25; margin: 10px 0 8px; font-weight: 700; }
.top h1 em { font-style: normal; color: var(--accent); }
.top .lead { color: var(--ink2); margin: 0; }
body.light .top .lead { color: #e8dcef; }
/* 燈泡點點（暗色）；亮色維持底片孔 */
.film {
  height: 14px; background-color: var(--paper); opacity: .9;
  background-image: radial-gradient(circle, #FDD89E 3px, transparent 4px), radial-gradient(circle, #F288B9 3px, transparent 4px);
  background-size: 28px 14px; background-position: 0 0, 14px 0;
}
body.light .film {
  height: 22px; background-color: var(--deep); opacity: 1;
  background-image: repeating-linear-gradient(90deg, transparent 0 14px, var(--paper) 14px 26px, transparent 26px 40px);
  background-size: 40px 10px; background-repeat: repeat-x; background-position: 0 6px;
}

section { padding: 28px 0 4px; }
h2 { font-size: 22px; margin: 0 0 12px; font-weight: 700; }
h3 { margin: 0 0 6px; font-size: 17px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

/* 票券（有撕線的卡片） */
.ticket { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); position: relative; }
.ticket .main { flex: 1; padding: 18px 20px; min-width: 0; }
.ticket .stub {
  width: 120px; flex: none; border-left: 2px dashed var(--line); padding: 16px 10px; text-align: center;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.ticket::before, .ticket::after {
  content: ""; position: absolute; right: 111px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line);
}
.ticket::before { top: -10px; clip-path: inset(50% 0 0 0); }
.ticket::after { bottom: -10px; clip-path: inset(0 0 50% 0); }
.ticket .label { font-size: 12px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.ticket .big { font-family: "Bebas Neue", sans-serif; font-size: 44px; line-height: 1; color: var(--accent); }
@media (max-width: 520px) {
  .ticket .stub { width: 92px; }
  .ticket::before, .ticket::after { right: 83px; }
  .ticket .big { font-size: 36px; }
}

/* 按鈕、表單 */
button, .btn {
  font: inherit; border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer; font-weight: 700;
  background: var(--btn); color: var(--btn-ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .12s, opacity .12s;
}
@media (hover: hover) { button:hover, .btn:hover { transform: translateY(-1px); } } /* 11/23：手機不會卡在 hover */
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button.primary, .btn.primary { background: var(--grad); color: var(--on-accent); box-shadow: 0 8px 20px rgba(242, 136, 185, .25); }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line2); }
button.small, .btn.small { padding: 6px 14px; font-size: 14px; }
button.danger { background: var(--danger); color: #fff; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(242, 136, 185, .6); outline-offset: 2px;
}
.wide { width: 100%; }

label.f, div.f { display: block; margin: 0 0 14px; }
label.f > span, div.f > span { display: block; font-weight: 700; font-size: 15px; margin-bottom: 4px; }
label.f > span small, div.f > span small { font-weight: 400; color: var(--muted); }
/* 每張票的本命（台中依本命抽獎） */
.bias-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], input[type=datetime-local], input[type=date], input[type=search], select, textarea {
  font: inherit; width: 100%; padding: 11px 14px; border-radius: 10px; border: 1.5px solid var(--line2); background: var(--field); color: var(--field-ink);
}
::placeholder { color: var(--placeholder); opacity: 1; }
body.light ::placeholder { color: #9a8f9e; }
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* 張數選擇：像選票種 */
.qty { display: flex; gap: 10px; flex-wrap: wrap; }
.qty button {
  width: 64px; height: 64px; border-radius: 14px; background: var(--card2); color: var(--ink); border: 2px solid var(--line2);
  font-family: "Bebas Neue", sans-serif; font-size: 30px; font-weight: 400; box-shadow: none;
}
.qty button[aria-pressed=true] { border-color: var(--accent); background: var(--soft); color: var(--accent); }

.msg { min-height: 24px; margin-top: 10px; font-weight: 500; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--ok); }

.chip { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--chip); color: var(--chip-ink); white-space: nowrap; }
.chip.hot { background: var(--grad); color: var(--on-accent); }
.chip.soon { background: #FDD89E; color: #1f1515; }
body.light .chip.soon { background: #fff0e0; color: var(--warn); }
.chip.off { background: var(--chip); color: var(--chip-ink); }
body.light .chip.off { background: #ece8e4; color: var(--muted); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }

/* 倒數：片頭計數器 */
.countdown { display: flex; gap: 10px; justify-content: center; margin: 10px 0 4px; }
.countdown div { background: var(--deep); color: var(--ink); border: 1px solid var(--line2); border-radius: 12px; min-width: 64px; padding: 8px 6px 2px; text-align: center; }
.countdown b { display: block; font-family: "Bebas Neue", sans-serif; font-size: 40px; line-height: 1; font-weight: 400; }
.countdown span { font-size: 11px; letter-spacing: .12em; color: var(--ink2); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + 20px); transform: translateX(-50%); background: var(--btn); color: var(--btn-ink); border: 1px solid var(--line2); padding: 10px 18px;
  border-radius: 999px; font-size: 15px; z-index: 50; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
footer.site { padding: 32px 16px 36px; margin-top: 48px; border-top: 1px solid var(--hair); text-align: center; color: var(--muted); font-size: 13px; }

/* 粉絲頁共用頁首（11/18 設計規則）：內容在 scripts/layout.mjs，每頁一樣。
   電腦：上方一排選單；手機（760px 以下）：選單變成畫面底部 5 個按鈕，跟 App 一樣 */
:root { --tabbar: 0px; }
.nav { display: flex; gap: 8px; align-items: center; justify-content: space-between; max-width: 1200px; margin: 0 auto; padding: 14px 16px; }
.nav .logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.nav .logo b { font-family: "Bebas Neue", sans-serif; font-weight: 400; font-size: 28px; letter-spacing: 3px; color: var(--accent2); }
.nav .logo span { font-weight: 700; font-size: 15px; }
.nav .menu { display: flex; gap: 2px; align-items: center; }
.nav .menu a { display: flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; padding: 10px 12px; font-size: 15px; }
.nav .menu svg { display: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav .menu a[aria-current=page] { color: var(--accent2); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent2); }
.nav .tools { display: flex; gap: 6px; align-items: center; flex: none; }
.nav .tools .theme-btn { margin: 0; }
.nav .tools a.auth-link { border: 1.5px solid var(--line2); border-radius: 999px; padding: 7px 14px; min-height: 40px; display: inline-flex; align-items: center; font-weight: 700; font-size: 14px; color: var(--ink); text-decoration: none; }
@media (max-width: 760px) {
  :root { --tabbar: calc(62px + env(safe-area-inset-bottom)); }
  body { padding-bottom: var(--tabbar); }
  .nav .menu { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; gap: 0; justify-content: space-around;
    background: var(--paper); border-top: 1px solid var(--line); padding: 4px 2px env(safe-area-inset-bottom); }
  .nav .menu a { flex: 1; flex-direction: column; gap: 2px; padding: 7px 2px 6px; font-size: 11px; min-height: 56px; justify-content: center; white-space: nowrap; }
  .nav .menu svg { display: block; }
  .nav .menu a[aria-current=page] { box-shadow: none; }
}
/* 版面只有兩種寬度（設計規則 6）：寬 1100（列表、圖鑑、遊戲）、窄 640（表單、登入、我的） */
.page { max-width: 1100px; margin: 0 auto; padding: 36px 16px 24px; }
.page.narrow { max-width: 640px; }
.wrap.wide { max-width: 1100px; }
.page-note { text-align: center; color: var(--muted); font-size: 13px; margin: 32px 16px 0; }
/* 文字按鈕（設計規則 5）：不重要的小動作，例如複製、看說明 */
.textbtn { background: none; border: 0; padding: 4px 2px; min-height: 0; color: var(--muted); font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.eyebrow { font-family: "Bebas Neue", sans-serif; letter-spacing: 4px; color: var(--accent2); font-size: 16px; display: block; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* 現場兌換 QR（11/15）：QR 一定要白底黑字才掃得到，暗色主題也一樣 */
.redeems { display: grid; gap: 12px; }
.redeem { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card2); }
.redeem b { font-size: 17px; }
.redeem.done { color: var(--ok); }
.qrbox { background: #fff; padding: 8px; border-radius: 10px; width: min(240px, 70vw); }
.qrbox svg { display: block; width: 100%; height: auto; }

/* 小卡（11/17，cardui.js）：卡圖 5:7 整張不裁（畫師規格 1000×1400），卡框在圖下面印成員和場景；圖還沒到先畫文字卡
   11/18 以前卡框是 5:7、圖區被壓成接近正方形，畫好的圖上下會被裁掉 → 改成卡框跟著圖加高（比例接近實體小卡 55×85mm） */
.pc { position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: #fffaf2; color: #2f2121;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28); display: flex; flex-direction: column; padding: 7%; padding-bottom: 0; }
.pc .art, .pc .art-img { flex: none; width: 100%; aspect-ratio: 5 / 7; border-radius: 9px; }
.pc .art { background: linear-gradient(150deg, var(--c1), var(--c2)); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 8px; }
.pc .art-img { object-fit: cover; display: block; }
.pc .who { font-family: "Bebas Neue", "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif; font-size: 1.5em; letter-spacing: 1px; line-height: 1.05; }
.pc .scene { font-size: .9em; opacity: .85; font-weight: 700; }
.pc .cap { padding: 7px 2px 9px; display: flex; flex-direction: column; line-height: 1.25; }
.pc .cap b { font-size: .95em; }
.pc .cap span { font-size: .78em; color: #7a5a56; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc .cnt { position: absolute; top: 6px; right: 6px; background: #2f2121; color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.pc .fl { position: absolute; top: 6px; left: 8px; color: #fff; text-shadow: 0 0 6px #F288B9; font-size: 16px; }
.pc.small { font-size: 12px; border-radius: 10px; padding: 6%; padding-bottom: 0; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.pc.small .who { font-size: 1.35em; }
.pc.small .scene { display: none; }
.pc.locked { background: var(--card2); box-shadow: none; border: 1.5px dashed var(--line2); }
.pc.locked .art { background: var(--soft); color: var(--muted); }
.pc.locked .who { font-size: 2.4em; opacity: .5; }
.pc.locked .cap b, .pc.locked .cap span { color: var(--muted); }
.pc.hidden-card:not(.locked) { background: #2f2121; }
.pc.hidden-card:not(.locked) .cap b { color: #FDD89E; } .pc.hidden-card:not(.locked) .cap span { color: #f0d9d6; }
/* 閃卡：流光 */
.pc.flash::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .75) 45%, rgba(253, 216, 158, .6) 50%, rgba(242, 136, 185, .6) 55%, transparent 70%);
  background-size: 250% 250%; animation: pcShine 2.6s ease-in-out infinite; }
.pc.flash { box-shadow: 0 0 0 2px #FDD89E, 0 10px 30px rgba(242, 136, 185, .45); }
@keyframes pcShine { 0% { background-position: 100% 100%; } 100% { background-position: 0% 0%; } }
@media (prefers-reduced-motion: reduce) { .pc.flash::after { animation: none; } }

/* 座位視角（11/24，seatview.js）：全螢幕 3D 影廳，畫面本身是暗的，亮色模式也一樣用深色字卡 */
html.sv-lock, html.sv-lock body { overflow: hidden; }
html.sv-lock .toast { z-index: 80; }
.sv { position: fixed; inset: 0; z-index: 70; background: #0b0809; color: #fdf3f0; animation: svIn .25s ease-out; }
.sv-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.sv-cv:active { cursor: grabbing; }
.sv-top { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.sv-top > * { pointer-events: auto; }
.sv-round { position: absolute; left: 0; width: 40px; height: 40px; padding: 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(20, 12, 15, .72); border: 1px solid rgba(255, 255, 255, .18); color: #fff; box-shadow: none; }
.sv-round svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sv-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 14px;
  background: rgba(20, 12, 15, .72); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(6px); }
.sv-pill i { width: 7px; height: 7px; border-radius: 50%; background: #F288B9; }
.sv-hint { position: absolute; top: calc(62px + env(safe-area-inset-top)); left: 0; right: 0; display: flex; justify-content: center; pointer-events: none; }
.sv-hint > * { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px;
  background: rgba(20, 12, 15, .6); border: 1px solid rgba(255, 255, 255, .14); color: #f0d9d6; box-shadow: none; min-height: 0; }
.sv-hint svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.sv-gyro.on { border-color: #F288B9; color: #fff; }
.sv-card { position: absolute; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: 460px; margin: 0 auto; padding: 16px 18px;
  border-radius: 18px; background: linear-gradient(160deg, rgba(90, 47, 60, .92), rgba(31, 21, 21, .92)); border: 1px solid rgba(242, 136, 185, .35);
  backdrop-filter: blur(8px); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.sv-title { margin: 0; font-size: 22px; }
.sv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.sv-chip { padding: 6px 14px; min-height: 0; border-radius: 999px; font-size: 14px; font-weight: 700; box-shadow: none;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2); color: #fdf3f0; }
.sv-chip[aria-pressed="true"] { background: #fdf3f0; color: #1f1515; border-color: #fdf3f0; }
.sv-note { margin: 0; font-size: 12px; color: #c9aaa6; }
@keyframes svIn { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sv { animation: none; } }

/* 開站前（11/25，common.js 的 PRELAUNCH）：還不能用的按鈕變灰，按了跳提示（不是真的停用，提示才看得到） */
html.pre-launch a[href="/cards"], html.pre-launch a[href^="/cards?"],
html.pre-launch a[href="/game"], html.pre-launch a[href^="/game?"],
html.pre-launch a[href="/pass"], html.pre-launch a[href^="/pass?"],
html.pre-login a[href="/login"], html.pre-login a[href^="/login?"] {
  opacity: .4; filter: grayscale(1); cursor: not-allowed; box-shadow: none;
}
