/* Flow panels share the existing scene and never introduce a two-column page. */
#actions{flex-wrap:wrap;gap:8px;max-height:31dvh;overflow:auto;padding:2px}
#actions button{font-size:14px;padding:10px 16px;min-height:42px}
#other-label{display:flex;align-items:center;gap:10px;padding:10px}#other-label[hidden]{display:none}
#other-input,select{border:1px solid #c9ad8b;border-radius:10px;padding:9px;background:#fffaf0;color:#604733;font:inherit;max-width:100%}
.preferences{display:flex;gap:16px;flex-wrap:wrap}.preferences label{display:flex;gap:8px;align-items:center}
.result-sheet{position:absolute;z-index:9;left:50%;transform:translateX(-50%);bottom:max(20px,env(safe-area-inset-bottom));width:min(1120px,94vw);max-height:67dvh;display:flex;flex-direction:column;gap:8px;padding:20px;border:1px solid #fff5dc;border-radius:25px;background:rgba(255,249,236,.97);box-shadow:0 16px 60px #402d3640;color:#654a35;overflow:auto}
.result-sheet[hidden]{display:none}.result-sheet h2{margin:0;font-size:22px}.result-sheet .book-heading{padding:0;gap:8px}.result-sheet p{margin:0}.result-sheet small,#pet-progress,#result-note{font-size:12px;color:#80694f}
.name-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.name-card{border:1px solid #dec9a8;background:#fffdf7;border-radius:14px;padding:12px;display:flex;flex-direction:column;gap:6px;min-width:0}.name-card h3{font-size:23px;color:#56715b;margin:0;overflow-wrap:anywhere}.name-card p{font-size:12px;line-height:1.5;flex:1}.name-card button{font-size:12px;padding:7px;min-height:34px}.name-card button[aria-pressed=true]{color:#a64e43;background:#ffe5dc}.result-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.result-actions button,.upload-label{font-size:13px;padding:10px 15px}
.results-open .dialogue-dock{bottom:auto;top:90px;width:min(900px,90vw)}.results-open .dialogue-footnote,.results-open #actions,.results-open .speaker-line,.results-open .continue-cue{display:none}.results-open .speech-panel{padding:13px 20px}.results-open .speech-text{min-height:0;margin:0;font-size:15px;line-height:1.55}.results-open .room-tag{display:none}
.certificate{display:flex;justify-content:center;min-height:0}.certificate canvas{width:min(100%,660px);height:auto;max-height:40dvh;object-fit:contain}.upload-label{position:relative;cursor:pointer}.upload-label input{position:absolute;width:1px;height:1px;opacity:0}
.flow-status{position:absolute;z-index:40;bottom:max(2px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);font-size:12px;color:#fff;background:#513f2ce0;border-radius:9px;max-width:90vw;margin:0;padding:4px 10px;pointer-events:none}.flow-status:empty{display:none}
dialog{border:1px solid #d0b895;border-radius:20px;background:#fff9ec;color:#654a35;max-width:min(700px,90vw);max-height:90dvh;padding:22px}dialog::backdrop{background:#342519a8}#download-image{display:block;max-width:100%;max-height:65dvh;object-fit:contain}
.stamping .speech-panel:after{content:'姓名登記';display:block;position:absolute;right:22px;top:-80px;border:4px double #aa5948;color:#aa5948;border-radius:50%;padding:16px;background:#fff6df;animation:seal .9s both}@keyframes seal{0%{transform:translateY(-50px) rotate(-15deg);opacity:0}60%{transform:translateY(0) rotate(-15deg);opacity:1}75%{transform:translateY(4px) rotate(-15deg)}100%{transform:translateY(0) rotate(-15deg)}}
@media(max-width:700px){#actions button{font-size:12px;padding:8px 11px;min-height:38px}.result-sheet{padding:14px;max-height:65dvh;bottom:max(12px,env(safe-area-inset-bottom));border-radius:18px}.name-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.name-card{padding:10px}.result-sheet h2{font-size:18px}.results-open .dialogue-dock{top:80px;width:93vw}.results-open .speech-panel{padding:12px}.results-open .speech-text{font-size:13px}.result-actions button,.upload-label{font-size:12px;padding:9px}.certificate canvas{max-height:33dvh}.preferences{gap:8px}.preferences label{font-size:12px}}
@media(max-height:600px){.results-open .dialogue-dock{top:65px}.results-open .speech-text{font-size:12px}.result-sheet{max-height:64dvh;padding:10px}.name-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.name-card{padding:6px}.name-card p{display:none}.name-card h3{font-size:17px}.name-card button{min-height:28px;padding:4px}.result-sheet h2{font-size:16px}}
@media(prefers-reduced-motion:reduce){.stamping .speech-panel:after{animation:none}}

.flow-navigation{display:flex;flex-wrap:nowrap;gap:8px;justify-content:flex-end;margin-left:auto;max-width:100%}.flow-navigation button{white-space:nowrap;flex-shrink:0}
@media(max-width:700px){.flow-navigation{flex-basis:100%}.flow-navigation button{font-size:12px!important;padding:8px 11px!important}}
/* Fit the five-character title inside the painted sign's cream inset. */
.scene-sign{top:8.3%;left:41%;width:20%;height:6%;justify-content:center;overflow:hidden}
.scene-sign h1{font-size:clamp(18px,calc(var(--world-width) * .023),40px);line-height:1.2;letter-spacing:.06em;max-width:100%}
@media(max-width:700px) and (orientation:portrait){.scene-sign{top:13%;left:34%;width:32%;height:5%}.scene-sign h1{font-size:clamp(18px,calc(var(--world-width) * .045),30px);letter-spacing:.04em}}
/* Keep the painted sign below the floating header when the animal book opens. */
@media(min-width:701px) and (min-height:501px){.game-viewport.book-open .world{top:0}}
@media(min-width:351px) and (max-width:700px) and (orientation:portrait){.game-viewport.book-open .world{top:0}}
