﻿/* =========================================================
   Zentra: free-play casino (design system)
   ========================================================= */
:root {
  --bg: #070a12;
  --bg2: #0b101c;
  --panel: #111827;
  --panel2: #172033;
  --panel3: #1f2b43;
  --panel4: #283859;
  --line: rgba(148, 170, 220, .12);
  --line2: rgba(148, 170, 220, .2);
  --text: #eef2fb;
  --muted: #8391ad;
  --muted2: #5e6b86;
  --accent: #4f8cff;
  --accent-2: #7b5cff;
  --grad: linear-gradient(135deg, #4f8cff 0%, #7b5cff 100%);
  --gold: #ffc83d;
  --green: #22d67f;
  --red: #ff4d6a;
  --orange: #ff9d3d;
  --radius: 14px;
  --sidebar: 252px;
  --topbar: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Outfit", "Inter", "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(123, 92, 255, .14), transparent 60%),
    radial-gradient(800px 600px at 10% 110%, rgba(79, 140, 255, .1), transparent 60%);
}
body::after { /* film grain */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 999; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.green { color: var(--green); }
.red { color: var(--red); }
.gold { color: var(--gold); }
.mono { font-variant-numeric: tabular-nums; }
::selection { background: rgba(79, 140, 255, .35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--panel4) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel3); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--panel4); }

.ic { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -.2em; flex-shrink: 0; overflow: visible; }

/* ===== Splash ===== */
#splash {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: var(--bg);
  transition: opacity .5s var(--ease), visibility .5s;
}
#splash.done { opacity: 0; visibility: hidden; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.splash-logo { position: relative; width: 96px; height: 96px; }
.splash-logo .ic { width: 96px; height: 96px; animation: splashIn .9s var(--spring) both; filter: drop-shadow(0 12px 30px rgba(95, 141, 255, .55)); }
.splash-logo::before, .splash-logo::after {
  content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 2px solid rgba(123, 92, 255, .5);
  animation: ringOut 1.6s var(--ease) infinite;
}
.splash-logo::after { animation-delay: .5s; }
.splash-word { font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: .5px; animation: fadeUp .7s .25s var(--ease) both; }
.splash-word b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.splash-bar { width: 160px; height: 3px; border-radius: 3px; background: var(--panel3); overflow: hidden; animation: fadeUp .6s .4s both; }
.splash-bar i { display: block; height: 100%; width: 40%; background: var(--grad); border-radius: 3px; animation: loadBar 1s var(--ease) infinite; }
@keyframes splashIn { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }
@keyframes ringOut { from { transform: scale(.7); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
@keyframes loadBar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }

/* ===== Layout ===== */
.app { display: flex; height: 100vh; position: relative; z-index: 1; }
.sidebar {
  width: var(--sidebar); flex-shrink: 0; background: rgba(11, 16, 28, .82); backdrop-filter: blur(18px);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  overflow-y: auto; z-index: 40; transition: transform .35s var(--ease);
}
.logo {
  display: flex; align-items: center; gap: 11px; height: var(--topbar);
  padding: 0 20px; font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: .2px;
  flex-shrink: 0; position: sticky; top: 0; background: inherit; z-index: 2;
}
.logo .ic { width: 38px; height: 38px; filter: drop-shadow(0 6px 16px rgba(95, 141, 255, .5)); transition: transform .5s var(--spring); }
.logo:hover .ic { transform: rotate(-10deg) scale(1.08); }
.logo span b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { padding: 4px 12px 28px; position: relative; }
.nav-indicator {
  position: absolute; left: 12px; right: 12px; top: 0; height: 40px; border-radius: 10px; pointer-events: none;
  background: linear-gradient(90deg, rgba(79, 140, 255, .18), rgba(123, 92, 255, .08));
  box-shadow: inset 0 0 0 1px rgba(79, 140, 255, .25);
  transition: transform .35s var(--ease), height .35s var(--ease), opacity .2s;
}
.nav-indicator::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); box-shadow: 0 0 12px var(--accent); }
.nav-title { color: var(--muted2); font-size: 11px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; padding: 18px 10px 8px; }
.nav a {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px; border-radius: 10px;
  color: #b3bfd6; font-weight: 600; transition: color .2s, background .2s;
}
.nav a > .ic { width: 20px; height: 20px; color: var(--muted); transition: color .2s, transform .3s var(--spring); }
.nav a .gi { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--panel2); transition: transform .3s var(--spring), background .2s; }
.nav a .gi .ic { width: 20px; height: 20px; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .03); }
.nav a:hover > .ic, .nav a:hover .gi { transform: scale(1.12) rotate(-6deg); }
.nav a.active { color: #fff; }
.nav a.active > .ic { color: var(--accent); }
.nav a.active .gi { background: var(--panel3); }
.nav .hot { margin-left: auto; font-size: 10px; font-weight: 800; color: var(--orange); background: rgba(255, 157, 61, .12); padding: 2px 7px; border-radius: 99px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar); flex-shrink: 0; display: flex; align-items: center; gap: 10px;
  padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(11, 16, 28, .7); backdrop-filter: blur(18px); z-index: 20;
}
.menu-btn { display: none; width: 42px; height: 42px; border-radius: 10px; }
.menu-btn .ic { width: 22px; height: 22px; }
.topbar .spacer { flex: 1; }
.wallet {
  display: flex; align-items: center; background: var(--panel); border-radius: 12px; padding: 4px;
  box-shadow: inset 0 0 0 1px var(--line), 0 6px 24px rgba(0, 0, 0, .25); position: relative;
}
.wallet.bump { animation: bump .45s var(--spring); }
@keyframes bump { 40% { transform: scale(1.07); } }
.wallet .bal { padding: 0 14px 0 10px; font-family: var(--display); font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; height: 38px; min-width: 130px; }
.wallet .bal .ic { width: 22px; height: 22px; color: var(--gold); filter: drop-shadow(0 0 6px rgba(255, 200, 61, .5)); }
.wallet .bal.flash-up { animation: flashUp .7s; }
.wallet .bal.flash-down { animation: flashDown .5s; }
@keyframes flashUp { 30% { color: var(--green); text-shadow: 0 0 16px rgba(34, 214, 127, .6); } }
@keyframes flashDown { 30% { color: #ffb3c0; } }
.wallet .refill-btn {
  height: 38px; padding: 0 14px; border-radius: 9px; background: var(--grad); display: flex; align-items: center; gap: 7px;
  font-weight: 700; color: #fff; white-space: nowrap; box-shadow: 0 4px 16px rgba(79, 140, 255, .35); position: relative; overflow: hidden;
}
.wallet .refill-btn .ic { width: 17px; height: 17px; }
.wallet .refill-btn.waiting { background: var(--panel3); color: var(--muted); box-shadow: none; }
.wallet .refill-btn.ready { background: linear-gradient(135deg, #14b865, var(--green)); color: #03200f; animation: glowPulse 1.6s infinite; }
@keyframes glowPulse { 50% { box-shadow: 0 0 0 7px rgba(34, 214, 127, .12), 0 0 26px rgba(34, 214, 127, .45); } }

.top-btn {
  height: 46px; padding: 0 14px; border-radius: 12px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 700; display: flex; align-items: center; gap: 9px; position: relative; transition: background .2s, transform .2s var(--spring);
}
.top-btn > .ic { width: 20px; height: 20px; }
.top-btn:hover { background: var(--panel2); transform: translateY(-1px); }
.top-btn .dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--panel); animation: dotPing 2s infinite; }
@keyframes dotPing { 0%, 100% { box-shadow: 0 0 0 3px var(--panel), 0 0 0 3px rgba(255, 77, 106, .5); } 50% { box-shadow: 0 0 0 3px var(--panel), 0 0 0 8px rgba(255, 77, 106, 0); } }
.level-chip { display: flex; align-items: center; gap: 10px; }
.level-chip .lv-text { line-height: 1.15; font-size: 13px; }
.level-bar { width: 96px; height: 5px; border-radius: 9px; background: var(--panel3); overflow: hidden; margin-top: 4px; }
.level-bar i { display: block; height: 100%; background: var(--grad); border-radius: 9px; transition: width .6s var(--ease); position: relative; }
.level-bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); animation: shimmer 2.2s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
#levelIcon { display: grid; place-items: center; }
.rank-badge { display: block; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .4)); }

