/* TriPanic: Typhoon v0.10.5 — one table for Solo and online.
   Shared layout priorities: cards, turn state, input, players; secondary metadata
   must yield on small screens. Presentation only; no change to match rules. */

/* Online already shows its room/match context in the header. This old
   bottom-right debug ribbon collided with the Match History control. */
.game-shell.ty-online .ty-server-mark{display:none!important}
/* Never reintroduce the center text notice from older versions. */
.game-stage .combat-fx .ty-event-notice{display:none!important}

/* Results and status bars use the same visual system in both modes. */
.game-stage .match-footer{box-sizing:border-box;max-width:100%;isolation:isolate}
.game-stage .match-footer .latest{min-width:0;overflow:hidden;text-overflow:ellipsis}
.game-stage .match-footer .history-button{flex-shrink:0;position:relative;z-index:2;touch-action:manipulation}
.game-stage .action-panel .action-btn:focus-visible,
.game-stage .match-footer .history-button:focus-visible{outline:2px solid #83fff3;outline-offset:2px}

/* Hide decorative labels when they would crowd a dense or short table.
   The scene art, card color, turn banner and rule-critical state stay visible. */
@media (pointer:coarse) and (orientation:landscape) and (max-height:760px) and (max-width:1800px){
 .game-stage .voyage-marker{display:none!important}
 .game-stage .match-footer{
   left:0!important;right:0!important;bottom:0!important;
   width:100%!important;max-width:100vw;
   height:var(--footer-h,46px)!important;min-height:var(--footer-h,46px)!important;
   display:flex!important;align-items:center!important;justify-content:space-between!important;
   flex-wrap:nowrap!important;gap:7px;
   padding-left:max(8px,env(safe-area-inset-left,0px))!important;
   padding-right:max(8px,env(safe-area-inset-right,0px))!important;
   z-index:30!important;overflow:hidden!important;
 }
 .game-stage .match-footer .latest{
   display:block!important;flex:1 1 auto;max-width:none!important;
   white-space:nowrap!important;font-size:clamp(9px,1.12vw,12px)!important;
 }
 .game-stage .match-footer #view-history{
   display:inline-flex!important;align-items:center!important;justify-content:center!important;
   flex:0 0 auto!important;min-width:100px!important;max-width:112px!important;
   height:40px!important;min-height:40px!important;
   transform:none!important;margin:0!important;
   padding:5px 8px!important;font-size:10px!important;
   white-space:nowrap;line-height:1.1;position:relative;right:auto;bottom:auto;
 }
 /* The action stack must finish above the utility/footer rail. */
 .game-stage .action-panel,.game-stage .action-panel.panic-visible{
   bottom:calc(var(--footer-h,46px) + 9px)!important;
   max-height:42%;overflow:visible;
 }
 .game-stage .action-panel .action-btn{min-height:40px}
 .game-stage .player-panel{bottom:calc(var(--footer-h,46px) + 9px)!important}
 .game-stage .hand-zone{bottom:calc(var(--footer-h,46px) + 3px)!important}
 .game-stage .battle-message{
   z-index:5;pointer-events:none;
 }
 /* Active-effects box is useful only when effects are actually in play. */
 .game-stage .effects-panel:has(.effects-list:empty){display:none!important}
}
@media (pointer:coarse) and (orientation:landscape) and (max-height:420px){
 .game-stage .effects-panel{padding:4px 6px;max-width:145px}
 .game-stage .effects-title{font-size:7px;margin-bottom:3px}
 .game-stage .effect-tag{font-size:7px;padding:2px 4px}
 .game-stage .match-footer .latest b{font-size:9px}
 .game-stage .match-footer #view-history{min-width:92px!important;max-width:100px!important;padding:3px 5px!important;font-size:9px!important}
}
@media (max-width:600px) and (orientation:portrait){
 /* Portrait is already supported by the rotate-to-landscape guidance. */
 .game-stage .match-footer #view-history{min-height:44px}
}
@media(prefers-reduced-motion:reduce){
 .game-stage .match-footer .history-button{transition:none!important}
}
