/* ==========================================================================
   Slotary — responsive.css
   Mobile-first overrides layered on top of index.html's inline <style> and its
   six appended "surgical" patch blocks (v5/v8/v9/v10/v11/v12/v13 + final).
   Linked as the LAST stylesheet so it wins the cascade; !important is used
   only where a patch block already forces the same property.

   Desktop (min-width: 769px) is intentionally left alone — every rule below
   is scoped to max-width: 768px unless noted.

   Layout tokens (mobile only):
     --sl-nav-h    height of the fixed bottom category bar (.mobile-cat-bar)
     --sl-nav-gap  gap between that bar and the viewport bottom edge
     --sl-safe-b   iOS home-indicator inset (0 unless viewport-fit=cover)
     --sl-pad      horizontal page gutter
   ========================================================================== */

:root {
  --sl-nav-h: 64px;
  --sl-nav-gap: 8px;
  --sl-safe-b: env(safe-area-inset-bottom, 0px);
  --sl-pad: 14px;
  /* total vertical space reserved for the bottom bar */
  --sl-bottom-reserve: calc(var(--sl-nav-h) + var(--sl-nav-gap) + var(--sl-safe-b));
}

/* --------------------------------------------------------------------------
   0. Touch devices: no sticky hover transforms (they "stick" after a tap)
   -------------------------------------------------------------------------- */
@media (hover: none) {
  .game:hover,
  .ng-tile:hover,
  .hero-card:hover,
  .btn:hover,
  .wallet-pill:hover,
  .account-pill:hover,
  .new-games-arrow:hover,
  .chat-bubble:hover {
    transform: none !important;
    animation: none !important;
  }
}

