/* 題目派對 — 夜晚的益智節目舞台：深墨藍舞台、燈泡黃聚光、四色搶答鈕 */
:root {
  --stage: #14183a;
  --stage-2: #1b2052;
  --panel: #212761;
  --line: #363f86;
  --paper: #fff6e0;
  --muted: #b2b5dd;
  --spot: #ffd23f;
  --s0: #ff5a5f;   /* ▲ */
  --s1: #2ec4b6;   /* ◆ */
  --s2: #ff9f1c;   /* ● */
  --s3: #6c8cff;   /* ■ */
  --good: #5be38f;
  --bad: #ff6b6f;
  --display: "Bungee", "Noto Sans TC", system-ui, sans-serif;
  --body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  color-scheme: dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }

html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--paper);
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgba(255, 210, 63, .16), transparent 70%),
    var(--stage);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h2 { font-size: 1.15rem; font-weight: 900; }
p { margin: 0 0 .6em; }
small { font-size: .8em; color: var(--muted); font-weight: 500; }
.hidden { display: none !important; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .9rem; margin-top: 1em; }
.loading, .empty { color: var(--muted); text-align: center; padding: 2rem 1rem; }
.mt { margin-top: 1.6em; }
.count { font-weight: 500; color: var(--muted); font-size: .9rem; margin-left: .3em; }

/* ---------- 按鈕與表單 ---------- */
.btn {
  font: inherit; font-weight: 700;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: .65em 1.2em;
  cursor: pointer;
  color: var(--paper);
  background: var(--panel);
  transition: transform .08s, background .15s, border-color .15s;
}
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary {
  background: var(--spot); color: #1b1600;
  box-shadow: 0 4px 0 #b8901a;
}
.btn.primary:active:not(:disabled) { box-shadow: 0 2px 0 #b8901a; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.small { padding: .35em .8em; font-size: .9rem; border-radius: 9px; }
.btn.big { font-size: 1.15rem; padding: .75em 1.8em; }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
:focus-visible { outline: 3px solid var(--spot); outline-offset: 2px; }

.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-size: .9rem; color: var(--muted); margin-bottom: .3em; }
input[type=text], input:not([type]), input[type=number], textarea {
  width: 100%;
  font: inherit;
  color: var(--paper);
  background: var(--stage);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: .6em .8em;
}
input:focus, textarea:focus { border-color: var(--spot); outline: none; }
textarea { resize: vertical; }
.code-input { font-family: var(--display); letter-spacing: .25em; font-size: 1.3rem; }

