/* =========================
   Manito Golf Games — Optimized CSS
   Version: 2.0
   Last Updated: November 13, 2025
   
   Features:
   - CSS custom properties for maintainability
   - Consolidated game table components
   - Simplified light theme
   - Responsive design with iOS optimizations
   ========================= */

/* ---- CSS Custom Properties ---- */
:root {
  /* Theme colors (dark default) — based on Bootswatch Darkly */
  --bg: #1b1f24;
  --panel: #2a3038;
  --panel-alt: #343d47;
  --ink: #ffffff;
  --muted: #adb5bd;
  --accent: #00bc8c;
  --line: #556170;
  --warn: #f39c12;
  --danger: #e74c3c;
  --shadow: rgba(0, 0, 0, .45);
  
  /* Spacing tokens */
  --space-xs: 6px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  
  /* Border radius tokens */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-2xl: 14px;
  --radius-3xl: 16px;
  
  /* Touch target sizes (iOS optimized). Scale up with --font-grow so buttons
     accommodate larger labels without clipping their content. */
  --touch-min: calc(44px + var(--font-grow));
  --touch-comfortable: calc(48px + var(--font-grow));
  
  /* Z-index layers */
  --z-sticky-col: 30;
  --z-sticky-header: 3;
  --z-sticky-corner: 4;
  --z-sticky-first-col: 5;
  --z-shadow: 6;
  --z-dropdown: 10;
  
  /* Transitions */
  --transition-fast: 0.2s;
  --transition-normal: 0.25s;
  --transition-slow: 0.3s;
  
  /* Font sizes (responsive clamp). Each token includes --font-size-step so
     the small/medium/large user setting scales typography globally. */
  --font-size-step: 0px;
  --text-xs: calc(11px + var(--font-size-step));
  --text-sm: calc(12px + var(--font-size-step));
  --text-base: calc(13px + var(--font-size-step));
  --text-md: calc(14px + var(--font-size-step));
  --text-lg: calc(15px + var(--font-size-step));
  --text-xl: calc(16px + var(--font-size-step));
  --text-2xl: calc(18px + var(--font-size-step));
  --text-3xl: clamp(calc(18px + var(--font-size-step)), 3.5vw, calc(28px + var(--font-size-step)));

  /* Unified app font stack */
  --font-ui: "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

    /* Font scaling controls
      Medium (default): descriptive +1px, data/non-descriptive +3px */
    --font-descriptive-adjust: 1px;
    --font-data-adjust: 3px;
    /* Container/button growth tied to font scaling so larger fonts get a
       proportionally taller box and don't clip. ~1.5× the font step keeps
       things balanced (small: -1.5px, large: +7.5px). */
    --font-grow: calc(var(--font-size-step) * 1.5);

  /* Scorecard typography tokens (--text-base/--text-xl already include --font-size-step) */
  --scorecard-header-font-size: calc(var(--text-base) + var(--font-data-adjust));
  --scorecard-data-font-size: calc(var(--text-xl) + var(--font-data-adjust));
  --scorecard-name-font-size: var(--scorecard-data-font-size);
  
  /* Table dimensions */
  --table-cell-width: 48px;
  --table-input-width: 44px;
  --table-ch-width: 60px;
  --games-launcher-gap: 6px;
  --score-header-height-scale: 1.1;
  --score-sticky-head-top: 0px;
  --game-header-height-scale: 1.1;
  --game-sticky-head-top: 0px;
  --score-sticky-par-top: 39px;
  --score-sticky-hcp-top: 100px;
  --footer-action-h-desktop: 53px;
  --footer-action-h-mobile: 48px;
  --footer-action-h: var(--footer-action-h-desktop);
  --app-dvh: 100dvh;
  --footer-bottom-offset: 0px;
  --safe-bottom-inset: 0px;
  --footer-row-bottom-clearance: 8px;
  --safe-top-dynamic: 0px;
  --safe-top-inset: var(--safe-top-dynamic);
}

/* In standalone/PWA mode, bootstrap a conservative safe-area default so the
   first CSS paint does not clip under the status bar before JS measures.
   JS (syncSafeTopInset) will overwrite --safe-top-dynamic with the exact px. */
html.ios-pwa-mode {
  --safe-top-dynamic: 20px;
  /* env() falls back to the static 24/20 values for non-home-indicator devices
     (iPhone 8 Plus / SE), and scales up on Pro / Max devices where the home
     indicator is ~34px tall. The packaged WKWebView extends edge-to-edge with
     contentInsetAdjustmentBehavior = .never, so without env() the footer rows
     land directly on the home indicator. */
  --safe-bottom-inset: max(24px, env(safe-area-inset-bottom, 0px));
  --footer-row-bottom-clearance: max(20px, calc(env(safe-area-inset-bottom, 0px) + 12px));
}

/* Standalone PWA: ensure fixed footer shells reach the actual screen bottom.
   Anchor explicitly to bottom:0, give the panel-alt background enough
   padding-bottom to fill into the home-indicator safe area, and pin html/body
   to the dynamic viewport so iOS doesn't shrink the layout viewport. */
html.ios-pwa-mode,
html.ios-pwa-mode body {
  height: var(--app-dvh, 100dvh);
  min-height: var(--app-dvh, 100dvh);
}

html.ios-pwa-mode .scorecard-controls-shell,
html.ios-pwa-mode .games-controls-shell {
  /* Hard-pin to the physical bottom in iOS PWA mode so JS viewport-math
     errors during transitions never cause the shell to float. */
  bottom: 0 !important;
  padding-bottom: 0;
  box-shadow: 0 20px 0 0 var(--panel-alt);
}

:root[data-font-size="small"] {
  --font-size-step: -3px;
  --font-descriptive-adjust: 0px;
  --font-data-adjust: 1px;
}

:root[data-font-size="medium"] {
  --font-size-step: 0px;
  --font-descriptive-adjust: 1px;
  --font-data-adjust: 3px;
}

:root[data-font-size="large"] {
  --font-size-step: 8px;
  --font-descriptive-adjust: 2px;
  --font-data-adjust: 6px;
}

/* On desktop, small and medium settings use noticeably smaller base sizes */
@media (min-width: 900px) {
  :root[data-font-size="small"] {
    --font-size-step: -5px;
  }

  :root[data-font-size="medium"] {
    --font-size-step: 0px;
  }

  :root[data-font-size="large"] {
    --font-size-step: 9px;
  }
}.btn,
  .cloud-code-badge-btn,
  .entry-switcher-btn,
  .game-toggle,
  .font-size-btn,
  .scorecard-add-player-btn,
  .game-options-toggle {
  min-height: calc(var(--btn-base-h, 40px) + var(--font-grow));
}

#scorecard input,
.score-input,
.ch-input {
  min-height: calc(30px + var(--font-grow));
}

/* ---- Base / Resets ---- */
* {
  box-sizing: border-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Re-enable text selection for inputs and editable content */
input, textarea, [contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}

html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}/* Screen reader only utility class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Prevent iOS zoom on input focus — must be 16px or larger */
input, select, textarea {
  font-size: max(16px, 1em);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  background-color: var(--bg);
  color: var(--ink);
  color-scheme: dark;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  /* NOTE: Do NOT add padding-bottom: env(safe-area-inset-bottom) here — the
     fixed footer shells (.scorecard-controls-shell / .games-controls-shell)
     own the bottom safe-area. Body padding-bottom can cause iOS standalone
     PWAs to anchor fixed children above the home indicator, leaving a gap. */
  padding: var(--safe-top-inset) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--safe-top-inset);
  background: var(--bg);
  pointer-events: none;
  z-index: 30;
}

/* Ensure status-bar region is filled on iOS (WebKit) and Android Chrome */
@supports (-webkit-touch-callout: none) {
  html,
  body {
    background-color: var(--bg);
  }
}

@media (display-mode: standalone) {
  html,
  body {
    background-color: var(--bg);
  }
}

/* ---- Global font scaling ---- */
/* Descriptive text: +1px at medium */
.small,
.note,
.meta,
.pill,
.warn,
.control label,
.junk-ach-labels,
#saveStatus,
#playerCountDisplay {
  font-size: calc(var(--text-sm) + var(--font-descriptive-adjust));
}

h1 {
  font-size: calc(var(--text-3xl) + var(--font-descriptive-adjust));
}

.small {
  font-size: calc(var(--text-xs) + var(--font-descriptive-adjust));
}

.control label {
  font-size: calc(var(--text-base) + var(--font-descriptive-adjust));
}

