/* Казино-зал: ночное казино. Сукно, золото, стекло. */

:root {
  --bg: #07130d;
  --bg-2: #0b1d14;
  --felt: #0f3d26;
  --felt-2: #0b2e1d;
  --card: rgba(12, 30, 21, .78);
  --card-solid: #10261b;
  --line: rgba(242, 193, 78, .16);
  --line-2: rgba(255, 255, 255, .08);
  --text: #f3efe2;
  --muted: #9fb3a6;
  --gold: #f2c14e;
  --gold-2: #ffdf8a;
  --gold-3: #c98f22;
  --red: #ef5b54;
  --green: #45d483;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45), 0 2px 0 rgba(255, 255, 255, .03) inset;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --gold-grad: linear-gradient(180deg, #ffe39a 0%, #f2c14e 45%, #d39a2a 100%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 500 15px/1.45 var(--font);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(242, 193, 78, .14), transparent 60%),
    radial-gradient(900px 700px at 100% 100%, rgba(239, 91, 84, .08), transparent 60%),
    radial-gradient(1000px 800px at 0% 100%, rgba(69, 212, 131, .07), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: .01em; margin: 0 0 10px; }
h1 { font-size: 28px; }
h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); margin: 0 0 16px; }
.small-hint { font-size: 13px; margin: 16px 0 8px; }
::selection { background: rgba(242, 193, 78, .35); }

/* ---------- Шапка ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px max(16px, calc((100vw - 1180px) / 2));
  background: rgba(6, 16, 11, .72);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.logo {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.logo-text {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(242, 193, 78, .25));
}
.me { display: flex; gap: 12px; align-items: center; }
#me-name { font-weight: 700; }
.chips {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  background: rgba(242, 193, 78, .1);
  border: 1px solid rgba(242, 193, 78, .35);
  color: var(--gold-2);
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.chips::before { content: "🪙"; font-size: 15px; }
.chips::after { content: none; }

.conn { font-size: 12px; color: var(--muted); white-space: nowrap; }
.conn::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--gold);
  box-shadow: 0 0 8px currentColor;
}
.conn[data-state="open"]::before { background: var(--green); box-shadow: 0 0 10px var(--green); }
.conn[data-state="closed"]::before { background: var(--red); box-shadow: 0 0 10px var(--red); }

/* ---------- Каркас ---------- */

main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 90px; }
.lobby { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.main-col, .side-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.side-col { position: sticky; top: 76px; }

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.card::before {
  /* тонкий блик сверху карточки */
  content: "";
  position: absolute;
  inset: 0 18px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 223, 138, .35), transparent);
  pointer-events: none;
}

/* ---------- Поля и кнопки ---------- */

input, select, textarea {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, .35);
  color: var(--text);
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(242, 193, 78, .6);
  box-shadow: 0 0 0 3px rgba(242, 193, 78, .15);
}
input::placeholder, textarea::placeholder { color: rgba(159, 179, 166, .7); }

button {
  position: relative;
  padding: 11px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--gold-grad);
  color: #2a1b02;
  font: inherit;
  font-weight: 800;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(242, 193, 78, .22), 0 1px 0 rgba(255, 255, 255, .5) inset, 0 -2px 0 rgba(0, 0, 0, .18) inset;
  transition: transform .08s, filter .15s, box-shadow .15s;
}
button:not(:disabled):hover { filter: brightness(1.07); box-shadow: 0 8px 24px rgba(242, 193, 78, .32), 0 1px 0 rgba(255, 255, 255, .5) inset, 0 -2px 0 rgba(0, 0, 0, .18) inset; }
button:not(:disabled):active { transform: translateY(1px) scale(.99); }
button:disabled { opacity: .45; cursor: default; box-shadow: none; }
button:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }

