/* BACCARAT DESKTOP PANELS (Ronan 2026-10-28, "go with recc") — one sheet for all five baccarats
   (Punto Banco, Mini, No-Commission, Banque, Chemin de Fer), copied byte-identical by kit/casino/build.js
   and loaded last. The site fits the game to the window on desktop (400-700px tall). Measured before
   this: the table fitted everywhere, but Rules was one tall column that scrolled at every desktop size
   (Close scrolled away with it in Banque and Chemin de Fer) and Stats scrolled at every size.
   The poker standard (briefs/desktop-window-fit.md): wide, content in columns, Close always in view;
   Rules text may scroll only in the shortest windows (under 581px). Phones (frame under 900px) unchanged. */
@media (min-width:900px){
  html body .panel-overlay{ padding:12px; }
  html body .panel-overlay .panel{ max-height:100%; }
  html body .panel-overlay .panel > .panel-close{ position:sticky; bottom:0; z-index:2; box-shadow:0 -10px 14px rgba(5,8,9,.85); background:#0b0f12; }
  /* B1 Rules: wide, the rules in two columns, the tables beside them */
  html body #rulesOverlay .panel{ width:min(1160px, 100%); max-width:none; padding-top:16px; display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); column-gap:28px; align-items:start; }
  html body #rulesOverlay .panel > *{ grid-column:1 / -1; }
  html body #rulesOverlay .panel h2{ margin-bottom:2px; }
  html body #rulesOverlay .panel > .rules-list{ grid-column:1; grid-row:3 / span 4; column-count:2; column-gap:28px; margin-bottom:8px; }
  /* the right column: the tables, then the keyboard line and the responsible-play note */
  html body #rulesOverlay .panel > #rulesPaytables{ grid-column:2; grid-row:3; max-width:none; margin-top:0; }
  html body #rulesOverlay .panel > .rules-kbd{ grid-column:2; grid-row:4; }
  html body #rulesOverlay .panel > .rules-rg{ grid-column:2; grid-row:5; }
  html body #rulesOverlay .panel > .panel-close{ grid-row:7; }
  html body #rulesOverlay .rules-list li{ break-inside:avoid; margin-bottom:5px; line-height:1.45; }
  html body #rulesOverlay .rules-kbd{ margin:4px 0 0; }
  html body #rulesOverlay .rules-rg{ font-size:11.5px; line-height:1.4; margin:6px 0 0; }
  /* B2 Stats: wide, in columns */
  html body .panel-overlay .panel.ts-panel-card{ width:min(1100px, 100%) !important; max-width:none; }
  /* three columns: session | last coup, this table (and Punto Banco's results history) | the last 20 coups */
  html body .panel-overlay .panel.ts-panel-card .ts-panel{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.35fr); column-gap:24px; row-gap:10px; align-items:start; }
  html body .panel-overlay .panel.ts-panel-card .ts-panel > *{ min-width:0; margin-top:0; }
  html body .panel-overlay .panel.ts-panel-card .ts-panel > [data-ts^="stats"]{ grid-column:1; grid-row:1 / span 2; }
  html body .panel-overlay .panel.ts-panel-card .ts-panel > [data-ts$="recap"]{ grid-column:2; grid-row:1; }
  html body .panel-overlay .panel.ts-panel-card .ts-panel > [class*="-road-panel"]{ grid-column:2; grid-row:2; }
  html body .panel-overlay .panel.ts-panel-card .ts-panel > .ts-list-wrap{ grid-column:3; grid-row:1 / span 2; }
  html body .panel-overlay .panel.ts-panel-card .ts-list li{ padding-top:1px; padding-bottom:1px; }
  /* the last 20 coups: a list as long as the session, so it scrolls in its own column once it is
     longer than the window allows; everything else and Close stay in view (Ronan 2026-10-28, as Five
     Card Draw's log, 2026-10-27) */
  html body .panel-overlay .panel.ts-panel-card{ grid-template-rows:auto minmax(0,1fr) auto; }
  html body .panel-overlay .panel.ts-panel-card > .ts-panel{ min-height:0; max-height:100%; overflow:hidden; }
  html body .panel-overlay .panel.ts-panel-card .ts-panel > .ts-list-wrap{ display:flex; flex-direction:column; min-height:0; max-height:100%; align-self:stretch; }
  html body .panel-overlay .panel.ts-panel-card .ts-list-wrap > *{ flex:none; }
  html body .panel-overlay .panel.ts-panel-card .ts-list-wrap > .ts-block.ts-list{ flex:0 1 auto; min-height:0; display:flex; flex-direction:column; }
  html body .panel-overlay .panel.ts-panel-card .ts-list-wrap > .ts-block.ts-list > *{ flex:none; }
  html body .panel-overlay .panel.ts-panel-card .ts-list-wrap > .ts-block.ts-list > ol.ts-list{ flex:0 1 auto; min-height:0; overflow-y:auto; }
  /* Reset Stats and Close on one row under the columns */
  html body .panel-overlay .panel.ts-panel-card{ display:grid; grid-template-columns:auto minmax(0,1fr); column-gap:12px; align-content:start; }
  html body .panel-overlay .panel.ts-panel-card > h2, html body .panel-overlay .panel.ts-panel-card > .ts-panel{ grid-column:1 / -1; }
  html body .panel-overlay .panel.ts-panel-card > .ts-panel-actions{ grid-column:1; margin:8px 0 0; }
  html body .panel-overlay .panel.ts-panel-card > .ts-panel-actions .action{ width:auto; padding-left:22px; padding-right:22px; }
  html body .panel-overlay .panel.ts-panel-card > .panel-close{ grid-column:2; margin-top:8px; }
}
@media (min-width:1000px) and (max-height:619px){
  /* laptop windows: everything under the title flows through four columns (rules, then the tables,
     the keyboard line and the responsible-play note), so no column is left half empty */
  html body #rulesOverlay .panel{ padding-top:12px; display:block; column-count:4; column-gap:22px; }
  html body #rulesOverlay .panel > h2, html body #rulesOverlay .panel > .sub, html body #rulesOverlay .panel > .panel-close{ column-span:all; }
  html body #rulesOverlay .panel .sub{ margin-bottom:6px; }
  html body #rulesOverlay .panel > .rules-list{ column-count:auto; margin-bottom:6px; }
  html body #rulesOverlay .panel > #rulesPaytables{ break-inside:avoid; margin:0 0 6px; }
  html body #rulesOverlay .panel > #rulesPaytables > *{ break-inside:avoid; }
  html body #rulesOverlay .rules-list li{ font-size:13px; margin-bottom:3px; line-height:1.32; }
  html body #rulesOverlay .panel h2{ font-size:22px; }
  html body .panel-overlay .panel.ts-panel-card{ padding-top:10px; }
  html body .panel-overlay .panel.ts-panel-card h2{ margin-bottom:0; }
  html body .panel-overlay .panel.ts-panel-card .ts-panel{ font-size:12.5px; line-height:16px; margin:2px 0; }
  html body .panel-overlay .panel.ts-panel-card .ts-panel-actions{ margin-top:4px; }
}
/* the shortest windows: Reset stats beside the Stats title, saving a row */
@media (min-width:1000px) and (max-height:440px){
  html body .panel-overlay .panel.ts-panel-card{ position:relative; padding-top:6px; }
  html body .panel-overlay .panel.ts-panel-card .ts-panel-actions{ position:absolute; top:8px; right:22px; margin:0; }
  html body .panel-overlay .panel.ts-panel-card .ts-panel-actions .action{ padding:6px 14px; min-height:0; font-size:12px; }
  html body .panel-overlay .panel.ts-panel-card > h2{ font-size:17px; margin:0 0 2px; }
  html body .panel-overlay .panel.ts-panel-card > .panel-close{ padding-top:7px; padding-bottom:7px; margin-top:6px; }
  html body .panel-overlay .panel.ts-panel-card .ts-panel{ font-size:12px; line-height:15px; row-gap:6px; }
}
/* the shortest laptop boxes (1054x652 with a side panel, 1280x580): Chemin de Fer's long rules close up */
@media (min-width:1000px) and (max-height:560px){
  html body #rulesOverlay .rules-list li{ font-size:12.5px; line-height:1.28; margin-bottom:2px; }
  html body #rulesOverlay .panel > h2{ font-size:20px; margin:0; }
  html body #rulesOverlay .panel .sub{ margin-bottom:4px; }
  html body #rulesOverlay .rules-kbd{ font-size:11.5px; }
  html body #rulesOverlay .rules-rg{ font-size:11px; line-height:1.3; }
}
/* the 400px floor: four flowing columns would spill sideways out of sight, so the rules go back to
   columns inside the list with the tables beside them, and only the text scrolls (allowed under
   581px, Ronan 2026-10-27), Close pinned */
