/* WINCHIK v2 — тёмная тема #232428, палитра Discord, Space Grotesk */
:root {
  --bg: #232428;
  --bg-deep: #1a1b1e;
  --panel: rgba(43, 45, 49, .72);
  --panel-solid: #2b2d31;
  --panel-2: #313338;
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .13);
  --text: #f2f3f5;
  --muted: #949ba4;
  --blurple: #5865F2;
  --blurple-h: #6d78ff;
  --green: #57F287;
  --yellow: #FEE75C;
  --red: #ED4245;
  --fuchsia: #EB459E;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* атрибут hidden обязан скрывать всегда — даже если у элемента задан display */
[hidden] { display: none !important; }
html { scrollbar-color: #4a4d55 var(--bg); }
body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* атмосфера: живые пятна света + зерно */
body::before {
  content: ''; position: fixed; inset: -20%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(700px 500px at 18% 8%, rgba(88, 101, 242, .16), transparent 60%),
    radial-gradient(600px 450px at 85% 12%, rgba(235, 69, 158, .09), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(87, 242, 135, .05), transparent 60%);
  animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift {
  to { transform: translate(3%, 2%) scale(1.06); }
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

button { font-family: inherit; cursor: pointer; border: none; }
input { font-family: inherit; }

/* предупреждение, если Discord OAuth не настроен */
.auth-warn {
  background: linear-gradient(90deg, rgba(237, 66, 69, .95), rgba(235, 69, 158, .9));
  color: #fff; text-align: center; padding: 10px 16px; font-size: 13.5px; font-weight: 500;
}
.auth-warn b { font-weight: 700; }

/* ===== topbar ===== */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 13px 28px;
  background: rgba(26, 27, 30, .72);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.logo { font-size: 22px; font-weight: 700; letter-spacing: 2px; cursor: pointer; user-select: none; }
.logo span {
  background: linear-gradient(90deg, var(--blurple), var(--fuchsia));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav-btn {
  background: transparent; color: var(--muted);
  padding: 9px 18px; border-radius: 12px; font-size: 15px; font-weight: 500;
  transition: .18s; position: relative;
}
.nav-btn:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav-btn.active {
  color: #fff; background: var(--blurple);
  box-shadow: 0 4px 18px rgba(88, 101, 242, .45), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.userbox { display: flex; align-items: center; gap: 10px; }
.balance {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), transparent), var(--bg-deep);
  border: 1px solid var(--border-strong);
  padding: 8px 18px; border-radius: 12px; font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.coin { color: var(--yellow); font-weight: 700; text-shadow: 0 0 12px rgba(254, 231, 92, .5); }
.name-btn {
  background: transparent; color: var(--muted); border: 1px solid var(--border-strong);
  padding: 8px 16px; border-radius: 12px; font-size: 14px; transition: .18s;
}
.name-btn:hover { color: var(--text); border-color: var(--blurple); box-shadow: 0 0 0 3px rgba(88, 101, 242, .18); }

/* ===== layout ===== */
main { max-width: 1080px; margin: 0 auto; padding: 30px 20px 90px; }
.view { display: none; animation: fadeUp .3s cubic-bezier(.2, .7, .3, 1); }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; } }

/* ===== лобби ===== */
.hero { position: relative; padding: 74px 10px 46px; }
.hero h1 { font-size: 58px; font-weight: 700; line-height: 1.05; letter-spacing: -1px; }
.grad {
  background: linear-gradient(90deg, var(--blurple) 0%, var(--fuchsia) 60%, var(--yellow) 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin-top: 18px; color: var(--muted); font-size: 17px; max-width: 460px; line-height: 1.55; }
.hero p b { color: var(--yellow); }
.hero-glow {
  position: absolute; right: -40px; top: -60px; width: 460px; height: 460px; pointer-events: none;
  background:
    radial-gradient(circle at 60% 40%, rgba(88, 101, 242, .30), transparent 55%),
    radial-gradient(circle at 40% 70%, rgba(235, 69, 158, .16), transparent 55%);
  filter: blur(4px);
  animation: pulse-glow 6s ease-in-out infinite alternate;
}
@keyframes pulse-glow { to { transform: scale(1.12); opacity: .8; } }

.game-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 10px; }
.game-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, .045), transparent 40%), var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; cursor: pointer; transition: .25s cubic-bezier(.2, .7, .3, 1);
  position: relative; overflow: hidden;
}
.game-card::before {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: .25s;
  background: radial-gradient(400px 200px at 50% 0%, rgba(88, 101, 242, .18), transparent 70%);
}
.game-card:hover { transform: translateY(-5px); border-color: rgba(88, 101, 242, .55); box-shadow: var(--shadow); }
.game-card:hover::before { opacity: 1; }
.gc-emoji { font-size: 42px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .5)); }
.game-card h3 { margin: 14px 0 6px; font-size: 25px; letter-spacing: -.3px; }
.game-card p { color: var(--muted); font-size: 14px; }
.gc-live { margin: 16px 0; font-size: 13px; color: var(--green); min-height: 18px; letter-spacing: .3px; }
.btn { padding: 12px 26px; border-radius: 12px; font-size: 15px; font-weight: 600; transition: .18s; }
.btn-blurple {
  background: linear-gradient(180deg, var(--blurple-h), var(--blurple)); color: #fff;
  box-shadow: 0 6px 20px rgba(88, 101, 242, .4), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-blurple:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ===== заголовок игры ===== */
.game-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.game-head h2 { font-size: 30px; letter-spacing: -.5px; }
.phase-pill {
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  padding: 6px 16px; border-radius: 999px; font-size: 13px; color: var(--muted); transition: .2s;
}
.phase-pill.hot {
  border-color: rgba(87, 242, 135, .5); color: var(--green);
  box-shadow: 0 0 16px rgba(87, 242, 135, .18), inset 0 0 8px rgba(87, 242, 135, .08);
}
.timer { font-size: 21px; font-weight: 700; color: var(--yellow); min-width: 64px; font-variant-numeric: tabular-nums; }

/* ===== рулетка ===== */
.r-history { display: flex; gap: 7px; margin-bottom: 16px; flex-wrap: wrap; }
.r-dot {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 3px 8px rgba(0, 0, 0, .35);
  animation: popIn .25s cubic-bezier(.2, .9, .3, 1.4);
}
@keyframes popIn { from { transform: scale(.4); opacity: 0; } }
.r-dot.red { background: linear-gradient(180deg, #f0575a, #b52d30); }
.r-dot.black { background: linear-gradient(180deg, #33363c, #141517); border: 1px solid var(--border-strong); }
.r-dot.green { background: linear-gradient(180deg, #4fdc7e, #16813f); }

.wheel-wrap {
  position: relative; height: 104px; overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-deep); border: 1px solid var(--border-strong);
  box-shadow: inset 0 4px 24px rgba(0, 0, 0, .5), var(--shadow);
}
.wheel-strip { display: flex; height: 100%; will-change: transform; }
.wheel-cell {
  flex: 0 0 90px; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 27px; font-weight: 700; color: #fff;
  border-right: 1px solid rgba(0, 0, 0, .3);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.wheel-cell.red { background: linear-gradient(180deg, #f0575a, #b52d30); }
.wheel-cell.black { background: linear-gradient(180deg, #2c2e33, #131416); }
.wheel-cell.green { background: linear-gradient(180deg, #4fdc7e, #157a3c); }
.wheel-marker {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; transform: translateX(-50%);
  background: var(--yellow); z-index: 3; border-radius: 2px;
  box-shadow: 0 0 16px rgba(254, 231, 92, .9), 0 0 40px rgba(254, 231, 92, .4);
}
.wheel-marker::before, .wheel-marker::after {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent;
}
.wheel-marker::before { top: -3px; border-top-color: var(--yellow); }
.wheel-marker::after { bottom: -3px; border-bottom-color: var(--yellow); }
.wheel-fade { position: absolute; top: 0; bottom: 0; width: 120px; z-index: 2; pointer-events: none; }
.wheel-fade.left { left: 0; background: linear-gradient(90deg, var(--bg-deep) 8%, transparent); }
.wheel-fade.right { right: 0; background: linear-gradient(-90deg, var(--bg-deep) 8%, transparent); }

.bet-panel { margin-top: 20px; }
.amount-row { display: flex; gap: 8px; flex-wrap: wrap; }
.amount-row input {
  width: 160px; background: var(--bg-deep); border: 1px solid var(--border-strong);
  color: var(--text); border-radius: 12px; padding: 11px 16px; font-size: 16px; transition: .18s;
}
.amount-row input:focus { outline: none; border-color: var(--blurple); box-shadow: 0 0 0 3px rgba(88, 101, 242, .2); }
.chip {
  background: var(--panel-solid); border: 1px solid var(--border); color: var(--muted);
  padding: 11px 15px; border-radius: 12px; font-size: 14px; font-weight: 600; transition: .15s;
}
.chip:hover { color: var(--text); border-color: var(--blurple); transform: translateY(-1px); }
.chip:active { transform: translateY(0) scale(.96); }

.color-btns { display: grid; grid-template-columns: 1fr .72fr 1fr; gap: 14px; margin-top: 14px; }
.color-btn {
  padding: 20px; border-radius: var(--radius); font-size: 19px; font-weight: 700; color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: .18s; position: relative; overflow: hidden;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 20px rgba(0, 0, 0, .3);
}
.color-btn span { font-size: 13px; opacity: .85; font-weight: 500; }
.color-btn.red { background: linear-gradient(180deg, #f0575a, #b52d30); }
.color-btn.red:hover:not(:disabled) { box-shadow: 0 0 28px rgba(237, 66, 69, .5), inset 0 1px 0 rgba(255,255,255,.2); }
.color-btn.black { background: linear-gradient(180deg, #33363c, #17181b); border: 1px solid var(--border-strong); }
.color-btn.black:hover:not(:disabled) { box-shadow: 0 0 24px rgba(255, 255, 255, .12); }
.color-btn.green { background: linear-gradient(180deg, #57F287, #1a8a45); color: #06230f; text-shadow: none; }
.color-btn.green:hover:not(:disabled) { box-shadow: 0 0 28px rgba(87, 242, 135, .5); }
.color-btn:hover:not(:disabled) { transform: translateY(-3px); }
.color-btn:active:not(:disabled) { transform: translateY(0); }
.color-btn:disabled { opacity: .4; cursor: not-allowed; filter: saturate(.6); }

.bets-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-top: 20px; }
.bets-col {
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; min-height: 130px;
}
.bets-col h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted);
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.red-col h4 { color: var(--red); } .green-col h4 { color: var(--green); }
.bets-col ul { list-style: none; }
.bets-col li {
  display: flex; justify-content: space-between; align-items: center; font-size: 14px;
  padding: 7px 10px; border-radius: 9px;
}
/* анимация только у только что добавленной строки */
.bets-col li.row-new, .duel-list li.row-new { animation: rowIn .22s ease; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-6px); } }
.bets-col li:nth-child(odd) { background: rgba(255, 255, 255, .035); }
.c-status.cashed { color: var(--green); font-weight: 700; }
.bets-col li b { color: var(--yellow); }
.bets-col li .cashed { color: var(--green); font-weight: 700; }

/* ===== crash ===== */
.c-history { display: flex; gap: 7px; margin-bottom: 16px; flex-wrap: wrap; }
.c-chip {
  padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  animation: popIn .25s cubic-bezier(.2, .9, .3, 1.4);
}
.c-chip.low { color: var(--red); border-color: rgba(237, 66, 69, .35); }
.c-chip.mid { color: var(--yellow); border-color: rgba(254, 231, 92, .3); }
.c-chip.high { color: var(--green); border-color: rgba(87, 242, 135, .35); }

.crash-stage {
  position: relative; height: 360px; border-radius: var(--radius);
  background:
    radial-gradient(600px 300px at 50% 120%, rgba(88, 101, 242, .12), transparent 70%),
    var(--bg-deep);
  border: 1px solid var(--border-strong); overflow: hidden;
  box-shadow: inset 0 4px 30px rgba(0, 0, 0, .5), var(--shadow);
}
/* звёзды */
.crash-stage::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .6;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 25%, #fff, transparent),
    radial-gradient(1px 1px at 34% 62%, rgba(255,255,255,.8), transparent),
    radial-gradient(1.5px 1.5px at 58% 18%, rgba(255,255,255,.9), transparent),
    radial-gradient(1px 1px at 73% 44%, rgba(255,255,255,.7), transparent),
    radial-gradient(1.5px 1.5px at 88% 70%, #fff, transparent),
    radial-gradient(1px 1px at 22% 80%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 45% 35%, rgba(255,255,255,.75), transparent),
    radial-gradient(1.5px 1.5px at 66% 85%, rgba(255,255,255,.8), transparent),
    radial-gradient(1px 1px at 92% 15%, rgba(255,255,255,.7), transparent);
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { to { opacity: .25; } }
#crashCanvas { width: 100%; height: 100%; display: block; position: relative; z-index: 1; }
.crash-mult {
  position: absolute; top: 26px; left: 50%; transform: translateX(-50%); z-index: 2;
  font-size: 60px; font-weight: 700; letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 34px rgba(88, 101, 242, .55);
  transition: color .2s;
}
.crash-mult.crashed { color: var(--red); text-shadow: 0 0 34px rgba(237, 66, 69, .7); animation: shake .4s; }
.crash-mult.flying { color: var(--green); text-shadow: 0 0 34px rgba(87, 242, 135, .5); }
@keyframes shake {
  0%, 100% { transform: translateX(-50%); }
  25% { transform: translateX(calc(-50% - 6px)); }
  75% { transform: translateX(calc(-50% + 6px)); }
}
.crash-msg {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 2;
  font-size: 15px; color: var(--muted); letter-spacing: .3px;
}
.crash-controls { display: flex; gap: 12px; margin-top: 18px; align-items: flex-start; flex-wrap: wrap; }
.btn-crash {
  background: linear-gradient(180deg, var(--blurple-h), var(--blurple)); color: #fff;
  font-size: 17px; font-weight: 700; padding: 12px 38px; border-radius: 12px; transition: .18s;
  box-shadow: 0 6px 20px rgba(88, 101, 242, .4), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-crash:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.btn-crash.cashout {
  background: linear-gradient(180deg, #6ef79a, #2eb45f); color: #06230f;
  animation: pulse 1s infinite;
}
.btn-crash:disabled { opacity: .4; cursor: not-allowed; animation: none; box-shadow: none; }
@keyframes pulse { 50% { box-shadow: 0 0 30px rgba(87, 242, 135, .65); } }
.crash-bets { margin-top: 20px; }

/* ===== daily + профиль-меню ===== */
.daily-btn {
  background: linear-gradient(180deg, #6ef79a, #2eb45f); color: #06230f;
  padding: 8px 16px; border-radius: 12px; font-size: 14px; font-weight: 700;
  animation: pulse 1.6s infinite; transition: .15s;
}
.daily-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.userbox { position: relative; }
.profile-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 8px; min-width: 250px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .55), 0 0 40px rgba(88, 101, 242, .08);
  animation: fadeUp .18s ease;
}
.pm-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 14px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.pm-ava .ava { box-shadow: 0 0 0 3px rgba(88, 101, 242, .35); }
.pm-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pm-who b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-bal { font-size: 13px; color: var(--muted); }
.pm-bal .coin { font-size: 13px; }
.pm-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; color: var(--text);
  padding: 11px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; transition: .12s;
}
.pm-item span { width: 20px; text-align: center; }
.pm-item:hover { background: rgba(255, 255, 255, .06); }
.pm-danger { color: var(--red); }
.pm-danger:hover { background: rgba(237, 66, 69, .12); }

/* ===== модалка рефералки ===== */
.modal-back {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(20, 21, 24, .7);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeUp .2s ease;
}
.modal {
  position: relative;
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  border-radius: 20px; padding: 30px;
  width: 100%; max-width: 520px; max-height: 86vh; overflow-y: auto;
  box-shadow: var(--shadow), 0 0 80px rgba(88, 101, 242, .12);
}
.modal h3 { font-size: 24px; margin-bottom: 8px; }
.modal-sub { color: var(--muted); font-size: 14px; line-height: 1.55; margin-bottom: 20px; }
.modal-sub b { color: var(--green); }
.modal-x {
  position: absolute; top: 16px; right: 16px;
  width: 34px; height: 34px; border-radius: 10px;
  background: transparent; color: var(--muted); font-size: 15px; transition: .12s;
}
.modal-x:hover { background: rgba(255, 255, 255, .07); color: var(--text); }

.ref-link-row { display: flex; gap: 10px; margin-bottom: 18px; }
.ref-link-row input {
  flex: 1; min-width: 0;
  background: var(--bg-deep); border: 1px solid var(--border-strong);
  color: var(--text); border-radius: 12px; padding: 12px 14px; font-size: 14px;
  font-family: inherit;
}
.ref-link-row input:focus { outline: none; border-color: var(--blurple); }

.ref-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.ref-stat {
  background: var(--bg-deep); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px; text-align: center;
  display: flex; flex-direction: column; gap: 4px;
}
.ref-stat b { font-size: 20px; color: var(--yellow); }
.ref-stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.ref-list-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted);
  margin-bottom: 10px;
}
.ref-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ref-list li {
  display: flex; align-items: center;
  padding: 9px 12px; border-radius: 10px; font-size: 14px;
  background: rgba(255, 255, 255, .03);
}
.ref-empty { color: var(--muted); justify-content: center; }

/* ===== слот «Олимп» ===== */
.paytable-btn {
  background: var(--panel-solid); border: 1px solid var(--border-strong); color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; transition: .15s; margin-left: auto;
}
.paytable-btn:hover { color: var(--text); border-color: var(--blurple); }
.sound-btn {
  background: var(--panel-solid); border: 1px solid var(--border-strong); color: var(--text);
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; transition: .15s;
}
.sound-btn:hover { border-color: var(--blurple); }
.sound-btn.off { color: var(--muted); opacity: .6; }
.sound-btn .ic { width: 17px; height: 17px; }

.slot-stage {
  position: relative;
  background:
    radial-gradient(600px 300px at 50% -10%, rgba(88, 101, 242, .18), transparent 70%),
    radial-gradient(400px 250px at 50% 110%, rgba(254, 231, 92, .08), transparent 70%),
    var(--bg-deep);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 18px; box-shadow: inset 0 4px 30px rgba(0, 0, 0, .5), var(--shadow);
}
/* поле не должно вылезать за экран: ограничиваем и по ширине, и по высоте окна.
   6 колонок × 5 рядов + отступы — считаем от доступной высоты вьюпорта */
.slot-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px;
  width: 100%;
  max-width: min(560px, calc((100vh - 300px) * 1.2));
  margin: 0 auto;
}
.sl-cell {
  aspect-ratio: 1; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(0, 0, 0, .25));
  border: 1px solid var(--border);
  /* падение с задержкой по колонкам — барабаны останавливаются по очереди */
  animation: slDrop .42s cubic-bezier(.18, .85, .3, 1.15) backwards;
  animation-delay: var(--d, 0s);
}
@keyframes slDrop { from { transform: translateY(-38px) scale(.9); opacity: 0; } }
.sl-cell .ic { width: 60%; height: 60%; stroke-width: 1.6; }
.sym-crown .ic { color: var(--yellow); }
.sym-hourglass .ic { color: #ffb457; }
.sym-ring .ic { color: #ff7ac6; }
.sym-chalice .ic { color: #b9a0ff; }
.sym-gem-red .ic { color: #ff6b6e; }
.sym-gem-purple .ic { color: #c07bff; }
.sym-gem-yellow .ic { color: #ffe066; }
.sym-gem-green .ic { color: #57F287; }
.sym-gem-blue .ic { color: #6fc3ff; }
.sym-zeus {
  background: linear-gradient(180deg, rgba(88, 101, 242, .5), rgba(88, 101, 242, .15));
  border-color: rgba(88, 101, 242, .7);
}
.sym-zeus .ic { color: #fff; fill: var(--blurple-h); }
.sl-win {
  border-color: var(--yellow);
  box-shadow: 0 0 22px rgba(254, 231, 92, .55), inset 0 0 16px rgba(254, 231, 92, .25);
  animation: slPulse .62s ease infinite alternate;
  z-index: 1;
}
@keyframes slPulse { to { transform: scale(1.07); box-shadow: 0 0 32px rgba(254, 231, 92, .75), inset 0 0 20px rgba(254, 231, 92, .35); } }
.sl-pop { animation: slPop .34s cubic-bezier(.4, 0, .6, 1) forwards; }
@keyframes slPop {
  40% { transform: scale(1.25) rotate(-6deg); }
  to { transform: scale(.15) rotate(20deg); opacity: 0; }
}

.slot-orbs {
  position: absolute; top: 10px; right: 12px; display: flex; gap: 6px; flex-wrap: wrap;
  max-width: 60%; justify-content: flex-end;
}
.sl-orb {
  background: radial-gradient(circle at 35% 30%, #ffe98a, #d4a017);
  color: #3a2a00; font-weight: 700; font-size: 13px;
  padding: 7px 11px; border-radius: 999px;
  box-shadow: 0 0 20px rgba(254, 231, 92, .6), inset 0 1px 0 rgba(255, 255, 255, .5);
  animation: orbIn .3s cubic-bezier(.2, .9, .3, 1.5);
}
@keyframes orbIn { from { transform: scale(0) translateY(-20px); opacity: 0; } }

.sl-win-badge {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(26, 27, 30, .85); backdrop-filter: blur(6px);
  border: 1px solid rgba(87, 242, 135, .5); color: var(--green);
  padding: 8px 20px; border-radius: 999px; font-weight: 700; font-size: 15px;
  animation: fadeUp .2s ease;
}
.sl-win-badge.big { font-size: 20px; box-shadow: 0 0 30px rgba(87, 242, 135, .35); }

.slot-fs {
  position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(180deg, var(--blurple-h), var(--blurple)); color: #fff;
  padding: 6px 18px; border-radius: 0 0 12px 12px; font-size: 13px; font-weight: 700;
  z-index: 2; box-shadow: 0 4px 16px rgba(88, 101, 242, .5);
}

.slot-controls { margin-top: 16px; }
.slot-btns { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.btn-spin {
  flex: 1; min-width: 160px;
  background: linear-gradient(180deg, var(--blurple-h), var(--blurple)); color: #fff;
  font-size: 17px; font-weight: 700; padding: 14px;
  box-shadow: 0 6px 20px rgba(88, 101, 242, .4), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-spin:hover:not(:disabled) { filter: brightness(1.1); }
.btn-spin:disabled { opacity: .55; cursor: wait; }
.btn-buy {
  background: linear-gradient(180deg, #ffe98a, #d4a017); color: #3a2a00; font-weight: 700; padding: 14px 18px;
}
.btn-buy:hover:not(:disabled) { filter: brightness(1.08); }
.btn-buy:disabled { opacity: .5; cursor: not-allowed; }
.btn-auto {
  background: var(--panel-2); border: 1px solid var(--border-strong); color: var(--muted); padding: 14px 20px;
}
.btn-auto.on { background: var(--green); color: #06230f; border-color: transparent; font-weight: 700; }

.pay-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.pay-list li {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-deep); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px;
}
.pay-list li b { flex: 0 0 120px; font-size: 13.5px; }
.pay-ic { width: 38px !important; height: 38px; aspect-ratio: auto; animation: none !important; }
.pay-vals { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pay-scatter { border-color: rgba(88, 101, 242, .5); }

/* ===== ставки на спорт ===== */
.sports-grid { display: grid; grid-template-columns: 1fr 330px; gap: 18px; align-items: start; }
.line-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.line-tab {
  background: var(--panel-solid); border: 1px solid var(--border); color: var(--muted);
  padding: 8px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 600; transition: .15s;
}
.line-tab:hover { color: var(--text); border-color: var(--blurple); }
.line-tab.active { background: var(--blurple); color: #fff; border-color: transparent; }

.line-list {
  background: var(--panel); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.line-league {
  padding: 10px 16px; font-size: 11.5px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--muted);
  background: rgba(0, 0, 0, .18); border-bottom: 1px solid var(--border);
}
.line-league.live-sep {
  color: var(--red); background: rgba(237, 66, 69, .08);
  border-top: 1px solid var(--border);
}
.line-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.line-row:last-child { border-bottom: none; }
.line-row.closed { opacity: .5; }
.line-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.line-info b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-when { font-size: 12px; color: var(--muted); }
.line-when.live { color: var(--red); font-weight: 700; letter-spacing: .5px; }
.odds-row { display: flex; gap: 6px; }
.odd-btn {
  width: 62px; padding: 8px 4px; border-radius: 10px;
  background: var(--bg-deep); border: 1px solid var(--border-strong); color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: .14s;
}
.odd-btn span { font-size: 10.5px; color: var(--muted); letter-spacing: .5px; }
.odd-btn b { font-size: 14px; }
.odd-btn:hover:not(:disabled) { border-color: var(--blurple); transform: translateY(-1px); }
.odd-btn.picked {
  background: linear-gradient(180deg, var(--blurple-h), var(--blurple));
  border-color: transparent; box-shadow: 0 4px 16px rgba(88, 101, 242, .45);
}
.odd-btn.picked span { color: rgba(255, 255, 255, .8); }
.odd-btn:disabled { opacity: .4; cursor: not-allowed; }
.line-empty, .res-empty, .tk-empty, .coupon-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 14px; }

.sec-title {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.3px; color: var(--muted);
  margin: 22px 0 10px;
}
.res-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.res-list li {
  display: flex; align-items: center; gap: 12px; font-size: 13.5px;
  padding: 9px 14px; border-radius: 10px; background: rgba(255, 255, 255, .03);
}
.res-list li b { flex: 1; font-weight: 500; }
.res-league { font-size: 11px; color: var(--muted); min-width: 92px; }
.res-score { font-weight: 700; color: var(--yellow); }

/* купон */
.coupon {
  position: sticky; top: 76px;
  background: var(--panel); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
}
.coupon-head { display: flex; align-items: center; gap: 9px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.coupon-head .ic { color: var(--blurple-h); }
.coupon-head b { flex: 1; }
.coupon-count {
  background: var(--blurple); color: #fff; border-radius: 999px;
  min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; padding: 0 6px;
}
.coupon-clear { background: transparent; color: var(--muted); padding: 4px; border-radius: 8px; }
.coupon-clear:hover { color: var(--red); background: rgba(237, 66, 69, .12); }
.coupon-list { list-style: none; display: flex; flex-direction: column; gap: 7px; margin: 12px 0; max-height: 240px; overflow-y: auto; }
.coupon-list li {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center;
  background: var(--bg-deep); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
}
.cp-teams { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-pick { font-size: 12px; font-weight: 700; color: var(--yellow); white-space: nowrap; }
.cp-x { background: transparent; color: var(--muted); font-size: 12px; padding: 2px 4px; }
.cp-x:hover { color: var(--red); }
.coupon-foot { border-top: 1px solid var(--border); padding-top: 12px; }
.coupon-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.coupon-row b { color: var(--text); font-size: 15px; }
.cp-win { color: var(--green) !important; }
.coupon .amount-row { margin-bottom: 12px; }
.coupon .amount-row input { width: 100%; }
.coupon .chip { padding: 9px 12px; font-size: 13px; }
.coupon-go { width: 100%; }
.coupon-go:disabled { opacity: .45; cursor: not-allowed; }

/* мои ставки */
.tickets { list-style: none; display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.tk {
  background: var(--bg-deep); border: 1px solid var(--border);
  border-left: 3px solid var(--muted); border-radius: 10px; padding: 10px 12px;
}
.tk-open { border-left-color: var(--yellow); }
.tk-won { border-left-color: var(--green); }
.tk-lost { border-left-color: var(--red); }
.tk-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.tk-head b { font-size: 13.5px; }
.tk-won .tk-head b { color: var(--green); }
.tk-lost .tk-head b { color: var(--red); }
.tk-open .tk-head b { color: var(--yellow); }
.tk-leg { font-size: 12px; color: var(--muted); padding: 3px 0; }
.leg-won { color: var(--green); }
.leg-lost { color: var(--red); text-decoration: line-through; }


/* ===== подсветка строк по рангу игрока ===== */
.bets-col li[class*='rk-'], .duel-list li[class*='rk-'] {
  border-left: 3px solid transparent;
  padding-left: 9px;
  transition: box-shadow .2s, border-color .2s;
}
.rk-novice { border-left-color: rgba(148, 155, 164, .5) !important; }
.rk-bronze { border-left-color: #cd8b4f !important; }
.rk-silver { border-left-color: #c8cdd7 !important; }
.rk-gold {
  border-left-color: var(--yellow) !important;
  box-shadow: inset 6px 0 14px -8px rgba(254, 231, 92, .55);
}
.rk-platinum {
  border-left-color: #7fd4ff !important;
  box-shadow: inset 8px 0 18px -8px rgba(127, 212, 255, .6);
}
.rk-diamond {
  border-left-color: #7fffd0 !important;
  box-shadow: inset 10px 0 22px -8px rgba(127, 255, 208, .65);
}
.rk-legend {
  border-left-color: var(--fuchsia) !important;
  box-shadow: inset 12px 0 26px -8px rgba(235, 69, 158, .7);
  animation: legendPulse 2.4s ease-in-out infinite;
}
@keyframes legendPulse {
  50% { box-shadow: inset 12px 0 30px -6px rgba(235, 69, 158, .9); }
}
.rk-diamond .user-chip-name, .rk-legend .user-chip-name { font-weight: 600; }

/* ===== модалка про ранги ===== */
button.rank-chip { cursor: pointer; font-family: inherit; transition: .15s; }
button.rank-chip:hover { filter: brightness(1.2); transform: translateY(-1px); }
.ranks-note { font-size: 13px !important; color: var(--muted); }
.ranks-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.ranks-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px; font-size: 14px;
  background: var(--bg-deep); border: 1px solid var(--border);
  border-left-width: 3px;
}
.ranks-row .ic { width: 18px; height: 18px; }
.ranks-row b { flex: 1; }
.ranks-need { color: var(--muted); font-size: 13px; white-space: nowrap; }
.ranks-row.current {
  background: rgba(88, 101, 242, .12);
  box-shadow: 0 0 0 1px rgba(88, 101, 242, .4);
}
.ranks-you {
  font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  background: var(--blurple); color: #fff; border-radius: 6px; padding: 3px 7px;
}
.ranks-row.rank-novice { border-left-color: rgba(148, 155, 164, .6); }
.ranks-row.rank-bronze { border-left-color: #cd8b4f; }
.ranks-row.rank-silver { border-left-color: #c8cdd7; }
.ranks-row.rank-gold { border-left-color: var(--yellow); }
.ranks-row.rank-platinum { border-left-color: #7fd4ff; }
.ranks-row.rank-diamond { border-left-color: #7fffd0; }
.ranks-row.rank-legend { border-left-color: var(--fuchsia); }

/* ===== топы ===== */
.top-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.top-tab {
  background: var(--panel-solid); border: 1px solid var(--border); color: var(--muted);
  padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; transition: .15s;
}
.top-tab:hover { color: var(--text); border-color: var(--blurple); }
.top-tab.active {
  color: #fff; background: var(--blurple); border-color: transparent;
  box-shadow: 0 4px 16px rgba(88, 101, 242, .4);
}
.top-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.top-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 18px; font-size: 15px;
  animation: fadeUp .25s ease;
}
.top-row .user-chip-name { max-width: 260px; font-weight: 600; }
.top-rank { width: 34px; text-align: center; font-size: 18px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.top-val { margin-left: auto; color: var(--yellow); font-size: 16px; }
.top-1 { border-color: rgba(254, 231, 92, .45); box-shadow: 0 0 24px rgba(254, 231, 92, .12); }
.top-2 { border-color: rgba(200, 205, 215, .35); }
.top-3 { border-color: rgba(205, 127, 50, .4); }
.top-1 .top-rank, .top-2 .top-rank, .top-3 .top-rank { font-size: 22px; }
.top-empty { color: var(--muted); text-align: center; padding: 30px; }

/* ===== экран входа ===== */
.login-gate {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(26, 27, 30, .8);
  backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeUp .3s ease;
}
.login-card {
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  border-radius: 20px; padding: 44px 52px; text-align: center;
  box-shadow: var(--shadow), 0 0 80px rgba(88, 101, 242, .15);
}
.login-logo { font-size: 34px; font-weight: 700; letter-spacing: 2px; margin-bottom: 14px; }
.login-logo span {
  background: linear-gradient(90deg, var(--blurple), var(--fuchsia));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-card p { color: var(--muted); font-size: 15px; line-height: 1.55; margin-bottom: 24px; }
.dc-big { font-size: 17px; padding: 14px 30px; margin: 0 auto; }

/* ===== тосты ===== */
.toasts { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 99; }
.toast {
  background: rgba(49, 51, 56, .9); backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong); color: var(--text);
  padding: 13px 20px; border-radius: 12px; font-size: 14px;
  animation: toastIn .25s cubic-bezier(.2, .9, .3, 1.2); max-width: 330px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, .5);
}
.toast.err { border-color: rgba(237, 66, 69, .6); box-shadow: 0 10px 36px rgba(237, 66, 69, .15); }
.toast.win { border-color: rgba(87, 242, 135, .6); box-shadow: 0 10px 36px rgba(87, 242, 135, .15); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px) scale(.96); } to { opacity: 1; } }

/* ===== аватары / юзер-чипы ===== */
.ava { border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.ava-letter {
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; border-radius: 50%;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
.user-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.user-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.me-ava { display: inline-flex; }
.name-btn { display: inline-flex; align-items: center; gap: 8px; }

.dc-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, var(--blurple-h), var(--blurple)); color: #fff;
  padding: 8px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; transition: .18s;
  box-shadow: 0 4px 16px rgba(88, 101, 242, .4), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.dc-btn::before { content: ''; width: 18px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127.14 96.36'%3E%3Cpath d='M107.7 8.07A105.15 105.15 0 0 0 81.47 0a72.06 72.06 0 0 0-3.36 6.83 97.68 97.68 0 0 0-29.11 0A72.37 72.37 0 0 0 45.64 0a105.89 105.89 0 0 0-26.25 8.09C2.79 32.65-1.71 56.6.54 80.21a105.73 105.73 0 0 0 32.17 16.15 77.7 77.7 0 0 0 6.89-11.11 68.42 68.42 0 0 1-10.85-5.18c.91-.66 1.8-1.34 2.66-2a75.57 75.57 0 0 0 64.32 0c.87.71 1.76 1.39 2.66 2a68.68 68.68 0 0 1-10.87 5.19 77 77 0 0 0 6.89 11.1 105.25 105.25 0 0 0 32.19-16.14c2.64-27.38-4.51-51.11-18.9-72.15ZM42.45 65.69C36.18 65.69 31 60 31 53s5-12.74 11.43-12.74S54 46 53.89 53s-5.05 12.69-11.44 12.69Zm42.24 0C78.41 65.69 73.25 60 73.25 53s5-12.74 11.44-12.74S96.23 46 96.12 53s-5.04 12.69-11.43 12.69Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127.14 96.36'%3E%3Cpath d='M107.7 8.07A105.15 105.15 0 0 0 81.47 0a72.06 72.06 0 0 0-3.36 6.83 97.68 97.68 0 0 0-29.11 0A72.37 72.37 0 0 0 45.64 0a105.89 105.89 0 0 0-26.25 8.09C2.79 32.65-1.71 56.6.54 80.21a105.73 105.73 0 0 0 32.17 16.15 77.7 77.7 0 0 0 6.89-11.11 68.42 68.42 0 0 1-10.85-5.18c.91-.66 1.8-1.34 2.66-2a75.57 75.57 0 0 0 64.32 0c.87.71 1.76 1.39 2.66 2a68.68 68.68 0 0 1-10.87 5.19 77 77 0 0 0 6.89 11.1 105.25 105.25 0 0 0 32.19-16.14c2.64-27.38-4.51-51.11-18.9-72.15ZM42.45 65.69C36.18 65.69 31 60 31 53s5-12.74 11.43-12.74S54 46 53.89 53s-5.05 12.69-11.44 12.69Zm42.24 0C78.41 65.69 73.25 60 73.25 53s5-12.74 11.44-12.74S96.23 46 96.12 53s-5.04 12.69-11.43 12.69Z'/%3E%3C/svg%3E") center/contain no-repeat; }
.dc-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.dc-btn.pulse { animation: dcPulse 1.2s ease 2; }
@keyframes dcPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(88, 101, 242, .4); }
  50% { box-shadow: 0 0 0 6px rgba(88, 101, 242, .35), 0 0 30px rgba(88, 101, 242, .7); transform: scale(1.05); }
}

/* ===== shell: контент + онлайн-сайдбар ===== */
.shell { display: flex; max-width: 1360px; margin: 0 auto; align-items: flex-start; }
.shell main { flex: 1; min-width: 0; }
.online-bar {
  width: 240px; flex-shrink: 0;
  position: sticky; top: 76px;
  margin: 30px 20px 0 0;
  background: rgba(26, 27, 30, .6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 10px;
  max-height: calc(100vh - 110px); overflow-y: auto;
}
.online-bar h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted);
  padding: 0 8px 10px;
}
.online-bar ul { list-style: none; }
.online-bar li {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 9px; font-size: 14px; transition: .12s;
  position: relative;
}
.online-bar li:hover { background: rgba(255, 255, 255, .05); }
.online-bar li .ava { position: relative; }
.online-bar li::after {
  content: ''; position: absolute; left: 27px; bottom: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green); border: 2.5px solid var(--bg-deep);
}
.on-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.online-more {
  display: block; width: calc(100% - 16px); margin: 10px 8px 2px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
  padding: 9px; border-radius: 10px; font-size: 13px; font-weight: 600; transition: .15s;
}
.online-more:hover { color: var(--text); border-color: var(--blurple); }
.clickable { cursor: pointer; }

/* ===== svg-иконки ===== */
.ic {
  width: 18px; height: 18px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -3px;
}
.nav-btn .ic, .top-tab .ic, .pm-item .ic, .daily-btn .ic, .side-btn .ic { width: 17px; height: 17px; }
.nav-btn, .top-tab, .side-btn, .daily-btn { display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.h-ic { width: 26px; height: 26px; margin-right: 10px; color: var(--blurple-h); }
.game-head h2, .modal h3 { display: flex; align-items: center; }
.gc-icon {
  width: 64px; height: 64px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 8px 24px rgba(0,0,0,.35);
}
.gc-icon .ic { width: 32px; height: 32px; color: #fff; }
.gc-icon.red-ic { background: linear-gradient(180deg, #f0575a, #b52d30); }
.gc-icon.blurple-ic { background: linear-gradient(180deg, var(--blurple-h), var(--blurple)); }
.gc-icon.yellow-ic { background: linear-gradient(180deg, #ffe98a, #d4a017); }
.gc-icon.violet-ic { background: linear-gradient(180deg, #b98cff, #7a3fd4); }
.gc-icon.green-ic { background: linear-gradient(180deg, #6ef79a, #1f9e52); }
.gc-icon.green-ic .ic { color: #06230f; }
.gc-icon.yellow-ic .ic { color: #4a3803; }
.face-ic { width: 46px !important; height: 46px !important; stroke-width: 1.8; }
.coin-face.heads .face-ic { color: #6b4c00; }
.coin-face.tails .face-ic { color: #3c414d; }
.duel-info { display: inline-flex; align-items: center; gap: 6px; }
.duel-info .ic { width: 15px; height: 15px; }
.hist-game { display: inline-flex; align-items: center; gap: 8px; }
.hist-game .ic { width: 16px; height: 16px; color: var(--muted); }
.rank-chip { display: inline-flex; align-items: center; gap: 7px; }
.rank-chip .ic { width: 15px; height: 15px; }
.rank-bronze { color: #cd8b4f; border-color: rgba(205, 139, 79, .5); }
.rank-silver { color: #c8cdd7; border-color: rgba(200, 205, 215, .5); }
.rank-gold { color: var(--yellow); border-color: rgba(254, 231, 92, .5); }
.rank-platinum { color: #7fd4ff; border-color: rgba(127, 212, 255, .5); }
.rank-diamond { color: #7fffd0; border-color: rgba(127, 255, 208, .5); }
.rank-legend { color: var(--fuchsia); border-color: rgba(235, 69, 158, .55); }
.top-rank .ic { width: 20px; height: 20px; }
.medal-1 { color: var(--yellow); }
.medal-2 { color: #c8cdd7; }
.medal-3 { color: #cd8b4f; }
.user-chip.clickable:hover .user-chip-name { color: var(--blurple-h); text-decoration: underline; }

/* ===== профиль игрока ===== */
.prof-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.prof-head .ava { box-shadow: 0 0 0 3px rgba(88, 101, 242, .4), 0 8px 24px rgba(0, 0, 0, .4); }
.prof-who { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.prof-who b { font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-chip {
  align-self: flex-start;
  background: linear-gradient(90deg, rgba(88, 101, 242, .25), rgba(235, 69, 158, .18));
  border: 1px solid rgba(88, 101, 242, .5);
  padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
}
.rank-progress { margin-bottom: 20px; }
.rank-bar {
  height: 8px; border-radius: 999px; background: var(--bg-deep);
  border: 1px solid var(--border); overflow: hidden; margin-bottom: 6px;
}
.rank-fill {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--blurple), var(--fuchsia));
  transition: width .4s ease;
}
.rank-next { font-size: 12.5px; color: var(--muted); }
.prof-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.prof-stat {
  background: var(--bg-deep); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 10px; text-align: center;
  display: flex; flex-direction: column; gap: 4px;
}
.prof-stat b { font-size: 17px; color: var(--yellow); }
.prof-stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

/* ===== история игр ===== */
.hist-list { list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow-y: auto; }
.hist-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px; font-size: 14px;
  background: rgba(255, 255, 255, .03); border-left: 3px solid transparent;
}
.hist-row.won { border-left-color: var(--green); }
.hist-row.lost { border-left-color: var(--red); }
.hist-game { min-width: 110px; font-weight: 600; }
.hist-mid { color: var(--muted); font-size: 12.5px; flex: 1; }
.hist-val { white-space: nowrap; }
.hist-row.won .hist-val { color: var(--green); }
.hist-row.lost .hist-val { color: var(--red); }
.hist-empty { color: var(--muted); text-align: center; padding: 26px; }

/* ===== монетка ===== */
.coin-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 18px; }
.coin-panel {
  background: var(--panel); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
}
.coin-panel h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted);
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.coin-flip-zone { display: flex; flex-direction: column; align-items: center; padding: 16px 0 20px; min-height: 170px; }
.coin3d {
  width: 110px; height: 110px; position: relative;
  transform-style: preserve-3d;
}
.coin-face {
  position: absolute; inset: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 52px;
  backface-visibility: hidden;
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, .25), inset 0 -4px 10px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .5);
}
.coin-face.heads { background: radial-gradient(circle at 35% 30%, #ffe98a, #d4a017 70%); }
.coin-face.tails { background: radial-gradient(circle at 35% 30%, #cdd2dd, #7d8494 70%); transform: rotateY(180deg); }
.spin-heads { animation: flipH 1.8s cubic-bezier(.2, .7, .25, 1) forwards; }
.spin-tails { animation: flipT 1.8s cubic-bezier(.2, .7, .25, 1) forwards; }
@keyframes flipH { 0% { transform: rotateY(0) translateY(0); } 45% { transform: rotateY(1080deg) translateY(-70px); } 100% { transform: rotateY(1800deg) translateY(0); } }
@keyframes flipT { 0% { transform: rotateY(0) translateY(0); } 45% { transform: rotateY(1170deg) translateY(-70px); } 100% { transform: rotateY(1980deg) translateY(0); } }
.coin-outcome { margin-top: 14px; font-size: 15px; min-height: 20px; color: var(--muted); }
.coin-outcome.good { color: var(--green); font-weight: 600; }
.coin-outcome.bad { color: var(--red); }
.coin-side-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.side-btn {
  background: var(--panel-2); border: 1px solid var(--border-strong); color: var(--text);
  font-size: 16px; font-weight: 700; padding: 15px;
}
.side-btn:hover:not(:disabled) { border-color: var(--yellow); box-shadow: 0 0 20px rgba(254, 231, 92, .2); transform: translateY(-2px); }
.side-btn:disabled { opacity: .45; cursor: not-allowed; }
#view-coin input, .duel-create select {
  background: var(--bg-deep); border: 1px solid var(--border-strong); color: var(--text);
  border-radius: 12px; padding: 11px 14px; font-size: 15px; font-family: inherit;
}
#view-coin input { width: 130px; }
#view-coin input:focus, .duel-create select:focus { outline: none; border-color: var(--blurple); }
.duel-create { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.btn-cancel { background: linear-gradient(180deg, #f0575a, #b52d30); color: #fff; }
.duel-list { list-style: none; }
.duel-list li {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 9px 10px; border-radius: 10px; font-size: 14px;
}
.duel-list li:nth-child(odd) { background: rgba(255, 255, 255, .035); }
.duel-empty { color: var(--muted); justify-content: center !important; }
.duel-info { color: var(--yellow); font-weight: 700; white-space: nowrap; }
.duel-join { background: var(--blurple); color: #fff; padding: 7px 16px; font-size: 13px; border-radius: 9px; }
.duel-join:disabled { opacity: .4; cursor: default; }
.duel-feed { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.duel-result {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
  padding: 7px 10px; background: rgba(255, 255, 255, .03); border-radius: 9px;
  animation: fadeUp .25s ease;
}
.duel-mid { color: var(--muted); }

/* ===== админка ===== */
.pm-admin { color: var(--green); }
.pm-admin:hover { background: rgba(87, 242, 135, .12); }
.modal-wide { max-width: 860px; }
.adm-sec {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.3px; color: var(--muted);
  margin: 20px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.adm-sec:first-of-type { margin-top: 6px; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 9px; }
.adm-card {
  background: var(--bg-deep); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 3px;
}
.adm-card b { font-size: 17px; color: var(--text); word-break: break-word; }
.adm-card span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.adm-card.good b { color: var(--green); }
.adm-card.bad b { color: var(--red); }
.adm-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.adm-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); font-weight: 600; padding: 8px 10px; white-space: nowrap;
}
.adm-table td { padding: 8px 10px; border-top: 1px solid var(--border); white-space: nowrap; }
.adm-table tbody tr:nth-child(odd) { background: rgba(255, 255, 255, .025); }
.adm-good { color: var(--green); }
.adm-bad { color: var(--red); }
.adm-refresh { margin-top: 20px; width: 100%; }

/* ================= АДАПТИВ ================= */

/* планшеты: прячем сайдбар онлайна, купон уходит вниз */
@media (max-width: 1100px) {
  .online-bar { display: none; }
  .sports-grid { grid-template-columns: 1fr; }
  .coupon { position: static; }
}

@media (max-width: 900px) {
  main { padding: 20px 14px 70px; }
  .coin-grid { grid-template-columns: 1fr; }
  .game-cards { grid-template-columns: 1fr 1fr; }
}

/* ===== телефоны ===== */
@media (max-width: 700px) {
  /* шапка: логотип и юзер в строку, навигация — прокручиваемая лента под ними */
  .topbar {
    padding: 10px 12px; gap: 10px;
    display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'logo user' 'nav nav';
  }
  .logo { grid-area: logo; font-size: 19px; }
  .userbox { grid-area: user; justify-self: end; gap: 7px; }
  .nav {
    grid-area: nav; gap: 4px;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-btn { padding: 8px 12px; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
  .balance { padding: 7px 11px; font-size: 14px; }
  .name-btn { padding: 6px 9px; font-size: 13px; }
  .name-btn #meName { max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dc-btn { padding: 7px 11px; font-size: 12.5px; }
  .daily-btn { padding: 7px 10px; font-size: 12.5px; }

  main { padding: 16px 12px 60px; }

  /* лобби */
  .hero { padding: 26px 4px 26px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 15px; }
  .hero-glow { width: 260px; height: 260px; right: -70px; }
  .game-cards { grid-template-columns: 1fr; gap: 14px; }
  .game-card { padding: 20px; }

  /* заголовки игр */
  .game-head { gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
  .game-head h2 { font-size: 22px; }
  .h-ic { width: 21px; height: 21px; margin-right: 7px; }
  .timer { font-size: 17px; min-width: 48px; }
  .phase-pill { font-size: 12px; padding: 5px 11px; }

  /* рулетка */
  .wheel-wrap { height: 78px; }
  .wheel-cell { flex-basis: 70px; font-size: 21px; }
  .wheel-fade { width: 60px; }
  .color-btns { grid-template-columns: 1fr; gap: 9px; }
  .color-btn { padding: 15px; font-size: 17px; flex-direction: row; justify-content: center; gap: 10px; }
  .bets-cols { grid-template-columns: 1fr; gap: 10px; }
  .bets-col { min-height: auto; padding: 12px; }
  .r-dot { width: 27px; height: 27px; border-radius: 7px; }

  /* ставки: поле на всю ширину, фишки в ряд */
  .amount-row { gap: 6px; }
  .amount-row input { width: 100%; flex: 1 1 100%; }
  .chip { padding: 9px 12px; font-size: 13px; flex: 1; min-width: 52px; }

  /* ракетка */
  .crash-stage { height: 240px; }
  .crash-mult { font-size: 38px; top: 16px; }
  .crash-msg { font-size: 13px; bottom: 12px; }
  .crash-controls { flex-direction: column; align-items: stretch; }
  .btn-crash { width: 100%; padding: 14px; }

  /* монетка */
  .coin3d { width: 88px; height: 88px; }
  .face-ic { width: 38px !important; height: 38px !important; }
  .coin-flip-zone { min-height: 140px; padding: 10px 0 14px; }
  .coin-panel { padding: 16px; }
  .duel-create { flex-wrap: wrap; }
  .duel-create input, .duel-create select { flex: 1; min-width: 110px; }
  #view-coin input { width: 100%; }
  .duel-list li { flex-wrap: wrap; gap: 8px; }

  /* слот */
  .slot-stage { padding: 12px; }
  .slot-grid { gap: 5px; }
  .sl-cell { border-radius: 9px; }
  .slot-btns { gap: 8px; }
  .btn-spin { min-width: 100%; font-size: 16px; padding: 13px; }
  .btn-buy, .btn-auto { flex: 1; padding: 12px; font-size: 13.5px; }
  .sl-win-badge { font-size: 13.5px; padding: 6px 14px; }
  .sl-win-badge.big { font-size: 17px; }
  .sl-orb { font-size: 11.5px; padding: 5px 9px; }
  .slot-orbs { top: 6px; right: 8px; gap: 4px; }
  .paytable-btn { margin-left: 0; }
  .pay-list li { flex-wrap: wrap; gap: 8px; }
  .pay-list li b { flex: 1 1 auto; }
  .pay-vals { flex: 1 1 100%; white-space: normal; }

  /* спорт */
  .line-row { flex-wrap: wrap; gap: 9px; padding: 11px 13px; }
  .line-info { flex: 1 1 100%; }
  .line-info b { font-size: 13.5px; white-space: normal; }
  .odds-row { width: 100%; gap: 5px; }
  .odd-btn { flex: 1; width: auto; padding: 9px 4px; }
  .line-tab { padding: 7px 13px; font-size: 12.5px; }
  .coupon { padding: 14px; }
  .coupon-list { max-height: none; }
  .tickets { max-height: none; }
  .res-league { min-width: 0; flex: 0 0 auto; font-size: 10.5px; }
  .res-list li { flex-wrap: wrap; gap: 7px; padding: 8px 11px; }

  /* топы */
  .top-tabs { gap: 6px; }
  .top-tab { padding: 8px 12px; font-size: 12.5px; }
  .top-row { padding: 10px 12px; gap: 10px; font-size: 14px; }
  .top-rank { width: 26px; font-size: 15px; }
  .top-row .user-chip-name { max-width: 120px; }
  .top-val { font-size: 14px; }

  /* модалки на весь экран */
  .modal-back { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%; width: 100%; max-height: 92vh;
    border-radius: 20px 20px 0 0; padding: 22px 16px 26px;
    animation: sheetUp .25s cubic-bezier(.2, .8, .3, 1);
  }
  @keyframes sheetUp { from { transform: translateY(40px); opacity: .6; } }
  .modal h3 { font-size: 20px; }
  .modal-sub { font-size: 13.5px; }
  .prof-grid { grid-template-columns: 1fr 1fr; }
  .ref-stats { grid-template-columns: 1fr 1fr 1fr; gap: 7px; }
  .ref-stat { padding: 11px 6px; }
  .ref-stat b { font-size: 17px; }
  .ref-stat span { font-size: 10px; }
  .ref-link-row { flex-direction: column; }
  .ref-link-row .btn { width: 100%; }
  .adm-grid { grid-template-columns: 1fr 1fr; }
  .adm-card b { font-size: 15px; }
  .hist-row { flex-wrap: wrap; gap: 6px 10px; padding: 10px 12px; }
  .hist-game { min-width: 0; flex: 1; }
  .hist-mid { flex: 1 1 100%; order: 3; }

  /* профиль-меню на всю ширину экрана */
  .profile-menu { position: fixed; left: 10px; right: 10px; top: auto; min-width: 0; }

  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
}

/* совсем узкие экраны */
@media (max-width: 380px) {
  .hero h1 { font-size: 27px; }
  .logo { font-size: 17px; }
  .balance { padding: 6px 9px; font-size: 13px; }
  .name-btn #meName { max-width: 46px; }
  .prof-grid, .adm-grid { grid-template-columns: 1fr; }
  .odd-btn b { font-size: 13px; }
}

/* устройства с сенсорным вводом: убираем hover-подъёмы, увеличиваем зоны нажатия */
@media (hover: none) {
  .game-card:hover, .color-btn:hover:not(:disabled), .chip:hover,
  .odd-btn:hover:not(:disabled), .btn-blurple:hover, .btn-crash:hover:not(:disabled) {
    transform: none;
  }
  .odd-btn, .chip, .nav-btn, .top-tab, .line-tab { min-height: 40px; }
}