/* Data / non-descriptive text: +3px at medium */
th,
td,
.btn,
.theme-toggle,
.game-toggle,
.name-edit,
.score-input,
.ch-input,
.par-row input,
.hcp-row input,
select,
input[type="number"],
input[type="text"] {
  font-size: calc(var(--text-base) + var(--font-data-adjust));
}

.btn,
.theme-toggle,
.game-toggle {
  font-size: calc(var(--text-lg) + var(--font-data-adjust));
}

.name-edit {
  font-size: calc(var(--text-md) + var(--font-data-adjust));
}

.score-input,
.ch-input,
.par-row input,
.hcp-row input,
input[type="number"],
input[type="text"] {
  font-size: calc(var(--text-xl) + var(--font-data-adjust));
}

/* Game tables: enforce font scaling on every cell, input, and inner element.
   Uses class selectors so it covers all six tables:
     .banker-table  -> #bankerTable, #wolfTable
     .vegas-table   -> #vegasTable, #hiloTable
     .skins-table   -> #skinsTable
     .junk-table    -> #junkTable
   Universal descendant selector (* ) makes sure spans, labels, small,
   strong, b, em, a, p, etc. inside cells also resize. !important is
   required because some inputs have a more specific id+attribute rule
   (e.g. input[type="number"]) that would otherwise win the cascade. */
.banker-table,
.vegas-table,
.skins-table,
.junk-table,
.live-results-table,
.banker-header-totals-table,
.banker-table *,
.vegas-table *,
.skins-table *,
.junk-table *,
.live-results-table *,
.banker-header-totals-table * {
  font-size: calc(12px + var(--font-data-adjust) + var(--font-size-step)) !important;
}

/* =============================================================================
   Visual Refresh
   Modern app-style finish with richer surfaces and stronger mobile framing.
   ============================================================================= */
:root {
  --bg: #07141f;
  --panel: rgba(13, 26, 39, 0.9);
  --panel-alt: rgba(18, 36, 54, 0.94);
  --ink: #eff8ff;
  --muted: #93a9bb;
  --accent: #33d1c6;
  --line: rgba(143, 170, 192, 0.22);
  --warn: #ffbf69;
  --danger: #ff6b6b;
  --shadow: rgba(2, 12, 22, 0.42);
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-3xl: 28px;
  --mobile-page-gutter: 8px;
  --mobile-results-inset: 9px;
  --mobile-card-radius: 22px;
  --mobile-dock-radius: 30px;
  --mobile-surface-shadow: 0 18px 36px -24px rgba(0, 0, 0, 0.78);
  --mobile-surface-shadow-light: 0 18px 36px -24px rgba(53, 84, 112, 0.24);
  --mobile-dock-shadow: 0 18px 44px -26px rgba(0, 0, 0, 0.72);
  --game-menu-inset: 12px;
  --game-menu-mobile-inset: 10px;
  --game-menu-radius: 24px;
  --game-menu-control-radius: 20px;
  --game-menu-chip-radius: 18px;
}
/* =========================================================================
   Repeated-color tokens (Tier 1B / P3 from refactor plan).
   Each captures an rgba() value that was repeated 7-21+ times across the
   stylesheet. Theme-agnostic — applies to both dark and light. Add new ones
   here, never invent a fresh rgba() literal inline.
   ========================================================================= */
:root {
  --line-soft:    rgba(136, 165, 191, 0.24);  /* 21× — neutral border tint */
  --line-medium:  rgba(96, 133, 163, 0.34);   /* 17× — stronger border tint */
  --line-warm:    rgba(112, 148, 178, 0.3);   /* 10× — warm-light border  */
  --line-mute:    rgba(136, 165, 191, 0.26);  /* 10× — softer border tint */
  --line-cool:    rgba(136, 165, 191, 0.28);  /*  8× — slightly stronger  */
  --line-haze:    rgba(151, 185, 210, 0.16);  /*  8× — very faint outline */
  --line-base:    rgba(128, 153, 178, 0.2);   /*  8× — pure neutral 20%   */

  --shadow-deep:  rgba(0, 0, 0, 0.72);        /* 11× — heavy drop shadow */
  --shadow-navy:  rgba(21, 32, 43, 0.2);      /* 10× — tinted dim shadow */
  --shadow-tint:  rgba(36, 71, 102, 0.2);     /*  8× — light theme shadow */

  --hi-thin:      rgba(255, 255, 255, 0.03);  /* 12× — barely-there gloss */
  --hi-faint:     rgba(255, 255, 255, 0.05);  /*  8× — faint gloss layer */
  --hi-soft:      rgba(255, 255, 255, 0.08);  /*  7× — gentle gloss      */
  --hi-medium:    rgba(255, 255, 255, 0.24);  /*  8× — medium overlay    */
  --hi-strong:    rgba(255, 255, 255, 0.94);  /*  7× — nearly opaque white */
  --hi-bright:    rgba(255, 255, 255, 0.96);  /*  9× — almost solid white */

  --accent-btn-bg:   rgba(20, 93, 171, 0.78);  /* 8× — accent button bg  */
  --accent-glow:     rgba(35, 132, 220, 0.24); /* 7× — accent focus ring */

  --surface-l1:   rgba(242, 247, 252, 0.98);  /* 8× — light card surface */
  --surface-l2:   rgba(230, 239, 248, 0.96);  /* 8× — light card surface (alt) */
  --surface-d1:   rgba(27, 47, 66, 0.96);     /* 7× — dark card surface */
  --surface-d2:   rgba(16, 31, 46, 0.94);     /* 7× — dark card surface (alt) */
}

body {
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at top left, rgba(51, 209, 198, 0.16), transparent 32%),
    radial-gradient(circle at top right, rgba(78, 140, 255, 0.18), transparent 36%),
    linear-gradient(180deg, #0b1a29 0%, #07141f 54%, #05111a 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 16%, rgba(255, 255, 255, 0.06), transparent 18%),
    radial-gradient(circle at 78% 10%, rgba(51, 209, 198, 0.09), transparent 16%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 28%);
  z-index: 0;
}

.top-pinned-shell,
.sticky-nav-bar,
.scorecard-controls-shell,
.games-controls-shell {
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.top-pinned-shell,
.sticky-nav-bar {
  background: linear-gradient(180deg, rgba(7, 20, 31, 0.96), rgba(7, 20, 31, 0.82));
  border-bottom: 1px solid rgba(147, 169, 187, 0.12);
}
.header-inner {
  padding: 0 2px 0;
  gap: 0;
}

h1 {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.control,
.utilities-section,
.cloud-control,
.scorecard-container,
.game-section,
#gameTotalsCard.game-totals-card,
.entry-switcher,
.scorecard-card-footer,
.games-card-footer {
  box-shadow: 0 18px 36px -24px var(--shadow);
}

.control,
.utilities-section,
.cloud-control {
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border-color: color-mix(in srgb, var(--line) 84%, transparent);
}

.btn,
.theme-toggle,
.game-toggle,
.entry-switcher-btn,
.hcp-mode-btn,
.cloud-code-badge-btn,
.cloud-status-badge,
.game-totals-tab,
.scorecard-add-player-btn,
.scorecard-theme-toggle,
.scorecard-main-options-icon,
.scorecard-clear-actions-toggle {
  border-radius: 18px;
  transition: transform 0.16s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn,
.theme-toggle,
.cloud-code-badge-btn,
.game-totals-tab,
.scorecard-add-player-btn,
.scorecard-theme-toggle,
.scorecard-main-options-icon,
.scorecard-clear-actions-toggle {
  border-color: rgba(151, 185, 210, 0.2);
  background: linear-gradient(180deg, var(--hi-soft), var(--hi-thin));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 22px -18px rgba(0, 0, 0, 0.8);
}

.btn:hover,
.theme-toggle:hover,
.cloud-code-badge-btn:hover,
.game-totals-tab:hover,
.scorecard-add-player-btn:hover,
.scorecard-theme-toggle:hover,
.scorecard-main-options-icon:hover,
.scorecard-clear-actions-toggle:hover,
.game-toggle:hover,
.entry-switcher-btn:hover,
.hcp-mode-btn:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 var(--hi-soft), 0 16px 28px -20px rgba(0, 0, 0, 0.85);
}

.font-size-btn.active,
.hcp-mode-btn[data-active="true"],
.entry-switcher-btn.active,
.game-toggle.active,
.game-totals-tab.is-active {
  background: linear-gradient(135deg, rgba(78, 140, 255, 0.28), rgba(51, 209, 198, 0.26));
  border-color: rgba(106, 201, 255, 0.66);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 18px 30px -22px rgba(51, 209, 198, 0.65);
}#cloudSnapshotsToggle,
  #cloudCreateBtn,
  .cloud-control-compact .btn,
  .cloud-status-badge,
  .cloud-code-badge-btn {
  border-color: rgba(151, 185, 210, 0.2);
  background: linear-gradient(180deg, var(--hi-soft), var(--hi-thin));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 22px -18px rgba(0, 0, 0, 0.8);
  color: var(--ink);
}#cloudSnapshotsToggle:hover,
  #cloudCreateBtn:hover,
  .cloud-control-compact .btn:hover,
  .cloud-status-badge:hover,
  .cloud-code-badge-btn:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 var(--hi-soft), 0 16px 28px -20px rgba(0, 0, 0, 0.85);
}

/* Preserve semantic status color, but in the same visual style. */
.cloud-status-badge[data-live="true"] {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
}
.entry-switcher {
  background: linear-gradient(180deg, rgba(18, 36, 54, 0.9), rgba(13, 26, 39, 0.88));
  border-color: var(--line-haze);
  box-shadow: 0 16px 28px -22px rgba(2, 12, 22, 0.8);
}
.scorecard-container {
  background: linear-gradient(180deg, rgba(18, 36, 54, 0.96), rgba(12, 24, 36, 0.96));
  border-color: rgba(151, 185, 210, 0.18);
  box-shadow: 0 24px 50px -36px rgba(0, 0, 0, 0.9);
}
.scorecard-controls-shell,
.games-controls-shell {
  /* Fully opaque so the panel's textured-stripe gutters
     (rendered via #gamesEntryPanel::before/::after at z-index:0) don't bleed
     through and make the footer rows look like they live on different surfaces. */
  background: linear-gradient(180deg, rgb(18, 36, 54), rgb(10, 22, 34));
  border-top-color: rgba(151, 185, 210, 0.14);
  box-shadow: 0 -18px 40px -28px rgba(0, 0, 0, 0.85);
}
.game-section {
  background: linear-gradient(180deg, rgba(18, 36, 54, 0.94), rgba(11, 24, 37, 0.94));
  border-top-color: var(--line-haze);
  border-bottom-color: var(--line-haze);
}
#gameTotalsCard.game-totals-card {
  border-color: var(--line-haze);
  background: linear-gradient(180deg, rgba(19, 39, 57, 0.98), rgba(13, 26, 39, 0.96));
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.82);
}