.content { flex: 1; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.view { padding: 26px; max-width: 1340px; margin: 0 auto; }
.view.enter { animation: viewIn .45s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } }

/* ===== Generic UI ===== */
.card { background: linear-gradient(180deg, rgba(255, 255, 255, .02), transparent), var(--panel); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 20px; border-radius: 11px; font-weight: 800; letter-spacing: .2px;
  background: var(--panel3); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 0 0 1px var(--line);
  transition: filter .2s, transform .15s var(--spring), opacity .2s, box-shadow .25s, background .2s;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn .ic { width: 18px; height: 18px; }
.btn::after { /* shine sweep */
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .22), transparent); transform: skewX(-20deg);
  transition: left .6s var(--ease); pointer-events: none;
}
.btn:hover:not(:disabled)::after { left: 130%; }
.btn:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 24px -6px rgba(79, 140, 255, .6); }
.btn-primary:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 30px -4px rgba(101, 116, 255, .75); }
.btn-green { background: linear-gradient(135deg, #12b561, #2ee88e); color: #032613; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 24px -6px rgba(34, 214, 127, .6); }
.btn-gold { background: linear-gradient(135deg, #f5a623, #ffd35c); color: #2a1c00; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 8px 24px -6px rgba(255, 200, 61, .55); }
.btn-red { background: linear-gradient(135deg, #d9243f, #ff5c78); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 24px -6px rgba(255, 77, 106, .55); }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-sm .ic { width: 15px; height: 15px; }
.btn-lg { height: 54px; font-size: 16px; border-radius: 13px; }
.btn-green.cashing { animation: cashGlow 1.2s infinite; }
@keyframes cashGlow { 50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 0 0 5px rgba(34, 214, 127, .15), 0 10px 34px -4px rgba(34, 214, 127, .8); } }
.ripple-ink { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .28); transform: scale(0); animation: ripple .65s var(--ease); pointer-events: none; z-index: -1; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

.field { margin-bottom: 15px; }
.field > label { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 7px; letter-spacing: .2px; }
.input-wrap {
  position: relative; display: flex; align-items: center; background: var(--bg2); border-radius: 11px; height: 44px; overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, opacity .2s;
}
.input-wrap:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px rgba(79, 140, 255, .15); }
.input-wrap.pulse { animation: inPulse .35s var(--ease); }
@keyframes inPulse { 40% { box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 0 4px rgba(255, 200, 61, .18); } }
.input-wrap input, .input-wrap select {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0 12px; outline: none; font-weight: 700; font-variant-numeric: tabular-nums;
}
.select-wrap select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px; }
.select-wrap .sel-caret { position: absolute; right: 12px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.input-wrap select option { background: var(--panel); }
.input-wrap .prefix { padding-left: 12px; color: var(--muted); font-weight: 700; display: flex; }
.input-wrap .coin-prefix .ic { width: 18px; height: 18px; color: var(--gold); }
.input-wrap .suffix { padding-right: 12px; color: var(--muted); font-weight: 700; display: flex; }
.input-wrap .mini {
  height: calc(100% - 8px); margin-right: 4px; padding: 0 11px; border-radius: 8px; color: #c9d3e6; font-weight: 800; font-size: 12px;
  background: var(--panel2); transition: background .15s, color .15s, transform .15s var(--spring);
}
.input-wrap .mini .ic { width: 15px; height: 15px; }
.input-wrap .mini:hover { background: var(--panel3); color: #fff; transform: translateY(-1px); }
.input-wrap.disabled { opacity: .5; pointer-events: none; }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type=number] { -moz-appearance: textfield; }

.seg { position: relative; display: flex; background: var(--bg2); border-radius: 12px; padding: 3px; gap: 0; box-shadow: inset 0 0 0 1px var(--line); }
.seg-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; border-radius: 9px; background: var(--panel3); box-shadow: 0 2px 10px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .06); transition: transform .35s var(--ease), width .35s var(--ease); }
.seg button { position: relative; z-index: 1; flex: 1; height: 36px; border-radius: 9px; font-weight: 700; color: var(--muted); font-size: 13px; transition: color .2s; }
.seg button.on { color: #fff; }
.seg.disabled { opacity: .55; pointer-events: none; }

.pill { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 99px; font-weight: 800; font-size: 12px; background: var(--panel3); font-variant-numeric: tabular-nums; animation: pillIn .4s var(--spring); }
.pill.win { background: rgba(34, 214, 127, .14); color: var(--green); box-shadow: inset 0 0 0 1px rgba(34, 214, 127, .25); }
.pill.lose { background: rgba(255, 255, 255, .04); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
@keyframes pillIn { from { transform: scale(.5) translateX(-10px); opacity: 0; } }

/* ===== Game layout ===== */
.game-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.gh-icon {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; flex-shrink: 0;
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--gc) 45%, transparent), transparent 70%), var(--panel2);
  box-shadow: inset 0 0 0 1px var(--line2), 0 10px 26px -10px var(--gc);
}
.gh-icon .ic { width: 36px; height: 36px; animation: floaty 4s ease-in-out infinite; }
.game-head h1 { font-family: var(--display); font-size: 26px; margin: 0; letter-spacing: -.3px; line-height: 1.1; }
.gh-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.game-head .tag { margin-left: auto; font-size: 11px; font-weight: 800; color: #9ec0ff; background: rgba(79, 140, 255, .1); padding: 6px 10px; border-radius: 8px; letter-spacing: .6px; box-shadow: inset 0 0 0 1px rgba(79, 140, 255, .25); white-space: nowrap; }
@keyframes floaty { 50% { transform: translateY(-3px) rotate(-3deg); } }
.game {
  display: grid; grid-template-columns: 330px 1fr; background: var(--panel);
  border-radius: 20px; overflow: hidden; min-height: 580px; box-shadow: inset 0 0 0 1px var(--line), 0 30px 60px -30px rgba(0, 0, 0, .6);
}
.panel { padding: 20px; background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 40%), var(--panel2); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.stage {
  position: relative; padding: 26px; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(79, 140, 255, .09), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(123, 92, 255, .06), transparent 70%);
}
.stage::before { /* subtle dot grid */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}
.stage > * { position: relative; }
.stat-row { display: flex; gap: 10px; }
.stat-row > * { flex: 1; }
.result-strip { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; min-height: 28px; margin-bottom: 12px; z-index: 2; }
.game-info { display: flex; gap: 20px; padding: 13px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; grid-column: 1 / -1; background: var(--bg2); flex-wrap: wrap; }
.game-info span { display: flex; align-items: center; gap: 7px; }
.game-info .ic { width: 15px; height: 15px; color: var(--muted2); }
.game-info .gi-right { margin-left: auto; }
.profit-box { background: var(--bg2); border-radius: 11px; padding: 10px 13px; font-weight: 800; margin-bottom: 15px; box-shadow: inset 0 0 0 1px var(--line); font-variant-numeric: tabular-nums; font-family: var(--display); font-size: 15px; }
.profit-box small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; font-family: var(--font); font-weight: 700; }
.slide-in { animation: fadeUp .35s var(--ease); }

