/* ============ Tokens ============ */
:root {
  --bg: #0a0d1e;
  --bg-2: #0f1229;
  --panel: #151937;
  --panel-2: #1b2045;
  --panel-3: #232957;
  --line: rgba(255, 255, 255, .06);
  --line-2: rgba(255, 255, 255, .11);
  --text: #eef0ff;
  --muted: #8d93bf;
  --dim: #5e6494;
  --blue: #3b82ff;
  --blue-2: #2563eb;
  --violet: #8b5cf6;
  --green: #1fd67a;
  --green-2: #11b263;
  --gold: #ffc23d;
  --red: #ff4867;
  --interac: #fdb913;
  --radius: 14px;
  --radius-lg: 18px;
  --sidebar: 268px;
  --topbar: 76px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(59, 130, 255, .06), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(139, 92, 246, .04), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; }
input:focus { outline: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; }
.ic.tiny { width: 12px; height: 12px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
::selection { background: rgba(59, 130, 255, .4); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #262c5a; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ Shell ============ */
.app { display: flex; min-height: 100vh; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-x: clip; }
.view { flex: 1; padding: 28px 32px 48px; max-width: 1640px; width: 100%; margin: 0 auto; }
.view-enter > * { animation: viewIn .5s var(--ease) backwards; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } }
.stagger > * { animation: rise .6s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 60ms + 80ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }

/* ============ Sidebar ============ */
.sidebar {
  width: var(--sidebar);
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, var(--bg-2), #0c0f24);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: width .35s var(--ease), transform .35s var(--ease);
  z-index: 40;
}
.sb-top { height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 16px; flex: none; }
.sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 14px 24px; }

.seg { position: relative; display: flex; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; flex: 1; }
.seg-btn { position: relative; z-index: 1; flex: 1; padding: 9px 0; font-weight: 600; color: var(--muted); border-radius: 9px; transition: color .25s; }
.seg-btn.on { color: #fff; }
.seg-btn:not(.on):hover { color: var(--text); }
.seg-ink { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px; background: #2f6fed; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }

.raffle {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 10px;
  border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 194, 61, .16), rgba(255, 194, 61, .02) 60%), var(--panel);
  border: 1px solid rgba(255, 194, 61, .22);
}
.raffle::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .12) 50%, transparent 65%); transform: translateX(-100%); animation: sheen 5s 1.2s infinite; }
@keyframes sheen { 0%, 70% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.raffle-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #3a2600; background: linear-gradient(135deg, #ffe08a, #ffb020); }
.raffle-copy { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.raffle-copy strong { font-size: 18px; font-weight: 800; font-style: italic; letter-spacing: -.01em; }
.raffle-copy span { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-style: italic; }
.raffle-time { margin-left: auto; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 8px; border: 1px solid rgba(255, 194, 61, .45); color: var(--gold); white-space: nowrap; }

.races { display: grid; grid-template-columns: repeat(3, 1fr); padding: 12px 4px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line); text-align: center; }
.races span { display: block; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); font-style: italic; }
.races strong { font-size: 15px; font-weight: 800; font-style: italic; }

.sb-nav, .sb-group-body > div { display: flex; flex-direction: column; gap: 2px; }
.sb-nav { padding: 6px 0 12px; }
.sb-nav a, .sb-group-body a {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 11px;
  color: #c9cdee; font-weight: 500; transition: background .2s, color .2s, transform .2s var(--ease);
}
.sb-nav a .ic, .sb-group-body a .ic { color: var(--muted); transition: color .2s, transform .3s var(--spring); }
.sb-nav a:hover, .sb-group-body a:hover { background: rgba(255, 255, 255, .04); color: #fff; }
.sb-nav a:hover .ic, .sb-group-body a:hover .ic { transform: scale(1.12); color: #fff; }
.sb-nav a.active, .sb-group-body a.active { background: linear-gradient(90deg, rgba(59, 130, 255, .18), rgba(59, 130, 255, .04)); color: #fff; }
.sb-nav a.active::before, .sb-group-body a.active::before { content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); }
.sb-nav a.active .ic, .sb-group-body a.active .ic { color: var(--blue); }
.sb-group-body a .ic { color: var(--c1, var(--muted)); }

.sb-group { margin-top: 8px; background: rgba(255, 255, 255, .02); border: 1px solid var(--line); border-radius: var(--radius); }
.sb-group-head { width: 100%; display: flex; align-items: center; gap: 14px; padding: 13px 14px; font-weight: 600; }
.sb-chev { margin-left: auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--panel-2); transition: transform .3s var(--ease); }
.sb-chev .ic { width: 16px; height: 16px; }
.sb-group:not(.open) .sb-chev { transform: rotate(-90deg); }
.sb-group-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .35s var(--ease); }
.sb-group:not(.open) .sb-group-body { grid-template-rows: 0fr; }
.sb-group-body > div { overflow: hidden; padding: 0 6px; }
.sb-group.open .sb-group-body > div { padding-bottom: 8px; }
.pill-new { margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; color: var(--green); background: rgba(31, 214, 122, .1); border: 1px solid rgba(31, 214, 122, .4); }

/* Collapsed sidebar */
.app.collapsed { --sidebar: 84px; }
.app.collapsed .sb-top { justify-content: center; padding: 0; }
.app.collapsed .seg, .app.collapsed .raffle, .app.collapsed .races, .app.collapsed .lbl, .app.collapsed .pill-new, .app.collapsed .sb-chev { display: none; }
.app.collapsed .sb-scroll { padding: 4px 12px; }
.app.collapsed .sb-nav a, .app.collapsed .sb-group-body a, .app.collapsed .sb-group-head { justify-content: center; padding: 12px; }
.app.collapsed .sb-group-body { grid-template-rows: 1fr !important; }

.scrim { display: none; }

