:root{
 --pixel-surface:#10252d;
 --pixel-surface-raised:#1b3034;
 --pixel-text:#f2ddb1;
 --pixel-text-muted:#aaba9e;
 --pixel-action:#c69b50;
 --pixel-frame:#a9864d;
 --pixel-frame-selected:#edc96f;
 --pixel-frame-inset:#07151b;
 --pixel-frame-shadow:#05090c;
 --pixel-panel-shadow:inset 0 0 0 2px var(--pixel-frame-inset),3px 3px 0 var(--pixel-frame-shadow);
}

/* One frame language for every game panel; reel cells keep their payout treatment. */
.money-hud,
.mg-hunt-preview,
.mg-bag,
.mg-item-detail,
.mg-slot,
.mg-item,
.mg-portrait-picker button,
.mg-hunt-picker button,
.mg-support,
.mg-memories button,
.mg-team,
.mg-loadouts>div,
.mg-partner-tag,
.partner-mechanic-badge,
.partner-rule,
 .partner-bonus-card,
 .partner-unlock,
 .partner-mission-card,
.guild-board,
.journal-book,
.guild-notice,
.gather-machine,
.gather-board,
.material-bag,
.tool-card,
.tool-stats>div,
.recipe-shelf,
.recipe-shelf>button,
.crafting-table,
.craft-result,
.workshop-stock,
.ingredient,
.craft-confirm,
.find-materials,
.split-combat .arena-actors,
.split-combat .intent-card,
.split-combat .hero-card,
.split-combat .partner-battle,
.split-combat .feature-panel,
.split-combat .feature-buttons>button,
.split-combat .result-panel,
.split-combat .battle-stage .target-tactics>.tactic-group,
.split-combat .timeline-entry,
.game-dialog,
.help-pages button,
.combat-potions{
 border:2px solid var(--pixel-frame);
 border-radius:0;
 box-shadow:var(--pixel-panel-shadow);
}

.mg-item.is-active,
.mg-portrait-picker button.is-active,
.mg-hunt-picker button.is-active,
.recipe-shelf>button[aria-pressed=true],
.split-combat .feature-buttons>button.selected,
.split-combat .battle-stage .target-options>button[aria-pressed=true],
.help-pages button[aria-pressed=true]{
 border-color:var(--pixel-frame-selected);
 border-radius:0;
 box-shadow:var(--pixel-panel-shadow);
}

.mg-item.is-active:after{display:none}
.guild-notice{transform:none;transition:border-color .15s,filter .15s}
.guild-notice:nth-child(even),.guild-notice:hover,.guild-notice:focus-visible{transform:none}
.guild-notice:hover,.guild-notice:focus-visible{border-color:var(--pixel-frame-selected)}

/* Keep the whole workbench inside its management content column. */
.workshop,
.workshop-body,
.workshop-body>*,
.workshop-stock,
.workshop-stock>*{min-width:0}
.workshop{width:100%;padding-right:8px}
.workshop-body{width:100%;grid-template-columns:215px minmax(0,1fr) minmax(0,245px)}
.craft-result{overflow:hidden}
.workshop-stock{width:100%;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:8px;padding-inline:12px;overflow:hidden}
.workshop-stock .stock-divider{display:none}
.workshop-stock>span{justify-content:center;min-width:0}

@media(max-width:1000px) and (orientation:landscape){
 .workshop{padding-right:6px}
 .workshop-body{grid-template-columns:155px minmax(0,1fr) minmax(0,175px)}
 .workshop-stock{gap:3px;padding-inline:6px}
}