/* win popup in stage */
.win-pop {
  position: absolute !important; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.6); opacity: 0;
  background: linear-gradient(180deg, rgba(34, 214, 127, .16), rgba(17, 24, 39, .96) 60%); border-radius: 18px; padding: 16px 30px 18px; text-align: center;
  box-shadow: inset 0 0 0 2px rgba(34, 214, 127, .7), 0 20px 60px rgba(0, 0, 0, .55), 0 0 60px rgba(34, 214, 127, .25);
  pointer-events: none; transition: all .35s var(--spring); z-index: 20; backdrop-filter: blur(6px);
}
.win-pop.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.win-pop .wp-label { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--green); opacity: .85; }
.win-pop .m { font-family: var(--display); font-size: 36px; font-weight: 800; color: #fff; text-shadow: 0 0 24px rgba(34, 214, 127, .8); line-height: 1.15; }
.win-pop .a { font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; }

/* ===== Lobby ===== */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 44px 42px; margin-bottom: 26px; min-height: 300px;
  background: linear-gradient(120deg, #142456 0%, #25196a 55%, #10224a 100%); box-shadow: inset 0 0 0 1px rgba(140, 160, 255, .22), 0 30px 60px -30px rgba(40, 60, 180, .6);
  isolation: isolate;
}
.hero-blob { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .55; z-index: -1; animation: blob 14s ease-in-out infinite; }
.hero-blob.b1 { width: 360px; height: 360px; background: #4f8cff; top: -120px; right: 18%; }
.hero-blob.b2 { width: 300px; height: 300px; background: #b15cff; bottom: -140px; right: -40px; animation-delay: -5s; }
.hero-blob.b3 { width: 240px; height: 240px; background: #22c3e6; bottom: -120px; left: 30%; opacity: .3; animation-delay: -9s; }
@keyframes blob { 33% { transform: translate(40px, 30px) scale(1.1); } 66% { transform: translate(-30px, 10px) scale(.9); } }
.hero .rain { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.hero .rain i { position: absolute; top: -30px; width: 1.5px; height: 22px; background: linear-gradient(transparent, rgba(180, 210, 255, .55)); animation: rain 1.1s linear infinite; transform: rotate(12deg); }
@keyframes rain { to { transform: translateY(380px) rotate(12deg) translateX(-60px); } }
.hero-copy { position: relative; max-width: 560px; }
.hero .kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: 1px; color: #c9d7ff; background: rgba(255, 255, 255, .08); padding: 7px 12px; border-radius: 99px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); margin-bottom: 16px; animation: fadeUp .6s var(--ease) both; }
.hero .kicker .ic { color: var(--gold); }
.hero h1 { font-family: var(--display); font-size: 44px; line-height: 1.05; margin: 0 0 14px; letter-spacing: -1.2px; animation: fadeUp .6s .08s var(--ease) both; }
.hero h1 .grad { background: linear-gradient(90deg, #8fc1ff, #c9a2ff, #ffd36b); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: gradMove 6s linear infinite; }
@keyframes gradMove { to { background-position: -200% 0; } }
.hero p { color: #b9c5e4; margin: 0 0 24px; font-size: 15px; line-height: 1.6; animation: fadeUp .6s .16s var(--ease) both; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; animation: fadeUp .6s .24s var(--ease) both; }
.hero-actions .btn:not(.btn-primary) { background: rgba(255, 255, 255, .08); backdrop-filter: blur(8px); }
.hero-stats { display: flex; gap: 26px; margin-top: 28px; animation: fadeUp .6s .32s var(--ease) both; }
.hero-stats div { font-family: var(--display); font-size: 24px; font-weight: 800; }
.hero-stats small { display: block; font-family: var(--font); font-size: 12px; color: #9fb0d8; font-weight: 600; }
.hero-art { position: absolute; right: 40px; top: 50%; width: 330px; height: 280px; transform: translateY(-50%); pointer-events: none; }
.hero-art .ha { position: absolute; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); animation: floaty2 6s ease-in-out infinite; }
.hero-art .ha .ic { width: 100%; height: 100%; }
.hero-art .ha1 { width: 190px; height: 190px; left: 70px; top: 30px; animation-duration: 7s; }
.hero-art .ha2 { width: 90px; height: 90px; left: 0; top: 150px; animation-delay: -2s; }
.hero-art .ha3 { width: 86px; height: 86px; right: 0; top: 0; animation-delay: -4s; }
.hero-art .ha4 { width: 70px; height: 70px; right: 10px; bottom: 0; animation-delay: -1s; }
.hero-art .ha5 { width: 56px; height: 56px; left: 30px; top: 10px; animation-delay: -3s; opacity: .9; }
@keyframes floaty2 { 50% { transform: translateY(-14px) rotate(4deg); } }
.hero-art .ha1 .ic { filter: drop-shadow(0 0 40px rgba(143, 193, 255, .5)); }

.section-title { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 20px; font-weight: 700; margin: 30px 0 16px; letter-spacing: -.2px; }
.section-title > .ic { width: 22px; height: 22px; color: var(--accent); }
.section-title .count { font-family: var(--font); font-size: 12px; color: var(--muted); background: var(--panel); padding: 4px 10px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--line); }
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 16px; }
.games-grid > * { min-width: 0; }
.game-card {
  --mx: 50%; --my: 50%;
  position: relative; aspect-ratio: 3/4; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
  justify-content: flex-end; padding: 14px; isolation: isolate; will-change: transform;
  transition: transform .45s var(--ease), box-shadow .35s;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 10px 26px -12px rgba(0, 0, 0, .6);
  animation: cardIn .6s var(--ease) both; animation-delay: calc(var(--i) * 35ms);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.game-card.tilting { transition: transform .08s linear, box-shadow .35s; }
.game-card:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 24px 40px -14px rgba(0, 0, 0, .7), 0 0 40px -10px var(--gc); }
.game-card .gc-bg { position: absolute; inset: 0; z-index: -3; }
.game-card .gc-bg::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, .28), transparent 55%); }
.game-card .gc-bg::after { content: ""; position: absolute; inset: 0; opacity: .25; background-image: radial-gradient(rgba(255, 255, 255, .5) 1px, transparent 1.2px); background-size: 14px 14px; mask-image: linear-gradient(transparent, #000 40%, transparent 85%); }
.game-card .gc-art { position: absolute; left: 50%; top: 40%; width: 64%; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: -1; transition: transform .5s var(--spring); filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .4)); }
.game-card .gc-art .ic { width: 100%; height: 100%; }
.game-card:hover .gc-art { transform: translate(-50%, -56%) scale(1.1) rotate(-4deg); }
.game-card .gc-shine { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .28), transparent 45%); mix-blend-mode: overlay; }
.game-card:hover .gc-shine { opacity: 1; }
.game-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(0, 0, 0, .55)); z-index: -2; }
.game-card .name { font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1.1; text-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.game-card .sub { font-size: 10px; font-weight: 800; opacity: .8; text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 3px; }
.game-card .gc-play {
  position: absolute; right: 12px; bottom: 14px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .95); color: #111; transform: scale(0) rotate(-90deg); transition: transform .4s var(--spring);
}
.game-card .gc-play .ic { width: 15px; height: 15px; margin-left: 2px; fill: currentColor; }
.game-card:hover .gc-play { transform: scale(1) rotate(0); }

