/* 互動簡報和課堂遊戲。版型照小芬老師的簡報：米白底、藍綠和珊瑚色色塊、黃色圓形段落頁。
   畫面固定 16:9（1280×720），用 transform 縮放到視窗大小。 */
.deck-wrap { position: fixed; inset: 0; background: var(--cream, #f4f0ea); display: flex; align-items: center; justify-content: center; overflow: hidden; }
body.has-rail .deck-wrap { left: var(--rail-w); }
.deck-stage {
  --cream: #f4f0ea; --teal: #1fb3ad; --teal-soft: #8fd6d2; --coral: #f26a4d; --sun: #fbbc35; --ink: #2f3133;
  position: absolute; width: 1280px; height: 720px; transform-origin: center center;
  background: var(--cream); color: var(--ink); overflow: hidden; border-radius: 6px;
  font-family: "Noto Sans TC", -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  user-select: none;
}
.deck-stage .slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.blob { position: absolute; z-index: 0; }
.blob.teal { background: var(--teal); }
.blob.teal-soft { background: var(--teal-soft); opacity: .8; }
.blob.coral { background: var(--coral); }
.blob.sun { background: var(--sun); border-radius: 50% !important; }
.blob.tri { width: 0; height: 0; background: none; border-left: 14px solid transparent; border-right: 14px solid transparent; border-bottom: 24px solid var(--coral); }
.s-in { position: relative; z-index: 1; }

/* 封面 */
.s-title h1 { font-size: 72px; font-weight: 500; margin: 0; letter-spacing: 4px; }
.s-title .who { font-size: 30px; margin-top: 10px; color: #5b5b5b; }
/* 目錄 */
.s-agenda .grid { display: grid; grid-template-columns: repeat(3, 280px); gap: 40px 60px; text-align: center; }
.s-agenda .n { font-size: 40px; font-weight: 300; }
.s-agenda .zh { font-size: 34px; }
.s-agenda .en { font-size: 22px; color: #555; }
/* 段落頁：黃色大圓 */
.s-section .circle { width: 380px; height: 380px; border-radius: 50%; background: var(--sun); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.s-section .n { font-size: 110px; font-weight: 300; line-height: 1; }
.s-section .zh { font-size: 48px; margin-top: 6px; }
.s-section .en { font-size: 28px; }
/* 單字卡 */
.s-vocab { justify-content: space-around; }
.pic { width: 460px; height: 460px; display: flex; align-items: center; justify-content: center; }
.pic img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; }
.pic .emoji { font-size: 300px; line-height: 1; }
.pic .swatch { width: 380px; height: 380px; border-radius: 20px; }
.word { text-align: center; min-width: 420px; }
.word .en { font-size: 84px; font-weight: 500; }
.word .zh { font-size: 52px; color: #444; margin-top: 8px; min-height: 70px; }
.hidden-zh { visibility: hidden; }
.say { margin-top: 14px; font-size: 26px; border: 2px solid var(--teal); color: var(--teal); background: #fff; border-radius: 40px; padding: 6px 22px; cursor: pointer; }
.say:hover { background: var(--teal); color: #fff; }
.tap-hint { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; font-size: 18px; color: #8a8580; z-index: 2; }
/* 單字總覽 */
.s-overview .grid { display: grid; gap: 18px; }
.s-overview .cell { background: #fff; border-radius: 16px; padding: 10px; text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.s-overview .cell .p { height: 120px; display: flex; align-items: center; justify-content: center; }
.s-overview .cell img { max-height: 120px; max-width: 100%; }
.s-overview .cell .emoji { font-size: 90px; }
.s-overview .cell .sw { width: 100px; height: 100px; border-radius: 12px; }
.s-overview .cell b { font-size: 26px; font-weight: 500; }
.s-overview .cell span { display: block; font-size: 20px; color: #666; }
/* 句型（藍綠色塊上的大字） */
.s-pattern .big { font-size: 64px; }
.s-pattern .small { font-size: 34px; color: #3b3b3b; margin-top: 18px; }
/* 問答：A 組問、B 組答 */
.s-qa { justify-content: space-around; }
.s-qa > div:last-child { max-width: 700px; }
.s-qa .q { font-size: 50px; }
.s-qa .a { font-size: 50px; margin-top: 18px; min-height: 80px; }
.s-qa .a .blank { display: inline-block; min-width: 200px; border-bottom: 4px solid var(--ink); text-align: center; }
.qa-groups { position: absolute; top: 28px; left: 32px; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.qa-groups .grp { padding: 6px 18px; border-radius: 999px; font-size: 24px; font-weight: 700; color: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .12); }
.qa-groups .ga { background: var(--teal); }
.qa-groups .gb { background: var(--coral); }
/* What's missing? */
.s-missing .grid, .s-bingo .grid { display: grid; gap: 0; background: #fff; border: 3px solid #555; }
.s-missing .cell, .s-bingo .cell { border: 1.5px solid #888; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transition: opacity .3s; }
.s-missing .cell img { max-width: 80%; max-height: 80%; }
.s-missing .cell .emoji { font-size: 84px; }
.s-missing .cell .sw { width: 70%; height: 70%; border-radius: 10px; }
.s-missing .cell.gone > * { opacity: 0; }
.s-missing .cell.reveal > * { opacity: 1; outline: 6px solid var(--coral); border-radius: 10px; }
.ctrl { position: absolute; bottom: 24px; right: 30px; z-index: 3; display: flex; gap: 10px; }
.ctrl button { font-size: 22px; border: 0; border-radius: 30px; padding: 10px 22px; background: var(--teal); color: #fff; cursor: pointer; font-family: inherit; }
.ctrl button.alt { background: var(--coral); }
.ctrl button:disabled { opacity: .4; cursor: default; }
.s-label { position: absolute; top: 24px; left: 0; right: 0; text-align: center; font-size: 40px; z-index: 2; }
/* Quick Guess：四塊黑色方塊 */
.qg { position: relative; width: 640px; height: 480px; background: #fff; border-radius: 6px; overflow: hidden; }
.qg .p { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.qg .p img { width: 100%; height: 100%; object-fit: cover; }
.qg .p .emoji { font-size: 320px; }
.qg .p .sw { width: 100%; height: 100%; }
.qg .tile { position: absolute; width: 50%; height: 50%; background: #111; border: 2px solid #333; cursor: pointer; transition: opacity .35s; }
.qg .tile.off { opacity: 0; pointer-events: none; }
.qg-answer { position: absolute; bottom: 70px; left: 0; right: 0; text-align: center; font-size: 46px; z-index: 2; }
.qg-answer em { color: var(--coral); font-style: normal; }
/* 抽寶貝球 */
.balls { display: flex; flex-wrap: wrap; gap: 34px; justify-content: center; max-width: 1100px; }
.ball { width: 150px; height: 150px; border-radius: 50%; position: relative; cursor: pointer; border: 6px solid #333; overflow: hidden;
  background: linear-gradient(#e5383b 0 46%, #333 46% 54%, #fff 54%); transition: transform .2s; }
.ball::after { content: ""; position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #fff; border: 6px solid #333; }
.ball:hover { transform: rotate(-12deg) scale(1.05); }
.ball.open { visibility: hidden; }
.reveal-card { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; background: rgba(244, 240, 234, .96); }
.reveal-card .box { display: flex; align-items: center; gap: 60px; animation: pop .35s ease; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.reveal-card .qtext { font-size: 52px; line-height: 1.5; }
.reveal-card .qtext u { text-decoration-thickness: 3px; }
/* 骰子 */
.dice-area { display: flex; align-items: center; gap: 70px; }
.die { width: 220px; height: 220px; background: #fff; border-radius: 34px; box-shadow: 0 8px 0 #d8d2c8, 0 10px 30px rgba(0,0,0,.15); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 26px; cursor: pointer; }
.die i { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); place-self: center; visibility: hidden; }
.die.rolling { animation: shake .12s infinite; }
@keyframes shake { 0% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } 100% { transform: rotate(-8deg); } }
.dice-items { display: grid; grid-template-columns: repeat(3, 170px); gap: 16px; }
.dice-items .it { background: #fff; border-radius: 16px; text-align: center; padding: 8px; border: 4px solid transparent; transition: border-color .2s, transform .2s; }
.dice-items .it.hit { border-color: var(--coral); transform: scale(1.08); }
.dice-items .it .p { height: 100px; display: flex; align-items: center; justify-content: center; }
.dice-items .it img { max-height: 100px; max-width: 100%; }
.dice-items .it .emoji { font-size: 74px; }
.dice-items .it .sw { width: 80px; height: 80px; border-radius: 10px; }
.dice-items .it .no { font-size: 22px; color: #888; }
/* 九宮格賓果 */
.s-bingo .cell { font-size: 36px; cursor: pointer; position: relative; }
.s-bingo .cell.on::after { content: ""; position: absolute; inset: 14%; border: 8px solid var(--coral); border-radius: 50%; }
/* 連結、計時 */
.s-link a { font-size: 40px; color: var(--ink); }
.link-go { display: inline-block; margin-top: 22px; padding: 16px 40px; border-radius: 999px; background: var(--coral, #f26a4d); color: #fff; font-size: 36px; font-weight: 700; text-decoration: none; box-shadow: 0 6px 0 rgba(0, 0, 0, .15); }
.link-go:hover { transform: translateY(-2px); }
.link-host { margin-top: 14px; font-size: 20px; color: #6b6660; }
.timer { font-size: 160px; font-variant-numeric: tabular-nums; }
.timer.done { color: var(--coral); }
.s-text h2 { font-size: 56px; font-weight: 500; margin: 0 0 20px; }
.s-text p { font-size: 34px; white-space: pre-line; margin: 0; }

/* ---------- 遊戲 ---------- */
.game-top { position: absolute; top: 18px; left: 26px; right: 26px; display: flex; justify-content: space-between; align-items: center; z-index: 3; font-size: 26px; }
.game-top .score { background: #fff; border-radius: 30px; padding: 6px 20px; }
.cards { display: grid; gap: 16px; }
.card-f { perspective: 800px; cursor: pointer; }
.card-f .in { position: relative; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.card-f.up .in, .card-f.done .in { transform: rotateY(180deg); }
.card-f .fr, .card-f .bk { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; display: flex; align-items: center; justify-content: center; text-align: center; }
.card-f .bk { background: var(--teal); background-image: radial-gradient(circle at 30% 30%, rgba(255,255,255,.25) 0 18%, transparent 19%); }
.card-f .fr { background: #fff; transform: rotateY(180deg); font-size: 32px; padding: 6px; }
.card-f .fr img { max-width: 90%; max-height: 90%; }
.card-f .fr .emoji { font-size: 70px; }
.card-f .fr .sw { width: 70%; height: 70%; border-radius: 10px; }
.card-f.done .fr { box-shadow: 0 0 0 5px var(--sun) inset; }
.match { display: flex; gap: 120px; }
.match .col { display: flex; flex-direction: column; gap: 14px; }
.match .m { min-width: 300px; min-height: 64px; background: #fff; border-radius: 14px; font-size: 30px; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; border: 4px solid transparent; padding: 4px 12px; }
.match .m img { max-height: 54px; }
.match .m .emoji { font-size: 40px; }
.match .m.sel { border-color: var(--teal); }
.match .m.ok { background: #dff3e3; border-color: #3a9d55; cursor: default; }
.match .m.bad { animation: shake .12s 3; border-color: var(--coral); }
.sky { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(#bfe6f5, var(--cream)); }
.balloon { position: absolute; width: 150px; height: 180px; border-radius: 50% 50% 48% 48%; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 26px; color: #fff; font-weight: 600; cursor: pointer; text-shadow: 0 1px 2px rgba(0,0,0,.3); padding: 8px; }
.balloon::after { content: ""; position: absolute; bottom: -60px; left: 50%; width: 2px; height: 60px; background: #888; }
.balloon.pop { animation: popb .25s forwards; }
@keyframes popb { to { transform: scale(1.6); opacity: 0; } }
.prompt { position: absolute; top: 70px; left: 0; right: 0; text-align: center; z-index: 3; }
.prompt .pp { display: inline-flex; align-items: center; gap: 20px; background: #fff; border-radius: 20px; padding: 10px 26px; font-size: 40px; box-shadow: 0 4px 14px rgba(0,0,0,.1); }
.prompt img { max-height: 90px; }
.prompt .emoji { font-size: 70px; }
.prompt .sw { width: 80px; height: 80px; border-radius: 10px; }
.quiz { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding-top: 90px; }
.quiz .qq { display: flex; align-items: center; gap: 30px; font-size: 52px; height: 250px; }
.quiz .qq img { max-height: 230px; }
.quiz .qq .emoji { font-size: 190px; }
.quiz .qq .sw { width: 210px; height: 210px; border-radius: 20px; }
.quiz .opts4 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 1100px; margin-top: 30px; }
.quiz .opts4 button { height: 120px; border: 0; border-radius: 14px; font-size: 40px; color: #fff; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 20px; padding: 0 30px; }
.quiz .opts4 button::before { font-size: 40px; }
.quiz .opts4 button:nth-child(1) { background: #e21b3c; } .quiz .opts4 button:nth-child(1)::before { content: "▲"; }
.quiz .opts4 button:nth-child(2) { background: #1368ce; } .quiz .opts4 button:nth-child(2)::before { content: "◆"; }
.quiz .opts4 button:nth-child(3) { background: #d89e00; } .quiz .opts4 button:nth-child(3)::before { content: "●"; }
.quiz .opts4 button:nth-child(4) { background: #26890c; } .quiz .opts4 button:nth-child(4)::before { content: "■"; }
.quiz .opts4 button.dim { opacity: .3; }
.quiz .bar { width: 1100px; height: 14px; background: #ddd; border-radius: 8px; overflow: hidden; }
.quiz .bar i { display: block; height: 100%; background: var(--teal); transition: width .2s linear; }
.end { text-align: center; }
.end h2 { font-size: 70px; margin: 0; font-weight: 500; }
.end p { font-size: 36px; }

/* 播放器外框的按鈕 */
.deck-bar { position: fixed; right: 16px; bottom: 14px; z-index: 30; display: flex; gap: 6px; align-items: center; padding: 6px 8px 6px 14px; border-radius: 14px; background: rgba(47, 49, 51, .88); color: #fff; font: 600 16px -apple-system, "PingFang TC", sans-serif; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.deck-bar #pos { margin-right: 4px; font-variant-numeric: tabular-nums; }
.deck-bar button { background: rgba(255, 255, 255, .16); color: #fff; border: 0; border-radius: 9px; padding: 8px 14px; cursor: pointer; font: inherit; }
.deck-bar #prev, .deck-bar #next { font-size: 22px; line-height: 1; padding: 6px 16px; }
.deck-bar button:hover { background: rgba(255, 255, 255, .3); }
.deck-msg { color: #ddd; font: 16px -apple-system, sans-serif; position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
:fullscreen .deck-wrap, .deck-wrap:fullscreen { left: 0; }
:fullscreen .app-rail { display: none; }
[data-say] { cursor: pointer; }

/* 黑板主題：底色深，灰字改亮；白底卡片裡維持深色字 */
.deck-stage.dark .s-title .who, .deck-stage.dark .s-agenda .en, .deck-stage.dark .word .zh,
.deck-stage.dark .s-pattern .small, .deck-stage.dark .link-host, .deck-stage.dark .tap-hint { color: #e6e1d3; }
.deck-stage.dark .s-overview .cell, .deck-stage.dark .s-missing .grid, .deck-stage.dark .s-bingo .grid,
.deck-stage.dark .die, .deck-stage.dark .dice-items .it, .deck-stage.dark .game-top .score,
.deck-stage.dark .card-f .fr, .deck-stage.dark .match .m, .deck-stage.dark .prompt .pp, .deck-stage.dark .qg { color: #2f3133; }
.deck-stage.dark .say { background: transparent; }
/* 背景設計不是色塊的主題就不畫色塊 */
.deck-stage:not([data-decor="blobs"]) .blob { display: none; }
.deck-stage.dark .s-section .circle { color: #2f3133; }
