﻿/* =========================================================
   Hardbass — PROFESSIONAL CASINO UI (Stake-style)
   Design: dark navy + blue accent, always-visible desktop sidebar
========================================================= */

/* =========================================================
   1) DESIGN TOKENS
========================================================= */
:root {
  --bg0:    #0f1923;
  --bg1:    #1a2c38;
  --bg2:    #213743;
  --bg3:    #2a4559;

  --surface0: rgba(255,255,255,.03);
  --surface1: rgba(255,255,255,.05);
  --surface2: rgba(255,255,255,.08);

  --border0: rgba(255,255,255,.07);
  --border1: rgba(255,255,255,.11);
  --border2: rgba(255,255,255,.16);

  --text0:   #c2d9ea;
  --text1:   rgba(194,217,234,.80);
  --text2:   rgba(194,217,234,.58);
  --text3:   rgba(194,217,234,.40);

  --accent:  #2e7dff;
  --accent-h: #4d93ff;
  --accent-d: #1a5fcc;

  --win:  #1fcf8b;
  --win-d: rgba(31,207,139,.15);
  --loss: #e84040;
  --loss-d: rgba(232,64,64,.15);
  --warn: #f0a500;

  --shadow0: 0 4px 20px rgba(0,0,0,.35);
  --shadow1: 0 8px 36px rgba(0,0,0,.50);
  --shadow2: 0 20px 60px rgba(0,0,0,.65);

  --r0: 8px;
  --r1: 12px;
  --r2: 16px;
  --r3: 22px;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --topbar-h:  56px;
  --sidebar-w: 210px;

  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-std:    cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================
   2) RESET
========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg0);
  color: var(--text0);
  min-height: 100vh;
  overflow-x: hidden;
}

a  { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select { font-family: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
input  { outline: none; }

::selection { background: rgba(46,125,255,.28); }

*::-webkit-scrollbar          { width: 6px; height: 6px; }
*::-webkit-scrollbar-track    { background: transparent; }
*::-webkit-scrollbar-thumb    { background: rgba(255,255,255,.12); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.20); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================
   3) LAYOUT
========================================================= */

/* Topbar */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 0;
  background: var(--bg1);
  border-bottom: 1px solid var(--border0);
  box-shadow: 0 1px 0 rgba(255,255,255,.04);
}

.topbar-left  { display: flex; align-items: center; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 1100;
  background: var(--bg1);
  border-right: 1px solid var(--border0);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;

  /* Mobile: hidden by default */
  transform: translateX(-110%);
  transition: transform .26s var(--ease-out), box-shadow .26s var(--ease-std);
  will-change: transform;
}

.sidebar.active {
  transform: translateX(0);
  box-shadow: 20px 0 60px rgba(0,0,0,.50);
}

/* Desktop: always visible */
@media (min-width: 1024px) {
  .sidebar {
    transform: translateX(0) !important;
    box-shadow: none !important;
    top: var(--topbar-h);
  }
  .container { margin-left: var(--sidebar-w); }
  .burger-wrap { display: none; }
}

/* Container */
.container {
  padding: calc(var(--topbar-h) + 20px) 20px 48px;
  max-width: 1300px;
}

/* Overlay (mobile only) */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .24s var(--ease-std), visibility .24s;
}
.overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* =========================================================
   4) TOPBAR COMPONENTS
========================================================= */

/* Brand */
.brand {
  width: var(--sidebar-w);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-right: 1px solid var(--border0);
  flex-shrink: 0;
  user-select: none;
}

.brand-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border1);
  flex-shrink: 0;
  background: var(--bg2);
}
.brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}

.brand-name {
  font-weight: 800;
  font-size: 15px;
  color: var(--text0);
  letter-spacing: -.2px;
}

/* Burger (mobile only) */
.burger-wrap {
  width: var(--topbar-h);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border0);
  border-radius: 10px;
  background: var(--surface0);
  color: var(--text0);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s, border-color .15s, transform .12s var(--ease-spring);
}
.icon-btn:hover { background: var(--surface1); border-color: var(--border1); }
.icon-btn:active { transform: scale(.92); }

