/* =========================================================================
   DonutMint UI
   Themes  : [data-theme] midnight (default, mint/black) | dark | light
   Styles  : [data-style] glass (default) | neon | solid
   ========================================================================= */

:root, [data-theme="midnight"] {
  --bg: #050807;
  --bg-2: #0a0f0d;
  --surface: rgba(20, 28, 25, 0.62);
  --surface-2: rgba(28, 39, 35, 0.62);
  --surface-solid: #101614;
  --surface-hover: rgba(38, 64, 53, 0.55);
  --input: rgba(4, 8, 6, 0.78);
  --border: rgba(62, 240, 168, 0.12);
  --border-strong: rgba(62, 240, 168, 0.3);
  --text: #eafaf2;
  --text-2: #a9c4b7;
  --muted: #6f8a7e;
  --accent: #3ef0a8;
  --accent-2: #6ff7c3;
  --accent-3: #13b877;
  --accent-text: #03140c;
  --accent-glow: rgba(62, 240, 168, 0.45);
  --grad: linear-gradient(135deg, #13b877 0%, #3ef0a8 55%, #8af9cf 100%);
  --success: #3ef0a8;
  --success-bg: rgba(62, 240, 168, 0.12);
  --danger: #ff4d6d;
  --danger-bg: rgba(255, 77, 109, 0.12);
  --warning: #ffb547;
  --warning-bg: rgba(255, 181, 71, 0.12);
  --info: #5cb8ff;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  --page-glow: radial-gradient(1200px 600px at 10% -10%, rgba(62, 240, 168, 0.10), transparent 60%),
               radial-gradient(900px 500px at 100% 0%, rgba(19, 184, 119, 0.08), transparent 60%),
               radial-gradient(900px 700px at 50% 120%, rgba(19, 184, 119, 0.08), transparent 60%);
  --logo-blend: normal;
  color-scheme: dark;
}

[data-theme="dark"] {
  --bg: #0a0b0f;
  --bg-2: #111319;
  --surface: rgba(26, 29, 38, 0.7);
  --surface-2: rgba(36, 40, 52, 0.7);
  --surface-solid: #171a22;
  --surface-hover: rgba(52, 57, 72, 0.8);
  --input: rgba(8, 9, 13, 0.8);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f5;
  --text-2: #b3b8c6;
  --muted: #747b8f;
  --accent: #3ef0a8;
  --accent-2: #6ff7c3;
  --accent-3: #13b877;
  --accent-text: #03140c;
  --accent-glow: rgba(62, 240, 168, 0.35);
  --grad: linear-gradient(135deg, #13b877, #3ef0a8 60%, #8af9cf);
  --page-glow: radial-gradient(1000px 500px at 0% -10%, rgba(62, 240, 168, 0.06), transparent 60%);
  --logo-blend: normal;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f1faf6;
  --bg-2: #e7f7ef;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-2: rgba(240, 255, 248, 0.9);
  --surface-solid: #ffffff;
  --surface-hover: rgba(223, 254, 239, 0.95);
  --input: #f3fff9;
  --border: rgba(33, 137, 86, 0.1);
  --border-strong: rgba(33, 137, 86, 0.22);
  --text: #14291e;
  --text-2: #446555;
  --muted: #7da290;
  --accent: #0fa968;
  --accent-2: #13b877;
  --accent-3: #0b7f4f;
  --accent-text: #ffffff;
  --accent-glow: rgba(62, 233, 153, 0.3);
  --grad: linear-gradient(135deg, #0b7f4f, #0fa968 55%, #13b877);
  --success: #0fa968;
  --success-bg: rgba(15, 169, 104, 0.1);
  --danger: #e11d48;
  --danger-bg: rgba(225, 29, 72, 0.08);
  --warning: #c27803;
  --warning-bg: rgba(194, 120, 3, 0.1);
  --shadow: 0 10px 30px rgba(33, 137, 86, 0.12);
  --page-glow: radial-gradient(1000px 500px at 0% -10%, rgba(62, 233, 153, 0.12), transparent 60%),
               radial-gradient(800px 500px at 100% 0%, rgba(80, 251, 175, 0.1), transparent 60%);
  --logo-blend: normal;
  color-scheme: light;
}

:root {
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --blur: blur(18px) saturate(140%);
  --topbar: 60px;
  --chat-w: 320px;
  --font: 'Outfit', system-ui, -apple-system, Segoe UI, sans-serif;
  --num: 'Space Grotesk', 'Outfit', ui-monospace, monospace;
  --ease: cubic-bezier(.2, .9, .25, 1);
}

/* ---------- styles ---------- */
[data-style="neon"] {
  --radius: 12px;
  --card-glow: 0 0 0 1px var(--border-strong), 0 0 24px -6px var(--accent-glow);
  --btn-glow: 0 0 22px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.25);
}
[data-style="glass"] {
  --card-glow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --btn-glow: 0 6px 22px -6px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.22);
}
[data-style="solid"] {
  --radius: 10px;
  --radius-lg: 14px;
  --blur: none;
  --card-glow: none;
  --btn-glow: none;
  --surface: var(--surface-solid);
  --surface-2: var(--bg-2);
  --page-glow: none;
}
[data-style="solid"][data-theme="midnight"] { --surface-2: #123725; --input: #061910; }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  background-image: var(--page-glow);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-2); text-decoration: none; }
img { max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-text); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.success { color: var(--success); }
.danger { color: var(--danger); }
.warning { color: var(--warning); }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.gap-s { gap: 6px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.bold { font-weight: 700; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; word-break: break-all; }

.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--card-glow);
}
.pad { padding: 16px; }
.pad-l { padding: 22px; }
.section-title { font-size: 17px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title svg { width: 18px; height: 18px; color: var(--accent-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-weight: 600; cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform .12s var(--ease), background .2s, border-color .2s, box-shadow .2s, opacity .2s;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary {
  background: var(--grad); border: 0; color: var(--accent-text, #fff);
  box-shadow: var(--btn-glow);
  background-size: 160% 160%; background-position: 0% 50%;
}
.btn-primary:hover { background: var(--grad); background-size: 160% 160%; background-position: 100% 50%; filter: brightness(1.08); }
.btn-success { background: linear-gradient(135deg, #12c983, #2ee59d); border: 0; color: #03140c; box-shadow: 0 6px 22px -6px rgba(46,229,157,.6); }
.btn-success:hover { background: linear-gradient(135deg, #12c983, #2ee59d); filter: brightness(1.08); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(255, 77, 109, .3); }
.btn-danger:hover { background: rgba(255, 77, 109, .22); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 8px; }
.btn-lg { height: 50px; font-size: 16px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn.loading { pointer-events: none; opacity: .75; }
.btn.loading::after {
  content: ''; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 13px; border-radius: var(--radius-sm);
  background: var(--input); border: 1px solid var(--border); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea.input { height: auto; min-height: 80px; padding: 10px 13px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-group { display: flex; align-items: stretch; background: var(--input); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.input-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-group .input { border: 0; background: transparent; box-shadow: none; min-width: 0; }
.input-group .addon { display: flex; align-items: center; padding: 0 10px; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.input-group .ig-btn { border: 0; border-left: 1px solid var(--border); background: transparent; padding: 0 12px; cursor: pointer; font-weight: 700; color: var(--text-2); font-size: 12px; }
.input-group .ig-btn:hover { background: var(--surface-hover); color: var(--text); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 20px; transition: .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: .25s var(--ease); }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); background: #fff; }

.seg { display: flex; background: var(--input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 3px; }
.seg button { flex: 1; height: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-weight: 600; color: var(--text-2); font-size: 13px; transition: .15s; white-space: nowrap; padding: 0 8px; }
.seg button:hover { color: var(--text); background: var(--surface-2); }
.seg button.active { background: var(--surface-hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }

/* ---------- loading screen ---------- */
#loader {
  position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  background: radial-gradient(800px 500px at 50% 40%, rgba(55, 250, 158, .25), transparent 70%), #020b07;
  transition: opacity .6s ease, visibility .6s;
}
#loader.done { opacity: 0; visibility: hidden; }
#loader .logo-wrap { position: relative; width: min(520px, 82vw); }
#loader .logo-wrap img { width: 100%; mix-blend-mode: screen; animation: loaderPulse 2.4s ease-in-out infinite; }
#loader .ring { position: absolute; left: 50%; top: 50%; width: 140%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(81, 251, 174, .4), transparent 30%); filter: blur(30px); animation: spin 4s linear infinite; z-index: -1; opacity: .6; }
@keyframes loaderPulse { 0%, 100% { filter: drop-shadow(0 0 18px rgba(81, 251, 174, .5)); transform: scale(1); } 50% { filter: drop-shadow(0 0 38px rgba(80, 251, 182, .8)); transform: scale(1.02); } }
#loader .bar { width: min(320px, 70vw); height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .07); overflow: hidden; }
#loader .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #31fa99, #50fbb6); box-shadow: 0 0 14px #51fbae; transition: width .35s var(--ease); }
#loader .status { color: #81b79c; font-size: 13px; letter-spacing: .04em; min-height: 18px; }
#loader .tip { position: absolute; bottom: 36px; color: #63947c; font-size: 12px; text-align: center; padding: 0 20px; }
#loader .particles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#loader .particles i { position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%; background: #6ffbbd; box-shadow: 0 0 8px #6ffbbd; animation: rise linear infinite; }
@keyframes rise { to { transform: translateY(-110vh); opacity: 0; } }

/* ---------- app layout ---------- */
#app { display: grid; grid-template-rows: var(--topbar) minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); width: 100%; height: 100vh; height: 100dvh; }
.topbar {
  position: relative; z-index: 50; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 0 14px; background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--border); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.brand { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: none; }
.brand img.mono-logo { width: 38px; height: 38px; border-radius: 10px; mix-blend-mode: var(--logo-blend); object-fit: cover; }
.brand img.wordmark { height: 30px; mix-blend-mode: var(--logo-blend); }
[data-theme="light"] .brand img { filter: none; background: #06170f; border-radius: 10px; }
[data-theme="light"] .brand img.wordmark { display: none; }
.navtabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.navtabs::-webkit-scrollbar { display: none; }
.navtab { display: flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px; border-radius: 8px; color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; border: 0; background: transparent; white-space: nowrap; transition: .15s; }
.navtab svg { width: 15px; height: 15px; }
.navtab:hover { color: var(--text); background: var(--surface-2); }
.navtab.active { color: var(--text); background: var(--surface-hover); }
.navtab.admin { color: var(--warning); }

.balance-box { display: flex; align-items: center; height: 42px; border-radius: 12px; background: var(--input); border: 1px solid var(--border-strong); overflow: hidden; box-shadow: var(--card-glow); }
.balance-amount { display: flex; align-items: center; gap: 9px; padding: 0 14px 0 12px; cursor: pointer; min-width: 120px; }
.balance-amount .coin { width: 22px; height: 22px; flex: none; }
.balance-amount .val { font-family: var(--num); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; transition: color .3s; }
.balance-amount .val.up { color: var(--success); text-shadow: 0 0 12px rgba(46, 229, 157, .6); }
.balance-amount .val.down { color: var(--danger); }
.balance-amount .cur { font-size: 11px; color: var(--muted); font-weight: 700; }
.wallet-btn { height: 100%; padding: 0 16px; border: 0; background: var(--grad); color: var(--accent-text); display: flex; align-items: center; gap: 7px; font-weight: 700; cursor: pointer; box-shadow: var(--btn-glow); }
.wallet-btn svg { width: 19px; height: 19px; }
.wallet-btn:hover { filter: brightness(1.12); }
.wallet-btn:active { transform: scale(.97); }

.profile-btn { display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 10px 0 5px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: .15s; }
.profile-btn:hover { background: var(--surface-hover); }
.profile-btn .pname { font-weight: 700; font-size: 13px; max-width: 120px; }
.profile-btn .pvip { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.profile-btn .chev { width: 14px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 14px; overflow: hidden; background: var(--grad); color: var(--accent-text); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 26px; }
.avatar.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text-2); transition: .15s; }
.icon-btn:hover { color: var(--text); background: var(--surface-hover); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 8px var(--danger); }

.body { display: flex; min-height: 0; position: relative; }
.chat-panel { width: var(--chat-w); flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); transition: margin .35s var(--ease); min-height: 0; z-index: 30; }
.chat-closed .chat-panel { margin-left: calc(-1 * var(--chat-w)); }
.main { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.page { max-width: 1320px; margin: 0 auto; padding: 22px 22px 60px; animation: pageIn .4s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- chat ---------- */
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.chat-head .title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.chat-head .title > svg { width: 18px; height: 18px; color: var(--accent-2); }
.chat-head .online { font-size: 11px; color: var(--success); display: flex; align-items: center; gap: 5px; font-weight: 600; white-space: nowrap; margin-left: 4px; }
.chat-head .online::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 6px var(--success); }
.chat-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.msg { display: flex; gap: 9px; padding: 7px 8px; border-radius: 10px; animation: msgIn .3s var(--ease); }
.msg:hover { background: var(--surface); }
.msg.deleted { opacity: .45; }
.msg.deleted .mtext { text-decoration: line-through; }
.msg .mbody { min-width: 0; flex: 1; }
.msg .mhead { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 2px; flex-wrap: wrap; }
.msg .mname { font-weight: 700; cursor: pointer; }
.msg .mname:hover { color: var(--accent-2); }
.msg .mtext { color: var(--text-2); font-size: 13px; line-height: 1.4; word-wrap: break-word; overflow-wrap: anywhere; }
.msg .mbal { font-size: 10.5px; color: var(--warning); font-family: var(--num); }
.msg .mtools { display: none; gap: 3px; margin-left: auto; }
.msg:hover .mtools { display: flex; }
.msg.system { justify-content: center; font-size: 12px; color: var(--accent-2); background: var(--surface); text-align: center; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.vip-tag { font-size: 9.5px; font-weight: 800; padding: 1px 6px; border-radius: 5px; letter-spacing: .03em; text-transform: uppercase; background: var(--surface-2); color: var(--text-2); }
.vip-Silver { color: #d3dae6; background: rgba(211, 218, 230, .14); }
.vip-Gold { color: #ffcd4a; background: rgba(255, 205, 74, .14); }
.vip-Platinum { color: #7de3ff; background: rgba(125, 227, 255, .14); }
.vip-Diamond { color: #9fb6ff; background: rgba(159, 182, 255, .16); }
.vip-Obsidian { color: #7dfcd5; background: rgba(125, 252, 213, .14); }
.vip-Midnight { color: var(--accent-text); background: var(--grad); }
.admin-tag { font-size: 9.5px; font-weight: 800; padding: 1px 6px; border-radius: 5px; background: var(--danger-bg); color: var(--danger); }
.chat-input { padding: 12px; border-top: 1px solid var(--border); }
.chat-lock { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--border-strong); font-size: 12.5px; color: var(--text-2); }
.chat-lock svg { width: 22px; height: 22px; color: var(--accent-2); flex: none; }

/* ---------- hero & lobby ---------- */
.announce { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border-strong); font-size: 13px; }
.announce > svg { width: 18px; height: 18px; flex: none; color: var(--accent-2); }
.announce > span, .announce > div { flex: 1; min-width: 0; }
.tier > svg, .empty > svg, .kpi .k > svg { width: 18px; height: 18px; flex: none; }
.hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 1983 / 793; max-height: 380px; width: 100%; border: 1px solid var(--border-strong); background: #020b07; box-shadow: 0 20px 60px -20px rgba(55, 250, 158, .45); }
.hero img.banner { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(2, 11, 7, .7) 0%, transparent 30%); pointer-events: none; }
.hero-content { position: absolute; z-index: 2; left: 0; right: 0; bottom: 7%; padding: 0 20px; }
.hero h1 { font-size: 34px; line-height: 1.08; margin: 0 0 10px; letter-spacing: -0.02em; color: #fff; }
.hero h1 span { background: linear-gradient(90deg, #6ffbbc, #6ffbcc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: #bee9d4; margin: 0 0 18px; font-size: 15px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 6px; }
.stat-pill { padding: 14px 16px; }
.stat-pill .k { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-pill .v { font-family: var(--num); font-size: 20px; font-weight: 700; margin-top: 4px; }

.cats { display: flex; gap: 8px; margin: 22px 0 16px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; color: var(--text-2); white-space: nowrap; transition: .15s; backdrop-filter: var(--blur); }
.cat svg { width: 16px; height: 16px; }
.cat:hover { color: var(--text); border-color: var(--border-strong); }
.cat.active { background: var(--grad); color: var(--accent-text); border-color: transparent; box-shadow: var(--btn-glow); }
.search { position: relative; margin-left: auto; min-width: 220px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--muted); }
.search .input { padding-left: 36px; height: 38px; }

.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; }
.game-card { position: relative; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; cursor: pointer; isolation: isolate;
  transition: transform .3s var(--ease), box-shadow .3s; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .08); }
.game-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 18px 40px -8px var(--card-c, var(--accent-glow)); }
.game-card .gc-bg { position: absolute; inset: 0; background: var(--card-bg); z-index: -2; }
.game-card .gc-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, .25), transparent 55%); }
.game-card .gc-art { position: absolute; inset: 8% 10% 30%; display: grid; place-items: center; z-index: -1; transition: transform .5s var(--ease); }
.game-card .gc-art svg { width: 78%; height: auto; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .35)); }
.game-card:hover .gc-art { transform: scale(1.1) rotate(-3deg); }
.game-card .gc-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 12px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); }
.game-card .gc-name b { display: block; font-size: 19px; font-weight: 800; color: #fff; letter-spacing: -.01em; text-transform: uppercase; text-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.game-card .gc-name small { color: rgba(255, 255, 255, .7); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.game-card .gc-badge { position: absolute; top: 10px; left: 10px; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: rgba(0, 0, 0, .45); color: #fff; backdrop-filter: blur(6px); letter-spacing: .05em; }
.game-card .gc-shine { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .25) 45%, transparent 60%); transform: translateX(-120%); transition: transform .8s var(--ease); }
.game-card:hover .gc-shine { transform: translateX(120%); }
.game-card .gc-off { position: absolute; inset: 0; background: rgba(0, 0, 0, .65); display: grid; place-items: center; font-weight: 800; color: #fff; }

/* ---------- tables / feeds ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 10px 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.tbl td { padding: 11px 12px; border-top: 1px solid var(--border); white-space: nowrap; }
.tbl tr.clickable { cursor: pointer; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tr.flash { animation: rowIn .5s var(--ease); }
@keyframes rowIn { from { background: var(--surface-hover); transform: translateY(-4px); opacity: 0; } }
.game-chip { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; text-transform: capitalize; }
.game-chip i { width: 8px; height: 8px; border-radius: 3px; background: var(--c, var(--accent)); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs button { height: 40px; padding: 0 14px; background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font-weight: 600; color: var(--text-2); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs button .count { font-size: 10.5px; background: var(--danger); color: #fff; border-radius: 10px; padding: 0 6px; min-width: 18px; height: 17px; display: inline-grid; place-items: center; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--text-2); text-transform: capitalize; }
.pill.success { background: var(--success-bg); color: var(--success); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.pill.warning { background: var(--warning-bg); color: var(--warning); }
.pill.info { background: rgba(92, 184, 255, .12); color: var(--info); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .5; margin-bottom: 8px; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 200; background: rgba(1, 8, 5, .65); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fadeIn .2s ease; overflow-y: auto; }
[data-theme="light"] .overlay { background: rgba(21, 59, 40, .35); }
.modal { position: relative; width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: color-mix(in srgb, var(--surface-solid) 92%, transparent); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow), var(--card-glow); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); animation: modalIn .35s var(--ease); }
.modal.wide { width: min(720px, 100%); }
.modal.xwide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.modal-head h3 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 9px; }
.modal-head h3 svg { width: 20px; height: 20px; color: var(--accent-2); }
.modal-body { padding: 14px 20px 20px; }
.modal-close { width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; color: var(--text-2); }
.modal-close:hover { color: var(--text); background: var(--surface-hover); }
.modal-close svg { width: 16px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.closing { animation: fadeOut .18s ease forwards; }
.closing .modal { animation: modalOut .18s ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------- drawer (profile) ---------- */
.drawer-overlay { position: fixed; inset: 0; z-index: 150; background: rgba(1, 8, 5, .45); animation: fadeIn .2s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 92vw); z-index: 151; background: color-mix(in srgb, var(--surface-solid) 94%, transparent); border-left: 1px solid var(--border-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); display: flex; flex-direction: column; animation: drawerIn .35s var(--ease); box-shadow: var(--shadow); }
.drawer.closing { animation: drawerOut .25s ease forwards; }
@keyframes drawerIn { from { transform: translateX(100%); } }
@keyframes drawerOut { to { transform: translateX(100%); } }
.drawer-head { padding: 20px; display: flex; gap: 14px; align-items: center; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 10px; }
.drawer-item { display: flex; align-items: center; gap: 12px; padding: 0 12px; height: 44px; border-radius: 11px; cursor: pointer; font-weight: 600; color: var(--text-2); transition: .15s; width: 100%; border: 0; background: transparent; text-align: left; }
.drawer-item:hover { background: var(--surface-2); color: var(--text); }
.drawer-item svg { width: 18px; height: 18px; color: var(--accent-2); }
.drawer-item .r { margin-left: auto; font-size: 12px; color: var(--muted); }
.drawer-sep { height: 1px; background: var(--border); margin: 8px 6px; }
.vip-bar { height: 6px; border-radius: 6px; background: var(--input); overflow: hidden; margin-top: 6px; }
.vip-bar i { display: block; height: 100%; background: var(--grad); border-radius: 6px; box-shadow: 0 0 10px var(--accent-glow); transition: width .6s var(--ease); }

/* ---------- toasts ---------- */
#toasts { position: fixed; z-index: 400; top: calc(var(--topbar) + 10px); right: 14px; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 28px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 13px; background: color-mix(in srgb, var(--surface-solid) 94%, transparent); border: 1px solid var(--border-strong); box-shadow: var(--shadow); backdrop-filter: var(--blur); animation: toastIn .35s var(--ease); font-size: 13px; }
.toast.out { animation: toastOut .25s ease forwards; }
.toast svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }
.toast.warning svg { color: var(--warning); }
.toast.info svg { color: var(--accent-2); }
.toast .t-body { flex: 1; }
.toast .t-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* critical alert bar for admins */
#alerts { position: fixed; z-index: 300; left: 50%; transform: translateX(-50%); top: calc(var(--topbar) + 8px); width: min(760px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 8px; }
.alert-crit { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(120, 10, 30, .95), rgba(60, 5, 20, .95)); border: 1px solid rgba(255, 77, 109, .6); color: #ffe3e8; box-shadow: 0 0 30px rgba(255, 50, 90, .35); animation: alertIn .4s var(--ease), alertPulse 2s ease-in-out infinite; }
.alert-crit svg.ic { width: 24px; height: 24px; color: #ff8099; flex: none; }
.alert-crit .ab { flex: 1; min-width: 0; font-size: 13px; }
.alert-crit .ab b { display: block; font-size: 13.5px; text-transform: uppercase; letter-spacing: .04em; }
.alert-crit .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.alert-crit .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; }
.alert-crit .btn:hover { background: rgba(255, 255, 255, .2); }
@keyframes alertIn { from { opacity: 0; transform: translateY(-14px); } }
@keyframes alertPulse { 50% { box-shadow: 0 0 46px rgba(255, 50, 90, .6); } }

/* ---------- game layout ---------- */
.game-layout { display: grid; grid-template-columns: 320px 1fr; gap: 0; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); min-height: 560px; box-shadow: var(--card-glow); }
.game-side { padding: 16px; background: color-mix(in srgb, var(--bg-2) 60%, transparent); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.game-stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; min-width: 0; overflow: hidden; }
.game-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.game-head h2 { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 10px; text-transform: capitalize; }
.game-head .edge { font-size: 12px; color: var(--muted); }
.game-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; justify-content: space-between; flex-wrap: wrap; }
.amount-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 6px; }
.amount-quick button { height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-weight: 700; font-size: 12px; color: var(--text-2); }
.amount-quick button:hover { color: var(--text); background: var(--surface-hover); }
.profit-box { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 10px; background: var(--input); border: 1px solid var(--border); font-size: 13px; }
.bet-btn { height: 52px; font-size: 16px; font-weight: 800; letter-spacing: .02em; }
.result-pop { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); padding: 9px 18px; border-radius: 12px; font-family: var(--num); font-weight: 800; font-size: 20px; z-index: 5; pointer-events: none; animation: popIn .5s var(--ease); }
.result-pop.win { background: var(--success-bg); color: var(--success); border: 1px solid rgba(46, 229, 157, .4); box-shadow: 0 0 30px rgba(46, 229, 157, .3); }
.result-pop.lose { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(255, 77, 109, .3); }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, -10px) scale(.8); } }
.history-strip { display: flex; gap: 6px; overflow: hidden; justify-content: flex-end; width: 100%; min-height: 28px; }
.hchip { flex: none; height: 26px; padding: 0 10px; border-radius: 8px; display: grid; place-items: center; font-family: var(--num); font-weight: 700; font-size: 12px; background: var(--surface-2); color: var(--text-2); animation: chipIn .35s var(--ease); }
.hchip.win { background: var(--success-bg); color: var(--success); }
.hchip.lose { color: var(--muted); }
.hchip.big { background: rgba(255, 181, 71, .14); color: var(--warning); }
@keyframes chipIn { from { opacity: 0; transform: translateX(16px) scale(.8); } }

/* dice */
.dice-wrap { width: 100%; max-width: 720px; }
.dice-track { position: relative; height: 64px; padding: 0 20px; background: var(--input); border: 1px solid var(--border); border-radius: 18px; display: flex; align-items: center; }
.dice-range { position: relative; width: 100%; height: 12px; border-radius: 10px; }
.dice-range .fill-l, .dice-range .fill-r { position: absolute; top: 0; bottom: 0; border-radius: 10px; transition: background .2s; }
.dice-slider { position: absolute; inset: -14px 0; width: 100%; opacity: 0; cursor: grab; margin: 0; }
.dice-thumb { position: absolute; top: 50%; width: 34px; height: 34px; border-radius: 10px; transform: translate(-50%, -50%); background: var(--grad); box-shadow: 0 0 18px var(--accent-glow); pointer-events: none; display: grid; place-items: center; }
.dice-thumb::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: rgba(255, 255, 255, .8); box-shadow: -6px 0 0 rgba(255, 255, 255, .5), 6px 0 0 rgba(255, 255, 255, .5); }
.dice-marker { position: absolute; top: -52px; transform: translateX(-50%); transition: left .5s var(--ease), opacity .2s; opacity: 0; pointer-events: none; }
.dice-marker .hex { padding: 7px 12px; border-radius: 10px; font-family: var(--num); font-weight: 800; font-size: 16px; background: var(--surface-solid); border: 2px solid; }
.dice-marker.win .hex { border-color: var(--success); color: var(--success); box-shadow: 0 0 20px rgba(46, 229, 157, .4); }
.dice-marker.lose .hex { border-color: var(--danger); color: var(--danger); }
.dice-scale { display: flex; justify-content: space-between; padding: 8px 20px 0; color: var(--muted); font-size: 12px; font-family: var(--num); }
.dice-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 26px; }

