/* 佔位美術：等日系柔和動畫風素材進來再統一換色與字體 */
:root {
  --paper: #f6f1e7;
  --paper-2: #ece4d3;
  --ink: #2b2622;
  --ink-soft: #6b625a;
  --stamp: #c8332b;       /* 圈選章紅：投票章顏色，不是任何政黨色 */
  --line: #d8ccb6;
  --card-face: #fffdf8;
  --ok: #3f8f5a;
  --chip-blue: #2f6fd8;   /* 得分框：基本分 */
  --chip-red: #d8463b;    /* 得分框：連擊倍率 */
  --gold: #f2c14e;
  --hl: #ffe08a;          /* 政見重點詞底色 */
  --radius: 10px;
  --gap: 8px;
  --rows: 4;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink);
  font-family: -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
[hidden] { display: none !important; }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.screen { display: none; min-height: 100vh; min-height: 100dvh; padding: max(12px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom)); gap: 12px; }
.screen.active { display: flex; flex-direction: column; }

.btn { display: block; width: 100%; padding: 13px 14px; border-radius: 12px; border: 2px solid var(--ink); background: var(--card-face); font-size: 17px; font-weight: 700; text-align: center; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.big { font-size: 20px; padding: 15px; }
.btn.ghost { border-color: var(--line); background: transparent; font-weight: 500; font-size: 15px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-row { display: flex; gap: 10px; } .btn-row > * { flex: 1; }
.link { background: none; border: none; padding: 0; color: var(--stamp); text-decoration: underline; }
.link.center { align-self: center; }
.bar { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.bar h2 { text-align: center; margin: 0; font-size: 20px; }
.lead { color: var(--ink-soft); font-size: 14px; line-height: 1.6; margin: 0; }
.sub { margin: 10px 0 0; font-size: 16px; }

/* 首頁 */
.ver-toggle { position: absolute; right: 12px; top: max(10px, env(safe-area-inset-top)); display: flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; font-size: 12px; z-index: 5; }
.ver-toggle button { border: none; background: var(--card-face); padding: 3px 10px; }
.ver-toggle button.on { background: var(--ink); color: var(--paper); }
.home-title { text-align: center; margin-top: 18px; }
/* 首頁標題（11/20 企劃選定 A1 糖果貼紙）：黃字、粗咖啡外框、下方咖啡影子；下面一顆膠囊提醒投票日。顏色只用奶油黃／咖啡／白，避開政黨色 */
.home-title h1 { font-family: Huninn, "Noto Sans TC", sans-serif; font-size: 42px; font-weight: 400; letter-spacing: 2px; line-height: 1.15; margin: 0;
  color: #ffd84d; -webkit-text-stroke: 7px #3b2a1a; paint-order: stroke fill; text-shadow: 0 5px 0 #3b2a1a; }
.home-badge { display: inline-flex; gap: 6px; align-items: center; margin: 8px 0 0; padding: 3px 14px 3px 6px; border-radius: 999px;
  background: #fff; border: 2.5px solid #3b2a1a; box-shadow: 0 3px 0 #3b2a1a; color: #3b2a1a; font-size: 14px; font-weight: 700; }
.home-badge b { background: #ffd84d; border-radius: 999px; padding: 1px 9px; font-family: "Chiron GoRound TC", "Noto Sans TC", sans-serif; font-weight: 900; }
.tagline { color: var(--ink-soft); margin: 4px 0 0; }
.hero { flex: 1; min-height: 230px; position: relative; overflow: hidden; border-radius: 16px; }
.hero-hint { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--ink-soft); margin: 0; z-index: 3; }
.home-buttons { display: grid; gap: 10px; }
.nick-line { text-align: center; color: var(--ink-soft); margin: 0; font-size: 13px; }
.fineprint { text-align: center; font-size: 11px; color: var(--ink); margin: 0; }

/* A：立體小星球（佔位：圓球＋扇形地標） */
.planet { background: radial-gradient(ellipse at 50% 100%, #fff7e3 0%, var(--paper) 70%); cursor: pointer; }
.globe { position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b9e3c6, #6fb58a 55%, #3f7d5a); box-shadow: inset -18px -24px 40px rgba(0,0,0,.18); }
.planet-city { position: absolute; top: 8px; left: 0; right: 0; text-align: center; font-weight: 800; font-size: 18px; z-index: 3; }
.planet-ring { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.lm { position: absolute; display: flex; flex-direction: column; align-items: center; }
.lm .bld { width: 40px; border-radius: 6px 6px 2px 2px; background: var(--card-face); border: 2px solid var(--ink); box-shadow: 3px 0 0 rgba(0,0,0,.15); }
.lm span { font-size: 11px; font-weight: 700; background: var(--card-face); border: 1px solid var(--line); border-radius: 6px; padding: 1px 4px; margin-bottom: 3px; white-space: nowrap; }
.lm.grow { animation: grow .45s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes grow { from { scale: 1 0; } to { scale: 1 1; } }

/* B：候選人小卡（扇形手牌） */
.hand { background: radial-gradient(ellipse at 50% 80%, #fff7e3, var(--paper) 70%); }
.hand-fan { position: absolute; left: 50%; bottom: 30%; width: 0; height: 0; animation: float 3.2s ease-in-out infinite; }
@keyframes float { 50% { translate: 0 -6px; } }
.hcard { position: absolute; left: -58px; bottom: 0; width: 116px; height: 162px; transform-origin: 50% 190%; border: none; padding: 0; background: none; perspective: 600px; }
.hcard.mid { left: -68px; width: 136px; height: 190px; z-index: 3; }
.hcard .hc-inner { position: relative; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.hcard.flip .hc-inner { transform: rotateY(180deg); }
.hcard .hc-face, .hcard .hc-back { position: absolute; inset: 0; border-radius: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.hcard .hc-face { background: var(--card-face); border: 2.5px solid var(--ink); display: flex; flex-direction: column; box-shadow: 0 6px 0 rgba(0,0,0,.12); }
.hcard .hc-back { transform: rotateY(180deg); }
.hcard .hc-face .avatar { flex: 1; }
.hcard .hc-face b { font-size: 16px; padding: 3px 0 0; }
.hcard .hc-face small { font-size: 11px; color: var(--ink-soft); padding-bottom: 5px; }
.foil { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.9) 50%, transparent 62%); background-size: 250% 100%; background-position: 150% 0; animation: foil 4s ease-in-out infinite; pointer-events: none; }
@keyframes foil { 0%, 70% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.hcard.deal { animation: deal .5s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes deal { from { translate: 0 220px; scale: .4; opacity: 0; } }

/* 單人二選一 */
.choice-list { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.choice { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; border-radius: 16px; border: 2px solid var(--ink); background: var(--card-face); padding: 18px; text-align: left; }
.choice b { font-size: 24px; } .choice span { color: var(--ink-soft); } .choice small { color: var(--stamp); font-weight: 700; }
.choice.primary { background: var(--ink); color: var(--paper); } .choice.primary span { color: #d9d0c2; } .choice.primary small { color: var(--gold); }

/* 選縣市：立體台灣地圖（佔位） */
.twmap { position: relative; flex: 1; min-height: 380px; border-radius: 16px; background: linear-gradient(#e7f0f3, #d9e8ee); overflow: hidden; }
.twmap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pin { position: absolute; transform: translate(-50%, -100%); border: none; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; }
.pin i { display: block; width: 22px; height: 26px; border-radius: 4px 4px 1px 1px; background: #c9c3b8; border: 1.5px solid #9a958b; }
.pin span { font-size: 10px; color: #8a847a; background: rgba(255,255,255,.8); border-radius: 4px; padding: 0 3px; margin-top: 1px; white-space: nowrap; }
.pin.on i { background: var(--card-face); border: 2px solid var(--ink); animation: bob 1.6s ease-in-out infinite; }
.pin.on span { color: var(--ink); font-weight: 800; font-size: 12px; }
.pin.sel i { background: var(--gold); }
@keyframes bob { 50% { translate: 0 -3px; } }
.county-info { text-align: center; margin: 0; font-weight: 700; min-height: 1.4em; }

/* 同機多人設定 */
.seg { display: flex; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; }
.seg button { flex: 1; border: none; background: var(--card-face); padding: 10px; font-weight: 700; }
.seg button.on { background: var(--ink); color: var(--paper); }
.names { display: grid; gap: 8px; }
.names input { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card-face); }

/* 好友房 */
.room-card { background: var(--card-face); border: 2px solid var(--ink); border-radius: 16px; padding: 14px; display: grid; gap: 6px; text-align: center; }
.room-card b { font-size: 34px; letter-spacing: 6px; }
.room-link { font-size: 12px; color: var(--ink-soft); word-break: break-all; margin: 0; }

/* 遊戲 */
.screen.game { gap: 8px; }
.hud-top { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; }
.hud-mode { text-align: center; font-weight: 700; color: var(--ink-soft); font-size: 14px; }
.icon { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card-face); padding: 0; font-size: 16px; }
.icon { display: grid; place-items: center; }
.icon .ic { width: 26px; height: 26px; vertical-align: 0; }
/* 遊戲圖示（public/icons，#13）：跟著字的大小走 */
.ic { width: 1.3em; height: 1.3em; object-fit: contain; vertical-align: -.3em; user-select: none; -webkit-user-drag: none; }
.ic.big { width: 64px; height: 64px; vertical-align: 0; }
.hud-score { display: flex; align-items: center; gap: 10px; }
.hud-score .total { flex: 1; line-height: 1.05; }
.hud-score .total small { display: block; font-size: 11px; color: var(--ink-soft); }
.hud-score .total b { font-size: 30px; font-variant-numeric: tabular-nums; }
.chips { display: flex; align-items: center; gap: 4px; font-weight: 900; font-size: 22px; font-variant-numeric: tabular-nums; }
.chip-base, .chip-mult { color: #fff; border-radius: 8px; padding: 2px 10px; min-width: 56px; text-align: center; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.chip-base { background: var(--chip-blue); } .chip-mult { background: var(--chip-red); }
.chips .bump { animation: bump .35s ease; }
.chips .shake { animation: shake .35s ease; }
@keyframes bump { 40% { transform: scale(1.3) rotate(-4deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.hud-info { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); }
.hud-info b { color: var(--ink); font-variant-numeric: tabular-nums; }
.hud-players { display: flex; gap: 6px; }
.hud-players .pl { flex: 1; border: 1.5px solid var(--line); border-radius: 10px; padding: 4px 6px; text-align: center; background: var(--card-face); line-height: 1.2; }
.hud-players .pl b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-players .pl small { color: var(--ink-soft); font-size: 12px; }
.hud-players .pl.turn { border: 2.5px solid var(--ink); box-shadow: 0 3px 0 rgba(0,0,0,.15); }
.hud-players .pl.turn b::before { content: ''; display: inline-block; width: 1.1em; height: 1.1em; margin-right: 3px; vertical-align: -.2em; background: url(icons/turn.webp) center / contain no-repeat; }

.grid { --cw: min(calc((min(100vw, 480px) - 32px - 3 * var(--gap)) / 4), calc((100dvh - 330px) / var(--rows) * 0.75 - var(--gap)));
  display: grid; grid-template-columns: repeat(4, var(--cw)); gap: var(--gap); justify-content: center; }
.card { width: var(--cw); aspect-ratio: 3 / 4; perspective: 600px; border: none; background: none; padding: 0; }
.card-inner { position: relative; width: 100%; height: 100%; transition: transform .3s ease; transform-style: preserve-3d; }
.card.open .card-inner, .card.matched .card-inner { transform: rotateY(180deg); }
.card-back, .card-front { position: absolute; inset: 0; border-radius: var(--radius); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.card-back, .hc-back { background: var(--paper-2); border: 2px solid var(--line); display: grid; place-items: center;
  background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,.03) 6px 12px); }
.stamp { display: grid; place-items: center; width: 52%; aspect-ratio: 1; border: 2px solid var(--stamp); border-radius: 50%; color: var(--stamp); font-weight: 800; font-size: calc(var(--cw, 96px) * .26); transform: rotate(-8deg); opacity: .85; }
.card-front { transform: rotateY(180deg); background: var(--card-face); border: 2px solid var(--ink); display: flex; flex-direction: column; }
.card.matched .card-front { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(63,143,90,.25); }
.card.matched { animation: pop .35s ease; }
.card.miss .card-front { border-color: var(--chip-red); }
.card.miss { animation: shake .35s ease; }
@keyframes pop { 50% { transform: scale(1.06); } }
.avatar { flex: 1; min-height: 0; display: grid; place-items: center; background: #e9e4da; }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.avatar .ph { font-size: calc(var(--cw, 96px) * .42); font-weight: 800; color: #b9b0a2; }
.namebar { padding: 3px 2px 4px; text-align: center; line-height: 1.1; background: var(--card-face); }
.namebar b { display: block; font-size: max(12px, calc(var(--cw) * .16)); white-space: nowrap; }
.namebar small { display: block; font-size: 10px; color: var(--ink-soft); white-space: nowrap; }
.card.pending .card-inner { animation: wobble .6s ease infinite; }
@keyframes wobble { 50% { transform: rotateY(25deg); } }

.popups { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pop-text { position: absolute; font-weight: 900; color: #fff; -webkit-text-stroke: 1px var(--ink); text-shadow: 0 3px 0 var(--ink); animation: rise 1s ease-out forwards; white-space: nowrap; }
@keyframes rise { 0% { transform: translate(-50%, 0) scale(.6); opacity: 0; } 20% { transform: translate(-50%, -10px) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -60px) scale(1); opacity: 0; } }

/* 政見對話框區 */
.talk { min-height: 120px; max-height: 34vh; max-height: 34dvh; overflow-y: auto; }
.bubble { background: var(--card-face); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.bubble .who { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mini { width: 28px; height: 28px; border-radius: 50%; background: #e9e4da; overflow: hidden; display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #9f9587; flex: none; }
.mini img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.bubble .say-src { margin: 4px 0 0; font-size: 11px; } .bubble .say-src a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px dotted currentColor; }
/* 說話的人：頭像從嘴的位置切成上下兩片，出聲時上片掀起來、下片往下掉（誇張的開合，像布偶） */
.mini.talker { position: relative; width: 44px; height: 44px; background: radial-gradient(circle at 60% 66%, #e4687a 0 22%, #5b1622 23%); overflow: visible; }
.mini.talker img { position: absolute; inset: 0; border-radius: 50%; }
.talker .jt { clip-path: inset(0 0 35.5% 0); transform-origin: 4% 64%; }
.talker .jb { clip-path: inset(64% 0 0 0); transform-origin: 4% 64%; }
.talker.talking .jt { animation: jaw-t .19s ease-in-out infinite alternate; }
.talker.talking .jb { animation: jaw-b .19s ease-in-out infinite alternate; }
@keyframes jaw-t { from { transform: none; } to { transform: rotate(-20deg); } }
@keyframes jaw-b { from { transform: none; } to { transform: rotate(7deg); } }
@media (prefers-reduced-motion: reduce) { .talker.talking .jt, .talker.talking .jb { animation: none; } }
.bubble .who b { font-size: 15px; } .bubble .who small { color: var(--ink-soft); font-size: 12px; }
.bubble q { display: block; font-size: 15px; line-height: 1.55; quotes: "「" "」"; }
mark { background: var(--hl); color: inherit; border-radius: 3px; padding: 0 1px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink-soft); margin-left: auto; }
.src { font-size: 11px; color: var(--ink-soft); margin: 6px 0 0; }
.versus { display: grid; grid-template-columns: 1fr 26px 1fr; gap: 4px; align-items: stretch; }
.bubble.compact { padding: 8px 10px; display: flex; flex-direction: column; }
.bubble.compact .who { margin-bottom: 4px; } .bubble.compact .mini { width: 24px; height: 24px; font-size: 12px; }
.bubble.compact q { font-size: 13px; line-height: 1.5; flex: 1; }
.bubble.compact .tag { align-self: flex-start; margin: 6px 0 0; }
.bolt { align-self: center; text-align: center; font-size: 22px; }
.bolt { display: flex; justify-content: center; align-items: center; }   /* 圖示比欄寬，用 flex 讓它往兩邊平均溢出，才會在兩個泡泡正中間 */
.bolt .ic { flex: none; width: 36px; height: 36px; vertical-align: 0; }
.hint { color: var(--ink-soft); font-size: 14px; text-align: center; padding-top: 24px; margin: 0; }

/* 配對成功：放大展示 */
.showcase { position: fixed; inset: 0; z-index: 50; background: rgba(32,26,22,.72); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; cursor: pointer; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.rays { position: absolute; left: 50%; top: 40%; width: 760px; height: 760px; margin: -380px 0 0 -380px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(242,193,78,.28) 0deg 9deg, transparent 9deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 0 30%, transparent 62%); mask: radial-gradient(circle, #000 0 30%, transparent 62%); animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sc-card { position: relative; width: 190px; height: 262px; background: var(--card-face); border: 3px solid var(--ink); border-radius: 18px; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 0 0 8px rgba(255,253,248,.25), 0 0 70px 18px rgba(242,193,78,.45); animation: enter .45s cubic-bezier(.2,1.4,.4,1) both, talkbob .5s ease-in-out .5s 4; --cw: 190px; }
@keyframes enter { from { transform: scale(.3) rotate(-20deg); opacity: 0; } to { transform: rotate(-5deg); } }
@keyframes talkbob { 0%, 100% { transform: rotate(-5deg) translateY(0); } 50% { transform: rotate(-5deg) translateY(-6px); } }
.sc-card .avatar .ph { font-size: 80px; }
.sc-card .namebar b { font-size: 20px; } .sc-card .namebar small { font-size: 12px; white-space: normal; line-height: 1.35; }
.sc-card .foil { animation-duration: 2.2s; }
.sc-bubble { position: relative; background: var(--card-face); border: 2.5px solid var(--ink); border-radius: 16px; padding: 12px 14px; width: min(340px, 100%); min-height: 84px; }
.sc-bubble::before { content: ''; position: absolute; top: -13px; left: 50%; margin-left: -12px; border: 12px solid transparent; border-top: 0; border-bottom-color: var(--ink); }
.sc-bubble p { margin: 0; font-size: 17px; line-height: 1.6; }
.sc-bubble p::after { content: '▌'; animation: blink .8s steps(1) infinite; color: var(--stamp); }
.sc-bubble p.done::after { content: ''; }
@keyframes blink { 50% { opacity: 0; } }
.sc-bubble small { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 12px; }
.sc-hint { color: #f3ead8; font-size: 13px; margin: 0; position: relative; }
.sc-pops { position: absolute; left: 50%; top: 18%; width: 0; height: 0; z-index: 2; }
.sc-pops .pop-text { font-size: 34px; }
.sc-pops .pop-text.mult { font-size: 24px; color: var(--hl); animation-delay: .15s; }

/* 說明視窗 */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(32,26,22,.6); display: grid; place-items: center; padding: 20px; }
.modal-box { background: var(--card-face); border: 2.5px solid var(--ink); border-radius: 18px; padding: 18px; width: min(360px, 100%); }
.modal-box h2 { margin: 0 0 10px; text-align: center; }
.steps { padding-left: 22px; margin: 0 0 14px; display: grid; gap: 10px; }
.steps b { display: block; } .steps span { color: var(--ink-soft); font-size: 14px; }

/* 結算 */
.result-card { text-align: center; background: var(--card-face); border: 2px solid var(--ink); border-radius: 16px; padding: 16px; }
.stars { font-size: 34px; letter-spacing: 6px; color: #d9a420; }
.result-score b { font-size: 48px; }
.result-detail { color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.result-rank { margin-top: 6px; font-weight: 700; }
.people-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.people-list li { background: var(--card-face); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.people-list .row { display: flex; align-items: center; gap: 8px; }
.people-list p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; }

/* 排行榜 */
.board-me { background: var(--ink); color: var(--paper); border-radius: 10px; padding: 10px 12px; }
.board-me:empty { display: none; }
.board-list { list-style: none; padding: 0; margin: 0; }
.board-list li { display: grid; grid-template-columns: 30px 28px 1fr auto; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.board-list li > svg { display: block; }
.board-list li.me { font-weight: 800; background: #fff3d1; }
/* 翻牌看板：每一列從上緣往下翻開，--i 是第幾列（app.js 的 flapIn 設定），越後面越晚翻 */
.board-list { perspective: 700px; }
.board-list li.flap { transform-origin: 50% 0; backface-visibility: hidden; animation: flap-in .42s cubic-bezier(.3,.9,.35,1.25) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes flap-in { 0% { transform: rotateX(-92deg); opacity: 0; } 35% { opacity: 1; } 70% { transform: rotateX(14deg); } 100% { transform: rotateX(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .board-list li.flap { animation: none; } }
.board-list li.empty { display: block; color: var(--ink-soft); text-align: center; }
.board-list .r { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.board-list .s { font-weight: 700; font-variant-numeric: tabular-nums; }

/* 出處 */
.about p { line-height: 1.7; font-size: 14px; } .about a { color: var(--stamp); }
.src-person { border-top: 1px solid var(--line); padding: 10px 0; }
.src-person h4 { margin: 0 0 4px; }
.src-person ul { margin: 4px 0; padding-left: 20px; font-size: 13px; line-height: 1.6; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s; z-index: 80;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 99px; font-size: 14px; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ===== 強化特效（11/19 晚）===== */
/* 選舉之夜舞台：遊戲與結算頁。紫色不屬於任何主要政黨。 */
body.stage { background: #1c1238; }
body.stage #app { background:
  radial-gradient(ellipse 70% 40% at 50% 0%, rgba(255,214,120,.28), transparent 70%),
  radial-gradient(ellipse 120% 80% at 50% 110%, #4b2a8a 0%, transparent 60%),
  linear-gradient(#2a1a52, #1c1238); }
.screen.game, #screen-result { --ink: #fff6e6; --ink-soft: #c9b8ea; --line: #5d4a94; color: var(--ink); }
.screen.game .icon { background: rgba(255,255,255,.08); border-color: #6d5aa6; color: #fff6e6; }
.hud-score .total b { font-size: 36px; color: #fff; text-shadow: 0 3px 0 #000, 0 0 18px rgba(242,193,78,.6); }
.chip-base, .chip-mult { font-size: 24px; border: 2px solid #fff; box-shadow: 0 4px 0 #000; }
.chip-mult[data-heat="2"] { background: #ff6a2b; box-shadow: 0 4px 0 #000, 0 0 14px #ff6a2b; }
.chip-mult[data-heat="3"], .chip-mult[data-heat="4"] { background: #ff3b1f; animation: fire .5s ease-in-out infinite alternate; }
@keyframes fire { from { box-shadow: 0 4px 0 #000, 0 -4px 14px #ffb21f, 0 0 26px #ff3b1f; } to { box-shadow: 0 4px 0 #000, 0 -10px 22px #ffd23f, 0 0 40px #ff3b1f; transform: scale(1.06); } }
.chips .bump { animation: bumpBig .45s cubic-bezier(.2,1.8,.4,1); }
@keyframes bumpBig { 0% { transform: scale(1); } 35% { transform: scale(1.6) rotate(-8deg); } 100% { transform: scale(1); } }
.card-back { background-color: #f3e7cf; border: 2.5px solid #fff3d6; box-shadow: 0 5px 0 rgba(0,0,0,.45); }
.card-front { border-width: 3px; box-shadow: 0 5px 0 rgba(0,0,0,.45); }
/* 翻開：整段由這個動畫負責（起點寫明、同時關掉漸變）。原本動畫和漸變同時作用在同一個屬性上，各家瀏覽器處理不同，iPhone 上會多動一下 */
.card.open .card-inner { animation: flipPop .32s ease; transition: none; }
@keyframes flipPop { 0% { transform: rotateY(0deg) scale(1); } 50% { transform: rotateY(90deg) scale(1.18); } 100% { transform: rotateY(180deg) scale(1); } }
.card.matched .card-front { border-color: #f2c14e; box-shadow: 0 0 0 3px #f2c14e, 0 0 22px rgba(242,193,78,.9); }
.card.matched { animation: popBig .5s cubic-bezier(.2,1.8,.4,1); }
@keyframes popBig { 40% { transform: scale(1.25) rotate(4deg); } }
.card.miss { animation: shakeHard .4s ease; }
@keyframes shakeHard { 15%, 55% { transform: translateX(-9px) rotate(-4deg); } 35%, 75% { transform: translateX(9px) rotate(4deg); } }
.card.miss .card-front { border-color: #ff4a3d; box-shadow: 0 0 0 3px #ff4a3d, 0 0 18px rgba(255,74,61,.8); }
.screen.game .bubble { color: #2b2622; --ink: #2b2622; --ink-soft: #6b625a; --line: #d8ccb6; }
.screen.game .src, .screen.game .hint { color: #c9b8ea; }
.bolt { font-size: 34px; animation: boltPulse .5s ease-in-out 3; filter: drop-shadow(0 0 8px #ffd23f); }
@keyframes boltPulse { 50% { transform: scale(1.6) rotate(-10deg); } }

/* 畫面震動與閃光 */
#app.shake-sm { animation: scrShake .25s linear; }
#app.shake-md { animation: scrShake .35s linear; --amp: 7px; }
#app.shake-lg { animation: scrShake .45s linear; --amp: 12px; }
@keyframes scrShake { 10% { transform: translate(var(--amp, 4px), calc(var(--amp, 4px) * -.6)); } 30% { transform: translate(calc(var(--amp, 4px) * -1), calc(var(--amp, 4px) * .5)); } 50% { transform: translate(calc(var(--amp, 4px) * .7), var(--amp, 4px)); } 70% { transform: translate(calc(var(--amp, 4px) * -.5), calc(var(--amp, 4px) * -.8)); } 90% { transform: translate(2px, 1px); } }
.flash { position: fixed; inset: 0; z-index: 70; pointer-events: none; animation: flashOut .45s ease-out forwards; }
@keyframes flashOut { from { opacity: 1; } to { opacity: 0; } }
#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 75; pointer-events: none; }

/* 配對成功放大展示：更強 */
.showcase { background: radial-gradient(circle at 50% 40%, rgba(80,40,140,.75), rgba(10,6,24,.92)); }
.rays { width: 1100px; height: 1100px; margin: -550px 0 0 -550px; background: repeating-conic-gradient(from 0deg, rgba(255,214,120,.55) 0deg 8deg, transparent 8deg 20deg); animation: spin 7s linear infinite; }
.showcase[data-heat="3"] .rays, .showcase[data-heat="4"] .rays, .showcase[data-heat="5"] .rays { background: repeating-conic-gradient(from 0deg, rgba(255,120,60,.6) 0deg 8deg, rgba(255,214,120,.3) 8deg 14deg, transparent 14deg 20deg); animation-duration: 3.5s; }
.sc-card { width: 210px; height: 290px; border: 4px solid #fff; box-shadow: 0 0 0 6px #f2c14e, 0 0 90px 30px rgba(242,193,78,.7); animation: slamIn .45s cubic-bezier(.2,1.5,.4,1) both, talkbob .5s ease-in-out 1.1s 4; }
@keyframes slamIn { 0% { transform: translateY(-120vh) rotate(-30deg) scale(1.6); } 70% { transform: translateY(0) rotate(-3deg) scale(.95); } 100% { transform: rotate(-5deg); } }
.sc-card::after { content: '卜'; position: absolute; right: -14px; top: -14px; width: 92px; height: 92px; border: 6px solid #d8211c; border-radius: 50%; color: #d8211c; font-size: 52px; font-weight: 900;
  display: grid; place-items: center; background: rgba(255,255,255,.15); opacity: 0; transform: scale(3) rotate(-30deg); }
.showcase.stamped .sc-card::after { animation: stampIn .28s cubic-bezier(.5,0,.8,.4) forwards; }
@keyframes stampIn { to { opacity: .95; transform: scale(1) rotate(-14deg); } }
.showcase.stamped .sc-card { animation: none; transform: rotate(-5deg); }
.showcase.stamped .sc-card::before { content: ''; position: absolute; inset: -40px; border-radius: 50%; border: 6px solid rgba(255,255,255,.9); animation: wave .5s ease-out forwards; pointer-events: none; }
@keyframes wave { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.sc-pops { top: 9%; display: flex; flex-direction: column; align-items: center; }
.big-pop { font-size: 72px; font-weight: 900; color: #ffd23f; text-shadow: 0 0 0 #2b1600, 3px 0 0 #2b1600, -3px 0 0 #2b1600, 0 3px 0 #2b1600, 0 -3px 0 #2b1600, 3px 3px 0 #2b1600, -3px 3px 0 #2b1600, 3px -3px 0 #2b1600, -3px -3px 0 #2b1600, 0 6px 0 #2b1600, 0 0 30px rgba(255,210,63,.8); white-space: nowrap; transform: translateX(-50%); animation: popIn .5s cubic-bezier(.2,1.8,.4,1) .15s both; }
/* 外框用 text-shadow 畫，不用 -webkit-text-stroke：中文筆畫密，手機上描邊會吃進字裡，糊成一團 */
.combo-pop { font-size: 30px; font-weight: 900; color: #fff; text-shadow: 0 0 0 #2b1600, 2px 0 0 #2b1600, -2px 0 0 #2b1600, 0 2px 0 #2b1600, 0 -2px 0 #2b1600, 2px 2px 0 #2b1600, -2px 2px 0 #2b1600, 2px -2px 0 #2b1600, -2px -2px 0 #2b1600, 0 4px 0 #2b1600; white-space: nowrap; transform: translateX(-50%); animation: popIn .5s cubic-bezier(.2,1.8,.4,1) .35s both; }
.combo-pop.heat3 { color: #ffb21f; font-size: 36px; } .combo-pop.heat4 { color: #ff6a2b; font-size: 42px; } .combo-pop.heat5 { color: #ff3b1f; font-size: 48px; animation: popIn .5s cubic-bezier(.2,1.8,.4,1) .35s both, jitter .08s linear .9s infinite; }
@keyframes popIn { from { transform: translateX(-50%) scale(0) rotate(-20deg); } to { transform: translateX(-50%) scale(1) rotate(-4deg); } }
@keyframes jitter { 50% { transform: translateX(calc(-50% + 2px)) rotate(-2deg) scale(1.03); } }
.sc-bubble { border: 3px solid #fff; box-shadow: 0 6px 0 rgba(0,0,0,.5); }
.sc-bubble::before { border-bottom-color: #fff; }
.sc-bubble p { font-size: 19px; font-weight: 600; }
.sc-bubble mark { background: #ffd23f; padding: 0 3px; box-shadow: 0 2px 0 #b8860b; }

/* 結算 */
#screen-result .result-card { background: rgba(255,255,255,.08); border: 3px solid #f2c14e; box-shadow: 0 0 40px rgba(242,193,78,.35); }
#screen-result .result-score b { font-size: 64px; color: #ffd23f; text-shadow: 0 4px 0 #000; }
#screen-result .result-detail, #screen-result .result-rank { color: var(--ink); }
.stars .star { display: inline-block; font-size: 52px; line-height: 1; }
.stars .star .ic { width: 56px; height: 56px; vertical-align: 0; }
.stars .star:not(.on) .ic { opacity: .45; }
.stars .star.on { filter: drop-shadow(0 0 12px rgba(255,210,63,.85)); animation: starStamp .3s cubic-bezier(.5,0,.8,.4) both; }
@keyframes starStamp { from { transform: scale(4) rotate(-40deg); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#screen-result .btn:not(.primary) { background: transparent; color: var(--ink); border-color: #8f7cc8; }
#screen-result .btn.primary { background: #ffd23f; color: #2b1600; border-color: #ffd23f; box-shadow: 0 4px 0 #9c7a12; }
#screen-result .people-list li { color: #2b2622; --ink-soft: #6b625a; }
#screen-result .sub { color: var(--ink); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
.sc-card { overflow: visible; } .sc-card .avatar { border-radius: 14px 14px 0 0; overflow: hidden; } .sc-card .namebar { border-radius: 0 0 14px 14px; } .sc-card .foil { border-radius: 14px; }

/* 卡牌名字固定深灰（深紫舞台會把文字改成淺色，卡面上要蓋回來） */
.namebar b { color: #333; }
.namebar small { color: #666; }

/* 配中短提示（11/19 改：不中斷遊戲，點擊穿透到牌桌） */
.showcase.quick { pointer-events: none; background: radial-gradient(circle at 50% 45%, rgba(80,40,140,.55), rgba(10,6,24,.35) 70%); gap: 12px; }
.showcase.quick .sc-hint, .showcase.quick #sc-src { display: none; }
.showcase.quick .sc-card { width: min(46vw, 190px); }
.showcase.quick .sc-bubble { padding: 10px 16px; }
.showcase.quick #sc-text { font-size: 22px; font-weight: 800; text-align: center; line-height: 1.35; }
.showcase.quick.out { opacity: 0; transform: scale(.92); transition: opacity .25s ease, transform .25s ease; }
/* 結算：本局政見完整原文 */
#result-people ul.full { margin: 6px 0 4px; padding-left: 1.2em; line-height: 1.55; }
#result-people ul.full li { margin: 3px 0; list-style: disc; }
/* 這一版首頁只用小星球 */
.ver-toggle, #hero-hand { display: none !important; }
#result-people ul.full li { border: 0; background: none; padding: 0; box-shadow: none; border-radius: 0; display: list-item; }

/* 3D 小星球 */
.planet.is3d { cursor: grab; }
.planet.is3d .planet-ring, .planet.is3d .globe { display: none; }
.planet3d { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; z-index: 1; }
.planet.is3d .hero-hint { position: absolute; left: 0; right: 0; bottom: 6px; z-index: 2; pointer-events: none; }

/* ---------- 建設台北：小星球當牌桌背景、飛行的牌、倒數 ---------- */
.screen.game.build { position: relative; isolation: isolate; }
.screen.game.build > :not(.game-planet):not(.popups) { position: relative; z-index: 1; }
.screen.game.build .grid { --cw: min(calc((min(100vw, 480px) - 32px - 3 * var(--gap)) / 4), calc((100dvh - 296px) / var(--rows) * 0.75 - var(--gap))); margin-block: auto; }
.screen.game.build .talk { min-height: 140px; max-height: 140px; overflow: hidden; }
.screen.game.build .versus q { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.screen.game.build .talk .src { margin: 4px 0 0; }
.hud-mode.clock { font-size: 26px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: 1px; text-shadow: 0 2px 0 #000; }
.hud-mode.clock.hurry { color: #ff6b5e; }
.hud-mode.clock.beat { animation: beat .35s ease; }
@keyframes beat { 30% { transform: scale(1.35); } }

/* 星球：整個遊戲畫面的底層，半透明，不搶牌的注意力 */
.game-planet { display: none; }
.screen.game.build .game-planet { display: block; position: absolute; inset: 0; z-index: 0; opacity: .58; pointer-events: none; overflow: hidden; }
.game-planet canvas { width: 100%; height: 100%; display: block; pointer-events: none; }
.flat-globe { display: none; }
.game-planet.flat .flat-globe { display: block; position: absolute; left: 50%; top: 50%; width: 96%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #a5e39c, #6fc46a 70%); border: 3px solid #2b2420; outline: 6px solid #fff; }
#flat-builds span { position: absolute; translate: -50% -50%; width: 34px; height: 34px; border-radius: 10px; border: 2.5px solid #2b2420; display: grid; place-items: center; font-size: 19px; animation: bumpBuild .4s cubic-bezier(.2,1.8,.4,1); }

.build-hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; min-height: 40px; }
.build-hud[hidden] { display: none; }
.build-count { justify-self: start; display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 14px;
  background: #fffaf0; color: #2b2420; border: 2.5px solid #2b2420; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.build-count b { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; min-width: 1ch; text-align: center; }
.build-count small { font-size: 11px; font-weight: 700; color: #6b5d52; white-space: nowrap; }
.build-count.bump { animation: bumpBuild .45s cubic-bezier(.2,1.8,.4,1); }
@keyframes bumpBuild { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.build-combo { justify-self: end; grid-column: 3; padding: 4px 10px; border-radius: 12px; font-weight: 900; font-size: 14px; white-space: nowrap;
  background: #d8463b; color: #fff; border: 2.5px solid #2b2420; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.build-combo[data-heat="3"], .build-combo[data-heat="4"] { background: #ff7a1a; box-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 14px rgba(255,160,40,.9); }
.build-combo.bump { animation: bumpBuild .4s cubic-bezier(.2,1.8,.4,1); }
.build-label { grid-column: 2; display: flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  background: var(--c, #ffe08a); color: #2b2420; font-weight: 800; font-size: 13px; border: 2px solid #2b2420; opacity: 0; pointer-events: none; white-space: nowrap; }
.build-label.show { animation: labelIn 2.4s ease forwards; }
@keyframes labelIn { 0% { opacity: 0; transform: translateY(26px) scale(.6); } 10% { opacity: 1; transform: translateY(0) scale(1.12); } 16% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-4px); } }
.build-note { display: none; }
.screen.game.build .build-note { display: block; margin: 0; text-align: center; font-size: 10px; color: #c9b8ea; }

.card.gone { visibility: hidden; }
/* 立體疊牌：data-left＝這一疊還剩幾張。牌往右下露出一層一層的邊（厚度就是張數，不另外標數字） */
.card[data-left] { position: relative; }
.card[data-left] .card-back, .card[data-left] .card-front { box-shadow: 0 3px 0 rgba(0,0,0,.45); }
.card[data-left="2"] .card-back, .card[data-left="2"] .card-front { box-shadow: 2px 2px 0 #cdb98f, 2px 5px 0 rgba(0,0,0,.45); }
.card[data-left="3"] .card-back, .card[data-left="3"] .card-front { box-shadow: 2px 2px 0 #cdb98f, 4px 4px 0 #b9a47a, 4px 7px 0 rgba(0,0,0,.45); }
.card[data-left="4"] .card-back, .card[data-left="4"] .card-front { box-shadow: 2px 2px 0 #cdb98f, 4px 4px 0 #b9a47a, 6px 6px 0 #a58f66, 6px 9px 0 rgba(0,0,0,.45); }
.card[data-left="5"] .card-back, .card[data-left="5"] .card-front { box-shadow: 2px 2px 0 #cdb98f, 4px 4px 0 #b9a47a, 6px 6px 0 #a58f66, 8px 8px 0 #917b53, 8px 11px 0 rgba(0,0,0,.45); }
/* 道具牌的牌背：蓋著也認得出來（紫底金星；不是任何政黨的顏色） */
.card.itemback .card-back, .deal-ghost.itemback { background-color: #6a45b8; border-color: #e9dcff; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,.09) 6px 12px); }
.card.itemback .stamp { border-color: #ffe08a; color: #ffe08a; opacity: 1; }
.card.itemback .stamp span { font-size: 0; }
.card.itemback .stamp span::before { content: '★'; font-size: calc(var(--cw, 96px) * .28); }
/* 開場發牌 */
.grid { position: relative; }
.card.predeal { visibility: hidden; }
.deal-ghost, .deal-deck i { position: absolute; border-radius: var(--radius); background-color: #f3e7cf; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,.03) 6px 12px); border: 2.5px solid #fff3d6; box-shadow: 0 3px 0 rgba(0,0,0,.45); pointer-events: none; }
.deal-ghost { z-index: 5; animation: dealFly .25s cubic-bezier(.3,.9,.4,1) both; }
.card.dealfly { z-index: 4; animation: dealFly .25s cubic-bezier(.3,.9,.4,1) both; }
@keyframes dealFly { from { transform: translate(var(--dx), var(--dy)) rotate(-14deg) scale(.9); } }
.deal-deck { position: absolute; z-index: 6; pointer-events: none; transition: opacity .2s; }
.deal-deck i { inset: 0; box-shadow: 2px 2px 0 #cdb98f, 4px 4px 0 #b9a47a, 6px 6px 0 #a58f66, 6px 9px 0 rgba(0,0,0,.45); }
.deal-deck.riffle i:first-child { animation: riffleL .38s ease-in-out 2; }
.deal-deck.riffle i:last-child { animation: riffleR .38s ease-in-out 2; }
@keyframes riffleL { 50% { transform: translateX(-62%) rotate(-10deg); } }
@keyframes riffleR { 50% { transform: translateX(62%) rotate(10deg); } }
.card-front .item-face { flex: 1; display: grid; place-items: center; background: #fff6dc; min-height: 0; }
.card-front .item-face .item-ic { width: 70%; height: auto; }
.item-face.hint { padding: 0; font-size: inherit; color: inherit; }   /* 全站 .hint（淡色提示文字）有 padding-top 24px，會把小燈泡牌的圖往下推 */
.card-front .item-face .item-emoji { font-size: calc(var(--cw) * .5); line-height: 1; }
/* 道具牌翻開：全部同一個紫色底（跟牌背同色系），一眼就知道「這是道具」，跟候選人牌的政黨色分開 */
.card-front .item-face { background: radial-gradient(circle at 50% 42%, #b79cf0, #6a45b8 78%); }
.card-front:has(.item-face) { border-color: #4a2e8f; }
.card-front:has(.item-face) .namebar { background: #efe6ff; } .card-front:has(.item-face) .namebar b { color: #4a2e8f; }
.item-face.wild { background: conic-gradient(from 200deg at 50% 45%, #ff9aa2, #ffd98a, #a8e6a1, #9ad0ff, #c9a8f5, #ff9aa2); }
/* loading 蓋章 */
.load-stamp { position: absolute; z-index: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px; display: grid; place-items: center; border: 4px solid #e2463a; border-radius: 50%; color: #e2463a; font: 900 34px/1 system-ui, sans-serif; font-style: normal; pointer-events: none; opacity: .9; transform: rotate(var(--r, 0deg)); animation: stampIn .22s cubic-bezier(.2,1.6,.4,1) backwards; transition: opacity .3s; }
.load-stamp.out { opacity: 0; }
.loading > :not(.load-stamp) { position: relative; z-index: 1; }
.loading > .loading-tip { position: absolute; }
@keyframes stampIn { from { transform: rotate(var(--r, 0deg)) scale(2.2); opacity: 0; } }

.card.deal { animation: dealIn .32s cubic-bezier(.2,1.4,.4,1) backwards; }
@keyframes dealIn { 0% { transform: translateY(-26px) scale(.7) rotate(-8deg); opacity: 0; } }
.card.nudge { animation: nudge .7s ease; }
@keyframes nudge { 20% { transform: rotate(-5deg) scale(1.05); } 45% { transform: rotate(5deg) scale(1.05); } 70% { transform: rotate(-3deg); } }

.fly-layer { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.fly-card { position: fixed; border-radius: var(--radius); background: #fffaf0; border: 2.5px solid #2b2420; box-shadow: 0 6px 0 rgba(0,0,0,.35); overflow: hidden; display: grid; place-items: center; will-change: transform; }
.fly-card .avatar { width: 100%; height: 100%; }
.fly-card .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fly-card.token span { font-size: 44px; }

.banner { position: fixed; left: 50%; top: 42%; z-index: 80; translate: -50% -50%; padding: 12px 28px; border-radius: 18px; font-size: 40px; font-weight: 900; white-space: nowrap;
  background: #fffaf0; color: #2b2420; border: 4px solid #2b2420; box-shadow: 0 8px 0 rgba(0,0,0,.4); pointer-events: none; }
.banner.in { animation: bannerIn .5s cubic-bezier(.2,1.8,.4,1); }
@keyframes bannerIn { 0% { transform: scale(.2) rotate(-12deg); opacity: 0; } }
.pop-text.round { font-size: 26px; color: #ffe08a; }
.bubble.built q { font-size: 15px; }
.bubble.built .src { margin: 4px 0 0; font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .card.deal, .card.nudge, .build-label.show, .banner.in { animation-duration: .01s; } }

/* ---------- 政見三消 ---------- */
.grid[hidden], .m3[hidden], .build-score[hidden] { display: none; }
.m3 { position: relative; margin: auto; clip-path: inset(0 -12px -12px -12px); touch-action: none; user-select: none; -webkit-user-select: none; }
.m3-tile { position: absolute; left: 0; top: 0; width: var(--ts); height: var(--ts); padding: 3px; border: none; background: none; transition: transform .17s cubic-bezier(.3,.9,.4,1.1); touch-action: none; -webkit-touch-callout: none; }
.m3-tile .face { display: block; width: 100%; height: 100%; border-radius: 12px; overflow: hidden; background: var(--pc); border: 3px solid var(--pc); box-shadow: 0 3px 0 rgba(0,0,0,.45); }
.m3-tile .face img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; transform: scale(1.12) translateY(-3%); }   /* 臉放大一點，下巴留在色帶上面 */
.m3-tile .face img.px { transform: none; }
.m3-tile .face .ph { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 900; font-size: 22px; color: #2b2420; }
.m3-tile .face i { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; font-style: normal; font-size: 7px; font-weight: 800; line-height: 1; padding: 1px 0 1.5px; text-align: center; background: var(--pc); color: #fff; white-space: nowrap; pointer-events: none; }   /* 黨派：框內底部一整條扁色帶 */
.m3-tile.sel .face { outline: 3px solid #fff; box-shadow: 0 0 0 5px rgba(255,224,138,.9), 0 3px 0 rgba(0,0,0,.45); }
/* 被消掉的方塊彈一下。--hd＝這一格晚多久起跳（骨牌、波浪的先後，由 app.js 設） */
.m3-tile.hit .face { animation: m3Hit .26s cubic-bezier(.3,1.5,.5,1) var(--hd, 0ms) forwards; }
@keyframes m3Hit { 45% { transform: translateY(-8px) scale(1.16); filter: brightness(1.2); } 100% { transform: scale(1.05); filter: brightness(1.1); } }
/* 補牌落下：越掉越快；落地壓扁一下再彈回 */
.m3-tile.fall { transition: transform .2s cubic-bezier(.5,0,1,.7); }
.m3-tile.land .face { animation: m3Land .18s ease-out; transform-origin: 50% 100%; }
@keyframes m3Land { 0% { transform: scale(1.12,.86); } 60% { transform: scale(.96,1.05); } 100% { transform: none; } }
/* 炸開：一圈漣漪從方塊後面擴散（z-index 比方塊低，不擋臉） */
.m3-ripple { position: absolute; z-index: -1; pointer-events: none; box-sizing: border-box; border-radius: 50%; border: 6px solid rgba(255,235,160,.95); animation: m3Ripple .44s ease-out forwards; }
@keyframes m3Ripple { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .m3-tile.hit .face { animation-delay: 0ms; } .m3-tile.land .face { animation: none; } }
.m3-tile.out { transition: transform .17s ease, opacity .17s ease; opacity: 0; }
.m3-tile.out .face { transform: scale(.3); transition: transform .17s ease; }
.m3-tile.no .face { animation: shake .19s ease, m3Sad .8s ease .19s; border-color: #d8463b; }
/* 換了不成立：頭垂下去、臉色變灰一下再恢復 */
@keyframes m3Sad { 0% { transform: none; filter: none; } 25% { transform: translateY(4px) rotate(-5deg) scale(.94); filter: grayscale(.85) brightness(.88); } 70% { transform: translateY(3px) rotate(-3deg) scale(.95); filter: grayscale(.7) brightness(.9); } 100% { transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { .m3-tile.no .face { animation: shake .19s ease; } }
.m3-tile.nudge .face { animation: nudge .7s ease; }
.m3-tile.deal { animation: m3Deal .3s cubic-bezier(.2,1.4,.4,1) backwards; }
@keyframes m3Deal { 0% { opacity: 0; scale: .4; } }
/* 連線：一圈空心的光框圈住這幾格，從起點畫到終點（.rev＝反方向）。框在外圍，臉看得到（11/22 起，取代橫過臉的亮線） */
.m3-link { position: absolute; z-index: 2; pointer-events: none; box-sizing: border-box; border: 4px solid #fff; border-radius: 16px;
  box-shadow: 0 0 10px 3px rgba(255,224,138,.9), inset 0 0 8px rgba(255,224,138,.7); animation: m3LinkH .44s ease-out forwards; }
.m3-link.h.rev { animation-name: m3LinkHr; } .m3-link.v { animation-name: m3LinkV; } .m3-link.v.rev { animation-name: m3LinkVr; }
@keyframes m3LinkH { 0% { clip-path: inset(-14px 100% -14px -14px); } 60% { clip-path: inset(-14px); opacity: 1; } 100% { clip-path: inset(-14px); opacity: 0; } }
@keyframes m3LinkHr { 0% { clip-path: inset(-14px -14px -14px 100%); } 60% { clip-path: inset(-14px); opacity: 1; } 100% { clip-path: inset(-14px); opacity: 0; } }
@keyframes m3LinkV { 0% { clip-path: inset(-14px -14px 100% -14px); } 60% { clip-path: inset(-14px); opacity: 1; } 100% { clip-path: inset(-14px); opacity: 0; } }
@keyframes m3LinkVr { 0% { clip-path: inset(100% -14px -14px -14px); } 60% { clip-path: inset(-14px); opacity: 1; } 100% { clip-path: inset(-14px); opacity: 0; } }
.build-score { grid-column: 2; justify-self: center; display: flex; align-items: baseline; gap: 3px; color: #fff; text-shadow: 0 2px 0 #000; }
.build-score b { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.build-score small { font-size: 11px; color: #c9b8ea; }
.screen.game.build .build-label { position: absolute; left: 50%; top: 100%; translate: -50% 4px; z-index: 3; }
.pop-text.big { font-size: 30px; color: #ffe08a; }
.pending { margin: 0; font-size: 14px; color: #6b625a; } .pending a { color: #3b6fd6; }
/* 候選人原聲片段的字幕與出處 */
.src.voice { line-height: 1.45; }
.voice-link { color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
/* 像素頭試看（?pixel）：放大時保持硬邊，整顆頭都看得到 */
img.px { image-rendering: pixelated; object-fit: contain !important; }
.m3-tile .face:has(img.px) { border-radius: 6px; }

/* ---------- 卡片表情（Issue #16）：沒有表情圖時的替代效果 ---------- */
.card-front .avatar, .fly-card .avatar { position: relative; }
/* 牌面：頭像框自己裁切、圖不撐高度，名字列固定高度不被壓縮（iPhone 上名字下緣曾被切掉） */
.card-front .avatar { overflow: hidden; }
.card-front .avatar > img { position: absolute; inset: 0; }
.card-front .namebar { flex: none; }
.mood-fx { position: absolute; inset: 0; pointer-events: none; }
.mood-fx svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mood-fx.happy { background: radial-gradient(circle at 50% 40%, rgba(255,236,150,.0) 40%, rgba(255,214,90,.38) 100%); }
.mood-fx.happy .sp { fill: #fff; stroke: #f2b01e; stroke-width: 2.5; stroke-linejoin: round; transform-box: fill-box; transform-origin: center; animation: moodTwinkle .5s ease-in-out infinite alternate; }
.mood-fx.happy .s2 { animation-delay: .22s; }
.mood-fx.happy .bl { fill: rgba(255,120,130,.6); }
@keyframes moodTwinkle { from { transform: scale(.55) rotate(-12deg); opacity: .6; } to { transform: scale(1.15) rotate(10deg); opacity: 1; } }
.mood-fx.angry { background: linear-gradient(rgba(224,45,45,.34), rgba(224,45,45,.1) 62%, transparent); }
.mood-fx.angry .vein { fill: none; stroke: #e02d2d; stroke-width: 6; stroke-linecap: round; }
.mood-fx.angry .vein path { animation: moodVein .28s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes moodVein { from { stroke-width: 5; opacity: .75; } to { stroke-width: 8; opacity: 1; } }
/* 開心：小跳兩下；生氣：往對方那邊歪。用獨立的 rotate／translate 屬性，才不會跟搖晃動畫的 transform 互搶 */
.card.happy .card-front .avatar > img, .fly-card.happy .avatar > img { animation: moodHop .42s ease 2; }
/* 表情動畫一邊動一邊放大，圖永遠蓋滿頭像框，左右下緣不會露出底色（白邊） */
.card.happy .card-front .avatar > img, .fly-card.happy .avatar > img { transform-origin: 50% 0; }
@keyframes moodHop { 40% { transform: translateY(-6%) scale(1.12); } }
.card.angry { transition: rotate .16s ease, translate .16s ease; }
.card.angry.lean-r { rotate: 7deg; translate: 5% 0; }
.card.angry.lean-l { rotate: -7deg; translate: -5% 0; }
.card.angry .card-front .avatar > img { animation: moodFume .14s linear infinite alternate; }
@keyframes moodFume { from { transform: translateX(-1.5%) scale(1.06); } to { transform: translateX(1.5%) scale(1.06); } }

/* ---------- 手機：畫面固定（Issue #21）---------- */
html, body { touch-action: manipulation; overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* 遊戲進行中：不能捏合、不能拖動整頁、不能下拉重新整理 */
body.zoom-lock, body.zoom-lock #app, .screen.game { touch-action: none; }
body.zoom-lock { overflow: hidden; }
/* 例外：其他模式的政見對照區文字多時要能上下捲 */
.screen.game .talk { touch-action: pan-y; }
/* 長按不要跳出選字、放大鏡、圖片選單 */
.screen.game, .screen.game *, .btn, .choice, .icon, .hero, .hcard, .fly-layer, .showcase {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.screen.game img, .fly-layer img, .hero img { -webkit-user-drag: none; pointer-events: none; }

/* ---------- 翻牌版手感機制（public/js/feel.js，預設開啟）---------- */
.feel-hud { display: grid; gap: 6px; }
.feel-hud[hidden] { display: none; }
.feel-energy { height: 10px; border-radius: 999px; background: rgba(255,255,255,.14); border: 2px solid #2b2420; overflow: hidden; }
.feel-energy i { display: block; height: 100%; width: calc(var(--v, 0) * 100%); border-radius: 999px; background: linear-gradient(90deg, #ffe08a, #ff9d2e); transition: width .25s ease; }
.feel-energy.fever i { background: linear-gradient(90deg, #fff, #ffe08a, #ff5b3d); transition: width .2s linear; animation: feelGlow .4s ease-in-out infinite alternate; }
@keyframes feelGlow { to { filter: brightness(1.5); } }
.feel-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; }
.feel-items { display: flex; gap: 6px; }
.feel-item { width: 46px; height: 32px; border-radius: 10px; border: 2.5px solid #2b2420; background: #fffaf0; color: #2b2420; font-size: 12px; padding: 0; box-shadow: 0 3px 0 rgba(0,0,0,.35); touch-action: manipulation; }
.feel-item.empty { background: rgba(255,255,255,.08); border-style: dashed; border-color: #6d5aa6; box-shadow: none; display: inline-block; }
.feel-item.peek { background: #ffe08a; } .feel-item.freeze { background: #a9d8ff; } .feel-item.hint { background: #b8f0b0; }
.feel-item.new { animation: bumpBuild .45s cubic-bezier(.2,1.8,.4,1); }
.feel-item:active { transform: translateY(2px); box-shadow: none; }
.feel-goal { font-size: 12px; font-weight: 700; color: #ffe08a; white-space: nowrap; }
.pop-text.feel { font-size: 16px; } .pop-text.feel.good { color: #9af0a0; } .pop-text.feel.bad { color: #ff8a7a; }
.feel-title { color: #ffe08a; font-size: 18px; }
.card.peek .card-inner { transform: rotateY(180deg); }
.card.peek .card-front { opacity: .82; border-style: dashed; }
.card.hinted { animation: nudge .6s ease 3; }
.card.hinted .card-back { box-shadow: 0 0 0 4px #b8f0b0, 0 0 18px rgba(150,240,150,.9); }
.hud-mode.clock.frozen { color: #a9d8ff; text-shadow: 0 0 12px rgba(120,190,255,.9), 0 2px 0 #000; }
body.fever.stage #app { background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255,190,60,.55), transparent 70%), radial-gradient(ellipse 120% 80% at 50% 110%, #8a3a2a 0%, transparent 60%), linear-gradient(#4a2440, #2a1238); }
body.fever .screen.game.build .game-planet { opacity: .85; }
body.fever .hud-mode.clock { color: #ffe08a; }
/* 里程碑：星球一階一階變亮 */
body[data-stage="1"] .screen.game.build .game-planet { opacity: .66; }
body[data-stage="2"] .screen.game.build .game-planet { opacity: .74; }
body[data-stage="3"] .screen.game.build .game-planet { opacity: .82; filter: saturate(1.15); }
body[data-stage="4"] .screen.game.build .game-planet { opacity: .9; filter: saturate(1.3) brightness(1.08); }
/* 實驗的 HUD 會多佔高度，牌要讓一點 */
.screen.game.build:has(.feel-hud:not([hidden])) .grid { --cw: min(calc((min(100vw, 480px) - 32px - 3 * var(--gap)) / 4), calc((100dvh - 352px) / var(--rows) * 0.75 - var(--gap))); }
.screen.game.build:has(.feel-hud:not([hidden])) .build-label { display: none; }

/* ---------- 政見三消：特殊方塊（public/js/feel3.js 的 ?sp）---------- */
.m3-tile .face { position: relative; }
.m3-tile[data-sp] .face { box-shadow: 0 0 0 2px #fff, 0 0 12px 3px rgba(255,224,138,.95), 0 3px 0 rgba(0,0,0,.45); animation: m3SpGlow .9s ease-in-out infinite alternate; }
/* 記號一律畫在方塊邊緣、縮小，不蓋到臉也不蓋到底部的黨派色帶（美術 11/22：原本記號下半截被色帶蓋掉、角落被圓角切掉）。
   --band＝黨派色帶的高度（7px 字＋上下 2.5px）；道具說明頁的示意方塊沒有色帶，設成 0。橫掃＝左右箭頭；直掃＝上下箭頭；十字＝四個方向；炸開＝一圈虛線框 */
.m3-tile .face { --band: 10px; }
.m3-tile[data-sp] .face::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: #fff; }
.m3-tile[data-sp="h"] .face::before { bottom: var(--band); clip-path: polygon(10% 41%, 0 50%, 10% 59%, 10% 41%, 90% 41%, 100% 50%, 90% 59%, 90% 41%); }
.m3-tile[data-sp="v"] .face::before { bottom: var(--band); clip-path: polygon(41% 10%, 50% 0, 59% 10%, 41% 10%, 41% 90%, 50% 100%, 59% 90%, 41% 90%); }
/* 十字：四個三角形用一條線串起來，串接的線要原路走回去（不圍出面積），不然中間會被塗白、看起來像碎片（#148） */
.m3-tile[data-sp="cross"] .face::before { bottom: var(--band); clip-path: polygon(10% 41%, 0 50%, 10% 59%, 10% 41%, 41% 10%, 50% 0, 59% 10%, 41% 10%, 90% 41%, 100% 50%, 90% 59%, 90% 41%, 59% 90%, 50% 100%, 41% 90%, 59% 90%, 90% 41%, 41% 10%); }
/* 同色全消：一圈會轉的金白光框 */
.m3-tile[data-sp="color"] .face::before { background: conic-gradient(from var(--spin, 0deg), #fff, #ffd24a, #fff, #ff9d2e, #fff, #ffd24a, #fff); bottom: var(--band); padding: 3px; border-radius: 8px 8px 3px 3px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: m3Spin 1.2s linear infinite; }
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes m3Spin { to { --spin: 360deg; } }
/* 炸開：自己畫的虛線（瀏覽器內建的 dashed 不能調間隔，線一細就密得可怕）。段長與間隔用比例（段 15%、一個循環 28.33%），
   每一邊剛好「3 個循環＋1 段」：四角都是 L 形、每邊中間一段，方塊大小不同（盤面、道具說明頁）樣子都一樣。粗 2px（美術 11/22） */
.m3-tile[data-sp="bomb"] .face::before { --dash: repeating-linear-gradient(90deg, #fff 0 15%, transparent 15% 28.33%); --dash-v: repeating-linear-gradient(180deg, #fff 0 15%, transparent 15% 28.33%);
  inset: 3px 3px calc(var(--band) + 2px) 3px; background: var(--dash) left top / 100% 2px no-repeat, var(--dash) left bottom / 100% 2px no-repeat, var(--dash-v) left top / 2px 100% no-repeat, var(--dash-v) right top / 2px 100% no-repeat; }
.m3-tile.born .face { animation: m3Born .4s cubic-bezier(.2,1.8,.4,1); }
@keyframes m3SpGlow { to { filter: brightness(1.18); } }
@keyframes m3Born { 0% { transform: scale(.6); filter: brightness(2.2); } 60% { transform: scale(1.22); } 100% { transform: scale(1); } }
.m3-beam { position: absolute; z-index: 3; pointer-events: none; }
.m3-beam::after { content: ''; position: absolute; background: #fff; border-radius: 999px; box-shadow: 0 0 22px 10px rgba(255,224,138,.95); }
.m3-beam.h::after { left: 0; right: 0; top: calc(50% - 7px); height: 14px; animation: m3BeamH .45s ease-out forwards; }
.m3-beam.v::after { top: 0; bottom: 0; left: calc(50% - 7px); width: 14px; animation: m3BeamV .45s ease-out forwards; }
.m3-beam.bomb::after { inset: 30%; background: none; border: 8px solid #fff; border-radius: 50%; animation: m3BeamRing .45s ease-out forwards; }
@keyframes m3BeamH { 0% { transform: scaleX(.05); opacity: 1; } 55% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1) scaleY(.2); opacity: 0; } }
@keyframes m3BeamV { 0% { transform: scaleY(.05); opacity: 1; } 55% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1) scaleX(.2); opacity: 0; } }
@keyframes m3BeamRing { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(2.4); opacity: 0; } }
.feel-item.shuffle { background: #ffd0a8; } .feel-item.spark { background: #ffe08a; }
@media (prefers-reduced-motion: reduce) { .m3-tile[data-sp] .face { animation: none; } }

/* ---------- Fever 冒火：能量條上方一排火焰（翻牌版與三消共用，body.fever 時出現）---------- */
.feel-hud { position: relative; }
.feel-hud::before, .feel-hud::after { content: ''; position: absolute; left: -6px; right: -6px; top: -38px; height: 46px; pointer-events: none; opacity: 0; transition: opacity .25s ease; transform-origin: bottom; mix-blend-mode: screen;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 48' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='1' x2='0' y2='0'%3E%3Cstop offset='0' stop-color='%23fff3a0'/%3E%3Cstop offset='.35' stop-color='%23ffb02e'/%3E%3Cstop offset='.75' stop-color='%23ff5b3d'/%3E%3Cstop offset='1' stop-color='%23ff5b3d' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M0 48 C0 34 6 30 8 14 C12 26 18 28 20 40 C22 28 28 20 30 2 C36 18 42 26 42 40 C45 30 50 26 52 18 C56 28 60 30 62 40 C64 32 68 28 70 22 C74 32 80 36 80 48 Z'/%3E%3C/svg%3E") repeat-x left bottom / 80px 100%; }
.feel-hud::after { background-size: 54px 78%; filter: brightness(1.25); }
body.fever .feel-hud::before { opacity: .95; animation: fireDrift .9s linear infinite, fireFlick .23s ease-in-out infinite alternate; }
body.fever .feel-hud::after { opacity: .8; animation: fireDriftBack .7s linear infinite, fireFlick .31s ease-in-out infinite alternate-reverse; }
body.fever .feel-energy { box-shadow: 0 0 14px 4px rgba(255,120,40,.85); }
@keyframes fireDrift { to { background-position-x: 80px; } }
@keyframes fireDriftBack { to { background-position-x: -54px; } }
@keyframes fireFlick { from { transform: scaleY(.8); } to { transform: scaleY(1.15); } }
@media (prefers-reduced-motion: reduce) { body.fever .feel-hud::before, body.fever .feel-hud::after { animation: none; } }
/* 配對時的漫畫式特效（#36，moodfx.js）：獨立的全畫面圖層，可以超出牌的邊框 */
.mfx-layer { position: fixed; inset: 0; z-index: 72; pointer-events: none; overflow: hidden; }
.mfx-box { position: fixed; }
.mfx-box > * { position: absolute; }
.mfx-box svg { overflow: visible; display: block; }
.mfx-vein path, .mfx-scribble path:not(.bg) { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mfx-vein .o { stroke: #fff; stroke-width: 11; }
.mfx-vein .i { stroke: #e02d2d; stroke-width: 6; }
.mfx-steam circle { fill: #fff; stroke: #2b2420; stroke-width: 3.5; }
.mfx-steam .c { stroke: none; }
.mfx-scribble .bg { fill: #5b5470; }
.mfx-scribble .o path { stroke: #fff; stroke-width: 8; }
.mfx-scribble .i path { stroke: #1d1630; stroke-width: 3.4; }
.mfx-drop path { fill: #7fc4ff; stroke: #2b2420; stroke-width: 2.5; }
.mfx-red { border-radius: 10px; background: linear-gradient(rgba(224,45,45,.45), rgba(224,45,45,.05) 70%); }
.mfx-star path { fill: #ffd23f; stroke: #2b2420; stroke-width: 2.6; stroke-linejoin: round; }
.mfx-heart path { fill: #ff6f91; stroke: #2b2420; stroke-width: 3; stroke-linejoin: round; }
.mfx-note ellipse { fill: #2b2420; }
.mfx-note .s { fill: none; stroke: #2b2420; stroke-width: 4; stroke-linecap: round; }
.mfx-conf { width: 8px; height: 12px; border-radius: 2px; }
.mfx-glow { border-radius: 22px; background: radial-gradient(closest-side, rgba(255,226,120,0) 62%, rgba(255,226,120,.85) 80%, rgba(255,226,120,0) 100%); }   /* 只有外圈亮，不蓋到臉 */
.mfx-rays line { stroke: #ffd23f; stroke-width: 5; stroke-linecap: round; }

/* 首頁小星球：藍天＋綠色星球是刻意的——讓藍、綠兩個顏色都公平地出現在畫面上，不偏任何一方（11/20 美術決定）。
   原本是綠色星球配米色底，只有綠色會被聯想成政黨色。飄動的扁平白雲由 sky.js 隨機產生。 */
.planet { background: linear-gradient(#6ec3f5 0%, #a9dcfb 55%, #dff3ff 100%); }
.sky-clouds { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky-clouds img { position: absolute; left: 0; display: block; height: auto; user-select: none; -webkit-user-drag: none; }
.planet .hero-hint { color: #2d5f86; }

/* ===== 立體糖果風格（11/20 美術選 B）：膠囊按鈕、底下一層厚度、柔和漸層，跟 3D 圖示同一種質感 ===== */
/* 配色：奶油黃（主）＋焦糖（骰子）；避開這次候選人用到的政黨／競選色（藍、綠、青綠、橘、紫、桃紅、紅），11/20 美術 */
:root { --candy-main: linear-gradient(#ffe27a, #ffc928); --candy-main-edge: #c9971a; --candy-main-ink: #5a4300; --candy-dice: linear-gradient(#e8b47a, #c98a4b); --candy-dice-edge: #94612f; --candy-cream-edge: #e2d7c4; --candy-ink: #3a3a5a; }
.candy-start { display: block; width: 100%; border: 0; border-radius: 999px; padding: 16px; font-size: 21px; font-weight: 900; letter-spacing: .12em; color: var(--candy-main-ink);
  background: var(--candy-main);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.55), inset 0 -4px 0 rgba(150,110,0,.15), 0 6px 0 var(--candy-main-edge), 0 10px 18px rgba(201,151,26,.3); transition: transform .08s, box-shadow .08s; }
.candy-start:active { transform: translateY(4px); box-shadow: inset 0 3px 0 rgba(255,255,255,.55), inset 0 -4px 0 rgba(150,110,0,.15), 0 2px 0 var(--candy-main-edge), 0 4px 8px rgba(201,151,26,.25); }
.nick-line { display: flex; justify-content: center; }
.nick-chip { display: inline-flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 5px 5px 5px 6px; box-shadow: 0 3px 0 var(--candy-cream-edge), 0 6px 12px rgba(0,0,0,.06); color: var(--candy-ink); }
/* 暱稱頭像（public/js/avatar.js 由暱稱畫出來的） */
.nick-av { display: block; width: 30px; height: 30px; flex: none; }
.nick-av svg { display: block; }
.nick-lab { font-size: 11px; font-weight: 800; color: #7a6a50; background: #f1ebe0; border-radius: 999px; padding: 3px 8px; }
.nick-chip b { font-size: 14px; }
/* 換暱稱的拉霸演出（app.js 的 spinNick）：每一格只露出一行，裡面的長條往上捲 */
#nick { display: inline-flex; align-items: center; white-space: pre; line-height: 1.5; }
.reel { display: inline-block; height: 1.5em; overflow: hidden; transition: width .16s ease-out; }
.reel-strip { display: flex; flex-direction: column; align-items: center; will-change: transform; }
.reel-strip span { height: 1.5em; flex: none; }
.reroll { width: 32px; height: 32px; border: 0; border-radius: 50%; padding: 0; display: grid; place-items: center; background: var(--candy-dice); box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 3px 0 var(--candy-dice-edge); }
.reroll svg { width: 20px; height: 20px; }
.reroll:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 1px 0 var(--candy-dice-edge); }
.back-btn { width: 42px; height: 42px; border: 0; border-radius: 50%; padding: 0; display: grid; place-items: center; background: #fff; color: var(--candy-ink); box-shadow: 0 4px 0 var(--candy-cream-edge), 0 6px 12px rgba(0,0,0,.08); }
.back-btn svg { width: 20px; height: 20px; }
.back-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--candy-cream-edge); }
.screen:not(#screen-result) .bar h2 { color: var(--candy-ink); font-weight: 900; }   /* 結算頁是深色底，不套 */
.board-pill { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 999px; padding: 6px 16px 6px 6px; font-size: 14px; font-weight: 800; color: var(--candy-ink); background: #fff; box-shadow: 0 3px 0 var(--candy-cream-edge); }
.board-pill img { width: 26px; height: 26px; }
.board-pill:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--candy-cream-edge); }

/* 過場：白天 → 選舉之夜（app.js nightfall） */
.nightfall { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.nightfall .nf-day { position: absolute; inset: 0; background: linear-gradient(#bfe6ff, #eaf6ff 45%, #f7f2e8 80%); }
.nightfall .nf-night { position: absolute; inset: 0; opacity: 0; background: linear-gradient(#3b2a6b, #1d1440); }   /* 跟 .loading 同一個漸層，交接時顏色不會跳 */
.nightfall .nf-night i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: #fff6d8; box-shadow: 0 0 6px #fff3c0; opacity: 0; animation: nfStar .5s ease-out var(--d) forwards; animation-delay: calc(.25s + var(--d)); }
@keyframes nfStar { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }

/* ===== 選擇玩法：一次一張大卡、左右滑、白霧玻璃（11/20 美術選 C） ===== */
#screen-single { background: linear-gradient(#bfe6ff, #eaf6ff 45%, #f7f2e8 85%); gap: 6px; }
.mode-stage { flex: 1; position: relative; display: flex; align-items: center; min-height: 0; margin: 0 -16px; overflow: hidden; touch-action: pan-y; }
.mode-track { position: relative; width: 100%; height: calc(min(470px, 64vh) + 30px); height: calc(min(470px, 64dvh) + 30px); touch-action: pan-y; user-select: none; -webkit-user-select: none; }   /* 橫向滑動交給程式，直向捲動留給瀏覽器 */
.mode-slide { position: absolute; left: 50%; top: 12px; width: min(270px, 72vw); height: min(470px, 64vh); height: min(470px, 64dvh); cursor: grab; border-radius: 30px; display: flex; flex-direction: column; align-items: center; padding: 14px 14px 12px;
  background: linear-gradient(160deg, #fff 0%, #fff 38%, rgba(255,255,255,.78) 100%); border: 2px solid #fff;
  box-shadow: 0 6px 0 rgba(160,190,215,.55), 0 12px 24px rgba(80,120,160,.14); }
/* 場景插圖：圓角方塊、各玩法自己的底色（11/21 美術：全部 2D 漫畫風，跟 Q 版頭像同一種畫法） */
.mode-scene { flex: 1; width: 100%; position: relative; display: grid; place-items: center; min-height: 0; border-radius: 22px; overflow: hidden; }
.mode-scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 120%, rgba(255,255,255,.35), transparent 60%), repeating-linear-gradient(45deg, rgba(255,255,255,.07) 0 10px, transparent 10px 20px); }
.k1 .mode-scene { background: radial-gradient(circle at 50% 45%, #fff3c4, #ffc94a 60%, #ff9f1c); }
.k2 .mode-scene { background: linear-gradient(110deg, #3D6CD6 0 50%, #3DAA57 50% 100%); }   /* 左藍（蔣）右綠（沈），各占一半 */
.k3 .mode-scene { background: linear-gradient(160deg, #c08cf0, #8a5ae0); }
.mode-rays { position: absolute; inset: -50%; background: repeating-conic-gradient(rgba(255,255,255,.3) 0 10deg, transparent 10deg 20deg); }
.mode-tiles { position: absolute; inset: -30px; rotate: -12deg; opacity: .3;   /* 底紋：一格一格的白色圓角方塊 */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Crect x='4' y='4' width='36' height='36' rx='9' fill='%23fff'/%3E%3C/svg%3E") 0 0 / 44px 44px; }
.mode-pic { position: relative; z-index: 1; width: 72%; max-height: 82%; object-fit: contain; filter: drop-shadow(0 10px 10px rgba(0,0,0,.2)); }
.mode-vs { position: absolute; z-index: 2; left: 50%; top: 30%; translate: -50% -50%; width: 62%; max-height: 40%; object-fit: contain; rotate: -8deg; filter: drop-shadow(0 4px 0 rgba(0,0,0,.15)); }
.mode-head { position: absolute; z-index: 1; bottom: -4px; width: 74%; filter: drop-shadow(0 6px 6px rgba(0,0,0,.2)); }
.mode-head.l { left: -6%; } .mode-head.r { right: -6%; }
/* 只有 VS 會動（輕輕一縮一放）；候選人不動（11/21 美術：動的東西太多） */
.mode-vs { animation: vsPulse 1.8s ease-in-out infinite; }
@keyframes vsPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.sway-cup { transform-origin: 50% 85%; animation: swayCup 3.2s ease-in-out infinite; }
.sway-tiles { transform-origin: 50% 70%; animation: swayTiles 3.8s ease-in-out infinite; }
@keyframes swayCup { 0%,100% { transform: rotate(-5deg) translateY(0); } 50% { transform: rotate(5deg) translateY(-5px); } }
@keyframes swayTiles { 0%,100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(4deg) scale(1.05); } }
/* 標題：白字粗描邊（遊戲標題字），重點字上色；蔣＝國民黨藍、沈＝民進黨綠（比黨色亮一點，描邊上才看得清楚） */
.mode-ttl { margin-top: 18px; font-size: 34px; line-height: 1.05; font-weight: 900; color: #fff; -webkit-text-stroke: 7px var(--candy-ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--candy-ink); letter-spacing: .02em; white-space: nowrap; }
.mode-ttl em { font-style: normal; color: #ffe27a; }
.mode-ttl em.kmt { color: #5B8BF0; } .mode-ttl em.dpp { color: #4FC46B; }
.mode-sub { flex: none; height: 58px; display: grid; place-items: center; font-size: 15px; font-weight: 800; color: #5a5470; text-align: center; line-height: 1.4; }   /* 一行說明放在標題和按鈕正中間 */
.mode-go { width: 100%; border: 0; border-radius: 999px; padding: 12px; font-size: 17px; font-weight: 900; letter-spacing: .06em; color: var(--candy-main-ink); background: var(--candy-main);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.6), 0 5px 0 var(--candy-main-edge); animation: goPulse 2.2s ease-in-out infinite; }
.k2 .mode-go { animation-delay: .73s; } .k3 .mode-go { animation-delay: 1.46s; }
.mode-go:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255,255,255,.6), 0 2px 0 var(--candy-main-edge); animation: none; }
@keyframes goPulse { 0%,100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.04); filter: brightness(1.1); } }
.mode-rec { min-height: 1.4em; margin-top: 8px; font-size: 12px; font-weight: 700; color: #8a8f9e; text-align: center; }
.mode-arrow { position: absolute; top: 50%; translate: 0 -50%; z-index: 2; width: 36px; height: 36px; border: 0; border-radius: 50%; padding: 0; display: grid; place-items: center; background: #fff; color: var(--candy-ink); box-shadow: 0 3px 0 #d4dde6; }
.mode-arrow svg { width: 16px; height: 16px; }
.mode-arrow.l { left: 8px; } .mode-arrow.r { right: 8px; } .mode-arrow[hidden] { display: none; }
.mode-dots { display: flex; gap: 7px; justify-content: center; }
.mode-dots i { width: 9px; height: 9px; border-radius: 50%; background: #c9d3dc; cursor: pointer; transition: width .2s, background .2s; }
.mode-dots i.on { width: 24px; border-radius: 6px; background: #ffc928; }
.mode-foot { display: flex; justify-content: center; padding: 6px 0 4px; }
@media (prefers-reduced-motion: reduce) { .mode-pic, .mode-go, .mode-vs { animation: none !important; } }
.mode-slide img { -webkit-user-drag: none; pointer-events: none; }

/* ---------- 道具圖示 ---------- */
.feel-item { display: inline-grid; place-items: center; }
.feel-item svg { width: 22px; height: 22px; display: block; pointer-events: none; }
/* 3D 道具圖示（#48）：按鈕放大一點，圖示比按鈕略大、往上凸出一點，看起來像拿在手上的道具 */
.feel-item:not(.empty) { width: 50px; height: 42px; overflow: visible; }
.feel-item.empty { width: 50px; height: 42px; }
.feel-item .item-ic { width: 44px; height: 44px; display: block; pointer-events: none; margin-top: -6px; filter: drop-shadow(0 2px 1px rgba(0,0,0,.18)); }
.feel-hud .feel-item.hint { color: #2b2420; }   /* .hint 在別處是淡色提示文字，這裡要蓋回深色 */

/* ---------- 過場 loading：星球表面貼圖橫向捲動＝星球在轉；字一個一個跳 ---------- */
.loading { position: fixed; inset: 0; z-index: 90; display: grid; place-content: center; justify-items: center; gap: 18px; background: linear-gradient(#3b2a6b, #1d1440); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility 0s linear .2s; }
.loading.on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .12s ease; }
.loading-planet { width: 120px; height: 120px; border-radius: 50%; background: #7cc8a0 url("planet/surface.webp") 0 50% / auto 100% repeat-x; box-shadow: inset -16px -12px 26px rgba(20,10,50,.6), inset 8px 6px 14px rgba(255,255,255,.35), 0 0 34px rgba(255,224,138,.4); animation: loadSpin 3.2s linear infinite; }
@keyframes loadSpin { to { background-position-x: -240px; } }
.loading-text { margin: 0; display: flex; gap: 3px; font-weight: 900; font-size: 20px; letter-spacing: 2px; color: #ffe08a; }
.loading-text span { display: inline-block; animation: loadHop .9s ease-in-out infinite; }
.loading-text span:nth-child(2) { animation-delay: .08s; } .loading-text span:nth-child(3) { animation-delay: .16s; } .loading-text span:nth-child(4) { animation-delay: .24s; }
.loading-text span:nth-child(5) { animation-delay: .32s; } .loading-text span:nth-child(6) { animation-delay: .4s; } .loading-text span:nth-child(7) { animation-delay: .48s; }
/* 過場下方的小提示（js/tips.js）：貼在畫面下緣，不擠到中間的星球 */
.loading-tip { position: absolute; left: 0; right: 0; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); margin: 0 auto; width: min(92%, 420px); padding: 14px 16px 12px; border-radius: 16px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,224,138,.35); color: #fff; text-align: center; }
.loading-tip b { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 1px; color: #3b2a6b; background: #ffe08a; border-radius: 999px; padding: 2px 10px; }
.loading-tip p { margin: 8px 0 0; font-size: 15px; line-height: 1.6; text-wrap: balance; }
.loading-tip small { display: block; margin-top: 6px; font-size: 11px; color: rgba(255,255,255,.65); }
.loading-tip small:empty { display: none; }
.fineprint.copy { margin-top: 2px; opacity: .8; }
@keyframes loadHop { 0%, 55%, 100% { transform: translateY(0); } 28% { transform: translateY(-9px); } }

/* ---------- 時間到之後的回顧：星球放大到上半部、可以轉；下半部是這局每一條政見 ---------- */
.review[hidden] { display: none; }
.screen.game.review .grid, .screen.game.review .m3, .screen.game.review .talk, .screen.game.review .feel-hud, .screen.game.review .build-combo, .screen.game.review .build-score, .screen.game.review .build-label { display: none !important; }
/* 星球的畫布縮到上半部（不是用 transform 縮，那樣球會被畫布邊緣切掉）；app.js 會叫星球重新算鏡頭 */
.screen.game.review .game-planet { opacity: 1 !important; filter: none !important; pointer-events: auto; inset: 56px 0 46% 0; touch-action: none; }
.screen.game.review .game-planet canvas { pointer-events: auto; touch-action: none; }
.screen.game.review .review { position: absolute !important; left: 12px; right: 12px; bottom: 26px; height: 44%; z-index: 2; display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 10px; border-radius: 18px; background: #fffaf0; border: 3px solid #2b2420; box-shadow: 0 5px 0 rgba(0,0,0,.4); color: #2b2420; animation: reviewUp .5s cubic-bezier(.2,1.2,.4,1) backwards; }
@keyframes reviewUp { from { transform: translateY(60%); opacity: 0; } }
.review-title { margin: 0; font-weight: 900; font-size: 15px; text-align: center; }
.review-list { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; align-content: start; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.review-list li { display: grid; grid-template-columns: 24px 30px 1fr; gap: 6px; align-items: start; padding: 7px 8px; border-radius: 12px; background: #f4ecdc; font-size: 14px; line-height: 1.45; animation: reviewIn .22s ease backwards; }
@keyframes reviewIn { from { transform: translateX(-14px); opacity: 0; } }
.review-list li .n { font-weight: 900; font-size: 12px; text-align: center; color: #fff; background: #d8463b; border-radius: 999px; min-width: 22px; padding: 1px 0; margin-top: 4px; }
.review-list li .mini { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; display: block; }
.review-list li .mini img, .review-list li .mini .avatar { width: 100%; height: 100%; object-fit: cover; }
.review-list li small { color: #7a6a58; font-weight: 700; } .review-list li small .ic { width: 16px; height: 16px; vertical-align: -3px; }
.review-list li q { display: block; margin-top: 2px; }
.review-list li .src, .review-list li .pending { margin: 2px 0 0; font-size: 12px; color: #7a6a58; }
.review-list li.hit { animation: reviewHit .9s ease; }
@keyframes reviewHit { 0%, 60% { background: #ffe08a; box-shadow: 0 0 0 3px #d8463b; } }
.screen.game.review .review-done { flex: none; opacity: .8; background: #2b2420; color: #fffaf0; border-color: #2b2420; }
.screen.game.review .build-note { position: absolute !important; left: 0; right: 0; bottom: 6px; z-index: 2; }
.review-done { flex: none; } .screen.game.review .review-done.ready { opacity: 1; animation: bumpBuild .45s cubic-bezier(.2,1.8,.4,1); }

/* ---------- 投票印章：電腦的游標是「卜」印章；點到可以按的東西會蓋一個章（手機也有）---------- */
html { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='12.5' fill='rgba(255,250,240,.75)' stroke='%23d8463b' stroke-width='3'/%3E%3Cpath d='M14 8v16M14 14.5l7 4' fill='none' stroke='%23d8463b' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") 16 16, auto; }
button, a, .card, .m3-tile, [data-go], label, select, summary, .review-list li { cursor: inherit; }
input, textarea { cursor: text; }
.tap-stamp { position: fixed; z-index: 95; width: 46px; height: 46px; margin: -23px 0 0 -23px; pointer-events: none; animation: tapStamp .5s cubic-bezier(.2,1.3,.4,1) forwards; }
.tap-stamp svg { width: 100%; height: 100%; display: block; }
@keyframes tapStamp { 0% { transform: rotate(var(--rot, 0deg)) scale(1.9); opacity: 0; } 22% { transform: rotate(var(--rot, 0deg)) scale(.92); opacity: .95; } 40% { transform: rotate(var(--rot, 0deg)) scale(1); opacity: .95; } 100% { transform: rotate(var(--rot, 0deg)) scale(1); opacity: 0; } }

/* ---------- 首頁「遊戲聲明」按鈕與內容 ---------- */
.notice-btn { align-self: center; display: inline-flex; align-items: center; gap: 6px; margin: 0 auto; padding: 7px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card-face); color: var(--ink); font-weight: 800; font-size: 13px; box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.notice-btn svg { width: 17px; height: 17px; }
.notice-btn:active { transform: translateY(2px); box-shadow: none; }
.notice-box { width: min(400px, 100%); max-height: 86vh; max-height: 86dvh; display: flex; flex-direction: column; }
.notice-body { overflow-y: auto; min-height: 0; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.notice-body p { margin: 0 0 10px; font-size: 14px; line-height: 1.65; }
.notice-body p:last-child { margin-bottom: 0; }
.notice-body .notice-credits { text-align: center; }

/* ===== 選擇玩法頁底部：兩顆大圓角長方形按鈕，圖示往上突出邊框（11/20 美術） ===== */
.mode-foot { display: flex; gap: 12px; padding: 30px 0 4px; justify-content: stretch; }
.mode-btn { flex: 1; position: relative; height: 62px; border: 0; border-radius: 18px; background: #fff; color: var(--candy-ink); padding: 0 6px 0 66px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 0 var(--candy-cream-edge), 0 10px 18px rgba(0,0,0,.06); }
.mode-btn.hot { background: linear-gradient(#fff6cf, #ffe58c); box-shadow: 0 5px 0 var(--candy-main-edge), 0 10px 18px rgba(201,151,26,.2); }
.mode-btn img { position: absolute; left: 0; bottom: 18px; width: 70px; height: 70px; filter: drop-shadow(0 6px 6px rgba(0,0,0,.15)); pointer-events: none; }
.mode-btn b { font-size: 15.5px; font-weight: 900; white-space: nowrap; }
.mode-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--candy-cream-edge); }
.mode-btn.hot:active { box-shadow: 0 2px 0 var(--candy-main-edge); }
.dex-badge { position: absolute; top: -8px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #e0463b; color: #fff; font-style: normal; font-size: 12px; font-weight: 900; line-height: 22px; text-align: center; box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.mode-dots { margin-top: -4px; }

/* ===== 政見圖鑑（dex.js） ===== */
#screen-dex { background: linear-gradient(#bfe6ff, #eaf6ff 45%, #f7f2e8 85%); gap: 10px; }
.glass-card { background: rgba(255,255,255,.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1.5px solid rgba(255,255,255,.9);
  box-shadow: 0 5px 0 rgba(160,190,215,.55), 0 10px 20px rgba(80,120,160,.12); }
.dex-body { display: flex; flex-direction: column; gap: 10px; color: var(--candy-ink); }
.dex-total { border-radius: 22px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.dex-total img { width: 60px; } .dex-total > div { flex: 1; }
.dex-total b { font-size: 30px; font-weight: 900; } .dex-total small { font-size: 13px; font-weight: 700; color: #6a6080; }
.dex-meter { display: block; height: 8px; border-radius: 6px; background: #e6edf3; overflow: hidden; margin-top: 6px; }
.dex-meter i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #ffe27a, #ffc928); }
.dex-seg { display: flex; background: rgba(255,255,255,.6); border-radius: 999px; padding: 4px; }
.dex-seg button { flex: 1; border: 0; background: none; font-size: 14px; font-weight: 800; color: #7a7468; padding: 8px 0; border-radius: 999px; }
.dex-seg button.on { background: #fff; color: var(--candy-ink); box-shadow: 0 2px 0 var(--candy-cream-edge); }
.dex-list { display: flex; flex-direction: column; gap: 8px; }
.dex-row { border-radius: 18px; padding: 8px 12px 8px 8px; display: flex; align-items: center; gap: 10px; text-align: left; color: inherit; width: 100%; }
.dex-row:disabled { opacity: .8; }
/* 新收集到的數量（紅色小圓點，跟首頁圖鑑按鈕上的同一種紅） */
.dex-n { display: inline-block; vertical-align: middle; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e0463b; color: #fff; font-style: normal; font-size: 11px; font-weight: 900; line-height: 18px; text-align: center; }
.dex-av { width: 48px; height: 48px; border-radius: 12px; overflow: hidden; flex: none; display: grid; place-items: center; }
.dex-av img { width: 100%; height: 100%; object-fit: cover; }
.dex-av.dex-ti { background: #fff; } .dex-av.dex-ti img { width: 78%; height: 78%; object-fit: contain; }
.dex-av.big { width: 64px; height: 64px; border-radius: 16px; }
.dex-nm { flex: 1; min-width: 0; } .dex-nm b { font-size: 16px; } .dex-nm small { font-size: 11.5px; color: #8a8f9e; font-weight: 700; margin-left: 5px; }
.dex-cnt { font-size: 13px; font-weight: 900; color: #b07800; white-space: nowrap; } .dex-cnt.muted { color: #a39a8c; font-weight: 700; font-size: 12px; }
.dex-head { border-radius: 22px; padding: 10px 12px; display: flex; align-items: center; gap: 12px; }
.dex-head b { font-size: 20px; } .dex-head small { display: block; font-size: 12px; color: #6a6080; font-weight: 700; }
.dex-head small.got { margin-top: 2px; color: #b07800; font-weight: 900; }
/* 收錄狀態（企劃 11/22）：原聲狀態、個人頁的政見／原聲一行、列表最下面的邀請 */
.dex-vs { display: block; margin-top: 2px; font-size: 11px; font-weight: 700; color: #a39a8c; } .dex-vs.ok { color: #4f8a5b; }
.dex-head small.dex-status { margin-top: 2px; color: #6a6080; }
.dex-ask { margin-left: 6px; color: #2f6fd1; text-decoration: underline; white-space: nowrap; }
.dex-invite { margin: 4px 6px 12px; font-size: 12px; line-height: 1.6; color: #6a6080; text-align: center; } .dex-invite .dex-ask { margin-left: 4px; }
.dex-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }   /* 主題有 8 個，一行放不下：左右滑 */
.dex-chips::-webkit-scrollbar { display: none; }
.dex-chips button { flex: none; border: 0; font-size: 13px; font-weight: 800; padding: 6px 13px; border-radius: 999px; background: rgba(255,255,255,.75); color: #6a6080; }
.dex-chips button.on { background: var(--candy-ink); color: #fff; }
.dex-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dex-st { aspect-ratio: 1; position: relative; border-radius: 18px; overflow: hidden; padding: 0; }
.dex-st > img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; }   /* 正方形縮圖（builds/sq），格子不會被撐高 */
.dex-st.ico > img { inset: 20%; width: 60%; height: 60%; }
.dex-st .tp { position: absolute; left: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.dex-st .tp img { width: 17px; height: 17px; }
.dex-st.new::after { content: 'NEW'; position: absolute; top: 6px; right: 6px; font-size: 9.5px; font-weight: 900; color: #5a4300; background: #ffc928; border-radius: 999px; padding: 1px 6px; }
.dex-st.lock { display: grid; place-items: center; background: repeating-linear-gradient(45deg, #f3e7cf 0 6px, #efe0c2 6px 12px); border: 2px solid rgba(43,36,32,.22); }
.dex-st.lock i { width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--stamp); color: var(--stamp); font-style: normal; font-weight: 900; display: grid; place-items: center; font-size: 18px; opacity: .55; }
.dex-empty { grid-column: 1 / -1; text-align: center; color: #8a8f9e; }
.dex-sheet { position: fixed; inset: 0; z-index: 80; }
.dex-dim { position: absolute; inset: 0; background: rgba(30,40,60,.38); animation: dexFade .2s ease; }
.dex-card { position: absolute; left: 50%; bottom: 0; translate: -50% 0; width: min(100%, 480px); border-radius: 28px 28px 0 0; background: #fffdf8; padding: 12px 20px max(22px, env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(0,0,0,.15); animation: dexUp .28s cubic-bezier(.2,.8,.3,1); color: var(--candy-ink); }
@keyframes dexUp { from { transform: translateY(100%); } } @keyframes dexFade { from { opacity: 0; } }
.dex-grab { display: block; width: 44px; height: 5px; border-radius: 3px; background: #d8d2c6; margin: 0 auto 10px; }
.dex-pic { width: 160px; height: 160px; margin: 0 auto; } .dex-pic img { width: 100%; height: 100%; object-fit: contain; }
.dex-meta { display: flex; justify-content: center; gap: 6px; margin: 6px 0 10px; }
.dex-meta span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 3px 10px 3px 6px; border-radius: 999px; background: #f1ebe0; color: #7a6a50; }
.dex-meta img { width: 18px; }
.dex-card q { display: block; font-size: 17px; font-weight: 800; line-height: 1.6; text-align: center; quotes: "「" "」"; }
.dex-from { text-align: center; font-size: 12px; color: #8a8f9e; margin: 8px 0 14px; }
.dex-btns { display: flex; gap: 10px; }
.dex-btns > * { flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 12px; font-size: 15px; font-weight: 900; text-decoration: none; }
.dex-b1 { color: var(--candy-main-ink); background: var(--candy-main); box-shadow: inset 0 3px 0 rgba(255,255,255,.6), 0 4px 0 var(--candy-main-edge); }
.dex-b1 img { width: 22px; }
.dex-b2 { color: var(--candy-ink); background: #fff; box-shadow: 0 4px 0 var(--candy-cream-edge); border: 1.5px solid #eee5d4 !important; }
/* 卡片撐滿中間的空間，圓點緊貼在卡片下面（11/20 美術：圓點往上） */
.mode-stage { align-items: stretch; }
.mode-track { height: auto; align-self: stretch; }
.mode-slide { height: calc(100% - 24px); max-height: 680px; }
/* 圖鑑裡不放主題圖示（11/20 美術）：沒有 3D 政見圖的政見用文字卡 */
.dex-row.no-av { padding-left: 16px; }
.dex-st.txt { display: grid; place-items: center; padding: 10px; }
.dex-txt { font-size: 11.5px; font-weight: 800; line-height: 1.4; color: var(--candy-ink); text-align: center; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.dex-meta span { padding: 3px 10px; }

/* ---------- 建設台北結束畫面（時間到直接到這頁）：星球在上、這塊在下可以捲 ---------- */
.screen.game.end .review, .screen.game.end .build-hud, .screen.game.end .build-note { display: none !important; }
.screen.game.review.end .game-planet { inset: 52px 0 auto 0; height: 40%; }
.build-end[hidden] { display: none; }
.build-end { position: absolute !important; left: 0; right: 0; top: calc(52px + 40% - 18px); bottom: 0; z-index: 2; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  padding: 4px max(16px, env(safe-area-inset-left)) max(22px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; color: #f4f0ff; animation: reviewUp .4s ease backwards; }
.build-end > * { flex: none; }
.be-big { text-align: center; text-shadow: 0 3px 0 rgba(0,0,0,.35); }
.rank-stamp-pos { position: absolute !important; z-index: 3 !important; pointer-events: none; }   /* !important：.screen.game.build > * 會把直屬子元素改成 relative */   /* 等級印章（#130）：放在成績框外層，位置與捲動由 app.js 的 stampRank 算 */
.rank-stamp { position: relative; width: 100%; height: 100%; transform: rotate(-12deg); opacity: .95; }
.rank-stamp canvas { display: block; }
.rank-stamp.hit { animation: stampHit .42s cubic-bezier(.55, 0, .8, .25) both; }
@keyframes stampHit {   /* 從畫面外放大、斜著甩下來，72% 壓到底，回彈一下定住 */
  0% { transform: rotate(4deg) scale(2.6); opacity: 0; }
  55% { opacity: .85; }
  72% { transform: rotate(-12deg) scale(.93); opacity: 1; animation-timing-function: ease-out; }
  86% { transform: rotate(-12deg) scale(1.04); }
  100% { transform: rotate(-12deg) scale(1); opacity: .95; } }
.rank-ink { position: absolute; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; animation: rankInk .6s ease-out forwards; }
@keyframes rankInk { from { transform: translate(0, 0) scale(1.3); opacity: .9; } to { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; } }
.rank-shine { position: absolute; inset: 6%; border-radius: 50%; overflow: hidden; }
.rank-shine::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.75) 50%, transparent 65%); background-size: 300% 100%; background-position: 120% 0; animation: rankShine 1.1s .55s ease-in-out 2; mix-blend-mode: overlay; }   /* 傳奇：蓋完掃兩道光 */
@keyframes rankShine { from { background-position: 120% 0; } to { background-position: -20% 0; } }
.be-big b { font-size: 60px; font-weight: 900; color: #ffd84a; line-height: 1; font-variant-numeric: tabular-nums; }
.be-big span { font-size: 16px; font-weight: 800; margin-left: 4px; }
.be-ribbon { align-self: center; display: flex; gap: 8px; align-items: center; background: linear-gradient(#ffe066, #f2b01e); color: #4a2c00; font-weight: 900; font-size: 16px; padding: 6px 18px; border-radius: 999px; box-shadow: 0 3px 0 #b07a12; }
.be-ribbon small { font-size: 12px; font-weight: 800; background: #fff6d6; color: #a0520a; border-radius: 999px; padding: 1px 8px; }
.be-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.be-chips div { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 6px 4px; text-align: center; }
.be-chips b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.be-chips small { font-size: 11px; opacity: .75; }
.be-next { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.be-bar { height: 10px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; }
.be-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb347, #ffd84a); }
.be-btn { display: block; width: 100%; border-radius: 999px; padding: 13px; font-size: 17px; font-weight: 800; border: none; }
.be-btn.yellow { background: linear-gradient(#ffe066, #f7c531); color: #3a2a10; box-shadow: 0 4px 0 #c9921a; }
.be-btn.ghost { background: transparent; color: #f4f0ff; border: 2px solid rgba(244,240,255,.85); }
.be-btn:active { transform: translateY(2px); }
.be-home { background: none; border: none; color: #f4f0ff; opacity: .85; text-decoration: underline; font-size: 14px; align-self: center; padding: 4px 10px; }
.be-fine { margin: 0; font-size: 11px; opacity: .65; text-align: center; }
.be-h { margin: 6px 0 0; font-size: 15px; }
.be-stickers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.be-stk { position: relative; background: rgba(255,255,255,.08); border: none; border-radius: 12px; padding: 0; aspect-ratio: 1; min-width: 0; overflow: hidden; }
/* 圖片疊滿格子、四周留 8%，整張縮進格子裡（不會被格子切掉） */
.be-stk img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; display: block; pointer-events: none; }
.be-stk[aria-pressed="true"] { outline: 2px solid #ffd84a; }
.be-stk .x-n { position: absolute; right: 4px; bottom: 4px; padding: 0 6px; border-radius: 999px; background: #ffd84a; color: #3a2268; font-size: 12px; font-weight: 900; line-height: 18px; pointer-events: none; }   /* 同一條政見這局上星球幾次 */
.review-list li .x-n { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #d8463b; color: #fff; font-size: 12px; font-weight: 900; }
.be-detail { background: #fffaf0; color: #2b2622; border-radius: 14px; padding: 10px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.be-detail:empty { display: none; }
.be-detail .who { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.be-detail .who .mini { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex: none; }
.be-detail .who .mini img { width: 100%; height: 100%; object-fit: cover; }
.be-detail .who small { display: block; color: #7a6a58; font-size: 11px; }
.be-detail q { font-size: 15px; line-height: 1.5; }
.be-detail .vq { margin: 0; font-size: 13px; color: #5a4630; }
.be-detail .vq { display: flex; flex-direction: column; gap: 1px; }
.be-detail .vsrc { align-self: flex-start; font-size: 12px; color: #8a7558; text-decoration: none; border-bottom: 1px dotted #b9a88e; padding-bottom: 1px; }
.be-detail .pending { margin: 0; color: #7a6a58; }
/* 原聲、公報連結：膠囊按鈕 */
.be-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.be-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; text-decoration: none; border: none; border-radius: 999px; padding: 6px 12px; background: #efe6d3; color: #5a4630; }
.be-pill .ic { width: 16px; height: 16px; }
/* 結束畫面頂端：這頁的名字（金色大字） */
.screen.game.end .hud-mode { color: #ffd84a; font-size: 22px; font-weight: 900; letter-spacing: .06em; text-shadow: 0 2px 0 #8a5a00, 0 0 14px rgba(255,216,74,.35); }

/* ---------- 今日挑戰／好友房結束畫面（#daily-end）：跟建設台北結束頁同一套（.be-*），多了金光＋蓋章星星 ---------- */
#screen-result.dnew > :not(#daily-end) { display: none !important; }
.daily-end { display: none; }
#screen-result.dnew, #screen-result.dnew .daily-end { overflow-x: clip; }
#screen-result.dnew .daily-end { position: relative; margin: 0 -16px; padding-left: 16px; padding-right: 16px; display: flex; flex-direction: column; gap: 10px; color: #f4f0ff; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.daily-end > :not(.de-rays) { position: relative; }
.daily-end > * { flex: none; }
.de-top { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; }
.de-x { width: 40px; height: 40px; }
.de-title { margin: 0; text-align: center; font-size: 22px; font-weight: 900; letter-spacing: .06em; color: #ffd84a; text-shadow: 0 2px 0 #8a5a00, 0 0 14px rgba(255,216,74,.35); }
.de-fx { position: relative; height: 190px; display: grid; place-items: center; }
/* 金色光芒：放在整個畫面後面、比螢幕寬很多，往外慢慢淡掉，一路延伸到畫面兩側（不會像被切成一個框） */
.de-rays { position: absolute; left: 50%; top: 150px; width: 1100px; height: 1100px; margin: -550px 0 0 -550px; border-radius: 50%; background: repeating-conic-gradient(rgba(255,216,74,.2) 0 9deg, transparent 9deg 20deg); -webkit-mask: radial-gradient(circle, #000 6%, rgba(0,0,0,.55) 22%, transparent 48%); mask: radial-gradient(circle, #000 6%, rgba(0,0,0,.55) 22%, transparent 48%); animation: deSpin 18s linear infinite; pointer-events: none; z-index: 0; }
@keyframes deSpin { to { transform: rotate(360deg); } }
.de-stars { position: relative; display: flex; align-items: flex-end; gap: 6px; }
.de-st { width: 78px; height: 78px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); opacity: 0; }
.de-st.s1 { width: 100px; height: 100px; margin-bottom: 10px; }
.de-st.off { filter: none; }
.de-play .de-st { animation: deStamp .45s cubic-bezier(.2,1.7,.4,1) both, deSway 2.6s ease-in-out infinite; }
.de-play .de-st.s0 { animation-delay: .3s, 1.4s; } .de-play .de-st.s1 { animation-delay: .75s, 1.6s; } .de-play .de-st.s2 { animation-delay: 1.2s, 1.8s; }
.de-play .de-st.off { animation: deStampOff .45s cubic-bezier(.2,1.7,.4,1) both; animation-delay: 1.2s; }
.de-play .de-st.s0.off { animation-delay: .3s; } .de-play .de-st.s1.off { animation-delay: .75s; }
@keyframes deStamp { from { opacity: 0; transform: translateY(-60px) scale(1.9) rotate(-20deg); } to { opacity: 1; transform: none; } }
@keyframes deStampOff { from { opacity: 0; transform: translateY(-60px) scale(1.9) rotate(-20deg); } to { opacity: .55; transform: none; } }
@keyframes deSway { 0%, 100% { rotate: -7deg; } 50% { rotate: 7deg; } }
.de-sparks i { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 50%; background: #fff6c2; box-shadow: 0 0 8px 3px rgba(255,216,74,.8); opacity: 0; pointer-events: none; }
.de-play .de-sparks i { animation: deSpark 2.2s ease-out infinite; }
.de-sparks i:nth-child(1) { --x: -120px; --y: -60px; animation-delay: 1.3s; } .de-sparks i:nth-child(2) { --x: 120px; --y: -50px; animation-delay: 1.6s; }
.de-sparks i:nth-child(3) { --x: -90px; --y: 70px; animation-delay: 1.9s; } .de-sparks i:nth-child(4) { --x: 100px; --y: 75px; animation-delay: 2.2s; }
.de-sparks i:nth-child(5) { --x: -140px; --y: 10px; animation-delay: 2.5s; } .de-sparks i:nth-child(6) { --x: 140px; --y: 15px; animation-delay: 2.8s; }
.de-sparks i:nth-child(7) { --x: -40px; --y: -95px; animation-delay: 3.1s; } .de-sparks i:nth-child(8) { --x: 50px; --y: -90px; animation-delay: 3.4s; }
@keyframes deSpark { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.2); } }
.de-play .de-big { animation: dePop .5s cubic-bezier(.2,1.6,.4,1) 1.5s both; }
@keyframes dePop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.de-rank.plain { background: rgba(255,255,255,.12); color: #f4f0ff; box-shadow: none; font-size: 14px; font-weight: 700; }
.de-play .de-rank:not(.plain) { animation: deBounce .6s cubic-bezier(.2,1.8,.4,1) 2.2s both, deBreathe 2.4s ease-in-out 3s infinite; }
@keyframes deBounce { from { opacity: 0; transform: translateY(20px) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes deBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.de-split { margin: -4px 0 0; text-align: center; font-size: 12px; opacity: .75; }
.de-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.de-two .be-btn { font-size: 15px; padding: 11px; }
@media (prefers-reduced-motion: reduce) { .de-play .de-st, .de-play .de-big, .de-play .de-rank, .de-rays, .de-play .de-sparks i { animation: none !important; opacity: 1; } .de-st.off { opacity: .55; } }
/* 從排行榜回到結束畫面：不重播進場，只留持續的輕搖、火花、金光 */
#screen-result.de-done .de-st { animation: deSway 2.6s ease-in-out infinite; opacity: 1; }
#screen-result.de-done .de-st.off { animation: none; opacity: .55; }
#screen-result.de-done .de-big, #screen-result.de-done .de-rank { animation: none; opacity: 1; }
#screen-result.de-done .de-rank:not(.plain) { animation: deBreathe 2.4s ease-in-out infinite; }

/* ---------- 分享成績：預覽＋選配色＋分享圖片／影片 ---------- */
.be-why { margin: -4px 0 0; text-align: center; font-size: 12px; opacity: .8; }
.share-sheet { position: fixed; inset: 0; z-index: 200; background: rgba(16,10,28,.97); color: #f4f0ff; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); overflow-y: auto; }
.ss-top { width: 100%; max-width: 420px; display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
.ss-x { background: rgba(255,255,255,.14); border: none; color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 16px; }
.ss-pre { height: min(52vh, 560px); aspect-ratio: 9 / 16; width: auto; max-width: 100%; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); background: #fff; }
.ss-pals { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ss-pals button { background: none; border: none; color: #f4f0ff; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; }
.ss-pals span { width: 38px; height: 38px; border-radius: 50%; position: relative; overflow: hidden; border: 2px solid rgba(255,255,255,.35); display: block; }
.ss-pals span i { position: absolute; width: 19px; height: 19px; border-radius: 50%; }
.ss-pals span i:first-child { right: -5px; top: -5px; } .ss-pals span i:last-child { left: -5px; bottom: -5px; }
.ss-pals small { font-size: 11px; }
.ss-pals button[aria-pressed="true"] span { border-color: #ffd84a; box-shadow: 0 0 0 3px rgba(255,216,74,.4); }
.ss-btns { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; }
.ss-msg { margin: 0; font-size: 13px; min-height: 1.4em; opacity: .9; }
.ss-hold { position: fixed; inset: 0; z-index: 201; background: rgba(16,10,28,.98); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; }   /* 叫不出分享選單時：秀圖讓玩家長按存相簿 */
.ss-hold img { height: min(64vh, 680px); aspect-ratio: 9 / 16; width: auto; max-width: 100%; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); -webkit-touch-callout: default; user-select: auto; }
.ss-hold p { margin: 0; font-size: 15px; text-align: center; }
.ss-hold .be-btn { width: 100%; max-width: 420px; }

/* 舊瀏覽器不認得 dvh（iOS 15.4、Chrome 108 之前）：自訂變數不會自動退回上一行，所以另外給一份用 vh 的 */
@supports not (height: 100dvh) {
  .grid { --cw: min(calc((min(100vw, 480px) - 32px - 3 * var(--gap)) / 4), calc((100vh - 330px) / var(--rows) * 0.75 - var(--gap))); }
  .screen.game.build .grid { --cw: min(calc((min(100vw, 480px) - 32px - 3 * var(--gap)) / 4), calc((100vh - 296px) / var(--rows) * 0.75 - var(--gap))); }
  .screen.game.build:has(.feel-hud:not([hidden])) .grid { --cw: min(calc((min(100vw, 480px) - 32px - 3 * var(--gap)) / 4), calc((100vh - 352px) / var(--rows) * 0.75 - var(--gap))); }
}
.bubble .who .co-kind { background: #efe3c8; color: #6b4a1a; border-radius: 8px; padding: 1px 7px; font-weight: 700; }
.bubble .co-src { margin: 4px 0 0; font-size: 12px; line-height: 1.45; color: #6b625a; }
/* 立體疊牌：配錯／偷看後畫面停住的那一小段，蓋著的牌暗一點，看得出現在不能點 */
.grid.locked .card:not(.open):not(.matched) { filter: brightness(.72); transition: filter .12s; }
/* 道具牌配中：併牌用的飛行牌（跟牌面同一個紫色底） */
.fly-card.item { border-color: #4a2e8f; }
.fly-card .item-face { width: 100%; height: 100%; display: grid; place-items: center; background: radial-gradient(circle at 50% 42%, #b79cf0, #6a45b8 78%); }
.fly-card .item-face.wild { background: conic-gradient(from 200deg at 50% 45%, #ff9aa2, #ffd98a, #a8e6a1, #9ad0ff, #c9a8f5, #ff9aa2); }
.fly-card .item-face .item-ic { width: 70%; height: auto; } .fly-card .item-face .item-emoji { font-size: calc(var(--cw, 80px) * .5); line-height: 1; }
/* 兩張變色龍：檯面的牌一張一張變成同一位候選人 */
.card.morph .card-front { opacity: 1; border-style: solid; animation: morphIn .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes morphIn { 0% { filter: hue-rotate(200deg) brightness(1.8); transform: rotateY(180deg) scale(.7); } 60% { filter: hue-rotate(60deg) brightness(1.3); } 100% { filter: none; transform: rotateY(180deg) scale(1); } }
/* 金元寶（補牌送的獎勵牌） */
.card-front .item-face.gold, .fly-card .item-face.gold { background: radial-gradient(circle at 50% 40%, #fff6c4, #f2b21e 80%); }
.card-front:has(.item-face.gold) { border-color: #b97a00; } .card-front:has(.item-face.gold) .namebar { background: #fff3c4; } .card-front:has(.item-face.gold) .namebar b { color: #8a5a00; }
/* 金元寶的牌背：金底紅星（寫在道具牌背之後，蓋過紫色） */
.card.goldback .card-back { background-color: #f2b21e; border-color: #fff3b0; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,.22) 6px 12px); }
.card.goldback .stamp { border-color: #a8431a; color: #a8431a; opacity: 1; }
.card.goldback .stamp span::before { content: "元"; }

/* ---------- 道具說明頁與「新道具！」視窗（#123，可用版，待美術調）---------- */
.mode-link { position: relative; display: flex; align-items: center; gap: 6px; width: fit-content; margin: 16px auto 4px; border: 0; border-radius: 999px; background: #fff; color: var(--candy-ink); padding: 4px 18px 4px 8px; box-shadow: 0 3px 0 var(--candy-cream-edge); }
.mode-link img { width: 34px; height: 34px; filter: drop-shadow(0 2px 1px rgba(0,0,0,.15)); pointer-events: none; }
.mode-link b { font-size: 14.5px; font-weight: 900; }
.mode-link:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--candy-cream-edge); }
.items-guide { padding: 4px 16px 28px; }
.ig-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin: 24px 4px 12px; }
.ig-head:first-child { margin-top: 10px; }
.ig-head h3.mode-ttl { margin: 0; }   /* 字型、描邊、大小跟選擇玩法頁的大標題（.mode-ttl）同一套 */
.ig-sec { background: #fff; border-radius: 20px; padding: 12px 14px 16px; margin: 0; box-shadow: 0 4px 0 var(--candy-cream-edge); color: var(--candy-ink); }
.ig-count { font-size: 13px; font-weight: 700; color: #6b625a; white-space: nowrap; padding-bottom: 3px; } .ig-count b { color: #6a45b8; font-size: 16px; }
.ig-how { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: #6b625a; }
.ig-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ig-card { position: relative; display: flex; flex-direction: column; padding: 0; border: 2.5px solid #4a2e8f; border-radius: 12px; overflow: visible; background: #efe6ff; aspect-ratio: 3 / 4; box-shadow: 0 3px 0 rgba(74,46,143,.35); color: #4a2e8f; }
.ig-card:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(74,46,143,.35); }
.ig-card .item-face { flex: 1; display: grid; place-items: center; border-radius: 9px 9px 0 0; background: radial-gradient(circle at 50% 42%, #b79cf0, #6a45b8 78%); min-height: 0; }
.ig-card .item-face.wild { background: conic-gradient(from 200deg at 50% 45%, #ff9aa2, #ffd98a, #a8e6a1, #9ad0ff, #c9a8f5, #ff9aa2); }
.ig-card .item-face.gold { background: radial-gradient(circle at 50% 42%, #ffe58c, #f2b21e 78%); }
.ig-card .item-face .item-ic { width: 78%; height: auto; display: block; filter: drop-shadow(0 2px 1px rgba(0,0,0,.2)); }
.ig-card b { font-size: 12.5px; font-weight: 900; padding: 3px 0 4px; white-space: nowrap; }
.ig-card.crush { border-color: #c9971a; background: #fff6cf; color: #5a4300; box-shadow: 0 3px 0 rgba(201,151,26,.4); }
.ig-card.crush .item-face { background: radial-gradient(circle at 50% 42%, #fff3b8, #ffc928 80%); }
.ig-card.back { background-color: #6a45b8; border-color: #e9dcff; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,.09) 6px 12px); color: #e9dcff; }
.ig-card.back.crush { background-color: #d9a520; border-color: #fff3b0; color: #fff8dc; }
.ig-q { flex: 1; display: grid; place-items: center; font-size: 34px; font-weight: 900; color: rgba(255,255,255,.85); text-shadow: 0 2px 0 rgba(0,0,0,.18); }
.ig-new { position: absolute; top: -8px; right: -8px; padding: 1px 6px; border-radius: 999px; background: #e0463b; color: #fff; font-style: normal; font-size: 11px; font-weight: 900; line-height: 16px; box-shadow: 0 2px 0 rgba(0,0,0,.2); animation: igNew 1.2s ease-in-out infinite; }
@keyframes igNew { 50% { transform: scale(1.12) rotate(6deg); } }
.items-badge { top: -6px; right: -6px; }
.itemcard { z-index: 70; }
.ic-box { position: relative; width: min(320px, 100%); padding: 26px 20px 18px; border-radius: 24px; background: #fff; text-align: center; color: var(--candy-ink); overflow: hidden; box-shadow: 0 6px 0 var(--candy-cream-edge); animation: icPop .38s cubic-bezier(.2,1.6,.4,1); }
@keyframes icPop { from { transform: scale(.6); opacity: 0; } }
.ic-rays { position: absolute; left: 50%; top: 150px; width: 640px; height: 640px; margin: -320px 0 0 -320px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255,214,120,.35) 0deg 8deg, transparent 8deg 20deg); animation: spin 9s linear infinite; pointer-events: none; }
.itemcard:not(.is-new) .ic-rays { display: none; }
.ic-ribbon { position: relative; margin: 0 0 14px; font-size: 22px; font-weight: 900; color: #6a45b8; letter-spacing: .04em; }
.itemcard.is-new .ic-ribbon { color: #e0463b; text-shadow: 0 2px 0 #ffe1a0; }
.ic-card { position: relative; width: 132px; margin: 0 auto 12px; aspect-ratio: 3 / 4; display: flex; flex-direction: column; border: 3px solid #4a2e8f; border-radius: 16px; overflow: hidden; background: #efe6ff; box-shadow: 0 5px 0 rgba(74,46,143,.35); }
.itemcard.is-new .ic-card { animation: icBounce 1.6s ease-in-out .35s infinite; }
@keyframes icBounce { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-6px) rotate(-3deg); } 60% { transform: translateY(0) rotate(2deg); } }
.ic-card .item-face { flex: 1; display: grid; place-items: center; background: radial-gradient(circle at 50% 42%, #b79cf0, #6a45b8 78%); }
.ic-card .item-face.wild { background: conic-gradient(from 200deg at 50% 45%, #ff9aa2, #ffd98a, #a8e6a1, #9ad0ff, #c9a8f5, #ff9aa2); }
.ic-card .item-face.gold { background: radial-gradient(circle at 50% 42%, #ffe58c, #f2b21e 78%); }
.ic-card .item-face .item-ic { width: 80%; height: auto; display: block; }
.ic-card b { padding: 5px 0 6px; font-size: 18px; font-weight: 900; color: #4a2e8f; }
.ic-card.crush { border-color: #c9971a; background: #fff6cf; box-shadow: 0 5px 0 rgba(201,151,26,.4); }
.ic-card.crush .item-face { background: radial-gradient(circle at 50% 42%, #fff3b8, #ffc928 80%); }
.ic-card.crush b { color: #5a4300; }
.ic-desc { position: relative; margin: 0 0 6px; font-size: 16px; font-weight: 700; line-height: 1.5; }
.ic-box:not(:has(.ic-how:not([hidden]))) .ic-desc { margin-bottom: 18px; }
.itemcard:not(.is-new) .ic-box { padding-top: 22px; }
.ic-how { position: relative; margin: 0 0 14px; font-size: 12.5px; line-height: 1.5; color: #6b625a; }
.ic-box .btn { position: relative; width: 100%; border: 0; border-radius: 999px; padding: 13px; font-size: 18px; font-weight: 900; letter-spacing: .1em; color: var(--candy-main-ink); background: var(--candy-main); box-shadow: 0 5px 0 var(--candy-main-edge); }
.ic-box .btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--candy-main-edge); }
/* 選舉公報檢視（點大頭貼開啟） */
.gz-av { cursor: pointer; position: relative; }
/* 放大鏡小圓標要整顆露在頭像右下角：頭像框本身不裁切，改成只把裡面的照片裁成圓（或圓角） */
.gz-av.mini, .be-detail .who .gz-av.mini, .review-list li .gz-av.mini, .dex-av.gz-av { overflow: visible; }
.gz-av.mini > img, .gz-av.mini > span { border-radius: 50%; }
.dex-av.gz-av > img { border-radius: inherit; }
.gz-av::after { content: ''; position: absolute; right: -3px; bottom: -3px; width: 42%; height: 42%; min-width: 14px; min-height: 14px; border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10.5' cy='10.5' r='6' fill='none' stroke='%235a4630' stroke-width='2.6'/%3E%3Cpath d='M15 15l5 5' stroke='%235a4630' stroke-width='2.8' stroke-linecap='round'/%3E%3C/svg%3E") center/70% no-repeat; box-shadow: 0 1px 3px rgba(0,0,0,.35); pointer-events: none; }
.gz { position: fixed; inset: 0; z-index: 90; background: rgba(20,14,40,.96); display: flex; flex-direction: column; padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); }
.gz[hidden] { display: none; }
.gz-top { display: flex; align-items: center; gap: 8px; color: #fff; padding: 2px 2px 8px; }
.gz-who { flex: 1; min-width: 0; } .gz-who b { display: block; font-size: 17px; } .gz-who small { display: block; font-size: 12px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gz-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255,255,255,.16); color: #fff; font-size: 20px; font-weight: 800; flex: none; }
.gz-btn.gz-x { background: #fff; color: #2a1d4a; }
.gz-view { flex: 1; min-height: 0; overflow: auto; background: #fff; border-radius: 10px; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.gz-view img { display: block; width: 100%; max-width: none; height: auto; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.gz-msg { margin: 0; padding: 40px 16px; text-align: center; color: #5a4630; font-size: 14px; }
.gz-foot { margin: 8px 2px 0; font-size: 11.5px; color: rgba(255,255,255,.8); text-align: center; line-height: 1.5; } .gz-foot a { color: #ffe066; }
/* 分享到 LINE、複製連結 */
.share-row { display: flex; gap: 10px; }
.be-btn.sm { font-size: 14.5px; padding: 10px 6px; border-width: 1.5px; }
.be-btn.line { border-color: #06c755; color: #b9f5cf; }
.share-row .be-btn { flex: 1; }
/* 對話框：名字下面一行職稱、選區、政黨 */
.bubble .who small.seat { display: block; font-size: 11px; line-height: 1.25; opacity: .78; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* loading 蓋章蓋在星球上：跟著地表一起轉（速度、週期跟 loadSpin 一樣） */
.loading-planet { overflow: hidden; }
.stamp-ride { position: absolute; width: 0; height: 0; animation: stampRide 3.2s linear infinite; transition: opacity .3s; }
.stamp-ride.out { opacity: 0; }
.stamp-ride .load-stamp { left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-width: 2.5px; font-size: 16px; }
.stamp-ride .load-stamp + .load-stamp { left: 240px; }
@keyframes stampRide { to { transform: translateX(-240px); } }
/* 遊戲聲明：常見問題 */
.notice-h { margin: 16px 0 8px; padding-top: 12px; border-top: 1px dashed rgba(90,70,48,.3); font-size: 15px; }

/* ---------- 選舉小達人（quiz.js）、公投一次看懂（referendum.js）：可用版，待美術調 ---------- */
.k4 .mode-scene { background: radial-gradient(circle at 50% 45%, #d9f3ff, #6cc3f0 60%, #2f8fd0); }
.k5 .mode-scene { background: linear-gradient(160deg, #ffe9a8, #f5a623); }
.mode-glyph { position: relative; z-index: 1; width: 46%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 7px solid var(--stamp); color: var(--stamp); font-size: clamp(48px, 16vw, 78px); font-weight: 900; line-height: 1; rotate: -8deg; box-shadow: 0 8px 0 rgba(0,0,0,.15); }
.quiz-body, .ref-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; width: min(100%, 520px); margin: 0 auto; padding-bottom: 16px; }
.quiz-body .glass-card, .ref-body .glass-card { background: var(--card-face); border: 2px solid var(--line); border-radius: 18px; padding: 16px; color: var(--ink); }
.qz-msg { text-align: center; padding: 40px 0; }
.qz-intro h3 { margin: 0 0 4px; font-size: 22px; } .qz-lead { margin: 0 0 10px; font-weight: 700; color: var(--ink-soft); }
.qz-points { margin: 0 0 14px; padding-left: 20px; font-size: 14.5px; line-height: 1.8; }
.qz-best { margin: 0 0 12px; font-size: 14px; } .qz-best b { font-size: 18px; color: var(--stamp); }
.qz-fine { margin: 10px 2px 0; font-size: 11.5px; line-height: 1.6; color: var(--ink-soft); }
.quiz-body .be-btn.ghost, .ref-body .be-btn.ghost { color: var(--ink); border-color: var(--line); background: #fff; }
.quiz-body .be-btn.line { color: #06894a; border-color: #06c755; }
.quiz-body .be-btn:disabled { opacity: .55; }
.qz-top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 700; }
.qz-n b { font-size: 20px; } .qz-lv { display: inline-flex; align-items: center; gap: 6px; }
.qz-stars { display: inline-flex; gap: 3px; vertical-align: middle; } .qz-stars i { width: 10px; height: 10px; border-radius: 50%; background: #d9d2c2; } .qz-stars i.on { background: #f5a623; }
.qz-bar { height: 8px; border-radius: 999px; background: #e4dccb; overflow: hidden; } .qz-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd24a, #f5a623); border-radius: 999px; transition: width .3s; }
.qz-tags { display: flex; gap: 6px; margin-bottom: 8px; } .qz-tags span { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #efe3c8; color: #6b4a1a; } .qz-tags .case { background: #dcecff; color: #1f5fae; }
.qz-q { margin: 0 0 12px; font-size: 17px; font-weight: 700; line-height: 1.6; }
.qz-opts { display: grid; gap: 9px; }
.qz-opt { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; padding: 11px 12px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink); font-size: 15.5px; line-height: 1.5; }
.qz-opt b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #efe6d3; font-size: 14px; }
.qz-opt:active:not(:disabled) { transform: translateY(2px); }
.qz-opt.right { border-color: var(--ok); background: #e7f6ec; } .qz-opt.right b { background: var(--ok); color: #fff; }
.qz-opt.wrong { border-color: var(--chip-red); background: #fdeceb; } .qz-opt.wrong b { background: var(--chip-red); color: #fff; }
.qz-opt:disabled:not(.right):not(.wrong) { opacity: .6; }
.qz-after { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.qz-verdict { margin: 0 0 6px; font-size: 17px; font-weight: 900; } .qz-verdict.ok { color: var(--ok); } .qz-verdict.no { color: var(--chip-red); }
.qz-ex { margin: 0 0 10px; font-size: 14.5px; line-height: 1.65; }
.qz-law { margin: 0 0 12px; padding: 9px 11px; border-left: 4px solid #d8ccb6; background: #f7f1e3; border-radius: 0 10px 10px 0; font-size: 13px; line-height: 1.6; color: var(--ink-soft); } .qz-law b { display: block; color: var(--ink); } .qz-law a { display: inline-block; margin-left: 6px; color: var(--chip-blue); }
.qz-result { text-align: center; } .qz-kick { margin: 0; font-weight: 700; color: var(--ink-soft); }
.qz-score b { font-size: 64px; line-height: 1.05; color: var(--stamp); } .qz-score span { margin-left: 4px; font-weight: 800; }
.qz-title { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 6px; padding: 6px 18px; border-radius: 999px; background: linear-gradient(#ffe066, #f7c531); color: #3a2a10; font-size: 19px; font-weight: 900; box-shadow: 0 4px 0 #c9921a; } .qz-title small { font-size: 11px; background: #fff; border-radius: 999px; padding: 1px 8px; }
.qz-sub, .qz-next { margin: 6px 0; font-size: 14px; } .qz-next { color: var(--ink-soft); }
.qz-rank { min-height: 1.6em; margin: 6px 0 10px; font-weight: 800; } .qz-rank b { font-size: 20px; color: var(--stamp); } .qz-rank small { margin-left: 6px; font-weight: 600; color: var(--ink-soft); }
.qz-result .share-row { margin-top: 10px; }
.qz-break h4, .qz-review h4 { margin: 0 0 10px; font-size: 16px; }
.qz-row { display: grid; grid-template-columns: 7.5em 1fr 3em; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 6px; } .qz-row i { height: 8px; border-radius: 999px; background: #e4dccb; overflow: hidden; } .qz-row u { display: block; height: 100%; background: var(--ok); } .qz-row b { text-align: right; }
.qz-review details { border-top: 1px dashed var(--line); padding: 9px 0; } .qz-review summary { font-size: 14.5px; font-weight: 700; line-height: 1.5; cursor: pointer; }
.qz-ans { margin: 8px 0 4px; font-size: 14px; font-weight: 700; color: var(--ok); } .qz-src { margin: 0; font-size: 12.5px; } .qz-src a { color: var(--chip-blue); }
/* 公投一次看懂 */
.ref-body h4 { margin: 0 0 10px; font-size: 17px; } .ref-body h4 small { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--ink-soft); } .ref-body h5 { margin: 14px 0 8px; font-size: 14.5px; }
.rf-kick { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.rf-question { margin: 0 0 12px; font-size: 21px; font-weight: 900; line-height: 1.55; }
.rf-how { margin: 0 0 8px; font-size: 14px; line-height: 1.65; padding: 9px 11px; background: #f7f1e3; border-radius: 10px; }
.rf-src { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); } .ref-body a { color: var(--chip-blue); } .rf-src i { font-style: normal; opacity: .85; }
.rf-facts { margin: 0; display: grid; grid-template-columns: 5.5em 1fr; gap: 8px 10px; font-size: 14px; line-height: 1.6; } .rf-facts dt { font-weight: 800; } .rf-facts dd { margin: 0; }
.rf-note { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.rf-theme { border-top: 1px dashed var(--line); padding-top: 4px; margin-top: 10px; }
.rf-theme h5 { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #efe3c8; color: #6b4a1a; font-size: 13px; }
/* 兩方的卡片長得一模一樣，只有左上角的標籤文字不同：不用顏色暗示好壞，也不用任何政黨色 */
.rf-arg { margin-bottom: 10px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; background: #fff; }
.rf-side { display: inline-block; margin-bottom: 4px; padding: 1px 9px; border-radius: 6px; border: 1.5px solid var(--ink); font-size: 12.5px; font-weight: 800; }
.rf-arg q, .rf-gq { display: block; font-size: 15px; line-height: 1.7; quotes: "「" "」"; }
.rf-who { margin: 6px 0 0; font-size: 13px; font-weight: 700; }
.rf-docs { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.9; } .rf-docs small { margin-left: 6px; color: var(--ink-soft); }
.rf-theme-tag { display: inline-block; margin: 0 0 8px; padding: 2px 10px; border-radius: 999px; background: #efe3c8; color: #6b4a1a; font-size: 12.5px; font-weight: 700; }
.rf-gq { margin-bottom: 12px; font-size: 16.5px; font-weight: 700; } .rf-game .share-row .be-btn { padding: 13px 6px; font-size: 16px; }
.rf-done { margin: 6px 0; font-size: 17px; font-weight: 800; } .rf-done b { font-size: 26px; color: var(--stamp); }
.qz-opt.right, .qz-opt.wrong { opacity: 1; color: var(--ink); -webkit-text-fill-color: var(--ink); }

/* ---------- 道具說明頁：三消特殊方塊（#148）。示意方塊不放候選人：人形圖示＋中性灰藍底，記號沿用盤面的 .m3-tile[data-sp] ---------- */
.item-face.sp-demo { display: grid; place-items: center; }
.item-face .sp-tile { position: relative; width: 66%; height: auto; aspect-ratio: 1; padding: 0; pointer-events: none; }
.item-face .sp-tile .face { --pc: #7b84aa; --band: 0px; display: grid; place-items: center; background: radial-gradient(circle at 50% 38%, #b3bbdb, #7b84aa 80%); }
.item-face .sp-tile .face svg { width: 42%; height: auto; }
.ic-area { display: grid; grid-template-columns: repeat(5, 14px); gap: 3px; justify-content: center; margin: 2px 0 12px; position: relative; }
.ic-area i { width: 14px; height: 14px; border-radius: 3px; background: #e6e0f0; }
.ic-area i.on { background: #ffc928; box-shadow: inset 0 0 0 1.5px #c9971a; }
.ic-area i.me { background: #7b84aa; box-shadow: inset 0 0 0 2px #fff, 0 0 0 1.5px #7b84aa; }
/* 政見三消：選選區 */
.m3pick-box { max-height: calc(100vh - 40px); overflow-y: auto; }
.m3pick-tip { margin: 0 0 10px; font-size: 13px; color: #6a6080; text-align: center; line-height: 1.5; }
.m3pick-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.m3pick-b { display: grid; gap: 1px; padding: 9px 8px; border: 2px solid var(--ink); border-radius: 12px; background: var(--card-face); text-align: center; }
.m3pick-b b { font-size: 16px; } .m3pick-b span { font-size: 13px; } .m3pick-b small { font-size: 12px; color: #6a6080; }
.m3pick-b.all { grid-column: 1 / -1; }
.m3pick-b.on { background: var(--ink); color: var(--paper); } .m3pick-b.on small { color: inherit; opacity: .8; }
.dex-chips.dist { margin-bottom: 8px; }

/* ---------- 新道具與新特殊方塊（便利貼、大掃把、斜十字、變色龍方塊、沙漏）---------- */
/* 便利貼：貼在牌背右上角的小紙條，畫著這張牌是誰。牌翻開、配走或空掉時不顯示 */
.card .pin-note { position: absolute; top: -5px; right: -5px; width: 50%; aspect-ratio: 1; z-index: 4; display: grid; place-items: center; overflow: hidden; pointer-events: none;
  background: #ffe45c; border: 2px solid #2b2420; border-radius: 3px 3px 3px 11px; transform: rotate(7deg); box-shadow: 0 2px 0 rgba(0,0,0,.4); animation: bumpBuild .4s cubic-bezier(.2,1.8,.4,1); }
.card .pin-note img, .card .pin-note svg { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; }
.card .pin-note .ph, .card .pin-note b { font-weight: 900; font-size: calc(var(--cw) * .26); color: #2b2420; }
.card.open .pin-note, .card.matched .pin-note, .card.gone .pin-note, .card.peek .pin-note, .card.predeal .pin-note { display: none; }
.item-face.note { background: radial-gradient(circle at 50% 42%, #b79cf0, #6a45b8 78%); }
.feel-item.broom { background: #d9c2ff; }
/* 斜十字：四個角各一個白色三角形（不蓋到臉） */
.m3-tile[data-sp="x"] .face::before { inset: 4px 4px calc(var(--band) + 2px) 4px; background: linear-gradient(135deg, #fff 9%, transparent 9.5%), linear-gradient(225deg, #fff 9%, transparent 9.5%), linear-gradient(315deg, #fff 9%, transparent 9.5%), linear-gradient(45deg, #fff 9%, transparent 9.5%); }   /* 斜十字：四個角各一個小直角三角形；往內 4px，直角才不會卡進方塊的圓角被切成圓弧 */
.m3-beam.d1 { transform: rotate(45deg); } .m3-beam.d2 { transform: rotate(-45deg); }
/* 沙漏：右上角一個小沙漏，光暈改成藍色（跟「時間」的顏色一致） */
.m3-tile[data-sp="time"] .face { box-shadow: 0 0 0 2px #fff, 0 0 12px 3px rgba(120,190,255,.95), 0 3px 0 rgba(0,0,0,.45); }
.m3-tile[data-sp="time"] .face::before { inset: -2px -2px auto auto; background: url(icons/item_time.webp) center / contain no-repeat; width: 46%; aspect-ratio: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }   /* 直接放 Q 版沙漏圖（自帶白色貼紙邊），不加圓框（#144，企劃 11/22） */
/* 變色龍方塊：不是候選人，整格換成彩色底＋變色龍圖示，黨派色帶也不顯示 */
.m3-tile[data-sp="wild"] .face { background: conic-gradient(from 200deg at 50% 45%, #ff9aa2, #ffd98a, #a8e6a1, #9ad0ff, #c9a8f5, #ff9aa2); }
.m3-tile[data-sp="wild"] .face img, .m3-tile[data-sp="wild"] .face > i, .m3-tile[data-sp="wild"] .face > span, .m3-tile[data-sp="wild"] .face svg { display: none; }
.m3-tile[data-sp="wild"] .face::before { background: url(icons/item_wild.webp) center / 88% no-repeat; }

/* 發表會主張：跟公報政見分開的一塊。字太多用「…」收尾（公報政見、主張各 2 行），高度才不會比一般的政見對話框高太多 */
.bubble .clamp2 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; -webkit-line-clamp: 2; line-clamp: 2; }
.bubble.has-view q { font-size: 14px; line-height: 1.45; }
.bubble .view-say { margin-top: 5px; padding-top: 5px; border-top: 1.5px dashed rgba(0,0,0,.18); }
.bubble .view-head { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; }
.bubble .view-say .co-kind { flex: none; background: #dcebff; color: #1f4b8f; border-radius: 8px; padding: 1px 7px; font-size: 11px; font-weight: 800; }
.bubble .view-say .view-src { font-size: 11px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 三消：條數與分數併進最上面那一行（時間的左右兩側），省下一列高度給 6×6 盤面（企劃 11/22）。
   回顧與結算畫面抬頭會換成標題文字，那時回到原本自己一列的排法，才不會疊在一起 */
.screen.game.build.crush:not(.review):not(.end) > .build-hud:not([hidden]) { position: absolute; z-index: 2; top: max(12px, env(safe-area-inset-top)); left: 60px; right: 60px; height: 38px; min-height: 0;
  grid-template-columns: 1fr 1fr; gap: 72px; pointer-events: none; }   /* 左右各讓出離開鍵、音效鍵；中間 72px 留給時間 */
.screen.game.build.crush:not(.review):not(.end) .build-count { grid-column: 1; padding: 2px 7px 2px 6px; gap: 4px; border-width: 2px; border-radius: 12px; }
.screen.game.build.crush:not(.review):not(.end) .build-count b { font-size: 20px; }
.screen.game.build.crush:not(.review):not(.end) .build-count small { font-size: 10px; }
.screen.game.build.crush:not(.review):not(.end) .build-score { grid-column: 2; justify-self: end; }
.screen.game.build.crush:not(.review):not(.end) .build-score b { font-size: 20px; }
.screen.game.build.crush:not(.review):not(.end) .build-combo, .screen.game.build.crush:not(.review):not(.end) .build-label { display: none; }
@media (max-width: 350px) {   /* 很窄的手機：條數只留數字、分數字再小一點，才不會壓到時間 */
  .screen.game.build.crush:not(.review):not(.end) .build-count small { display: none; }
  .screen.game.build.crush:not(.review):not(.end) .build-score b { font-size: 17px; }
  .screen.game.build.crush:not(.review):not(.end) > .build-hud:not([hidden]) { left: 56px; right: 56px; gap: 64px; }
}

/* 特殊方塊的光束會比盤面長（斜十字最明顯）：用跟盤面一樣大的框裁掉，才不會撐大頁面（手機上會整頁縮放、跑版） */
.m3-beamclip { position: absolute; inset: 0; overflow: hidden; z-index: 3; pointer-events: none; }
/* 保險：任何特效（放大的表情、光束、彈跳）往左右伸出去都不撐寬頁面。clip 不會像 hidden 那樣讓另一個方向變成可捲動 */
#app { overflow-x: clip; }
/* 系統開了「減少動態效果」：整個畫面一律不抖 */
@media (prefers-reduced-motion: reduce) { #app.shake-sm, #app.shake-md, #app.shake-lg { animation: none; } }
/* 公投頁：我們加的白話補充，跟官方原文分開、字小一點 */
.rf-facts .rf-plain { display: block; margin-top: 4px; font-size: 12px; line-height: 1.5; opacity: .78; }

/* 公報上的「過去政績」：跟政見區分開的標籤 */
.bubble .who .co-kind.past { background: #e6e0f5; color: #4b3a86; }

/* 結算：今日名次蓋在星球右上角（#screen-game 的直屬層，不跟成績框捲動）。!important 同 .rank-stamp-pos 的原因 */
.rank-top-pos { position: absolute !important; z-index: 3 !important; top: 58px; right: 14px; margin: 0; pointer-events: none; animation: deBounce .6s cubic-bezier(.2,1.8,.4,1) both; }
@media (prefers-reduced-motion: reduce) { .rank-top-pos { animation: none; } }
/* ---------- 三消電腦版（企劃 11/22）：維持直式（盤面在上、對話框在下），整欄跟著視窗高度加寬，6×6 盤面用滿高度 ----------
   body.m3-wide 由 app.js 的 m3Start 加上（視窗寬 700 以上）；時間到、離開遊戲或換玩法就拿掉。
   寬度＝視窗高度的 62%（接近手機直式的比例），最窄 480px（原本的寬度），最寬 760px。 */
body.m3-wide #app { max-width: clamp(480px, 62vh, 760px); }
/* 盤面後面墊一塊半透明深色，星球背景才不會跟方塊搶（電腦版背景露出來的面積大） */
body.m3-wide .screen.game.build.crush .m3::before { content: ''; position: absolute; inset: 0 -10px -10px; border-radius: 0 0 18px 18px; background: rgba(22,16,48,.5); z-index: -2; }

/* 選擇玩法頁底部四顆按鈕（企劃 11/22）：平均排一列，圖示在上、往上突出邊框，字在下。蓋過上面兩顆大按鈕的橫式排法 */
.mode-foot.four { gap: 8px; padding: 34px 0 4px; }
.mode-foot.four .mode-btn { min-width: 0; height: 60px; padding: 26px 2px 0; border-radius: 16px; }
.mode-foot.four .mode-btn img, .mode-foot.four .mode-ico { position: absolute; left: 50%; top: -26px; bottom: auto; width: 54px; height: 54px; transform: translateX(-50%); pointer-events: none; }
.mode-foot.four .mode-ico { display: grid; place-items: center; color: var(--candy-ink); filter: drop-shadow(0 4px 4px rgba(0,0,0,.15)); }
.mode-foot.four .mode-ico svg { width: 44px; height: 44px; }
.mode-foot.four .mode-btn b { font-size: 13.5px; }
.mode-foot.four .dex-badge { top: -10px; right: -4px; }
@media (max-width: 360px) { .mode-foot.four { gap: 6px; } .mode-foot.four .mode-btn b { font-size: 12.5px; } }

/* 首頁最下面一列：遊戲聲明＋三個官方社群圖示。更新公告收在遊戲聲明視窗裡；有新公告時「遊戲聲明」右上角一顆紅色「！」（企劃 11/22） */
.notice-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.notice-row .notice-btn { margin: 0; position: relative; }
.news-dot { position: absolute; top: -9px; right: -7px; width: 21px; height: 21px; border-radius: 50%; background: #e0463b; color: #fff; font-style: normal; font-size: 14px; font-weight: 900; line-height: 21px; text-align: center; box-shadow: 0 2px 0 rgba(0,0,0,.2); animation: newsDot 1.6s ease-in-out infinite; }
@keyframes newsDot { 0%, 100% { transform: none; } 50% { transform: translateY(-3px) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .news-dot { animation: none; } }
.news-item { margin: 0 0 14px; }
.news-item h3 { margin: 0 0 6px; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.news-new { font-style: normal; font-size: 11px; font-weight: 900; color: #fff; background: #e0463b; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.news-item ul { margin: 0; padding-left: 1.25em; font-size: 14px; line-height: 1.65; }
.news-item li { margin: 2px 0; }

/* 各層按鈕上的「！」：樣式同更新公告那一顆；按鈕本身要能當定位的基準 */
.has-new { position: relative; }
.candy-start > .new-dot { top: -6px; right: 6px; width: 26px; height: 26px; line-height: 26px; font-size: 17px; }
.mode-go > .new-dot { top: -8px; right: -4px; }

/* 圖鑑：候選人偷偷講話（dex.js 的 dexTalkTick）。講話的那一位頭像切成上下兩片開合（同 .mini.talker），旁邊冒一個三個點的小泡泡 */
.dex-av.talker { position: relative; display: block; overflow: visible; background: radial-gradient(circle at 60% 66%, #e4687a 0 22%, #5b1622 23%); }
.dex-av.talker img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; }
.dex-say { position: absolute; right: -10px; top: -9px; display: flex; gap: 2px; align-items: center; padding: 4px 5px; border-radius: 9px 9px 9px 2px; background: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.18); z-index: 2; animation: dexSayIn .25s cubic-bezier(.2,1.8,.4,1) both; }
.dex-say b { width: 4px; height: 4px; border-radius: 50%; background: #5a4630; animation: dexSayDot .9s ease-in-out infinite; } .dex-say b:nth-child(2) { animation-delay: .15s; } .dex-say b:nth-child(3) { animation-delay: .3s; }
@keyframes dexSayIn { from { transform: scale(0); } to { transform: none; } }
@keyframes dexSayDot { 0%, 100% { transform: none; opacity: .5; } 40% { transform: translateY(-3px); opacity: 1; } }
.dex-row.speaking .dex-av, .dex-head.speaking .dex-av { animation: dexNod 1.1s ease-in-out infinite; }
@keyframes dexNod { 0%, 100% { transform: none; } 50% { transform: rotate(-4deg) translateY(-1px); } }
@media (prefers-reduced-motion: reduce) { .dex-say, .dex-say b, .dex-row.speaking .dex-av, .dex-head.speaking .dex-av { animation: none; } }
/* 首頁公告列的 Discord 連結：跟旁邊兩顆同一個樣子，圖示用 Discord 的品牌色 */
/* 首頁的官方社群：三顆只有圖示的圓形連結，跟「遊戲聲明」排同一列（.notice-row） */
.notice-row { align-items: center; }
.notice-box .news-entry { position: relative; margin: 0 auto 12px; }   /* 遊戲聲明視窗裡的「更新公告」入口 */
.social-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--card-face); color: var(--ink); box-shadow: 0 3px 0 rgba(0,0,0,.18); text-decoration: none; }
.social-btn svg { width: 20px; height: 20px; }
.social-btn:active { transform: translateY(2px); box-shadow: none; }
.social-btn.discord svg { color: #5865f2; }
.social-btn.ig svg { color: #d62976; }

/* 翻牌牌面下面那行「市長 5號」：字級跟著牌寬縮（電腦視窗矮的時候一張牌只有 55 點寬，固定 10px 會被裁掉；玩家 11/22 回報） */
.card-front .namebar small { font-size: clamp(8px, calc(var(--cw) * .15), 10px); }

/* 圖鑑「全部已讀」（企劃 11/22）：總覽在總數卡片右邊；候選人／主題那一頁在貼紙格上面一列。有新的才出現 */
.dex-readall { flex: none; border: 0; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 900; color: #5a4300; background: #ffc928; box-shadow: 0 2px 0 rgba(0,0,0,.15); white-space: nowrap; }
.dex-readall:active { transform: translateY(2px); box-shadow: none; }
.dex-readrow { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 8px 2px 0; font-size: 12.5px; font-weight: 700; color: #6a6080; }