#gameTotalsCard.game-totals-card.is-collapsed {
  border-width: 1px;
  border-style: solid;
  border-radius: 18px;
  margin-bottom: 0;
}

#gameTotalsCard.game-totals-card.is-collapsed .game-totals-toggle {
  border-radius: inherit;
}
/* Main games-view result cards share the refreshed Game Totals language. */
.live-results-card,
.banker-header-totals,
.vegas-rotation-breakdown {
  border-color: rgba(151, 185, 210, 0.18);
  background: linear-gradient(180deg, rgba(19, 39, 57, 0.98), rgba(13, 26, 39, 0.96));
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.82);
}
.results-collapse-bar {
  border-color: rgba(151, 185, 210, 0.18);
  background: linear-gradient(180deg, rgba(19, 39, 57, 0.98), rgba(13, 26, 39, 0.96));
  box-shadow: 0 14px 28px -24px rgba(0, 0, 0, 0.68);
}
.results-collapse-bar:hover {
  background: linear-gradient(180deg, rgba(27, 52, 74, 0.98), rgba(18, 36, 54, 0.96));
}
.live-results-table th,
.live-results-table td,
.banker-header-totals-table th,
.banker-header-totals-table td {
  border-bottom-color: var(--line-haze);
}
.live-results-title-row th,
.banker-header-title-row th {
  background: var(--panel-alt) !important;
  color: var(--ink) !important;
}.live-results-label {
  background: transparent;
  box-shadow: 2px 0 0 0 var(--line-haze);
}root[data-theme="light"] .live-results-label {
  box-shadow: 2px 0 0 0 rgba(136, 165, 191, 0.18);
}

.live-results-data-row td,
.banker-header-data-row td {
  background: transparent;
}

.banker-header-totals-table tr:first-child th,
.banker-header-totals-table tr:first-child td {
  background: var(--panel-alt) !important;
  color: var(--ink) !important;
}

.banker-header-totals-table tr:nth-child(n+2) th,
.banker-header-totals-table tr:nth-child(n+2) td {
  background: transparent !important;
}

/* Strictly scope first visible DATA row coloring to game totals cards only.
   Hi-Lo is excluded: its thead has the column headers so tbody row 1 is real data. */
#vegasResultsWrap .live-results-table .live-results-title-row + .live-results-data-row th,
#vegasResultsWrap .live-results-table .live-results-title-row + .live-results-data-row td,
#vegasResultsWrap .live-results-table .live-results-data-row:first-child th,
#vegasResultsWrap .live-results-table .live-results-data-row:first-child td,
#junkResultsWrap .live-results-table .live-results-title-row + .live-results-data-row th,
#junkResultsWrap .live-results-table .live-results-title-row + .live-results-data-row td,
#junkResultsWrap .live-results-table .live-results-data-row:first-child th,
#junkResultsWrap .live-results-table .live-results-data-row:first-child td,
#wolfResultsWrap .live-results-table .live-results-title-row + .live-results-data-row th,
#wolfResultsWrap .live-results-table .live-results-title-row + .live-results-data-row td,
#wolfResultsWrap .live-results-table .live-results-data-row:first-child th,
#wolfResultsWrap .live-results-table .live-results-data-row:first-child td,
#bankerResultsWrap .banker-header-totals-table .banker-header-title-row + .banker-header-data-row th,
#bankerResultsWrap .banker-header-totals-table .banker-header-title-row + .banker-header-data-row td,
#bankerResultsWrap .banker-header-totals-table .banker-header-data-row:first-child th,
#bankerResultsWrap .banker-header-totals-table .banker-header-data-row:first-child td {
  background: var(--panel-alt) !important;
  color: var(--ink) !important;
}

/* Hi-Lo: thead column-header row gets the same grey; tbody rows stay transparent */
#hiloResultsWrap .live-results-table thead .live-results-data-row th,
#hiloResultsWrap .live-results-table thead .live-results-data-row td {
  background: var(--panel-alt) !important;
  color: var(--ink) !important;
}
#hiloResultsWrap .live-results-table tbody .live-results-data-row th,
#hiloResultsWrap .live-results-table tbody .live-results-data-row td {
  background: transparent !important;
}

#vegasResultsWrap .live-results-table .live-results-title-row + .live-results-data-row ~ .live-results-data-row th,
#vegasResultsWrap .live-results-table .live-results-title-row + .live-results-data-row ~ .live-results-data-row td,
#vegasResultsWrap .live-results-table .live-results-data-row:first-child ~ .live-results-data-row th,
#vegasResultsWrap .live-results-table .live-results-data-row:first-child ~ .live-results-data-row td,
#junkResultsWrap .live-results-table .live-results-title-row + .live-results-data-row ~ .live-results-data-row th,
#junkResultsWrap .live-results-table .live-results-title-row + .live-results-data-row ~ .live-results-data-row td,
#junkResultsWrap .live-results-table .live-results-data-row:first-child ~ .live-results-data-row th,
#junkResultsWrap .live-results-table .live-results-data-row:first-child ~ .live-results-data-row td,
#wolfResultsWrap .live-results-table .live-results-title-row + .live-results-data-row ~ .live-results-data-row th,
#wolfResultsWrap .live-results-table .live-results-title-row + .live-results-data-row ~ .live-results-data-row td,
#wolfResultsWrap .live-results-table .live-results-data-row:first-child ~ .live-results-data-row th,
#wolfResultsWrap .live-results-table .live-results-data-row:first-child ~ .live-results-data-row td,
#bankerResultsWrap .banker-header-totals-table .banker-header-title-row + .banker-header-data-row ~ .banker-header-data-row th,
#bankerResultsWrap .banker-header-totals-table .banker-header-title-row + .banker-header-data-row ~ .banker-header-data-row td,
#bankerResultsWrap .banker-header-totals-table .banker-header-data-row:first-child ~ .banker-header-data-row th,
#bankerResultsWrap .banker-header-totals-table .banker-header-data-row:first-child ~ .banker-header-data-row td {
  background: transparent !important;
}