.panel {
  background: var(--stage-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}

.tag {
  display: inline-block; font-size: .75rem; font-weight: 700;
  padding: .1em .55em; border-radius: 99px; margin-left: .4em; white-space: nowrap;
}
.tag.host { background: var(--spot); color: #1b1600; }
.tag.ok { background: rgba(91, 227, 143, .16); color: var(--good); }

.avatar {
  --h: 200;
  flex: none;
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: hsl(var(--h) 70% 62%);
  color: #14183a; font-weight: 900;
}
.avatar.big { width: 64px; height: 64px; font-size: 1.6rem; }

/* 選項的四色 */
.s0 { --c: var(--s0); } .s1 { --c: var(--s1); } .s2 { --c: var(--s2); } .s3 { --c: var(--s3); }
.mini {
  display: inline-grid; place-items: center; flex: none;
  width: 1.6em; height: 1.6em; margin-right: .45em; border-radius: 6px;
  background: var(--c); color: #14183a; font-size: .85em;
}

/* ---------- 首頁 ---------- */
.marquee { text-align: center; padding: 28px 0 32px; }
.logo {
  display: inline-block;
  font-size: clamp(2.6rem, 9vw, 4.6rem);
  font-weight: 900;
  letter-spacing: .08em;
  margin: 0 0 .25em;
  padding: .15em .6em;
  border: 4px solid var(--spot);
  border-radius: 22px;
  /* 舞台燈泡框 */
  box-shadow:
    0 0 0 6px var(--stage),
    0 0 0 10px rgba(255, 210, 63, .35),
    0 0 40px rgba(255, 210, 63, .25);
  background-image: radial-gradient(circle, var(--spot) 2.5px, transparent 3px);
  background-size: 22px 22px;
  background-position: 0 -3px;
  background-repeat: repeat-x;
}
.tagline { color: var(--muted); max-width: 34em; margin: 0 auto; }

.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.home-grid.join-first #join-form { order: -1; border-color: var(--spot); }
.home-grid .btn { width: 100%; margin-top: .4rem; }

.myrooms { margin-top: 32px; }
.myrooms ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.myrooms li {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--stage-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px;
}
.myrooms .code { font-family: var(--display); font-size: 1.25rem; letter-spacing: .12em; color: var(--spot); }
.myrooms .who { flex: 1; color: var(--muted); }

/* ---------- 房間 ---------- */
.room-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.room-code .label { display: block; font-size: .85rem; color: var(--muted); }
.room-code .code {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.2rem, 7vw, 3.2rem); letter-spacing: .14em; line-height: 1;
  color: var(--spot);
  text-shadow: 0 0 24px rgba(255, 210, 63, .35);
}
.room-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.lobby-grid { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 18px; align-items: start; }

.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.players li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; border-radius: 12px; background: var(--panel);
}
.players li.off { opacity: .45; }
.players li.new { animation: join-pop .7s cubic-bezier(.2, 1.6, .4, 1); box-shadow: 0 0 0 2px var(--spot); }
.players .pname { font-weight: 700; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.players .pmeta { font-size: .8rem; color: var(--muted); }
@keyframes join-pop { from { transform: scale(.6); opacity: 0; } }

.opts { border: 0; padding: 0; margin: 0 0 1rem; }
.opts legend { font-size: .9rem; color: var(--muted); margin-bottom: .4em; padding: 0; }
.opt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.opt-pick { position: relative; cursor: pointer; flex: none; }
.opt-pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opt-badge {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 10px;
  border: 2px solid var(--c); color: var(--c); font-size: 1.1rem;
  transition: background .15s, color .15s;
}
.opt-pick input:checked + .opt-badge { background: var(--c); color: #14183a; }
.opt-pick input:checked + .opt-badge::after { content: "✓"; position: absolute; right: -6px; top: -8px;
  background: var(--good); color: #0c2a17; font-size: .7rem; font-weight: 900; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; }
.opt-pick input:focus-visible + .opt-badge { outline: 3px solid var(--spot); outline-offset: 2px; }
.opt-row:has(input:checked) input[type=text] { border-color: var(--c); }
.form-actions { display: flex; gap: 8px; }

.myq { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.myq li { background: var(--panel); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.myq .q-text { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.myq .q-ans { margin: 0; color: var(--muted); font-size: .9rem; display: flex; align-items: center; grid-column: 1; }
.myq .q-btns { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 6px; align-items: center; }
.myq li.empty { display: block; padding: 18px; }

.lobby-foot {
  position: sticky; bottom: 0; z-index: 5;
  margin: 18px -16px 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: rgba(20, 24, 58, .92); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.btn.ready { border-color: var(--line); background: transparent; }
.btn.ready.on { background: rgba(91, 227, 143, .15); border-color: var(--good); color: var(--good); }
.host-ctl { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sec-field { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.sec-field input { width: 4.5em; text-align: center; padding: .4em; }
.start-info { color: var(--muted); font-size: .9rem; }
.wait { margin: 0; color: var(--muted); }
.wait b { color: var(--paper); }

/* ---------- 遊戲：倒數開場 ---------- */
.game { min-height: calc(100vh - 80px); display: flex; flex-direction: column; }
.starting, .intro { flex: 1; display: grid; place-content: center; text-align: center; position: relative; overflow: hidden; }
.starting .lead { font-size: 1.4rem; font-weight: 900; }
.big-count .cd-num {
  display: block; font-family: var(--display);
  font-size: clamp(6rem, 30vw, 12rem); line-height: 1; color: var(--spot);
}

/* ---------- 遊戲：第 N 題（這個頁面最主要的視覺時刻）---------- */
.beam {
  position: absolute; left: 50%; top: -20%;
  width: 70vmin; height: 140%;
  transform: translateX(-50%) rotate(-24deg); transform-origin: 50% 0;
  background: linear-gradient(to bottom, rgba(255, 210, 63, .45), rgba(255, 210, 63, 0) 80%);
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
  filter: blur(6px);
  animation: sweep 1.1s cubic-bezier(.3, .8, .3, 1) forwards;
}
@keyframes sweep { to { transform: translateX(-50%) rotate(0deg); } }
.intro-num { position: relative; display: flex; align-items: center; justify-content: center; gap: .15em; margin: 0; }
.intro-word {
  font-size: clamp(2rem, 8vw, 3.6rem); font-weight: 900;
  opacity: 0; animation: fade-in .4s .55s forwards;
}
.numeral {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(8rem, 38vw, 16rem); line-height: .9;
  color: var(--spot);
  text-shadow: 0 6px 0 #b8901a, 0 0 60px rgba(255, 210, 63, .5);
  animation: slam .65s .2s cubic-bezier(.2, 1.5, .4, 1) both;
}
@keyframes slam {
  from { transform: scale(3.2) rotate(-8deg); opacity: 0; }
  60% { opacity: 1; }
}
.intro-sub { position: relative; color: var(--muted); font-size: 1.2rem; opacity: 0; animation: fade-in .4s 1s forwards; }
@keyframes fade-in { to { opacity: 1; } }

/* ---------- 遊戲：作答 ---------- */
.q-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.q-index { font-weight: 900; color: var(--muted); }
.timer { position: relative; width: 76px; height: 76px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 9; }
.ring-fg { fill: none; stroke: var(--spot); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .1s linear, stroke .2s; }
.timer .cd-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 1.6rem; }
.timer.urgent .ring-fg { stroke: var(--bad); }
.timer.urgent .cd-num { color: var(--bad); animation: tick 1s infinite; }
@keyframes tick { 0% { transform: scale(1.25); } 30% { transform: scale(1); } }

.q-card {
  background: var(--paper); color: #14183a;
  border-radius: 20px; padding: 22px 24px; margin-bottom: 16px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .25);
  animation: card-in .45s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes card-in { from { transform: translateY(24px) scale(.97); opacity: 0; } }
.q-author { font-size: .85rem; font-weight: 700; color: #5a5f8a; margin: 0 0 .3em; }
.q-title { font-size: clamp(1.3rem, 4vw, 2rem); font-weight: 900; margin: 0; overflow-wrap: anywhere; }
.banner { text-align: center; color: var(--spot); font-weight: 700; }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ans {
  font: inherit; text-align: left;
  display: flex; align-items: center; gap: 12px;
  min-height: 76px; padding: 14px 16px;
  border: 0; border-radius: 16px;
  background: var(--c); color: #14183a; font-weight: 700; font-size: 1.1rem;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 55%, #000);
  cursor: pointer; transition: transform .1s, opacity .2s, filter .2s;
}
.ans:hover:not(:disabled) { filter: brightness(1.07); }
.ans:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 55%, #000); }
.ans:disabled { cursor: default; }
.ans-shape { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: rgba(20, 24, 58, .18); font-size: 1.2rem; }
.ans-text { flex: 1; overflow-wrap: anywhere; }
.answers.locked .ans:not(.chosen) { opacity: .3; }
.answers.locked .ans.chosen { box-shadow: 0 0 0 4px var(--paper), 0 6px 0 color-mix(in srgb, var(--c) 55%, #000); }
.q-status { text-align: center; color: var(--muted); margin-top: 16px; }

/* ---------- 遊戲：解答 ---------- */
.next-in { color: var(--muted); font-weight: 700; }
.next-in .cd-num { color: var(--spot); font-family: var(--display); }
.answers.reveal .ans { min-height: 60px; cursor: default; }
.answers.reveal .ans.is-wrong { opacity: .3; }
.answers.reveal .ans.is-correct { animation: correct-pulse .6s .2s; box-shadow: 0 0 0 4px var(--good), 0 6px 0 color-mix(in srgb, var(--c) 55%, #000); }
.answers.reveal .ans.mine .ans-text::after { content: "（你的選擇）"; font-size: .8em; font-weight: 500; }
.ans-count { font-family: var(--display); font-weight: 400; font-size: 1rem; }
@keyframes correct-pulse { 50% { transform: scale(1.04); } }
.verdict { text-align: center; font-size: 1.5rem; font-weight: 900; margin: 18px 0 2px; }
.verdict.good { color: var(--good); } .verdict.bad { color: var(--bad); } .verdict.meh { color: var(--muted); }
.who { text-align: center; color: var(--muted); }
.speed { list-style: none; margin: 12px auto 6px; padding: 0; max-width: 420px; display: grid; gap: 6px; }
.speed li {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border-radius: 10px; background: var(--panel);
  animation: row-in .35s calc(.2s + var(--i) * .12s) both;
}
.speed li.fastest { background: rgba(255, 210, 63, .14); box-shadow: inset 0 0 0 2px var(--spot); }
.speed li.me .sp-name::after { content: "（你）"; font-size: .8em; color: var(--muted); font-weight: 500; }
.sp-rank { width: 1.6em; text-align: center; font-family: var(--display); color: var(--muted); }
.speed li.fastest .sp-rank { color: var(--spot); }
.sp-name { flex: 1; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.sp-time { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.sp-pts { min-width: 2.4em; text-align: right; font-weight: 900; color: var(--good); }

.board { margin-top: 18px; background: var(--stage-2); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.board h3 { font-size: 1rem; }
.board ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 12px; background: var(--panel);
  animation: row-in .4s calc(.5s + var(--i) * .07s) both;
}
.row.me { box-shadow: inset 0 0 0 2px var(--spot); }
.row .rk { width: 1.8em; font-family: var(--display); color: var(--muted); text-align: center; }
.row .nm { flex: 1; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.row .dl { min-width: 2.6em; text-align: right; font-weight: 900; }
.row .dl.up { color: var(--good); } .row .dl.down { color: var(--bad); }
.row .sc { min-width: 2.4em; text-align: right; font-family: var(--display); font-size: 1.2rem; }
.row.bump .sc { animation: bump .4s; }
@keyframes row-in { from { transform: translateX(-16px); opacity: 0; } }
@keyframes bump { 50% { transform: scale(1.3); color: var(--spot); } }

/* ---------- 頒獎台 ---------- */
.podium-scene { min-height: calc(100vh - 80px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.final-title { font-size: clamp(2rem, 7vw, 3rem); font-weight: 900; letter-spacing: .1em; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; width: 100%; max-width: 640px; margin-top: 12px; }
.pod { flex: 1; display: flex; flex-direction: column; align-items: center; }
.pod-person {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 140px; justify-content: flex-end;
  padding-bottom: 10px; position: relative;
  opacity: 0; animation: rise-person .6s calc(var(--d) + .45s) cubic-bezier(.2, 1.5, .4, 1) forwards;
}
.pod-name { font-weight: 900; font-size: 1.1rem; overflow-wrap: anywhere; }
.pod-score { color: var(--muted); font-weight: 700; }
.crown { font-size: 2.2rem; line-height: 1; animation: crown 1.2s calc(var(--d) + .9s) ease-in-out infinite; }
.pod-block {
  width: 100%; display: grid; place-items: start center; padding-top: 12px;
  border-radius: 14px 14px 0 0;
  font-family: var(--display); font-size: 2.6rem; color: rgba(20, 24, 58, .75);
  transform-origin: bottom; transform: scaleY(0);
  animation: grow .7s var(--d) cubic-bezier(.2, 1.2, .4, 1) forwards;
}
.pod-1 .pod-block { height: 200px; background: linear-gradient(var(--spot), #e0a800); }
.pod-2 .pod-block { height: 150px; background: linear-gradient(#e6e8f5, #a9adc9); }
.pod-3 .pod-block { height: 110px; background: linear-gradient(#f0a868, #c7743a); }
.pod-1 .avatar { box-shadow: 0 0 0 4px var(--spot), 0 0 40px rgba(255, 210, 63, .6); }
.skip { margin-top: 28px; }
@keyframes grow { to { transform: scaleY(1); } }
@keyframes rise-person { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes crown { 50% { transform: translateY(-6px) rotate(-6deg); } }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i {
  position: absolute; top: -20px; border-radius: 2px;
  animation-name: fall; animation-timing-function: cubic-bezier(.3, .4, .6, 1); animation-fill-mode: forwards;
}
@keyframes fall { to { transform: translate(var(--x), 110vh) rotate(var(--r)); } }

/* ---------- 總排行 ---------- */
.final { display: grid; grid-template-columns: 1fr 260px; gap: 24px; align-items: start; padding-top: 12px; }
.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rrow {
  display: flex; align-items: center; gap: 12px;
  background: var(--stage-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px;
  animation: row-in .45s calc(var(--i) * .08s) both;
}
.rrow .rk { width: 2em; text-align: center; font-family: var(--display); font-size: 1.3rem; color: var(--muted); }
.rrow .nm { flex: 1; font-weight: 700; font-size: 1.1rem; min-width: 0; overflow-wrap: anywhere; }
.rrow .sc { font-family: var(--display); font-size: 1.4rem; }
.rrow .sc small { font-family: var(--body); }
.rrow.top1 { border-color: var(--spot); background: rgba(255, 210, 63, .12); }
.rrow.top1 .rk { color: var(--spot); }
.rrow.top2 .rk { color: #d5d8ee; }
.rrow.top3 .rk { color: #f0a868; }
.rrow.me { box-shadow: inset 0 0 0 2px var(--paper); }
.final-side { position: sticky; top: 20px; display: grid; gap: 10px; }

/* ---------- 檢視所有題目 ---------- */
.review-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.review-head h1 { margin: 0; font-size: 1.6rem; font-weight: 900; }
.rlist { display: grid; gap: 14px; }
.rq { background: var(--stage-2); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; }
.rq header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rq-num { font-family: var(--display); color: var(--spot); font-size: 1.3rem; }
.rq-author { color: var(--muted); font-size: .9rem; }
.rq h2 { font-size: 1.2rem; overflow-wrap: anywhere; }
.rq-opts { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rq-opts li { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-radius: 10px; background: var(--panel); opacity: .6; }
.rq-opts li.correct { opacity: 1; box-shadow: inset 0 0 0 2px var(--good); }
.rq-opts li.mine { opacity: 1; }
.rq-opt { flex: 1; overflow-wrap: anywhere; }
.rq-opts .cnt { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.rq-who { color: var(--muted); font-size: .9rem; margin: 0; }

/* ---------- 提示訊息 ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--paper); color: #14183a; font-weight: 700;
  padding: .6em 1.2em; border-radius: 99px; max-width: calc(100% - 32px);
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 手機 ---------- */
@media (max-width: 760px) {
  .home-grid, .lobby-grid, .final { grid-template-columns: 1fr; }
  .final-side { position: static; }
  .answers { grid-template-columns: 1fr; gap: 10px; }
  .ans { min-height: 60px; }
  .rq-opts { grid-template-columns: 1fr; }
  .lobby-foot { flex-direction: column; align-items: stretch; }
  .host-ctl { justify-content: space-between; }
  .pod-1 .pod-block { height: 150px; } .pod-2 .pod-block { height: 110px; } .pod-3 .pod-block { height: 80px; }
  .avatar.big { width: 52px; height: 52px; font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition: none !important; }
  .confetti { display: none; }
}
