/* Chrome & Gigs layered battlefield stage.
   Authoritative presentation only: game rules and interaction logic stay in JS. */

body.match-active > .site-header { display:none !important; }
body.match-active > main { padding:env(safe-area-inset-top,0) env(safe-area-inset-right,0) 0 env(safe-area-inset-left,0) !important; }
body.match-active #match:not([hidden]) {
  --match-safe-bottom:env(safe-area-inset-bottom,0px);
  --arena-red:#ff574c; --arena-cyan:#31d9ff; --arena-gold:#ffc64d;
  --arena-meter-width:76px;
  --arena-meter-top:58px;
  --arena-rail-height:clamp(96px,14dvh,124px);
  --arena-hand-height:clamp(118px,17dvh,150px);
  --arena-battle-min-height:116px;
  --arena-hud-content-depth:var(--arena-hand-height);
  --arena-hud-depth:calc(var(--arena-hand-height) + var(--match-safe-bottom));
  --arena-tracker-height:92px; --arena-turn-height:92px;
  position:relative; display:block; min-height:0; overflow:hidden; isolation:isolate;
  background:radial-gradient(ellipse at 50% 48%,#15313b73,#08111766 42%,transparent 72%),linear-gradient(180deg,#160a0b42,transparent 25% 72%,#061a224f),#050b0f;
}

/* One composited stage instead of stacked page rows. */
body.match-active #match .match-layout,
#match #board,
#match .arena-playmat {
  position:absolute !important; inset:0 !important; width:100% !important; height:100% !important;
  min-height:0 !important; max-height:none !important; margin:0 !important; overflow:hidden !important;
}
body.match-active #match .match-layout { scrollbar-gutter:auto; }
#match #board {
  border:1px solid #263d46; border-radius:0;
  background:linear-gradient(90deg,transparent 49.92%,#a7c3cc18 50%,transparent 50.08%),repeating-linear-gradient(0deg,transparent 0 43px,#91a9b006 44px),repeating-linear-gradient(90deg,transparent 0 67px,#91a9b006 68px),radial-gradient(ellipse at center,#18323d4f,transparent 66%),#060d12;
}
#match .arena-playmat { display:block !important; flex:none !important; padding:0 !important; border:0 !important; background:transparent !important; }
body.match-active #match .match-coach,#match .mat-heading,#match #localGigsDock { display:none !important; }

/* Semi-transparent rival/player rails let the circuit board continue behind them. */
#match .arena-band {
  position:absolute !important; z-index:10; left:0; right:76px; width:auto !important;
  height:var(--arena-rail-height) !important; min-height:0 !important; overflow:visible !important;
  border:0 !important; color:var(--arena-red); isolation:isolate; box-shadow:none !important;
  background:linear-gradient(90deg,transparent 0 5%,currentColor 18%,transparent 42% 58%,currentColor 82%,transparent 95%) 0 50%/100% 1px no-repeat,linear-gradient(90deg,transparent,#081118c7 13% 87%,transparent);
}
#match .arena-rival { top:0; }
#match .arena-own { bottom:calc(var(--arena-hand-height) - 18px + var(--match-safe-bottom)); color:var(--arena-cyan); }
#match .arena-band::before,#match .arena-band::after { content:""; position:absolute; z-index:-1; pointer-events:none; }
#match .arena-band::before { inset:0; opacity:.42; background:linear-gradient(180deg,currentColor 0 1px,transparent 1px 96%,currentColor 96%); clip-path:polygon(0 0,34% 0,38% 12%,62% 12%,66% 0,100% 0,100% 100%,66% 100%,62% 88%,38% 88%,34% 100%,0 100%); }
#match .arena-band::after { inset:4px 0; background:radial-gradient(ellipse at center,#071117ed 12%,#071117a8 44%,transparent 76%); }
#match .arena-band > .player-resources { position:absolute !important; inset:0 !important; display:block !important; width:100% !important; height:100% !important; }

/* Fixed Gig circuit nodes: dark unowned, cyan viewer-owned, red rival-owned. */
#match .arena-band .mat-fixer { position:absolute !important; z-index:12; inset:0 !important; display:block !important; padding:0 !important; border:0 !important; background:transparent !important; pointer-events:none; }
#match .arena-band .mat-fixer > .mat-label { display:none !important; }
#match .arena-band .mat-fixer > .mat-content {
  display:grid !important; grid-template-columns:repeat(3,70px) minmax(360px,1fr) repeat(3,70px) !important;
  align-items:center; gap:clamp(4px,.7vw,12px) !important; width:100% !important; height:100% !important; padding:0 clamp(82px,8vw,154px) !important;
}
#match .arena-band .fixer-die {
  --origin-color:#66777f; --node-color:#66777f;
  position:relative; width:58px !important; min-width:44px !important; height:50px !important; min-height:44px !important;
  padding:3px !important; overflow:visible !important; isolation:isolate; border:1px solid color-mix(in srgb,var(--origin-color) 58%,#27343a) !important;
  clip-path:polygon(9px 0,calc(100% - 9px) 0,100% 9px,100% calc(100% - 9px),calc(100% - 9px) 100%,9px 100%,0 calc(100% - 9px),0 9px) !important;
  color:var(--node-color); background:linear-gradient(90deg,var(--origin-color) 0 3px,transparent 3px calc(100% - 3px),var(--origin-color) calc(100% - 3px)),repeating-linear-gradient(90deg,#d8b347 0 2px,transparent 2px 5px) 50% 3px/70% 3px no-repeat,linear-gradient(145deg,#26343a,#080d11 36% 66%,#1c282d) !important;
  box-shadow:inset 0 0 0 3px #05090c,inset 0 0 0 5px color-mix(in srgb,var(--origin-color) 34%,transparent),0 0 9px color-mix(in srgb,var(--origin-color) 32%,transparent) !important; pointer-events:auto;
}
#match .arena-rival .fixer-die{--origin-color:var(--arena-red)} #match .arena-own .fixer-die{--origin-color:var(--arena-cyan)}
#match .arena-band .fixer-die::before,#match .arena-band .fixer-die::after{content:"";position:absolute;z-index:2;left:9px;right:9px;height:calc(50% - 3px);border:1px solid #35444a;background:linear-gradient(135deg,#202c31,#080d10 62%);box-shadow:inset 0 0 8px #000;transition:transform .28s ease,opacity .28s ease,box-shadow .28s ease;pointer-events:none}
#match .arena-band .fixer-die::before{top:6px;border-bottom-color:#111;transform-origin:50% 100%} #match .arena-band .fixer-die::after{bottom:6px;border-top-color:#111;transform-origin:50% 0}
#match .arena-band .fixer-die.can-roll::before,#match .arena-band .fixer-die.gig-owned-own::before,#match .arena-band .fixer-die.gig-owned-rival::before,#match .arena-band .fixer-die.stealable::before,#match .arena-band .fixer-die.gig-attack-target::before{transform:translateY(-8px) scaleY(.3);opacity:.28}
#match .arena-band .fixer-die.can-roll::after,#match .arena-band .fixer-die.gig-owned-own::after,#match .arena-band .fixer-die.gig-owned-rival::after,#match .arena-band .fixer-die.stealable::after,#match .arena-band .fixer-die.gig-attack-target::after{transform:translateY(8px) scaleY(.3);opacity:.28}
#match .arena-band .fixer-die:nth-child(6){grid-column:1} #match .arena-band .fixer-die:nth-child(5){grid-column:2} #match .arena-band .fixer-die:nth-child(4){grid-column:3}
#match .arena-band .fixer-die:nth-child(3){grid-column:5} #match .arena-band .fixer-die:nth-child(2){grid-column:6} #match .arena-band .fixer-die:nth-child(1){grid-column:7}
#match .arena-band .fixer-die.gig-owned-own { --node-color:var(--arena-cyan); opacity:1 !important; background:linear-gradient(90deg,var(--origin-color) 0 3px,transparent 3px calc(100% - 3px),var(--origin-color) calc(100% - 3px)),repeating-linear-gradient(90deg,#31d9ff 0 2px,transparent 2px 5px) 50% 3px/70% 3px no-repeat,linear-gradient(145deg,#164c5b,#07141a 35% 65%,#0d3541) !important; box-shadow:inset 0 0 0 3px #06141b,inset 0 0 0 5px #31d9ff66,0 0 16px #31d9ffc4 !important; }
#match .arena-band .fixer-die.gig-owned-rival { --node-color:var(--arena-red); opacity:1 !important; background:linear-gradient(90deg,var(--origin-color) 0 3px,transparent 3px calc(100% - 3px),var(--origin-color) calc(100% - 3px)),repeating-linear-gradient(90deg,#ff574c 0 2px,transparent 2px 5px) 50% 3px/70% 3px no-repeat,linear-gradient(145deg,#582522,#170909 35% 65%,#3d1715) !important; box-shadow:inset 0 0 0 3px #180909,inset 0 0 0 5px #ff574c66,0 0 16px #ff574cb8 !important; }
#match .arena-band .fixer-die.can-roll{--node-color:var(--arena-gold);animation:gigCradleReady 1.25s ease-in-out infinite alternate;background:linear-gradient(90deg,var(--arena-gold) 0 3px,transparent 3px calc(100% - 3px),var(--arena-gold) calc(100% - 3px)),repeating-linear-gradient(90deg,#ffc64d 0 2px,transparent 2px 5px) 50% 3px/70% 3px no-repeat,linear-gradient(145deg,#4c3a15,#0e0b05 35% 65%,#34260c) !important}
#match .arena-band .fixer-die .gig-node-value{position:relative;z-index:3;display:block;color:#f6fbfc;font:900 20px/1 'Barlow Condensed',sans-serif;text-shadow:0 1px 3px #000,0 0 7px currentColor}
#match .arena-band .fixer-die .gig-node-designation{position:absolute;z-index:4;right:5px;bottom:4px;display:block;min-width:0;height:auto;transform:none;border:0;background:transparent;color:currentColor;font:800 9px/1 'IBM Plex Mono',monospace;text-transform:lowercase;text-shadow:0 1px 3px #000,0 0 5px currentColor;clip-path:none}
#match .arena-band .fixer-die .gig-node-state{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#match .arena-band .fixer-die.gig-attack-target,#match .arena-band .fixer-die.stealable{--node-color:var(--arena-gold);outline:2px solid var(--arena-gold);outline-offset:2px;animation:gigCradleReady .75s ease-in-out infinite alternate}
@keyframes gigCradleReady{from{filter:brightness(.96);box-shadow:inset 0 0 0 3px #080b0c,inset 0 0 0 5px #ffc64d55,0 0 7px #ffc64d44}to{filter:brightness(1.18);box-shadow:inset 0 0 0 3px #080b0c,inset 0 0 0 5px #ffc64d99,0 0 17px #ffc64daa}}

/* Portrait, totals and Legend sockets are a single visual hub. */
#match .arena-band .player-hub {
  position:absolute !important; z-index:8; left:50% !important; top:50% !important; display:grid !important;
  width:70px !important; height:70px !important; padding:0 !important; place-items:center; place-content:stretch; transform:translate(-50%,-50%) !important;
  overflow:visible !important; border:2px solid currentColor !important; border-radius:50% !important;
  background:#071119 !important;
  box-shadow:none !important;
}
#match .arena-band .player-hub::before,#match .arena-band .player-hub::after{content:none;display:none}
#match .arena-band .player-hub .identity-badge{display:grid;width:100%;height:100%;place-items:center;padding:0;border:0;background:transparent}
#match .arena-band .player-hub .identity-badge>.portrait-image{width:52px !important;height:auto !important;aspect-ratio:140/174;border:0;border-radius:0;clip-path:circle(26px at 50% 50%);background-size:1000% 1000%}
#match .arena-band .player-hub .identity-badge>span:not(.portrait-image){display:none !important}
#match .arena-band .player-hub .identity-badge strong,#match .arena-band .player-hub-stats{display:none !important}
#match .arena-band .player-hub-stat {
  position:absolute !important; z-index:10; top:9px !important; display:grid; width:50px !important; min-height:38px !important;
  place-content:center; border:1px solid currentColor; border-radius:5px; background:#050b10e8; box-shadow:0 5px 14px #000b,inset 0 0 10px currentColor;
}
#match .arena-band .hub-gigs{right:calc(100% + 10px) !important;color:inherit !important}
#match .arena-band .hub-eddies{left:calc(100% + 10px) !important;color:var(--arena-gold) !important}
#match .arena-band .player-hub-stat small{display:none} #match .arena-band .player-hub-stat strong{margin:0;font-size:15px}
#match .arena-band .hub-gigs::before{content:"◆";margin-right:3px;font-size:8px} #match .arena-band .hub-eddies::before{content:"";width:10px;height:10px;margin-right:3px;border:1px solid var(--arena-gold);border-radius:50%;background:radial-gradient(circle,#ffc64d 0 27%,#35270c 30% 100%);box-shadow:0 0 6px #ffc64d99}

#match .arena-band .mat-legends {
  position:absolute !important; z-index:14; left:calc(50% - 282px) !important; top:50% !important; display:block !important;
  width:174px !important; height:68px !important; transform:translateY(-50%) !important; padding:0 !important; border:0 !important; background:transparent !important; pointer-events:none;
}
#match .arena-band .mat-legends>.mat-label{display:none} #match .arena-band .mat-legends>.mat-content,#match .arena-band .mat-legend-slots{position:absolute;inset:0;display:block}
#match .arena-band .mat-legend-slot {
  position:absolute !important; top:3px !important; bottom:auto !important; width:54px !important; height:62px !important;
  overflow:hidden; border:1px solid var(--arena-gold); clip-path:polygon(12% 0,88% 0,100% 12%,100% 88%,88% 100%,12% 100%,0 88%,0 12%);
  background:#171207e6; box-shadow:0 0 12px #ffc64d55; pointer-events:auto;
}
#match .arena-band .mat-legend-slot:nth-child(1){left:0 !important} #match .arena-band .mat-legend-slot:nth-child(2){left:60px !important;right:auto !important}
#match .arena-band .mat-legend-slot:nth-child(3){left:120px !important;top:3px !important;bottom:auto !important}
#match .arena-rival .mat-legend-slot:nth-child(3){top:3px !important;bottom:auto !important}
#match .arena-band .legend-art,#match .arena-band .legend-back,#match .arena-band .legend-art img,#match .arena-band .legend-back .card-back-visual{width:100%;height:100% !important;min-height:0;padding:0;object-fit:cover}
#match .arena-band .legend-name,#match .arena-band .legend-state,#match .arena-band .legend-gear-stack,#match .arena-band .solo-button{display:none !important}
#match .arena-band .mat-legends.legend-call-ready .mat-legend-slot{border-color:#ffe26a;box-shadow:0 0 0 1px #31d9ff7a,0 0 14px #ffc64d8c}