.results-card-wrap:not(.is-collapsed) .live-results-card,
.results-card-wrap:not(.is-collapsed) .banker-header-totals {
  box-shadow: 0 18px 36px -28px rgba(0, 0, 0, 0.82);
}

@media (max-width: 768px) {
  .live-results-card,
  .banker-header-totals,
  .vegas-rotation-breakdown,
  .results-collapse-bar {
    border-radius: var(--mobile-card-radius);
  }

  .results-card-wrap:not(.is-collapsed) .live-results-card,
  .results-card-wrap:not(.is-collapsed) .banker-header-totals {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }

  .results-card-wrap.is-collapsed .results-collapse-bar {
    border-radius: var(--mobile-card-radius);
  }

  .live-results-table th,
  .live-results-table td,
  .banker-header-totals-table th,
  .banker-header-totals-table td {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  body.mode-games #bankerSection[aria-hidden="false"] #bankerResultsWrap,
  body.mode-games #vegasSection[aria-hidden="false"] #vegasResultsWrap,
  body.mode-games #hiloSection[aria-hidden="false"] #hiloResultsWrap,
  body.mode-games #junkSection[aria-hidden="false"] #junkResultsWrap,
  body.mode-games #wolfSection[aria-hidden="false"] #wolfResultsWrap {
    left: var(--mobile-results-inset);
    right: var(--mobile-results-inset);
    bottom: calc(var(--games-footer-h, 126px) + var(--footer-bottom-offset, 0px) + 12px);
  }

  body.mode-games #bankerSection[aria-hidden="false"] #bankerResultsWrap .banker-header-totals,
  body.mode-games #vegasSection[aria-hidden="false"] #vegasResultsWrap .live-results-card,
  body.mode-games #hiloSection[aria-hidden="false"] #hiloResultsWrap .live-results-card,
  body.mode-games #junkSection[aria-hidden="false"] #junkResultsWrap .live-results-card,
  body.mode-games #wolfSection[aria-hidden="false"] #wolfResultsWrap .live-results-card {
    border-left: 1px solid var(--line-soft);
    border-right: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    border-radius: 0 0 var(--mobile-card-radius) var(--mobile-card-radius);
    overflow: hidden;
  }

  body.mode-games #bankerSection[aria-hidden="false"] #bankerResultsWrap.is-collapsed .results-collapse-bar,
  body.mode-games #vegasSection[aria-hidden="false"] #vegasResultsWrap.is-collapsed .results-collapse-bar,
  body.mode-games #hiloSection[aria-hidden="false"] #hiloResultsWrap.is-collapsed .results-collapse-bar,
  body.mode-games #junkSection[aria-hidden="false"] #junkResultsWrap.is-collapsed .results-collapse-bar,
  body.mode-games #wolfSection[aria-hidden="false"] #wolfResultsWrap.is-collapsed .results-collapse-bar {
    border-left: 1px solid var(--line-soft);
    border-right: 1px solid var(--line-soft);
    border-radius: var(--mobile-card-radius);
  }

  .results-card-wrap {
    gap: 0;
  }

  .results-collapse-bar {
    min-height: 50px;
    padding: 10px 14px;
    border-radius: var(--mobile-card-radius) var(--mobile-card-radius) 0 0;
    font-size: 14px;
    letter-spacing: 0.01em;
  }

  .results-collapse-label {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 12px;
    color: #5d7387;
  }

  .results-collapse-chevron::before,
  .results-card-wrap.is-collapsed .results-collapse-chevron::before {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.8;
    color: #4a6177;
  }

  .results-card-wrap:not(.is-collapsed) .live-results-card,
  .results-card-wrap:not(.is-collapsed) .banker-header-totals {
    box-shadow: var(--mobile-surface-shadow-light);
  }
}

