/* Quiet materials at rest, finite local feedback on interaction. */
body :is(.gacha-frame,.cosmetic-frame,.mission-frame,.card-pool-panel){animation:general-panel-entry 190ms ease-out both}
@keyframes general-panel-entry{from{opacity:.72;translate:0 4px}to{opacity:1;translate:0 0}}
html[data-motion-screen="title"] body .title-art-panel-v2317{animation:none;transform:none;translate:none;scale:none;overflow:hidden}
/* Keep the background and title static, including older illustration pseudos. */
html[data-motion-screen="title"] body .title-art-panel-v2317:before,
html[data-motion-screen="title"] body .title-art-panel-v2317:after,
html[data-motion-screen="title"] body .home-title h1:after{content:none;animation:none}
html[data-motion-screen="title"] body .home-title h1{position:relative;overflow:hidden}
body :is(.title-entry-v2317,.title-sub-actions-v2317 button,.shared-mode-grid button,.profile-actions button,.gacha-count-presets button,.gacha-featured-thumbs button,.cosmetic-card-tile,.draft-card){transition:translate 160ms ease,scale 150ms ease,border-color 180ms ease,background-color 180ms ease,opacity 180ms ease}
@media(hover:hover){body :is(.title-entry-v2317,.title-sub-actions-v2317 button,.shared-mode-grid button,.profile-actions button,.gacha-count-presets button,.gacha-featured-thumbs button,.cosmetic-card-tile,.draft-card):hover:not(:disabled){translate:0 -2px}}
body :is(.title-entry-v2317,.title-sub-actions-v2317 button,.shared-mode-grid button,.profile-actions button,.gacha-count-presets button,.gacha-featured-thumbs button,.cosmetic-card-tile,.draft-card):active:not(:disabled){translate:0 1px;scale:.99}
body .game-app .battle-background:before{content:none;animation:none}
/* Turn ownership remains in the HUD; neither face row gets a turn frame. */
.general-motion-layer{position:fixed;inset:0;overflow:hidden;z-index:1650;pointer-events:none;contain:layout style;isolation:isolate}
body:has(.modal-backdrop) .general-motion-layer{visibility:hidden}
.general-motion-layer *{pointer-events:none!important;box-sizing:border-box}
.general-motion-layer>div{position:absolute}
.motion-mark{border:1px solid #d6c59b;border-radius:3px;box-shadow:none}
.motion-mark.motion-spent{border-color:#8b9ca8}.motion-mark.motion-number{border-color:#c6d3de}
.motion-mark.motion-victory{border:2px solid #e4cf91}.motion-mark.motion-defeat{border-color:#b78783}
/* Keep PR89's measured backdrop/compositing fixes intact. */
body.battle-screen-active :is(.roll-overlay,.cast-overlay,.place-overlay,.modal-backdrop.shared-panel-front){backdrop-filter:none!important}
body .gacha-header{backdrop-filter:none}
body .gacha-featured-secret{mask-image:none;-webkit-mask-image:none}
body .gacha-featured-slide:before{mix-blend-mode:normal}
body .face-tile[data-card]:focus-visible{outline:2px solid #f4d890;outline-offset:2px}
@media(hover:hover){body .face-tile[data-card]:hover{outline:1px solid var(--attr);outline-offset:1px}}
body .game-app :is(.face-tile.trigger,.face-tile.trigger-card,.face-tile.target-highlight){animation:none!important;transform:none!important;translate:none!important;filter:none!important;box-shadow:none!important;outline:1px solid #d9c392!important;outline-offset:-1px}
body .game-app .face-tile.trigger .face-copy b{font-size:inherit}
body .game-app :is(.destiny-toss-button,.tutorial-target,.online-status i.reconnecting){animation:none!important;box-shadow:none!important}
body .battle-fx-life-slot .life-fx-event{min-width:0;padding:2px 4px;border:0;border-radius:2px;box-shadow:none;background:#0d1821ed;transform:translate(0,-50%);animation:noble-life-enter 150ms ease-out both}
body .battle-fx-life-slot .life-fx-event[data-life-fx-player="1"]{transform:translate(-100%,-50%)}
body .battle-fx-life-slot .life-fx-event:before{content:none}
body .battle-fx-life-slot .life-fx-event strong{font:700 24px/1.15 Georgia,serif;letter-spacing:0;text-shadow:none}
body .battle-fx-life-slot .life-fx-event.damage{color:#efaaa3;background:#0d1821ed;box-shadow:none;border:0}
body .battle-fx-life-slot .life-fx-event.heal{color:#afd8bf;background:#0d1821ed;box-shadow:none;border:0}
body .battle-fx-life-slot.fx-exiting .life-fx-event{animation:noble-life-exit 230ms ease-in both}
@keyframes noble-life-enter{from{opacity:0;translate:0 2px}to{opacity:1;translate:0 0}}
@keyframes noble-life-exit{from{opacity:1}to{opacity:0}}
body .turn-announcement{width:min(320px,80vw);min-height:0;padding:12px 18px;border-color:#b6a17480;background:#0b1721ed;box-shadow:none;text-shadow:none;animation:noble-turn-fade 650ms ease both}
body .turn-announcement:before,body .turn-announcement:after,body .turn-announcement-line{display:none}
body .turn-announcement strong{font-size:22px;letter-spacing:.04em}
body .turn-announcement b{display:none}body .turn-announcement small{font-size:12px}
@keyframes noble-turn-fade{0%,100%{opacity:0}20%,75%{opacity:1}}
body .roll-overlay.final .roll-result-card{animation:motion-roll-finish 180ms ease-out both}
@keyframes motion-roll-finish{from{opacity:.8;scale:.99}to{opacity:1;scale:1}}
html.motion-document-hidden .gacha-featured-art img{animation-play-state:paused!important}
/* Queue status occupies header space, never a floating position over the HUD. */
body .app>.shared-header.has-ranked-queue{gap:8px}
body .shared-header.has-ranked-queue .brand{flex:1 1 auto!important;min-width:0;width:auto!important;overflow:hidden;text-overflow:ellipsis}
body .shared-header .ranked-cpu-queue-strip{position:static;inset:auto;flex:0 1 auto;width:auto;max-width:400px;height:calc(var(--shared-bar) - 1px);min-width:0;margin:0;padding:0 8px;transform:none;gap:12px;border:0;border-inline:1px solid #7d6e4b;border-radius:0;background:#111c26;box-shadow:none;backdrop-filter:none;animation:none}
body .shared-header .ranked-cpu-queue-strip strong{font-size:12px;line-height:1.2;font-weight:500;color:#e2d2ac}
body .shared-header .ranked-cpu-queue-strip .btn{height:var(--shared-bar);min-height:0;padding:0 6px;border:0;border-radius:0;background:transparent;box-shadow:none;color:#f4ecda;font-size:12px;line-height:1;white-space:nowrap}
body .shared-header .ranked-cpu-queue-strip.disconnected strong{color:#efb6ae}
body .shared-header.has-ranked-queue [data-shared-menu]{flex:0 0 104px;margin-left:0}
.ability-keyword{display:inline;margin:0;padding:1px 2px;border:0;border-bottom:1px solid #ac9565;border-radius:0;background:transparent;color:inherit;font:inherit;font-weight:600;line-height:inherit;cursor:pointer;white-space:nowrap;vertical-align:baseline;box-shadow:none;text-shadow:none}
.ability-keyword:hover,.ability-keyword:focus-visible{color:#ffebbd;background:#b79c5926;outline:1px solid #b79c59;outline-offset:1px}
dialog.ability-keyword-help{box-sizing:border-box;position:fixed;inset:0;width:min(460px,calc(100vw - max(16px,env(safe-area-inset-left)) - max(16px,env(safe-area-inset-right))));max-width:100%;max-height:calc(100dvh - max(16px,env(safe-area-inset-top)) - max(16px,env(safe-area-inset-bottom)));margin:auto;padding:16px 20px 20px;border:1px solid #a99467;border-radius:5px;background:#101d29;color:#f2eddf;box-shadow:0 14px 36px #0008, inset 0 1px #f8e5b91c;overflow:auto;overscroll-behavior:contain;font:400 14px/1.65 system-ui;animation:none}
dialog.ability-keyword-help::backdrop{background:#02070d66;backdrop-filter:none}
.ability-keyword-help header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 8px;border-bottom:1px solid #7f70524d}
.ability-keyword-help h2{margin:0;font:600 21px/1.4 "Yu Mincho","Hiragino Mincho ProN",serif;color:#e5d3a6}
.ability-keyword-help p{margin:12px 0 0;overflow-wrap:anywhere}
.ability-keyword-help [data-keyword-close]{flex:0 0 44px;min-height:44px;border:0;border-radius:2px;background:transparent;color:#f2eddf;font:400 24px/1 system-ui;cursor:pointer}
.ability-keyword-help [data-keyword-close]:focus-visible{outline:2px solid #ddc792;outline-offset:-3px}
@media(max-width:1180px) and (max-height:600px) and (orientation:landscape){
 body .shared-header .ranked-cpu-queue-strip{gap:8px;padding-inline:6px}
 body .shared-header.has-ranked-queue .brand{font-size:12px!important;padding-inline:0!important}
 body .shared-header.has-ranked-queue [data-shared-menu]{flex-basis:92px;width:92px}
 body .battle-fx-life-slot .life-fx-event strong{font-size:18px}
 dialog.ability-keyword-help{width:min(560px,calc(100vw - max(16px,env(safe-area-inset-left)) - max(16px,env(safe-area-inset-right))));padding:10px 16px 16px}
 .ability-keyword-help p{margin-top:8px}
}
@media(prefers-reduced-motion:reduce){
 body :is(.gacha-frame,.cosmetic-frame,.mission-frame,.card-pool-panel){animation:none!important}
 body .roll-overlay.final .roll-result-card,body .turn-announcement,body .battle-fx-life-slot .life-fx-event{animation:none!important}
 body :is(.title-entry-v2317,.title-sub-actions-v2317 button,.shared-mode-grid button,.profile-actions button,.gacha-count-presets button,.gacha-featured-thumbs button,.cosmetic-card-tile,.draft-card){transition:none;translate:none!important;scale:1!important}
}

/* PR87 finalization: reclaim vertical space for both six-face boards. */
body .game-app .face-table{grid-template-rows:minmax(0,1fr) 8px minmax(0,1fr);gap:3px}
body .game-app .face-shade{background:linear-gradient(180deg,#03091000 40%,#07121b22 66%,#08151fbb 100%)}
body .game-app .face-tile .face-copy{bottom:28px!important;min-height:20px;padding:2px 6px!important;background:#0c1923df}
body .game-app .face-tile .face-copy b{white-space:nowrap;display:block;overflow:hidden;text-overflow:ellipsis;line-height:20px!important}
body .game-app .face-tile .face-result{height:28px;padding:1px 5px}
body .game-app .face-tile .key-effect{min-height:24px}
body .game-app .face-tile .key-effect b{font-size:22px}
body .game-app .face-tile .face-copy:before{content:none}
body .game-app .face-row:has(.board-skin-layer[data-cosmetic-rarity]:not([data-cosmetic-rarity="0"]))>.face-tile{margin:0}
body .game-app :is(.hand-zone,.mana-zone-main,.combatant,.turn-center){backdrop-filter:none}
@media(min-width:1181px),(min-height:601px){
 body .game-app .game-shell{grid-template-rows:90px minmax(0,1fr) 165px;gap:6px;padding-block:6px}
 body .game-app .score-strip>.combatant{grid-template-rows:52px 32px;gap:0 12px;padding:2px 8px}
 body .game-app .battle-identity,body .game-app .desktop-nameplate{height:52px}
 body .game-app .nameplate-content{grid-template-rows:20px 20px;padding:4px var(--plate-safe-right,12px) 4px var(--plate-safe-left,12px);gap:2px}
 body .game-app .nameplate-name-row{height:20px}
 body .game-app .nameplate-player,body .game-app .nameplate-role{line-height:20px!important}
 body .game-app .nameplate-title{height:20px;min-height:20px;line-height:20px!important}
 body .game-app .nameplate-content.long-title{grid-template-rows:18px 32px;gap:0;padding-block:1px}
 body .game-app .long-title .nameplate-name-row{height:18px}
 body .game-app .long-title .nameplate-player,body .game-app .long-title .nameplate-role{line-height:18px!important}
 body .game-app .long-title .nameplate-title{height:32px;min-height:32px;line-height:15px!important}
 body .game-app .nameplate-content.untitled{grid-template-rows:22px}
 body .game-app .combatant .life{font-size:30px}
 body .game-app .combatant .mana-orb{height:32px;min-height:32px!important;width:90px;min-width:90px;grid-template-rows:20px 11px!important;padding:0 5px!important}
 body .game-app .combatant .mana-orb strong{font-size:24px}
 body .game-app .combatant .mana-orb small{line-height:11px}
 body .game-app .combatant .public-counts span{height:14px;padding:0;line-height:14px}
 body .game-app .combatant .public-counts b{font-size:13px;line-height:14px}
 body .game-app .combatant.cpu>.cpu-deck-mini{top:15px}
 body .game-app .turn-center{padding:2px 6px!important;grid-template-rows:20px minmax(0,1fr)!important}
 body .game-app .turn-center:has(.ranked-timer-panel){grid-template-rows:20px minmax(0,1fr) 17px!important}
 body .game-app .turn-center .phase-copy>b{font-size:15px}
 body .game-app .play-dock .hand-zone{padding:5px 8px;grid-template-rows:20px minmax(0,1fr)}
 body .game-app .play-dock .hand-head{height:20px}
}
@media(max-width:1180px) and (max-height:600px) and (orientation:landscape){
 body.battle-screen-active .game-app .game-shell{grid-template-rows:60px minmax(0,1fr) 96px;gap:3px}
 body.battle-screen-active .game-app .score-strip,body.battle-screen-active .game-app .turn-center{height:60px}
 body.battle-screen-active .game-app .score-strip>.combatant{height:60px;grid-template-rows:30px 24px;gap:0 6px;padding:2px 5px}
 body.battle-screen-active .game-app .battle-identity,body.battle-screen-active .game-app .desktop-nameplate{height:30px}
 body.battle-screen-active .game-app .nameplate-content{grid-template-rows:15px 15px;gap:0}
 body.battle-screen-active .game-app .nameplate-content.untitled{grid-template-rows:30px}
 body.battle-screen-active .game-app .nameplate-title{min-height:15px;height:15px;line-height:15px!important}
 body.battle-screen-active .game-app .combatant .life-block{flex-direction:row;align-items:baseline;gap:3px;min-width:0}
 body.battle-screen-active .game-app .combatant .life{font-size:23px}
 body.battle-screen-active .game-app .combatant .stat-label{font-size:7px;letter-spacing:0}
 body.battle-screen-active .game-app .combatant .mana-orb{position:relative;height:26px!important;min-height:26px!important;grid-template-rows:15px 10px!important;padding:0 3px!important}
 body.battle-screen-active .game-app .combatant .mana-orb:after{content:"";position:absolute;inset:-7px 0;pointer-events:auto}
 body.battle-screen-active .game-app .combatant .mana-orb strong{font-size:21px}
 body.battle-screen-active .game-app .combatant .mana-orb small{font-size:9px!important}
 body.battle-screen-active .game-app .combatant .public-counts{gap:0}
 body.battle-screen-active .game-app .combatant .public-counts span{height:12px;padding:0 2px;line-height:12px}
 body.battle-screen-active .game-app .combatant .public-counts b{font-size:11px;line-height:12px}
 body.battle-screen-active .game-app .turn-center{padding:2px 4px;gap:0}
 body.battle-screen-active .game-app .face-table{grid-template-rows:minmax(0,1fr) 6px minmax(0,1fr);padding-block:1px;gap:2px}
 body.battle-screen-active .game-app .face-tile .face-copy{bottom:20px!important;min-height:17px!important;padding:1px 4px!important}
 body.battle-screen-active .game-app .face-tile .face-copy b{font-size:12px!important;line-height:17px!important}
 body.battle-screen-active .game-app .face-tile .face-result{height:20px;padding:0 3px}
 body.battle-screen-active .game-app .face-tile .key-effect{min-height:18px}
 body.battle-screen-active .game-app .face-tile .key-effect b{font-size:17px}
 body.battle-screen-active .game-app .play-dock .hand-zone{padding:2px 4px 3px!important;grid-template-rows:12px minmax(0,1fr)}
 body.battle-screen-active .game-app .play-dock .hand-head{height:12px}
}
/* Legacy assign-grid columns must not survive the face-selection flex layout. */
body .face-selection-modal{min-width:0;max-width:100%;grid-template-columns:minmax(0,1fr);box-sizing:border-box}
body .face-selection-modal>*{min-width:0;max-width:100%;box-sizing:border-box}
body .face-selection-modal>.modal-actions{width:100%;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}
body .face-selection-modal>.modal-actions>.btn{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
body .modal-backdrop:has(>.face-selection-modal){box-sizing:border-box;padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));backdrop-filter:none}
@media(max-width:1180px) and (max-height:600px) and (orientation:landscape){
 body.battle-screen-active .face-selection-modal{width:100%;max-width:920px;max-height:calc(100dvh - 28px - max(12px,env(safe-area-inset-top)) - max(12px,env(safe-area-inset-bottom)));padding:7px;gap:4px}
 body.battle-screen-active .face-selection-modal .choice-grid{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);overflow:hidden;flex:0 1 auto}
 body.battle-screen-active .face-selection-modal .face-choice-select{min-height:82px;padding:4px;gap:1px}
 body.battle-screen-active .face-selection-modal .face-choice-art{height:44px;flex-basis:33px;width:33px}
 body.battle-screen-active .face-selection-modal .face-choice-heading{line-height:17px}
 body.battle-screen-active .face-selection-modal>.modal-actions{flex-wrap:nowrap;gap:6px}
 body.battle-screen-active .face-selection-modal>.modal-actions>.btn{min-height:44px;flex:0 1 auto;font-size:12px;padding:5px 10px}
}
@media(max-width:1180px) and (max-height:375px) and (orientation:landscape){
 body.battle-screen-active .face-selection-modal .face-choice-select{min-height:75px}
}

body .nameplate-role-compact{display:none}

/* Battle feedback: a single receipt and one local outline, never an idle loop. */
body .battle-install-feedback{position:fixed;z-index:630;left:50%;top:45%;transform:translate(-50%,-50%);display:flex;align-items:center;gap:12px;box-sizing:border-box;width:328px;max-width:calc(100vw - max(16px,env(safe-area-inset-left)) - max(16px,env(safe-area-inset-right)));padding:9px 13px 9px 9px;border:1px solid #a992648c;border-radius:5px;background:linear-gradient(115deg,#10222af5,#0c1923ed);box-shadow:0 4px 16px #02081040;color:#f3ead8;font:600 16px/1.4 system-ui;pointer-events:none;animation:battle-receipt-fade var(--card-use-duration,1600ms) linear both}
body .battle-card-use-art{display:block;flex:0 0 68px;height:88px;background-size:cover;background-position:center 30%;border:1px solid #bba77880;border-radius:2px}
body .battle-card-use-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:6px}
body .battle-card-use-copy strong{font:600 18px/1.45 "Yu Mincho","Hiragino Mincho ProN",serif;overflow-wrap:anywhere}
body .battle-install-feedback small{display:flex;gap:8px;min-width:0;font-size:12px;font-weight:400;line-height:1.4;color:#c6b995;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body .battle-card-use-player{display:none}
body .battle-card-use-action{flex:none;color:#e3d4b2}
@keyframes battle-receipt-fade{0%,100%{opacity:0}10%,92.5%{opacity:1}}
body .general-motion-layer .motion-place,body .general-motion-layer .motion-selected-face{border:2px solid #fff0bb;background:#ffe4a015;box-shadow:inset 0 0 0 1px #151e29,0 0 7px #e9cd7538,inset 0 0 9px #ffe4a012;border-radius:4px}
body .general-motion-layer .motion-selected-face{border-color:#f4efd9;background:#e3efff1e;box-shadow:inset 0 0 0 1px #151e29,0 0 7px #dce8e83b,inset 0 0 9px #e3efff12}
body .game-app .face-tile.trigger-card:not(.trigger){outline:none!important}
@media(prefers-reduced-motion:reduce){body .battle-install-feedback{animation:none}}
@media(max-width:1180px) and (max-height:600px) and (orientation:landscape){
 body .battle-install-feedback{width:240px;font-size:13px;line-height:18px;padding:6px 10px 6px 6px;gap:9px}
 body .battle-card-use-art{flex-basis:48px;height:60px}
 body .battle-card-use-copy{gap:3px}
 body .battle-card-use-copy strong{font-size:15px;line-height:20px}
 body .battle-install-feedback small{font-size:11px}
 /* Reclaim only 2px from PR91: 62px HUD, unchanged hand, 1px per face row. */
 body.battle-screen-active .game-app .game-shell{grid-template-rows:62px minmax(0,1fr) 96px}
 body.battle-screen-active .game-app .score-strip,body.battle-screen-active .game-app .turn-center{height:62px}
 body.battle-screen-active .game-app .score-strip>.combatant{height:62px;min-width:0;grid-template-columns:minmax(0,1fr) auto auto;grid-template-rows:24px 26px;gap:2px 5px;padding:5px 5px;box-sizing:border-box}
 body.battle-screen-active .game-app .score-strip>.combatant.cpu{grid-template-columns:auto auto minmax(0,1fr)}
 body.battle-screen-active .game-app .battle-identity,body.battle-screen-active .game-app .desktop-nameplate{height:24px;min-width:0;max-width:100%;overflow:hidden}
 body.battle-screen-active .game-app .nameplate-content{height:24px;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);grid-template-rows:24px;align-items:center;padding:0 6px;gap:0 5px;overflow:hidden;container-type:normal}
 body.battle-screen-active .game-app .nameplate-content.untitled{grid-template-columns:minmax(0,1fr);grid-template-rows:24px}
 body.battle-screen-active .game-app .nameplate-name-row{height:20px;min-width:0;gap:4px;padding:0}
 body.battle-screen-active .game-app .untitled .nameplate-name-row{height:20px}
 body.battle-screen-active .game-app .nameplate-player{font-size:13px;line-height:18px!important;letter-spacing:0;flex:1;min-width:0}
 body.battle-screen-active .game-app .nameplate-role-full{display:none}
 body.battle-screen-active .game-app .nameplate-role-compact{display:inline}
 body.battle-screen-active .game-app .nameplate-role{font-size:9px;line-height:18px!important;letter-spacing:0;flex:none}
 body.battle-screen-active .game-app .nameplate-title{display:block;box-sizing:border-box;font-size:11px;line-height:18px!important;height:18px;min-height:18px;min-width:0;max-width:100%;padding:0 0 0 5px;border-left:1px solid #b6a17466;background:transparent;box-shadow:none;letter-spacing:0;color:#e9d5a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body.battle-screen-active .game-app .nameplate-art{background-size:100% 100%;background-position:center;opacity:.72}
 body.battle-screen-active .game-app .combatant[data-cosmetic-rarity="2"] .nameplate-art{background-size:100% 220%;background-position:center 47%;opacity:.62}
 body.battle-screen-active .game-app .desktop-nameplate{background:#0b1a24}
 body.battle-screen-active .game-app .combatant>.resource-now,body.battle-screen-active .game-app .combatant>.public-counts,body.battle-screen-active .game-app .combatant>.life-block{min-width:0;max-width:100%;margin:0}
 body.battle-screen-active .game-app .combatant .stat-label{font-size:9px}
 body.battle-screen-active .game-app .combatant .mana-orb{width:64px;min-width:64px;max-width:64px}
 body.battle-screen-active .game-app .combatant .mana-orb small{font-size:10px!important}
 body.battle-screen-active .game-app .combatant .public-counts span{font-size:10px}
}

/* Center six faces in the safe play area. The floating action has no grid track. */
body .game-app .face-table{--board-side-gutter:92px;position:relative;padding-inline:0}
body .game-app .face-table>.face-row{padding-left:var(--board-side-gutter);padding-right:var(--board-side-gutter);box-sizing:border-box}
body .game-app .face-row>.board-skin-layer{left:var(--board-side-gutter);right:var(--board-side-gutter)}
body .game-app .face-table>.dice-divider{padding-left:var(--board-side-gutter);padding-right:var(--board-side-gutter);box-sizing:border-box}

/* PR97: a persistent die, with one finite flight/contact/settle timeline. */
body .dice-motion-overlay{
 position:fixed;inset:0;z-index:640;display:grid;place-items:center;
 padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
 box-sizing:border-box;pointer-events:none;overflow:hidden;
 background:transparent!important;backdrop-filter:none!important;animation:none!important;
}
body .dice-motion-stage{--dice-size:82px;position:relative;width:1em;height:1em;font-size:var(--dice-size);perspective:900px;transform:translateY(12px)}
body .dice-motion-flight{position:absolute;inset:0;transform-style:preserve-3d}
body .dice-motion-overlay .dice-cube-wrap,body .dice-motion-overlay .dice-cube{
 width:1em;height:1em;position:relative;transform-style:preserve-3d;
 animation:none!important;filter:none!important;perspective:none;will-change:auto;
}
body .dice-motion-overlay .cube-face{border-radius:.065em!important;border-width:.022em!important;box-sizing:border-box}
body .dice-motion-overlay .cube-face.front{transform:translateZ(.5em)}
body .dice-motion-overlay .cube-face.back{transform:rotateY(180deg) translateZ(.5em)}
body .dice-motion-overlay .cube-face.right{transform:rotateY(90deg) translateZ(.5em)}
body .dice-motion-overlay .cube-face.left{transform:rotateY(-90deg) translateZ(.5em)}
body .dice-motion-overlay .cube-face.top{transform:rotateX(90deg) translateZ(.5em)}
body .dice-motion-overlay .cube-face.bottom{transform:rotateX(-90deg) translateZ(.5em)}
body .dice-motion-overlay .cube-face .die-face-pips{width:.76em;height:.76em;padding:.035em;gap:.035em;box-sizing:border-box}
body .dice-motion-overlay .cube-face .pip{width:.125em;height:.125em}
body .dice-motion-overlay .dice-ground-shadow{display:none}
body .dice-motion-shadow{position:absolute;inset:0;z-index:-1;border-radius:50%;background:radial-gradient(ellipse,#030508 18%,#030508bb 45%,transparent 72%);transform-origin:center;pointer-events:none}
body .dice-motion-result{position:absolute;top:calc(var(--dice-size)*1.25);left:50%;transform:translateX(-50%);font:500 12px/1.4 system-ui;white-space:nowrap;padding:3px 12px;border:1px solid #b7a06d77;border-radius:20px;background:#0b1420ee;color:#e3d5b7;visibility:hidden}
body .dice-motion-result b{font-size:20px;color:#fff2d1;margin-left:4px;font-variant-numeric:tabular-nums}
body .dice-motion-overlay[data-dice-phase="result"] .dice-motion-result{visibility:visible}
@media (orientation:landscape) and (max-height:600px){
 body .dice-motion-stage{--dice-size:52px;transform:translateY(9px)}
 body .dice-motion-result{font-size:11px;padding:1px 10px}
 body .dice-motion-result b{font-size:17px}
}

/* Proposal header/timer and actions never belong to a scrolling region. */
body .ranked-cpu-proposal-overlay{
 height:calc(100dvh - var(--shared-header-height,0px));max-height:calc(100dvh - var(--shared-header-height,0px));box-sizing:border-box;overflow:hidden;
 place-items:center;padding:calc(10px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
 overscroll-behavior:contain;backdrop-filter:none;
}
body .ranked-cpu-proposal-overlay>section.ranked-proposal-dialog{
 width:min(600px,100%);max-width:100%;max-height:100%;min-height:0;
 box-sizing:border-box;display:grid;grid-template-rows:auto minmax(0,1fr) auto;
 overflow:hidden;padding:20px;border-radius:16px;text-align:left;
}
body .ranked-proposal-header{display:flex;align-items:center;justify-content:space-between;gap:14px;min-width:0}
body .ranked-proposal-header h2{font-size:24px;line-height:1.35;margin:0;min-width:0}
body .ranked-proposal-clock{width:76px;flex:0 0 76px;display:flex;align-items:baseline;justify-content:flex-end;gap:5px}
body .ranked-proposal-clock .ranked-countdown{font-size:42px;line-height:1;margin:0;width:2ch;text-align:right;letter-spacing:0;font-variant-numeric:tabular-nums}
body .ranked-proposal-clock small{font-size:12px;color:#d5c8ab}
body .ranked-proposal-body{min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;padding:10px 0}
body .ranked-proposal-body .ranked-opponent{justify-content:flex-start;margin:4px 0;min-width:0}
body .ranked-proposal-body .ranked-opponent>div{min-width:0}
body .ranked-proposal-body .ranked-opponent strong{display:block;overflow-wrap:anywhere}
body .ranked-proposal-body .ranked-cpu-paused-copy{margin:7px 0 0}
body .ranked-proposal-footer{position:relative;border-top:1px solid #b99a5144;padding-top:10px;background:#0d121b}
body .ranked-proposal-footer p{min-height:1.5em;margin:0 0 9px;font-size:12px;line-height:1.5}
body .ranked-proposal-footer .modal-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;margin:0}
body .ranked-proposal-footer .modal-actions .btn{width:100%;min-width:0;min-height:48px;margin:0;padding:8px 12px;white-space:normal;line-height:1.3;font-size:15px;touch-action:manipulation}
@media (max-height:500px){
 body .ranked-cpu-proposal-overlay>section.ranked-proposal-dialog{padding:12px 16px;border-radius:12px}
 body .ranked-proposal-header h2{font-size:21px}
 body .ranked-proposal-clock .ranked-countdown{font-size:34px}
 body .ranked-proposal-body{padding:5px 0}
 body .ranked-proposal-body .ranked-opponent{gap:10px}
 body .ranked-proposal-body .rank-gem{width:40px;height:40px}
 body .ranked-proposal-footer{padding-top:7px}
 body .ranked-proposal-footer p{margin-bottom:6px}
 body .ranked-proposal-footer .modal-actions .btn{min-height:46px}
}
body .game-app .board-end-turn{position:absolute;right:8px!important;top:50%;margin:0!important;transform:translateY(-50%)}
@media(max-width:1180px) and (max-height:600px) and (orientation:landscape){
 body.battle-screen-active .game-app .game-shell{padding-left:calc(5px + env(safe-area-inset-left));padding-right:calc(5px + env(safe-area-inset-right))}
 body.battle-screen-active .game-app .face-table{--board-side-gutter:70px}
 body.battle-screen-active .game-app .board-end-turn{right:5px!important;width:60px!important;height:60px!important;min-width:60px;min-height:60px}
}

/* Result: warm rim and short corner lights, with a clear unpainted centre.
   A little side shade makes the original upper material read as the lit face. */
body .dice-motion-overlay .dice-result-face>.die-face-pips{position:relative;z-index:1}
body .dice-motion-overlay .dice-result-face:after{
 content:"";position:absolute;inset:0;z-index:0;border-radius:inherit;pointer-events:none;opacity:0;
 background:
  linear-gradient(#edc06e,#edc06e) left top/24% 3px no-repeat,
  linear-gradient(#edc06e,#edc06e) left top/3px 24% no-repeat,
  linear-gradient(#dbab54,#dbab54) right top/24% 3px no-repeat,
  linear-gradient(#dbab54,#dbab54) right top/3px 24% no-repeat,
  linear-gradient(#dbab54,#dbab54) left bottom/24% 3px no-repeat,
  linear-gradient(#dbab54,#dbab54) left bottom/3px 24% no-repeat,
  linear-gradient(#edc06e,#edc06e) right bottom/24% 3px no-repeat,
  linear-gradient(#edc06e,#edc06e) right bottom/3px 24% no-repeat,
  radial-gradient(ellipse at 0 0,#dcb26055,transparent 24%),
  radial-gradient(ellipse at 100% 100%,#dcb2603d,transparent 22%);
 box-shadow:inset 0 0 0 1.8px #ad792bd9,0 0 4px #d6a84c33;
}
body .dice-motion-overlay[data-dice-stopped="true"] .dice-result-face:after{animation:dice-result-edge 600ms ease-in-out both}
body .dice-motion-overlay[data-dice-stopped="true"] .cube-face:not(.dice-result-face):after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:#09121d26;animation:dice-result-edge 600ms ease-in-out both}
body .dice-motion-overlay[data-dice-stopped="true"] .dice-motion-result{visibility:visible}
@keyframes dice-result-edge{0%,18%{opacity:1}100%{opacity:0}}
@media(prefers-reduced-motion:reduce){
 body .dice-motion-overlay[data-dice-stopped="true"] .dice-result-face:after,
 body .dice-motion-overlay[data-dice-stopped="true"] .cube-face:not(.dice-result-face):after{animation:none;opacity:0}
}

.battle-departure{overflow:visible!important;pointer-events:none!important}
.battle-departure-label{position:absolute;z-index:10;bottom:0;left:0;max-width:180px;white-space:nowrap;padding:3px 5px;border:1px solid #efd59d;border-radius:4px;background:#152131;color:#ffebba;font:600 11px/1.3 system-ui;box-shadow:0 2px 8px #0008}