/* ============ Topbar ============ */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar);
  display: flex; align-items: center; gap: 16px; padding: 0 32px;
  background: rgba(10, 13, 30, .78);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.sim-banner {
  position: sticky; top: var(--topbar); z-index: 20;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 9px 20px; text-align: center;
  font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--gold);
  background: linear-gradient(90deg, rgba(255, 194, 61, .12), rgba(255, 194, 61, .05) 50%, rgba(255, 194, 61, .12));
  border-bottom: 1px solid rgba(255, 194, 61, .22);
}
.sim-banner .ic { width: 15px; height: 15px; }
.sim-banner b { color: #ffe08a; text-transform: uppercase; letter-spacing: .08em; }
.logo { display: flex; align-items: center; gap: 10px; flex: none; }
.logo-mark { width: 44px; height: 28px; transition: transform .4s var(--spring); }
.logo:hover .logo-mark { transform: rotate(-6deg) scale(1.08); }
.logo-word { font-size: 27px; font-weight: 900; letter-spacing: -.03em; font-style: italic; }
.logo-word b { font-weight: 900; background: linear-gradient(120deg, #6aa1ff, #b18cff); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 3px; }

.tb-center { display: flex; align-items: center; gap: 10px; margin: 0 auto; }
.balance-wrap { position: relative; }
.balance {
  display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 16px 0 20px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px 0 0 12px; border-right: 0;
  font-weight: 700; font-size: 16px; transition: background .2s, box-shadow .3s;
}
.balance:hover { background: var(--panel-2); }
.balance-chev { width: 16px; height: 16px; color: var(--muted); }
.balance.flash-pos { animation: flashPos .9s var(--ease); }
.balance.flash-neg { animation: flashNeg .6s var(--ease); }
@keyframes flashPos { 30% { color: #b9ffd9; } }
@keyframes flashNeg { 30% { color: #ffb3c0; } }
.btn-wallet {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px; margin-left: -10px;
  border-radius: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #27d881, #17b86a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .2s var(--ease), filter .2s;
}
.btn-wallet::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-120%); animation: sheen 4s 2s infinite; }
.btn-wallet:hover { filter: brightness(1.08); }
.btn-wallet:active { transform: scale(.97); }
.delta { position: absolute; left: 24px; top: 100%; font-weight: 800; font-size: 14px; pointer-events: none; animation: deltaUp 1.3s var(--ease) forwards; white-space: nowrap; }
.delta.pos { color: var(--green); }
.delta.neg { color: var(--red); }
@keyframes deltaUp { 0% { opacity: 0; transform: translateY(-4px) scale(.8); } 20% { opacity: 1; transform: translateY(4px) scale(1); } 100% { opacity: 0; transform: translateY(18px); } }

.tb-right { display: flex; align-items: center; gap: 10px; flex: none; }
.icon-btn {
  position: relative; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line-2); color: #d6daf8;
  transition: background .2s, transform .2s var(--ease), color .2s;
}
.icon-btn:hover { background: var(--panel-2); color: #fff; }
.icon-btn:active { transform: scale(.94); }
.icon-btn.ghost { background: transparent; border-color: transparent; }
.icon-btn.ghost:hover { background: rgba(255, 255, 255, .05); }
.tb-group { display: flex; align-items: center; gap: 2px; padding: 0 4px; height: 48px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; }
.tb-group .icon-btn { width: 42px; height: 40px; }
.user-btn { width: auto !important; padding: 0 8px; display: flex !important; gap: 4px; }
.dot-badge { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--panel); animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { transform: scale(1.3); } }

.boost { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px 0 10px; border-radius: 12px; border: 1px solid rgba(255, 194, 61, .3); background: linear-gradient(135deg, rgba(255, 194, 61, .12), transparent), var(--panel); transition: transform .2s var(--ease); }
.boost:hover { border-color: rgba(255, 194, 61, .5); }
.boost-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #3a2600; background: linear-gradient(135deg, #ffe08a, #ffad1f); }
.boost-ic .ic { width: 16px; height: 16px; }
@keyframes glowPulse { 50% { box-shadow: 0 0 0 6px rgba(255, 194, 61, .08), 0 0 18px rgba(255, 194, 61, .5); } }
.boost-copy { display: flex; flex-direction: column; line-height: 1.1; }
.boost-copy strong { font-size: 14px; color: var(--gold); font-weight: 800; }
.boost-copy span { font-size: 12px; color: var(--muted); }

.mobile-only { display: none !important; }

/* Popovers */
.pop-wrap { position: relative; }
.pop {
  position: absolute; top: calc(100% + 12px); right: 0; min-width: 260px; padding: 14px;
  background: rgba(24, 28, 62, .96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .7);
  opacity: 0; transform: translateY(-8px) scale(.97); transform-origin: top right; pointer-events: none;
  transition: opacity .2s, transform .25s var(--ease); z-index: 50;
}
.pop.open { opacity: 1; transform: none; pointer-events: auto; }
.pop-bal { left: 0; right: auto; transform-origin: top left; }
.pop-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.pop-big { font-size: 28px; font-weight: 800; margin-bottom: 10px; }
.pop-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); padding: 10px 0; border-top: 1px solid var(--line); }
.pop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.pop-menu { padding: 8px; min-width: 240px; }
.pop-menu a, .pop-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 10px; font-weight: 500; color: #d6daf8; text-align: left; transition: background .15s; }
.pop-menu a:hover, .pop-menu button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.pop-menu .ic { width: 18px; height: 18px; color: var(--muted); }
.pop-user { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.pop-user strong { display: block; }
.pop-user span { font-size: 12px; color: #d59a5b; font-weight: 600; }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), var(--violet)); }
.pop-list { width: 320px; }
.notif { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); }
.notif strong { display: block; font-size: 14px; }
.notif span { font-size: 12px; color: var(--muted); }
.notif-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.notif-ic .ic { width: 16px; height: 16px; }
.notif-ic.deposit, .txn-ic.deposit { background: rgba(31, 214, 122, .12); color: var(--green); }
.notif-ic.withdraw, .txn-ic.withdraw { background: rgba(59, 130, 255, .12); color: var(--blue); }
.empty-sm { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 0; color: var(--dim); font-size: 14px; }

/* ============ Buttons ============ */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 12px; font-weight: 700; white-space: nowrap; overflow: hidden;
  transition: transform .18s var(--ease), filter .2s, background .2s, box-shadow .25s, opacity .2s;
}
.btn .ic { width: 18px; height: 18px; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; border-radius: 10px; }
.btn-lg { height: 54px; font-size: 16px; padding: 0 26px; border-radius: 14px; }
.btn-xl { height: 50px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-primary { color: #fff; background: linear-gradient(180deg, #3d84ff, #2563eb); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-green { color: #fff; background: linear-gradient(135deg, #2ee68b, #12b866); }
.btn-ghost { background: var(--panel-2); border: 1px solid var(--line-2); color: #dfe2ff; }
.btn-ghost:hover:not(:disabled) { background: var(--panel-3); }
.btn-glass { color: #fff; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn-interac { color: #1a1300; background: linear-gradient(180deg, #ffc93a, #fdb913); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-interac:hover:not(:disabled) { filter: brightness(1.06); }
.btn-logo { width: 26px; height: 26px; border-radius: 6px; }
.btn-cashout { background: linear-gradient(180deg, #27d881, #17b86a) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2) !important; }
.bet-btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease); }
.bet-btn:hover:not(:disabled)::after { transform: translateX(120%); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #c9cdee; background: var(--panel-2); border: 1px solid var(--line); }
.chip .ic { width: 15px; height: 15px; color: var(--muted); }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--blue); animation: spin .8s linear infinite; display: inline-block; }
.spinner.sm { width: 18px; height: 18px; border-width: 2.5px; border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Home ============ */
.banners { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 26px; }
.banner {
  position: relative; overflow: hidden; display: flex; min-height: 210px; padding: 28px; border-radius: var(--radius-lg);
  isolation: isolate; transition: transform .35s var(--ease), box-shadow .35s;
}
.banner::before { content: ''; position: absolute; inset: 0; z-index: -2; background: var(--bgx); }
.banner::after { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .12) 1px, transparent 0) 0 0 / 18px 18px; mask-image: linear-gradient(110deg, transparent 30%, #000); -webkit-mask-image: linear-gradient(110deg, transparent 30%, #000); }
.banner:hover { box-shadow: 0 18px 36px -20px rgba(0, 0, 0, .9); }
.b1 { --bgx: linear-gradient(135deg, #2d6bff, #1b2fa8 60%, #5a2fd6); --glow: rgba(59, 130, 255, .7); }
.b2 { --bgx: linear-gradient(135deg, #1d1a10, #3b2c06 50%, #6b4a00); --glow: rgba(253, 185, 19, .6); }
.b3 { --bgx: linear-gradient(135deg, #ff3d8b, #9b2cff 60%, #4a17b3); --glow: rgba(255, 61, 139, .6); }
.b-copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; max-width: 60%; }
.b-kicker { font-size: 15px; font-weight: 600; opacity: .85; margin-bottom: 6px; }
.banner h2 { margin: 0 0 auto; font-size: clamp(22px, 2.1vw, 30px); line-height: 1.08; font-weight: 800; letter-spacing: -.02em; padding-bottom: 18px; }
.b-art { position: absolute; right: -10px; top: 50%; width: 52%; aspect-ratio: 1; transform: translateY(-50%); z-index: 1; transition: transform .6s var(--ease); animation: float 6s ease-in-out infinite; }
.b-art svg { width: 100%; height: 100%; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35)); }
.banner:hover .b-art { transform: translateY(-50%) scale(1.06) rotate(-3deg); }
@keyframes float { 50% { margin-top: -10px; } }
.b-art-interac { display: grid; place-items: center; }
.b-art-interac img { width: 62%; transform: rotate(-10deg); border-radius: 18px; box-shadow: 0 24px 40px -16px rgba(0, 0, 0, .6); }
.b-orb { position: absolute; width: 260px; height: 260px; right: -60px; bottom: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .1), transparent 65%); z-index: 0; animation: orb 8s ease-in-out infinite alternate; }
@keyframes orb { to { transform: translate(-40px, -30px) scale(1.2); } }

/* Live wins */
.live-wins { position: relative; display: flex; gap: 12px; padding: 18px 0 18px; margin-bottom: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lw-label { position: absolute; top: 4px; left: 0; z-index: 3; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 600; background: rgba(21, 25, 55, .92); border: 1px solid var(--line-2); backdrop-filter: blur(6px); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(31, 214, 122, .6); animation: livePulse 1.6s infinite; }
@keyframes livePulse { 70% { box-shadow: 0 0 0 8px rgba(31, 214, 122, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 214, 122, 0); } }
.lw-viewport { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }
.lw-track { display: flex; gap: 10px; transition: transform .7s var(--ease); will-change: transform; }
.lw-item { flex: none; width: 112px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lw-thumb { position: relative; width: 112px; height: 132px; border-radius: 12px; overflow: hidden; background: radial-gradient(120% 80% at 30% 0%, rgba(255, 255, 255, .25), transparent 60%), linear-gradient(160deg, var(--c1), var(--c2)); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 10px; transition: transform .3s var(--ease); }
.lw-thumb svg { position: absolute; top: 6px; width: 84%; }
.lw-thumb span { position: relative; font-weight: 900; font-size: 15px; text-transform: uppercase; letter-spacing: .02em; text-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.lw-item:hover .lw-thumb { transform: translateY(-3px); }
.lw-user { display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 500; max-width: 100%; margin-top: 4px; }
.lw-user .ic { color: #d59a5b; }
.lw-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lw-amt { font-size: 15px; font-weight: 700; color: var(--green); }
.lw-new .lw-thumb { animation: lwIn .7s var(--spring); }
.lw-item.you .lw-thumb { box-shadow: 0 0 0 2px var(--gold), 0 8px 24px -6px rgba(255, 194, 61, .7); }
.lw-item.you .lw-user { color: var(--gold); font-weight: 700; }
@keyframes lwIn { from { transform: scale(.6); opacity: 0; } }

/* Toolbar */
.toolbar { display: flex; gap: 14px; margin: 26px 0 30px; }
.search { flex: 1; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); transition: border-color .2s, box-shadow .25s, background .2s; }
.search:focus-within { border-color: rgba(59, 130, 255, .6); box-shadow: 0 0 0 4px rgba(59, 130, 255, .14); background: var(--panel-2); }
.search .ic { color: var(--muted); }
.search input { flex: 1; min-width: 0; background: none; border: 0; font-size: 16px; }
.search input::placeholder { color: var(--dim); }
.tabs { position: relative; display: flex; padding: 5px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); }
.tab { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 10px; font-weight: 600; color: #c4c8ec; transition: color .25s; }
.tab .ic { width: 18px; height: 18px; }
.tab.on { color: #fff; }
.tab-ink { position: absolute; top: 5px; left: 0; height: 44px; border-radius: 10px; background: #2f6fed; transition: transform .4s var(--ease), width .4s var(--ease); }

/* Rows & grids */
.row-section { margin-bottom: 34px; }
.row-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.row-head h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.row-head h3 .ic { width: 24px; height: 24px; color: var(--blue); }
.row-link { color: var(--muted); font-weight: 500; transition: color .2s; }
.row-link:hover { color: #fff; }
.row-arrows { display: flex; margin-left: auto; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); }
.arrow { width: 52px; height: 40px; display: grid; place-items: center; background: var(--panel); color: #c9cdee; transition: background .2s, color .2s; }
.arrow + .arrow { border-left: 1px solid var(--line-2); }
.arrow:hover { background: var(--panel-2); color: #fff; }
.row-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 6 * 16px) / 7); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 6px 2px 14px; margin: -6px -2px 0; }
.row-track::-webkit-scrollbar { display: none; }
.row-track > * { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }

/* Game card */
.gcard { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 16px; }
.gcard-in {
  position: absolute; inset: 0; border-radius: inherit; overflow: hidden; isolation: isolate;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .8);
}
.gcard-bg { position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(120% 70% at 25% 0%, rgba(255, 255, 255, .16), transparent 55%),
  radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .1) 1px, transparent 0) 0 0 / 14px 14px,
  linear-gradient(165deg, var(--c1), var(--c2)); }
.gcard-in::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .28) 50%, transparent 65%); transform: translateX(-110%); transition: transform .8s var(--ease); pointer-events: none; }
.gcard-art { position: absolute; left: 8%; right: 8%; top: 6%; aspect-ratio: 1; transition: transform .5s var(--spring); }
.gcard-art svg { width: 100%; height: 100%; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .3)); }
.gcard-title { position: absolute; left: 0; right: 0; bottom: 30px; text-align: center; font-size: clamp(17px, 1.55vw, 24px); font-weight: 900; text-transform: uppercase; letter-spacing: .01em; text-shadow: 0 3px 14px rgba(0, 0, 0, .35); }
.gcard-tag { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.gcard-badge { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px; border-radius: 7px; background: rgba(0, 0, 0, .35); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .2); }
.gcard:hover .gcard-in { transform: translateY(-6px); box-shadow: 0 18px 32px -18px rgba(0, 0, 0, .95); }
.gcard:hover .gcard-in::after { transform: translateX(110%); }
.gcard:hover .gcard-art { transform: scale(1.08) rotate(-4deg); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 34px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius); background: linear-gradient(180deg, var(--panel), rgba(21, 25, 55, .6)); border: 1px solid var(--line); transition: transform .3s var(--ease), border-color .3s; }
.stat:hover { border-color: var(--line-2); background: linear-gradient(180deg, var(--panel-2), rgba(21, 25, 55, .6)); }
.stat-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: var(--blue); background: rgba(59, 130, 255, .12); flex: none; }
.stat:nth-child(2) .stat-ic { color: var(--violet); background: rgba(139, 92, 246, .14); }
.stat:nth-child(3) .stat-ic { color: #ff8a3d; background: rgba(255, 138, 61, .12); }
.stat:nth-child(4) .stat-ic { color: var(--gold); background: rgba(255, 194, 61, .12); }
.stat > div > span { display: block; font-size: 13px; color: var(--muted); }
.stat strong { font-size: 22px; font-weight: 800; }

.cta-strip { position: relative; overflow: hidden; display: flex; align-items: center; gap: 20px; padding: 22px 26px; border-radius: var(--radius-lg); background: linear-gradient(100deg, rgba(253, 185, 19, .14), rgba(253, 185, 19, .02) 55%), var(--panel); border: 1px solid rgba(253, 185, 19, .22); transition: transform .3s var(--ease), border-color .3s; }
.cta-strip:hover { border-color: rgba(253, 185, 19, .45); }
.cta-logo img { width: 58px; height: 58px; border-radius: 12px; display: block; }
.cta-copy { flex: 1; display: flex; flex-direction: column; }
.cta-copy strong { font-size: 19px; }
.cta-copy span { color: var(--muted); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 60px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius-lg); color: var(--muted); }
.empty > .ic { width: 40px; height: 40px; color: var(--dim); margin-bottom: 6px; }
.empty strong { font-size: 18px; color: var(--text); }
.empty .btn { margin-top: 12px; }

.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.page-head-ic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--blue), var(--violet)); }
.page-head h1 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
.page-head p { margin: 2px 0 0; color: var(--muted); }

