/* One material language: black Palor, aged brass, and restrained vitae light.
   Frames are paint only. They never change arena dimensions or input timing. */
:root{
 --palor-stone:#101512;--palor-deep:#080c0b;--palor-brass:#a68b52;
 --palor-edge:#806d465c;--palor-ivory:#efe2c4;--palor-muted:#afb5a4;
 --palor-surface:radial-gradient(ellipse at 0 0,#4b625322,transparent 65%),
  repeating-linear-gradient(113deg,#c3b99403 0 1px,transparent 1px 5px),
  linear-gradient(145deg,#1b221d,#101713 45%,#0a100e);
}
/* The same forged rim is used in the lobby, room settings and the arena. */
body :is(#dialog[open],#modal[open],.shared-feedback,.reaction-map-notice,
 .intent-map-notice,.prepared-action,.arena-choice-popup,.match-menu-items,
 .ss-tools-items,.unit-drawer,.pieces-panel,.history-drawer[open],.panel,.room-card,.upkeep-feedback){
 color:var(--palor-ivory);background:var(--palor-surface)!important;
 border:1px solid var(--palor-brass);border-radius:2px;
 box-shadow:0 12px 28px #0006,inset 0 0 0 3px #080d0ab0,inset 0 0 0 4px #c5a56519;
}
body :is(#modal[open],#dialog[open],.shared-feedback,.reaction-map-notice){
 background-image:
  linear-gradient(var(--popup-player,#aa955d),var(--popup-player,#aa955d)),
  linear-gradient(var(--popup-player,#aa955d),var(--popup-player,#aa955d)),
  linear-gradient(var(--palor-brass),var(--palor-brass)),
  linear-gradient(var(--palor-brass),var(--palor-brass)),
  var(--palor-surface)!important;
 background-size:25px 2px,2px 25px,25px 2px,2px 25px,auto,auto,auto!important;
 background-position:7px 7px,7px 7px,calc(100% - 7px) calc(100% - 7px),calc(100% - 7px) calc(100% - 7px),0 0,0 0,0 0!important;
 background-repeat:no-repeat,no-repeat,no-repeat,no-repeat,no-repeat,repeat,no-repeat!important;
}
body.gameplay-screen .player-owned-popup{
 border-color:var(--palor-brass)!important;
 box-shadow:0 12px 28px #0006,inset 0 0 0 3px #080d0ab0,inset 0 0 0 4px #c5a56519!important;
}
body :is(#dialog,#modal,.shared-feedback) :is(h2,h3){color:var(--palor-ivory);text-wrap:balance}
body :is(#dialog,#modal) p{color:#d2d6c7}
body :is(#dialog,#modal) :is(.popup-drag,.shell-drag){
 color:#a6ad9b;font:10px/1.4 Alegreya,Georgia,serif;letter-spacing:.07em;
 border-bottom:1px solid var(--palor-edge);padding-bottom:6px;margin-bottom:9px;
}
body :is(#dialog,#modal,.shared-feedback) .player-popup-owner{
 font:600 12px/1.4 Alegreya,Georgia,serif;color:var(--popup-player,#c3a968);
 letter-spacing:.035em;padding:0;border:0;margin:4px 0 9px;
}
body .player-popup-owner:before{
 width:7px;height:11px;clip-path:polygon(50% 0,100% 30%,75% 80%,50% 100%,25% 80%,0 30%);
 transform:none;animation:none!important;box-shadow:none;
}
body :is(#dialog,#modal,.arena-choice-popup,.prepared-action) button{
 border-radius:2px;min-height:36px;line-height:1.25;
 background:linear-gradient(150deg,#303c2a,#1b291f);color:#eee4ce;
 border:1px solid #9d8b5c90;box-shadow:inset 0 0 0 2px #07110d66;
 transition:background-color 80ms,border-color 80ms;
}
body :is(#dialog,#modal,.arena-choice-popup,.prepared-action) button:is(.gold,.primary){
 background:linear-gradient(130deg,#7c6a3c,#4b482b);border-color:#c5aa70;color:#fff3d4;
}
body :is(#dialog,#modal,.arena-choice-popup,.prepared-action) button:hover:not(:disabled){
 border-color:#e0c88e;box-shadow:inset 0 0 0 2px #a98a3f26;
}
body :is(#dialog,#modal) button:focus-visible{outline:2px solid #dfc58b;outline-offset:2px}
body.gameplay-screen #modal .combat-resolution>button.gold{
 position:sticky;bottom:0;z-index:2;box-shadow:0 -6px 12px #0b120e;
}
body :is(#modal,#dialog,.shared-feedback,.reaction-map-notice,.intent-map-notice){
 animation:none!important;transition:none!important;
}
body.gameplay-screen .popup-champion img{
 width:44px;height:44px;border:1px solid #c3a968;
 box-shadow:0 0 0 2px #080d0b,0 0 0 3px #b69d5844;
}
/* Fixed information rails: restrained frames rather than a stack of cards. */
body.gameplay-screen :is(.champion-rail,.event-rail){
 background:linear-gradient(150deg,#172019,#0a120e 70%);
 border-color:var(--palor-edge);box-shadow:inset 0 0 0 3px #050a0760;
}
body.gameplay-screen :is(.roster-panel,#detail){background:transparent;border-color:var(--palor-edge)}
body.gameplay-screen .roster-player{
 background:linear-gradient(110deg,#adb27809,transparent);
 border-color:#9f895438;border-radius:2px;box-shadow:none;
}
body.gameplay-screen .response-summary{border-bottom:1px solid var(--palor-edge)}
body.gameplay-screen .response-summary .activity-title,
body.gameplay-screen .activity-feed>.activity-title{color:#c4ab70;letter-spacing:.16em}
body.gameplay-screen .chronicle-entry:hover{background:#c3ae7210}
body.gameplay-screen .chronicle-portrait{box-shadow:0 0 0 2px #080d0b}
body.gameplay-screen #detail .ability-row{
 border-color:#a18b59;background:linear-gradient(105deg,#efe2bfde,#cbbb98ed),url('/table/assets/paper.webp');
 box-shadow:inset 0 0 0 2px #4f431329;
}
body.gameplay-screen .screen-primary-actions button{
 border-radius:2px;box-shadow:inset 0 0 0 2px #060b084d;
}
body.gameplay-screen .arena-announcement-strip{
 background:linear-gradient(90deg,#162b20,#0b1510 75%);border-color:#ac925244;
}
body.gameplay-screen #route-toolbar.choice-docked{position:relative;gap:3px;padding:4px 8px}
body.gameplay-screen #route-toolbar.choice-docked>.popup-drag{
 position:absolute;top:3px;right:6px;font-size:0;width:16px;height:16px;cursor:grab;touch-action:none;
}
body.gameplay-screen #route-toolbar.choice-docked>.popup-drag:before{content:'⠿';font:16px/1 Alegreya;color:#b4a575}
body.gameplay-screen #route-toolbar.choice-docked .player-popup-owner{margin:0;padding:0;line-height:12px}
/* The exit is an inert visual trace. The real decision closes immediately. */
.soulstone-exit-echo{
 pointer-events:none!important;user-select:none!important;position:fixed!important;
 z-index:101!important;margin:0!important;animation:none!important;
 overflow:hidden!important;contain:layout paint;min-height:0!important;
}
.soulstone-exit-echo *{pointer-events:none!important}
@media(prefers-reduced-motion:reduce){.soulstone-exit-echo{display:none!important}}

/* Arena presentation, revision 95. A forged charcoal slab and a single vitae
   accent replace stacked green boxes. Geometry remains fixed during playback. */
:root{--palor-ivory:#f5ead3;--palor-muted:#c3c5ba;--palor-brass:#ae9361;--palor-surface:radial-gradient(ellipse at 50% -25%,#69796026,transparent 60%),repeating-linear-gradient(145deg,#d6caa504 0 1px,transparent 1px 7px),linear-gradient(160deg,#20241f,#111613 54%,#0b100e)}
body :is(#dialog[open],#modal[open],.shared-feedback,.reaction-map-notice,.intent-map-notice,.prepared-action,.arena-choice-popup,.upkeep-feedback,.round-intro){
 border:1px solid #a18a5d;border-top:3px solid #c1aa74;border-radius:7px 7px 3px 3px;
 background:var(--palor-surface)!important;
 box-shadow:0 18px 42px #0009,inset 0 0 0 3px #060a08,inset 0 0 0 4px #b79b5230!important;
}
body.gameplay-screen .player-owned-popup{border-color:#a18a5d!important;border-top-color:var(--popup-player,#c1aa74)!important;box-shadow:0 18px 42px #0009,inset 0 0 0 3px #060a08,inset 0 0 0 4px #b79b5230!important}
body :is(#dialog,#modal,.shared-feedback) .popup-drag{position:relative;text-transform:uppercase;font:10px/1.5 Alegreya,Georgia,serif;letter-spacing:.13em;color:#b3b6a6;border-bottom:1px solid #a58b5538;padding-bottom:8px;margin-bottom:10px;cursor:grab}
body :is(#dialog,#modal,.shared-feedback) .popup-drag:after{content:'◆';position:absolute;left:calc(50% - 6px);top:0;color:var(--popup-player,#c1aa74);font-size:13px;text-shadow:0 0 12px #bca36e55}
body :is(#modal,#dialog,.shared-feedback) .player-popup-owner{font-size:12px;letter-spacing:.06em}
body :is(#modal,#dialog,.shared-feedback) h2{font-family:Alegreya,Georgia,serif;font-weight:700;line-height:1.1;letter-spacing:-.02em}
body :is(#modal,#dialog,.shared-feedback) p{line-height:1.4}
body.gameplay-screen :is(#modal[open],.shared-feedback).battle-stage{
 width:min(520px,calc(100vw - 28px))!important;max-width:calc(100vw - 28px);max-height:calc(100dvh - 32px)!important;
 padding:18px 24px!important;bottom:auto!important;top:50%;right:calc(max(14px,(100vw - 520px)/2));left:auto;transform:translateY(-50%);overflow:auto;
}
body .battle-access-title{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
body .battle-kicker{font:600 13px/1.3 Alegreya,Georgia,serif;letter-spacing:.13em;color:#dcc18a;margin:4px 0 15px;text-align:center;text-transform:uppercase}
body .battle-duel{display:grid;grid-template-columns:1fr 26px 1fr;align-items:center;gap:10px;margin-bottom:10px}
body .battle-duel:not(:has(.battle-versus)){grid-template-columns:1fr}
body .battle-combatant{display:flex;align-items:center;justify-content:center;gap:10px;min-width:0}
body .battle-combatant img{width:48px;height:48px;border-radius:50%;object-fit:cover;border:2px solid #ac9660;box-shadow:0 0 0 3px #060c09,0 0 0 4px #ac966040;flex:none}
body .battle-combatant strong{font:700 22px/1.05 Alegreya,Georgia,serif;text-align:left;text-wrap:balance;color:#f4e7c8}
body .battle-versus{font:26px/1 Georgia;color:#bca06b;text-align:center}
body .battle-resolution{position:relative;display:flex;flex-direction:column;gap:10px;text-align:center}
body .battle-resolution .roll-pair{order:2;margin:0!important;padding:8px 0 4px;gap:20px!important;align-items:start}
body .battle-resolution .favour-invocation{order:1;font-size:18px!important;line-height:1.3!important;margin:4px 0!important;min-height:42px;color:#dfc58e!important;animation:none!important}
body .battle-resolution .favour-invocation small{font-size:12px;letter-spacing:.03em;margin-top:2px}
body .battle-resolution .roll-pair>div>small{font:600 12px/1.3 Alegreya;letter-spacing:.08em;color:#c4bba4}
body .battle-resolution .animated-die{width:88px!important;height:80px!important;min-width:0!important;min-height:0!important;animation:none!important}
body .battle-resolution .dice-with-label>span{display:none}
body .battle-resolution .ability-d4{order:2;margin:8px auto}
body .battle-resolution .rolling-label{order:3;color:#d4b878;font:18px Alegreya;margin:5px;min-height:35px}
body .battle-resolution .battle-outcome{order:3;min-height:100px;padding-top:4px;border-top:1px solid #bfa56b30}
body .battle-verdict{display:flex;gap:12px;justify-content:center;align-items:center}
body .battle-verdict>strong{font:800 36px/1.1 Alegreya,Georgia,serif;color:#f2d89f;letter-spacing:.02em}
body .battle-critical{padding:3px 8px;border:1px solid #ad7d55;color:#efbb8c;font:16px Alegreya}
body .battle-resolution .outcome-reason{margin:8px 0!important;font:18px/1.35 Alegreya,Georgia,serif!important;color:#ece7d9}
body .battle-resolution .strike-reasons{text-align:left;margin:5px 0!important;padding:0!important;font:15px/1.45 Alegreya,Georgia,serif}
body .battle-resolution .strike-reasons summary{padding:8px;text-align:center;color:#baa87d;cursor:pointer}
body .battle-resolution .strike-reasons ul{padding:4px 18px 5px;margin:0}
body .battle-provisional{display:block;font:12px/1.2 Alegreya;color:#b8bbaa;margin-bottom:4px}
body .battle-result-footer{order:4;display:flex;justify-content:space-between;align-items:center;gap:10px;border-top:1px solid #bfa56b30;padding-top:12px;margin-top:3px}
body .battle-read-hint{font:13px/1.25 Alegreya;color:#c3c5ba;text-align:left;max-width:65%}
body .battle-result-footer button{min-width:116px;font:700 17px Alegreya;padding:9px 14px}
body .battle-result-footer kbd{font:12px Georgia;opacity:.7;margin-left:7px}
body .battle-resolution.rolling .battle-result-footer{visibility:hidden}
body .battle-resolution .set-choice{font-size:13px;line-height:1.2;margin:3px 0}
body .battle-resolution .dice-set.set-discarded{opacity:.4}
body .battle-resolution .set-verdict,body .battle-resolution .dual-bonus{font-size:12px}
body.battle-reading .intent-map-notice,body.battle-reading .confirmed-ability-notice{visibility:hidden}
body.battle-reading .champion-rail,body.battle-reading .event-rail{filter:saturate(.7)}
/* One fixed stage at the top; never stretch or shrink the arena to fit a cue. */
body.gameplay-screen #arena-announcements>.battle-upkeep{
 display:block!important;inset:4px 10px auto;height:auto!important;max-height:calc(100dvh - 100px)!important;min-height:140px;width:calc(100% - 20px)!important;
 padding:16px 22px!important;overflow:visible!important;box-sizing:border-box;z-index:5;
}
body .upkeep-scene{display:grid!important;grid-template-columns:minmax(0,1fr);gap:12px;text-align:left}
body.gameplay-screen #arena-announcements .upkeep-scene>*{grid-column:1!important;grid-row:auto!important;min-width:0}
body.gameplay-screen #arena-announcements .upkeep-scene .upkeep-result-heading{display:flex;justify-content:space-between;align-items:center;font:600 13px/1.3 Alegreya!important;letter-spacing:.08em;color:#d0b27a;padding:0 0 8px!important;border-bottom:1px solid #a9915940;margin:0}
body .upkeep-result-heading i{font-size:10px;margin:0 8px;font-style:normal}
body.gameplay-screen #arena-announcements .upkeep-scene .upkeep-result-heading small{font:12px Alegreya;color:#aeb6a8}
body .upkeep-unit-result{display:flex;gap:15px;align-items:center}
body.gameplay-screen #arena-announcements .upkeep-scene .upkeep-result-portrait{width:56px;height:56px;flex:none;object-fit:cover;border:1px solid #bda46b;border-radius:50%;box-shadow:0 0 0 3px #080e0a}
body.gameplay-screen #arena-announcements .upkeep-scene .upkeep-result-name{display:flex;flex-wrap:wrap;column-gap:18px;row-gap:4px;align-items:baseline}
body.gameplay-screen #arena-announcements .upkeep-scene .upkeep-result-name strong{font:700 27px/1.1 Alegreya;color:#f3e6ca}
body .upkeep-main-result{font:700 27px/1.1 Alegreya;color:#cbe2bd}
body .upkeep-source{flex-basis:100%;font:15px/1.3 Alegreya;color:#d4bb88}
body .upkeep-emblem{font:40px/1 Georgia;color:#baa164;width:54px;text-align:center;flex:none}
body.gameplay-screen #arena-announcements .upkeep-scene .upkeep-injury-dice{display:flex;flex-wrap:wrap;gap:8px;margin:0}
body.gameplay-screen #arena-announcements .upkeep-scene .injury-countdown{padding:0;gap:5px}
body.gameplay-screen #arena-announcements .upkeep-scene .d4-marker{width:29px;height:29px}
body.gameplay-screen #arena-announcements .upkeep-scene .injury-arrow{font-size:17px}
body.gameplay-screen #arena-announcements .upkeep-scene .injury-cleared{font-size:12px}
body.gameplay-screen #arena-announcements .upkeep-scene .injury-cleared:after{display:none}
body.gameplay-screen #arena-announcements .upkeep-scene ul{display:block;list-style:none;padding:0;margin:0}
body.gameplay-screen #arena-announcements .upkeep-scene li{font:17px/1.3 Alegreya;margin:2px 0;color:#dce1d3}
body.gameplay-screen #arena-announcements .upkeep-scene ul:empty{display:none}
body.gameplay-screen #arena-announcements .priority-table{display:grid;grid-template-columns:repeat(var(--upkeep-players,2),minmax(0,1fr));gap:12px;margin:0}
body.gameplay-screen #arena-announcements .priority-table>.priority-contender{display:flex;flex-direction:column;gap:4px;align-items:center;justify-content:center;padding:2px 8px;border-left:1px solid #b7a06930}
body.gameplay-screen #arena-announcements .priority-table>.priority-contender:first-child{border-left:0}
body.gameplay-screen #arena-announcements .priority-table .priority-player{font:700 19px/1.1 Alegreya;color:var(--seat-colour);text-align:center;overflow-wrap:normal;min-height:22px}
body.gameplay-screen #arena-announcements .priority-table .priority-face{width:82px!important;height:74px!important;min-width:82px!important;min-height:74px!important;display:block}
body.gameplay-screen #arena-announcements .priority-table .priority-rank-result{font:700 16px/1.1 Alegreya;color:#e9d5a6;min-height:18px}
body .priority-rolling .priority-rank-result{visibility:hidden}
body .priority-announcement{text-align:center;min-height:28px;border-top:1px solid #bba3693b;padding-top:9px}
body .priority-roll-caption{font:17px Alegreya;color:#c4b38c}
body .priority-winner{font:700 24px/1.15 Alegreya;color:#f5dfaa}
body .priority-settled .priority-rank-result[data-winner]{color:#e8d18d;text-shadow:0 0 18px #c9ad6355}
@media(max-width:760px){body.gameplay-screen #arena-announcements>.battle-upkeep{padding:12px 14px!important;inset:3px 6px auto;width:calc(100% - 12px)!important}.upkeep-scene{gap:9px!important}body.gameplay-screen #arena-announcements .priority-table .priority-player{font-size:16px}body.gameplay-screen #arena-announcements .upkeep-scene .upkeep-result-name strong,body .upkeep-main-result{font-size:24px}body .priority-winner{font-size:21px}body .battle-combatant{flex-direction:column;gap:7px}body .battle-combatant strong{text-align:center;font-size:20px}body .battle-combatant img{width:40px;height:40px}body .battle-resolution .animated-die{width:72px!important;height:66px!important}body.gameplay-screen :is(#modal[open],.shared-feedback).battle-stage{padding:14px 18px!important}body .battle-resolution .outcome-reason{font-size:17px!important}}
@media(max-width:500px){body.gameplay-screen #arena-announcements .priority-table{grid-template-columns:repeat(2,minmax(0,1fr))}.battle-resolution .favour-invocation{font-size:16px!important}.battle-resolution .battle-outcome{min-height:90px}body .battle-verdict>strong{font-size:31px}body.gameplay-screen #arena-announcements .priority-table .priority-face{width:68px!important;height:62px!important;min-width:68px!important;min-height:62px!important}}
@media(prefers-reduced-motion:reduce){body .battle-outcome{animation:none!important}}

/* Keep the roll and result in exactly the same footprint. */
body .battle-resolution .battle-outcome[hidden]{display:block!important;visibility:hidden}
body .battle-resolution .rolling-label{position:absolute;bottom:80px;left:0;right:0;margin:0}
body .battle-resolution .battle-outcome{min-height:118px}
body .battle-applied-effects{font:15px/1.35 Alegreya;color:#d8caa9}

/* Announcements must paint above the arena, whose retained artwork has its own layer. */
body.gameplay-screen .arena-announcement-strip:has(.battle-upkeep){z-index:30}

body.gameplay-screen #arena-announcements>.round-intro{background:var(--palor-surface);border:1px solid #a18a5d;border-top:3px solid #c1aa74;box-shadow:inset 0 0 0 3px #060a08,inset 0 0 0 4px #b79b5230}
