/* Readable battle: spend height on cards, portraits and actions, not an empty choice row. */
#cardGameScreen .nq { max-width: 600px; margin-inline: auto; }
.nq .nq-battle-waza {
 grid-template-rows: 28px 112px minmax(150px, 1fr) 112px 64px 58px !important;
 gap: 6px; padding: 6px; border-radius: 18px;
}
.nq .nq-battle-waza .nq-battle-heading { gap: 2px; flex-wrap: nowrap; }
.nq .nq-battle-waza .nq-battle-heading .nq-score { font-size: 12px; line-height: 1.15; }
.nq .nq-battle-waza .nq-battle-heading button { font-size: 11px; min-height: 28px; padding: 2px 4px; }
.nq .nq-battle-waza .nq-side {
 grid-template-columns: 78px minmax(0,1fr) 52px;
 grid-template-rows: 22px 19px 24px 31px;
 gap: 2px 5px; padding: 4px 6px; height: 112px; box-sizing: border-box;
}
.nq .nq-battle-waza .nq-who { grid-row: 1 / 5; width: 78px; max-height: none; align-self: center; font-size: 12px; line-height: 1.15; overflow: visible; }
.nq .nq-battle-waza .nq-who .nq-portrait { display:block; width:64px; height:64px; margin:0 auto 2px; flex-basis:64px; object-fit:contain; background:transparent; border:0; border-radius:0; padding:0; box-shadow:none; filter:drop-shadow(0 0 6px #ffdf8990); }
.nq .nq-battle-waza .nq-total { font-size: 38px; line-height: 1; }
.nq .nq-battle-waza .nq-rest { font-size: 13px; }
.nq .nq-battle-waza .nq-dots { font-size: 12px; }
.nq .nq-battle-waza .nq-table-hand,.nq .nq-battle-waza .nq-table-hand:has(>span) { grid-column:2/4; height:31px; gap:3px; }
.nq .nq-battle-waza .nq-table-hand>small { font-size:10px; }
.nq .nq-battle-waza .nq-table-hand:has(.nq-played-card)>small { display:none; }
.nq .nq-battle-waza .nq-played-card .nq-card { width:21px; height:29px; }
.nq .nq-battle-waza .nq-played-card small { font-size:10px; }
.nq .nq-battle-waza .nq-center,.nq .nq-battle-waza .nq-center.nq-has-draw {
 position:relative; grid-template-columns:minmax(0,1.12fr) minmax(0,.88fr);
 grid-template-rows:minmax(0,1fr); padding:6px; column-gap:8px; isolation:isolate;
}
.nq .nq-battle-waza .nq-drawn,.nq .nq-battle-waza .nq-has-draw .nq-drawn { position:relative; min-width:0; max-width:100%; overflow:visible; }
.nq .nq-battle-waza .nq-drawn .nq-card-draw { height:min(100%,300px); width:auto; max-width:100%; max-height:100%; aspect-ratio:5/7; }
.nq .nq-battle-waza .nq-draw-detail { gap:8px; padding:2px; overflow-wrap:anywhere; }
.nq .nq-battle-waza .nq-draw-detail .nq-draw-owner { font-size:13px; line-height:1.35; padding:5px; }
.nq .nq-battle-waza .nq-draw-name { font-size:15px; line-height:1.35; }
.nq .nq-battle-waza .nq-draw-equation { font-size:22px; line-height:1.3; margin:0; }
.nq .nq-battle-waza .nq-msg { font-size:14px; line-height:1.4; }
.nq .nq-battle-waza .nq-original-number { font-size:54px; line-height:1; color:#233b60; }
.nq .nq-battle-waza .nq-draw-original { margin:0; font-size:14px; }
.nq .nq-battle-waza .nq-ctl.nq-choice-overlay {
 position:absolute; z-index:8; left:50%; bottom:5%; transform:translateX(-50%);
 display:grid; width:max(100%,164px); max-width:calc(100vw - 50px); height:auto;
 grid-template-rows:auto auto; gap:6px; padding:8px; box-sizing:border-box;
 border:2px solid #fff2bd; border-radius:14px; background:#142b50e8;
 box-shadow:0 3px 12px #14243a66;
}
.nq .nq-battle-waza .nq-choice-overlay .nq-ask { color:white; font-size:15px; line-height:1.25; margin:0; text-align:center; }
.nq .nq-battle-waza .nq-choice-overlay .nq-choice { gap:6px; }
.nq .nq-battle-waza .nq-choice-overlay .nq-choice .nq-btn { height:48px; min-height:48px; font-size:28px; padding:3px; border-radius:10px; }
.nq .nq-battle-waza .nq-choice-overlay:has(.nq-choice-three) { width:max(100%,186px); }
.nq .nq-battle-waza .nq-slot { position:relative; min-height:64px; max-height:none; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:2px; padding:4px; overflow:hidden; }
.nq .nq-battle-waza .nq-slot b { font-size:26px; line-height:1; }
.nq .nq-battle-waza .nq-slot small { font-size:12px; line-height:1.25; white-space:normal; text-align:center; }
.nq .nq-battle-waza .nq-slot .nq-card { width:24px; height:34px; position:absolute; top:3px; left:3px; opacity:.9; }
.nq .nq-battle-waza .nq-slot:has(.nq-card) { padding-left:26px; }
.nq .nq-battle-waza .nq-used-label { font-size:10px; color:#534f61; }
.nq .nq-battle-waza .nq-slot.nq-used { background:#e1e3eb; border-style:dashed; }
.nq .nq-battle-waza .nq-auto-tag { position:static; font-size:10px; padding:0 3px; line-height:1.2; }
.nq .nq-battle-waza .nq-acts button { min-height:58px; font-size:18px; line-height:1.2; padding:4px 3px; }
.nq .nq-battle-waza .nq-acts button small { font-size:11px; }
.nq .nq-battle-waza .nq-turn-controls { min-height:58px; }
.nq .nq-battle-waza .nq-center[data-presentation=card] .nq-ability-notice { display:none; }
/* Selection and the rulebook may scroll. Never clip the only start/back buttons. */
body:has(#cardGameScreen .nq-pickwrap),body:has(#cardGameScreen .nq-rulebook) { overflow-y:auto !important; height:auto !important; }
#cardGameScreen:has(.nq-pickwrap),#cardGameScreen:has(.nq-rulebook),
#cardGameScreen .nq:has(>.nq-pickwrap),#cardGameScreen .nq:has(>.nq-rulebook) {
 height:auto !important; max-height:none !important; min-height:0 !important; overflow:visible !important;
}
.nq .nq-pickwrap { margin-top:8px; margin-bottom:24px; padding-bottom:18px; }
.nq .nq-level-menu { gap:12px; }
.nq .nq-level-menu .nq-level-button { min-height:76px; }
.nq .nq-rulebook-open { width:100%; min-height:48px; background:#e5f4ff; color:#18304e; border:2px solid #8ab4d5; }
.nq .nq-rulebook { padding:16px 12px 30px; background:#fef9eb; color:#193754; border:2px solid #dab763; border-radius:18px; }
.nq .nq-rulebook h2 { font-size:24px; margin:4px 0 18px; text-align:center; }
.nq .nq-rulebook section { padding:12px 4px; border-top:1px solid #d8cda9; }
.nq .nq-rulebook h3 { font-size:21px; margin:0 0 8px; }
.nq .nq-rulebook p { font-size:18px; line-height:1.7; margin:0; white-space:pre-line; }
.nq .nq-rulebook button { width:100%; min-height:52px; margin-top:18px; font-size:18px; }
.nq .nq-ability-confirm { max-height:calc(100dvh - 28px); overflow-y:auto; }
@media(max-height:720px) {
 .nq .nq-battle-waza { grid-template-rows:26px 88px minmax(114px,1fr) 88px 56px 52px !important; gap:4px; padding:4px; }
 .nq .nq-battle-waza .nq-side { height:88px; grid-template-columns:66px minmax(0,1fr) 44px; grid-template-rows:17px 17px 18px 23px; padding:3px 5px; gap:1px 4px; }
 .nq .nq-battle-waza .nq-who { width:66px; font-size:10px; }
 .nq .nq-battle-waza .nq-who .nq-portrait { width:52px; height:52px; }
 .nq .nq-battle-waza .nq-total { font-size:32px; }
 .nq .nq-battle-waza .nq-table-hand,.nq .nq-battle-waza .nq-table-hand:has(>span) { height:23px; }
 .nq .nq-battle-waza .nq-played-card .nq-card { width:16px; height:22px; }
 .nq .nq-battle-waza .nq-rest,.nq .nq-battle-waza .nq-dots { font-size:11px; }
 .nq .nq-battle-waza .nq-slot { min-height:56px; }
 .nq .nq-battle-waza .nq-slot b { font-size:24px; }
 .nq .nq-battle-waza .nq-slot small { font-size:11px; }
 .nq .nq-battle-waza .nq-acts button { min-height:52px; font-size:16px; }
 .nq .nq-battle-waza .nq-draw-name { font-size:13px; }
 .nq .nq-battle-waza .nq-draw-equation { font-size:18px; }
 .nq .nq-battle-waza .nq-draw-detail .nq-draw-owner { font-size:11px; }
}

#cardGameScreen.integrated-quest-screen .nq-battle-waza .nq-drawn>.nq-card-draw { width:100%;height:100%;max-width:100%;max-height:100%;aspect-ratio:5/7; }
.nq .nq-battle-waza .nq-drawn,.nq .nq-battle-waza .nq-has-draw .nq-drawn { justify-self:center;align-self:center; }
.nq .nq-battle-waza .nq-who { display:block; }
.nq .nq-battle-waza .nq-slot-icons { margin:0; }
@media(max-height:720px){.nq .nq-battle-waza .nq-who .nq-portrait{flex-basis:52px;min-height:0;}}

#cardGameScreen .nq-ability-confirm > .nq-card-draw { width:140px; height:196px; max-width:45vw; max-height:28dvh; margin-inline:auto; }
.nq .nq-ability-confirm .nq-attack-explanation { font-size:16px; line-height:1.55; }

.nq .nq-battle-waza .nq-portrait-name { display:block;white-space:pre-line;text-wrap:balance;line-height:1.15; }
.nq .nq-battle-waza .nq-slot:has(.nq-card) { padding-left:4px; }
.nq .nq-battle-waza .nq-slot .nq-card { width:18px;height:25px; }
.nq .nq-battle-waza .nq-used-label { line-height:11px; }

.nq .nq-battle-waza .nq-center.nq-has-draw[data-draw-side="c"] { grid-template-columns:minmax(0,.88fr) minmax(0,1.12fr); }

/* The confirmed effect already has its own readable dialog; do not leave a fading duplicate over the card. */
.nq .nq-battle-waza .nq-ability-notice { display:none; }
.nq .nq-battle-waza .nq-draw-equation { white-space:nowrap; }

/* A very short visible viewport gets a scroll fallback rather than unreachable controls. */
@media(max-height:560px) {
 body:has(#cardGameScreen .nq-battle-waza) { height:auto !important;overflow-y:auto !important; }
 #cardGameScreen:has(.nq-battle-waza),#cardGameScreen .nq:has(>.nq-battle-waza) { height:auto !important;max-height:none !important;overflow:visible !important; }
 .nq .nq-battle-waza { height:auto !important;max-height:none !important;grid-template-rows:26px 88px 180px 88px 56px 52px !important;overflow:visible; }
}

/* Tournament headings must not size the entire battle's implicit grid column. */
.nq .nq-battle-waza { grid-template-columns:minmax(0,1fr); }
.nq .nq-battle-waza > * { min-width:0; }
.nq .nq-battle-waza .nq-battle-heading { display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:4px;min-width:0;max-width:100%; }
.nq .nq-battle-waza .nq-battle-heading .nq-score { white-space:normal;min-width:0;overflow-wrap:anywhere; }
.nq .nq-battle-waza[data-tournament="true"] { grid-template-rows:42px 112px minmax(150px,1fr) 112px 64px 58px !important; }
.nq .nq-battle-waza[data-tournament="true"] .nq-battle-heading button { min-height:36px;min-width:52px;font-size:12px; }
@media(max-height:720px){.nq .nq-battle-waza[data-tournament="true"]{grid-template-rows:42px 88px minmax(114px,1fr) 88px 56px 52px!important;}}
@media(max-height:560px){.nq .nq-battle-waza[data-tournament="true"]{grid-template-rows:42px 88px 180px 88px 56px 52px!important;}}
/* A compact tournament board with a clear route to the next opponent. */
body:has(#cardGameScreen .nq-bracket-screen) #screenTitle { display:none; }
.nq .nq-bracket-screen { background:radial-gradient(ellipse at 50% 0,#34528a,#202344 65%,#171e38);padding:12px 9px;gap:8px;border:2px solid #e9c46c;box-shadow:inset 0 0 0 3px #ffffff0b,0 5px 0 #17233a;color:#fff4d0; }
.nq .nq-cup-header { display:flex;align-items:center;justify-content:center;gap:10px;min-height:52px;padding-bottom:8px;border-bottom:1px solid #f3cc6a66; }
.nq .nq-cup-mark { font-size:34px;line-height:1;filter:drop-shadow(0 2px 5px #ffd76766); }
.nq .nq-cup-header h2 { font-size:25px;line-height:1.2;color:#fff0bb;text-shadow:0 2px 1px #07112c; }
.nq .nq-cup-header p { font-size:12px;margin-top:3px;color:#c6d7ee; }
.nq .nq-bracket { gap:10px;padding:4px 0; }
.nq .nq-bracket-round h3 { display:grid;place-items:center;margin:0 0 7px;min-height:28px;border-radius:7px;background:#ffffff0b;border:1px solid #879bc044;font-size:10px;line-height:1.3;color:#c8d9f1; }
.nq .nq-bracket-round[data-active="true"] h3 { background:#f3cc6c;color:#263451;border-color:#ffe99e;font-weight:800; }
.nq .nq-bracket-games { height:344px;gap:6px; }
.nq .nq-bracket-entrant { min-height:36px;padding:3px 2px;gap:3px;border:1px solid #c8d9ff30;background:#ffffff10;border-radius:7px; }
.nq .nq-bracket-entrant span { font-size:10px;line-height:1.2; }
.nq .nq-bracket-entrant .nq-portrait { width:24px;max-width:24px;height:30px;flex-basis:24px; }
.nq .nq-bracket-player { outline:2px solid #84d7ff;outline-offset:0;background:#3774a844; }
.nq .nq-bracket-winner { color:#37270c;background:linear-gradient(#fff1bb,#f3cf76);border-color:#fff1ad;font-weight:800; }
.nq .nq-bracket-loser { opacity:.48; }
.nq .nq-bracket-lines path { stroke:#7e91b5;stroke-width:2; }
.nq .nq-bracket-lines .nq-bracket-line-won { stroke:#ffda79;stroke-width:3; }
.nq .nq-bracket-next { display:flex;align-items:center;gap:8px;padding:7px 9px;border:1px solid #ffdb8166;background:#ffffff0d;border-radius:12px;min-height:54px;box-sizing:border-box; }
.nq .nq-bracket-next .nq-portrait { width:40px;height:42px;flex:0 0 40px;object-fit:contain; }
.nq .nq-bracket-next div { display:grid;gap:3px;min-width:0; }
.nq .nq-bracket-next small { font-size:11px;color:#c6d7ee; }
.nq .nq-bracket-next strong { font-size:14px;line-height:1.3; }
.nq .nq-next-stage { margin-left:auto;max-width:74px;text-align:center;font-size:10px;color:#ffe39a;line-height:1.4; }
.nq .nq-bracket-status { color:#ffdc88;font-size:14px;line-height:1.3; }
.nq .nq-bracket-screen > .nq-btn-main { min-height:46px;background:linear-gradient(#ffe9a6,#eab644);color:#352812;border-color:#ffe7a2; }
.nq .nq-bracket-screen > .nq-link { min-height:30px;color:#d0e1f5; }
.nq .nq-bracket-screen:has(.nq-cup-champion) .nq-bracket-games { height:310px; }

.nq .nq-battle-waza[data-tournament="true"] .nq-score { display:grid;gap:2px;text-align:left; }
.nq .nq-stage-label { color:#ffe49b;font-size:12px;line-height:1.2; }
.nq .nq-round-score { font-size:12px;line-height:1.2; }

/* Readable status and a deliberate gap between panels: no illegible thumbnail strips. */
.nq .nq-battle-waza { grid-template-rows:28px 128px minmax(100px,1fr) 100px 64px 58px!important;gap:9px;padding:8px;border-width:1px;box-shadow:none; }
.nq .nq-battle-waza[data-tournament="true"] {grid-template-rows:42px 128px minmax(100px,1fr) 100px 64px 58px!important;}
.nq .nq-battle-waza .nq-side {display:grid;grid-template-columns:70px minmax(0,1fr) 48px;grid-template-rows:minmax(0,1fr);gap:4px 6px;padding:7px;height:100%;min-height:0;border-width:1px;border-radius:15px;box-shadow:none;overflow:visible;}
.nq .nq-battle-waza .nq-cpu {grid-template-rows:minmax(0,1fr) 44px;}
.nq .nq-battle-waza .nq-who {grid-row:1/-1;grid-column:1;width:70px;font-size:11px;align-self:center;}
.nq .nq-battle-waza .nq-who .nq-portrait {width:60px;height:60px;max-height:none;}
.nq .nq-battle-waza .nq-total {grid-column:3;grid-row:1;align-self:start;justify-self:end;font-size:36px;line-height:1.1;margin:0;}
.nq .nq-battle-waza .nq-side-info {grid-column:2;grid-row:1;display:flex;flex-direction:column;align-items:flex-start;gap:3px;min-width:0;justify-content:center;}
.nq .nq-battle-waza .nq-rest,.nq .nq-battle-waza .nq-dots {position:static;grid-area:auto;white-space:normal;line-height:1.2;font-size:12px;margin:0;}
.nq .nq-battle-waza .nq-dots {font-size:11px;}
.nq .nq-battle-waza .nq-drawn-history-button {font:inherit;font-size:11px;line-height:1.2;color:#fff3c0;border:1px solid #ffffff55;background:#ffffff12;border-radius:7px;padding:5px 6px;min-height:27px;text-align:left;cursor:pointer;white-space:normal;}
.nq .nq-battle-waza .nq-status-pill {position:static;align-self:flex-start;font-size:11px;line-height:1.2;padding:3px 6px;border-radius:7px;white-space:normal;}
.nq .nq-battle-waza .nq-cpu .nq-status-pill {display:none;}
.nq .nq-battle-waza .nq-cpu.nq-turn .nq-dots::after {content:' ・ 考え中';}
.nq .nq-battle-waza .nq-opponent-skills {grid-column:2/4;grid-row:2;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;min-width:0;}
.nq .nq-battle-waza .nq-opponent-skill {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:2px;min-height:44px;min-width:0;color:#fff7da;background:#ffffff0d;border:1px solid #c5b0ef80;border-radius:7px;cursor:pointer;}
.nq .nq-battle-waza .nq-opponent-skill small,.nq .nq-battle-waza .nq-opponent-skill span {font-size:10px;line-height:1.15;white-space:nowrap;}
.nq .nq-battle-waza .nq-opponent-skill b {font-size:13px;line-height:1.1;white-space:nowrap;}
.nq .nq-battle-waza .nq-opponent-skill.nq-skill-used {background:#f6d777;color:#382509;border-color:#fff0ab;}
.nq .nq-battle-waza .nq-slots,.nq .nq-battle-waza .nq-acts {gap:7px;}
.nq .nq-battle-waza .nq-slot {min-height:0;border-width:1px;border-radius:12px;box-shadow:none;padding:3px;}
.nq .nq-battle-waza .nq-slot b {font-size:23px;}
.nq .nq-battle-waza .nq-center {border-width:1px;box-shadow:none;border-radius:17px;}
.nq .nq-battle-waza .nq-center:not(.nq-has-draw) {grid-template-columns:1fr 1fr;}
.nq .nq-drawn-history-item {display:grid!important;grid-template-columns:105px minmax(0,1fr);gap:12px;align-items:center;padding:12px!important;color:#203943;border-bottom:1px solid #d8e2df;}
.nq .nq-history-card {padding:0;border:0;background:none;cursor:pointer;width:105px;}
.nq .nq-history-card .nq-card {width:105px!important;height:147px!important;margin:0;}
.nq .nq-drawn-history-item strong,.nq .nq-drawn-history-item p {font-size:15px!important;line-height:1.5;}
@media(max-height:720px){
.nq .nq-battle-waza {grid-template-rows:28px 108px minmax(70px,1fr) 82px 54px 50px!important;gap:6px;padding:6px;}
.nq .nq-battle-waza[data-tournament="true"]{grid-template-rows:42px 108px minmax(70px,1fr) 82px 54px 50px!important;}
.nq .nq-battle-waza .nq-side {padding:5px;grid-template-columns:58px minmax(0,1fr) 40px;gap:3px 5px;}
.nq .nq-battle-waza .nq-who {width:58px;}
.nq .nq-battle-waza .nq-who .nq-portrait {width:49px;height:49px;}
.nq .nq-battle-waza .nq-cpu {grid-template-rows:minmax(0,1fr) 42px;}
.nq .nq-battle-waza .nq-opponent-skill {min-height:42px;}
.nq .nq-battle-waza .nq-side-info {gap:2px;}
.nq .nq-battle-waza .nq-drawn-history-button {min-height:24px;padding:3px 5px;}
.nq .nq-battle-waza .nq-total {font-size:32px;}
.nq .nq-battle-waza .nq-acts button {min-height:50px;font-size:16px;}
.nq .nq-battle-waza .nq-slot b {font-size:20px;}
.nq .nq-battle-waza .nq-slot small {font-size:11px;}
}
@media(max-height:560px){.nq .nq-battle-waza,.nq .nq-battle-waza[data-tournament="true"]{height:auto!important;grid-template-rows:42px 108px 160px 82px 54px 50px!important;}}

/* Bottom breathing room: keep the last action row off the outer frame. */
.nq .nq-battle-waza {padding-bottom:16px;}
@media(max-height:720px){.nq .nq-battle-waza {padding-bottom:14px;}}

/* Keep the compact control wrapper from exceeding its allocated row. */
.nq .nq-battle-waza .nq-turn-controls,.nq .nq-battle-waza .nq-acts{min-height:0;height:100%;}

/* Six requested battle presentation changes; no game state is changed here. */
.nq .nq-battle-waza .nq-score{display:grid!important;gap:1px;text-align:left;align-content:center;}
.nq .nq-battle-waza .nq-match-score{font-size:11px;line-height:12px;white-space:nowrap;}
.nq .nq-battle-waza .nq-round-score{font-size:11px;line-height:12px;}
.nq .nq-battle-waza .nq-stage-label{font-size:11px;line-height:12px;}
.nq .nq-battle-waza .nq-side{position:relative;}
.nq .nq-battle-waza .nq-who .nq-portrait{width:70px;height:76px;margin-bottom:1px;}
.nq .nq-battle-waza .nq-opponent-skill{display:grid;grid-template-rows:10px minmax(0,1fr) 10px;justify-items:center;align-content:stretch;align-items:center;gap:0;padding:1px 2px;}
.nq .nq-battle-waza .nq-opponent-skill .nq-enemy-skill-name{display:block;box-sizing:border-box;max-width:100%;width:100%;font-size:13px;line-height:14px;white-space:nowrap;text-align:center;}
.nq .nq-battle-waza .nq-opponent-skill .nq-long-skill{font-size:11px;line-height:11px;white-space:normal;overflow-wrap:anywhere;text-wrap:balance;}
.nq .nq-battle-waza .nq-cpu-callout{position:absolute;right:7px;top:40px;z-index:3;font-size:20px;font-weight:900;line-height:1.1;white-space:nowrap;padding:2px 5px;border-radius:7px;pointer-events:none;text-shadow:0 1px 0 #fff9;}
.nq .nq-battle-waza .nq-cpu-stop{color:#b82039;background:#ffe6e9;border:1px solid #ffb2bd;}
.nq .nq-battle-waza .nq-cpu-pass{color:#124c99;background:#e2f4ff;border:1px solid #92cfff;}
.nq .nq-battle-waza .nq-cpu-reacting .nq-cpu-callout{animation:nq-cpu-status-pop .35s ease-out;transform-origin:right center;}
.nq .nq-battle-waza .nq-cpu-reacting[data-cpu-action=stop] .nq-portrait{animation:nq-cpu-stop-nod .4s ease-out;}
.nq .nq-battle-waza .nq-cpu-reacting[data-cpu-action=pass] .nq-portrait{animation:nq-cpu-pass-lean .4s ease-out;}
.nq .nq-battle-waza .nq-draw-name{margin:0;display:grid;gap:3px;line-height:1.25;}
.nq .nq-battle-waza .nq-draw-base-number{font-size:20px;line-height:1.2;}
.nq .nq-battle-waza .nq-draw-character-name{overflow-wrap:anywhere;text-wrap:balance;}
.nq .nq-battle-waza .nq-choice-overlay .nq-choice .nq-btn{animation:nq-choice-border-glow 1.8s ease-in-out infinite;}
@keyframes nq-cpu-status-pop{0%{opacity:.3;transform:scale(.88);}65%{opacity:1;transform:scale(1.05);}100%{transform:scale(1);}}
@keyframes nq-cpu-stop-nod{0%,100%{transform:none;}45%{transform:translateY(2px) rotate(-2deg);}}
@keyframes nq-cpu-pass-lean{0%,100%{transform:none;}45%{transform:translateX(2px) rotate(3deg);}}
@keyframes nq-choice-border-glow{0%,100%{border-color:#b9d0d8;box-shadow:0 0 0 1px #b9d0d822;}50%{border-color:#ffe891;box-shadow:0 0 0 2px #ffe89188,0 0 10px #ffe89166;}}
@media(max-height:720px){
.nq .nq-battle-waza .nq-who .nq-portrait{width:58px;height:60px;}
.nq .nq-battle-waza .nq-cpu-callout{top:31px;right:5px;font-size:18px;}
.nq .nq-battle-waza .nq-draw-detail{gap:4px;}
.nq .nq-battle-waza .nq-draw-detail .nq-draw-owner{font-size:11px;padding:3px;}
.nq .nq-battle-waza .nq-draw-character-name{font-size:12px;line-height:1.2;}
.nq .nq-battle-waza .nq-draw-base-number{font-size:18px;}
.nq .nq-battle-waza .nq-draw-equation{font-size:20px;}
}
@media(prefers-reduced-motion:reduce){.nq .nq-battle-waza .nq-choice-overlay .nq-choice .nq-btn,.nq .nq-battle-waza .nq-cpu-reacting .nq-portrait,.nq .nq-battle-waza .nq-cpu-reacting .nq-cpu-callout{animation:none!important;}}
/* Place the status between the total and the three skill cells. */
.nq .nq-battle-waza .nq-cpu-callout{top:48px;padding:1px 5px;}
@media(max-height:720px){.nq .nq-battle-waza .nq-cpu-callout{top:39px;font-size:16px;}.nq .nq-battle-waza .nq-cpu .nq-total{font-size:30px;}}
.nq .nq-battle-waza .nq-opponent-skill{grid-template-columns:minmax(0,1fr);}

@media(max-height:720px){.nq .nq-battle-waza{grid-template-rows:28px 112px minmax(70px,1fr) 82px 54px 50px!important;}.nq .nq-battle-waza[data-tournament="true"]{grid-template-rows:42px 112px minmax(70px,1fr) 82px 54px 50px!important;}}

/* Contextual practice: real controls remain usable; only explanatory prose changes. */
.nq .nq-practice-coach{display:flex;flex-direction:column;gap:5px;text-align:left;color:#193654;width:100%;min-width:0;box-sizing:border-box;}
.nq .nq-practice-coach .nq-coach-label{align-self:flex-start;background:#224a6e;color:#fff;border-radius:10px;padding:2px 8px;font-size:10px;}
.nq .nq-practice-coach>strong{font-size:16px;line-height:1.3;}
.nq .nq-practice-coach>p{font-size:13px;line-height:1.5;margin:0;}
.nq .nq-practice-coach .nq-coach-skip{align-self:flex-start;min-height:32px;padding:4px 3px;border:0;background:transparent;color:#284c69;text-decoration:underline;font-size:11px;cursor:pointer;}
.nq .nq-battle-waza .nq-teach-target{outline:3px solid #ffb51b;outline-offset:-4px;box-shadow:inset 0 0 0 5px #fff1bd;animation:nq-teach-glow 1.8s ease-in-out infinite;}
@keyframes nq-teach-glow{50%{outline-color:#fff3aa;box-shadow:inset 0 0 0 5px #ffd34b;}}
@media(max-height:720px){.nq .nq-practice-coach{gap:2px;}.nq .nq-practice-coach>strong{font-size:12px;}.nq .nq-practice-coach>p{font-size:11px;line-height:1.35;}.nq .nq-practice-coach .nq-coach-label{display:none;}.nq .nq-practice-coach .nq-coach-skip{font-size:10px;min-height:28px;padding:2px;}.nq .nq-practice-coach .nq-draw-equation{font-size:15px;}}
/* A new trio: water spirit, Lux number15, and Pipil's attack. Static card artwork. */
.nq .nq-quest-entry{position:relative;overflow:hidden;background:radial-gradient(ellipse at 50% 60%,#7866ba66,transparent 62%),linear-gradient(145deg,#111d43,#362c67 58%,#151d3d);border-color:#dfbd68;box-shadow:0 7px 0 #16243f, inset 0 0 0 4px #ffffff0c;}
.nq .nq-quest-art{filter:drop-shadow(0 10px 8px #0007);}
.nq .nq-quest-art img:nth-child(1){transform:translateX(-68%) rotate(-13deg);}
.nq .nq-quest-art img:nth-child(2){transform:translateY(-9px);z-index:2;}
.nq .nq-quest-art img:nth-child(3){transform:translateX(68%) rotate(13deg);}
.nq .nq-quest-kicker{display:block;color:#d4dcff;font-size:12px;letter-spacing:.12em;margin-top:9px;}
.nq .nq-btn-coll{position:relative;overflow:hidden;background:linear-gradient(135deg,#202d53,#3c3269);border-color:#cbb16b;color:#fff4d1;box-shadow:0 3px 0 #18223c;}
.nq .nq-btn-coll small{color:#ded9f3;}
.nq .nq-menu-progress{position:absolute;left:0;bottom:0;height:5px;width:100%;background:linear-gradient(to right,#ffdf7d var(--progress),#ffffff15 var(--progress));}
/* Champion celebration is UI only, with no new rewards or winner logic. */
.nq .nq-champion-celebration{position:fixed;inset:0;box-sizing:border-box;margin:auto;width:min(350px,calc(100vw - 28px));max-height:calc(100dvh - 36px);overflow-y:auto;border:2px solid #f5d67e;border-radius:24px;padding:20px;text-align:center;color:#fff5cf;background:radial-gradient(ellipse at 50% 45%,#8b6549 0,#3e3767 42%,#162445 85%);box-shadow:0 0 45px #ffde8c55;isolation:isolate;}
.nq .nq-champion-celebration::backdrop{background:#07132cd9;}
.nq .nq-champion-crown{display:block;font-size:52px;line-height:1.1;}
.nq .nq-champion-en{display:block;letter-spacing:.22em;font-size:16px;color:#ffe2a0;margin-top:8px;}
.nq .nq-champion-celebration h2{font-size:40px;margin:7px 0;color:#ffe187;text-shadow:0 3px #6c3b27;}
.nq .nq-champion-celebration .nq-champion-hero{display:block;width:145px;height:170px;margin:8px auto;filter:drop-shadow(0 0 16px #ffe4a777);}
.nq .nq-champion-name{font-size:24px;display:block;}
.nq .nq-champion-celebration p{font-size:17px;margin:8px 0 18px;}
.nq .nq-champion-celebration button{width:100%;min-height:50px;font-size:18px;background:linear-gradient(#ffeca0,#f2bd4d);color:#472b0e;border:2px solid #fff0bd;}
.nq .nq-champion-confetti{position:absolute;inset:0;overflow:hidden;border-radius:22px;pointer-events:none;z-index:-1;}
.nq .nq-champion-confetti i{position:absolute;top:-10%;left:var(--x);width:7px;height:13px;background:hsl(var(--hue) 80% 72%);animation:nq-champion-fall 3.5s linear 2;animation-delay:var(--delay);transform:rotate(var(--tilt));}
@keyframes nq-champion-fall{to{top:110%;transform:rotate(calc(var(--tilt) + 360deg));}}
@media(max-height:720px){.nq .nq-champion-celebration{padding:14px;}.nq .nq-champion-crown{font-size:38px;}.nq .nq-champion-celebration h2{font-size:32px;}.nq .nq-champion-celebration .nq-champion-hero{width:110px;height:125px;}.nq .nq-champion-celebration p{margin:6px 0 12px;}}
@media(prefers-reduced-motion:reduce){.nq .nq-teach-target,.nq .nq-champion-confetti i{animation:none;}.nq .nq-champion-confetti{display:none;}}

.nq .nq-menu .nq-quest-art{position:relative;width:100%;height:172px;isolation:isolate;}
.nq .nq-menu .nq-quest-art img{position:absolute;left:50%;top:50%;width:100px;height:140px;max-width:36%;object-fit:contain;}
.nq .nq-menu .nq-quest-art img:nth-child(1){transform:translate(-112%,-44%) rotate(-12deg);}
.nq .nq-menu .nq-quest-art img:nth-child(2){transform:translate(-50%,-54%);z-index:2;}
.nq .nq-menu .nq-quest-art img:nth-child(3){transform:translate(12%,-44%) rotate(12deg);}
.nq .nq-battle-waza .nq-practice-coach>p{color:#193654;opacity:1;}
.nq .nq-battle-waza .nq-practice-coach>strong{color:#193654;}
@media(max-height:720px){.nq .nq-menu .nq-quest-art{height:145px;}.nq .nq-menu .nq-quest-art img{width:90px;height:126px;}}
