*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:"Microsoft YaHei",sans-serif;color:white}body{background:#312052;display:flex;justify-content:center}button,input{font:inherit}button{cursor:pointer;border:0}button:active{transform:scale(.95)}button:focus-visible{outline:3px solid #fff;outline-offset:3px}[hidden]{display:none!important}#game{width:100%;max-width:480px;min-height:100svh;position:relative;overflow:hidden;background:radial-gradient(circle at 20% 15%,#ae77f180,transparent 40%),radial-gradient(#6841c344 1px,transparent 1.5px),#8956e8;background-size:auto,12px 12px,auto;padding:20px 13px 14px;display:flex;flex-direction:column}#game:before{content:'♧';position:absolute;left:40px;top:70px;font-size:270px;color:#6236c226;transform:rotate(-30deg);pointer-events:none}header{display:flex;align-items:center;gap:16px;z-index:1}header button{background:none;color:white;font-size:30px}.room{display:flex;align-items:center;background:#ffffff12;border-radius:30px;padding:7px;gap:7px;flex:1}.room-icon{font-size:22px;color:#ffe19e}.room b{font-size:15px}.room small{display:block;font-size:10px;color:#e2ceff}.tag{font-size:11px;color:#d5b7f3;border:1px solid #c3a0eb;border-radius:15px;padding:4px}.connection{font-size:10px;color:#66daff;margin:5px 0}#seats{display:flex;justify-content:space-between;gap:7px;margin:9px 0 17px;z-index:1}.seat{flex:1;min-width:0;text-align:center}.seat-face{aspect-ratio:1;border-radius:50%;background:#ffffff12;display:flex;align-items:center;justify-content:center;color:#ffffff66;font-size:23px}.seat-face img{width:100%;height:100%;border-radius:50%;object-fit:cover;border:2px solid #85eeec}.seat small{font-size:9px;color:#d7b9ff}.room-meta{display:flex;justify-content:space-between;font-size:12px;color:#ead8ff;margin:0 0 54px}.room-meta span{background:#ffffff0c;border-radius:10px;padding:4px 8px}.play{z-index:1}.panel{position:relative;aspect-ratio:1.22;background:#fbd59a;border:4px solid #30115f;border-radius:15px;box-shadow:inset 0 0 0 2px #fff1c0,0 3px 0 #b18aea;background-image:linear-gradient(#fff2 1px,transparent 1px),linear-gradient(90deg,#fff2 1px,transparent 1px);background-size:9px 9px;color:#250e52}.target{position:absolute;right:3px;top:3px;border:2px solid #28104f;border-radius:6px;background:linear-gradient(#b4f9ed,#eefdc7);font-size:17px;font-weight:900;padding:2px 10px;z-index:2}.category{position:absolute;top:-11px;left:10px;background:#fffceb;border:3px solid #321364;border-radius:6px;font-weight:900;font-size:20px;padding:2px 5px;z-index:2}#question{position:absolute;inset:38px 10px 36px;display:flex;align-items:center;justify-content:center}#question .apple{width:100%;height:100%;object-fit:contain;mix-blend-mode:multiply}#question .digit{height:60%;max-width:50%;animation:pop .9s ease-out}.welcome{text-align:center}.welcome>b{font-size:25px}.welcome p{font-size:14px;line-height:1.8}.welcome button,#again{background:#ffdf43;color:#371369;border:2px solid #5c2aa3;border-radius:25px;padding:10px 30px;font-weight:bold;box-shadow:0 3px #d69b34}.timer{position:absolute;bottom:9px;left:10px;display:flex;gap:4px;align-items:center}.clock{color:#ffe842;font-size:31px;line-height:1;text-shadow:1px 1px #5e329e,-1px -1px #5e329e}.timer b{background:#fff4b0;border:2px solid #76509c;border-radius:5px;min-width:42px;text-align:center;font-size:15px}#round{position:absolute;right:12px;bottom:11px;font-size:11px;color:#785b6c}#hint{font-size:12px;text-align:center;height:18px;margin:12px 0 4px;color:#fff8ee}#answer{display:block;width:64%;margin:0 auto;background:transparent;padding:0}#answer img{width:100%;display:block}#answer:disabled{opacity:.65;cursor:default}#ranking{display:flex;justify-content:center;gap:39px;margin:26px 0 20px;z-index:1}.rank{position:relative;text-align:center;width:58px}.rank-face{height:58px;border:2px solid #391263;border-radius:8px;background:#d6c3ef;box-shadow:0 2px 2px #452475;display:grid;place-items:center;color:#9178ac;font-size:25px}.rank-face img{width:100%;height:100%;object-fit:cover;border-radius:6px}.crown{position:absolute;width:37px;height:30px;object-fit:contain;top:-18px;left:-13px;transform:rotate(-17deg)}.points{position:relative;display:block;margin:-9px 0 0 -7px;width:40px;background:#ffffa6;color:#361065;border:2px solid #421b72;border-radius:4px;font-size:13px;font-weight:900}.rank:nth-child(2) .points{background:#d3faff}.rank:nth-child(3) .points{background:#ffcd9d}.rank small{font-size:10px;color:#e4cdfc}.lower{margin-top:auto;padding:60px 0 18px;display:flex;justify-content:space-between;font-size:10px;color:#dfc0f6}footer{display:flex;align-items:center;justify-content:space-between;color:#e7d3ff;font-size:24px}footer button{border-radius:20px;background:#ffffff17;color:#e7d3ff;padding:8px 12px;font-size:12px}footer #restart{font-size:24px;padding:0 10px}.mute{opacity:.5}#composer{position:fixed;bottom:0;left:0;right:0;background:#f8f5ff;padding:12px;z-index:10;box-shadow:0 -3px 20px #34134c44}form{display:flex;gap:8px;max-width:480px;margin:auto}input{min-width:0;flex:1;border:1px solid #dfd6ec;background:#eeeaf6;border-radius:10px;padding:12px;font-size:16px;color:#30134e}form button{border-radius:9px;background:#874cda;color:white;padding:10px}#close-input{background:none;color:#7b5b95;font-size:22px}#overlay{position:fixed;inset:0;background:#180d3f99;z-index:20;display:grid;place-items:center}#result{background:linear-gradient(130deg,#fff,#f4f0ff);border:4px solid #6330ba;border-radius:23px;width:275px;text-align:center;padding:45px 16px 20px;color:#302039;position:relative;box-shadow:0 10px 40px #1e064080;animation:pop .25s ease-out}.winner{position:absolute;width:75px;height:75px;object-fit:cover;border-radius:50%;top:-42px;left:96px;border:4px solid #ffe17a}h1{background:#ff4a55;color:white;text-shadow:0 2px #a2314f;border:2px solid #b92d48;border-radius:10px;transform:rotate(-3deg);font-size:27px;margin:0 0 12px;padding:5px}.correct{background:#ffb33b;border-radius:20px;padding:4px 24px;color:white;font-size:17px}#result-label{font-size:14px;margin:22px 0 5px}#result-answer{font-size:30px}#result-score{color:#9869ca;font-weight:bold}#toast{position:fixed;top:24%;left:50%;transform:translateX(-50%);background:#32175ce8;border-radius:20px;padding:12px 20px;z-index:40;max-width:90%;display:none;font-size:14px}.score-pop{animation:pop .4s}@keyframes pop{0%{transform:scale(.65);opacity:.5}60%{transform:scale(1.08)}100%{transform:scale(1);opacity:1}}@media(max-height:740px){#game{padding-top:10px}.room-meta{margin-bottom:27px}#ranking{margin-top:23px}.lower{padding-top:22px}}@media(min-width:481px){#game{box-shadow:0 0 60px #17092f}}
/* Keep the room controls visible on common portrait screens. */
.lower{padding-top:18px;padding-bottom:12px}.room-meta{margin-bottom:38px}#ranking{margin-bottom:12px}.crown{width:62px;height:48px;top:-26px;left:-24px;transform:rotate(-3deg)}#game{padding-bottom:max(12px,env(safe-area-inset-bottom))}
@media(max-height:740px){.room-meta{margin-bottom:22px}.lower{padding-top:8px}#ranking{margin-top:23px;margin-bottom:8px}#game{padding-top:8px}header{gap:8px}.panel{aspect-ratio:1.35}}
.room-meta{margin-bottom:24px}.lower{padding-top:10px}#ranking{margin-top:24px}#toast{pointer-events:none}
#question{overflow:hidden}#question .apple{transform:scale(1.65)}
@media(max-height:700px){#game{padding:8px 10px}.room{padding:3px 5px}.tag{display:none}.connection{margin:3px 0}#seats{margin:5px 0 7px}.seat-face{font-size:19px}.room-meta{margin-bottom:21px;font-size:10px}.panel{aspect-ratio:1.5}.category{font-size:17px}.target{font-size:15px}#hint{margin:8px 0 2px;font-size:11px}#answer{width:58%}#ranking{margin:21px 0 5px;gap:33px}.rank{width:49px}.rank-face{height:49px}.lower{padding:7px 0;font-size:9px}footer{font-size:20px}footer button{padding:6px 10px}}
@media(max-height:700px){.panel{aspect-ratio:1.8}.room-meta{margin-bottom:16px}.rank small{font-size:9px}}
#question .question-image{width:100%;height:100%;object-fit:contain}.category{max-width:60%;font-size:clamp(12px,4vw,20px);white-space:normal;overflow-wrap:anywhere;line-height:1.15}.target{top:32px;font-size:14px}#hint{height:auto;min-height:18px;overflow-wrap:anywhere}
.category{max-width:calc(100% - 130px);font-size:clamp(14px,4.6vw,20px)}.target{top:3px;font-size:17px}@media(max-height:700px){.target{font-size:15px}.category{font-size:17px}}
/* Independent content, outline, and floating HUD layers. */
.panel{border:0;background:#fbd59a;box-shadow:0 3px 0 #b18aea;isolation:isolate;background-image:linear-gradient(#fff2 1px,transparent 1px),linear-gradient(90deg,#fff2 1px,transparent 1px)}
.panel:after{content:'';position:absolute;inset:0;border:4px solid #30115f;border-radius:inherit;z-index:3;pointer-events:none}
.panel.has-question{background:#fff;background-image:none}
#question{inset:4px;border-radius:11px;z-index:1;padding:0;overflow:hidden}
#question .question-image{display:block;width:100%;height:100%;object-fit:contain;background:#fff;opacity:1;filter:none;mix-blend-mode:normal;transform:none}
.panel:not(.has-question) #question{padding:25px 8px}
.category{z-index:4}.target{z-index:5}.timer{z-index:6}#round{z-index:6}
.seat-face{border:1px solid #c99bff44;background:#ac79ed44;position:relative;overflow:hidden}.seat-face.occupied{background:#fff;border:2px solid #b0f7eb}.seat-face img{width:100%;height:100%;border:0;object-fit:contain;background:#fff}.seat-face svg{width:49%;height:49%;color:#e3ccff66}
.rank-face{overflow:hidden;background:#fff}.rank-face img{object-fit:contain;background:#fff}.winner{object-fit:contain;background:#fff}
/* A single stable slot: hidden children use display:none via [hidden]. */
#answer-slot{height:48px;margin-top:8px;display:flex;align-items:center;justify-content:center}
#answer-slot #hint{margin:0;padding:0;min-height:0;height:auto;text-align:center}
#answer-slot #answer{margin:0;width:64%;max-height:48px}
#answer-slot #answer img{height:auto;max-height:48px;object-fit:contain}
#ranking{margin-top:17px;margin-bottom:12px}
@media(max-height:700px){#answer-slot{height:40px;margin-top:6px}#answer-slot #answer{width:58%;max-height:40px}#answer-slot #answer img{max-height:40px}#ranking{margin-top:17px;margin-bottom:5px}}
#answer-slot #answer{height:48px;position:relative;flex-shrink:0}
#answer-slot #answer img{position:absolute;left:0;top:50%;width:100%;height:auto;max-height:none;transform:translateY(-50%)}
@media(max-height:700px){#answer-slot #answer{height:40px}#answer-slot #answer img{max-height:none}}
/* Independent image, opaque countdown veil, cue, frame, and HUD. */
.panel{background:#fff;background-image:none}
#question{z-index:0}
.panel:not(.has-question) #question{padding:25px 8px}
.panel.has-question #question{padding:0}
#countdown-mask{position:absolute;inset:4px;border-radius:11px;z-index:1;background:#fbd59a;opacity:1;pointer-events:none;transition:none}
#countdown-mask.revealing{opacity:0;transition:opacity 500ms linear}
#round-cue{position:absolute;inset:4px;z-index:2;display:flex;align-items:center;justify-content:center;pointer-events:none}
#round-cue .digit{height:60%;max-width:50%;animation:pop .9s ease-out}
.start-word{width:54%;height:auto;overflow:visible}
.panel:after{z-index:3}.category{z-index:4}.target{z-index:5}.timer{z-index:6}
#ranking{margin-top:14px}
/* Countdown digits change once per second without bounce, scale, or fade. */
#round-cue .digit{animation:none;transform:none;opacity:1}
/* Match the reference: visible glyph is about 28% of the panel height. */
#round-cue .digit{height:42%;max-width:36%}
#round-cue .start-sticker{width:48%;height:auto;max-height:50%;object-fit:contain;animation:none;opacity:1}
/* Success art uses its native 840x780 canvas; all positioning follows the asset README. */
:root{--streak-duration:400ms;--streak-easing:linear}
.success-base,.success-frame,#streak-slot{display:none}
#overlay.success-overlay{align-items:start;padding-top:22svh}
#result.illustrated{width:min(77vw,330px);aspect-ratio:840/780;padding:0;border:0;border-radius:0;background:none;box-shadow:none;animation:none;isolation:isolate}
#result.illustrated .success-base,#result.illustrated .success-frame{display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none}
#result.illustrated .success-base{z-index:0}
#result.illustrated .success-frame{z-index:2}
#result.illustrated .winner{position:absolute;left:34.5238%;top:2.8205%;width:30.9524%;height:auto;aspect-ratio:1;border:0;border-radius:50%;object-fit:contain;background:#fff;z-index:1}
#result.illustrated #result-title,#result.illustrated #result-sub,#result.illustrated #result-label,#result.illustrated #result-score{display:none}
#result.illustrated #result-answer{position:absolute;left:14%;top:66%;width:72%;height:15.4%;display:flex;align-items:center;justify-content:center;color:#565656;font-size:min(var(--answer-size,20px),20px);font-weight:400;line-height:1.2;text-align:center;overflow-wrap:anywhere;overflow:hidden;padding:2px 4px;z-index:3}
#result.illustrated #streak-slot{display:block;position:absolute;left:69.6429%;top:36.5629%;width:25%;aspect-ratio:470/402;z-index:4;pointer-events:none}
.streak-badge{display:block;width:100%;height:100%;object-fit:contain;transform-origin:50% 50%;animation:streak-bounce var(--streak-duration) var(--streak-easing) both}
@keyframes streak-bounce{0%{transform:scale(.65);opacity:0}25%{transform:scale(1.15);opacity:1}55%{transform:scale(.92);opacity:1}80%{transform:scale(1.04);opacity:1}100%{transform:scale(1);opacity:1}}
/* Each level grows in display space, rather than sharing one fixed-size box. */
#result.illustrated #streak-slot{left:auto;right:4%;top:auto;bottom:37%;width:30%;aspect-ratio:470/402}
#result.illustrated #streak-slot[data-level="2"]{width:34%}
#result.illustrated #streak-slot[data-level="3"]{width:38%}
#result.illustrated #streak-slot[data-level="4"]{width:42%}
#result.illustrated #streak-slot[data-level="5"]{width:46%}
#result.illustrated #result-answer{font-size:min(var(--answer-size,26px),26px)}
#result.illustrated #result-answer{top:65%;height:13.5%}
#answer-elapsed{display:none}
#result.illustrated #answer-elapsed:not([hidden]){display:flex;position:absolute;left:14%;top:79.5%;width:72%;height:6%;align-items:center;justify-content:center;margin:0;font-size:clamp(10px,3vw,12px);line-height:1;color:#77578d;white-space:nowrap;z-index:3}
#result.illustrated #result-answer{top:64%;height:12%}
#result.illustrated #answer-elapsed:not([hidden]){top:77%;height:5%}
/* Original clock art clipped to its outline; digits are a separate DOM layer. */
.timer{width:90px;height:37.47px;left:9px;bottom:8px;display:block}
.timer-art{display:block;width:100%;height:100%;overflow:hidden}
.timer b{position:absolute;left:32%;top:55%;transform:translateY(-50%);width:56%;min-width:0;padding:0;background:none;border:0;border-radius:0;color:#16094f;font-size:21px;line-height:1;font-weight:900;text-align:center;letter-spacing:-.7px}

/* The Visual Viewport moves only the input bar; the game keeps its height. */
#game{min-height:var(--game-screen-height,100svh)}
#composer{background:#fff;padding:7px 10px calc(7px + env(safe-area-inset-bottom));box-shadow:0 -1px 3px #21103b22;transition:none}
#composer.above-keyboard{padding-bottom:7px}
#composer #form{max-width:480px;align-items:center;gap:10px}
#composer #input{height:46px;background:#fff;border:1px solid #eeeeef;border-radius:5px;padding:8px 10px;font-size:16px;line-height:28px;box-shadow:none}
#composer #submit-answer{height:46px;min-width:80px;padding:0 20px;background:#087cfa;color:#fff;border-radius:9px;font-size:19px;font-weight:700;box-shadow:0 2px 3px #0067ca33;flex-shrink:0;touch-action:manipulation}
#composer #submit-answer:active{background:#0068de;transform:none}

/* Fade scene, unfold the plate, then bounce the independent streak badge. */
:root{--success-dim-duration:150ms;--success-unfold-duration:350ms;--success-streak-delay:calc(var(--success-dim-duration) + var(--success-unfold-duration))}
#overlay.success-overlay{background:rgba(18,18,25,.6);animation:success-scene-dim var(--success-dim-duration) linear both}
#result.illustrated{transform-origin:50% 50%;animation:success-unfold var(--success-unfold-duration) ease-out var(--success-dim-duration) both}
#result.illustrated::before{content:'';position:absolute;left:1.9%;right:1.9%;top:10.25%;bottom:2.2%;border:4px solid #271165;border-radius:9% / 10%;background:#fff;z-index:-1}
#result.illustrated .success-base,#result.illustrated .success-frame,#result.illustrated .winner,#result.illustrated #result-answer,#result.illustrated #answer-elapsed{animation:success-content-in var(--success-unfold-duration) linear var(--success-dim-duration) both}
#result.illustrated .streak-badge{animation-delay:var(--success-streak-delay)}
@keyframes success-scene-dim{from{background-color:rgba(18,18,25,0)}to{background-color:rgba(18,18,25,.6)}}
@keyframes success-unfold{from{transform:scaleY(.22)}to{transform:scaleY(1)}}
@keyframes success-content-in{from{opacity:0}to{opacity:1}}

/* Reference image 2, status/navigation bars removed: 390 × 830 coordinates.
   One transform scales the entire design; no per-component viewport scaling. */
#game{display:block;padding:0;max-width:480px;width:100%;height:calc(830px * var(--ui-scale,1));min-height:max(var(--game-screen-height,100svh),calc(830px * var(--ui-scale,1)));overflow:hidden;background:#8956e8 url('assets/ui/room/room-background.png') center top/100% 100% no-repeat}
#game:before{display:none}
.design-stage{position:absolute;left:0;top:0;width:390px;height:830px;transform:scale(var(--ui-scale,1));transform-origin:0 0;color:#fff}
.design-stage header{position:absolute;left:12px;top:6px;width:366px;height:42px;display:block;z-index:3}
.design-stage .room{width:222px;height:40px;padding:4px 7px;gap:6px;border-radius:25px;background:#ffffff16}
.design-stage .room b{font-size:14px}.design-stage .room small{font-size:9px}.design-stage .room-icon{font-size:22px}
.design-stage .tag{display:block;font-size:10px;padding:4px;white-space:nowrap}
.design-stage header #sound,.design-stage header #help{position:absolute;top:164px;width:25px;height:25px;line-height:21px;border:2px solid #28115d;border-radius:50%;background:#fff;color:#28115d;font-size:23px;padding:0}
.design-stage header #sound{left:0}.design-stage header #help{right:0}
.design-stage .connection{position:absolute;left:14px;top:47px;font-size:9px;margin:0;color:#6ed8ff}
.design-stage #seats{position:absolute;left:8px;top:64px;width:374px;height:51px;margin:0;display:grid;grid-template-columns:repeat(8,37px);column-gap:11px;align-items:start;z-index:4}
.design-stage .seat{width:37px;min-width:0}.design-stage .seat-face{width:37px;height:37px;padding:0;font-size:19px;border:1px solid #9bdfff77;background:#9168d845;aspect-ratio:1}
.design-stage .seat small{display:block;margin-top:1px;font-size:8px;line-height:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.design-stage .seat .seat-state{width:37px;height:14px;background-size:100% 100%;color:#fff;font-size:7px;line-height:13px;margin-top:-1px;position:relative}
.design-stage .room-meta{position:absolute;left:12px;top:110px;width:366px;height:38px;margin:0;font-size:12px;display:block}
.design-stage .room-meta>span{position:absolute;left:0;top:13px;height:19px;line-height:19px;padding:0 9px;border-radius:12px;background:#ffffff14}
#under-mic{position:absolute;right:0;top:0;width:151px;height:36px;border-radius:9px;background:#ffffff18;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:3px 9px}
#under-mic-faces{display:flex;gap:3px}#under-mic-faces img{width:25px;height:25px;border-radius:50%;object-fit:contain;background:#fff}#under-mic-count{font-size:10px;line-height:12px;white-space:pre-line}
.design-stage .play{position:absolute;left:12px;top:204px;width:368px;height:351px}
.design-stage .panel{width:368px;height:303px;aspect-ratio:auto;border-radius:14px;box-shadow:none}
.design-stage .panel:after{border-width:4px}
.design-stage .category{top:-8px;left:12px;max-width:235px;border-width:2px;border-radius:6px;font-size:17px;line-height:20px;padding:2px 4px}
.design-stage .target{top:3px;right:3px;font-size:15px;padding:2px 7px;border-width:2px;line-height:20px}
.design-stage #question{inset:4px;border-radius:10px}
.design-stage #countdown-mask{inset:4px;border-radius:10px;background-color:#ffdda0;background-image:linear-gradient(#fff1 1px,transparent 1px),linear-gradient(90deg,#fff1 1px,transparent 1px),linear-gradient(#fff2 1px,transparent 1px),linear-gradient(90deg,#fff2 1px,transparent 1px);background-size:4px 4px,4px 4px,16px 16px,16px 16px}
.design-stage #round-cue .digit{height:39%;max-width:36%}.design-stage #round-cue .start-sticker{width:48%;max-height:50%}
.design-stage .timer{left:9px;bottom:8px;width:90px;height:37.47px}.design-stage #round{font-size:9px;bottom:10px;right:10px}
.design-stage #answer-slot{position:absolute;left:0;top:309px;width:368px;height:35px;margin:0;display:flex;align-items:center;justify-content:center}
.design-stage #answer-slot #hint{font-size:11px;font-weight:700;line-height:18px;color:#fff;margin:0}
.design-stage #answer-slot #answer{width:184px;height:35px;max-height:none;margin:0}.design-stage #answer-slot #answer img{max-height:none;width:100%}
.design-stage #ranking{position:absolute;left:45px;top:568px;display:grid;grid-template-columns:repeat(4,52px);gap:28px 30px;width:298px;margin:0;align-content:start;justify-content:start}
.design-stage .rank{width:52px;min-height:63px;margin:0}.design-stage .rank-face{width:52px;height:52px;border-width:2px;border-radius:7px}.design-stage .rank-face img{border-radius:5px}
.design-stage .crown{width:37px;height:30px;top:-18px;left:-13px;transform:rotate(-3deg)}
.design-stage .points{margin:-10px 0 0 -3px;width:33px;height:16px;line-height:12px;border-width:2px;font-size:11px;border-radius:3px}
.design-stage .rank small{display:block;width:74px;max-width:none;margin:2px 0 0 -11px;text-align:center;font-size:9px;line-height:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.design-stage .lower{position:absolute;left:14px;top:756px;width:362px;padding:0;margin:0;font-size:10px;height:21px;line-height:21px}
.design-stage footer{position:absolute;left:12px;top:789px;width:366px;height:34px;display:flex;align-items:center;justify-content:space-between;font-size:24px}
.design-stage footer button{font-size:11px;padding:8px 10px}.design-stage footer #restart{font-size:24px;padding:0 9px}
#room-return{position:absolute;right:14px;top:746px;font-size:10px;padding:3px 7px;color:#fff;background:#ffffff16;border-radius:8px}
#room-lobby{display:none;position:absolute;inset:0;z-index:2;pointer-events:none}
.room-view #room-lobby{display:block}.room-view .play,.room-view #ranking{display:none!important}
#room-lobby button{pointer-events:auto}
.room-logo{position:absolute;left:79px;top:292px;width:232px;height:auto}
#room-loading{position:absolute;left:0;top:510px;width:390px;text-align:center;font-size:22px;font-weight:900;font-style:italic;color:#fff;-webkit-text-stroke:1px #2e0c62;text-shadow:1px 2px #2e0c62}
#room-loading span{display:inline-block;animation:room-dot .9s ease-in-out infinite;margin-left:4px}#room-loading span:nth-child(2){animation-delay:.15s}#room-loading span:nth-child(3){animation-delay:.3s}
@keyframes room-dot{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-6px)}}
#room-players{position:absolute;left:9px;top:510px;width:372px;display:grid;grid-template-columns:repeat(8,40px);gap:7px}
.room-player{position:relative;width:40px;height:44px;display:grid;place-items:center}.room-player>img:first-child{position:absolute;width:40px;height:40px;inset:0}
.room-player>span{z-index:2;font-size:8px;font-weight:900;color:#fff;text-shadow:0 1px #5d267a}
.room-player .room-player-avatar{position:absolute;left:4px;top:4px;width:32px;height:32px;object-fit:contain;border-radius:50%;background:#fff;z-index:1}
.room-player>span.room-player-status{position:absolute;top:33px;left:0;width:40px;height:14px;background-size:100% 100%;font-size:7px;line-height:14px;text-align:center}
.room-actions{position:absolute;left:20px;top:585px;width:350px;display:flex;justify-content:center;gap:24px}
.art-button{width:150px;height:57px;padding:0;background:transparent url('assets/ui/room/button-yellow.png') center/100% 100% no-repeat;color:#260d66;font-size:19px;font-weight:900;letter-spacing:2px}
.art-button.teal{background-image:url('assets/ui/room/button-teal.png')}.art-button:disabled{opacity:.6}
#room-play{position:absolute;left:138px;top:657px;width:114px;height:29px;background:#ffffff19;color:#fff;border-radius:15px;font-size:12px}
#room-sync-status{position:absolute;left:15px;top:697px;width:360px;font-size:11px;text-align:center;color:#ecdfff}
#room-retry{position:absolute;left:145px;top:573px;width:100px;padding:10px;color:#fff;background:#52269b;border-radius:20px}


/* Align score ribbons and second-row baselines with the reference. */
.design-stage #ranking{row-gap:18px}.design-stage .rank{height:63px;min-height:63px}
.design-stage .points{position:absolute;left:-3px;top:37px;margin:0}
.design-stage .rank small{position:absolute;left:50%;transform:translateX(-50%);top:54px;width:74px;margin:0;text-align:center}
.design-stage #countdown-mask{background-image:url('assets/ui/room/countdown-texture.png');background-size:72.22px 72.22px}

/* Latest confirmed artwork; dynamic labels remain independent layers. */
#game{background-image:url('assets/ui/final/background.png')}
.design-stage .room{width:max-content;max-width:244px;gap:5px;padding:4px 7px}
.design-stage .room>div{white-space:nowrap}.design-stage .room .tag{margin-left:3px;font-size:9px}
.design-stage .connection,.design-stage #round,#under-mic-count{display:none!important}
.design-stage .seat .seat-name{display:none!important}
.design-stage .room-tools{position:absolute;right:0;top:3px;display:flex;gap:11px;align-items:center}
.design-stage .room-tools button{width:22px;height:30px;padding:0;background:none;display:grid;place-items:center}
.design-stage .room-tools button img{width:24px;height:24px}.design-stage .room-tools #room-menu{width:12px}.design-stage .room-tools #room-menu img{width:20px}
.design-stage header #sound{border:0;background:none;width:26px;height:26px;top:164px;left:0}
.design-stage header #sound img{display:block;width:100%;height:100%;object-fit:contain}.design-stage header #sound.muted{opacity:.45}
.room-logo{left:71px;top:292px;width:248px}
.art-button{background-image:url('assets/ui/final/button-yellow.png')}.art-button.teal{background-image:url('assets/ui/final/button-teal.png')}
.design-stage .points{width:34px;height:16px;padding:0 4px 0 0;border:0;border-radius:0;line-height:16px;background:transparent var(--result-score-blue,url('assets/ui/final/score-blue.png')) center/100% 100% no-repeat;color:#1f0955;font-size:11px}
.design-stage .points[data-color="gold"]{background-image:var(--result-score-gold,url('assets/ui/final/score-gold.png'))}.design-stage .points[data-color="green"]{background-image:var(--result-score-green,url('assets/ui/final/score-green.png'))}
.design-stage .rank-number{position:absolute;left:-5px;top:-3px;width:16px;height:16px;border-radius:50%;border:1.5px solid #2a125d;background:linear-gradient(#fff,#e6dcff);color:#25104d;font-size:12px;font-weight:900;line-height:13px;text-align:center}
.design-stage .crown{width:34px;height:26px;top:-13px;left:-9px;object-fit:contain;transform:rotate(-14deg)}
.design-stage .rank-face{box-shadow:none}
.design-stage #question .question-image{object-fit:cover}
.design-stage .timer{height:39px}.design-stage .timer-art{object-fit:contain}.design-stage .timer b{left:37%;width:53%;top:55%;font-size:21px}
.design-stage #round-cue .digit{height:39%;max-width:36%;animation:digit-dissolve 1000ms linear both;transform:none}
.design-stage #round-cue .start-sticker{animation:start-dissolve 1500ms linear both}
@keyframes digit-dissolve{0%{opacity:0}18%,76%{opacity:1}100%{opacity:0}}
@keyframes start-dissolve{0%{opacity:0}10%,85%{opacity:1}100%{opacity:0}}
.design-stage #answer-slot #hint{width:100%;background:linear-gradient(90deg,transparent,#ffffff22 22%,#ffffff22 78%,transparent);line-height:30px;font-size:11px;color:#fff;font-weight:900}
.design-stage #answer-slot #answer{width:184px;height:35px}
#result.illustrated #result-title{display:flex;position:absolute;left:22%;top:30.4%;width:56%;height:13.4%;margin:0;padding:0;align-items:center;justify-content:center;border:0;border-radius:0;background:#fa443f;color:#fff;font-size:27px;font-weight:900;line-height:1;transform:none;text-shadow:0 1px #ce3530;z-index:3;animation:success-content-in var(--success-unfold-duration) linear var(--success-dim-duration) both}
#result.illustrated #streak-slot{bottom:40%;width:34%;right:4%}
#result.illustrated #streak-slot[data-level="2"]{width:38%}#result.illustrated #streak-slot[data-level="3"]{width:42%}#result.illustrated #streak-slot[data-level="4"]{width:46%}#result.illustrated #streak-slot[data-level="5"]{width:50%}
#overlay.closing{animation:success-scene-undim 350ms linear both}
#overlay.closing #result.illustrated{animation:success-fold 350ms ease-in both}
#overlay.closing #result.illustrated>*{animation:success-content-out 350ms linear both}
#overlay.closing .streak-badge{animation:none;opacity:1;transform:none}
@keyframes success-fold{from{transform:scaleY(1);opacity:1}to{transform:scaleY(.22);opacity:0}}
@keyframes success-scene-undim{from{background-color:rgba(18,18,25,.6)}to{background-color:rgba(18,18,25,0)}}
@keyframes success-content-out{from{opacity:1}to{opacity:0}}
.design-stage .room{background:none;padding:0}
.design-stage .room>div{background:#ffffff16;padding:4px 7px;border-radius:18px}
.design-stage #ranking .rank .points{background:transparent var(--result-score-blue,url('assets/ui/final/score-blue.png')) center/100% 100% no-repeat}
.design-stage #ranking .rank .points[data-color="gold"]{background-image:var(--result-score-gold,url('assets/ui/final/score-gold.png'))}
.design-stage #ranking .rank .points[data-color="green"]{background-image:var(--result-score-green,url('assets/ui/final/score-green.png'))}

/* Previous pure-purple SVG digits, with the current opacity-only dissolve. */
.design-stage #round-cue .digit{height:42%;max-width:36%}
/* Larger original badge artwork makes the consecutive-answer text legible. */
#result.illustrated #streak-slot{bottom:42%;width:40%}
#result.illustrated #streak-slot[data-level="2"]{width:48%}
#result.illustrated #streak-slot[data-level="3"]{width:52%}
#result.illustrated #streak-slot[data-level="4"]{width:56%}
#result.illustrated #streak-slot[data-level="5"]{width:60%}

:root{--success-dim-duration:120ms;--success-streak-delay:350ms}
#result.illustrated{animation-delay:0ms}
#result.illustrated .success-base,#result.illustrated .success-frame,#result.illustrated .winner,#result.illustrated #result-answer,#result.illustrated #answer-elapsed,#result.illustrated #result-title{animation-delay:0ms}
.design-stage .play{top:196px}
.design-stage #ranking{top:560px}
.design-stage header #sound{top:156px}
#composer #form{gap:14px}
#composer #submit-answer{min-width:96px}
.design-stage #round-cue .digit,.design-stage #round-cue .start-sticker{will-change:opacity}
#countdown-mask.revealing{will-change:opacity}
#result.illustrated{will-change:transform,opacity;z-index:1}
#overlay.success-overlay,#overlay.success-overlay.closing{background:transparent;animation:none}
#overlay.success-overlay::before{content:'';position:absolute;inset:0;background:rgba(18,18,25,.6);z-index:0;pointer-events:none;will-change:opacity;animation:success-dim-opacity 120ms linear both}
#overlay.success-overlay.closing::before{animation:success-undim-opacity 350ms linear both}
@keyframes success-dim-opacity{from{opacity:0}to{opacity:1}}
@keyframes success-undim-opacity{from{opacity:1}to{opacity:0}}

/* Enlarge extracted original letter layers inside the original badge proportions. */
#result.illustrated #streak-slot{top:31%;bottom:auto;right:5%;width:26%}
#result.illustrated #streak-slot[data-level="2"]{width:28%}
#result.illustrated #streak-slot[data-level="3"]{width:30%}
#result.illustrated #streak-slot[data-level="4"]{width:32%}
#result.illustrated #streak-slot[data-level="5"]{width:34%}
.room-player.is-empty::before{content:'';position:absolute;left:4px;top:4px;width:32px;height:32px;border-radius:50%;z-index:1;background:#802260}
.room-player.is-empty[data-color="blue"]::before{background:#164c7e}
.room-player.is-empty[data-color="green"]::before{background:#08706b}
.room-player.is-empty[data-color="orange"]::before{background:#9b5c0c}
.room-player.is-empty>span{position:absolute;left:0;top:0;width:40px;height:40px;display:grid;place-items:center;line-height:1}
#overlay.success-overlay:not(.closing)::before,
#overlay.success-overlay:not(.closing) #result.illustrated,
#overlay.success-overlay:not(.closing) #result.illustrated .success-base,
#overlay.success-overlay:not(.closing) #result.illustrated .success-frame,
#overlay.success-overlay:not(.closing) #result.illustrated .winner,
#overlay.success-overlay:not(.closing) #result.illustrated #result-title,
#overlay.success-overlay:not(.closing) #result.illustrated #result-answer,
#overlay.success-overlay:not(.closing) #result.illustrated #answer-elapsed{animation-delay:var(--success-feedback-delay,0ms)}
#overlay.success-overlay:not(.closing) #result.illustrated .streak-badge{animation-delay:calc(var(--success-feedback-delay,0ms) + var(--success-streak-delay))}
#composer{padding-top:6px;padding-bottom:calc(6px + env(safe-area-inset-bottom))}
#composer.above-keyboard{padding-bottom:6px}
#composer #input{height:38px;padding:6px 10px;line-height:24px}
#composer #submit-answer{height:38px;font-size:17px}
#overlay.success-overlay:not(.closing){animation:feedback-after-keyboard 0s linear var(--success-feedback-delay,0ms) both}
@keyframes feedback-after-keyboard{from{visibility:hidden}to{visibility:visible}}

/* Continuous answers: complete decoded images, separate unscored transition. */
.panel.chain-correct:after{animation:chain-correct-border 500ms linear both}
@keyframes chain-correct-border{0%,95%{border-color:#25d674}100%{border-color:#30115f}}
.panel.chain-fading .question-effect{animation:chain-image-in 500ms linear both}
@keyframes chain-image-in{from{opacity:0}to{opacity:1}}

.question-previous{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none;opacity:1}

#answer-receipt{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#218d58;font-weight:bold;background:#fff;border:2px solid #3a2060;border-radius:20px;font-size:17px}.answered-hidden{visibility:hidden}.rank-face{position:relative}.answered-correct .rank-face img{filter:brightness(.45)}.answer-check{position:absolute;inset:0;display:grid;place-items:center;color:#55f599;font-size:32px;font-weight:900}.answer-gain{position:absolute;left:8px;top:-20px;color:#40ef9c;font-weight:bold;animation:answer-gain 700ms ease-out forwards}@keyframes answer-gain{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-25px)}}

.receipt-streak{position:absolute;right:3px;height:34px;width:48px;object-fit:contain}

#audio-settings{position:fixed;z-index:45;width:240px;padding:14px;background:#ede5ff;color:#3b1d65;border:2px solid #7950b8;border-radius:14px;box-shadow:0 4px 16px #25114933}#audio-settings label{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:7px 0;font-size:14px}#audio-settings input[type=checkbox]{flex:0 0 auto;min-width:20px;width:20px;height:20px}#audio-settings label:last-child{display:block}#audio-settings input[type=range]{width:100%;padding:0;height:22px}

#answer-receipt.revealed{color:#6d5b8a}

/* One artwork layer and one uninterrupted result timeline. */
#result.illustrated .success-base,#result.illustrated #result-title{display:none}

:root{--success-unfold-duration:300ms;--success-streak-delay:300ms;--streak-duration:200ms}
#overlay.success-overlay:not(.closing){animation:none}
#overlay.success-overlay::before{background:rgba(12,10,22,.76);animation-duration:120ms}
#overlay.success-overlay.closing::before{animation-duration:300ms}
#overlay.closing #result.illustrated,#overlay.closing #result.illustrated>*{animation-duration:300ms}
#composer #input,#composer #input:focus,#composer #input:focus-visible{border:0;outline:none;box-shadow:none;background:#f7f8fa;color:#303238}
#composer #submit-answer{width:58px;min-width:58px;max-width:58px;padding:0;flex:0 0 58px}

.seat-nickname{display:block;position:absolute;top:calc(100% + 12px);left:50%;transform:translateX(-50%);width:120%;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff;font-size:9px;line-height:14px}
.peer-art{display:none}
#result.peer-result>:not(.peer-art){display:none!important}
#result.peer-result .peer-art{display:block;position:absolute;inset:0 12.3%;height:100%;color:#111}
.peer-frame{position:absolute;inset:0;width:100%;height:100%;z-index:1}
.peer-avatar{position:absolute;left:29%;top:4.3%;width:39.6%;aspect-ratio:1;border-radius:50%;object-fit:cover;z-index:0}
.peer-art h2{position:absolute;left:16%;top:33%;width:68%;height:10%;margin:0;display:flex;align-items:center;justify-content:center;color:white;z-index:2;white-space:nowrap;font-weight:900;text-shadow:0 1px 2px #351778}
.peer-answer{position:absolute;left:12%;top:63%;width:76%;height:15%;display:flex;align-items:center;justify-content:center;text-align:center;font-size:24px;overflow-wrap:anywhere;background:white;z-index:2}
.peer-art button{position:absolute;top:81%;height:12%;width:15%;background:transparent;z-index:3;border-radius:10px}
.peer-like{left:46%}.peer-dislike{left:66%}.peer-art button[aria-pressed="true"]{box-shadow:0 0 0 2px #6d40db;background:#8d63e92a}
@keyframes success-unfold-visible{from{transform:scaleY(.22);opacity:0}to{transform:scaleY(1);opacity:1}}
@keyframes peer-panel-in{from{transform:scale(.94);opacity:0}to{transform:scale(1);opacity:1}}
@keyframes peer-panel-out{from{transform:scale(1);opacity:1}to{transform:scale(.97);opacity:0}}
#result.illustrated{animation-name:success-unfold-visible}
#result.illustrated.peer-result{animation-name:peer-panel-in}
#overlay.closing #result.illustrated.peer-result{animation-name:peer-panel-out}
@keyframes success-dim-opacity{from{opacity:.15}to{opacity:1}}
.peer-art h2{white-space:normal;line-height:1.05;overflow-wrap:anywhere;text-align:center}
#result.illustrated.peer-result::before{display:none}
.design-stage .seat{position:relative}
.design-stage .seat-nickname{top:50px}
#result.peer-result .peer-art{inset:0;width:100%;height:100%}.peer-avatar{left:30%;top:4%;width:39%;height:29%;aspect-ratio:auto}.peer-answer{font-size:22px}
.peer-avatar{height:auto;aspect-ratio:1}
@keyframes success-dim-opacity{from{opacity:0}to{opacity:1}}
#result.illustrated.peer-result{width:min(79vw,338px)}
#overlay.peer-overlay{padding-top:16.5svh}
#result.illustrated.peer-result{aspect-ratio:840/820}
.peer-art,.peer-art h2,.peer-art strong,.peer-art span{font-family:"Microsoft YaHei","PingFang SC","Noto Sans CJK SC",sans-serif}
.peer-avatar{left:49%;transform:translateX(-50%);top:4.4%;width:40%;height:auto;aspect-ratio:1}
.peer-answer{background:transparent;font-weight:400;color:#444;font-size:22px;height:11%;top:64%;box-shadow:none}
.peer-correct-label{position:absolute;z-index:2;left:24%;top:50.5%;width:52%;height:9%;display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:400;color:white}
.peer-feedback-label{position:absolute;z-index:2;left:17%;top:83%;font-size:10px;color:#555;font-weight:400}
.peer-time{position:absolute;z-index:2;left:20%;top:76%;width:60%;text-align:center;font-size:10px;color:#777}
.peer-art h2{font-weight:600;text-shadow:none}
.rank small{display:block;width:100%;text-align:center}
/* Optical text alignment inside the fixed peer-result artwork. */
.peer-art h2{top:31.7%}
.peer-correct-label{top:48.7%;height:10%;line-height:1}
.peer-answer{top:61.5%;height:10.5%;line-height:1.15}
.peer-time{top:72%;height:5%;display:flex;align-items:center;justify-content:center;line-height:1}
.peer-feedback-label{top:82%}


.panel.has-question #question:has(.custom-question-image){padding:0;display:block}.custom-question-image{position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none}

#question{background:#fff}
