.adventure {max-width:640px;margin:0 auto;padding:22px 16px 100px;line-height:1.55;color:var(--ink)}
.adventure h1 {font-size:clamp(17px,4.6vw,25px);line-height:1.2;margin:12px 0}
.adventure h2 {font-size:16px;line-height:1.5}
.adventure p {font-family:var(--term);font-size:21px}
.adventure .eyebrow {color:#ffe08c;font-size:12px;letter-spacing:.09em}
.adventure .boss-portrait {height:110px;display:flex;align-items:center;justify-content:center;font-size:70px;margin:10px}
.adventure .boss-portrait img {max-width:100%;height:110px;object-fit:contain;image-rendering:pixelated}
.adventure .panel {padding:18px;border:2px solid var(--line);border-radius:4px;background:var(--card);margin:16px 0}
.adventure .host {border-left:3px solid #ffe08c;padding:8px 14px;color:#e0d3f1}
.adventure .actions {display:grid;gap:10px;margin:18px 0}
.adventure button,.adventure input {min-height:48px;font-family:var(--term);font-size:21px}
.adventure button {white-space:normal;line-height:1.6;font:12px/1.6 var(--px);overflow-wrap:anywhere;padding:12px}
.adventure input[type=text] {width:100%;box-sizing:border-box;border:1px solid #9681b7;border-radius:8px;padding:12px;background:#100c1d;color:var(--ink)}
.adventure label {display:block;margin:10px 0}
.adventure input[type=checkbox] {min-height:24px;width:24px;vertical-align:middle}
.adventure .benefits {display:flex;flex-wrap:wrap;gap:8px;padding:0;list-style:none;font-family:var(--term)}
.adventure .benefits li {border:1px solid #746295;border-radius:20px;padding:7px 12px}
.adventure progress {width:100%;height:12px;accent-color:#65eed0}
.adventure .note {font-size:14px;color:#c4b9d5}
.adventure .guide-grid {display:grid;gap:12px}
.adventure .guide-grid h2 {overflow-wrap:anywhere}
.adventure a {color:#83f4dc}
.adventure button:focus-visible,.adventure input:focus-visible {outline:3px solid #83f4dc;outline-offset:3px}
.quick-adventure-card {margin:12px 0;padding:16px;border:2px solid var(--line);border-radius:4px;background:var(--card);display:grid;gap:10px}
.quick-adventure-card p {font-family:var(--term);font-size:20px;line-height:1.5;margin:0}
.ar-finisher-modal {background:radial-gradient(ellipse at 50% 40%,#382251,#0d0920 75%)}
.ar-finisher-modal .ar-slam-btn {cursor:pointer}
.share-photo-choices {max-height:170px;overflow:auto;font-family:system-ui,sans-serif;font-size:14px}
.share-photo-choices label {display:block;padding:8px}
@media(prefers-reduced-motion:reduce) {*,*::before,*::after {animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}}

.ar-original-art {position:absolute;inset:0;width:100%;height:100%;object-fit:contain;image-rendering:pixelated;pointer-events:none}
.ar-boss-sprite {touch-action:manipulation}

.quick-adventure-card.expedition {padding:16px;margin:12px 0;max-width:100%;width:100%}

/* Home gives one adventure priority; secondary modes live on their own screen. */
.home-logo.hero { margin-bottom: 2px; padding-bottom: 0; }
.home-logo .hero-scroll-img { max-width: 240px; }
.home-welcome { text-align:center; padding: 0 8px 14px; }
.home-welcome h1,.game-modes h1 { font: 15px/1.75 var(--px); color:var(--ink); margin: 12px 0 22px; text-wrap:balance; }
.home-welcome .btn { width:100%; min-height:48px; white-space:normal; line-height:1.65; }
.home-welcome #quickStart,.home-welcome #resumeGo,.home-welcome #resumeExpedition { font-size:11px; padding:16px 10px; }
.home-reassurance { font:21px/1.3 var(--term); color:var(--ink-dim); margin:12px 0 16px; text-wrap:balance; }
.home-secondary { display:grid; gap:12px; margin-top:16px; }
.home-secondary .btn { font-size:10px; background:var(--card); box-shadow:4px 4px 0 #000, inset 0 2px 0 #49345f; border:2px solid #80639e; color:var(--ink); }
.home-secondary .btn:hover { background:#2c1942; border-color:var(--gold); }
.home-secondary .btn:active { transform:translate(2px,2px); box-shadow:2px 2px 0 #000; }
.home-welcome .resume-card { margin:0; text-align:left; }
.home-welcome .rc-actions { display:flex; flex-direction:column; }
.home-welcome #resumeDismiss { font-size:9px; box-shadow:none; border:0; }
.home-welcome #reconnectSlot .primary { background:var(--card); color:var(--ink); }
.game-modes { padding: 8px; }
.game-modes > p,.home-mode-invite p { font:22px/1.35 var(--term); color:var(--ink-dim); }
.game-mode-list { display:grid; gap:12px; margin:20px 0; }
.game-mode-option { display:flex; align-items:center; gap:12px; width:100%; min-height:100px; padding:14px 10px; background:var(--card); border:2px solid var(--line); color:var(--ink); text-align:left; cursor:pointer; }
.game-mode-option > img,.mode-outdoor-art { width:58px; height:64px; flex-shrink:0; object-fit:contain; image-rendering:pixelated; }
.mode-outdoor-art { display:grid; place-items:center; font-size:40px; color:var(--gold); }
.game-mode-option strong { display:block; font:10px/1.6 var(--px); color:var(--gold); margin-bottom:7px; }
.game-mode-option span span { display:block; font:21px/1.2 var(--term); }
.game-mode-option:hover { border-color:var(--neon-3); }
.home-welcome button:focus-visible,.game-modes button:focus-visible,.profile-guide:focus-visible { outline:3px solid var(--gold); outline-offset:3px; }
.profile-guide { width:100%; margin:0 0 16px; }
.home-mode-invite { border:2px solid var(--line); padding:12px; margin:16px 0; }
@media (max-width:360px) { .home-welcome { padding-inline:0; } .home-welcome h1 { font-size:13px; } .home-welcome #quickStart { font-size:10px; } }

.home-welcome #reconnectSlot[data-primary="true"] .primary { background:var(--neon); color:var(--ink); }
.home-welcome #reconnectSlot .rc-actions { display:flex; flex-direction:column; }
.home-welcome #rcGo { font-size:11px; padding:16px 10px; }
.home-welcome #rcDismiss { font-size:9px; box-shadow:none; border:0; }

/* The questmaster uses the existing cabinet, art, colour and type system. */
.questmaster-generation,.questmaster-reveal,.adventure-journal { padding:18px 10px 28px; }
.questmaster-generation h1,.questmaster-reveal h1,.adventure-journal h1 { font:16px/1.7 var(--px); overflow-wrap:anywhere; text-wrap:balance; margin:18px 0; }
.questmaster-generation p,.questmaster-reveal p,.adventure-journal p { font:22px/1.4 var(--term); }
.questmaster-generation,.questmaster-reveal { text-align:center; }
.qm-host-art { margin:24px auto; min-height:110px; display:grid; place-items:center; }
.qm-host-art > img { width:120px; height:120px; object-fit:contain; image-rendering:pixelated; }
.qm-loading { color:var(--gold); font-size:28px; letter-spacing:6px; padding:12px; animation:qm-glow 1.8s ease-in-out infinite; }
@keyframes qm-glow { 50% { opacity:.4; } }
.qm-kicker,.qm-source { font:18px/1.45 var(--term); color:var(--ink-dim); margin:10px 0; }
.qm-kicker { color:var(--gold); }
.home-welcome .qm-source { font:18px/1.3 var(--term); margin-top:-6px; }
.questmaster-reveal .boss-portrait { margin:12px auto; }
.questmaster-reveal .qm-personality { color:var(--ink); margin:14px 0; }
.questmaster-reveal .actions,.questmaster-generation .actions { display:grid; gap:10px; margin:20px 0; }
.questmaster-reveal .btn,.questmaster-generation .btn,.adventure-journal .btn { width:100%; min-height:48px; font:10px/1.7 var(--px); white-space:normal; }
.qm-details { margin:16px 0; padding:12px; border:2px solid var(--line); background:var(--card); text-align:left; }
.qm-details summary { cursor:pointer; font:10px/1.7 var(--px); min-height:32px; color:var(--gold); padding:6px 0; }
.qm-details h2,.adventure-journal h2 { font:12px/1.7 var(--px); overflow-wrap:anywhere; }
.qm-details .row { flex-wrap:wrap; }
.qm-journal-entry { margin:14px 0; padding:16px 12px; border:2px solid var(--line); background:var(--card); }
.qm-journal-entry h3 { font:11px/1.65 var(--px); overflow-wrap:anywhere; }
.qm-journal-art { display:block; margin:auto; width:120px; height:120px; object-fit:contain; image-rendering:pixelated; }
.qm-task-progress { display:block; color:var(--gold); margin-top:10px; }
.qm-quest-heading { font:16px/1.7 var(--px); margin:12px 0; }
#questOtherSteps .step-card { margin-top:14px; }
.qm-details summary:focus-visible,.questmaster-reveal button:focus-visible,.questmaster-generation button:focus-visible,.adventure-journal button:focus-visible,#questBossCard:focus-visible { outline:3px solid var(--gold); outline-offset:3px; }
@media(prefers-reduced-motion:reduce) { .qm-loading { animation:none; } }
.questmaster-reveal .boss-portrait { height:160px; display:flex; align-items:center; justify-content:center; font-size:90px; }
.questmaster-reveal .boss-portrait img { max-width:100%; height:160px; object-fit:contain; image-rendering:pixelated; }
#questBossCard .boss-stat { color:var(--ink); gap:8px; line-height:1.5; }
#questBossCard .boss-stat > span:first-child { overflow-wrap:anywhere; }
#questBossCard #bossHpText { flex-shrink:0; }
#timerWrap .lbl { color:var(--ink-dim); }
.welcome-bubble .text,.qm-personality,.adventure-journal p { overflow-wrap:anywhere; }
.quest-inline-tools { display:flex; gap:10px; flex-wrap:wrap; margin:14px 0; align-items:center; }
.quest-inline-tools .fab,.quest-inline-tools .sab-fab { position:relative; inset:auto; transform:none; min-width:48px; width:48px; height:48px; animation:none; box-shadow:3px 3px 0 #000; }
.quest-inline-tools .chat-fab { flex:1; min-width:160px; background:var(--card); gap:8px; }
.quest-inline-tools .chat-fab .fab-label { position:static; transform:none; border:0; padding:0; box-shadow:none; background:none; color:var(--ink); font-size:9px; letter-spacing:0; }
.quest-inline-tools .fab-ic { max-width:30px; max-height:30px; object-fit:contain; }

/* Short labels and expandable supporting information; retain readable type. */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.content-badge { display:inline-block; font:18px/1.4 var(--term); color:var(--ink-dim); border:1px solid var(--line); padding:3px 8px; margin:4px 0 10px; max-width:100%; overflow-wrap:anywhere; }
.quest-boss-name { font:22px/1.35 var(--term); color:var(--gold); margin:8px 0; overflow-wrap:anywhere; }
.adventure .result-earnings { font:26px/1.35 var(--term); color:var(--gold); margin:18px 0; }
.result-primary { margin:20px 0; }
.result-options .actions { display:grid; gap:10px; }
.qm-journal-entry > .btn { margin-top:12px; }
.task-examples { margin:8px 0; padding:0 10px; }
.task-examples > summary { min-height:44px; padding:12px 0; box-sizing:border-box; }
.task-examples ul { margin:0 0 10px; padding-left:20px; }

@media(prefers-reduced-motion:reduce) { .toast { transition:none; } }

.result-primary { display:grid; gap:12px; }
.result-recap { background:var(--card); border:2px solid #80639e; color:var(--ink); }
#questProgress { display:block; width:100%; height:16px; margin:12px 0; appearance:none; border:2px solid #80639e; border-radius:0; background:#100a1c; color:var(--neon-3); }
#questProgress::-webkit-progress-bar { background:#100a1c; }
#questProgress::-webkit-progress-value { background:repeating-linear-gradient(90deg,var(--neon-3) 0 14px,#007e76 14px 16px); }
#questProgress::-moz-progress-bar { background:repeating-linear-gradient(90deg,var(--neon-3) 0 14px,#007e76 14px 16px); }

#showdownLine { display:block; width:100%; resize:vertical; box-sizing:border-box; border:2px solid #9681b7; padding:12px; background:#100c1d; color:var(--ink); font:22px/1.3 var(--term); }
#showdownLine:focus-visible { outline:3px solid var(--gold); outline-offset:3px; }
#showdownError:empty { display:none; }
#showdownError { color:#ffb6b6; }
.showdown-defeat.won { animation:showdown-yield .8s steps(5) both; }
@keyframes showdown-yield { 0%{transform:translateX(0)} 25%{transform:translateX(-7px)} 50%{transform:translateX(7px)} 100%{transform:translateY(8px) rotate(-7deg);filter:saturate(.5)} }
@media(prefers-reduced-motion:reduce) { .showdown-defeat.won { animation:none; } }

/* Prototype arena scales one deterministic logical playfield to every viewport. */
.adventure:has(.relic-fight) { padding:12px 8px 24px; }
.relic-fight h1 { font:14px/1.6 var(--px); overflow-wrap:anywhere; }
.rf-hp { font:19px/1.3 var(--term); color:var(--ink); }
.rf-hp progress { display:block; appearance:none; border:2px solid #80639e; height:13px; border-radius:0; background:#100a1c; }
.rf-hp progress::-webkit-progress-bar { background:#100a1c; }
.rf-hp progress::-webkit-progress-value { background:#ff3da6; }
.rf-hp progress::-moz-progress-bar { background:#ff3da6; }
#rfInstructions { margin:10px 0; color:var(--gold); }
.rf-arena { position:relative; width:100%; aspect-ratio:360/400; border:2px solid #80639e; background:#10091f; overflow:hidden; }
#rfCanvas { display:block; width:100%; height:100%; }
.rf-opening { position:absolute; top:3%; width:100%; text-align:center; font:17px/1.2 var(--term); color:#00e6c3; pointer-events:none; }
.adventure .rf-relic { position:absolute; left:50%; top:78%; transform:translate(-50%,-50%); width:54px; height:54px; min-height:54px; padding:3px; background:#261432; border:2px solid #ffce4f; box-shadow:3px 3px #000; border-radius:50%; touch-action:none; user-select:none; -webkit-user-select:none; cursor:grab; }
.rf-relic img { width:100%; height:100%; object-fit:contain; image-rendering:pixelated; pointer-events:none; }
.rf-relic.pulling { cursor:grabbing; }
.rf-relic:focus-visible { outline:3px solid #fff; outline-offset:4px; }
.rf-overlay { position:absolute; inset:0; background:#100a1cef; padding:20px; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:16px; font:23px/1.4 var(--term); text-align:center; }
.rf-overlay[hidden] { display:none; }
.rf-name { margin:10px 0; overflow-wrap:anywhere; color:var(--gold); }
.rf-name span { display:block; font:17px/1.3 var(--term); color:var(--ink-dim); }
#rfFeedback { min-height:28px; margin:8px 0; }
.rf-weakness { color:#00e6c3; margin:6px 0; overflow-wrap:anywhere; }
#rfError:empty { display:none; }
#rfError { color:#ffb6b6; }
#rfRetry[hidden] { display:none; }
/* Prototype health and charge: always below the throwing relic. */
.rf-player { display:grid; grid-template-columns:1fr auto; gap:4px 12px; font:18px/1.3 var(--term); color:var(--ink); margin-top:9px; }
.rf-player progress { grid-column:1/-1; grid-row:2; height:9px; accent-color:#00e6c3; }
#rfPressure { color:#ffce4f; }
/* Segments fan outward below the full pull area; decoration never captures input. */
.rf-power { position:relative; width:144px; margin:5px 0 10px; transform:translateX(-50%); text-align:center; pointer-events:none; --charge-color:#ffe394; }
.rf-fan { transform:rotate(180deg); display:block; width:140px; height:68px; margin:auto; overflow:visible; }
.rf-segment { fill:none; stroke:#513755; stroke-width:7; stroke-linecap:butt; transition:stroke .12s,filter .15s; }
.rf-segment.lit { stroke:var(--segment); }
.rf-power label { display:block; margin:0; color:var(--charge-color); font:20px/1.3 var(--term); white-space:nowrap; }
.rf-power progress { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.rf-max-power .rf-segment:last-child { filter:drop-shadow(0 0 4px #ff5267); animation:rf-heat 1.1s ease-in-out infinite alternate; }
@keyframes rf-heat { to { filter:drop-shadow(0 0 8px #ff923f); } }
.rf-arena::after { content:''; position:absolute; inset:0; pointer-events:none; box-shadow:inset 0 0 30px 8px rgb(255 40 65 / var(--hurt-alpha,0)); border:3px solid transparent; }
.rf-arena[data-low-health="true"]::after { border-color:#b94d66; }
.rf-arena[data-protected="true"] { border-color:#9aefff; }
.rf-danger-label { position:absolute; top:56%; width:100%; text-align:center; color:#9aefff; font:17px/1.2 var(--term); pointer-events:none; }
.rf-arena[data-low-health="true"]:not([data-protected="true"]) .rf-danger-label { color:#ffb6c0; }
.rf-damage-number { position:absolute; top:44%; width:100%; text-align:center; color:#ffbdc7; font:24px/1.2 var(--term); text-shadow:2px 2px #10091f; pointer-events:none; }
.rf-overlay { z-index:5; }
@media(prefers-reduced-motion:reduce) { .rf-segment { transition:none; } .rf-max-power .rf-segment:last-child { animation:none; } .rf-arena::after { box-shadow:none; } .rf-arena[data-hurt="true"]::after { border-color:#ffbdc7; } }

/* Pickup labels sit outside the input target; no decorative element can collect them. */
.rf-pickup-label { position:absolute; transform:translateX(-50%); text-align:center; pointer-events:none; padding:1px 3px; background:#130b23e8; border:1px solid #9673ad; font:16px/1.2 var(--term); white-space:nowrap; color:#fff1ca; }
.rf-pickup-label[hidden] { display:none; }
.rf-effects { min-height:48px; margin:6px 0; color:#b9edff; font:19px/1.25 var(--term); }

/* Visible held Shield power-up; decoration cannot change the relic's hit target. */
.rf-shield { position:absolute; width:88px; height:96px; pointer-events:none; transform:translate(-50%,-50%); filter:drop-shadow(0 0 6px #5ce8bd80); }
.rf-shield[hidden] { display:none; }
.rf-shield svg { width:100%; height:100%; overflow:visible; }
.rf-shield-body { fill:#65eab51c; stroke:#8cf3b8; stroke-width:3; stroke-linejoin:bevel; }
.rf-shield-edge { fill:none; stroke:#58caa2; stroke-width:1; }
.rf-shield-glint { fill:none; stroke:#e7fff0; stroke-width:3; }
.rf-shield[data-state="break"] .rf-shield-body { fill:#baffdc35; stroke:#e7fff0; stroke-dasharray:14 8; }
.rf-shield[data-state="break"] .rf-shield-edge { stroke-dasharray:8 12; }

/* Audit follow-up: consistent cabinet content, visible controls and compact setup. */
.custom-setup h2, .custom-quest h1 { scroll-margin-top:110px; }
.custom-setup #setupHeading:focus { outline:2px solid var(--neon-3); outline-offset:5px; }
.custom-setup .style-card { padding:10px 6px; }
.custom-setup .style-card-ic { height:44px; }
.custom-setup .style-card-img { max-height:44px; }
.custom-setup .style-card-name { font-size:10px; line-height:1.5; }
.custom-setup .style-card-blurb { font:18px/1.25 var(--term); }
.custom-setup .style-card-grid { gap:8px; }
.custom-setup .style-advanced-toggle { min-height:44px; }
.custom-quest .boss-sticky { position:static; }
.custom-quest .photo-stage:not(.has-photo) { aspect-ratio:auto; height:96px; }
.earned-loot { margin:12px 0; padding:12px; border:2px solid var(--gold); background:#171026; }
.earned-item { display:flex; align-items:center; gap:12px; text-align:left; margin:6px 0 12px; }
.earned-item > img, .earned-item .earned-icon { width:42px; height:42px; object-fit:contain; flex-shrink:0; image-rendering:pixelated; }
.earned-item strong { font:22px/1.1 var(--term); color:var(--gold); }
.earned-item p { margin:4px 0; }
.earned-item .avatar { width:50px; height:50px; flex-shrink:0; }
/* Canvas clips its own projectiles. Shield decoration may cross the arena edge. */
.rf-arena { overflow:visible; }
.rf-arena canvas { overflow:hidden; }
.rf-shield { z-index:2; }
.rf-overlay { z-index:4; }

.style-current .style-card { width:100%; display:grid; grid-template-columns:56px 1fr; text-align:left; align-items:center; }
.style-current .style-card-ic { grid-row:1/3; }
.style-current .style-card-blurb { grid-column:2; }
.custom-quest .timer-ring-wrap { padding:8px 12px; }
.custom-quest .timer-ring-wrap svg { width:36px; height:36px; }
.rf-cue { min-height:3em; }
@media(max-width:500px) { .arcade-pedestal { width:100%; margin-left:0; margin-right:0; } }
@media(max-width:500px) { .arcade-cabinet { margin-left:6px; margin-right:6px; } }

/* Compact active-card disclosure. Opening it never re-renders the quest. */
.quest-card-header { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.quest-card-header .step-tag { min-width:0; flex:1; }
.quest-options-toggle { flex:none; min-height:44px; padding:6px 9px; border:2px solid #9072ac; box-shadow:2px 2px 0 #080410; background:#281b3c; color:#f6eaff; font:18px/1 var(--term); cursor:pointer; }
.quest-options-toggle[aria-expanded="true"] { border-color:var(--gold); }
.quest-options-panel { margin:12px 0; padding:10px; border:2px solid #78578e; background:#171025; display:grid; gap:10px; }
.quest-options-panel[hidden], .quest-camera-error[hidden] { display:none; }
.quest-option-action { width:100%; min-height:44px; padding:10px; text-align:left; border:2px solid #a084b8; background:#2b1c40; color:#fff3ff; font:19px/1.2 var(--term); box-shadow:2px 2px 0 #080410; cursor:pointer; }
.quest-option-action small { display:block; margin-top:3px; font:17px/1.2 var(--term); color:#d3bedf; }
.quest-options-toggle:focus-visible, .quest-option-action:focus-visible { outline:3px solid #ffce4f; outline-offset:3px; }
.quest-camera-error { color:#ffcf93; font:18px/1.25 var(--term); margin:8px 0; }
.rf-arena[data-guard="guarded"] .rf-opening { color:#ff3030; }
.rf-arena[data-guard="open"] .rf-opening { color:#51ff86; font-weight:bold; font-size:24px; letter-spacing:1px; }

/* Readable boss facts, grouped by purpose without adding more explanation. */
.boss-details .boss-detail { --detail-accent:#cab0ff; margin:10px 0; padding:12px; border:1px solid #4e395f; border-left:4px solid var(--detail-accent); background:#170f25; }
.boss-details .boss-detail h2 { color:var(--detail-accent); margin:0 0 8px; font:10px/1.65 var(--px); }
.boss-details .boss-detail p { color:#eee1f7; margin:0; font:22px/1.35 var(--term); }
.boss-details .boss-detail-health { --detail-accent:#ffcf64; background:#292014; }
.boss-detail-health strong { color:#ffdf81; font:28px/1.2 var(--term); }
.boss-details .boss-detail-wants { --detail-accent:#edabff; }
.boss-details .boss-detail-challenge { --detail-accent:#80e8b7; background:#112923; }
.boss-details .boss-detail-consequence { --detail-accent:#ff9d9d; }
.boss-details .boss-detail-equipment { --detail-accent:#92d9ff; }
/* Keep progress, provenance and the boss together as a compact status group. */
.custom-quest > .step-head { display:flex; flex-direction:column; align-items:flex-start; gap:6px; margin:0 0 10px; }
.custom-quest .qm-quest-heading { margin:8px 0 2px; }
.custom-quest #questProgress { margin:0; }
.custom-quest .step-head > .content-badge { margin:0; padding:2px 7px; line-height:1.2; }
/* A smaller visual Options button retains its 44px touch target. */
.quest-options-toggle { position:relative; isolation:isolate; min-height:44px; padding:6px; border:0; box-shadow:none; background:none; font-size:16px; }
.quest-options-toggle::before { content:''; position:absolute; inset:6px 0; z-index:-1; background:#281b3c; border:1px solid #9072ac; box-shadow:2px 2px #080410; }
.quest-options-toggle[aria-expanded="true"]::before { border-color:#ffcf64; }
.quest-option-action[data-skip-step] { background:#351b2c; border-color:#bd7284; color:#ffd0d7; }
.quest-option-action[data-skip-step] small { color:#edbec9; }
/* Fixed-size chat content: no auto image margins pushing its label aside. */
.quest-inline-tools .chat-fab { flex:0 1 auto; width:auto; min-width:0; max-width:100%; padding:8px 12px; gap:9px; border:2px solid #bc95df; background:#312045; justify-content:center; }
.quest-inline-tools .chat-fab .fab-ic { margin:0; flex:0 0 28px; width:28px; height:28px; }
.quest-inline-tools .chat-fab .fab-label { line-height:1.4; text-align:center; white-space:normal; }
.quest-inline-tools .chat-fab:hover { background:#432b59; border-color:#ecd0ff; }
.quest-inline-tools .chat-fab:active { transform:translate(2px,2px); box-shadow:1px 1px #000; }
.quest-inline-tools .chat-fab:focus-visible { outline:3px solid #ffcf64; outline-offset:3px; }
/* Slow glow, never blinking or disappearing; combat state still owns the cue. */
.rf-arena[data-guard="guarded"] .rf-opening,.rf-arena[data-guard="open"] .rf-opening { font-weight:bold; animation:rf-status-glow 1.5s ease-in-out infinite; }
@keyframes rf-status-glow { 0%,100% { text-shadow:0 0 2px currentColor; } 50% { text-shadow:0 0 8px currentColor,0 0 2px currentColor; } }
@media(prefers-reduced-motion:reduce) { .rf-arena[data-guard] .rf-opening { animation:none; text-shadow:none; } }
/* Rewards have their own surface; zero stays visible and accurately labelled. */
.result-combat-recap { margin:12px 0; padding:12px; border:1px solid #665080; background:#1a132a; }
.result-combat-recap p { margin:0 0 8px; color:#cdbfe0; }
.result-combat-recap p:last-child { margin-bottom:0; }
.result-combat-recap .result-task-count { color:#e1caff; }
.result-reward-breakdown { margin:12px 0; padding:12px; border:2px solid #997445; background:#261d16; }
.result-reward-breakdown > div + div { margin-top:12px; padding-top:10px; border-top:1px solid #6b5141; }
.result-reward-breakdown dt { color:#dfd1ba; font:18px/1.3 var(--term); margin-bottom:5px; }
.result-reward-breakdown dd { display:flex; flex-wrap:wrap; gap:8px 16px; margin:0; font:25px/1.25 var(--term); }
.reward-coins { color:#ffda65; }
.reward-xp { color:#8ee7ff; }
.adventure .result-earnings { display:flex; justify-content:center; flex-wrap:wrap; gap:8px; }
.result-earnings > span { padding:8px 12px; border:1px solid currentColor; background:#1a132a; }

.result-secondary-actions { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); gap:8px; width:100%; }
.result-secondary-actions .btn { min-width:0; width:100%; white-space:normal; }
.result-chest-stage { margin:6px auto 12px; text-align:center; }
.result-chest { border:0; background:none; color:#d8bfdc; display:inline-flex; flex-direction:column; align-items:center; gap:4px; padding:6px; cursor:pointer; font:17px/1.3 var(--term); }
.result-chest img { display:block; width:150px; height:150px; object-fit:contain; image-rendering:pixelated; filter:drop-shadow(0 0 12px #bc8f4355); }
.result-chest.opening img { animation:result-chest-pop .7s ease-out; }
.result-chest:focus-visible { outline:3px solid #ffcf64; outline-offset:3px; }
@keyframes result-chest-pop { 0% { transform:rotate(-3deg) scale(.96); } 28% { transform:rotate(3deg) scale(1); } 55% { transform:rotate(0) scale(1.08); } 100% { transform:scale(1); } }
@media(prefers-reduced-motion:reduce) { .result-chest.opening img { animation:none; } }

/* Recovery-flow clarity: shared facts, earnings, and consequences. */
.finale-section { margin:12px 0; padding:14px; text-align:left; background:#181026; border:1px solid #49345f; border-left:3px solid var(--fact-color,#b79de1); }
.finale-section h2,.expedition .finale-section h2 { color:var(--fact-color,#b79de1); font:20px/1.3 var(--term); margin:0 0 8px; }
.finale-section p { margin:6px 0; }
.finale-section .note { color:#d3c7e0; }
.finale-health { --fact-color:#ff99a9; }
.finale-advantages { --fact-color:#75ebce; }
.finale-relic,.finale-rewards { --fact-color:#ffdc7c; }
.finale-controls { --fact-color:#a5caff; }
.finale-consequences { --fact-color:#ffb78c; }
.finale-reward-values { display:flex; flex-wrap:wrap; gap:12px; font:24px/1.3 var(--term); }
.ar-camera-status { color:#eafff4; background:#10251ff2; border:1px solid #75ebce; padding:8px; margin:0 0 6px; font:17px/1.2 var(--term); }
.qm-avatar-floating img { animation:qm-avatar-float 2s ease-in-out infinite; }
@keyframes qm-avatar-float { 50% { transform:translateY(-7px); } }
.result-reward-note { background:#1b142b; border:1px solid #655077; color:#e0d2eb; padding:12px; font:19px/1.35 var(--term); }
.loot-revealing { animation:result-loot-drop .65s cubic-bezier(.2,.75,.3,1) both; animation-delay:var(--loot-delay,0ms); }
@keyframes result-loot-drop { 0% { transform:translateY(-26px) scale(.85); opacity:.4; } 65% { transform:translateY(3px) scale(1.035); opacity:1; filter:brightness(1.3); } 100% { transform:none; opacity:1; filter:none; } }
@media(prefers-reduced-motion:reduce) { .qm-avatar-floating img,.loot-revealing { animation:none; } }

/* Optional training: one contextual lesson, with a reference on demand. */
.tutorial-guide { text-align:left; padding:12px; margin:12px 0; background:#15241f; border:2px solid #68d8b7; color:#ecfff6; }
.tutorial-guide strong { font:19px/1.25 var(--term); color:#8cf3c9; display:block; }
.tutorial-guide .tutorial-copy p { font:20px/1.3 var(--term); margin:6px 0 10px; color:#f0fff8; }
.tutorial-guide .tutorial-actions { display:flex; flex-direction:row; flex-wrap:wrap; align-items:center; gap:8px; }
.tutorial-control,.adventure .tutorial-control { min-height:44px; padding:7px 10px; border:1px solid #7da495; background:#1b3028; color:#e2fff2; cursor:pointer; font:17px/1.2 var(--term); }
.tutorial-control:focus-visible,.tutorial-reference summary:focus-visible { outline:3px solid #ffdf81; outline-offset:3px; }
.tutorial-target { outline:3px dashed #a0ffd4; outline-offset:4px; }
.tutorial-reference { margin-top:10px; }
.tutorial-reference summary { cursor:pointer; color:#b8e7ff; font:18px/1.4 var(--term); min-height:36px; }
.tutorial-reference h3 { color:#a6d9ff; font:20px/1.3 var(--term); margin:12px 0 5px; }
.tutorial-reference p { color:#ecfff6; font:19px/1.35 var(--term); margin:4px 0; }
.tutorial-skipped { padding:6px; border-color:#566e64; }
.tutorial-guide [hidden] { display:none; }
.relic-fight .tutorial-copy { height:auto; overflow:visible; }
.relic-fight .tutorial-actions { display:inline-flex; vertical-align:top; }
.relic-fight .tutorial-reference:not([open]) { display:inline-block; margin:0 0 0 6px; vertical-align:top; }
.relic-fight .tutorial-reference summary { min-height:44px; padding:8px 0; }
.rf-perk-list { margin:0; }
.rf-perk-list dt { color:#b4e8ff; font-weight:bold; margin-top:12px; }
.rf-perk-list dd { margin:4px 0 0; }
.ar-tutorial-hint { max-width:430px; margin:auto; padding:8px; background:#10291ddd; color:#edfff5; font:19px/1.2 var(--term); letter-spacing:0; pointer-events:none; }
.ar-tutorial-toggle { align-self:center; z-index:3; }

/* Reading tutorial tips always pauses combat; content sizes naturally in a modal. */
.rf-tutorial-dialog { margin:auto; box-sizing:border-box; width:min(540px,calc(100vw - 24px)); max-height:calc(100dvh - 32px); overflow:auto; padding:16px; background:#130d22; color:#ecfff6; border:3px solid #68d8b7; font:22px/1.3 var(--term); }
.rf-tutorial-dialog::backdrop { background:#080512df; }
.rf-tutorial-dialog h2 { font:24px/1.2 var(--term); color:#8cf3c9; margin:0 0 10px; }
.rf-tutorial-dialog p { margin:8px 0; }
.rf-tutorial-dialog .tutorial-guide { padding:10px; margin:10px 0; }
.rf-tutorial-dialog > .btn { display:block; width:100%; margin-top:10px; }
.rf-tutorial-dialog .rf-tutorial-basics { color:#cfedff; }
#rfTutorialHelp { margin:10px 0; }

.rf-tutorial-dialog [hidden] { display:none; }

/* Compact arcade stage counter; the fill continues to show resolved quests only. */
.quest-progress-panel { width:100%; padding:10px 12px; border:2px solid #735294; border-left:4px solid var(--gold); background:linear-gradient(110deg,#302045,#1a112d); box-shadow:inset 0 2px #503264,3px 3px #090510; }
.custom-quest .quest-progress-panel .qm-quest-heading { margin:0 0 8px; font:12px/1.4 var(--px); color:var(--gold); }
.quest-word { vertical-align:middle; }
.quest-index { display:inline-block; vertical-align:middle; min-width:36px; padding:7px 5px; text-align:center; font:20px/1.1 var(--px); background:#4b3422; color:#ffdc80; border:2px solid #e5ac44; box-shadow:inset -2px -2px #302011,2px 2px #090510; }
.quest-total { color:#c4a8dd; font:21px/1.3 var(--term); vertical-align:middle; }
.custom-quest .quest-progress-panel #questProgress { height:10px; border:1px solid #9572b0; box-shadow:0 1px #090510; }
.quest-progress-panel #questProgress::-webkit-progress-bar { background:repeating-linear-gradient(90deg,#1b1328 0 12px,#322040 12px 14px); }
.quest-progress-panel #questProgress::-webkit-progress-value { background:repeating-linear-gradient(90deg,#69eac5 0 12px,#248c7d 12px 14px); }
.quest-progress-panel #questProgress::-moz-progress-bar { background:repeating-linear-gradient(90deg,#69eac5 0 12px,#248c7d 12px 14px); }
.arcade-marquee { display:block; width:100%; border-radius:0; cursor:pointer; touch-action:manipulation; user-select:none; }
.arcade-marquee:focus-visible { outline:3px solid var(--gold); outline-offset:4px; }

/* Build 347: compact quest hierarchy, without reducing instruction type. */
.custom-quest .quest-progress-panel { padding:6px 10px 2px; }
.custom-quest .quest-progress-panel #questProgress { margin:4px 0 0; }
.custom-quest .step-head { gap:2px; }
.guided-quest #questBossCard > div { padding:7px!important; }
.guided-quest #questBossCard .boss-emblem { width:34px; height:34px; min-width:34px; }
.guided-quest #questBossCard .boss-emblem img { max-height:34px; }
.guided-quest #timerWrap { padding:6px 10px; margin:8px 0; gap:8px; }
.guided-quest #timerWrap svg { width:30px; height:30px; }
.guided-quest #timerWrap .clock { font-size:24px; }
.guided-quest #timerWrap .lbl { font-size:10px; }
.guided-quest .tutorial-guide { padding:8px; margin:8px 0; }
.guided-quest .tutorial-guide .tutorial-copy p { margin:4px 0 6px; }
.guided-quest .tutorial-reference:not([open]) { display:inline-block; margin-top:4px; }
.guided-quest .photo-stage { min-height:80px; }
.debug-pressure,.rf-earned { color:#ffe096; background:#33223f; border:1px solid #8c679f; padding:8px; font:18px/1.3 var(--term); }
.item-scope,.store-tag.scope { color:#9ee8d4; }
.item-drawer .item-row { width:100%; text-align:left; font:inherit; color:var(--ink); cursor:pointer; }
.item-drawer .item-row:focus-visible { outline:3px solid var(--gold); outline-offset:3px; }
.finale-preference { padding:8px; border:1px solid #735294; }
.finale-preference label { display:flex; align-items:center; gap:8px; min-height:44px; font:18px/1.3 var(--term); }
.finale-preference input { width:20px; height:20px; }
.rf-stage { min-width:0; }
.rf-pattern { color:#a9d9ec; font:18px/1.3 var(--term); }
@media (orientation:landscape) and (max-height:500px) {
 body:has(.relic-fight) #app { max-width:940px; }
 body:has(.relic-fight) .arcade-cabinet { max-width:940px; }
 .relic-fight { display:grid; grid-template-columns:calc((100svh - 110px) * .9) minmax(180px,1fr); align-items:start; gap:10px 20px; scroll-margin-top:8px; }
 .rf-stage { grid-column:1; grid-row:1; }
 .rf-combat-hud { grid-column:2; grid-row:1; }
 .relic-fight > :not(.rf-stage):not(.rf-combat-hud) { grid-column:1/-1; }
 .rf-arena { width:100%; }
 .rf-power { width:112px; margin-bottom:0; }
 .rf-fan { height:45px; width:100px; }
 .rf-power label { font-size:18px; }
 .relic-fight h1 { margin:6px 0; }
 .rf-combat-hud .rf-hp,.rf-combat-hud .rf-player { margin:8px 0; }
 .rf-combat-hud #rfInstructions { margin:8px 0; }
 .rf-overlay { font-size:18px; padding:8px; }
}

/* Proof actions wrap inside narrow cards instead of being clipped. */
.quest-proof-actions { flex-wrap:wrap; }
.quest-proof-actions > .btn { flex:1 1 120px; min-width:0; white-space:normal; }

/* One full-health scale, from quest outcomes to the projectile finale. */
.shared-health-track,.hp-bar { position:relative; }
.shared-health-track progress { display:block;width:100%; }
.shared-health-marker { position:absolute;top:0;bottom:0;width:3px;background:#ffe39b;box-shadow:0 0 0 1px #261434;pointer-events:none; }
.shared-health-note { font:16px/1.2 var(--term);color:#ffde91;margin:5px 0; }
.shared-health-note span { display:block;color:#c9b4df;font-size:15px; }
.shared-health-panel { padding:10px;border:2px solid #705381;background:#180f27;margin:8px 0; }
.shared-health-panel strong { font:18px/1.3 var(--term);color:#ebd2f4; }
@media(max-height:500px) and (orientation:landscape){.rf-combat-hud .shared-health-note{font-size:14px;max-width:320px;}}

#questBossCard .shared-health-note {font-size:15px;margin:3px 0 0}#questBossCard .shared-health-note span {display:none}

.rf-combo {font:18px/1.15 var(--term);color:#b9ddf5;margin:5px 0;padding:4px 8px;border-left:3px solid currentColor;background:#171020;}
.rf-combo[data-tier="1"]{color:#91ead0}.rf-combo[data-tier="2"]{color:#f9d772}.rf-combo[data-tier="3"]{color:#ffab75}.rf-combo[data-tier="4"]{color:#ff7cac;text-shadow:0 0 8px #ff478970;box-shadow:inset 0 0 12px #ef46802b;animation:combo-glow 1.3s ease-in-out infinite alternate}
@keyframes combo-glow{to{box-shadow:inset 0 0 17px #ef468060}}
@media(prefers-reduced-motion:reduce){.rf-combo[data-tier="4"]{animation:none;text-shadow:none}}
@media(max-height:500px) and (orientation:landscape){.rf-combo{font-size:16px;padding:2px 6px;margin:3px 0}}

.rf-boss-damage{position:absolute;pointer-events:none;transform:translateX(-50%);z-index:2;color:#ffdc87;font-family:var(--term);text-shadow:2px 2px #160923;white-space:nowrap}

/* Combat artwork v1: fixed image boxes prevent help layout shifts. */
.rf-perk-art{display:inline-block;width:36px;height:36px;object-fit:contain;image-rendering:pixelated;vertical-align:middle;margin-right:8px;flex-shrink:0}
.rf-perk-list dt{display:flex;align-items:center;gap:0;min-height:36px}