/* ============ Game page ============ */
.game-shell { display: grid; grid-template-columns: 340px 1fr; border-radius: var(--radius-lg); overflow: hidden; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); min-height: 600px; }
.game-controls { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border-right: 1px solid var(--line); }
.game-stage { position: relative; display: flex; flex-direction: column; padding: 22px; overflow: hidden; background:
  radial-gradient(80% 60% at 50% 40%, color-mix(in srgb, var(--c1) 5%, transparent), transparent 70%),
  #0d1028; }
.stage-loading { flex: 1; display: grid; place-items: center; }

.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.field label, .field-head label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field-sub { font-size: 12px; color: var(--dim); }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.field-row > * { min-width: 0; }
.input-group { display: flex; align-items: center; height: 42px; min-width: 0; border-radius: 12px; background: #0c0f26; border: 1px solid var(--line-2); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.input-group:focus-within { border-color: rgba(59, 130, 255, .6); box-shadow: 0 0 0 4px rgba(59, 130, 255, .12); }
.input-group .prefix { flex: none; padding-left: 12px; color: var(--muted); font-weight: 600; font-size: 14px; }
.input-group .suffix { flex: none; padding: 0 12px; color: var(--muted); font-weight: 700; }
.input-group input { flex: 1; width: 100%; min-width: 0; height: 100%; padding: 0 10px; background: none; border: 0; font-weight: 700; font-size: 15px; }
.input-group input:disabled { opacity: .6; }
.input-group button { flex: none; height: 100%; padding: 0 12px; font-weight: 700; color: #c9cdee; border-left: 1px solid var(--line-2); background: var(--panel-2); transition: background .15s, color .15s; }
.input-group button:hover:not(:disabled) { background: var(--panel-3); color: #fff; }
.input-group.readonly { background: rgba(12, 15, 38, .5); }
.input-group.readonly input { color: #c9cdee; }
input[type=number] { -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.select-wrap { position: relative; }
.select-wrap::after { content: ''; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select-wrap select { width: 100%; height: 42px; padding: 0 14px; appearance: none; -webkit-appearance: none; border-radius: 12px; background: #0c0f26; border: 1px solid var(--line-2); font-weight: 700; font-size: 16px; cursor: pointer; }
.seg-ctl { display: flex; padding: 3px; gap: 3px; border-radius: 12px; background: #0c0f26; border: 1px solid var(--line-2); }
.seg-ctl button { flex: 1; min-width: 0; height: 34px; border-radius: 9px; font-weight: 600; color: var(--muted); transition: background .2s, color .2s; }
.seg-ctl button.on { background: var(--panel-3); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.seg-ctl button:disabled { opacity: .5; }
.bet-btn { margin-top: 4px; }

.game-meta { display: flex; align-items: center; gap: 18px; margin: 22px 0 36px; padding: 20px 22px; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); }
.game-meta-ic { width: 54px; height: 54px; flex: none; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(145deg, var(--c1), var(--c2)); }
.game-meta-ic .ic { width: 26px; height: 26px; }
.game-meta-copy { flex: 1; min-width: 0; }
.game-meta h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.game-meta h1 .muted { font-size: 14px; font-weight: 500; margin-left: 8px; }
.game-meta p { margin: 4px 0 0; color: var(--muted); }
.game-meta-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.fav.on { color: var(--gold); border-color: rgba(255, 194, 61, .35); }
.fav.on .ic { fill: var(--gold); }
.fav.pop-anim .ic { animation: starPop .5s var(--spring); }
@keyframes starPop { 40% { transform: scale(1.5) rotate(15deg); } }

.history { display: flex; gap: 8px; justify-content: flex-end; min-height: 34px; overflow: hidden; margin-bottom: 8px; }
.hchip { flex: none; display: grid; place-items: center; min-width: 64px; height: 32px; padding: 0 10px; border-radius: 9px; font-size: 13px; font-weight: 700; animation: chipIn .45s var(--spring); }
.hchip.win { color: #052; background: var(--green); }
.hchip.lose { color: #c9cdee; background: var(--panel-3); }
@keyframes chipIn { from { transform: translateX(-20px) scale(.7); opacity: 0; } }

.result-pop { position: absolute; left: 50%; top: 50%; z-index: 20; min-width: 290px; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 22px 18px; border-radius: 16px; transform: translate(-50%, -50%); background: linear-gradient(160deg, rgba(56, 64, 108, .97), rgba(40, 46, 86, .97)); border: 3px solid #8ef0a0; box-shadow: 0 24px 60px -10px rgba(0, 0, 0, .7); pointer-events: none; animation: popIn .5s var(--spring); }
.result-pop strong { display: block; width: 100%; padding: 8px 36px; text-align: center; border-radius: 10px; border: 2px solid rgba(142, 240, 160, .5); background: rgba(142, 240, 160, .06); font-size: 52px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: #8ef0a0; }
.result-pop span { font-size: 22px; font-weight: 500; color: #8ef0a0; }
.result-pop.out { animation: popOut .3s ease forwards; }
@keyframes popIn { from { transform: translate(-50%, -50%) scale(.5); opacity: 0; } }
@keyframes popOut { to { transform: translate(-50%, -50%) scale(.9); opacity: 0; } }

/* ---- Dice ---- */
.dice-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 40px; padding: 10px 2% 0; }
.dice-board { padding: 26px 26px 30px; border-radius: 20px; background: #161a3a; border: 1px solid var(--line); }
.dice-scale { display: flex; justify-content: space-between; padding: 0 12px; margin-bottom: 16px; font-weight: 700; color: var(--muted); font-size: 14px; }
.dice-rail { position: relative; height: 34px; padding: 12px; border-radius: 30px; background: #232957; }
.dice-track { height: 10px; border-radius: 10px; --lo: var(--red); --hi: var(--green); background: linear-gradient(90deg, var(--lo) var(--t), var(--hi) var(--t)); transition: background .2s; }
.dice-track.under { --lo: var(--green); --hi: var(--red); }
.dice-rail input[type=range] { position: absolute; inset: 0 12px; width: calc(100% - 24px); height: 100%; margin: 0; -webkit-appearance: none; appearance: none; background: transparent; cursor: grab; }
.dice-rail input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(180deg, #6da2ff, #3b82ff); border: 0; box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .4); }
.dice-rail input[type=range]::-moz-range-thumb { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(180deg, #6da2ff, #3b82ff); border: 0; }
.dice-marker { position: absolute; bottom: calc(100% + 18px); left: 50%; transform: translateX(-50%) scale(.6); opacity: 0; transition: left .42s var(--ease), opacity .2s, transform .35s var(--spring); pointer-events: none; }
.dice-marker.show { opacity: 1; transform: translateX(-50%) scale(1); }
.dice-marker span { display: grid; place-items: center; min-width: 78px; height: 58px; padding: 0 10px; font-size: 20px; font-weight: 800; color: #1a1f3b; background: #fff; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); transition: color .2s; }
.dice-marker.win span { color: var(--green-2); }
.dice-marker.lose span { color: var(--red); }

.dice-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 18px; border-radius: 18px; background: #161a3a; border: 1px solid var(--line); }
.dstat { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.dstat > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.dstat-in { display: flex; align-items: center; height: 44px; border-radius: 12px; background: #0c0f26; border: 1px solid var(--line-2); padding: 0 14px; transition: border-color .2s; }
.dstat-in:focus-within { border-color: rgba(59, 130, 255, .6); }
.dstat-in input { flex: 1; min-width: 0; background: none; border: 0; font-weight: 700; font-size: 16px; }
.dstat-in b { color: var(--muted); display: grid; place-items: center; }
.dstat-btn .dstat-in { cursor: pointer; }
.dstat-btn:hover .dstat-in { border-color: var(--blue); }
.dstat-btn .dstat-in input { pointer-events: none; }
.swap-ic .ic { width: 18px; height: 18px; transition: transform .4s var(--ease); }
.dstat-btn:hover .swap-ic .ic { transform: rotate(180deg); color: var(--blue); }

/* ---- Coinflip ---- */
.cf-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; }
.cf-arena { position: relative; width: 260px; height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; perspective: 900px; }
.cf-glow { position: absolute; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 194, 61, .08), transparent 65%); animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: .7; } }
.cf-toss.go { animation: toss 1.6s cubic-bezier(.3, .6, .4, 1); }
@keyframes toss { 0% { transform: translateY(0); } 45% { transform: translateY(-110px) scale(1.15); } 100% { transform: translateY(0); } }
.coin { position: relative; width: 210px; height: 210px; transform-style: preserve-3d; transition: transform 1.6s cubic-bezier(.25, .7, .25, 1); }
.coin-face { position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; }
.coin-face.heads { background: radial-gradient(circle at 35% 30%, #fff1a8, #ffd23f 40%, #e79a0b 100%); box-shadow: inset 0 0 0 10px #f2b21c, inset 0 0 0 14px #ffe17a, 0 18px 34px -14px rgba(0, 0, 0, .7); }
.coin-face.tails { transform: rotateX(180deg); background: radial-gradient(circle at 35% 30%, #c8d6ff, #7d95e8 45%, #3c4fa8 100%); box-shadow: inset 0 0 0 10px #6178d1, inset 0 0 0 14px #b6c5ff, 0 18px 34px -14px rgba(0, 0, 0, .7); }
.coin-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.coin-inner .logo-mark { width: 92px; height: 60px; filter: none; }
.coin-face.heads .logo-mark path { fill: #c77d00 !important; }
.coin-inner span { font-weight: 900; font-size: 15px; letter-spacing: .2em; }
.coin-face.heads span { color: #9a5d00; }
.coin-face.tails span { color: #1f2a6b; }
.coin-star { width: 70px; height: 70px; fill: #24306f; }
.cf-shadow { position: absolute; bottom: 20px; width: 160px; height: 18px; border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, .55), transparent 70%); }
.cf-shadow.go { animation: shadow 1.6s cubic-bezier(.3, .6, .4, 1); }
@keyframes shadow { 45% { transform: scale(.55); opacity: .4; } }
.cf-caption { font-size: 18px; font-weight: 600; color: var(--muted); transition: color .3s; }
.cf-caption.win { color: var(--green); }
.cf-caption.lose { color: var(--red); }
.side-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side { display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px; border-radius: 12px; font-weight: 700; background: #0c0f26; border: 1px solid var(--line-2); color: var(--muted); transition: all .2s var(--ease); }
.side.on { color: #fff; border-color: var(--blue); background: rgba(59, 130, 255, .1); }
.mini-coin { width: 22px; height: 22px; border-radius: 50%; }
.mini-coin.heads { background: radial-gradient(circle at 35% 30%, #fff1a8, #ffd23f 45%, #e79a0b); }
.mini-coin.tails { background: radial-gradient(circle at 35% 30%, #c8d6ff, #7d95e8 45%, #3c4fa8); }

/* ---- Mines ---- */
.mines-stage { flex: 1; display: grid; place-items: center; }
.mines-grid { --cols: 5; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 12px; width: min(100%, 540px); }
.mines-grid[data-cols="6"] { gap: 10px; width: min(100%, 560px); }
.mines-grid[data-cols="7"] { gap: 8px; width: min(100%, 580px); }
.mines-grid[data-cols="8"] { gap: 7px; width: min(100%, 600px); }
.mines-grid[data-cols="7"] .tile, .mines-grid[data-cols="8"] .tile { border-radius: 10px; box-shadow: inset 0 -4px 0 #191e44, 0 4px 10px -8px rgba(0, 0, 0, .7); }
.mines-grid[data-cols="7"] .tile-mult, .mines-grid[data-cols="8"] .tile-mult { padding: 2px 7px; font-size: 10px; border-width: 1px; }
.mines-grid[data-cols="8"] .tile-face svg { width: 74%; height: 74%; }
.grid-size button { font-variant-numeric: tabular-nums; }
.tile { position: relative; aspect-ratio: 1; border-radius: 14px; background: linear-gradient(180deg, #2c3370, #232957); box-shadow: inset 0 -6px 0 #191e44, 0 6px 14px -8px rgba(0, 0, 0, .7); transition: transform .2s var(--ease), background .2s, box-shadow .2s; }
.mines-grid.armed .tile:not(.revealed) { animation: tileIn .5s var(--spring) backwards; animation-delay: var(--d); }
@keyframes tileIn { from { transform: scale(.7); opacity: .3; } }
.tile:not(:disabled):hover { transform: translateY(-3px); background: linear-gradient(180deg, #353d8a, #2a3068); box-shadow: inset 0 -6px 0 #1d2350; }
.tile:disabled:not(.revealed) { cursor: default; }
.tile-face { position: absolute; inset: 0; display: grid; place-items: center; }
.tile-face svg { width: 68%; height: 68%; }
.tile.revealed { background: #0d1029; box-shadow: inset 0 0 0 1px var(--line); animation: reveal .45s var(--spring); }


.tile.dim { opacity: .4; animation: revealDim .35s ease; }
.tile.dim svg { transform: scale(.8); }
.tile.boom { background: radial-gradient(circle, rgba(255, 72, 103, .28), #1f0f22 70%); box-shadow: inset 0 0 0 2px var(--red); animation: boom .55s var(--ease); }
@keyframes reveal { 0% { transform: rotateY(90deg) scale(.85); } 100% { transform: none; } }
@keyframes revealDim { from { opacity: 0; } }
@keyframes boom { 0% { transform: scale(.6); } 30% { transform: scale(1.18) rotate(-4deg); } 50% { transform: scale(.95) rotate(4deg); } 70% { transform: rotate(-2deg); } }
.mines-grid.busted { animation: shake .45s ease; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.live-profit { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; border-radius: 14px; background: #0c0f26; border: 1px solid var(--line-2); animation: rise .4s var(--ease); }
.live-profit span { display: block; font-size: 12px; color: var(--muted); }
.live-profit strong { font-size: 17px; }
.live-profit .wide { grid-column: span 2; padding-top: 10px; border-top: 1px solid var(--line); }
.live-profit .wide strong { color: var(--green); font-size: 20px; }

/* ---- Plinko ---- */
.plinko-stage { position: relative; flex: 1; display: flex; align-items: center; }
.plinko-stage canvas { width: 100%; display: block; }
.plinko-hist { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; border-radius: 12px; overflow: hidden; }
.plinko-hist span { display: grid; place-items: center; width: 60px; height: 40px; font-weight: 800; font-size: 13px; color: #1a0f22; background: var(--bc); animation: histDrop .4s var(--spring); }
@keyframes histDrop { from { transform: translateY(-30px); opacity: 0; } }

/* ---- Blackjack ---- */
.bj-stage { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 0; }
.bj-shoe { position: absolute; right: 6px; top: 6px; width: 64px; height: 84px; }
.bj-shoe span { position: absolute; inset: 0; border-radius: 9px; background: linear-gradient(135deg, #4f6dff, #7b3dff); border: 2px solid rgba(255, 255, 255, .25); }
.bj-shoe span:nth-child(2) { transform: translate(-4px, 4px); }
.bj-shoe span:nth-child(3) { transform: translate(-8px, 8px); }
.bj-hand { display: flex; flex-direction: column; align-items: center; gap: 14px; min-height: 196px; justify-content: center; }
.bj-cards { display: flex; justify-content: center; min-height: 150px; }
.bj-total { min-width: 56px; padding: 6px 14px; border-radius: 10px; text-align: center; font-weight: 800; background: var(--panel-3); animation: chipIn .35s var(--spring); }
.bj-total.bust { background: var(--red); color: #fff; }
.bj-total.bj { background: var(--gold); color: #2a1a00; }
.bj-felt { text-align: center; color: rgba(255, 255, 255, .28); }
.bj-felt strong { display: block; font-size: 15px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.bj-felt span { font-size: 13px; }
.pcard { width: 104px; height: 148px; perspective: 800px; animation: dealIn .5s var(--ease) backwards; }
.pcard + .pcard { margin-left: -46px; }
@keyframes dealIn { from { transform: translate(var(--fx), var(--fy)) rotate(20deg) scale(.7); opacity: 0; } }
.pcard.leave { animation: cardOut .26s ease forwards; }
@keyframes cardOut { to { transform: translateY(-30px) scale(.9); opacity: 0; } }
.pcard-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .5s var(--ease); }
.pcard.down .pcard-inner { transform: rotateY(180deg); }
.pcard-front, .pcard-back { position: absolute; inset: 0; border-radius: 11px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .7); }
.pcard-front { background: linear-gradient(180deg, #fff, #eef0f8); color: #1b1f3b; display: grid; place-items: center; }
.pcard.red .pcard-front { color: #e2244a; }
.pc-corner { position: absolute; top: 8px; left: 9px; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.pc-corner b { font-size: 24px; font-weight: 900; }
.pc-corner.br { top: auto; left: auto; bottom: 8px; right: 9px; transform: rotate(180deg); }
.pc-suit { width: 16px; height: 16px; fill: currentColor; margin-top: 3px; }
.pc-big { width: 46px; height: 46px; fill: currentColor; }
.pcard-back { transform: rotateY(180deg); display: grid; place-items: center; background:
  repeating-linear-gradient(45deg, rgba(255, 255, 255, .07) 0 6px, transparent 6px 12px),
  linear-gradient(135deg, #4f6dff, #7b3dff); border: 3px solid #fff; }
.pcard-back .logo-mark { width: 54px; height: 36px; }
.pcard-back .logo-mark path { fill: #fff !important; }
.bj-result { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.7); opacity: 0; padding: 14px 28px; border-radius: 14px; font-size: 22px; font-weight: 800; white-space: nowrap; pointer-events: none; background: rgba(13, 16, 40, .9); backdrop-filter: blur(8px); transition: opacity .25s, transform .4s var(--spring); }
.bj-result b { display: block; font-size: 15px; text-align: center; opacity: .85; }
.bj-result.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.bj-result.win { border: 2px solid var(--green); color: var(--green); }
.bj-result.lose { border: 2px solid var(--red); color: var(--red); }
.bj-result.push { border: 2px solid var(--muted); color: #dfe2ff; }
.bj-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bj-actions .btn { height: 40px; }

/* ---- Crash ---- */
.crash-stage { position: relative; flex: 1; min-height: 420px; border-radius: 16px; background: #0b0e24; border: 1px solid var(--line); overflow: hidden; }
.crash-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crash-readout { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.crash-readout strong { font-size: clamp(54px, 7vw, 92px); font-weight: 900; letter-spacing: -.03em; line-height: 1; transition: color .2s; }
.crash-readout span { margin-top: 8px; font-weight: 600; color: var(--muted); }
.crash-stage[data-phase=crashed] strong { color: var(--red); animation: crashShake .4s ease; }
.crash-stage.cashed strong { color: var(--green); }
.crash-stage[data-phase=idle] strong { color: rgba(255, 255, 255, .25); text-shadow: none; }
@keyframes crashShake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

/* ---- Limbo ---- */
.limbo-stage { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; }
.limbo-rings { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: 1px; height: 1px; }
.limbo-rings i { position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 1px solid rgba(34, 211, 238, .15); transform: translate(-50%, -50%); animation: ring 4s ease-out infinite; }
.limbo-rings i:nth-child(1) { width: 200px; height: 200px; }
.limbo-rings i:nth-child(2) { width: 320px; height: 320px; animation-delay: .6s; }
.limbo-rings i:nth-child(3) { width: 440px; height: 440px; animation-delay: 1.2s; }
@keyframes ring { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.8); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15); } }
.limbo-num { position: relative; flex: 1; display: grid; place-items: center; min-height: 320px; }
.limbo-num strong { font-size: clamp(64px, 9vw, 120px); font-weight: 900; letter-spacing: -.03em; transition: color .25s, transform .4s var(--spring); }
.limbo-num.rolling strong { color: #fff; }
.limbo-num.win strong { color: var(--green); transform: scale(1.04); }
.limbo-num.lose strong { color: var(--red); }
.limbo-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px; border-radius: 18px; background: #161a3a; border: 1px solid var(--line); }

/* ============ Wallet ============ */
.wallet-page { max-width: 1180px; margin: 0 auto; }
.wallet-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.wallet-head h1 { margin: 0; font-size: 34px; letter-spacing: -.02em; }
.wallet-head p { margin: 4px 0 0; color: var(--muted); }
.wallet-bal { text-align: right; padding: 14px 20px; border-radius: 16px; background: linear-gradient(135deg, rgba(59, 130, 255, .16), rgba(139, 92, 246, .1)); border: 1px solid rgba(91, 120, 255, .3); }
.wallet-bal span { display: block; font-size: 13px; color: var(--muted); }
.wallet-bal strong { font-size: 28px; font-weight: 800; }
.wallet-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.panel { border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); }
.wallet-panel { padding: 8px; }
.wtabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: #0c0f26; }
.wtab { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border-radius: 11px; font-weight: 700; color: var(--muted); transition: color .25s; }
.wtab.on { color: #fff; }
.wtab-ink { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 11px; background: var(--panel-3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); animation: inkIn .45s var(--ease); }
.wtab-ink.withdraw { transform: translateX(100%); animation-name: inkInR; }
@keyframes inkIn { from { transform: translateX(100%); } }
@keyframes inkInR { from { transform: translateX(0); } }
.wallet-body { display: flex; flex-direction: column; gap: 22px; padding: 22px 18px 18px; }
.wallet-body > * { animation: rise .5s var(--ease) backwards; }
.wallet-body > *:nth-child(2) { animation-delay: .06s; }
.wallet-body > *:nth-child(3) { animation-delay: .12s; }
.wallet-body > *:nth-child(4) { animation-delay: .18s; }
.methods { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.methods.one { grid-template-columns: 1fr; }
.method { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; text-align: left; background: #0c0f26; border: 1px solid var(--line-2); transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.method.on { border-color: var(--interac); }
.method.disabled { opacity: .45; }
.method-logo { width: 44px; height: 44px; flex: none; border-radius: 11px; display: grid; place-items: center; overflow: hidden; }
.method-logo.interac img { width: 100%; height: 100%; display: block; }
.method-logo.crypto { background: rgba(247, 147, 26, .15); color: #f7931a; }
.method-logo.bank { background: rgba(59, 130, 255, .15); color: var(--blue); }
.method-copy { display: flex; flex-direction: column; min-width: 0; }
.method-copy strong { font-size: 15px; }
.method-copy span { font-size: 12px; color: var(--muted); }
.method-check { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--interac); color: #1a1300; animation: popIn2 .4s var(--spring); }
.method-check .ic { width: 14px; height: 14px; stroke-width: 3; }
@keyframes popIn2 { from { transform: scale(0); } }
.amount-input { display: flex; align-items: center; height: 70px; padding: 0 20px; border-radius: 16px; background: #0c0f26; border: 1px solid var(--line-2); transition: border-color .2s, box-shadow .2s; }
.amount-input:focus-within { border-color: rgba(59, 130, 255, .6); box-shadow: 0 0 0 4px rgba(59, 130, 255, .12); }
.amount-input .prefix { font-size: 22px; font-weight: 700; color: var(--muted); }
.amount-input input { flex: 1; min-width: 0; padding: 0 10px; background: none; border: 0; font-size: 30px; font-weight: 800; }
.amount-input .suffix { font-weight: 700; color: var(--dim); }
.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; margin-top: 10px; }
.chip-btn { position: relative; height: 42px; border-radius: 11px; font-weight: 700; color: #c9cdee; background: var(--panel-2); border: 1px solid var(--line); transition: all .2s var(--ease); }
.chip-btn:hover { background: var(--panel-3); color: #fff; transform: translateY(-2px); }
.chip-btn.on { color: #fff; border-color: var(--blue); background: rgba(59, 130, 255, .15); }
.summary { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 14px; background: rgba(12, 15, 38, .6); border: 1px solid var(--line); font-size: 15px; }
.summary > div { display: flex; justify-content: space-between; color: var(--muted); }
.summary > div span:last-child { color: var(--text); font-weight: 600; }
.summary .total { padding-top: 10px; border-top: 1px solid var(--line); }
.summary .total span { color: var(--text) !important; font-weight: 800 !important; font-size: 17px; }
.pos { color: var(--green) !important; }
.fine { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13px; color: var(--dim); }
.fine .ic { width: 15px; height: 15px; margin-top: 1px; }
.txn-panel { padding: 18px; }
.panel-head h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 18px; }
.panel-head .ic { color: var(--blue); }
.txn { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); animation: rise .4s var(--ease); }
.txn-ic { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.txn-ic .ic { width: 18px; height: 18px; }
.txn-main { grid-row: span 2; display: flex; flex-direction: column; min-width: 0; }
.txn-main strong { font-size: 15px; }
.txn-main span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-amt { font-weight: 800; text-align: right; }
.txn-amt.deposit { color: var(--green); }
.txn-status { font-size: 11px; color: var(--dim); text-align: right; }

.wd-progress { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; background: #0c0f26; border: 1px solid var(--line-2); animation: rise .4s var(--ease); }
.wd-step { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--dim); font-weight: 500; transition: color .3s; }
.step-dot { position: relative; width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); transition: all .3s var(--ease); }
.active > .step-dot { border-color: rgba(59, 130, 255, .25); border-top-color: var(--blue); animation: spin .8s linear infinite; }
.done > .step-dot { border-color: var(--green); background: var(--green); }
.done > .step-dot::after { content: ''; position: absolute; left: 6px; top: 2.5px; width: 5px; height: 10px; border: solid #04210f; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); animation: popIn2 .3s var(--spring); }
.wd-step.active, .wd-step.done { color: var(--text); }

/* ============ Interac flow ============ */
.interac-page { display: grid; place-items: center; min-height: calc(100vh - var(--topbar) - 140px); }
.ix-card { position: relative; width: min(100%, 560px); padding: 34px 34px 22px; border-radius: 24px; overflow: hidden; background: linear-gradient(180deg, #191d40, #13173a); border: 1px solid var(--line-2); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(253, 185, 19, .06); }
.ix-card::before { content: ''; position: absolute; left: 50%; top: -180px; width: 520px; height: 320px; transform: translateX(-50%); background: radial-gradient(ellipse, rgba(253, 185, 19, .06), transparent 70%); pointer-events: none; transition: background .6s; }
.ix-card.done::before { background: radial-gradient(ellipse, rgba(31, 214, 122, .07), transparent 70%); }
.ix-progress { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: rgba(255, 255, 255, .05); }
.ix-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #fdb913, #ffd86b); transition: width 1s linear; }
.ix-card.done .ix-progress span { background: var(--green); transition: width .4s, background .4s; }
.ix-top { position: relative; display: flex; align-items: center; gap: 14px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.ix-logo { width: 54px; height: 54px; border-radius: 12px; }
.ix-title { display: flex; flex-direction: column; }
.ix-title strong { font-size: 18px; }
.ix-title span { font-size: 13px; color: var(--muted); }
.ix-amount { margin-left: auto; text-align: right; }
.ix-amount span { display: block; font-size: 12px; color: var(--muted); }
.ix-amount strong { font-size: 24px; font-weight: 800; }

.ix-visual { display: flex; flex-direction: column; align-items: center; gap: 20px; margin: 30px 0 14px; }
.ix-loader { position: relative; width: 136px; height: 136px; display: grid; place-items: center; }
.ix-loader::before { content: ''; position: absolute; inset: -30px; border-radius: 50%; background: radial-gradient(circle, rgba(253, 185, 19, .06), transparent 65%); transition: background .6s; }
.ix-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ix-track { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 6; }
.ix-arc { fill: none; stroke: var(--interac); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 80 260; transform-box: fill-box; transform-origin: center; animation: spin 1.1s linear infinite; transition: opacity .3s; }
.ix-card[data-step="1"] .ix-arc { animation-duration: .85s; stroke-dasharray: 120 220; }
.ix-card[data-step="2"] .ix-arc { animation-duration: .7s; stroke-dasharray: 170 170; }
.ix-full { fill: none; stroke: var(--green); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 340; stroke-dashoffset: 340; }
.ix-center { position: relative; width: 70px; height: 70px; border-radius: 16px; animation: logoPulse 2s ease-in-out infinite; transition: transform .45s var(--ease), opacity .3s; }
@keyframes logoPulse { 50% { transform: scale(1.05); } }
.ix-check { position: absolute; width: 74px; height: 74px; }
.ix-check path { fill: none; stroke: var(--green); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 64; stroke-dashoffset: 64; }
.ix-card.done .ix-loader::before { background: radial-gradient(circle, rgba(31, 214, 122, .07), transparent 65%); }
.ix-card.done .ix-arc { opacity: 0; }
.ix-card.done .ix-full { animation: draw .7s var(--ease) forwards; }
.ix-card.done .ix-center { animation: none; transform: scale(.4); opacity: 0; }
.ix-card.done .ix-check path { animation: draw .45s var(--ease) .45s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.ix-route { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-radius: 999px; background: #0c0f26; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); transition: border-color .4s, color .4s; }
.ix-route > span { display: flex; align-items: center; gap: 7px; }
.ix-route .ic { width: 16px; height: 16px; color: var(--interac); }
.ix-route .logo-mark { width: 22px; height: 14px; filter: none; }
.ix-dots { gap: 5px !important; }
.ix-dots b { width: 5px; height: 5px; border-radius: 50%; background: var(--interac); animation: dotPulse 1.2s ease-in-out infinite; }
.ix-dots b:nth-child(2) { animation-delay: .2s; }
.ix-dots b:nth-child(3) { animation-delay: .4s; }
@keyframes dotPulse { 0%, 100% { opacity: .2; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }
.ix-card.done .ix-route { border-color: rgba(31, 214, 122, .35); color: var(--text); }
.ix-card.done .ix-dots b { animation: none; background: var(--green); opacity: 1; }
.ix-burst { position: absolute; left: 50%; top: 50%; }
.ix-burst i { position: absolute; width: 8px; height: 8px; border-radius: 2px; background: var(--green); opacity: 0; }
.ix-burst i:nth-child(3n) { background: var(--interac); }
.ix-burst i:nth-child(3n+1) { background: #6aa1ff; }
.ix-card.done .ix-burst i { animation: burst .9s var(--ease) forwards; animation-delay: calc(.55s + var(--d)); }
@keyframes burst { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-120px) scale(.4) rotate(180deg); } }

.ix-status { text-align: center; }
.ix-status h2 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.ix-status h2.swap { animation: swapIn .45s var(--ease); }
@keyframes swapIn { from { opacity: 0; transform: translateY(8px); } }
.ix-status p { margin: 6px 0 0; color: var(--muted); }
.ix-steps { list-style: none; margin: 22px 0 0; padding: 14px 18px; border-radius: 16px; background: #0c0f26; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; transition: opacity .4s, max-height .5s var(--ease); }
.ix-steps li { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--dim); font-weight: 500; transition: color .3s; }
.ix-steps li.active, .ix-steps li.done { color: var(--text); }
.ix-steps li.active .step-dot { border-color: rgba(253, 185, 19, .2); border-top-color: var(--interac); }
.ix-done { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .5s var(--ease), opacity .4s .2s; }
.ix-done-inner { overflow: hidden; min-height: 0; display: flex; flex-direction: column; gap: 16px; }
.ix-card.done .ix-done { grid-template-rows: 1fr; opacity: 1; }
.ix-card.done .ix-done-inner { padding-top: 20px; }
.ix-newbal { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-radius: 14px; background: rgba(31, 214, 122, .08); border: 1px solid rgba(31, 214, 122, .3); }
.ix-newbal span { color: var(--muted); }
.ix-newbal strong { font-size: 24px; color: var(--green); }
.ix-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ix-foot { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; font-size: 12px; color: var(--dim); }
.ix-foot .ic { width: 14px; height: 14px; }
.ix-foot .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); }

/* ============ Footer ============ */
.footer { margin-top: 20px; padding: 40px 32px 30px; border-top: 1px solid var(--line); background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .25)); }
.f-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; max-width: 1640px; margin: 0 auto; }
.f-brand p { max-width: 360px; color: var(--muted); line-height: 1.6; }
.f-col { display: flex; flex-direction: column; gap: 10px; }
.f-col h4 { margin: 0 0 4px; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.f-col a { color: #b8bde4; transition: color .2s, transform .2s; }
.f-col a:hover { color: #fff; transform: translateX(3px); }
.f-bottom { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; max-width: 1640px; margin: 30px auto 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }
.f-badge { padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line-2); font-weight: 700; color: var(--muted); }

/* ============ Toasts ============ */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.toast { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(27, 32, 69, .96); backdrop-filter: blur(14px); border: 1px solid var(--line-2); box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .7); cursor: pointer; animation: toastIn .45s var(--spring); }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { transform: translateX(110%); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(110%); opacity: 0; } }
.toast-ic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: rgba(59, 130, 255, .15); color: var(--blue); }
.toast-ic .ic { width: 18px; height: 18px; }
.toast-success .toast-ic { background: rgba(31, 214, 122, .15); color: var(--green); }
.toast-error .toast-ic { background: rgba(255, 72, 103, .15); color: var(--red); }
.toast-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.toast-text strong { font-size: 15px; }
.toast-text span { font-size: 13px; color: var(--muted); }
.toast-action { padding: 8px 12px; border-radius: 9px; font-weight: 700; font-size: 13px; background: var(--blue); color: #fff; }
.toast-timer { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: currentColor; opacity: .25; transform-origin: left; animation: timer 3.6s linear forwards; }
.toast-success .toast-timer { color: var(--green); }
.toast-error .toast-timer { color: var(--red); }
@keyframes timer { to { transform: scaleX(0); } }

/* ============ Responsive ============ */
@media (max-width: 1500px) {
  .row-track { grid-auto-columns: calc((100% - 5 * 16px) / 6); }
  .boost { display: none; }
}
@media (max-width: 1280px) {
  .row-track { grid-auto-columns: calc((100% - 4 * 16px) / 5); }
  .game-shell { grid-template-columns: 300px 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); width: 288px !important; box-shadow: 30px 0 60px rgba(0, 0, 0, .5); }
  .app.drawer-open .sidebar { transform: none; }
  .app.collapsed .seg, .app.collapsed .raffle, .app.collapsed .races, .app.collapsed .lbl, .app.collapsed .pill-new, .app.collapsed .sb-chev { display: revert; }
  .app.collapsed .raffle, .app.collapsed .seg, .app.collapsed .sb-chev { display: flex; }
  .app.collapsed .races { display: grid; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(4, 6, 18, .6); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .app.drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .mobile-only { display: grid !important; }
  .topbar { padding: 0 16px; gap: 10px; }
  .view { padding: 22px 20px 40px; }
  .banners { grid-template-columns: repeat(3, 85%); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-right: -20px; padding-right: 20px; }
  .banners::-webkit-scrollbar { display: none; }
  .banner { scroll-snap-align: start; }
  .row-track { grid-auto-columns: calc((100% - 3 * 14px) / 4); gap: 14px; }
  .game-shell { grid-template-columns: 1fr; }
  .game-controls { border-right: 0; border-top: 1px solid var(--line); order: 2; }
  .game-stage { min-height: 460px; }
  .wallet-grid { grid-template-columns: 1fr; }
  .f-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  :root { --topbar: 64px; }
  .logo-word { font-size: 22px; }
  .logo-mark { width: 36px; height: 23px; }
  .tb-center { margin: 0 0 0 auto; }
  .balance { height: 40px; padding: 0 10px 0 12px; font-size: 14px; gap: 6px; }
  .btn-wallet { height: 40px; padding: 0 12px; margin-left: -8px; }
  .btn-wallet span, .tb-right > [data-search], .tb-group .pop-wrap:first-child { display: none; }
  .tb-group { height: 40px; }
  .topbar .logo-word { display: none; }
  .view { padding: 16px 16px 32px; }
  .banners { margin-right: -16px; padding-right: 16px; grid-template-columns: repeat(3, 88%); gap: 12px; }
  .banner { min-height: 180px; padding: 22px; }
  .toolbar { flex-direction: column; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tab { padding: 0 14px; }
  .row-track { grid-auto-columns: calc((100% - 2 * 12px) / 2.6); gap: 12px; }
  .row-arrows { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; gap: 10px; }
  .stat-ic { width: 38px; height: 38px; }
  .stat strong { font-size: 17px; }
  .cta-strip { flex-wrap: wrap; }
  .cta-strip .btn { width: 100%; }
  .game-stage { padding: 14px; min-height: 400px; }
  .game-controls { padding: 16px; }
  .game-meta { flex-wrap: wrap; }
  .game-meta-badges { justify-content: flex-start; }
  .dice-stats { grid-template-columns: 1fr 1fr; padding: 12px; }
  .dice-stats .dstat:first-child { grid-column: span 2; }
  .dice-board { padding: 22px 14px; }
  .pcard { width: 78px; height: 112px; }
  .pcard + .pcard { margin-left: -34px; }
  .pc-corner b { font-size: 18px; }
  .pc-big { width: 32px; height: 32px; }
  .bj-cards { min-height: 112px; }
  .bj-hand { min-height: 150px; }
  .mines-grid { gap: 8px; }
  .mines-grid[data-cols="7"], .mines-grid[data-cols="8"] { gap: 5px; }
  .mines-grid[data-cols="8"] .tile-mult { display: none; }
  .methods { grid-template-columns: 1fr; }
  .wallet-head { flex-direction: column; align-items: stretch; }
  .wallet-bal { text-align: left; }
  .ix-card { padding: 28px 18px 18px; }
  .ix-top { flex-wrap: wrap; }
  .ix-actions { grid-template-columns: 1fr; }
  .f-top { grid-template-columns: 1fr; }
  .footer { padding: 30px 16px; }
  .plinko-hist span { width: 48px; height: 32px; font-size: 11px; }
  .pop, .pop-bal { position: fixed; top: calc(var(--topbar) + 8px); left: 16px; right: 16px; width: auto; min-width: 0; transform-origin: top center; }
}

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

/* ============ Reduced motion / streamer (from Settings) ============ */
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
html.streamer [data-balance], html.streamer .delta, html.streamer [data-wbal], html.streamer .field-sub[data-bal] { filter: blur(7px); transition: filter .2s; }
html.streamer .balance:hover [data-balance], html.streamer .wallet-bal:hover [data-wbal] { filter: none; }

/* ============ Manual / Auto ============ */
.mode-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: #0c0f26; border: 1px solid var(--line-2); }
.mode-tabs button { position: relative; z-index: 1; height: 34px; border-radius: 9px; font-weight: 700; color: var(--muted); transition: color .25s; }
.mode-tabs button.on { color: #fff; }
.mode-ink { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px; background: var(--panel-3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); transition: transform .35s var(--ease); }
.mode-tabs.auto .mode-ink { transform: translateX(100%); }
.mode-tabs.locked { opacity: .6; pointer-events: none; }
.auto-panel { display: flex; flex-direction: column; gap: 12px; animation: rise .35s var(--ease); }
.auto-hint { display: flex; gap: 8px; margin: 0; padding: 8px 10px; line-height: 1.35; border-radius: 10px; font-size: 13px; color: var(--muted); background: rgba(59, 130, 255, .08); border: 1px solid rgba(59, 130, 255, .2); }
.auto-hint .ic { width: 16px; height: 16px; color: var(--blue); flex: none; margin-top: 1px; }
.adj { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 8px; }
.adj .seg-ctl button { height: 34px; font-size: 12.5px; white-space: nowrap; }
.adj .input-group { height: 42px; }
.adj .input-group input:disabled { opacity: .35; }
.inf { transition: opacity .2s; font-size: 18px; }
.auto-live { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #0c0f26; border: 1px solid var(--line-2); animation: rise .3s var(--ease); }
.auto-live span { display: block; font-size: 12px; color: var(--muted); }
.auto-live strong { font-size: 15px; }
.auto-live strong.pos { color: var(--green); }
.auto-live strong.neg { color: var(--red); }
.btn-stop { background: linear-gradient(180deg, #f2516c, #d9304d) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18) !important; }
.auto-select-hint { text-align: center; margin: 4px 0 12px; font-weight: 600; color: var(--muted); animation: rise .3s var(--ease); }

/* ============ Provably fair ============ */
.fair { position: absolute; top: 14px; right: 14px; z-index: 15; }
.fair-btn { position: relative; display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--muted); background: rgba(21, 25, 55, .85); border: 1px solid var(--line-2); backdrop-filter: blur(6px); transition: color .2s, border-color .2s; }
.fair-btn .ic { width: 14px; height: 14px; }
.fair-btn:hover, .fair-btn[aria-expanded="true"] { color: #fff; border-color: rgba(255, 255, 255, .2); }
.fair-dot { position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px var(--bg); }
.fair-pop { position: absolute; top: calc(100% + 8px); right: 0; width: min(340px, calc(100vw - 48px)); display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px; background: rgba(24, 28, 62, .98); border: 1px solid var(--line-2); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .75); font-size: 13px; animation: fairIn .2s var(--ease); }
@keyframes fairIn { from { opacity: 0; transform: translateY(-6px); } }
.fair-pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.fair-pop-head strong { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.fair-pop-head strong .ic { width: 15px; height: 15px; color: var(--green); }
.fair-x { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); }
.fair-x:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.fair-x .ic { width: 14px; height: 14px; }
.fair-note { margin: 0 0 6px; color: var(--muted); line-height: 1.45; }
.fair-pop label { margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.fair-pop code { display: block; padding: 7px 9px; border-radius: 8px; background: #0c0f26; border: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: #c9cdee; word-break: break-all; }
.fair-reveal { display: flex; flex-direction: column; gap: 6px; }
.fair-readable { margin: 4px 0; color: var(--muted); line-height: 1.4; }
.fair-result { color: var(--muted); }
.fair-result.ok, .fair-result.bad { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.fair-result.ok { color: var(--green); }
.fair-result.bad { color: var(--red); }
.fair-result .ic { width: 15px; height: 15px; flex: none; }

/* Selection for auto patterns */
.tile.picked, .t-tile.picked { background: linear-gradient(180deg, #4166e8, #3150d8) !important; box-shadow: inset 0 -6px 0 #2238a8 !important; }
.mines-grid.selecting .tile:not(.revealed), .tower.selecting .t-tile:not(.revealed) { cursor: pointer; }
/* A picked tile that turns out to be a mine/bomb shows red, not the blue selection colour. */
.tile.picked.mine, .t-tile.picked.bomb { background: radial-gradient(circle, rgba(255, 72, 103, .28), #1f0f22 70%) !important; box-shadow: inset 0 0 0 2px var(--red) !important; }

/* ============ Mines tile multiplier ============ */
.tile-mult { position: absolute; left: 50%; bottom: 8%; z-index: 2; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px; font-size: clamp(11px, 1.2vw, 15px); font-weight: 800; white-space: nowrap; color: #fff; background: linear-gradient(180deg, #5aa2ff, #3a7be0); border: 2px solid rgba(160, 205, 255, .5); animation: multPill 1.3s var(--spring) forwards; pointer-events: none; }
@keyframes multPill { 0% { opacity: 0; transform: translate(-50%, 8px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -6px) scale(.95); } }
.tile.revealed.gem:not(.dim) { box-shadow: inset 0 0 0 2px rgba(110, 170, 255, .45) !important; background: #18204a; }


/* ============ Tower ============ */
.tower-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tower { display: flex; flex-direction: column-reverse; gap: 8px; width: min(100%, 520px); padding: 16px; border-radius: 18px; background: linear-gradient(180deg, rgba(255, 84, 112, .06), rgba(12, 15, 38, .6)); border: 1px solid var(--line); }
.t-row { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 8px; padding: 4px; border-radius: 12px; transition: background .3s, box-shadow .3s; animation: rise .45s var(--ease) backwards; animation-delay: var(--d); }
.t-row.current { background: rgba(255, 84, 112, .07); box-shadow: 0 0 0 1px rgba(255, 84, 112, .35); }
.t-row.cleared { background: rgba(255, 194, 61, .05); }
.t-tile { position: relative; height: 46px; border-radius: 10px; background: linear-gradient(180deg, #2c3370, #232957); box-shadow: inset 0 -4px 0 #191e44; transition: transform .2s var(--ease), background .2s; }
.t-tile:disabled:not(.revealed):not(.picked) { opacity: .55; cursor: default; }
.t-row.current .t-tile:not(:disabled) { opacity: 1; }
.t-row.current .t-tile:not(:disabled):hover { transform: translateY(-2px); background: linear-gradient(180deg, #e9566f, #c92d4f); box-shadow: inset 0 -4px 0 #8a1238; }
.t-mult { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .35); transition: opacity .2s; }
.t-row.current .t-mult { color: #fff; }
.t-face { position: absolute; inset: 0; display: grid; place-items: center; }
.t-face svg { height: 78%; }
.t-tile.revealed { background: #0d1029; box-shadow: inset 0 0 0 1px var(--line); animation: reveal .4s var(--spring); }
.t-tile.revealed .t-mult { opacity: 0; }
.t-tile.revealed.safe:not(.dim) { background: #221d33; box-shadow: inset 0 0 0 2px rgba(255, 194, 61, .5); }
.t-tile.dim { opacity: .38; }
.t-tile.boom { background: radial-gradient(circle, rgba(255, 72, 103, .28), #1f0f22 70%); box-shadow: inset 0 0 0 2px var(--red); animation: boom .55s var(--ease); }
.tower.busted { animation: shake .45s ease; }

/* ============ Keno ============ */
.keno-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.keno-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; width: min(100%, 720px); margin: 0 auto; }
.k-tile { position: relative; aspect-ratio: 1; border-radius: 12px; font-weight: 800; font-size: clamp(14px, 1.4vw, 19px); color: #dfe3ff; background: linear-gradient(180deg, #2c3370, #232957); box-shadow: inset 0 -5px 0 #191e44; transition: transform .2s var(--ease), background .2s, box-shadow .2s, color .2s; }
.k-tile:hover:not(:disabled) { transform: translateY(-3px); }
.k-tile:hover:not(:disabled):not(.picked):not(.drawn) { background: linear-gradient(180deg, #3a439a, #2c3370); }
.k-tile.picked:hover:not(:disabled):not(.drawn) { background: linear-gradient(180deg, #9d72f5, #8445f0); }
.k-tile.picked { color: #fff; background: linear-gradient(180deg, #9061f0, #7c3aed); box-shadow: inset 0 -5px 0 #5b21b6; }
.k-tile.drawn.miss { color: var(--red); background: #13163a; box-shadow: inset 0 0 0 1px rgba(255, 72, 103, .25); animation: kDraw .35s var(--spring); }
.k-tile.drawn.miss.picked { color: #fff; }
.k-tile.drawn.hit { background: #15283a; box-shadow: inset 0 0 0 2px var(--green); animation: kDraw .4s var(--spring); }
.k-tile.drawn.hit .k-num { opacity: 0; }
.k-face { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.k-gem { width: 62%; }
.k-num { transition: opacity .2s; }
@keyframes kDraw { 0% { transform: scale(.7) rotate(-6deg); } 100% { transform: none; } }
.keno-grid.shuffle .k-tile.picked { animation: rise .4s var(--spring) backwards; animation-delay: var(--d); }
.keno-pay { width: min(100%, 720px); margin: 0 auto; }
.kp-table { display: flex; border-radius: 12px; overflow: hidden; background: #1c2146; border: 1px solid var(--line); }
.kp-col { flex: 1; min-width: 0; display: flex; flex-direction: column; transition: background .3s; }
.kp-col + .kp-col { border-left: 1px solid rgba(0, 0, 0, .28); }
.kp-mult, .kp-hits { display: flex; align-items: center; justify-content: center; gap: 6px; height: 46px; font-size: clamp(12px, 1.15vw, 17px); font-weight: 500; white-space: nowrap; }
.kp-mult { color: #e3e6ff; border-bottom: 1px solid rgba(0, 0, 0, .28); }
.kp-col:not(.pays) .kp-mult { color: var(--muted); }
.kp-hits { color: #e3e6ff; }
.kp-gem { width: 18px; height: 18px; flex: none; }
.kp-col.hit { background: rgba(31, 214, 122, .16); }
.kp-col.hit .kp-mult { color: var(--green); font-weight: 700; }
.keno-empty { padding: 18px; text-align: center; border-radius: 12px; color: var(--muted); background: #13163a; border: 1px dashed var(--line-2); }

/* ============ Avatar ============ */
.avatar-badge { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 10px; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--av), color-mix(in srgb, var(--av) 55%, #120a2e)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); letter-spacing: .02em; }
.avatar-badge.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.avatar-badge.md { width: 40px; height: 40px; border-radius: 12px; font-size: 14px; }
.avatar-badge.xl { width: 76px; height: 76px; border-radius: 22px; font-size: 26px; }
.pop-menu .pop-user { padding: 10px 10px 14px; margin-bottom: 6px; border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--line); }
.pop-menu .pop-user strong { color: #fff; }

/* ============ Settings ============ */
.settings-grid { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.set-nav { position: sticky; top: calc(var(--topbar) + 20px); display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); }
.set-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 11px; font-weight: 600; color: #c9cdee; transition: background .2s, color .2s; }
.set-nav a .ic { width: 18px; height: 18px; color: var(--muted); }
.set-nav a:hover { background: rgba(255, 255, 255, .04); color: #fff; }
.set-nav a.on { background: linear-gradient(90deg, rgba(59, 130, 255, .18), rgba(59, 130, 255, .04)); color: #fff; }
.set-nav a.on .ic { color: var(--blue); }
.set-panel { display: flex; flex-direction: column; gap: 20px; }
.set-section { padding: 24px; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); animation: rise .45s var(--ease) backwards; }
.set-section + .set-section { animation-delay: .08s; }
.set-section h2 { margin: 0; font-size: 20px; }
.set-sub { margin: 4px 0 20px; color: var(--muted); }
.profile-card { display: flex; align-items: center; gap: 18px; padding: 18px; margin-bottom: 22px; border-radius: 16px; background: linear-gradient(120deg, rgba(59, 130, 255, .1), rgba(139, 92, 246, .06)); border: 1px solid var(--line-2); }
.profile-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.profile-meta strong { font-size: 22px; }
.profile-meta > span:not(.tier-pill) { color: var(--muted); font-size: 14px; }
.tier-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 800; color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 40%, transparent); }
.tier-pill .ic { width: 14px; height: 14px; }
.set-form { display: flex; flex-direction: column; gap: 18px; max-width: 520px; }
.set-form .input-group .prefix .ic { width: 16px; height: 16px; }
.field-error { margin-top: 6px; font-size: 13px; color: var(--red); min-height: 0; }
.field.invalid .input-group { border-color: rgba(255, 72, 103, .6); box-shadow: 0 0 0 4px rgba(255, 72, 103, .1); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 36px; height: 36px; border-radius: 11px; background: var(--sw); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); transition: transform .25s var(--spring), box-shadow .2s; }
.swatch:hover { transform: scale(1.1); }
.swatch.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--sw); transform: scale(1.05); }
.set-actions { display: flex; justify-content: flex-start; }
.set-list { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; padding-top: 0; }
.set-copy { display: flex; flex-direction: column; gap: 2px; }
.set-copy strong { font-size: 16px; }
.set-copy span { font-size: 14px; color: var(--muted); }
.switch { position: relative; flex: none; width: 52px; height: 30px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line-2); transition: background .3s, border-color .3s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); transition: transform .35s var(--spring); }
.switch.on { background: linear-gradient(135deg, #4f8bff, #2563eb); border-color: transparent; }
.switch.on span { transform: translateX(22px); }
.vip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.vip-bar, .limit-bar { height: 10px; border-radius: 10px; background: #0c0f26; overflow: hidden; border: 1px solid var(--line); }
.vip-bar span, .limit-bar span { display: block; height: 100%; width: var(--p); border-radius: 10px; background: linear-gradient(90deg, color-mix(in srgb, var(--tc, var(--blue)) 70%, #fff), var(--tc, var(--blue))); animation: grow 1s var(--ease) backwards .2s; }
@keyframes grow { from { width: 0; } }
.vip-tiers { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--dim); }
.vip-tiers .reached { color: var(--tc); }
.limit-usage { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.limit-bar span { --tc: var(--green); }
.reminder { max-width: 420px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; background: #0c0f26; border: 1px solid var(--line); animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i) * 40ms); }
.stat-tile .stat-ic { width: 38px; height: 38px; border-radius: 11px; margin-bottom: 6px; }
.stat-tile .stat-ic .ic { width: 18px; height: 18px; }
.stat-tile > span:not(.stat-ic) { font-size: 13px; color: var(--muted); }
.stat-tile strong { font-size: 20px; }
.limit-note { display: flex; gap: 8px; margin: -6px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; color: #ffc9d3; background: rgba(255, 72, 103, .08); border: 1px solid rgba(255, 72, 103, .3); }
.limit-note .ic { width: 16px; height: 16px; flex: none; color: var(--red); }
.limit-note a { color: #fff; text-decoration: underline; }

@media (max-width: 1024px) {
  .settings-grid { grid-template-columns: 1fr; }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .set-nav a { flex: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .keno-grid { gap: 6px; }
  .k-tile { border-radius: 9px; }
  .kp-mult, .kp-hits { height: 36px; gap: 3px; }
  .kp-gem { width: 13px; height: 13px; }
  .t-tile { height: 38px; }
  .set-section { padding: 18px; }
  .result-pop { min-width: 230px; }
  .result-pop strong { font-size: 40px; padding: 6px 20px; }
}

/* ============ Wallet: methods, crypto, contact ============ */
.methods.two { grid-template-columns: 1fr 1fr; }
.method { cursor: pointer; }
.method:not(.on):not(.disabled):hover { border-color: rgba(255, 255, 255, .2); transform: translateY(-2px); }
.method .method-check { display: none; }
.method.on .method-check { display: grid; }
.method.on[data-method="crypto"] { border-color: #f7931a; }
.method.on[data-method="crypto"] .method-check { background: #f7931a; }
.method-body { display: flex; flex-direction: column; gap: 22px; }
.swap-in { animation: rise .45s var(--ease); }
.summary .fee { color: #ffb3c0 !important; }
.spinner.sm.dark { border-color: rgba(0, 0, 0, .15); border-top-color: #1a1300; }
.back-link { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 14px; font-weight: 600; color: var(--muted); transition: color .2s; }
.back-link .ic { width: 16px; height: 16px; }
.back-link:hover { color: #fff; }
.wd-stage { display: flex; flex-direction: column; gap: 20px; }

.coin-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.coin-opt { position: relative; display: flex; align-items: center; gap: 9px; padding: 10px; border-radius: 12px; text-align: left; background: #0c0f26; border: 1px solid var(--line-2); transition: border-color .2s, transform .2s var(--ease), background .2s; }
.coin-opt:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(255, 255, 255, .2); }
.coin-opt.on { border-color: var(--blue); background: rgba(59, 130, 255, .08); }
.coin-opt:disabled { opacity: .55; }
.coin-opt > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.coin-opt strong { font-size: 14px; }
.coin-opt em { font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-badge { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; font-weight: 800; font-size: 15px; color: #fff; background: var(--cc); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.coin-badge.xs { width: 22px; height: 22px; font-size: 11px; }
.cx-rate { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: -10px; font-size: 14px; color: var(--muted); }
.cx-rate b { color: var(--text); }
.cx-rate em { font-style: normal; margin-left: auto; font-size: 12px; color: var(--dim); }
.cx-panel { display: flex; flex-direction: column; gap: 16px; animation: rise .45s var(--ease); }
.cx-addr { display: grid; grid-template-columns: 170px 1fr; gap: 20px; align-items: center; padding: 18px; border-radius: 16px; background: #0c0f26; border: 1px solid var(--line-2); }
.cx-qr { position: relative; width: 170px; aspect-ratio: 1; border-radius: 14px; overflow: hidden; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .8); animation: qrIn .6s var(--spring); }
@keyframes qrIn { from { transform: scale(.8) rotate(-4deg); opacity: 0; } }
.qr { display: block; width: 100%; height: 100%; }
.coin-badge.qr { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; font-size: 19px; transform: translate(-50%, -50%); box-shadow: 0 0 0 5px #fff; }
.cx-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cx-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.cx-label + .cx-copy, .cx-sub + .cx-label { margin-top: 8px; }
.cx-qty { font-size: 24px; font-weight: 800; }
.cx-sub { font-size: 13px; color: var(--muted); }
.cx-copy { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); min-width: 0; }
.cx-copy code { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; color: #dfe3ff; }
.cx-copy button { flex: none; padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; background: var(--blue); color: #fff; transition: filter .2s; }
.cx-copy button:hover { filter: brightness(1.1); }
.cx-status { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 14px; background: #0c0f26; border: 1px solid var(--line-2); }
.cx-status-row { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.cx-status .spinner.sm { border-top-color: #f7931a; }
.cx-bar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.cx-bar span { display: block; width: 0; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #f7931a, #ffc23d); transition: width .35s var(--ease); }
.cx-conf { font-size: 13px; color: var(--muted); }
.cx-status.done { border-color: rgba(31, 214, 122, .4); background: rgba(31, 214, 122, .06); }
.cx-status.done .cx-bar span { background: var(--green); }
.cx-done-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #04210f; animation: popIn2 .4s var(--spring); }
.cx-done-ic .ic { width: 14px; height: 14px; stroke-width: 3; }
.cx-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.cx-recv { font-style: normal; font-size: 13px; font-weight: 600; color: var(--muted); }
.cx-tx { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 14px; background: rgba(31, 214, 122, .06); border: 1px solid rgba(31, 214, 122, .35); animation: rise .4s var(--ease); }
.cx-tx span { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.cx-tx .ic { width: 16px; height: 16px; color: var(--green); }
.cx-tx code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }

.contact-type button { display: flex; align-items: center; justify-content: center; gap: 8px; }
.contact-type .ic { width: 16px; height: 16px; }
.contact-input { margin-top: 10px; }
.contact-input .prefix { display: grid; place-items: center; min-width: 22px; font-weight: 700; }
.contact-input .prefix .ic { width: 16px; height: 16px; }
.contact.invalid .input-group { border-color: rgba(255, 72, 103, .6); box-shadow: 0 0 0 4px rgba(255, 72, 103, .1); }
.contact-head { display: flex; gap: 14px; align-items: flex-start; }
.contact-head img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.contact-head strong { display: block; font-size: 18px; }
.contact-head span { font-size: 14px; color: var(--muted); }

/* Interac page states */
.ix-contact { display: flex; flex-direction: column; gap: 20px; margin-top: 24px; animation: rise .45s var(--ease); }
.ix-contact-head h2 { margin: 0; font-size: 22px; }
.ix-contact-head p { margin: 6px 0 0; color: var(--muted); }
.ix-contact .back-link { align-self: center; }
.ix-card[data-state="contact"] .ix-run { display: none; }
.ix-card[data-state="run"] .ix-contact { display: none; }
.ix-card[data-state="run"] .ix-run { animation: rise .5s var(--ease); }

@media (max-width: 720px) {
  .coin-pick { grid-template-columns: repeat(3, 1fr); }
  .cx-addr { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .cx-info { align-items: center; width: 100%; }
  .cx-copy { width: 100%; }
  .cx-actions { grid-template-columns: 1fr; }
  .methods.two { grid-template-columns: 1fr; }
}
.tower.still .t-row { animation: none; }

/* Hover-lift hit areas: a lifted element keeps covering the spot it rose from. */
.tile:hover::before, .k-tile:hover::before, .t-tile:hover::before, .chip-btn:hover::before,
.method:hover::before, .coin-opt:hover::before { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 8px; }

/* ============ Auth ============ */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); }
.auth-card h1 { margin: 6px 0 0; font-size: 26px; letter-spacing: -.02em; }
.auth-sub { margin: 0; color: var(--muted); }
.auth-switch { display: flex; justify-content: space-between; gap: 12px; margin: 0; font-size: 14px; }
.auth-switch button { color: var(--muted); font-weight: 600; }
.auth-switch button:hover { color: #fff; }
.auth-fine { display: flex; gap: 8px; align-items: center; margin: 0; color: var(--dim); font-size: 12px; }
.auth-fine .ic { width: 16px; height: 16px; }

/* ============ Verification ============ */
.kyc h2 { display: flex; align-items: center; gap: 10px; }
.kyc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 18px 20px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); }
.kyc-row.locked { opacity: .8; }
.kyc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kyc-head .ic { width: 18px; height: 18px; color: var(--muted); }
.kyc-done { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 8px; color: var(--green); border: 1px solid var(--green); font-size: 14px; }
.kyc-done .ic { width: 14px; height: 14px; color: var(--green); }

/* ============ Guest chrome ============ */
.tb-auth { display: none; align-items: center; gap: 10px; order: 10; }
.app.guest .tb-auth { display: flex; }
.app.guest .tb-center, .app.guest .tb-group, .app.guest [data-account-group] { display: none; }
.app.guest .tb-right { margin-left: auto; }
.btn-login { background: linear-gradient(180deg, #2ee68b, #12b866) !important; }
body.modal-open { overflow: hidden; }

/* ============ Login / Register popup ============ */
.auth-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(5, 7, 20, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: auth-in .2s var(--ease); }
@keyframes auth-in { from { opacity: 0; } }
.auth-dialog { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: min(940px, 100%); max-height: calc(100vh - 40px); overflow: hidden; border-radius: 22px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .9); animation: auth-pop .3s var(--spring); }
@keyframes auth-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.auth-art { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 28px; overflow: hidden; min-height: 560px; background: linear-gradient(160deg, #2a2f7a 0%, #1a1650 55%, #0e0f33 100%); }
.art-glow { position: absolute; inset: -20% -10% auto; height: 70%; background: radial-gradient(60% 60% at 50% 40%, rgba(139, 92, 246, .55), transparent 70%); pointer-events: none; }
.art-logo { position: relative; display: flex; justify-content: center; padding-top: 6px; transform: scale(1.25); transform-origin: center top; }
.art-tiles { position: relative; flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: center; padding: 6px 10px; }
.art-tile { display: grid; place-items: center; gap: 8px; padding: 22px 10px; border-radius: 18px; font-weight: 800; letter-spacing: .02em; background: linear-gradient(145deg, var(--c1), var(--c2)); box-shadow: 0 18px 30px -14px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .25); }
.art-tile .ic { width: 38px; height: 38px; }
.art-tile.t0 { transform: rotate(-5deg); }
.art-tile.t1 { transform: rotate(4deg) translateY(14px); }
.art-tile.t2 { transform: rotate(3deg); }
.art-tile.t3 { transform: rotate(-4deg) translateY(14px); }
.art-copy { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: center; }
.art-copy strong { font-size: 20px; }
.art-copy span { color: #b9bff0; font-size: 14px; }
.art-fine { position: relative; margin: 0; text-align: center; font-size: 12px; color: #9aa0d6; }
.auth-body { display: flex; flex-direction: column; gap: 16px; padding: 22px 28px 24px; overflow-y: auto; }
.auth-tabs { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.auth-tabs [data-tab] { padding: 14px 16px; font-size: 17px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s; }
.auth-tabs [data-tab]:hover { color: #fff; }
.auth-tabs [data-tab].on { color: #fff; border-bottom-color: var(--blue); }
.auth-close { margin-left: auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-3); color: #fff; }
.auth-close:hover { background: #2d3470; }
.auth-close .ic { width: 16px; height: 16px; }
.auth-title { margin: 6px 0 0; font-size: 22px; letter-spacing: -.01em; }
.auth-link { align-self: flex-end; color: var(--muted); font-weight: 600; font-size: 14px; }
.auth-link:hover { color: #fff; }
.auth-done { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.auth-done .ic { width: 34px; height: 34px; color: var(--green); }
.auth-done p { margin: 0; color: var(--muted); }
.auth-fine { display: flex; gap: 8px; align-items: center; margin: auto 0 0; color: var(--dim); font-size: 12px; }
.auth-fine .ic { width: 16px; height: 16px; flex: none; }
@media (max-width: 760px) {
  .auth-dialog { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-body { padding: 16px 18px 20px; }
}