.promo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.promo {
  position: relative; overflow: hidden; padding: 18px; border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line);
  display: flex; gap: 14px; align-items: center; cursor: pointer; transition: transform .3s var(--spring), box-shadow .3s;
}
.promo::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 0% 50%, color-mix(in srgb, var(--pc) 22%, transparent), transparent 60%); opacity: .8; transition: opacity .3s; }
.promo:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc) 50%, transparent), 0 16px 30px -16px var(--pc); }
.promo > * { position: relative; }
.promo .pi { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--pc) 18%, var(--panel2)); color: var(--pc); flex-shrink: 0; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc) 35%, transparent); }
.promo .pi .ic { width: 24px; height: 24px; }
.promo b { display: block; font-size: 15px; margin-bottom: 2px; }
.promo span { color: var(--muted); font-size: 13px; }
.promo .go { margin-left: auto; color: var(--muted); transition: transform .3s var(--spring), color .2s; }
.promo:hover .go { transform: translateX(4px); color: #fff; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ===== Live bets ===== */
.bets-wrap { padding: 0 26px 44px; max-width: 1340px; margin: 0 auto; }
.bets-tabs { display: flex; gap: 10px; margin-bottom: 12px; align-items: center; }
.live-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--green); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: livePing 1.6s infinite; }
@keyframes livePing { 0% { box-shadow: 0 0 0 0 rgba(34, 214, 127, .6); } 100% { box-shadow: 0 0 0 9px rgba(34, 214, 127, 0); } }
table.bets { width: 100%; border-collapse: collapse; font-size: 13px; }
table.bets th { text-align: left; color: var(--muted2); font-weight: 700; padding: 12px 16px; font-size: 11px; letter-spacing: .8px; text-transform: uppercase; }
table.bets td { padding: 11px 16px; border-top: 1px solid var(--line); font-weight: 600; font-variant-numeric: tabular-nums; }
table.bets td .gcell { display: inline-flex; align-items: center; gap: 9px; }
table.bets td .gcell .ic { width: 22px; height: 22px; }
table.bets td .ucell { display: inline-flex; align-items: center; gap: 7px; }
table.bets td .ucell .ic { width: 15px; height: 15px; color: var(--muted2); }
table.bets tr.new td { animation: rowIn .5s var(--ease); }
table.bets tr.me td { background: rgba(79, 140, 255, .05); }
table.bets tr.me td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.bets tr:hover td { background: rgba(255, 255, 255, .02); }
@keyframes rowIn { from { background: rgba(79, 140, 255, .14); transform: translateY(-8px); opacity: 0; } }
table.bets td:last-child, table.bets th:last-child { text-align: right; }
.bets-card { overflow: hidden; }

