    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --coral:  #FF4D6D;
      --yellow: #FFD60A;
      --cyan:   #00F5D4;
      --violet: #7B2FBE;
      --lime:   #BAFF29;
      --bg:     #0D0D0D;
    }

    html, body {
      min-height: 100%;
      background: var(--bg);
      font-family: 'Syne', sans-serif;
      color: #fff;
      overflow-x: hidden;
    }

    /* ── Blobs ── */
    .blobs {
      position: fixed; inset: 0;
      pointer-events: none; z-index: 0;
      /* No filter here — blur per-blob so Firefox only blurs each circle, not the whole viewport */
    }
    .blob {
      position: absolute; border-radius: 50%;
      filter: blur(60px); opacity: 0.45;
      will-change: transform;
    }
    .blob:nth-child(1) { width:500px;height:500px;background:var(--coral);top:-150px;left:-100px;animation:d1 22s ease-in-out infinite; }
    .blob:nth-child(2) { width:420px;height:420px;background:var(--violet);bottom:-120px;right:-80px;animation:d2 28s ease-in-out infinite; }
    .blob:nth-child(3) { width:320px;height:320px;background:var(--cyan);top:40%;left:50%;animation:d3 18s ease-in-out infinite; }
    /* translate3d keeps blobs on their own GPU layer */
    @keyframes d1 { 0%,100%{transform:translate3d(0,0,0)} 50%{transform:translate3d(60px,80px,0)} }
    @keyframes d2 { 0%,100%{transform:translate3d(0,0,0)} 50%{transform:translate3d(-70px,-60px,0)} }
    @keyframes d3 { 0%,100%{transform:translate3d(0,0,0)} 50%{transform:translate3d(-100px,60px,0)} }

    /* ── Cursor glow ── */
    #cglow {
      position: fixed; width:280px;height:280px; border-radius:50%;
      background:radial-gradient(circle,rgba(255,255,255,0.05) 0%,transparent 70%);
      transform:translate(-50%,-50%); pointer-events:none; z-index:1;
    }

    /* ── Header ── */
    header {
      position: relative; z-index: 10;
      display: flex; align-items: center; justify-content: space-between;
      padding: 20px 40px;
      border-bottom: 1px solid rgba(255,255,255,0.07);
      background: rgba(13,13,13,0.92);
    }
    .breadcrumb {
      font-size: 0.85rem; font-weight: 700;
      letter-spacing: 0.05em; color: rgba(255,255,255,0.4);
    }
    .breadcrumb a { color: rgba(255,255,255,0.4); text-decoration: none; }
    .breadcrumb a:hover { color: var(--coral); }
    .breadcrumb span { color: rgba(255,255,255,0.8); margin-left: 4px; }

    #balance-display {
      font-size: 1rem; font-weight: 800;
      color: var(--yellow);
      display: flex; align-items: center; gap: 8px;
      background: rgba(255,214,10,0.08);
      border: 1px solid rgba(255,214,10,0.2);
      padding: 8px 18px; border-radius: 999px;
      transition: transform 0.15s;
    }
    #balance-display.bump { animation: bump 0.3s ease; }
    @keyframes bump { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }

    /* ── Page title ── */
    .page-title {
      position: relative; z-index: 10;
      text-align: center; padding: 56px 20px 12px;
    }
    .page-title h1 {
      font-size: clamp(2.2rem, 6vw, 5rem);
      font-weight: 800; letter-spacing: -0.02em;
      background: linear-gradient(90deg,var(--coral),var(--yellow),var(--lime),var(--cyan),var(--coral));
      background-size: 200% auto;
      -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
      animation: shimmer 4s linear infinite;
    }
    .page-title p {
      margin-top: 10px; font-size: 1rem; font-weight: 700;
      color: rgba(255,255,255,0.4); letter-spacing: 0.04em;
    }
    @keyframes shimmer { from{background-position:0% center} to{background-position:200% center} }

    /* ── Game grid ── */
    .game-grid {
      position: relative; z-index: 10;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 20px; padding: 40px;
      max-width: 1200px; margin: 0 auto;
    }

    .game-card {
      background: rgba(255,255,255,0.04);
      border: 1.5px solid rgba(255,255,255,0.08);
      border-radius: 20px; padding: 32px 28px;
      cursor: pointer;
      transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
      display: flex; flex-direction: column; gap: 12px;
    }
    .game-card:hover {
      transform: translateY(-6px);
      border-color: var(--accent);
      box-shadow: 0 0 30px -5px var(--accent);
    }
    .game-card .icon {
      font-size: 2.4rem;
      color: var(--accent);
      filter: drop-shadow(0 0 10px var(--accent));
      transition: filter 0.2s, transform 0.2s;
    }
    .game-card:hover .icon {
      filter: drop-shadow(0 0 18px var(--accent));
      transform: scale(1.1);
    }
    .game-card h2 { font-size: 1.3rem; font-weight: 800; color: var(--accent); }

    /* FA icon inside modal title */
    #modal-title i { margin-right: 8px; opacity: 0.85; }
    .game-card p  { font-size: 0.8rem; font-weight: 700; color: rgba(255,255,255,0.4); line-height: 1.5; }
    .game-card .odds {
      margin-top: auto; font-size: 0.7rem; font-weight: 700;
      letter-spacing: 0.08em; text-transform: uppercase;
      color: rgba(255,255,255,0.25);
    }

    /* ── Modal ── */
    #modal {
      position: fixed; inset: 0; z-index: 500;
      background: rgba(0,0,0,0.85);
      display: none; align-items: center; justify-content: center;
    }
    #modal.open { display: flex; }
    #modal-box {
      background: #141414;
      border-radius: 24px;
      padding: 36px 40px;
      min-width: 340px; max-width: 480px; width: 90%;
      border: 2px solid var(--modal-accent, #fff);
      box-shadow: 0 0 60px -10px var(--modal-accent, #fff);
      position: relative;
      animation: popIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
    }
    @keyframes popIn { from{transform:scale(0.85);opacity:0} to{transform:scale(1);opacity:1} }
    #modal-box h2 {
      font-size: 1.4rem; font-weight: 800; letter-spacing: 0.04em;
      color: var(--modal-accent, #fff); margin-bottom: 20px; text-align: center;
    }
    #modal-content { /* game-specific content goes here */ }

    /* ── Shared modal UI pieces ── */
    .bet-row {
      display: flex; align-items: center; gap: 10px;
      margin: 16px 0;
    }
    .bet-row label { font-size: 0.8rem; font-weight: 700; color: rgba(255,255,255,0.4); white-space: nowrap; }
    .bet-row input {
      flex: 1; background: rgba(255,255,255,0.06);
      border: 1.5px solid rgba(255,255,255,0.15);
      border-radius: 10px; padding: 8px 14px;
      font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700;
      color: #fff; outline: none;
      transition: border-color 0.2s;
    }
    .bet-row input:focus { border-color: var(--modal-accent, #fff); }

    .btn {
      font-family: 'Syne', sans-serif; font-size: 0.85rem; font-weight: 800;
      letter-spacing: 0.05em; cursor: pointer;
      border: none; border-radius: 10px; padding: 11px 22px;
      transition: transform 0.12s, opacity 0.12s;
    }
    .btn:hover { transform: scale(1.04); }
    .btn:active { transform: scale(0.97); }
    .btn-primary {
      background: var(--modal-accent, #fff);
      color: #0D0D0D;
    }
    .btn-ghost {
      background: rgba(255,255,255,0.07);
      color: rgba(255,255,255,0.6);
    }
    .btn-row { display: flex; gap: 10px; margin-top: 18px; justify-content: center; }

    /* ── Clerk user/sign-in slot ── */
    #clerk-user-mount {
      display: flex; align-items: center;
    }
    /* Sign-in button — matches tcm-btn/shop-link pill style */
    #clerk-signin-btn {
      font-family: 'Syne', sans-serif; font-size: 0.72rem; font-weight: 800;
      letter-spacing: 0.04em; cursor: pointer; white-space: nowrap;
      padding: 8px 16px; border-radius: 999px;
      background: rgba(255,77,109,0.1);
      border: 1.5px solid rgba(255,77,109,0.28);
      color: rgba(255,77,109,0.85);
      transition: background 0.15s, border-color 0.15s;
    }
    #clerk-signin-btn:hover { background: rgba(255,77,109,0.18); border-color: rgba(255,77,109,0.5); }
    /* Clerk UserButton sizing override */
    #clerk-user-mount .cl-userButtonBox,
    #clerk-user-mount .cl-userButtonAvatarBox { width: 32px !important; height: 32px !important; }

    /* ── Profile button (header) ── */
    #profile-btn {
      display: flex; align-items: center; gap: 8px;
      background: rgba(255,255,255,0.05);
      border: 1.5px solid rgba(255,255,255,0.1);
      border-radius: 999px; padding: 6px 14px 6px 6px;
      cursor: pointer; font-family: 'Syne', sans-serif;
      font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em;
      color: rgba(255,255,255,0.65);
      transition: background 0.18s, border-color 0.18s;
    }
    #profile-btn:hover { background: rgba(255,255,255,0.09); }
    .p-avatar {
      width: 26px; height: 26px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 0.78rem; font-weight: 900; color: #000; flex-shrink: 0;
    }
    #profile-name-el { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* ── Profile setup full-screen overlay ── */
    #profile-setup {
      position: fixed; inset: 0; z-index: 900;
      background: rgba(0,0,0,0.94);
      display: flex; align-items: center; justify-content: center;
    }
    #psetup-box {
      background: #141414; border: 2px solid rgba(255,255,255,0.1);
      border-radius: 24px; padding: 40px 36px;
      width: 90%; max-width: 380px; text-align: center;
      animation: popIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
    }
    .color-swatch {
      width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
      border: 3px solid transparent; transition: transform 0.15s, border-color 0.15s;
      flex-shrink: 0;
    }
    .color-swatch.sel { border-color: #fff; transform: scale(1.2); }

    /* ── Stats grid inside profile modal ── */
    .stat-pill {
      background: rgba(255,255,255,0.05); border-radius: 10px;
      padding: 10px 8px; text-align: center;
    }
    .stat-pill .sv { font-size: 1.15rem; font-weight: 900; }
    .stat-pill .sk { font-size: 0.6rem; color: rgba(255,255,255,0.3); margin-top: 2px; letter-spacing: .06em; }
    .game-row-stat {
      display: flex; justify-content: space-between; align-items: center;
      padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,0.04);
      font-size: 0.73rem;
    }
    .game-row-stat:last-child { border-bottom: none; }
    .recent-row {
      display: flex; justify-content: space-between; align-items: center;
      padding: 5px 8px; background: rgba(255,255,255,0.03);
      border-radius: 7px; font-size: 0.7rem; gap: 6px;
    }

    .result-box {
      text-align: center; padding: 16px 0; min-height: 80px;
    }
    .result-label {
      font-size: 1.6rem; font-weight: 800; letter-spacing: 0.04em;
      animation: resultPop 0.3s cubic-bezier(0.34,1.56,0.64,1);
    }
    .result-delta {
      font-size: 1rem; font-weight: 700; margin-top: 4px;
      animation: resultPop 0.3s cubic-bezier(0.34,1.56,0.64,1) 0.05s both;
    }
    .result-balance { font-size: 0.75rem; color: rgba(255,255,255,0.3); margin-top: 4px; }
    @keyframes resultPop { from{transform:scale(0.6);opacity:0} to{transform:scale(1);opacity:1} }

    .win  { color: var(--lime); }
    .lose { color: var(--coral); }
    .push { color: var(--yellow); }

    /* ── Slots reels ── */
    .reels {
      display: flex; gap: 12px; justify-content: center;
      background: rgba(0,0,0,0.3); border-radius: 14px;
      padding: 16px 20px; margin: 16px 0;
    }
    .reel {
      width: 76px; height: 76px; background: rgba(255,255,255,0.07);
      border-radius: 10px; border: 2px solid rgba(255,255,255,0.15);
      display: flex; align-items: center; justify-content: center;
      font-size: 2rem; font-weight: bold;
      overflow: hidden; position: relative;
      transition: border-color 0.3s;
    }
    /* Scrolling reel strip */
    .reel-strip {
      display: flex; flex-direction: column;
      align-items: center; position: absolute; top: 0;
      will-change: transform;
    }
    .reel-strip.spin { animation: reel-scroll 0.22s linear infinite; }
    .reel-sym { width:76px; height:76px; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:2rem; }
    @keyframes reel-scroll { from{transform:translateY(0)} to{transform:translateY(-76px)} }
    .reel-final {
      font-size: 2.2rem;
      animation: reel-land 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }
    @keyframes reel-land {
      0%   { transform:scale(0.15) translateY(-14px); opacity:0; filter:blur(6px); }
      55%  { filter:blur(0); }
      100% { transform:scale(1) translateY(0); opacity:1; }
    }
    .reel.stopped { transform: scale(1.07); transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1); }

    /* ── Coin flip ── */
    .coin-choices { display: flex; gap: 12px; justify-content: center; margin: 20px 0; }
    .coin-btn {
      font-family: 'Syne', sans-serif; font-size: 1.5rem; font-weight: 800;
      width: 90px; height: 90px; border-radius: 50%;
      border: 2.5px solid rgba(255,255,255,0.2);
      background: rgba(255,255,255,0.05);
      color: #fff; cursor: pointer;
      transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
      display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    }
    .coin-btn span { font-size: 0.6rem; letter-spacing: 0.08em; }
    .coin-btn:hover {
      transform: scale(1.08);
      border-color: var(--yellow);
      box-shadow: 0 0 20px rgba(255,214,10,0.3);
    }
    /* 3D Coin */
    .coin-3d { perspective: 500px; width:90px; height:90px; margin:12px auto; }
    .coin-inner {
      width:100%; height:100%;
      transform-style: preserve-3d;
      border-radius: 50%;
    }
    .coin-inner.flip-heads { animation: coinFlipH 1.0s cubic-bezier(0.15, 0, 0.35, 1) forwards; }
    .coin-inner.flip-tails { animation: coinFlipT 1.0s cubic-bezier(0.15, 0, 0.35, 1) forwards; }
    @keyframes coinFlipH {
      0%   { transform:rotateY(0deg) scale(1); }
      40%  { transform:rotateY(1260deg) scale(0.85); }
      100% { transform:rotateY(2160deg) scale(1); }  /* 0° mod 360 → heads */
    }
    @keyframes coinFlipT {
      0%   { transform:rotateY(0deg) scale(1); }
      40%  { transform:rotateY(1260deg) scale(0.85); }
      100% { transform:rotateY(2340deg) scale(1); }  /* 180° mod 360 → tails */
    }
    .coin-face {
      position:absolute; width:100%; height:100%;
      backface-visibility:hidden;
      display:flex; align-items:center; justify-content:center;
      font-size:3.5rem; border-radius:50%;
      box-shadow: 0 0 20px rgba(255,214,10,0.25);
    }
    .coin-face-back { transform:rotateY(180deg); }

    /* ── Dice ── */
    .dice-display { display: flex; gap: 24px; justify-content: center; align-items: center; margin: 20px 0; }
    .die {
      width: 70px; height: 70px; border-radius: 12px;
      background: rgba(255,255,255,0.07);
      border: 2px solid rgba(255,255,255,0.2);
      display: flex; align-items: center; justify-content: center;
      font-size: 2.2rem; font-weight: 800;
      transition: transform 0.3s, border-color 0.3s;
      transform-style: preserve-3d;
    }
    .die.rolling { animation: diceTumble 0.35s ease-in-out infinite; }
    @keyframes diceTumble {
      0%   { transform:perspective(200px) rotateX(0deg) rotateY(0deg) scale(1); }
      25%  { transform:perspective(200px) rotateX(18deg) rotateY(25deg) scale(0.92); }
      50%  { transform:perspective(200px) rotateX(-12deg) rotateY(-20deg) scale(0.95); }
      75%  { transform:perspective(200px) rotateX(22deg) rotateY(-18deg) scale(0.9); }
      100% { transform:perspective(200px) rotateX(0deg) rotateY(0deg) scale(1); }
    }
    .die.landed { animation: diceLand 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
    @keyframes diceLand {
      0%   { transform:perspective(200px) rotateX(35deg) rotateY(15deg) scale(1.15); filter:blur(2px); }
      60%  { filter:blur(0); }
      100% { transform:perspective(200px) rotateX(0deg) rotateY(0deg) scale(1); }
    }
    .vs-label { font-size: 0.75rem; font-weight: 800; color: rgba(255,255,255,0.3); letter-spacing: 0.1em; }

    /* ── Hi-Lo ── */
    .hilo-card {
      width: 90px; height: 130px; border-radius: 12px;
      background: #fff; color: #111;
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      font-size: 2rem; font-weight: 800; margin: 0 auto 16px;
      box-shadow: 0 8px 30px rgba(0,0,0,0.5);
      transition: transform 0.2s;
    }
    .hilo-card.red { color: var(--coral); }
    .hilo-suit { font-size: 1rem; margin-top: 4px; }
    .hilo-btns { display: flex; gap: 12px; justify-content: center; }
    .hilo-btn {
      font-family: 'Syne', sans-serif; font-size: 0.85rem; font-weight: 800;
      padding: 10px 24px; border-radius: 10px; border: none; cursor: pointer;
      transition: transform 0.12s;
    }
    .hilo-btn:hover { transform: scale(1.05); }
    .hilo-higher { background: var(--lime); color: #0D0D0D; }
    .hilo-lower  { background: var(--coral); color: #fff; }
    .hilo-streak { text-align: center; font-size: 0.75rem; font-weight: 700; color: rgba(255,255,255,0.4); margin-bottom: 12px; }

    /* ── Roulette ── */
    .wheel-wrap {
      position: relative;
      text-align: center; margin: 16px 0;
      padding-top: 26px;
    }
    /* Pointer lives on the wrapper — does NOT rotate */
    .wheel-wrap::before {
      content: '▼';
      position: absolute; top: 2px; left: 50%;
      transform: translateX(-50%);
      font-size: 1.1rem; color: var(--yellow);
      text-shadow: 0 0 8px var(--yellow);
      z-index: 2;
    }
    .wheel {
      width: 160px; height: 160px; border-radius: 50%;
      margin: 0 auto 14px;
      /* Red  0–170°  |  thin divider  |  Black 171–340°  |  thin divider  |  Green 341–360° */
      background: conic-gradient(
        var(--coral)  0deg   170deg,
        rgba(255,255,255,0.25) 170deg 172deg,
        #2e2e2e       172deg  340deg,
        rgba(255,255,255,0.25) 340deg 342deg,
        #1a8a2a       342deg  360deg
      );
      border: 4px solid rgba(255,255,255,0.2);
      box-shadow: 0 0 24px rgba(0,0,0,0.6), inset 0 0 12px rgba(0,0,0,0.4);
      transition: transform 3s cubic-bezier(0.17,0.67,0.12,1);
    }
    .roulette-choices { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 5px 0; }

    /* ── Mode Switcher (game variant tabs) ── */
    .mode-switcher {
      display: flex; gap: 5px; justify-content: center; flex-wrap: wrap;
      margin: 0 0 10px;
    }
    .mode-chip {
      font-family: 'Syne', sans-serif; font-size: 0.68rem; font-weight: 800;
      letter-spacing: 0.04em; cursor: pointer; white-space: nowrap;
      padding: 4px 13px; border-radius: 999px;
      background: rgba(255,255,255,0.05);
      border: 1.5px solid rgba(255,255,255,0.1);
      color: rgba(255,255,255,0.38);
      transition: all 0.15s;
    }
    .mode-chip:hover { border-color: rgba(255,255,255,0.28); color: rgba(255,255,255,0.72); }
    .mode-chip.active {
      background: rgba(255,255,255,0.12);
      border-color: var(--modal-accent, #fff);
      color: var(--modal-accent, #fff);
    }

    /* ── Wheel of Fortune ── */
    .wof-wheel {
      width: 160px; height: 160px; border-radius: 50%;
      margin: 0 auto 14px;
      background: conic-gradient(
        #ef4444 0deg 29deg, rgba(0,0,0,0.4) 29deg 31deg,
        #ef4444 31deg 59deg, rgba(0,0,0,0.4) 59deg 61deg,
        #f59e0b 61deg 89deg, rgba(0,0,0,0.4) 89deg 91deg,
        #f59e0b 91deg 119deg, rgba(0,0,0,0.4) 119deg 121deg,
        #84cc16 121deg 149deg, rgba(0,0,0,0.4) 149deg 151deg,
        #84cc16 151deg 179deg, rgba(0,0,0,0.4) 179deg 181deg,
        #06b6d4 181deg 209deg, rgba(0,0,0,0.4) 209deg 211deg,
        #3b82f6 211deg 239deg, rgba(0,0,0,0.4) 239deg 241deg,
        #7c3aed 241deg 269deg, rgba(0,0,0,0.4) 269deg 271deg,
        #ec4899 271deg 299deg, rgba(0,0,0,0.4) 299deg 301deg,
        #FFD60A 301deg 329deg, rgba(0,0,0,0.4) 329deg 331deg,
        #f8fafc 331deg 359deg, rgba(0,0,0,0.4) 359deg 360deg
      );
      border: 4px solid rgba(255,255,255,0.2);
      box-shadow: 0 0 24px rgba(0,0,0,0.6), inset 0 0 12px rgba(0,0,0,0.4);
      transition: transform 3.5s cubic-bezier(0.17,0.67,0.12,1);
    }
    .rou-btn {
      font-family: 'Syne', sans-serif; font-size: 0.8rem; font-weight: 800;
      padding: 10px 18px; border-radius: 10px; border: 2px solid transparent;
      cursor: pointer; transition: transform 0.12s, border-color 0.15s;
    }
    .rou-btn:hover { transform: scale(1.06); border-color: rgba(255,255,255,0.3); }
    .rou-red   { background: var(--coral); color: #fff; }
    .rou-black { background: #333; color: #fff; }
    .rou-green { background: #1a8a2a; color: #fff; }

    /* ── Blackjack Solo ── */
    .bj-section { text-align:center; margin:8px 0; }
    .bj-section-lbl { font-size:0.68rem; font-weight:800; color:rgba(255,255,255,0.38); letter-spacing:.07em; text-transform:uppercase; margin-bottom:5px; }
    .bj-hand { display:flex; flex-wrap:wrap; gap:6px; justify-content:center; min-height:68px; align-items:center; }
    .bj-card {
      display:inline-flex; align-items:center; justify-content:center;
      width:44px; height:62px; border-radius:8px; position:relative;
      background:#f5f5f5; color:#111; font-size:0.95rem; font-weight:900;
      box-shadow:0 4px 10px rgba(0,0,0,0.55);
      animation:bjDeal 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
    }
    .bj-card.red { color:#dc2626; }
    .bj-card.face-down { background:linear-gradient(135deg,#1e3a5f,#0f2444); color:rgba(255,255,255,0.25); font-size:1.5rem; }
    @keyframes bjDeal { from{transform:scale(0.2) translateY(-18px) rotate(-8deg);opacity:0} to{transform:none;opacity:1} }
    @keyframes fadeSlideIn { from{transform:translateY(-6px);opacity:0} to{transform:none;opacity:1} }
    .bj-section { margin:8px 0; }
    .bj-section .bj-label { font-size:0.72rem;font-weight:700;color:rgba(255,255,255,0.45);letter-spacing:0.05em;text-transform:uppercase;margin-bottom:4px; }
    .bj-score-lbl { font-size:0.75rem; font-weight:800; color:rgba(255,255,255,0.4); margin-top:6px; }

    /* ── Quick Draw ── */
    .qd-arena { display:flex; flex-direction:column; align-items:center; gap:10px; padding:10px 0 4px; }
    .qd-ring {
      width:120px; height:120px; border-radius:50%;
      border:3px solid rgba(255,255,255,0.12);
      display:flex; align-items:center; justify-content:center;
      font-size:1rem; font-weight:900; letter-spacing:.05em; transition:all 0.12s;
    }
    .qd-ring.waiting { color:rgba(255,255,255,0.2); animation:qdPulse 1.6s ease-in-out infinite; }
    .qd-ring.draw    { border-color:#BAFF29; color:#BAFF29; background:rgba(186,255,41,0.07); font-size:1.5rem; box-shadow:0 0 40px rgba(186,255,41,0.4); animation:qdPop 0.18s cubic-bezier(0.34,1.56,0.64,1); }
    @keyframes qdPulse { 0%,100%{transform:scale(1);border-color:rgba(255,255,255,0.12)} 50%{transform:scale(1.07);border-color:rgba(255,255,255,0.22)} }
    @keyframes qdPop   { from{transform:scale(0.75)} to{transform:scale(1)} }
    .qd-hint { font-size:0.7rem; color:rgba(255,255,255,0.28); letter-spacing:.04em; }

    /* ── Scratch Card ── */
    .sc-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:12px auto; max-width:268px; }
    .sc-tile {
      aspect-ratio:1; border-radius:12px; border:2px solid rgba(255,255,255,0.1);
      background:rgba(255,255,255,0.04); font-size:0; cursor:pointer;
      display:flex; align-items:center; justify-content:center; transition:all 0.12s;
      position:relative; overflow:hidden;
    }
    .sc-tile:not([disabled]):hover { background:rgba(255,255,255,0.09); border-color:rgba(255,255,255,0.22); transform:scale(1.04); }
    .sc-tile.revealed { font-size:1.8rem; animation:scReveal 0.32s cubic-bezier(0.34,1.56,0.64,1) both; cursor:default; }
    .sc-tile.is-match   { border-color:#BAFF29; background:rgba(186,255,41,0.09); box-shadow:0 0 14px rgba(186,255,41,0.28); }
    .sc-tile.is-disaster{ border-color:#FF4D6D; background:rgba(255,77,109,0.07); }
    .sc-tile::before { content:'❓'; font-size:1.5rem; }
    .sc-tile.revealed::before { display:none; }
    @keyframes scReveal { from{transform:scale(0.3) rotate(-12deg);opacity:0} to{transform:none;opacity:1} }

    /* ── Plinko ── */
    .plinko-risk {
      font-family:'Syne',sans-serif; font-size:0.78rem; font-weight:800;
      padding:7px 18px; border-radius:9px; border:2px solid rgba(255,255,255,0.14);
      background:rgba(255,255,255,0.05); color:rgba(255,255,255,0.5); cursor:pointer; transition:all 0.14s;
    }
    .plinko-risk.active { background:var(--cyan); color:#000; border-color:var(--cyan); box-shadow:0 0 16px rgba(0,245,212,0.3); }

    /* ── Wheel of Fortune ── */
    .wof-wrap { position:relative; width:220px; margin:8px auto 4px; }
    .wof-pointer { position:absolute; top:-4px; left:50%; transform:translateX(-50%); font-size:1.2rem; color:var(--yellow); text-shadow:0 0 10px var(--yellow); z-index:2; pointer-events:none; line-height:1; }

    /* ── Ticker ── */
    .ticker-price { font-size:2rem; font-weight:900; text-align:center; font-variant-numeric:tabular-nums; transition:color 0.15s; }
    .ticker-price.up   { color:#BAFF29; }
    .ticker-price.down { color:#FF4D6D; }
    .ticker-price.flat { color:rgba(255,255,255,0.8); }
    .ticker-pnl { text-align:center; font-size:0.88rem; font-weight:800; letter-spacing:.04em; min-height:22px; }

    /* ── Memory Match ── */
    .mm-status { display:flex; justify-content:space-between; font-size:0.72rem; font-weight:800; color:rgba(255,255,255,0.38); letter-spacing:.04em; margin-bottom:8px; }
    .mm-mult-lbl { color:var(--lime) !important; font-size:0.88rem !important; }
    .mm-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; max-width:272px; margin:0 auto; }
    .mm-card-wrap { aspect-ratio:1; perspective:500px; cursor:pointer; }
    .mm-card-inner {
      width:100%; height:100%; position:relative;
      transform-style:preserve-3d; border-radius:9px;
      transition:transform 0.32s cubic-bezier(0.4,0,0.2,1);
    }
    .mm-card-wrap.flipped .mm-card-inner  { transform:rotateY(180deg); }
    .mm-card-wrap.matched  .mm-card-inner { transform:rotateY(180deg); }
    .mm-card-face {
      position:absolute; inset:0; border-radius:9px;
      display:flex; align-items:center; justify-content:center;
      backface-visibility:hidden; -webkit-backface-visibility:hidden;
    }
    .mm-card-front { background:rgba(255,255,255,0.05); border:1.5px solid rgba(255,255,255,0.1); font-size:1.3rem; color:rgba(255,255,255,0.12); }
    .mm-card-back  { background:rgba(168,85,247,0.1); border:1.5px solid rgba(168,85,247,0.28); font-size:1.5rem; transform:rotateY(180deg); }
    .mm-card-wrap.matched .mm-card-back  { background:rgba(186,255,41,0.1); border-color:rgba(186,255,41,0.4); animation:mmMatch 0.3s cubic-bezier(0.34,1.56,0.64,1); }
    .mm-card-wrap.wrong   .mm-card-inner { animation:mmWrong 0.4s cubic-bezier(0.4,0,0.2,1) forwards; }
    @keyframes mmMatch { 0%,100%{transform:rotateY(180deg)} 50%{transform:rotateY(180deg) scale(1.15)} }
    @keyframes mmWrong { 0%{transform:rotateY(180deg)} 20%{transform:rotateY(180deg) translateX(5px)} 40%{transform:rotateY(180deg) translateX(-5px)} 60%{transform:rotateY(180deg) translateX(3px)} 80%{transform:rotateY(180deg) translateX(-3px)} 100%{transform:rotateY(0)} }

    /* ── Tower Climb ── */
    .tower-floors { display:flex; gap:5px; justify-content:center; margin:4px 0 12px; flex-wrap:wrap; }
    .tower-dot { width:13px; height:13px; border-radius:50%; background:rgba(255,255,255,0.1); border:1.5px solid rgba(255,255,255,0.14); transition:all 0.25s; }
    .tower-dot.cleared { background:#BAFF29; border-color:#BAFF29; box-shadow:0 0 8px rgba(186,255,41,0.5); }
    .tower-dot.current { background:rgba(255,107,53,0.45); border-color:#FF6B35; animation:towerPulse 0.9s ease-in-out infinite; }
    @keyframes towerPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.3)} }
    .tower-doors { display:flex; gap:10px; justify-content:center; margin-bottom:12px; }
    .tower-door {
      width:72px; height:88px; border-radius:10px;
      border:2px solid rgba(255,255,255,0.16); background:rgba(255,255,255,0.04);
      font-size:2rem; cursor:pointer; transition:all 0.14s;
      display:flex; align-items:center; justify-content:center;
    }
    .tower-door:hover:not([disabled]) { border-color:rgba(255,107,53,0.55); background:rgba(255,107,53,0.07); transform:translateY(-4px); box-shadow:0 8px 20px rgba(255,107,53,0.18); }
    .tower-door.safe-reveal  { border-color:#BAFF29!important; background:rgba(186,255,41,0.1)!important; animation:doorSafe 0.35s cubic-bezier(0.34,1.56,0.64,1); }
    .tower-door.trap-reveal  { border-color:#FF4D6D!important; background:rgba(255,77,109,0.1)!important; animation:doorShake 0.4s; }
    @keyframes doorSafe  { from{transform:scaleY(0.05)} to{transform:scaleY(1)} }
    @keyframes doorShake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-7px)} 50%{transform:translateX(7px)} 80%{transform:translateX(-4px)} }

    /* ── Broke toast ── */
    #broke-toast {
      position: fixed; inset: 0; z-index: 900;
      display: flex; align-items: center; justify-content: center;
      pointer-events: none;
    }
    #broke-inner {
      background: #0D0D0D;
      border: 2px solid var(--coral);
      box-shadow: 0 0 60px rgba(255,77,109,0.5), inset 0 0 40px rgba(255,77,109,0.05);
      border-radius: 24px; padding: 40px 56px;
      text-align: center;
      animation: brokeIn 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
      opacity: 0;
    }
    #broke-inner.hiding {
      animation: brokeOut 0.4s ease forwards;
    }
    @keyframes brokeIn  { from{transform:scale(0.7);opacity:0} to{transform:scale(1);opacity:1} }
    @keyframes brokeOut { from{transform:scale(1);opacity:1}   to{transform:scale(0.8);opacity:0} }
    #broke-inner .broke-emoji { font-size: 3.5rem; animation: brokeBounce 0.5s ease infinite alternate; }
    @keyframes brokeBounce { from{transform:translateY(0)} to{transform:translateY(-8px)} }
    #broke-inner .broke-title {
      font-size: 2.2rem; font-weight: 800; color: var(--coral);
      letter-spacing: 0.04em; margin: 12px 0 8px;
      text-shadow: 0 0 20px rgba(255,77,109,0.7);
    }
    #broke-inner .broke-sub {
      font-size: 0.8rem; font-weight: 700;
      color: rgba(255,255,255,0.4); letter-spacing: 0.1em;
    }
    #broke-inner .broke-bar {
      width: 100%; height: 4px; background: rgba(255,255,255,0.08);
      border-radius: 2px; margin-top: 20px; overflow: hidden;
    }
    #broke-inner .broke-fill {
      height: 100%; background: var(--coral); border-radius: 2px;
      width: 100%; transform-origin: left;
      animation: brokeDrain 1.8s linear forwards;
    }
    @keyframes brokeDrain { from{transform:scaleX(1)} to{transform:scaleX(0)} }

    /* ── True Casino Mode ── */
    .tcm-btn {
      font-family:'Syne',sans-serif; font-size:0.72rem; font-weight:800;
      letter-spacing:0.05em; cursor:pointer;
      padding:8px 16px; border-radius:999px;
      background:rgba(255,255,255,0.06);
      border:1.5px solid rgba(255,255,255,0.12);
      color:rgba(255,255,255,0.45);
      transition:background 0.2s,border-color 0.2s,color 0.2s;
      white-space:nowrap;
    }
    .tcm-btn:hover  { background:rgba(255,77,109,0.1); border-color:rgba(255,77,109,0.3); color:var(--coral); }
    .tcm-btn.active {
      background:rgba(255,77,109,0.15); border-color:var(--coral); color:var(--coral);
      animation:tcmPulse 2s ease-in-out infinite;
    }
    @keyframes tcmPulse { 0%,100%{box-shadow:none} 50%{box-shadow:0 0 14px rgba(255,77,109,0.4)} }

    .shop-link {
      font-size:0.72rem; font-weight:800; letter-spacing:0.05em;
      padding:8px 16px; border-radius:999px;
      background:rgba(255,255,255,0.06);
      border:1.5px solid rgba(255,255,255,0.12);
      color:rgba(255,255,255,0.45);
      text-decoration:none;
      transition:background 0.2s,border-color 0.2s,color 0.2s;
    }
    .shop-link:hover { background:rgba(186,255,41,0.1); border-color:rgba(186,255,41,0.35); color:var(--lime); }

    /* Debt bar */
    #debt-bar {
      position:relative; z-index:10; display:none;
      height:3px; background:rgba(255,77,109,0.15);
    }
    #debt-fill { height:100%; background:var(--coral); width:0%; transition:width 0.5s; box-shadow:0 0 8px var(--coral); }

    /* TCM banner */
    #tcm-banner {
      display:none; position:relative; z-index:10;
      background:rgba(255,77,109,0.07); border-bottom:1px solid rgba(255,77,109,0.2);
      padding:7px 40px; align-items:center; gap:10px;
      font-size:0.7rem; font-weight:800; letter-spacing:0.06em;
      color:rgba(255,100,120,0.85); user-select:none;
    }
    #tcm-banner i { margin-right:4px; }

    /* Item bar */
    #item-bar {
      position:relative; z-index:10;
      display:none; align-items:center; gap:8px; flex-wrap:wrap;
      padding:8px 40px; border-bottom:1px solid rgba(255,255,255,0.04);
      font-size:0.68rem;
    }
    .item-pip {
      display:inline-flex; align-items:center; gap:6px;
      padding:4px 10px; border-radius:999px;
      background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1);
      color:rgba(255,255,255,0.55); font-size:0.67rem; font-weight:800;
      letter-spacing:0.04em; white-space:nowrap;
    }
    .item-pip i { font-size:0.7rem; }
    .item-pip .pip-charges { color:rgba(255,255,255,0.28); margin-left:2px; }
    .item-pip.common    { border-color:rgba(156,163,175,0.25); color:#9ca3af; }
    .item-pip.uncommon  { border-color:rgba(74,222,128,0.25);  color:#4ade80; }
    .item-pip.rare      { border-color:rgba(96,165,250,0.3);   color:#60a5fa; }
    .item-pip.epic      { border-color:rgba(168,85,247,0.35);  color:#a855f7; }
    .item-pip.legendary { border-color:rgba(249,115,22,0.4);   color:#f97316; }
    .item-pip.mythic    { border-color:rgba(255,255,255,0.4);  color:#fff; animation:mythicPip 3s linear infinite; }
    @keyframes mythicPip { 0%{filter:hue-rotate(0deg)} 100%{filter:hue-rotate(360deg)} }

    /* In-debt balance */
    #balance-display.in-debt { color:var(--coral) !important; border-color:rgba(255,77,109,0.35) !important; background:rgba(255,77,109,0.1) !important; }
    body.true-mode header    { border-bottom-color:rgba(255,77,109,0.25); }

    /* True mode card highlight */
    body.true-mode .page-title h1 { filter:hue-rotate(310deg); }

    /* ── VS Mode name inputs ── */
    .vs-name-in {
      width: 100%; background: rgba(255,255,255,0.06);
      border: 1.5px solid rgba(255,255,255,0.15); border-radius: 10px;
      padding: 8px 12px; font-family:'Syne',sans-serif; font-size:0.9rem;
      font-weight:800; color:#fff; outline:none;
    }
    .vs-name-in:focus { border-color:var(--yellow); }

    /* ── Particles ── */
    .particle {
      position: fixed; border-radius: 50%;
      pointer-events: none; z-index: 50;
      animation: pfly var(--dur) ease-out forwards;
    }
    @keyframes pfly {
      0%   { opacity:1; transform:translate(0,0) scale(1); }
      100% { opacity:0; transform:translate(var(--tx),var(--ty)) scale(0.2); }
    }

    /* ── VFX ── */
    #confetti-canvas {
      position: fixed; inset: 0;
      pointer-events: none; z-index: 800;
      display: none;
    }
    #screen-flash {
      position: fixed; inset: 0;
      pointer-events: none; z-index: 790;
      opacity: 0;
    }

    /* Hi-Lo card deal animation */
    .hilo-card {
      transition: box-shadow 0.3s;
      transform-origin: center bottom;
    }
    .hilo-card.flip-in {
      animation: cardDeal 0.52s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }
    @keyframes cardDeal {
      0%   { transform: perspective(700px) translateY(-80px) translateX(50px) rotateZ(-22deg) rotateY(-80deg) scale(0.35); opacity: 0; filter: blur(6px); }
      30%  { opacity: 1; filter: blur(1px); }
      55%  { filter: blur(0); }
      72%  { transform: perspective(700px) translateY(8px) translateX(-3px) rotateZ(4deg) rotateY(12deg) scale(1.06); }
      100% { transform: perspective(700px) translateY(0) translateX(0) rotateZ(0deg) rotateY(0deg) scale(1); opacity: 1; }
    }

    /* Floating "+x" multiplier text */
    .float-label {
      position: fixed;
      font-family: 'Syne', sans-serif; font-weight: 800;
      pointer-events: none; z-index: 850;
      animation: floatUp 1.1s ease-out forwards;
    }
    @keyframes floatUp {
      0%   { opacity: 1; transform: translateY(0) scale(0.7); }
      18%  { opacity: 1; transform: translateY(-16px) scale(1.15); }
      100% { opacity: 0; transform: translateY(-80px) scale(0.9); }
    }

    /* Streak badge */
    .streak-badge {
      text-align: center; margin-bottom: 12px;
      font-size: 0.78rem; font-weight: 800;
      color: rgba(255,255,255,0.35); letter-spacing: 0.08em;
      transition: color 0.3s, text-shadow 0.3s;
    }
    .streak-badge.s1 { color: #BAFF29; text-shadow: 0 0 10px #BAFF29; animation: sbPulse 1s ease-in-out infinite; }
    .streak-badge.s2 { color: #FFD60A; text-shadow: 0 0 14px #FFD60A; animation: sbPulse 0.8s ease-in-out infinite; }
    .streak-badge.s3 { color: #FF6B35; text-shadow: 0 0 18px #FF6B35; animation: sbPulse 0.6s ease-in-out infinite; }
    @keyframes sbPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.07)} }

    /* Modal shake on loss */
    .modal-shake { animation: mShake 0.42s ease !important; }
    @keyframes mShake {
      0%,100% { transform: translateX(0); }
      18%     { transform: translateX(-10px); }
      36%     { transform: translateX(10px); }
      54%     { transform: translateX(-6px); }
      72%     { transform: translateX(6px); }
    }

    /* Result pop */
    .result-box { transition: box-shadow 0.3s; }
    .result-box.pop { animation: rPop 0.3s cubic-bezier(0.34,1.56,0.64,1); }
    @keyframes rPop { from{transform:scale(0.5);opacity:0} to{transform:scale(1);opacity:1} }

    /* Prestige locked state */
    .prestige-locked { filter: grayscale(0.55) brightness(0.8); cursor: not-allowed !important; }
    .prestige-locked:hover { transform: none !important; box-shadow: none !important; }

    /* ══════════════════════════════
       P2P CHAT WIDGET
    ══════════════════════════════ */
    #p2p-fab {
      position: fixed; bottom: 24px; right: 24px; z-index: 8000;
      width: 52px; height: 52px; border-radius: 50%;
      background: linear-gradient(135deg, #4e4e9e, #7B2FBE);
      border: none; color: #fff; font-size: 1.3rem; cursor: pointer;
      box-shadow: 0 4px 20px rgba(78,78,158,0.5);
      transition: transform .2s, box-shadow .2s;
      display: flex; align-items: center; justify-content: center;
    }
    #p2p-fab:hover { transform: scale(1.1); box-shadow: 0 8px 30px rgba(78,78,158,0.7); }
    #p2p-badge {
      position: absolute; top: -4px; right: -4px;
      background: var(--coral); border-radius: 999px;
      font-size: 0.6rem; font-weight: 900; padding: 2px 6px;
      min-width: 18px; text-align: center; display: none;
    }
    #p2p-panel {
      position: fixed; bottom: 86px; right: 24px; z-index: 8000;
      width: 310px;
      background: rgba(18,18,28,0.97);
      border: 1.5px solid rgba(255,255,255,0.1);
      border-radius: 16px;
      box-shadow: 0 16px 50px rgba(0,0,0,0.7);
      display: none; flex-direction: column;
      overflow: hidden; backdrop-filter: blur(16px);
      animation: p2pSlideUp 0.25s cubic-bezier(0.34,1.3,0.64,1);
    }
    @keyframes p2pSlideUp {
      from { transform:translateY(16px); opacity:0; }
      to   { transform:translateY(0); opacity:1; }
    }
    #p2p-panel.open { display: flex; }
    .p2p-head {
      padding: 12px 14px 10px;
      border-bottom: 1px solid rgba(255,255,255,0.07);
      display: flex; align-items: center; justify-content: space-between;
    }
    .p2p-head-title { font-size:0.85rem; font-weight:900; letter-spacing:.05em; color:#fff; }
    .p2p-close-btn { background:none;border:none;color:rgba(255,255,255,0.4);font-size:1rem;cursor:pointer; padding:0; }
    .p2p-close-btn:hover { color:#fff; }
    .p2p-id-row {
      padding: 8px 14px;
      background: rgba(255,255,255,0.04);
      border-bottom: 1px solid rgba(255,255,255,0.07);
      display: flex; align-items: center; gap: 8px;
      font-size: 0.7rem;
    }
    .p2p-id-label { color: rgba(255,255,255,0.4); font-weight:700; letter-spacing:.06em; white-space:nowrap; }
    #p2p-id-text {
      flex:1; font-size:0.68rem; color:rgba(255,255,255,0.7);
      font-family:monospace; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
    }
    .p2p-copy-btn {
      background:rgba(255,255,255,0.08);border:1px solid rgba(255,255,255,0.15);
      color:#fff;border-radius:5px;padding:3px 8px;font-size:0.65rem;cursor:pointer;
      font-family:'Syne',sans-serif;font-weight:800;
    }
    .p2p-connect-row {
      padding: 8px 14px;
      border-bottom: 1px solid rgba(255,255,255,0.07);
      display: flex; gap: 6px;
    }
    #p2p-connect-in {
      flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
      border-radius: 7px; padding: 6px 10px; color: #fff;
      font-size: 0.72rem; font-family:'Syne',sans-serif; outline:none;
    }
    #p2p-connect-in::placeholder { color:rgba(255,255,255,0.25); }
    .p2p-connect-btn {
      background: #4e4e9e; border: none; border-radius: 7px;
      color: #fff; padding: 6px 12px; font-size: 0.72rem;
      font-family:'Syne',sans-serif; font-weight:800; cursor:pointer;
    }
    #p2p-msgs {
      flex: 1; overflow-y: auto; max-height: 220px;
      padding: 10px 14px; display: flex; flex-direction: column; gap: 6px;
    }
    #p2p-msgs::-webkit-scrollbar { width:4px; }
    #p2p-msgs::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.1);border-radius:99px; }
    .p2p-msg {
      font-size: 0.72rem; line-height: 1.4; padding: 6px 10px;
      border-radius: 8px; max-width: 90%;
    }
    .p2p-msg.sys { color:rgba(255,255,255,0.35); font-style:italic; align-self:center; background:rgba(255,255,255,0.04); }
    .p2p-msg.me  { background:rgba(78,78,158,0.35); align-self:flex-end; color:#c8c8ff; }
    .p2p-msg.peer { background:rgba(255,255,255,0.07); align-self:flex-start; color:#e5e5e5; }
    .p2p-msg.game-ev { background:rgba(186,255,41,0.08); border:1px solid rgba(186,255,41,0.15); align-self:center; color:#BAFF29; font-style:italic; }
    .p2p-msg .p2p-from { font-weight:900; font-size:0.62rem; margin-bottom:2px; opacity:0.6; }
    .p2p-send-row {
      padding: 8px 14px;
      border-top: 1px solid rgba(255,255,255,0.07);
      display: flex; gap: 6px;
    }
    #p2p-msg-in {
      flex:1; background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.12);
      border-radius:7px;padding:7px 10px;color:#fff;
      font-size:0.72rem;font-family:'Syne',sans-serif;outline:none;
    }
    #p2p-msg-in::placeholder { color:rgba(255,255,255,0.2); }
    .p2p-send-btn {
      background:var(--lime);border:none;border-radius:7px;
      color:#000;padding:7px 12px;font-size:0.72rem;
      font-family:'Syne',sans-serif;font-weight:900;cursor:pointer;
    }
    #p2p-peers-bar {
      padding: 6px 14px;
      border-bottom: 1px solid rgba(255,255,255,0.07);
      font-size: 0.65rem; color: rgba(255,255,255,0.4);
      display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    }
    .p2p-peer-chip {
      background:rgba(74,222,128,0.12);border:1px solid rgba(74,222,128,0.25);
      color:#4ade80;border-radius:99px;padding:2px 8px;
      font-size:0.62rem;font-weight:800;
    }

    /* ── PWA bottom nav (only in standalone mode) ── */
    #pwa-nav {
      display: none;
      position: fixed; bottom: 0; left: 0; right: 0; z-index: 9500;
      background: rgba(13,13,13,0.97);
      border-top: 1px solid rgba(255,255,255,0.1);
      backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
      /* padding-top = tap area; padding-bottom pushes tabs above iOS home bar */
      padding: 10px 0 max(16px, env(safe-area-inset-bottom));
      justify-content: space-around; align-items: flex-start;
    }
    .pwa-nav-item {
      display: flex; flex-direction: column; align-items: center; gap: 3px;
      color: rgba(255,255,255,0.4); text-decoration: none;
      font-size: 0.65rem; font-weight: 800; letter-spacing: 0.03em;
      padding: 6px 10px; border-radius: 10px; min-width: 56px; text-align: center;
      transition: color 0.2s; -webkit-tap-highlight-color: transparent;
    }
    .pwa-nav-item .nav-icon { font-size: 1.55rem; line-height: 1; }
    .pwa-nav-item.active { color: var(--coral); }
    .pwa-nav-item:hover  { color: rgba(255,255,255,0.75); }
    @media (max-width: 768px) {
      #pwa-nav { display: flex; }
      body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
      #p2p-fab { bottom: calc(76px + env(safe-area-inset-bottom)); }
    }

    /* ── PWA Ad banner (non-logged-in only) ── */
    #pwa-ad-banner {
      display: none;
      position: sticky; top: 0; z-index: 9200;
      background: rgba(13,13,13,0.95);
      border-bottom: 1px solid rgba(255,214,10,0.15);
      padding: 10px 16px;
      align-items: center; justify-content: space-between; gap: 12px;
      font-size: 0.72rem; font-weight: 700;
    }
    #pwa-ad-banner .ad-label {
      font-size: 0.55rem; font-weight: 900; letter-spacing: 0.08em;
      color: rgba(255,255,255,0.25); text-transform: uppercase; flex-shrink: 0;
    }
    #pwa-ad-banner .ad-content {
      flex: 1; color: rgba(255,255,255,0.65);
    }
    #pwa-ad-banner .ad-cta {
      background: var(--yellow); color: #0D0D0D;
      border: none; border-radius: 6px; padding: 6px 12px;
      font-family: 'Syne', sans-serif; font-size: 0.68rem; font-weight: 900;
      cursor: pointer; white-space: nowrap; flex-shrink: 0;
    }
    #pwa-ad-banner .ad-close {
      background: none; border: none; color: rgba(255,255,255,0.3);
      cursor: pointer; font-size: 1rem; padding: 0 0 0 8px; flex-shrink: 0;
    }
    @media (max-width: 768px) and (display-mode: standalone) {
      #pwa-ad-banner { display: flex; }
    }

    /* ═══════════════════════════════════════════════════
       MOBILE ONLY — all rules inside max-width: 768px
       Desktop is completely untouched.
    ═══════════════════════════════════════════════════ */
    @media (max-width: 768px) {

      /* ── Header ── */
      header { padding: 14px 18px; flex-wrap: wrap; gap: 10px; }
      .breadcrumb { display: none; }
      header > div:last-child { gap: 8px; flex-wrap: wrap; }
      #balance-display {
        font-size: 1rem; font-weight: 900;
        padding: 8px 16px; border-radius: 999px;
      }
      .tcm-btn { font-size: 0.72rem; padding: 8px 14px; }
      #prestige-badge { font-size: 0.72rem !important; padding: 5px 10px !important; }

      /* ── Page title ── */
      .page-title { padding: 32px 20px 10px; }
      .page-title h1 { font-size: 2.6rem; }
      .page-title p { font-size: 0.95rem; }

      /* ── Game grid — single column ── */
      .game-grid {
        display: flex; flex-direction: column;
        gap: 12px; padding: 16px 16px 24px;
      }

      /* Cards: CSS grid layout — icon left, text centre, chevron right.
         No HTML changes needed — targets existing .icon / h2 / p / .odds */
      .game-card {
        display: grid;
        grid-template-columns: 68px 1fr 28px;
        grid-template-rows: auto auto auto;
        column-gap: 14px; row-gap: 2px;
        padding: 20px 16px; border-radius: 20px;
        min-height: 82px;
      }
      .game-card .icon {
        grid-column: 1; grid-row: 1 / 4;
        align-self: center; justify-self: center;
        font-size: 2.5rem; line-height: 1;
        display: flex; align-items: center; justify-content: center;
      }
      .game-card h2 {
        grid-column: 2; grid-row: 1;
        font-size: 1.15rem; align-self: end;
      }
      .game-card p {
        grid-column: 2; grid-row: 2;
        font-size: 0.78rem; line-height: 1.4;
      }
      .game-card .odds {
        grid-column: 2; grid-row: 3;
        font-size: 0.63rem;
      }
      .game-card::after {
        content: '›';
        grid-column: 3; grid-row: 1 / 4;
        font-size: 1.9rem; font-weight: 300;
        color: rgba(255,255,255,0.18);
        align-self: center; justify-self: end;
      }

      /* ── Modal — full-screen sheet ── */
      #modal {
        align-items: flex-end;
        padding: 0;
      }
      #modal-box {
        width: 100%;
        max-width: 100% !important;
        min-width: unset !important;
        /* Fill the entire screen above the bottom nav */
        height: calc(100dvh - 68px - env(safe-area-inset-bottom));
        max-height: none;
        border-radius: 24px 24px 0 0;
        padding: 0 22px max(28px, env(safe-area-inset-bottom));
        overflow-y: auto; overflow-x: hidden;
        display: flex; flex-direction: column;
        animation: slideUpFull 0.32s cubic-bezier(0.32, 0.72, 0, 1) !important;
      }
      @keyframes slideUpFull {
        from { transform: translateY(60px); opacity: 0; }
        to   { transform: translateY(0);    opacity: 1; }
      }

      /* Drag handle at top of sheet */
      #modal-box::before {
        content: ''; display: block; flex-shrink: 0;
        width: 44px; height: 5px;
        background: rgba(255,255,255,0.2); border-radius: 3px;
        margin: 14px auto 4px;
      }

      /* Modal header row */
      .modal-title {
        font-size: 1.15rem; padding-bottom: 16px;
        padding-top: 4px;
      }
      .modal-close {
        width: 40px; height: 40px; font-size: 1.2rem;
        border-radius: 50%;
        background: rgba(255,255,255,0.07);
      }

      /* Modal content fills remaining space */
      #modal-content { flex: 1; }

      /* ── Bet row ── */
      .bet-row { flex-direction: column; gap: 10px; }
      .bet-input {
        font-size: 1.1rem; padding: 14px 16px;
        border-radius: 14px; width: 100%;
      }
      .bet-presets { gap: 8px; flex-wrap: wrap; }
      .bet-preset {
        padding: 10px 16px; font-size: 0.82rem;
        border-radius: 10px; flex: 1; text-align: center;
      }

      /* ── All game action buttons ── */
      .coin-btn, .hilo-btn, .rou-btn, .btn {
        min-height: 56px; font-size: 1rem;
        border-radius: 14px;
      }
      .btn-row { flex-direction: column; gap: 12px; }
      .btn-row .btn { width: 100%; }

      /* ── Result box ── */
      .result-box {
        padding: 18px 20px; border-radius: 16px;
        font-size: 1.05rem;
      }

      /* ── Item bar ── */
      #item-bar { padding: 10px 18px; gap: 8px; font-size: 0.8rem; }

      /* ── Coin flip buttons ── */
      .coin-btn {
        padding: 18px 28px; font-size: 1.05rem;
        gap: 10px;
      }

      /* ── 3-D coin ── */
      .coin-3d { width: 110px; height: 110px; margin: 16px auto; }

      /* ── Roulette ── */
      .roulette-choices { gap: 10px; }
      .rou-btn { padding: 16px 18px; font-size: 0.95rem; flex: 1; }
      .wheel { width: 180px; height: 180px; }

      /* ── Dice ── */
      .die { width: 76px; height: 76px; font-size: 2.4rem; }

      /* ── Hi-Lo card ── */
      .hilo-card { width: 100px; height: 144px; font-size: 2.2rem; margin-bottom: 20px; }
      .hilo-btns { gap: 14px; }
      .hilo-btn { padding: 16px 28px; font-size: 1rem; }

      /* ── Slots reels ── */
      .reel { width: 84px; height: 84px; }
      .reel-sym { width: 84px; height: 84px; font-size: 2.2rem; }
      .reel-final { font-size: 2.5rem; }

      /* ── Crash ── */
      #crash-canvas { height: 200px; }
      #crash-mult { font-size: 3rem; }

      /* ── Mines ── */
      .mines-grid { gap: 6px; }
      .mines-grid button { width: 52px; height: 52px; font-size: 1.3rem; border-radius: 10px; }

      /* ── VS banner ── */
      #vs-banner { padding: 8px 16px; font-size: 0.68rem; }

      /* ── Prestige ── */
      .prestige-locked { pointer-events: none; }

      /* ── Streak badge ── */
      .streak-badge { font-size: 0.88rem; }
    }

    /* ══════════════════════════════════════════════════
       UA-BASED MOBILE OVERRIDES (html.is-mobile class)
       Higher specificity than desktop rules — wins even
       when screen width detection would miss (e.g. iPad
       in desktop mode, zoom weirdness, PWA display mode).
    ══════════════════════════════════════════════════ */

    /* Nav & body chrome */
    html.is-mobile #pwa-nav               { display: flex !important; }
    html.is-mobile body                   { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
    html.is-mobile #p2p-fab               { bottom: calc(76px + env(safe-area-inset-bottom)); }

    /* Header */
    html.is-mobile header                 { padding: max(14px, env(safe-area-inset-top)) 18px 14px 18px; flex-wrap: wrap; gap: 10px; }
    html.is-mobile .breadcrumb            { display: none; }
    html.is-mobile .shop-link             { display: none; }   /* remove Shop + VS buttons */
    html.is-mobile #balance-display       { font-size: 1rem; font-weight: 900; padding: 8px 16px; }
    html.is-mobile .tcm-btn               { font-size: 0.72rem; padding: 8px 14px; }

    /* Page title */
    html.is-mobile .page-title            { padding: 32px 20px 10px; }
    html.is-mobile .page-title h1         { font-size: 2.6rem; }

    /* Game grid — single column */
    html.is-mobile .game-grid             { display: flex; flex-direction: column; gap: 12px; padding: 16px 16px 24px; }
    html.is-mobile .game-card             { display: grid; grid-template-columns: 68px 1fr 28px; grid-template-rows: auto auto auto; column-gap: 14px; row-gap: 2px; padding: 20px 16px; border-radius: 20px; min-height: 82px; }
    html.is-mobile .game-card .icon       { grid-column: 1; grid-row: 1 / 4; align-self: center; justify-self: center; font-size: 2.5rem; line-height: 1; display: flex; align-items: center; justify-content: center; }
    html.is-mobile .game-card h2          { grid-column: 2; grid-row: 1; font-size: 1.15rem; align-self: end; }
    html.is-mobile .game-card p           { grid-column: 2; grid-row: 2; font-size: 0.78rem; line-height: 1.4; }
    html.is-mobile .game-card .odds       { grid-column: 2; grid-row: 3; font-size: 0.63rem; }
    html.is-mobile .game-card::after      { content: '›'; grid-column: 3; grid-row: 1 / 4; font-size: 1.9rem; font-weight: 300; color: rgba(255,255,255,0.18); align-self: center; justify-self: end; }

    /* Modal — full-screen sheet */
    html.is-mobile #modal                 { align-items: flex-end; padding: 0; }
    html.is-mobile #modal-box             { width: 100%; max-width: 100% !important; min-width: unset !important; height: calc(100dvh - 68px - env(safe-area-inset-bottom)); max-height: none; border-radius: 24px 24px 0 0; padding: 0 22px max(28px, env(safe-area-inset-bottom)); overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }
    html.is-mobile #modal-box::before     { content: ''; display: block; flex-shrink: 0; width: 44px; height: 5px; background: rgba(255,255,255,0.2); border-radius: 3px; margin: 14px auto 4px; }
    html.is-mobile .modal-title           { font-size: 1.15rem; padding-bottom: 16px; padding-top: 4px; }
    html.is-mobile .modal-close           { width: 40px; height: 40px; font-size: 1.2rem; border-radius: 50%; background: rgba(255,255,255,0.07); }
    html.is-mobile #modal-content         { flex: 1; }

    /* Inputs & buttons */
    html.is-mobile .bet-row               { flex-direction: column; gap: 10px; }
    html.is-mobile .bet-input             { font-size: 1.1rem; padding: 14px 16px; width: 100%; }
    html.is-mobile .bet-preset            { padding: 10px 16px; font-size: 0.82rem; flex: 1; text-align: center; }
    html.is-mobile .coin-btn,
    html.is-mobile .hilo-btn,
    html.is-mobile .rou-btn,
    html.is-mobile .btn                   { min-height: 56px; font-size: 1rem; border-radius: 14px; }
    html.is-mobile .btn-row               { flex-direction: column; gap: 12px; }
    html.is-mobile .btn-row .btn          { width: 100%; }

    /* Games */
    html.is-mobile .hilo-card             { width: 100px; height: 144px; font-size: 2.2rem; margin-bottom: 20px; }
    html.is-mobile .die                   { width: 76px; height: 76px; font-size: 2.4rem; }
    html.is-mobile .roulette-choices      { gap: 10px; }
    html.is-mobile .rou-btn               { padding: 16px 18px; font-size: 0.95rem; flex: 1; }
    html.is-mobile .wheel                 { width: 180px; height: 180px; }
    html.is-mobile #crash-canvas          { height: 200px; }
    html.is-mobile .mines-grid button     { width: 52px; height: 52px; font-size: 1.3rem; border-radius: 10px; }
    html.is-mobile .coin-3d               { width: 110px; height: 110px; margin: 16px auto; }

    /* ── Keno ── */
    .keno-grid {
      display: grid; grid-template-columns: repeat(8, 1fr);
      gap: 4px; max-width: 340px; margin: 6px auto 10px;
    }
    .keno-num {
      aspect-ratio: 1; border-radius: 6px;
      background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.1);
      font-family: 'Syne', sans-serif; font-size: 0.72rem; font-weight: 800;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      transition: all 0.12s; color: rgba(255,255,255,0.55);
    }
    .keno-num:hover:not([disabled]) { background: rgba(255,255,255,0.12); color: #fff; }
    .keno-num.picked { background: rgba(0,245,212,0.18); border-color: var(--cyan); color: var(--cyan); }
    .keno-num.hit    { background: rgba(186,255,41,0.2); border-color: var(--lime); color: var(--lime); animation: kenoHit 0.32s cubic-bezier(0.34,1.56,0.64,1); }
    .keno-num.miss   { background: rgba(255,77,109,0.1); border-color: rgba(255,77,109,0.35); color: rgba(255,77,109,0.65); }
    @keyframes kenoHit { from{transform:scale(0.65)} to{transform:scale(1)} }
    .keno-info { text-align: center; font-size: 0.7rem; color: rgba(255,255,255,0.38); margin-bottom: 6px; font-weight: 800; letter-spacing: .03em; }

    /* ── Site footer ── */
    .site-footer {
      position: relative; z-index: 10;
      border-top: 1px solid rgba(255,255,255,0.06);
      background: rgba(13,13,13,0.85);
      padding: 28px 40px 32px;
      font-size: 0.68rem; font-weight: 700;
      color: rgba(255,255,255,0.22);
      letter-spacing: 0.04em;
    }
    .site-footer-inner {
      max-width: 900px; margin: 0 auto;
      display: flex; flex-direction: column; align-items: center; gap: 10px;
    }
    .site-footer-top {
      display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center;
    }
    .site-footer-logo {
      font-size: 0.82rem; font-weight: 900; letter-spacing: 0.06em;
      color: rgba(255,255,255,0.38);
    }
    .site-footer-sep { color: rgba(255,255,255,0.12); }
    .site-footer-links {
      display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center;
    }
    .site-footer-links a {
      color: rgba(255,255,255,0.3); text-decoration: none;
      transition: color 0.15s;
    }
    .site-footer-links a:hover { color: rgba(255,77,109,0.85); }
    .site-footer-version {
      font-size: 0.62rem; color: rgba(255,255,255,0.15); letter-spacing: 0.08em;
    }
    .site-footer-disclaimer {
      font-size: 0.62rem; color: rgba(255,255,255,0.12);
      text-align: center; max-width: 560px; line-height: 1.6;
    }
    html.is-mobile .site-footer { padding: 20px 18px 28px; }
    html.is-mobile .site-footer-top { gap: 12px; }
    html.is-mobile .site-footer-links { gap: 12px; }
