/* * 任期小遊戲(tm-):台式競選文宣 × 立體桌遊。粗黑框、錯位硬陰影、螢光黃重點、圈選章紅。 * 手機直式優先,按鈕至少 44px。減少動態效果時只留淡入淡出。 */ .tm-screen, .tm-preview { box-sizing: border-box; width: 100%; display: grid; gap: 14px; max-width: 560px; margin: 0 auto; padding: 12px 16px 32px; color: var(--ink); } .tm-preview > .tm-screen { padding: 0; } .tm-preview h2 { margin: 8px 0 0; font-family: var(--font-serif); font-size: 26px; } /* ── 外框 ── */ .tm-game { position: relative; background: var(--surface); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--shadow-ink); padding: 14px; display: grid; gap: 12px; overflow: hidden; } .tm-game-head { display: flex; align-items: center; gap: 10px; } .tm-game-head h3 { margin: 0; font-family: var(--font-serif); font-size: 22px; letter-spacing: 0.04em; } .tm-game-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 10px; background: var(--signal); color: var(--signal-ink, var(--ink)); box-shadow: 2px 2px 0 var(--shadow-ink); transform: rotate(-4deg); } .tm-intro, .tm-done { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 10px 4px 6px; animation: tm-in 260ms var(--ease-out) both; } .tm-intro p, .tm-done p { margin: 0; font-size: 16px; line-height: 1.6; text-wrap: pretty; } .tm-start, .tm-done .btn, .tm-next { min-height: 48px; min-width: 160px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; } .tm-done-score { display: inline-flex; align-items: baseline; gap: 4px; font-family: var(--font-num); animation: tm-stamp-in 380ms var(--ease-out) both; } .tm-done-score b { font-size: 72px; line-height: 1; color: var(--stamp); border: 4px solid var(--stamp); border-radius: 14px; padding: 2px 14px; transform: rotate(-6deg); display: inline-block; } .tm-done-score small { font-size: 20px; font-weight: 800; } .tm-play { position: relative; display: grid; gap: 12px; min-height: 340px; align-content: start; } /* ── 計時、資源、量表 ── */ .tm-timer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; font-family: var(--font-num); font-weight: 800; } .tm-timer b { font-size: 20px; min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; } .tm-timer-track, .tm-meter, .tm-ctrl, .tm-alloc-bar { position: relative; display: block; height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface-2); overflow: hidden; } .tm-timer-track > i, .tm-meter > i, .tm-ctrl > i, .tm-alloc-bar > i { position: absolute; inset: 0; transform-origin: left center; background: var(--signal); transition: transform 120ms linear; } .tm-timer.is-warn { color: var(--stamp); } .tm-timer.is-warn .tm-timer-track > i { background: var(--stamp); } .tm-meter { display: inline-block; width: 64px; height: 10px; vertical-align: middle; margin-left: 6px; } .tm-meter > i { background: var(--good); transition-duration: 300ms; } .tm-res { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--muted); } .tm-res b { color: var(--ink); font-family: var(--font-num); font-size: 18px; margin: 0 2px; } /* ── 選項按鈕(陳情、白話說明、預覽) ── */ .tm-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .tm-choices-col { grid-template-columns: 1fr; } .tm-choice, .tm-evi, .tm-article, .tm-step, .tm-sign, .tm-push, .tm-cut, .tm-pass { min-height: 52px; border: 2px solid var(--ink); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: 3px 3px 0 var(--shadow-ink); font: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; transition: transform 100ms var(--ease-out), box-shadow 100ms var(--ease-out), background-color 150ms ease, opacity 150ms ease; } .tm-choice { display: grid; gap: 2px; padding: 8px 10px; text-align: left; } .tm-choice b { font-size: 16px; line-height: 1.35; } .tm-choice small { color: var(--muted); font-family: var(--font-num); font-size: 13px; } .tm-choice.is-on { background: var(--signal); color: var(--signal-ink, var(--ink)); } :is(.tm-choice, .tm-evi, .tm-article, .tm-step, .tm-sign, .tm-push, .tm-cut, .tm-pass):active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-ink); } :is(.tm-choice, .tm-evi, .tm-article, .tm-step, .tm-sign, .tm-push, .tm-cut, .tm-pass):disabled { opacity: 0.4; box-shadow: none; cursor: default; } @media (hover: hover) and (pointer: fine) { :is(.tm-choice, .tm-evi, .tm-article, .tm-step, .tm-sign):hover:not(:disabled) { background: var(--signal); color: var(--signal-ink, var(--ink)); } } /* ── 效果字(漫畫字) ── */ .tm-pop { position: absolute; z-index: 5; pointer-events: none; translate: -50% -50%; font-family: var(--font-serif); font-weight: 900; font-size: 26px; white-space: nowrap; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 8px; background: var(--surface); box-shadow: 3px 3px 0 var(--shadow-ink); animation: tm-pop 900ms var(--ease-out) both; } .tm-pop.is-good { background: var(--good); color: #fff; } .tm-pop.is-bad { background: var(--surface-2); color: var(--stamp); font-size: 20px; } .tm-pop.is-boom { background: var(--signal); color: var(--signal-ink, var(--ink)); font-size: 34px; transform: rotate(-6deg); } /* ── 陳情 ── */ .tm-petition-card { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 12px; border: 2px solid var(--ink); border-radius: 14px; background: var(--surface-2); box-shadow: 3px 3px 0 var(--shadow-ink); animation: tm-deal 280ms var(--ease-out) both; } .tm-petition-card b { font-size: 14px; color: var(--muted); } .tm-petition-card p { margin: 4px 0 0; font-size: 17px; line-height: 1.5; font-weight: 700; } /* ── 質詢 ── */ .tm-inter-stage { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; } .tm-official { position: relative; display: grid; justify-items: center; gap: 4px; } .tm-official.is-sweating .avatar { animation: tm-wobble 600ms ease-in-out infinite; } .tm-nameplate { display: grid; justify-items: center; font-weight: 800; font-size: 14px; padding: 2px 8px; background: var(--ink); color: var(--surface); border-radius: 6px; } .tm-nameplate small { font-size: 11px; font-weight: 500; opacity: 0.8; } .tm-sweat { position: absolute; top: -4px; right: -8px; font-size: 18px; } .tm-bubble { position: relative; display: grid; gap: 6px; padding: 12px 14px 16px; border: 2px solid var(--ink); border-radius: 14px; background: var(--surface); box-shadow: 3px 3px 0 var(--shadow-ink); overflow: hidden; animation: tm-in 220ms var(--ease-out) both; } .tm-bubble small { color: var(--muted); font-size: 12px; } .tm-bubble p { margin: 0; font-size: 19px; line-height: 1.45; font-weight: 800; font-family: var(--font-serif); } .tm-line-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--signal); transform-origin: left; animation: tm-drain linear both; } .tm-score-line { font-size: 14px; color: var(--muted); } .tm-score-line b { color: var(--ink); font-family: var(--font-num); font-size: 18px; } .tm-evidence { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .tm-evi { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; font-size: 17px; background: var(--surface-2); } .tm-evi:nth-child(odd) { transform: rotate(-1deg); } .tm-evi:nth-child(even) { transform: rotate(1deg); } /* ── 講解法條 ── */ .tm-seats { display: grid; justify-items: center; gap: 2px; } .tm-seats svg { width: 100%; max-width: 300px; height: auto; } .tm-seats circle { fill: var(--surface-2); stroke: var(--ink); stroke-width: 1.5; transition: fill 250ms ease; } .tm-seats circle.is-lit { fill: var(--signal); } .tm-seats-podium { fill: var(--ink); } .tm-seats > b { font-family: var(--font-num); font-size: 28px; line-height: 1; } .tm-seats > b small { font-size: 14px; color: var(--muted); margin-left: 4px; } .tm-seats > b.is-pass { color: var(--good); } .tm-articles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; } .tm-article { width: 100%; display: grid; gap: 2px; padding: 6px 2px; text-align: center; } .tm-article b { font-size: 15px; } .tm-article small { font-size: 11px; color: var(--muted); } .tm-article.is-filled { background: var(--signal); color: var(--signal-ink, var(--ink)); opacity: 1; } .tm-article.is-filled small { color: inherit; } .tm-fragment { padding: 12px 14px; border: 2px dashed var(--ink); border-radius: 12px; background: var(--paper); animation: tm-deal 240ms var(--ease-out) both; } .tm-fragment small { color: var(--muted); font-size: 12px; } .tm-fragment p { margin: 4px 0 0; font-family: var(--font-news, var(--font-serif)); font-size: 17px; line-height: 1.6; } .tm-ask { margin: 0; font-weight: 800; } /* ── 搶主席台 ── */ .tm-brawl-floor { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 6px; min-height: 170px; padding: 12px 8px 10px; border: 2px solid var(--ink); border-radius: 14px; background: linear-gradient(var(--surface-2) 62%, color-mix(in srgb, var(--board-wood, #b98a5a) 60%, var(--surface)) 62%); overflow: hidden; } .tm-crowd { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; position: relative; } .tm-crowd > span { flex-basis: 100%; text-align: center; font-size: 12px; font-weight: 800; } .tm-crowd.is-us { animation: tm-shove 420ms ease-in-out infinite; } .tm-crowd.is-them { animation: tm-shove 460ms ease-in-out infinite reverse; } .tm-crowd.is-paused { animation: none; opacity: 0.55; } .tm-crowd.is-paused::after { content: "愣住"; position: absolute; top: -6px; right: 0; font-size: 12px; font-weight: 800; background: var(--surface); border: 1.5px solid var(--ink); border-radius: 6px; padding: 0 4px; } .tm-podium { align-self: center; display: grid; place-items: center; width: 82px; height: 58px; border: 3px solid var(--ink); border-radius: 8px 8px 4px 4px; background: var(--stamp); color: #fff; font-family: var(--font-serif); font-weight: 900; box-shadow: 3px 3px 0 var(--shadow-ink); transition: transform 140ms var(--ease-out); } .tm-mic { position: absolute; z-index: 4; translate: -50% -50%; display: grid; place-items: center; width: 56px; height: 56px; border: 3px solid var(--ink); border-radius: 50%; background: var(--signal); color: var(--ink); box-shadow: 3px 3px 0 var(--shadow-ink); cursor: pointer; touch-action: manipulation; animation: tm-mic 1600ms linear both; } .tm-ctrl { height: 20px; } .tm-ctrl > i { background: var(--muted); transition-duration: 100ms; } .tm-ctrl.is-hold > i { background: var(--signal); } .tm-ctrl-line { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--stamp); translate: -50% 0; } .tm-brawl-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; } .tm-sign { display: grid; justify-items: center; align-content: center; gap: 0; padding: 6px; } .tm-sign b { font-size: 16px; } .tm-sign small { font-size: 12px; color: var(--muted); font-family: var(--font-num); } .tm-push { min-height: 92px; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--stamp); color: #fff; font-family: var(--font-serif); font-size: 34px; font-weight: 900; border-width: 3px; box-shadow: 5px 5px 0 var(--shadow-ink); } .tm-push:active { transform: translate(3px, 3px) scale(0.98); box-shadow: 1px 1px 0 var(--shadow-ink); } /* ── 分預算 ── */ .tm-typhoon { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 12px; background: var(--stamp); color: #fff; animation: tm-deal 280ms var(--ease-out) both; } .tm-typhoon > span { display: grid; gap: 0; font-size: 14px; } .tm-typhoon b { font-size: 17px; } .tm-typhoon.is-done { background: var(--good); } .tm-typhoon .tm-step { color: var(--ink); } .tm-alloc { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; } .tm-alloc li { display: grid; grid-template-columns: 3em 48px 1fr 48px; align-items: center; gap: 8px; } .tm-alloc li > b { font-size: 16px; } .tm-step { display: grid; place-items: center; width: 48px; min-height: 44px; padding: 0; } .tm-alloc-bar { height: 26px; border-radius: 8px; } .tm-alloc-bar > i { transition-duration: 180ms; transition-timing-function: var(--ease-out); } .tm-alloc-bar > em { position: relative; display: block; text-align: center; line-height: 22px; font-style: normal; font-family: var(--font-num); font-weight: 800; font-size: 15px; } .tm-districts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .tm-district { display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; align-items: center; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 10px; background: var(--surface-2); transition: background-color 250ms ease; } .tm-district small { grid-column: 1 / -1; font-size: 11px; color: var(--muted); } .tm-district .tm-meter { width: 100%; margin: 0; } .tm-district em { font-style: normal; font-family: var(--font-num); font-weight: 800; font-size: 18px; } .tm-district.is-high { background: color-mix(in srgb, var(--good) 22%, var(--surface)); } .tm-district.is-low { background: color-mix(in srgb, var(--stamp) 18%, var(--surface)); } .tm-district.is-storm { border-style: dashed; } /* ── 審預算 ── */ .tm-item { position: relative; display: grid; gap: 6px; justify-items: center; text-align: center; padding: 18px 14px; border: 2px solid var(--ink); border-radius: 14px; background: var(--paper); box-shadow: 4px 4px 0 var(--shadow-ink); animation: tm-deal 240ms var(--ease-out) both; } .tm-item small { color: var(--muted); font-size: 12px; } .tm-item b { font-family: var(--font-serif); font-size: 22px; line-height: 1.35; } .tm-item em { font-style: normal; font-family: var(--font-num); font-size: 30px; font-weight: 800; color: var(--stamp); } .tm-review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .tm-cut, .tm-pass { min-height: 72px; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-serif); font-size: 26px; font-weight: 900; } .tm-cut { background: var(--stamp); color: #fff; } .tm-pass { background: var(--good); color: #fff; } /* ── 任期進度、回顧 ── */ .tm-screen-head { display: grid; gap: 6px; } .tm-screen-head small { color: var(--muted); font-weight: 700; } .tm-screen-head h2 { margin: 0; font-family: var(--font-serif); font-size: 28px; letter-spacing: 0.04em; } .tm-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; } .tm-steps li { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 4px; border: 2px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); } .tm-steps li span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); font-family: var(--font-num); } .tm-steps li.is-now { border-color: var(--ink); background: var(--signal); color: var(--signal-ink, var(--ink)); } .tm-steps li.is-done { border-color: var(--ink); color: var(--ink); padding-left: 8px; } .tm-steps li.is-now span { background: var(--surface); color: var(--ink); } .tm-review-card { display: grid; gap: 14px; padding: 16px; border: 3px solid var(--ink); border-radius: 16px; background: var(--surface); box-shadow: 4px 4px 0 var(--shadow-ink); animation: tm-in 300ms var(--ease-out) both; } .tm-review-card h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-family: var(--font-serif); font-size: 22px; } .tm-headlines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; } .tm-headlines li { padding: 10px 12px; border: 1.5px solid var(--ink); border-left-width: 6px; border-radius: 6px; background: var(--paper); font-family: var(--font-news, var(--font-serif)); font-weight: 700; font-size: 16px; line-height: 1.5; animation: tm-deal 320ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 140ms); } .tm-gains { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .tm-gain { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border: 2px solid var(--ink); border-radius: 12px; background: var(--surface-2); text-align: center; } .tm-gain span { font-size: 12px; color: var(--muted); } .tm-gain b { font-family: var(--font-num); font-size: 26px; line-height: 1.1; white-space: nowrap; } .tm-gain b small { font-size: 14px; margin-left: 2px; } .tm-gain:first-child { background: var(--signal); color: var(--signal-ink, var(--ink)); } .tm-gain:first-child span { color: inherit; } .tm-next { justify-self: center; } /* ── 預覽頁 ── */ .tm-preview-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); gap: 8px; } .tm-preview-stages .tm-choice { min-width: 0; } .tm-preview-stages .tm-choice { text-align: center; justify-items: center; } .tm-preview-name { display: grid; gap: 4px; font-weight: 700; } .tm-preview-name input { min-height: 44px; padding: 0 12px; border: 2px solid var(--ink); border-radius: 10px; font: inherit; font-size: 16px; background: var(--surface); color: var(--ink); } .tm-preview-json { margin: 0; padding: 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--surface-2); font-size: 12px; white-space: pre-wrap; word-break: break-all; } /* ── 震動(輕/重) ── */ .tm-shake-small { animation: tm-shake-s 260ms ease-out; } .tm-shake-large { animation: tm-shake-l 420ms ease-out; } @keyframes tm-in { from { opacity: 0; transform: translateY(8px); } } @keyframes tm-deal { from { opacity: 0; transform: translateY(16px) rotate(-1.5deg); } } @keyframes tm-stamp-in { from { opacity: 0; transform: scale(1.6); } 60% { opacity: 1; transform: scale(0.95); } } @keyframes tm-pop { 0% { opacity: 0; scale: 0.6; } 18% { opacity: 1; scale: 1.12; } 30% { scale: 1; } 75% { opacity: 1; } 100% { opacity: 0; translate: -50% -110%; } } @keyframes tm-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } } @keyframes tm-wobble { 50% { transform: rotate(-3deg) translateX(-2px); } } @keyframes tm-shove { 50% { transform: translateX(4px); } } @keyframes tm-mic { 0% { opacity: 0; scale: 0.4; } 15% { opacity: 1; scale: 1.1; } 25% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0.2; scale: 0.85; } } @keyframes tm-shake-s { 20% { transform: translate(-4px, 1px); } 40% { transform: translate(3px, -2px); } 60% { transform: translate(-2px, 1px); } 80% { transform: translate(1px, 0); } } @keyframes tm-shake-l { 15% { transform: translate(-8px, 3px) rotate(-0.6deg); } 30% { transform: translate(7px, -4px) rotate(0.5deg); } 45% { transform: translate(-5px, 2px); } 60% { transform: translate(4px, -1px); } 80% { transform: translate(-2px, 0); } } @keyframes tm-fade { from { opacity: 0; } } @media (max-width: 380px) { .tm-choices { grid-template-columns: 1fr; } .tm-articles { grid-template-columns: repeat(2, 1fr); } .tm-inter-stage { grid-template-columns: 1fr; justify-items: center; } } /* 減少動態效果:不震、不彈、不晃,只淡入淡出 */ @media (prefers-reduced-motion: reduce) { .tm-intro, .tm-done, .tm-done-score, .tm-petition-card, .tm-bubble, .tm-fragment, .tm-typhoon, .tm-item, .tm-review-card, .tm-headlines li, .tm-pop, .tm-mic { animation: tm-fade 200ms ease both; } .tm-crowd.is-us, .tm-crowd.is-them, .tm-official.is-sweating .avatar, .tm-shake-small, .tm-shake-large { animation: none; } .tm-line-timer { animation-name: tm-drain; } .tm-podium, .tm-timer-track > i, .tm-meter > i, .tm-ctrl > i, .tm-alloc-bar > i { transition: none; } } /* 任期開始前的任務簡報 */ .tm-brief { display: grid; gap: 12px; padding: 18px; border: 3px solid var(--ink); border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 5px 5px 0 var(--shadow-ink); } .tm-brief h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-family: var(--font-serif); font-size: 22px; } .tm-brief > p { margin: 0; color: var(--muted); } .tm-brief-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; } .tm-brief-list li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--ink); background: var(--surface-2); animation: tm-brief-in 320ms var(--ease-out) calc(var(--i, 0) * 80ms) both; } .tm-brief-list b { font-size: 17px; } .tm-brief-list span { font-size: 14px; } .tm-brief-list small { font-size: 13px; color: var(--muted); } .tm-brief-reward { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; font-weight: 800; } .tm-brief-reward span { display: inline-flex; align-items: center; gap: 4px; } .tm-brief-reward svg { color: var(--stamp); } @keyframes tm-brief-in { from { opacity: 0; transform: translateY(8px); } } /* 每個小遊戲開始前的一二三步 */ .tm-howto { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; text-align: left; font-size: 15px; line-height: 1.5; } .tm-howto li::marker { font-weight: 900; color: var(--stamp); } .tm-howto-reward { margin: 0; font-size: 13px; color: var(--muted); text-align: left; } .tm-gain.is-exp { margin-top: 4px; } @media (prefers-reduced-motion: reduce) { .tm-brief-list li { animation: none; } }