/* Deck and trash are one fused data module beside Eddies. */
#match .arena-band .resource-piles{position:absolute;z-index:9;left:calc(50% + 118px);top:8px;display:grid;width:112px;height:58px;grid-template-columns:repeat(2,minmax(0,1fr));overflow:hidden;border:1px solid #34505b;clip-path:polygon(8px 0,calc(100% - 8px) 0,100% 8px,100% calc(100% - 8px),calc(100% - 8px) 100%,8px 100%,0 calc(100% - 8px),0 8px);background:linear-gradient(135deg,#07151ddb,#03090de8);box-shadow:inset 0 0 12px #31d9ff22,0 5px 14px #000b;backdrop-filter:blur(4px)}
#match .arena-own .resource-piles{top:auto;bottom:8px}
#match .arena-band .mat-deck,#match .arena-band .mat-trash {
  position:relative !important; inset:auto !important; z-index:auto; grid-area:auto !important; align-self:stretch !important; width:auto !important; height:58px !important;
  min-height:44px !important; padding:0 !important; overflow:hidden; border:0 !important; background:transparent !important; backdrop-filter:none;
}
#match .arena-band .mat-deck{border-right:1px solid #34505b !important}
#match .arena-band .mat-deck>.mat-label,#match .arena-band .mat-trash>.mat-label,#match .arena-band .back-caption,#match .arena-band .removed-link{display:none !important}
#match .arena-band .mat-deck>.mat-content,#match .arena-band .mat-trash>.mat-content{width:100%;height:100%}
#match .arena-band .pile-control{position:relative;display:grid;width:100%;height:100%;min-height:44px;place-content:center;padding:0;border:0;background:transparent;color:#d5e4e8}
#match .arena-band .pile-control:focus-visible,#match .arena-band .pile-control:hover{background:#16313b9e;color:#fff;outline:2px solid currentColor;outline-offset:-3px}
#match .arena-band .pile-icon{position:relative;display:block;width:25px;height:23px;color:currentColor}
#match .arena-band .deck-icon::before,#match .arena-band .deck-icon::after{content:"";position:absolute;width:18px;height:13px;border:2px solid currentColor;background:#071118}
#match .arena-band .deck-icon::before{left:1px;top:6px;box-shadow:3px -3px 0 #071118,3px -3px 0 1px currentColor}
#match .arena-band .deck-icon::after{left:7px;top:0}
#match .arena-band .trash-icon{border:2px solid currentColor;clip-path:polygon(12% 0,88% 0,100% 18%,100% 82%,82% 100%,18% 100%,0 82%,0 18%)}
#match .arena-band .trash-icon::before,#match .arena-band .trash-icon::after{content:"";position:absolute;left:4px;right:4px;top:9px;height:2px;background:currentColor;transform:rotate(38deg)}
#match .arena-band .trash-icon::after{transform:rotate(-38deg)}
#match .arena-band .pile-badge{position:absolute;right:3px;bottom:3px;display:grid;min-width:18px;height:17px;place-content:center;padding:0 3px;border:1px solid currentColor;border-radius:3px;background:#03080ded;color:currentColor;font:800 8px/1 'IBM Plex Mono',monospace}
#match .arena-band>.mat-rival,#match .arena-band>.mat-friendly,#match .arena-eddies{display:none !important}

/* Two transparent combat lanes occupy only the space between command rails. */
#match .arena-battle {
  position:absolute !important; z-index:3; top:calc(var(--arena-rail-height) - 8px) !important; right:76px !important;
  bottom:calc(var(--arena-hand-height) + var(--arena-rail-height) - 30px + var(--match-safe-bottom)) !important; left:0 !important;
  min-height:var(--arena-battle-min-height) !important; overflow:hidden;
}
#match .arena-battle>.mat-field{position:absolute !important;inset:0 !important;width:auto !important;height:auto !important;margin:0 !important;padding:0 !important;overflow:hidden;border:0 !important;background:linear-gradient(90deg,transparent 49.92%,#9eb7bf1c 50%,transparent 50.08%),radial-gradient(ellipse at center,#152e3852,transparent 72%) !important}
#match .arena-battle .mat-field>.mat-label{display:none !important}
#match .arena-battle .mat-field>.mat-content{position:absolute !important;inset:0 !important;display:grid !important;width:auto !important;height:auto !important;grid-template-rows:repeat(2,minmax(0,1fr));gap:0}
#match .arena-battle .field-lane{position:relative;display:grid;min-height:0;grid-template-rows:20px minmax(0,1fr);padding:2px 12px;overflow:hidden;border:0 !important;background:transparent !important}
#match .arena-battle .field-lane-rival{box-shadow:inset 0 -1px #ff574c55} #match .arena-battle .field-lane-own{box-shadow:inset 0 1px #31d9ff55}
#match .arena-battle .field-lane-rival::after{content:"";position:absolute;left:44%;right:44%;bottom:-1px;height:2px;background:#b7ccd2;box-shadow:0 0 9px #b7ccd2}
#match .arena-battle .lane-title{min-height:18px;margin:0;opacity:.64}
#match .arena-battle .lane-title .identity-badge,#match .arena-battle .lane-title h3,#match .arena-battle .lane-title>span:not(.lane-turn-state){display:none !important}
#match .arena-battle .lane-turn-state{display:none !important}
#match .arena-battle .field-cards{display:flex;min-height:0;height:100%;flex-wrap:nowrap;align-items:center;justify-content:center;gap:clamp(10px,1.4vw,24px);padding:2px 8px;overflow-x:auto;overflow-y:hidden}
#match .arena-battle .field-cards>.mat-empty{width:44px;height:44px;overflow:hidden;color:transparent;font-size:0}
#match .arena-battle .field-cards>.mat-empty::after{content:"+";display:grid;width:44px;height:44px;place-content:center;color:#50656c;font-size:20px}