/* ===== Modal / Toast ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(3, 6, 12, .7); backdrop-filter: blur(8px); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fadeIn .25s; }
.modal-bg.out { animation: fadeOut .22s forwards; }
.modal-bg.out .modal { animation: popOut .22s forwards; }
.modal {
  width: 100%; max-width: 470px; background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 30%), var(--panel); border-radius: 22px; padding: 28px; position: relative;
  animation: popIn .45s var(--spring); max-height: 92vh; overflow-y: auto; box-shadow: inset 0 0 0 1px var(--line2), 0 40px 80px rgba(0, 0, 0, .6);
}
.modal h2 { margin: 0 0 6px; font-family: var(--display); font-size: 24px; letter-spacing: -.3px; }
.modal .close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 10px; color: var(--muted); display: grid; place-items: center; transition: background .2s, color .2s, transform .3s var(--spring); z-index: 2; }
.modal .close:hover { background: var(--panel2); color: #fff; transform: rotate(90deg); }
.modal-center { text-align: center; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popIn { from { transform: scale(.88) translateY(20px); opacity: 0; } }
@keyframes popOut { to { transform: scale(.94); opacity: 0; } }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 300; pointer-events: none; }
.toast {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; min-width: 250px; max-width: 360px;
  background: rgba(23, 32, 51, .92); backdrop-filter: blur(14px); padding: 13px 16px 15px 13px; border-radius: 14px; font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--line2), 0 16px 40px rgba(0, 0, 0, .5); animation: toastIn .5s var(--spring); pointer-events: auto; --tc: var(--accent);
}
.toast.out { animation: toastOut .4s var(--ease) forwards; }
.toast-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 18%, transparent); color: var(--tc); flex-shrink: 0; }
.toast-ic .ic { width: 18px; height: 18px; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--tc); transform-origin: left; animation: toastBar 3s linear forwards; opacity: .7; }
.toast.good { --tc: var(--green); } .toast.bad { --tc: var(--red); } .toast.gold { --tc: var(--gold); }
@keyframes toastIn { from { transform: translateX(40px) scale(.9); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(40px); opacity: 0; } }
@keyframes toastBar { to { transform: scaleX(0); } }

/* broke modal */
.broke-head { text-align: center; }
.broke-art { position: relative; width: 110px; height: 96px; margin: 0 auto 6px; }
.broke-cloud { width: 110px !important; height: 80px !important; color: #7d8db0; animation: floaty 3s ease-in-out infinite; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .4)); }
.broke-rain { position: absolute; left: 22px; right: 22px; top: 58px; height: 40px; overflow: hidden; }
.broke-rain i { position: absolute; top: -12px; width: 2px; height: 10px; border-radius: 2px; background: #6fa8ff; animation: drip 1s linear infinite; }
.broke-rain i:nth-child(1) { left: 5%; animation-delay: 0s; } .broke-rain i:nth-child(2) { left: 16%; animation-delay: .3s; } .broke-rain i:nth-child(3) { left: 27%; animation-delay: .6s; }
.broke-rain i:nth-child(4) { left: 38%; animation-delay: .15s; } .broke-rain i:nth-child(5) { left: 49%; animation-delay: .45s; } .broke-rain i:nth-child(6) { left: 60%; animation-delay: .75s; }
.broke-rain i:nth-child(7) { left: 71%; animation-delay: .2s; } .broke-rain i:nth-child(8) { left: 82%; animation-delay: .5s; } .broke-rain i:nth-child(9) { left: 93%; animation-delay: .85s; }
@keyframes drip { to { transform: translateY(52px); opacity: .2; } }
.broke-choices { display: grid; gap: 12px; margin-top: 20px; }
.choice {
  display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 16px; background: var(--panel2); text-align: left; width: 100%;
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .25s, transform .3s var(--spring), background .2s; animation: fadeUp .45s var(--ease) both;
}
.choice:nth-child(2) { animation-delay: .08s; }
.choice:hover:not(:disabled) { box-shadow: inset 0 0 0 1.5px var(--accent), 0 12px 30px -14px var(--accent); transform: translateY(-2px); background: var(--panel3); }
.choice.ready { box-shadow: inset 0 0 0 1.5px var(--green), 0 0 30px -8px var(--green); }
.choice-ic { position: relative; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--panel3); color: var(--accent); flex-shrink: 0; }
.choice-ic > .ic { width: 22px; height: 22px; }
.choice-ic.bolt { color: var(--gold); background: rgba(255, 200, 61, .12); }
.mini-ring { position: absolute; inset: 0; width: 50px; height: 50px; transform: rotate(-90deg); }
.mini-ring circle { fill: none; stroke: var(--panel4); stroke-width: 3; }
.mini-ring .prog { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .3s linear; }
.choice b { display: block; font-size: 15px; }
.choice span { color: var(--muted); font-size: 13px; }
.choice .amt { margin-left: auto; font-weight: 800; color: var(--green); font-size: 16px; white-space: nowrap; font-family: var(--display); }

/* level up + big win */
.levelup { text-align: center; padding-top: 6px; }
.lu-badge { position: relative; width: 110px; height: 110px; margin: 0 auto 10px; }
.lu-badge .rank-badge { animation: badgeIn .9s var(--spring) both; filter: drop-shadow(0 12px 30px rgba(123, 92, 255, .6)); }
.lu-ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(255, 200, 61, .6); animation: ringOut 1.8s var(--ease) infinite; }
.lu-ring.r2 { animation-delay: .6s; }
@keyframes badgeIn { from { transform: scale(0) rotate(-180deg); } }
.lu-kicker { font-size: 12px; font-weight: 800; letter-spacing: 3px; color: var(--gold); }
.levelup h2 { font-size: 34px; margin: 2px 0; }
.lu-reward { font-family: var(--display); font-size: 30px; font-weight: 800; color: var(--green); margin: 10px 0 18px; text-shadow: 0 0 22px rgba(34, 214, 127, .5); }
.bigwin { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: radial-gradient(circle, rgba(24, 14, 60, .9), rgba(3, 5, 10, .96)); animation: fadeIn .3s; cursor: pointer; overflow: hidden; }
.bigwin.out { animation: fadeOut .35s forwards; }
.bw-rays { position: absolute; width: 1400px; height: 1400px; background: repeating-conic-gradient(rgba(255, 200, 61, .12) 0 10deg, transparent 10deg 20deg); animation: spin 18s linear infinite; mask-image: radial-gradient(circle, #000, transparent 60%); }
@keyframes spin { to { transform: rotate(360deg); } }
.bw-inner { position: relative; text-align: center; animation: bwIn .7s var(--spring); }
@keyframes bwIn { from { transform: scale(.3); opacity: 0; } }
.bw-tier { font-family: var(--display); font-size: clamp(48px, 10vw, 96px); font-weight: 900; letter-spacing: 2px; background: linear-gradient(180deg, #fff6c9, #ffc83d 55%, #e08800); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 0 #7a4a00) drop-shadow(0 0 40px rgba(255, 200, 61, .5)); animation: bwPulse 1s ease-in-out infinite; }
@keyframes bwPulse { 50% { transform: scale(1.05); } }
.bw-amt { font-family: var(--display); font-size: clamp(34px, 6vw, 58px); font-weight: 800; color: #fff; text-shadow: 0 0 30px rgba(34, 214, 127, .7); }
.bw-sub { color: #c9d3e6; font-weight: 700; font-size: 18px; margin-top: 4px; }
.bw-hint { color: var(--muted); font-size: 12px; margin-top: 26px; letter-spacing: 1px; }

/* FX layer */
.fx-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 500; }
.fly-coin { position: fixed; z-index: 501; pointer-events: none; width: 24px; height: 24px; color: var(--gold); filter: drop-shadow(0 0 6px rgba(255, 200, 61, .7)); }
.fly-coin .ic { width: 24px; height: 24px; }
.float-text { position: fixed; z-index: 502; pointer-events: none; transform: translateX(-50%); font-family: var(--display); font-weight: 800; font-size: 15px; animation: floatUp 1.4s var(--ease) forwards; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 0) scale(.7); } 20% { opacity: 1; transform: translate(-50%, 6px) scale(1.05); } 100% { opacity: 0; transform: translate(-50%, 34px); } }
.fx-shake { animation: shake .45s cubic-bezier(.36, .07, .19, .97); }
.fx-shake-lg { animation: shakeLg .6s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }
@keyframes shakeLg { 10%, 90% { transform: translate(-2px, 1px); } 20%, 80% { transform: translate(5px, -2px); } 30%, 50%, 70% { transform: translate(-8px, 2px); } 40%, 60% { transform: translate(8px, -1px); } }

/* ===== Rewards / Earn / Profile pages ===== */
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.page-head .ph-ic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--grad); box-shadow: 0 12px 30px -10px rgba(101, 116, 255, .8); }
.page-head .ph-ic .ic { width: 26px; height: 26px; }
.page-title { font-family: var(--display); font-size: 30px; font-weight: 800; margin: 0; letter-spacing: -.5px; }
.page-sub { color: var(--muted); margin: 2px 0 0; }
.reward-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.reward { padding: 24px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; transition: transform .3s var(--spring), box-shadow .3s; }
.reward:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--line2), 0 20px 40px -24px rgba(0, 0, 0, .8); }
.reward::before { content: ""; position: absolute; width: 220px; height: 220px; right: -80px; top: -90px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--rc) 22%, transparent), transparent 70%); }
.reward > * { position: relative; }
.reward .head { display: flex; align-items: center; gap: 14px; }
.reward .head .big { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--rc) 16%, var(--panel2)); color: var(--rc); flex-shrink: 0; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 30%, transparent); }
.reward .head .big .ic { width: 28px; height: 28px; }
.reward h3 { margin: 0; font-size: 17px; font-family: var(--display); }
.reward p { margin: 0; color: var(--muted); line-height: 1.5; }
.reward .value { font-family: var(--display); font-size: 30px; font-weight: 800; }
.streak { display: flex; gap: 6px; }
.streak i { flex: 1; height: 38px; border-radius: 9px; background: var(--panel2); font-style: normal; font-size: 11px; font-weight: 800; display: grid; place-items: center; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); transition: all .3s; }
.streak i .ic { width: 14px; height: 14px; }
.streak i.done { background: rgba(34, 214, 127, .14); color: var(--green); box-shadow: inset 0 0 0 1px rgba(34, 214, 127, .3); }
.streak i.today { box-shadow: inset 0 0 0 2px var(--gold), 0 0 16px -2px rgba(255, 200, 61, .6); color: var(--gold); animation: todayPulse 1.6s infinite; }
@keyframes todayPulse { 50% { transform: translateY(-2px); } }
.ring { position: relative; width: 130px; height: 130px; margin: 4px auto; }
.ring svg { transform: rotate(-90deg); }
.ring .rw-ring { transition: stroke-dashoffset .9s linear, stroke .3s; filter: drop-shadow(0 0 6px currentColor); }
.ring .t { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 24px; }
.ring .t .ic { width: 34px; height: 34px; color: var(--muted2); }

