:root {
  --bg: #0d1016;
  --bg-2: #141922;
  --card: #1a202b;
  --card-2: #222a37;
  --line: #2a3342;
  --text: #eef2f8;
  --muted: #8a95a8;
  --accent: #19c6b1;
  --accent-2: #3b82f6;
  --accent-grad: linear-gradient(135deg, #19c6b1 0%, #3b82f6 100%);
  --gold: #f5b83d;
  --danger: #ff5a6a;
  --ton: #0098ea;
  --r: 18px;
  --tabbar-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  min-height: 100vh;
  overscroll-behavior: none;
  user-select: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
[hidden] { display: none !important; }
img { -webkit-user-drag: none; }

.ic {
  width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.art-fallback { width: 46%; height: 46%; color: var(--muted); stroke-width: 1.5; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: rgba(13, 16, 22, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.avatar {
  position: relative; width: 44px; height: 44px; border-radius: 14px; flex: none;
  background: linear-gradient(145deg, #2b3445, #1b212c); border: 1px solid var(--line);
  display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #dfe6f1; letter-spacing: .02em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar-lg { width: 84px; height: 84px; border-radius: 26px; font-size: 28px; margin: 0 auto 12px; }
.vip-dot {
  position: absolute; right: -5px; bottom: -5px; width: 20px; height: 20px; border-radius: 7px;
  background: var(--card-2); border: 2px solid var(--bg); color: var(--vc);
  font-style: normal; display: grid; place-items: center;
}
.vip-dot .ic { width: 12px; height: 12px; stroke-width: 2.4; }
.vip-badge {
  width: 30px; height: 30px; border-radius: 10px; flex: none; display: inline-grid; place-items: center;
  color: var(--vc); background: color-mix(in srgb, var(--vc) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--vc) 35%, transparent);
}
.vip-badge .ic { width: 16px; height: 16px; }
.vip-badge.lg { width: 52px; height: 52px; border-radius: 16px; }
.vip-badge.lg .ic { width: 26px; height: 26px; stroke-width: 1.8; }
.vip-badge.sm { width: 20px; height: 20px; border-radius: 6px; }
.vip-badge.sm .ic { width: 12px; height: 12px; }
.bal { flex: 1; min-width: 0; line-height: 1.15; }
.bal small { color: var(--muted); font-size: 12px; font-weight: 600; }
.bal b { display: flex; align-items: center; gap: 6px; font-size: 19px; font-weight: 800; }

.ton-ico {
  display: inline-block; width: 1.05em; height: 1.05em; flex: none; border-radius: 50%;
  background: url("/static/ton.svg?v=1") center/contain no-repeat;
  vertical-align: -0.15em;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 20px; border-radius: 14px;
  font-weight: 700; font-size: 16px;
  background: var(--card-2); transition: transform .08s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-accent { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 20px -8px rgba(25, 198, 177, .7); }
.btn-gold { background: linear-gradient(135deg, #ffd56b, #f59e0b); color: #2a1a00; }
.btn-warn { background: linear-gradient(135deg, #ff8a3d, #ff4d6d); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-sm { height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn-block { width: 100%; }

/* ---------- layout ---------- */
#view { padding: 14px 16px calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; font-size: 19px; font-weight: 800; }
.section-title > .ic { color: var(--accent); width: 20px; height: 20px; }
.page-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.page-head h1 { font-size: 24px; font-weight: 800; }
.back { width: 40px; height: 40px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; }
.back .ic { width: 20px; height: 20px; }
.btn .ic { width: 19px; height: 19px; }
.empty-ico {
  width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 22px; display: grid; place-items: center;
  color: var(--accent); background: rgba(25, 198, 177, .1); border: 1px solid rgba(25, 198, 177, .25);
}
.empty-ico .ic { width: 30px; height: 30px; stroke-width: 1.7; }
.feature-ico {
  width: 58px; height: 58px; flex: none; border-radius: 18px; display: grid; place-items: center;
  background: var(--accent-grad); color: #fff; box-shadow: 0 8px 22px -10px rgba(25, 198, 177, .9);
}
.feature-ico .ic { width: 28px; height: 28px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.muted { color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack { display: grid; gap: 12px; }

/* ---------- live strip ---------- */
.live { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.live-label {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.live-label::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2ee07a; box-shadow: 0 0 8px #2ee07a; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.live-track { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; padding: 2px 0; }
.live-track::-webkit-scrollbar { display: none; }
.live-item img { width: 80%; height: 80%; object-fit: contain; }
.live-item {
  flex: none; width: 56px; height: 56px; border-radius: 14px;
  display: grid; place-items: center; font-size: 28px;
  background: var(--card); border: 2px solid var(--rc, var(--line));
  animation: pop .35s ease-out;
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* ---------- game banners ---------- */
.banner {
  position: relative; overflow: hidden; display: flex; align-items: flex-end;
  height: 122px; border-radius: 22px; padding: 16px 18px; margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,.08);
  isolation: isolate;
}
.banner::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(60% 120% at 85% 50%, rgba(255,255,255,.22), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 2px, transparent 2px 14px);
}
.b-title {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 23px; font-weight: 800; letter-spacing: .01em; text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.b-title .ic { width: 24px; height: 24px; stroke-width: 2.2; }
.banner .art { position: absolute; right: 0; top: 0; bottom: 0; width: 48%; z-index: -1; }
.banner .art img { position: absolute; object-fit: contain; filter: drop-shadow(0 12px 18px rgba(0,0,0,.45)); }
.banner .art .a1 { width: 104px; height: 104px; right: 18px; top: 50%; transform: translateY(-50%) rotate(-6deg); }
.banner .art .a2 { width: 62px; height: 62px; right: 112px; top: 12px; transform: rotate(10deg); opacity: .9; }
.banner .tag {
  position: absolute; left: 16px; top: 14px; display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(10, 12, 16, .55); color: #fff; padding: 5px 10px 5px 8px; border-radius: 9px;
  backdrop-filter: blur(6px);
}
.banner .tag .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.banner.soon::after {
  content: "СКОРО"; position: absolute; left: 16px; bottom: 50px; font-size: 10px; font-weight: 800;
  color: rgba(255,255,255,.75); letter-spacing: .12em;
}
.b-rocket { background: linear-gradient(120deg, #1d3f9e 0%, #2f6fe0 55%, #58b6f5 100%); }
.b-pvp { background: linear-gradient(120deg, #8a3a0c 0%, #d9771c 55%, #f7b541 100%); }
.b-hub { background: linear-gradient(120deg, #0d4a45 0%, #13897c 55%, #2cc9a3 100%); }
.b-daily { background: linear-gradient(120deg, #5a1030 0%, #b3264f 55%, #f0567a 100%); }

/* ---------- case cards ---------- */
.case-card {
  position: relative; border-radius: 20px; overflow: hidden; background: var(--card);
  border: 1px solid var(--line); display: flex; flex-direction: column;
  transition: transform .1s;
}
.case-card:active { transform: scale(.97); }
.case-art {
  position: relative; aspect-ratio: 1 / .95; display: grid; place-items: center;
  font-size: 72px; isolation: isolate;
}
.case-art::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--theme); opacity: .95; }
.case-art .mini { position: absolute; font-size: 28px; opacity: .9; filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); }
.case-art .mini.m1 { left: 12%; top: 16%; transform: rotate(-14deg); }
.case-art .mini.m2 { right: 12%; bottom: 14%; transform: rotate(12deg); }
.case-art .main { filter: drop-shadow(0 12px 18px rgba(0,0,0,.5)); width: 62%; height: 62%; display: grid; place-items: center; }
.case-art .mini { width: 30%; height: 30%; display: grid; place-items: center; }
.case-art img { width: 100%; height: 100%; object-fit: contain; }
.ton-big {
  display: block; width: 62%; aspect-ratio: 1; border-radius: 50%;
  background: url("/static/ton.svg?v=1") center/contain no-repeat;
  box-shadow: 0 8px 22px -8px rgba(0,152,234,.85);
}
.case-art .ton-big, .strip .cell .ton-big, .live-item .ton-big { width: 70%; }
.case-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 8px 10px 11px; min-width: 0; }
.case-foot b { font-size: clamp(13px, 3.8vw, 15px); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
.case-foot .price-pill { flex: none; padding: 6px 8px; font-size: 13px; gap: 4px; }
.price-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; border-radius: 11px;
  background: var(--card-2); font-weight: 800; font-size: 14px;
}
.case-card .ribbon {
  position: absolute; left: 10px; top: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em; padding: 5px 9px 5px 7px; border-radius: 9px;
  background: var(--gold); color: #2a1a00;
}
.case-card .ribbon .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.ribbon.hit { background: #ff5a3d; color: #fff; }
.ribbon.limited { background: #1f1f1f; color: #ffb35c; border: 1px solid #ffb35c55; }
.t-green { --theme: radial-gradient(90% 90% at 50% 40%, #34d399, #065f46); }
.t-orange { --theme: radial-gradient(90% 90% at 50% 40%, #fb923c, #7c2d12); }
.t-gold { --theme: radial-gradient(90% 90% at 50% 40%, #fcd34d, #78350f); }
.t-blue { --theme: radial-gradient(90% 90% at 50% 40%, #60a5fa, #1e1b4b); }
.t-pink { --theme: radial-gradient(90% 90% at 50% 40%, #f472b6, #500724); }
.t-red { --theme: radial-gradient(90% 90% at 50% 40%, #f87171, #450a0a); }
.t-violet { --theme: radial-gradient(90% 90% at 50% 40%, #a78bfa, #2e1065); }

/* ---------- item tiles ---------- */
.item {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 10px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.item-art {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 14px; display: grid; place-items: center;
  font-size: 56px; background: radial-gradient(80% 80% at 50% 40%, color-mix(in srgb, var(--rc) 28%, transparent), transparent 70%), var(--bg-2);
  border: 2px solid color-mix(in srgb, var(--rc) 65%, transparent);
}
.item-art img { width: 78%; height: 78%; object-fit: contain; }
.item-price {
  position: absolute; right: 6px; top: 6px; display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 800; padding: 4px 7px; border-radius: 9px; background: rgba(0,0,0,.65);
}
.item-name { font-weight: 700; font-size: 14px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip {
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 8px;
  color: color-mix(in srgb, var(--rc) 70%, white);
  background: color-mix(in srgb, var(--rc) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--rc) 35%, transparent);
}
.item .chance { font-size: 11px; color: var(--muted); font-weight: 600; }
.item .sell { width: 100%; margin-top: 2px; }

/* ---------- roulette ---------- */
.roulette {
  position: relative; overflow: hidden; height: 112px; border-radius: 20px;
  background: var(--bg-2); border: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.roulette-wrap { position: relative; margin-bottom: 14px; }
.roulette-wrap::before, .roulette-wrap::after {
  content: ""; position: absolute; left: 50%; z-index: 3; width: 0; height: 0; transform: translateX(-50%);
  border-left: 9px solid transparent; border-right: 9px solid transparent;
}
.roulette-wrap::before { top: -1px; border-top: 12px solid var(--accent); }
.roulette-wrap::after { bottom: -1px; border-bottom: 12px solid var(--accent); }
.roulette .needle { position: absolute; left: 50%; top: 10px; bottom: 10px; width: 2px; margin-left: -1px; background: var(--accent); z-index: 2; box-shadow: 0 0 12px var(--accent); }
.strip { display: flex; gap: 10px; position: absolute; left: 0; top: 12px; will-change: transform; }
.strip .cell {
  flex: none; width: 88px; height: 88px; border-radius: 16px; display: grid; place-items: center; font-size: 44px;
  background: radial-gradient(80% 80% at 50% 40%, color-mix(in srgb, var(--rc) 35%, transparent), transparent 75%), var(--card);
  border: 2px solid color-mix(in srgb, var(--rc) 70%, transparent);
}
.strip .cell img { width: 72%; height: 72%; object-fit: contain; }

/* ---------- lists ---------- */
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row b { display: inline-flex; align-items: center; gap: 6px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card); margin-bottom: 8px; }
.lb-row.me { outline: 2px solid var(--accent); }
.lb-place { width: 30px; font-weight: 800; color: var(--muted); text-align: center; }
.lb-row:nth-child(1) .lb-place { color: #ffd56b; } .lb-row:nth-child(2) .lb-place { color: #d6dde8; } .lb-row:nth-child(3) .lb-place { color: #e0955a; }
.lb-name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { text-align: center; padding: 28px 20px; }
.empty .big { font-size: 56px; margin-bottom: 8px; }
.empty h3 { font-size: 19px; margin-bottom: 8px; }
.empty p { color: var(--muted); margin: 0 0 18px; line-height: 1.45; }

.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: var(--card); margin-bottom: 18px; }
.tabs button { position: relative; padding: 12px 4px; border-radius: 12px; font-weight: 700; font-size: 13px; color: var(--muted); display: grid; gap: 6px; justify-items: center; }
.tabs button .ic { width: 20px; height: 20px; }
.tabs button.on { background: var(--accent-grad); color: #fff; }
.tabs .hot { position: absolute; top: -6px; right: 6px; font-size: 9px; font-weight: 800; background: #ff8a3d; color: #fff; padding: 2px 6px; border-radius: 6px; }

.progress { height: 10px; border-radius: 6px; background: var(--bg-2); overflow: hidden; margin: 10px 0 8px; }
.progress i { display: block; height: 100%; background: var(--accent-grad); border-radius: 6px; }

.input {
  width: 100%; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--text); padding: 0 14px; font: inherit; font-weight: 600; outline: none;
}
.input:focus { border-color: var(--accent); }

.admin-card { border-color: rgba(245, 184, 61, .45); background: linear-gradient(180deg, rgba(245, 184, 61, .08), transparent 60%), var(--card); }
.admin-tag { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--gold); }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding: 0 6px var(--safe-b);
  background: rgba(20, 25, 34, .94); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.tabbar a { position: relative; display: grid; justify-items: center; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 700; padding: 6px 0; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--text); }
.tabbar a.on svg { stroke: var(--accent); }
.tabbar a.home { margin: -26px auto 0; width: 64px; height: 64px; border-radius: 22px; place-content: center; background: var(--card-2); border: 1px solid var(--line); }
.tabbar a.home.on { background: var(--accent-grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(25,198,177,.9); }
.tabbar a.home.on svg { stroke: #fff; }
.tabbar .badge { position: absolute; top: 0; right: calc(50% - 22px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-style: normal; font-size: 11px; display: grid; place-items: center; padding: 0 5px; }

/* ---------- modal / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(4, 6, 10, .72); backdrop-filter: blur(6px); display: grid; place-items: end center; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal-card {
  width: 100%; max-width: 480px; background: var(--card); border-radius: 26px 26px 0 0; border: 1px solid var(--line);
  padding: 24px 18px calc(22px + var(--safe-b)); text-align: center; animation: up .28s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes up { from { transform: translateY(40%); opacity: 0; } }
.win-art {
  width: 150px; height: 150px; margin: 0 auto 14px; border-radius: 28px; display: grid; place-items: center; font-size: 86px;
  background: radial-gradient(80% 80% at 50% 40%, color-mix(in srgb, var(--rc) 45%, transparent), transparent 75%), var(--bg-2);
  border: 2px solid var(--rc); box-shadow: 0 0 50px -10px var(--rc);
  animation: winpop .5s cubic-bezier(.2,.9,.3,1.4);
}
.win-art img { width: 78%; height: 78%; object-fit: contain; }
@keyframes winpop { from { transform: scale(.4) rotate(-12deg); } }
.win-name { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.win-price { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 800; margin-bottom: 20px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); transform: translateX(-50%); z-index: 60;
  background: var(--card-2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 14px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100% - 32px); animation: fade .2s;
}
.toast.err { border-color: var(--danger); }

.skeleton { background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 18px; }
@keyframes sk { to { background-position: -200% 0; } }

/* =================== games =================== */
.game-card {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 104px; padding: 14px 16px;
  border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: var(--card); isolation: isolate;
}
.game-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--theme); opacity: .55; }
.game-card:active { transform: scale(.98); }
.game-art { position: relative; width: 84px; height: 76px; flex: none; }
.game-art img { position: absolute; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0,0,0,.45)); }
.game-art .g1 { width: 68px; height: 68px; left: 0; top: 4px; }
.game-art .g2 { width: 40px; height: 40px; right: 0; top: 0; transform: rotate(12deg); }
.game-info { flex: 1; min-width: 0; }
.game-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; }
.game-title .ic { width: 18px; height: 18px; }
.game-desc { color: rgba(238,242,248,.72); font-size: 13px; margin-top: 4px; line-height: 1.35; }
.game-go { width: 34px; height: 34px; border-radius: 11px; background: rgba(0,0,0,.28); display: grid; place-items: center; flex: none; }

.game-ctl { display: grid; gap: 10px; margin-top: 14px; }
.ctl-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.ctl-label b { color: var(--text); }
.ctl-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.bet-ctl { display: grid; grid-template-columns: 1fr 44px 44px 56px; gap: 6px; }
.bet-ctl.off { opacity: .55; }
.bet-field {
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line); font-size: 16px;
}
.bet-field:focus-within { border-color: var(--accent); }
.bet-field input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-weight: 800; }
.bet-op { height: 46px; border-radius: 12px; background: var(--card-2); font-weight: 800; font-size: 13px; color: #cfd6e2; }
.bet-op:active { transform: scale(.95); }
.auto-field { display: flex; align-items: center; gap: 6px; width: 130px; height: 42px; padding: 0 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.auto-field input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-weight: 800; text-align: right; }
.auto-field span { color: var(--muted); font-weight: 800; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 13px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { height: 36px; border-radius: 9px; font-weight: 800; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(25,198,177,.45); }
.seg.off { opacity: .55; }
.range { width: 100%; accent-color: var(--accent); }

.chips-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; min-height: 28px; }
.chips-row::-webkit-scrollbar { display: none; }
.mchip {
  flex: none; font-size: 12px; font-weight: 800; padding: 6px 9px; border-radius: 9px;
  color: var(--mc); background: color-mix(in srgb, var(--mc) 13%, transparent); border: 1px solid color-mix(in srgb, var(--mc) 30%, transparent);
}
.price-pill.small { padding: 3px 9px; font-size: 12px; }

.list-card { padding: 2px 16px; }
.list-card .row { gap: 10px; padding: 12px 0; }
.list-card .row.me .name { color: var(--accent); }
.list-card .name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bet-amt { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 14px; }
.bet-res { min-width: 64px; text-align: right; font-size: 13px; font-weight: 700; color: var(--muted); }
.bet-res.won, .bet-amt.won { color: #2ee07a; }
.bet-res.lost { color: var(--danger); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.empty.small { padding: 16px; }
.empty.small p { margin: 0; font-size: 14px; }

/* crash */
.crash-stage {
  position: relative; height: 260px; border-radius: 22px; overflow: hidden;
  background: radial-gradient(90% 80% at 20% 100%, rgba(25,198,177,.14), transparent 60%), linear-gradient(180deg, #121826, #0e131c);
  border: 1px solid var(--line);
}
.crash-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crash-rocket { position: absolute; left: 0; top: 0; width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0,0,0,.5)); transition: opacity .3s; will-change: transform; }
.crash-rocket.gone { opacity: 0; }
.crash-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.crash-mult { font-size: 52px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-shadow: 0 4px 24px rgba(0,0,0,.5); }
.crash-sub { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.crash-progress { position: absolute; left: 16px; right: 16px; bottom: 12px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.06); overflow: hidden; }
.crash-progress i { display: block; height: 100%; background: var(--accent-grad); transition: width .1s linear; }

/* mines */
.mines-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px; margin-bottom: 12px; text-align: center; }
.mines-stats small { display: block; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.mines-stats b { display: inline-flex; align-items: center; gap: 5px; font-size: 17px; }
.mines-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 10px; border-radius: 20px; background: var(--bg-2); border: 1px solid var(--line); }
.mines-grid.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.mcell {
  aspect-ratio: 1; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(180deg, #2a3342, #212938); border: 1px solid #334055; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25);
  transition: transform .1s, background .2s;
}
.mcell:not(.locked):active { transform: scale(.92); }
.mcell.locked { cursor: default; }
.mcell .ic { width: 46%; height: 46%; }
.mcell.pending { animation: pulse .6s infinite; }
.mcell.safe { background: radial-gradient(circle, rgba(46,224,122,.28), rgba(46,224,122,.06)); border-color: rgba(46,224,122,.55); color: #2ee07a; animation: pop .25s; }
.mcell.boom { background: radial-gradient(circle, rgba(255,90,106,.4), rgba(255,90,106,.1)); border-color: var(--danger); color: #fff; animation: pop .25s; }
.mcell.dim { opacity: .45; background: var(--card); box-shadow: none; }
.mcell.dim .ic { color: var(--muted); }

/* plinko */
.plinko-board { padding: 12px; display: grid; justify-items: center; }
.plinko-board canvas { display: block; }
.plinko-buckets { display: grid; gap: 2px; justify-content: center; margin-top: 4px; }
.plinko-buckets span {
  height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: inherit; font-weight: 800; color: #10141b;
  background: var(--bc); overflow: hidden; white-space: nowrap; letter-spacing: -.03em;
}
.plinko-buckets span.hit { animation: bucket .45s; }
@keyframes bucket { 30% { transform: translateY(5px); filter: brightness(1.4); } }

/* upgrade */
.upg-ring { position: relative; display: grid; place-items: center; padding: 18px; }
.ring { width: 220px; height: 220px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg-2); stroke-width: 16; }
.ring-arc { fill: none; stroke: var(--accent); stroke-width: 16; stroke-linecap: round; transition: stroke-dasharray .4s; filter: drop-shadow(0 0 8px rgba(25,198,177,.5)); }
.needle { position: absolute; width: 220px; height: 220px; left: 50%; top: 50%; margin: -110px 0 0 -110px; pointer-events: none; }
.needle i { position: absolute; left: 50%; top: -4px; width: 0; height: 0; margin-left: -9px; border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 18px solid #fff; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.ring-center { position: absolute; text-align: center; }
.ring-center b { display: block; font-size: 34px; font-weight: 800; }
.ring-center small { color: var(--muted); font-weight: 700; }
.upg-slots { display: grid; grid-template-columns: 1fr 34px 1fr; align-items: center; gap: 8px; margin: 12px 0; }
.upg-arrow { color: var(--accent); display: grid; place-items: center; }
.upg-slot { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 10px; display: grid; gap: 6px; justify-items: center; text-align: center; min-height: 170px; align-content: center; }
.upg-slot .item-art { width: 100%; }
.slot-empty { width: 64px; height: 64px; border-radius: 18px; border: 2px dashed var(--line); display: grid; place-items: center; color: var(--muted); }
.slot-price { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 14px; }
.upg-mults button { font-size: 13px; }
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 60vh; overflow-y: auto; text-align: center; }
.pick { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px; display: grid; gap: 4px; justify-items: center; }
.pick .item-art { width: 100%; font-size: 30px; }
.pick span { font-size: 11px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick b { font-size: 12px; }
.pick em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--accent); }

/* pvp */
.pvp-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.pvp-top small { display: block; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.pvp-top b { display: inline-flex; align-items: center; gap: 6px; font-size: 20px; }
.pvp-wheel { position: relative; width: 250px; height: 250px; margin: 0 auto; }
.wheel { width: 100%; height: 100%; transform-origin: 50% 50%; }
.pvp-pointer { position: absolute; left: 50%; top: -6px; z-index: 2; margin-left: -11px; width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-top: 22px solid #fff; filter: drop-shadow(0 3px 6px rgba(0,0,0,.6)); }
.wheel-center { position: absolute; inset: 58px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); display: grid; place-content: center; text-align: center; padding: 10px; }
.wheel-center small { color: var(--muted); font-weight: 700; font-size: 12px; }
.wheel-center b { font-size: 20px; font-weight: 800; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wheel-center em { font-style: normal; color: #2ee07a; font-weight: 800; font-size: 14px; }

/* promo */
.promo-card { display: grid; gap: 10px; padding: 14px 16px; }
.promo-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.promo-head .ic { color: var(--accent); }
.promo-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.promo-row .input { height: 42px; text-transform: uppercase; letter-spacing: .06em; }
.promo-row .btn { height: 42px; }
.promo-list { display: grid; gap: 8px; }
.promo-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.promo-item.off { opacity: .55; }
.promo-code { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; letter-spacing: .06em; justify-self: start; }
.promo-code .ic { width: 14px; height: 14px; color: var(--muted); }
.promo-meta { grid-column: 1; font-size: 12px; color: var(--muted); }
.promo-item .btn { grid-column: 2; grid-row: 1 / span 2; }
/* =================== layout hardening: одинаково на любом экране =================== */
html, body { max-width: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, #view { overflow-x: clip; }
body { font-size: 15px; }
input, button, select, textarea { font-size: inherit; min-width: 0; }
img, svg, canvas { max-width: 100%; }

:root { --app-w: 480px; }
#view { width: 100%; max-width: var(--app-w); margin: 0 auto; }
.topbar { padding-left: max(16px, calc((100% - var(--app-w)) / 2 + 16px)); padding-right: max(16px, calc((100% - var(--app-w)) / 2 + 16px)); }
.tabbar { padding-left: max(6px, calc((100% - var(--app-w)) / 2 + 6px)); padding-right: max(6px, calc((100% - var(--app-w)) / 2 + 6px)); }
.modal-card { max-width: var(--app-w); }
.toast { max-width: min(calc(100% - 32px), calc(var(--app-w) - 32px)); }

.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tabs, .seg { grid-auto-columns: minmax(0, 1fr); }
.tabbar { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bet-ctl { grid-template-columns: minmax(0, 1fr) 42px 42px 52px; }
.bet-field { min-width: 0; }
.bet-field input { width: 100%; }
.mines-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mines-stats b { font-size: 16px; white-space: nowrap; }
.mines-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.upg-slots { grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr); }
.pick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.promo-row { grid-template-columns: minmax(0, 1fr) auto; }
.promo-item { grid-template-columns: minmax(0, 1fr) auto; }
.promo-row .input, .input { width: 100%; }
.card, .game-ctl, .banner, .case-card, .item { min-width: 0; }
.ctl-inline { min-width: 0; }
.auto-field { width: 120px; flex: none; }

.bal b { font-size: clamp(16px, 5vw, 19px); white-space: nowrap; }
#depositBtn { flex: none; }
.b-title { font-size: clamp(18px, 5.6vw, 23px); position: relative; z-index: 1; }
.banner .art .a1 { width: clamp(78px, 26vw, 104px); height: clamp(78px, 26vw, 104px); }
.banner .art .a2 { width: clamp(46px, 15vw, 62px); height: clamp(46px, 15vw, 62px); right: clamp(84px, 28vw, 112px); }
.crash-mult { font-size: clamp(40px, 13vw, 52px); }
.page-head h1 { font-size: clamp(20px, 6vw, 24px); }

.ring, .needle { width: min(220px, 62vw); height: min(220px, 62vw); }
.needle { margin: calc(min(220px, 62vw) / -2) 0 0 calc(min(220px, 62vw) / -2); }
.pvp-wheel { width: min(250px, 70vw); height: min(250px, 70vw); }
.wheel-center { inset: 23%; }

@media (max-width: 360px) {
  #view { padding-left: 12px; padding-right: 12px; }
  .grid2 { gap: 10px; }
  .bet-ctl { grid-template-columns: minmax(0, 1fr) 38px 38px 46px; gap: 5px; }
  .bet-op { font-size: 12px; }
  .tabbar a span { font-size: 10px; }
  #depositBtn { padding: 0 10px; }
}
.offline { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(8, 10, 14, .92); backdrop-filter: blur(8px); }
.offline .card { width: 100%; max-width: 400px; }
/* gift bets */
.bet-wrap { display: grid; gap: 8px; min-width: 0; }
.bet-wrap.off { opacity: .55; }
.bet-mode { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 3px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.bet-mode button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; border-radius: 9px; font-weight: 800; font-size: 13px; color: var(--muted); }
.bet-mode button .ic { width: 15px; height: 15px; }
.bet-mode button.on { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(25,198,177,.45); }
.gift-pick { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 12px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--line); text-align: left; min-width: 0; }
.gp-empty { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: 14px; }
.gp-thumbs, .gthumbs { display: inline-flex; flex: none; }
.gp-thumbs i, .gthumbs i { width: 30px; height: 30px; border-radius: 9px; margin-left: -8px; display: grid; place-items: center; background: var(--card-2); border: 1.5px solid color-mix(in srgb, var(--rc) 70%, transparent); }
.gp-thumbs i:first-child, .gthumbs i:first-child { margin-left: 0; }
.gp-thumbs img, .gthumbs img { width: 80%; height: 80%; object-fit: contain; }
.gthumbs i { width: 24px; height: 24px; border-radius: 7px; }
.gthumbs em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--muted); margin-left: 4px; align-self: center; }
.gp-text { flex: 1; min-width: 0; font-size: 14px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; }
.gp-edit { font-size: 12px; font-weight: 800; color: var(--accent); flex: none; }
.pick.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(25,198,177,.35); }
.pick .item-art { position: relative; }
.pick-check { position: absolute; right: 4px; top: 4px; width: 20px; height: 20px; border-radius: 50%; display: none; place-items: center; background: var(--accent); color: #fff; }
.pick-check .ic { width: 13px; height: 13px; stroke-width: 3; }
.pick.sel .pick-check { display: grid; }

/* deposit */
.dep-card { gap: 12px; }
.dep-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.dep-head b { display: block; font-size: 16px; }
.dep-head small { color: var(--muted); font-size: 12px; }
.tc-root { display: flex; justify-content: center; min-height: 40px; }
.dep-manual { margin-top: 12px; padding: 14px 16px; }
.dep-manual summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.copy-row small { grid-column: 1; color: var(--muted); font-size: 11px; font-weight: 700; }
.copy-row code { grid-column: 1; font-size: 13px; font-weight: 700; word-break: break-all; user-select: all; }
.copy-row .btn { grid-column: 2; grid-row: 1 / span 2; }
.dep-warn { display: flex; gap: 8px; font-size: 13px; line-height: 1.4; color: #ffcf7a; padding: 10px 12px; border-radius: 12px; background: rgba(245,184,61,.08); border: 1px solid rgba(245,184,61,.3); }
.dep-warn .ic { flex: none; margin-top: 2px; }
.won-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 46vh; overflow-y: auto; }
.won-gift { display: grid; gap: 4px; justify-items: center; padding: 8px; border-radius: 14px; background: var(--bg-2); border: 1px solid color-mix(in srgb, var(--rc) 45%, var(--line)); animation: pop .3s; }
.won-gift .item-art { width: 100%; }
.won-gift span { font-size: 11px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.won-gift b { font-size: 12px; }
.win-price small { display: block; }
/* upgrade shortcuts */
.inv-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; width: 100%; margin-top: 2px; }
.inv-actions .btn { height: 34px; padding: 0 8px; font-size: 13px; border-radius: 10px; gap: 5px; white-space: nowrap; overflow: hidden; }
.inv-actions .btn .ic { width: 14px; height: 14px; }
.btn-up { background: linear-gradient(135deg, #ffd56b, #f59e0b); color: #2a1a00; }
.won-up { display: inline-flex; align-items: center; justify-content: center; gap: 3px; width: 100%; margin-top: 2px; padding: 5px 4px; border-radius: 8px; font-size: 11px; font-weight: 800; background: linear-gradient(135deg, #ffd56b, #f59e0b); color: #2a1a00; }
.won-up .ic { width: 12px; height: 12px; }
/* admin */
.adm-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; padding-bottom: 2px; }
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tabs a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); }
.adm-tabs a .ic { width: 15px; height: 15px; }
.adm-tabs a.on { background: var(--accent-grad); color: #fff; border-color: transparent; }
.adm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; }
.adm-grid small, .adm-alerts small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.adm-grid b, .adm-alerts b { font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }
.adm-stat { margin-top: 12px; }
.adm-stat-title { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.adm-alerts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pos { color: #2ee07a; } .neg { color: var(--danger); }
.adm-search { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 8px; }
select.input { appearance: none; background: var(--bg-2); }
.adm-user { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.adm-user > div { min-width: 0; }
.adm-user small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-user .r { text-align: right; flex: none; }
.adm-user-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.adm-user-head h2 { font-size: 19px; }
.adm-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: end; }
.adm-row .btn { height: 48px; }
.adm-label { display: grid; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); min-width: 0; }
.adm-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; min-height: 48px; }
.adm-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.adm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.adm-chip em { font-style: normal; color: var(--muted); }
.adm-chip button { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--card-2); }
.adm-chip .ic { width: 12px; height: 12px; }
.list-card .row small.muted { font-size: 11px; }

/* rules */
.rules { line-height: 1.5; font-size: 14px; }
.rules ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.rules p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.rules .list-card { padding: 0; background: none; border: 0; }
.adm-row:has(> .btn) { grid-template-columns: minmax(0, 1fr) auto; }
.adm-row:has(> .btn) .btn { padding: 0 16px; }

/* dice */
.dice-stage { padding: 22px 18px 14px; text-align: center; }
.dice-value { font-size: clamp(46px, 15vw, 64px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; transition: color .2s; }
.dice-value.win { color: #2ee07a; text-shadow: 0 0 30px rgba(46,224,122,.35); }
.dice-value.lose { color: var(--danger); }
.dice-bar { position: relative; height: 14px; border-radius: 8px; background: rgba(255,90,106,.35); margin: 16px 0 6px; overflow: visible; }
.dice-zone { position: absolute; top: 0; bottom: 0; border-radius: 8px; background: linear-gradient(90deg, #19c6b1, #2ee07a); transition: left .2s, width .2s; }
.dice-marker { position: absolute; top: -8px; width: 4px; height: 30px; margin-left: -2px; border-radius: 2px; background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.7); opacity: 0; transition: left .35s cubic-bezier(.2,.8,.2,1), opacity .2s; }
.dice-marker.show { opacity: 1; }
.dice-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 700; }
.dice-params { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.dice-params small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.dice-params b { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; }

/* coinflip */
.coin-face { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #ffe89a, #f5b83d 55%, #b87812); color: #5a3a00; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
.coin-face.tails { background: radial-gradient(circle at 35% 30%, #f1f5fb, #aebbd0 55%, #6d7a8f); color: #2b3445; }
.coin-face .ic { width: 20px; height: 20px; stroke-width: 2.2; }
.list-card .coin-face { width: 28px; height: 28px; } .list-card .coin-face .ic { width: 15px; height: 15px; }
.cf-game { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 12px 14px; }
.cf-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cf-left > div { min-width: 0; } .cf-left b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-left small { font-size: 12px; }
.cf-mid { display: flex; align-items: center; gap: 6px; }
.cf-act { display: flex; gap: 6px; }
.cf-act .btn { height: 36px; }
.coin-anim { perspective: 800px; height: 150px; display: grid; place-items: center; margin-bottom: 8px; }
.coin { position: relative; width: 120px; height: 120px; transform-style: preserve-3d; transition: transform 2s cubic-bezier(.2,.7,.25,1); }
.coin-side { position: absolute; inset: 0; backface-visibility: hidden; display: grid; place-items: center; }
.coin-side .coin-face { width: 120px; height: 120px; box-shadow: 0 10px 30px rgba(0,0,0,.5), inset 0 -6px 0 rgba(0,0,0,.2); }
.coin-side .coin-face .ic { width: 56px; height: 56px; }
.coin-side.back { transform: rotateY(180deg); }

/* battles */
.bt-picked { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; align-items: center; }
.bt-cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.bt-case { padding: 9px 6px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); display: grid; gap: 2px; text-align: center; }
.bt-case b { font-size: 13px; } .bt-case small { font-size: 12px; color: var(--muted); display: inline-flex; gap: 4px; justify-content: center; align-items: center; }
.bt-case:active { transform: scale(.96); }
.bt-row { display: grid; gap: 8px; padding: 12px 14px; }
.bt-row-cases { display: flex; flex-wrap: wrap; gap: 4px; }
.bt-row-cases span { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 7px; background: var(--bg-2); border: 1px solid var(--line); }
.bt-row-info { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.bt-row-info .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bt-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.bt-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bt-slot { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; border: 1px dashed var(--line); background: var(--bg-2); min-width: 0; }
.bt-slot.full { border-style: solid; border-color: rgba(25,198,177,.4); }
.bt-slot b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-arena { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 6px; }
.bt-col { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px 6px; display: grid; gap: 6px; align-content: start; transition: border-color .3s, box-shadow .3s; }
.bt-col.lead { border-color: rgba(245,184,61,.6); }
.bt-col.winner { border-color: #2ee07a; box-shadow: 0 0 24px -6px rgba(46,224,122,.7); }
.bt-col-head { display: flex; align-items: center; gap: 5px; font-size: 12px; min-width: 0; }
.bt-col-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-col-head .ic { width: 14px; height: 14px; flex: none; }
.bt-total { font-size: 18px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.bt-items { display: grid; gap: 5px; }
.bt-item { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border-radius: 10px; background: var(--bg-2); border: 1px solid color-mix(in srgb, var(--rc) 45%, var(--line)); animation: pop .3s; text-align: center; }
.bt-item .item-art { width: 70%; border-width: 1.5px; border-radius: 10px; font-size: 26px; }
.bt-item small { font-size: 10px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-item b { font-size: 11px; }
/* retention */
.streak-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.sd { display: grid; justify-items: center; gap: 2px; padding: 7px 2px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); font-size: 11px; }
.sd small { color: var(--muted); font-weight: 700; font-size: 10px; }
.sd b { font-size: 12px; }
.sd .ton-ico { font-size: 11px; }
.sd.done { background: rgba(25,198,177,.12); border-color: rgba(25,198,177,.45); }
.sd.next { border-color: var(--gold); box-shadow: 0 0 14px -4px rgba(245,184,61,.8); }
.dep-head .ic { color: var(--gold); width: 26px; height: 26px; }
.quest { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; }
.quest.claimed { opacity: .55; }
.q-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(25,198,177,.1); color: var(--accent); }
.q-ico .ic { width: 20px; height: 20px; }
.q-body b { font-size: 14px; }
.q-body .progress { margin: 6px 0 3px; height: 6px; }
.q-body small { font-size: 11px; }
.quest .btn { min-width: 58px; height: 34px; }
.tour-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.tour-head small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.tour-head b { font-size: 15px; display: inline-flex; gap: 4px; align-items: center; }
.tour-prize { display: inline-flex; gap: 4px; align-items: center; color: #2ee07a; font-size: 14px; }
/* provably fair */
.fair-code { display: block; margin-top: 4px; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--text); word-break: break-all; user-select: all; }
.fair-out { padding: 12px; border-radius: 12px; background: rgba(25,198,177,.08); border: 1px solid rgba(25,198,177,.3); font-size: 14px; line-height: 1.5; }
.fair-out .fair-code { margin: 4px 0 10px; }
[data-log] { cursor: pointer; }
/* inventory withdraw */
.inv-row { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 6px; }
.inv-row:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.wd-btn { padding: 0 !important; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.45; }

/* chat */
.chat-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; margin-top: 2px; }
.chat-link > .ic:first-child { width: 26px; height: 26px; color: var(--accent); }
.chat-link small { display: block; font-size: 12px; }
.chat-box { height: calc(100vh - 290px); min-height: 280px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 85%; align-self: flex-start; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--bg-2); border: 1px solid var(--line); }
.msg.me { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: rgba(25,198,177,.12); border-color: rgba(25,198,177,.3); }
.msg-head { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 2px; }
.msg-head b { color: #9fe8de; } .msg-head b.adm { color: var(--gold); }
.msg-head small { color: var(--muted); font-size: 11px; }
.msg-act { width: 20px; height: 20px; display: grid; place-items: center; color: var(--muted); }
.msg-act .ic { width: 13px; height: 13px; }
.msg-text { font-size: 14px; line-height: 1.4; word-break: break-word; user-select: text; }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 8px; margin-top: 10px; }
.chat-form .btn { height: 48px; padding: 0; }