@media (max-width: 768px) {
  :root:not([data-theme="light"]) #gameTotalsCard.game-totals-card,
  :root:not([data-theme="light"]) .live-results-card,
  :root:not([data-theme="light"]) .banker-header-totals,
  :root:not([data-theme="light"]) .vegas-rotation-breakdown,
  :root:not([data-theme="light"]) .results-collapse-bar {
    background: linear-gradient(180deg, rgba(22, 39, 55, 0.98), rgba(11, 24, 36, 0.96));
    border-color: var(--line-medium);
    box-shadow: var(--mobile-surface-shadow);
  }

  :root:not([data-theme="light"]) .results-collapse-bar:hover {
    background: linear-gradient(180deg, rgba(29, 52, 73, 0.98), rgba(16, 33, 49, 0.96));
  }

  :root:not([data-theme="light"]) .results-collapse-label {
    color: #93a9bb;
  }

  :root:not([data-theme="light"]) .results-collapse-chevron::before,
  :root:not([data-theme="light"]) .results-card-wrap.is-collapsed .results-collapse-chevron::before,
  :root:not([data-theme="light"]) .game-totals-toggle-state {
    color: #c7d7e4;
  }

  :root:not([data-theme="light"]) .live-results-data-row td,
  :root:not([data-theme="light"]) .banker-header-data-row td {
    background: rgba(255, 255, 255, 0.02);
  }

  :root:not([data-theme="light"]) .scorecard-add-player-btn,
  :root:not([data-theme="light"]) .scorecard-footer-controls > .btn#scorecardOptionsToggle,
  :root:not([data-theme="light"]) .scorecard-footer-controls > .game-options-toggle#scorecardOptionsToggle,
  :root:not([data-theme="light"]) .scorecard-footer-controls > .scorecard-theme-toggle,
  :root:not([data-theme="light"]) .scorecard-footer-controls > .scorecard-main-options-icon,
  :root:not([data-theme="light"]) .scorecard-footer-controls > .scorecard-clear-actions-toggle,
  :root:not([data-theme="light"]) .game-totals-tab,
  :root:not([data-theme="light"]) .footer-entry-switcher .entry-switcher-btn {
    background: linear-gradient(180deg, var(--surface-d1), var(--surface-d2));
    border-color: var(--line-medium);
    color: #e5f1fb;
    box-shadow: inset 0 1px 0 var(--hi-faint), 0 12px 24px -20px rgba(0, 0, 0, 0.78);
  }

  :root:not([data-theme="light"]) .game-totals-tab.is-active,
  :root:not([data-theme="light"]) .footer-entry-switcher .entry-switcher-btn.active {
    background: linear-gradient(180deg, #2384dc, #176dc6);
    border-color: var(--accent-btn-bg);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 16px 28px -22px rgba(20, 93, 171, 0.45);
  }

  :root:not([data-theme="light"]) .footer-entry-switcher {
    background: linear-gradient(180deg, rgba(17, 32, 46, 0.72), rgba(12, 24, 36, 0.44));
    border-top-color: rgba(96, 133, 163, 0.24);
  }
}

.game-totals-toggle,
.game-totals-body,
.footer-entry-switcher,
.scorecard-card-footer,
.games-card-footer {
  background: transparent;
}

@media (max-width: 768px) {
  .header-inner {
    padding: 3.6px 5px 1.6px;
    gap: 0;
  }

  .header-collapse-bar,
  .header-cloud-scroll-indicator {
    margin-left: var(--mobile-page-gutter);
    margin-right: var(--mobile-page-gutter);
  }

  .view-mode-banner,
  .entry-switcher,
  .games-launcher-shell,
  .game-section,
  .scorecard-container {
    margin-left: var(--mobile-page-gutter);
    margin-right: var(--mobile-page-gutter);
  }

  .entry-switcher {
    padding: 5px;
    border-width: 1px;
  }

  .entry-switcher-btn,
  .game-toggle,
  .header-collapse-bar .cloud-status-badge,
  .header-collapse-bar .cloud-code-badge-btn,
  .btn,
  .theme-toggle {
    font-size: calc(15px + var(--font-data-adjust));
  }

  .scorecard-container {
    width: auto;
    border-radius: 24px;
    border-width: 1px;
    border-bottom-width: 1px;
    margin-top: 10px;
  }

  /* Score mode should attach directly under the cloud bar with no extra gap. */
  body.mode-score .scorecard-container {
    margin-top: 0;
  }

  .game-section {
    border: 1px solid var(--line-haze);
    border-radius: var(--mobile-card-radius);
    padding-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 20px 38px -28px rgba(0, 0, 0, 0.86);
  }

  .scorecard-controls-shell,
  .games-controls-shell {
    border: 1px solid var(--line-haze);
    overflow: hidden;
  }

  /* Game Totals card is positioned upward above the score footer shell; keep
     overflow visible in score mode so the card is not clipped off-screen. */
  body.mode-score .scorecard-controls-shell:has(#gameTotalsCard:not([hidden])) {
    overflow: visible;
  }

  .footer-entry-switcher {
    border-top: 1px solid rgba(151, 185, 210, 0.12);
    padding: 6px 8px max(var(--footer-row-bottom-clearance), 10px);
  }

  .scorecard-card-footer,
  .games-card-footer {
    padding-left: var(--mobile-page-gutter);
    padding-right: var(--mobile-page-gutter);
  }

  .scorecard-add-player-btn {
    border-radius: 16px;
  }
}

/* Bottom dock refinement: cleaner hierarchy for the mobile action rows.
   Footer shell is edge-to-edge — the previous --mobile-page-gutter outer
   inset (and the 18px floating-dock radius/lift) showed dark page bg in
   the left/right margins, breaking the bottom bar's visual continuity.
   Buttons keep their original x-coordinates because the gutter moves
   inward as padding-left/right on the shell. */
@media (max-width: 768px) {
  .scorecard-controls-shell,
  .games-controls-shell {
    left: 0;
    right: 0;
    bottom: var(--footer-bottom-offset, 0px);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-color: rgba(136, 165, 191, 0.22);
    box-shadow: var(--mobile-dock-shadow);
    padding-left: var(--mobile-page-gutter);
    padding-right: var(--mobile-page-gutter);
  }

  .scorecard-controls-shell:has(#gameTotalsCard:not([hidden])) {
    border-top-color: transparent;
  }

  .scorecard-card-footer,
  .games-card-footer {
    padding: 8px 10px 4px;
    min-height: 58px;
    gap: 8px;
  }

  .scorecard-footer-controls {
    grid-template-columns: minmax(78px, auto) minmax(0, 1fr) repeat(3, 44px);
    gap: 8px;
  }

  .scorecard-footer-controls > .btn,
  .scorecard-footer-controls > .scorecard-theme-toggle,
  .scorecard-footer-controls > .scorecard-main-options-icon,
  .scorecard-footer-controls > .scorecard-clear-actions-toggle {
    height: 44px !important;
    min-height: 44px !important;
  }

  .scorecard-add-player-btn {
    min-width: 78px !important;
    width: 78px !important;
    justify-content: center;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em;
    padding: 0 8px !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 247, 255, 0.86));
    color: #16334d;
    border-color: rgba(116, 149, 176, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 12px 22px -18px rgba(36, 71, 102, 0.34);
  }

  .scorecard-footer-controls > .btn#scorecardOptionsToggle,
  .scorecard-footer-controls > .game-options-toggle#scorecardOptionsToggle {
    border-radius: 16px;
    justify-content: center;
    padding: 0 10px;
    font-size: 13px !important;
    font-weight: 700 !important;
    white-space: normal;
    line-height: 1.05;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 255, 0.92));
    color: #12283d;
    border-color: rgba(106, 140, 168, 0.28);
    box-shadow: inset 0 1px 0 var(--hi-bright), 0 14px 24px -20px rgba(36, 71, 102, 0.38);
  }

  .scorecard-footer-controls > .scorecard-theme-toggle,
  .scorecard-footer-controls > .scorecard-main-options-icon,
  .scorecard-footer-controls > .scorecard-clear-actions-toggle {
    min-width: 44px !important;
    width: 44px !important;
    border-radius: 15px;
    background: linear-gradient(180deg, var(--hi-bright), rgba(242, 248, 255, 0.9));
    border-color: rgba(116, 149, 176, 0.24);
    color: #173149;
    box-shadow: inset 0 1px 0 var(--hi-strong), 0 12px 20px -18px rgba(36, 71, 102, 0.32);
  }

  .scorecard-footer-controls > .scorecard-theme-toggle,
  .scorecard-footer-controls > .scorecard-main-options-icon,
  .scorecard-footer-controls > .scorecard-clear-actions-toggle {
  }
  .scorecard-clear-panel {
    padding: 8px 10px 6px;
    min-height: 70px;
    border-top: 1px solid rgba(136, 165, 191, 0.14);
  }

  .scorecard-clear-buttons {
    gap: 8px;
  }

  .scorecard-clear-buttons .btn {
    border-radius: 18px;
    height: 50px !important;
    min-height: 50px !important;
    font-size: 15px !important;
  }

  #gameTotalsCard.game-totals-card {
    margin: 0 0 0;
    border-radius: var(--mobile-card-radius);
    background: linear-gradient(180deg, var(--surface-l1), var(--surface-l2));
    border-color: rgba(136, 165, 191, 0.3);
    box-shadow: 0 20px 38px -26px rgba(53, 84, 112, 0.32);
  }

  #gameTotalsCard.game-totals-card.is-collapsed {
    margin: 0 0 0;
    border-width: 1px;
    border-style: solid;
    border-color: rgba(136, 165, 191, 0.3);
    border-radius: 18px;
    background: linear-gradient(180deg, var(--surface-l1), var(--surface-l2));
    box-shadow: 0 20px 38px -26px rgba(53, 84, 112, 0.32);
    overflow: visible;
  }

  #gameTotalsCard.game-totals-card::before {
    display: none;
  }

  .game-totals-toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "label state chevron"
      "tabs tabs tabs";
    align-items: center;
    column-gap: 8px;
    row-gap: 6px;
    padding: 8px 10px 6px;
  }

  .game-totals-label {
    grid-area: label;
    font-size: 13px;
    line-height: 0.95;
    opacity: 0.8;
    max-width: none;
    font-weight: 700;
    text-align: center;
  }

  .game-totals-tabs-shell {
    grid-area: tabs;
    min-width: 0;
    display: block;
  }

  .game-totals-tabs {
    gap: 5px;
    padding-right: 2px;
  }

  .game-totals-tab {
    min-height: 40px;
    height: 40px;
    padding: 0 13px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.82);
    color: #142a40;
    border-color: rgba(116, 149, 176, 0.24);
  }

  .game-totals-tab.is-active {
    background: linear-gradient(180deg, #2384dc, #176dc6);
    border-color: var(--accent-btn-bg);
    color: #ffffff;
  }

  .game-totals-toggle-state {
    grid-area: state;
    min-width: 0;
    padding: 0 2px 0 0;
    font-size: 11px;
    font-weight: 700;
    color: #31485f;
  }

  .game-totals-chevron {
    grid-area: chevron;
    width: 9px;
    height: 9px;
    opacity: 0.56;
  }

  .game-totals-body {
    padding: 2px 8px 0;
  }

  .footer-entry-switcher {
    margin-top: 6px;
    padding: 8px 10px max(var(--footer-row-bottom-clearance), 10px);
    border-top: 1px solid rgba(136, 165, 191, 0.12);
    background: linear-gradient(180deg, rgba(228, 238, 249, 0.58), rgba(220, 232, 244, 0.34));
  }

  html.ios-pwa-mode .entry-switcher.footer-entry-switcher {
    /* iOS WKWebView fills view to the device bottom (contentInsetAdjustmentBehavior
       = .never), so the Score/Games row would land directly on the home indicator
       without explicit safe-area padding. Use env() so it adapts to devices
       without a home indicator (8 Plus / SE) instead of a fixed 30px. */
    padding-bottom: max(30px, calc(env(safe-area-inset-bottom, 0px) + 14px));
  }

  html.ios-native-app:not(.ios-pwa-mode) .entry-switcher.footer-entry-switcher {
    /* Native iOS app (WKWebView), but not Safari PWA mode.
       Keep the Score/Games switcher above the home indicator. */
    padding-bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 14px));
  }

  .footer-entry-switcher.entry-switcher {
    border-width: 0;
    box-shadow: none;
    background: transparent;
    padding-left: 0;
    padding-right: 0;
    gap: 10px;
  }

  .scorecard-card-footer {
    position: relative;
  }

  .scorecard-card-footer::before {
    content: "";
    display: block;
    position: absolute;
    left: 10px;
    right: 10px;
    top: -4px;
    height: 1px;
    background: linear-gradient(90deg, rgba(136, 165, 191, 0), var(--line-cool), rgba(136, 165, 191, 0));
    pointer-events: none;
  }

  .scorecard-controls-shell:has(#gameTotalsCard.is-collapsed:not([hidden])) .scorecard-card-footer::before {
    display: none;
  }

  .scorecard-controls-shell:has(#gameTotalsCard.is-collapsed:not([hidden])) .scorecard-card-footer {
    padding-top: 0;
  }

  .footer-entry-switcher .entry-switcher-btn {
    min-height: 40px;
    height: 40px;
    border-radius: var(--mobile-card-radius);
    font-size: 14px;
    font-weight: 700;
    border: 1px solid rgba(116, 149, 176, 0.26);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 247, 255, 0.86));
    color: #51677c;
    box-shadow: inset 0 1px 0 var(--hi-bright), 0 12px 24px -22px rgba(36, 71, 102, 0.28);
  }

  .footer-entry-switcher .entry-switcher-btn.active {
    background: linear-gradient(180deg, #2482d8, #176abe);
    color: #ffffff;
    border-color: var(--accent-btn-bg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 16px 28px -22px rgba(20, 93, 171, 0.45);
  }
}

@media (max-width: 768px) {
  :root:not([data-theme="light"]) #gameTotalsCard.game-totals-card {
    background: linear-gradient(180deg, rgba(22, 39, 55, 0.98), rgba(11, 24, 36, 0.96)) !important;
    border-color: var(--line-medium) !important;
    box-shadow: var(--mobile-surface-shadow) !important;
  }

  :root:not([data-theme="light"]) #gameTotalsCard.game-totals-card.is-collapsed {
    border-width: 1px !important;
    border-style: solid !important;
    background: linear-gradient(180deg, rgba(22, 39, 55, 0.98), rgba(11, 24, 36, 0.96)) !important;
    border-color: var(--line-medium) !important;
    box-shadow: var(--mobile-surface-shadow) !important;
  }

  :root:not([data-theme="light"]) .game-totals-card.is-collapsed .game-totals-label {
    color: #93a9bb;
  }

  :root:not([data-theme="light"]) .game-totals-card.is-collapsed .game-totals-toggle-state {
    color: #c7d7e4;
  }

  :root:not([data-theme="light"]) .game-totals-card.is-collapsed .game-totals-toggle:hover {
    background: linear-gradient(180deg, rgba(29, 52, 73, 0.98), rgba(16, 33, 49, 0.96));
  }

  :root:not([data-theme="light"]) .game-totals-toggle-state,
  :root:not([data-theme="light"]) .results-collapse-label,
  :root:not([data-theme="light"]) .results-collapse-chevron::before,
  :root:not([data-theme="light"]) .results-card-wrap.is-collapsed .results-collapse-chevron::before {
    color: #c7d7e4;
  }

  :root:not([data-theme="light"]) .scorecard-add-player-btn,
  :root:not([data-theme="light"]) .scorecard-footer-controls > .btn#scorecardOptionsToggle,
  :root:not([data-theme="light"]) .scorecard-footer-controls > .game-options-toggle#scorecardOptionsToggle,
  :root:not([data-theme="light"]) .scorecard-footer-controls > .scorecard-theme-toggle,
  :root:not([data-theme="light"]) .scorecard-footer-controls > .scorecard-main-options-icon,
  :root:not([data-theme="light"]) .scorecard-footer-controls > .scorecard-clear-actions-toggle,
  :root:not([data-theme="light"]) .game-totals-tab,
  :root:not([data-theme="light"]) .footer-entry-switcher .entry-switcher-btn {
    background: linear-gradient(180deg, var(--surface-d1), var(--surface-d2)) !important;
    border-color: var(--line-medium) !important;
    color: #e5f1fb !important;
    box-shadow: inset 0 1px 0 var(--hi-faint), 0 12px 24px -20px rgba(0, 0, 0, 0.78) !important;
  }

  :root:not([data-theme="light"]) .scorecard-footer-controls > .btn#scorecardOptionsToggle,
  :root:not([data-theme="light"]) .scorecard-footer-controls > .game-options-toggle#scorecardOptionsToggle {
    color: #f2f8ff !important;
  }

  :root:not([data-theme="light"]) .game-totals-tab.is-active,
  :root:not([data-theme="light"]) .footer-entry-switcher .entry-switcher-btn.active {
    background: linear-gradient(180deg, #2384dc, #176dc6);
    border-color: var(--accent-btn-bg);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 16px 28px -22px rgba(20, 93, 171, 0.45);
  }

  :root:not([data-theme="light"]) .footer-entry-switcher {
    background: linear-gradient(180deg, rgba(17, 32, 46, 0.72), rgba(12, 24, 36, 0.44));
    border-top-color: rgba(96, 133, 163, 0.24);
  }
}
.game-options-icon-btn,
.banker-options-icon-btn {
  border-radius: var(--game-menu-control-radius);
  border-color: var(--line-soft);
  background: linear-gradient(180deg, var(--hi-bright), rgba(240, 247, 255, 0.88));
  color: #173149;
  box-shadow: inset 0 1px 0 var(--hi-strong), 0 12px 20px -18px rgba(36, 71, 102, 0.32);
}