.burger {
  width: 16px;
  height: 1.5px;
  background: var(--text0);
  border-radius: 3px;
  display: block;
  position: relative;
}
.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1.5px;
  background: var(--text0);
  border-radius: 3px;
  transition: transform .22s var(--ease-std);
}
.burger::before { top: -5px; }
.burger::after  { top:  5px; }

/* Chips */
.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border0);
  background: var(--bg2);
  font-size: 13px;
  line-height: 1;
}
.chip-label { color: var(--text3); font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
.chip-value { color: var(--text0); font-weight: 800; }

.chip-btn {
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s var(--ease-spring);
}
.chip-btn:hover { background: var(--bg3); border-color: var(--border1); }
.chip-btn:active { transform: scale(.97); }

.balance-icon { font-size: 14px; }

/* Auth button */
.btn-auth {
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  transition: filter .15s, transform .12s var(--ease-spring);
}
.btn-auth:hover { filter: brightness(1.12); }
.btn-auth:active { transform: scale(.96); }

/* Online indicator */
.online-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
}
.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--win);
  box-shadow: 0 0 6px var(--win);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}

/* =========================================================
   5) SIDEBAR NAV
========================================================= */

.nav { padding: 12px 8px; flex: 1; }

.nav-section {
  padding: 14px 8px 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r1);
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  transition: background .15s, color .15s, transform .12s var(--ease-spring);
  position: relative;
  cursor: pointer;
  border: 1px solid transparent;
}
.nav-link:hover {
  background: var(--surface1);
  color: var(--text0);
  transform: translateX(2px);
}
.nav-link.active {
  background: rgba(46,125,255,.14);
  border-color: rgba(46,125,255,.20);
  color: #7bb4ff;
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.nav-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--border0);
  font-size: 11px;
  color: var(--text3);
}

/* =========================================================
   6) TYPOGRAPHY & HELPERS
========================================================= */

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page { animation: pageIn .24s var(--ease-out) both; }

.page-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.3px;
  color: var(--text0);
  margin-bottom: 4px;
}
.page-sub {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 20px;
}

.h2 { font-size: 15px; font-weight: 800; color: var(--text0); letter-spacing: -.1px; }
.h3 { font-size: 13px; font-weight: 700; color: var(--text1); }

.muted { color: var(--text2); font-size: 13px; }
.mono  { font-family: var(--mono); }

.text-win  { color: var(--win); }
.text-loss { color: var(--loss); }
.text-warn { color: var(--warn); }

.hr { height: 1px; background: var(--border0); margin: 14px 0; }

.pre {
  font-family: var(--mono);
  font-size: 11px;
  background: rgba(0,0,0,.30);
  border: 1px solid var(--border0);
  border-radius: var(--r1);
  padding: 10px 12px;
  color: var(--text2);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

/* =========================================================
   7) PANELS & CARDS
========================================================= */

.panel {
  background: var(--bg2);
  border: 1px solid var(--border0);
  border-radius: var(--r2);
  overflow: hidden;
}

.panel-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0,0,0,.12);
}

.panel-body { padding: 16px; }

/* Compact card (used in lists) */
.card {
  background: var(--bg2);
  border: 1px solid var(--border0);
  border-radius: var(--r2);
  overflow: hidden;
}
.card-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(0,0,0,.10);
}
.card-body { padding: 14px 16px; }

/* =========================================================
   8) BUTTONS
========================================================= */

.btn {
  height: 38px;
  padding: 0 14px;
  border-radius: var(--r1);
  border: 1px solid var(--border1);
  background: var(--surface1);
  color: var(--text0);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s, border-color .15s, transform .12s var(--ease-spring);
  white-space: nowrap;
}
.btn:hover { background: var(--surface2); border-color: var(--border2); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(46,125,255,.25);
}
.btn-primary:hover { background: var(--accent-h); }
.btn-primary:disabled { box-shadow: none; }

.btn-win {
  background: var(--win);
  border-color: transparent;
  color: #061e13;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(31,207,139,.20);
}
.btn-win:hover { filter: brightness(1.1); }

.btn-ghost {
  background: transparent;
  border-color: var(--border0);
  color: var(--text1);
}
.btn-ghost:hover { background: var(--surface1); }

