/* Brasta viewport-locked match/lobby shell
   Normal play never scrolls the document. Long panels may scroll internally
   without visible scrollbars. The virtual-keyboard state temporarily restores
   document scrolling so focused fields can stay reachable. */
:root{
  --brasta-visual-height:100dvh;
  --brasta-site-nav-base:58px;
  --brasta-topbar-base:64px;
}

html.brasta-shell-locked,
body.brasta-shell-locked{
  width:100%;
  height:var(--brasta-visual-height);
  max-height:var(--brasta-visual-height);
  overflow:hidden;
  overscroll-behavior:none;
}

body.brasta-shell-locked{
  min-height:0;
  display:flex;
  flex-direction:column;
}

body.brasta-shell-locked .brasta-site-nav{
  position:relative;
  top:auto;
  flex:0 0 var(--brasta-site-nav-base);
  height:var(--brasta-site-nav-base);
}

body.brasta-shell-locked .brasta-bootstrap-root{
  flex:1 1 auto;
  width:100%;
  height:auto;
  min-height:0;
  overflow:hidden;
}

body.brasta-shell-locked #app{
  display:flex;
  flex-direction:column;
  width:100%;
  height:100%;
  min-height:0;
  overflow:hidden;
}

body.brasta-shell-locked .topbar{
  position:relative!important;
  top:auto!important;
  flex:0 0 auto;
  min-height:calc(var(--brasta-topbar-base) + env(safe-area-inset-top));
  height:calc(var(--brasta-topbar-base) + env(safe-area-inset-top));
  padding-top:env(safe-area-inset-top);
  padding-left:max(12px,env(safe-area-inset-left));
  padding-right:max(12px,env(safe-area-inset-right));
}

body.brasta-shell-locked #app > main{
  flex:1 1 auto;
  min-width:0;
  min-height:0;
  width:100%;
  max-height:100%;
  overflow:hidden;
  padding-bottom:max(6px,env(safe-area-inset-bottom));
}

body.brasta-shell-locked #app > main:not(.lobby){
  display:flex;
  flex-direction:column;
}

body.brasta-shell-locked .players,
body.brasta-shell-locked .last-move-banner,
body.brasta-shell-locked .event,
body.brasta-shell-locked .error,
body.brasta-shell-locked .notice,
body.brasta-shell-locked .hand-area,
body.brasta-shell-locked .game-action-row,
body.brasta-shell-locked .action-panel{
  flex:0 0 auto;
  min-width:0;
}

body.brasta-shell-locked .table{
  flex:1 1 auto;
  min-width:0;
  min-height:0!important;
  overflow:hidden;
}

body.brasta-shell-locked .build-row,
body.brasta-shell-locked .loose-row{
  min-height:0!important;
  height:50%;
  align-content:center;
  overflow:hidden;
}

body.brasta-shell-locked .hand,
body.brasta-shell-locked .target-list,
body.brasta-shell-locked .button-row,
body.brasta-shell-locked .compact-context-actions,
body.brasta-shell-locked .selection-v2-options{
  overscroll-behavior:contain;
  scrollbar-width:none;
}

body.brasta-shell-locked .hand::-webkit-scrollbar,
body.brasta-shell-locked .target-list::-webkit-scrollbar,
body.brasta-shell-locked .button-row::-webkit-scrollbar,
body.brasta-shell-locked .compact-context-actions::-webkit-scrollbar,
body.brasta-shell-locked .selection-v2-options::-webkit-scrollbar,
body.brasta-shell-locked .round-end::-webkit-scrollbar,
body.brasta-shell-locked .action-panel::-webkit-scrollbar,
body.brasta-shell-locked .burn-call-card::-webkit-scrollbar{
  display:none;
}

body.brasta-shell-locked .action-panel{
  max-height:min(24vh,190px);
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:none;
}

body.brasta-shell-locked .round-end{
  flex:1 1 auto;
  min-height:0;
  max-height:none;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:none;
  margin-top:8px;
  margin-bottom:8px;
}

body.brasta-shell-locked .privacy-cover{
  inset:calc(var(--brasta-site-nav-base) + var(--brasta-topbar-base) + env(safe-area-inset-top)) 0 0!important;
}