/* Deployed full cards are replaced by cropped, short data shards. */
#match .arena-battle .game-card.data-shard {
  position:relative; flex:0 0 clamp(126px,10.5vw,174px) !important; width:clamp(126px,10.5vw,174px) !important;
  height:clamp(92px,12.8dvh,126px) !important; max-height:100% !important; padding:5px !important; overflow:visible !important;
  border:1px solid color-mix(in srgb,var(--card-color) 72%,#d9eef4) !important;
  clip-path:polygon(8% 0,92% 0,100% 12%,100% 88%,92% 100%,8% 100%,0 88%,0 12%);
  background:linear-gradient(145deg,#0d1a22e8,#04090dd9) !important;
  box-shadow:0 8px 18px #000a,inset 0 0 0 2px #071017,0 0 10px color-mix(in srgb,var(--card-color) 42%,transparent) !important;
}
#match .arena-battle .data-shard.spent{transform:rotate(-5deg);filter:saturate(.55) brightness(.72)}
#match .arena-battle .data-shard.selected,#match .arena-battle .data-shard.attack-target-selected{box-shadow:0 0 0 3px var(--arena-gold),0 0 24px #ffc64daa !important}
#match .arena-battle .data-shard .card-art-button{width:100% !important;height:100% !important;min-height:44px !important;overflow:hidden;border:0 !important;clip-path:polygon(7% 0,93% 0,100% 10%,100% 90%,93% 100%,7% 100%,0 90%,0 10%);background:#071017}
#match .arena-battle .data-shard .card-art-button .thumb,#match .arena-battle .data-shard .card-art-button img{width:100% !important;height:100% !important;object-fit:cover !important;object-position:center 28%;filter:contrast(1.08) saturate(.88)}
#match .arena-battle .data-shard h3,#match .arena-battle .data-shard .status,#match .arena-battle .data-shard .mini-actions{display:none !important}
#match .arena-battle .data-shard .card-meta.shard-stats{position:absolute;z-index:4;top:7px;right:7px;display:grid;gap:3px;min-width:44px;min-height:44px;margin:0;padding:0;border:0;border-radius:3px;background:none;color:#f0f7f8;font-size:11px;cursor:pointer;pointer-events:auto}
#match .arena-battle .data-shard .shard-stat{display:grid;min-width:30px;height:24px;grid-template-columns:11px 1fr;place-items:center;padding:2px 4px;border:1px solid #63808a;border-radius:3px;background:#04090de8;box-shadow:0 2px 8px #000a}
#match .arena-battle .data-shard .shard-stat::before{font-size:9px} #match .arena-battle .data-shard .shard-cost::before{content:"€";color:var(--arena-gold)} #match .arena-battle .data-shard .shard-power::before{content:"◆";color:var(--arena-red)}
#match .arena-battle .data-shard .shard-power{display:flex;justify-content:center;gap:3px}
#match .shard-stats:focus-visible{outline:2px solid var(--arena-cyan);outline-offset:3px}
#match .power-modifier{padding:0 2px;border:1px solid currentColor;border-radius:2px;font-size:.8em;line-height:1.25;font-weight:800}
#match .power-up{color:#a6f3b2} #match .power-down{color:#ffaaa4} #match .power-neutral{color:#ffe0a0}
#match .shard-power.power-changed{animation:power-change 900ms ease-out}
@keyframes power-change{0%,35%{border-color:#e9ff9a;box-shadow:0 0 12px #d6ff7caa}100%{box-shadow:0 2px 8px #000a}}
@media(prefers-reduced-motion:reduce){#match .shard-power.power-changed{animation:none}}
.power-breakdown{margin:10px 0;padding:10px;border-left:2px solid var(--arena-cyan,#80eaff);background:#06131c}
.power-breakdown h3{margin:0 0 6px;font-size:1rem}.power-breakdown ul{margin:0;padding-left:20px}.power-breakdown li{margin:4px 0;overflow-wrap:anywhere}
#detail.power-details-view{width:min(520px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:12px;overflow:auto}
#detail.power-details-view #detailContent{display:block;clear:none;padding-top:0}
#detail.power-details-view #detailContent>img,#detail.power-details-view .rules-text,#detail.power-details-view .badge,#detail.power-details-view .card-reference-details,#detail.power-details-view .card-effect-actions{display:none}
#detail.power-details-view #detailContent h2{margin:0 52px 4px 0;font-size:24px;line-height:1.1}
#detail.power-details-view .close{position:sticky;top:0;min-width:44px;min-height:44px}
#match .unit-state-indicator{position:absolute;z-index:5;left:3px;top:2px;display:flex;align-items:center;gap:1px;max-width:calc(100% - 54px);box-sizing:border-box;padding:2px;border:1px solid #73cae0;border-radius:2px;background:#06131df2;color:#adefff;font:800 9px/1.1 "IBM Plex Mono",monospace;pointer-events:none}
#match .unit-state-indicator b{font:inherit;white-space:nowrap}#match .unit-state-indicator small{font-size:6px}
#match .unit-state-indicator.status-restriction{border-color:#e9967c;color:#ffbd9b}#match .unit-state-indicator.status-protection{border-color:#a7eab9;color:#c7ffd6}
#match .unit-status-changed{animation:unit-status-change 900ms ease-out}
@keyframes unit-status-change{0%,35%{box-shadow:0 0 10px #b9f8ffb0;filter:brightness(1.5)}100%{filter:brightness(1)}}
@media(max-height:540px){#match .unit-state-indicator{top:0;font-size:7px;padding:0 1px}}
@media(prefers-reduced-motion:reduce){#match .unit-status-changed{animation:none}}
.unit-status-section{margin-top:12px;padding-top:8px;border-top:1px solid #527080}.unit-status-section h3{margin:0 0 6px;font-size:1rem}.unit-status-section ul{margin:0;padding-left:18px}.unit-status-section li{margin:7px 0;overflow-wrap:anywhere}.unit-status-section li strong,.unit-status-section li span{display:block}.unit-status-section li span,.last-unit-effect{font-size:12px;line-height:1.4;color:#b8cbd3}
#match .draw-fx-layer{position:absolute;inset:0;z-index:80;overflow:hidden;pointer-events:none;contain:layout style}
#match #realHand .draw-awaiting-arrival,#match #realHand .draw-awaiting-arrival *{visibility:hidden !important;pointer-events:none !important}
#match .draw-flight{position:absolute;left:0;top:0;border:1px solid #738a93;border-radius:4px;background:#071017;box-shadow:0 6px 16px #0009;overflow:hidden;pointer-events:none;animation-name:draw-travel;animation-timing-function:cubic-bezier(.22,.65,.3,1);animation-fill-mode:both}
#match .draw-flight img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none}
#match .draw-flight-reveals .draw-back{animation:draw-back-hide 1000ms linear both}#match .draw-face{animation:draw-face-show 1000ms linear both}
@keyframes draw-travel{0%{opacity:0;transform:translate(var(--draw-x),var(--draw-y)) rotate(-8deg) scale(.7)}10%{opacity:1}88%{opacity:1}100%{opacity:0;transform:translate(var(--draw-to-x),var(--draw-to-y)) rotate(0) scale(1)}}
@keyframes draw-back-hide{0%,55%{opacity:1}72%,100%{opacity:0}}
@keyframes draw-face-show{0%,55%{opacity:0}72%,100%{opacity:1}}
#match .draw-count-receiving{animation:draw-count-arrival 1000ms ease-out;outline:2px solid #86e5ee;outline-offset:2px}
@keyframes draw-count-arrival{0%,75%{box-shadow:0 0 12px #51d9e980}100%{box-shadow:none}}
@media(prefers-reduced-motion:reduce){#match .draw-flight{display:none}#match .draw-count-receiving{animation:none}}
#match .arena-battle .data-shard .gear-list{position:absolute;z-index:6;right:-11px;top:20%;bottom:auto;left:auto;display:grid;gap:4px;pointer-events:none}
#match .arena-battle .data-shard .gear-list .shard-module{display:grid;width:44px;min-width:44px;height:36px;min-height:36px;place-content:center;padding:0;border:1px solid var(--arena-gold);clip-path:polygon(0 0,82% 0,100% 22%,100% 78%,82% 100%,0 100%,10% 50%);background:#171107ed;color:#ffe1a0;box-shadow:0 0 10px #ffc64d66;pointer-events:auto}
#match .arena-battle .data-shard .gear-list .program-module{border-color:var(--arena-cyan);clip-path:polygon(8% 0,78% 0,100% 22%,100% 78%,78% 100%,8% 100%,0 72%,0 28%);background:linear-gradient(135deg,#123a47ed,#06131aed);color:#a8efff;box-shadow:0 0 12px #31d9ff8c}
#match .arena-battle .module-icon{position:relative;display:block;width:17px;height:17px;color:currentColor}
#match .arena-battle .equipment-module .module-icon{clip-path:polygon(18% 0,82% 0,100% 30%,88% 100%,50% 82%,12% 100%,0 30%);background:currentColor}
#match .arena-battle .equipment-module .module-icon::after{content:"";position:absolute;inset:4px 5px 7px;background:#171107;clip-path:polygon(0 0,100% 0,75% 100%,25% 100%)}
#match .arena-battle .program-module .module-icon{border:2px solid currentColor;background:repeating-linear-gradient(90deg,transparent 0 3px,currentColor 3px 4px)}
#match .arena-battle .program-module .module-icon::before,#match .arena-battle .program-module .module-icon::after{content:"";position:absolute;left:-5px;right:-5px;top:3px;height:2px;background:currentColor;box-shadow:0 7px currentColor}
#match .arena-battle .program-module .module-icon::after{left:3px;right:auto;top:-5px;width:2px;height:25px;box-shadow:7px 0 currentColor}

/* One continuous control struggle: the shared boundary moves with the score. */
#match .arena-meter {
  position:absolute !important; z-index:18; top:0 !important; right:0 !important; bottom:0 !important; left:auto !important;
  display:block !important; width:var(--arena-meter-width) !important; height:auto !important; min-height:0 !important; padding:calc(var(--arena-meter-top) + var(--arena-overtime-space,0px)) 15px calc(128px + var(--match-safe-bottom)) !important;
  overflow:hidden; border:0 !important; border-left:1px solid #2e4852 !important; border-radius:0 !important;
  background:linear-gradient(90deg,#04090db5,#09131aed) !important; backdrop-filter:blur(5px); pointer-events:none;
}
#match .arena-meter-title{display:none !important}
#match .arena-meter.is-overtime{--arena-overtime-space:20px}
#match .arena-meter-badge{position:absolute;z-index:4;left:50%;transform:translateX(-50%);display:block;padding:3px 4px;border:1px solid currentColor;border-radius:3px;background:#080f16;color:var(--arena-gold);font:700 9px/1.1 "IBM Plex Mono",monospace;white-space:nowrap}
#match .arena-meter-overtime{top:var(--arena-meter-top)}
#match .arena-meter-warning-rival{top:3px;color:#ffaca6}
#match .arena-meter-warning-own{bottom:3px;color:#a7edff}
#match .arena-pressure{position:relative;display:block !important;width:100%;height:100%;min-height:0;overflow:visible;border:1px solid #38515b;border-radius:22px;background:linear-gradient(to bottom,#ff574cd8 0 var(--control-boundary,50%),#31d9ffdc var(--control-boundary,50%) 100%);box-shadow:inset 0 0 18px #000,0 0 14px #000a}
#match .arena-pressure::after{content:"";position:absolute;inset:5px;border-radius:18px;background:repeating-linear-gradient(to bottom,transparent 0 8.5%,#020609b8 8.5% 10%);pointer-events:none}
#match .pressure-side{display:none !important}
#match .pressure-neutral{position:absolute;z-index:3;left:50%;top:var(--control-boundary,50%);display:grid;width:44px;height:44px;place-content:center;transform:translate(-50%,-50%) rotate(45deg);border:2px solid #d9edf2;border-radius:5px;background:linear-gradient(135deg,#ff574c 0 48%,#31d9ff 52%);color:#fff;box-shadow:0 0 16px #fff6;font-size:0}
#match .pressure-neutral::before,#match .pressure-neutral::after{content:"";position:absolute;left:6px;right:6px;height:10px;border:2px solid #fff;transform:rotate(-45deg)}
#match .pressure-neutral::before{top:7px;border-right:0;border-bottom:0;background:#ff574c}
#match .pressure-neutral::after{bottom:7px;border-left:0;border-top:0;background:#31d9ff}

/* Hand, guidance and End Turn are independent transparent HUD layers. */
#match .match-bottom-dock{position:absolute !important;inset:0 !important;z-index:40;display:block !important;width:100% !important;height:100% !important;max-height:none !important;padding:0 !important;overflow:visible !important;border:0 !important;background:transparent !important;pointer-events:none}
#match .match-bottom-dock>*{pointer-events:auto}
#match .match-bottom-dock .hand-area {
  position:absolute !important; z-index:2; left:380px !important; right:154px !important; bottom:var(--match-safe-bottom) !important;
  display:block !important; width:auto !important; height:var(--arena-hand-height) !important; min-height:0 !important;
  padding:22px 8px 0 !important; overflow:hidden !important; border:0 !important;
  background:linear-gradient(180deg,transparent,#050b10a8 34%,#03070bef) !important; box-shadow:none !important;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 8% 92%,transparent),linear-gradient(180deg,transparent,#000 22%);
  mask-image:linear-gradient(90deg,transparent,#000 8% 92%,transparent),linear-gradient(180deg,transparent,#000 22%);
  -webkit-mask-composite:source-in; mask-composite:intersect;
}
#match .match-bottom-dock .hand-area .section-title{position:absolute;z-index:4;top:7px;left:50%;width:auto;height:22px;transform:translateX(-50%);padding:2px 9px;border:1px solid #284953;border-radius:12px;background:#061018c7;white-space:nowrap}
#match .match-bottom-dock .hand-area .section-title h2{font-size:9px} #match #realWallet{display:none}
#match .match-bottom-dock #realHand{position:absolute;inset:25px 0 0;display:flex;height:calc(100% - 25px) !important;min-height:0 !important;align-items:flex-start;justify-content:safe center;padding:4px 18px 0 !important;overflow-x:auto;overflow-y:hidden}
#match .match-bottom-dock #realHand .game-card{flex:0 0 clamp(84px,7.2vw,112px) !important;width:clamp(84px,7.2vw,112px) !important;margin-left:clamp(-30px,-1.7vw,-16px) !important;transform:rotate(var(--fan-angle,0deg)) translateY(var(--fan-drop,0px));transform-origin:50% 120%}
#match .match-bottom-dock #realHand .game-card:first-child{margin-left:0 !important} #match .match-bottom-dock #realHand .card-art-button{height:clamp(122px,20dvh,172px) !important}
#match #realHand .hand-card{position:relative}
#match #realHand .sellable-marker{position:absolute;z-index:8;top:4px;right:4px;display:grid;width:28px;height:24px;place-content:center;border:1px solid #ffe08a;border-radius:5px;background:linear-gradient(145deg,#5b4314,#171005);color:#fff3bd;font:900 10px/1 'IBM Plex Mono',monospace;box-shadow:0 2px 7px #000c,0 0 9px #ffc64d99;pointer-events:none}

#match #stepTracker{position:absolute !important;z-index:5;left:8px !important;bottom:calc(8px + var(--match-safe-bottom)) !important;display:grid !important;width:360px !important;height:var(--arena-tracker-height) !important;max-height:var(--arena-tracker-height) !important;padding:10px 18px !important;overflow:hidden;border:1px solid #31d9ff !important;background:linear-gradient(135deg,#07131bf2,#03080ce8) !important;box-shadow:inset 7px 0 #eff300,inset 0 1px #eff300,0 0 18px #31d9ff2b !important;backdrop-filter:blur(5px)}
#match #stepTracker>h3,#match #stepTracker .turn-steps,#match #stepTracker .effect-queue,#match #stepTracker .tracker-actions{display:none !important}
#match #stepTracker .match-context{display:grid;min-width:0;gap:3px;overflow:hidden} #match #stepTracker .match-context>#matchContextKicker,#match #stepTracker #matchContextHint{display:none !important}
#match #stepTracker .match-context>strong{overflow:hidden;color:#e7f3f5;font-size:15px;text-overflow:ellipsis;white-space:nowrap} #match #stepTracker .match-context>small{overflow:hidden;color:#a7bbc1;font-size:8px;text-overflow:ellipsis;white-space:nowrap}
#match #stepTracker .context-actions{display:flex;gap:4px;overflow-x:auto} #match #stepTracker .context-actions:empty{display:none} #match #stepTracker .context-actions button{flex:0 0 auto;min-height:44px}
#match #stepTracker:has(.context-actions button){left:calc(50% + 112px) !important;bottom:calc(var(--arena-hand-height) - 8px + var(--match-safe-bottom)) !important;width:min(460px,calc(100% - 420px)) !important;height:58px !important;max-height:58px !important;transform:translateX(-50%);padding:6px !important;border-color:#a5bfc7 !important;background:linear-gradient(135deg,#07131bf2,#03080cf2) !important;box-shadow:0 8px 18px #000c,0 0 15px #31d9ff35 !important}
#match #stepTracker:has(.context-actions button) .match-context{display:block;overflow:visible}
#match #stepTracker:has(.context-actions button) .match-context>strong,#match #stepTracker:has(.context-actions button) .match-context>small,#match #stepTracker:has(.context-actions button) .match-context>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#match #stepTracker:has(.context-actions button) .context-actions{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(118px,1fr);width:100%;height:46px;justify-content:center;gap:5px;overflow-x:auto;padding:0}
#match #stepTracker:has(.context-actions button) .context-actions button{width:100%;min-width:118px;min-height:44px;padding:6px 10px;text-align:center;white-space:nowrap}
#match .match-bottom-dock .turn-dock{position:absolute !important;z-index:5;right:8px !important;bottom:calc(8px + var(--match-safe-bottom)) !important;left:auto !important;display:grid !important;width:138px !important;height:var(--arena-turn-height) !important;min-height:0 !important;place-content:center;padding:7px !important;overflow:hidden;border:1px solid #8c722d !important;background:linear-gradient(135deg,#201708df,#0c0904d1) !important;box-shadow:0 0 18px #ffc64d25 !important;backdrop-filter:blur(5px)}
#match .turn-dock-label,#match #endTurnHint{display:none !important} #match .match-bottom-dock .turn-dock button{width:120px;min-height:54px}
#match #matchPlayOptions{padding-inline:4px;white-space:normal;line-height:1.2}

/* Floating secondary menu. */
#match>.toolbar{position:absolute;z-index:95;top:max(6px,env(safe-area-inset-top,0px));right:calc((var(--arena-meter-width,76px) - 44px) / 2 + 1px);display:block !important;width:44px;height:44px;margin:0}
#match .match-settings>summary{width:44px;height:44px;min-height:44px;padding:0;border:1px solid #68828b;border-radius:50%;background:#061018d9;color:#d8e7e9;font-size:24px;line-height:42px;box-shadow:0 3px 14px #0009;backdrop-filter:blur(5px)}
#match .match-settings-panel{position:fixed;z-index:100;top:max(56px,calc(env(safe-area-inset-top,0px) + 54px));right:max(6px,env(safe-area-inset-right,0px));width:min(390px,calc(100vw - 12px));max-height:calc(100dvh - 64px - env(safe-area-inset-bottom,0px));overflow:auto}

/* Hand layers rise only while the player is making a hand decision. */
#match .hand-expand-toggle{position:absolute;z-index:72;right:150px;bottom:calc(8px + var(--match-safe-bottom));width:44px;height:44px;min-height:44px;padding:0;border-radius:50%;background:#07141ded;color:var(--arena-cyan);font-size:24px}
#match.hand-expanded .match-bottom-dock{z-index:88;background:radial-gradient(ellipse at 50% 70%,#07151be8,#000a 74%) !important;pointer-events:auto}
#match.hand-expanded .match-bottom-dock .hand-area{left:max(8px,env(safe-area-inset-left,0px)) !important;right:max(8px,env(safe-area-inset-right,0px)) !important;bottom:var(--match-safe-bottom) !important;z-index:70;height:min(48dvh,350px) !important;padding-top:8px !important;overflow:visible !important;-webkit-mask-image:none;mask-image:none;background:linear-gradient(180deg,transparent,#06131aec 18%,#020609 62%) !important}
#match.hand-expanded #realHand{inset:28px 0 0;height:calc(100% - 28px) !important;padding:12px 56px !important}
#match.hand-expanded #realHand .game-card{flex-basis:clamp(112px,13vw,154px) !important;width:clamp(112px,13vw,154px) !important;margin-left:clamp(-42px,-3vw,-18px) !important}
#match.hand-expanded #realHand .card-art-button{height:clamp(160px,36dvh,250px) !important}
#match.hand-expanded .hand-expand-toggle{position:fixed;right:max(12px,env(safe-area-inset-right,0px));bottom:calc(8px + var(--match-safe-bottom));z-index:150}

#match:has(#stepTracker .turn-steps li:nth-child(2):last-child) .match-bottom-dock{z-index:88;background:radial-gradient(ellipse at 50% 53%,#07151bdd,#000c 72%) !important;pointer-events:auto}
#match:has(#stepTracker .turn-steps li:nth-child(2):last-child) .hand-area{left:6vw !important;right:6vw !important;top:8% !important;bottom:auto !important;z-index:2;height:min(64dvh,450px) !important;padding:10px 10px 0 !important;overflow:visible !important;-webkit-mask-image:none;mask-image:none;background:transparent !important}
#match:has(#stepTracker .turn-steps li:nth-child(2):last-child) .hand-area .section-title{display:none}
#match:has(#stepTracker .turn-steps li:nth-child(2):last-child) #realHand{inset:0;height:100% !important;padding:12px !important;align-items:flex-start;overflow-x:auto;overflow-y:visible}
#match:has(#stepTracker .turn-steps li:nth-child(2):last-child) #realHand .game-card{flex:0 0 clamp(116px,14vw,176px) !important;width:clamp(116px,14vw,176px) !important;margin-left:clamp(-54px,-3.4vw,-22px) !important}
#match:has(#stepTracker .turn-steps li:nth-child(2):last-child) #realHand .card-art-button{height:clamp(174px,43dvh,300px) !important}
#match:has(#stepTracker .turn-steps li:nth-child(2):last-child) #stepTracker{left:50% !important;bottom:calc(10px + var(--match-safe-bottom)) !important;z-index:4;width:min(560px,calc(100% - 24px)) !important;height:auto !important;max-height:none !important;transform:translateX(-50%);clip-path:none;background:#061018ed !important}
#match:has(#stepTracker .turn-steps li:nth-child(2):last-child) #stepTracker .context-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible}
#match:has(#stepTracker .turn-steps li:nth-child(2):last-child) #stepTracker .context-actions button{width:100%;min-height:48px}
#match:has(#stepTracker .turn-steps li:nth-child(2):last-child) .turn-dock,#match:has(#stepTracker .turn-steps li:nth-child(2):last-child) .hand-expand-toggle{display:none !important}

[data-drag-kind]{touch-action:none !important;cursor:grab}[data-drag-kind]:active{cursor:grabbing}
.card-drag-ghost{position:fixed;z-index:140;left:0;top:0;width:clamp(96px,13vw,150px);padding:4px;border:2px solid #31d9ff;border-radius:7px;background:#07131b;box-shadow:0 16px 36px #000c,0 0 20px #31d9ff88;pointer-events:none;opacity:.94}
#match .drag-drop-hover{outline:3px solid #eff300 !important;outline-offset:-3px;box-shadow:inset 0 0 34px #eff30030 !important} body.card-drag-active{user-select:none}
#match .mat-zone>.mat-label[aria-hidden=true]{pointer-events:none}
@media (hover:hover) and (pointer:fine){#match .field-cards,#match #realHand{scrollbar-gutter:stable}}

/* Same composition, continuously compressed for short landscape screens. */
@media (orientation:landscape) and (max-height:620px){
  body.match-active #match:not([hidden]){--arena-meter-width:62px;--arena-meter-top:52px;--arena-rail-height:clamp(52px,16dvh,66px);--arena-hand-height:clamp(86px,25dvh,104px);--arena-battle-min-height:58px;--arena-tracker-height:54px;--arena-turn-height:88px}
  #match .arena-band{right:62px}
  #match .arena-band .mat-fixer>.mat-content{grid-template-columns:repeat(3,54px) minmax(260px,1fr) repeat(3,54px) !important;gap:2px !important;padding:0 8px !important}
  #match .arena-band .fixer-die{width:48px !important;height:44px !important;padding:1px !important} #match .arena-band .fixer-die .gig-node-value{font-size:16px} #match .arena-band .fixer-die .gig-node-designation{right:3px;bottom:3px;left:auto;top:auto;min-width:0;height:auto;font-size:8px}
  #match .arena-band .player-hub{width:48px !important;height:48px !important} #match .arena-band .player-hub .identity-badge>.portrait-image{width:36px !important;height:auto !important;clip-path:circle(18px at 50% 50%)}
  #match .arena-band .player-hub-stat{top:7px !important;width:42px !important;min-height:30px !important} #match .arena-band .hub-gigs{right:calc(100% + 5px) !important} #match .arena-band .hub-eddies{left:calc(100% + 5px) !important} #match .arena-band .player-hub-stat strong{font-size:11px}
  #match .arena-band .mat-legends{left:calc(50% - 170px) !important;width:92px !important;height:48px !important} #match .arena-band .mat-legend-slot{top:2px !important;width:44px !important;height:44px !important}
  #match .arena-band .mat-legend-slot:nth-child(1){left:0 !important} #match .arena-band .mat-legend-slot:nth-child(2){left:24px !important} #match .arena-band .mat-legend-slot:nth-child(3){left:48px !important;top:2px !important;bottom:auto !important} #match .arena-rival .mat-legend-slot:nth-child(3){top:2px !important;bottom:auto !important}
  #match .arena-band .resource-piles{left:calc(50% + 78px);top:2px;width:92px;height:44px}
  #match .arena-own .resource-piles{top:auto;bottom:2px}
  #match .arena-band .mat-deck,#match .arena-band .mat-trash{width:auto !important;height:44px !important;min-height:44px !important;inset:auto !important}
  #match .arena-band .pile-badge{right:2px;bottom:2px;min-width:16px;height:15px;font-size:7px}
  #match .arena-battle{top:calc(var(--arena-rail-height) - 4px) !important;right:62px !important;bottom:calc(var(--arena-hand-height) + var(--arena-rail-height) - 18px + var(--match-safe-bottom)) !important}
  #match .arena-battle .field-lane{grid-template-rows:14px minmax(0,1fr);padding:1px 3px}
  #match .arena-battle .data-shard{flex-basis:clamp(88px,12vw,112px) !important;width:clamp(88px,12vw,112px) !important;height:clamp(56px,14dvh,76px) !important;padding:3px !important}
  #match .arena-battle .data-shard .shard-stat{min-width:24px;height:19px;grid-template-columns:8px 1fr;padding:1px 2px;font-size:8px}
  #match .arena-battle .data-shard .gear-list{bottom:-8px} #match .arena-battle .data-shard .gear-list .shard-module{width:44px;height:26px;min-height:26px;font-size:14px}
  #match .arena-meter{padding-inline:13px !important;padding-bottom:calc(var(--arena-hand-height) + 10px + var(--match-safe-bottom)) !important} #match .pressure-neutral{width:32px;height:32px}
  #match #stepTracker{left:4px !important;bottom:var(--match-safe-bottom) !important;width:226px !important;padding:5px 10px !important;}
  #match #stepTracker:has(.context-actions button){left:calc(50% + 68px) !important;bottom:calc(var(--arena-hand-height) - 6px + var(--match-safe-bottom)) !important;width:min(390px,calc(100% - 330px)) !important;padding:5px !important}
  #match #stepTracker .match-context>#matchContextKicker,#match #stepTracker .match-context>small{display:none} #match #stepTracker .match-context>strong{font-size:11px}
  #match .match-bottom-dock .hand-area{left:232px !important;right:96px !important;padding-top:16px !important} #match .match-bottom-dock .hand-area .section-title{top:1px;height:18px}
  #match .match-bottom-dock #realHand{inset:16px 0 0;height:calc(100% - 16px) !important;padding-inline:4px !important}
  #match .match-bottom-dock #realHand .game-card{flex-basis:76px !important;width:76px !important;margin-left:-14px !important} #match .match-bottom-dock #realHand .card-art-button{height:104px !important}
  #match #realHand .sellable-marker{top:2px;right:2px;width:24px;height:21px;font-size:8px}
  #match.hand-expanded #realHand .card-art-button{height:clamp(142px,36dvh,230px) !important}
  #match .match-bottom-dock .turn-dock{right:4px !important;bottom:calc(4px + var(--match-safe-bottom)) !important;width:88px !important} #match .match-bottom-dock .turn-dock button{width:74px;min-height:54px;font-size:11px}
  #match .hand-expand-toggle{right:94px;bottom:calc(4px + var(--match-safe-bottom))}
}
@media (orientation:landscape) and (max-width:1100px) and (max-height:430px){
  body.match-active #match:not([hidden]){--arena-rail-height:52px;--arena-hand-height:88px;--arena-battle-min-height:54px;--arena-tracker-height:54px;--arena-turn-height:84px}
  #match .arena-band .mat-fixer>.mat-content{padding-inline:6px !important}
  #match .arena-battle .data-shard{height:58px !important} #match .match-bottom-dock .hand-area{left:230px !important;right:94px !important}
  #match:has(#stepTracker .turn-steps li:nth-child(2):last-child) .hand-area{top:2% !important;height:66dvh !important;min-height:170px !important}
  #match:has(#stepTracker .turn-steps li:nth-child(2):last-child) #realHand .card-art-button{height:clamp(142px,48dvh,190px) !important}
  #match:has(#stepTracker .turn-steps li:nth-child(2):last-child) #stepTracker{bottom:calc(4px + var(--match-safe-bottom)) !important;padding:4px !important}
  #match.hand-expanded .match-bottom-dock .hand-area{height:60dvh !important;min-height:150px !important} #match.hand-expanded #realHand .card-art-button{height:48dvh !important}
}
@media (prefers-reduced-motion:reduce){#match *,#match *::before,#match *::after{scroll-behavior:auto !important;animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}

/* Approved interaction pass: visibility is independent from availability. */
#match #realHand .game-card[data-play-state="unavailable"]{opacity:1 !important;filter:none !important}
#match #realHand .game-card[data-play-state="inspect"]{opacity:1 !important;filter:none !important;border-color:#87a7b1;box-shadow:0 8px 18px #000a,0 0 10px #31d9ff2e}
#match #realHand .game-card[data-play-state="inspect"] .hand-action-state,
#match #realHand .game-card[data-play-state="inspect"] .hand-lock-reason{display:none !important}

/* Used is a gameplay state, not a visibility penalty. */
#match .arena-battle .data-shard.spent{transform:rotate(-4deg);filter:none !important;border-style:dashed !important;box-shadow:0 8px 18px #000a,inset 0 0 0 2px #071017,0 0 0 2px #899ba3 !important}
#match .arena-battle .data-shard.spent .card-art-button img{filter:contrast(1.08) saturate(.88) !important}
#match .arena-battle .data-shard.spent .status{position:absolute;z-index:7;right:4px;bottom:4px;display:block !important;padding:3px 6px;border:1px solid #91a6ad;background:#061018ed;color:#d9e7ea;font:900 9px/1 'IBM Plex Mono',monospace;letter-spacing:.08em;pointer-events:none}

/* Tap targeting: attacker/target brackets and a direct visual vector. */
#match .arena-battle .data-shard.selected::before{content:"ATTACKER" !important;position:absolute;z-index:9;top:-11px;left:50%;padding:3px 8px;transform:translateX(-50%);border:1px solid var(--arena-cyan);background:#06202aed;color:#8cecff;font:900 9px/1 'IBM Plex Mono',monospace;letter-spacing:.09em;white-space:nowrap}
#match .arena-battle .data-shard.attack-target-option{outline:2px solid var(--arena-gold);outline-offset:3px;box-shadow:0 0 0 1px #101600,0 0 20px #ffc64d5e !important}
#match .arena-battle .data-shard.attack-target-selected::before{content:"TARGET" !important;position:absolute;z-index:9;top:-11px;left:50%;padding:3px 8px;transform:translateX(-50%);border:1px solid var(--arena-gold);background:#241b06ed;color:#ffe269;font:900 9px/1 'IBM Plex Mono',monospace;letter-spacing:.09em;white-space:nowrap}
#match .attack-vector,#match .gig-capture-vector{position:absolute;z-index:36;height:3px;transform-origin:0 50%;pointer-events:none}
#match .attack-vector{background:linear-gradient(90deg,var(--arena-cyan),var(--arena-gold));box-shadow:0 0 8px #31d9ff,0 0 13px #ffc64d}
#match .attack-vector::after,#match .gig-capture-vector::after{content:"";position:absolute;right:-2px;top:50%;width:12px;height:12px;transform:translateY(-50%) rotate(45deg);border-top:3px solid currentColor;border-right:3px solid currentColor}
#match .attack-vector::after{color:var(--arena-gold)}
#match .gig-capture-vector{z-index:82;background:linear-gradient(90deg,var(--arena-cyan),#fff,var(--arena-gold));color:var(--arena-gold);box-shadow:0 0 10px #31d9ff,0 0 18px #ffc64d;animation:gig-capture-surge .65s ease-out both}
@keyframes gig-capture-surge{0%{opacity:0;clip-path:inset(0 100% 0 0)}35%{opacity:1}100%{opacity:0;clip-path:inset(0 -14px 0 0)}}
#match .fixer-die.action-resolved{animation:gig-secured-node .7s ease-out both !important}
@keyframes gig-secured-node{0%{filter:brightness(1)}35%{filter:brightness(1.8);transform:scale(1.12)}100%{filter:brightness(1);transform:none}}

/* Targeting temporarily owns the bottom command dock and replaces End Turn. */
#match[data-action-state="targeting"] .match-bottom-dock .turn-dock,
#match[data-action-state="targeting"] .hand-expand-toggle{display:none !important}
#match[data-action-state="targeting"] .match-bottom-dock .hand-area{bottom:calc(64px + var(--match-safe-bottom)) !important}
#match[data-action-state="targeting"] #stepTracker:has(.context-actions button){right:max(6px,env(safe-area-inset-right,0px)) !important;bottom:calc(4px + var(--match-safe-bottom)) !important;left:max(6px,env(safe-area-inset-left,0px)) !important;z-index:94;width:auto !important;height:58px !important;max-height:58px !important;transform:none !important;padding:5px 7px !important;}
#match[data-action-state="targeting"] #stepTracker .match-context{display:grid !important;grid-template-columns:minmax(0,1fr) auto !important;grid-template-rows:1fr 1fr !important;grid-template-areas:"title actions" "hint actions" !important;align-items:center;gap:0 10px;height:100%;overflow:hidden}
#match[data-action-state="targeting"] #stepTracker .match-context>strong{position:static !important;grid-area:title;width:auto !important;height:auto !important;overflow:hidden !important;clip-path:none !important;color:#f1f7f8;font-size:16px !important;line-height:1.05;text-overflow:ellipsis;white-space:nowrap !important}
#match[data-action-state="targeting"] #stepTracker .match-context>small{position:static !important;grid-area:hint;display:block !important;width:auto !important;height:auto !important;overflow:hidden !important;clip-path:none !important;color:#b9c9cd;font-size:11px;line-height:1.1;text-overflow:ellipsis;white-space:nowrap !important}
#match[data-action-state="targeting"] #stepTracker .match-context>#matchContextKicker,
#match[data-action-state="targeting"] #stepTracker .match-context>.context-result,
#match[data-action-state="targeting"] #stepTracker .match-context>.context-sync{display:none !important}
#match[data-action-state="targeting"] #stepTracker .context-actions{grid-area:actions;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(150px,1fr);width:auto;height:48px;gap:7px;overflow:visible;padding:0}
#match[data-action-state="targeting"] #stepTracker .context-actions button{min-width:150px;min-height:48px;padding:7px 16px;font-size:16px;font-weight:900;text-align:center}
#match[data-action-state="targeting"] #stepTracker .context-actions .primary{background:#eff300;color:#101400;border-color:#eff300}

/* Mandatory Gig claims expose only actionable nodes without hiding their values. */
#match.choosing-gigs .mat-rival .fixer-die:not(.stealable){opacity:.42 !important;filter:saturate(.45)}
#match.choosing-gigs .mat-rival .fixer-die.stealable{opacity:1 !important;filter:none;outline:3px solid var(--arena-gold);outline-offset:3px}
#match .gig-choice-badge{min-width:max-content}

@media (orientation:landscape) and (max-height:430px){
 #match[data-action-state="targeting"] .match-bottom-dock .hand-area{bottom:calc(56px + var(--match-safe-bottom)) !important}
 #match[data-action-state="targeting"] #stepTracker:has(.context-actions button){height:52px !important;max-height:52px !important;padding:3px 5px !important}
 #match[data-action-state="targeting"] #stepTracker .match-context{grid-template-columns:minmax(0,1fr) minmax(250px,auto) !important}
 #match[data-action-state="targeting"] #stepTracker .match-context>strong{font-size:13px !important}
 #match[data-action-state="targeting"] #stepTracker .match-context>small{font-size:9px}
 #match[data-action-state="targeting"] #stepTracker .context-actions{height:46px;grid-auto-columns:minmax(118px,1fr)}
 #match[data-action-state="targeting"] #stepTracker .context-actions button{min-width:118px;min-height:46px;padding:5px 9px;font-size:14px}
}
@media (prefers-reduced-motion:reduce){#match .attack-vector,#match .gig-capture-vector,#match .fixer-die.action-resolved{animation:none !important}}

/* Gig breach + paid Legend actions v7.
   The idle coach is gone. Required choices temporarily own a single focused
   surface, while Call and Go Solo remain attached to the Legend rail. */
#match[data-action-state="main"] #stepTracker,
#match[data-action-state="gig"] #stepTracker,
#match[data-action-state="waiting"] #stepTracker,
#match[data-action-state="steal"] #stepTracker,
#match[data-action-state="complete"] #stepTracker:not(:has(.context-actions button)) { display:none !important; }

#match .mat-legend-slot { position:relative; }
#match .mat-legend-slot .legend-back { width:100%;height:100%;min-height:44px;padding:0;border:0;background:transparent; }
#match .mat-legend-slot .legend-back:focus-visible,
#match .mat-legend-slot .legend-art:focus-visible { outline:3px solid var(--arena-gold);outline-offset:2px; }
#match .mat-legend-slot.legend-action-selected { outline:2px solid var(--arena-gold);outline-offset:2px;box-shadow:0 0 18px #ffc64d88;transform:translateY(-2px); }
#match .legend-paid-cue { position:absolute;z-index:9;right:0;bottom:-10px;min-width:max-content;padding:2px 4px;border:1px solid var(--arena-gold);background:#181204f2;color:#ffe06c;font:900 7px/1 "IBM Plex Mono",monospace;letter-spacing:.05em;pointer-events:none; }
#match .legend-back:disabled + .legend-paid-cue { opacity:.42; }

#match[data-action-state="legend"] .match-bottom-dock .turn-dock,
#match[data-action-state="legend"] .hand-expand-toggle { display:none !important; }
#match[data-action-state="legend"] #stepTracker:has(.context-actions button) { right:max(6px,env(safe-area-inset-right,0px)) !important;bottom:calc(4px + var(--match-safe-bottom)) !important;left:max(6px,env(safe-area-inset-left,0px)) !important;z-index:94;width:auto !important;height:60px !important;max-height:60px !important;transform:none !important;padding:5px 7px !important; }
#match[data-action-state="legend"] #stepTracker .match-context { display:grid !important;grid-template-columns:minmax(0,1fr) auto !important;grid-template-rows:1fr 1fr !important;grid-template-areas:"title actions" "hint actions" !important;align-items:center;gap:0 10px;height:100%;overflow:hidden; }
#match[data-action-state="legend"] #stepTracker .match-context>strong { position:static !important;grid-area:title;width:auto !important;height:auto !important;overflow:hidden !important;clip-path:none !important;color:#f6e8aa;font-size:15px !important;line-height:1.05;text-overflow:ellipsis;white-space:nowrap !important; }
#match[data-action-state="legend"] #stepTracker .match-context>small { position:static !important;grid-area:hint;display:block !important;width:auto !important;height:auto !important;overflow:hidden !important;clip-path:none !important;color:#c8c4aa;font-size:10px;line-height:1.1;text-overflow:ellipsis;white-space:nowrap !important; }
#match[data-action-state="legend"] #stepTracker .match-context>#matchContextKicker,
#match[data-action-state="legend"] #stepTracker .match-context>.context-result,
#match[data-action-state="legend"] #stepTracker .match-context>.context-sync { display:none !important; }
#match[data-action-state="legend"] #stepTracker .context-actions { grid-area:actions;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(128px,1fr);width:auto;height:48px;gap:7px;overflow:visible;padding:0; }
#match[data-action-state="legend"] #stepTracker .context-actions button { min-width:128px;min-height:48px;padding:7px 12px;font-size:14px;font-weight:900;text-align:center; }

#match.choosing-gigs .arena-playmat,
#match.choosing-gigs .match-bottom-dock { filter:brightness(.42) saturate(.55); }
#match.choosing-gigs .turn-dock,
#match.choosing-gigs .hand-expand-toggle { pointer-events:none; }
#match .gig-hack-overlay[hidden] { display:none !important; }
#match .gig-hack-overlay { position:absolute;z-index:93;inset:0;display:grid;place-items:center;padding:clamp(8px,2vw,24px);pointer-events:auto;background:radial-gradient(circle at 50% 52%,#09263244,#0003 58%); }
#match .gig-hack-shell { position:relative;width:min(900px,calc(100vw - 56px));max-height:min(70dvh,620px);padding:clamp(14px,2vw,24px);overflow:auto;border:2px solid var(--arena-cyan);background:linear-gradient(180deg,#071720f7,#030a0ff7),repeating-linear-gradient(0deg,transparent 0 6px,#31d9ff08 7px);box-shadow:inset 0 0 0 5px #02070b,inset 0 0 38px #31d9ff25,0 0 0 1px #baf7ff,0 18px 60px #000e,0 0 34px #31d9ff55; }
#match .gig-hack-shell::before,#match .gig-hack-shell::after { content:"";position:absolute;z-index:0;left:8%;right:8%;height:2px;background:linear-gradient(90deg,transparent,var(--arena-cyan),#fff,var(--arena-cyan),transparent);opacity:.5;animation:gig-hack-scan 2.4s linear infinite; }
#match .gig-hack-shell::before { top:0; }
#match .gig-hack-shell::after { bottom:0;animation-direction:reverse; }
#match .gig-hack-shell>* { position:relative;z-index:1; }
#match .gig-hack-code { display:block;margin:-4px 0 5px;color:#55d8ee;font:700 8px/1.2 "IBM Plex Mono",monospace;letter-spacing:.12em;opacity:.72;white-space:nowrap;overflow:hidden; }
#match .gig-hack-shell header { display:flex;align-items:start;justify-content:space-between;gap:18px;margin-bottom:6px; }
#match .gig-hack-shell header span { color:#55e6ff;font:900 11px/1 "IBM Plex Mono",monospace;letter-spacing:.16em; }
#match .gig-hack-shell h2 { margin:5px 0 0;color:#f2f8f8;font:900 clamp(22px,3vw,38px)/1 "Barlow Condensed",sans-serif;letter-spacing:.045em; }
#match .gig-hack-trace { display:grid;min-width:112px;padding:7px 10px;border:1px solid #ff574c;background:#240a0acc;color:#ff7167;text-align:right;box-shadow:inset 0 0 12px #ff574c2c; }
#match .gig-hack-trace small { font:800 8px/1 "IBM Plex Mono",monospace;letter-spacing:.12em; }
#match .gig-hack-trace strong { margin-top:4px;font:900 14px/1 "IBM Plex Mono",monospace; }
#match .gig-hack-progress-row { display:flex;align-items:center;gap:12px;color:#bcecf4;font:800 10px/1 "IBM Plex Mono",monospace; }
#match .gig-hack-progress { display:flex;flex:1;gap:5px; }
#match .gig-hack-progress i { height:5px;flex:1;border:1px solid #35616d;background:#061018; }
#match .gig-hack-progress i.current { border-color:var(--arena-gold);background:#4a360b;box-shadow:0 0 8px #ffc64d88; }
#match .gig-hack-progress i.secured { border-color:var(--arena-cyan);background:var(--arena-cyan);box-shadow:0 0 8px #31d9ff88; }
#match #gigHackStatus { margin:8px 0 12px;color:#a9bec4;font-size:12px; }
#match .gig-hack-options { position:relative;display:grid;grid-template-columns:repeat(auto-fit,minmax(128px,1fr));gap:clamp(10px,2vw,20px);padding:14px 10px; }
#match .gig-hack-options::before { content:"";position:absolute;z-index:0;left:6%;right:6%;top:50%;height:2px;background:linear-gradient(90deg,var(--arena-cyan),#fff,var(--arena-cyan));box-shadow:0 0 10px #31d9ff; }
#match .gig-hack-port { position:relative;z-index:1;display:grid;min-width:0;min-height:142px;place-items:center;gap:5px;padding:12px;border:2px solid var(--arena-gold);background:#071219f2;color:#ffe16d;box-shadow:inset 0 0 20px #ffc64d1d,0 0 17px #ffc64d42; }
#match .gig-hack-port:hover,#match .gig-hack-port:focus-visible { transform:translateY(-3px);outline:3px solid #fff;outline-offset:2px; }
#match .gig-hack-port.route-locked { border-color:var(--arena-cyan);color:#90efff;box-shadow:inset 0 0 25px #31d9ff2c,0 0 24px #31d9ffaa; }
#match .gig-hack-chassis { position:relative;display:grid;width:82px;height:82px;place-content:center;border:4px solid currentColor;clip-path:polygon(16px 0,calc(100% - 16px) 0,100% 16px,100% calc(100% - 16px),calc(100% - 16px) 100%,16px 100%,0 calc(100% - 16px),0 16px);background:radial-gradient(circle,#16313c 0 35%,#03080c 37%);box-shadow:inset 0 0 0 5px #020508,inset 0 0 18px currentColor,0 0 14px currentColor; }
#match .gig-hack-chassis strong { font:900 34px/1 "IBM Plex Mono",monospace;color:#fff;text-shadow:0 0 8px currentColor; }
#match .gig-hack-chassis small { position:absolute;right:6px;bottom:5px;font:900 10px/1 "IBM Plex Mono",monospace;text-transform:uppercase; }
#match .gig-hack-packet { position:absolute;top:50%;left:-32px;width:8px;height:8px;background:#fff;box-shadow:0 0 10px var(--arena-cyan);animation:gig-hack-packet 1.1s linear infinite; }
#match .gig-hack-port-state { font:900 11px/1 "IBM Plex Mono",monospace;letter-spacing:.09em; }
#match .gig-hack-check { position:absolute;top:4px;right:5px;display:none;width:28px;height:28px;place-content:center;border:2px solid var(--arena-cyan);border-radius:50%;background:#05202a;color:#fff;font-weight:900;box-shadow:0 0 12px var(--arena-cyan); }
#match .route-locked .gig-hack-check { display:grid; }
#match .gig-hack-actions { display:grid;grid-template-columns:minmax(130px,.65fr) minmax(180px,1fr);gap:9px;margin-top:4px; }
#match .gig-hack-actions button { min-height:48px;font-size:15px;font-weight:900; }
#match .gig-hack-actions .primary:not(:disabled) { background:var(--arena-gold);border-color:var(--arena-gold);color:#111500;box-shadow:0 0 18px #ffc64d77; }
@keyframes gig-hack-scan { 0%{transform:translateX(-12%);opacity:.18}50%{opacity:.8}100%{transform:translateX(12%);opacity:.18} }
@keyframes gig-hack-packet { 0%{transform:translateX(0);opacity:0}20%{opacity:1}100%{transform:translateX(42px);opacity:0} }

@media (orientation:landscape) and (max-height:500px){
 #match .gig-hack-overlay { padding:4px 64px 4px 4px; }
 #match .gig-hack-shell { width:min(780px,calc(100vw - 96px));max-height:calc(100dvh - 8px);padding:9px 14px; }
 #match .gig-hack-shell h2 { font-size:22px; }
 #match #gigHackStatus,#match .gig-hack-code { display:none; }
 #match .gig-hack-options { gap:8px;padding:7px 6px; }
 #match .gig-hack-port { min-height:104px;padding:7px; }
 #match .gig-hack-chassis { width:62px;height:62px; }
 #match .gig-hack-chassis strong { font-size:25px; }
 #match .gig-hack-actions button { min-height:44px; }
 #match[data-action-state="legend"] #stepTracker .match-context>strong { font-size:12px !important; }
 #match[data-action-state="legend"] #stepTracker .match-context>small { font-size:8px; }
 #match[data-action-state="legend"] #stepTracker .context-actions { grid-auto-columns:minmax(108px,1fr); }
 #match[data-action-state="legend"] #stepTracker .context-actions button { min-width:108px;font-size:12px; }
}
@media (prefers-reduced-motion:reduce){
 #match .gig-hack-shell::before,#match .gig-hack-shell::after,#match .gig-hack-packet { animation:none !important; }
 #match .gig-hack-port:hover,#match .gig-hack-port:focus-visible { transform:none; }
}

/* Readable action pass: keep the board visible while every commitment is explicit. */
body.match-active .card-reading-preview{position:fixed !important;z-index:240 !important;inset:0 !important;display:grid !important;width:auto !important;height:auto !important;max-width:none !important;max-height:none !important;place-items:center;margin:0 !important;padding:clamp(12px,3vw,36px) !important;overflow:hidden !important;border:0 !important;background:radial-gradient(circle at 50% 50%,#06131ac7 0 18%,#0205088f 58%,#0008) !important;box-shadow:none !important;pointer-events:none}
body.match-active .card-reading-preview[hidden]{display:none !important}
body.match-active .card-reading-preview .card-inspect-image{display:block;width:auto;height:auto;max-width:min(76vw,430px);max-height:min(86dvh,680px);object-fit:contain;border:0;filter:drop-shadow(0 24px 34px #000e) drop-shadow(0 0 18px #31d9ff55);animation:card-hold-in .13s ease-out both}
body.match-active .card-reading-preview.pinned{pointer-events:auto}
body.match-active .card-reading-preview::backdrop{background:transparent}
.card-inspect-close{position:absolute;top:max(8px,env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));width:44px;height:44px;padding:0;font-size:24px}
.card-inspect-fallback{width:min(460px,80vw);max-height:72dvh;overflow:auto;padding:16px;background:#08131b;border:1px solid #315064;overflow-wrap:anywhere}
.card-inspect-fallback p{white-space:pre-line;margin:0}
body.match-active .card-reading-preview.with-gear{grid-template-rows:minmax(0,1fr) auto;gap:8px}
body.match-active .card-reading-preview.with-gear .card-inspect-image{max-height:100% !important;min-height:0}
.card-inspect-gear{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;max-height:25dvh;overflow:auto}
@keyframes card-hold-in{from{opacity:0;transform:scale(.92) translateY(8px)}to{opacity:1;transform:none}}

#match .match-bottom-dock .hand-area .section-title{display:none !important}
#match .arena-band .player-hub .identity-badge>span:not(.portrait-image),#match .arena-band .player-hub .identity-badge strong,#match .arena-band .player-hub-stats{display:none !important}
#match .arena-rival .player-hub.gig-attack-target{cursor:pointer;outline:3px solid var(--arena-gold);outline-offset:5px;box-shadow:0 0 0 2px #120e04,0 0 28px #ffc64daa,inset 0 0 20px #ffc64d44 !important;animation:hub-target-ready .75s ease-in-out infinite alternate}
#match .arena-rival .player-hub.attack-target-selected{outline-color:#eff300;box-shadow:0 0 0 3px #eff300,0 0 34px #eff300aa,inset 0 0 24px #eff30055 !important;animation:none}
@keyframes hub-target-ready{to{filter:brightness(1.22)}}

#match .rival-hand-count{position:absolute;z-index:7;left:50%;top:calc(100% + 20px);display:flex;min-width:42px;height:25px;align-items:center;justify-content:center;gap:5px;transform:translateX(-50%);border:1px solid #71868d;border-radius:4px;background:#03090ded;color:#eef7f8;box-shadow:0 5px 13px #000b;font:900 11px/1 "IBM Plex Mono",monospace;pointer-events:none}
#match .rival-hand-count i{position:relative;width:13px;height:16px;border:1px solid #c2d6dc;background:#10242d;box-shadow:-3px 2px 0 -1px #03090d,-3px 2px 0 0 #728991}

#match .arena-band .fixer-die.can-roll{cursor:pointer}
#match .arena-band .fixer-die.die-roll-selected{--node-color:#eff300 !important;outline:3px solid #eff300 !important;outline-offset:4px;filter:brightness(1.25) drop-shadow(0 0 14px #eff300) !important;animation:none !important}
#match .arena-band .fixer-die.die-roll-selected .gig-node-state{color:#101400;background:#eff300;padding:2px 4px;font-weight:900}
#match[data-action-state="gig"] #stepTracker:has(.context-actions button){display:grid !important;right:max(6px,env(safe-area-inset-right,0px)) !important;bottom:calc(4px + var(--match-safe-bottom)) !important;left:max(6px,env(safe-area-inset-left,0px)) !important;z-index:94;width:auto !important;height:58px !important;max-height:58px !important;transform:none !important;padding:5px 7px !important;}
#match[data-action-state="gig"] #stepTracker .match-context{display:grid !important;grid-template-columns:minmax(0,1fr) auto !important;grid-template-rows:1fr 1fr !important;grid-template-areas:"title actions" "hint actions" !important;align-items:center;gap:0 10px;height:100%;overflow:hidden}
#match[data-action-state="gig"] #stepTracker .match-context>strong{position:static !important;grid-area:title;width:auto !important;height:auto !important;overflow:hidden !important;clip-path:none !important;color:#f7f8cf;font-size:15px !important;line-height:1.05;text-overflow:ellipsis;white-space:nowrap !important}
#match[data-action-state="gig"] #stepTracker .match-context>small{position:static !important;grid-area:hint;display:block !important;width:auto !important;height:auto !important;overflow:hidden !important;clip-path:none !important;color:#cbd3a2;font-size:10px;line-height:1.1;text-overflow:ellipsis;white-space:nowrap !important}
#match[data-action-state="gig"] #stepTracker .match-context>#matchContextKicker,#match[data-action-state="gig"] #stepTracker .match-context>.context-result,#match[data-action-state="gig"] #stepTracker .match-context>.context-sync{display:none !important}
#match[data-action-state="gig"] #stepTracker .context-actions{grid-area:actions;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(128px,1fr);width:auto;height:48px;gap:7px;overflow:visible;padding:0}
#match[data-action-state="gig"] #stepTracker .context-actions button{min-width:128px;min-height:48px;padding:7px 12px;font-size:14px;font-weight:900;text-align:center}

#match .gig-hack-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:0 0 6px}
#match .gig-hack-metrics>span{display:grid;min-height:47px;place-content:center;padding:6px 9px;border:1px solid #315865;background:#041018d9;text-align:center;box-shadow:inset 0 0 12px #31d9ff12}
#match .gig-hack-metrics small{color:#83aab3;font:800 8px/1 "IBM Plex Mono",monospace;letter-spacing:.1em}
#match .gig-hack-metrics strong{margin-top:5px;color:#ecf8fa;font:900 18px/1 "IBM Plex Mono",monospace}
#match .gig-hack-metrics>span:nth-child(2){border-color:var(--arena-gold)}#match .gig-hack-metrics>span:nth-child(2) strong{color:#ffe16d}

#match .arena-battle .data-shard .gear-list{right:auto !important;left:-11px !important;top:20% !important;bottom:auto !important}
#match .arena-battle .data-shard .gear-list .shard-module{clip-path:polygon(18% 0,100% 0,90% 50%,100% 100%,18% 100%,0 78%,0 22%) !important}

#match .match-event-cue{position:absolute;z-index:92;top:50%;left:50%;max-width:min(72vw,680px);transform:translate(-50%,-50%);padding:9px 18px;border:1px solid var(--arena-cyan);background:#031018ed;color:#dffaff;box-shadow:inset 4px 0 var(--arena-cyan),0 8px 28px #000d,0 0 22px #31d9ff55;font:900 clamp(12px,1.6vw,19px)/1.1 "IBM Plex Mono",monospace;letter-spacing:.08em;text-align:center;text-transform:uppercase;pointer-events:none;animation:event-cue-in .22s ease-out both}
#match .match-event-cue[hidden]{display:none !important}
#match .match-event-cue[data-kind="attack"],#match .match-event-cue[data-kind="blocked"]{border-color:var(--arena-red);box-shadow:inset 4px 0 var(--arena-red),0 8px 28px #000d,0 0 24px #ff574c55;color:#ffd6d2}
#match .match-event-cue[data-kind="capture"],#match .match-event-cue[data-kind="turn"]{border-color:var(--arena-gold);box-shadow:inset 4px 0 var(--arena-gold),0 8px 28px #000d,0 0 24px #ffc64d55;color:#fff0ae}
@keyframes event-cue-in{from{opacity:0;transform:translate(-50%,-44%) scale(.95)}to{opacity:1;transform:translate(-50%,-50%)}}
#match .feedback-deploy{animation:field-entry .42s ease-out both}#match .feedback-attack,#match .feedback-blocked{animation:target-impact .36s ease-out both}#match .feedback-capture{animation:gig-transfer .55s ease-out both}#match .feedback-dice,#match .feedback-select,#match .feedback-equip,#match .feedback-gig{animation:ability-pulse .42s ease-out both}
@keyframes field-entry{from{opacity:.2;transform:translateY(22px) scale(.88);filter:brightness(2)}to{opacity:1}}
@keyframes target-impact{45%{filter:brightness(2.1) saturate(1.5);transform:translateX(-4px)}70%{transform:translateX(3px)}}
@keyframes gig-transfer{0%{opacity:.35;filter:hue-rotate(120deg) brightness(2);transform:scale(.82)}60%{transform:scale(1.12)}100%{opacity:1}}
@keyframes ability-pulse{45%{filter:brightness(1.8);box-shadow:0 0 32px #31d9ffaa}}

@media(max-width:720px),(orientation:landscape) and (max-height:500px){#match .rival-hand-count{top:calc(100% + 10px);height:22px}.card-reading-preview .card-inspect-image{max-height:82dvh !important}.gig-hack-metrics>span{min-height:38px;padding:4px}.gig-hack-metrics strong{font-size:14px !important}}
@media(prefers-reduced-motion:reduce){body.match-active .card-reading-preview .card-inspect-image,#match .arena-rival .player-hub.gig-attack-target,#match .match-event-cue,#match .feedback-deploy,#match .feedback-attack,#match .feedback-blocked,#match .feedback-capture,#match .feedback-dice,#match .feedback-select,#match .feedback-equip,#match .feedback-gig{animation:none !important}}

/* The hub is a target only when the current attack permits it. */
#match .arena-band .player-hub.gig-attack-target{outline:2px dashed var(--arena-gold);outline-offset:4px;cursor:pointer}
#match .arena-band .player-hub.attack-target-selected{outline:3px solid #eff300;outline-offset:4px;box-shadow:0 0 14px #eff30066 !important}
#match .arena-band .player-hub:focus-visible{box-shadow:0 0 0 3px #fff !important}
#match .arena-band .player-hub-stat{top:50% !important;transform:translateY(-50%)}

/* Menu actions occupy full rows; shortcuts never compete with action labels. */
#match .match-settings-panel{box-sizing:border-box;width:min(390px,calc(100vw - 16px));padding:16px;overscroll-behavior:contain;scrollbar-gutter:stable}
#match .match-settings-panel .match-actions{display:flex;flex-direction:column;align-items:stretch;gap:8px;width:100%}
#match .match-settings-panel .match-actions>button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-width:0;min-height:44px;height:auto;margin:0;padding:11px 12px;white-space:normal;text-align:left;line-height:1.35;overflow-wrap:anywhere;box-sizing:border-box}
#match .match-settings-panel .match-actions>button[hidden]{display:none}
#match .undo-meta{display:inline-flex;align-items:center;gap:8px;flex-shrink:0;font-size:11px}
#match .undo-meta kbd{font:inherit;white-space:nowrap;color:#b8c8d2}
#match .undo-count{display:grid;place-items:center;min-width:22px;min-height:22px;padding:0 4px;border:1px solid currentColor;border-radius:3px}
#match .match-session{display:grid;gap:8px;min-width:0}
#match .match-session>span{max-width:100%;white-space:normal;overflow-wrap:anywhere}

#match .match-settings>summary::before{content:none}

#match #undoAction::before{content:none}
#match #undoAction:not(:disabled)>span:first-child::before{content:"↶";margin-right:8px}

/* Size the menu from its actual top offset, including notched displays. */
#match .match-settings-panel{--menu-safe-top:env(safe-area-inset-top,0px);--menu-safe-bottom:env(safe-area-inset-bottom,0px);--menu-top:max(56px,calc(var(--menu-safe-top) + 54px));top:var(--menu-top);max-height:calc(100dvh - var(--menu-top) - 8px - var(--menu-safe-bottom))}
/* Equipped frame colors use the existing hub border, never another ring. */
#match .player-hub .identity-badge[data-frame]>.portrait-image{outline:none;box-shadow:none}
#match .player-hub:has(.identity-badge[data-frame="signal"]){border-color:#72e7ff !important}
#match .player-hub:has(.identity-badge[data-frame="gold"]){border-color:#f6d576 !important}
#match .player-hub:has(.identity-badge[data-frame="violet"]){border-color:#d0a0ff !important}

/* Program loading/unloading lives on noninteractive visual copies. */
#match .program-fx-layer{position:absolute;inset:0;z-index:74;overflow:hidden;pointer-events:none;contain:layout style}
#match .program-card-fx{position:absolute;pointer-events:none;isolation:isolate;border:1px solid #60e9ff;border-radius:5px;background:#07171dc9;box-shadow:inset 0 0 0 2px #061016,0 0 16px #31d9ff44;overflow:hidden;animation-duration:420ms;animation-fill-mode:both;animation-timing-function:ease-out}
#match .program-fx-picture,#match .program-fx-picture img{position:absolute;inset:0;width:100%;height:100%;margin:0;display:block}
#match .program-card-in{animation-name:program-load}
#match .program-card-out{animation-name:program-unload;border-color:#ffb477;--unload-x:0px;--unload-y:-18px}
#match .program-card-out::after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(to bottom,transparent 0 8px,#061017d9 8px 11px);pointer-events:none}
#match .program-fx-scan{position:absolute;z-index:2;left:0;right:0;top:100%;height:3px;background:#c8fbff;box-shadow:0 0 12px 5px #31d9ff66;animation:program-scan 420ms ease-out both;animation-delay:inherit}
#match .program-fx-label{position:absolute;z-index:3;left:0;right:0;bottom:0;padding:4px 2px;color:#c6f8ff;background:#04141eea;text-align:center;font:800 8px/1.2 "IBM Plex Mono",monospace;letter-spacing:.08em}
#match .program-image-loading{opacity:.14 !important}
#match .turn-presence{position:absolute;z-index:19;top:50%;left:50%;transform:translate(-50%,-50%);max-width:70%;padding:3px 9px;border-bottom:1px solid #31d9ff99;background:#07131ae8;color:#b8f3ff;font:800 9px/1.3 "IBM Plex Mono",monospace;letter-spacing:.08em;white-space:nowrap;pointer-events:none}
#match .turn-presence[data-owner="rival"]{border-color:#ff574c99;color:#ffd4d0}
#match .turn-announcement{position:absolute;z-index:94;top:38%;left:50%;transform:translate(-50%,-50%);display:grid;gap:6px;min-width:min(290px,70vw);padding:14px 26px;border-block:1px solid #56e4ff;background:linear-gradient(90deg,transparent,#051821f5 14% 86%,transparent);color:#d5faff;text-align:center;pointer-events:none;animation:turn-signal 1.05s ease-out both}
#match .turn-announcement strong{font:900 clamp(19px,3vw,35px)/1.1 "IBM Plex Mono",monospace;letter-spacing:.09em}
#match .turn-announcement small{font:700 10px/1.2 "IBM Plex Mono",monospace;letter-spacing:.18em;color:inherit}
#match .turn-announcement[data-owner="rival"]{border-color:#ff766b;color:#ffd3cc;background:linear-gradient(90deg,transparent,#21100df5 14% 86%,transparent)}
#match .turn-presence[hidden],#match .turn-announcement[hidden]{display:none}
@keyframes program-load{0%{opacity:.25;clip-path:inset(100% 0 0);filter:saturate(.35)}35%{opacity:.9;clip-path:inset(38% 0 0)}80%{opacity:1;clip-path:inset(0)}100%{opacity:0;clip-path:inset(0)}}
@keyframes program-unload{0%{opacity:.95;transform:translate(0,0);clip-path:inset(0)}40%{opacity:.8;transform:translate(0,0);clip-path:inset(35% 0)}100%{opacity:0;transform:translate(var(--unload-x),var(--unload-y)) scale(.12);clip-path:inset(46% 0)}}
@keyframes program-scan{to{top:0;opacity:0}}
@keyframes turn-signal{0%{opacity:0;clip-path:inset(48% 0)}18%,72%{opacity:1;clip-path:inset(0)}100%{opacity:0;clip-path:inset(0)}}
@media(max-height:430px){#match .turn-announcement{padding:9px 18px;top:37%}#match .turn-presence{font-size:8px;padding:2px 6px}}
@media(prefers-reduced-motion:reduce){#match .program-card-fx{display:none}#match .program-image-loading{opacity:1 !important}#match .turn-announcement{animation:none}}

#match .field-lane .feedback-deploy{animation:none}

#match:has(> .turn-presence:not([hidden])) .mat-field > .mat-content::after{content:none}

@media(max-height:500px){#match .turn-announcement small{display:none}}

/* Keep approved turn/card transitions; guidance belongs to the board. */
#match .program-fx-scan{animation-duration:1100ms}
#match .turn-announcement{animation-duration:1.8s}
@keyframes program-unload{0%,50%{opacity:1;transform:translate(0,0);clip-path:inset(0)}70%{opacity:.85;transform:translate(0,0);clip-path:inset(25% 0)}100%{opacity:0;transform:translate(var(--unload-x),var(--unload-y)) scale(.12);clip-path:inset(46% 0)}}
#match .turn-presence.gig-choice-prompt {
  width:max-content;
  max-width:calc(100% - 32px);
  font-size:clamp(15px,2vw,24px);
  line-height:1.12;
  letter-spacing:.06em;
  padding:5px 12px;
  color:#0d1218;
  border:1px solid #fff2ad;
  background:#ffe477;
  box-shadow:0 0 16px #ffd75488;
  text-align:center;
  white-space:normal;
}
#match[data-action-state="gig"] .arena-own .fixer-die.can-roll {
  border-color:#ffe477 !important;
  background:#392c0c !important;
  box-shadow:inset 0 0 0 2px #ffe477, inset 0 0 14px #ffdd6644 !important;
}
#match[data-action-state="gig"]:not(.gig-roll-selected) .arena-own .fixer-die.can-roll { animation:gig-invite .65s ease-out 2 }
#match[data-action-state="gig"] .arena-own .fixer-die.can-roll .gig-node-value { display:none }
#match[data-action-state="gig"] .arena-own .fixer-die.can-roll .gig-node-designation {
  inset:6px 0 auto;
  color:#fff3b1;
  font-size:15px;
  text-align:center;
}
#match[data-action-state="gig"] .arena-own .fixer-die.can-roll .gig-node-state {
  inset:auto 2px 4px;
  z-index:4;
  width:auto;
  height:auto;
  clip-path:none;
  color:#ffe477;
  font:800 8px/1 'IBM Plex Mono',monospace;
  text-align:center;
}
#match[data-action-state="gig"] .arena-own .fixer-die.die-roll-selected {
  background:#5e4b14 !important;
  box-shadow:inset 0 0 0 3px #eff300 !important;
  animation:none;
}
@keyframes gig-invite{from{filter:brightness(1.65)}to{filter:brightness(1)}}
/* Confirmation appears only after selecting a real Gig node. */
#match[data-action-state="gig"] #stepTracker:has(.context-actions button){left:var(--gig-prompt-left,50%) !important;right:auto !important;top:calc(var(--gig-prompt-top,50%) + 24px) !important;display:block !important;bottom:auto !important;transform:translateX(-50%) !important;width:min(360px,calc(100% - 24px)) !important;height:52px !important;max-height:52px !important;padding:0 !important;clip-path:none !important;border:0 !important;border-radius:0;background:transparent !important;box-shadow:none !important;backdrop-filter:none}
#match[data-action-state="gig"] #stepTracker:has(.context-actions button) .match-context{display:block !important;height:52px;min-height:0;margin:0;padding:0;border:0;box-shadow:none;background:transparent;overflow:visible}
#match[data-action-state="gig"] #stepTracker:has(.context-actions button) .match-context>strong,
#match[data-action-state="gig"] #stepTracker:has(.context-actions button) .match-context>small,
#match[data-action-state="gig"] #stepTracker:has(.context-actions button) .match-context>span{display:none !important}
#match[data-action-state="gig"] #stepTracker:has(.context-actions button) .context-actions{display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr)) !important;grid-auto-flow:row !important;grid-auto-columns:auto !important;gap:8px !important;width:100%;height:52px;overflow:visible;padding:2px}
#match[data-action-state="gig"] #stepTracker:has(.context-actions button) .context-actions button{width:100%;min-width:0 !important;min-height:44px !important;height:48px;padding:6px 10px;font-size:13px}
@media(prefers-reduced-motion:reduce){#match[data-action-state="gig"] .arena-own .fixer-die.can-roll:not(.die-roll-selected){animation:none !important;filter:brightness(1.3)}}
@media(orientation:landscape) and (max-height:620px){
 #match .match-bottom-dock #realHand{gap:10px;justify-content:flex-start;padding-inline:12px !important}
 #match .match-bottom-dock #realHand .game-card{flex-basis:90px !important;width:90px !important;margin-left:0 !important;transform:none}
 #match .match-bottom-dock #realHand .card-art-button{height:126px !important}
 #match.hand-expanded .match-bottom-dock #realHand .card-art-button{height:clamp(142px,36dvh,230px) !important}
}
#match:has(.card-command-open .hand-card-focus:not([hidden])) .match-event-cue{visibility:hidden}

/* The hand uses the full lower shelf while leaving its controls clear. */
#match{--hand-card-width:clamp(84px,7.2vw,112px);--hand-right:204px;--response-height:52px;--response-right:84px}
#match .match-bottom-dock .hand-area{left:8px !important;right:var(--hand-right) !important}
#match .match-bottom-dock #realHand{gap:0;justify-content:safe center}
#match .match-bottom-dock #realHand .game-card{flex-basis:var(--hand-card-width) !important;width:var(--hand-card-width) !important;transform:none}
#match .match-bottom-dock #realHand .game-card:not(:first-child){margin-left:clamp(-18px,calc((100% - 32px - var(--hand-count,1) * var(--hand-card-width)) / max(1,var(--hand-count,1) - 1)),10px) !important}
#match.hand-expanded{--hand-card-width:clamp(112px,13vw,154px)}
#match .arena-band .mat-legend-slot.legend-slot-empty{opacity:.3;box-shadow:none;pointer-events:none}
/* Response controls live between the hand and rail, with no clipped grid rows. */
#match.response-actions-open .arena-own{bottom:calc(var(--arena-hand-height) + var(--response-height) + 8px + var(--match-safe-bottom)) !important}
#match.response-actions-open .arena-battle{bottom:calc(var(--arena-hand-height) + var(--response-height) + var(--arena-rail-height) + 8px + var(--match-safe-bottom)) !important}
#match.response-actions-open #stepTracker:has(.context-actions button){display:block !important;left:8px !important;right:var(--response-right) !important;top:auto !important;bottom:calc(var(--arena-hand-height) + 4px + var(--match-safe-bottom)) !important;transform:none !important;width:auto !important;height:auto !important;min-height:52px;max-height:none !important;margin:0;padding:2px !important;clip-path:none !important;border:0 !important;border-radius:0;background:transparent !important;box-shadow:none !important;backdrop-filter:none;overflow:visible}
#match.response-actions-open #stepTracker:has(.context-actions button) .match-context{display:block !important;position:static;min-height:0;height:auto;margin:0;padding:0;border:0;box-shadow:none;background:transparent;overflow:visible}
#match.response-actions-open #stepTracker:has(.context-actions button) .match-context>strong,
#match.response-actions-open #stepTracker:has(.context-actions button) .match-context>small,
#match.response-actions-open #stepTracker:has(.context-actions button) .match-context>span{position:absolute !important;width:1px !important;height:1px !important;overflow:hidden !important;clip-path:inset(50%) !important;white-space:nowrap !important}
#match.response-actions-open #stepTracker:has(.context-actions button) .context-actions{display:flex !important;align-items:stretch;justify-content:safe center;gap:8px;width:100%;min-height:48px;height:auto;max-height:none;margin:0;padding:2px;overflow-x:auto;overflow-y:hidden;overscroll-behavior:contain}
#match.response-actions-open #stepTracker:has(.context-actions button) .context-actions button{flex:0 0 clamp(144px,18vw,200px);width:auto;min-width:0;min-height:44px;height:auto;max-height:none;padding:8px 12px;text-align:center;white-space:normal;overflow-wrap:anywhere;line-height:1.25;font-size:13px}
@media(orientation:landscape) and (max-height:620px){
 #match{--hand-card-width:90px;--hand-right:144px;--response-right:70px}
 body.match-active #match.response-actions-open:not([hidden]){--arena-hand-height:76px}
}
@media(orientation:landscape) and (max-height:380px){
 body.match-active #match.response-actions-open:not([hidden]){--arena-hand-height:48px;--arena-rail-height:48px}
 #match.response-actions-open .arena-battle .field-lane{grid-template-rows:minmax(0,1fr);padding:0 3px}
 #match.response-actions-open .arena-battle .lane-title{display:none}
 #match.response-actions-open .arena-battle .data-shard{padding:1px !important}
 #match.response-actions-open .match-bottom-dock .hand-area{padding-top:0 !important;-webkit-mask-image:none;mask-image:none}
 #match.response-actions-open .match-bottom-dock #realHand{inset:0;height:100% !important;padding-top:2px !important}
}

/* Results keep their action footer visible in short mobile viewports. */
#winDialog[open]{display:grid;grid-template-rows:minmax(0,1fr) auto;gap:10px;width:min(720px,calc(100vw - 24px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px)));max-width:calc(100vw - 24px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px)) !important;max-height:calc(100dvh - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)) !important;margin:auto;padding:20px !important;overflow:hidden !important;line-height:1.35}
#winDialog .win-content{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 3px 2px;overflow-wrap:anywhere}
#winDialog .eyebrow{font-size:10px;margin:0}
#winDialog #winTitle{font-size:clamp(28px,4vw,46px);line-height:1.05;margin:6px 0;letter-spacing:.04em}
#winDialog #winReason{font-size:14px;line-height:1.35;margin:6px auto 10px}
#winDialog #winRecordStatus{min-height:0 !important;margin:4px auto !important;font-size:12px !important;line-height:1.35;overflow-wrap:anywhere}
#winDialog .win-scoreboard{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:10px;margin:12px 0 0}
#winDialog .win-scoreboard article{min-width:0;padding:12px 8px;gap:4px}
#winDialog .win-scoreboard article>.identity-badge{min-width:0;max-width:100%;margin:0 auto 4px;gap:4px}
#winDialog .identity-badge strong{font:800 clamp(16px,2.4vw,24px)/1.15 'Barlow Condensed',sans-serif;white-space:normal;overflow-wrap:anywhere;letter-spacing:.03em}
#winDialog .identity-badge>.portrait-image{width:40px;height:auto;aspect-ratio:140/174}
#winDialog .win-scoreboard article>span{font-size:10px;line-height:1.2}
#winDialog .win-scoreboard article>strong{font-size:28px;line-height:1.1}
#winDialog .win-scoreboard article>small{font-size:12px;line-height:1.3;overflow-wrap:anywhere}
#winDialog .win-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;min-width:0;margin:0;padding:0}
#winDialog .win-actions button{min-width:0;min-height:44px;width:100%;padding:8px;font-size:13px;line-height:1.25;white-space:normal;overflow-wrap:anywhere}
#winDialog .win-actions button[hidden]{display:none}
@media(max-height:500px){
 #winDialog[open]{gap:8px;padding:10px !important}
 #winDialog #winTitle{font-size:28px;margin:4px 0}
 #winDialog #winReason{font-size:12px;margin:4px auto 6px}
 #winDialog #winRecordStatus{font-size:11px !important;margin:2px auto !important}
 #winDialog .win-scoreboard{margin-top:6px;gap:8px}
 #winDialog .win-scoreboard article{display:grid;grid-template-columns:1fr 1fr;align-content:center;align-items:center;gap:3px 6px;padding:6px}
 #winDialog .win-scoreboard article>.identity-badge{grid-column:1/-1;display:flex;flex-direction:row;justify-content:center;gap:8px;margin:0 auto 2px}
 #winDialog .identity-badge>.portrait-image{width:28px;height:auto;flex:0 0 28px}
 #winDialog .identity-badge strong{font-size:16px;line-height:1.15}
 #winDialog .win-scoreboard article>strong{font-size:22px}
 #winDialog .win-scoreboard article>small{grid-column:1/-1;font-size:10px;line-height:1.25}
 #winDialog .win-versus{font-size:14px}
 #winDialog .win-actions button{font-size:12px;padding:6px}
}
@media(max-width:560px) and (min-height:501px){
 #winDialog[open]{padding:14px !important}
 #winDialog .win-scoreboard{grid-template-columns:minmax(0,1fr)}
 #winDialog .win-versus{display:none}
 #winDialog .win-scoreboard article{padding:8px}
}
/* Notification text determines the box size, including long card/player names. */
#match .match-event-cue{width:max-content;max-width:min(680px,calc(100% - 32px));height:auto;min-height:0;max-height:calc(100% - 32px);padding:10px 16px;overflow:auto;font-size:clamp(12px,1.6vw,17px);line-height:1.35;white-space:normal;overflow-wrap:anywhere;word-break:normal}
#match .action-receipt{white-space:normal;overflow-wrap:anywhere;line-height:1.3;text-align:center}

/* Guided practice uses the existing center line and menu, not a new popup. */
#match .turn-presence.tutorial-presence{display:block;max-width:calc(100% - 100px);width:max-content;padding:5px 9px;white-space:normal;overflow-wrap:anywhere;text-align:center;font-size:13px;line-height:1.3;letter-spacing:.03em;clip-path:none;background:#04131bf5;color:#e9ff9a;border-bottom:1px solid #b9df68;pointer-events:none}
#match .tutorial-target{outline:2px solid #eaff64;outline-offset:2px}
#match #nextActions.tutorial-target{outline:0}#match #nextActions.tutorial-target button:not(:disabled){box-shadow:inset 0 0 0 1px #eaff64}
#tutorialMenu p{font-size:12px;line-height:1.4;color:#adc0c5}.tutorial-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:10px 0}.tutorial-tools button{min-height:44px;white-space:normal;padding:7px}
@media(orientation:landscape) and (max-height:500px){#match .turn-presence.tutorial-presence{max-width:calc(100% - 86px);padding:3px 7px;font-size:11px;line-height:1.2;letter-spacing:0}}

/* Ability-scoped card choices: only the current chooser sees permitted cards. */
.card-choice-dialog{box-sizing:border-box;width:min(880px,calc(100vw - 20px));max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px);margin:auto;padding:14px;border:1px solid #64c7dd;border-radius:6px;background:#07131bf7;color:#e4f5f8;overflow:auto;overscroll-behavior:contain}
.card-choice-dialog[open]{display:flex;flex-direction:column;overflow:hidden}
.card-choice-dialog::backdrop{background:#02080bb8}
.card-choice-dialog>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0 0 8px;padding:0;max-width:none;width:100%;flex:none;border:0;background:transparent}
.card-choice-dialog h2{font-size:20px;line-height:1.25;margin:0;overflow-wrap:anywhere}
.card-choice-dialog button,.card-choice-dialog summary,.pile-return{min-height:44px;white-space:normal;overflow-wrap:anywhere}
.card-choice-dialog>header button{flex:none;width:132px;max-width:132px;height:44px;padding:6px 8px;font-size:13px;white-space:nowrap}
.choice-cause{color:#a9fff5;font-size:12px;line-height:1.3;margin:2px 0 0;overflow-wrap:anywhere}
#matchContextCause{text-align:center;margin:0 0 3px}
.card-choice-hint{font-size:13px;line-height:1.4;margin:4px 0 8px;color:#b8d1d8;flex:none}
.card-choice-grid{display:grid;min-height:0;overflow:auto;overscroll-behavior:contain;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:10px}
.card-choice-entry{display:flex;flex-direction:column;min-width:0;padding:7px;border:1px solid #36515b;border-radius:4px;background:#0c1c25}
.card-choice-entry .choice-card-art{display:block;width:100%;padding:0;border:0;background:transparent}
.card-choice-entry img{display:block;max-width:100%;width:auto;height:clamp(110px,28dvh,220px);object-fit:contain;margin:auto}
.card-choice-entry details{font-size:13px;line-height:1.4;margin:5px 0}
.card-choice-entry summary{display:flex;align-items:center;cursor:pointer}
.card-choice-entry .choice-card-select{width:100%;margin-top:auto}
.card-choice-dialog>.card-choice-actions{display:flex !important;flex-wrap:wrap;gap:8px;margin-top:8px;padding:0;flex:none;border:0}
.card-choice-dialog .hidden-legend-choice{display:grid;justify-items:center;gap:8px;min-width:0;padding:8px}
.hidden-legend-choice .card-back-visual{width:70px;height:98px}
#match .legend-known-marker{position:absolute;z-index:5;top:2px;right:2px;padding:2px;border-radius:50%;background:#091b25;color:#85e5f8;font:12px/1 sans-serif;pointer-events:none}
@media(orientation:landscape) and (max-height:430px){.card-choice-dialog{padding:10px}.card-choice-dialog h2{font-size:16px}.card-choice-grid{grid-template-columns:repeat(auto-fit,minmax(112px,1fr))}.card-choice-entry img{height:112px}}
@media(orientation:landscape) and (max-height:430px){
 .card-choice-entry{display:grid;grid-template-columns:60px minmax(0,1fr);align-content:start;padding:5px;gap:4px}
 .card-choice-entry .choice-card-art{grid-column:1;grid-row:1}
 .card-choice-entry img{height:84px;max-width:60px}
 .card-choice-entry details{grid-column:2;grid-row:1;margin:0;font-size:12px}
 .card-choice-entry .choice-card-select,.card-choice-entry>small{grid-column:1/-1;margin:0;font-size:12px}
}

/* Legend Spend actions live in the reachable command menu, outside the tiny rail. */
#match[data-action-state="legend"] #stepTracker .context-actions{min-width:0;max-width:min(70vw,720px);overflow-x:auto;overscroll-behavior-inline:contain}
#match[data-action-state="legend"] #stepTracker .context-actions button{white-space:normal;line-height:1.2;overflow-wrap:anywhere}
#match[data-action-state="legend"] .legend-spend-action:not(:disabled){border-color:#6ee6ff;color:#c4f6ff;background:#103341}


/* A public Gear count stays visible while the portrait remains the tap target. */
#match .arena-band .legend-gear-indicator{position:absolute;z-index:10;left:4px;bottom:4px;display:block;min-width:18px;padding:2px;border:1px solid #ffd274;border-radius:3px;background:#171107f5;color:#ffe1a0;font:800 9px/1.1 sans-serif;white-space:nowrap;pointer-events:none;box-shadow:0 1px 4px #000}
#match .arena-band .legend-art{position:relative;z-index:1}
#match .arena-band .mat-legend-slot:has(.legend-gear-indicator){overflow:visible}

#match .program-card-solo{border-color:#ffe18a;box-shadow:inset 0 0 0 2px #271a07,0 0 18px #ffc64d99}
#match .program-card-solo .program-fx-scan{background:#fff0b5;box-shadow:0 0 12px 5px #ffc64d99}
#match .program-card-solo .program-fx-label{color:#ffebac;background:#231707f2}

#match .turn-presence.opening-roll-prompt {
  max-width:calc(100% - 86px);
  width:max-content;
  white-space:normal;
  text-align:center;
  font-size:clamp(11px,1.5vw,16px);
  padding:5px 9px;
}

#match.opening-roll-active .match-bottom-dock { display:none !important }
#match .opening-roll[hidden] { display:none }
#match .opening-roll {
  position:absolute;
  z-index:92;
  inset:0;
  display:grid;
  place-items:center;
  box-sizing:border-box;
  padding:max(8px,env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) max(8px,var(--match-safe-bottom,0px)) max(12px,env(safe-area-inset-left,0px));
  background:radial-gradient(ellipse at center,#132532e8,#030810ed 75%);
}
#match .opening-roll-panel {
  box-sizing:border-box;
  width:min(100%,490px);
  max-height:100%;
  overflow:auto;
  display:grid;
  justify-items:center;
  gap:clamp(6px,1.8dvh,13px);
  padding:clamp(8px,2.5dvh,24px) clamp(12px,4vw,32px);
  border:1px solid #408196;
  border-block-start:3px solid #52ddf7;
  background:repeating-linear-gradient(0deg,#4ad0ee06 0 1px,transparent 1px 5px),#09151f;
  box-shadow:0 0 40px #26c6f126, inset 0 -3px #1b3b4a;
  text-align:center;
  color:#effaff;
}
#match .opening-roll-kicker,
#match .opening-roll-label,
#match .opening-roll-tag,
#match .opening-roll-comparison {
  font:800 11px/1.15 "IBM Plex Mono",monospace;
  letter-spacing:.12em;
}
#match .opening-roll-kicker { color:#83dfef }
#match .opening-roll-panel h2 {
  margin:0;
  color:#f2fbff;
  font-size:clamp(20px,5.5dvh,34px);
  line-height:1.05;
  text-transform:uppercase;
}
#match .opening-roll-grid {
  width:100%;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  gap:clamp(5px,1.5vw,16px);
  align-items:center;
}
#match .opening-roll-seat {
  --roll-accent:#69e6ff;
  --roll-tint:#173f50;
  display:grid;
  justify-items:center;
  gap:4px;
  padding:clamp(5px,1.5dvh,12px) 4px;
  border:1px solid var(--roll-tint);
  background:linear-gradient(145deg,var(--roll-tint),#09141d 68%);
  color:var(--roll-accent);
}
#match .opening-roll-seat[data-seat="1"] { --roll-accent:#ff9cbf; --roll-tint:#51223a }
#match .opening-roll-seat.roll-winner {
  --roll-accent:#ffe888;
  --roll-tint:#634615;
  border-color:var(--roll-accent);
  box-shadow:0 0 15px #ffce4540;
}
#match .opening-roll-die {
  display:grid;
  place-items:center;
  width:clamp(49px,19dvh,105px);
  aspect-ratio:1;
  color:inherit;
  background:center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23d2f0ff' stroke-width='1.5'%3E%3Cpath d='M50 3 92 27v46L50 97 8 73V27Z' opacity='.8'/%3E%3Cpath d='M50 3 24 65h52L50 3M8 27l16 38L8 73m84-46L76 65l16 8M24 65l26 32 26-32' opacity='.33'/%3E%3C/svg%3E");
  font:800 clamp(26px,8.5dvh,52px)/1 "IBM Plex Mono",monospace;
  font-variant-numeric:tabular-nums;
  text-shadow:0 0 16px var(--roll-accent),0 2px 7px #000;
}
@media (prefers-reduced-motion:no-preference) {
  #match .opening-roll.is-rolling .opening-roll-die {
    animation:opening-d20-roll 1s cubic-bezier(.28,.78,.55,1) both;
  }
  #match .opening-roll.is-rolling [data-seat="1"] .opening-roll-die {
    animation-direction:reverse;
  }
}
@keyframes opening-d20-roll {
  0% { transform:rotate(0) scale(1) }
  24% { transform:rotate(115deg) scale(.86) }
  55% { transform:rotate(240deg) scale(1.13) }
  100% { transform:rotate(360deg) scale(1) }
}
#match .opening-roll-comparison { font-size:clamp(16px,5.5dvh,30px); color:#ffec9f; letter-spacing:0 }
#match .opening-roll-panel p { margin:0; font-size:clamp(12px,3.5dvh,15px); line-height:1.3; color:#effaff }
#match .opening-roll-actions { width:100%; display:flex; flex-wrap:wrap; justify-content:center; gap:8px }
#match .opening-roll-actions:empty { display:none }
#match .opening-roll.is-rolling .opening-roll-actions { display:flex; min-height:44px }
#match .opening-roll-actions button { min-width:min(100%,112px); min-height:44px; padding:6px 12px }

@media (max-width:720px) and (orientation:portrait) and (pointer:coarse) {
  #match .opening-roll { display:none }
}

/* Match instructions and card actions reflow within the board. */
#match :is(.turn-presence,.turn-announcement,.opening-roll-panel,.gig-hack-shell),
#match .match-settings-panel,
body.match-active #detailContent,
body.match-active .card-choice-dialog {
  overflow-wrap:anywhere;
}
#match .turn-presence {
  width:max-content;
  white-space:normal;
  text-align:center;
  font-size:12px;
  letter-spacing:.03em;
}
#match .turn-presence.gig-adjustment-prompt {font-size:clamp(13px,1.5vw,16px)}
#match .match-bottom-dock .hand-card-focus :is(h3,.card-meta,.hand-lock-reason,.mini-actions button) {
  min-width:0;
  white-space:normal !important;
  overflow-wrap:anywhere;
  line-height:1.3;
}
#match .hand-card-focus .hand-lock-reason {font-size:13px}
#match .hand-card-focus .mini-actions button {min-height:44px;font-size:13px}

#match:is([data-action-state="targeting"],[data-action-state="legend"]) #stepTracker:has(.context-actions button) {
  height:auto !important;
  max-height:none !important;
  min-height:56px;
}
#match:is([data-action-state="targeting"],[data-action-state="legend"]) #stepTracker .match-context {
  grid-template-columns:minmax(0,1fr) auto !important;
  grid-template-rows:auto auto !important;
  gap:3px 10px;
  height:auto;
}
#match:is([data-action-state="targeting"],[data-action-state="legend"]) #stepTracker :is(#matchContextTitle,#matchContextHint) {
  overflow:visible !important;
  overflow-wrap:anywhere;
  white-space:normal !important;
  line-height:1.25;
}
#match:is([data-action-state="targeting"],[data-action-state="legend"]) #stepTracker #matchContextTitle {font-size:15px !important}
#match:is([data-action-state="targeting"],[data-action-state="legend"]) #stepTracker #matchContextHint {display:block !important;font-size:13px;color:#d2dee2}
#match:is([data-action-state="targeting"],[data-action-state="legend"]) #stepTracker:has(.context-actions button) .context-actions {
  display:flex !important;
  justify-content:flex-start;
  align-items:stretch;
  min-width:0;
  width:auto !important;
  height:auto;
  max-width:min(52vw,560px);
  overflow-x:auto !important;
  overscroll-behavior-inline:contain;
  padding:2px;
}
#match:is([data-action-state="targeting"],[data-action-state="legend"]) #stepTracker:has(.context-actions button) .context-actions button {
  flex:0 0 auto;
  min-width:110px !important;
  width:auto !important;
  max-width:180px;
  height:auto;
  margin:0;
  padding:7px 10px;
  font-size:14px;
  line-height:1.25;
  white-space:normal;
  overflow-wrap:anywhere;
}
#match.response-actions-open #stepTracker:has(.context-actions button) .match-context {
  display:grid !important;
  grid-template-columns:minmax(0,1fr) minmax(0,72%);
  grid-template-rows:auto auto;
  gap:2px 8px;
  align-content:center;
  align-items:center;
}
#match.response-actions-open #stepTracker .match-context>#matchContextTitle {
  position:static !important;
  grid-column:1;
  grid-row:1;
  width:auto !important;
  height:auto !important;
  overflow:visible !important;
  clip-path:none !important;
  white-space:normal !important;
  overflow-wrap:anywhere;
  font-size:14px;
  line-height:1.25;
}
#match.response-actions-open #matchContextCause {
  grid-column:1;
  grid-row:2;
  text-align:left;
  margin:0;
  font-size:13px;
}
#match.response-actions-open #stepTracker .context-actions {grid-column:2;grid-row:1 / 3}
#match.response-actions-open #stepTracker .context-actions:has(.gig-value-options) {
  justify-content:flex-start;
  flex-wrap:wrap;
  overflow:visible;
}
#match.response-actions-open #stepTracker .gig-value-options {
  flex:0 1 auto;
  min-width:0;
  gap:4px;
}
#match.response-actions-open #stepTracker .context-actions:has(.gig-value-options) button {
  flex:0 1 auto;
  max-width:100%;
  padding-inline:8px;
}
#match.response-actions-open #stepTracker .context-actions .gig-value-options button.gig-value-option {
  flex:0 0 44px;
  min-width:44px;
  min-height:44px;
  font-size:15px;
}
.card-choice-dialog>header button {
  width:auto;
  height:auto;
  white-space:normal;
  overflow-wrap:anywhere;
}
.card-choice-entry :is(details,.choice-card-select) {font-size:14px;line-height:1.35}
body.match-active #detailContent .rules-text {line-height:1.5}

/* Keep long instructions inside the existing match panels. */
#match #stepTracker:not(:has(.context-actions button)) {
  align-content:start;
  overflow:auto;
  overscroll-behavior:contain;
  clip-path:none !important;
}
#match #stepTracker:not(:has(.context-actions button)) .match-context {
  display:block;
  overflow:visible;
}
#match #stepTracker:not(:has(.context-actions button)) :is(#matchContextTitle,#matchContextHint,#matchContextCause,#matchContextResult,#matchContextSync):not([hidden]) {
  display:block !important;
  margin:0;
  color:#e1edf2;
  overflow:visible;
  white-space:normal;
  overflow-wrap:anywhere;
  font-size:13px;
  line-height:1.3;
  text-align:left;
}
#match #stepTracker:not(:has(.context-actions button)) #matchContextTitle:not([hidden]) {
  color:#f5fbff;
  font-size:14px;
}
#match #stepTracker:not(:has(.context-actions button)) :is(#matchContextHint,#matchContextCause,#matchContextResult,#matchContextSync):not([hidden]) {
  margin-top:3px;
}
#match .match-event-cue {
  letter-spacing:normal;
  text-transform:none;
  clip-path:none;
}
.card-choice-dialog>header>div {min-width:0}
.card-choice-entry details p {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
body.match-active #detailContent .rules-text {white-space:pre-wrap}
@media (orientation:landscape) and (max-height:430px) {
  .card-choice-dialog .card-choice-entry details {
    max-height:84px;
    overflow:auto;
    overscroll-behavior:contain;
  }
}

/* Show the card face with its existing actions in a compact column. */
#match .match-bottom-dock.card-command-open .hand-card-focus {
  --focused-card-width:clamp(96px,33dvh,146px);
  z-index:96;
  left:50% !important;
  right:auto !important;
  bottom:calc(8px + var(--match-safe-bottom)) !important;
  transform:translateX(-50%) !important;
  width:max-content !important;
  min-width:0 !important;
  max-width:calc(100% - 16px) !important;
  max-height:none !important;
  margin:0;
  padding:4px !important;
  border:0;
  background:none;
  box-shadow:none;
}
#match .hand-card-focus::before {content:none}
#match .match-bottom-dock.card-command-open .hand-card-focus .game-card {
  display:grid !important;
  grid-template-columns:var(--focused-card-width) minmax(92px,1fr);
  grid-template-rows:44px 1fr;
  gap:4px 6px;
  width:auto !important;
  min-width:0;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  margin:0 !important;
  padding:0 !important;
  border:0;
  background:none;
  box-shadow:none;
  overflow:visible;
  clip-path:none;
}
#match .hand-card-focus .game-card :is(h3,.card-meta,.hand-action-state,.hand-lock-reason,.sellable-marker) {display:none !important}
#match .match-bottom-dock.card-command-open .hand-card-focus .card-art-button {
  grid-column:1 !important;
  grid-row:1 / 3 !important;
  width:100% !important;
  height:auto !important;
  aspect-ratio:5 / 7;
  padding:0;
  clip-path:none;
}
#match .match-bottom-dock.card-command-open .hand-card-focus .thumb {
  width:100% !important;
  height:100% !important;
  object-fit:contain;
  object-position:center;
  transform:none;
}
#match .match-bottom-dock.card-command-open .hand-card-focus :is(.hand-card-close,.hand-card-expand) {
  position:static !important;
  grid-column:2;
  grid-row:1;
  width:44px;
  height:44px;
}
#match .hand-card-focus .hand-card-close {justify-self:end}
#match .hand-card-focus .hand-card-expand {justify-self:start}
#match .match-bottom-dock.card-command-open .hand-card-focus .mini-actions {
  grid-column:2 !important;
  grid-row:2 !important;
  display:grid !important;
  grid-template-columns:minmax(0,1fr);
  align-content:start;
  gap:4px;
  margin:0;
}
#match :is(#stepTracker,.turn-dock,.gig-hack-shell,.gig-hack-port) {border-radius:5px}

