/* All House Quest surfaces stay inside the game's route. */
body[data-game="house-quest"] {
  --hq-ink: #0b1020;
  --hq-panel: #141b2f;
  --hq-panel-soft: #1b233b;
  --hq-gold: #e9c887;
  --hq-text: #f7f0e4;
  --hq-muted: #bcc0d2;
  --hq-line: #343a51;
  --hq-violet: #ba96fb;
  background: radial-gradient(ellipse at 25% 5%, #1d2945 0, transparent 65%), #0b1020;
  color: var(--hq-text);
}
body[data-game="house-quest"] #app-shell { margin: 0; padding: 0; background: transparent; }
body[data-game="house-quest"] #app-shell > .page { width: 100%; max-width: none; margin: 0; padding: 0; }
.hq-shell { width: min(1480px, 100%); margin: auto; padding: 0 clamp(16px, 3vw, 48px) 40px; color: var(--hq-text); }
.hq-shell *, .hq-shell *::before, .hq-shell *::after { box-sizing: border-box; }
.hq-shell :is(h1,h2,h3,p) { margin: 0; }
.hq-shell :is(h1,h2,h3) { color: var(--hq-text); }
.hq-shell :is(h1,h2) { font-family: inherit; font-weight: 650; }
.hq-shell h2 { font-size: 1.65rem; line-height: 1.15; }
.hq-shell button { font: inherit; cursor: pointer; text-transform: none; letter-spacing: normal; }
.hq-shell button:disabled { cursor: default; opacity: .45; }
.hq-shell :is(button,select,textarea):focus-visible { outline: 3px solid #f7db9d; outline-offset: 4px; }
.hq-shell svg { width: 20px; height: 20px; flex: 0 0 auto; }
.hq-kicker { color: var(--hq-gold); font-size: .64rem; font-weight: 800; letter-spacing: .16em; line-height: 1.5; }
.hq-subtle { color: var(--hq-muted); font-size: .82rem; line-height: 1.65; }
.hq-topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; min-height: 96px; border-bottom: 1px solid var(--hq-line); }
.hq-back { display: inline-flex; align-items: center; justify-content: center; justify-self: start; gap: 9px; min-height: 44px; padding: 9px 13px; border: 1px solid var(--hq-line); border-radius: 8px; color: var(--hq-text); background: transparent; font-size: .8rem; }
.hq-back:hover { background: var(--hq-panel-soft); border-color: var(--hq-gold); }
.hq-brand { display: flex; gap: 12px; align-items: center; }
.hq-brand-seal { display: grid; place-items: center; width: 45px; height: 45px; border: 1px solid #8a7854; border-radius: 50%; color: var(--hq-gold); }
.hq-brand-seal svg { width: 24px; height: 24px; }
.hq-brand > span:last-child { display: grid; gap: 3px; }
.hq-brand small { color: var(--hq-gold); letter-spacing: .18em; font-size: .5rem; font-weight: 800; }
.hq-brand b { color: var(--hq-text); font-family: Georgia, serif; font-size: 1.7rem; font-weight: 400; }
.hq-brand em { color: var(--hq-gold); font-style: normal; }
.hq-top-note { justify-self: end; color: var(--hq-muted); font-size: .73rem; }
.hq-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 34px 0 30px; }
.hq-intro h1, .hq-completion h1 { margin: 10px 0 14px; font-size: clamp(2.35rem, 3.6vw, 3.8rem); line-height: 1.08; letter-spacing: -.035em; }
.hq-intro h1 em, .hq-completion h1 em { color: var(--hq-gold); font-style: normal; }
.hq-intro p:last-child { color: var(--hq-muted); max-width: 580px; font-size: .92rem; line-height: 1.7; }
.hq-session-seal { display: grid; place-items: center; gap: 4px; width: 116px; height: 116px; flex: 0 0 auto; border: 1px solid #665d4a; border-radius: 50%; color: var(--hq-gold); background: #151c2e; }
.hq-session-seal strong { font-family: Georgia, serif; font-size: 3.1rem; font-weight: 400; line-height: 1; }
.hq-session-seal small { font-size: .64rem; color: var(--hq-muted); }
.hq-setup-grid { display: grid; grid-template-columns: minmax(0,1.85fr) minmax(320px,1fr); gap: 26px; align-items: start; }
.hq-house-preview { min-width: 0; border: 1px solid var(--hq-line); border-radius: 16px; background: var(--hq-panel); overflow: hidden; }
.hq-scene { position: relative; width: 100%; aspect-ratio: var(--scene-ratio, 1672 / 941); isolation: isolate; background: #181c2a; }
.hq-scene-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.hq-play .hq-house-scene.is-tall { width: min(100%,720px); margin-inline: auto; }
.hq-preview-caption { display: flex; justify-content: space-between; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--hq-line); font-size: .78rem; color: var(--hq-gold); }
.hq-preview-caption span { display: inline-flex; align-items: center; gap: 8px; }
.hq-preview-caption svg { width: 17px; height: 17px; }
.hq-how { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 24px 22px; margin: 0; gap: 20px; list-style: none; }
.hq-how li { display: flex; gap: 10px; }
.hq-how li > b { color: #b99c67; font-family: Georgia,serif; font-size: 1.25rem; font-weight: 400; }
.hq-how strong { display: block; margin-bottom: 6px; font-size: .78rem; font-weight: 700; }
.hq-how span { display: block; color: var(--hq-muted); font-size: .71rem; line-height: 1.6; }
.hq-settings { display: flex; flex-direction: column; gap: 14px; padding: 25px; border: 1px solid var(--hq-line); border-radius: 16px; background: var(--hq-panel); }
.hq-settings h2 { margin-bottom: 5px; font-size: 1.9rem; }
.hq-houses { display: grid; gap: 9px; padding: 0; margin: 0; border: 0; min-width: 0; }
.hq-houses legend { margin-bottom: 10px; }
.hq-house-choice { display: grid; grid-template-columns: 66px 1fr; gap: 12px; align-items: center; width: 100%; min-height: 80px; padding: 8px; border: 1px solid #414a64; border-radius: 9px; text-align: left; background: #11182a; color: var(--hq-text); }
.hq-house-choice img { width: 66px; height: 66px; object-fit: cover; border-radius: 5px; }
.hq-house-choice strong { display: block; font-size: .84rem; margin-bottom: 5px; }
.hq-house-choice small { display: block; font-size: .68rem; line-height: 1.55; color: var(--hq-muted); }
.hq-house-choice.is-selected { border-color: var(--hq-gold); box-shadow: inset 3px 0 var(--hq-gold); background: #272838; }
.hq-floor-vocabulary { display: grid; gap: 8px; padding: 12px; background: #0e1527; border: 1px solid #414a64; border-radius: 8px; }
.hq-floor-vocabulary > p:nth-child(2) { color: var(--hq-text); font-size: .75rem; line-height: 1.8; }
.hq-floor-vocabulary small { color: var(--hq-muted); font-size: .68rem; line-height: 1.6; }
.hq-floor-badge { margin-top: 8px !important; color: var(--hq-gold); font-size: .75rem; }
.hq-floor-nav { padding: 8px 14px; border-top: 1px solid var(--hq-line); }
.hq-floor-row { display: grid; grid-template-columns: minmax(105px, .65fr) minmax(0, 1.35fr); gap: 10px; padding: 9px 0; align-items: center; }
.hq-floor-row + .hq-floor-row { border-top: 1px solid #343a5166; }
.hq-floor-row > div:first-child span { display: block; color: var(--hq-gold); font-size: .74rem; line-height: 1.5; }
.hq-floor-row small { display: block; margin-top: 2px; color: var(--hq-muted); font-size: .63rem; }
.hq-floor-row .hq-room-nav { border: 0; padding: 0; }
.hq-floor-row.is-current > div:first-child span { color: var(--hq-violet); }
.hq-level-reminder { color: var(--hq-gold); font-size: .75rem; line-height: 1.65; }
.hq-shell :is(label,legend) { display: block; color: var(--hq-muted); font-size: .75rem; font-weight: 600; }
.hq-shell :is(select,textarea) { width: 100%; min-height: 46px; padding: 11px 12px; border: 1px solid #51576e; border-radius: 8px; background: #0e1527; color: var(--hq-text); font: inherit; font-size: .9rem; }
.hq-shell option { background: #141b2f; color: #f7f0e4; }
.hq-shell textarea { resize: vertical; line-height: 1.7; }
.hq-levels { display: grid; gap: 9px; padding: 0; border: 0; margin: 4px 0; min-width: 0; }
.hq-levels legend { margin-bottom: 12px; }
.hq-level { display: grid; grid-template-columns: 26px 1fr 15px; align-items: center; gap: 12px; width: 100%; min-height: 78px; padding: 12px; text-align: left; border: 1px solid #3b435b; border-radius: 10px; background: #11182a; color: var(--hq-text); }
.hq-level > b { align-self: start; margin-top: 2px; font-size: .75rem; color: var(--hq-muted); font-weight: 400; }
.hq-level strong { display: block; margin-bottom: 5px; font-size: .87rem; font-weight: 700; }
.hq-level small { display: block; color: var(--hq-muted); font-size: .7rem; line-height: 1.5; }
.hq-level.is-selected { border-color: var(--hq-gold); background: #272838; box-shadow: inset 3px 0 0 var(--hq-gold); }
.hq-level.is-selected > b { color: var(--hq-gold); }
.hq-level-dot { width: 13px; height: 13px; border: 1px solid #697088; border-radius: 50%; }
.hq-level.is-selected .hq-level-dot { border: 3px solid #2a2732; outline: 1px solid var(--hq-gold); background: var(--hq-gold); }
.hq-primary, .hq-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 50px; padding: 12px 18px; border-radius: 8px; font-weight: 750; font-size: .86rem; line-height: 1.4; }
.hq-primary { border: 1px solid #f3d79e; background: linear-gradient(120deg,#f1d59b,#dbb96f); color: #182030; box-shadow: 0 4px 20px #d4ad5b13; }
.hq-primary:hover:not(:disabled) { background: #f7dea8; }
.hq-primary > span { margin-left: auto; font-size: 1.2rem; }
.hq-secondary { background: transparent; border: 1px solid #555e79; color: var(--hq-text); }
.hq-secondary:hover { border-color: var(--hq-gold); background: #222b42; }
.hq-explore-link { display: flex; justify-content: center; align-items: center; gap: 9px; min-height: 44px; border: 0; background: transparent; color: var(--hq-violet); font-size: .8rem; }
.hq-save-note { color: var(--hq-muted); text-align: center; font-size: .68rem; line-height: 1.7; }
.hq-best { display: flex; align-items: center; gap: 8px; color: var(--hq-gold); font-size: .73rem; }
.hq-best svg { width: 16px; height: 16px; }
.hq-setup-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 25px; padding: 20px 0 0; border-top: 1px solid var(--hq-line); color: var(--hq-muted); font-size: .67rem; }
.hq-play-heading { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 22px 0; }
.hq-play-subtitle { margin-top: 6px !important; font-size: .8rem; color: var(--hq-muted); }
.hq-play-subtitle span { margin: 0 8px; }
.hq-run-stats { display: flex; align-items: center; gap: 12px; font-size: .76rem; color: var(--hq-muted); }
.hq-run-stats > span { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border: 1px solid var(--hq-line); border-radius: 8px; }
.hq-run-stats b, .hq-run-stats svg { color: var(--hq-gold); }
.hq-run-stats svg { width: 15px; height: 15px; }
.hq-steps { display: flex; flex-wrap: wrap; padding: 0 0 20px; margin: 0; gap: 14px 22px; list-style: none; font-size: .73rem; color: #939bb5; }
.hq-steps li { display: flex; align-items: center; gap: 8px; }
.hq-steps li > span { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #424b65; border-radius: 50%; font-size: .65rem; }
.hq-steps .is-current { color: var(--hq-text); }
.hq-steps .is-current > span { background: #8d63ce; border-color: #b68de9; color: white; }
.hq-steps .is-done > span { color: var(--hq-gold); border-color: #b2955d; }
.hq-play-grid { display: grid; grid-template-columns: minmax(0,1fr) 350px; gap: 22px; align-items: start; }
.hq-play-grid > div { min-width: 0; }
.hq-scene-card { border: 1px solid #4b4650; border-radius: 14px; overflow: hidden; background: var(--hq-panel); }
.hq-scene-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--hq-line); }
.hq-scene-header h1 { margin-top: 5px; font-size: clamp(1.55rem,2vw,2.1rem); }
.hq-scene-tools { display: flex; gap: 8px; align-items: center; }
.hq-icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; min-width: 44px; padding: 9px; border: 1px solid #565273; border-radius: 50%; background: #292441; color: #dac2ff; }
.hq-icon-button:hover:not(:disabled), .hq-icon-button[aria-pressed="true"] { background: #493367; border-color: var(--hq-violet); }
.hq-room-hit { position: absolute; display: flex; align-items: flex-end; justify-content: center; padding: 5px; border: 2px solid transparent; border-radius: 8px; background: transparent; color: var(--hq-text); transition: border-color 150ms, background 150ms; }
.hq-room-hit > span { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 10px; border: 1px solid #bca67d; border-radius: 6px; background: #10182cef; box-shadow: 0 4px 10px #0005; font-size: clamp(.55rem,1vw,.79rem); line-height: 1.3; }
.hq-room-hit b { color: var(--hq-gold); }
.hq-room-hit:hover, .hq-room-hit:focus-visible { border-color: #c499ff; background: #b68af718; box-shadow: inset 0 0 24px #ad73ff40; }
.hq-scene-caption { display: flex; gap: 8px; padding: 12px 18px; color: var(--hq-muted); font-size: .7rem; line-height: 1.5; background: #101727; }
.hq-scene-caption svg { width: 17px; height: 17px; color: var(--hq-gold); }
.hq-room-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px; border-top: 1px solid var(--hq-line); }
.hq-room-nav button { flex: 1 0 auto; min-height: 44px; padding: 8px 10px; border: 1px solid #404960; border-radius: 7px; background: transparent; color: #d1d2df; font-size: .68rem; }
.hq-room-nav button:hover, .hq-room-nav .is-active { border-color: var(--hq-violet); color: #eedfff; background: #332745; }
.hq-scene-viewport { overflow: auto; overscroll-behavior-x: contain; }
.hq-room-scene { container-type: inline-size; }
.hq-scene-viewport.is-zoomed .hq-scene { width: max(100%,1400px); }
.hq-object, .hq-decor { position: absolute; left: var(--object-x); top: var(--object-y); z-index: var(--object-depth, 2); width: var(--object-width); min-width: 0; aspect-ratio: var(--object-ratio); padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; transform: translate(-50%,-100%); }
/* A small transparent hit allowance never changes the visible sprite's scale. */
.hq-object::before { content: ""; position: absolute; inset: -6px; }
.hq-object-art { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 100%; }
.hq-object-art img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; filter: drop-shadow(0 3px 2px #0006); }
.hq-object .hq-object-art img, .hq-decor img { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: fill; filter: brightness(.85) saturate(.78) sepia(.08) drop-shadow(0 .5px .7px #251b1280); transform: rotate(var(--object-angle)); transform-origin: center bottom; }
.hq-decor { pointer-events: none; user-select: none; }
.hq-object.is-behind .hq-object-art { clip-path: inset(0 0 22% 0); }
.hq-furniture-foreground { position: absolute; inset: 0; z-index: 300; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.hq-room-scene.is-searching, .hq-shell .hq-room-scene.is-searching .hq-object { cursor: crosshair; }
.hq-shell .hq-object:is(:hover,:focus,:focus-visible,:active) { border: 0; outline: 0; background: transparent; box-shadow: none; }
/* A small keyboard focus dot preserves navigation without outlining hidden objects. */
.hq-object:focus-visible::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 5px; height: 5px; border-radius: 50%; background: var(--hq-gold); transform: translateX(-50%); }
.hq-shell .hq-object:disabled { opacity: 1; }
.hq-object-tooltip { display: none; position: absolute; z-index: 3; bottom: calc(100% + 10px); left: 50%; padding: 6px 9px; border: 1px solid var(--hq-gold); border-radius: 5px; background: #11182bf5; color: var(--hq-text); font-size: .68rem; white-space: nowrap; transform: translateX(-50%); }
.hq-object:hover .hq-object-tooltip, .hq-object:focus-visible .hq-object-tooltip { display: block; }
.hq-investigation-panel { display: grid; gap: 16px; min-width: 0; }
.hq-clue-card, .hq-answer-form, .hq-solved-card, .hq-search-note, .hq-explorer-card { display: grid; gap: 14px; padding: 22px; border: 1px solid var(--hq-line); border-radius: 14px; background: var(--hq-panel); }
.hq-clue-card { border-color: #67547d; background: linear-gradient(135deg,#251e3a,#141b2f); }
.hq-card-heading { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.hq-card-heading .hq-kicker { color: #d5b9ff; }
.hq-clue { color: var(--hq-text); font-family: Georgia,serif; font-size: 1.2rem; line-height: 1.7; }
.hq-hint-button { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; border: 1px solid #6d6085; border-radius: 8px; background: #302740; color: #e6d5ff; font-size: .78rem; }
.hq-hint-cost { text-align: center; color: var(--hq-muted); font-size: .65rem; }
.hq-hint-note { display: grid; gap: 9px; padding: 12px; border-left: 2px solid var(--hq-gold); background: #12182a; }
.hq-hint-note small { color: var(--hq-gold); font-size: .64rem; }
.hq-hint-note p { font-size: .75rem; color: var(--hq-muted); line-height: 1.6; }
.hq-hint-note strong { font-size: .85rem; font-weight: 600; }
.hq-search-note { text-align: center; padding: 24px; }
.hq-search-note > span { display: grid; place-items: center; width: 44px; height: 44px; margin: auto; border: 1px solid #655c45; border-radius: 50%; color: var(--hq-gold); }
.hq-search-note p { color: var(--hq-muted); font-size: .8rem; line-height: 1.7; }
.hq-feedback { padding: 10px 12px; font-size: .78rem; line-height: 1.65; border: 1px solid transparent; border-radius: 8px; }
.hq-feedback:empty { display: none; }
.hq-feedback.is-error { background: #442b35; color: #ffd1c2; border-color: #72505a; }
.hq-feedback.is-success { background: #243930; color: #c7edd2; border-color: #4b725b; }
.hq-answer-tiles { display: flex; flex-wrap: wrap; gap: 6px; min-height: 70px; align-content: flex-start; padding: 10px; border: 1px dashed #77718a; border-radius: 8px; background: #0d1426; }
.hq-answer-tiles button, .hq-word-bank button { min-height: 44px; padding: 8px 11px; border: 1px solid #7f719e; border-radius: 6px; background: #302744; color: #f1e7ff; font-size: .8rem; line-height: 1.5; text-align: left; }
.hq-word-bank { display: flex; flex-wrap: wrap; gap: 7px; }
.hq-word-bank button { background: #141b2f; }
.hq-empty-sentence { color: #a2a9bd; font-size: .8rem; padding: 10px 0; }
.hq-sentence-stem { color: var(--hq-gold); font-family: Georgia,serif; font-size: 1.25rem; line-height: 1.6; }
.hq-journal { margin-top: 18px; padding: 20px; border: 1px solid var(--hq-line); border-radius: 14px; background: #11182a; }
.hq-journal h2 { font-size: 1.3rem; margin-top: 4px; }
.hq-journal ol { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; padding: 0; margin: 16px 0 0; list-style: none; }
.hq-journal li { display: grid; place-items: center; gap: 8px; min-height: 112px; padding: 10px 4px; border: 1px dashed #424a63; border-radius: 9px; color: #9fa7bf; font-size: .65rem; text-align: center; }
.hq-journal .is-collected { border-style: solid; border-color: #77623e; color: var(--hq-text); background: #1a2030; }
.hq-journal .hq-object-art { width: 42px; height: 42px; }
.hq-journal small { color: var(--hq-gold); font-size: .72rem; }
.hq-unknown { font-family: Georgia,serif; font-size: 1.7rem; color: #646e87; }
.hq-solved-card { text-align: center; border-color: #726141; background: linear-gradient(145deg,#262d30,#141b2f); }
.hq-success-mark { display: grid; place-items: center; width: 45px; height: 45px; margin: auto; border: 1px solid #88c69b; border-radius: 50%; color: #b0dfb5; background: #244533; }
.hq-stars { color: var(--hq-gold); font-size: 2.2rem; letter-spacing: .16em; }
.hq-stars > span { color: #8f8a81; }
.hq-model-sentence { display: flex; align-items: center; gap: 10px; text-align: left; padding: 14px; border-radius: 9px; background: #0e1526; }
.hq-model-sentence p { font-family: Georgia,serif; font-size: 1.05rem; line-height: 1.7; }
.hq-score-pill { justify-self: center; padding: 6px 14px; border: 1px solid #726141; border-radius: 20px; color: var(--hq-gold); font-size: .76rem; }
.hq-explorer-card { text-align: center; }
.hq-explorer-object { width: 90px; height: 90px; margin: auto; }
.hq-explorer-card .hq-icon-button { justify-self: center; }
.hq-explorer-sentence { color: var(--hq-muted); font-family: Georgia,serif; font-size: 1.1rem; line-height: 1.7; }
.hq-storage-warning { margin-top: 18px !important; color: #ffd1c2; font-size: .8rem; }
.hq-completion { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 40px 0; }
.hq-completion-art { position: relative; align-self: stretch; min-height: 310px; border: 1px solid #6f5d40; border-radius: 14px; overflow: hidden; }
.hq-completion-art > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hq-completion-art.is-tall { align-self: start; min-height: 0; aspect-ratio: 1; }
.hq-completion-art.is-tall > img { object-fit: contain; }
.hq-completion-seal { position: absolute; bottom: 24px; left: 50%; display: grid; place-items: center; gap: 10px; width: 105px; height: 105px; border: 1px solid var(--hq-gold); border-radius: 50%; background: #111a2bf2; color: var(--hq-gold); transform: translateX(-50%); box-shadow: 0 0 0 8px #10182c5c; }
.hq-completion-seal svg { width: 34px; height: 34px; }
.hq-completion-seal b { font-size: .65rem; letter-spacing: .1em; }
.hq-completion-copy > p:not(.hq-kicker,.hq-save-note) { color: var(--hq-muted); font-size: .9rem; line-height: 1.7; }
.hq-completion h1 { font-size: clamp(2rem,3.6vw,3.3rem); }
.hq-completion-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 25px 0; padding: 18px 0; border-block: 1px solid var(--hq-line); }
.hq-completion-stats > div { display: grid; gap: 8px; }
.hq-completion-stats strong { color: var(--hq-gold); font-family: Georgia,serif; font-size: 2rem; font-weight: 400; }
.hq-completion-stats small { color: #b8aa90; font-size: .85rem; }
.hq-completion-stats span { color: var(--hq-muted); font-size: .7rem; }
.hq-completion-actions { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; margin-bottom: 16px; }
.hq-field-notes { padding: 25px; border: 1px solid var(--hq-line); border-radius: 14px; background: #141b2f; }
.hq-field-notes h2 { margin-top: 6px; }
.hq-field-notes > div { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.hq-field-notes article { display: flex; align-items: center; gap: 16px; padding: 17px; border: 1px solid #424b63; border-radius: 9px; background: #101727; }
.hq-field-notes article > .hq-object-art { flex: 0 0 52px; width: 52px; height: 52px; }
.hq-field-notes article > div { flex: 1; }
.hq-field-notes small { display: block; margin-bottom: 5px; color: var(--hq-muted); font-size: .68rem; }
.hq-field-notes article p { color: var(--hq-text); font-size: .87rem; line-height: 1.6; }
.hq-note-stars { display: block; margin-top: 6px; color: var(--hq-gold); font-size: .75rem; letter-spacing: .13em; }
.hq-shell .language-keyboard { padding: 9px; border: 1px solid #414962; border-radius: 8px; background: #0e1527; }
.hq-shell .language-keyboard__heading { color: var(--hq-muted); font-size: .65rem; }
.hq-shell .language-keyboard__keys { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.hq-shell .language-keyboard__keys button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 35px; min-height: 44px; padding: 7px; border: 1px solid #4f5670; border-radius: 5px; background: #222b42; color: var(--hq-text); }
.hq-shell .language-keyboard__divider { display: none; }

/* A1/A2: readable clue blocks and a small visual vocabulary guide. */
.hq-clue { display: grid; gap: 18px; font-family: inherit; font-size: .98rem; line-height: 1.65; }
.hq-clue-part { display: grid; grid-template-columns: 26px minmax(0,1fr); gap: 10px; align-items: start; }
.hq-clue-part > span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #baa0df1c; color: #d9c3f5; font-size: .72rem; font-weight: 700; }
.hq-clue-part h3 { margin: 1px 0 4px; color: #cfb5eb; font-size: .7rem; font-weight: 600; }
.hq-clue-part p { overflow-wrap: anywhere; }
.hq-clue-part + .hq-clue-part { padding-top: 14px; border-top: 1px solid #a68dc52a; }
.hq-search-prompt { color: var(--hq-muted); font-size: .76rem; line-height: 1.6; padding-inline: 5px; }
.hq-journal { padding: 16px; }
.hq-journal h2 { font-size: 1.15rem; }
.hq-journal li { min-height: 84px; }
.hq-unknown { font-size: 1.25rem; }
.hq-learning-goal { color: #d5c6ed; padding: 10px 12px; background: #ad8ce214; border-radius: 8px; font-size: .77rem; line-height: 1.7; }
.hq-learned-word { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 12px; padding: 14px; border: 1px solid #7c735253; border-radius: 10px; background: #e9c8870b; }
.hq-learned-word > .hq-object-art { width: 48px; height: 48px; }
.hq-learned-word > div { display: grid; gap: 5px; }
.hq-learned-word small { color: var(--hq-gold); font-size: .56rem; letter-spacing: .05em; }
.hq-learned-word strong { color: var(--hq-text); font-size: 1.2rem; }
.hq-learned-word span { color: var(--hq-muted); font-size: .76rem; }
.hq-learning-guide { border: 1px solid var(--hq-line); border-radius: 12px; background: #11192c; overflow: hidden; }
.hq-learning-guide summary { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 13px 16px; color: var(--hq-gold); font-size: .83rem; cursor: pointer; list-style: none; }
.hq-learning-guide summary::-webkit-details-marker { display: none; }
.hq-learning-guide summary > span { margin-left: auto; font-size: 1.2rem; }
.hq-learning-guide[open] summary > span { transform: rotate(45deg); }
.hq-learning-guide summary:focus-visible { outline: 3px solid var(--hq-gold); outline-offset: -3px; }
.hq-learning-guide > div { display: grid; gap: 18px; padding: 0 16px 18px; }
.hq-learning-guide h3 { margin-bottom: 9px; color: #c8c1df; font-size: .75rem; }
.hq-guide-words { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.hq-guide-word { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 9px; min-height: 45px; border: 1px solid #3a435b; border-radius: 8px; color: #ede4d5; background: #1b2338; font-size: .73rem; text-align: left; }
.hq-guide-word > span { flex: 1; min-width: 0; }
.hq-guide-words i { width: 14px; height: 14px; flex: 0 0 14px; border: 1px solid #ffffff25; border-radius: 50%; background: var(--swatch); }
.hq-guide-words svg { width: 34px; height: 25px; color: var(--hq-gold); }
.hq-text-button { min-height: 44px; padding: 8px; color: #c2b5df; border: 0; border-radius: 8px; background: transparent; font-size: .79rem; text-decoration: underline; text-underline-offset: 4px; }
.hq-clue-recap summary { min-height: 44px; padding: 12px; color: var(--hq-muted); font-size: .79rem; cursor: pointer; }
.hq-answer-form { gap: 12px; }
.hq-review-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; padding: 24px; border: 1px solid #8c744b; border-radius: 14px; background: linear-gradient(130deg,#272b35,#141b2f); }
.hq-review-card h2 { margin: 7px 0; }
.hq-review-card > .hq-primary,.hq-review-card > .hq-secondary { width: auto; }
.hq-review-card.is-question { display: grid; justify-content: stretch; max-width: 760px; margin-inline: auto; gap: 16px; text-align: center; }
.hq-review-object { width: 80px; height: 80px; margin: 0 auto; }
.hq-review-choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.hq-review-choices button { min-height: 52px; padding: 12px; border: 1px solid #616077; border-radius: 10px; background: #1a2238; color: var(--hq-text); }
.hq-review-choices button:disabled { opacity: 1; }
.hq-review-choices .is-correct { border-color: #89c19e; background: #243e31; }
.hq-review-choices .is-incorrect { border-color: #af716b; background: #412c32; }
.hq-review-card.is-question > .hq-primary { width: 100%; }

@media (min-width: 1550px) { .hq-play-grid { grid-template-columns: minmax(0,1fr) 390px; } }
@media (max-width: 1100px) {
  .hq-setup-grid { grid-template-columns: minmax(0,1.4fr) 330px; gap: 18px; }
  .hq-how { grid-template-columns: 1fr; padding: 20px; }
  .hq-how li { align-items: center; }
  .hq-how span { font-size: .76rem; }
  .hq-preview-caption { flex-direction: column; }
  .hq-play-grid { grid-template-columns: minmax(0,1fr) 320px; gap: 16px; }
  .hq-scene-header { padding: 15px; }
  .hq-scene-tools .hq-subtle { display: none; }
  .hq-clue-card,.hq-answer-form,.hq-search-note,.hq-solved-card { padding: 18px; }
}
@media (max-width: 900px) {
  .hq-setup-grid,.hq-play-grid,.hq-completion { grid-template-columns: minmax(0,1fr); }
  .hq-how { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .hq-how li { align-items: start; }
  .hq-preview-caption { flex-direction: row; }
  .hq-settings { display: grid; grid-template-columns: minmax(0,1fr); }
  .hq-levels { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .hq-level { grid-template-columns: 1fr; position: relative; min-height: 155px; align-items: start; gap: 8px; padding: 14px; }
  .hq-level-dot { position: absolute; top: 15px; right: 15px; }
  .hq-investigation-panel { grid-row: 1; }
  .hq-play-grid { gap: 20px; }
  .hq-investigation-panel:has(.hq-answer-form,.hq-solved-card) { grid-row: auto; }
  .hq-play-grid:has(.hq-answer-form,.hq-solved-card) .hq-journal:not(.hq-departure-board) { display: none; }
  .hq-scene-card.is-locked .hq-room-nav { display: none; }
  .hq-scene-card.is-locked .hq-floor-nav { display: none; }
  .hq-search-note { display: none; }
  .hq-clue-card { gap: 10px; }
  .hq-clue { font-size: 1.08rem; }
  .hq-hint-button { justify-self: start; padding: 8px 12px; }
  .hq-hint-cost { text-align: left; }
  .hq-journal { margin-top: 14px; }
  .hq-completion { gap: 25px; }
  .hq-completion-art { min-height: 0; aspect-ratio: 1672/941; }
}
@media (max-width: 600px) {
  .hq-clue { font-size: .92rem; gap: 12px; }
  .hq-clue-part + .hq-clue-part { padding-top: 10px; }
  .hq-review-card { padding: 18px; gap: 16px; }
  .hq-review-card > .hq-primary,.hq-review-card > .hq-secondary { width: 100%; }
  .hq-review-choices { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .hq-shell { padding-inline: 12px; }
  .hq-topbar { grid-template-columns: auto 1fr; min-height: 80px; gap: 12px; }
  .hq-top-note { display: none; }
  .hq-brand { justify-self: end; gap: 8px; }
  .hq-brand b { font-size: 1.35rem; }
  .hq-brand small { font-size: .42rem; }
  .hq-brand-seal { width: 35px; height: 35px; }
  .hq-back { padding: 8px 10px; font-size: .72rem; }
  .hq-back svg { width: 16px; height: 16px; }
  .hq-intro { padding: 26px 6px; }
  .hq-intro h1 { font-size: 2.15rem; }
  .hq-intro p:last-child { font-size: .84rem; }
  .hq-session-seal { display: none; }
  .hq-how { grid-template-columns: minmax(0,1fr); gap: 17px; }
  .hq-how li { align-items: center; }
  .hq-preview-caption { flex-wrap: wrap; padding: 14px; font-size: .72rem; }
  .hq-settings { padding: 20px; }
  .hq-levels { grid-template-columns: minmax(0,1fr); }
  .hq-level { grid-template-columns: 25px 1fr 15px; min-height: 78px; align-items: center; gap: 10px; }
  .hq-level-dot { position: static; }
  .hq-setup-footer { flex-wrap: wrap; gap: 10px; padding-top: 16px; }
  .hq-setup-footer span:last-child { display: none; }
  .hq-play-heading { flex-wrap: wrap; padding: 18px 2px; }
  .hq-run-stats { width: 100%; gap: 7px; }
  .hq-run-stats > span { flex: 1; justify-content: center; padding: 8px 5px; font-size: .7rem; }
  .hq-steps { justify-content: space-between; gap: 8px; font-size: .62rem; }
  .hq-steps li { align-items: flex-start; gap: 5px; max-width: 33%; line-height: 1.6; }
  .hq-steps li > span { flex: 0 0 21px; width: 21px; height: 21px; }
  .hq-scene-header { padding: 14px 12px; }
  .hq-scene-header .hq-kicker { font-size: .52rem; }
  .hq-scene-header h1 { font-size: 1.5rem; }
  .hq-scene-tools { gap: 5px; }
  .hq-scene-tools .hq-back { font-size: .67rem; gap: 4px; }
  .hq-scene-tools .hq-icon-button { width: 40px; height: 44px; min-width: 40px; }
  .hq-room-hit { padding: 2px; border-width: 1px; }
  .hq-room-hit > span { padding: 5px 4px; font-size: .52rem; gap: 3px; }
  .hq-room-hit b { display: none; }
  .hq-scene-caption { padding: 10px; font-size: .64rem; }
  .hq-room-nav { padding: 10px; gap: 6px; }
  .hq-room-nav button { flex: 1 0 28%; padding: 7px 5px; font-size: .62rem; }
  .hq-floor-nav { padding: 6px 10px; }
  .hq-floor-row { grid-template-columns: 90px minmax(0,1fr); gap: 7px; }
  .hq-floor-row > div:first-child span { font-size: .64rem; }
  .hq-floor-row small { font-size: .57rem; }
  .hq-floor-row .hq-room-nav { padding: 0; }
  .hq-floor-row .hq-room-nav button { flex-basis: 100%; }
  .hq-journal { padding: 14px; }
  .hq-journal ol { gap: 5px; }
  .hq-journal li { min-height: 94px; padding: 8px 2px; font-size: .53rem; }
  .hq-journal .hq-object-art { width: 30px; height: 30px; }
  .hq-journal small { font-size: .6rem; }
  .hq-unknown { font-size: 1.3rem; }
  .hq-completion { padding: 24px 0; }
  .hq-completion h1 { font-size: 2.4rem; }
  .hq-completion-actions,.hq-field-notes > div { grid-template-columns: minmax(0,1fr); }
  .hq-field-notes { padding: 18px; }
  .hq-field-notes article { padding: 12px; gap: 10px; }
  .hq-field-notes article > .hq-object-art { flex-basis: 36px; width: 36px; height: 36px; }
  .hq-field-notes article p { font-size: .79rem; }
}
@media (prefers-reduced-motion: reduce) { .hq-shell *, .hq-shell *::before, .hq-shell *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Story context and physical placement appear only in new investigations. */
.hq-story-preview { padding: 14px; border: 1px solid #bda1dd38; border-radius: 10px; background: #a480cf0b; }
.hq-story-preview strong { color: var(--hq-text); font-size: .85rem; }
.hq-story-preview p { margin-top: 7px; color: var(--hq-muted); font-size: .78rem; line-height: 1.65; }
.hq-story-preview.is-quick { border-color: #bda36a; }
.hq-quest-meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-bottom: 10px; color: var(--hq-gold); font-size: .65rem; line-height: 1.5; }
.hq-recovered-scene { align-self: start; min-height: 0; aspect-ratio: auto; }
.hq-recovered-scene .hq-journal { margin: 0; border: 0; border-top: 1px solid var(--hq-line); border-radius: 0; }
.hq-story-banner { display: flex; align-items: center; gap: 13px; margin: 0 0 18px; padding: 14px 18px; border: 1px solid #bda1dd38; border-radius: 12px; background: linear-gradient(100deg,#2c2343,#151c2e); }
.hq-story-banner > span { display: grid; place-items: center; flex: 0 0 34px; color: var(--hq-gold); }
.hq-story-banner svg { width: 24px; height: 24px; }
.hq-story-banner strong { font-size: .87rem; }
.hq-story-banner p { margin-top: 4px; color: var(--hq-muted); font-size: .78rem; line-height: 1.6; }
.hq-place-panel { display: grid; gap: 14px; padding: 22px; border: 1px solid #ac956858; border-radius: 14px; background: var(--hq-panel); }
.hq-place-panel h2 { font-family: Georgia,serif; font-size: 1.5rem; font-weight: 400; }
.hq-place-instruction { padding: 14px; border-radius: 9px; background: #d3b87910; color: var(--hq-text); font-size: 1rem; line-height: 1.7; }
.hq-place-options { display: flex; flex-wrap: wrap; gap: 8px; }
.hq-place-options button { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid #536078; border-radius: 9px; background: #151d30; color: var(--hq-text); font-size: .77rem; cursor: pointer; }
.hq-place-options button > span { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid #ab986f; border-radius: 50%; color: var(--hq-gold); font-size: .7rem; }
.hq-place-options button.is-selected { border-color: var(--hq-gold); background: #d1b4771b; }
.hq-place-marker { position: absolute; z-index: 350; display: grid; place-items: center; width: 44px; height: 44px; transform: translate(-50%,-50%); padding: 0; border: 0; background: transparent; cursor: pointer; }
.hq-place-marker > span { display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid #efd599; border-radius: 50%; background: #242332f2; color: #f3dcaa; box-shadow: 0 2px 5px #0008; font-size: .7rem; font-weight: 700; }
.hq-place-marker.is-selected > span { color: #201b17; background: #efd599; outline: 2px solid #242332; }
.hq-place-marker:focus-visible { outline: 2px solid #efd599; border-radius: 50%; }
@media (min-width: 561px) and (max-width: 1080px) { .hq-how { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 560px) {
  .hq-steps li { max-width: none; flex: 0 0 calc(50% - 5px); }
  .hq-story-banner { padding: 12px; align-items: start; }
  .hq-story-banner p { font-size: .75rem; }
  .hq-place-panel { padding: 18px; }
  .hq-place-instruction { font-size: .95rem; }
}

/* Small map numbers keep the villa's narrow bathrooms readable. */
.hq-house-scene.is-villa .hq-room-hit > span { padding: 0; border: 0; background: transparent; box-shadow: none; }
.hq-room-number { display: inline-grid; place-items: center; flex: 0 0 23px; width: 23px; height: 23px; padding: 0; border: 1px solid #bca67d; border-radius: 50%; background: #11182bef; color: var(--hq-gold); font: 600 .64rem/1 sans-serif; }
.hq-house-scene.is-villa .hq-room-name { display: none; position: absolute; z-index: 5; bottom: 32px; left: 50%; max-width: 170px; width: max-content; padding: 7px 10px; border: 1px solid #bca67d; border-radius: 6px; background: #11182bf5; color: var(--hq-text); transform: translateX(-50%); font-size: .72rem; line-height: 1.4; }
.hq-house-scene.is-villa .hq-room-hit:is(:hover,:focus-visible) .hq-room-name { display: block; }
.hq-house-scene.is-villa .hq-room-hit:is(:hover,:focus-visible) { z-index: 5; }
.hq-room-nav button:has(.hq-room-number) { display: inline-flex; align-items: center; justify-content: flex-start; gap: 7px; text-align: left; }
@media (max-width: 560px) {
  .hq-house-scene.is-villa .hq-room-hit { padding: 1px; }
  .hq-house-scene.is-villa .hq-room-number { display: inline-grid; flex-basis: 18px; width: 18px; height: 18px; font-size: .52rem; }
}
.hq-floor-row .hq-room-number { display: inline-grid; margin: 0; color: var(--hq-gold); }

.hq-task-purpose { margin-top: 8px !important; padding-top: 8px; border-top: 1px solid var(--hq-line); }
.hq-task-purpose b { font-size: .65rem; color: var(--hq-gold); }
.hq-activity-board .hq-card-heading { padding-bottom: 12px; }
.hq-activity-board .hq-card-heading strong { color: var(--hq-gold); }
.hq-activity-board li > svg { width: 20px; height: 20px; color: #bbd4b2; margin-left: auto; }
.hq-activity-board > .hq-subtle { font-size: .72rem; line-height: 1.6; margin-bottom: 0; }
.hq-evidence-board { margin-top: 18px; padding: 20px; border: 1px solid #665d4a; border-radius: 14px; background: var(--hq-panel); }
.hq-evidence-board summary { font-size: .85rem; letter-spacing: .04em; cursor: pointer; min-height: 44px; }
.hq-evidence-board[open] { margin-bottom: 18px; }
.hq-evidence-board .hq-card-heading strong { color: var(--hq-gold); }
.hq-evidence-board ol { display: grid; gap: 10px; padding: 0; list-style: none; }
.hq-evidence-board li { padding: 12px; border: 1px solid var(--hq-line); border-radius: 8px; }
.hq-evidence-board .is-read { background: #2c3a352b; border-color: #5d7764; }
.hq-evidence-board li > div { display: grid; gap: 7px; }
.hq-evidence-board li p { font-size: .82rem; line-height: 1.6; margin: 8px 0 0; }
.hq-evidence-board .hq-text-button { text-align: left; font-size: .78rem; white-space: normal; min-height: 44px; }

.hq-departure-board > .hq-primary { width: 100%; margin: .6rem 0; }
.hq-departure-board > ol:empty { display: none; }
.hq-departure-candidates { margin-top: 1rem; }
.hq-departure-candidates summary { cursor: pointer; font-weight: 650; }
.hq-departure-candidates > div { display: grid; gap: .5rem; margin-top: .7rem; }
.hq-candidate { display: flex; align-items: center; gap: .7rem; padding: .7rem; border: 1px solid var(--hq-line); border-radius: .8rem; background: transparent; color: inherit; text-align: left; }
.hq-candidate > span:first-child { flex: 0 0 2.5rem; text-align: center; }
.hq-candidate small { display: block; margin-top: .3rem; opacity: .7; }
.hq-candidate.is-selected { border-color: var(--hq-gold); }
.hq-departure-board .hq-feedback { margin: .7rem 0; }
[data-hq-decision-panel] .hq-secondary { width: 100%; margin-top: .6rem; }
[data-hq-departure-form] .hq-learned-word { margin-bottom: 1rem; }

.hq-departure-board ol { grid-template-columns: repeat(auto-fit,minmax(76px,1fr)); }
.hq-mystery-dossier{padding:22px;margin-bottom:18px;border:1px solid var(--hq-line);border-radius:18px;background:var(--hq-panel);min-width:0}
.hq-mystery-dossier h2{margin:0;font-size:1.15rem}
.hq-mystery-dossier .hq-card-heading>span{font-size:.75rem;color:var(--hq-muted);text-align:right}
.hq-witness-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:16px}
.hq-witness{padding:14px;border-radius:12px;background:var(--hq-panel-soft);border:1px solid var(--hq-line);min-width:0}
.hq-witness.is-read{background:#20312e}
.hq-witness>div{display:flex;justify-content:space-between;gap:10px}
.hq-witness small{font-size:.7rem;color:var(--hq-muted)}
.hq-witness p{font-size:.85rem;line-height:1.6;margin-bottom:0}
.hq-witness .hq-text-button{font-size:.75rem;text-align:left;white-space:normal}
.hq-supported-proof{margin-top:16px;padding:14px;border-left:3px solid #99b68a;background:#20312e;font-size:.85rem}
.hq-hypothesis-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.hq-hypothesis{display:flex;flex-direction:column;gap:7px;padding:12px;border:1px solid var(--hq-line);border-radius:12px;min-width:0}
.hq-hypothesis.is-selected{border-color:var(--hq-gold);background:#303044}
.hq-hypothesis.is-excluded{opacity:.7;background:#242536}
.hq-hypothesis strong{font-size:.85rem}
.hq-hypothesis small,.hq-hypothesis p{font-size:.7rem;margin:0}
.hq-hypothesis button{padding:8px;font-size:.72rem;border:1px solid #51576e;border-radius:8px;background:#141b2f;color:var(--hq-text);white-space:normal;text-align:left}
.hq-hypothesis button[aria-pressed=true]{background:#3e3a51;border-color:var(--hq-gold)}
.hq-proof-options{margin:20px 0;padding:0;border:0;min-width:0}
.hq-proof-options legend{font-weight:700;font-size:.9rem}
.hq-proof-options p{font-size:.8rem}
.hq-proof-options label{display:flex;align-items:flex-start;gap:9px;font-size:.82rem;line-height:1.5;padding:10px 0}
.hq-proof-options input{flex:0 0 auto;margin-top:4px;accent-color:var(--hq-gold)}
.hq-proof-options span{min-width:0}
.hq-completion-art .hq-mystery-dossier{margin:16px 0 0}
@media(max-width:520px){.hq-witness-list{grid-template-columns:1fr}.hq-mystery-dossier{padding:16px}.hq-hypothesis-list{gap:8px}.hq-hypothesis{padding:10px}.hq-mystery-dossier .hq-card-heading{align-items:flex-start}}

.hq-witness .hq-witness-location{color:var(--hq-muted);font-size:.75rem;margin:10px 0}

.hq-bedroom-board{margin:0 0 20px}
.hq-bedroom-wishes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.hq-bedroom-wishes .hq-candidate{align-items:flex-start;min-width:0;white-space:normal}
.hq-bedroom-wishes .hq-candidate>span:last-child{display:flex;flex-direction:column;gap:8px;min-width:0}
.hq-bedroom-wishes strong{font-size:.8rem}
.hq-bedroom-wishes span span{font-size:.78rem;line-height:1.5}
.hq-bedroom-board .hq-card-heading>strong{flex:0 0 auto;text-align:right}
.hq-bedroom-board .hq-card-heading>strong small{display:block;font-size:.65rem;font-weight:400}
.hq-bedroom-options button{text-align:left;white-space:normal;justify-content:flex-start;gap:10px;line-height:1.5}
.hq-completion-art .hq-bedroom-board{margin:16px 0 0}
.hq-completion-art .hq-bedroom-wishes{grid-template-columns:1fr}
@media(max-width:600px){.hq-bedroom-wishes{grid-template-columns:1fr}.hq-bedroom-board{padding:16px}.hq-bedroom-wishes .hq-candidate>span:last-child{gap:4px}}
.hq-shell .hq-bedroom-wishes button:disabled{opacity:1}
@media(max-width:900px){
  .hq-play-grid:has(.hq-bedroom-board)>div{display:contents}
  .hq-play-grid:has(.hq-bedroom-board) .hq-bedroom-board{grid-row:1}
  .hq-play-grid:has(.hq-bedroom-board) .hq-investigation-panel{grid-row:2}
  .hq-play-grid:has(.hq-bedroom-board) .hq-scene-card{grid-row:3}
  .hq-play-grid:has(.hq-bedroom-board):has(.hq-answer-form) .hq-scene-card{grid-row:1}
}

.hq-sorting-board{margin:0 0 20px}
.hq-sort-lanes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:16px 0}
.hq-sort-lane{min-width:0;padding:12px;border:1px solid var(--hq-line);border-radius:12px;background:rgba(255,255,255,.025)}
.hq-sort-lane.is-unclassified{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 10px}
.hq-sort-lane.is-unclassified h3{grid-column:1/-1}
.hq-sort-lane h3{margin:0 0 10px;font-size:.72rem;font-weight:600;color:var(--hq-muted)}
.hq-sort-lane .hq-candidate{width:100%;min-width:0;white-space:normal;align-items:flex-start;margin:6px 0}
.hq-sort-lane .hq-candidate>span:last-child{display:flex;flex-direction:column;gap:6px;min-width:0}
.hq-sort-lane strong{font-size:.8rem}
.hq-sort-lane small{font-size:.68rem;line-height:1.5}
.hq-sort-actions{display:flex;flex-wrap:wrap;gap:10px}
.hq-sort-actions button{flex:1 1 180px;width:auto}
.hq-sort-message{padding:14px;margin:16px 0;border-left:3px solid var(--hq-gold);background:rgba(255,255,255,.035)}
.hq-sort-message h3{font-size:.7rem;margin:0 0 8px}
.hq-sort-message p{font-size:.84rem;line-height:1.7;margin:0}
.hq-sorting-board .hq-card-heading>strong{flex:0 0 auto;text-align:right}
.hq-sorting-board .hq-card-heading>strong small{display:block;font-size:.65rem;font-weight:400}
.hq-sort-options button{white-space:normal;text-align:left}
.hq-shell .hq-sort-lane button:disabled{opacity:1}
.hq-completion-art .hq-sort-lanes{grid-template-columns:1fr}
@media(max-width:899px){
  .hq-play-grid:has(.hq-sorting-board)>div{display:contents}
  .hq-play-grid:has(.hq-sorting-board) .hq-sorting-board{grid-row:1}
  .hq-play-grid:has(.hq-sorting-board) .hq-investigation-panel{grid-row:2}
  .hq-play-grid:has(.hq-sorting-board) .hq-scene-card{grid-row:3}
  .hq-play-grid:has(.hq-sorting-board):has(.hq-answer-form) .hq-scene-card{grid-row:1}
}
@media(max-width:600px){.hq-sort-lanes,.hq-sort-lane.is-unclassified{grid-template-columns:1fr}.hq-sorting-board{padding:16px}.hq-sort-actions>*{width:100%}}

.hq-memory-board{margin:0 0 20px}
.hq-memory-observations{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.hq-memory-observations .hq-candidate{min-width:0;white-space:normal;text-align:left;align-items:flex-start}
.hq-memory-observations .hq-candidate>span:last-child{min-width:0;display:flex;flex-direction:column;gap:6px}
.hq-memory-observations strong{font-size:.8rem}
.hq-memory-observations small{font-size:.72rem;line-height:1.5}
.hq-memory-board .hq-card-heading>strong{flex:0 0 auto;text-align:right}
.hq-memory-board .hq-card-heading>strong small{display:block;font-size:.65rem;font-weight:400}
.hq-memory-board .hq-primary{width:100%}
.hq-memory-frames{display:flex;gap:8px;align-items:center;padding:12px 18px;border-bottom:1px solid var(--hq-line);background:var(--hq-panel)}
.hq-memory-frames button{padding:9px 15px;border:1px solid var(--hq-line);border-radius:20px;background:transparent;color:var(--hq-muted);cursor:pointer;font:inherit;font-size:.8rem}
.hq-memory-frames button.is-selected{background:var(--hq-gold);border-color:var(--hq-gold);color:var(--hq-ink)}
.hq-memory-frames strong{margin-left:auto;color:var(--hq-text);font-size:.8rem}
.hq-memory-options button{white-space:normal;text-align:left;line-height:1.5}
.hq-shell .hq-memory-observations button:disabled{opacity:1}
.hq-completion-art .hq-memory-board{margin:16px 0 0}
@media(max-width:900px){
 .hq-play-grid:has([data-hq-memory-panel],[data-hq-memory-form])>div{display:contents}
 .hq-play-grid:has([data-hq-memory-panel],[data-hq-memory-form]) .hq-scene-card{grid-row:1}
 .hq-play-grid:has([data-hq-memory-panel],[data-hq-memory-form]) .hq-memory-board{grid-row:2}
 .hq-play-grid:has([data-hq-memory-panel],[data-hq-memory-form]) .hq-investigation-panel{grid-row:3}
}
@media(max-width:600px){.hq-memory-observations{grid-template-columns:1fr}.hq-memory-board{padding:16px}.hq-memory-frames{padding:10px;gap:6px}.hq-memory-frames button{padding:9px 12px}.hq-memory-frames strong{font-size:.7rem}}

.hq-quest-catalog { margin: 24px; padding-top: 20px; border-top: 1px solid var(--hq-line); }
.hq-quest-catalog summary { cursor: pointer; font-weight: 700; color: var(--hq-text); }
.hq-quest-catalog summary > span { font-weight: 400; font-size: .8rem; color: var(--hq-muted); margin-left: 8px; }
.hq-quest-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.hq-quest-choice { display: flex; flex-direction: column; gap: 8px; text-align: left; border: 1px solid var(--hq-line); border-radius: 12px; padding: 14px; background: var(--hq-panel); color: var(--hq-text); cursor: pointer; min-width: 0; }
.hq-quest-choice.is-selected { border-color: var(--hq-gold); background: rgba(205, 169, 96, .09); }
.hq-quest-choice > strong { font-size: 1rem; }
.hq-quest-choice > span:not(.hq-quest-meta) { font-size: .82rem; line-height: 1.5; }
.hq-quest-choice > small { font-size: .72rem; color: var(--hq-muted); }
.hq-quest-recommended { font-size: .7rem; color: var(--hq-gold); }
.hq-quest-choice:focus-visible, .hq-quest-catalog summary:focus-visible { outline: 2px solid var(--hq-gold); outline-offset: 3px; }
@media (max-width: 520px) {
  .hq-quest-catalog { margin: 16px; }
  .hq-quest-cards { grid-template-columns: 1fr; }
  .hq-quest-catalog summary > span { display: block; margin: 4px 0 0; }
}