/* ==========================================================================
   MOBILE + SMALL TABLET  (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {

  /* ---------- 0. Global safety & type floor ---------- */
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
  }
  img, video, iframe, svg, canvas { max-width: 100%; }
  /* iOS zooms the page when focusing an input < 16px */
  input, select, textarea { font-size: 16px !important; }
  input[readonly] { font-size: 14px !important; }
  .compliance-bar { font-size: 13px; padding: 10px 14px; line-height: 1.4; }
  .page-sub, .legal p, .promo p, .hero p, footer p, .tx-info, .feature p, .quote {
    font-size: 14px;
  }
  .page-title { font-size: clamp(26px, 8vw, 32px); }

  /* ---------- 1. Fixed bottom bar never covers content ----------
     Reserve room below the last content block for the bar + safe area.
     Beats: body{padding-bottom:18px!important} (v13) and
            body.slotary-mobile-scrolled{padding-bottom:76px!important} (v13). */
  body,
  body.slotary-mobile-scrolled {
    padding-bottom: calc(var(--sl-bottom-reserve) + 10px) !important;
  }
  footer { padding: 32px var(--sl-pad) 20px; margin-top: 32px; }

  /* Bottom category bar: compact, fixed height, sits above the safe area. */
  .mobile-cat-bar {
    left: 8px;
    right: 8px;
    bottom: calc(var(--sl-nav-gap) + var(--sl-safe-b));
    height: var(--sl-nav-h);
    box-sizing: border-box;
    gap: 6px;
    padding: 6px;
    border-radius: 18px;
    z-index: 97;
  }
  .mobile-cat-bar a {
    min-height: 0;
    height: 100%;
    padding: 4px 2px 3px;
    gap: 3px;
    border-radius: 12px;
    font-size: 9.5px;
    letter-spacing: 0.2px;
    min-width: 0;
    overflow: hidden;
  }
  .mobile-cat-bar a span {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-cat-bar a img { width: 26px; height: 26px; }

  /* Legacy 5-button dock stays hidden (owner: "hide for now, not deleted").
     If it is ever re-enabled, it shares the same reserve/inset as the cat bar. */
  .mobile-nav {
    bottom: calc(var(--sl-nav-gap) + var(--sl-safe-b)) !important;
    padding-bottom: calc(6px + var(--sl-safe-b)) !important;
  }

  /* ---------- 2. Floating chat launcher: above the bar, out of the grid ----------
     Beats: .chat-bubble,#chatBubble{bottom:…!important} (v11/v12/v13, ≤(1,1,1)). */
  body #chatBubble,
  body.slotary-mobile-scrolled #chatBubble {
    bottom: calc(var(--sl-bottom-reserve) + 14px) !important;
    right: 10px !important;
    width: 46px !important;
    height: 46px !important;
    font-size: 21px !important;
    z-index: 96 !important;
    box-shadow: 0 8px 22px rgba(0,255,163,0.35) !important;
  }
  body #chatBubble .badge { width: 16px; height: 16px; font-size: 9px; }
  /* Never float the launcher over a running game or an open modal/drawer. */
  #launcherModal.show ~ #chatBubble,
  .modal-backdrop.show ~ #chatBubble,
  .drawer.open ~ #chatBubble { display: none !important; }

  #chatPanel {
    left: 8px;
    right: 8px;
    width: auto;
    bottom: calc(var(--sl-bottom-reserve) + 10px);
    height: min(500px, calc(100vh - var(--sl-bottom-reserve) - 90px));
    height: min(500px, calc(100dvh - var(--sl-bottom-reserve) - 90px));
    max-height: none;
    border-radius: 18px;
    z-index: 99;
  }
  .chat-quick button { min-height: 36px; }
  .chat-input input { font-size: 16px !important; }
  .chat-input button { min-height: 40px; padding: 0 14px; }

  /* ---------- 3. Hero: legible over art, wraps cleanly ----------
     Beats the #page-home .hero-* !important rules in the "FINAL MOBILE OVERRIDE". */
  #page-home .hero:not(.hero-collapsed) {
    padding: 10px var(--sl-pad) 4px !important;
    margin: 0 !important;
    max-height: none !important;
  }
  #page-home .hero-card {
    min-height: 0 !important;
    padding: 0 !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  }
  #page-home .hero-slides {
    height: clamp(240px, 66vw, 330px) !important;
    border-radius: 18px !important;
  }
  #page-home .hero-slide {
    align-items: flex-end !important;
  }
  #page-home .hero-art {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: 62% 50% !important;
    border-radius: 18px !important;
    animation: none !important;
  }
  #page-home .hero-art.art-left { object-position: 40% 50% !important; }
  /* Bottom-weighted scrim (replaces the desktop left/right side scrims). */
  #page-home .hero-card::before,
  #page-home .hero-card:has(.hero-slide.text-right.is-active)::before {
    background:
      linear-gradient(180deg,
        rgba(8,10,24,0.10) 0%,
        rgba(8,10,24,0.28) 38%,
        rgba(8,10,24,0.78) 68%,
        rgba(8,10,24,0.94) 100%),
      linear-gradient(90deg, rgba(8,10,24,0.45) 0%, transparent 60%) !important;
  }
  #page-home .hero-content {
    max-width: 100% !important;
    width: 100%;
    padding: 16px 16px 38px !important;
    text-align: left !important;
    margin: 0 !important;
  }
  #page-home .hero-slide.text-right .hero-content { margin-left: 0 !important; }
  #page-home .hero-tag {
    font-size: 10px !important;
    padding: 4px 9px !important;
    margin-bottom: 8px !important;
  }
  #page-home .hero h1 {
    font-size: clamp(22px, 6.6vw, 30px) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.5px !important;
    margin-bottom: 8px !important;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
    overflow-wrap: anywhere;
  }
  #page-home .hero p {
    color: #fff !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    max-width: 92% !important;
    margin-bottom: 12px !important;
    text-shadow: 0 1px 8px rgba(0,0,0,0.7);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  #page-home .hero-cta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: flex-start !important;
  }
  #page-home .hero-cta .btn {
    min-height: 40px !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
    white-space: nowrap;
  }
  #page-home .hero-cta .btn-ghost {
    background: rgba(10,13,30,0.55) !important;
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(6px);
  }
  /* Dots: larger hit area without changing the look */
  #page-home .hero-dots { bottom: 10px !important; gap: 12px; padding: 6px; }
  #page-home .hero-dot { position: relative; height: 8px; }
  #page-home .hero-dot::before { content: ''; position: absolute; inset: -12px -6px; }

  /* ---------- 4. Header cluster fits 360px ----------
     The patch blocks size the logo with transform:scale() hacks and hide the
     Sign In / Register buttons — so a signed-out phone user had no way in
     (and saw a fake "0.00… BTC" pill because `#walletPill{display:flex!important}`
     beat the inline display:none). Rebuild the row as a 3-column grid. */
  body header .nav,
  body.slotary-mobile-scrolled header .nav {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    grid-template-rows: auto !important;
    column-gap: 8px !important;
    row-gap: 0 !important;
    align-items: center !important;
    width: calc(100% - 16px) !important;
    max-width: calc(100% - 16px) !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 6px auto !important;
    padding: 6px 8px !important;
    overflow: visible !important;
    border-radius: 18px !important;
  }
  body header .nav > .logo,
  body:not(.is-signed-in) header .nav > .logo {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: start !important;
    align-self: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: clamp(44px, 13.5vw, 56px) !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    overflow: hidden !important;
  }
  body header .nav > .logo .logo-video,
  body header .nav > .logo:is(:hover, :active, :focus) .logo-video {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: left center !important;
    transform: none !important;
    display: block !important;
  }

  /* Wallet pill: real size (no scale hack), truncates with ellipsis. */
  body header .nav #walletPill {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: center !important;
    transform: none !important;
    height: 40px !important;
    min-width: 0 !important;
    max-width: 150px !important;
    padding: 0 8px 0 6px !important;
    gap: 6px !important;
    border-radius: 13px !important;
    overflow: hidden !important;
  }
  body header .nav #walletPill::after { display: none !important; }
  body header .nav #walletPill .wallet-coin,
  body header .nav #walletPill > span:first-child {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
  }
  body header .nav #walletPill .wallet-amt {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    line-height: 1;
  }
  body header .nav #walletPill .balance {
    font-size: 12.5px !important;
    line-height: 1.1 !important;
    max-width: 88px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-variant-numeric: tabular-nums;
  }
  body header .nav #walletPill .ccy { font-size: 8.5px !important; line-height: 1 !important; }
  body header .nav #walletPill .demo-chip { display: none !important; }

  /* Account / avatar button */
  body header .nav #avatarBtn {
    grid-column: 3 !important;
    grid-row: 1 !important;
    align-self: center !important;
    transform: none !important;
    width: 42px !important;
    min-width: 42px !important;
    height: 40px !important;
    padding: 0 !important;
    border-radius: 13px !important;
    justify-content: center !important;
  }
  body header .nav #avatarBtn .account-mark {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    font-size: 13px !important;
  }

  /* Signed out: hide the wallet/avatar (they were leaking through), show
     compact Sign In / Register in the same two grid cells. */
  body:not(.is-signed-in) header .nav #walletPill,
  body:not(.is-signed-in) header .nav #avatarBtn {
    display: none !important;
  }
  body:not(.is-signed-in) header .nav #signinBtn,
  body:not(.is-signed-in) header .nav #registerBtn {
    display: inline-flex !important;
    grid-row: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 12px !important;
    font-size: 13px !important;
    border-radius: 11px !important;
    white-space: nowrap !important;
    margin: 0 !important;
  }
  body:not(.is-signed-in) header .nav #signinBtn {
    grid-column: 2 !important;
    border: 1px solid rgba(255,255,255,0.14) !important;
    background: rgba(255,255,255,0.04) !important;
  }
  body:not(.is-signed-in) header .nav #registerBtn { grid-column: 3 !important; }
  body.is-signed-in header .nav #signinBtn,
  body.is-signed-in header .nav #registerBtn { display: none !important; }

  /* ---------- 5. Game grids & horizontal rows ----------
     Root cause of the overlapping/cut-off tiles: `.game{min-height:160px}` (≤480)
     + aspect-ratio 3/4 forces every tile to ≥120px wide — 4 of those don't fit
     in 360px, so the grid overflowed and neighbours overlapped. */
  .page .grid,
  section .grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .page .game,
  .grid .game {
    min-height: 0 !important;
    min-width: 0 !important;
    width: auto !important;
    aspect-ratio: 3 / 4 !important;
    padding: 8px !important;
    border-radius: 12px !important;
  }
  .grid .game-info { min-width: 0; }
  .grid .game-title {
    font-size: 12px !important;
    line-height: 1.15 !important;
    font-weight: 700 !important;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
  }
  .grid .game-provider {
    font-size: 10px !important;
    margin-top: 2px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .grid .game-badge {
    top: 6px !important;
    left: 6px !important;
    font-size: 8.5px !important;
    padding: 3px 6px !important;
    border-radius: 6px !important;
  }
  .grid .fav-btn {
    top: 4px !important;
    right: 4px !important;
    width: 30px !important;
    height: 30px !important;
    font-size: 13px !important;
  }
  .grid .game-art .art-glyph { font-size: 30px !important; }
  .grid .game-art .art-title { font-size: 11px !important; line-height: 1.05 !important; }

  /* New Games — horizontal scroller with snap and a hidden scrollbar. */
  .new-games-wrap {
    padding: 0 var(--sl-pad) !important;
    margin-top: 16px !important;
    overflow: hidden !important;
  }
  .new-games-head { margin-bottom: 8px !important; }
  .new-games-head h2 { font-size: 20px !important; }
  .new-games-arrow { width: 40px !important; height: 40px !important; }
  .new-games-view-all { padding: 8px 6px !important; font-size: 13px !important; min-height: 40px; display: inline-flex; align-items: center; }
  .new-games-scroll {
    display: flex !important;
    gap: 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 6px 0 12px !important;
    margin: 0 !important;
    scroll-snap-type: x mandatory !important;
    scroll-padding-left: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none !important;
    overscroll-behavior-x: contain;
  }
  .new-games-scroll::-webkit-scrollbar { display: none !important; width: 0; height: 0; }
  .new-games-scroll .ng-tile {
    flex: 0 0 auto !important;
    width: calc((100% - 20px) / 3) !important;
    min-width: 0 !important;
    max-width: none !important;
    border-radius: 12px !important;
    scroll-snap-align: start !important;
  }
  .new-games-scroll .ng-tile .ng-badge {
    top: 6px !important; left: 6px !important;
    font-size: 8.5px !important; padding: 3px 6px !important; border-radius: 6px !important;
  }
  .new-games-scroll .ng-tile .ng-label { left: 8px !important; right: 8px !important; bottom: 8px !important; }
  .new-games-scroll .ng-tile .ng-title {
    font-size: 12px !important; line-height: 1.15 !important;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  .new-games-scroll .ng-tile .ng-provider {
    font-size: 10px !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  /* Category chips row: snap + hidden scrollbar, 40px+ targets */
  .categories {
    padding: 0 var(--sl-pad) 4px !important;
    margin-top: 10px !important;
    gap: 8px !important;
    overflow-x: auto !important;
    scroll-snap-type: x proximity;
    scrollbar-width: none !important;
  }
  .categories::-webkit-scrollbar { display: none; }
  .cat {
    min-height: 40px !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    border-radius: 12px !important;
    scroll-snap-align: start;
    flex: 0 0 auto;
  }

  /* Search + sort row */
  .search-wrap { padding: 0 var(--sl-pad) !important; margin-top: 10px !important; }
  .search-wrap > div { gap: 8px !important; }
  .search-wrap .search-box { min-width: 0 !important; flex: 1 1 100% !important; }
  .search-wrap .search-box input { height: 46px !important; border-radius: 13px !important; }
  .search-wrap select#sortSelect {
    width: 100% !important;
    max-width: none !important;
    height: 44px !important;
    border-radius: 13px !important;
    padding: 0 14px !important;
  }

  section { padding: 0 var(--sl-pad) !important; margin: 18px auto !important; }
  .section-head { margin-bottom: 10px !important; }
  .section-head h2 { font-size: 19px !important; }

  /* Promo strip / trust bar / footer stacking */
  .promos-strip { padding: 0 var(--sl-pad); margin: 24px auto; gap: 10px; grid-template-columns: 1fr; }
  .promo { padding: 18px; }
  .promo .btn { min-height: 40px; }
  .trust-bar { margin: 24px var(--sl-pad) 0; padding: 16px 12px; gap: 12px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px 16px; }
  .footer-about { grid-column: 1 / -1; }
  .footer-about .logo { height: 40px; }
  .footer-about .logo .logo-video { height: 100%; width: auto; max-width: 180px; object-fit: contain; }
  .footer-col a { display: flex; align-items: center; min-height: 40px; font-size: 14px; }
  .footer-bottom { flex-wrap: wrap; gap: 10px; }

  /* ---------- 6. Tables & wide rows scroll inside their parent ----------
     There are no real <table>s on the public pages except the referral tier
     table (and the admin table on the hidden admin page); everything else
     (transactions, fairness history, leaderboard) is card/grid markup. */
  .page table,
  .legal table,
  .ref-tier-table,
  .admin-table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .page table th, .page table td { padding: 8px 10px; font-size: 13px; }
  .lb-row {
    grid-template-columns: 30px minmax(0, 1fr) auto auto !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    font-size: 12.5px !important;
  }
  .lb-row > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* fairness page: monospace hash inputs + their Copy/Save buttons */
  #page-fair .input-group input { min-width: 0; width: 100%; }
  #page-fair .input-group > div[style*="display:flex"] { flex-wrap: nowrap; }
  #page-fair .input-group > div[style*="display:flex"] > input { flex: 1 1 auto; }
  #page-fair .input-group > div[style*="display:flex"] > .btn { flex: 0 0 auto; min-height: 40px; }
  #page-fair .legal { padding: 16px 14px; }
  #page-fair .legal > div[style*="padding:20px"] { padding: 14px !important; }
  #page-fair code, #page-fair pre { overflow-wrap: anywhere; word-break: break-word; }
  #pfHistoryList > div > div:first-child { flex-direction: column; align-items: flex-start !important; gap: 4px !important; }
  #pfHistoryList > div > div:first-child > div[style*="text-align:right"] { text-align: left !important; }
  /* transaction rows */
  .tx-row, .tx-item { gap: 10px; }
  .tx-amount { white-space: nowrap; }

  /* ---------- 7. Modals → bottom sheets with internal scroll ----------
     The game launcher (#launcherModal) is a raw full-bleed div, not `.modal`,
     so it stays fullscreen. */
  .modal-backdrop {
    padding: 0 !important;
    align-items: flex-end !important;
    justify-content: center !important;
  }
  .modal-backdrop .modal {
    width: 100% !important;
    max-width: none !important;
    min-height: 40vh;
    max-height: calc(100vh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    margin: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none !important;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    animation: slSheetUp .28s cubic-bezier(.2,.8,.2,1);
  }
  @keyframes slSheetUp {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  /* drag-handle affordance */
  .modal-backdrop .modal::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.22);
    margin: 8px auto -4px;
    flex: 0 0 auto;
  }
  .modal-backdrop .modal .modal-header {
    flex: 0 0 auto;
    padding: 12px 16px;
    gap: 10px;
  }
  .modal-backdrop .modal .modal-header h3 {
    font-size: 17px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .modal-backdrop .modal .modal-close {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    background: rgba(255,255,255,0.05);
  }
  .modal-backdrop .modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 16px 16px calc(20px + var(--sl-safe-b)) !important;
  }
  .modal-tabs { gap: 4px; }
  .modal-tab { min-height: 40px; font-size: 13px; padding: 8px 10px; }
  .game-modal .game-meta { gap: 8px; }
  .game-modal .meta-item { padding: 10px 6px; }
  .game-modal .meta-item .value { font-size: 15px; }
  .game-modal .similar-games { gap: 8px; }
  .balance-display .amount { font-size: clamp(22px, 7vw, 30px); overflow-wrap: anywhere; }

  /* Game launcher top bar: title truncates, nothing wraps or collides */
  #launcherModal > div > div:first-child {
    padding: 8px 10px !important;
    gap: 8px !important;
    min-height: 48px;
  }
  #launcherModal > div > div:first-child > div {
    min-width: 0;
    gap: 8px !important;
    flex-wrap: nowrap;
  }
  #launcherModal > div > div:first-child > div:first-child { flex: 1 1 auto; overflow: hidden; }
  #launcherModal > div > div:first-child > div:last-child { flex: 0 0 auto; }
  #launcherTitle {
    font-size: 14px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  #launcherProvider { display: none !important; }
  #launcherBalance { white-space: nowrap; font-size: 13px !important; }
  #launcherModal .btn-ghost { min-height: 36px; padding: 6px 10px !important; font-size: 13px; white-space: nowrap; }

  /* ---------- 8. Touch targets ≥ 40px ---------- */
  .btn { min-height: 40px; }
  .btn-block { min-height: 46px; }
  .drawer-close { width: 40px; height: 40px; }
  .account-nav button { min-height: 40px; }
  .chat-header .modal-close { width: 40px; height: 40px; }
  .cookie-banner .btn { min-height: 40px; }
  .pager button, #pfHistoryPager .btn { min-height: 40px; }

  /* ---------- 9. Decorative floating win bubbles: off on phones ---------- */
  .wins-ticker,
  .win-bubble,
  .win-feed, .big-win-feed, .recent-wins, .live-wins, .win-toast-stack {
    display: none !important;
  }

  /* ---------- 10. Account drawer: unchanged (deliberately no rules) ---------- */

  /* ---------- Account page: sidebar nav becomes a chip rail ---------- */
  #page-account .account-grid { grid-template-columns: 1fr !important; gap: 14px; }
  #page-account .account-side { padding: 12px; }
  #page-account .account-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding: 2px 0 6px;
    margin: 8px -12px 0;
    padding-left: 12px;
    padding-right: 12px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  #page-account .account-nav::-webkit-scrollbar { display: none; }
  #page-account .account-nav button {
    flex: 0 0 auto;
    white-space: nowrap;
    margin: 0 !important;
    padding: 8px 12px;
    scroll-snap-align: start;
  }
  #page-account .account-profile { padding-bottom: 6px; }

  /* ---------- Toast & cookie banner: above the bar, never full-width blobs ---------- */
  #toast {
    bottom: calc(var(--sl-bottom-reserve) + 18px);
    width: max-content;
    max-width: calc(100vw - 32px);
    text-align: center;
    padding: 12px 18px;
    font-size: 14px;
  }
  #cookieBanner.cookie-banner {
    left: 8px !important;
    right: 8px !important;
    bottom: calc(var(--sl-bottom-reserve) + 12px) !important;
    max-width: none !important;
    padding: 12px 14px !important;
    border-radius: 16px !important;
    gap: 10px !important;
  }
  #cookieBanner .text { font-size: 13px; line-height: 1.4; }
  #cookieBanner .actions { display: flex; gap: 8px; flex-wrap: wrap; }
  #cookieBanner .actions .btn { flex: 1 1 auto; justify-content: center; }

  /* ---------- Landing page (signed-out) ---------- */
  #page-landing .land-hero { padding: 36px var(--sl-pad) 24px; }
  #page-landing .land-hero h1 { font-size: clamp(30px, 9vw, 44px); line-height: 1.05; overflow-wrap: anywhere; }
  #page-landing .land-hero .sub { font-size: 15px; }
  #page-landing .land-cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
  #page-landing .land-cta .btn { flex: 1 1 100%; justify-content: center; min-height: 46px; }
  #page-landing .land-stats { margin: 20px var(--sl-pad); padding: 16px; grid-template-columns: 1fr 1fr; gap: 10px; }
  #page-landing .land-section { padding-left: var(--sl-pad); padding-right: var(--sl-pad); }
  #page-landing .features-grid, #page-landing .testimonials { grid-template-columns: 1fr; gap: 12px; }
  #page-landing .feature, #page-landing .testimonial { padding: 18px; }

  /* Tournaments / promotions cards */
  .tourney { grid-template-columns: 1fr !important; }
  .tourney-side { border-left: none !important; border-top: 1px solid var(--line); }
  .promo-card .promo-body, .promo-card { min-width: 0; }
  .promo-card .btn { min-height: 40px; }
}

