/* Build 350: a quiet supporting interface around the current action. */
.qm-details { border:1px solid #705681; background:#160e23; padding:0 12px; margin:12px 0; }
.qm-details > summary { padding:12px 0; min-height:44px; color:#d8c1ed; }
.qm-details[open] { padding-bottom:12px; }
.qm-details > summary:hover { color:#ffe09a; }
.qm-details p,.finale-section p { line-height:1.4; }
.finale-section { border:0; border-left:3px solid #725684; box-shadow:none; background:transparent; padding:8px 12px; margin:12px 0; }
.finale-section h2 { margin:0 0 6px; }
.finale-section p { margin:6px 0; }
.home-secondary .btn { box-shadow:2px 2px #080510; background:#20132f; }
.home-welcome .qm-host { box-shadow:none; }
.questmaster-reveal,.questmaster-generation { padding:10px 4px 18px; }
.questmaster-reveal h1 { margin:12px 0; }
.questmaster-reveal .qm-personality { margin:8px 0 12px; color:#d5bddf; }
.questmaster-reveal .actions { margin:14px 0; }
.boss-details .boss-detail { background:transparent; box-shadow:none; border-width:0 0 0 3px; padding:8px 12px; }
.boss-details .shared-health-panel { border:0; padding:0; background:none; }
.custom-setup .panel,.custom-setup .card { box-shadow:none; }
.custom-quest #questBossCard { border:1px solid #80618c; box-shadow:none; background:#1b1028; }
.custom-quest #questBossCard .boss-body { padding:10px!important; }
.custom-quest .step-card { box-shadow:none; }
.custom-quest .step-card .instr { line-height:1.4; }
.custom-quest .content-badge { background:transparent; border-color:transparent; }
.adventure:has(.result-primary) { padding:14px 8px 24px; }
.result-loot { box-shadow:none; }
.result-loot .earned-loot { border:0; border-left:3px solid var(--gold); }
.result-reward-breakdown { background:#1c1129; box-shadow:none; }
.result-secondary-actions .btn { border:2px solid #80639e; box-shadow:2px 2px #080510; }

/* Combat keeps the cabinet silhouette but shares one compact top row. */
body:has(.relic-fight) #app { max-width:620px; }
.arcade-cabinet:has(.relic-fight) { max-width:620px; padding:10px 12px 0; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; animation:none; }
.arcade-cabinet:has(.relic-fight) > .arcade-marquee { margin:0; align-self:center; min-height:44px; letter-spacing:1px; font-size:9px; padding:8px 4px; box-shadow:inset 0 -3px #703998; }
.arcade-cabinet:has(.relic-fight) > .top-bar { padding:0; margin:0; border:0; }
.arcade-cabinet:has(.relic-fight) .top-bar .brand-side,.arcade-cabinet:has(.relic-fight) .top-bar .pill { display:none; }
.arcade-cabinet:has(.relic-fight) .top-bar .stats { flex-wrap:nowrap; gap:3px; width:auto; }
.arcade-cabinet:has(.relic-fight) .top-bar .cog-btn { width:44px; height:44px; min-width:44px; }
.arcade-cabinet:has(.relic-fight) > .arcade-screen-wrap,.arcade-cabinet:has(.relic-fight) > nav,.arcade-cabinet:has(.relic-fight) > .arcade-controls { grid-column:1/-1; }
.arcade-cabinet:has(.relic-fight) > .arcade-screen-wrap { padding:4px; box-shadow:inset 0 0 0 1px #644381; }
.arcade-screen-wrap > .screen:has(.relic-fight) { padding:6px 4px 12px; }
.adventure:has(.relic-fight) { padding:0; }
.relic-fight { max-width:440px; margin:auto; }
.relic-fight h1 { font:12px/1.4 var(--px); color:#edcffb; margin:0 0 8px; }
.rf-combat-hud { padding:4px 0 8px; }
.rf-hp { font:18px/1.15 var(--term); }
.rf-player { grid-template-columns:auto 1fr; align-items:center; gap:8px; margin:6px 0 0; }
.rf-player progress { grid-column:2; grid-row:1; }
.rf-hud-bottom { min-height:25px; display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:6px; font:17px/1.15 var(--term); }
.relic-fight .rf-combo { margin:0; padding:2px 6px; font:18px/1.15 var(--term); }
#rfPressure { color:#d6bbef; text-align:right; }
.rf-stage { margin:0; }
.rf-arena { margin:0; }
.rf-power { margin-top:4px; margin-bottom:0; }
.rf-fan { width:112px; height:54px; }
.rf-power label { font-size:18px; }
.relic-fight .rf-cue { min-height:0; margin:6px 0; color:#ead392; font:19px/1.25 var(--term); }
.relic-fight .rf-effects { min-height:24px; margin:4px 0; font:18px/1.25 var(--term); }
.relic-fight .rf-name { margin:8px 0 4px; font:20px/1.2 var(--term); color:#ffe09a; }
.relic-fight #rfFeedback { font:19px/1.3 var(--term); margin:4px 0; color:#d9c6ef; }
.relic-fight .rf-weakness { font:18px/1.25 var(--term); margin:4px 0; color:#9fe8ce; }
.relic-fight #rfError:empty { display:none; }
.relic-fight .rf-details p { font:20px/1.35 var(--term); }
.relic-fight .rf-details .rf-earned { background:transparent; border:0; border-left:3px solid #8ccdae; padding:6px 10px; }
.relic-fight .rf-help-paused { color:#98efc5; }
.relic-fight .rf-details > summary { font:10px/1.5 var(--px); min-height:48px; }
.relic-fight #rfLeave,.relic-fight #rfTutorialHelp { min-height:44px; padding:10px; font-size:10px; }
.relic-fight #rfHelpResume { width:100%; }
.rf-relic:focus-visible { outline-color:#ffdc91; }
/* Longer instructions and help live below the aiming surface and cannot move it. */
@media(min-width:700px) and (min-height:501px) { .relic-fight { max-width:420px; } }
@media(orientation:landscape) and (max-height:500px) {
 body:has(.relic-fight) #app,.arcade-cabinet:has(.relic-fight) { max-width:940px; }
 .relic-fight { max-width:none; grid-template-columns:calc((100svh - 100px) * .9) minmax(180px,1fr); gap:8px 18px; }
 .rf-hud-bottom { flex-wrap:wrap; }
 .rf-combat-hud { padding:0; }
 .rf-combat-hud h1 { margin-top:0; }
 .rf-fan { height:45px; width:100px; }
 .relic-fight .rf-player { display:block; }
 .relic-fight .rf-player progress { display:block; margin-top:4px; }
}
@media(max-width:350px){.arcade-cabinet:has(.relic-fight){padding-inline:9px}.arcade-cabinet:has(.relic-fight) > .arcade-marquee{font-size:8px;letter-spacing:0}.relic-fight h1{font-size:11px}.rf-hud-bottom{gap:4px}}
/* A running clock stays readable; its urgent state retains the danger treatment. */
.custom-quest .timer-ring-wrap:not(.warn):not(.done) { border:1px solid #637f85; box-shadow:none; background:#141022; }
.custom-quest .timer-ring-wrap:not(.warn):not(.done) .clock { color:#ade6d8; text-shadow:none; }
.custom-quest .timer-ring-wrap { top:8px; }
.custom-quest .step-card .instr { color:#e3d3ee; }
/* Reward names stay visible; long inventory descriptions are optional. */
.earned-item-details { margin:6px 0; font:18px/1.3 var(--term); }
.earned-item-details summary { cursor:pointer; display:list-item; min-height:44px; padding:9px 10px; color:#d9c1ed; border:1px solid #725785; background:#20142f; }
.earned-item-details summary:focus-visible { outline:3px solid #ffdd91; outline-offset:3px; }
.earned-item-details p { text-align:left; }
.earned-item { align-items:flex-start; text-align:left; }
.earned-item > img,.earned-item > .earned-icon { margin-top:3px; }
.earned-item > div { min-width:0; flex:1; }
#resultBag { width:auto; min-height:44px; font-size:10px; padding:9px 12px; border:1px solid #8d71a7; box-shadow:2px 2px #090511; }

/* Keep the decorative base within a short landscape phone viewport. */
@media (orientation:landscape) and (max-height:500px) {
  .arcade-pedestal { width:100%; max-width:100%; margin-left:0; margin-right:0; }
  .arcade-cabinet { width:calc(100% - 16px); }
}

/* Reward portraits are square artwork, not expanding text columns. */
.earned-item > .avatar { flex:0 0 64px; width:64px; height:64px; min-width:64px; aspect-ratio:1; }
.earned-item > .avatar > img { object-fit:contain; }
.ar-boss-stage { min-height:150px; overflow:hidden; touch-action:manipulation; }
.ar-boss-anchor,.ar-boss-sprite,.ar-boss-sprite * { user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; touch-action:manipulation; }
.ar-boss-emoji { width:clamp(88px,24vw,140px); height:clamp(88px,24vw,140px); font-size:clamp(78px,22vw,124px); }
.ar-combo-chip { top:220px; right:12px; pointer-events:none; }
.ar-finisher-modal .ar-hud { padding-right:42px; }
.ar-finisher-modal .ar-tap-hint { font:18px/1.2 var(--term); letter-spacing:0; }
.ar-finisher-modal.ar-tint-4::before,.ar-finisher-modal.ar-tint-3::before { opacity:.18; }
@media (orientation:landscape) and (max-height:500px) {
 .ar-finisher-modal .ar-hud { max-width:48%; } .ar-finisher-modal .ar-timer { position:absolute;right:60px;top:24px;font-size:20px; }
 .ar-combo-chip {top:70px;right:14px;} .ar-boss-stage {min-height:80px;} .ar-boss-emoji {width:80px;height:80px;font-size:74px;}
}
.help-recovery {display:flex;flex-wrap:wrap;gap:8px;padding:10px 16px;}
.help-recovery .btn {flex:1;min-width:130px;font-size:10px;min-height:44px;}

.ar-finisher-modal.ar-tint-3 .ar-scrim,.ar-finisher-modal.ar-tint-4 .ar-scrim {background:linear-gradient(180deg,rgba(50,10,35,.55),transparent 40%,rgba(50,10,35,.5));animation:none;}
.ar-finisher-modal.ar-windup .ar-windup-vignette {box-shadow:inset 0 0 65px 15px rgba(255,40,75,.55);animation:none;}
@media (prefers-reduced-motion:reduce){.ar-heartbeat,.ar-boss-sprite,.ar-enrage-banner,.ar-combo-tierup{animation:none!important;}}