.game-options-icon-btn.is-open,
.banker-options-icon-btn.is-open,
.game-options-toggle.is-open {
  background: linear-gradient(180deg, #2384dc, #176dc6);
  border-color: var(--accent-btn-bg);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 16px 28px -22px rgba(20, 93, 171, 0.42);
}

.game-options-panel {
  margin-top: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(136, 165, 191, 0.22);
  border-radius: var(--game-menu-radius);
  background: linear-gradient(180deg, rgba(245, 249, 253, 0.75), rgba(231, 239, 247, 0.65));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 20px 36px -28px rgba(53, 84, 112, 0.24);
}

/* Info (i) panels should run edge-to-edge like the game area.
   Keep option (wrench) panels padded for controls density. */
#vegasInfoPanel,
#bankerInfoPanel,
#hiloOptionsPanel,
#junkTeamInfoPanel,
#wolfInfoPanel {
  padding: 0;
}

.game-section > .game-options-panel {
  margin-left: 0;
  margin-right: 0;
}

.banker-controls,
.vegas-controls {
  gap: 12px;
  background: transparent;
}
.game-options-panel .pill,
.game-options-panel .team-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(16, 130, 122, 0.1);
  color: #33556e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-options-panel .control {
  background: rgba(255, 255, 255, 0.44);
  border-color: rgba(136, 165, 191, 0.2);
}

.game-options-panel .small,
.game-options-panel .note,
.game-options-panel p {
  color: #4f6578;
}

.game-options-panel .input-label,
.game-options-panel label {
  color: #21384d;
}.skins-toggle-btn,
  .vegas-toggle-btn,
  .vegas-choice-btn {
  border-radius: var(--game-menu-chip-radius);
  border-color: rgba(136, 165, 191, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 247, 255, 0.86));
  color: #1f3448;
  box-shadow: inset 0 1px 0 var(--hi-strong), 0 10px 18px -18px var(--shadow-tint);
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease, opacity 0.1s ease;
}.skins-toggle-btn:active,
  .vegas-toggle-btn:active,
  .vegas-choice-btn:active {
  transform: scale(0.95);
  opacity: 0.8;
}.skins-toggle-btn:has(input:checked),
  .vegas-toggle-btn:has(input:checked),
  .vegas-choice-btn:has(input:checked),
  .vegas-opt-flag:has(input:checked) {
  background: linear-gradient(180deg, rgba(35, 132, 220, 0.16), rgba(23, 109, 198, 0.12));
  border-color: rgba(20, 93, 171, 0.48);
  color: #154264;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.game-options-panel .hcp-mode-btn[data-active="true"] {
  background: linear-gradient(180deg, var(--accent-glow), rgba(23, 109, 198, 0.2));
  border-color: rgba(20, 93, 171, 0.8);
  color: #0f3f66;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 0 0 2px var(--accent-glow);
}.game-options-panel .skins-toggle-btn:has(input:checked),
  .game-options-panel .vegas-toggle-btn:has(input:checked),
  .game-options-panel .vegas-choice-btn:has(input:checked),
  .game-options-panel .vegas-opt-flag:has(input:checked) {
  background: linear-gradient(180deg, var(--accent-glow), rgba(23, 109, 198, 0.2));
  border-color: var(--accent-btn-bg);
  color: #0f3f66;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 0 0 2px rgba(35, 132, 220, 0.22);
}

:root:not([data-theme="light"]) .game-options-icon-btn,
:root:not([data-theme="light"]) .banker-options-icon-btn {
  background: linear-gradient(180deg, var(--surface-d1), var(--surface-d2));
  border-color: var(--line-medium);
  color: #e5f1fb;
  box-shadow: inset 0 1px 0 var(--hi-faint), 0 12px 20px -18px var(--shadow-deep);
}