.btn-danger {
  background: rgba(232,64,64,.20);
  border-color: rgba(232,64,64,.30);
  color: var(--loss);
}
.btn-danger:hover { background: rgba(232,64,64,.30); }

.btn-sm { height: 32px; padding: 0 10px; font-size: 12px; border-radius: var(--r0); }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; border-radius: var(--r2); }

/* Play button — full width, prominent */
.play-btn {
  width: 100%;
  height: 46px;
  border-radius: var(--r1);
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(46,125,255,.30);
  transition: filter .15s, transform .12s var(--ease-spring), box-shadow .15s;
}
.play-btn:hover {
  filter: brightness(1.10);
  box-shadow: 0 6px 28px rgba(46,125,255,.40);
}
.play-btn:active { transform: scale(.97); }
.play-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.cashout-btn {
  width: 100%;
  height: 46px;
  border-radius: var(--r1);
  background: var(--win);
  border: none;
  color: #05230f;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(31,207,139,.25);
  transition: filter .15s, transform .12s var(--ease-spring);
}
.cashout-btn:hover { filter: brightness(1.08); }
.cashout-btn:active { transform: scale(.97); }
.cashout-btn:disabled { opacity: .35; cursor: not-allowed; transform: none !important; box-shadow: none; }

/* =========================================================
   9) FORMS / INPUTS
========================================================= */

.label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--bg1);
  border: 1px solid var(--border1);
  border-radius: var(--r1);
  color: var(--text0);
  font-size: 14px;
  font-weight: 600;
  transition: border-color .15s, box-shadow .15s;
}
.input:hover  { border-color: var(--border2); }
.input:focus  {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46,125,255,.15);
}
.input::placeholder { color: var(--text3); font-weight: 400; }

/* Bet input block */
.bet-block { display: flex; flex-direction: column; gap: 6px; }
.bet-row {
  display: flex;
  gap: 4px;
}
.bet-row .input {
  flex: 1;
  border-radius: var(--r1) 0 0 var(--r1);
}
.bet-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bet-actions .btn {
  height: 19px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 0;
  border-left: none;
  font-weight: 800;
  color: var(--text2);
}
.bet-actions .btn:first-child { border-radius: 0 var(--r0) 0 0; }
.bet-actions .btn:last-child  { border-radius: 0 0 var(--r0) 0; }

.bet-quick-row {
  display: flex;
  gap: 4px;
}
.bet-quick-btn {
  flex: 1;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border0);
  background: var(--bg1);
  color: var(--text2);
  font-size: 11px;
  font-weight: 700;
  transition: background .12s, color .12s, border-color .12s;
}
.bet-quick-btn:hover { background: var(--bg2); border-color: var(--border1); color: var(--text0); }

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================================================
   10) TABLES
========================================================= */

.tablewrap {
  overflow: auto;
  border: 1px solid var(--border0);
  border-radius: var(--r1);
  background: rgba(0,0,0,.12);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead th {
  padding: 9px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3);
  border-bottom: 1px solid var(--border0);
  white-space: nowrap;
}
.table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--text1);
  transition: background .1s;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--surface0); }

/* =========================================================
   11) GAME LAYOUT SYSTEM
========================================================= */

.game-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 860px) {
  .game-layout { grid-template-columns: 1fr; }
}

/* Control panel (left column) */
.ctrl {
  background: var(--bg2);
  border: 1px solid var(--border0);
  border-radius: var(--r2);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Display panel (right column) */
.display {
  background: var(--bg2);
  border: 1px solid var(--border0);
  border-radius: var(--r2);
  overflow: hidden;
}

.display-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border0);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.display-body { padding: 20px; }

/* Section label inside ctrl */
.ctrl-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3);
  margin-bottom: 6px;
}

/* Stat row (chance/multiplier) */
.stat-row {
  display: flex;
  gap: 8px;
}
.stat-box {
  flex: 1;
  background: var(--bg1);
  border: 1px solid var(--border0);
  border-radius: var(--r1);
  padding: 10px;
  text-align: center;
}
.stat-box-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.stat-box-val   { font-size: 15px; font-weight: 800; color: var(--text0); }