@media (min-width:1000px) and (max-height:440px){
  html body #rulesOverlay .panel{ display:grid; column-count:auto; padding-top:8px; }
  html body #rulesOverlay .panel > .rules-list{ column-count:3; column-gap:22px; }
  html body #rulesOverlay .panel > #rulesPaytables{ margin:0; }
}
@media (min-width:1000px) and (max-height:480px){
  html body #rulesOverlay .panel{ padding-bottom:10px; }
  html body #rulesOverlay .panel > .panel-close{ padding-top:7px; padding-bottom:7px; }
}
/* the shortest windows (1280x580 and below): Punto Banco, Mini and No-Commission's results history
   moves into a column of its own instead of under the last coup, where it was cut off */
@media (min-width:1000px) and (max-height:480px){
  html body .panel-overlay .panel.ts-panel-card .ts-panel:has(> [class*="-road-panel"]){ grid-template-columns:minmax(0,.9fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.3fr); column-gap:20px; }
  html body .panel-overlay .panel.ts-panel-card .ts-panel:has(> [class*="-road-panel"]) > [class*="-road-panel"]{ grid-column:3; grid-row:1 / span 2; }
  html body .panel-overlay .panel.ts-panel-card .ts-panel:has(> [class*="-road-panel"]) > .ts-list-wrap{ grid-column:4; }
}
