:root{--paper:#fff9ec;--ink:#263e4f;--teal:#247f7c;--orange:#e87e61;--muted:#75817f;--line:#e4dece;--app-w:100vw;--app-h:100dvh;font-family:system-ui,-apple-system,'PingFang TC','Noto Sans TC',sans-serif;color:var(--ink);background:var(--paper)}
*{box-sizing:border-box}[hidden]{display:none!important}html{width:100%;height:100%;overflow:hidden;overscroll-behavior:none;touch-action:none}body{margin:0;position:fixed;left:50%;top:50%;width:var(--app-w);height:var(--app-h);transform:translate(-50%,-50%);overflow:hidden;overscroll-behavior:none;touch-action:none;background:var(--paper);background-image:radial-gradient(#c7bda524 .8px,transparent .8px);background-size:8px 8px}body.rotated{transform:translate(-50%,-50%) rotate(90deg)}button,a,input{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;border:0;color:inherit;touch-action:manipulation}button:disabled{opacity:.45;cursor:default}button:focus-visible,a:focus-visible{outline:3px solid #e9ad39;outline-offset:3px}button:active:not(:disabled){filter:brightness(.9)}header{height:40px;padding:5px max(14px,env(safe-area-inset-right));display:flex;align-items:center;gap:15px}.brand{text-decoration:none;font-size:20px;font-weight:900;color:var(--ink);letter-spacing:1px}.brand span{color:var(--teal)}.brand i{color:var(--orange);font-style:normal;margin-left:8px}.edition{font-size:10px;color:var(--muted);margin-left:auto}header .quiet{font-size:12px}main{height:calc(100% - 40px);padding:4px max(14px,env(safe-area-inset-right)) 10px}#game{position:relative;height:100%;display:grid;grid-template-columns:minmax(0,1fr) 202px;grid-template-rows:60px 1fr;column-gap:18px;align-items:start;padding-right:0}.paper{grid-column:1;grid-row:1 / 3;align-self:center;justify-self:center;position:relative;height:min(100%,calc((var(--app-w) - 248px) * 2 / 3));aspect-ratio:3 / 2;max-width:100%;background:#fffdf6;border:1.5px solid #ddd6c5;border-radius:18px;overflow:hidden;box-shadow:0 5px 0 #eae2d2}.paper canvas{width:100%;height:100%;display:block;touch-action:none}.scene-badge{position:absolute;top:10px;left:12px;background:#fff9ecde;padding:5px 10px;border:1px solid var(--line);border-radius:20px;font-size:11px;pointer-events:none}.scene-status{position:absolute;bottom:10px;left:0;right:0;text-align:center;pointer-events:none;font-size:13px;color:var(--teal);font-weight:700;text-shadow:0 1px 0 white}.game-heading{grid-column:2;grid-row:1;display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:8px}.eyebrow{font-size:10px;font-weight:700;color:var(--teal)}h2{margin:6px 0;font-size:20px}h3{font-size:14px;margin:0}.game-heading h2{font-size:18px}.counter{font-size:16px;white-space:nowrap;font-weight:900;color:var(--teal);font-variant-numeric:tabular-nums}#instruction{grid-column:2;grid-row:2;font-size:12px;line-height:1.6;margin:7px 0;color:var(--muted)}.drawing-panel,.waiting{grid-column:2;grid-row:2;margin-top:48px;background:#f7f1e2;border:1px solid var(--line);border-radius:16px;padding:13px}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:15px}.panel-head h3{font-size:12px}.tools{display:flex;gap:6px}.tool{width:32px;height:32px;border:1px solid #d8d7cb;background:#fffdf7;border-radius:9px;font-size:23px;line-height:1}.draw-bottom{display:flex;flex-direction:column;gap:16px}.colors{display:flex;gap:15px;padding:3px}.color{width:24px;height:24px;border-radius:50%;background:var(--ink);outline:2px solid transparent;outline-offset:3px}.color.selected{outline-color:var(--ink)}.primary,.secondary{padding:12px 14px;border-radius:12px;font-weight:800;min-height:42px;display:inline-flex;justify-content:center;align-items:center;gap:10px;font-size:13px}.primary{background:var(--teal);color:white;box-shadow:0 3px 0 #165c5a}.secondary{background:#fffdf5;border:1.5px solid #d4d5c9}.quiet{padding:8px;background:transparent;color:var(--teal);font-size:12px;font-weight:700}.compact{width:100%;font-size:12px}.small{font-size:10px;line-height:1.6;color:var(--muted);text-align:center;margin:12px 0 0}.waiting{text-align:center;font-size:12px;padding:14px}.waiting p{font-size:11px;color:var(--muted);line-height:1.6}.waiting-icon{font-size:24px;color:var(--orange)}#room-code{font-size:22px;font-weight:900;letter-spacing:3px;color:var(--teal)}#meter{grid-column:2;grid-row:2;display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:11px;margin:50px 0 0}.track{height:8px;background:#e7e5da;border-radius:10px;flex:1;overflow:hidden}#wet-bar{height:100%;width:0%;background:#63aaa9}#time-left{font-size:11px}.result{position:absolute;right:0;top:72px;width:202px;background:#eef3e6;border:1px solid #d7e1cb;border-radius:16px;padding:14px;text-align:center;z-index:2}.result h2{font-size:22px;line-height:1.35;margin:10px 0}.result p{font-size:12px;line-height:1.5;margin:8px 0}.row{display:flex;gap:8px;justify-content:center;margin:12px 0 0}.result .row{flex-direction:column}.result .primary,.result .secondary{font-size:12px;min-height:36px;padding:8px}.result .quiet{margin-top:6px}.gallery{position:absolute;right:0;bottom:4px;width:202px;display:flex;gap:5px;overflow:hidden}.mini{display:flex;align-items:center;gap:4px;flex:1;min-width:0;font-size:9px}.mini canvas{width:32px;height:24px}.mini strong{font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.start-options{display:flex;flex-wrap:wrap;gap:12px;margin-top:18px}.start-options .quiet{width:100%}dialog{position:fixed;border:1.5px solid var(--line);border-radius:20px;background:var(--paper);color:var(--ink);width:min(480px,90vw);max-height:90dvh;overflow:auto;padding:22px;box-shadow:0 20px 80px #19393026;touch-action:pan-y}dialog::backdrop{background:#233d4b55;backdrop-filter:blur(3px)}body.rotated dialog{width:min(480px,85dvh);max-width:85dvh;max-height:90vw;transform:rotate(90deg)}.dialog-head{display:flex;justify-content:space-between;align-items:center}.dialog-head h2{margin:0;font-size:22px}dialog p{font-size:13px;color:var(--muted);line-height:1.7}.effect-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.effect-choice{background:#fffefa;border:1px solid #dcd7c7;padding:10px 6px;border-radius:12px;font-size:12px;font-weight:700}.effect-choice span{display:block;font-size:25px;margin-bottom:4px}#join-dialog label{font-size:13px}#join-code{display:block;width:100%;font:inherit;font-size:24px;letter-spacing:5px;text-transform:uppercase;padding:12px;margin:12px 0;border:1px solid #c9cfbf;border-radius:12px;background:#fffefa;color:var(--teal);touch-action:manipulation}#toast{position:absolute;bottom:15px;left:50%;transform:translateX(-50%);background:#263e4f;color:white;padding:12px 18px;border-radius:14px;font-size:12px;max-width:75%;z-index:20}#theme-intro{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;background:#fff9ecb8;pointer-events:none;z-index:4;animation:theme-reveal 3s both}#theme-intro small{font-size:14px;letter-spacing:5px;color:var(--teal);margin-bottom:16px}#theme-title{font-size:clamp(40px,7vw,65px);font-weight:900;line-height:1.25;letter-spacing:3px;text-align:center;color:var(--teal);text-shadow:3px 4px 0 #eadcb7;animation:theme-letter 3s both}@keyframes theme-reveal{0%{opacity:0}12%,78%{opacity:1}100%{opacity:0}}@keyframes theme-letter{0%{transform:scale(.55) rotate(-8deg);opacity:0}16%{transform:scale(1.08) rotate(2deg);opacity:1}28%,78%{transform:scale(1) rotate(-2deg);opacity:1}100%{transform:scale(1.15);opacity:0}}@media(prefers-reduced-motion:reduce){#theme-intro,#theme-title{animation:none}}

/* 0.8: a host welcomes the pair; the story takes the stage at reveal. */
.mascot{width:64px;height:64px;object-fit:contain;image-rendering:auto;flex-shrink:0}
#pair-intro{position:absolute;inset:0;z-index:5;background:#fff9ecf5;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;pointer-events:none}
#pair-intro .mascot{width:105px;height:105px;animation:host-hop 1s ease-in-out infinite}#pair-intro small{font-size:15px;color:var(--teal)}#pair-name{font-size:32px;color:var(--teal)}#pair-note{font-size:13px;color:var(--muted)}
@keyframes host-hop{50%{transform:translateY(-7px) rotate(4deg)}}
.waiting{margin-top:14px;padding:10px}.waiting .mascot{width:42px;height:42px}.waiting h3{font-size:13px}.waiting p{margin:5px 0}#partner-canvas{width:100%;aspect-ratio:3/2;display:block;background:#fffdf6;border:1px solid var(--line);border-radius:10px;margin:8px 0}
#game.revealing{grid-template-columns:1fr;grid-template-rows:1fr 62px;gap:4px}
#game.revealing .paper{grid-column:1;grid-row:1;height:min(100%,calc((var(--app-w) - 32px)*2/3));border-radius:14px;transition:height .35s ease}
#game.revealing .game-heading{position:absolute;left:12px;top:7px;z-index:3;padding:0;background:#fff9eceb;border-radius:10px;padding:4px 9px;gap:16px}
#game.revealing .game-heading h2{font-size:14px;margin:2px 0}#game.revealing .counter{font-size:12px}#game.revealing .scene-badge{display:none}
#game.revealing .gallery{left:235px;right:10px;bottom:15px;width:auto;max-width:350px}#game.revealing .mini{font-size:11px}#game.revealing .mini strong{font-size:11px}
#mascot-footer{position:absolute;bottom:1px;left:4px;display:flex;align-items:center;gap:3px;width:230px;font-size:11px;font-weight:700;color:var(--teal)}#mascot-footer .mascot{width:54px;height:54px}
#game.revealing .result{top:auto;bottom:69px;left:50%;right:auto;transform:translateX(-50%);width:min(490px,90%);background:#fff9ecf2;padding:10px 16px;box-shadow:0 5px 24px #263e4f20}
#game.revealing .result h2{font-size:20px;margin:3px 0}#game.revealing .result p{font-size:11px;margin:3px 0}#game.revealing .result .row{flex-direction:row;margin-top:7px}#game.revealing .result .quiet{margin-top:2px;padding:5px}
@media(prefers-reduced-motion:reduce){#pair-intro .mascot{animation:none}#game.revealing .paper{transition:none}}

body.revealing header{display:none}body.revealing main{height:100%;padding:6px 12px}#game.revealing{grid-template-rows:1fr}#game.revealing .paper{height:100%}#game.revealing .result{bottom:10px}#game.revealing .gallery{bottom:auto;top:12px;left:auto;right:14px;width:210px}#game.revealing #mascot-footer{bottom:5px;left:0;width:160px}#game.revealing #mascot-footer span{max-width:100px}#game.revealing #mascot-footer .mascot{width:48px;height:48px}

/* 0.9: one welcome per session; full-stage artwork reveal. */
#welcome{height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px}#welcome .mascot{width:90px;height:90px}#welcome h1{font-size:42px;margin:0;color:var(--teal)}#welcome p{font-size:16px;margin:4px 0 15px}#welcome .primary{min-width:220px;font-size:20px}
#art-showcase{position:absolute;inset:0;z-index:12;background:#fff9ec;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;opacity:1;transition:opacity .4s ease}#art-showcase.leaving{opacity:0;pointer-events:none}#art-showcase>small{font-size:20px;color:var(--teal);font-weight:800}#showcase-cards{display:flex;width:90%;height:65%;gap:24px}#showcase-cards article{flex:1;min-width:0;border:2px solid var(--line);border-radius:24px;background:#fffefa;display:flex;align-items:center;justify-content:center;flex-direction:column;animation:art-enter .35s both}#showcase-cards article:nth-child(2){animation-delay:.2s}#showcase-cards canvas{width:100%;height:calc(100% - 60px);object-fit:contain}#showcase-cards h2{font-size:24px;text-align:center;margin:8px}#game.revealing .gallery{display:none}@keyframes art-enter{from{opacity:0;transform:translateY(20px) scale(.93)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){#showcase-cards article{animation:none}#art-showcase{transition:none}}