/* Result message */
.result-msg {
  padding: 10px 14px;
  border-radius: var(--r1);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  display: none;
}
.result-msg.win  { background: var(--win-d); color: var(--win); display: block; }
.result-msg.loss { background: var(--loss-d); color: var(--loss); display: block; }
.result-msg.show { display: block; background: var(--surface1); color: var(--text0); }

/* History list */
.hist-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 200px;
  overflow-y: auto;
}
.hist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border0);
  font-size: 12px;
  gap: 8px;
}
.hist-row:last-child { border-bottom: none; }
.hist-badge {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}
.hist-badge.win  { background: var(--win-d); color: var(--win); }
.hist-badge.loss { background: var(--loss-d); color: var(--loss); }

/* =========================================================
   12) HOME PAGE — GAME GRID
========================================================= */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.game-card {
  border: 1px solid var(--border0);
  border-radius: var(--r2);
  background: var(--bg2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color .18s, transform .18s var(--ease-out), box-shadow .18s;
  will-change: transform;
}
.game-card:hover {
  border-color: rgba(46,125,255,.30);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.45), 0 0 0 1px rgba(46,125,255,.10);
}

.game-thumb {
  aspect-ratio: 16/9;
  background: var(--bg3);
  overflow: hidden;
  position: relative;
}
.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .28s var(--ease-out);
}
.game-card:hover .game-thumb img { transform: scale(1.06); }

.game-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 50%);
}

/* Game thumb fallback (emoji/icon) */
.game-thumb-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.game-info {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.game-name { font-weight: 800; font-size: 14px; color: var(--text0); }
.game-desc { font-size: 12px; color: var(--text2); }
.game-go   {
  padding: 10px 14px;
  border-top: 1px solid var(--border0);
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  transition: color .15s;
}
.game-card:hover .game-go { color: var(--accent); }

/* =========================================================
   13) DICE GAME
========================================================= */

/* Large result display */
.dice-result-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px 16px;
}

@keyframes diceAppear {
  from { transform: scale(.7) rotateY(-30deg); opacity: 0; }
  60%  { transform: scale(1.1) rotateY(5deg); }
  to   { transform: scale(1) rotateY(0); opacity: 1; }
}

.dice-number {
  font-size: 72px;
  font-weight: 900;
  font-family: var(--mono);
  letter-spacing: -4px;
  color: var(--text0);
  line-height: 1;
  text-align: center;
  min-width: 180px;
  padding: 16px 24px;
  background: var(--bg1);
  border: 1px solid var(--border0);
  border-radius: var(--r2);
  box-shadow: inset 0 -12px 24px rgba(0,0,0,.30);
  transition: color .3s;
}
.dice-number.win  { color: var(--win); }
.dice-number.loss { color: var(--loss); }
.dice-number.rolling { animation: diceAppear .35s var(--ease-out) both; }

/* Progress bar under result */
.dice-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg1);
  border-radius: 99px;
  border: 1px solid var(--border0);
  position: relative;
  overflow: visible;
}
.dice-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(46,125,255,.20), rgba(46,125,255,.60));
  transition: width .5s var(--ease-out);
}
.dice-bar-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--text0);
  box-shadow: 0 0 10px rgba(46,125,255,.50);
}

/* Slider */
.dice-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  background: var(--bg1);
  border-radius: 99px;
  border: 1px solid var(--border0);
  outline: none;
  cursor: pointer;
}
.dice-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(255,255,255,.25);
  box-shadow: 0 2px 8px rgba(46,125,255,.40);
  cursor: pointer;
  transition: transform .12s var(--ease-spring);
}
.dice-slider::-webkit-slider-thumb:active { transform: scale(1.2); }

.dice-target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.dice-target-label { font-size: 12px; color: var(--text2); }
.dice-target-val   { font-size: 18px; font-weight: 800; color: var(--text0); }

/* =========================================================
   14) MINES GAME
========================================================= */

.mines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px;
}

@keyframes cellReveal {
  0%   { transform: scale(.7) rotateY(-90deg); opacity: 0; }
  60%  { transform: scale(1.05) rotateY(8deg); }
  100% { transform: scale(1) rotateY(0); opacity: 1; }
}

