.play-shell:has(.bastions-game) {max-width:none;padding-inline:clamp(4px,1vw,17px);}
.play-shell:has(.bastions-game) :is(.match-strip,.round-footer>span) {display:none;}
.play-shell:has(.bastions-game) #round-content>.arena.shared {width:100%;margin-inline:auto;max-width:none;}
.play-shell:has(.bastions-game) :is(.player-panel,.game-content) {margin:0;padding:0;border:0;box-shadow:none;background:none;min-height:0;}
.bastions-game {
  --gold:#ffdf99;--bastions-text:#fff3dc;--frame:#d6ad7275;--deep:#252445;
  min-width:0;width:100%;height:clamp(490px,calc(100dvh - 100px),1160px);
  display:grid;grid-template-columns:clamp(152px,14vw,208px) minmax(0,1fr) clamp(152px,14vw,208px);
  grid-template-areas:'hud hud hud' 'mine board rival';grid-template-rows:auto minmax(0,1fr);gap:5px;
  padding:5px;border:1px solid #bea175;border-radius:clamp(10px,1.8vw,22px);
  background:linear-gradient(155deg,#765d74,#352c50 52%,#594364);box-shadow:0 10px 24px #26244526;color:var(--bastions-text);user-select:none;-webkit-user-select:none;
}
.bastions-game.is-solo {grid-template-columns:clamp(164px,16vw,226px) minmax(0,1fr);grid-template-areas:'hud hud' 'mine board';}
.bastions-team-0 {--army:#94e7cf;--army-dark:#215955;}
.bastions-team-1 {--army:#ffc29b;--army-dark:#753f44;}
.bastions-hud {
  grid-area:hud;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:5px;
  align-items:center;background:linear-gradient(#3a3255,var(--deep));border:1px solid var(--frame);border-radius:9px;padding:4px 10px;
  font-variant-numeric:tabular-nums;
}
.bastions-keep {min-width:0;display:flex;align-items:center;gap:6px;line-height:1.16;font-size:clamp(.65rem,2vw,.93rem);}
.bastions-keep strong {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--army);}
.bastions-keep>span {white-space:nowrap;font-size:.81em;color:#f8e4ba;font-weight:690;}
.bastions-keep.bastions-team-1 {grid-column:3;grid-row:1;justify-self:end;}
.bastions-time {grid-column:2;grid-row:1;text-align:center;line-height:1.07;padding:2px 6px;}
.bastions-time time {display:block;color:var(--gold);font-size:clamp(.95rem,3vw,1.4rem);font-weight:860;}
.bastions-time small {font-size:.62rem;font-weight:650;}
.bastions-time small:empty {display:none;}
.bastions-board {grid-area:board;position:relative;min-width:0;min-height:0;overflow:hidden;border:1px solid #6b9f9e;border-radius:10px;background:#397970;box-shadow:inset 0 0 0 1px #fde2b14a;}
.bastions-board canvas {display:block;width:100%;height:100%;touch-action:none;}
.bastions-banner {position:absolute;left:50%;top:43%;translate:-50% -50%;width:max-content;max-width:85%;margin:0;padding:9px 16px;border:1px solid #f5d399;border-radius:12px;background:#253d50ec;color:#ffdd9b;font-size:clamp(1.05rem,3.8vw,2.1rem);font-weight:870;text-align:center;}
.bastions-banner[hidden] {display:none;}
.bastions-tray {
  min-width:0;display:grid;align-content:start;gap:6px;padding:7px;
  border:1px solid var(--frame);border-radius:9px;background:linear-gradient(160deg,#353052,var(--deep) 72%);box-shadow:inset 0 1px 0 #fceab328;
}
.bastions-tray.bastions-team-0 {grid-area:mine;}
.bastions-tray.bastions-team-1 {grid-area:rival;}
.bastions-tray-info {display:grid;gap:4px;align-items:center;line-height:1.12;min-width:0;}
.bastions-tray-info>strong {color:var(--army);font-size:clamp(.7rem,2.5vw,.94rem);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.bastions-amber {display:grid;grid-template-columns:auto auto minmax(23px,1fr);align-items:center;gap:4px;color:var(--gold);font-variant-numeric:tabular-nums;font-size:clamp(.64rem,2.1vw,.86rem);}
.bastions-reserve {min-width:0;height:6px;overflow:hidden;border:1px solid #d5b2799f;border-radius:4px;background:#292844;}
.bastions-reserve i {display:block;width:var(--amber,0%);height:100%;background:linear-gradient(90deg,#d28d68,#ffd484,#fff4b1);}
.bastions-lanes {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;}
.bastions-game button {font:inherit;min-width:0;touch-action:none;}
.bastions-lanes button {
  padding:3px 4px;min-height:35px;border:1px solid #c2abc77d;border-radius:7px;background:#494062;color:#f6e8ed;
  white-space:nowrap;font-size:clamp(.68rem,2.15vw,.9rem);font-weight:780;
}
.bastions-lanes button[aria-pressed=true] {border-color:var(--army);color:var(--army);background:var(--army-dark);}
.bastions-game button:focus-visible {outline:2px solid #fff4bc;outline-offset:1px;z-index:2;}
.bastions-hand {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;}
.bastions-card {
  position:relative;display:grid;min-height:54px;min-width:0;grid-template-rows:auto 1fr;align-items:start;
  overflow:hidden;padding:0 0 4px;border:1px solid #e7c78c;border-radius:8px;background:linear-gradient(#5f4b65,#392e4e);color:var(--bastions-text);cursor:grab;
}
.bastions-card.is-dragging {cursor:grabbing;border-color:#ffe8a6;box-shadow:0 0 9px #f1c47b;transform:translateY(-2px);}
.bastions-card img {width:100%;height:auto;aspect-ratio:4/3;object-fit:cover;pointer-events:none;}
.bastions-card>strong {padding:3px 1px 0;font-size:clamp(.64rem,2.12vw,.77rem);line-height:1.12;overflow-wrap:anywhere;}
.bastions-cost {
  position:absolute;top:3px;left:3px;padding:3px;border-radius:4px;background:#392942ee;color:var(--gold);border:1px solid #ffd38682;
  font-size:clamp(.61rem,1.8vw,.74rem);font-weight:865;line-height:1;
}
.bastions-card kbd {position:absolute;right:3px;top:3px;padding:3px 4px;border-radius:4px;background:#223447dc;color:#e4eedb;font:inherit;font-size:.68rem;}
.bastions-card.is-expensive {border-color:#74878a;color:#c5cec8;}
.bastions-card.is-expensive img {filter:saturate(.69) brightness(.79);}
.bastions-status {margin:0;min-height:1.2em;line-height:1.18;font-size:clamp(.66rem,2vw,.83rem);color:#e5e8cb;font-weight:650;}
@media (max-width:850px), (orientation:portrait) and (max-width:1100px) {
  .bastions-game,.bastions-game.is-solo {
    height:clamp(480px,calc(100dvh - 81px),970px);grid-template-columns:minmax(0,1fr);
    grid-template-areas:'hud' 'rival' 'board' 'mine';grid-template-rows:auto auto minmax(0,1fr) auto;
  }
  .bastions-game.is-solo {grid-template-areas:'hud' 'board' 'mine';grid-template-rows:auto minmax(0,1fr) auto;}
  .bastions-tray {padding:4px;gap:3px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
  .bastions-tray-info {gap:2px;}
  .bastions-tray-info>strong {display:none;}
  .bastions-hand {grid-column:1/-1;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;}
  .bastions-card {min-height:46px;grid-template-rows:minmax(21px,1fr) auto;}
  .bastions-card img {height:clamp(31px,8.6vw,58px);aspect-ratio:auto;object-position:center 43%;}
  .bastions-card>strong {max-height:2.4em;font-size:clamp(.53rem,2.04vw,.78rem);}
  .bastions-status {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
  .bastions-keep {display:grid;gap:2px;}
  .bastions-team-1.bastions-keep {justify-items:end;}
}
@media (pointer:coarse),(max-width:740px) { .bastions-card kbd {display:none;} }
@media (orientation:landscape) and (max-height:520px) {
  .bastions-game,.bastions-game.is-solo {
    height:max(265px,calc(100dvh - 66px));grid-template-columns:minmax(100px,.65fr) minmax(0,2fr) minmax(100px,.65fr);
    grid-template-areas:'hud hud hud' 'mine board rival';grid-template-rows:auto minmax(0,1fr);
  }
  .bastions-game.is-solo {grid-template-columns:minmax(115px,.72fr) minmax(0,2.4fr);grid-template-areas:'hud hud' 'mine board';}
  .bastions-hand {grid-template-columns:repeat(2,minmax(0,1fr));}
  .bastions-card {min-height:44px;}
  .bastions-card img {height:clamp(23px,6.4dvh,34px);aspect-ratio:auto;}
  .bastions-card>strong {font-size:clamp(.53rem,1.35vw,.68rem);}
}

.bastions-callout {
  position:absolute;bottom:10px;left:50%;translate:-50% 0;margin:0;padding:5px 10px;
  max-width:90%;width:max-content;border:1px solid #eac280ad;border-radius:8px;
  background:#342b47e8;color:#ffe29e;text-align:center;font-size:clamp(.65rem,2.1vw,.89rem);
  font-weight:780;pointer-events:none;
}
.bastions-callout:empty {display:none;}
.bastions-card[aria-pressed=true] {border-color:#ffebaf;box-shadow:0 0 0 1px #ffcf82,0 0 13px #dca85590;}
.bastions-card.is-special .bastions-cost {background:#624173;}
.bastions-card.is-special .bastions-cost::after {
  content:'⇄';margin-left:3px;color:#ffe9fc;
}
.bastions-card.is-special kbd {z-index:1;}
.bastions-card kbd[hidden] {display:none;}

.bastions-game .bastions-markers-control {
  position:absolute;top:7px;right:7px;z-index:1;min-height:36px;padding:4px 9px;
  border:1px solid #aacdc3;border-radius:8px;background:#1f334aeb;color:#edfff8;
  font-size:clamp(.65rem,1.85vw,.84rem);font-weight:770;
}
.bastions-markers-control[aria-pressed=true] {border-color:#9ef5dc;background:#23595de8;color:#cff9e6;}
@media (pointer:coarse) {
  .bastions-markers-control {min-height:40px;}
}
@media (min-width:1000px) and (hover:hover) and (pointer:fine) {
  .play-shell:has(.bastions-game) {padding-inline:clamp(6px,1vw,16px);}
  .bastions-game.is-solo {
    height:clamp(460px,calc(100dvh - 78px),1500px);
    grid-template-columns:clamp(145px,12vw,183px) minmax(0,1fr);
  }
}