/* Lobby uses the remaining viewport as a fixed layout budget. */
body.brasta-shell-locked .lobby{
  display:flex;
  flex-direction:column;
  gap:10px;
}

body.brasta-shell-locked .lobby-hero,
body.brasta-shell-locked .lobby-controls{
  flex:0 0 auto;
  margin:0;
}

body.brasta-shell-locked .lobby-seats{
  flex:1 1 auto;
  min-height:0;
  grid-auto-rows:minmax(0,1fr);
}

body.brasta-shell-locked .lobby-seat{
  min-height:0;
  overflow:hidden;
}

body.brasta-shell-locked .lobby-controls{
  min-height:0;
  gap:8px;
}

body.brasta-shell-locked .room-links{
  margin-bottom:6px;
}

body.brasta-shell-locked .burn-call-modal,
body.brasta-shell-locked [role="dialog"]{
  overscroll-behavior:contain;
}

body.brasta-shell-locked .burn-call-card{
  max-height:calc(var(--brasta-visual-height) - 28px);
  overflow-y:auto;
  scrollbar-width:none;
}

/* Compact is the normal phone/tablet density. */
body.brasta-density-compact{
  --brasta-topbar-base:54px;
}

body.brasta-shell-locked.brasta-density-compact #app > main{
  padding-top:6px;
}

body.brasta-shell-locked.brasta-density-compact .lobby-hero{
  padding:12px 14px;
  gap:10px;
}

body.brasta-shell-locked.brasta-density-compact .lobby-hero h1{
  font-size:32px;
  margin:0;
}

body.brasta-shell-locked.brasta-density-compact .lobby-hero p{
  margin:3px 0;
  font-size:12px;
}

body.brasta-shell-locked.brasta-density-compact .lobby-seat{
  padding:10px;
}