.mines-cell {
  aspect-ratio: 1;
  border-radius: var(--r1);
  border: 1px solid var(--border1);
  background: var(--bg1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  transition: transform .14s var(--ease-spring), border-color .14s, background .14s, box-shadow .14s;
  will-change: transform;
  position: relative;
  overflow: hidden;
}
.mines-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.08), transparent 65%);
  pointer-events: none;
}
.mines-cell:hover:not(.revealed) {
  transform: scale(1.04);
  border-color: var(--border2);
  background: var(--bg2);
}
.mines-cell:active:not(.revealed) { transform: scale(.96); }

.mines-cell.revealed { animation: cellReveal .28s var(--ease-out) both; pointer-events: none; }
.mines-cell.revealed.safe {
  background: rgba(31,207,139,.12);
  border-color: rgba(31,207,139,.30);
  box-shadow: 0 0 0 2px rgba(31,207,139,.08);
}
.mines-cell.revealed.mine {
  background: rgba(232,64,64,.14);
  border-color: rgba(232,64,64,.35);
  box-shadow: 0 0 0 2px rgba(232,64,64,.08);
}

/* Multiplier display for mines */
.mines-mult-display {
  text-align: center;
  padding: 14px;
  background: var(--bg1);
  border: 1px solid var(--border0);
  border-radius: var(--r1);
}
.mines-mult-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.mines-mult-val   { font-size: 28px; font-weight: 900; color: var(--win); font-family: var(--mono); }

/* =========================================================
   15) CRASH GAME
========================================================= */

.crash-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  min-height: 240px;
  position: relative;
  gap: 20px;
}

.crash-ring {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 3px solid var(--border1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--bg1);
  transition: border-color .3s;
}
.crash-ring.running {
  border-color: rgba(46,125,255,.50);
  box-shadow: 0 0 0 8px rgba(46,125,255,.08), 0 0 40px rgba(46,125,255,.12);
}
.crash-ring.crashed {
  border-color: rgba(232,64,64,.50);
  box-shadow: 0 0 0 8px rgba(232,64,64,.08);
}
.crash-ring.won {
  border-color: rgba(31,207,139,.50);
  box-shadow: 0 0 0 8px rgba(31,207,139,.08);
}

/* Spinning orbit ring */
.crash-ring::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  opacity: 0;
  transition: opacity .3s;
}
.crash-ring.running::before {
  opacity: 1;
  animation: crashSpin 1.2s linear infinite;
}
@keyframes crashSpin { to { transform: rotate(360deg); } }

@keyframes multPop {
  0%   { transform: scale(.9); opacity: .6; }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.crash-mult {
  font-size: 42px;
  font-weight: 900;
  font-family: var(--mono);
  color: var(--text0);
  letter-spacing: -2px;
  line-height: 1;
  transition: color .25s;
}
.crash-mult.running { color: var(--accent); animation: multPop .15s var(--ease-spring); }
.crash-mult.crashed { color: var(--loss); }
.crash-mult.won     { color: var(--win); }

.crash-state-label {
  font-size: 12px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

/* Bar */
.crash-bar {
  width: 100%;
  height: 6px;
  background: var(--bg1);
  border-radius: 99px;
  border: 1px solid var(--border0);
  overflow: hidden;
}
.crash-line {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(46,125,255,.70), rgba(46,125,255,1));
  border-radius: 99px;
  box-shadow: 0 0 14px rgba(46,125,255,.40);
  transition: width .16s linear;
}

/* History pill */
.crash-hist-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.crash-pill {
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
}
.crash-pill.high { background: var(--win-d); color: var(--win); }
.crash-pill.low  { background: var(--loss-d); color: var(--loss); }

/* =========================================================
   16) KENO GAME
========================================================= */

.keno-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  padding: 12px;
}
@media (max-width: 600px) {
  .keno-grid { grid-template-columns: repeat(8, 1fr); gap: 4px; }
}

