/* One line of speech; full question and choices share one natural-height foreground. */
.master-single-stage .single-ui{position:absolute;inset:0;z-index:2;pointer-events:none;color:#fff}
.master-single-stage .single-ui button,.master-single-stage .single-ui a,.master-single-stage .single-ui select,.master-single-stage .single-ui summary,.master-single-stage .single-content{pointer-events:auto;touch-action:manipulation}
.master-single-stage .single-top{position:absolute;left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));top:max(8px,env(safe-area-inset-top));display:flex;align-items:center;gap:8px;height:52px}
.master-single-stage .single-top .topline{display:flex;gap:6px;flex:none;margin:0}
.master-single-stage .single-top .btn{min-height:44px;padding:7px 10px;background:#081322e6;color:#fff;border:2px solid #eff7ff;border-radius:6px;font-size:15px;line-height:1.3}
.master-single-stage .single-top .topline button:not(#home){display:none}
.master-single-stage .single-dialogue{display:flex;align-items:center;gap:6px;flex:1;min-width:0;min-height:48px!important;height:48px!important;margin:0!important;padding:8px 12px!important;border:2px solid #fff;outline:0;box-shadow:none;background:rgba(4,9,17,.88);color:#fff;border-radius:6px;text-align:left}
.master-single-stage .single-dialogue .master-battle-text{display:block;flex:1;min-width:0;min-height:0;white-space:pre;font-size:22px;line-height:1.3;font-weight:700;letter-spacing:0}
.master-single-stage .single-dialogue-arrow{flex:none;font-size:24px;line-height:1;color:#ffeaa7}
.master-single-stage .single-content{position:absolute;left:50%;right:auto;transform:translateX(-50%);width:calc(100% - 32px);max-width:1300px;bottom:max(12px,env(safe-area-inset-bottom));min-height:0;color:#fff}
.master-single-stage .single-question-content{display:flex;flex-direction:column;gap:8px}
.master-single-stage .single-question-content>.panel{display:block!important;margin:0!important;padding:10px 14px!important;min-width:0;background:rgba(5,14,27,.83)!important;color:#fff;border:2px solid #e9f2fa!important;border-radius:8px;box-shadow:none!important;flex:none}
.master-single-stage .single-question-content .question{margin:4px 0!important;font-size:28px;line-height:1.45;text-align:center;color:#fff;overflow-wrap:anywhere}
.master-single-stage .single-choices{display:flex!important;flex-direction:column;gap:8px!important;background:none!important;margin:0!important;padding:0!important;flex:none}
.master-single-stage .single-choices .choice{position:relative;display:flex;align-items:center;min-height:54px;width:100%;padding:8px 14px;font-size:22px!important;line-height:1.4;background:rgba(5,14,27,.8);color:#fff;border:2px solid #d6e4ed;border-radius:8px;text-align:center;box-shadow:none;overflow-wrap:anywhere;opacity:1}
.master-single-stage .single-choices .choice b{position:absolute;left:12px;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:30px;height:30px;min-width:30px;font-size:18px;margin:0;color:#122b3d;background:#f1f7fa;border-radius:50%}
.master-single-stage .single-choices .choice span{flex:1;min-width:0;padding:0 36px;text-align:center}
.master-single-stage .single-choices .choice.selected,.master-single-stage .single-choices .choice:focus-visible{outline:3px solid #ffe487;outline-offset:-3px;border-color:#ffe487;background:rgba(23,41,61,.85);box-shadow:inset 6px 0 0 #ffe487}
.master-single-stage .single-choices .choice:hover{border-color:#ffe487}
.master-single-stage .single-question-content .iroha-before{margin:0 0 6px;padding:6px 10px;background:rgba(12,30,40,.75);color:#fff;border-color:#c8dce8}
.master-single-stage .single-question-content .iroha-song-label{margin:0 0 3px;font-size:16px;color:#fff}
.master-single-stage .single-question-content .iroha-original{font-size:21px;line-height:1.45;margin:4px 0;padding:0;color:#fff;text-align:center;border:0}
.master-single-stage .single-question-content .iroha-reading{font-size:16px;margin:2px 0;color:#fff}
.master-single-stage .single-question-content .iroha-reading summary,.master-single-stage .single-question-content .iroha-reading p{color:#fff}
.master-single-stage .single-question-content .iroha-recall-note{font-size:16px;margin:3px 0;color:#fff}
.master-single-stage .single-question-content rt{font-size:.5em}
.master-single-stage .single-scroll-needed{overflow-y:auto;overscroll-behavior:contain;padding:2px;scrollbar-color:#c8dce8 #10203199}
.master-single-stage[data-single-density="compact"] .single-question-content{gap:6px}
.master-single-stage[data-single-density="compact"] .single-question-content>.panel{padding:7px 12px!important}
.master-single-stage[data-single-density="compact"] .single-question-content .question{font-size:26px;line-height:1.35}
.master-single-stage[data-single-density="compact"] .single-choices .choice{min-height:50px;padding:6px 12px;line-height:1.35}
.master-single-stage[data-single-density="compact"] .single-choices{gap:6px!important}
.master-single-stage[data-single-density="dense"] .single-question-content{gap:6px}
.master-single-stage[data-single-density="dense"] .single-question-content>.panel{padding:6px 10px!important}
.master-single-stage[data-single-density="dense"] .single-question-content .question{font-size:22px;line-height:1.3}
.master-single-stage[data-single-density="dense"] .single-choices .choice{font-size:20px!important;line-height:1.3;min-height:44px;padding:6px 10px}
.master-single-stage[data-single-density="dense"] .single-choices{gap:6px!important}
.master-single-stage[data-single-density="dense"] .single-question-content .iroha-original{font-size:19px;line-height:1.3}
.master-single-stage[data-single-density="dense"] .single-question-content .iroha-before{padding:4px 8px;margin-bottom:4px}
.master-single-stage .single-feedback-content{top:max(34%,var(--single-reading-top,210px));display:flex;flex-direction:column;gap:8px}
.master-single-stage .single-feedback-head{flex:none;background:rgba(5,14,27,.88);padding:10px 14px;border:2px solid #e9f2fa;border-radius:8px;display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center}
.master-single-stage .single-feedback-head .feedback{font-size:26px;margin:0;padding:0;color:#fff;background:none;border:0}
.master-single-stage .single-feedback-head h2{grid-column:1/-1;grid-row:2;font-size:22px;line-height:1.4;margin:0;color:#fff;overflow-wrap:anywhere}
.master-single-stage .single-feedback-head #next{grid-column:2;grid-row:1;min-height:48px;font-size:20px;padding:8px 14px;white-space:normal}
.master-single-stage .single-explanation,.master-single-stage .single-information{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:2px;scrollbar-color:#c8dce8 #10203199}
.master-single-stage .single-explanation .panel,.master-single-stage .single-information .panel{background:rgba(5,14,27,.85)!important;color:#fff;border-color:#e9f2fa!important;box-shadow:none!important;padding:14px!important;margin:0}
.master-single-stage .single-explanation p,.master-single-stage .single-information p{color:#fff;font-size:18px;line-height:1.7;overflow-wrap:anywhere}
.master-single-stage .single-explanation h2,.master-single-stage .single-explanation h3,.master-single-stage .single-information h1,.master-single-stage .single-information h2{color:#fff}
.master-single-stage .single-explanation .iroha-after,.master-single-stage .single-explanation .iroha-meaning,.master-single-stage .single-explanation .iroha-life,.master-single-stage .single-explanation .discovery-mini{background:rgba(12,30,40,.86);color:#fff;border-color:#c8dce8}
.master-single-stage .single-explanation .iroha-original,.master-single-stage .single-explanation .iroha-reading summary{color:#fff}
.master-single-stage .single-explanation .choices{display:flex!important;flex-direction:column;gap:6px;margin-top:12px}
.master-single-stage .single-explanation .choice{font-size:20px;background:#0b1d2ce0;color:#fff;border-color:#c8dce8;opacity:1;text-align:left;padding:10px;min-height:44px}
.master-single-stage .single-explanation .choice.is-correct{border:2px solid #8dffb7}.master-single-stage .single-explanation .choice.is-wrong{border:2px solid #ffacac}
.master-single-stage .single-explanation .choice em{display:block;color:#bdffd3;font-size:16px}
.master-single-stage .single-information{top:36%;background:transparent}
.master-single-stage .single-information>h1,.master-single-stage .single-information>.eyebrow{background:#081522e6;padding:8px;color:#fff;margin:0}
.master-single-stage .single-information .score{color:#ffe393}
.master-single-stage .single-information .final85-rewards{background:rgba(40,31,10,.86);color:#fff8db;border-color:#f1d17f}
.master-single-stage .single-information .notice{color:#fff;background:#3d2c17}
.master-single-stage .single-information .btn{min-height:44px;font-size:18px;white-space:normal}
@media(max-width:899px),(orientation:portrait){.master-single-stage .single-question-content .question{font-size:26px}.master-single-stage .single-content{width:calc(100% - 24px)}}
@media(max-width:600px){.master-single-stage .single-top{left:8px;right:8px;gap:6px}.master-single-stage .single-top .btn{font-size:12px;padding:6px;min-width:44px}.master-single-stage .single-dialogue{padding:6px 8px!important}.master-single-stage .single-dialogue .master-battle-text{font-size:20px}.master-single-stage .single-content{width:calc(100% - 16px)}.master-single-stage .single-question-content .question{font-size:24px}.master-single-stage .single-choices .choice{font-size:20px!important}.master-single-stage .single-feedback-head{padding:8px}.master-single-stage .single-feedback-head #next{font-size:17px;padding:6px 8px}.master-single-stage .single-feedback-head .feedback{font-size:22px}}
.master-single-stage .single-ui .panel{animation:none!important;transform:none!important;opacity:1!important}
.master-single-stage .single-choices{align-self:stretch!important;width:100%;min-width:0}
.master-single-stage .single-question-content .staged-hint{margin:4px 0 0}
.master-single-stage .single-question-content .staged-hint>.btn{min-height:44px;padding:5px 10px;font-size:16px}
/* Optional existing hints stay available without taking space from the required question. */
.master-single-stage .single-hint-tools{position:absolute;top:70px;right:max(16px,env(safe-area-inset-right));z-index:5;margin:0}
.master-single-stage .single-hint-tools>.btn{min-height:44px;padding:5px 10px;font-size:16px;background:#102337e8;color:#fff;border-color:#e9f2fa}
.master-single-stage .single-hint-tools #hint-content{position:absolute;right:0;top:42px;width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 144px);overflow-y:auto;overscroll-behavior:contain;background:#0b1b2cf5;color:#fff;border:2px solid #e9f2fa;padding:12px;box-shadow:0 4px 16px #0008}
.master-single-stage .single-hint-tools .hint-step,.master-single-stage .single-hint-tools .hint-text,.master-single-stage .single-hint-tools p{color:#fff}
.master-single-stage .single-hint-tools .hint-close{position:sticky;bottom:0;margin-top:8px}
.master-single-stage .single-hint-tools{pointer-events:auto}
.master-single-stage .single-explanation .card-point{background:#162c3be8;color:#fff;border-color:#bbd3a5}
.master-single-stage .single-explanation .discovery-mini .eyebrow,.master-single-stage .single-explanation .card-actions small{color:#e2edcf}
/* Keep the finished line centered and reserve its width while characters are revealed. */
.master-single-stage .single-dialogue{position:relative;gap:0;padding-left:32px!important;padding-right:32px!important;text-align:center}
.master-single-stage .single-dialogue-copy{display:flex;justify-content:center;flex:1;min-width:0}
.master-single-stage .single-dialogue .master-battle-text{flex:none;max-width:100%;text-align:left}
.master-single-stage .single-dialogue-arrow{position:absolute;right:12px;top:50%;transform:translateY(-50%)}
/* Explicit foreground/background pairs prevent legacy light panels inheriting white text. */
.master-single-stage .single-information .master-result-msg,
.master-single-stage .single-information>p{background:#102337;color:#fff;border:1px solid #d9e6f2;border-radius:8px;padding:8px 12px}
.master-single-stage .single-information .final89-checklist li{background:#102337;color:#fff;border:1px solid #d9e6f2}
.master-single-stage .single-information>.score{background:#102337;border-radius:8px}
.master-single-stage .single-information>details{background:#102337;color:#fff;border:1px solid #d9e6f2;border-radius:8px;padding:8px 12px}
.master-single-stage .single-information>details>summary{color:#fff}
/* Only the locked training card is smaller so its question mark stays above the guide. */
.master-single-stage[data-layer-mode="training"] .master89-mystery{height:24vh;height:24dvh}