/* limbo */
.limbo-num { font-family: var(--num); font-size: clamp(60px, 11vw, 120px); font-weight: 800; letter-spacing: -0.04em; transition: color .2s, text-shadow .2s; }
.limbo-num.win { color: var(--success); text-shadow: 0 0 40px rgba(46, 229, 157, .45); }
.limbo-num.lose { color: var(--danger); }

/* crash */
.crash-wrap { position: relative; width: 100%; height: 100%; min-height: 420px; }
.crash-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crash-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.crash-mult { font-family: var(--num); font-size: clamp(54px, 9vw, 96px); font-weight: 800; letter-spacing: -0.04em; text-shadow: 0 0 30px var(--accent-glow); }
.crash-mult.crashed { color: var(--danger); text-shadow: 0 0 30px rgba(255, 77, 109, .5); }
.crash-sub { color: var(--text-2); font-weight: 600; margin-top: 4px; }
.crash-players { width: 100%; max-height: 220px; overflow-y: auto; }
.crash-players .pl { display: flex; justify-content: space-between; padding: 6px 4px; font-size: 12.5px; border-bottom: 1px solid var(--border); }
.crash-players .pl.out { color: var(--success); }

/* mines & towers */
.mines-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; width: min(500px, 100%); }
.mines-grid .tile { aspect-ratio: 1; min-width: 0; }
.tile { position: relative; border-radius: 14px; border: 0; cursor: pointer; background: linear-gradient(180deg, var(--surface-hover), var(--surface-2)); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .25), 0 4px 10px rgba(0, 0, 0, .25); transition: transform .15s var(--ease), filter .15s; display: grid; place-items: center; padding: 0; }
.tile:hover:not(:disabled) { transform: translateY(-3px); filter: brightness(1.2); }
.tile:disabled { cursor: default; }
.tile svg { width: 58%; height: 58%; animation: reveal .4s var(--ease); }
.tile.gem { background: radial-gradient(circle at 50% 40%, rgba(46, 229, 157, .3), var(--input)); box-shadow: inset 0 0 0 2px rgba(46, 229, 157, .5); }
.tile.bomb { background: radial-gradient(circle at 50% 40%, rgba(255, 77, 109, .35), var(--input)); box-shadow: inset 0 0 0 2px rgba(255, 77, 109, .6); }
.tile.ghost { opacity: .45; }
.tile.boom { animation: shake .45s; }
@keyframes reveal { from { transform: scale(0) rotate(-30deg); opacity: 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.towers { display: flex; flex-direction: column-reverse; gap: 7px; width: min(460px, 100%); }
.trow { display: grid; gap: 7px; align-items: center; grid-template-columns: 60px repeat(var(--cols), 1fr); }
.trow .tm { font-family: var(--num); font-size: 12px; color: var(--muted); text-align: right; padding-right: 6px; }
.trow.current .tm { color: var(--accent-2); font-weight: 700; }
.trow .tile { height: 42px; border-radius: 10px; }
.trow:not(.current) .tile:not(.gem):not(.bomb) { opacity: .55; }

/* plinko & wheel canvases */
.canvas-box { width: 100%; max-width: 760px; position: relative; }
.canvas-box canvas { width: 100%; display: block; }
.slots { display: flex; gap: 3px; margin-top: 4px; }
.slot { flex: 1; height: 30px; border-radius: 7px; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; font-family: var(--num); color: #1a0f00; transition: transform .2s; }
.slot.hit { animation: slotHit .5s var(--ease); }
@keyframes slotHit { 30% { transform: translateY(8px) scale(1.06); filter: brightness(1.4); } }
.wheel-legend { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.wheel-legend span { padding: 6px 12px; border-radius: 8px; font-family: var(--num); font-weight: 700; font-size: 12.5px; background: var(--input); border-bottom: 3px solid var(--c); }

/* keno */
.keno-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; width: min(640px, 100%); }
.kn { aspect-ratio: 1; border-radius: 11px; border: 0; cursor: pointer; font-weight: 800; font-family: var(--num); font-size: 16px; background: linear-gradient(180deg, var(--surface-hover), var(--surface-2)); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .22); transition: transform .12s, background .2s; color: var(--text); }
.kn:hover { transform: translateY(-2px); filter: brightness(1.15); }
.kn.sel { background: var(--grad); color: var(--accent-text); box-shadow: 0 0 14px var(--accent-glow); }
.kn.drawn { background: var(--input); color: var(--muted); box-shadow: inset 0 0 0 2px var(--border-strong); }
.kn.hit { background: linear-gradient(135deg, #12c983, #2ee59d); color: #03140c; box-shadow: 0 0 18px rgba(46, 229, 157, .6); animation: reveal .35s var(--ease); }
.keno-pay { display: flex; gap: 4px; width: min(640px, 100%); margin-top: 14px; overflow-x: auto; }
.keno-pay div { flex: 1; min-width: 46px; text-align: center; padding: 6px 2px; border-radius: 8px; background: var(--input); font-size: 11px; }
.keno-pay div b { display: block; font-family: var(--num); font-size: 12px; }
.keno-pay div.on { background: var(--success-bg); color: var(--success); }

/* coinflip */
.coin-scene { perspective: 900px; width: 200px; height: 200px; }
.coin { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1.6s cubic-bezier(.3, 1.4, .4, 1); }
.coin .face { position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; display: grid; place-items: center; font-weight: 900; font-size: 54px; color: #fff; }
.coin .heads { background: radial-gradient(circle at 35% 30%, #aafdd9, #42faa5 55%, #1ea464); box-shadow: inset 0 0 0 8px rgba(255, 255, 255, .25), 0 0 40px var(--accent-glow); }
.coin .tails { background: radial-gradient(circle at 35% 30%, #ffe7a3, #f5a524 55%, #a5650a); box-shadow: inset 0 0 0 8px rgba(255, 255, 255, .25), 0 0 40px rgba(245, 165, 36, .4); transform: rotateY(180deg); }

/* hilo */
.hilo-cards { display: flex; align-items: center; gap: 28px; }
.pcard { width: 140px; height: 196px; border-radius: 16px; background: #f9fffc; color: #162f23; display: flex; flex-direction: column; justify-content: space-between; padding: 12px; font-weight: 800; box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(0, 0, 0, .06); animation: cardIn .45s var(--ease); }
.pcard.red { color: #e11d48; }
.pcard .big { font-size: 64px; text-align: center; line-height: 1; }
.pcard .corner { font-size: 20px; line-height: 1; }
.pcard .corner.br { transform: rotate(180deg); align-self: flex-end; }
.pcard.back { background: var(--grad); box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 0 0 6px rgba(255, 255, 255, .18); }
.pcard.sm { width: 46px; height: 64px; padding: 4px 5px; border-radius: 8px; font-size: 13px; animation: none; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }
.pcard.sm .big { font-size: 20px; }
.pcard.sm.lost { outline: 2px solid var(--danger); }
.pcard.sm.won { outline: 2px solid var(--success); }
.pcard.sm.skip { opacity: .5; }
@keyframes cardIn { from { transform: rotateY(90deg) translateY(-10px); opacity: 0; } }
.hilo-hist { display: flex; gap: 6px; overflow-x: auto; width: 100%; padding: 6px 2px; margin-top: 22px; }

/* ---------- account pages ---------- */
.account { display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: start; }
.account-nav { position: sticky; top: 0; padding: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { padding: 16px; }
.kpi .k { color: var(--muted); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-family: var(--num); font-size: 22px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.chart { width: 100%; height: 220px; }
.theme-opt { border: 2px solid var(--border); border-radius: 14px; padding: 10px; cursor: pointer; transition: .15s; background: var(--surface); }
.theme-opt:hover { border-color: var(--border-strong); }
.theme-opt.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.theme-opt .sw { height: 70px; border-radius: 9px; margin-bottom: 8px; position: relative; overflow: hidden; }
.theme-opt .sw i { position: absolute; left: 10px; right: 30%; height: 10px; border-radius: 4px; }
.avatar-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatar-pick button { border: 2px solid transparent; border-radius: 14px; padding: 0; cursor: pointer; background: none; aspect-ratio: 1; }
.avatar-pick button.active { border-color: var(--accent); }
.avatar-pick .avatar { width: 100%; height: 100%; border-radius: 12px; }
.qr { background: #fff; padding: 10px; border-radius: 14px; width: 190px; height: 190px; display: grid; place-items: center; flex: none; }
.qr svg, .qr img { width: 100%; height: 100%; }
.copy-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--input); border: 1px solid var(--border); }
.copy-box code { flex: 1; min-width: 0; font-size: 12px; word-break: break-all; }
.wallet-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wallet-opt { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-weight: 600; transition: .15s; }
.wallet-opt:hover { border-color: var(--accent); background: var(--surface-hover); }
.wallet-opt img, .wallet-opt .wi { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; }
.wallet-opt small { margin-left: auto; font-size: 10.5px; color: var(--success); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.otp { letter-spacing: .5em; text-align: center; font-family: var(--num); font-size: 22px; font-weight: 700; }
.tier { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--input); border: 1px solid var(--border); }
.tier.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.tier .tic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 900; }

/* ---------- admin ---------- */
.admin-wrap { display: grid; grid-template-columns: 210px 1fr; gap: 18px; align-items: start; }
.admin-nav { position: sticky; top: 0; padding: 8px; }
.admin-nav .drawer-item .count { margin-left: auto; font-size: 11px; background: var(--danger); color: #fff; border-radius: 10px; padding: 0 7px; }
.sev-critical { color: var(--danger); }
.sev-warning { color: var(--warning); }
.sev-info { color: var(--info); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 10px; }
.bars div { flex: 1; border-radius: 4px 4px 0 0; min-height: 2px; background: var(--grad); position: relative; }
.bars div.neg { background: var(--danger); opacity: .7; }
.bars div:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--surface-solid); border: 1px solid var(--border); padding: 4px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap; z-index: 3; }
.code-list { max-height: 260px; overflow-y: auto; font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--input); border-radius: 10px; padding: 10px; user-select: all; }

/* ---------- admin fun mode ---------- */
.fun-toggle { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 800; font-size: 12px; cursor: pointer; letter-spacing: .04em; transition: .2s; }
.fun-toggle:hover { color: var(--text); border-color: #ffd34d; }
.fun-toggle.on { background: linear-gradient(135deg, #ffd34d, #7dfcd5 55%, #51fbae); color: #0c2d1e; border-color: transparent; box-shadow: 0 0 20px rgba(125, 252, 213, .5); }
.fun-badge { display: inline-grid; place-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 10px; font-weight: 900; letter-spacing: .06em; color: #0c2d1e; background: linear-gradient(135deg, #ffd34d, #7dfcd5); }
.balance-box.fun { border-color: #ffd34d; box-shadow: 0 0 22px rgba(255, 211, 77, .35); }
.balance-box.fun .wallet-btn { background: linear-gradient(135deg, #ffd34d, #7dfcd5); color: #0c2d1e; }
body.fun-mode .game-layout { box-shadow: 0 0 0 2px rgba(255, 211, 77, .55), 0 0 40px rgba(125, 252, 213, .2); }
.pump-rooms { flex: none; }
.pump-rooms button { height: 28px; font-size: 11px; font-weight: 800; }
@media (max-width: 680px) { .fun-toggle span { display: none; } .fun-toggle { padding: 0 9px; height: 36px; } }

/* ---------- shared table/card bits ---------- */
.bc-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--text-2); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bc-label b { font-size: 16px; color: var(--text); letter-spacing: 0; }
.bc-cards { display: flex; gap: 8px; min-height: 120px; flex-wrap: wrap; justify-content: center; }
.bc-cards .pcard, .cw-side .pcard, .bj-table .pcard { width: 86px; height: 120px; padding: 8px; }
.bc-cards .pcard .big, .cw-side .pcard .big { font-size: 40px; }
.pcard.deal { animation: cardDeal .4s var(--ease) both; }
@keyframes cardDeal { from { transform: translate(60px, -80px) rotate(20deg); opacity: 0; } }
.rl-chip { position: absolute; right: 2px; top: 2px; min-width: 22px; height: 18px; padding: 0 4px; border-radius: 9px; background: #ffd34d; color: #3a2800; font-size: 9.5px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); pointer-events: none; }

/* roulette */
.rl-reel { position: relative; width: 100%; max-width: 760px; height: 74px; overflow: hidden; border-radius: 14px; background: var(--input); border: 1px solid var(--border); margin-bottom: 18px; }
.rl-track { display: flex; gap: 4px; padding: 5px 0; will-change: transform; }
.rl-tile { flex: none; width: 60px; height: 62px; border-radius: 10px; display: grid; place-items: center; font-family: var(--num); font-weight: 800; font-size: 20px; color: #fff; }
.rl-tile.red, .rl-cell.red, .hchip.rl-h.red { background: #d61f45; }
.rl-tile.black, .rl-cell.black, .hchip.rl-h.black { background: #1d1d28; }
.rl-tile.green, .rl-cell.green, .hchip.rl-h.green { background: #16a46b; }
.hchip.rl-h { color: #fff; }
.rl-pointer { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #ffd34d; box-shadow: 0 0 12px #ffd34d; }
.rl-board { display: grid; grid-template-columns: 52px 1fr 52px; grid-template-rows: auto auto auto; gap: 4px; width: 100%; max-width: 760px; }
.rl-zero { grid-row: 1; grid-column: 1; display: grid; }
.rl-nums { grid-row: 1; grid-column: 2; display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.rl-cols { grid-row: 1; grid-column: 3; display: grid; gap: 4px; }
.rl-dozens { grid-row: 2; grid-column: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.rl-outside { grid-row: 3; grid-column: 2; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.rl-cell { position: relative; min-height: 40px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; background: var(--surface-2); color: #fff; font-weight: 800; font-family: var(--num); cursor: pointer; transition: transform .1s, filter .15s, box-shadow .2s; font-size: 13px; }
.rl-cell:hover { filter: brightness(1.25); }
.rl-cell:active { transform: scale(.94); }
.rl-cell.win { box-shadow: 0 0 0 3px #ffd34d, 0 0 20px #ffd34d; z-index: 2; }
.rl-zero .rl-cell { height: 100%; }

/* baccarat */
.bc-table { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; width: 100%; max-width: 720px; margin-bottom: 20px; text-align: center; }
.bc-side .bc-label { justify-content: center; }
.bc-spots { display: grid; grid-template-columns: 1fr .7fr 1fr; gap: 10px; width: 100%; max-width: 720px; }
.bc-spot { position: relative; height: 88px; border-radius: 16px; border: 2px solid var(--border-strong); background: var(--surface-2); font-weight: 900; letter-spacing: .08em; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; transition: .15s; }
.bc-spot small { font-family: var(--num); font-size: 12px; opacity: .8; letter-spacing: 0; }
.bc-spot.player { border-color: #4fb6ff; background: rgba(79, 182, 255, .12); }
.bc-spot.banker { border-color: #ff4d6d; background: rgba(255, 77, 109, .12); }
.bc-spot.tie { border-color: #2ee59d; background: rgba(46, 229, 157, .12); }
.bc-spot:hover { filter: brightness(1.2); }
.bc-spot.win { box-shadow: 0 0 0 3px #ffd34d, 0 0 26px rgba(255, 211, 77, .6); }

/* blackjack */
.bj-table { width: 100%; max-width: 760px; min-height: 460px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; padding: 20px; border-radius: 120px 120px 20px 20px; background: radial-gradient(ellipse at 50% 0%, #1b7a52, #0c3b29 70%); border: 6px solid #5a3a1b; box-shadow: inset 0 0 60px rgba(0, 0, 0, .5); }
.bj-row, .bj-hand { text-align: center; }
.bj-row .bc-label, .bj-hand .bc-label { justify-content: center; color: #d8f5e6; }
.bj-felt { text-align: center; color: rgba(255, 255, 255, .45); font-size: 11px; font-weight: 800; letter-spacing: .2em; }
.bj-hands { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; }
.bj-hand { padding: 8px; border-radius: 14px; }
.bj-hand.active { background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 2px #ffd34d; }

/* slots */
.sl-machine { position: relative; padding: 14px; border-radius: 22px; background: linear-gradient(180deg, #127748, #073f25); border: 3px solid #8dfcda; box-shadow: 0 0 40px rgba(80, 251, 182, .35), inset 0 0 30px rgba(0, 0, 0, .5); }
.sl-reels { display: grid; grid-template-columns: repeat(5, 92px); gap: 8px; }
.sl-reel { height: 228px; overflow: hidden; border-radius: 12px; background: linear-gradient(180deg, #fff, #e9fef4 50%, #fff); box-shadow: inset 0 10px 14px -8px rgba(0, 0, 0, .4), inset 0 -10px 14px -8px rgba(0, 0, 0, .4); }
.sl-strip { will-change: transform; }
.sl-cell { height: 76px; display: grid; place-items: center; font-size: 44px; }
.sl-lines { position: absolute; left: 14px; top: 14px; width: calc(100% - 28px); height: 228px; pointer-events: none; }
.sl-lines polyline { fill: none; stroke: #ffd34d; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px #ffd34d); animation: lineIn .6s ease both; }
@keyframes lineIn { from { opacity: 0; } }
.sl-win { margin-top: 14px; font-size: 24px; font-weight: 800; color: #ffd34d; min-height: 30px; text-shadow: 0 0 16px rgba(255, 211, 77, .6); }

/* cases */
.cs-reels { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 760px; }
.cs-reel { position: relative; height: 132px; overflow: hidden; border-radius: 14px; background: var(--input); border: 1px solid var(--border); }
.cs-track { display: flex; gap: 6px; padding: 8px 0; will-change: transform; }
.cs-tile { flex: none; width: 110px; height: 114px; border-radius: 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--r) 25%, transparent), var(--surface-2)); border-bottom: 4px solid var(--r); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; padding: 4px; }
.cs-tile .cs-ic { font-size: 30px; }
.cs-tile .cs-n { font-size: 11px; font-weight: 700; line-height: 1.1; }
.cs-tile .cs-m { font-size: 12px; font-weight: 800; color: var(--r); }
.cs-tile.won { box-shadow: 0 0 0 3px var(--r), 0 0 30px var(--r); animation: popIn .5s var(--ease); }
.cs-pointer { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #ffd34d; box-shadow: 0 0 14px #ffd34d; z-index: 2; }
.cs-items { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.cs-item { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 6px 8px; border-radius: 8px; background: var(--input); border-left: 3px solid var(--r); }

/* gems */
.gm-row { display: grid; grid-template-columns: repeat(5, 96px); gap: 12px; margin-bottom: 22px; }
.gm-slot { height: 96px; border-radius: 18px; background: var(--input); border: 1px solid var(--border); display: grid; place-items: center; }
.gm-slot svg { width: 70%; height: 70%; }
.gm-slot.in svg { animation: reveal .35s var(--ease); }
.gm-slot.match { border-color: #ffd34d; box-shadow: 0 0 18px rgba(255, 211, 77, .45); }
.gm-pay, .dt-pay, .sc-pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; width: 100%; max-width: 640px; }
.gm-pay div, .dt-pay div, .sc-pay div, .pn-ladder div { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 9px; background: var(--input); font-size: 12px; border: 1px solid transparent; }
.gm-pay div.on, .dt-pay div.on { border-color: var(--success); background: var(--success-bg); color: var(--success); }

/* darts */
.dt-wrap { width: min(360px, 100%); margin-bottom: 16px; }
.dt-board { width: 100%; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .5)); }
.dt-dart.hit { transition: transform .42s cubic-bezier(.2, .9, .3, 1); }

/* card war */
.cw-table { display: flex; align-items: center; gap: 40px; }
.cw-side { text-align: center; }
.cw-side .bc-label { justify-content: center; }
.cw-side .pcard { width: 120px; height: 168px; }
.cw-vs { font-size: 30px; font-weight: 900; color: var(--accent-2); text-shadow: 0 0 20px var(--accent-glow); }

/* scratch */
.sc-card { position: relative; width: min(380px, 100%); padding: 18px; border-radius: 20px; background: linear-gradient(160deg, #ffe36b, #e8a019); box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }
.sc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sc-cell { aspect-ratio: 1; border-radius: 12px; background: #fff8e1; display: grid; place-items: center; font-size: 40px; }
.sc-cell.win { background: #fff; box-shadow: 0 0 0 3px #2ee59d, 0 0 18px #2ee59d; animation: popIn .4s var(--ease); }
.sc-cover { position: absolute; left: 18px; top: 18px; width: calc(100% - 36px); height: calc(100% - 58px); border-radius: 12px; cursor: crosshair; touch-action: none; }
.sc-title { text-align: center; margin-top: 10px; font-weight: 900; letter-spacing: .14em; color: #5a2a08; font-size: 12px; }
.sc-pay { grid-template-columns: 1fr 1fr; }

/* defuse */
.df-bomb { width: min(320px, 100%); padding: 20px; border-radius: 20px; background: #24242c; border: 3px solid #3a3a46; display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.df-bomb.boom { animation: shake .5s; background: #5a1010; }
.df-timer { font-size: 34px; font-weight: 800; color: #ff3d3d; background: #0b0b10; padding: 6px 14px; border-radius: 10px; text-shadow: 0 0 12px #ff3d3d; }
.df-led { width: 22px; height: 22px; border-radius: 50%; background: #ff3d3d; box-shadow: 0 0 14px #ff3d3d; animation: aBlink 1s steps(2) infinite; }
.df-led.safe { background: #2ee59d; box-shadow: 0 0 14px #2ee59d; animation: none; }
.df-led.boom { animation: none; }
.df-wires { display: flex; gap: 18px; }
.df-wire { width: 34px; height: 190px; border: 0; background: none; cursor: pointer; position: relative; padding: 0; }
.df-wire span { position: absolute; left: 50%; top: 0; bottom: 0; width: 12px; margin-left: -6px; border-radius: 6px; background: var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 60%, transparent); transition: .2s; }
.df-wire:hover span { width: 16px; margin-left: -8px; }
.df-wire.sel span { box-shadow: 0 0 0 3px #fff, 0 0 18px var(--c); }
.df-wire.cut span { clip-path: polygon(0 0, 100% 0, 100% 46%, 0 52%, 0 58%, 100% 54%, 100% 100%, 0 100%); transform: scaleY(1.02); }
.df-wire.live::after { content: '💣'; position: absolute; bottom: -30px; left: 50%; transform: translateX(-50%); font-size: 22px; }

/* balloon */
.bl-stage { position: relative; height: 420px; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.bl-balloon { --s: .7; width: 170px; height: 200px; border-radius: 50% 50% 48% 48%; background: radial-gradient(circle at 35% 30%, #c4fdeb, #53fbc9 45%, #179d74); transform: scale(var(--s)); transform-origin: 50% 100%; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); display: grid; place-items: center; position: relative; box-shadow: inset -12px -18px 30px rgba(0, 0, 0, .25), 0 20px 40px rgba(83, 251, 201, .3); margin-bottom: 2px; }
.bl-shine { position: absolute; left: 22%; top: 14%; width: 26%; height: 22%; border-radius: 50%; background: rgba(255, 255, 255, .55); filter: blur(2px); }
.bl-mult { font-size: 30px; font-weight: 800; color: #fff; text-shadow: 0 3px 10px rgba(0, 0, 0, .4); transform: scale(calc(1 / var(--s))); }
.bl-string { width: 2px; height: 90px; background: rgba(255, 255, 255, .6); }
.bl-balloon.popped { animation: popBalloon .25s ease-out forwards; }
@keyframes popBalloon { to { transform: scale(1.6); opacity: 0; } }
.bl-pop { position: absolute; top: 34%; font-size: 72px; font-weight: 900; color: #53fbc9; text-shadow: 0 0 30px #53fbc9; animation: rugIn .5s cubic-bezier(.2, 1.6, .4, 1) both; }

/* penalty */
.pn-pitch { position: relative; width: 100%; max-width: 640px; height: 430px; border-radius: 18px; overflow: hidden; background: repeating-linear-gradient(0deg, #1e8a3e 0 40px, #1a7c37 40px 80px); }
.pn-goal { position: absolute; left: 10%; right: 10%; top: 40px; height: 170px; display: grid; gap: 4px; border: 6px solid #fff; border-bottom: 0; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .15) 0 2px, transparent 2px 14px), repeating-linear-gradient(0deg, rgba(255, 255, 255, .15) 0 2px, transparent 2px 14px), rgba(0, 0, 0, .15); padding: 4px; }
.pn-zone { border: 2px dashed rgba(255, 255, 255, .25); border-radius: 8px; background: transparent; cursor: pointer; transition: .15s; }
.pn-zone:not(:disabled):hover { background: rgba(255, 211, 77, .25); border-color: #ffd34d; }
.pn-zone:disabled { cursor: default; }
.pn-zone { position: relative; }
.pn-zone.kept { background: rgba(255, 90, 90, .18); border-color: rgba(255, 120, 120, .6); }
.pn-zone.kept::after { content: '🧤'; position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(26px, 5vw, 44px); animation: pnGlove .35s cubic-bezier(.2, .9, .3, 1.4) both; }
.pn-zone.hit:not(.saved) { background: rgba(80, 255, 140, .25); border-color: #5dff9b; border-style: solid; }
.pn-zone.saved { background: rgba(255, 70, 70, .35); border-style: solid; }
@keyframes pnGlove { from { transform: scale(.3) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
.pn-keeper.dive { opacity: 0; transform: scale(.6); }
.pn-keeper { transition: opacity .2s, transform .2s; pointer-events: none; }
.pn-keeper { position: absolute; left: 50%; top: 120px; margin-left: -28px; width: 56px; font-size: 54px; text-align: center; transition: transform .45s cubic-bezier(.2, .9, .3, 1); }
.pn-ball { position: absolute; left: 50%; bottom: 60px; margin-left: -20px; font-size: 40px; transition: transform .5s cubic-bezier(.2, .8, .3, 1); }
.pn-msg { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.pn-ladder { display: flex; flex-direction: column-reverse; gap: 4px; }
.pn-ladder div.done { background: var(--success-bg); color: var(--success); }
.pn-ladder div.next { border-color: var(--accent); }

@media (max-width: 680px) {
  /* roulette: vertical board (3 columns x 12 rows) like phone roulette apps */
  .rl-board { grid-template-columns: 1fr; }
  .rl-zero, .rl-nums, .rl-cols, .rl-dozens, .rl-outside { grid-column: 1; grid-row: auto; }
  .rl-zero .rl-cell { height: 38px; }
  .rl-nums, .rl-cols, .rl-outside { grid-template-columns: repeat(3, 1fr); }
  .rl-cell { min-height: 36px; font-size: 13px; }
  .rl-reel { height: 60px; }
  .rl-tile { width: 50px; height: 50px; font-size: 16px; }
  /* plinko: 17 slots must fit a phone */
  .slot { min-width: 0; overflow: hidden; font-size: 7.5px !important; letter-spacing: -.03em; height: 24px; border-radius: 5px; }
  .slots { gap: 2px; }
  /* tighter stages so the controls are reachable without much scrolling */
  .game-stage { min-height: 0; padding: 14px 10px; }
  .bj-table { min-height: 0; gap: 10px; }
  .bj-table .pcard, .bc-cards .pcard { width: 64px; height: 90px; padding: 5px; }
  .bc-cards .pcard .big { font-size: 28px; }
  .bc-cards { min-height: 92px; }
  .bj-felt { font-size: 9px; letter-spacing: .12em; }
  .pump-head { flex-wrap: wrap; }
  .pump-head .pump-rooms { order: 3; width: 100%; }
  .pn-pitch { height: 330px; }
  .pn-goal { height: 140px; }
  .bl-stage { height: 320px; }
  .cs-reel { height: 116px; }
  .cs-tile { width: 94px; height: 98px; }
  .tb-left .pill { display: none; }
  .sl-cell { font-size: 30px; }
  .gm-row { grid-template-columns: repeat(5, 56px); gap: 6px; }
  .gm-slot { height: 56px; }
  .bj-table { border-radius: 40px 40px 14px 14px; padding: 12px; }
  .cw-table { gap: 16px; }
}

/* ---------- Pump (crash) ---------- */
.game-stage:has(.pump) { padding: 14px; align-items: stretch; justify-content: flex-start; }
.pump { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.pump-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--input); border: 1px solid var(--border); }
.pump-coin { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .15), 0 6px 18px rgba(0, 0, 0, .35); }
.pump-ticker { font-size: 17px; letter-spacing: .02em; }
.pump-cap { color: var(--success); }
.pump-chart { position: relative; height: 430px; border-radius: 14px; background: linear-gradient(180deg, rgba(46, 229, 157, .05), transparent 60%), #070b10; border: 1px solid rgba(46, 229, 157, .15); overflow: hidden; }
[data-theme="light"] .pump-chart { background: #0d1117; }
.pump-chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pump-center { position: absolute; left: 16px; top: 12px; pointer-events: none; }
.pump-mult { font-size: clamp(34px, 5vw, 54px); font-weight: 800; letter-spacing: -0.03em; color: #2ee59d; text-shadow: 0 0 24px rgba(46, 229, 157, .4); line-height: 1; }
.pump-mult.rugged { color: #ff4d6d; text-shadow: 0 0 24px rgba(255, 77, 109, .5); }
.pump-sub { color: #9aa7b4; font-weight: 600; font-size: 13px; margin-top: 4px; }
.pump-rug { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(56px, 10vw, 110px); font-weight: 900; letter-spacing: .04em; color: #ff2d55;
  text-shadow: 0 0 30px rgba(255, 45, 85, .8), 0 0 80px rgba(255, 45, 85, .5), 0 6px 0 #6b0019; pointer-events: none; animation: rugIn .7s cubic-bezier(.2, 1.6, .4, 1) both, rugShake .5s .7s ease-in-out 2; background: radial-gradient(circle, rgba(255, 0, 60, .18), transparent 60%); }
@keyframes rugIn { from { transform: scale(2.4) rotate(-8deg); opacity: 0; } to { transform: scale(1) rotate(-4deg); opacity: 1; } }
@keyframes rugShake { 25% { transform: translateX(-8px) rotate(-6deg); } 75% { transform: translateX(8px) rotate(-2deg); } }
.pump-trades { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; font-size: 12px; }
.pump-trade { padding: 6px 8px; border-radius: 8px; background: var(--input); border-left: 3px solid var(--border-strong); animation: msgIn .25s var(--ease); }
.pump-trade.buy { border-left-color: #2ee59d; }
.pump-trade.sell { border-left-color: #ff4d6d; }
@media (max-width: 680px) { .pump-chart { height: 320px; } .pump-head .history-strip { display: none; } }

/* ---------- animated game covers ----------
   Every .a-* animation is paused until the card is on screen (.inview), and plays 1.6x
   faster on hover. Only transform/opacity are animated (GPU friendly). */
.gc-art [class^="a-"], .gc-art [class*=" a-"] { transform-box: fill-box; transform-origin: center; animation-play-state: paused; }
.game-card.inview .gc-art [class^="a-"], .game-card.inview .gc-art [class*=" a-"] { animation-play-state: running; }
.a-float { animation: aFloat 3.2s ease-in-out infinite; }
.a-bounce { animation: aBounce 1.6s ease-in-out infinite; }
.a-pulse { animation: aPulse 2s ease-in-out infinite; }
.a-glow { animation: aGlow 2.4s ease-in-out infinite; }
.a-twinkle { animation: aTwinkle 2.2s ease-in-out infinite; }
.a-spin { animation: aSpin 7s linear infinite; }
.a-orbit { animation: aSpin 2.6s linear infinite reverse; transform-box: view-box !important; transform-origin: 0 0 !important; }
.a-tumble { animation: aTumble 4s ease-in-out infinite; }
.a-flip { animation: aFlip 2.6s ease-in-out infinite; }
.a-drop { animation: aDrop 2.4s cubic-bezier(.5, 0, .7, 1) infinite; }
.a-candle { animation: aCandle 3s ease-out infinite; transform-origin: bottom !important; }
.a-rug { animation: aRug 3s ease-in infinite; transform-origin: top !important; }
.a-lid { animation: aLid 2.8s ease-in-out infinite; transform-origin: left bottom !important; }
.a-deal1 { animation: aDeal1 3.4s ease-in-out infinite; }
.a-deal2 { animation: aDeal2 3.4s ease-in-out infinite; }
.a-reel { animation: aReel 1.8s ease-in-out infinite; }
.a-inflate { animation: aInflate 2.6s ease-in-out infinite; transform-origin: bottom !important; }
.a-sway { animation: aSway 2.6s ease-in-out infinite; transform-origin: top !important; }
.a-keeper { animation: aKeeper 2.4s ease-in-out infinite; }
.a-shot { animation: aShot 2.4s ease-in infinite; }
.a-dart { animation: aDart 2.8s cubic-bezier(.2, .8, .2, 1) infinite; }
.a-scratch { animation: aScratch 2s ease-in-out infinite; }
.a-clash1 { animation: aClash1 2.4s ease-in-out infinite; }
.a-clash2 { animation: aClash2 2.4s ease-in-out infinite; }
.a-shake { animation: aShake 1.4s ease-in-out infinite; }
.a-blink { animation: aBlink 1s steps(2) infinite; }
.a-snip { animation: aSnip 1.4s ease-in-out infinite; }
@keyframes aFloat { 50% { transform: translateY(-6px); } }
@keyframes aBounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-9px); } 60% { transform: translateY(-9px) scale(1.06); } }
@keyframes aPulse { 50% { transform: scale(1.1); } }
@keyframes aGlow { 50% { opacity: .35; transform: scale(1.12); } }
@keyframes aTwinkle { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes aSpin { to { transform: rotate(360deg); } }
@keyframes aTumble { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(16deg) translateY(-6px); } }
@keyframes aFlip { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(-1); } }
@keyframes aDrop { 0% { transform: translate(0, 0); } 25% { transform: translate(9px, 22px); } 50% { transform: translate(-2px, 44px); } 75% { transform: translate(10px, 66px); } 100% { transform: translate(4px, 86px); opacity: 0; } }
@keyframes aCandle { 0% { transform: scaleY(0); opacity: 0; } 30%, 80% { transform: scaleY(1); opacity: 1; } 100% { opacity: 0; } }
@keyframes aRug { 0%, 70% { transform: scaleY(0); opacity: 0; } 78% { opacity: 1; } 95% { transform: scaleY(1); opacity: 1; } 100% { opacity: 0; } }
@keyframes aLid { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-22deg) translateY(-6px); } }
@keyframes aDeal1 { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(-4px, -4px) rotate(-4deg); } }
@keyframes aDeal2 { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(4px, -6px) rotate(4deg); } }
@keyframes aReel { 0% { transform: translateY(-30px); opacity: 0; } 25%, 80% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(30px); opacity: 0; } }
@keyframes aInflate { 0%, 100% { transform: scale(.85); } 70% { transform: scale(1.08); } 80% { transform: scale(1.05, 1.1); } }
@keyframes aSway { 50% { transform: rotate(8deg); } }
@keyframes aKeeper { 0%, 100% { transform: translateX(0); } 45% { transform: translateX(-24px) rotate(-30deg); } }
@keyframes aShot { 0% { transform: translate(0, 0) scale(1); } 45% { transform: translate(28px, -56px) scale(.6); } 100% { transform: translate(28px, -56px) scale(.6); opacity: 0; } }
@keyframes aDart { 0% { transform: translate(40px, -40px); opacity: 0; } 40%, 85% { transform: translate(0, 0); opacity: 1; } 100% { opacity: 0; } }
@keyframes aScratch { 50% { transform: translate(-40px, -36px); } }
@keyframes aClash1 { 50% { transform: translateX(6px) rotate(4deg); } }
@keyframes aClash2 { 50% { transform: translateX(-6px) rotate(-4deg); } }
@keyframes aShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-2px) rotate(-1deg); } 40% { transform: translateX(2px) rotate(1deg); } }
@keyframes aBlink { 50% { opacity: .2; } }
@keyframes aSnip { 50% { transform: rotate(-12deg) translateY(-3px); } }
.game-card:hover .gc-art { filter: drop-shadow(0 0 18px var(--card-c, rgba(255, 255, 255, .35))); }
/* background layers: slow light rays + dotted texture + vignette */
.game-card .gc-rays { position: absolute; left: 50%; top: 38%; width: 220%; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: -1; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .13) 0deg 7deg, transparent 7deg 22deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 55%); mask-image: radial-gradient(circle, #000 0%, transparent 55%);
  animation: raysSpin 40s linear infinite; animation-play-state: paused; opacity: .75; }
.game-card.inview .gc-rays { animation-play-state: running; }
.game-card:hover .gc-rays { opacity: 1; }
@keyframes raysSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.game-card .gc-dots { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .18;
  background-image: radial-gradient(rgba(255, 255, 255, .9) 1px, transparent 1.4px); background-size: 12px 12px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%); mask-image: linear-gradient(180deg, #000, transparent 70%); }
.game-card .gc-bg::before { content: ''; position: absolute; inset: 0; background: radial-gradient(90% 60% at 50% 105%, rgba(0, 0, 0, .55), transparent 70%); }
.game-card .gc-art { inset: 4% 4% 24%; }
.game-card .gc-art svg { width: 92%; }
/* logo-style title */
.game-card .gc-name b { font-size: 21px; font-weight: 900; font-style: italic; letter-spacing: -.01em; line-height: 1;
  background: linear-gradient(180deg, #fff 30%, color-mix(in srgb, var(--card-c, #fff) 55%, #fff)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .45)) drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); }
.game-card .gc-name small { display: block; margin-bottom: 3px; }
.game-card .gc-rtp { position: absolute; top: 10px; right: 10px; font-size: 9.5px; font-weight: 800; padding: 3px 7px; border-radius: 6px; background: rgba(0, 0, 0, .35); color: rgba(255, 255, 255, .85); opacity: 0; transform: translateY(-4px); transition: .25s var(--ease); }
.game-card:hover .gc-rtp { opacity: 1; transform: none; }
.game-card .gc-play { position: absolute; left: 50%; top: 42%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: #0c3924; opacity: 0; transform: scale(.6); transition: .25s var(--ease); box-shadow: 0 8px 30px rgba(0, 0, 0, .4); z-index: 2; }
.game-card .gc-play svg { width: 22px; height: 22px; margin-left: 3px; }
.game-card:hover .gc-play { opacity: 1; transform: scale(1); }
.game-card .gc-players { position: absolute; left: 12px; bottom: 50px; font-size: 10px; font-weight: 700; color: rgba(255, 255, 255, .8); display: flex; align-items: center; gap: 5px; }
.game-card .gc-players::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #2ee59d; box-shadow: 0 0 6px #2ee59d; }

/* ---------- performance ----------
   backdrop-filter re-blurs everything behind an element on every frame. It is kept only on
   floating layers (top bar, popups, drawer, toasts); panels use opaque-ish fills instead. */
.card, .chat-panel, .cat, .game-layout, .game-card .gc-badge, .bottom-nav, .modal { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.chat-panel { background: color-mix(in srgb, var(--bg) 88%, var(--surface-solid)); }
.overlay { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal { background: var(--surface-solid); }
.game-card, .kn, .tile, .slot { contain: layout paint; }
.main { contain: layout paint; }
#lobby-bets .tbl tbody, #game-bets .tbl tbody { contain: content; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }

/* ---------- mobile ---------- */
.bottom-nav { display: none; }
@media (max-width: 1560px) { .brand img.wordmark { display: none; } }
@media (max-width: 1320px) { .navtab { font-size: 0; gap: 0; padding: 0 8px; } .navtab svg { width: 17px; height: 17px; } }
@media (max-width: 1100px) {
  .game-layout { grid-template-columns: 1fr; }
  .game-side { order: 2; border-right: 0; border-top: 1px solid var(--border); }
  .game-stage { min-height: 380px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .account, .admin-wrap { grid-template-columns: 1fr; }
  .account-nav, .admin-nav { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .account-nav .drawer-item, .admin-nav .drawer-item { width: auto; flex: none; white-space: nowrap; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .chat-panel { position: absolute; left: 0; top: 0; bottom: 0; width: min(var(--chat-w), 100vw); box-shadow: var(--shadow); background: color-mix(in srgb, var(--surface-solid) 96%, transparent); }
  .chat-closed .chat-panel { margin-left: calc(-1 * min(var(--chat-w), 100vw) - 10px); }
  .navtabs { display: none; }
  .brand img.wordmark { display: none; }
}
@media (max-width: 680px) {
  :root { --topbar: 56px; --chat-w: 100vw; }
  .topbar { grid-template-columns: auto 1fr auto; padding: 0 10px; gap: 8px; }
  .tb-center { display: flex; justify-content: center; }
  .balance-amount { min-width: 0; padding: 0 10px; }
  .balance-amount .val { font-size: 15px; }
  .wallet-btn span { display: none; }
  .wallet-btn { padding: 0 12px; }
  .profile-btn .pmeta, .profile-btn .chev, .tb-right .icon-btn.hide-m { display: none; }
  .profile-btn { padding: 0 4px; border: 0; background: none; }
  .page { padding: 14px 12px 90px; }
  .hero { border-radius: 14px; }
  .hero-content { bottom: 5%; }
  .hero-content .btn-lg { height: 36px; font-size: 13px; padding: 0 12px; }
  .games-grid { grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .game-card .gc-name b { font-size: 13px; }
  .game-card .gc-name small { display: none; }
  .game-card .gc-name { padding: 20px 8px 8px; }
  .search { min-width: 0; width: 100%; margin-left: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .mines-grid { gap: 7px; }
  .keno-grid { gap: 5px; }
  .kn { font-size: 13px; border-radius: 8px; }
  .pcard { width: 104px; height: 146px; }
  .pcard .big { font-size: 46px; }
  .modal { border-radius: 18px; }
  .wallet-list { grid-template-columns: 1fr; }
  .qr { width: 160px; height: 160px; }
  .main { padding-bottom: 64px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: 62px; padding-bottom: env(safe-area-inset-bottom); z-index: 60; background: color-mix(in srgb, var(--surface-solid) 92%, transparent); border-top: 1px solid var(--border); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
  .bottom-nav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
  .bottom-nav button svg { width: 21px; height: 21px; }
  .bottom-nav button.active { color: var(--accent-2); }
  #toasts { top: auto; bottom: 74px; }
  .dice-stats { grid-template-columns: 1fr 1fr; }
  .dice-stats > :last-child { grid-column: span 2; }
}