@keyframes kenoDraw {
  0%   { transform: scale(.6); opacity: 0; }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.keno-num {
  aspect-ratio: 1;
  border-radius: var(--r0);
  border: 1px solid var(--border0);
  background: var(--bg1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  cursor: pointer;
  transition: background .14s, border-color .14s, color .14s, transform .12s var(--ease-spring);
  will-change: transform;
  user-select: none;
}
.keno-num:hover:not(.drawn):not(.picked) {
  background: var(--bg2);
  border-color: var(--border2);
  color: var(--text0);
  transform: scale(1.06);
}
.keno-num.picked {
  background: rgba(46,125,255,.25);
  border-color: rgba(46,125,255,.50);
  color: #7bb4ff;
  font-weight: 800;
}
.keno-num.drawn {
  background: rgba(31,207,139,.18);
  border-color: rgba(31,207,139,.40);
  color: var(--win);
  animation: kenoDraw .22s var(--ease-out) both;
}
.keno-num.picked.drawn {
  background: rgba(31,207,139,.28);
  border-color: rgba(31,207,139,.60);
  color: var(--win);
  box-shadow: 0 0 10px rgba(31,207,139,.30);
  font-weight: 900;
}
.keno-num.missed-pick {
  background: rgba(232,64,64,.12);
  border-color: rgba(232,64,64,.30);
  color: var(--loss);
}

/* Keno picks counter */
.keno-pick-bar {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 0 12px 12px;
}
.keno-pick-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border1);
  transition: background .2s;
}
.keno-pick-dot.filled { background: var(--accent); }

/* Payout table */
.keno-payout-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.keno-payout-table th {
  padding: 5px 8px;
  text-align: center;
  color: var(--text3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid var(--border0);
}
.keno-payout-table td {
  padding: 4px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.03);
  color: var(--text1);
}
.keno-payout-table tr.highlighted td {
  background: rgba(31,207,139,.10);
  color: var(--win);
  font-weight: 700;
}

/* =========================================================
   17) PLITRIS
========================================================= */

.plitris-board {
  padding: 0 !important;
  display: grid;
  grid-template-columns: repeat(8, 40px);
  grid-template-rows: repeat(8, 40px);
  gap: 3px;
  position: relative;
  width: max-content;
  margin: 0 auto;
  background: var(--bg1);
  border: 1px solid var(--border0);
  border-radius: var(--r2);
  box-shadow: var(--shadow0);
}

.plitris-cell {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.05);
  background: rgba(255,255,255,.02);
  color: var(--text3);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plitris-slot {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border1);
  background: var(--bg2);
  color: var(--text0);
  font-weight: 800;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plitris-piece {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  position: absolute;
  left: 2px;
  top: 2px;
  will-change: left, top;
  transition: left .22s linear, top .22s linear;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.45), transparent 60%),
              linear-gradient(135deg, var(--accent), rgba(124,60,255,.90));
  box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 0 18px rgba(46,125,255,.40), 0 10px 28px rgba(0,0,0,.45);
}

@media (max-width: 420px) {
  .plitris-board { transform: scale(.88); transform-origin: top center; }
}

/* =========================================================
   18) CASES
========================================================= */

.cases-list { display: flex; flex-direction: column; gap: 10px; }

.case-card {
  background: var(--bg2);
  border: 1px solid var(--border0);
  border-radius: var(--r2);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color .15s, transform .15s var(--ease-spring);
}
.case-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.case-card-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--r1);
  object-fit: cover;
  border: 1px solid var(--border0);
  background: var(--bg3);
  flex-shrink: 0;
}
.case-card-icon-ph {
  width: 60px;
  height: 60px;
  border-radius: var(--r1);
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.case-card-info { flex: 1; }
.case-card-name  { font-weight: 800; font-size: 15px; margin-bottom: 3px; }
.case-card-price { font-size: 13px; color: var(--text2); }

.case-reveal-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 12px;
}
@media (max-width: 480px) {
  .case-reveal-grid { grid-template-columns: repeat(2, 1fr); }
}

@keyframes cardFlipAnim {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(180deg); }
}

.case-tile {
  aspect-ratio: 1;
  border-radius: var(--r2);
  border: 1px solid var(--border1);
  background: var(--bg1);
  cursor: pointer;
  perspective: 800px;
  transition: border-color .15s, transform .15s var(--ease-spring);
}
.case-tile:hover:not(.flipped) {
  border-color: rgba(46,125,255,.35);
  transform: translateY(-3px) scale(1.02);
}
.case-tile-inner {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .44s cubic-bezier(.22,1,.36,1);
  position: relative;
}
.case-tile.flipped .case-tile-inner { transform: rotateY(180deg); }
.case-tile-front,
.case-tile-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r2);
}
.case-tile-front { font-size: 26px; color: var(--text2); }
.case-tile-back  {
  transform: rotateY(180deg);
  background: var(--bg2);
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  text-align: center;
}

