/* C 典藏卡牌・手機答題代表頁。所有卡框、卡背、封蠟、計時環、牌桌都是 gpt_image_2_5 生成原圖（assets/gen），CSS 只負責擺放、9-slice、混合與動態。 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: #000; }
body { color: #f5ead0; font-family: "Songti TC", "Noto Serif TC", serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.num { font-family: "Didot", "Bodoni 72", "Times New Roman", serif; font-weight: 700; }

.stage { position: relative; width: 390px; height: 844px; margin: 0 auto; overflow: hidden; overflow: clip; background: #020604; isolation: isolate; }
.bg { position: absolute; inset: 0; background: url(assets/gen/c-table.jpg) center 38% / cover; z-index: -2; animation: bgin 1.4s ease-out both; }
@keyframes bgin { from { opacity: 0; filter: brightness(.3); } to { opacity: 1; filter: none; } }
.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

/* frame helpers — J2 card front as 9-slice, J3 card back as cover */
.fr { border: 11px solid transparent; border-image: url(assets/gen/c-card-front.png) 84 fill / 11px stretch; }
.f.back { background: url(assets/gen/c-card-back.png) center / 100% 100%; border-radius: 7px; }

/* HUD */
.hud { position: absolute; left: 14px; right: 14px; top: 12px; height: 44px; display: flex; justify-content: space-between; align-items: center; z-index: 5; }
.tbl { display: flex; align-items: center; gap: 8px; font-size: 16px; letter-spacing: .06em; }
.tbl .mini { width: 26px; height: 39px; border-radius: 3px; background: url(assets/gen/c-card-back.png) center / cover; box-shadow: 0 3px 8px rgba(0,0,0,.7); transform: rotate(-8deg); }
.tbl b { font-size: 22px; color: #ffe2a0; }
.qno { font-size: 15px; opacity: 0; transition: opacity .4s; } .qno .num { font-size: 26px; color: #ffe2a0; }
.on-q .qno { opacity: 1; }
.demo-tag { position: absolute; right: 14px; top: 58px; font-size: 11px; color: rgba(245,234,208,.55); letter-spacing: .08em; z-index: 5; }

/* lobby — waiting before the question */
.lobby { position: absolute; inset: 0; z-index: 2; transition: opacity .5s; }
.lobby .wm { position: absolute; left: 50%; top: 96px; width: 250px; margin-left: -125px; filter: drop-shadow(0 4px 12px rgba(0,0,0,.8)); animation: wm 1.6s .5s cubic-bezier(.2,.9,.3,1) both; }
@keyframes wm { from { opacity: 0; transform: translateY(14px); filter: blur(4px) drop-shadow(0 4px 12px rgba(0,0,0,.8)); } }
.deck { position: absolute; left: 50%; top: 250px; width: 150px; height: 225px; margin-left: -75px; animation: deckin .9s .2s cubic-bezier(.2,1.2,.4,1) both; }
.deck i { position: absolute; inset: 0; border-radius: 9px; background: url(assets/gen/c-card-back.png) center / 100% 100%; box-shadow: 0 14px 30px rgba(0,0,0,.75); }
.deck i:nth-child(1) { transform: translate(-7px, 6px) rotate(-5deg); filter: brightness(.6); }
.deck i:nth-child(2) { transform: translate(6px, 3px) rotate(3deg); filter: brightness(.8); }
.deck i:nth-child(3) { animation: breathe 3.2s ease-in-out infinite; }
@keyframes deckin { from { opacity: 0; transform: translateY(-40px) scale(1.15); } }
@keyframes breathe { 50% { box-shadow: 0 14px 30px rgba(0,0,0,.75), 0 0 34px rgba(255,205,110,.45); } }
.cap { position: absolute; left: 0; right: 0; top: 520px; text-align: center; animation: capin .7s 1.1s ease-out both; }
.cap b { display: block; font-size: 24px; letter-spacing: .12em; color: #ffe7b0; text-shadow: 0 2px 10px rgba(0,0,0,.9); }
.cap span { display: block; margin-top: 10px; font-size: 15px; color: rgba(245,234,208,.82); }
@keyframes capin { from { opacity: 0; transform: translateY(10px); } }
.dots { display: inline-flex; gap: 5px; margin-left: 8px; vertical-align: middle; }
.dots i { width: 6px; height: 6px; transform: rotate(45deg); background: #d9b15c; animation: dot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 50% { opacity: .2; } }
.on-q .lobby { opacity: 0; pointer-events: none; }

/* question-number flip card — the transition into each question */
.flipcard { position: absolute; left: 50%; top: 250px; width: 150px; height: 225px; margin-left: -75px; perspective: 900px; z-index: 20; display: none; }
.flipcard .in, .rc .in, .lot .in, .oc .in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.4,0,.2,1); }
.f { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.f.front { transform: rotateY(180deg); }
.flipcard .front, .rc .front, .lot .front { border: 14px solid transparent; border-image: url(assets/gen/c-card-front.png) 84 fill / 14px stretch; display: grid; place-content: center; text-align: center; }
.flipcard small { font: 700 12px/1 "Didot", serif; letter-spacing: .4em; color: #d9b15c; }
.flipcard b { display: block; margin-top: 12px; font-size: 30px; letter-spacing: .1em; color: #fff0c4; }
.flipcard.show { display: block; animation: fcin .35s ease-out both; }
.flipcard.open .in { transform: rotateY(180deg); }
.flipcard.out { animation: fcout .45s ease-in forwards; }
@keyframes fcin { from { transform: translateY(-50px); opacity: 0; } }
@keyframes fcout { to { transform: translateY(-260px) scale(.4); opacity: 0; } }

/* question card (J2 stretched 9-slice) */
.qcard { position: absolute; left: 18px; right: 18px; top: 74px; height: 178px; padding: 18px 22px; border: 24px solid transparent; border-image: url(assets/gen/c-card-front.png) 84 fill / 24px stretch;
  display: grid; align-content: center; text-align: center; transform-origin: 50% 0; transform: scaleY(0); opacity: 0; z-index: 3; filter: drop-shadow(0 10px 22px rgba(0,0,0,.7)); }
.qcard small { position: absolute; top: -8px; left: 0; right: 0; font-size: 12px; letter-spacing: .3em; color: #d9b15c; }
.qcard p { font-size: 21px; font-weight: 700; line-height: 1.55; color: #fff3d6; }
.on-q .qcard { animation: qin .5s cubic-bezier(.2,1.2,.4,1) forwards; }
@keyframes qin { 0% { transform: scaleY(0); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* clock: timer ring (J5, screen-blended) + gain + table pick */
.clock { position: absolute; left: 0; right: 0; top: 262px; height: 100px; visibility: hidden; }
.on-q .clock { visibility: visible; }
.on-q .clock > * { animation: fade .5s .2s both; }
/* the ring PNG is gold on pure black: the whole .timer is screen-blended onto the table so the black disappears (no stacking-context ancestor in between) */
.timer { position: absolute; left: 50%; top: 0; width: 98px; height: 98px; margin-left: -49px; mix-blend-mode: screen; }
.timer img { position: absolute; inset: 0; width: 100%; height: 100%; }
.timer .arc { position: absolute; inset: 21px; border-radius: 50%; background: conic-gradient(rgba(255,214,120,.95) calc(var(--p, 100) * 1%), rgba(0,0,0,.55) 0);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%); mask: radial-gradient(circle, transparent 62%, #000 64%); }
.timer .sec { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; color: #fff0c4; text-shadow: 0 0 12px rgba(255,200,100,.6); }
.timer.low .sec { color: #ffb08a; animation: low .5s infinite alternate; } @keyframes low { to { transform: scale(1.12); } }
.gain, .pick { position: absolute; top: 20px; width: 128px; text-align: center; }
.gain { left: 10px; } .pick { right: 10px; }
.gain small, .pick small { display: block; font-size: 12px; color: rgba(245,234,208,.75); letter-spacing: .04em; }
.gain b { display: block; font-size: 30px; color: #ffe2a0; line-height: 1.2; }
.pick b { display: block; font-size: 30px; color: #ffe2a0; line-height: 1.2; }
.pick em { display: block; font-style: normal; font-size: 12px; color: rgba(245,234,208,.8); }
.pick.bump b { animation: bump .45s cubic-bezier(.2,1.6,.4,1); } @keyframes bump { 0% { transform: scale(1.6); color: #fff; } }
.locked .gain small::after { content: ""; }

/* hand of answer cards */
.hand { position: absolute; left: 0; right: 0; top: 536px; height: 240px; z-index: 6; perspective: 1000px; }
.oc { position: absolute; left: 50%; top: 96px; width: 92px; height: 138px; margin-left: -46px; transform-origin: 50% 150%; cursor: pointer;
  transition: transform .42s cubic-bezier(.2,1.25,.4,1), filter .3s, opacity .3s; filter: drop-shadow(0 10px 14px rgba(0,0,0,.7)); }
.oc .front { transform: none; display: grid; grid-template-rows: auto 1fr; justify-items: center; padding: 6px 4px 8px; border-radius: 7px; }
.oc .front.fr { border-width: 11px; }
.oc .back { transform: rotateY(180deg); }
.oc.down .in { transform: rotateY(180deg); }
.oc .L { font: 700 46px/1 "Didot", "Bodoni 72", serif; background: linear-gradient(180deg, #fff6da, #c8963e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.oc .w { align-self: center; font: 600 14px/1.25 "Optima", "Avenir Next", sans-serif; color: #f5ead0; text-align: center; }
.oc.deal { animation: deal .5s cubic-bezier(.2,1.2,.4,1) both; }
@keyframes deal { from { opacity: 0; transform: translate(0, -330px) rotate(0) scale(.6); } }
.oc.sel { filter: drop-shadow(0 0 16px rgba(255,214,120,.95)) drop-shadow(0 12px 18px rgba(0,0,0,.7)); z-index: 3; }
/* 封牌（Owner 2026-10-19 重做）：金綠鍛壓章壓在本桌的牌正中央，齒輪邊轉一格鎖住，再退到牌的右上角留著 */
.oc .seal { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; opacity: 0; pointer-events: none; filter: drop-shadow(0 8px 10px rgba(0,0,0,.75)); }
.oc .seal.go { animation: seal 1.25s cubic-bezier(.5,0,.3,1) forwards; }
@keyframes seal { 0% { opacity: 0; transform: translateY(-90px) scale(2.4) rotate(-30deg); filter: blur(3px) drop-shadow(0 8px 10px rgba(0,0,0,.75)); }
  26% { opacity: 1; transform: scale(1) rotate(-15deg); filter: drop-shadow(0 8px 10px rgba(0,0,0,.75)); }
  32% { transform: scale(1.06, .92) rotate(-15deg); } 44% { transform: scale(1) rotate(0deg); }
  70% { transform: scale(1) rotate(0deg); } 100% { opacity: 1; transform: translate(42px, -64px) scale(.74) rotate(0deg); } }
.oc .sweep { position: absolute; inset: 0; border-radius: 7px; pointer-events: none; background: linear-gradient(115deg, transparent 36%, rgba(255,248,220,.42) 50%, transparent 64%); background-size: 260% 100%; background-position: 130% 0; }
.oc.win .sweep { animation: sweep 1.1s .1s ease-out both; } @keyframes sweep { to { background-position: -40% 0; } }
.oc.win { filter: drop-shadow(0 0 26px rgba(255,220,130,1)) drop-shadow(0 12px 18px rgba(0,0,0,.7)); }
.oc.lose { filter: grayscale(.7) brightness(.5) drop-shadow(0 10px 14px rgba(0,0,0,.7)); }
.oc.answer { filter: drop-shadow(0 0 22px rgba(255,220,130,.95)) drop-shadow(0 12px 18px rgba(0,0,0,.7)); }
.revealed .oc:not(.sel):not(.answer) { opacity: .55; }
.hand.gone .oc { transition: transform .5s cubic-bezier(.6,0,.4,1), opacity .5s; opacity: 0; }

/* score pop + rays */
.score { position: absolute; left: 0; right: 0; top: 590px; text-align: center; z-index: 30; opacity: 0; pointer-events: none; }
.score b { display: block; font-size: 56px; color: #fff0c4; text-shadow: 0 0 24px rgba(255,200,90,.85), 0 3px 0 rgba(0,0,0,.6); }
.score span { display: inline-block; margin-top: 4px; padding: 5px 12px; font-size: 14px; background: rgba(0,0,0,.6); border-radius: 4px; }
.score.go { animation: sc 1.1s cubic-bezier(.2,1.3,.4,1) forwards; } @keyframes sc { 0% { opacity: 0; transform: translateY(30px) scale(.7); } 35% { opacity: 1; transform: none; } 100% { opacity: 1; } }
.rays { position: absolute; left: 50%; top: 520px; width: 820px; height: 820px; margin: -410px 0 0 -410px; z-index: 1; opacity: 0; pointer-events: none;
  background: repeating-conic-gradient(rgba(255,226,160,.2) 0 5deg, transparent 5deg 15deg); -webkit-mask: radial-gradient(circle, #000 8%, transparent 58%); mask: radial-gradient(circle, #000 8%, transparent 58%); }
.rays.go { animation: rays 9s linear infinite, fade .6s forwards; } @keyframes rays { to { transform: rotate(360deg); } } @keyframes fade { to { opacity: 1; } }

/* rank card + lottery card */
.rank { position: absolute; inset: 0; z-index: 25; pointer-events: none; }
.rc, .lot { position: absolute; left: 50%; perspective: 1000px; opacity: 0; }
.rc { top: 300px; width: 214px; height: 300px; margin-left: -107px; }
.rc .front { gap: 6px; }
.rc .t { font-size: 13px; letter-spacing: .3em; color: #d9b15c; }
.rc .pos { font-size: 30px; letter-spacing: .08em; color: #fff0c4; } .rc .pos .num { font-size: 52px; color: #ffe2a0; vertical-align: -6px; }
.rc .tot { font-size: 16px; } .rc .tot b { font-size: 24px; color: #ffe2a0; }
.rc .gap { font-style: normal; font-size: 13px; color: rgba(245,234,208,.8); }
.rank.show { pointer-events: auto; }
.rank.show .rc { animation: rcin .55s cubic-bezier(.2,1.2,.4,1) forwards; }
.rank.show .rc .in { transform: rotateY(180deg); transition-delay: .5s; }
.rank.final .rc { top: 118px; }
@keyframes rcin { from { opacity: 0; transform: translateY(280px) rotate(8deg); } to { opacity: 1; transform: none; } }
.lot { top: 450px; width: 190px; height: 268px; margin-left: -95px; }
.lot .back { display: grid; align-content: end; justify-items: center; padding-bottom: 22px; }
.lot .back span { font-size: 18px; font-weight: 700; letter-spacing: .2em; color: #fff0c4; text-shadow: 0 2px 6px #000; }
.lot .front { gap: 12px; padding: 0 8px; }
.lot .front b { font-size: 19px; color: #fff0c4; }
.lot .front small { font-size: 11px; color: rgba(245,234,208,.75); line-height: 1.4; }
.lot .go { width: 128px; height: 44px; margin: 0 auto; border: 9px solid transparent; border-image: url(assets/gen/c-card-front.png) 84 fill / 9px stretch; font-size: 16px; font-weight: 700; color: #ffe7b0; }
.rank.final .lot { animation: rcin .55s .7s cubic-bezier(.2,1.2,.4,1) forwards; cursor: pointer; }
.lot.open .in { transform: rotateY(180deg); }
.hint { position: absolute; left: 0; right: 0; top: 740px; text-align: center; font-size: 14px; color: #ffe2a0; opacity: 0; transition: opacity .4s; }
.rank.final .hint { opacity: 1; transition-delay: 1.3s; }

/* bottom ribbon, toast, reconnect */
.ribbon { position: absolute; left: 12px; right: 12px; bottom: 10px; min-height: 36px; padding: 8px 10px; text-align: center; font-size: 14px; line-height: 1.4; z-index: 10;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.72) 12%, rgba(0,0,0,.72) 88%, transparent); color: #f5ead0; }
.ribbon b { color: #ffe2a0; }
.toast { position: absolute; left: 30px; right: 30px; top: 470px; z-index: 35; text-align: center; pointer-events: none; }
.toast div { display: inline-block; padding: 9px 14px; font-size: 14px; background: rgba(10,22,16,.92); box-shadow: 0 0 0 1px rgba(217,177,92,.7), 0 8px 18px rgba(0,0,0,.6); border-radius: 4px; animation: toast 2.4s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 12%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.net { position: absolute; inset: 0; z-index: 50; display: none; place-content: center; text-align: center; background: rgba(0,0,0,.72); }
.net.show { display: grid; }
.net .spin { width: 60px; height: 90px; margin: 0 auto 18px; border-radius: 5px; background: url(assets/gen/c-card-back.png) center / 100% 100%; animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotateY(360deg); } }
.net p { font-size: 16px; }

/* demo controls live outside the 390x844 stage */
.demo { width: 390px; margin: 10px auto 30px; display: flex; flex-wrap: wrap; gap: 6px; font-family: "PingFang TC", sans-serif; font-size: 13px; color: #9c927c; }
.demo b { width: 100%; font-weight: 600; }
.demo i { width: 100%; height: 0; }
.demo button { padding: 6px 9px; border: 1px solid #3a3326; border-radius: 3px; color: #d8cdb2; background: #12100c; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
