/* Keep the deck total clear of the resource box's lower edge. */
#match .arena-band .mat-deck .deck-count{top:3px;bottom:auto;right:2px;z-index:2;min-width:24px;height:20px;padding:1px 4px;font:800 11px/1 "IBM Plex Mono",monospace;background:#041018;color:#e5f8ff;border-color:#95cfe5}
#nextActions .gig-die-options{display:flex;flex-wrap:wrap;gap:5px;max-width:100%}
#nextActions .gig-die-option{min-height:44px;padding:6px 8px;font-size:12px;line-height:1.3}
#nextActions .gig-die-option[aria-pressed=true]{border-color:#ffdf72;background:#443b20;color:#fff2b9}
#detail[open]:has(.pile-inspector){display:block;width:min(860px,calc(100vw - 24px));height:min(780px,calc(100dvh - 24px));max-height:calc(100dvh - 24px);padding:12px;overflow:hidden;background:#09141d;border:1px solid #59717f;clip-path:none;border-radius:6px}
#detail:has(.pile-inspector) #closeDetail{position:absolute;top:12px;right:12px;z-index:3;min-height:44px}
#detail:has(.pile-inspector) #detailContent{height:100%;min-height:0;overflow:hidden}
.pile-inspector{height:100%;min-height:0;display:grid;grid-template-rows:auto auto auto minmax(0,1fr);gap:6px}
.pile-inspector h2{min-height:44px;margin:0;padding-right:80px;display:flex;align-items:center;font-size:22px;line-height:1.3}
.pile-inspector-tools{display:flex;align-items:center;gap:10px}
.pile-inspector-tools label{display:flex;flex-direction:row;align-items:center;gap:8px;font-size:13px}
.pile-inspector-tools select{min-height:44px;width:160px;padding:8px;font-size:14px}
.pile-order-hint{margin:0;font-size:12px;line-height:1.4;color:#b2c6d1}
.pile-inspector .pile-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));align-content:start;gap:10px;margin:0;padding:3px;list-style:none;min-height:0;overflow:auto;overscroll-behavior:contain}
.pile-order-entry{min-width:0}
.pile-inspector .pile-entry{display:flex;flex-direction:column;align-items:stretch;gap:6px;width:100%;min-width:0;min-height:44px;height:100%;padding:7px;border:1px solid #3e5665;border-radius:5px;background:#101f2b;text-align:left;color:#eaf3f9;clip-path:none}
.pile-inspector .pile-entry:hover,.pile-inspector .pile-entry:focus-visible{border-color:#8ae7ed;background:#182e3c}
.pile-art-frame{display:block;position:relative;align-self:center;width:100%}
.pile-inspector .pile-entry .card-art{display:block;width:100%;height:auto;max-height:240px;aspect-ratio:1400/1960;object-fit:contain;margin:0;border:0;clip-path:none}
.pile-order-badge{position:absolute;top:5px;left:5px;max-width:calc(100% - 10px);padding:4px 6px;border:1px solid #8be6ed;border-radius:4px;background:#041018ed;color:#c7fbff;font:700 11px/1.3 "IBM Plex Mono",monospace}
.pile-card-name{font-size:14px;font-weight:600;line-height:1.35;overflow-wrap:anywhere}
.pile-reveal-note{display:block;font-size:11px;line-height:1.4;color:#c5d6a0;overflow-wrap:anywhere}
.pile-empty{grid-column:1/-1;padding:20px;color:#b2c6d1}
@media(max-width:420px){.pile-inspector .pile-list{grid-template-columns:repeat(2,minmax(0,1fr))}.pile-inspector h2{font-size:19px}}
@media(max-height:430px){
 .pile-inspector .pile-list{grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}
 .pile-inspector .pile-entry{display:grid;grid-template-columns:72px minmax(0,1fr);grid-template-rows:auto auto;align-content:start}
 .pile-art-frame{grid-row:1/3}
 .pile-card-name,.pile-reveal-note{grid-column:2}
 .pile-inspector .pile-entry .card-art{max-height:104px}
}

/* Centered choice signal; the board remains the die picker. */
#match:is(.die-choice-open,.hand-discard-open)[data-action-state] #stepTracker{
 position:absolute !important;z-index:35;left:50% !important;right:auto !important;
 top:calc((100% - var(--arena-hand-height))/2) !important;bottom:auto !important;
 transform:translate(-50%,-50%) !important;box-sizing:border-box !important;
 display:block !important;width:min(560px,calc(100% - 150px)) !important;
 height:auto !important;min-height:0 !important;max-height:min(48dvh,260px) !important;
 overflow:auto !important;clip-path:none !important;overscroll-behavior:contain;
 padding:6px !important;background:transparent !important;border:0 !important;
 box-shadow:none !important;backdrop-filter:none;pointer-events:none;
 scrollbar-width:thin;text-align:center;
}
#match:is(.die-choice-open,.hand-discard-open)[data-action-state] #stepTracker .match-context{display:block !important;height:auto !important;min-height:0;overflow:visible !important;background:transparent}
#match:is(.die-choice-open,.hand-discard-open)[data-action-state] #stepTracker .match-context>:is(#matchContextTitle,#matchContextHint):not([hidden]){
 display:block !important;position:static !important;width:auto !important;height:auto !important;
 overflow:visible !important;clip-path:none !important;white-space:normal !important;
 overflow-wrap:anywhere;line-height:1.3;text-align:center;margin:0 0 4px;
 text-shadow:0 2px 3px #000,0 0 8px #000,0 0 16px #000;
}
#match:is(.die-choice-open,.hand-discard-open)[data-action-state] #stepTracker .match-context>#matchContextTitle{font-size:15px;color:#c3fbff;letter-spacing:.02em}
#match:is(.die-choice-open,.hand-discard-open)[data-action-state] #stepTracker .match-context>#matchContextHint{font-size:13px;color:#e5f1f5}
#match:is(.die-choice-open,.hand-discard-open)[data-action-state] #stepTracker :is(#matchContextKicker,#matchContextCause,#matchContextResult,#matchContextSync){display:none !important}
#match:is(.die-choice-open,.hand-discard-open)[data-action-state] #stepTracker .context-actions{
 display:flex !important;flex-wrap:wrap !important;align-items:center !important;justify-content:center !important;
 width:100%;height:auto !important;min-height:0 !important;max-height:none !important;
 overflow:visible !important;gap:5px;padding:2px !important;pointer-events:none;
}
#match:is(.die-choice-open,.hand-discard-open)[data-action-state] #stepTracker .context-actions button{
 flex:0 1 auto !important;width:auto !important;min-width:44px;min-height:44px;max-width:100%;
 white-space:normal;overflow-wrap:anywhere;line-height:1.25;pointer-events:auto;
 background:#07151de8;border:1px solid #80bfc9;box-shadow:0 2px 10px #0008;
}
#match:is(.die-choice-open,.hand-discard-open)[data-action-state] #stepTracker .context-actions button.primary{background:#dce93e;color:#071018;border-color:#e7f461}
#match:is(.die-choice-open,.hand-discard-open)[data-action-state] #stepTracker .gig-value-options{justify-content:center;flex:1 0 100%;pointer-events:none}
#match:is(.die-choice-open,.hand-discard-open)[data-action-state] #stepTracker .gig-choice-summary{flex:1 0 100%;margin:0;font-size:13px;line-height:1.3;overflow-wrap:anywhere;text-shadow:0 2px 4px #000}
@media(max-height:430px){#match:is(.die-choice-open,.hand-discard-open)[data-action-state] #stepTracker{padding:3px !important}#match:is(.die-choice-open,.hand-discard-open)[data-action-state] #stepTracker .match-context>#matchContextTitle{font-size:13px}}
/* Keep transient banners from competing with an active choice. */
#match:is(.die-choice-open,.hand-discard-open) :is(.turn-presence,.turn-announcement,.match-event-cue,#matchTargetLine){visibility:hidden !important}
#match:is(.die-choice-open,.hand-discard-open)[data-action-state] #stepTracker .match-context{border:0 !important;padding:0 !important;margin:0 !important;box-shadow:none !important;background:transparent !important}
/* Discard directly from the existing hand shelf. */
#match.hand-discard-open #realHand .hand-card.discard-eligible{outline:2px solid #75e9dc;outline-offset:-2px;filter:none;box-shadow:0 0 14px #65e9dc88}
#match.hand-discard-open #realHand .hand-card.discard-selected{outline:3px solid #ffdf72;box-shadow:0 0 18px #ffdf7299}
#match.hand-discard-open #realHand .hand-card:not(.discard-eligible) .card-art-button{opacity:.55}
#match .discard-state{position:absolute;z-index:9;left:2px;right:2px;top:2px;padding:3px 2px;background:#031018e8;color:#bcfff3;font:800 9px/1.2 "IBM Plex Mono",monospace;text-align:center;pointer-events:none;white-space:normal}
#match .discard-selected .discard-state{color:#ffed9c}
#match.hand-discard-open .match-event-cue{visibility:hidden !important}
/* Public deck-trash records and legal picks are separate visual groups. */
.card-choice-dialog.has-deck-trash .card-choice-hint{color:#d9f58f;font-weight:700;flex:none}
.card-choice-dialog.has-deck-trash .card-choice-grid{min-height:100px;flex:1 1 auto}
.deck-trash-record{flex:none;border-top:1px solid #49616c;margin-top:8px;padding-top:4px;max-height:148px;overflow:auto}
.card-choice-dialog .deck-trash-record>summary{min-height:44px;font-size:13px;line-height:1.3;color:#becdd4;cursor:pointer;display:list-item}
.trash-record-cards{display:flex;gap:7px;overflow-x:auto;padding:3px;min-width:0}
.card-choice-dialog .trash-record-card{position:relative;flex:0 0 50px;width:50px;min-width:44px;min-height:72px;padding:0;border:1px solid #6f8390;background:#0a1720}
.card-choice-dialog .trash-record-card img{display:block;width:48px;height:68px;object-fit:contain}
.trash-record-card>span{position:absolute;top:0;left:0;padding:2px 3px;background:#051018ed;color:#fff;font-size:10px;line-height:1.2}
@media(max-height:430px){
 .deck-trash-record{max-height:82px;min-height:74px}
 .card-choice-dialog .deck-trash-record>summary{float:left;width:126px;min-height:44px;padding:4px 6px 4px 0;font-size:12px}
 .deck-trash-record .trash-record-cards{margin-left:132px}
 .card-choice-dialog .trash-record-card{min-height:64px}
 .card-choice-dialog .trash-record-card img{height:60px}
}
@media(max-height:430px){
 .card-choice-dialog.has-deck-trash .card-choice-entry{display:grid;grid-template-columns:64px minmax(0,1fr);grid-template-rows:auto auto;gap:4px;align-content:start}
 .card-choice-dialog.has-deck-trash .choice-card-art{grid-row:1/3}
 .card-choice-dialog.has-deck-trash .card-choice-entry img{width:64px;height:90px}
 .card-choice-dialog.has-deck-trash .card-choice-entry details{grid-column:2;margin:0;min-height:44px}
 .card-choice-dialog.has-deck-trash .choice-card-select{grid-column:2;margin:0;align-self:start}
}
#match .deck-trash-notice{position:absolute;z-index:40;top:calc(var(--arena-rail-height) + 12px);right:78px;width:min(330px,calc(100% - 100px));box-sizing:border-box;padding:6px 9px;background:#06141de8;border:1px solid #466875;border-radius:5px;color:#e7f5f8;box-shadow:0 3px 14px #0009;pointer-events:none}
#match .deck-trash-notice>header{display:flex;align-items:center;justify-content:space-between;gap:8px;width:auto;padding:0;margin:0;background:transparent;border:0}
#match .deck-trash-notice>header strong{font-size:12px;line-height:1.3;overflow-wrap:anywhere}
#match .deck-trash-notice>header button{flex:none;min-width:44px;min-height:44px;padding:3px;pointer-events:auto}
#match .deck-trash-notice .deck-trash-record{border:0;margin:0;padding:0;max-height:none;overflow:visible}
#match .deck-trash-notice summary{min-height:44px;font-size:12px;line-height:1.3;cursor:pointer;pointer-events:auto}
#match .deck-trash-notice .trash-record-cards{margin-left:0}
#match .deck-trash-notice .trash-record-card{flex:0 0 48px;position:relative;width:48px;min-width:44px;min-height:64px;padding:0;pointer-events:auto}
#match .deck-trash-notice .trash-record-card img{display:block;width:46px;height:64px;object-fit:contain}
@media(max-height:430px){#match .deck-trash-notice{top:calc(var(--arena-rail-height) + 4px);right:76px;padding:3px 6px;width:264px}#match .deck-trash-notice summary{font-size:11px}#match .deck-trash-notice .trash-record-card img{height:48px}#match .deck-trash-notice .trash-record-card{min-height:48px}}

/* Match commands share a readable layer above the target vector. */
#match .match-bottom-dock:has(#stepTracker .context-actions button) {
  z-index: 90 !important;
}
#match #matchAttackArrow,
#match #matchTargetLine {
  z-index: 39;
}
/* The lower-left status is text-first; its old left rails consumed space. */
#match #stepTracker:not(:has(.context-actions button)) {
  padding-inline: 12px !important;
  box-shadow: 0 0 18px #31d9ff2b !important;
}
#match #stepTracker:not(:has(.context-actions button)) .match-context {
  border-left: 0 !important;
  box-shadow: none !important;
  padding-inline: 0 !important;
}
/* Shared command typography and input size across target, Legend and effect cues. */
#match #stepTracker:has(.context-actions button) :is(#matchContextTitle,#matchContextHint,#matchContextCause) {
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.25;
  text-shadow: 0 2px 5px #000c;
}
#match #stepTracker:has(.context-actions button) .context-actions button {
  min-height: 44px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}
