
  :root{
    --ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --display: 'Orbitron', 'Inter', sans-serif;
    --win: #39ff88;
    --lose: #ff3860;
  }

  html[data-theme="violet"]{
    --bg0:#050311; --bg1:#0d0620; --bg2:#180a34;
    --neon1:#b026ff; --neon1-l:#d896ff; --neon1-d:#5c0f96;
    --neon2:#00f0ff; --neon2-l:#93fbff; --neon2-d:#007a87;
    --panel-border: rgba(176,38,255,0.4);
    --panel-glow: rgba(176,38,255,0.35);
  }
  html[data-theme="cyan"]{
    --bg0:#02090f; --bg1:#03161f; --bg2:#04202f;
    --neon1:#00e5ff; --neon1-l:#93f6ff; --neon1-d:#007784;
    --neon2:#ff2ec4; --neon2-l:#ff9be8; --neon2-d:#8c0f6e;
    --panel-border: rgba(0,229,255,0.4);
    --panel-glow: rgba(0,229,255,0.35);
  }
  html[data-theme="pink"]{
    --bg0:#0a020e; --bg1:#190522; --bg2:#240a33;
    --neon1:#ff2ec4; --neon1-l:#ff9be8; --neon1-d:#8c0f6e;
    --neon2:#7c3aff; --neon2-l:#c3a6ff; --neon2-d:#3d1499;
    --panel-border: rgba(255,46,196,0.4);
    --panel-glow: rgba(255,46,196,0.35);
  }
  html[data-theme="green"]{
    --bg0:#010b07; --bg1:#031c12; --bg2:#052a1c;
    --neon1:#39ff88; --neon1-l:#b0ffd6; --neon1-d:#0c8f45;
    --neon2:#00e5ff; --neon2-l:#93f6ff; --neon2-d:#007784;
    --panel-border: rgba(57,255,136,0.4);
    --panel-glow: rgba(57,255,136,0.35);
  }
  html[data-theme="gold"]{
    --bg0:#0c0700; --bg1:#1f1204; --bg2:#2b1806;
    --neon1:#ffd23f; --neon1-l:#ffec9e; --neon1-d:#a3730a;
    --neon2:#ff6b35; --neon2-l:#ffb28e; --neon2-d:#a63510;
    --panel-border: rgba(255,210,63,0.4);
    --panel-glow: rgba(255,210,63,0.35);
  }
  html[data-theme="space"]{
    --bg0:#01010a; --bg1:#05081a; --bg2:#0a1030;
    --neon1:#7aa2ff; --neon1-l:#c5d6ff; --neon1-d:#2a3f8f;
    --neon2:#e0a6ff; --neon2-l:#f2d4ff; --neon2-d:#6b3a8f;
    --panel-border: rgba(122,162,255,0.45);
    --panel-glow: rgba(122,162,255,0.35);
  }
  html[data-theme="ocean"]{
    --bg0:#001018; --bg1:#002030; --bg2:#003848;
    --neon1:#00d4c8; --neon1-l:#9ff5ef; --neon1-d:#007a72;
    --neon2:#3da9fc; --neon2-l:#a8d8ff; --neon2-d:#1a5a9a;
    --panel-border: rgba(0,212,200,0.4);
    --panel-glow: rgba(0,212,200,0.35);
  }
  html[data-theme="ember"]{
    --bg0:#120404; --bg1:#2a0808; --bg2:#3d1010;
    --neon1:#ff4d2e; --neon1-l:#ffb09e; --neon1-d:#8f1a0a;
    --neon2:#ffb020; --neon2-l:#ffe09a; --neon2-d:#8f5a0a;
    --panel-border: rgba(255,77,46,0.45);
    --panel-glow: rgba(255,77,46,0.35);
  }
  html[data-theme="arctic"]{
    --bg0:#060b12; --bg1:#0d1824; --bg2:#142838;
    --neon1:#a8e6ff; --neon1-l:#e5f7ff; --neon1-d:#3a6a80;
    --neon2:#7eb6ff; --neon2-l:#cfe4ff; --neon2-d:#2a5080;
    --panel-border: rgba(168,230,255,0.4);
    --panel-glow: rgba(168,230,255,0.3);
  }
  html[data-theme="sunset"]{
    --bg0:#120810; --bg1:#241018; --bg2:#3a1820;
    --neon1:#ff6b9d; --neon1-l:#ffc0d4; --neon1-d:#8f2a4a;
    --neon2:#ffb347; --neon2-l:#ffe0a8; --neon2-d:#8f5a18;
    --panel-border: rgba(255,107,157,0.45);
    --panel-glow: rgba(255,107,157,0.35);
  }

  *{ box-sizing:border-box; }

  html,body{
    margin:0;
    min-height:100vh;
    background:
      radial-gradient(ellipse 900px 500px at 15% -5%, var(--neon1-d) 0%, transparent 60%),
      radial-gradient(ellipse 900px 500px at 90% 10%, var(--neon2-d) 0%, transparent 60%),
      radial-gradient(ellipse 1200px 900px at 50% 100%, var(--bg2) 0%, var(--bg1) 55%, var(--bg0) 100%);
    background-attachment: fixed;
    font-family: var(--ui);
    color: #f4f1fb;
  }

  body{
    display:flex;
    flex-direction:column;
    align-items:center;
    padding: 0 0 70px;
    position:relative;
    overflow-x:hidden;
  }

  body::before{
    content:"";
    position:fixed;
    inset:0;
    pointer-events:none;
    opacity:0.35;
    background-image:
      linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse 1000px 700px at 50% 0%, black 10%, transparent 75%);
    z-index:0;
  }

  ::-webkit-scrollbar{ height:8px; width:8px; }
  ::-webkit-scrollbar-thumb{ background: var(--neon1-d); border-radius:8px; }
  ::-webkit-scrollbar-track{ background: rgba(255,255,255,0.04); }

  /* ================= TOP BAR ================= */

  .topbar{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding: 14px 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.15));
    border-bottom: 1px solid var(--panel-border);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    flex-wrap: wrap;
  }

  .brand{
    display:flex;
    align-items:center;
    gap: 10px;
    font-family: var(--display);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #fff;
  }
  .brand .mark{
    font-size: 22px;
    filter: drop-shadow(0 0 8px var(--neon1)) drop-shadow(0 0 16px var(--neon2));
  }
  .brand small{
    display:block;
    font-family: var(--ui);
    font-size: 9.5px;
    letter-spacing: 0.22em;
    color: var(--neon1-l);
    font-weight: 700;
    margin-top:2px;
  }

  .topbar-right{
    display:flex;
    align-items:center;
    gap: 14px;
    flex-wrap: wrap;
  }

  .theme-picker{
    display:flex;
    align-items:center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 999px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.12);
  }
  .theme-swatch{
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.25);
    cursor:pointer;
    padding:0;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  }
  .theme-swatch:hover{ transform: scale(1.15); }
  .theme-swatch.active{
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.25), 0 0 12px 2px currentColor;
    transform: scale(1.15);
  }
  .theme-swatch[data-theme="violet"]{ background: linear-gradient(135deg,#b026ff,#00f0ff); color:#b026ff; }
  .theme-swatch[data-theme="cyan"]{ background: linear-gradient(135deg,#00e5ff,#ff2ec4); color:#00e5ff; }
  .theme-swatch[data-theme="pink"]{ background: linear-gradient(135deg,#ff2ec4,#7c3aff); color:#ff2ec4; }
  .theme-swatch[data-theme="green"]{ background: linear-gradient(135deg,#39ff88,#00e5ff); color:#39ff88; }
  .theme-swatch[data-theme="gold"]{ background: linear-gradient(135deg,#ffd23f,#ff6b35); color:#ffd23f; }
  .theme-swatch[data-theme="space"]{ background: linear-gradient(135deg,#7aa2ff,#e0a6ff); color:#7aa2ff; }
  .theme-swatch[data-theme="ocean"]{ background: linear-gradient(135deg,#00d4c8,#3da9fc); color:#00d4c8; }
  .theme-swatch[data-theme="ember"]{ background: linear-gradient(135deg,#ff4d2e,#ffb020); color:#ff4d2e; }
  .theme-swatch[data-theme="arctic"]{ background: linear-gradient(135deg,#a8e6ff,#7eb6ff); color:#a8e6ff; }
  .theme-swatch[data-theme="sunset"]{ background: linear-gradient(135deg,#ff6b9d,#ffb347); color:#ff6b9d; }

  .balance-pill{
    display:flex;
    align-items:center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(0,0,0,0.35));
    border: 1px solid var(--panel-border);
    box-shadow: 0 0 18px -4px var(--panel-glow), inset 0 1px 0 rgba(255,255,255,0.1);
    font-family: var(--display);
    font-weight: 700;
    font-size: 15px;
    color: var(--neon1-l);
  }
  .balance-pill .coin-ico{ font-size: 16px; }

  .balance-reset-btn{
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--panel-border);
    background: rgba(0,0,0,0.3);
    color: rgba(244,241,251,0.7);
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  }
  .balance-reset-btn:hover{ color:#fff; border-color: var(--neon1); transform: rotate(-70deg); }

  /* ================= TABS ================= */

  .tabs-row{
    display:flex;
    align-items:center;
    gap: 10px;
    margin: 24px 0 0;
    max-width: 94vw;
  }

  .tabs-arrow{
    flex: 0 0 auto;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--panel-border);
    background: rgba(0,0,0,0.35);
    color: var(--neon1-l);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, color 0.2s ease;
  }
  .tabs-arrow:hover{ color:#fff; transform: scale(1.1); }
  .tabs-arrow:active{ transform: scale(0.94); }

  .swipe-hint{
    font-size: 10.5px;
    letter-spacing: 0.04em;
    color: rgba(244,241,251,0.4);
    margin: 8px 0 8px;
    text-align:center;
  }

  .tabs{
    display:flex;
    gap: 6px;
    padding: 5px;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    z-index: 5;
    flex-wrap: wrap;
    justify-content:center;
    max-width: 100%;
    overflow-x: auto;
  }

  .tab-btn{
    font-family: var(--ui);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: rgba(244,241,251,0.55);
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    display:flex;
    align-items:center;
    gap: 6px;
    white-space:nowrap;
  }
  .tab-btn.active{
    background: linear-gradient(135deg, var(--neon1), var(--neon2));
    color: #0a0512;
    box-shadow: 0 0 20px -2px var(--panel-glow);
  }
  .tab-btn:hover:not(.active){ color: #fff; }

  main{
    width: 100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    z-index: 2;
  }

  .tab-panel{
    display:none;
    width: 100%;
    flex-direction:column;
    align-items:center;
    animation: fadeIn 0.4s ease;
  }
  .tab-panel.active{ display:flex; }

  @keyframes fadeIn{
    from{ opacity:0; transform: translateY(8px); }
    to{ opacity:1; transform: translateY(0); }
  }

  h1{
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(24px, 4.5vw, 34px);
    margin: 8px 0 6px;
    color: #fff;
    letter-spacing: 0.01em;
    text-shadow: 0 0 18px var(--panel-glow);
  }

  .subtitle{
    font-size: 13px;
    color: rgba(244,241,251,0.6);
    margin-bottom: 26px;
    text-align:center;
    max-width: 460px;
    line-height: 1.6;
    padding: 0 18px;
  }

  .layout{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap: 36px;
    width: 100%;
    max-width: 920px;
    padding: 0 18px;
  }

  .glass-panel{
    background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(0,0,0,0.25));
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    box-shadow: 0 0 32px -8px var(--panel-glow), inset 0 1px 0 rgba(255,255,255,0.06);
    backdrop-filter: blur(6px);
  }

  /* ================= WHEEL ================= */

  .wheel-block{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap: 22px;
  }

  .wheel-stage{
    position:relative;
    width: min(76vw, 380px);
    height: min(76vw, 380px);
  }

  .wheel-shadow{
    position:absolute;
    inset: 4%;
    border-radius:50%;
    background: radial-gradient(circle, var(--neon1) 0%, transparent 70%);
    filter: blur(30px);
    opacity: 0.5;
    z-index: 0;
  }

  .pointer{
    position:absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 22px;
    z-index: 6;
  }
  .pointer .ball{
    width: 15px;
    height: 15px;
    margin: 2px auto 0;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #ffffff, var(--neon2-l) 45%, var(--neon2) 100%);
    box-shadow: 0 0 10px 2px var(--neon2);
  }
  .pointer .notch{
    width: 0; height: 0;
    margin: -1px auto 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 12px solid var(--neon1-l);
    filter: drop-shadow(0 0 6px var(--neon1));
  }

  .neon-rim{
    position:relative;
    width:100%;
    height:100%;
    border-radius:50%;
    background: conic-gradient(from 0deg, var(--neon1), var(--neon2), var(--neon1));
    box-shadow:
      0 0 40px -4px var(--panel-glow),
      0 0 80px -20px var(--panel-glow),
      inset 0 0 0 2px rgba(255,255,255,0.15);
    padding: 4%;
    z-index: 1;
  }

  .ball-track{
    width:100%;
    height:100%;
    border-radius:50%;
    background: radial-gradient(circle at 40% 30%, #14091f, #05020a 70%);
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.1);
    padding: 3%;
  }

  .wheel-wrap{
    position:relative;
    width:100%;
    height:100%;
    border-radius:50%;
    overflow:hidden;
    background: #05020a;
    box-shadow: inset 0 0 18px rgba(0,0,0,0.9), inset 0 0 0 2px #000;
  }

  #wheel{
    width:100%;
    height:100%;
    display:block;
    transform-origin: 50% 50%;
    position:relative;
    z-index:1;
  }

  .hub{
    position:absolute;
    top:50%; left:50%;
    width: 15%;
    height:15%;
    transform: translate(-50%,-50%);
    border-radius:50%;
    background: radial-gradient(circle at 34% 28%, var(--neon2-l), var(--neon1) 60%, #1a0630 100%);
    box-shadow: 0 0 20px 2px var(--panel-glow), inset 0 0 0 2px rgba(255,255,255,0.3);
    z-index: 4;
  }
  .hub::after{
    content:"";
    position:absolute;
    inset: 28%;
    border-radius:50%;
    background: radial-gradient(circle at 35% 30%, #241238, #08030f);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.8);
  }

  /* ================= CONTROLS ================= */

  .controls{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap: 16px;
  }

  .neon-btn{
    font-family: var(--ui);
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 14px 42px;
    border-radius: 999px;
    border: 1px solid var(--neon1);
    background: linear-gradient(135deg, var(--neon1-d), #0a0512 60%);
    color: #fff;
    cursor:pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
    box-shadow: 0 0 24px -4px var(--panel-glow), inset 0 1px 0 rgba(255,255,255,0.14);
  }
  .neon-btn:hover:not(:disabled){
    transform: translateY(-2px);
    box-shadow: 0 0 34px -2px var(--panel-glow), inset 0 1px 0 rgba(255,255,255,0.2);
  }
  .neon-btn:active:not(:disabled){ transform: translateY(0px); }
  .neon-btn:disabled{ opacity: 0.45; cursor: default; }
  .neon-btn.danger{
    border-color: var(--lose);
    background: linear-gradient(135deg, #4a0a1c, #0a0512 60%);
    color: #ffd3dc;
    box-shadow: 0 0 24px -4px rgba(255,56,96,0.5), inset 0 1px 0 rgba(255,255,255,0.14);
  }
  .neon-btn.gold{
    border-color: var(--win);
    color: #d6fff0;
    box-shadow: 0 0 24px -4px rgba(57,255,136,0.5), inset 0 1px 0 rgba(255,255,255,0.14);
  }

  .result{
    display:flex;
    align-items:center;
    gap: 14px;
    min-height: 58px;
  }

  .result-chip{
    width: 50px; height: 50px;
    border-radius: 50%;
    display:flex; align-items:center; justify-content:center;
    font-family: var(--display);
    font-size: 18px; font-weight: 800;
    color: #fff;
    border: 3px solid rgba(255,255,255,0.3);
    box-shadow: 0 0 18px 2px var(--panel-glow);
    opacity: 0;
    transform: scale(0.55);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  }
  .result-chip.show{ opacity: 1; transform: scale(1); }
  .result-chip.red{ background: linear-gradient(160deg, #ff5577, #a3182b); }
  .result-chip.black{ background: linear-gradient(160deg, #3a3a44, #0c0c10); }
  .result-chip.green{ background: linear-gradient(160deg, var(--neon1-l), var(--neon1-d)); }

  .result-texts{ display:flex; flex-direction:column; gap: 3px; }

  .result-text{
    font-size: 13px;
    color: rgba(244,241,251,0.65);
    opacity: 0;
    transition: opacity 0.35s ease;
  }
  .result-text.show{ opacity: 1; }
  .result-text b{ color: #fff; font-weight: 800; }

  .bet-summary{
    font-size: 12.5px;
    font-weight: 800;
    opacity: 0;
    transition: opacity 0.35s ease;
  }
  .bet-summary.show{ opacity: 1; }
  .bet-summary.win{ color: var(--win); }
  .bet-summary.lose{ color: var(--lose); }
  .bet-summary.neutral{ color: rgba(244,241,251,0.6); }

  .stats{ display:flex; gap: 10px; font-size: 12px; flex-wrap:wrap; justify-content:center; }
  .stat{
    display:flex; align-items:center; gap: 7px;
    padding: 6px 12px; border-radius: 999px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(244,241,251,0.65);
  }
  .stat .dot{ width:9px; height:9px; border-radius:50%; }
  .stat .dot.red{ background: #ff5577; box-shadow:0 0 6px #ff5577; }
  .stat .dot.black{ background: #6a6a76; }
  .stat .dot.green{ background: var(--neon1); box-shadow:0 0 6px var(--neon1); }
  .stat b{ color: #fff; font-weight:800; }

  /* Horizontal scrollable "last N" history row */
  .hscroll-history{
    display:flex;
    flex-wrap: nowrap;
    gap: 7px;
    max-width: 460px;
    width:100%;
    overflow-x:auto;
    padding: 4px 2px 8px;
    scroll-snap-type: x proximity;
  }
  .history-chip{
    flex: 0 0 auto;
    scroll-snap-align:start;
    width: 34px; height: 34px; border-radius: 50%;
    display:flex; align-items:center; justify-content:center;
    font-size: 11px; font-weight: 800; color: #fff;
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: 0 0 8px -1px rgba(0,0,0,0.6);
  }
  .history-chip.red{ background: linear-gradient(160deg,#ff5577,#a3182b); }
  .history-chip.black{ background: linear-gradient(160deg,#3a3a44,#0c0c10); }
  .history-chip.green{ background: linear-gradient(160deg,var(--neon1-l),var(--neon1-d)); }

  .crash-chip{
    flex: 0 0 auto;
    scroll-snap-align:start;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 800;
    color: #fff;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.15);
    white-space:nowrap;
  }
  .crash-chip.low{ color: #ff92a4; border-color: rgba(255,56,96,0.4); }
  .crash-chip.high{ color: var(--win); border-color: rgba(57,255,136,0.4); }

  /* ================= CHIP SELECTOR / BET INPUT ================= */

  .chip-label{
    font-size: 12px;
    color: rgba(244,241,251,0.6);
    letter-spacing: 0.03em;
  }

  .bet-input-wrap{
    display:flex;
    align-items:center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content:center;
  }
  .bet-input-control{
    display:flex;
    align-items:center;
    gap: 6px;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    padding: 5px 6px;
  }
  .bet-input{
    width: 92px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--neon1-l);
    font-family: var(--display);
    font-weight: 700;
    font-size: 14px;
    text-align:center;
    -moz-appearance: textfield;
  }
  .bet-input::-webkit-outer-spin-button,
  .bet-input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
  .bet-step{
    font-family: var(--ui);
    font-size: 11px;
    font-weight: 700;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--panel-border);
    background: rgba(255,255,255,0.05);
    color: rgba(244,241,251,0.65);
    cursor:pointer;
    transition: background 0.2s ease, color 0.2s ease;
  }
  .bet-step:hover{ background: rgba(255,255,255,0.14); color: #fff; }

  .bet-actions{
    display:flex;
    align-items:center;
    gap: 14px;
    font-size: 12.5px;
    color: rgba(244,241,251,0.65);
  }
  #clear-bets{
    font-family: var(--ui);
    font-size: 12px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--panel-border);
    background: rgba(0,0,0,0.25);
    color: rgba(244,241,251,0.65);
    cursor:pointer;
    transition: background 0.2s ease, color 0.2s ease;
  }
  #clear-bets:hover{ background: rgba(0,0,0,0.4); color: #fff; }

  /* ================= BETTING TABLE ================= */

  .table-block{
    width: 100%;
    max-width: 560px;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap: 16px;
  }

  .table-label{
    font-family: var(--display);
    font-size: 14px;
    font-weight:700;
    color: var(--neon1-l);
    letter-spacing: 0.03em;
  }

  .baize{
    width: 100%;
    padding: 14px;
    transition: opacity 0.3s ease;
  }
  .baize.locked{ opacity: 0.55; pointer-events: none; }

  .grid-row{ display:flex; gap: 5px; }

  .zero-cell{
    width: 42px; flex-shrink:0;
    display:flex; align-items:center; justify-content:center;
    background: linear-gradient(160deg, var(--neon1-l), var(--neon1-d));
    border-radius: 6px;
    font-weight: 800; font-size: 15px; color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
    cursor: pointer;
  }

  .numbers-grid{
    flex:1;
    display:grid;
    grid-template-columns: repeat(12, minmax(28px, 1fr));
    grid-template-rows: repeat(3, auto);
    grid-auto-flow: row;
    gap: 4px;
    min-width: 360px;
  }

  .num-cell{
    aspect-ratio: 1 / 0.82;
    display:flex; align-items:center; justify-content:center;
    border-radius: 5px;
    font-size: 12px; font-weight: 700; color: #fff;
    border: 1px solid rgba(255,255,255,0.14);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
    cursor: pointer;
  }
  .num-cell.red{ background: linear-gradient(160deg, #ff5577, #a3182b); }
  .num-cell.black{ background: linear-gradient(160deg, #3a3a44, #0c0c10); }
  .num-cell:hover, .zero-cell:hover{ filter: brightness(1.25); }

  .num-cell.win, .zero-cell.win{
    box-shadow: 0 0 0 2px #fff, 0 0 18px 4px var(--neon2);
    transform: translateY(-2px);
  }

  .dozens-row{
    display:grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-top: 6px;
  }
  .outside-bets{
    display:grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-top: 6px;
  }
  .outside-cell{
    padding: 9px 4px;
    text-align:center;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: rgba(244,241,251,0.7);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--panel-border);
    border-radius: 5px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
  }
  .outside-cell:hover{ background: rgba(255,255,255,0.12); }
  .outside-cell.win{
    box-shadow: 0 0 0 2px #fff, 0 0 18px 4px var(--neon2);
    color: #fff;
  }

  .bet-badge{
    position:absolute;
    top:-7px; right:-7px;
    background: var(--neon2);
    color:#04121a;
    font-size: 9.5px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 999px;
    box-shadow: 0 0 8px var(--neon2);
    pointer-events:none;
    z-index: 5;
    white-space: nowrap;
  }

  .footnote{
    margin-top: 4px;
    font-size: 11.5px;
    color: rgba(244,241,251,0.35);
    text-align:center;
    max-width: 440px;
    line-height: 1.65;
    padding: 0 18px 30px;
  }

  /* ================= MINING TAB ================= */

  .mining-stage{
    position:relative;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap: 26px;
    padding: 10px 18px 40px;
    width:100%;
    max-width: 480px;
  }

  .mine-orb-wrap{ position:relative; width: 220px; height: 220px; }

  .mine-glow{
    position:absolute;
    inset: -20px;
    border-radius:50%;
    background: radial-gradient(circle, var(--panel-glow), transparent 70%);
    filter: blur(6px);
    animation: glowPulse 2.6s ease-in-out infinite;
  }
  @keyframes glowPulse{
    0%,100%{ opacity:0.55; transform: scale(1); }
    50%{ opacity:0.9; transform: scale(1.06); }
  }

  .mine-orb{
    position:relative;
    width: 100%;
    height:100%;
    border-radius:50%;
    background: radial-gradient(circle at 35% 28%, var(--neon2-l), var(--neon1) 55%, #1a0630 100%);
    box-shadow: 0 0 40px -6px var(--panel-glow), inset 0 4px 10px rgba(255,255,255,0.25), inset 0 -10px 20px rgba(0,0,0,0.4);
    border: 3px solid rgba(255,255,255,0.35);
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap: 6px;
    cursor:pointer; user-select:none;
    transition: transform 0.08s ease;
    z-index: 2;
  }
  .mine-orb:active{ transform: scale(0.94); }
  .mine-orb.pulse{ animation: orbPulse 0.28s ease; }
  @keyframes orbPulse{ 0%{transform:scale(1);} 40%{transform:scale(1.07);} 100%{transform:scale(1);} }

  .mine-icon{ font-size: 46px; filter: drop-shadow(0 3px 4px rgba(0,0,0,0.5)); }
  .mine-cta{ font-family: var(--ui); font-weight: 800; font-size: 15px; color: #0a0512; letter-spacing: 0.03em; }
  .mine-sub{ font-family: var(--ui); font-size: 10.5px; color: rgba(10,5,18,0.65); letter-spacing: 0.06em; }

  .float-layer{ position:absolute; inset: -60px 0 0 0; pointer-events:none; overflow:visible; z-index: 4; }
  .float-text{
    position:absolute;
    font-family: var(--display);
    font-weight: 800;
    font-size: 18px;
    color: var(--neon1-l);
    text-shadow: 0 0 10px var(--neon1);
    animation: floatUp 0.95s ease-out forwards;
    left: 50%;
  }
  @keyframes floatUp{ 0%{opacity:1; transform: translate(-50%,0) scale(1);} 100%{opacity:0; transform: translate(-50%,-80px) scale(1.15);} }

  .combo-badge{
    padding: 7px 16px;
    border-radius: 999px;
    background: linear-gradient(160deg, var(--neon2-l), var(--neon2-d));
    color: #04121a;
    font-weight: 800;
    font-size: 12.5px;
    box-shadow: 0 0 16px -2px var(--panel-glow);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .stat-row{ display:flex; gap: 10px; flex-wrap:wrap; justify-content:center; }
  .stat-card{
    display:flex; flex-direction:column; align-items:center; gap: 4px;
    padding: 12px 20px;
    border-radius: 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--panel-border);
    min-width: 110px;
  }
  .stat-card span{ font-size: 11px; color: rgba(244,241,251,0.6); letter-spacing: 0.03em; }
  .stat-card b{ font-size: 18px; color: var(--neon1-l); font-family: var(--display); }

  /* ================= CRASH TAB ================= */
  .crash-stage{
    display:flex; flex-direction:column; align-items:center; gap: 18px;
    width:100%; max-width: 640px; padding: 0 18px;
  }
  .crash-graph-wrap{
    position:relative;
    width:100%;
    aspect-ratio: 600 / 320;
    max-height: 320px;
    overflow:hidden;
  }
  .crash-graph-wrap canvas{ width:100%; height:100%; display:block; }
  .crash-multiplier{
    position:absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(32px, 8vw, 52px);
    color: #fff;
    text-shadow: 0 0 20px var(--panel-glow);
    transition: color 0.2s ease;
    pointer-events:none;
    text-align:center;
  }
  .crash-multiplier.busted{ color: var(--lose); text-shadow: 0 0 24px var(--lose); }
  .crash-multiplier.won{ color: var(--win); text-shadow: 0 0 24px var(--win); }
  .crash-multiplier .wait-label{
    display:block;
    font-family: var(--ui);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: rgba(244,241,251,0.7);
    margin-top: 6px;
  }
  .crash-status{
    position:absolute;
    bottom: 12px; left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: rgba(244,241,251,0.65);
    text-align:center;
    width: 100%;
    padding: 0 12px;
    pointer-events:none;
  }
  .crash-controls{ display:flex; flex-direction:column; align-items:center; gap: 14px; }

  /* ================= MINES TAB ================= */
  .mines-stage{ display:flex; flex-direction:column; align-items:center; gap: 20px; width:100%; max-width: 480px; padding: 0 18px 20px; }
  .mines-settings{ display:flex; flex-direction:column; align-items:center; gap: 14px; width:100%; }
  .mines-count-wrap{ display:flex; align-items:center; gap: 12px; flex-wrap:wrap; justify-content:center; }
  .neon-select{
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    padding: 9px 16px;
    color: var(--neon1-l);
    font-family: var(--ui);
    font-weight: 800;
    font-size: 13.5px;
    outline:none;
    cursor:pointer;
  }
  .neon-select option{ color: #121215; }

  .mines-grid{ display:grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width:100%; max-width: 340px; padding: 14px; }
  .mine-cell{
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(0,0,0,0.35));
    border: 1px solid var(--panel-border);
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.08), 0 0 10px -3px var(--panel-glow);
    display:flex; align-items:center; justify-content:center;
    font-size: 20px;
    cursor:pointer;
    transition: transform 0.12s ease, background 0.2s ease, box-shadow 0.2s ease;
    user-select:none;
  }
  .mine-cell:hover:not(.revealed):not(.disabled){ transform: translateY(-2px); box-shadow: 0 0 18px -2px var(--panel-glow); }
  .mine-cell:active:not(.revealed):not(.disabled){ transform: translateY(0) scale(0.95); }
  .mine-cell.revealed.safe{ background: linear-gradient(160deg, var(--win), #0c8f45); cursor:default; }
  .mine-cell.revealed.mine{ background: linear-gradient(160deg, #ff5577, var(--lose)); cursor:default; }
  .mine-cell.disabled{ cursor:default; opacity: 0.85; }
  .mine-cell.faded{ opacity: 0.4; }

  .mines-info{ display:flex; gap: 10px; flex-wrap:wrap; justify-content:center; }
  .mines-actions{ display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap: 14px; }

  /* ================= DICE TAB ================= */
  .dice-stage{ display:flex; flex-direction:column; align-items:center; gap: 24px; width:100%; max-width: 520px; padding: 0 18px 20px; }
  .dice-panel{ width:100%; padding: 24px 22px; display:flex; flex-direction:column; align-items:center; gap: 20px; }
  .dice-result{
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(34px, 9vw, 48px);
    color: #fff;
    text-shadow: 0 0 20px var(--panel-glow);
    transition: color 0.2s ease;
  }
  .dice-result.win{ color: var(--win); text-shadow: 0 0 24px var(--win); }
  .dice-result.lose{ color: var(--lose); text-shadow: 0 0 24px var(--lose); }

  .dice-bar-wrap{ width:100%; position:relative; padding-top: 26px; }
  .dice-bar{
    width:100%; height: 20px; border-radius: 999px;
    overflow:hidden;
    position:relative;
    border: 1px solid var(--panel-border);
    display:flex;
  }
  .dice-bar .lose-zone{ background: linear-gradient(90deg, #4a0a1c, #6e1030); }
  .dice-bar .win-zone{ background: linear-gradient(90deg, #0c8f45, var(--win)); }
  .dice-marker{
    position:absolute;
    top: 0;
    width: 3px; height: 20px;
    background: #fff;
    box-shadow: 0 0 8px #fff;
    transform: translateX(-50%);
  }
  .dice-ball{
    position:absolute;
    top: -6px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 12px 3px #fff;
    transform: translateX(-50%);
    transition: left 0.5s cubic-bezier(0.2,0.8,0.2,1);
  }
  .dice-scale{ display:flex; justify-content:space-between; font-size:10.5px; color:rgba(244,241,251,0.4); margin-top:6px; }

  .dice-target-row{ display:flex; align-items:center; gap:14px; width:100%; justify-content:center; flex-wrap:wrap; }
  .dice-slider{
    -webkit-appearance:none; appearance:none;
    width: 220px; height: 6px; border-radius:999px;
    background: linear-gradient(90deg, var(--neon2-d), var(--neon1));
    outline:none;
  }
  .dice-slider::-webkit-slider-thumb{
    -webkit-appearance:none; width:20px; height:20px; border-radius:50%;
    background:#fff; box-shadow: 0 0 10px 2px var(--panel-glow); cursor:pointer;
    border: 2px solid var(--neon1);
  }
  .dice-target-val{
    font-family: var(--display); font-weight:800; font-size:16px; color:var(--neon1-l);
    min-width: 58px; text-align:center;
  }

  .mode-toggle{ display:flex; gap:8px; padding:4px; border-radius:999px; background: rgba(0,0,0,0.35); border: 1px solid var(--panel-border); }
  .mode-btn{
    font-family: var(--ui); font-size:12px; font-weight:700; padding: 8px 18px; border-radius:999px; border:none;
    background:transparent; color: rgba(244,241,251,0.6); cursor:pointer; transition: all 0.2s ease;
  }
  .mode-btn.active{ background: linear-gradient(135deg, var(--neon1), var(--neon2)); color:#0a0512; }

  .dice-info-row{ display:flex; gap:10px; flex-wrap:wrap; justify-content:center; }

  /* ================= TOWER TAB ================= */
  .tower-stage{ display:flex; flex-direction:column; align-items:center; gap: 20px; width:100%; max-width: 420px; padding: 0 18px 20px; }
  .tower-grid{ display:flex; flex-direction:column-reverse; gap: 7px; width:100%; }
  .tower-row{ display:flex; gap: 8px; align-items:center; }
  .tower-row-label{ width: 46px; flex-shrink:0; font-family: var(--display); font-size:11.5px; font-weight:700; color: rgba(244,241,251,0.45); text-align:right; }
  .tower-tiles{ flex:1; display:grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .tower-tile{
    height: 46px;
    border-radius: 10px;
    background: linear-gradient(160deg, rgba(255,255,255,0.07), rgba(0,0,0,0.35));
    border: 1px solid var(--panel-border);
    display:flex; align-items:center; justify-content:center;
    font-size: 18px;
    cursor:pointer;
    transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
    color: rgba(244,241,251,0.3);
  }
  .tower-row.active .tower-tile{ cursor:pointer; color: rgba(244,241,251,0.6); box-shadow: 0 0 14px -3px var(--panel-glow); }
  .tower-row.active .tower-tile:hover{ transform: translateY(-2px); box-shadow: 0 0 20px -2px var(--panel-glow); }
  .tower-row.done .tower-tile{ cursor:default; }
  .tower-row.done .tower-tile.safe{ background: linear-gradient(160deg, var(--win), #0c8f45); color:#04160c; }
  .tower-row.done .tower-tile.bomb{ background: linear-gradient(160deg, #ff5577, var(--lose)); color:#1a0207; }
  .tower-row.locked .tower-tile{ cursor:default; opacity: 0.4; }
  .tower-row-mult{ width: 54px; flex-shrink:0; font-family: var(--display); font-weight:800; font-size:12px; color: var(--neon1-l); text-align:left; }

  @media (prefers-reduced-motion: reduce){
    #wheel{ transition: none !important; }
    .float-text, .mine-glow, .mine-orb.pulse{ animation: none !important; }
  }

  @media (max-width: 480px){
    .num-cell{ font-size: 9.5px; }
    .zero-cell{ width: 32px; font-size: 12px; }
    .outside-cell{ font-size: 8.5px; }
    .mine-orb-wrap{ width: 180px; height: 180px; }
    .dice-slider{ width: 160px; }
    .tower-row-label{ width: 34px; font-size:10px; }
    .tower-row-mult{ width: 42px; font-size:10.5px; }
  }

.burger-wrap{position:relative;display:flex;justify-content:center;width:100%}.burger-btn{font:inherit;background:#ffffff14;color:#fff;border:1px solid #ffffff2e;border-radius:12px;padding:10px 22px;cursor:pointer;font-size:17px}.burger-menu{display:none;position:absolute;top:110%;z-index:50;min-width:240px;background:#141828f2;border:1px solid #22e6ff44;border-radius:14px;padding:8px;box-shadow:0 10px 40px #000a}.burger-menu.open{display:block}.burger-menu a{display:block;color:#fff;text-decoration:none;padding:10px 14px;border-radius:10px}.burger-menu a:hover{background:#22e6ff22}.burger-menu a.cur{background:#22e6ff33}


/* башня: рост снизу вверх */
.tower-grid{ flex-direction: column; }
/* открытая мина — ярко, не мутно */
.tower-row.done .tower-tile{ opacity: 1 !important; }
.tower-row.done .tower-tile.bomb{ background: linear-gradient(160deg,#ff2d55,#a30027) !important; color:#fff !important;
  border:2px solid #ff8fa5 !important; box-shadow:0 0 22px #ff2d55cc, inset 0 0 14px #ffffff55 !important; font-size:30px !important; }
/* убрать голубой квадрат фокуса браузера */
*:focus,
*:focus-visible,
*:active {
  outline: none !important;
  outline-offset: 0 !important;
}
button, a, input, select, textarea, [tabindex],
.neon-btn, .bet-step, .theme-swatch, .auth-btn, .burger-btn,
.mode-btn, .mine-cell, .tower-tile, .num-cell, .outside-cell, .zero-cell {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-focus-ring-color: transparent !important;
  outline: none !important;
}
button:focus, button:focus-visible, button:active,
a:focus, a:focus-visible, input:focus, input:focus-visible {
  outline: none !important;
  outline-offset: 0 !important;
}
/* рулетка: крупное поле ставок */
.table-block{ max-width: 680px; margin: 0 auto; }
.numbers-grid{ gap: 8px; }
.num-cell{ min-width:52px; min-height:52px; font-size:19px; border-radius:12px; }
.zero-cell{ min-width:52px; min-height:52px; font-size:19px; border-radius:12px; }
.outside-cell{ padding:14px 10px; font-size:16px; border-radius:12px; }
.dozens-row .outside-cell{ padding:14px 10px; font-size:16px; }
.baize{ padding:18px; border-radius:18px; }
@media (max-width: 480px){
  .num-cell,.zero-cell{ min-width:44px; min-height:44px; font-size:17px; }
}


.tabs-row{background:none!important;border:none!important;box-shadow:none!important;padding:2px 0!important;}
.tabs-row::before,.tabs-row::after{display:none!important;}
.auth-btn{font:inherit;background:#22e6ff22;color:#fff;border:1px solid #22e6ff66;border-radius:10px;padding:8px 16px;cursor:pointer;font-size:15px;white-space:nowrap;}
.auth-btn:hover{background:#22e6ff44;}
.auth-overlay{position:fixed;inset:0;background:#000a;display:flex;align-items:center;justify-content:center;z-index:100;}
.auth-box{width:min(340px,90vw);background:#141828;border:1px solid #22e6ff44;border-radius:16px;padding:22px;}
.auth-tabs{display:flex;gap:8px;margin-bottom:14px;}
.auth-tabs button{flex:1;font:inherit;background:transparent;color:#fff;border:1px solid #ffffff2e;border-radius:10px;padding:9px;cursor:pointer;}
.auth-tabs button.active{background:#22e6ff33;border-color:#22e6ff;}
.auth-box input{width:100%;box-sizing:border-box;font:inherit;margin-bottom:10px;background:#ffffff10;color:#fff;border:1px solid #ffffff2e;border-radius:10px;padding:10px 12px;}
.auth-err{color:#ff5577;min-height:20px;font-size:14px;margin-bottom:6px;}
.auth-box .neon-btn{width:100%;}

/* topbar burger fix */
.topbar-right .burger-wrap {
  position: relative;
  display: flex;
  width: auto;
  justify-content: flex-end;
}
.topbar-right .burger-btn {
  padding: 8px 14px;
  font-size: 16px;
  border-radius: 10px;
  background: rgba(34, 230, 255, 0.12);
  border: 1px solid rgba(34, 230, 255, 0.4);
}
.topbar-right .burger-menu {
  right: 0;
  left: auto;
  min-width: 220px;
}
.topbar-right .burger-menu a {
  font-size: 14px;
}

/* ========== FIXES 2026 ========== */

/* Topbar: burger far right */
.topbar {
  padding: 12px 14px;
}
.topbar-right {
  margin-left: auto;
  gap: 10px;
}
.topbar-right .burger-wrap {
  margin-left: 4px;
  order: 99;
}

/* Slide-out side drawer */
.side-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.side-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(300px, 86vw);
  height: 100%;
  z-index: 95;
  background: linear-gradient(180deg, #120a22 0%, #0a0614 100%);
  border-left: 1px solid var(--panel-border);
  box-shadow: -12px 0 40px rgba(0,0,0,0.5);
  transform: translateX(105%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 24px;
  overflow-y: auto;
}
.side-drawer.open {
  transform: translateX(0);
}
.side-drawer .drawer-title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  color: var(--neon1-l);
  margin: 4px 0 16px;
  letter-spacing: 0.04em;
}
.side-drawer a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  padding: 13px 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  transition: background 0.15s ease;
}
.side-drawer a:hover,
.side-drawer a.cur {
  background: rgba(34, 230, 255, 0.15);
}
.side-drawer .drawer-close {
  align-self: flex-end;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  margin-bottom: 8px;
}

/* Hide old dropdown burger menu */
.burger-menu { display: none !important; }

/* Action row: bet + buttons together */
.action-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  margin-top: 4px;
}
.action-row .bet-input-wrap {
  margin: 0;
  justify-content: center;
  flex-wrap: wrap;
}
.action-row .mines-actions,
.action-row .action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* Roulette baize — European table, not compressed */
.table-block {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 12px 24px;
}
.baize {
  width: 100%;
  margin: 0 auto;
  padding: 14px !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.grid-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
  min-width: 420px;
}
.zero-cell {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 44px !important;
  min-width: 44px !important;
  flex-shrink: 0;
  border-radius: 10px !important;
  font-size: 18px !important;
  font-weight: 800;
  background: linear-gradient(160deg, #39ff88, #0c8f45) !important;
  color: #04160c !important;
  writing-mode: horizontal-tb !important;
}
.numbers-grid {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(30px, 1fr)) !important;
  grid-template-rows: repeat(3, 44px) !important;
  grid-auto-flow: row !important;
  gap: 5px !important;
  flex: 1;
  min-width: 360px;
}
.num-cell {
  min-width: 0 !important;
  height: 44px !important;
  min-height: 44px !important;
  font-size: 13px !important;
  aspect-ratio: auto !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 8px !important;
  position: relative;
  font-weight: 800;
}
.dozens-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
  min-width: 420px;
}
.outside-bets {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 6px;
  min-width: 420px;
}
.outside-cell {
  padding: 12px 4px !important;
  font-size: 12px !important;
  text-align: center;
  border-radius: 10px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  min-height: 40px;
}

@media (max-width: 560px) {
  .numbers-grid {
    grid-template-rows: repeat(3, 40px) !important;
    gap: 4px !important;
  }
  .num-cell {
    height: 40px !important;
    min-height: 40px !important;
    font-size: 12px !important;
  }
  .zero-cell {
    width: 36px !important;
    min-width: 36px !important;
    font-size: 15px !important;
  }
  .outside-bets {
    grid-template-columns: repeat(3, 1fr);
  }
  .outside-cell {
    font-size: 11px !important;
    padding: 10px 4px !important;
  }
  .baize { padding: 10px !important; }
}

@media (min-width: 700px) {
  .numbers-grid {
    grid-template-rows: repeat(3, 52px) !important;
    gap: 6px !important;
  }
  .num-cell {
    height: 52px !important;
    min-height: 52px !important;
    font-size: 16px !important;
  }
  .zero-cell {
    width: 52px !important;
    min-width: 52px !important;
    font-size: 20px !important;
  }
  .outside-cell {
    font-size: 13px !important;
    padding: 14px 6px !important;
  }
}

/* Crash graph polish */
.crash-graph-wrap {
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.55));
}
.crash-multiplier {
  text-shadow: 0 0 28px var(--panel-glow), 0 2px 8px rgba(0,0,0,0.8);
}
.crash-history-wrap {
  width: 100%;
  max-width: 640px;
  padding: 0 12px;
}
.crash-history-label {
  font-size: 11px;
  color: rgba(244,241,251,0.45);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.hscroll-history {
  scrollbar-width: thin;
  padding-bottom: 6px;
}

/* Profile logout */
.logout-btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,56,96,0.45);
  background: linear-gradient(135deg, #3a0a16, #0a0512 70%);
  color: #ffb3c1;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.logout-btn:hover {
  border-color: var(--lose);
  color: #fff;
}

/* General polish */
.neon-btn {
  min-width: 140px;
}
.bet-input {
  width: 90px;
  text-align: center;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 9px 8px;
}
.bet-step {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}
.bet-step:hover {
  background: rgba(255,255,255,0.14);
}


/* Tower: revealed tiles always bright, never muted */
.tower-row.done .tower-tile,
.tower-row.done.locked .tower-tile {
  opacity: 1 !important;
  filter: none !important;
}
.tower-row.done .tower-tile.safe {
  background: linear-gradient(160deg, #39ff88, #0c8f45) !important;
  color: #04160c !important;
  border: 2px solid rgba(57,255,136,0.7) !important;
  box-shadow: 0 0 18px rgba(57,255,136,0.45) !important;
  font-size: 26px !important;
}
.tower-row.done .tower-tile.bomb {
  background: linear-gradient(160deg, #ff2d55, #a30027) !important;
  color: #fff !important;
  border: 2px solid #ff8fa5 !important;
  box-shadow: 0 0 22px #ff2d55cc, inset 0 0 14px #ffffff44 !important;
  font-size: 26px !important;
}

/* Toast notifications */
.toast-stack {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 14px 14px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  animation: toastIn 0.28s cubic-bezier(0.22,1,0.36,1);
  touch-action: pan-y;
  user-select: none;
}
.toast.win {
  background: linear-gradient(135deg, #0d3d24, #072016 70%);
  border: 1px solid rgba(57,255,136,0.55);
  color: #b8ffd4;
}
.toast.lose {
  background: linear-gradient(135deg, #3d0d18, #16070c 70%);
  border: 1px solid rgba(255,56,96,0.55);
  color: #ffb3c1;
}
.toast .toast-msg { flex: 1; }
.toast .toast-x {
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.7;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
}
.toast .toast-x:hover { opacity: 1; }
.toast.hiding {
  animation: toastOut 0.25s ease forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-12px) scale(0.96); }
}


/* Extra themes atmosphere */
html[data-theme="space"] body::before { opacity: 0.15; }
html[data-theme="space"] body::after {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 12%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 22% 38%, #c5d6ff, transparent),
    radial-gradient(1px 1px at 35% 18%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 48% 62%, #e0a6ff, transparent),
    radial-gradient(1px 1px at 61% 28%, #fff, transparent),
    radial-gradient(2px 2px at 74% 72%, #fff, transparent),
    radial-gradient(1px 1px at 88% 15%, #c5d6ff, transparent),
    radial-gradient(1.5px 1.5px at 12% 78%, #fff, transparent),
    radial-gradient(1px 1px at 41% 88%, #e0a6ff, transparent),
    radial-gradient(1.5px 1.5px at 55% 8%, #fff, transparent),
    radial-gradient(1px 1px at 67% 48%, #fff, transparent),
    radial-gradient(2px 2px at 91% 55%, #c5d6ff, transparent),
    radial-gradient(1px 1px at 18% 52%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 33% 68%, #fff, transparent),
    radial-gradient(1px 1px at 79% 33%, #e0a6ff, transparent),
    radial-gradient(1px 1px at 5% 45%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 95% 90%, #fff, transparent),
    radial-gradient(1px 1px at 50% 40%, #c5d6ff, transparent);
  background-repeat: repeat; background-size: 320px 320px;
  animation: star-drift 120s linear infinite; opacity: 0.9;
}
@keyframes star-drift {
  from { background-position: 0 0; }
  to { background-position: 320px 160px; }
}
html[data-theme="ocean"] body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 600px 280px at 20% 90%, rgba(0,212,200,0.12), transparent 70%),
    radial-gradient(ellipse 500px 220px at 80% 95%, rgba(61,169,252,0.1), transparent 70%);
}
html[data-theme="ember"] body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 700px 320px at 50% 110%, rgba(255,77,46,0.18), transparent 65%),
    radial-gradient(ellipse 400px 200px at 15% 0%, rgba(255,176,32,0.08), transparent 60%);
}
html[data-theme="arctic"] body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 800px 300px at 50% -10%, rgba(168,230,255,0.12), transparent 60%),
    radial-gradient(ellipse 500px 250px at 80% 100%, rgba(126,182,255,0.08), transparent 70%);
}
html[data-theme="sunset"] body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 900px 400px at 50% 100%, rgba(255,107,157,0.15), transparent 60%),
    radial-gradient(ellipse 500px 260px at 10% 20%, rgba(255,179,71,0.1), transparent 65%);
}
.theme-picker { flex-wrap: wrap; max-width: 220px; justify-content: center; }
@media (max-width: 520px) {
  .theme-picker { max-width: 160px; }
  .theme-swatch { width: 16px; height: 16px; }
}




/* ========== RESPONSIVE TOPBAR + DRAWER THEMES ========== */

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* --- Desktop / default: spacious topbar --- */
.topbar {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 14px 28px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.topbar .brand {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  flex: 0 1 auto !important;
}
.topbar .brand .mark {
  font-size: 26px !important;
  flex-shrink: 0 !important;
  filter: drop-shadow(0 0 8px var(--neon1)) drop-shadow(0 0 16px var(--neon2));
}
.topbar .brand .brand-text {
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px !important;
  letter-spacing: 0.03em;
  white-space: nowrap !important;
  color: #fff;
}
.topbar-right {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 12px !important;
  margin-left: auto !important;
  flex: 0 0 auto !important;
}
.topbar .theme-picker { display: none !important; }

.balance-pill {
  padding: 10px 18px !important;
  font-size: 15px !important;
  gap: 8px !important;
}
.auth-btn {
  padding: 9px 16px !important;
  font-size: 14px !important;
}
.burger-wrap,
.topbar-right .burger-wrap {
  width: auto !important;
  margin: 0 !important;
  order: 99 !important;
  flex-shrink: 0 !important;
}
.burger-btn,
.topbar-right .burger-btn {
  padding: 9px 14px !important;
  font-size: 17px !important;
  border: 1px solid rgba(255,255,255,0.22) !important;
  background: rgba(0,0,0,0.35) !important;
  border-radius: 10px !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
  cursor: pointer;
}
.burger-btn:hover {
  border-color: var(--neon1) !important;
  background: rgba(255,255,255,0.08) !important;
}

/* Side drawer */
.side-drawer {
  display: flex !important;
  flex-direction: column !important;
  width: min(320px, 86vw) !important;
}
.side-drawer .drawer-spacer {
  flex: 1 1 auto;
  min-height: 12px;
}
.side-drawer .drawer-themes {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.side-drawer .drawer-themes-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(244,241,251,0.45);
  margin-bottom: 12px;
}
.side-drawer .drawer-theme-picker {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}
.side-drawer .theme-swatch {
  width: 30px !important;
  height: 30px !important;
  justify-self: center;
}

/* Home: nice on PC */
.home-hero {
  max-width: 800px !important;
  padding: 48px 24px 28px !important;
}
.home-hero h1 {
  font-size: clamp(32px, 4vw, 48px) !important;
}
.home-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
  max-width: 900px !important;
  padding: 0 24px 48px !important;
}
.home-card {
  padding: 28px 16px !important;
  min-height: 140px;
}
.home-card .ico { font-size: 36px !important; }
.home-card .title { font-size: 16px !important; }
.home-card .desc { font-size: 12.5px !important; }

/* Main content width on large screens */
main {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* Focus */
*:focus, *:focus-visible, button:focus, button:active {
  outline: none !important;
}
button, a, input {
  -webkit-tap-highlight-color: transparent !important;
}

/* --- Tablet --- */
@media (max-width: 900px) {
  .home-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .topbar {
    padding: 12px 16px !important;
  }
}

/* --- Phone --- */
@media (max-width: 560px) {
  .topbar {
    gap: 8px !important;
    padding: 10px 12px !important;
  }
  .topbar .brand .mark {
    font-size: 20px !important;
  }
  .topbar .brand .brand-text {
    font-size: 13px !important;
  }
  .balance-pill {
    padding: 7px 11px !important;
    font-size: 12.5px !important;
    gap: 5px !important;
    max-width: 42vw;
  }
  .balance-pill .balance-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .auth-btn {
    padding: 7px 11px !important;
    font-size: 12.5px !important;
  }
  .burger-btn,
  .topbar-right .burger-btn {
    padding: 7px 11px !important;
    font-size: 15px !important;
  }
  .home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    padding: 0 12px 32px !important;
  }
  .home-card {
    padding: 16px 10px !important;
    min-height: 0;
  }
  .home-card .ico { font-size: 28px !important; }
  .home-card .title { font-size: 13px !important; }
  .home-card .desc { font-size: 10.5px !important; }
  .home-hero {
    padding: 24px 14px 12px !important;
  }
  .home-hero h1 {
    font-size: 26px !important;
  }
  h1 { font-size: 22px !important; }
  .subtitle { font-size: 12px !important; padding: 0 12px !important; }
  .side-drawer .theme-swatch {
    width: 28px !important;
    height: 28px !important;
  }
}

@media (min-width: 1100px) {
  .topbar {
    padding: 16px 40px !important;
  }
  .topbar .brand .brand-text {
    font-size: 20px !important;
  }
  .home-grid {
    max-width: 960px !important;
    gap: 18px !important;
  }
}
