/* QA10 shell with the independent v5 resource system. */
.chapter-v5 #game .topbar{background:linear-gradient(180deg,#140f1bf2 0%,#140f1bb8 55%,#140f1b00 100%)}
.chapter-v5 #resource-hud{background:transparent}
html[data-contrast=high] .chapter-v5 #game .topbar{background:linear-gradient(180deg,#111018 0%,#111018ed 65%,#11101800 100%)}
.chapter-v5 .landing-cover .menu-version{font-size:12px;color:#dfd5c4;margin-top:20px}
.chapter-v5 .landing-cover .menu-copy{padding:0}
.chapter-v5 .chapters[hidden]{display:none}
.chapter-v5 .chapter-card .menu-actions button{min-height:48px}
.chapter-v5 #game{position:relative}
.chapter-v5 #game #discovery-toast{position:absolute;inset:calc(var(--header-overlay,80px) + 8px) 12px auto auto;max-width:min(420px,calc(100% - 24px));width:auto;margin:0;z-index:8;font-size:12px}
.chapter-v5 .board-wrap{width:min(1180px,calc(100% - 32px));margin:8px auto;flex:none}
.chapter-v5 .board-wrap:has(#production-board[hidden]){display:none}
.chapter-v5 #production-board:not([hidden]){float:none;width:100%;max-height:none;overflow:visible;margin:0}
.chapter-v5 #production-board .board-note p{margin:6px 0 0;color:#2a2131}
.chapter-v5 #production-board .board-head h2{max-width:100%;overflow-wrap:anywhere}
.chapter-v5 .task-columns{grid-template-columns:repeat(2,minmax(0,1fr))}
.chapter-v5 .ending-share-controls{margin:14px 0}.chapter-v5 .collection-progress{font-size:var(--font)}
.chapter-v5 .ending-art-collection{grid-template-columns:repeat(2,minmax(0,1fr))}
.chapter-v5 .speaker-link{font:inherit;text-align:left}
.chapter-v5 .panel-buttons{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}
.chapter-v5 .panel-buttons button,.chapter-v5 .codex-tabs button{min-height:44px}
.chapter-v5 #panel{overflow-x:hidden}.chapter-v5 #panel-content{overflow-wrap:anywhere}
.chapter-v5 .setting-row input[type=checkbox]{width:24px;height:24px;flex:none}
.chapter-v5 .setting-volume input{min-height:44px;width:100%}
.chapter-v5 #cover-cameos{pointer-events:none}
@media(max-width:760px){
 .chapter-v5 .landing-cover h1{font-size:clamp(48px,11vw,76px)}
 .chapter-v5 .landing-cover-copy{padding:30px 24px 40px}
 .chapter-v5 .ending-art-collection,.chapter-v5 .task-columns{grid-template-columns:1fr}
 .chapter-v5 #production-board .board-notes{grid-template-columns:1fr}
 .chapter-v5 #game #discovery-toast{max-width:calc(100% - 24px)}
 .chapter-v5 .board-wrap{width:calc(100% - 16px)}
 .chapter-v5 .codex-tabs{flex-wrap:wrap}
}

/* Portraits identify speech without changing the scene's character framing. */
.reading-speech { display: flex; align-items: flex-start; gap: 12px; }
.reading-avatar { width: 48px; height: 48px; object-fit: contain; flex: 0 0 48px; }
.reading-speech-copy { min-width: 0; }
.reading-speaker { display: block; margin-bottom: 3px; color: #f3d89e; font-size: 15px; line-height: 1.3; }
@media(max-width:760px){
 .reading-speech { gap: 8px; }
 .reading-avatar { width: 40px; height: 40px; flex-basis: 40px; }
 .reading-speaker { font-size: 13px; }
}

#game[data-reading-speech=true] .speaker-row { display: none; }
.reading-role { display: block; margin: 0 0 8px; color: #d3bfdc; font-size: 13px; line-height: 1.35; }
.reading-speaker .speaker-link { min-height: 0; padding: 0; font: inherit; color: inherit; }
.reading-speaker .speaker-link:hover { text-decoration: underline; }
.codex-avatar-figure { align-items: center; }
.codex-avatar { display: block; width: 100%; max-width: 220px; height: auto; object-fit: contain; }
@media(max-width:760px){.reading-role{font-size:12px;margin-bottom:6px}.codex-avatar-figure{min-height:160px}}


.chapter-v5 #content .reading-dialogue{font-size:var(--font);line-height:1.6;margin:0}.chapter-v5 .reading-scene{max-width:70ch}.chapter-v5 .reading-speech-copy{flex:1}.chapter-v5 .reading-speaker .speaker-link{min-height:44px}


/* Discoveries follow complete artwork instead of covering faces. */

/* QA12: mobile portraits belong to the dialogue, leaving the artwork clear. */
.chapter-v5 #game[data-after-visit=true] .hud-clock{display:none}
.chapter-v5 #voice-label[hidden]{display:none}
@media(max-width:760px){
 .chapter-v5 .dialogue>.hud-team{position:relative;display:flex;justify-content:flex-end;gap:4px;margin:0 0 12px;height:44px}
 .chapter-v5 .dialogue>.hud-team[hidden]{display:none}
}