:root:not([data-theme="light"]) .game-options-panel {
  border-color: rgba(96, 133, 163, 0.3);
  background: linear-gradient(180deg, rgba(22, 39, 55, 0.75), rgba(11, 24, 36, 0.65));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 20px 36px -28px var(--shadow-deep);
}
:root:not([data-theme="light"]) .game-options-panel .pill,
:root:not([data-theme="light"]) .game-options-panel .team-pill {
  background: rgba(51, 209, 198, 0.12);
  color: #b9d6e7;
}

:root:not([data-theme="light"]) .game-options-panel .small,
:root:not([data-theme="light"]) .game-options-panel .note,
:root:not([data-theme="light"]) .game-options-panel p,
:root:not([data-theme="light"]) .game-options-panel .input-label,
:root:not([data-theme="light"]) .game-options-panel label {
  color: #d6e4ef;
}:root:not([data-theme="light"]) .skins-toggle-btn,
  :root:not([data-theme="light"]) .vegas-toggle-btn,
  :root:not([data-theme="light"]) .vegas-choice-btn,
  :root:not([data-theme="light"]) .vegas-opt-flag {
  border-color: rgba(96, 133, 163, 0.3);
  background: linear-gradient(180deg, var(--surface-d1), var(--surface-d2));
  color: #e5f1fb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 18px -18px rgba(0, 0, 0, 0.62);
}:root:not([data-theme="light"]) .skins-toggle-btn:has(input:checked),
  :root:not([data-theme="light"]) .vegas-toggle-btn:has(input:checked),
  :root:not([data-theme="light"]) .vegas-choice-btn:has(input:checked),
  :root:not([data-theme="light"]) .vegas-opt-flag:has(input:checked) {
  background: linear-gradient(180deg, rgba(35, 132, 220, 0.22), rgba(23, 109, 198, 0.16));
  border-color: rgba(20, 93, 171, 0.5);
  color: #ffffff;
}

:root:not([data-theme="light"]) .game-options-panel .hcp-mode-btn[data-active="true"] {
  background: linear-gradient(180deg, rgba(35, 132, 220, 0.34), rgba(23, 109, 198, 0.3));
  border-color: rgba(106, 201, 255, 0.88);
  color: #ffffff;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 0 2px rgba(70, 177, 255, 0.3), 0 12px 24px -20px rgba(0, 0, 0, 0.7);
}:root:not([data-theme="light"]) .game-options-panel .skins-toggle-btn:has(input:checked),
  :root:not([data-theme="light"]) .game-options-panel .vegas-toggle-btn:has(input:checked),
  :root:not([data-theme="light"]) .game-options-panel .vegas-choice-btn:has(input:checked),
  :root:not([data-theme="light"]) .game-options-panel .vegas-opt-flag:has(input:checked) {
  background: linear-gradient(180deg, rgba(35, 132, 220, 0.34), rgba(23, 109, 198, 0.3));
  border-color: rgba(106, 201, 255, 0.84);
  color: #ffffff;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 0 2px rgba(70, 177, 255, 0.28), 0 12px 24px -20px var(--shadow-deep);
}

@media (max-width: 768px) {
  .game-options-panel {
    margin-top: 12px;
    padding: 12px;
    border-radius: var(--game-menu-radius);
    background: linear-gradient(180deg, rgba(245, 249, 253, 0.75), rgba(231, 239, 247, 0.65));
  }

  .game-section > .game-options-panel {
    margin-left: 0;
    margin-right: 0;
  }

  .game-options-icon-btn,
  .banker-options-icon-btn {
    border-radius: var(--game-menu-chip-radius);
  }}

/* ---- Large screen: cap width and center like a native iPad/tablet app ---- */
@media (min-width: 960px) {
  .top-pinned-shell,
  .sticky-nav-bar,
  .entry-panel,
  .games-launcher-shell,
  .scorecard-controls-shell,
  .games-controls-shell {
    max-width: min(1600px, 100vw);
    margin-left: auto;
    margin-right: auto;
  }

  /* Score mode: keep footer shell full-bleed like the rest of the score view. */
  body.mode-score #scoreEntryPanel > .scorecard-controls-shell {
  }

  /* Keep header shell full-bleed in app/desktop so it spans the screen width. */
  .top-pinned-shell,
  .sticky-nav-bar {
  }

  .scorecard-container {
    max-width: min(1600px, 100vw);
    margin-left: auto;
    margin-right: auto;
    border-radius: 18px 18px 0 0;
  }

  .game-section {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    position: relative;
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    /* Fade top and bottom edges into the page background so the section
       feels integrated rather than framed like a floating window. */
    background: linear-gradient(
      to bottom,
      var(--bg) 0px,
      var(--panel-alt) 40px,
      var(--panel-alt) calc(100% - 40px),
      var(--bg) 100%
    );
  }

  /* Add subtle texture to desktop side gutters and extend to screen edges. */
  .game-section::before,
  .game-section::after {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    width: max(0px, calc(50vw - 516px));
    pointer-events: none;
    z-index: 0;
    background:
      radial-gradient(120% 85% at 50% 0%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 56%),
      repeating-linear-gradient(135deg, rgba(136, 165, 191, 0.18) 0 10px, rgba(136, 165, 191, 0.08) 10px 20px),
      linear-gradient(180deg, rgba(223, 233, 244, 0.92), rgba(209, 221, 234, 0.82));
    box-shadow: inset -1px 0 0 var(--line-mute);
  }

  .game-section::before { left: 0; }
  .game-section::after {
    right: 0;
    box-shadow: inset 1px 0 0 var(--line-mute);
  }

  :root:not([data-theme="light"]) .game-section::before,
  :root:not([data-theme="light"]) .game-section::after {
    background:
      radial-gradient(120% 85% at 50% 0%, rgba(151, 185, 210, 0.28), rgba(151, 185, 210, 0) 56%),
      repeating-linear-gradient(135deg, rgba(99, 138, 171, 0.24) 0 10px, rgba(99, 138, 171, 0.12) 10px 20px),
      linear-gradient(180deg, rgba(19, 37, 56, 0.82), rgba(12, 26, 40, 0.74));
    box-shadow: inset -1px 0 0 var(--line-warm);
  }

  :root:not([data-theme="light"]) .game-section::after {
    box-shadow: inset 1px 0 0 var(--line-warm);
  }

  /* Score mode: mirror the same gutter texture language used in games mode. */
  body.mode-score #scoreEntryPanel {
    position: relative;
  }

  body.mode-score #scoreEntryPanel::before,
  body.mode-score #scoreEntryPanel::after {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    width: max(0px, calc(50vw - 516px));
    pointer-events: none;
    z-index: 0;
    background:
      radial-gradient(120% 85% at 50% 0%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 56%),
      repeating-linear-gradient(135deg, rgba(136, 165, 191, 0.18) 0 10px, rgba(136, 165, 191, 0.08) 10px 20px),
      linear-gradient(180deg, rgba(223, 233, 244, 0.92), rgba(209, 221, 234, 0.82));
    box-shadow: inset -1px 0 0 var(--line-mute);
  }

  body.mode-score #scoreEntryPanel::before { left: 0; }
  body.mode-score #scoreEntryPanel::after {
    right: 0;
    box-shadow: inset 1px 0 0 var(--line-mute);
  }

  :root:not([data-theme="light"]) body.mode-score #scoreEntryPanel::before,
  :root:not([data-theme="light"]) body.mode-score #scoreEntryPanel::after {
    background:
      radial-gradient(120% 85% at 50% 0%, rgba(151, 185, 210, 0.28), rgba(151, 185, 210, 0) 56%),
      repeating-linear-gradient(135deg, rgba(99, 138, 171, 0.24) 0 10px, rgba(99, 138, 171, 0.12) 10px 20px),
      linear-gradient(180deg, rgba(19, 37, 56, 0.82), rgba(12, 26, 40, 0.74));
    box-shadow: inset -1px 0 0 var(--line-warm);
  }

  :root:not([data-theme="light"]) body.mode-score #scoreEntryPanel::after {
    box-shadow: inset 1px 0 0 var(--line-warm);
  }

  body.mode-score #scoreEntryPanel > * {
    position: relative;
    z-index: 1;
  }

  /* Keep score footer shell (and anchored Game Totals) above scorecard.
     The generic child z-index=1 rule above should not flatten this shell. */
  body.mode-score #scoreEntryPanel > .scorecard-controls-shell {
    z-index: 35 !important;
  }

  /* Games mode: center the inner table content without constraining the
     full-bleed background of the game section. !important overrides inline
     margin styles (e.g. style="margin: 10px 12px 0") on child elements. */
  .game-section > * {
    max-width: 1032px;
    position: relative;
    z-index: 1;
  }

  .live-results-card,
  .banker-header-totals,
  .vegas-rotation-breakdown,
  #gameTotalsCard {
    border-radius: 18px;
  }

  /* Fixed results panels: center within full-width game section */
  body.mode-games #bankerSection[aria-hidden="false"] #bankerResultsWrap,
  body.mode-games #vegasSection[aria-hidden="false"] #vegasResultsWrap,
  body.mode-games #hiloSection[aria-hidden="false"] #hiloResultsWrap,
  body.mode-games #junkSection[aria-hidden="false"] #junkResultsWrap,
  body.mode-games #wolfSection[aria-hidden="false"] #wolfResultsWrap {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(1032px, 100vw);
    max-width: 100vw;
  }

  body.mode-games #bankerSection[aria-hidden="false"] #bankerResultsWrap .banker-header-totals,
  body.mode-games #vegasSection[aria-hidden="false"] #vegasResultsWrap .live-results-card,
  body.mode-games #hiloSection[aria-hidden="false"] #hiloResultsWrap .live-results-card,
  body.mode-games #junkSection[aria-hidden="false"] #junkResultsWrap .live-results-card,
  body.mode-games #wolfSection[aria-hidden="false"] #wolfResultsWrap .live-results-card {
    border-left: revert;
    border-right: revert;
    border-radius: 18px 18px 0 0;
  }

  body.mode-games #bankerSection[aria-hidden="false"] #bankerResultsWrap.is-collapsed .results-collapse-bar,
  body.mode-games #vegasSection[aria-hidden="false"] #vegasResultsWrap.is-collapsed .results-collapse-bar,
  body.mode-games #hiloSection[aria-hidden="false"] #hiloResultsWrap.is-collapsed .results-collapse-bar,
  body.mode-games #junkSection[aria-hidden="false"] #junkResultsWrap.is-collapsed .results-collapse-bar,
  body.mode-games #wolfSection[aria-hidden="false"] #wolfResultsWrap.is-collapsed .results-collapse-bar {
    border-left: revert;
    border-right: revert;
    border-radius: 18px 18px 0 0;
  }

  #gameTotalsCard {
    width: 100%;
    box-sizing: border-box;
  }
}