button.ghost {
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  border: 1px solid var(--line-2);
  font-weight: 600;
  box-shadow: none;
}
button.ghost:not(:disabled):hover { background: rgba(255, 255, 255, .09); border-color: rgba(242, 193, 78, .35); box-shadow: none; }
button.danger {
  background: linear-gradient(180deg, #ff8a7f, #e0443d 55%, #b72c26);
  color: #fff;
  box-shadow: 0 6px 18px rgba(239, 91, 84, .25), 0 1px 0 rgba(255, 255, 255, .35) inset;
}
button.link {
  padding: 0;
  background: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  box-shadow: none;
}
button.link:not(:disabled):hover { color: var(--text); box-shadow: none; filter: none; }

.error { color: var(--red); min-height: 1.4em; margin: 12px 0 0; }

/* ---------- Вход ---------- */

.login {
  max-width: 440px;
  margin: 8vh auto 0;
  padding: 36px 32px 28px;
  text-align: center;
  overflow: hidden;
}
.login::after {
  content: "♠ ♥ ♦ ♣";
  position: absolute;
  inset: auto 0 -18px;
  font-size: 64px;
  letter-spacing: 18px;
  color: rgba(242, 193, 78, .06);
  pointer-events: none;
}
.login h1 {
  font-size: 34px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login form { display: flex; gap: 8px; }

/* ---------- Вкладки ---------- */

/* Внутри игры: «Главная» и три группы — те же разделы, что на главной. */
.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line-2);
}
.tab-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 2px 4px 2px 2px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
  border-left: 3px solid var(--g);
}
.tab-group.casino { --g: #f2c14e; }
.tab-group.versus { --g: #e0445a; }
.tab-group.slots { --g: #5fe8d8; }
.tab-group-name {
  padding: 8px 10px;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
  white-space: nowrap;
}
.tab-group-name::after { content: " ▸"; color: var(--g); }
.tab-group.open .tab-group-name::after { content: none; }
.tab-group-name:not(:disabled):hover { color: var(--text); background: rgba(255, 255, 255, .05); box-shadow: none; filter: none; }
.tab-group:not(.open) .tab { display: none; }
.tab {
  white-space: nowrap;
  padding: 9px 12px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  box-shadow: none;
  white-space: nowrap;
}
.tab:not(:disabled):hover { color: var(--text); background: rgba(255, 255, 255, .05); box-shadow: none; filter: none; }
.tab.active, .tab.active:not(:disabled):hover {
  background: var(--gold-grad);
  color: #2a1b02;
  box-shadow: 0 6px 18px rgba(242, 193, 78, .25);
}
.tab .dot {
  display: inline-block;
  width: 9px; height: 9px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  vertical-align: middle;
  animation: pulse 1s infinite;
}
@keyframes pulse { 50% { transform: scale(1.35); opacity: .7; } }

/* ---------- Пособие, уведомления ---------- */

.bonus {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-color: rgba(242, 193, 78, .5);
  background: linear-gradient(120deg, rgba(242, 193, 78, .16), rgba(12, 30, 21, .8) 60%);
}
.bonus .muted { margin: 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 45;
  transform: translateX(-50%);
  margin: 0;
  padding: 0;
  max-width: calc(100vw - 32px);
  border-radius: 12px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}
.toast:not(:empty) {
  padding: 10px 18px;
  background: rgba(30, 10, 10, .92);
  border: 1px solid rgba(239, 91, 84, .5);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  animation: toast-in .2s ease-out;
}
.toast.ok:not(:empty) { color: var(--green); background: rgba(8, 30, 18, .94); border-color: rgba(69, 212, 131, .5); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Общие куски игр ---------- */

.history { display: flex; gap: 6px; overflow: hidden; margin-bottom: 14px; min-height: 28px; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.history span {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: rgba(239, 91, 84, .12);
  border: 1px solid rgba(239, 91, 84, .3);
  color: #ff8a83;
}
.history span.good { color: var(--green); background: rgba(69, 212, 131, .1); border-color: rgba(69, 212, 131, .3); }
.history span.great { color: var(--gold-2); background: rgba(242, 193, 78, .12); border-color: rgba(242, 193, 78, .4); }
/* номера рулетки в истории */
.history span.rn { min-width: 30px; text-align: center; color: #fff; }
.history span.rn.red { background: linear-gradient(180deg, #e0443d, #a8231d); border-color: #ff8a83; }
.history span.rn.black { background: linear-gradient(180deg, #2b2b2b, #0e0e0e); border-color: #555; }
.history span.rn.green { background: linear-gradient(180deg, #1fa35c, #0d6b39); border-color: #5be39a; }

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 120px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.field input { flex: none; font-size: 16px; text-transform: none; letter-spacing: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { min-width: 46px; }
.action { flex: 1 1 200px; min-height: 48px; font-size: 16px; font-family: var(--display); }
.action.cashout {
  background: linear-gradient(180deg, #8af5b6, #38c978 55%, #1f9a55);
  color: #052312;
  box-shadow: 0 0 0 0 rgba(69, 212, 131, .6), 0 8px 24px rgba(69, 212, 131, .35);
  animation: cashout-glow 1s infinite;
}
@keyframes cashout-glow { 50% { box-shadow: 0 0 0 6px rgba(69, 212, 131, 0), 0 8px 30px rgba(69, 212, 131, .55); } }
.my-result { min-height: 1.4em; margin: 12px 0 0; color: var(--muted); font-weight: 700; }
.my-result.win { color: var(--green); }
.my-result.lose { color: var(--red); }

.bets { width: 100%; border-collapse: collapse; margin-top: 16px; font-variant-numeric: tabular-nums; font-size: 14px; }
.bets th { text-align: left; font-weight: 600; font-size: 11px; color: var(--muted); padding: 6px 0; text-transform: uppercase; letter-spacing: .06em; }
.bets td { padding: 8px 0; border-top: 1px solid var(--line-2); }
.bets th:not(:first-child), .bets td:not(:first-child) { text-align: right; }
.bets tr.self td:first-child { color: var(--gold-2); font-weight: 700; }
.bets .won { color: var(--green); font-weight: 700; }
.bets .lost { color: var(--red); }

/* ---------- Краш ---------- */

.stage {
  position: relative;
  height: 300px;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, .5), transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(255, 255, 255, .4), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255, 255, 255, .35), transparent),
    radial-gradient(1.5px 1.5px at 85% 60%, rgba(255, 255, 255, .3), transparent),
    radial-gradient(1px 1px at 10% 85%, rgba(255, 255, 255, .3), transparent),
    radial-gradient(800px 300px at 50% 120%, rgba(242, 193, 78, .18), transparent 70%),
    linear-gradient(180deg, #050b14, #0b1626 60%, #0d1d1a);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .6);
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.mult {
  font-family: var(--display);
  font-size: clamp(52px, 11vw, 96px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 30px rgba(242, 193, 78, .55), 0 4px 0 rgba(0, 0, 0, .3);
}
.mult[data-phase="running"] { color: var(--gold-2); }
.mult[data-phase="betting"] { color: rgba(243, 239, 226, .55); text-shadow: none; }
.mult[data-phase="crashed"] { color: var(--red); text-shadow: 0 0 34px rgba(239, 91, 84, .7); animation: crashed .45s; }
@keyframes crashed { 20% { transform: translateX(-8px) rotate(-2deg); } 50% { transform: translateX(8px) rotate(2deg); } 80% { transform: translateX(-4px); } }
.phase { margin-top: 10px; color: var(--muted); font-weight: 600; }

/* ---------- Колесо фортуны ---------- */

.fw-top { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.fw-box { position: relative; width: 360px; max-width: 100%; aspect-ratio: 1; flex: none; margin: 0 auto; }
.fw-box canvas { width: 100%; height: 100%; display: block; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55)); }
.fw-hub {
  position: absolute; left: 50%; top: 52.5%; transform: translate(-50%, -50%);
  width: 23%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 26px; color: var(--gold-2);
  pointer-events: none;
}
.fw-hub.show { animation: pop .4s ease-out; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.fw-hub.show.m60 { color: var(--gold-2); text-shadow: 0 0 18px rgba(255, 214, 94, .9); }
.fw-hub.show.m0 { font-size: 34px; }
.fw-side { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fw-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fw-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 12px; border-radius: 14px; text-align: left; color: #fff;
  border: 1px solid rgba(255, 255, 255, .18);
  background: linear-gradient(160deg, var(--c2), var(--c1));
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .2);
  transition: transform .12s, box-shadow .2s, opacity .2s, filter .2s;
}
.fw-card:hover:not(:disabled) { transform: translateY(-2px); }
.fw-card:disabled { cursor: default; }
.fw-card.m2 { --c1: #0646d6; --c2: #3fb4ff; }
.fw-card.m3 { --c1: #008f39; --c2: #5dff95; }
.fw-card.m10 { --c1: #a00c83; --c2: #ff5ce0; }
.fw-card.m60 { --c1: #ff8a00; --c2: #ffe14d; color: #3a1d00; }
.fw-card-mult { font-family: var(--display); font-size: 22px; line-height: 1.1; }
.fw-card:not(.m60) { text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.fw-card small { font-size: 11px; opacity: .85; }
.fw-card-pot { font-size: 12px; font-weight: 600; opacity: .9; }
.fw-card-mine { position: absolute; top: 8px; right: 10px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; background: rgba(0, 0, 0, .35); color: #fff; }
.fw-card-mine:empty { display: none; }
.fw-card.has-mine { box-shadow: 0 0 0 2px var(--gold-2), 0 6px 18px rgba(0, 0, 0, .35); }
.fw-card.win { box-shadow: 0 0 0 3px #fff, 0 0 26px rgba(255, 255, 255, .55); animation: pop .4s; }
.fw-card.dim { opacity: .45; filter: saturate(.6); }
.history span.fwh { min-width: 38px; text-align: center; color: #fff; }
.history span.fwh.m2 { background: linear-gradient(180deg, #3fb4ff, #0a5cff); border-color: #9fd6ff; }
.history span.fwh.m3 { background: linear-gradient(180deg, #5dff95, #00b347); border-color: #b2ffcb; }
.history span.fwh.m10 { background: linear-gradient(180deg, #ff5ce0, #c2129f); border-color: #ffb3ef; }
.history span.fwh.m60 { background: linear-gradient(180deg, #ffe14d, #ff8a00); border-color: #fff3b0; color: #3b2400; }
.history span.fwh.m0 { background: linear-gradient(180deg, #a3102a, #2a0008); border-color: #ff5c74; }
.fw-stake { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; }
.fw-stake.m2 { background: #0a5cff; }
.fw-stake.m3 { background: #00a640; }
.fw-stake.m10 { background: #c2129f; }
.fw-stake.m60 { background: #ffb21f; color: #2e1c00; }
.dv-num.m2 { background: linear-gradient(180deg, #3fb4ff, #0a5cff); }
.dv-num.m3 { background: linear-gradient(180deg, #5dff95, #00b347); }
.dv-num.m10 { background: linear-gradient(180deg, #ff5ce0, #c2129f); }
.dv-num.m60 { background: linear-gradient(180deg, #ffe14d, #ff8a00); color: #3b2400; }
.dv-num.m0 { background: linear-gradient(180deg, #a3102a, #2a0008); }
@media (max-width: 560px) {
  .fw-hub { font-size: 20px; }
  .fw-card-mult { font-size: 18px; }
}

/* ---------- Рулетка ---------- */

.r-top { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.wheel-box {
  position: relative;
  width: 300px; height: 300px;
  flex: none;
  margin: 0 auto;
  border-radius: 50%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6), 0 0 0 6px rgba(0, 0, 0, .25);
}
.wheel-box canvas { width: 300px; height: 300px; display: block; }
.r-center {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(10, 6, 2, .72);
  border: 2px solid var(--gold);
  color: var(--gold-2);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 20px rgba(242, 193, 78, .35);
  transition: transform .3s;
}
.r-center:empty { opacity: 0; }
.r-center.red, .r-center.black, .r-center.green { width: 64px; height: 64px; font-size: 26px; color: #fff; animation: pop .4s ease-out; }
.r-center.red { background: radial-gradient(circle at 35% 30%, #ff6b62, #b3261e); }
.r-center.black { background: radial-gradient(circle at 35% 30%, #4a4a4a, #0c0c0c); }
.r-center.green { background: radial-gradient(circle at 35% 30%, #3fd185, #0d6b39); }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } }

.r-side { flex: 1 1 240px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.r-phase { color: var(--muted); font-weight: 600; }
.r-result { min-height: 1.4em; font-family: var(--display); font-weight: 700; font-size: 18px; }
.r-result.win { color: var(--green); }
.r-result.lose { color: var(--red); }
.r-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.r-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  --c: #2b6cb0;
  width: 54px; height: 54px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  color: #fff;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
  /* фишка: кант с полосками и внутренний круг */
  background:
    radial-gradient(circle, var(--c) 0 52%, transparent 53%),
    repeating-conic-gradient(var(--c) 0 20deg, #fff 20deg 30deg),
    var(--c);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .35) inset, 0 4px 10px rgba(0, 0, 0, .5);
  transition: transform .12s;
}
.chip:not(:disabled):hover { transform: translateY(-3px); filter: brightness(1.1); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35) inset, 0 8px 16px rgba(0, 0, 0, .5); }
.chip[data-v="10"] { --c: #5b6577; }
.chip[data-v="50"] { --c: #2563c4; }
.chip[data-v="100"] { --c: #1d8a52; }
.chip[data-v="500"] { --c: #b3261e; }
.chip[data-v="1000"] { --c: #7a3fd1; }
.chip[data-v="5000"] { --c: #c9862a; }
.chip.active { transform: translateY(-4px); box-shadow: 0 0 0 3px var(--gold-2), 0 0 18px rgba(242, 193, 78, .7); }
.r-custom { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted, #9aa3b2); font-size: 14px; }
.r-custom input {
  width: 130px; padding: 8px 12px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(0, 0, 0, .3); color: #fff; font: inherit; font-weight: 700;
}
.r-custom input:focus { outline: none; border-color: var(--gold-2); }
.r-custom input.active { border-color: var(--gold-2); box-shadow: 0 0 0 2px rgba(242, 193, 78, .35), 0 0 14px rgba(242, 193, 78, .4); }
.r-custom input.bad { border-color: #e05252; box-shadow: none; }
.r-mytotal { color: var(--gold-2); min-height: 1.4em; font-weight: 700; }

.board-wrap {
  overflow-x: auto;
  padding: 12px;
  border-radius: 14px;
  background: radial-gradient(ellipse at center, #136b3e, #0b4527 80%);
  border: 6px solid #4a250f;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .45), 0 10px 30px rgba(0, 0, 0, .4);
}
.board {
  display: grid;
  grid-template-columns: 32px repeat(12, minmax(24px, 1fr)) 32px;
  grid-template-rows: repeat(3, 40px) 34px 34px;
  gap: 2px;
  min-width: 380px;
}
.cell {
  position: relative;
  padding: 0;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .55);
  color: #fff;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  background: transparent;
  box-shadow: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.cell:not(:disabled):hover { background-color: rgba(255, 255, 255, .14); box-shadow: none; filter: none; }
.cell.red { background: #b3261e; }
.cell.black { background: #151515; }
.cell.green { background: #14894a; }
.cell.red:not(:disabled):hover, .cell.black:not(:disabled):hover, .cell.green:not(:disabled):hover { filter: brightness(1.25); }
.cell:disabled { cursor: default; opacity: .9; }
.cell.win { box-shadow: 0 0 0 3px var(--gold-2), 0 0 18px rgba(242, 193, 78, .8); z-index: 1; animation: pop .4s; }
.cell .stake {
  position: absolute;
  right: -6px;
  top: -8px;
  min-width: 24px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--gold-grad);
  color: #2a1b02;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
  z-index: 2;
}

/* ---------- Покер (Техасский холдем) ---------- */

.poker-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pot-box {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .06em;
}
.pot { color: var(--gold-2); font-family: var(--display); font-size: 26px; font-variant-numeric: tabular-nums; text-transform: none; }
.poker-phase { color: var(--muted); font-weight: 600; }

.ptable { position: relative; aspect-ratio: 16 / 10; min-height: 360px; margin: 18px 0 8px; }
.felt {
  position: absolute;
  inset: 13% 11%;
  border-radius: 50% / 50%;
  background: radial-gradient(ellipse at center, #16804a, #0c5130 70%, #093d25);
  border: 12px solid #4a250f;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, .55), 0 0 0 3px #c9a24a, 0 18px 40px rgba(0, 0, 0, .5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pk-board { display: flex; gap: 6px; }
.pk-pot { min-height: 1.3em; font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--gold-2); text-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.pk-result {
  max-width: 80%;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  border: 1px solid var(--green);
  color: var(--green);
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  animation: pop .35s;
}

/* Карта */
.pcard {
  --w: 46px;
  position: relative;
  width: var(--w);
  height: calc(var(--w) * 1.4);
  flex: none;
  border-radius: calc(var(--w) * .12);
  background: linear-gradient(160deg, #fff, #ecebe6);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .45), inset 0 -2px 0 rgba(0, 0, 0, .08);
  color: #151515;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  user-select: none;
}
.pcard b { font-family: var(--display); font-size: calc(var(--w) * .42); font-weight: 800; }
.pcard i { font-style: normal; font-size: calc(var(--w) * .44); margin-top: 2px; }
.pcard.red { color: #d0261e; }
.pcard.small { --w: 26px; border-radius: 4px; box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.pcard.small i { margin-top: 0; }
.pcard.back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .14) 0 3px, transparent 3px 7px),
    linear-gradient(160deg, #b3261e, #6f120e);
  border: 2px solid #fff;
}
.pcard.slot { background: rgba(0, 0, 0, .18); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .15); }
.pcard.deal { animation: deal .45s cubic-bezier(.2, .8, .3, 1.2); }
@keyframes deal { from { transform: translateY(-40px) rotate(-14deg) scale(.6); opacity: 0; } }
.pcard.hl { box-shadow: 0 0 0 3px var(--gold-2), 0 0 18px rgba(242, 193, 78, .8); transform: translateY(-4px); }

/* Места */
.pk-seats { position: absolute; inset: 0; pointer-events: none; }
.pk-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 128px;
  padding: 6px 8px 7px;
  border-radius: 14px;
  background: rgba(6, 14, 10, .9);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .45);
  font-size: 13px;
  text-align: center;
  pointer-events: auto;
  transition: box-shadow .2s, opacity .2s;
}
.pk-seat.empty { width: 92px; padding: 10px 6px; color: rgba(255, 255, 255, .3); background: rgba(0, 0, 0, .25); border-style: dashed; font-size: 12px; }
.pk-seat.mine { border-color: rgba(242, 193, 78, .7); }
.pk-seat.turn { box-shadow: 0 0 0 2px var(--gold-2), 0 0 26px rgba(242, 193, 78, .55); }
.pk-seat.folded { opacity: .5; }
.pk-seat.offline { opacity: .6; }
.pk-seat.winner { border-color: var(--green); box-shadow: 0 0 0 2px var(--green), 0 0 28px rgba(69, 212, 131, .6); }
.pk-cards { display: flex; justify-content: center; gap: 3px; min-height: 38px; margin-top: -26px; margin-bottom: 4px; }
.pk-head { display: flex; align-items: center; justify-content: center; gap: 6px; }
.pk-head .avatar { width: 22px; height: 22px; font-size: 11px; }
.pk-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 84px; }
.pk-stack { color: var(--gold-2); font-family: var(--display); font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.pk-note { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-note.won { color: var(--green); font-size: 12px; }
.pk-tag {
  position: absolute;
  top: -8px;
  min-width: 22px;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}
.pk-tag.dealer { right: -8px; background: #fff; color: #111; }
.pk-tag.blind { left: -8px; background: #2563c4; color: #fff; }
.pk-tag.blind + .pk-tag.blind { left: auto; right: 18px; }
.pk-timer { position: absolute; left: 8px; right: 8px; bottom: 3px; height: 3px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.pk-timer i { display: block; height: 100%; background: var(--gold-grad); transition: width .25s linear; }

/* Ставка игрока на улице: стопка фишек ближе к центру стола */
.pk-bet {
  position: absolute;
  padding: 2px 8px 2px 22px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: var(--gold-2);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.pk-bet::before {
  content: "";
  position: absolute;
  left: 4px; top: 50%;
  width: 14px; height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  background: radial-gradient(circle, #e0443d 0 45%, #fff 46% 55%, #e0443d 56%);
}
.slot-0 .pk-bet { left: 50%; top: -44px; transform: translateX(-50%); }
.slot-3 .pk-bet { left: 50%; bottom: -30px; transform: translateX(-50%); }
.slot-1 .pk-bet, .slot-2 .pk-bet { left: calc(100% + 6px); top: 40%; }
.slot-4 .pk-bet, .slot-5 .pk-bet { right: calc(100% + 6px); top: 40%; }

/* Мои карты крупно и кнопки */
.pk-me { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 8px; }
.pk-hole { display: flex; gap: 8px; }
.pk-hole .pcard { --w: 64px; }
.pk-hole.folded { opacity: .4; filter: grayscale(.7); }
.hand-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hint { margin: 4px 0 0; color: var(--muted); min-height: 1.4em; font-weight: 600; }

.pk-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.pk-main-actions { display: flex; gap: 8px; }
.pk-main-actions button { flex: 1; min-height: 46px; font-family: var(--display); }
.pk-raise { display: flex; flex-direction: column; gap: 8px; }
.pk-raise-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#raise-slider { flex: 1 1 180px; padding: 0; border: 0; background: none; box-shadow: none; accent-color: var(--gold); height: 26px; }
#raise-amount { flex: 0 1 110px; }
#raise-btn { flex: 1 1 160px; }

.leave { display: block; margin: 16px auto 0; }
.rules { margin-top: 18px; color: var(--muted); font-size: 14px; }
.rules summary { cursor: pointer; font-weight: 700; color: var(--text); }
.rules .ranks { margin: 8px 0 0; padding-left: 20px; }

@media (max-width: 700px) {
  .ptable { aspect-ratio: 3 / 4; min-height: 420px; }
  .felt { inset: 16% 8%; border-width: 8px; }
  .pk-seat { width: 96px; padding: 5px 5px 6px; font-size: 12px; }
  .pk-name { max-width: 60px; }
  .pcard { --w: 34px; }
  .pcard.small { --w: 22px; }
  .pk-hole .pcard { --w: 54px; }
  .pk-board { gap: 4px; }
}

/* ---------- Боковая колонка ---------- */

.count {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  background: rgba(69, 212, 131, .15);
  color: var(--green);
  border: 1px solid rgba(69, 212, 131, .35);
  border-radius: 999px;
  padding: 1px 9px;
}
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line-2);
}
.list li:first-child { border-top: 0; }
.list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.list li.self .name { color: var(--gold-2); }
.list li.self .name::after { content: " · ты"; color: var(--muted); font-weight: 500; }
.avatar {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: hsl(var(--h, 140) 55% 38%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25), 0 0 0 2px rgba(255, 255, 255, .08);
  text-transform: uppercase;
}
.leaderboard { counter-reset: place; }
.leaderboard li::before {
  counter-increment: place;
  content: counter(place);
  width: 22px;
  text-align: center;
  color: var(--muted);
  font-family: var(--display);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.leaderboard li:nth-child(1)::before { content: "🥇"; font-size: 17px; }
.leaderboard li:nth-child(2)::before { content: "🥈"; font-size: 17px; }
.leaderboard li:nth-child(3)::before { content: "🥉"; font-size: 17px; }
.leaderboard li.offline .name, .leaderboard li.offline .avatar { opacity: .5; }
.leaderboard .score { color: var(--gold-2); font-family: var(--display); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- Чат ---------- */

.chat-log {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
  font-size: 14px;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
  scrollbar-color: rgba(242, 193, 78, .3) transparent;
}
.chat-log li { padding: 5px 8px; border-radius: 10px; }
.chat-log li + li { margin-top: 2px; }
.chat-log li:hover { background: rgba(255, 255, 255, .03); }
.chat-log .time { color: var(--muted); font-size: 11px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.chat-log .author { font-weight: 800; margin-right: 6px; color: #9ed8ff; }
.chat-log li.self .author { color: var(--gold-2); }
.chat-log .empty { color: var(--muted); }
.chat-log li.system { background: linear-gradient(90deg, rgba(69, 212, 131, .13), rgba(69, 212, 131, .03)); border-left: 3px solid var(--green); }
.chat-log li.system .author { color: var(--green); }
.chat-form, .order-form { display: flex; gap: 6px; }
.order-form { margin-top: 8px; }
.chat-form input, .order-form select { padding: 9px 12px; font-size: 14px; }
.chat-form button, .order-form button { padding: 9px 14px; font-size: 14px; }

/* ---------- Музыка ---------- */

.music {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 8px 16px 8px 10px;
  border-radius: 999px;
  background: rgba(10, 22, 15, .9);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(242, 193, 78, .5);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .55), 0 0 24px rgba(242, 193, 78, .15);
  font-size: 14px;
}
.music::before {
  content: "";
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle, #111 0 18%, var(--gold) 19% 24%, #1b1b1b 25% 100%);
  box-shadow: 0 0 0 2px rgba(242, 193, 78, .4);
  animation: vinyl 3s linear infinite;
}
@keyframes vinyl { to { transform: rotate(360deg); } }
.music.off { border-color: var(--line-2); opacity: .85; box-shadow: 0 12px 34px rgba(0, 0, 0, .55); }
.music.off::before { animation: none; opacity: .5; }
.music.off .volume, .music.off .volume-hint { display: none; }
.music-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.music-play { padding: 6px 12px; font-size: 13px; }
.volume { display: flex; align-items: center; gap: 4px; flex: none; }
#music-volume { width: 120px; height: 24px; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; cursor: pointer; accent-color: var(--gold); }
.volume-hint { font-size: 12px; white-space: nowrap; }
.music .link { white-space: nowrap; }

/* ---------- Объявления и эффекты ---------- */

.banner {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(circle, rgba(0, 0, 0, .45), rgba(0, 0, 0, .8));
  animation: banner-in .35s ease-out;
  cursor: pointer;
}
.banner-text {
  max-width: 900px;
  padding: 32px 40px;
  border-radius: 24px;
  border: 2px solid var(--gold);
  background: linear-gradient(160deg, #173a28, #0a1d13);
  font-family: var(--display);
  font-size: clamp(26px, 6vw, 56px);
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
  box-shadow: 0 0 80px rgba(242, 193, 78, .4);
  color: var(--gold-2);
}
@keyframes banner-in { from { opacity: 0; transform: scale(1.3); } to { opacity: 1; transform: none; } }

.fx-layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.fx-confetti, .fx-emoji { position: absolute; top: -40px; animation: fx-fall linear forwards; }
.fx-confetti { width: 10px; height: 16px; border-radius: 2px; }
.fx-emoji { font-size: 32px; }
@keyframes fx-fall { to { transform: translateY(110vh) rotate(var(--spin)); } }

body.fx-shake { animation: fx-shake .9s; }
@keyframes fx-shake {
  0%, 100% { transform: none; }
  10%, 50%, 90% { transform: translate(-14px, 6px) rotate(-1deg); }
  30%, 70% { transform: translate(14px, -6px) rotate(1deg); }
}
body.fx-flip { transform: rotate(180deg); transition: transform .6s; }
body.fx-disco { animation: fx-disco .5s linear infinite; }
@keyframes fx-disco { from { filter: hue-rotate(0deg) saturate(2); } to { filter: hue-rotate(360deg) saturate(2); } }

/* ---------- Мобильные ---------- */

@media (max-width: 960px) {
  .lobby { grid-template-columns: 1fr; }
  .side-col { position: static; }
}
@media (max-width: 700px) {
  main { padding: 14px 10px 90px; }
  .card { padding: 16px; border-radius: 16px; }
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; }
  .logo { font-size: 17px; }
  .stage { height: 220px; }
  .wheel-box, .wheel-box canvas { width: 280px; height: 280px; }
  .music { left: 8px; right: 8px; bottom: 8px; max-width: none; }
  #music-volume { width: 90px; }
  .tab { padding: 8px 9px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Фоновый джаз ---------- */

.lounge { position: fixed; right: 16px; bottom: 16px; z-index: 31; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.lounge-btn {
  position: relative;
  width: 46px; height: 46px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(10, 22, 15, .85);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 20px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
  opacity: .75;
  transition: opacity .2s, transform .15s;
}
.lounge-btn:not(:disabled):hover { opacity: 1; background: rgba(10, 22, 15, .95); box-shadow: 0 8px 22px rgba(0, 0, 0, .45); }
.lounge-btn.off { filter: grayscale(1); opacity: .5; }
.lounge-btn .eq { position: absolute; right: 6px; bottom: 7px; display: none; gap: 1.5px; align-items: flex-end; height: 10px; }
.lounge-btn.playing .eq { display: flex; }
.lounge-btn .eq i { width: 2.5px; background: var(--gold); border-radius: 1px; animation: eq 1s ease-in-out infinite; }
.lounge-btn .eq i:nth-child(2) { animation-delay: -.35s; }
.lounge-btn .eq i:nth-child(3) { animation-delay: -.7s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 10px; } }

.lounge-panel {
  width: 240px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(10, 22, 15, .95);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  font-size: 14px;
  animation: toast-in .15s ease-out;
}
.lounge-head { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--gold-2); }
.lounge-track { margin: 6px 0 10px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lounge-row { display: flex; gap: 6px; }
.lounge-row button { padding: 8px 10px; font-size: 14px; }
.lounge-row #lounge-toggle { flex: 1; }
.lounge-vol { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--muted); }
#lounge-vol { padding: 0; border: 0; background: none; box-shadow: none; accent-color: var(--gold); height: 22px; }
.lounge-note { margin: 8px 0 0; min-height: 0; font-size: 12px; color: var(--muted); }
.lounge-note:empty { display: none; }

@media (max-width: 700px) {
  .lounge { right: 10px; bottom: 10px; }
  .has-music .lounge { bottom: 70px; }
}

/* ---------- Бомба в банке ---------- */

.b-stage { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-top: 4px; }
.b-bomb { position: relative; width: 190px; height: 200px; flex: none; margin: 0 auto; }
.b-body {
  position: absolute;
  left: 10px; bottom: 0;
  width: 170px; height: 170px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 32% 28%, #5d6470 0, #262a31 22%, #0c0d10 60%, #000 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .6), inset -10px -14px 30px rgba(0, 0, 0, .7), inset 6px 8px 18px rgba(255, 255, 255, .06);
  transition: box-shadow .4s;
}
.b-body::before {
  /* горлышко */
  content: "";
  position: absolute;
  top: -12px; right: 34px;
  width: 34px; height: 24px;
  border-radius: 6px;
  background: linear-gradient(180deg, #5b616b, #1d2025);
  transform: rotate(32deg);
}
.b-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
#b-bank { font-family: var(--display); font-size: 34px; font-weight: 800; color: var(--gold-2); text-shadow: 0 0 18px rgba(242, 193, 78, .5); font-variant-numeric: tabular-nums; }
.b-fuse {
  position: absolute;
  top: 0; right: 4px;
  width: 52px; height: 42px;
  border-top: 4px solid #c9a56a;
  border-right: 4px solid #c9a56a;
  border-radius: 0 34px 0 0;
  transform: rotate(18deg);
}
.b-spark {
  position: absolute;
  top: -11px; left: -9px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 18%, #ffd34d 30%, #ff7a1a 55%, transparent 70%);
  opacity: 0;
}
.b-bomb.lit .b-spark { opacity: 1; animation: spark .18s infinite alternate; }
@keyframes spark { from { transform: scale(.8) rotate(0); } to { transform: scale(1.35) rotate(40deg); } }
.b-bomb[data-heat="1"] .b-body { animation: wobble 1.6s ease-in-out infinite; }
.b-bomb[data-heat="2"] .b-body { animation: wobble .8s ease-in-out infinite; box-shadow: 0 18px 40px rgba(0, 0, 0, .6), 0 0 30px rgba(255, 90, 40, .25), inset -10px -14px 30px rgba(0, 0, 0, .7); }
.b-bomb[data-heat="3"] .b-body { animation: wobble .35s ease-in-out infinite; box-shadow: 0 18px 40px rgba(0, 0, 0, .6), 0 0 50px rgba(255, 70, 30, .55), inset -10px -14px 30px rgba(0, 0, 0, .7); }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2.5deg) scale(1.01); } 75% { transform: rotate(2.5deg) scale(1.01); } }
.b-bomb.bump #b-bank { animation: pop .35s; }
.b-bomb.exploded .b-body { animation: blown .6s forwards; }
.b-bomb.exploded .b-fuse { opacity: 0; }
@keyframes blown { 0% { transform: scale(1); } 40% { transform: scale(1.35); filter: brightness(3); } 100% { transform: scale(.9); opacity: .35; filter: grayscale(1); } }

.b-info { flex: 1 1 240px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.b-phase { font-family: var(--display); font-weight: 700; font-size: 17px; }
.b-timer { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.b-timer i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--gold-grad); transition: width .2s linear; }
.b-timer i.hurry { background: linear-gradient(90deg, #ff8a7f, #e0443d); }
.b-result { font-weight: 700; color: var(--muted); min-height: 1.4em; }
.b-result.win { color: var(--green); }
.b-result.lose { color: var(--red); }

.b-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 18px; }
.b-player {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "av name" "av sum" "av st";
  column-gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line-2);
  font-size: 13px;
  transition: box-shadow .2s, transform .2s;
}
.b-player .avatar { grid-area: av; align-self: center; width: 34px; height: 34px; font-size: 15px; }
.b-name { grid-area: name; font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-sum { grid-area: sum; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.b-status { grid-area: st; color: var(--muted); }
.b-player.mine { border-color: rgba(242, 193, 78, .6); }
.b-player.turn { box-shadow: 0 0 0 2px #ff9b4a, 0 0 22px rgba(255, 120, 40, .45); transform: translateY(-2px); }
.b-player.out { opacity: .55; }
.b-player.boom { border-color: var(--red); background: rgba(239, 91, 84, .14); }
.b-player.boom .b-status { color: var(--red); font-weight: 800; }

.b-deposit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 100%; }
.b-deposit .quick button { min-width: 50px; }
#b-amount { flex: 0 1 100px; }
#b-put { flex: 1 1 140px; }

.boom-flash {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  font-size: min(40vw, 320px);
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 230, 150, .9), rgba(255, 90, 30, .55) 40%, transparent 75%);
  animation: boom 1.2s ease-out forwards;
}
@keyframes boom { 0% { opacity: 0; transform: scale(.3); } 12% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.6); } }

/* ---------- Апгрейдер ---------- */

.u-stage { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.u-wheel-box { position: relative; width: 280px; height: 280px; flex: none; margin: 0 auto; }
.u-wheel-box canvas { width: 280px; height: 280px; display: block; }
.u-center {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 150px; height: 150px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 40% 30%, rgba(69, 212, 131, .12), rgba(0, 0, 0, .4) 70%);
  border: 1px solid var(--line-2);
}
#u-chance-big { font-family: var(--display); font-size: 40px; font-weight: 800; color: var(--green); line-height: 1; text-shadow: 0 0 20px rgba(69, 212, 131, .5); }
#u-mult-big { margin-top: 6px; font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--gold-2); }
.upgrader.won .u-center { box-shadow: 0 0 40px rgba(69, 212, 131, .55); border-color: var(--green); animation: pop .4s; }

.u-side { flex: 1 1 260px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.u-side .field { flex: none; }
.u-chance-label { color: var(--green); font-size: 14px; }
#u-chance { padding: 0; border: 0; background: none; box-shadow: none; accent-color: var(--green); height: 26px; }
.u-presets button.active { border-color: var(--green); color: var(--green); background: rgba(69, 212, 131, .1); }
.u-win { font-size: 15px; color: var(--muted); font-weight: 600; }
.u-win b { font-family: var(--display); font-size: 22px; color: var(--gold-2); }
#u-mult { color: var(--green); font-weight: 800; }
#u-go { flex: none; }
.u-result { min-height: 1.4em; font-family: var(--display); font-weight: 700; font-size: 18px; }
.u-result.win { color: var(--green); animation: pop .4s; }
.u-result.lose { color: var(--red); }

.u-feed-title { margin-top: 22px; font-size: 14px; color: var(--muted); }
.u-feed li { font-size: 14px; }
.u-feed .u-what { font-family: var(--display); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.u-feed li.win .u-what { color: var(--green); }
.u-feed li.lose .u-what { color: var(--red); }
.u-feed .u-ch { min-width: 92px; text-align: right; color: var(--muted); font-size: 12px; }

/* ---------- Лента ставок и выигрышей ---------- */

.act-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.act-head h2 { margin: 0; }
.act-filter { display: flex; gap: 4px; }
.act-filter button { padding: 6px 12px; font-size: 13px; }
.act-filter button.active { border-color: var(--gold); color: var(--gold-2); background: rgba(242, 193, 78, .1); }
.act-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(242, 193, 78, .3) transparent; }
.act-list li { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-top: 1px solid var(--line-2); border-radius: 8px; font-size: 14px; }
.act-list li:first-child { border-top: 0; }
.act-list li.self { background: rgba(242, 193, 78, .06); }
.act-list li.fresh { animation: act-in .5s ease-out; }
@keyframes act-in { from { opacity: 0; transform: translateY(-8px); background: rgba(242, 193, 78, .18); } }
.act-icon { flex: none; width: 22px; text-align: center; font-size: 16px; }
.act-list .avatar { width: 26px; height: 26px; font-size: 12px; }
.act-body { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.act-body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-what { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-amount { flex: none; font-family: var(--display); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--gold-2); }
.act-win .act-amount { color: var(--green); }
.act-lose .act-amount { color: var(--red); }
.act-empty { justify-content: center; }

/* ---------- Пул ---------- */

.pl-sub { margin-top: 22px; font-size: 14px; color: var(--muted); }
.pl-invites { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.pl-invites:empty { display: none; }
.pl-invite { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(242, 193, 78, .45); background: rgba(242, 193, 78, .08); font-weight: 600; }
.pl-invite span { flex: 1 1 200px; }
.pl-invite button { padding: 7px 14px; font-size: 14px; }
#pl-matches li button { padding: 6px 12px; font-size: 13px; }

.pl-top { display: flex; align-items: stretch; gap: 10px; }
.pl-player {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line-2);
  transition: box-shadow .2s;
}
.pl-player.right { text-align: right; }
.pl-player.active { border-color: var(--gold-2); box-shadow: 0 0 0 2px rgba(242, 193, 78, .4), 0 0 18px rgba(242, 193, 78, .3); }
.pl-player.winner { border-color: var(--green); box-shadow: 0 0 0 2px var(--green), 0 0 20px rgba(69, 212, 131, .5); }
.pl-name { display: flex; align-items: center; gap: 6px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-player.right .pl-name { flex-direction: row-reverse; }
.pl-name .avatar { width: 24px; height: 24px; font-size: 11px; }
.pl-group { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pl-mini { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; min-height: 18px; }
.pl-player.right .pl-mini { justify-content: flex-end; }
.pl-mini span {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
  color: #111;
  background: radial-gradient(circle, #fff 0 38%, var(--c) 40%);
}
.pl-mini span.stripe { background: radial-gradient(circle, #fff 0 38%, transparent 40%), linear-gradient(180deg, #fff 0 25%, var(--c) 25% 75%, #fff 75%); }
.pl-center { flex: 1 1 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; text-align: center; min-width: 0; }
.pl-status { font-family: var(--display); font-weight: 700; font-size: 14px; }
.pl-msg { margin: 10px 0 6px; min-height: 1.4em; color: var(--gold-2); font-weight: 700; text-align: center; font-size: 14px; }
.pl-table-wrap { border-radius: 18px; overflow: hidden; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); }
#pl-canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.pl-power { height: 8px; margin-top: 10px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.pl-power i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #45d483, #f2c14e 60%, #ef5b54); }
.pl-actions { justify-content: space-between; }

.pl-popup {
  position: fixed;
  top: 78px;
  left: 50%;
  z-index: 55;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100vw - 24px);
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(10, 22, 15, .96);
  border: 1px solid var(--gold);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6), 0 0 30px rgba(242, 193, 78, .25);
  font-weight: 600;
  animation: toast-in .25s ease-out;
}
.pl-popup .row { margin: 0; gap: 6px; display: flex; }
.pl-popup button { padding: 8px 14px; font-size: 14px; }

@media (max-width: 700px) {
  .pl-top { flex-wrap: wrap; }
  .pl-center { order: -1; flex-basis: 100%; }
}

/* ---------- Верити ---------- */
.vt-strip span {
  min-width: 30px; text-align: center; font-size: 15px; line-height: 1;
}
.vt-strip span.vt-g { background: rgba(247, 207, 34, .12); border-color: rgba(247, 207, 34, .45); }
.vt-strip span.vt-e { background: rgba(212, 42, 28, .16); border-color: rgba(255, 90, 70, .45); }

.vt-stage {
  position: relative; overflow: hidden; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 12px 0; min-height: 400px;
  background:
    radial-gradient(ellipse 60% 45% at 50% 42%, rgba(247, 207, 34, .14), transparent 70%),
    radial-gradient(ellipse 120% 70% at 50% 120%, #0f3a26, #0a1f16 60%, #090d0b);
  border: 1px solid var(--line);
  transition: background .6s;
}
.verity.evil-mood .vt-stage {
  background:
    radial-gradient(ellipse 60% 45% at 50% 42%, rgba(220, 40, 30, .25), transparent 70%),
    radial-gradient(ellipse 120% 70% at 50% 120%, #3a0f12, #1f0a0c 60%, #0d0909);
}

.vt-bubble {
  position: relative; z-index: 2; max-width: 92%;
  background: #fffaf0; color: #1a1408; font-weight: 700; font-size: 15px;
  padding: 9px 14px; border-radius: 16px; text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.vt-bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -8px; margin-left: -8px;
  border: 8px solid transparent; border-bottom: 0; border-top-color: #fffaf0;
}
.vt-bubble.pop { animation: vt-pop .3s ease-out; }
.vt-bubble.think { background: #f3f0ff; color: #2a2346; }
.vt-bubble.think::after { border-top-color: #f3f0ff; }
.vt-bubble.good { background: #fff3b8; }
.vt-bubble.good::after { border-top-color: #fff3b8; }
.vt-bubble.evil { background: #2a0b0c; color: #ffb3a8; border: 1px solid #a3231c; }
.vt-bubble.evil::after { border-top-color: #2a0b0c; }
@keyframes vt-pop { from { transform: scale(.85); opacity: .3; } to { transform: scale(1); opacity: 1; } }

.vt-float { margin-top: 18px; animation: vt-float 3.2s ease-in-out infinite; }
@keyframes vt-float { 50% { transform: translateY(-8px); } }

.vt-hero { width: 230px; height: 230px; transition: filter .4s; }
.vt-hero svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* Какая сторона монетки сейчас видна. */
.vt-face-evil, .vt-redskin, .vt-horns { opacity: 0; }
.vt-hero[data-side="evil"] .vt-face-good { opacity: 0; }
.vt-hero[data-side="evil"] .vt-face-evil,
.vt-hero[data-side="evil"] .vt-redskin,
.vt-hero[data-side="evil"] .vt-horns { opacity: 1; }

.vt-eyes-happy, .vt-blush, .vt-mouth-open, .vt-maw { opacity: 0; }
.vt-hero.happy .vt-eyes, .vt-hero.happy .vt-smile { opacity: 0; }
.vt-hero.happy .vt-eyes-happy, .vt-hero.happy .vt-mouth-open { opacity: 1; }
.vt-hero.happy .vt-blush { opacity: .55; }
.vt-hero.eat .vt-grin { opacity: 0; }
.vt-hero.eat .vt-maw { opacity: 1; }

.vt-eyes, .vt-maw, .vt-horns, .vt-glint { transform-box: fill-box; transform-origin: center; }
.vt-hero.idle .vt-eyes { animation: vt-blink 4.6s infinite; }
@keyframes vt-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }

.vt-hero.idle { animation: vt-sway 5s ease-in-out infinite; }
@keyframes vt-sway { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }

.vt-hero.happy { filter: drop-shadow(0 0 26px rgba(255, 214, 60, .75)); }
.vt-hero.jump { animation: vt-jump .55s ease-out 3; }
@keyframes vt-jump {
  0% { transform: translateY(0) scale(1.08, .9); }
  40% { transform: translateY(-34px) scale(.95, 1.06); }
  80% { transform: translateY(0) scale(1.06, .94); }
  100% { transform: translateY(0) scale(1); }
}

.vt-hero.grin, .vt-hero.burp { filter: drop-shadow(0 0 30px rgba(255, 40, 20, .7)); }
.vt-hero.grin .vt-horns { animation: vt-horns .35s ease-out; }
@keyframes vt-horns { from { transform: scale(.2) translateY(30px); } to { transform: scale(1) translateY(0); } }
.vt-hero.grin .vt-glint { animation: vt-glint 1s ease-in-out infinite; }
@keyframes vt-glint { 50% { transform: scale(1.6); fill: #ff3b2f; } }
.vt-hero.eat .vt-maw { animation: vt-open .22s ease-out; }
.vt-hero.chomp .vt-maw { animation: vt-chomp .26s ease-in-out infinite; }
@keyframes vt-open { from { transform: scaleY(.15); } to { transform: scaleY(1); } }
@keyframes vt-chomp { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.15); } }
.vt-hero.burp { animation: vt-burp .7s ease-in-out; }
@keyframes vt-burp {
  0%, 100% { transform: none; }
  15% { transform: translateX(-7px) rotate(-5deg); } 30% { transform: translateX(7px) rotate(5deg); }
  45% { transform: translateX(-5px) rotate(-3deg) scale(1.08); } 60% { transform: translateX(4px) rotate(2deg) scale(1.08); }
}

.vt-table {
  position: relative; width: min(340px, 92%); height: 92px; margin-top: auto;
  background: radial-gradient(ellipse 50% 40% at 50% 55%, rgba(0, 0, 0, .35), transparent 70%);
}
.vt-pile { position: absolute; left: 50%; bottom: 34px; width: 34px; height: 60px; margin-left: -17px; }
.vt-pile-label {
  position: absolute; left: 0; right: 0; bottom: 8px; text-align: center;
  font: 700 15px var(--display); color: var(--gold-2); transition: opacity .3s;
}
.vt-pile-label.good { color: var(--green); text-shadow: 0 0 12px rgba(69, 212, 131, .6); }
.vt-pile-label.gone { opacity: 0; }

.vt-chip, .vt-coin { position: absolute; left: 0; top: 0; pointer-events: none; }
.vt-pile .vt-chip { top: auto; }
.vt-chip {
  width: 34px; height: 12px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #e44b3c 45%, #9c1d14 46% 55%, #e44b3c 56%);
  border: 2px dashed #fff3e0; box-shadow: 0 3px 0 #6b120c, 0 4px 6px rgba(0, 0, 0, .4);
}
.vt-chip.alt { background: radial-gradient(ellipse at 50% 40%, #2b6fd6 45%, #183f7c 46% 55%, #2b6fd6 56%); box-shadow: 0 3px 0 #10305e, 0 4px 6px rgba(0, 0, 0, .4); }
.vt-chip.alt2 { background: radial-gradient(ellipse at 50% 40%, #1f9e5a 45%, #0e5c33 46% 55%, #1f9e5a 56%); box-shadow: 0 3px 0 #0a4123, 0 4px 6px rgba(0, 0, 0, .4); }
.vt-chip.drop { animation: vt-drop .35s cubic-bezier(.3, 1.4, .6, 1) backwards; }
@keyframes vt-drop { from { transform: translateY(-60px); opacity: 0; } }
.vt-chip.fly { z-index: 3; }

.vt-coin {
  z-index: 3; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6b0, #f7cf22 45%, #b37a00 100%);
  border: 2px solid #ffe680; box-shadow: 0 0 10px rgba(255, 210, 60, .7);
}

.vt-controls {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: end; margin-top: 14px;
}
.vt-controls .field { margin: 0; }
.vt-controls .action { grid-column: 1 / -1; }
.vt-odds { grid-column: 1 / -1; color: var(--muted); font-size: 13px; text-align: center; }
.vt-controls .u-result { grid-column: 1 / -1; }
.vt-series {
  grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: 16px;
  border: 1px solid rgba(255, 150, 60, .5);
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 120, 40, .22), transparent 70%), rgba(0, 0, 0, .25);
  animation: pop .35s ease-out;
}
.vt-series-title { font-weight: 700; color: #ffc48a; font-size: 14px; text-align: center; }
.vt-ladder { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.vt-ladder span {
  padding: 3px 10px; border-radius: 999px; font-family: var(--display); font-size: 13px; font-weight: 700;
  color: var(--muted); border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03);
}
.vt-ladder span.done { color: #ffd2a6; border-color: rgba(255, 150, 60, .4); }
.vt-ladder span.now { color: #2a1200; background: linear-gradient(180deg, #ffd27a, #ff8a1f); border-color: #ffd27a; box-shadow: 0 0 14px rgba(255, 140, 40, .6); }
.vt-ladder span.next { color: #ffb36b; border-color: #ff8a1f; border-style: dashed; animation: vt-next 1.2s infinite; }
@keyframes vt-next { 50% { box-shadow: 0 0 12px rgba(255, 140, 40, .55); } }
.vt-series-buttons { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.vt-series-go { background: linear-gradient(180deg, #ffd27a, #ff8a1f 55%, #d9520b); color: #2a1200; }

@media (max-width: 560px) {
  .vt-stage { min-height: 350px; }
  .vt-hero { width: 190px; height: 190px; }
  .vt-controls { grid-template-columns: 1fr; }
}

/* Пул: винт */
.pl-controls { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.pl-controls .pl-power { flex: 1; margin-top: 0; }
.pl-spin {
  position: relative; flex: none; width: 50px; height: 50px; padding: 0; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff, #e9e4d6 55%, #b9b29f);
  border: 2px solid rgba(255, 255, 255, .25); box-shadow: 0 3px 10px rgba(0, 0, 0, .45);
  cursor: ns-resize; touch-action: none;
}
.pl-spin::before {
  content: ''; position: absolute; left: 50%; top: 7px; bottom: 7px; width: 1px; margin-left: -.5px;
  background: rgba(0, 0, 0, .15);
}
.pl-spin i {
  position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: #d8352b; box-shadow: 0 0 0 2px rgba(255, 255, 255, .8); transition: transform .12s;
}
.pl-spin.top i { background: #2c9e5a; }
.pl-spin.back i { background: #2b6fd6; }
.pl-spin-label { display: flex; flex-direction: column; min-width: 112px; line-height: 1.2; }
.pl-spin-label span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.pl-spin-label b { font-size: 13px; }

/* ---------- Достижения и неделя ---------- */
.ach-btn { text-decoration: none; font-size: 13px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); }
.ach-btn b { color: var(--gold-2); }
.rank-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.rank-head h2 { margin: 0; }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line-2); }
.seg button {
  padding: 4px 8px; border-radius: 7px; background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 700; box-shadow: none; border: 0;
}
.seg button:not(:disabled):hover { color: var(--text); background: rgba(255, 255, 255, .05); filter: none; box-shadow: none; }
.seg button.active, .seg button.active:not(:disabled):hover { background: var(--gold-grad); color: #2a1b02; }
.list li.clickable, .hall-row.clickable { cursor: pointer; }
.list li.clickable:hover .name, .hall-row.clickable:hover .name { color: var(--gold-2); }
.leaderboard .badges { font-size: 12px; color: var(--muted); white-space: nowrap; }
.score.plus { color: var(--green); }
.score.minus { color: var(--red); }
.week-info { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
#week-box .week-info:last-child { margin: 8px 0 0; }
.hall { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hall > li { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.hall > li.muted { background: none; border: 0; padding: 4px 0; }
.hall .hall-week { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.hall-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.hall-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

.modal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgba(3, 8, 6, .72); backdrop-filter: blur(4px);
}
.modal-card {
  position: relative; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  padding: 22px; border-radius: 20px; background: var(--card); border: 1px solid var(--line-2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: vt-pop .25s ease-out;
}
.modal-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.prof-head { display: flex; align-items: center; gap: 14px; padding-right: 40px; }
.prof-head .avatar { width: 52px; height: 52px; font-size: 22px; }
.prof-head h3 { margin: 0; font-family: var(--display); font-size: 20px; }
.prof-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.prof-progress { display: flex; align-items: center; gap: 10px; margin: 16px 0 14px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.prof-progress .bar { flex: 1; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.prof-progress .bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--gold-grad); transition: width .5s; }
.ach-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.ach-grid li { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.ach-grid li.got { border-color: rgba(242, 193, 78, .45); background: linear-gradient(135deg, rgba(242, 193, 78, .12), rgba(255, 255, 255, .02)); }
.ach-grid li.locked { opacity: .6; }
.ach-grid li.locked .ach-icon { filter: grayscale(1) brightness(1.3); opacity: .7; }
.ach-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; font-size: 22px; border-radius: 12px; background: rgba(0, 0, 0, .3); }
.ach-grid div { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ach-grid b { font-size: 14px; }
.ach-grid span { font-size: 12px; color: var(--muted); }
.ach-grid small { font-size: 11px; color: var(--gold-2); margin-top: 2px; }

.ach-pop {
  position: fixed; z-index: 70; left: 50%; top: 18px; display: flex; align-items: center; gap: 14px;
  width: max-content; max-width: calc(100vw - 32px); min-width: min(340px, calc(100vw - 32px));
  padding: 14px 18px; border-radius: 18px;
  background: linear-gradient(135deg, #2b2208, #14110a); border: 1px solid rgba(242, 193, 78, .6);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 30px rgba(242, 193, 78, .25);
  transform: translate(-50%, -160%); transition: transform .45s cubic-bezier(.2, 1.3, .4, 1);
}
.ach-pop.show { transform: translate(-50%, 0); }
.ach-pop-icon { font-size: 34px; animation: ach-bounce 1s ease-in-out infinite; }
.ach-pop div { display: flex; flex-direction: column; line-height: 1.25; }
.ach-pop small { color: var(--gold-2); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.ach-pop b { font-family: var(--display); font-size: 17px; }
.ach-pop span { color: var(--muted); font-size: 13px; }
@keyframes ach-bounce { 50% { transform: translateY(-5px) rotate(-8deg) scale(1.1); } }

/* ---------- Подтверждение ставки ---------- */
#bet-confirm { z-index: 80; }
.bet-card { width: min(380px, 100%); text-align: center; padding: 24px 22px 18px; }
.bc-game { font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.bet-card h3 { margin: 6px 0 10px; font-family: var(--display); font-size: 18px; }
.bc-amount b { font-family: var(--display); font-size: 34px; color: var(--gold-2); }
.bc-amount span { color: var(--muted); }
.bc-note { margin: 8px 0 0; font-size: 14px; }
.bc-share { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.bc-share.warn { color: var(--red); font-weight: 700; }
.bc-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 18px; }
.bc-opt { margin: 14px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- Дуэль на везение ---------- */
.dv-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; margin-top: 12px; }
.dv-form .dv-games-field { grid-column: 1 / -1; }
.dv-form .action { grid-column: 1 / -1; }
.dv-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 4px; }
.dv-games button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
  padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line-2);
  color: var(--text); box-shadow: none;
}
.dv-games button small { color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.25; }
.dv-games button:not(:disabled):hover { background: rgba(255, 255, 255, .06); filter: none; box-shadow: none; }
.dv-games button.active { border-color: var(--gold); background: rgba(242, 193, 78, .1); box-shadow: 0 0 0 1px var(--gold) inset; }
.dv-history li .dv-h-game { color: var(--muted); font-size: 13px; white-space: nowrap; }

.dv-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.dv-player {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; min-width: 0;
  background: rgba(255, 255, 255, .03); border: 2px solid var(--pc, var(--line-2));
}
.dv-player.right { flex-direction: row-reverse; text-align: right; }
.dv-player .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-player .dv-tag { font-size: 12px; color: var(--muted); }
.dv-player > div { display: flex; flex-direction: column; min-width: 0; }
.dv-player.win { box-shadow: 0 0 26px var(--pc); background: rgba(255, 255, 255, .06); }
.dv-player.lose { opacity: .55; }
.dv-vs { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.dv-vs b { font-family: var(--display); font-size: 15px; }
.dv-vs span { color: var(--gold-2); font-weight: 700; font-size: 13px; white-space: nowrap; }
.dv-rule { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0 6px; }

.dv-stage {
  position: relative; display: flex; justify-content: center; align-items: center; gap: 18px; flex-wrap: wrap;
  min-height: 280px; padding: 14px; border-radius: 16px; border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, .04), transparent 70%), rgba(0, 0, 0, .25);
}
.dv-crash-canvas { width: 100%; height: 280px; display: block; }
.dv-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dv-col canvas { width: 200px; height: 200px; display: block; }
.dv-col .dv-col-name { font-weight: 700; color: var(--pc); }
.dv-num {
  min-width: 52px; padding: 4px 12px; border-radius: 999px; text-align: center;
  font-family: var(--display); font-size: 22px; font-weight: 700; color: #fff; visibility: hidden;
}
.dv-num.show { visibility: visible; animation: pop .35s; }
.dv-num.red { background: linear-gradient(180deg, #e0443d, #a8231d); }
.dv-num.black { background: linear-gradient(180deg, #2b2b2b, #0e0e0e); }
.dv-num.green { background: linear-gradient(180deg, #1fa35c, #0d6b39); }
.dv-up-canvas { width: 280px; height: 280px; display: block; }
.dv-up-legend { display: flex; flex-direction: column; gap: 8px; min-width: 180px; }
.dv-up-legend div { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.dv-up-legend i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dv-up-legend span { color: var(--muted); }

.dv-face { width: 130px; height: 130px; }
.dv-face svg { transition: transform .2s; }
.dv-face.dv-toss svg { animation: dv-toss 1.4s cubic-bezier(.2, .8, .3, 1); }
@keyframes dv-toss {
  0% { transform: translateY(0) rotateY(0); }
  40% { transform: translateY(-34px) rotateY(900deg); }
  100% { transform: translateY(0) rotateY(1800deg); }
}
.dv-rounds { display: flex; gap: 4px; min-height: 22px; font-size: 16px; }
.dv-verity-msg { width: 100%; text-align: center; font-weight: 700; min-height: 24px; }

.dv-result { text-align: center; font-family: var(--display); font-size: 20px; margin-top: 14px; min-height: 28px; }
.dv-result.win { color: var(--green); }
.dv-result.lose { color: var(--red); }
.dv-actions { justify-content: center; margin-top: 10px; }

@media (max-width: 560px) {
  .dv-form { grid-template-columns: 1fr; }
  .dv-head { grid-template-columns: 1fr 1fr; }
  .dv-vs { grid-column: 1 / -1; grid-row: 1; }
  .dv-col canvas { width: 150px; height: 150px; }
  .dv-face { width: 110px; height: 110px; }
  .dv-up-canvas { width: 240px; height: 240px; }
}

/* ---------- Плинко ---------- */
.pk-wrap { display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: start; }
.pk-side { display: flex; flex-direction: column; gap: 12px; }
.pk-side .field { margin: 0; }
.pk-seg { display: grid; grid-template-columns: repeat(3, 1fr); }
.pk-seg button { padding: 7px 4px; font-size: 13px; }
.pk-seg button:disabled { opacity: .5; }
.pk-side #pk-auto.on { border-color: var(--gold); color: var(--gold-2); }
.pk-last { min-height: 24px; font-family: var(--display); font-size: 16px; text-align: center; }
.pk-last.win { color: var(--green); }
.pk-last.lose { color: var(--muted); }
.pk-board {
  border-radius: 16px; border: 1px solid var(--line); padding: 6px;
  background: radial-gradient(ellipse at 50% 0%, rgba(242, 193, 78, .08), transparent 60%), rgba(0, 0, 0, .25);
}
.pk-board canvas, .dv-pk-canvas { width: 100%; max-width: 520px; margin: 0 auto; display: block; }
.dv-pk-canvas { max-width: 520px; }
.pk-strip span { min-width: 44px; text-align: center; color: #1b1203; font-weight: 800; border-color: transparent; }

/* Доске нужна ширина: на узких экранах она сверху во всю карточку, настройки под ней. */
@media (max-width: 1100px) {
  .pk-wrap { grid-template-columns: 1fr; }
  .pk-board { order: -1; }
  .pk-side { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
  .pk-side .action, .pk-side #pk-auto, .pk-side .pk-last { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .pk-side { grid-template-columns: 1fr; }
}

/* ---------- Мины ---------- */
.mn-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.mn-side { display: flex; flex-direction: column; gap: 12px; }
.mn-side .field { margin: 0; }
.mn-side input[type="range"] { width: 100%; accent-color: var(--red); }
.mn-presets { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 6px; }
.mn-presets button { padding: 6px 2px; font-size: 13px; }
.mn-info { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); }
.mn-info div { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.mn-info span { color: var(--muted); }
.mn-info b { font-family: var(--display); }
#mn-payout { color: var(--green); }
.minesgame.playing #mn-go { background: linear-gradient(180deg, #5ee69b, #1f9a55); color: #06200f; }

.mn-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 460px; width: 100%; margin: 0 auto;
  padding: 12px; border-radius: 18px; border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, .05), transparent 70%), rgba(0, 0, 0, .25);
}
.minesgame.shake .mn-grid { animation: mn-shake .45s; }
@keyframes mn-shake {
  20% { transform: translateX(-8px) rotate(-1deg); } 40% { transform: translateX(7px) rotate(1deg); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(3px); }
}
.mn-tile {
  aspect-ratio: 1; padding: 0; border-radius: 12px; font-size: clamp(20px, 5vw, 32px);
  display: grid; place-items: center; cursor: default;
  background: linear-gradient(180deg, #2a3d33, #1b2a22); border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .35), 0 3px 8px rgba(0, 0, 0, .3);
  transition: transform .12s, background .2s;
}
.minesgame.playing .mn-tile.closed { cursor: pointer; }
.minesgame.playing .mn-tile.closed:hover { transform: translateY(-2px); background: linear-gradient(180deg, #34503f, #22362b); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .35), 0 0 14px rgba(242, 193, 78, .25); }
.mn-tile.wait { animation: mn-wait .5s ease-in-out infinite alternate; }
@keyframes mn-wait { to { transform: scale(.92); } }
.mn-tile.gem {
  background: radial-gradient(circle at 50% 40%, rgba(94, 230, 155, .35), rgba(20, 60, 40, .9));
  border-color: rgba(94, 230, 155, .6); box-shadow: 0 0 18px rgba(94, 230, 155, .35);
  animation: mn-flip .35s ease-out;
}
.mn-tile.boom {
  background: radial-gradient(circle at 50% 45%, #ff8a5c, #b3221a 60%, #3a0806);
  border-color: #ff6b4a; box-shadow: 0 0 26px rgba(255, 70, 40, .8);
  animation: mn-flip .3s ease-out;
}
.mn-tile.mine-dim { background: rgba(120, 30, 25, .35); opacity: .75; animation: mn-flip .3s ease-out; }
.mn-tile.gem-dim { opacity: .35; }
@keyframes mn-flip { 0% { transform: rotateY(90deg) scale(.8); } 100% { transform: rotateY(0) scale(1); } }

@media (max-width: 760px) {
  .mn-wrap { grid-template-columns: 1fr; }
  .mn-grid { order: -1; }
}

/* ---------- Вход и пароль ---------- */
.login-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.login-hint { margin: 10px 0 0; }
.pw-card { display: flex; flex-direction: column; gap: 10px; border-color: rgba(242, 193, 78, .55); background: linear-gradient(135deg, rgba(242, 193, 78, .1), rgba(255, 255, 255, .02)); }
.pw-card h2 { margin: 0 0 4px; }
.pw-card p { margin: 0; }
.pw-card .row { margin: 0; flex-wrap: wrap; }
.pw-card input { flex: 1 1 200px; }
@media (max-width: 560px) {
  .login-form { grid-template-columns: 1fr; }
}

/* ---------- Главная: три раздела игр ---------- */
/* Казино — фишки на сукне, соревнования — красный против синего, слоты — окошки с живыми символами. */

.tab-home { align-self: center; }
.logo[role="link"] { cursor: pointer; border-radius: 10px; }
.logo[role="link"]:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 4px; }

.home { display: flex; flex-direction: column; gap: 30px; }
.home-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 12px; }
.home-head h2 { margin: 0; font-size: 22px; }
.home-note { margin: 0; color: var(--muted); font-size: 13px; }
.home-casino .home-head h2 { color: var(--gold-2); }
.home-versus .home-head h2 { background: linear-gradient(90deg, #ff6a7a, #8fb4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home-slots .home-head h2 { color: #8ff0e4; }

.home-grid { display: grid; gap: 12px; }
.home-casino .home-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.home-versus .home-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.home-slots .home-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* Общая основа карточки: кнопка без золотого градиента обычных кнопок. */
.home-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: 16px;
  color: var(--text);
  font-weight: 500;
  text-align: left;
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, filter .18s;
}
.home-card:not(:disabled):hover { transform: translateY(-3px); filter: none; }
.home-card:not(:disabled):active { transform: translateY(-1px) scale(.99); }
.home-name { font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.2; }
.home-text { font-size: 13px; line-height: 1.35; color: rgba(243, 239, 226, .72); }

/* Казино: зелёное сукно, игра — в казино-фишке своего цвета. */
.casino-card {
  align-items: center;
  text-align: center;
  padding: 18px 12px 16px;
  background:
    radial-gradient(130% 90% at 50% 0%, rgba(255, 255, 255, .07), transparent 55%),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #145236, #0b2e1d);
  border: 1px solid rgba(242, 193, 78, .28);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 223, 138, .12);
}
.casino-card:not(:disabled):hover { box-shadow: 0 16px 30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(242, 193, 78, .55), inset 0 1px 0 rgba(255, 223, 138, .2); }
.home-chip {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: repeating-conic-gradient(var(--c) 0 30deg, #f3efe2 30deg 45deg);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .5), inset 0 0 0 3px rgba(0, 0, 0, .25);
  transition: transform .5s cubic-bezier(.3, 1.4, .5, 1);
}
.home-chip::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 55%, #000));
  border: 2px dashed rgba(255, 255, 255, .55);
}
.home-chip-icon { position: relative; font-size: 26px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); transition: transform .5s cubic-bezier(.3, 1.4, .5, 1); }
.casino-card:hover .home-chip, .casino-card:focus-visible .home-chip { transform: rotate(40deg); }
.casino-card:hover .home-chip-icon, .casino-card:focus-visible .home-chip-icon { transform: rotate(-40deg); }

/* Соревнования: стенка на стенку — красный против синего, игра на стыке. */
.versus-card {
  min-height: 168px;
  padding: 16px 18px;
  background:
    linear-gradient(180deg, transparent 30%, rgba(5, 4, 10, .78) 72%),
    linear-gradient(112deg, #6e1424 0 49.6%, #f2c14e 49.6% 50.4%, #142a6a 50.4% 100%);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
}
.versus-card:not(:disabled):hover { box-shadow: 0 16px 32px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .3); }
.home-vs {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 2px 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #2a2a3a, #0a0a12);
  border: 2px solid #f2c14e;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, .35), 0 0 22px rgba(242, 193, 78, .35);
  font-size: 28px;
  transition: transform .25s;
}
.versus-card:hover .home-vs { transform: scale(1.08) rotate(-6deg); }
.versus-card .home-name { margin-top: 12px; font-size: 19px; }
.home-call {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 0 14px var(--red);
  animation: pulse 1s infinite;
}

/* Слоты: окошко барабана с живым символом и вывеска слота его же шрифтом. */
.slots-card {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  column-gap: 16px;
  align-items: center;
  min-height: 160px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .5);
}
.slot-kraken {
  background:
    radial-gradient(70% 90% at 15% 50%, rgba(95, 232, 216, .16), transparent 60%),
    radial-gradient(60% 80% at 90% 110%, rgba(140, 20, 50, .45), transparent 60%),
    linear-gradient(160deg, #0b2a30, #041418 60%, #020a0c);
  border-color: rgba(201, 161, 74, .45);
}
.slot-saloon {
  background:
    radial-gradient(80% 70% at 75% 115%, rgba(255, 140, 60, .5), transparent 60%),
    linear-gradient(180deg, #170812, #3a1214 55%, #6e2a12);
  border-color: rgba(201, 139, 78, .5);
}
.slots-card:not(:disabled):hover { box-shadow: 0 18px 36px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 223, 138, .5); }
.home-window {
  grid-row: 1 / 3;
  width: 124px;
  height: 124px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .06), rgba(0, 0, 0, .55));
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .6), inset 0 0 18px rgba(0, 0, 0, .7), 0 0 0 3px rgba(201, 161, 74, .55);
  overflow: hidden;
}
.slot-saloon .home-window { box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .6), inset 0 0 18px rgba(0, 0, 0, .7), 0 0 0 3px rgba(150, 100, 60, .7); }
.home-sym { display: block; width: 100%; height: 100%; }
.home-words { display: flex; flex-direction: column; gap: 2px; align-self: end; }
.slots-card .home-name { font-size: 34px; font-weight: 700; line-height: 1; }
.home-sub { font-size: 15px; letter-spacing: .14em; margin-bottom: 6px; }
.slot-kraken .home-name {
  font-family: "Cormorant SC", Georgia, serif;
  background: linear-gradient(180deg, #f5e2a8, #c9a14a 60%, #8a6a2e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.slot-kraken .home-sub { font-family: "Cormorant SC", Georgia, serif; color: #8ff0e4; }
.slot-saloon .home-name, .slot-saloon .home-sub {
  font-family: "Ruslan Display", Georgia, serif;
  font-weight: 400;
  background: linear-gradient(180deg, #efe0c8, #c98a4a 55%, #6e2a0c);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home-play {
  justify-self: start;
  align-self: start;
  margin-top: 10px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--gold-grad);
  color: #2a1b02;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(242, 193, 78, .3);
}

@media (max-width: 560px) {
  .home { gap: 24px; }
  .home-casino .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-versus .home-grid, .home-slots .home-grid { grid-template-columns: 1fr; }
  .versus-card { min-height: 0; display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-items: center; padding: 14px 16px; }
  .versus-card .home-vs { grid-row: 1 / 3; width: 52px; height: 52px; margin: 0; font-size: 24px; }
  .versus-card .home-name { margin-top: 0; align-self: end; }
  .versus-card .home-text { align-self: start; }
  .slots-card { grid-template-columns: 96px minmax(0, 1fr); }
  .home-window { width: 96px; height: 96px; }
  .slots-card .home-name { font-size: 28px; }
}

/* ---------- Приколы от админа (pranks.js) ---------- */

.title-tag {
  display: inline-block; margin: 0 6px; padding: 1px 8px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(242, 193, 78, .25), rgba(242, 193, 78, .1));
  border: 1px solid rgba(242, 193, 78, .5); color: var(--gold-2);
  font-size: 11px; font-weight: 700; white-space: nowrap; vertical-align: middle;
}
.prank-scare { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 200; pointer-events: none; }

.prank-jackpot {
  position: fixed; inset: 0; z-index: 190; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: radial-gradient(circle, rgba(60, 30, 0, .78), rgba(0, 0, 0, .9)); pointer-events: none;
  animation: pj-in .35s cubic-bezier(.3, 1.6, .5, 1);
}
.pj-title { max-width: 94vw; text-align: center; font-family: var(--display); font-weight: 800; font-size: clamp(34px, 8vw, 110px); background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 18px rgba(242, 193, 78, .6)); animation: pj-pulse .5s ease-in-out infinite alternate; }
.pj-sum { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 6vw, 64px); color: #fff; text-shadow: 0 4px 16px rgba(0, 0, 0, .8); }
.pj-sub { font-size: 18px; color: var(--gold-2); }
.prank-jackpot.joke .pj-title { animation: none; background: none; color: #ff9a9a; -webkit-text-fill-color: #ff9a9a; filter: none; }
.prank-jackpot.joke .pj-sum { color: var(--muted); font-size: clamp(24px, 4vw, 40px); }
@keyframes pj-in { from { transform: scale(.4); opacity: 0; } }
@keyframes pj-pulse { to { transform: scale(1.06); } }

.prank-chest {
  position: fixed; left: 16px; bottom: 16px; z-index: 120;
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 18px;
  background: linear-gradient(180deg, #3a2a0e, #1a1206); border: 2px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, .4), 0 14px 40px rgba(0, 0, 0, .6), 0 0 40px rgba(242, 193, 78, .35);
  animation: pc-drop .5s cubic-bezier(.3, 1.6, .5, 1);
  max-width: calc(100vw - 32px);
}
.pc-icon { font-size: 40px; animation: pc-wobble 1s ease-in-out infinite; }
.pc-text { display: flex; flex-direction: column; min-width: 0; }
.pc-text b { font-family: var(--display); font-size: 17px; color: var(--gold-2); }
.pc-timer { font-size: 12px; color: var(--muted); }
.pc-grab { white-space: nowrap; font-size: 16px; padding: 12px 22px; }
.prank-chest.won { border-color: var(--green); }
.prank-chest.lost { border-color: var(--muted); opacity: .85; }
.prank-chest.won .pc-icon, .prank-chest.lost .pc-icon { animation: none; }
@keyframes pc-drop { from { transform: translate(-30px, -60vh) rotate(-12deg); } }
@keyframes pc-wobble { 50% { transform: rotate(-10deg) scale(1.08); } }

/* Лотерея — карточка сверху справа: не закрывает игру и пропускает клики (можно забрать краш, крутить слот). */
.prank-lottery { position: fixed; top: 76px; right: 16px; z-index: 180; pointer-events: none; transition: opacity .45s, transform .45s; animation: pl-in .4s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes pl-in { from { transform: translateX(120%); } }
.prank-lottery.out { opacity: 0; transform: translateX(40%); }
.pl-card {
  width: min(280px, calc(100vw - 32px)); padding: 14px 16px 12px; border-radius: 18px; text-align: center;
  background: linear-gradient(180deg, #2a1e08, #120c04); border: 2px solid var(--gold);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .7), 0 0 50px rgba(242, 193, 78, .3);
}
.pl-title { font-family: var(--display); font-weight: 800; font-size: 22px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pl-prize { color: var(--muted); margin-bottom: 10px; font-size: 13px; }
.pl-window {
  position: relative; height: 54px; overflow: hidden; border-radius: 12px; background: rgba(0, 0, 0, .5);
  box-shadow: inset 0 0 0 2px rgba(242, 193, 78, .5), inset 0 10px 16px rgba(0, 0, 0, .6), inset 0 -10px 16px rgba(0, 0, 0, .6);
}
.pl-strip { will-change: transform; }
.pl-name { height: 54px; line-height: 54px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 22px; color: #fff; }
.pl-result { min-height: 24px; margin-top: 10px; font-size: 16px !important; font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--gold-2); }
.pl-card.won { border-color: var(--green); box-shadow: 0 20px 60px rgba(0, 0, 0, .7), 0 0 60px rgba(69, 212, 131, .45); }
.pl-card.won .pl-result { color: var(--green); }

/* ---------- Телефон: компактная шапка, вкладки в одну строку, рулетка по ширине ---------- */

.quick button { flex: 1 1 0; min-width: 40px; padding-left: 8px; padding-right: 8px; }

@media (max-width: 700px) {
  .topbar { flex-wrap: nowrap; gap: 8px; padding: 8px 10px; }
  .logo-text { display: none; }
  .logo { font-size: 22px; margin-right: 0; }
  .me { gap: 8px; margin-left: auto; min-width: 0; }
  #me-name { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chips { padding: 4px 9px 4px 6px; font-size: 13px; }
  .conn { font-size: 0; }
  .conn::before { margin-right: 0; }

  /* Вкладки игры — одна строка, листается пальцем; активная вкладка сама прокручивается в центр. */
  .tabs { position: relative; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-group, .tab-home { flex: none; flex-wrap: nowrap; }

  .board { grid-template-columns: 24px repeat(12, minmax(17px, 1fr)) 24px; grid-template-rows: repeat(3, 34px) 30px 30px; min-width: 0; }
  .board .cell { font-size: 10px; white-space: nowrap; letter-spacing: -.02em; }
  .board-wrap { padding: 8px; border-width: 4px; }
}
@media (max-width: 420px) {
  #me-name { display: none; }
}

@media (max-width: 700px) {
  .prank-lottery { top: 64px; right: 8px; }
  .prank-chest { left: 8px; right: 70px; bottom: 8px; }
}

/* ---------- Мероприятия от админа ---------- */
/* Колонка плашек слева сверху: не мешает кликам мимо них. */
.ev-stack { position: fixed; top: 76px; left: 16px; z-index: 125; display: flex; flex-direction: column; gap: 8px; width: min(300px, calc(100vw - 32px)); pointer-events: none; }
.ev-stack > * {
  pointer-events: auto; padding: 10px 14px; border-radius: 16px;
  background: linear-gradient(180deg, #2a1e08, #120c04); border: 2px solid var(--gold);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .6), 0 0 30px rgba(242, 193, 78, .25);
  animation: ev-in .4s cubic-bezier(.3, 1.4, .5, 1);
}
@keyframes ev-in { from { transform: translateX(-120%); } }
.ev-left { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.ev-stack b { font-family: var(--display); font-size: 15px; color: var(--gold-2); }

.ev-happy { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-color: #ffd23a; background: linear-gradient(90deg, #3b2a00, #1b1300); animation: ev-in .4s cubic-bezier(.3, 1.4, .5, 1), ev-glow 1.6s ease-in-out infinite alternate; }
.ev-happy b { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes ev-glow { to { box-shadow: 0 14px 40px rgba(0, 0, 0, .6), 0 0 44px rgba(255, 210, 58, .6); } }

.ev-race-head, .ev-quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ev-race-top { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; }
.ev-race-top li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.ev-race-top li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-race-top li.me { color: var(--gold-2); font-weight: 700; }
.ev-race-top li.empty { color: var(--muted); font-size: 13px; }
.ev-race-top .plus { color: var(--green); font-variant-numeric: tabular-nums; }
.ev-race-top .minus { color: #ff8a80; font-variant-numeric: tabular-nums; }
.ev-race-foot { margin-top: 4px; font-size: 12px; color: var(--muted); }
.ev-race.done { border-color: var(--green); }

.ev-quiz { border-color: #8ec5ff; box-shadow: 0 14px 40px rgba(0, 0, 0, .6), 0 0 30px rgba(110, 170, 255, .35); }
.ev-quiz-q { margin: 6px 0 8px; font-size: 15px; color: #fff; overflow-wrap: anywhere; }
.ev-quiz-form { display: flex; gap: 6px; }
.ev-quiz-form input { flex: 1 1 auto; min-width: 0; }
.ev-quiz-form button { flex: none; }
.ev-quiz-res { font-family: var(--display); font-weight: 700; color: var(--muted); }
.ev-quiz-res.won { color: var(--green); }

/* Дождь: слой пропускает клики, ловятся только сами монеты. */
.ev-rain { position: fixed; inset: 0; z-index: 175; pointer-events: none; overflow: hidden; }
.ev-rain-banner {
  position: absolute; top: 70px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 8px 18px; border-radius: 999px; background: rgba(10, 20, 14, .85); border: 2px solid var(--gold);
  font-family: var(--display); font-weight: 700; color: var(--gold-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.ev-rain-banner.done { border-color: var(--green); }
.ev-coin {
  position: absolute; top: -60px; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 240, 180, .35), transparent 60%); font-size: 36px; line-height: 48px;
  pointer-events: auto; cursor: pointer; touch-action: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5));
  animation: ev-fall linear both;
}
.ev-coin-i { display: block; transition: transform .1s; }
.ev-coin:hover .ev-coin-i { transform: scale(1.15); }
.ev-coin.got, .ev-coin.gone { pointer-events: none; }
.ev-coin.got .ev-coin-i { animation: ev-pop .25s ease-out forwards; }
.ev-coin.gone .ev-coin-i { animation: ev-gone .2s ease-out forwards; }
@keyframes ev-fall { from { transform: translateY(0) rotate(-20deg); } to { transform: translateY(calc(100vh + 120px)) rotate(340deg); } }
@keyframes ev-pop { to { transform: scale(1.8); opacity: 0; } }
@keyframes ev-gone { to { transform: scale(.3); opacity: 0; } }

.ev-float {
  position: fixed; z-index: 190; transform: translate(-50%, 0); pointer-events: none; white-space: nowrap;
  font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--gold-2); text-shadow: 0 2px 8px rgba(0, 0, 0, .9);
  animation: ev-up 1.2s ease-out forwards;
}
.ev-float.happy { font-size: 24px; color: #ffd23a; }
@keyframes ev-up { to { transform: translate(-50%, -70px); opacity: 0; } }

@media (max-width: 700px) {
  .ev-stack { top: 64px; left: 8px; width: min(260px, calc(100vw - 16px)); }
  .ev-stack > * { padding: 8px 12px; }
}

/* ---------- Блэкджек ---------- */
/* Полукруглый стол: кожаный борт, зелёное сукно, золотая надпись по дуге. Карты — вёрстка с 3D-переворотом. */

.bj-table {
  --w: 76px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 470px;
  padding: 22px 16px 40px;
  border: 12px solid transparent;
  border-radius: 30px 30px 50% 50% / 30px 30px 24% 24%;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(255, 255, 255, .09), transparent 60%) padding-box,
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .014) 0 2px, transparent 2px 5px) padding-box,
    radial-gradient(85% 75% at 50% 45%, #1c7347 0%, #125634 55%, #0a3b22 100%) padding-box,
    linear-gradient(180deg, #6b3a1c, #3d1f0d 55%, #241105) border-box;
  box-shadow:
    inset 0 0 0 1px rgba(242, 193, 78, .5),
    inset 0 0 0 5px rgba(0, 0, 0, .18),
    inset 0 0 0 6px rgba(242, 193, 78, .22),
    inset 0 0 70px rgba(0, 0, 0, .5),
    0 2px 0 rgba(255, 220, 160, .25),
    0 24px 50px rgba(0, 0, 0, .55);
  overflow: hidden;
  isolation: isolate;
}
.bj-arc { width: min(100%, 560px); height: auto; margin: 0 0 -26px; pointer-events: none; order: 2; }
.bj-arc-main { font: 700 17px var(--display); fill: rgba(242, 193, 78, .72); letter-spacing: .16em; }
.bj-arc-sub { font: 600 12px var(--font); fill: rgba(243, 239, 226, .42); letter-spacing: .1em; text-transform: uppercase; }
.bj-dealer-zone { order: 1; }
.bj-msg { order: 3; }
.bj-hands { order: 4; }

/* Шуз в углу: чем меньше карт, тем ниже стопка. */
.bj-shoe {
  --fill: 1;
  position: absolute;
  top: 14px;
  right: 18px;
  width: 58px;
  height: 50px;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(180deg, #2c2c30, #0f0f12);
  box-shadow: 0 0 0 1px rgba(242, 193, 78, .35), 0 8px 18px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .12);
  transform: rotate(8deg);
}
.bj-shoe-cards {
  position: absolute;
  left: 7px; right: 7px; bottom: 9px;
  height: calc(30px * var(--fill));
  border-radius: 3px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .5) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #8a1c25, #4a0b12);
  box-shadow: inset 0 0 0 1px rgba(242, 193, 78, .5);
  transition: height .4s;
}
.bj-shoe-left {
  position: absolute;
  left: 0; right: 0; bottom: -20px;
  font: 700 11px var(--display);
  color: rgba(243, 239, 226, .55);
  text-align: center;
  transform: rotate(-8deg);
}

.bj-dealer-zone, .bj-hand { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bj-dealer-zone { min-height: calc(var(--w) * 1.4 + 38px); justify-content: flex-start; }
.bj-cards { display: flex; min-height: calc(var(--w) * 1.4); }
.bj-cards .bj-card + .bj-card { margin-left: calc(var(--w) * -.48); }

.bj-msg {
  min-height: 1.5em;
  margin: 14px 0 10px;
  padding: 0 8px;
  font: 700 17px var(--display);
  text-align: center;
  color: var(--text);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
}
.bj-msg.win { color: #7dffb2; }
.bj-msg.lose { color: #ff8a83; }
.bj-msg.push { color: var(--gold-2); }
.bj-msg.pop { animation: pop .4s; }

.bj-hands { display: flex; justify-content: center; gap: 18px; min-height: calc(var(--w) * 1.4 + 80px); }
.bj-hand { position: relative; padding: 10px 12px 8px; border-radius: 18px; transition: background .25s, box-shadow .25s, opacity .3s; }
.bj-hand .bj-cards { order: 1; }
.bj-hand .bj-badge { order: 2; }
.bj-hand .bj-bet { order: 3; }
.bj-hand.cur { background: rgba(242, 193, 78, .08); box-shadow: 0 0 0 1px rgba(242, 193, 78, .55), 0 0 24px rgba(242, 193, 78, .15); }
.bj-hand.lost .bj-cards { filter: saturate(.6) brightness(.82); transition: filter .4s; }

.bj-badge {
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(4, 18, 10, .72);
  border: 1px solid rgba(242, 193, 78, .45);
  font: 700 13px var(--display);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}
.bj-badge.best { border-color: #7dffb2; color: #7dffb2; }
.bj-badge.bust { border-color: #ff8a83; color: #ff8a83; background: rgba(60, 6, 6, .7); }
.bj-badge.bj { background: var(--gold-grad); color: #2a1b02; border-color: transparent; box-shadow: 0 0 18px rgba(242, 193, 78, .6); }

.bj-tag {
  position: absolute;
  top: 34%;
  left: 50%;
  z-index: 3;
  padding: 5px 12px;
  border-radius: 8px;
  font: 800 12px var(--display);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translate(-50%, -50%) rotate(-6deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .5);
  animation: bj-stamp .35s cubic-bezier(.2, 1.6, .4, 1);
}
.bj-tag.win { background: linear-gradient(180deg, #8af5b6, #2fb86a); color: #052312; }
.bj-tag.blackjack { background: var(--gold-grad); color: #2a1b02; }
.bj-tag.push { background: linear-gradient(180deg, #f3efe2, #c9c2ad); color: #2a2618; }
.bj-tag.lose, .bj-tag.bust { background: linear-gradient(180deg, #ff8a7f, #c9362f); color: #fff; }
@keyframes bj-stamp { from { transform: translate(-50%, -50%) rotate(-6deg) scale(2); opacity: 0; } }

/* Фишка ставки у руки; удвоенная — стопкой из двух. */
.bj-bet { display: flex; align-items: center; gap: 7px; font: 700 13px var(--display); color: var(--gold-2); font-variant-numeric: tabular-nums; animation: bj-chip-in .35s ease-out; transition: opacity .3s; }
.bj-bet.gone { opacity: 0; }
.bj-chip {
  position: relative;
  width: 26px; height: 26px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #b8232c 0 38%, #fff3d6 39% 44%, transparent 45%),
    repeating-conic-gradient(#b8232c 0 30deg, #f6ecd2 30deg 45deg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 3px 6px rgba(0, 0, 0, .45);
}
.bj-bet.doubled .bj-chip { box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 -4px 0 -1px #8d1820, 0 -5px 0 0 rgba(0, 0, 0, .35), 0 6px 8px rgba(0, 0, 0, .45); transform: translateY(2px); }
@keyframes bj-chip-in { from { transform: translateY(-16px); opacity: 0; } }

/* ---- Карта ---- */
.bj-card { position: relative; flex: none; width: var(--w); height: calc(var(--w) * 1.4); perspective: 700px; }
.bj-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3, .7, .3, 1.1); }
.bj-card.down .bj-inner { transform: rotateY(180deg); }
.bj-front, .bj-back {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--w) * .09);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow: hidden;
}
.bj-front {
  background: linear-gradient(155deg, #fffef9 0%, #f6f0df 60%, #ece3cb 100%);
  color: #17191d;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), -3px 4px 10px rgba(0, 0, 0, .38);
}
.bj-card.red .bj-front { color: #c3131f; }
.bj-back {
  transform: rotateY(180deg);
  background:
    radial-gradient(circle at 50% 50%, #f2c14e 0 7%, transparent 7.5%),
    radial-gradient(circle at 50% 50%, transparent 0 15%, rgba(242, 193, 78, .55) 15.5% 17%, transparent 17.5%),
    repeating-linear-gradient(45deg, rgba(242, 193, 78, .2) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(-45deg, rgba(242, 193, 78, .2) 0 1px, transparent 1px 6px),
    linear-gradient(160deg, #8a1c25, #4a0b12);
  box-shadow: inset 0 0 0 3px #f3ecd9, inset 0 0 0 4px rgba(201, 143, 34, .9), -3px 4px 10px rgba(0, 0, 0, .4);
}
.bj-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: .92;
  font-family: var(--display);
  font-weight: 700;
}
/* Уголки — узкой колонкой у края, значки и рамка картинки — в середине: друг на друга не залезают. */
.bj-corner.tl { top: 4%; left: 5%; }
.bj-corner.br { bottom: 4%; right: 5%; transform: rotate(180deg); }
.bj-r { font-size: calc(var(--w) * .21); letter-spacing: -.08em; }
.bj-s { font-size: calc(var(--w) * .16); }
.bj-pips { position: absolute; inset: 18% 37%; }
.bj-pip { position: absolute; font-size: calc(var(--w) * .17); line-height: 1; transform: translate(-50%, -50%); }
.bj-pip.flip { transform: translate(-50%, -50%) rotate(180deg); }
.bj-ace { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--w) * .62); line-height: 1; }
.bj-face {
  position: absolute;
  inset: 15% 27%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--w) * .05);
  background: radial-gradient(circle at 50% 38%, rgba(242, 193, 78, .42), rgba(242, 193, 78, .1) 70%);
  box-shadow: inset 0 0 0 1px currentColor, inset 0 0 0 3px #f6f0df, inset 0 0 0 4px rgba(201, 143, 34, .85);
}
.bj-face b { font: 700 calc(var(--w) * .36) / 1 "Cormorant SC", Georgia, serif; }
.bj-face i { font-style: normal; font-size: calc(var(--w) * .16); line-height: 1; }

/* ---- Кнопки ---- */
.bj-controls { margin-top: 18px; }
.bj-betbox { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.bj-betbox .field { flex: 1 1 150px; margin: 0; }
.bj-betbox .action { flex: 1 1 200px; }
.bj-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bj-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 60px; padding: 8px 10px; }
.bj-act b { font: 700 17px var(--display); }
.bj-act small { font-size: 11px; font-weight: 600; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bj-act.hit { background: linear-gradient(180deg, #8af5b6, #38c978 55%, #1f9a55); color: #052312; box-shadow: 0 6px 18px rgba(69, 212, 131, .28), inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 0 rgba(0, 0, 0, .18); }
.bj-act.stand { background: linear-gradient(180deg, #ff9c92, #e0443d 55%, #b72c26); color: #fff; box-shadow: 0 6px 18px rgba(239, 91, 84, .28), inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -2px 0 rgba(0, 0, 0, .18); }
.bj-act.split { background: linear-gradient(180deg, #c9a6ff, #8f5cf0 55%, #6a3bc7); color: #fff; box-shadow: 0 6px 18px rgba(143, 92, 240, .28), inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -2px 0 rgba(0, 0, 0, .18); }
.u-feed li.push .u-what { color: var(--gold-2); }

@media (max-width: 700px) {
  .bj-table { --w: 58px; min-height: 400px; padding: 16px 8px 34px; border-width: 9px; border-radius: 24px 24px 50% 50% / 24px 24px 18% 18%; }
  .bj-arc { margin-bottom: -18px; }
  .bj-arc-main { font-size: 19px; }
  .bj-arc-sub { font-size: 14px; }
  .bj-shoe { top: 10px; right: 10px; transform: rotate(8deg) scale(.82); transform-origin: top right; }
  .bj-hands { gap: 6px; }
  .bj-hand { padding: 8px 6px 6px; }
  .bj-msg { font-size: 15px; margin: 10px 0 6px; }
  .bj-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .bj-act { min-height: 54px; }
}
@media (max-width: 420px) {
  .bj-table { --w: 52px; }
  .bj-cards .bj-card + .bj-card { margin-left: calc(var(--w) * -.55); }
}

/* ---------- Приложение (PWA): вырез экрана и кнопка установки ---------- */

/* В standalone-режиме iPhone страница уходит под статус-бар: закрываем полосу цветом шапки. */
.topbar { border-top: env(safe-area-inset-top, 0px) solid #06100b; }
html { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.toast, .music, .lounge, .prank-chest { margin-bottom: env(safe-area-inset-bottom, 0px); }
main { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }

.install-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 10px 12px 10px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.install-bar img { flex: none; border-radius: 10px; }
.install-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.35; }
.install-text b { color: var(--gold-2); }
.install-bar #install-btn { flex: none; padding: 9px 16px; font-size: 14px; }
button.install-close { flex: none; padding: 6px; color: var(--muted); font-size: 15px; }
