:root {
  --bg: #FFF6EA; --ink: #2B2B2B; --ink2: #6B6259; --card: #FFFFFF; --line: #EADFCF;
  --or: #FF8A3D; --or-d: #D9681F; --lime: #A8E01B; --lime-d: #7FAF0C; --blue: #3D7BFF; --blue-d: #2A5BD0;
  --red: #F0433A; --gold: #FFC531; --vh: 100dvh;
  --r: 18px; --sh: 0 4px 0 rgba(0,0,0,.12);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { min-height: var(--vh); overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; font-size: 17px; }
a { color: inherit; }
#app { max-width: 520px; margin: 0 auto; min-height: var(--vh); position: relative; }
.screen { display: none; flex-direction: column; min-height: var(--vh); padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
.screen.active { display: flex; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
[hidden] { display: none !important; }

/* 按鈕 */
.primary, .secondary, .ghost { border-radius: 14px; padding: 12px 18px; font-weight: 800; font-size: 17px; transition: transform .08s; }
.primary { background: var(--or); color: #fff; box-shadow: 0 4px 0 var(--or-d); }
.secondary { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--line); border: 2px solid var(--line); }
.ghost { color: var(--ink2); }
.primary:active, .secondary:active, .big:active, .mid:active, .daily-card:active, .tile:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.big-btn { width: 100%; padding: 15px; font-size: 19px; }
.small { padding: 7px 12px; font-size: 14px; }
.primary:disabled { background: #C9C0B4; box-shadow: 0 4px 0 #A9A094; }

/* 首頁 */
.home-hd { text-align: center; margin: 18px 0 14px; }
.logo-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.logo-row .eyes { font-size: 40px; animation: look 4s infinite; display: inline-block; }
@keyframes look { 0%, 40%, 100% { transform: translateX(0); } 45%, 60% { transform: translateX(-5px); } 65%, 80% { transform: translateX(5px); } }
.home-hd h1 { margin: 0; font-size: 42px; font-weight: 900; letter-spacing: 2px; background: linear-gradient(90deg, #FF8A3D, #FF4D8D 50%, #7A5CFF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag { margin: 4px 0 0; color: var(--ink2); font-weight: 600; }
.daily-card { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 16px 18px; border-radius: 20px; background: linear-gradient(120deg, #2B2B2B, #45403A); color: #fff; box-shadow: 0 5px 0 #000; text-align: left; margin-bottom: 14px; }
.daily-card b { font-size: 19px; display: block; }
.daily-card small { color: #D8CFC4; font-size: 13px; }
.dc-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.streak { font-weight: 800; font-size: 15px; }
.dc-go { background: var(--lime); color: #233; padding: 6px 12px; border-radius: 99px; font-weight: 900; font-size: 14px; }
.daily-card.done .dc-go { background: #6a6158; color: #fff; }
.menu { display: flex; flex-direction: column; gap: 12px; }
.big { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border-radius: 20px; color: #fff; text-align: left; }
.big .ic { font-size: 34px; }
.big b { font-size: 21px; display: block; }
.big small { font-size: 13px; opacity: .9; }
.b-theme { background: var(--or); box-shadow: 0 5px 0 var(--or-d); }
.b-mp { background: var(--blue); box-shadow: 0 5px 0 var(--blue-d); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mid { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 12px; box-shadow: var(--sh); display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.mid .ic { font-size: 24px; }
.mid b { font-size: 16px; margin-top: 2px; }
.mid small { color: var(--ink2); font-size: 12px; }
.foot { margin-top: auto; padding-top: 22px; text-align: center; font-size: 12px; color: var(--ink2); }
.foot .cg { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; }
.foot .cg img { width: 22px; height: 22px; border-radius: 6px; }
.foot .links { margin-top: 6px; }
.foot .links a { text-decoration: none; }

/* 頂欄 */
.topbar { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; margin-bottom: 8px; }
.topbar h2 { margin: 0; font-size: 21px; text-align: center; }
.back, .icon-btn { width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 2px solid var(--line); font-size: 18px; font-weight: 900; }
.pill { background: #fff; border: 2px solid var(--line); border-radius: 99px; padding: 4px 10px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.sub-note { text-align: center; color: var(--ink2); font-size: 13px; margin: 0 0 12px; }

/* 主題格 */
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { position: relative; border-radius: 20px; padding: 14px 12px 12px; background: var(--tc); color: #fff; text-align: left; min-height: 128px; display: flex; flex-direction: column; box-shadow: 0 5px 0 rgba(0,0,0,.25); overflow: hidden; }
.tile .ti { font-size: 38px; line-height: 1; }
.tile .tn { font-weight: 900; font-size: 17px; margin-top: 8px; }
.tile .tst { margin-top: auto; font-size: 15px; letter-spacing: 1px; }
.tile .tst .off { opacity: .35; }
.tile .tcol { font-size: 11px; opacity: .9; }
.tile .ring { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(#fff var(--p), rgba(255,255,255,.25) 0); display: grid; place-items: center; }
.tile .ring::after { content: attr(data-t); width: 26px; height: 26px; border-radius: 50%; background: var(--tc); display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.tile.locked { background: #CFC6BA; color: #fff; }
.tile.locked .ti { filter: grayscale(1); opacity: .5; }
.tile .lock { margin-top: auto; font-size: 13px; font-weight: 800; }
.tile.new::before { content: 'NEW'; position: absolute; top: 10px; right: 10px; background: var(--lime); color: #233; font-size: 11px; font-weight: 900; padding: 2px 7px; border-radius: 99px; }

/* 遊戲畫面 */
#s-game { padding-top: 10px; gap: 8px; height: var(--vh); min-height: 0; overflow: hidden; }
.g-top { display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: 10px; }
.g-prog { font-weight: 900; font-size: 16px; }
.g-lives { font-size: 16px; letter-spacing: 1px; }
.g-score { font-weight: 900; font-size: 22px; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.g-score.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.35); color: var(--or); } }
.g-timer { height: 10px; background: #EDE3D5; border-radius: 99px; overflow: hidden; }
.g-timer i { display: block; height: 100%; width: 100%; background: var(--lime); border-radius: 99px; transform-origin: left; }
.g-timer i.mid { background: var(--gold); }
.g-timer i.low { background: var(--red); animation: blink .5s infinite; }
@keyframes blink { 50% { opacity: .55; } }
.g-meta { display: flex; justify-content: space-between; align-items: center; min-height: 24px; }
.g-type { font-size: 13px; font-weight: 800; color: var(--ink2); background: #fff; border: 2px solid var(--line); padding: 2px 9px; border-radius: 99px; }
.g-type.gold { background: var(--gold); border-color: #E0A800; color: #5A3B00; animation: glow 1.2s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 14px #FFC531; } }
.g-combo { font-weight: 900; color: var(--or); font-size: 16px; }
.g-combo.on { animation: bump .4s; }
.stage-wrap { position: relative; flex: 1 1 auto; min-height: 150px; max-height: 56vh; }
.stage { position: absolute; inset: 0; border-radius: var(--r); overflow: hidden; }
.stage .frame { position: absolute; inset: 0; background: #17161A; overflow: hidden; border-radius: var(--r); }
.stage.k-logo .frame { background: #fff; border: 2px solid var(--line); }
.stage .pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; will-change: transform; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.stage.k-logo .pic { inset: 7%; width: 86%; height: 86%; }
.stage .pic.sil { filter: brightness(0) blur(1px); }
.stage .pic { transition: filter 1.2s ease; }
.stage .pic.hidden-pic { visibility: hidden; }
.stage .pix { position: absolute; inset: 0; width: 100%; height: 100%; }
.tiles { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 3px; padding: 0; }
.tl { background: var(--c); display: grid; place-items: center; color: rgba(255,255,255,.75); font-weight: 900; font-size: 26px; transition: transform .45s cubic-bezier(.5,1.6,.4,1), opacity .4s; background-image: radial-gradient(rgba(255,255,255,.18) 2px, transparent 2px); background-size: 14px 14px; }
.tl.open { transform: rotateY(90deg) scale(.7); opacity: 0; }
.hints { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; pointer-events: none; }
.hint-chip { background: rgba(255,255,255,.95); color: var(--ink); border-radius: 99px; padding: 4px 11px; font-weight: 800; font-size: 14px; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.hint-chip .boxes { letter-spacing: 2px; }
.pop-in { animation: popIn .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes popIn { from { transform: scale(.4); opacity: 0; } }
.stage.txt { background: #fff; border: 2px solid var(--line); }
.card { position: absolute; inset: 0 0 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px; text-align: center; }
.q-lab { font-weight: 800; color: var(--ink2); font-size: 14px; margin-bottom: 12px; }
.pal { display: flex; width: 92%; height: 34%; min-height: 70px; border-radius: 16px; overflow: hidden; box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.pal i { display: block; }
.pal i.w, .dots i.w, .sw.w { box-shadow: inset 0 0 0 2px #E4DACB; }
.dots { display: flex; gap: 12px; margin-top: 16px; }
.dots i { width: 38px; height: 38px; border-radius: 50%; display: block; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.quote { font-size: clamp(20px, 6vw, 28px); font-weight: 900; line-height: 1.45; padding: 0 6px; }
.blank { color: var(--or); border-bottom: 3px dashed var(--or); padding: 0 4px; }
.blank.filled { border-bottom-style: solid; animation: popIn .4s; }
.emo { font-size: clamp(54px, 17vw, 84px); line-height: 1.2; letter-spacing: 4px; }
.clues { list-style: none; padding: 0; margin: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.clues li { background: #FFF6EA; border-radius: 12px; padding: 9px 12px; font-weight: 700; font-size: 16px; opacity: .12; filter: blur(3px); transition: opacity .4s, filter .4s; text-align: left; }
.clues li.on { opacity: 1; filter: none; animation: popIn .35s; }
.sw { display: inline-block; width: 20px; height: 20px; border-radius: 50%; vertical-align: -4px; margin-right: 4px; }
.g-ovl { position: absolute; inset: 0; z-index: 5; border-radius: var(--r); background: rgba(23,22,26,.78); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; text-align: center; }
.g-ovl .n { font-size: 84px; font-weight: 900; animation: popIn .4s; }
.g-ovl .t { font-size: 18px; font-weight: 800; }
.g-ovl .gold-b { font-size: 30px; font-weight: 900; color: var(--gold); animation: popIn .5s, glowT 1s infinite; }
@keyframes glowT { 50% { text-shadow: 0 0 20px #FFC531; } }
.g-ovl .spin { width: 40px; height: 40px; border: 4px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.g-feed { min-height: 30px; max-height: 92px; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.g-feed.chat { flex-direction: column; flex-wrap: nowrap; gap: 3px; max-height: 96px; }
.chip { background: #fff; border: 2px solid var(--line); border-radius: 99px; padding: 3px 10px; font-size: 14px; font-weight: 700; }
.chip.x { color: #9A8F84; text-decoration: line-through; }
.chip.close { border-color: var(--gold); background: #FFF4CC; color: #7A5600; text-decoration: none; }
.fd { font-size: 14px; line-height: 1.35; animation: fadeIn .2s; }
.fd .who { font-weight: 800; margin-right: 4px; }
.fd.c { color: #1E8F4E; font-weight: 800; }
.fd.m { color: var(--ink2); }
.fd.sys { color: var(--ink2); font-style: italic; }
.g-sugg { display: flex; gap: 6px; flex-wrap: wrap; min-height: 0; }
.g-sugg button { background: #fff; border: 2px solid var(--line); border-radius: 99px; padding: 5px 11px; font-weight: 700; font-size: 14px; }
.g-form { display: flex; gap: 8px; }
.g-form input { flex: 1; min-width: 0; border: 3px solid var(--ink); border-radius: 16px; padding: 12px 14px; background: #fff; font-size: 18px; font-weight: 700; outline: none; }
.g-form input:focus { border-color: var(--or); }
.g-form input:disabled { background: #F1EAE0; border-color: #CFC6BA; }
.g-form button { background: var(--ink); color: #fff; border-radius: 16px; padding: 0 18px; font-weight: 900; font-size: 17px; box-shadow: 0 4px 0 #000; }
.g-form.ok input { border-color: #1E8F4E; background: #E9FBEF; }
.g-tools { display: flex; justify-content: space-between; }
.g-tools button { font-weight: 800; color: var(--ink2); font-size: 14px; padding: 6px 4px; }
.g-tools button:disabled { opacity: .35; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.flash-ok { animation: flashOk .5s; }
@keyframes flashOk { 30% { box-shadow: 0 0 0 6px #A8E01B; } }
.float-pop { position: fixed; z-index: 60; transform: translate(-50%, -50%); font-weight: 900; font-size: 34px; color: var(--or); text-shadow: 0 2px 0 #fff, 0 0 12px rgba(255,255,255,.9); pointer-events: none; animation: floatUp 1.2s ease-out forwards; white-space: nowrap; }
.float-pop.gold { color: #E0A000; font-size: 40px; }
.float-pop.bad { color: var(--red); font-size: 24px; }
.float-pop.close { color: #C08A00; font-size: 26px; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.5); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }

/* 揭曉 */
.reveal { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; padding: 0 10px calc(10px + env(safe-area-inset-bottom)); animation: slideUp .3s cubic-bezier(.2,1.2,.4,1); }
@keyframes slideUp { from { transform: translateY(100%); } }
.rv-card { background: #fff; border-radius: 24px; box-shadow: 0 -6px 30px rgba(0,0,0,.18); padding: 16px 16px 14px; border: 3px solid var(--ink); max-height: 62vh; overflow-y: auto; }
.rv-head { font-weight: 900; font-size: 18px; }
.rv-head.ok { color: #1E8F4E; }
.rv-head.no { color: var(--red); }
.rv-name { font-size: 32px; font-weight: 900; margin-top: 2px; line-height: 1.15; }
.rv-en { color: var(--ink2); font-weight: 700; font-size: 14px; }
.rv-rare { margin-top: 6px; font-weight: 800; color: #B35A00; font-size: 15px; }
.rv-fact { margin-top: 6px; font-size: 15px; line-height: 1.5; color: #4A433C; }
.rv-credit { margin-top: 8px; font-size: 11px; color: #9A8F84; word-break: break-all; }
.rv-credit a { color: inherit; }
.rv-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
#rv-next { position: relative; overflow: hidden; }
#rv-auto { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: rgba(255,255,255,.7); }
.rv-board { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.rv-board:empty { display: none; }
.rb { display: grid; grid-template-columns: 28px 30px 1fr auto auto; gap: 6px; align-items: center; padding: 6px 8px; border-radius: 12px; background: #FFF6EA; font-weight: 700; transition: transform .6s cubic-bezier(.3,1.3,.5,1); }
.rb.me { background: #FFE9C9; outline: 2px solid var(--or); }
.rb .rk { font-weight: 900; text-align: center; }
.rb .av { font-size: 20px; }
.rb .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb .gain { color: #1E8F4E; font-weight: 900; font-size: 14px; }
.rb .gain.zero { color: #B9AEA2; }
.rb .sc { font-weight: 900; font-variant-numeric: tabular-nums; min-width: 54px; text-align: right; }
.rb .up { color: #1E8F4E; font-size: 12px; margin-left: 4px; }
.rb .dn { color: var(--red); font-size: 12px; margin-left: 4px; }

/* 結算 */
.res { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding-top: 20px; }
.res-title { font-size: 26px; font-weight: 900; }
.res-stars { font-size: 46px; letter-spacing: 6px; min-height: 10px; }
.res-stars span { display: inline-block; animation: starIn .5s cubic-bezier(.3,1.8,.5,1) both; }
.res-stars .off { filter: grayscale(1); opacity: .25; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } }
.res-score { font-size: 56px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--or); line-height: 1; }
.res-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.res-stats span { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; font-weight: 800; font-size: 14px; }
.res-grid { font-size: 28px; letter-spacing: 3px; }
.res-new { width: 100%; }
.res-new .nt { font-weight: 900; margin-bottom: 6px; }
.res-new .nl { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.res-new .nl span { background: var(--lime); color: #233; border-radius: 99px; padding: 4px 10px; font-weight: 800; font-size: 14px; animation: popIn .4s both; }
.res-board { width: 100%; }
.res-board .bt { font-weight: 900; margin: 6px 0; }
.res-board ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.res-board li { display: flex; justify-content: space-between; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 6px 12px; font-weight: 700; }
.res-board li.me { border-color: var(--or); background: #FFE9C9; }
.res-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 10px; }

/* 圖鑑 */
.col-body { display: flex; flex-direction: column; gap: 16px; }
.col-sec h3 { margin: 0 0 8px; font-size: 16px; display: flex; justify-content: space-between; }
.col-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cb { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 8px 6px; text-align: center; font-weight: 800; font-size: 13px; min-height: 64px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.cb .cc { display: flex; justify-content: center; gap: 3px; }
.cb .cc i { width: 12px; height: 12px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.cb.no { background: #EFE7DC; color: #B9AEA2; border-style: dashed; }
.col-foot { margin-top: 16px; display: flex; justify-content: center; }

/* 對戰 */
.mp-entry, .lobby { display: flex; flex-direction: column; gap: 10px; }
.lab { font-weight: 800; color: var(--ink2); font-size: 14px; margin-top: 6px; }
.mp-entry input, .join-row input, .m-box input, .m-box select { border: 3px solid var(--ink); border-radius: 14px; padding: 11px 14px; background: #fff; font-weight: 700; width: 100%; }
.avs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.avs button { font-size: 26px; padding: 6px 0; border-radius: 12px; background: #fff; border: 2px solid var(--line); }
.avs button.on { border-color: var(--or); background: #FFE9C9; transform: scale(1.06); }
.or { text-align: center; color: var(--ink2); font-weight: 700; margin-top: 10px; }
.join-row { display: flex; gap: 8px; }
.join-row input { text-transform: uppercase; letter-spacing: 6px; text-align: center; font-size: 22px; font-weight: 900; }
.mp-msg { color: var(--red); font-weight: 700; min-height: 1em; text-align: center; margin: 4px 0; }
.mp-msg.info { color: var(--ink2); }
.code { letter-spacing: 3px; }
.net { font-size: 12px; font-weight: 800; color: var(--ink2); }
.net.bad { color: var(--red); }
.lb-share { display: flex; gap: 14px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 12px; }
.qr { width: 112px; height: 112px; flex: none; }
.qr img, .qr canvas, .qr svg { width: 100%; height: 100%; image-rendering: pixelated; }
.lb-share-r { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.big-code { font-size: 42px; font-weight: 900; letter-spacing: 8px; }
.players { display: flex; flex-wrap: wrap; gap: 8px; }
.pl { display: flex; align-items: center; gap: 6px; background: #fff; border: 2px solid var(--line); border-radius: 99px; padding: 4px 12px 4px 6px; font-weight: 800; animation: popIn .3s; }
.pl .av { font-size: 22px; }
.pl.host::after { content: '👑'; font-size: 13px; }
.pl.off { opacity: .4; }
.pl.me { border-color: var(--or); }
.cfg { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 12px; }
.cfg .ct { font-weight: 900; font-size: 14px; color: var(--ink2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 2px solid var(--line); border-radius: 99px; padding: 5px 11px; font-weight: 800; font-size: 14px; background: #fff; }
.chips button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips button:disabled { opacity: .55; cursor: default; }
.cfg-sum { font-weight: 700; color: var(--ink2); font-size: 14px; line-height: 1.5; }
.mp-mini { position: absolute; top: 108px; right: 22px; z-index: 6; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.mp-mini div { background: rgba(255,255,255,.92); border-radius: 99px; padding: 1px 8px; font-size: 12px; font-weight: 800; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.mp-mini div.done { background: #DFF7E7; }

/* 頒獎台 */
.podium-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pd-title { margin: 10px 0 0; font-size: 26px; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; width: 100%; margin-top: 8px; }
.pd { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; animation: rise .7s cubic-bezier(.3,1.4,.5,1) both; }
.pd .av { font-size: 40px; }
.pd .nm { font-weight: 900; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd .sc { font-weight: 800; color: var(--ink2); font-size: 14px; }
.pd .blk { width: 100%; border-radius: 14px 14px 0 0; display: grid; place-items: center; font-size: 30px; font-weight: 900; color: #fff; margin-top: 6px; }
.pd.p1 .blk { height: 120px; background: var(--gold); }
.pd.p2 .blk { height: 86px; background: #B8C2CC; }
.pd.p3 .blk { height: 62px; background: #D79A62; }
.pd.p1 { animation-delay: .9s; } .pd.p2 { animation-delay: .5s; } .pd.p3 { animation-delay: .1s; }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } }
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.aw { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px; animation: popIn .4s both; }
.aw b { display: block; font-size: 15px; }
.aw span { font-size: 13px; color: var(--ink2); font-weight: 700; word-break: break-all; }
.pd-rest { width: 100%; display: flex; flex-direction: column; gap: 4px; }

/* 視窗、提示 */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .2s; }
.m-box { background: #fff; border-radius: 22px; padding: 20px; width: 100%; max-width: 420px; max-height: 86vh; overflow-y: auto; border: 3px solid var(--ink); }
.m-box h3 { margin: 0 0 10px; font-size: 20px; }
#m-body { font-size: 15px; line-height: 1.6; color: #4A433C; }
#m-body p { margin: 0 0 8px; }
.m-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.set-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.switch { width: 52px; height: 30px; border-radius: 99px; background: #D8CFC4; position: relative; transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on { background: var(--lime-d); }
.switch.on::after { transform: translateX(22px); }
.toast { position: fixed; left: 50%; top: 18px; transform: translate(-50%, -140%); z-index: 70; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 14px; font-weight: 800; transition: transform .25s; max-width: 90vw; text-align: center; }
.toast.on { transform: translate(-50%, 0); }
#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 55; }

/* 大螢幕（主持）模式：寬螢幕左邊大題目、右邊聊天和排名；窄螢幕就只是不顯示輸入框 */
body.tv #s-game .g-form, body.tv #s-game .g-tools, body.tv #s-game .g-sugg { display: none; }
@media (min-width: 800px) {
  body.tv #app { max-width: 1280px; }
  body.tv #s-game.active { display: grid; grid-template-columns: 1fr 340px; grid-template-rows: auto auto auto 1fr auto; column-gap: 20px; padding: 24px; }
  body.tv #s-game .g-top, body.tv #s-game .g-timer, body.tv #s-game .g-meta { grid-column: 1 / -1; }
  body.tv #s-game .stage-wrap { grid-column: 1; grid-row: 4 / 6; max-height: none; min-height: 0; }
  body.tv #s-game .g-feed { grid-column: 2; grid-row: 4; max-height: none; }
  body.tv #s-game .g-feed .fd { font-size: 19px; }
  body.tv .mp-mini { position: static; grid-column: 2; grid-row: 5; }
  body.tv .mp-mini div { font-size: 17px; padding: 4px 12px; }
  body.tv .quote { font-size: 46px; }
  body.tv .emo { font-size: 140px; }
  body.tv .q-lab { font-size: 20px; }
  body.tv .clues li { font-size: 24px; }
  body.tv .rv-card { max-width: 900px; margin: 0 auto; }
  body.tv .rv-name { font-size: 54px; }
  body.tv .hint-chip { font-size: 22px; }
  body.tv .g-ovl .n { font-size: 170px; }
  body.tv .g-ovl .t { font-size: 28px; }
}
@media (min-width: 700px) {
  .theme-grid { grid-template-columns: repeat(3, 1fr); }
  .col-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-height: 640px) {
  .home-hd { margin: 6px 0 10px; }
  .home-hd h1 { font-size: 34px; }
  .rv-name { font-size: 26px; }
}
