/* Original retro field + central portrait + dialogue. Scoped to MASTER presentation. */
.master-battle{margin:12px 0 16px;min-width:0;color:#fff;font-family:"Hiragino Maru Gothic ProN","Yu Gothic","Noto Sans JP",Meiryo,sans-serif}
.quiz:not(.master-battle-intro)>.master-battle{margin:8px 0 12px}
.quiz:has(>.master-battle)>.topline{margin-bottom:6px}
.quiz:has(>.master-battle)>progress{margin:6px 0 8px}
.master-battle-heading{display:flex;align-items:baseline;justify-content:center;flex-wrap:wrap;gap:4px 14px;padding:6px 10px;background:#16283c;color:#fff;line-height:1.5;text-align:center}
.master-battle-heading strong{font-size:19px}.master-battle-heading span{font-size:14px}
.master-battle-field{position:relative;display:flex;align-items:center;justify-content:center;height:142px;min-width:0;background:#73aab9 var(--battle-field) center bottom/100% 100% no-repeat;image-rendering:pixelated;overflow:hidden}
.master-battle-frame{position:relative;display:flex;align-items:center;justify-content:center;width:180px;height:128px;max-width:80%;border:3px solid #fff;background:linear-gradient(#173b51e8,#193b2ff0);box-shadow:0 0 0 2px #112537;box-sizing:border-box;overflow:hidden;image-rendering:auto}
.master-battle .master88-portrait{margin:0;width:100%;height:100%;padding:8px;min-width:0;min-height:0;overflow:hidden;animation:none!important}
.master-battle .master88-portrait img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center;filter:drop-shadow(0 3px 2px #0005);animation:none}
.master-battle .master88-fallback{padding:8px;color:#fff;font-size:16px;text-align:center;line-height:1.5}
.master-battle[data-battle-state="entrance"] img{animation:battle-arrive .28s ease-out}
.master-battle[data-battle-state="correct"] img{animation:battle-nod .28s ease-out}
.master-battle[data-battle-state="incorrect"] img{animation:battle-think .28s ease-out}
.master-battle[data-battle-state="cleared"] img{animation:battle-arrive .28s ease-out}
@keyframes battle-arrive{from{opacity:.5;transform:scale(.94)}to{opacity:1;transform:scale(1)}}
@keyframes battle-nod{50%{transform:translateY(2px)}}@keyframes battle-think{30%{transform:translateX(-2px)}70%{transform:translateX(2px)}}
@media(prefers-reduced-motion:reduce){.master-battle .master88-portrait img{animation:none!important}}
.master-battle-dialogue{position:relative;box-sizing:border-box;min-height:64px;padding:12px 18px;background:#090b10;color:#fff;border:3px solid #fff;border-radius:5px;outline:2px solid #14283b;box-shadow:inset 0 0 0 2px #090b10;text-align:left;line-height:1.6}
.master-battle-dialogue p,.master-battle-text{display:block;margin:0;color:#fff;font-size:18px;font-weight:600;overflow-wrap:anywhere}
.master-battle-advance{display:block;width:100%;font:inherit;cursor:pointer;touch-action:manipulation}
.master-battle-advance:focus-visible{outline:3px solid #ffda6e;outline-offset:3px}.master-battle-advance:hover{background:#151b24}
.master-battle-text{min-height:3.2em}.master-battle-help{display:block;margin-top:8px;font-size:14px;font-weight:400;line-height:1.6;color:#e0e9f3;text-align:right}
.master-battle-accessible{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.master-battle-opening .master-battle-field{height:310px}.master-battle-opening .master-battle-frame{width:280px;height:284px}
.master-battle-opening .master-battle-dialogue{min-height:146px;padding:18px 24px}.master-battle-opening .master-battle-dialogue p,.master-battle-opening .master-battle-text{font-size:22px}
@media(max-width:600px){.master-battle-heading{gap:2px 8px}.master-battle-heading strong{font-size:18px}.master-battle-heading span{font-size:13px}.master-battle-field{height:130px}.master-battle-frame{height:116px;width:164px}.master-battle-dialogue{padding:10px 12px;min-height:62px}.master-battle-dialogue p{font-size:18px}.master-battle-opening .master-battle-field{height:270px}.master-battle-opening .master-battle-frame{height:244px;width:236px}.master-battle-opening .master-battle-dialogue{padding:16px;min-height:154px}.master-battle-opening .master-battle-dialogue p{font-size:20px}}
@media(max-height:800px) and (min-width:800px){.master-battle-field{height:144px}.master-battle-frame{height:130px;width:182px}.master-battle-heading{padding:3px 8px}.master-battle-opening .master-battle-field{height:250px}.master-battle-opening .master-battle-frame{height:226px;width:240px}}
/* A long poem and the four vertical choices share the available tablet width.
   Keep every existing question/choice font size; only their placement changes. */
@media(min-width:700px) and (max-width:899px){
 .quiz.master-quiz .iroha-question-panel,.quiz.master85-quiz .iroha-question-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px 18px;padding:20px}
 .quiz.master-quiz .iroha-question-panel>.eyebrow,.quiz.master85-quiz .iroha-question-panel>.eyebrow{grid-column:1/-1}
 .quiz.master-quiz .iroha-question-panel>.choices,.quiz.master85-quiz .iroha-question-panel>.choices{align-self:start}
}