/* Equipment uses one row on short landscape screens. */
#match #nextActions .equipment-summary{display:none}
@media(orientation:landscape) and (max-height:500px){
 #match.equipment-choice-open.response-actions-open #stepTracker:has(.context-actions button) .match-context{
  display:block !important;
 }
 #match.equipment-choice-open.response-actions-open #stepTracker #matchContextTitle{
  position:absolute !important;width:1px !important;height:1px !important;
  overflow:hidden !important;clip-path:inset(50%) !important;
 }
 #match.equipment-choice-open.response-actions-open #stepTracker .context-actions{
  justify-content:flex-start;gap:6px;padding:2px;min-height:48px;
 }
 #match.equipment-choice-open.response-actions-open #stepTracker .context-actions button{
  flex:0 0 auto;width:auto;min-width:64px;min-height:44px;
  padding:4px 12px;white-space:nowrap;
 }
 #match.equipment-choice-open.response-actions-open #stepTracker .context-actions .equipment-summary{
  display:block;flex:1 1 0;min-width:0;text-align:left;
  overflow:hidden;text-overflow:ellipsis;
 }
}

#match #matchTargetLine{position:absolute;z-index:88;inset:8px 50% auto auto;transform:translateX(50%);inline-size:max-content;max-inline-size:min(72%,640px);margin:0;padding:5px 9px;border:1px solid #d6ef45;background:#111820f5;color:#f4f7dc;font:700 clamp(11px,1.5vw,15px)/1.25 "IBM Plex Sans",sans-serif;text-align:center;overflow-wrap:anywhere;pointer-events:none}
#match #matchTargetLine[data-state="attack"]{border-color:#ff8e84;color:#ffe3df}
#match #matchTargetLine[data-state="effect"]{border-color:#76eaff;color:#dbfaff}
#match [data-target-marker]{outline:2px solid #f1e373 !important;outline-offset:-2px}
#match [data-target-marker="Attacker"],#match [data-target-marker="Effect option"]{outline-color:#76eaff !important}
#match [data-target-marker="Under attack"],#match [data-target-marker="Effect target"]{outline:3px solid #ff8e84 !important}
#match :is(.data-shard,.player-hub)[data-target-marker]::after{display:block;content:attr(data-target-marker);position:absolute;z-index:12;inset:0 auto auto 50%;transform:translateX(-50%);width:max-content;max-width:100%;padding:2px 4px;background:#0b1017;color:#fff;font:700 9px/1.2 "IBM Plex Sans",sans-serif;text-align:center;pointer-events:none}
#match .data-shard[data-target-marker].attack-target-selected::before{content:none !important}
@media(orientation:landscape) and (max-height:500px){#match #matchTargetLine{inset-block-start:3px;max-inline-size:58%;font-size:11px;padding:3px 7px}}

#match{position:relative}
#match #matchAttackArrow{position:absolute;inset:0;z-index:89;pointer-events:none;overflow:hidden}
#match #matchAttackArrow:empty{display:none}
#match .incoming-attack-vector{height:4px;background:linear-gradient(90deg,#ff594d,#ffe8ce);box-shadow:0 0 3px 1px #221111,0 0 10px #ff695c}
#match .incoming-attack-vector::after{color:#fff1da;width:14px;height:14px}