.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 16px; }
.task { padding: 22px; text-align: left; display: flex; flex-direction: column; gap: 10px; transition: transform .3s var(--spring), box-shadow .3s; }
.task:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 40%, transparent), 0 20px 40px -20px var(--tc); }
.task .big { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: var(--tc); background: color-mix(in srgb, var(--tc) 15%, var(--panel2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 30%, transparent); }
.task .big .ic { width: 28px; height: 28px; }
.task h3 { margin: 4px 0 0; font-family: var(--display); }
.task p { margin: 0; color: var(--muted); flex: 1; line-height: 1.5; }
.lock-banner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; background: rgba(255, 200, 61, .07); box-shadow: inset 0 0 0 1px rgba(255, 200, 61, .3); color: var(--gold); font-weight: 700; margin-bottom: 18px; }
.lock-banner .ic { width: 20px; height: 20px; }
.task-area { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.task-done .td-ic { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: rgba(34, 214, 127, .15); color: var(--green); animation: badgeIn .7s var(--spring); box-shadow: 0 0 0 10px rgba(34, 214, 127, .06); }
.task-done .td-ic .ic { width: 42px; height: 42px; }
.task-fail .td-ic { background: rgba(255, 77, 106, .12); color: var(--red); box-shadow: 0 0 0 10px rgba(255, 77, 106, .05); }
.aim-field { position: relative; width: 100%; height: 320px; background: radial-gradient(circle at 50% 50%, var(--panel2), var(--bg2)); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; cursor: crosshair; }
.aim-target { position: absolute; width: 50px; height: 50px; border-radius: 50%; transform: translate(-50%, -50%); animation: targetIn .3s var(--spring); cursor: crosshair;
  background: radial-gradient(circle, #fff 0 16%, var(--red) 17% 38%, #fff 39% 56%, var(--red) 57%); box-shadow: 0 0 24px rgba(255, 77, 106, .6); }
.aim-target::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(255, 77, 106, .5); animation: ringOut 1s infinite; }
@keyframes targetIn { from { transform: translate(-50%, -50%) scale(0); } }
.aim-hit { position: absolute; width: 50px; height: 50px; border-radius: 50%; transform: translate(-50%, -50%); border: 3px solid var(--green); animation: hitRing .4s var(--ease) forwards; pointer-events: none; }
@keyframes hitRing { to { transform: translate(-50%, -50%) scale(2); opacity: 0; } }
.mem-grid { display: grid; grid-template-columns: repeat(4, 68px); gap: 10px; perspective: 800px; }
.mem-card { width: 68px; height: 68px; position: relative; transform-style: preserve-3d; transition: transform .45s var(--spring); }
.mem-card .mf, .mem-card .mb { position: absolute; inset: 0; border-radius: 12px; display: grid; place-items: center; backface-visibility: hidden; }
.mem-card .mb { background: var(--grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.mem-card .mb .ic { width: 26px; height: 26px; opacity: .55; }
.mem-card .mf { background: var(--panel2); transform: rotateY(180deg); box-shadow: inset 0 0 0 1px var(--line2); }
.mem-card .mf .ic { width: 38px; height: 38px; }
.mem-card.open, .mem-card.done { transform: rotateY(180deg); }
.mem-card.done .mf { box-shadow: inset 0 0 0 2px var(--green), 0 0 18px -4px var(--green); }
.mem-card:hover:not(.open):not(.done) { transform: translateY(-3px); }
.math-q { font-family: var(--display); font-size: 46px; font-weight: 800; letter-spacing: -.5px; }
.math-q.pop { animation: popIn .4s var(--spring); }
.task-progress { display: flex; gap: 6px; }
.task-progress i { width: 30px; height: 6px; border-radius: 4px; background: var(--panel3); transition: background .3s, box-shadow .3s; }
.task-progress i.on { background: var(--green); box-shadow: 0 0 10px rgba(34, 214, 127, .6); }
.type-text { font-size: 19px; font-weight: 700; background: var(--bg2); padding: 16px 20px; border-radius: 12px; line-height: 1.7; max-width: 520px; user-select: none; box-shadow: inset 0 0 0 1px var(--line); letter-spacing: .3px; }
.type-text .ok { color: var(--green); }
.type-text .bad { color: var(--red); background: rgba(255, 77, 106, .15); border-radius: 3px; }
.type-text .cur { border-left: 2px solid var(--accent); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { border-color: transparent; } }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { padding: 18px; display: flex; gap: 12px; align-items: center; }
.stat .st-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--panel2); color: var(--accent); flex-shrink: 0; }
.stat .st-ic .ic { width: 20px; height: 20px; }
.stat small { color: var(--muted); font-weight: 700; font-size: 12px; }
.stat div div { font-family: var(--display); font-size: 21px; font-weight: 800; margin-top: 2px; }
.profile-card { padding: 22px; margin-bottom: 18px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.avatar { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: var(--grad); font-family: var(--display); font-weight: 800; font-size: 28px; box-shadow: 0 14px 30px -10px rgba(101, 116, 255, .8); flex-shrink: 0; }

/* ===== Cards (playing) ===== */
.pcard { width: 80px; height: 114px; position: relative; flex-shrink: 0; perspective: 600px; animation: dealIn .45s var(--ease) both; }
.pcard .pc-face, .pcard .pc-back { position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; transition: transform .5s var(--ease); }
.pcard .pc-face {
  background: linear-gradient(160deg, #fff, #eef2fa); color: #1b2233; box-shadow: 0 8px 20px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(0, 0, 0, .06);
  display: flex; flex-direction: column; justify-content: space-between; padding: 7px 8px; font-family: var(--display); font-weight: 800; overflow: hidden;
}
.pcard.red .pc-face { color: #e0314f; }
.pcard .r, .pcard .r2 { font-size: 19px; line-height: 1; display: flex; flex-direction: column; align-items: center; width: 20px; }
.pcard .r i, .pcard .r2 i { font-style: normal; display: block; margin-top: 2px; }
.pcard .r i .ic, .pcard .r2 i .ic { width: 11px; height: 11px; display: block; }
.pcard .s { align-self: center; line-height: 0; }
.pcard .s .ic { width: 30px; height: 30px; }
.pcard .r2 { align-self: flex-end; transform: rotate(180deg); }
.pcard .pc-back {
  transform: rotateY(180deg); display: grid; place-items: center;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .06) 0 6px, transparent 6px 12px), var(--grad);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35), inset 0 0 0 3px rgba(255, 255, 255, .85), inset 0 0 0 5px rgba(79, 140, 255, .9);
}
.pcard .pc-back .ic { width: 40px; height: 40px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3)); }
.pcard.back .pc-face { transform: rotateY(-180deg); }
.pcard.back .pc-back { transform: rotateY(0); }
.pcard.flip-in .pc-face { animation: flipFace .55s var(--ease) both; }
.pcard.flip-in .pc-back { animation: flipBack .55s var(--ease) both; }
.pcard.flip-in { animation: none; }
@keyframes flipFace { from { transform: rotateY(-180deg); } }
@keyframes flipBack { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
.pcard.win .pc-face { box-shadow: 0 0 0 3px var(--green), 0 0 24px rgba(34, 214, 127, .6); }
.pcard.lose .pc-face { box-shadow: 0 0 0 3px var(--red), 0 0 24px rgba(255, 77, 106, .5); }
.pcard.sm { width: 46px; height: 64px; }
.pcard.sm .pc-face { padding: 4px 5px; border-radius: 7px; }
.pcard.sm .pc-back { border-radius: 7px; }
.pcard.sm .r, .pcard.sm .r2 { font-size: 13px; width: 12px; }
.pcard.sm .r i .ic, .pcard.sm .r2 i .ic { width: 8px; height: 8px; }
.pcard.sm .s .ic { width: 18px; height: 18px; }
.pcard.sm .pc-back .ic { width: 22px; height: 22px; }
@keyframes dealIn { from { transform: translate(40px, -60px) rotate(-14deg); opacity: 0; } }

/* ===== Responsive ===== */
.scrim { display: none; }
@media (max-width: 1100px) {
  .promo-row { grid-template-columns: 1fr; }
  .hero-art { opacity: .35; right: -60px; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; transform: translateX(-100%); background: rgba(11, 16, 28, .97); }
  .sidebar.open { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .6); }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); z-index: 30; animation: fadeIn .3s; }
  .menu-btn { display: grid; place-items: center; }
  .game { grid-template-columns: 1fr; }
  .panel { border-right: 0; border-top: 1px solid var(--line); order: 2; }
  .stage { order: 1; min-height: 380px; padding: 16px; }
  .game-info { order: 3; }
  .game-info .gi-right { margin-left: 0; }
  .view { padding: 16px; }
  .bets-wrap { padding: 0 16px 30px; }
  .level-chip .lv-text, .top-btn .lbl { display: none; }
  .hero { padding: 28px 24px; }
  .hero h1 { font-size: 32px; }
  .hero-art { display: none; }
  table.bets .hide-sm { display: none; }
  .game-head .tag { display: none; }
}
@media (max-width: 480px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .wallet .bal { padding: 0 8px; font-size: 14px; min-width: 0; }
  .wallet .refill-btn span { display: none; }
  .wallet .refill-btn.waiting span, .wallet .refill-btn.ready span { display: inline; }
  .top-btn { padding: 0 11px; }
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hero-stats { gap: 16px; }
  .hero-stats div { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
