/* TriPanic: Typhoon v0.10.9 — shared measured seat layout.
   Earlier fallback percentages remain available if JavaScript is unavailable. */
.game-shell.ty-party-table .game-stage .opponent.crew-seat[data-ty-placed="1"]{
 top:var(--ty-seat-y)!important;left:var(--ty-seat-x)!important;
 right:auto!important;bottom:auto!important;
 transform:none!important;
}
/* Keep opponent labels within their own tiles at all supported densities. */
.game-shell.ty-party-table .game-stage .opponent.crew-seat{
 overflow:hidden;contain:layout;isolation:isolate;
}
.game-shell.ty-party-table .game-stage .opponent.crew-seat.turn::before,
.game-shell.ty-party-table .game-stage .opponent.crew-seat.turn::after{inset:0;border-radius:inherit;}
/* Very short landscape phones: a seventh seat is more important than small
   secondary labels. Preserve portraits, card count, and target hit areas. */
@media (orientation:landscape) and (max-height:370px){
 .game-shell.ty-party-table .game-stage .opponent.crew-seat{
  width:clamp(97px,17vw,124px);height:43px!important;min-height:43px!important;max-height:43px!important;
  padding:2px 3px;grid-template-columns:22px minmax(0,1fr) 23px;
  grid-template-rows:18px 13px;gap:1px 3px;border-radius:7px;
 }
 .game-shell.ty-party-table .game-stage .opponent.crew-seat .crew-portrait-wrap{width:22px;height:36px;grid-row:1/3;}
 .game-shell.ty-party-table .game-stage .opponent.crew-seat .name{font-size:7px;line-height:1.05;grid-row:1/3;max-height:35px;overflow-wrap:anywhere;}
 .game-shell.ty-party-table .game-stage .opponent.crew-seat .persona,
 .game-shell.ty-party-table .game-stage .opponent.crew-seat .status-effects{display:none;}
 .game-shell.ty-party-table .game-stage .opponent.crew-seat .big-count{grid-column:3;grid-row:1/3;width:23px;min-height:27px;font-size:15px;}
 .game-shell.ty-party-table .game-stage .opponent.crew-seat .big-count span{font-size:5px;}
 .game-shell.ty-party-table .game-stage .ty-control-rail{bottom:calc(var(--footer-h,44px) + 5px)}
}
/* Shared priority order: opponent controls and readable cards always above
   scenery and ship, even during a reversal, shield animation or PANIC call. */
.game-shell .game-stage .foxy-orbit-marker{z-index:1;pointer-events:none}
.game-shell .game-stage .table-center{z-index:6}
.game-shell .game-stage .opponents{z-index:8}
.game-shell .game-stage .player-panel,
.game-shell .game-stage .hand-zone{z-index:9}
.game-shell .game-stage .ty-control-rail{z-index:10}
.game-shell .game-stage .match-footer{z-index:11}
/* The game footer never squeezes its History control to make room for status.
   Reserve the button and truncate secondary commentary instead. */
.game-shell .game-stage .match-footer{display:flex;align-items:center;gap:8px}
.game-shell .game-stage .match-footer .latest{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.game-shell .game-stage .match-footer #view-history{flex:0 0 auto;white-space:nowrap;max-width:min(40vw,160px)}
/* Reserve the real-sized match footer even on tablet breakpoints, where an
   earlier footer custom property could be smaller than the rendered button. */
@media (orientation:landscape){
 .game-shell .game-stage .ty-control-rail{
  bottom:calc(max(var(--footer-h,44px),45px) + 8px)!important;
 }
}
@media (orientation:landscape) and (min-width:1101px){
 /* Keep the centered fan clear of the right rail's actual outside gutter. */
 .game-shell .game-stage .hand-zone{
  max-width:calc(100% - 2 * var(--ty-rail-width) - 96px)!important;
 }
}
/* On narrow, short landscape phones even the default 2–4 person table gets
   compact top seating. Do not allow the top portrait to cover the deck. */
@media (orientation:landscape) and (max-width:750px) and (max-height:420px){
 .game-shell:not(.ty-party-table) .game-stage .opponent.crew-seat.bot-top{
  height:44px!important;min-height:44px!important;max-height:44px!important;
  padding:2px 5px!important;
 }
 .game-shell:not(.ty-party-table) .game-stage .opponent.crew-seat.bot-top .crew-portrait-wrap{
  height:37px!important;max-height:37px!important;
 }
 .game-shell:not(.ty-party-table) .game-stage .opponent.crew-seat.bot-top .persona{display:none!important}
 .game-shell:not(.ty-party-table) .game-stage .opponent.crew-seat.bot-top .big-count{min-height:33px!important}
}
@media (orientation:landscape) and (max-height:340px){
 .game-shell.ty-party-table .game-stage .opponent.crew-seat{
  height:39px!important;min-height:39px!important;max-height:39px!important;
 }
 .game-shell.ty-party-table .game-stage .opponent.crew-seat .crew-portrait-wrap{height:32px}
 .game-shell.ty-party-table .game-stage .opponent.crew-seat .big-count{min-height:25px}
}
