:root {
  --pink: #ff4f9a; --blue: #3d8bff; --gold: #ffc23d; --green: #22c55e; --red: #ef4444;
  --ink: #1a1530; --paper: #fffdf7; --muted: #6b6380;
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0b20; font-family: var(--font); color: var(--ink); }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
button { font-family: inherit; cursor: pointer; }

/* 上方資訊列 */
.hud { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; gap: 8px; align-items: center; pointer-events: none; z-index: 5; }
.hud .chip { background: rgba(13,11,32,.78); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.hud .chip b { color: var(--gold); }
.hud .grow { flex: 1; }
.hud .streak { background: linear-gradient(90deg, var(--pink), var(--gold)); color: #1a1530; border: 0; }

/* 標題頁、結算頁的中央卡 */
.center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; background: radial-gradient(ellipse at center, rgba(13,11,32,.35), rgba(13,11,32,.75)); }
.card { background: var(--paper); border-radius: 22px; box-shadow: 0 18px 60px rgba(0,0,0,.45), 0 0 0 4px rgba(255,255,255,.12); padding: 22px; width: min(560px, 100%); max-height: calc(100% - 8px); overflow: auto; }
.logo { font-weight: 900; font-size: clamp(40px, 11vw, 68px); line-height: 1; text-align: center; margin: 4px 0 2px; letter-spacing: 2px;
  background: linear-gradient(90deg, var(--pink), #ffb347 50%, var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-sub { text-align: center; font-weight: 900; font-size: 22px; letter-spacing: 10px; color: var(--ink); margin-bottom: 12px; }
.lead { text-align: center; font-size: 16px; line-height: 1.6; margin: 0 0 14px; }
.how { background: #f3eefc; border-radius: 14px; padding: 10px 14px; font-size: 14px; line-height: 1.7; margin: 0 0 14px; }
.how b { color: var(--pink); }
.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 14px; font-size: 20px; font-weight: 900; color: #fff;
  background: linear-gradient(90deg, var(--pink), #ff7a59); box-shadow: 0 6px 0 #b8325f; transition: transform .08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #b8325f; }
.btn.blue { background: linear-gradient(90deg, var(--blue), #59b0ff); box-shadow: 0 6px 0 #1f56b0; }
.best { text-align: center; color: var(--muted); font-size: 14px; margin-top: 10px; }
.disclaimer { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 14px; border-top: 1px dashed #d8d0ea; padding-top: 10px; }
.disclaimer a { color: var(--blue); word-break: break-all; }

/* 出題面板：桌機在右側，手機在下方 */
.panel { position: absolute; z-index: 8; background: var(--paper); display: flex; flex-direction: column; box-shadow: 0 0 40px rgba(0,0,0,.4); }
@media (min-aspect-ratio: 11/10) {
  .panel { top: 0; right: 0; bottom: 0; width: min(46vw, 600px); border-radius: 24px 0 0 24px; padding: 64px 22px 18px; }
}
@media (max-aspect-ratio: 11/10) {
  .panel { left: 0; right: 0; bottom: 0; max-height: 64%; border-radius: 22px 22px 0 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
}
.panel .scroll { overflow: auto; flex: 1; min-height: 0; }
.timer { height: 10px; background: #ece6f7; border-radius: 99px; overflow: hidden; margin-bottom: 10px; flex: none; }
.timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--green), var(--gold), var(--red)); background-size: 300% 100%; transform-origin: left; }
.say { position: relative; background: #eaf2ff; border: 2px solid var(--blue); border-radius: 16px; padding: 10px 14px 12px; margin-bottom: 12px; }
.say .who { display: inline-block; background: var(--blue); color: #fff; font-weight: 900; font-size: 13px; padding: 2px 10px; border-radius: 99px; margin-bottom: 6px; }
.say .txt { font-size: 18px; line-height: 1.6; font-weight: 700; min-height: 1.6em; }
@media (max-aspect-ratio: 11/10) { .say .txt { font-size: 16px; } }
.ask { font-weight: 900; font-size: 15px; color: var(--pink); margin: 0 0 8px; }
.opts { display: grid; gap: 8px; }
.opt { text-align: left; border: 2px solid #ddd3ef; background: #fff; border-radius: 14px; padding: 10px 12px; font-size: 15px; line-height: 1.5; color: var(--ink); display: flex; gap: 10px; align-items: flex-start; transition: transform .1s, background .2s; }
.opt:hover:not(:disabled) { border-color: var(--pink); transform: translateX(2px); }
.opt .k { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 14px; margin-top: 1px; }
.opt .t { flex: 1; }
.opt .tag { display: inline-block; font-size: 12px; font-weight: 900; padding: 1px 8px; border-radius: 99px; margin-left: 6px; vertical-align: 1px; }
.opt.right { background: #dcfce7; border-color: var(--green); }
.opt.right .k { background: var(--green); }
.opt.picked.wrongpick { background: #fee2e2; border-color: var(--red); }
.opt.picked.wrongpick .k { background: var(--red); }
.opt:disabled { cursor: default; }
.opt.fake { opacity: .78; }
.tag.real { background: var(--green); color: #fff; }
.tag.fake { background: #e5e0ef; color: #4b4366; }
.tag.decoy { background: var(--gold); color: #3a2a00; }
.verdict { font-size: 26px; font-weight: 900; text-align: center; margin: 4px 0 8px; animation: pop .5s cubic-bezier(.3,1.6,.5,1); }
.verdict.ok { color: var(--green); }
.verdict.ng { color: var(--red); }
.verdict small { display: block; font-size: 15px; color: var(--muted); font-weight: 700; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.full { margin-top: 12px; background: #faf7ff; border: 1px solid #e3dbf3; border-radius: 14px; padding: 10px 12px; font-size: 14px; line-height: 1.7; }
.full h4 { margin: 0 0 6px; font-size: 14px; }
.full .line { margin: 6px 0; }
.full .line b { color: #fff; font-size: 12px; padding: 1px 8px; border-radius: 99px; margin-right: 6px; }
.full .line b.h { background: var(--pink); }
.full .line b.m { background: var(--blue); }
.full .at { color: var(--muted); font-size: 12px; }
.full .note { color: var(--muted); font-size: 12px; margin-top: 6px; }
.next { margin-top: 12px; flex: none; }
.float { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); font-size: 64px; font-weight: 900; pointer-events: none; z-index: 20; animation: floatup 1.1s ease-out forwards; text-shadow: 0 4px 0 rgba(0,0,0,.35); }
@keyframes floatup { 0% { transform: translate(-50%, -30%) scale(.5); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -120%) scale(1); opacity: 0; } }
.float.ok { color: #fff36b; }
.float.ng { color: #9fd3ff; }

/* 結算 */
.score-big { text-align: center; font-size: 56px; font-weight: 900; line-height: 1; margin: 4px 0; color: var(--pink); }
.rank { text-align: center; font-size: 26px; font-weight: 900; margin: 8px 0 2px; }
.rank-sub { text-align: center; color: var(--muted); margin-bottom: 12px; }
.review { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; font-size: 13px; line-height: 1.5; }
.review li { background: #f6f2fd; border-radius: 10px; padding: 8px 10px; display: flex; gap: 8px; }
.review li .m { flex: none; font-weight: 900; }
.review li.ok .m { color: var(--green); }
.review li.ng .m { color: var(--red); }
.row2 { display: grid; grid-template-columns: 1fr; gap: 10px; }
.mute { position: absolute; right: 16px; top: max(10px, env(safe-area-inset-top)); z-index: 12; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(13,11,32,.75); color: #fff; font-size: 20px; }
.panel-open .mute { display: none; }