/* Playtest polish 2026-10-18: wear on equipped slots, price beside departure, compact stat chips. */
.mg-slot .mg-durability{position:absolute;left:8px;right:8px;top:5px;height:3px;background:var(--pixel-frame-inset)}
.mg-slot .mg-durability>i{display:block;height:100%;background:#7fae63}
.mg-slot.is-worn .mg-durability>i{background:#e0a142}
.mg-slot.is-broken,.mg-slot.is-ruined{border-color:#c4553f}
.mg-slot.is-broken .mg-gear-icon,.mg-slot.is-ruined .mg-gear-icon{filter:grayscale(.85) brightness(.7)}
.mg-slot-flag{position:absolute;left:50%;bottom:-8px;transform:translateX(-50%);padding:1px 5px;background:#a8402f;border:1px solid #f0b38f;color:#fff1dc;font:700 9px/1.2 Arial,sans-serif;white-space:nowrap}
.mg-trip-cost{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:-4px;color:var(--pixel-text-muted);font:11px/1.3 Arial,sans-serif;text-align:center}
.mg-trip-cost .ui-pixel-icon{width:16px;height:16px;flex-shrink:0}
.mg-trip-cost.is-warning{color:#efbe61}
.mg-trip-cost.is-blocked{color:#ef9e7f}
.management-screen .mg-primary .ui-pixel-icon{width:22px;height:22px}

.stat-chips{margin:0}
.stat-chips.is-quad{grid-template-columns:repeat(4,minmax(0,1fr))}
.stat-chips.forge-odds{width:100%;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
.stat-chips.forge-odds>div,.stat-chips.is-compact>div{grid-template-columns:1fr;gap:0;padding:3px 2px;text-align:center}
.stat-chips.forge-odds dt,.stat-chips.is-compact dt{font-size:9px;color:var(--pixel-text-muted)}
.stat-chips.forge-odds dd,.stat-chips.is-compact dd{font-size:14px}
.stat-chips.forge-odds small,.stat-chips.is-compact small{font-size:8px}

.craft-result.forge-result{gap:5px;overflow-y:auto}
.forge-result .result-plinth{min-height:0;overflow:hidden}
@container (max-height:32px){.forge-result .result-plinth>.mg-gear-icon{visibility:hidden}}
.forge-result>h3{margin:0;font-size:20px}
.forge-result .craft-benefit{font-size:22px}
.craft-result .condition-line{margin:0;font-size:11px;line-height:1.3;color:var(--pixel-text-muted)}
.condition-line b{color:#ef9e7f}
.forge-result .find-materials{min-height:32px;padding:4px 8px;font-size:11px}
.forge-result .craft-confirm{min-height:44px}
.forge-result .craft-hint{font-size:10px;color:var(--pixel-text-muted)}

.tool-card-scroll{padding-bottom:2px}
.tool-services{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px}
.tool-service,.tool-services .tool-condition{display:grid;gap:6px;align-content:start;min-width:0;margin:0}
.tool-service p{margin:0;font-size:11px;line-height:1.35;color:var(--pixel-text-muted)}
.tool-service p strong{color:var(--pixel-text)}
.tool-service .find-materials{min-height:34px;font-size:11px}

.split-combat .feature-buttons>.swap-choices{display:flex;flex:2 1 0;gap:6px;min-width:0}
.split-combat .slot-side .feature-buttons .swap-choices button{flex:1;height:100%;display:grid;place-items:center;padding:0;border:2px solid var(--pixel-frame);border-radius:0;background:var(--pixel-surface-raised)}
.split-combat .slot-side .feature-buttons .swap-choices button.selected{border-color:var(--pixel-frame-selected);background:#4f5736}
.split-combat .slot-side .feature-buttons .swap-choices img{width:28px;height:28px}

.gather-story>.gather-tools-link{align-self:center}
.gather-story .gather-tool-summary{margin:4px 0;font-size:12px;text-align:center}
.gather-story .gather-tool-summary b{color:var(--pixel-text)}
.gather-story .stat-chips{width:100%;max-width:360px;margin:2px 0 6px}
/* The emblem gives way to the summary instead of overlapping the progress row. */
.gather-story .gather-emblem{width:100%;container-type:size}
.gather-story .gather-emblem>.material-icon{width:min(130px,100cqh);height:min(130px,100cqh)}

/* Release pass 2026-10-18: matchup before departure, atlas arrows, rally, toast clear of battle controls. */
.management-screen .mg-go{width:16px;height:16px;margin-left:6px;opacity:.8;vertical-align:middle}
.mg-hunt-preview .mg-matchup{margin-top:3px;font:italic 11px/1.3 Arial,sans-serif;color:var(--pixel-text-muted)}
.mg-hunt-preview .mg-matchup.is-weak{color:#9fd47f}
.mg-hunt-preview .mg-matchup.is-resist{color:#ef9e7f}
.split-combat .feature-buttons>button.rally-tool.used{opacity:.55}
.toast.is-top{top:calc(var(--game-top,0px) + 64px * var(--game-scale,1));bottom:auto}

@media(max-width:1000px) and (orientation:landscape){
 .mg-slot .mg-durability{left:5px;right:5px;top:3px;height:2px}
 .mg-slot-flag{font-size:7px;bottom:-6px;padding:0 3px}
 .mg-trip-cost{gap:4px;margin-top:-2px;font-size:8px}
 .management-screen .mg-go{width:11px;height:11px;margin-left:4px}
 .mg-hunt-preview .mg-matchup{font-size:8px;margin-top:1px}
 .toast.is-top{top:48px}
 .mg-lobby-quest .mg-practice{min-height:20px;padding:0}
 .mg-trip-cost .ui-pixel-icon{width:11px;height:11px}
 .management-screen .mg-primary .ui-pixel-icon{width:16px;height:16px}
 .stat-chips.forge-odds dt,.stat-chips.is-compact dt{font-size:7px}
 .stat-chips.forge-odds dd,.stat-chips.is-compact dd{font-size:10px}
 .stat-chips.forge-odds small,.stat-chips.is-compact small{font-size:6px}
 .stat-chips.forge-odds>div,.stat-chips.is-compact>div{padding:2px 1px}
 .craft-result.forge-result{gap:2px}
 .forge-result .result-plinth{display:none}
 .forge-result>h3{font-size:13px}
 .forge-result .craft-benefit{font-size:14px}
 .forge-result>small{font-size:7px}
 .craft-result .condition-line{font-size:8px}
 .forge-result .find-materials{min-height:22px;padding:2px 4px;font-size:8px}
 .forge-result .craft-confirm{min-height:28px}
 .forge-result .craft-hint{font-size:7px}
 .tool-services{gap:6px;margin-top:4px}
 .tool-service,.tool-services .tool-condition{gap:3px}
 .tool-service p{font-size:8px}
 .tool-service .find-materials{min-height:22px;font-size:8px;padding:2px 4px}
 .tool-service .find-materials .ui-pixel-icon{width:13px;height:13px}
 .split-combat .feature-buttons>.swap-choices{gap:4px}
 .split-combat .slot-side .feature-buttons .swap-choices img{width:20px;height:20px}
 .gather-story .gather-tool-summary{font-size:9px;margin:2px 0}
 .gather-story .stat-chips{max-width:260px;margin:0 0 3px}
 .gather-story .gather-emblem>.material-icon{width:min(65px,100cqh);height:min(65px,100cqh)}
 .gather-story>.gather-tools-link{font-size:10px}
 .forge-result>.bench-label{display:none}
 .tool-card .stat-chips small{display:none}
 .tool-card .stat-chips>div{grid-template-columns:1fr auto;align-items:baseline;padding:3px 4px}
 .tool-card .stat-chips dd{grid-row:auto}
}

/* Conversation UI shares the fixed game canvas and existing pixel panel tokens. */
/* Personal conversation follows the selected partner; the shared book belongs to the roster. */
.partner-hub-controls{--partner-control-size:62px;position:absolute;bottom:15px;left:34%;display:flex;align-items:stretch;gap:12px}
.partner-hub-controls .mg-partner-tag{height:var(--partner-control-size);position:static;white-space:nowrap}
.partner-talk{position:relative;width:var(--partner-control-size);height:var(--partner-control-size);min-height:0;aspect-ratio:1;padding:0;display:grid;place-items:center;flex:none;background:#142a31ec;border:2px solid var(--pixel-frame);border-radius:0;box-shadow:var(--pixel-panel-shadow)}
.partner-talk .ui-pixel-icon{width:32px;height:32px}
.shared-story-book{display:none}
.game-shell:has(.mg-cast) .shared-story-book{display:grid}
.story-ready{position:absolute;right:-9px;top:-9px;padding:2px 8px;background:var(--pixel-action);color:#18251e;border:2px solid var(--pixel-frame);font-weight:bold}
.story-journal-link{position:absolute;right:20px;bottom:85px;font-size:12px}
.game-dialog.story-dialog{width:1060px;height:630px;max-width:none;max-height:none;transform:scale(var(--game-scale,1));overflow:hidden}
.story-dialog .dialog-body{height:100%;padding:26px;box-sizing:border-box}
.story-scene{height:100%;display:flex;flex-direction:column;gap:12px}
.story-scene header h2{font-size:24px;margin:4px 0;max-width:100%;line-height:1.25}
.story-stage{display:grid;grid-template-columns:230px minmax(0,1fr);gap:22px;flex:1;min-height:0}
.story-portraits{position:relative;display:flex;align-items:center;justify-content:center;min-height:0;overflow:hidden;background:var(--pixel-surface-raised);border:2px solid var(--pixel-frame-inset)}
.story-portraits img{width:100%;height:100%;object-fit:contain;object-position:center;image-rendering:pixelated}
.story-portraits img.story-narration-art{object-fit:cover;opacity:.65}
.story-portrait-caption{position:absolute;bottom:0;left:0;right:0;padding:12px;background:var(--pixel-surface);color:var(--pixel-text-muted);text-align:center}
.story-speaker-fallback{display:flex;flex-direction:column;align-items:center;gap:16px;padding:16px;text-align:center;color:var(--pixel-text)}
.story-speaker-fallback>.ui-pixel-icon{width:64px;height:64px}
.story-copy{align-self:center;min-width:0}
.story-name{font:700 20px Georgia,serif;color:var(--pixel-action)}
.story-dialog p.story-line{font:24px/1.4 Arial,sans-serif;color:var(--pixel-text);margin:12px 0;max-width:46ch}
.story-dialog .story-choices{flex:none;gap:6px}
.story-dialog .story-choices>button{min-height:56px;border:2px solid var(--pixel-frame);border-radius:0;background:var(--pixel-surface-raised);color:var(--pixel-text);padding:7px 12px;font-size:20px;line-height:1.3}
.story-dialog .story-choices>button>span:first-child{font-size:20px}
.story-dialog .story-choices>button>span>small{font-size:14px;color:var(--pixel-action);margin:0 0 3px}
.story-dialog .story-choices .primary{margin:0;background:var(--pixel-action);color:#18251e}
.story-choices .ui-pixel-icon{width:18px;height:18px}
.story-dialog .story-help{font-size:14px;color:var(--pixel-text-muted)}
.game-dialog.story-library{width:780px;max-width:none;max-height:600px;transform:scale(var(--game-scale,1));overflow:hidden}
.story-library .dialog-body{padding:24px;display:flex;flex-direction:column;max-height:590px;box-sizing:border-box}
.story-library h2{font-size:25px;margin:4px 0 16px}
.story-list{display:grid;gap:8px;overflow:auto;min-height:0;padding:2px 6px 8px 2px}
.story-list>.mg-button{display:flex;align-items:center;justify-content:space-between;min-height:48px;text-align:left;gap:12px;padding:9px 12px;flex-shrink:0}
.story-list small{display:block;font-size:11px;color:var(--pixel-text-muted);margin-bottom:4px}
.story-list b{font-size:15px}
.story-list .ui-pixel-icon{width:18px;height:18px}
.story-library .quiet{margin-top:10px;flex:none}
.story-dialog button:focus-visible,.story-library button:focus-visible{outline:3px solid var(--pixel-action);outline-offset:2px}
.story-dialog button:disabled{opacity:.5}

.game-dialog.story-dialog,.game-dialog.story-library{position:fixed;left:50%;top:50%;right:auto;bottom:auto;margin:0;transform:translate(-50%,-50%) scale(var(--game-scale,1))}

/* Gameplay controls use the existing fixed canvas and pixel panel palette. */
.home-support{display:flex;align-items:center;gap:10px;text-align:left;border:2px solid var(--pixel-frame);border-radius:0;background:var(--pixel-surface);box-shadow:var(--pixel-panel-shadow);color:var(--pixel-text);padding:8px 10px}
.home-support>span{display:grid;gap:3px;min-width:0;flex:1}
.home-support small{display:block;color:var(--pixel-text-muted);font-size:11px;line-height:1.3}
.home-support small:first-child{font-size:9px;letter-spacing:.08em}
.home-support b{font-size:14px}
.home-support .ui-pixel-icon{width:23px;height:23px;flex:none}
.mg-lobby-quest>.home-support{width:100%;flex:none;min-height:58px}
.home-support-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;overflow:auto;min-height:0;padding:3px 5px 8px 3px}
.home-support-list .mg-button{display:flex;align-items:center;gap:10px;min-height:76px;text-align:left;border:2px solid var(--pixel-frame);border-radius:0;background:var(--pixel-surface-raised);box-shadow:var(--pixel-panel-shadow);padding:8px}
.home-support-list .mg-button:first-child{grid-column:1/-1;min-height:45px}
.home-support-list .mg-button.is-active{border-color:var(--pixel-frame-selected);background:#304138}
.home-support-list img{width:48px;height:58px;object-fit:contain;image-rendering:pixelated;flex:none}
.home-support-list b{font-size:15px}
.home-support-list small{display:block;color:var(--pixel-text-muted);font-size:12px;font-weight:400;line-height:1.3;margin-top:4px}
.home-support-list button:disabled{opacity:.45}
.home-support:focus-visible,.home-support-list button:focus-visible,.gameplay-status:focus-visible{outline:3px solid var(--pixel-action);outline-offset:2px}
.game-dialog>.dialog-body>.home-support{width:100%;margin:8px 0}
.gameplay-status{position:absolute;z-index:3;top:calc(100% + 3px);left:0;right:0;min-height:22px;padding:3px 7px;text-align:left;color:var(--pixel-text);background:var(--pixel-surface);border:1px solid var(--pixel-frame);font:11px/1.3 Arial,sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gameplay-status:after{content:' ⓘ';color:var(--pixel-action)}
.mission-objective{color:var(--pixel-action);font-weight:700}
.board-column.is-hidden{position:relative}
.board-column.is-hidden .symbol-cell img{visibility:hidden}
.board-column.is-hidden .symbol-cell:after{content:'?';position:absolute;inset:0;display:grid;place-items:center;color:var(--pixel-text-muted);font:700 35px Georgia,serif;background:linear-gradient(135deg,#264348e8,#10252deb)}
.board[data-hidden-column="0"] .reel-lane:nth-child(1),.board[data-hidden-column="1"] .reel-lane:nth-child(2),.board[data-hidden-column="2"] .reel-lane:nth-child(3),.board[data-hidden-column="3"] .reel-lane:nth-child(4),.board[data-hidden-column="4"] .reel-lane:nth-child(5){visibility:hidden}
.symbol-cell.is-debt:after{content:'NỢ';position:absolute;right:3px;bottom:3px;padding:2px 4px;color:#ffe2b3;background:#702f24;border:1px solid #d88b70;font:700 10px Arial,sans-serif;letter-spacing:.08em}
.reel-labels>span.is-locked b{opacity:1;color:#edac72}
.symbol-cell:disabled{cursor:default}

.home-support-dialog .home-exchange{font-size:13px;line-height:1.3;margin:0 0 12px;color:var(--pixel-text-muted)}
.home-support-dialog> .dialog-body>p{flex:none}

.split-combat .arena-actors,.split-combat .action-timeline{margin-top:20px}

.symbol-cell.is-fake img{filter:grayscale(1);opacity:.55}
.symbol-cell.is-fake:after{content:'GIẢ';position:absolute;right:3px;bottom:3px;padding:2px 4px;color:var(--pixel-text);background:#334146;border:1px solid #96a49c;font:700 10px Arial,sans-serif;letter-spacing:.08em}

/* Hard contracts extend the existing notice board and scaled dialog. */
.guild-tabs.hard-chapters button{min-width:48px;padding-inline:12px}
.guild-tabs.hard-chapters button:first-child{min-width:110px}
.hard-mode-choices{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:10px 0;clear:both}
.hard-mode-choices button{border:2px solid var(--pixel-frame);border-radius:0;background:var(--pixel-surface);color:var(--pixel-text);padding:10px 5px;font:700 13px Arial,sans-serif}
.hard-mode-choices button[aria-pressed="true"]{border-color:var(--pixel-frame-selected);background:var(--pixel-action);color:#182d32}
.hard-mode-choices button:focus-visible{outline:3px solid var(--pixel-action);outline-offset:2px}
.hard-materials{display:flex;align-items:center;justify-content:center;gap:8px}
.hard-materials .material-icon{width:28px;height:28px}
.game-dialog.mission-notice{position:fixed;left:50%;top:50%;right:auto;bottom:auto;margin:0;width:900px;height:620px;max-width:none;max-height:none;overflow:hidden;transform:translate(-50%,-50%) scale(var(--game-scale,1))}
.mission-notice .dialog-body{display:flex;flex-direction:column;box-sizing:border-box;height:100%;padding:26px}
.mission-notice h2{font-size:28px;line-height:1.2;margin:6px 36px 12px 0;flex:none}
.notice-scroll{overflow:auto;min-height:0;padding-right:10px;flex:1}
.notice-summary{display:flex;align-items:center;gap:22px}
.notice-summary>img{width:130px;height:140px;object-fit:contain;image-rendering:pixelated;flex:none}
.mission-notice p{font-size:15px;line-height:1.4;margin:8px 0}
.mission-notice .hard-mode-choices button{font-size:15px}
.mission-notice .home-support{width:100%;margin-top:12px}
.notice-actions{flex:none;border-top:1px solid var(--pixel-frame);padding-top:8px;margin-top:12px}
.notice-actions>.primary{width:100%;min-height:44px}

/* Compact existing navigation without shrinking its labels or icons. */
.management-screen{grid-template-rows:minmax(0,1fr) 56px}
.mg-nav button{min-height:0;padding-top:4px;padding-bottom:4px}
@media(max-width:1000px) and (orientation:landscape){
 .management-screen{grid-template-rows:minmax(0,1fr) 44px}
 .mg-nav button{padding-top:2px;padding-bottom:2px}
}

@media(max-width:1000px) and (orientation:landscape){
 .partner-hub-controls{--partner-control-size:46px}
}

/* Header actions share the wallet's height and centered breathing room. */
.topbar{--top-control-height:32px}
.game-shell .topbar .money-hud,.game-shell .topbar .top-actions>button{height:var(--top-control-height);min-height:var(--top-control-height);box-sizing:border-box}
.game-shell .topbar .top-actions>button{padding:0 10px;border:2px solid var(--pixel-frame);box-shadow:var(--pixel-panel-shadow);display:grid;place-items:center}
.game-shell .topbar .top-actions>.icon-button{width:var(--top-control-height);padding:0;flex:none}
.game-shell .topbar .top-actions>.shared-story-book{display:none}
.game-shell:has(.mg-cast) .topbar .top-actions>.shared-story-book{display:grid}
.game-shell .topbar .top-actions>.icon-button .ui-pixel-icon{width:calc(var(--top-control-height) - 10px);height:calc(var(--top-control-height) - 10px)}
@media(max-width:1000px) and (orientation:landscape){
 .topbar{--top-control-height:27px}
}

/* The bottom brand/save strip is removed; autosave keeps its status node. */
.game-shell{grid-template-rows:77px minmax(0,1fr) 0}
.game-shell>.footer{display:none}
@media(max-height:500px) and (min-width:560px) and (orientation:landscape){
 .game-shell:has(.combat){grid-template-rows:40px minmax(0,1fr) 0}
}

.home-support>.home-support-visual{display:grid;place-items:center;width:48px;height:48px;flex:0 0 48px;overflow:hidden}
.home-support-visual>img{width:48px;height:48px;object-fit:cover;object-position:center top;image-rendering:pixelated}
.home-support-visual .potion-icon,.home-support-visual .material-icon{width:44px;height:44px}

@media(max-width:1000px) and (orientation:landscape){
 .home-support{gap:6px;padding:6px 8px}
 .home-support>.home-support-visual{width:40px;height:40px;flex-basis:40px}
 .home-support-visual>img{width:40px;height:40px}
 .home-support-visual .potion-icon{width:40px;height:40px}
 .home-support b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .home-support small{font-size:10px}
 /* In the narrow lobby column the card is portrait + label + name; the prep detail stays in its accessible name and the picker. */
 .mg-lobby-quest>.home-support{min-height:0}
 .mg-lobby-quest>.home-support small:not(:first-child){display:none}
 .mg-lobby-quest>.home-support small:first-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .mg-lobby-quest>.mg-hunt-preview{min-height:78px}
 .home-support>.mg-go{width:18px;height:18px}
}

/* Per-character face anchors keep dialogue close-ups at one apparent scale. */
.story-portraits img.story-face{position:absolute;left:50%;top:32%;width:var(--face-width);max-width:none;height:auto;object-fit:initial;transform:translate(calc(-1 * var(--face-x)),calc(-1 * var(--face-y)))}

/* One illustrated wordmark, fitted inside the existing header height. */
.game-shell .topbar .brand{display:flex;align-items:center;justify-content:center;flex:none}
.brand-wordmark{display:block;width:210px;height:64px;object-fit:contain;object-position:left center;image-rendering:pixelated}
.game-shell .topbar .brand-tagline{display:block;margin:0;padding-left:24px;border-left:1px solid var(--pixel-text-muted);font:15px/24px Arial,sans-serif;white-space:nowrap;color:var(--pixel-text-muted)}
@media(max-width:1000px) and (orientation:landscape){
 .brand-wordmark{width:132px;height:34px}
 .game-shell .topbar .brand-tagline{display:none}
}

/* Polish pass 2026-10-18 (playtest 2): atlas icons instead of text glyphs, one focus ring, square frames. */
:where(button,[role="button"],a,input,select,summary,[tabindex]):focus-visible{outline:3px solid var(--pixel-action);outline-offset:2px}
.ui-pixel-icon.btn-go{width:1.15em;height:1.15em;margin-left:.45em;vertical-align:-.2em;flex:none}
.stage-return .btn-go{margin:0 .35em 0 0}
.help-pages .btn-go{width:22px;height:22px;margin:0}
.symbol-icon{display:inline-block;width:1.1em;height:1.1em;object-fit:contain;vertical-align:-.18em;image-rendering:pixelated}
.result-panel .text-button .ui-pixel-icon{width:14px;height:14px;margin-right:4px;vertical-align:-3px}
.spin-cost .ui-pixel-icon,.gather-cost .ui-pixel-icon{width:1.25em;height:1.25em;vertical-align:-.3em}
.order-check .ui-pixel-icon{width:14px;height:14px}
.mg-item>b .ui-pixel-icon,.mg-item>b .lock-icon{width:16px;height:16px}
.mg-item.is-locked>b{opacity:.85}
.partner-unlock>span .ui-pixel-icon,.partner-unlock>span .lock-icon{width:70%;height:70%}
.mg-portrait-picker .picker-check{width:14px;height:14px;margin-left:4px;vertical-align:-2px}
.mg-partner-tag .symbol-icon{width:16px;height:16px;margin-right:3px}
.hard-mode-choices .mode-cleared{width:16px;height:16px;margin-left:6px;vertical-align:-3px}
.guild-notice>b .ui-pixel-icon{width:1.2em;height:1.2em;vertical-align:-.25em}
.cleared-stamp .ui-pixel-icon{width:1.3em;height:1.3em;vertical-align:-.3em}
.notice-summary>div>b{font:700 18px Georgia,serif;color:var(--pixel-text)}
.notice-stats{display:flex;align-items:center;gap:6px}
.notice-stats>b{margin-right:12px;color:var(--pixel-text);font-variant-numeric:tabular-nums}
.notice-stats .symbol-icon,.notice-stats .ui-pixel-icon{width:22px;height:22px;vertical-align:middle}
.notice-cost{display:flex;align-items:center;gap:6px;color:var(--pixel-text-muted)}
.notice-cost .ui-pixel-icon{width:16px;height:16px;flex:none}
.mission-notice .notice-actions>p.notice-cost{font-size:13px;margin:0 0 8px}
.notice-rewards{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px}
.notice-rewards>span{display:inline-flex;align-items:center;gap:4px;color:var(--pixel-text);font-weight:700}
.notice-rewards .material-icon{width:24px;height:24px}
.notice-rewards>small{color:var(--pixel-text-muted)}
.loot-items{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 18px}
.loot-items>span,.hard-materials>span{display:inline-flex;align-items:center;gap:6px}
.loot-items .mg-gear-icon{width:34px;height:34px;flex:none}
.story-list>.story-shelf{display:grid;grid-template-columns:24px minmax(0,1fr) auto;gap:10px}
.story-list>.story-shelf>.ui-pixel-icon:first-child{width:24px;height:24px}
.story-shelf>b{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.story-shelf>em{min-width:28px;padding:1px 6px;border:1px solid var(--pixel-frame);background:var(--pixel-frame-inset);color:var(--pixel-frame-selected);font:700 13px Arial,sans-serif;font-style:normal;text-align:center}
.story-shelf>.btn-go{width:18px;height:18px}
.story-shelf:disabled{opacity:.45;cursor:default}
.partner-mission-card.is-ready{border-color:var(--pixel-frame-selected)}
.partner-mission-card.is-locked>img{filter:grayscale(1) brightness(.55)}
.partner-mission-card.is-locked strong{color:var(--pixel-text-muted)}
/* Landscape phones: boss art beside the bounty name; smaller inline icons. */
@media(max-width:1000px) and (orientation:landscape){
 /* One line per row so the card never grows past its slot; full names stay in the card's accessible name. */
 .mg-hunt-preview{display:grid;grid-template-columns:52px minmax(0,1fr);column-gap:8px;align-content:safe center;text-align:left;overflow:hidden}
 .mg-hunt-preview>span{grid-column:1/-1;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .mg-hunt-preview>img{grid-column:1;grid-row:2/span 3;width:52px;height:52px;align-self:center}
 .mg-hunt-preview>strong,.mg-hunt-preview>.mg-matchup,.mg-hunt-preview>small{grid-column:2;justify-content:flex-start;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .mg-hunt-preview>strong{font-size:14px;line-height:1.2}
 .mg-hunt-preview>small{font-size:11px}
 .notice-stats .symbol-icon,.notice-stats .ui-pixel-icon{width:18px;height:18px}
 .loot-items .mg-gear-icon{width:28px;height:28px}
 .story-list>.story-shelf>.ui-pixel-icon:first-child{width:20px;height:20px}
 .mg-item>b .ui-pixel-icon,.mg-item>b .lock-icon{width:12px;height:12px}
 .mg-portrait-picker .picker-check{width:11px;height:11px}
 .mg-partner-tag .symbol-icon{width:12px;height:12px}
}
/* Narrow landscape phones (667×375 and below): the four gem tools use their short names so the gem cost stays visible. */
@media(max-width:700px) and (orientation:landscape){
 .split-combat .slot-side .feature-buttons>button{padding:1px 4px;gap:3px}
 .split-combat .slot-side .feature-buttons .gem-cost{min-width:0;padding:1px 3px}
 .split-combat .slot-side .feature-buttons .gem-tool-name[data-short]{font-size:0}
 .split-combat .slot-side .feature-buttons .gem-tool-name[data-short]:after{content:attr(data-short);font-size:10px;white-space:nowrap}
}

/* Board pressure (docs/BOARD-PRESSURE.md): partner symbols, monsters, chains, boss swaps and the seal badge. */
.symbol-cell.is-partner{box-shadow:inset 0 0 0 3px var(--cell-accent,var(--pixel-frame))}
.symbol-cell.is-monster{box-shadow:inset 0 0 0 3px #b8432e;background-color:#f1d1bf}
.symbol-cell.is-chained:before{content:'';position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(45deg,transparent 0 9px,#4b5559cc 9px 13px),repeating-linear-gradient(-45deg,transparent 0 9px,#4b5559cc 9px 13px);border:3px solid #39434a}
.symbol-cell.is-armed{box-shadow:inset 0 0 0 4px var(--pixel-action)}
.symbol-cell.is-armed:before{border-color:var(--pixel-action)}
.symbol-cell[data-badge]:after{content:attr(data-badge);position:absolute;right:3px;bottom:3px;padding:2px 4px;color:#ffe2b3;background:#702f24;border:1px solid #d88b70;font:700 10px Arial,sans-serif;letter-spacing:.08em}
.symbol-cell.is-chained[data-badge]:after{background:#2b3439;border-color:#9aa5a8;color:#e6ecea}
.symbol-cell[data-badge="CHẠY"]:after{background:#2f5a3a;border-color:#8cd6a0;color:#e9ffe9}
.symbol-cell.pressure-pop img{animation:pressure-pop .45s steps(3) 2}
@keyframes pressure-pop{50%{transform:scale(1.18)}}
.board-bottom .seal-badge{display:inline-flex;align-items:center;gap:6px;margin-left:auto;padding:3px 8px;border:2px solid #b8432e;background:var(--pixel-surface);color:var(--pixel-text);font:700 13px Arial,sans-serif;box-shadow:2px 2px 0 var(--pixel-frame-shadow)}
.board-bottom .seal-badge .glyph{width:20px;height:20px}
.board-bottom .seal-badge>em{display:inline-flex;align-items:center;gap:2px;font-style:normal;color:var(--pixel-frame-selected)}
.board-bottom .seal-badge.is-armed{border-color:var(--pixel-action);background:#4f5736}
.board-bottom .seal-badge:disabled{opacity:.55}
#feature-status.is-armed{display:inline-flex;align-items:center;gap:4px;color:var(--pixel-frame-selected);font-weight:700}
#feature-status .glyph{width:14px;height:14px}
.pressure-lesson{display:grid;grid-template-columns:72px minmax(0,1fr);gap:16px;align-items:start}
.pressure-lesson-icon{display:grid;place-items:center;width:72px;height:72px;border:2px solid var(--pixel-frame);background:#f3e2be;box-shadow:var(--pixel-panel-shadow)}
.pressure-lesson-icon .glyph{width:56px;height:56px}
.pressure-lesson-dialog .primary{width:100%;min-height:44px;margin-top:12px}
.bao-help,.bao-harm{display:flex;align-items:baseline;gap:8px;margin:6px 0}
.bao-help>b,.bao-harm>b{flex:none;min-width:38px;padding:1px 6px;font:700 11px Arial,sans-serif;text-align:center;border:1px solid}
.bao-help>b{color:#d9f5d0;background:#2f5a3a;border-color:#8cd6a0}
.bao-harm>b{color:#ffe2b3;background:#702f24;border-color:#d88b70}
.help-dialog .help-list article>b>.glyph,.help-dialog .help-list article>b>.ui-pixel-icon{width:36px;height:36px;image-rendering:pixelated}
/* The partner combat tab holds three rules: two side by side, the reel symbol ("báo") full width; scrolls locally if text wraps. */
.partner-tab-panel.partner-combat-panel{grid-template-columns:repeat(2,minmax(0,1fr));overflow-y:auto}
.partner-combat-panel>.partner-bao{grid-column:1/-1}
.partner-bao .partner-rule-title>img{image-rendering:pixelated}
/* Landscape phones: the seal badge keeps its sealed symbol and price; the words stay in its accessible name. */
@media(max-width:1000px) and (orientation:landscape){
 .board-bottom .seal-badge{gap:3px;padding:1px 4px;font-size:10px}
 .board-bottom .seal-badge .glyph{width:14px;height:14px}
 .board-bottom .seal-badge .seal-label{display:none}
}
/* Narrow landscape phones: boss and partner names step down so they fit their half of the stage. */
@media(max-width:700px) and (orientation:landscape){
 .split-combat .actor-status h1,.split-combat .actor-status h2{font-size:13px}
 .split-combat .element-matchup{font-size:8px;gap:0 4px}
}
/* Very short landscape phones (568×320): the lobby column tightens so the departure action stays on screen; turn cards drop the actor name. */
@media(max-height:340px) and (orientation:landscape){
 .mg-lobby-quest{gap:4px}
 .mg-lobby-quest>.mg-hunt-preview{min-height:66px;padding:4px}
 .mg-lobby-quest>.mg-hunt-preview>img{width:48px;height:48px}
 .mg-lobby-quest>.home-support{padding:3px 6px}
 .mg-lobby-quest>.home-support>.home-support-visual,.mg-lobby-quest .home-support-visual>img,.mg-lobby-quest .home-support-visual .potion-icon{width:30px;height:30px;flex-basis:30px}
 .mg-lobby-quest>.mg-button,.mg-lobby-quest>.mg-primary{min-height:30px;padding-block:4px}
 .mg-lobby-quest .mg-practice{min-height:14px}
 .split-combat .timeline-actor-name{display:none}
 /* Battle: the board keeps near-square cells by taking the full height on the left; wallets, forecast and the spin button stack in a narrow right column. */
 .split-combat .slot-side{grid-template-columns:minmax(0,1fr) 112px;grid-template-rows:26px minmax(0,1fr) 54px;grid-template-areas:"board heading" "board footer" "features features";gap:5px}
 .split-combat .slot-side>.slot-heading{grid-area:heading;min-width:0}
 .split-combat .slot-side>.board-frame{grid-area:board}
 .split-combat .slot-side>.feature-panel{grid-area:features}
 .split-combat .slot-side>.slot-footer{grid-area:footer;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 64px;gap:5px}
 .split-combat .slot-footer .battle-actions{height:64px}
 .split-combat .slot-footer>.result-panel{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;align-content:start}
 .split-combat .slot-footer .result-stats{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto;width:auto}
 /* Cover and heal orders stand in a column at the partner's side instead of across the art. */
 .split-combat .party-unit>.actor-orders{left:auto;right:0;bottom:0;flex-direction:column}
 .split-combat .actor-status>.eyebrow{display:none}
 .split-combat .element-matchup{font-size:8px;gap:0 4px}
 /* Management screens drop their decorative titles (the bottom nav names the screen) so grids keep usable cells. */
 .guild-room .guild-heading{display:none}
 .guild-notice{grid-template-columns:36px minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto auto;row-gap:0}
 .guild-notice>small{display:none}
 .guild-notice>img,.guild-notice>.job-emblem{grid-row:1/-1;width:36px;height:36px;align-self:center}
 .guild-notice>strong,.guild-notice>span:not(.notice-pin){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .workshop{grid-template-rows:30px minmax(0,1fr) 35px}
 .workshop-heading>div:first-child{display:none}
 .mg-bag .mg-grid{grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr))}
 .mg-grid .mg-item{aspect-ratio:1;width:auto;height:100%;justify-self:center}
 .mg-item-hero{display:none}
 .mg-item-detail{gap:3px;justify-content:flex-start}
 .mg-item-detail>*{flex:none}
 .mg-item-detail .mg-perk{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:0} /* min-height overrides the phone-tier perk height */
 .mg-item-detail .mg-symbols{padding:2px 0}
 .mg-item-detail .mg-symbols img{width:18px;height:18px}
 .craft-result>.bench-label,.craft-result>.result-plinth{display:none}
 .recipe-shelf>button{min-height:0;grid-template-columns:22px minmax(0,1fr);grid-template-rows:auto;padding:3px 4px}
 .recipe-shelf>button>.potion-icon,.recipe-shelf>button>.mg-gear-icon{width:20px;height:20px}
 .recipe-shelf>button>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .recipe-shelf>button>b{display:none}
}
/* Phones (any landscape height up to 600px): readable contract notice and unclipped partner rule cards. */
/* The contract notice uses the real viewport instead of the scaled 1280×720 stage. */
@media(max-height:600px) and (orientation:landscape){
 .game-dialog.mission-notice{width:min(900px,calc(100vw - 24px));height:calc(100dvh - 16px);transform:translate(-50%,-50%)}
 .mission-notice .dialog-body{padding:12px 16px}
 .mission-notice h2{font-size:20px;margin:2px 40px 6px 0}
 .mission-notice p{font-size:13px;margin:5px 0}
 .notice-summary{gap:12px}
 .notice-summary>img{width:72px;height:78px}
 .notice-actions{margin-top:6px;padding-top:6px}
 .mission-notice .notice-actions>p.notice-cost{font-size:12px;margin-bottom:6px}
 /* Partner combat tab: cards take their own height and the panel scrolls, so card text is never clipped. */
 .partner-tab-panel.partner-combat-panel{align-content:start;grid-auto-rows:auto}
}

/* Offline install, update and Install controls in the topbar (src/pwa.js). They reuse the topbar's .quiet button size. */
.update-dot{display:inline-block;width:8px;height:8px;margin-right:6px;background:var(--pixel-action);box-shadow:0 0 6px var(--pixel-action);vertical-align:middle;flex:none}
.update-dot.is-pulsing{animation:update-pulse 1.2s steps(4) infinite}
@keyframes update-pulse{0%,100%{opacity:.35}50%{opacity:1}}
.game-shell .topbar .icon-button{position:relative}
.game-shell .topbar .settings-dot{position:absolute;top:3px;right:3px;margin:0;width:6px;height:6px}
.game-shell .topbar .update-ready{border-color:var(--pixel-frame-selected);color:var(--pixel-frame-selected)}
.offline-status{margin:0 0 6px;font-size:13px;color:var(--pixel-text-muted)}
@media(prefers-reduced-motion:reduce){.update-dot.is-pulsing{animation:none}}

/* Settings: music and effects volume as four pixel steps (Tắt / Nhỏ / Vừa / To), not a browser slider. */
.volume-row{align-items:center}
.volume-steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;flex:none;width:232px}
.volume-steps button{min-height:44px;padding:4px 2px;border:2px solid var(--pixel-frame);border-radius:0;background:var(--pixel-surface);color:var(--pixel-text);font:700 12px Arial,sans-serif;box-shadow:2px 2px 0 var(--pixel-frame-shadow)}
.volume-steps button[aria-pressed="true"]{border-color:var(--pixel-frame-selected);background:var(--pixel-action);color:#182d32}
.volume-steps button:active{transform:translate(2px,2px);box-shadow:none}
@media(hover:hover){.volume-steps button:hover{border-color:var(--pixel-frame-selected)}}

/* Big / Mega / Ultra Win over the cabinet. */
.win-celebration{position:absolute;inset:0;z-index:40;display:grid;place-items:center;background:radial-gradient(ellipse at center,#0b1a22cc 20%,#050b0fee 75%);cursor:pointer;animation:win-in .18s ease-out}
.win-celebration.is-leaving{opacity:0;transition:opacity .2s}
.win-card{position:relative;z-index:2;display:grid;justify-items:center;gap:6px;padding:22px 48px;border:3px solid var(--pixel-frame-selected);background:linear-gradient(#1b3034,#0d1f26);box-shadow:var(--pixel-panel-shadow),0 0 40px #f5c55a55}
.win-label{font:900 64px/1 Georgia,serif;letter-spacing:.04em;color:#ffe08a;text-shadow:0 4px 0 #6b3d10,0 0 18px #ffd36988;white-space:nowrap}
.win-celebration[data-tier="mega"] .win-label{color:#ffb4f0;text-shadow:0 4px 0 #5a1d58,0 0 22px #ff8ae688}
.win-celebration[data-tier="ultra"] .win-label{color:#9ff3ff;text-shadow:0 4px 0 #13466b,0 0 28px #7fe8ffaa}
.win-celebration[data-tier="mega"] .win-card{border-color:#ff9ce6}
.win-celebration[data-tier="ultra"] .win-card{border-color:#8ce8ff;box-shadow:var(--pixel-panel-shadow),0 0 60px #7fe8ff66}
.win-amount{font:900 52px/1 Georgia,serif;color:var(--pixel-text);font-variant-numeric:tabular-nums}
.win-card>small{color:var(--pixel-text-muted);font:700 13px Arial,sans-serif;letter-spacing:.06em}
.win-celebration.is-pop .win-label{animation:win-pop .35s steps(4)}
.win-shower{position:absolute;inset:0;overflow:hidden;pointer-events:none}
.win-shower>i{position:absolute;left:var(--x);top:-12%;animation:win-fall 1.6s linear infinite;animation-delay:calc(var(--i) * -.13s)}
.win-shower .glyph{width:34px;height:34px}
.win-celebration.is-still .win-card{animation:none}
@keyframes win-in{from{opacity:0}}
@keyframes win-pop{0%{transform:scale(.6)}60%{transform:scale(1.15)}100%{transform:scale(1)}}
@keyframes win-fall{to{transform:translateY(130vh) rotate(540deg)}}
@media(prefers-reduced-motion:reduce){.win-shower{display:none}.win-celebration.is-pop .win-label{animation:none}}
@media(max-height:600px) and (orientation:landscape){
 .win-label{font-size:40px}.win-amount{font-size:34px}.win-card{padding:14px 28px}
 .volume-steps{width:204px}.volume-steps button{font-size:11px}
}

/* "Vì sao?": the turn ledger. */
.game-dialog.why-dialog{width:min(640px,94vw);overflow:hidden}
.why-dialog .dialog-body{display:flex;flex-direction:column;max-height:calc(88dvh - 8px)}
.why-dialog h2{flex:none;margin:2px 40px 8px 0}
.why-headline{flex:none;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin-bottom:10px}
.why-headline>span{display:grid;justify-items:center;padding:6px 4px;border:2px solid var(--pixel-frame);background:var(--pixel-surface)}
.why-headline small{font:700 10px Arial,sans-serif;letter-spacing:.06em;color:var(--pixel-text-muted);text-transform:uppercase}
.why-headline strong{display:flex;align-items:center;gap:3px;font:900 20px Georgia,serif;color:var(--pixel-text);font-variant-numeric:tabular-nums}
.why-scroll{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-right:6px}
.why-scroll.has-more{-webkit-mask-image:linear-gradient(#000 calc(100% - 28px),#0000);mask-image:linear-gradient(#000 calc(100% - 28px),#0000)}
.why-section{margin:0 0 10px}
.why-section h3{margin:0 0 4px;font:700 12px Arial,sans-serif;letter-spacing:.08em;text-transform:uppercase;color:var(--pixel-action)}
.game-dialog .why-line{display:grid;grid-template-columns:22px minmax(0,1fr) auto;align-items:center;gap:8px;max-width:none;margin:0;line-height:1.3;padding:5px 6px;border-bottom:1px solid #a9864d33;font-size:14px;color:var(--pixel-text)}
.why-line>b{font-variant-numeric:tabular-nums;white-space:nowrap}
.why-line.is-good>b{color:#9fd47f}
.why-line.is-bad>b,.why-line.is-bad>span{color:#ef9e7f}
.why-line.is-total{border-top:2px solid var(--pixel-frame);border-bottom:0;font-weight:700}
.why-line.is-total>b{color:var(--pixel-frame-selected)}
.why-icon{display:inline-block;width:20px;height:20px;object-fit:contain;image-rendering:pixelated}
.why-headline .why-icon{width:16px;height:16px}
@media(max-height:600px) and (orientation:landscape){
 .why-dialog .dialog-body{max-height:calc(94dvh - 8px)}
 .why-headline strong{font-size:16px}.game-dialog .why-line{font-size:12px;padding:3px 4px}
}
@media(max-height:340px) and (orientation:landscape){
 .why-dialog .dialog-body{padding:12px 18px}
 .why-dialog .eyebrow{display:none}
 .why-dialog h2{font-size:19px;margin:0 44px 6px 0}
 .why-headline{margin:0 50px 6px 0}.why-headline>span{grid-auto-flow:column;align-items:baseline;gap:6px;padding:3px 4px}
 .why-headline strong{font-size:14px}
 .why-headline>span:last-child>small{display:none}
}

/* Rotate screen (landscape-only game held upright): a top-layer modal over the whole window, so it also covers
   open dialogs. Same surface, type and buttons as the game; Fullscreen and Install share one size. */
dialog.rotate-screen{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;border:0;
 padding:max(24px,env(safe-area-inset-top)) 20px max(24px,env(safe-area-inset-bottom));overflow:auto;
 color:var(--pixel-text);background:radial-gradient(ellipse at 50% 32%,#1d3d45,var(--pixel-surface) 58%,#061116);text-align:center}
dialog.rotate-screen[open]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}
dialog.rotate-screen::backdrop{background:#061116}
.rotate-crest{width:132px;height:132px;object-fit:contain;filter:drop-shadow(3px 4px 0 var(--pixel-frame-shadow))}
.rotate-screen .eyebrow{color:var(--pixel-text-muted);letter-spacing:.16em}
.rotate-screen h2{margin:0;font:700 28px/1.15 Georgia,serif;color:var(--pixel-frame-selected)}
.rotate-screen p{margin:0;max-width:30ch;font:15px/1.5 Arial,sans-serif;color:var(--pixel-text)}
.rotate-actions{display:grid;gap:12px;width:min(300px,100%);margin-top:14px}
.rotate-actions>button{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:48px;padding:10px 16px;font-size:15px}
.rotate-actions .ui-pixel-icon{width:20px;height:20px;flex:none}
.rotate-screen .rotate-help{min-height:1.5em;font-size:13px;color:var(--pixel-text-muted)}
@media (prefers-reduced-motion:no-preference){.rotate-crest{animation:rotate-nudge 2.4s ease-in-out infinite}}
@keyframes rotate-nudge{0%,60%,100%{transform:rotate(0)}75%{transform:rotate(-12deg)}85%{transform:rotate(4deg)}}

/* "Vì sao?" lives on demand: the hub's info button at the top right of the result panel, after Xem lại.
   It never opens by itself; a soft ring marks it until the player has opened it once. */
.result-panel .section-title [data-action="replay"]{margin:0 8px 0 auto}
.result-panel .why-button{position:relative;display:grid;place-items:center;width:28px;height:28px;padding:0;font-size:17px;line-height:1;cursor:pointer}
/* Drawn at 28px to fit the heading row; the tap area reaches 44px. */
.result-panel .why-button::after{content:"";position:absolute;inset:-8px}
.result-panel .why-button:disabled{opacity:.35;cursor:default}
@media(hover:hover){.result-panel .why-button:not(:disabled):hover{border-color:var(--pixel-frame-selected);color:var(--pixel-frame-selected)}}
.result-panel .why-button.is-new{border-color:var(--pixel-frame-selected);box-shadow:0 0 0 2px #edc96f55}
@media(prefers-reduced-motion:no-preference){.result-panel .why-button.is-new{animation:why-ring 1.8s ease-in-out infinite}}
@keyframes why-ring{50%{box-shadow:0 0 0 5px #edc96f22}}
