/* 課堂遊戲：投影幕（.stage，老師頁）和手機（.play，學生頁）的版面 */
.g-pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.g-pic .sw { display: block; width: 100%; height: 100%; border-radius: 12px; }
.g-pic .emoji { font-size: var(--emoji, 64px); line-height: 1; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.g-pic .txt { font-weight: 700; font-size: 28px; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; text-align: center; }
.g-pic { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mark { display: inline-flex; width: 1.4em; justify-content: center; opacity: .9; }

/* ---------- 投影幕 ---------- */
.stage { position: fixed; inset: 0; z-index: 50; background: #fbf6ec; color: #3a3836; display: flex; flex-direction: column; font-size: 22px; overflow: hidden; }
.stage .blob { position: absolute; z-index: 0; pointer-events: none; }
.stage .blob.a { left: -120px; top: -140px; width: 420px; height: 320px; background: #f2b8a2; border-radius: 40% 60% 55% 45%/60% 40% 60% 40%; opacity: .55; }
.stage .blob.b { right: -120px; bottom: -150px; width: 420px; height: 320px; background: #9fd0cc; border-radius: 55% 45% 40% 60%/50% 60% 40% 50%; opacity: .55; }
.stage > * { position: relative; z-index: 1; }
.stage-top { display: flex; align-items: center; gap: 14px; padding: 12px 20px; }
.stage-top .title { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-top .pinchip { background: #fff; border-radius: 999px; padding: 4px 14px; font-weight: 700; letter-spacing: 2px; }
.stage-top button, .stage-foot button { font-size: 18px; padding: 8px 16px; border-radius: 10px; }
.stage-body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 24px; gap: 12px; }
.stage-foot { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 12px 20px 18px; }
.stage-foot .big { font-size: 26px; padding: 12px 34px; border-radius: 14px; }
.timebar { height: 10px; background: #0001; border-radius: 5px; overflow: hidden; width: min(900px, 90%); }
.timebar i { display: block; height: 100%; background: #e07a5f; width: 100%; }
.stage .meta { display: flex; gap: 24px; align-items: center; font-size: 20px; color: #77736e; }
.stage .meta b { color: #3a3836; font-size: 28px; }

/* 等大家加入 */
.lobby { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 28px; width: min(1200px, 100%); align-items: start; }
.lobby .join { background: #fff; border-radius: 22px; padding: 22px; text-align: center; box-shadow: 0 6px 24px #0001; }
.lobby .join .url { font-size: 20px; color: #77736e; word-break: break-all; }
.lobby .join .pin { font-size: 76px; font-weight: 800; letter-spacing: 8px; line-height: 1.1; margin: 6px 0 10px; }
.lobby .join .qr svg { width: 220px; height: 220px; }
.lobby .who h2 { margin: 0 0 12px; font-size: 26px; }
.lobby .chips { display: flex; flex-wrap: wrap; gap: 10px; }
.lobby .chip { background: #fff; border-radius: 999px; padding: 8px 16px; font-size: 22px; font-weight: 600; cursor: pointer; border: 2px solid transparent; animation: pop .25s ease-out; }
.lobby .chip:hover { border-color: #e07a5f; text-decoration: line-through; }
.lobby .chip.off { opacity: .45; }
.lobby .chip.A, .board .A { background: #fde3dc; }
.lobby .chip.B, .board .B { background: #d9eef0; }
.lobby .teams { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* 投影幕上的選項 */
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: min(1100px, 100%); }
.opts.six { grid-template-columns: 1fr 1fr 1fr; }
.opts .o { color: #fff; border-radius: 16px; padding: 10px 18px; font-size: 32px; font-weight: 700; display: flex; align-items: center; gap: 12px; min-height: 66px; }
.opts .o .g-pic { width: 64px; height: 56px; flex: none; background: #fff; border-radius: 10px; --emoji: 44px; }
.opts .o .n { margin-left: auto; font-size: 26px; background: #0002; border-radius: 999px; padding: 0 14px; }
.opts.revealed .o:not(.right) { opacity: .35; }
.opts.revealed .o.right { outline: 5px solid #3a3836; }

/* Quick Guess：圖片被 4 塊黑格蓋住 */
.qg { position: relative; width: min(56vh, 520px); aspect-ratio: 4/3; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 6px 24px #0002; }
.qg .g-pic { position: absolute; inset: 0; --emoji: 200px; padding: 12px; }
.qg .tiles { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.qg .tiles i { background: #222; border: 2px solid #fbf6ec; transition: opacity .5s, transform .5s; }
.qg .tiles i.off { opacity: 0; transform: scale(.85); }

/* What's missing */
.wm { display: grid; gap: 12px; width: min(1000px, 100%); }
.wm .cell { background: #fff; border-radius: 14px; aspect-ratio: 4/3; box-shadow: 0 3px 10px #0001; --emoji: 72px; padding: 6px; transition: opacity .4s, transform .4s; }
.wm .cell.gone { opacity: 0; transform: scale(.7); }
.wm .cell.back { opacity: 1; transform: none; outline: 5px solid #e07a5f; }
.cue { font-size: 44px; font-weight: 800; }

/* 射氣球：大螢幕念單字 */
.bl-word { font-size: 110px; font-weight: 800; line-height: 1; }
.bl-say { font-size: 26px; border-radius: 999px; padding: 10px 24px; }
.floaty { position: absolute; bottom: -140px; width: 90px; height: 110px; border-radius: 50% 50% 46% 46%; opacity: .5; animation: rise linear infinite; z-index: 0; }
.floaty::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 50px; background: #0003; }
@keyframes rise { to { transform: translateY(-120vh); } }

/* 揭曉答案、排行榜 */
.answer { display: flex; align-items: center; gap: 24px; background: #fff; border-radius: 20px; padding: 14px 28px; box-shadow: 0 6px 24px #0001; }
.answer .g-pic { width: 160px; height: 120px; --emoji: 96px; }
.answer .en { font-size: 64px; font-weight: 800; }
.answer .zh { font-size: 28px; color: #77736e; }
.board { width: min(760px, 100%); display: grid; gap: 8px; }
.board .row { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 12px; padding: 8px 18px; font-size: 26px; animation: pop .3s ease-out; }
.board .row .r { width: 36px; font-weight: 800; color: #77736e; }
.board .row .s { margin-left: auto; font-weight: 700; }
.teamscore { display: flex; gap: 20px; }
.teamscore div { border-radius: 16px; padding: 10px 28px; font-size: 30px; font-weight: 700; }
.podium { display: flex; align-items: flex-end; gap: 16px; }
.podium > div { background: #fff; border-radius: 16px 16px 0 0; width: 200px; text-align: center; padding: 14px 8px; font-size: 26px; font-weight: 700; box-shadow: 0 6px 24px #0001; }
.podium > div small { display: block; font-size: 20px; color: #77736e; }
.podium .p1 { height: 220px; background: #f6ebc8; } .podium .p2 { height: 170px; } .podium .p3 { height: 130px; }
.podium .medal { font-size: 54px; }

/* ---------- 手機 ---------- */
body.play { margin: 0; background: #fbf6ec; color: #3a3836; font-family: system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif; min-height: 100dvh; display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent; }
.play-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-weight: 700; background: #fff; box-shadow: 0 1px 0 #0001; }
.play-top .score { background: #3a3836; color: #fff; border-radius: 999px; padding: 2px 12px; }
.play-main { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 16px; gap: 14px; text-align: center; position: relative; overflow: hidden; }
.play-main h1 { margin: 0; font-size: 28px; }
.play-main .brand { font-size: 15px; color: #77736e; }
.play-main input { font: inherit; font-size: 28px; text-align: center; padding: 12px; border: 2px solid #d5d5d8; border-radius: 14px; width: min(320px, 100%); box-sizing: border-box; }
.play-main input.pin { letter-spacing: 8px; font-weight: 800; font-size: 34px; }
.play-main .go { font: inherit; font-size: 24px; font-weight: 700; padding: 12px 20px; border: 0; border-radius: 14px; background: #3a3836; color: #fff; width: min(320px, 100%); cursor: pointer; }
.play-main .go:disabled { opacity: .5; }
.play-main .err { color: #c0392b; min-height: 1.3em; margin: 0; }
.play-main .hint { color: #77736e; font-size: 18px; margin: 0; }
.teampick { display: flex; gap: 10px; width: min(320px, 100%); }
.teampick label { flex: 1; border-radius: 14px; padding: 12px; font-size: 22px; font-weight: 700; border: 3px solid transparent; cursor: pointer; }
.teampick label.A { background: #fde3dc; } .teampick label.B { background: #d9eef0; }
.teampick input { display: none; }
.teampick label:has(input:checked) { border-color: #3a3836; }
.ptime { position: absolute; top: 0; left: 0; right: 0; height: 8px; background: #0001; }
.ptime i { display: block; height: 100%; background: #e07a5f; }
.pbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 520px; flex: 1; max-height: 520px; }
.pbtns button { border: 0; border-radius: 18px; color: #fff; font: inherit; font-size: 26px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; cursor: pointer; transition: transform .1s; min-height: 110px; }
.pbtns button:active { transform: scale(.96); }
.pbtns button .g-pic { width: 80%; height: 90px; background: #fff; border-radius: 10px; --emoji: 64px; }
.pbtns button .g-pic .txt { color: #3a3836; }
.pbtns.locked button:not(.mine) { opacity: .3; }
.pbtns.result button:not(.right) { opacity: .3; }
.pbtns.result button.right { outline: 4px solid #3a3836; }
.feedback { font-size: 64px; }
.feedback + h1 { font-size: 34px; }
.gain { font-size: 28px; font-weight: 800; }
/* 射氣球：氣球在手機上往上飄，點對的那顆 */
.sky { position: absolute; inset: 8px 0 0; }
.balloon { position: absolute; width: 104px; height: 126px; border: 0; border-radius: 50% 50% 46% 46%; padding: 0; cursor: pointer; animation: float var(--dur, 6s) linear infinite; animation-delay: var(--delay, 0s); bottom: -150px; box-shadow: inset -8px -10px 0 #0001; }
.balloon::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 40px; background: #0004; }
.balloon .g-pic { position: absolute; inset: 18px 14px 26px; background: #fff; border-radius: 50%; --emoji: 46px; }
.balloon .g-pic .txt { font-size: 16px; color: #3a3836; }
.balloon.popped { animation: popout .3s ease-out forwards; }
.balloon.dim { opacity: .25; }
@keyframes float { from { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(calc(-50dvh - 75px)) rotate(3deg); } to { transform: translateY(calc(-100dvh - 160px)) rotate(-3deg); } }
@keyframes popout { to { transform: scale(1.6); opacity: 0; } }
.bigpic { width: 160px; height: 120px; background: #fff; border-radius: 16px; --emoji: 90px; }