/* =========================================================================
   Light theme overrides — moved from light-theme-overrides.css. ui-polish.css
   loads after this file and refines --bg/--panel-alt/--line, so those values
   end up matching ui-polish's palette at runtime (same as before the move).
   ========================================================================= */

:root[data-theme="light"] {
  --bg: #edf4fb;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-alt: rgba(244, 249, 255, 0.96);
  --ink: #0f2233;
  --muted: #62788b;
  --accent: #0ea5a0;
  --line: rgba(104, 137, 163, 0.22);
  --shadow: rgba(36, 71, 102, 0.14);
  /* Restored from the former Bootswatch Flatly block in light-theme-overrides.css.
     The dark-theme :root above sets #ffbf69 / #ff6b6b; light theme uses the
     original Flatly hues. */
  --warn: #f39c12;
  --danger: #e74c3c;
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at top left, rgba(14, 165, 160, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 34%),
    linear-gradient(180deg, #f7fbff 0%, #edf4fb 58%, #e8f0f8 100%);
  color-scheme: light;
}

:root[data-theme="light"] .top-pinned-shell,
:root[data-theme="light"] .sticky-nav-bar {
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.95), rgba(237, 244, 251, 0.82));
  border-bottom-color: rgba(98, 120, 139, 0.12);
}

:root[data-theme="light"] .btn,
:root[data-theme="light"] .theme-toggle,
:root[data-theme="light"] .cloud-code-badge-btn,
:root[data-theme="light"] .game-totals-tab,
:root[data-theme="light"] .scorecard-add-player-btn,
:root[data-theme="light"] .scorecard-theme-toggle,
:root[data-theme="light"] .scorecard-main-options-icon,
:root[data-theme="light"] .scorecard-clear-actions-toggle {
  background: linear-gradient(180deg, var(--hi-bright), rgba(240, 247, 255, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 16px 30px -24px rgba(36, 71, 102, 0.35);
}

:root[data-theme="light"] #cloudSnapshotsToggle,
  :root[data-theme="light"] #cloudCreateBtn,
  :root[data-theme="light"] .cloud-control-compact .btn,
  :root[data-theme="light"] .cloud-status-badge,
  :root[data-theme="light"] .cloud-code-badge-btn {
  background: linear-gradient(180deg, var(--hi-bright), rgba(240, 247, 255, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 16px 30px -24px rgba(36, 71, 102, 0.35);
  border-color: rgba(151, 185, 210, 0.24);
  color: #1e293b;
}

:root[data-theme="light"] .cloud-status-badge[data-live="true"] {
  color: #166534;
  border-color: rgba(22, 163, 74, 0.45);
  background: rgba(22, 163, 74, 0.12);
}

:root[data-theme="light"] .entry-switcher {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 255, 0.92));
}

:root[data-theme="light"] .scorecard-container {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 253, 0.94));
}

:root[data-theme="light"] .scorecard-controls-shell,
:root[data-theme="light"] .games-controls-shell {
  background: linear-gradient(180deg, rgb(250, 253, 255), rgb(239, 246, 253));
  box-shadow: 0 -18px 40px -30px rgba(36, 71, 102, 0.22);
}

:root[data-theme="light"] .game-section {
  background: linear-gradient(180deg, var(--hi-bright), rgba(243, 248, 253, 0.94));
}

:root[data-theme="light"] #gameTotalsCard.game-totals-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 255, 0.94));
}

:root[data-theme="light"] .live-results-card,
:root[data-theme="light"] .banker-header-totals,
:root[data-theme="light"] .vegas-rotation-breakdown {
  border-color: var(--line-soft);
  background: linear-gradient(180deg, var(--surface-l1), var(--surface-l2));
  box-shadow: 0 20px 38px -26px rgba(53, 84, 112, 0.28);
}

:root[data-theme="light"] .results-collapse-bar {
  border-color: var(--line-soft);
  background: linear-gradient(180deg, var(--surface-l1), var(--surface-l2));
  box-shadow: 0 16px 28px -24px rgba(53, 84, 112, 0.22);
}

:root[data-theme="light"] .results-collapse-bar:hover,
.results-card-wrap.is-collapsed .results-collapse-bar:hover {
  background: linear-gradient(180deg, rgba(247, 250, 254, 0.98), rgba(235, 243, 251, 0.96));
}

:root[data-theme="light"] .live-results-table th,
:root[data-theme="light"] .live-results-table td,
:root[data-theme="light"] .banker-header-totals-table th,
:root[data-theme="light"] .banker-header-totals-table td {
  border-bottom-color: rgba(136, 165, 191, 0.18);
}

/* =========================================================================
   Shared modal animations — used by JS-injected dialogs in cloudsync.js and
   index.js. Moved from light-theme-overrides.css.
   ========================================================================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes slideUpFull {
  from {
    transform: translateY(100vh);
    opacity: 0.92;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideDownFull {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100vh);
    opacity: 0.85;
  }
}

/* =========================================================================
   Light theme overrides — more component-agnostic surfaces (banner, body,
   universal table headers, .btn/.theme-toggle defaults, control boxes).
   Moved from light-theme-overrides.css.
   ========================================================================= */

:root[data-theme="light"] .view-mode-banner {
  background: #fff2df;
  border-color: #d97706;
  color: #1a1c1f;
}

:root[data-theme="light"] body {
  background: var(--bg);
  color: var(--ink);
}

:root[data-theme="light"] .control-box,
:root[data-theme="light"] .team-box,
:root[data-theme="light"] .opts-box {
  background: #ffffff;
  border-color: #bcc7d2;
}

/* Universal table header/footer (game-specific overrides live in game-tables.css). */
:root[data-theme="light"] thead th,
:root[data-theme="light"] tfoot td {
  background: #e5ecf2;
  color: #1a1c1f;
}

:root[data-theme="light"] .btn,
:root[data-theme="light"] .theme-toggle,
:root[data-theme="light"] button {
  background: #d4dee8;
  border-color: #aebac7;
  color: #1a1c1f;
}

:root[data-theme="light"] .btn:hover,
:root[data-theme="light"] .theme-toggle:hover,
:root[data-theme="light"] button:hover {
  background: #c8d4e1;
}

:root[data-theme="light"] .btn.accent {
  background: #e0f2ff;
  border-color: #0090e0;
  color: #1a1c1f;
}