/* ==========================================================================
   Narrow phones (< 360px): 2-column grids
   ========================================================================== */
@media (max-width: 359px) {
  .page .grid,
  section .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .new-games-scroll .ng-tile { width: calc((100% - 10px) / 2) !important; }
  .mobile-cat-bar a { font-size: 9px; }
  .mobile-cat-bar a img { width: 22px; height: 22px; }
  #page-home .hero h1 { font-size: 21px !important; }
  body header .nav > .logo { height: 42px !important; }
  body header .nav #walletPill { max-width: 120px !important; }
  body header .nav #walletPill .balance { max-width: 64px !important; }
}

/* ==========================================================================
   Landscape phones (short viewports): compact header + bar so content shows
   ========================================================================== */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  :root { --sl-nav-h: 46px; --sl-nav-gap: 6px; }

  body header .nav,
  body.slotary-mobile-scrolled header .nav {
    margin: 4px auto !important;
    padding: 4px 8px !important;
    border-radius: 14px !important;
  }
  body header .nav > .logo { height: 36px !important; }
  body header .nav #walletPill,
  body header .nav #avatarBtn,
  body:not(.is-signed-in) header .nav #signinBtn,
  body:not(.is-signed-in) header .nav #registerBtn { height: 34px !important; min-height: 34px !important; }

  .mobile-cat-bar { left: 8px; right: 8px; padding: 4px; gap: 4px; border-radius: 14px; }
  .mobile-cat-bar a { flex-direction: row; gap: 6px; padding: 0 8px; font-size: 10px; border-radius: 10px; }
  .mobile-cat-bar a img { width: 22px; height: 22px; }

  #page-home .hero:not(.hero-collapsed) { padding: 6px var(--sl-pad) 2px !important; }
  #page-home .hero-slides { height: 220px !important; }
  #page-home .hero-content { padding: 12px 16px 30px !important; max-width: 70% !important; }
  #page-home .hero h1 { font-size: 22px !important; }
  #page-home .hero p { -webkit-line-clamp: 2; margin-bottom: 8px !important; }

  .page .grid, section .grid { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
  .new-games-scroll .ng-tile { width: calc((100% - 40px) / 5) !important; }

  body #chatBubble, body.slotary-mobile-scrolled #chatBubble { width: 40px !important; height: 40px !important; font-size: 18px !important; }
  .modal-backdrop .modal { min-height: 0; max-height: 100vh !important; max-height: 100dvh !important; border-radius: 0 !important; }
  .modal-backdrop .modal::before { display: none; }
}