/* =========================================================
   19) BALANCE PAGE
========================================================= */

.balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* =========================================================
   20) ACCOUNT PAGE
========================================================= */

.acc-profile-card {
  background: var(--bg2);
  border: 1px solid var(--border0);
  border-radius: var(--r2);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.acc-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), rgba(124,60,255,.80));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}
.acc-meta { flex: 1; }
.acc-name  { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.acc-sub   { font-size: 13px; color: var(--text2); }

.acc-tabs-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border0);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.acc-tab-btn {
  height: 40px;
  padding: 0 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.acc-tab-btn:hover { color: var(--text0); }
.acc-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Legacy compat classes */
.acc-top  { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.acc-kv   { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.acc-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  height: 34px;
  padding: 0 14px;
  border-radius: 99px;
  border: 1px solid var(--border0);
  background: var(--surface0);
  color: var(--text1);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.tab:hover { background: var(--surface1); border-color: var(--border1); }
.acc-tab   { margin-top: 12px; }

.histbox {
  max-height: 280px;
  overflow: auto;
  border-radius: var(--r1);
  border: 1px solid var(--border0);
  background: rgba(0,0,0,.14);
  padding: 6px;
}

/* =========================================================
   21) MODAL
========================================================= */

@keyframes modalIn {
  from { opacity: 0; transform: scale(.93) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s var(--ease-std), visibility .22s;
}
.modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.modal.active .modal-card { animation: modalIn .28s var(--ease-out) both; }

.modal-card {
  width: min(860px, 100%);
  background: var(--bg1);
  border: 1px solid var(--border1);
  border-radius: var(--r3);
  overflow: hidden;
  box-shadow: var(--shadow2);
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0,0,0,.12);
}
.modal-title { font-size: 16px; font-weight: 800; }
.modal-body  { padding: 20px; }
.modal-foot  {
  padding: 14px 20px;
  border-top: 1px solid var(--border0);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Auth form tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border0);
  margin-bottom: 20px;
}
.auth-tab-btn {
  flex: 1;
  height: 44px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.auth-tab-btn:hover { color: var(--text0); }
.auth-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form-section { display: none; }
.auth-form-section.active { display: flex; flex-direction: column; gap: 14px; }

/* =========================================================
   22) TOAST
========================================================= */

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 18px;
  border-radius: var(--r1);
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  background: var(--bg3);
  color: var(--text0);
  border: 1px solid var(--border1);
  box-shadow: var(--shadow1);
  max-width: 320px;
  opacity: 0;
  transform: translateY(16px) scale(.95);
  transition: opacity .22s var(--ease-out), transform .22s var(--ease-out);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  animation: toastIn .24s var(--ease-out) both;
}
.toast.success { background: rgba(20,80,50,.96); border-color: rgba(31,207,139,.25); color: var(--win); }
.toast.error   { background: rgba(80,18,18,.96); border-color: rgba(232,64,64,.25);  color: var(--loss); }

/* =========================================================
   23) LIVE BETS TABLE
========================================================= */

.live-bet-row {
  display: grid;
  grid-template-columns: 80px 1fr 80px 80px 90px;
  gap: 8px;
  padding: 8px 14px;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: 13px;
  transition: background .1s;
}
.live-bet-row:hover { background: var(--surface0); }
.live-bet-row.new-bet { animation: liveBetIn .35s var(--ease-out) both; }
@keyframes liveBetIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* =========================================================
   24) GRIDS / UTILS
========================================================= */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.btnrow  { display: flex; gap: 8px; flex-wrap: wrap; }
.copyrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copytext {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border-radius: var(--r1);
  border: 1px solid var(--border0);
  background: var(--bg1);
  font-family: var(--mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text1);
}

.footer {
  margin-top: 32px;
  text-align: center;
  font-size: 12px;
  color: var(--text3);
}

/* Focus */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(46,125,255,.50);
  outline-offset: 2px;
  border-radius: var(--r1);
}

/* Mini icon */
.mini-ico { width: 20px; height: 20px; }