body.brasta-shell-locked.brasta-density-compact .seat-name{
  margin:4px 0;
  font-size:17px;
  line-height:1.1;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

body.brasta-shell-locked.brasta-density-compact .lobby-controls{
  padding:9px 11px;
}

body.brasta-shell-locked.brasta-density-compact .lobby-controls .big-button,
body.brasta-shell-locked.brasta-density-compact .lobby-controls .waiting-copy{
  min-height:40px;
  padding:8px 14px!important;
}

body.brasta-shell-locked.brasta-density-compact .room-links{
  width:100%;
  font-size:10px;
  line-height:1.2;
}

body.brasta-shell-locked.brasta-density-compact .room-links p{
  margin:3px 0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Tight mode is reserved for short phones, landscape phones, split-screen,
   and other constrained viewports. Preserve readable controls before detail. */
body.brasta-density-tight{
  --brasta-topbar-base:50px;
}

body.brasta-shell-locked.brasta-density-tight #app > main{
  padding-top:4px;
  padding-left:5px;
  padding-right:5px;
  padding-bottom:max(4px,env(safe-area-inset-bottom));
}

body.brasta-shell-locked.brasta-density-tight .topbar strong{
  font-size:17px;
}

body.brasta-shell-locked.brasta-density-tight .players{
  gap:3px;
  margin-bottom:3px;
}

body.brasta-shell-locked.brasta-density-tight .player-chip{
  padding:3px 5px;
  font-size:10px;
  line-height:1.08;
}

body.brasta-shell-locked.brasta-density-tight .player-chip > div:last-child,
body.brasta-shell-locked.brasta-density-tight .starter,
body.brasta-shell-locked.brasta-density-tight .seat-label{
  display:none;
}

body.brasta-shell-locked.brasta-density-tight .players.players-2v2 .player-chip > .player-card-hand{
  display:flex!important;
}

body.brasta-shell-locked.brasta-density-tight .last-move-banner{
  margin:2px auto 3px;
  padding:3px 6px;
  font-size:10px;
}

body.brasta-shell-locked.brasta-density-tight .event,
body.brasta-shell-locked.brasta-density-tight .error,
body.brasta-shell-locked.brasta-density-tight .notice{
  margin:2px auto;
  padding:4px 7px;
  font-size:10px;
}

body.brasta-shell-locked.brasta-density-tight .table{
  padding:5px 6px;
  border-width:4px;
  border-radius:12px;
}

body.brasta-shell-locked.brasta-density-tight .build-row,
body.brasta-shell-locked.brasta-density-tight .loose-row{
  gap:4px;
}

body.brasta-shell-locked.brasta-density-tight .card{
  width:56px;
  height:82px;
}

body.brasta-shell-locked.brasta-density-tight .card .corner{
  top:4px;
  left:5px;
  font-size:12px;
}

body.brasta-shell-locked.brasta-density-tight .card .suit{
  font-size:25px;
}

body.brasta-shell-locked.brasta-density-tight .build{
  width:92px;
  min-height:76px;
  padding:24px 3px 3px;
}

body.brasta-shell-locked.brasta-density-tight .build-label{
  top:3px;
  left:3px;
  right:3px;
  padding:2px;
  font-size:10px;
}

body.brasta-shell-locked.brasta-density-tight .build-cards{
  min-height:42px;
}

body.brasta-shell-locked.brasta-density-tight .card.tiny{
  width:35px;
  height:50px;
  margin-left:-19px;
}

body.brasta-shell-locked.brasta-density-tight .hand-area{
  margin-top:3px;
  padding:3px 5px;
}

body.brasta-shell-locked.brasta-density-tight .hand-title{
  display:none;
}

body.brasta-shell-locked.brasta-density-tight .hand{
  gap:3px;
  padding-top:1px;
  padding-bottom:2px;
}

body.brasta-shell-locked.brasta-density-tight .action-panel,
body.brasta-shell-locked.brasta-density-tight .action-panel.compact-action-dock{
  margin-top:3px;
  padding:4px 6px;
  max-height:min(21vh,118px);
}

body.brasta-shell-locked.brasta-density-tight .action-panel h3,
body.brasta-shell-locked.brasta-density-tight .action-panel > p{
  display:none;
}

body.brasta-shell-locked .action-panel.action-idle-prompt{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}

body.brasta-shell-locked .action-panel.action-idle-prompt > p,
body.brasta-shell-locked.brasta-density-tight .action-panel.action-idle-prompt > p{
  display:block!important;
  margin:0;
  color:#bdc8c2;
  font-size:12px;
  line-height:1.25;
}

body.brasta-shell-locked.brasta-density-tight .action-panel button,
body.brasta-shell-locked.brasta-density-tight .compact-context-actions button{
  min-height:34px;
  padding:6px 9px!important;
  font-size:11px;
}

body.brasta-shell-locked.brasta-density-tight .lobby{
  gap:5px;
}

body.brasta-shell-locked.brasta-density-tight .lobby-hero{
  padding:7px 9px;
  gap:6px;
}

body.brasta-shell-locked.brasta-density-tight .lobby-hero h1{
  font-size:26px;
}

body.brasta-shell-locked.brasta-density-tight .lobby-hero p,
body.brasta-shell-locked.brasta-density-tight .spectator-count{
  margin:2px 0;
  font-size:10px;
}

body.brasta-shell-locked.brasta-density-tight .lobby-hero .button-row{
  gap:4px;
}

body.brasta-shell-locked.brasta-density-tight .lobby-hero button{
  padding:5px 7px;
  font-size:10px;
}

body.brasta-shell-locked.brasta-density-tight .lobby-seats{
  gap:5px;
}

body.brasta-shell-locked.brasta-density-tight .lobby-seat{
  padding:6px 7px;
  border-radius:9px;
}

body.brasta-shell-locked.brasta-density-tight .seat-number,
body.brasta-shell-locked.brasta-density-tight .offline-note{
  font-size:8px;
}

body.brasta-shell-locked.brasta-density-tight .seat-name{
  margin:2px 0;
  font-size:14px;
}

body.brasta-shell-locked.brasta-density-tight .lobby-controls{
  gap:5px;
  padding:6px 8px;
}

body.brasta-shell-locked.brasta-density-tight .room-links{
  display:none;
}

body.brasta-shell-locked.brasta-density-tight .lobby-controls .big-button,
body.brasta-shell-locked.brasta-density-tight .lobby-controls .waiting-copy{
  min-width:min(100%,260px);
  min-height:34px;
  padding:6px 10px!important;
  font-size:12px!important;
}

body.brasta-shell-locked.brasta-density-tight .waiting-copy{
  font-size:10px;
}

@media (max-width:700px){
  body.brasta-shell-locked{
    --brasta-site-nav-base:52px;
  }
}

@media (max-width:700px){
  body.brasta-shell-locked .lobby-seats{
    flex:0 1 auto;
    width:100%;
    max-height:min(38vh,320px);
  }

  body.brasta-shell-locked .lobby-seat{
    max-height:100%;
  }

  body.brasta-shell-locked .lobby-controls{
    flex:0 0 auto;
    min-height:92px;
    padding:12px 12px 14px;
    justify-content:center;
  }

  body.brasta-shell-locked .lobby-controls .big-button,
  body.brasta-shell-locked .lobby-controls .waiting-copy{
    min-height:52px!important;
    padding:10px 18px!important;
  }
}

@media (max-width:430px){
  body.brasta-shell-locked .lobby-seats{
    max-height:min(34vh,270px);
  }

  body.brasta-shell-locked.brasta-density-tight .lobby-controls{
    min-height:84px;
    padding:10px 9px 12px;
  }

  body.brasta-shell-locked.brasta-density-tight .lobby-controls .big-button,
  body.brasta-shell-locked.brasta-density-tight .lobby-controls .waiting-copy{
    min-height:48px!important;
    padding:9px 14px!important;
    font-size:13px!important;
  }
}



/* Let the layout breathe horizontally on short landscape devices instead of
   stacking the hero into an unnecessarily tall column. */
@media (min-width:600px){
  body.brasta-shell-locked.brasta-density-tight .lobby-hero{
    flex-direction:row;
    text-align:left;
  }
}

/* Mobile action dock: stable geometry across idle, play, capture and build
   states. The outer frame and action buttons share the same corner language,
   and a single action always fills the available dock consistently. */
@media (max-width:700px){
  body.brasta-shell-locked .game-action-row{
    align-items:stretch;
    min-height:72px;
  }

  body.brasta-shell-locked .game-action-row > .action-panel{
    min-height:72px;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    justify-content:center;
    padding:8px 10px;
    border-radius:18px;
  }

  body.brasta-shell-locked .game-action-row > .action-panel.compact-action-dock{
    max-height:none;
    overflow:visible;
  }

  body.brasta-shell-locked .action-panel .button-row.actions,
  body.brasta-shell-locked .action-panel.selection-v2-has-target .button-row.actions,
  body.brasta-shell-locked .action-panel.selection-v2-has-target .selection-v2-options{
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    justify-content:center!important;
    gap:6px;
    width:100%!important;
    min-height:48px;
    margin:0!important;
    overflow:visible!important;
  }

  body.brasta-shell-locked .action-panel .button-row.actions > button,
  body.brasta-shell-locked .action-panel.selection-v2-has-target .button-row.actions > button,
  body.brasta-shell-locked .action-panel.selection-v2-has-target .selection-v2-options > button{
    flex:1 1 138px!important;
    min-width:0!important;
    width:auto!important;
    max-width:none!important;
    min-height:48px!important;
    border-radius:18px!important;
    white-space:normal!important;
    line-height:1.15;
    padding:8px 10px!important;
  }

  /* One action should never change size just because it came from a different
     selection path. It fills the same inner frame for Play, Capture or Build. */
  body.brasta-shell-locked .action-panel .button-row.actions:has(> button:only-child),
  body.brasta-shell-locked .action-panel.selection-v2-has-target .button-row.actions:has(> button:only-child),
  body.brasta-shell-locked .action-panel.selection-v2-has-target .selection-v2-options:has(> button:only-child){
    width:100%!important;
    margin:0!important;
  }

  body.brasta-shell-locked .action-panel .button-row.actions:has(> button:only-child) > button,
  body.brasta-shell-locked .action-panel.selection-v2-has-target .button-row.actions:has(> button:only-child) > button,
  body.brasta-shell-locked .action-panel.selection-v2-has-target .selection-v2-options:has(> button:only-child) > button{
    flex:1 1 100%!important;
    width:100%!important;
    max-width:none!important;
  }

  body.brasta-shell-locked .action-panel.action-idle-prompt,
  body.brasta-shell-locked .action-panel .selection-v2-note{
    align-items:center;
    justify-content:center;
  }

  body.brasta-shell-locked .action-panel .selection-v2-note{
    display:flex;
    flex:1 1 auto;
    min-height:48px;
    padding:0 8px;
  }
}

@media (max-width:430px){
  body.brasta-shell-locked .game-action-row,
  body.brasta-shell-locked .game-action-row > .action-panel{
    min-height:68px;
  }

  body.brasta-shell-locked .game-action-row > .action-panel{
    padding:7px 8px;
    border-radius:17px;
  }

  body.brasta-shell-locked .action-panel .button-row.actions,
  body.brasta-shell-locked .action-panel.selection-v2-has-target .button-row.actions,
  body.brasta-shell-locked .action-panel.selection-v2-has-target .selection-v2-options{
    min-height:46px;
    gap:5px;
  }

  body.brasta-shell-locked .action-panel .button-row.actions > button,
  body.brasta-shell-locked .action-panel.selection-v2-has-target .button-row.actions > button,
  body.brasta-shell-locked .action-panel.selection-v2-has-target .selection-v2-options > button{
    min-height:46px!important;
    flex-basis:118px!important;
    border-radius:17px!important;
    padding:7px 8px!important;
    font-size:11px!important;
  }
}

/* Opening choice uses the same full-dock geometry as gameplay actions. */
body.brasta-shell-locked .opening-panel{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:stretch;
  min-height:86px;
  border-radius:18px;
  padding:9px 10px;
}

body.brasta-shell-locked .opening-panel .opening-choice-actions{
  display:flex!important;
  flex-wrap:nowrap!important;
  align-items:stretch!important;
  justify-content:stretch!important;
  width:100%;
  min-height:50px;
  gap:7px;
  margin:0;
  overflow:visible!important;
}

body.brasta-shell-locked .opening-choice-button{
  flex:1 1 50%;
  min-width:0;
  min-height:50px;
  width:auto;
  border-radius:18px!important;
  padding:9px 12px!important;
  font-weight:900!important;
  line-height:1.12;
  cursor:pointer;
  box-shadow:none!important;
}

body.brasta-shell-locked .opening-choice-button.opening-keep{
  background:#2f7655!important;
  border:1px solid #6cb58f!important;
  color:#f3fff8!important;
}

body.brasta-shell-locked .opening-choice-button.opening-place{
  background:#b8953f!important;
  border:1px solid #e0c46f!important;
  color:#1f1807!important;
}

body.brasta-shell-locked .opening-choice-button:hover{
  filter:brightness(1.08);
}

@media (max-width:430px){
  body.brasta-shell-locked .opening-panel{
    min-height:76px;
    padding:7px 8px;
    border-radius:17px;
  }

  body.brasta-shell-locked .opening-panel .opening-choice-actions{
    min-height:46px;
    gap:5px;
  }

  body.brasta-shell-locked .opening-choice-button{
    min-height:46px;
    border-radius:17px!important;
    padding:7px 8px!important;
    font-size:11px!important;
  }
}

/* Board card fit: don't let a wrapped loose-card row get clipped by the
   fixed 50/50 build/loose split. If there are no builds, give the loose area
   most of the table. On narrow/tight phones, six loose cards also scale just
   enough to remain on one row when possible. */
body.brasta-shell-locked .table:has(.build-row > .empty-note) .build-row{
  height:26%;
}

body.brasta-shell-locked .table:has(.build-row > .empty-note) .loose-row{
  height:74%;
}

body.brasta-shell-locked.brasta-density-tight .loose-row:has(> .card:nth-child(6)) > .card{
  width:50px;
  height:74px;
}

body.brasta-shell-locked.brasta-density-tight .loose-row:has(> .card:nth-child(6)) > .card .corner{
  top:3px;
  left:4px;
  font-size:11px;
}

body.brasta-shell-locked.brasta-density-tight .loose-row:has(> .card:nth-child(6)) > .card .suit{
  font-size:23px;
}

/* Dense-board safeguards. A no-scroll shell must also handle unusually full
   tables, so card size and row allocation react to actual board population. */
body.brasta-shell-locked .table:has(.loose-row > .card:nth-child(9)) .build-row{
  height:36%;
}
body.brasta-shell-locked .table:has(.loose-row > .card:nth-child(9)) .loose-row{
  height:64%;
}

body.brasta-shell-locked.brasta-density-compact .loose-row:has(> .card:nth-child(7)) > .card{
  width:54px;
  height:80px;
}
body.brasta-shell-locked.brasta-density-compact .loose-row:has(> .card:nth-child(7)) > .card .corner{
  font-size:11px;
}
body.brasta-shell-locked.brasta-density-compact .loose-row:has(> .card:nth-child(7)) > .card .suit{
  font-size:24px;
}

body.brasta-shell-locked .loose-row:has(> .card:nth-child(9)) > .card{
  width:46px;
  height:68px;
}
body.brasta-shell-locked .loose-row:has(> .card:nth-child(9)) > .card .corner{
  top:3px;
  left:4px;
  font-size:10px;
}
body.brasta-shell-locked .loose-row:has(> .card:nth-child(9)) > .card .suit{
  font-size:21px;
}

body.brasta-shell-locked .loose-row:has(> .card:nth-child(13)) > .card{
  width:38px;
  height:56px;
  border-radius:5px;
}
body.brasta-shell-locked .loose-row:has(> .card:nth-child(13)) > .card .corner{
  top:2px;
  left:3px;
  font-size:9px;
}
body.brasta-shell-locked .loose-row:has(> .card:nth-child(13)) > .card .suit{
  font-size:18px;
}

body.brasta-shell-locked .build-row:has(> .build:nth-child(3)) > .build{
  width:84px;
  min-height:72px;
  padding:23px 3px 3px;
}
body.brasta-shell-locked .build-row:has(> .build:nth-child(3)) > .build .build-label{
  top:3px;
  left:3px;
  right:3px;
  padding:2px;
  font-size:9px;
}
body.brasta-shell-locked .build-row:has(> .build:nth-child(3)) > .build .card.tiny{
  width:32px;
  height:46px;
  margin-left:-18px;
}
body.brasta-shell-locked .build-row:has(> .build:nth-child(3)) > .build .card.tiny .corner{
  font-size:8px;
}
body.brasta-shell-locked .build-row:has(> .build:nth-child(3)) > .build .card.tiny .suit{
  font-size:15px;
}

/* A horizontally scrollable hand also clips vertical overflow in browsers.
   Keep the mobile selection entirely inside the card instead of lifting it or
   drawing an outline beyond the scrollport. */
@media(max-width:800px){
  body.brasta-shell-locked .hand .card.selected,
  body.brasta-shell-locked .hand .card.compact-staged,
  body.brasta-shell-locked .hand .card.selection-v2-selected{
    transform:none!important;
    outline:0!important;
    border-color:#e8c85f!important;
    box-shadow:0 4px 10px #0005,inset 0 0 0 3px #f3d878!important;
  }
}

/* Fit the complete round breakdown and its controls inside the locked mobile
   viewport. Desktop keeps the roomier score card. */
@media(max-width:800px){
  body.brasta-shell-locked .round-end{
    width:100%;
    margin:4px auto;
    padding:12px 14px;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    border-radius:14px;
  }

  body.brasta-shell-locked .round-end h2{
    margin:0 0 4px;
    font-size:clamp(21px,3.2vh,28px);
    line-height:1.08;
  }

  body.brasta-shell-locked .round-end>p{
    margin:0 0 6px;
    font-size:clamp(12px,1.8vh,15px);
    line-height:1.2;
  }

  body.brasta-shell-locked .round-end table{
    width:100%;
    table-layout:fixed;
    margin:4px 0 6px;
    font-size:clamp(11px,1.75vh,14px);
    line-height:1.12;
  }

  body.brasta-shell-locked .round-end th,
  body.brasta-shell-locked .round-end td{
    padding:clamp(2px,.48vh,4px) 5px;
  }

  body.brasta-shell-locked .round-end th:first-child,
  body.brasta-shell-locked .round-end td:first-child{
    width:52%;
    white-space:nowrap;
  }

  body.brasta-shell-locked .round-end>.button-row{
    width:100%;
    margin-top:auto;
    padding-top:3px;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
    gap:7px;
    flex-wrap:nowrap;
  }

  body.brasta-shell-locked .round-end>.button-row>button{
    width:100%;
    min-height:38px;
    padding:7px 9px;
  }
}

@media(max-width:800px) and (max-height:760px){
  body.brasta-shell-locked .round-end{
    padding:8px 11px;
  }

  body.brasta-shell-locked .round-end h2{
    font-size:20px;
    margin-bottom:2px;
  }

  body.brasta-shell-locked .round-end>p{
    margin-bottom:3px;
    font-size:11px;
  }

  body.brasta-shell-locked .round-end table{
    margin:2px 0 3px;
    font-size:11px;
  }

  body.brasta-shell-locked .round-end th,
  body.brasta-shell-locked .round-end td{
    padding:2px 4px;
  }

  body.brasta-shell-locked .round-end>.button-row>button{
    min-height:34px;
    padding:5px 7px;
  }
}

/* Pull-to-refresh feedback for the viewport-locked shell. The browser's native
   gesture is unavailable with overflow:hidden, so the shell provides an
   equivalent gesture without re-enabling page scrolling. */
.brasta-pull-refresh{
  --brasta-pull-distance:0px;
  position:fixed;
  z-index:1600;
  top:max(8px,env(safe-area-inset-top));
  left:50%;
  display:flex;
  align-items:center;
  gap:7px;
  min-height:34px;
  padding:6px 11px;
  border:1px solid #ffffff24;
  border-radius:999px;
  background:#0b281df2;
  color:#d7e4dc;
  box-shadow:0 8px 24px #0007;
  font-size:11px;
  font-weight:800;
  letter-spacing:.02em;
  opacity:0;
  pointer-events:none;
  transform:translate(-50%,calc(-46px + var(--brasta-pull-distance)));
  transition:opacity .12s ease,transform .08s linear,border-color .12s ease,color .12s ease;
}
.brasta-pull-refresh.visible{opacity:1}
.brasta-pull-refresh.armed{border-color:#d8b75e88;color:#f5df9d}
.brasta-pull-refresh-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  font-size:17px;
  line-height:1;
  transform:rotate(calc(var(--brasta-pull-distance) * 2.4));
}
.brasta-pull-refresh.refreshing .brasta-pull-refresh-icon{
  animation:brasta-pull-refresh-spin .65s linear infinite;
}
@keyframes brasta-pull-refresh-spin{to{transform:rotate(360deg)}}

/* Virtual keyboard exception: the page may scroll only while a text-editing
   control is focused and the visual viewport has actually contracted. */
html.brasta-keyboard-open,
body.brasta-keyboard-open{
  height:auto;
  max-height:none;
  min-height:var(--brasta-visual-height);
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior-y:contain;
}

body.brasta-keyboard-open{
  display:block;
}

body.brasta-keyboard-open .brasta-site-nav{
  position:sticky;
  top:0;
}

body.brasta-keyboard-open .brasta-bootstrap-root,
body.brasta-keyboard-open #app{
  height:auto;
  min-height:calc(var(--brasta-visual-height) - var(--brasta-site-nav-base));
  overflow:visible;
}

body.brasta-keyboard-open #app > main{
  flex:none;
  height:auto;
  max-height:none;
  min-height:calc(var(--brasta-visual-height) - var(--brasta-topbar-base));
  overflow:visible;
}

body.brasta-keyboard-open .lobby-seats{
  flex:none;
  min-height:auto;
}

body.brasta-keyboard-open .action-panel,
body.brasta-keyboard-open .round-end{
  max-height:none;
  overflow:visible;
}

@media (prefers-reduced-motion:reduce){
  html.brasta-shell-locked{scroll-behavior:auto}
}
