:root {
  --bg: #0b0c16;
  --bg-2: #120f24;
  --surface: #161629;
  --surface-2: #1f1e37;
  --surface-3: #2a2847;
  --line: #2e2c4d;
  --text: #f1effb;
  --muted: #8f8cb0;
  --accent: #7c6bff;
  --accent-2: #b35cff;
  --pink: #ff38aa;
  --cyan: #00e5ff;
  --ok: #2ee59d;
  --warn: #ffb938;
  --bad: #ff4f6d;
  --gold: #ffd23f;
  --felt: #17603f;
  --felt-2: #0e4029;
  --radius: 16px;
  --gutter: 14px;
  --vh: var(--tg-viewport-stable-height, 100dvh);
  --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  /* fullscreen Mini App: the status bar and the strip with Telegram's close/menu pill */
  --safe-top: var(--tg-safe-area-inset-top, 0px);
  --strip-top: var(--tg-content-safe-area-inset-top, 0px);
  --top-inset: calc(var(--safe-top) + var(--strip-top));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); height: 100%; overflow: hidden; }
body {
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(124, 107, 255, .16), transparent 60%),
    radial-gradient(80% 50% at 100% 110%, rgba(255, 56, 170, .10), transparent 60%),
    var(--bg);
}
button { font: inherit; color: inherit; }
input, textarea { font: inherit; user-select: text; -webkit-user-select: text; }
.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#app { display: flex; flex-direction: column; height: var(--vh); max-width: 640px; margin: 0 auto; }
body.fullscreen #app { padding-top: var(--safe-top); }
/* the "sheet handle" strip in fullscreen: drag it down (or tap) to leave fullscreen and swipe the app away */
.grip { display: none; height: var(--strip-top); flex-shrink: 0; align-items: center; justify-content: center; touch-action: none; cursor: grab; }
body.fullscreen .grip { display: flex; }
.grip i { display: block; width: 44px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .28); box-shadow: 0 0 10px rgba(0, 229, 255, .25); transition: transform .15s, background .15s; }
.grip:active i, .grip.pull i { background: var(--cyan); transform: scaleX(1.15); }

@keyframes float { 50% { transform: translateY(-5px); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glowPulse { 50% { box-shadow: 0 0 0 4px rgba(255, 56, 170, .18), 0 0 26px rgba(255, 56, 170, .25); } }
.float { animation: float 3.2s ease-in-out infinite; display: inline-block; }

/* view transitions between screens */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
::view-transition-old(root) { animation-name: vtOut; }
::view-transition-new(root) { animation-name: vtIn; }
::view-transition-group(game-hero) { animation-duration: .35s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
@keyframes vtOut { to { opacity: 0; transform: scale(.985); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- splash ---------- */
.splash { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--muted); }
.splash .pixel-logo svg { filter: drop-shadow(0 0 18px rgba(255, 56, 170, .45)); }
.splash-logo { font: 900 28px "Courier New", monospace; color: #fff; text-shadow: 3px 3px 0 var(--pink); }
.splash-bar { width: 160px; height: 8px; border: 2px solid var(--cyan); padding: 1px; }
.splash-bar i { display: block; height: 100%; width: 30%; background: repeating-linear-gradient(90deg, var(--pink) 0 6px, transparent 6px 8px); animation: load 1.1s steps(8) infinite; }
@keyframes load { from { margin-left: 0; } to { margin-left: 70%; } }
.splash-text { font: 700 12px "Courier New", monospace; letter-spacing: .3em; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }
.pixel-logo { display: inline-flex; line-height: 0; }
.pixel-logo svg { height: 28px; width: auto; image-rendering: pixelated; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 8px; padding: 10px var(--gutter);
  border-bottom: 1px solid var(--line); background: rgba(11, 12, 22, .85); backdrop-filter: blur(10px);
  flex-shrink: 0;
}
.topbar .who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; cursor: pointer; }
.topbar .who .name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balance {
  display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line);
  padding: 6px 12px 6px 8px; border-radius: 999px; font-weight: 800; white-space: nowrap; transition: color .3s, border-color .3s, box-shadow .3s;
}
.balance.big { font-size: 18px; padding: 8px 16px 8px 10px; }
.balance { position: relative; }
.balance .ndot {
  position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bad); border: 2px solid var(--bg); box-shadow: 0 0 8px rgba(255, 70, 70, .8); animation: ndotPulse 1.6s infinite;
}
@keyframes ndotPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.balance.up { color: var(--ok); border-color: var(--ok); box-shadow: 0 0 14px rgba(46, 229, 157, .35); }
.balance.down { color: var(--bad); border-color: var(--bad); }
.coin {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 50% 50%, #fff6c2 0 18%, var(--gold) 19% 48%, #e09a00 49% 60%, var(--gold) 61%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25), 0 0 0 1px #b87400;
}
.coin.sm { width: 14px; height: 14px; }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface-2); position: relative;
  width: 36px; height: 36px; border-radius: 12px; font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.icon-btn:active { transform: scale(.92); }
.qbadge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--pink); color: #fff; font-size: 11px; font-weight: 900; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.qbadge.static { position: static; box-shadow: none; }
.netbar { background: var(--warn); color: #221a00; text-align: center; font-size: 13px; padding: 4px; font-weight: 700; }

/* ---------- screen ---------- */
.screen { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; position: relative; min-height: 0; }
.screen.game-mode, .screen.fixed-mode { overflow: hidden; display: flex; flex-direction: column; }
.game-root { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; touch-action: none; overscroll-behavior: none; }
.pad { padding: var(--gutter); }
h1, h2, h3 { margin: 0; }
.h1 { font-size: 22px; font-weight: 900; letter-spacing: -.01em; }
.h2 { font-size: 17px; font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.section { margin-top: 18px; }
.section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 14px 0 8px; font-weight: 800;
}
.section-title .muted { text-transform: none; letter-spacing: 0; font-weight: 600; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tip { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(124, 107, 255, .08); border: 1px dashed rgba(124, 107, 255, .35); color: #c9c4f2; font-size: 13px; }
.skeleton { height: 62px; border-radius: 14px; margin-bottom: 8px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 40%, var(--surface) 80%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton.tall { height: 150px; }
.form-error { color: var(--bad); font-size: 13px; min-height: 16px; }

/* ---------- tab bar ---------- */
.tabbar {
  display: flex; border-top: 1px solid var(--line); background: rgba(11, 12, 22, .92); backdrop-filter: blur(10px);
  padding: 4px 4px calc(4px + var(--safe-bottom)); flex-shrink: 0;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0 5px; border: 0; background: none; color: var(--muted); font-size: 10.5px; font-weight: 700; cursor: pointer;
  border-radius: 12px; position: relative; transition: color .2s;
}
.tab .ico { font-size: 21px; line-height: 1; transition: transform .2s; filter: grayscale(.6); }
.tab.active { color: var(--text); }
.tab.active .ico { transform: translateY(-2px) scale(1.12); filter: none; }
.tab.active::after {
  content: ""; position: absolute; bottom: 0; left: 30%; right: 30%; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--pink), var(--cyan)); box-shadow: 0 0 10px var(--pink);
}
.tab .dot {
  position: absolute; top: 1px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--pink); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 900; line-height: 17px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-weight: 800; cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35); transition: transform .08s ease, box-shadow .08s ease, opacity .15s;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: linear-gradient(135deg, var(--pink), var(--accent-2) 55%, var(--accent)); border-color: transparent; color: #fff; box-shadow: 0 3px 0 #5b1f8f, 0 6px 18px rgba(255, 56, 170, .25); }
.btn.primary:active { box-shadow: 0 1px 0 #5b1f8f; }
.btn.ok { background: linear-gradient(135deg, #3cf0aa, #1fc184); border-color: transparent; color: #04241a; box-shadow: 0 3px 0 #0f7a52; }
.btn.danger { background: transparent; border-color: rgba(255, 79, 109, .5); color: var(--bad); box-shadow: none; }
.btn.gold { background: var(--gold); border-color: transparent; color: #2a1d00; box-shadow: 0 3px 0 #a67c00; }
.btn.pink { background: var(--pink); border-color: transparent; color: #fff; box-shadow: 0 3px 0 #99195f; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.block { width: 100%; }
.btn.big { padding: 15px 18px; font-size: 16px; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 11px; box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.btn-row { display: flex; gap: 8px; }
.btn-row > .btn { flex: 1; }

/* ---------- lists ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: linear-gradient(180deg, var(--surface), rgba(22, 22, 41, .8)); border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
  transition: transform .1s, border-color .2s;
}
.item:active { transform: scale(.985); }
.item .title { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.item.glow-item { border-color: rgba(46, 229, 157, .5); box-shadow: 0 0 0 3px rgba(46, 229, 157, .08); }
.item.online-item { border-color: rgba(46, 229, 157, .25); }
.item.unread { border-color: rgba(255, 56, 170, .45); }
.item.unread .sub { color: var(--text); }
.item .place, .item .value { font-weight: 900; }
.item .place { width: 26px; text-align: center; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty.small { padding: 16px 8px; font-size: 14px; }
.empty .big { font-size: 42px; margin-bottom: 6px; }
.room-seats { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; }

/* names: guild tag + anonymous mark */
.pname { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; vertical-align: middle; }
.pname-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtag {
  display: inline-block; padding: 1px 5px; border-radius: 5px; font: 800 10px ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .06em; color: var(--cyan); background: rgba(0, 229, 255, .12); border: 1px solid rgba(0, 229, 255, .35);
  margin-left: 6px; flex-shrink: 0;
}
.pname .gtag { margin-left: 0; }
.gtag.big { font-size: 12px; padding: 2px 7px; vertical-align: middle; }
.anon-mark { font-size: 13px; }

/* ---------- home ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 18px; margin-bottom: 12px; min-height: 132px;
  background: linear-gradient(180deg, #150c33 0%, #2c0f4f 70%, #3f0d52 100%); border: 2px solid var(--pink);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, .35) inset, 0 10px 30px rgba(255, 56, 170, .15);
}
.hero-grid {
  position: absolute; left: -20%; right: -20%; bottom: -30px; height: 90px; transform: perspective(160px) rotateX(55deg);
  overflow: hidden; opacity: .55;
}
/* the lines slide with a transform (composited) instead of repainting the background every frame */
.hero-grid::before {
  content: ""; position: absolute; left: 0; right: 0; top: -18px; bottom: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255, 56, 170, .6) 0 2px, transparent 2px 18px),
    repeating-linear-gradient(90deg, rgba(255, 56, 170, .5) 0 2px, transparent 2px 28px);
  animation: gridMove 2.4s linear infinite; will-change: transform;
}
@keyframes gridMove { to { transform: translateY(18px); } }
.hero-body { position: relative; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.hero-hi { font-weight: 900; font-size: 18px; }
.hero-row { display: flex; gap: 8px; align-items: center; }
.hero-coins { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: 18px; background: rgba(0, 0, 0, .3); padding: 5px 12px 5px 8px; border-radius: 999px; }
.hero-guild { font-weight: 800; background: rgba(0, 229, 255, .15); border: 1px solid rgba(0, 229, 255, .4); color: var(--cyan); padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.quick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.quick {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-weight: 800; font-size: 13px; cursor: pointer;
}
.quick span { font-size: 22px; }
.quick:active { transform: scale(.96); }
.banner { background: var(--surface-2); border: 1px solid var(--gold); border-radius: 14px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.banner.glow { animation: glowPulse 2s infinite; border-color: var(--pink); cursor: pointer; }
.warn-banner { border-color: var(--warn); color: var(--warn); font-size: 13px; }

.games-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-card, .lobby-hero, .guild-card, .profile-card {
  --g1: #2c2352; --g2: #141029; --gl: rgba(124, 107, 255, .5);
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(150deg, var(--g1), var(--g2));
  border: 1px solid rgba(255, 255, 255, .08); border-radius: 18px;
}
[data-game="poker"] { --g1: #147a4c; --g2: #07291a; --gl: rgba(46, 229, 157, .55); }
[data-game="durak"] { --g1: #8a1a45; --g2: #2a0916; --gl: rgba(255, 79, 109, .55); }
[data-game="blackjack"] { --g1: #6b4b05; --g2: #1f1500; --gl: rgba(255, 210, 63, .55); }
[data-game="chess"] { --g1: #3b2d7a; --g2: #120d2b; --gl: rgba(124, 107, 255, .6); }
[data-game="checkers"] { --g1: #7a4520; --g2: #26140a; --gl: rgba(255, 170, 90, .5); }
[data-game="battleship"] { --g1: #0f4c8a; --g2: #061a33; --gl: rgba(0, 229, 255, .55); }
[data-game="connect4"] { --g1: #2350d6; --g2: #0b1f5c; --gl: rgba(255, 210, 63, .5); }
[data-game="tictactoe"] { --g1: #0c6670; --g2: #052326; --gl: rgba(0, 229, 255, .5); }
[data-game="nardy"] { --g1: #6b2d1a; --g2: #24100a; --gl: rgba(255, 140, 60, .55); }
.gc-scan { position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 4px); pointer-events: none; }
.game-card {
  padding: 14px 12px 12px; cursor: pointer; min-height: 138px; display: flex; flex-direction: column; gap: 3px;
  transition: transform .15s cubic-bezier(.2, .8, .2, 1), box-shadow .2s;
}
.game-card::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, var(--gl), transparent 70%); opacity: .6;
}
.game-card:active, .game-card.picked { transform: scale(.95); box-shadow: 0 0 0 2px var(--gl), 0 0 24px var(--gl); }
.game-card .emoji { font-size: 38px; line-height: 1.1; margin-bottom: 6px; animation: float 3.2s ease-in-out infinite; filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .35)); width: fit-content; }
.game-card .gt { font-weight: 900; font-size: 16px; }
.game-card .gd { font-size: 12px; color: rgba(255, 255, 255, .62); }
.game-card .online { position: absolute; top: 10px; right: 10px; font-size: 11px; color: var(--ok); font-weight: 800; background: rgba(0, 0, 0, .35); padding: 2px 7px; border-radius: 999px; }

/* ---------- lobby ---------- */
.lobby-hero { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 6px; }
.lobby-hero .back { position: absolute; top: 8px; left: 8px; }
.lobby-emoji { font-size: 52px; line-height: 1; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .35)); }
.lobby-desc { color: rgba(255, 255, 255, .7); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
  font-weight: 800; font-size: 14px; cursor: pointer; transition: transform .1s;
}
.chip:active { transform: scale(.94); }
.chip.active { background: linear-gradient(135deg, var(--pink), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 0 14px rgba(255, 56, 170, .35); }
.chip:disabled { opacity: .35; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--surface-3); white-space: nowrap; }
.tag.ok { background: rgba(46, 229, 157, .15); color: var(--ok); }
.tag.warn { background: rgba(255, 185, 56, .15); color: var(--warn); }
.tag.bad { background: rgba(255, 79, 109, .15); color: var(--bad); }
.tag.gold { background: rgba(255, 210, 63, .15); color: var(--gold); }
.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); outline: none; font-weight: 600; resize: none;
}
.input.code { text-transform: uppercase; letter-spacing: .15em; font-weight: 900; }
.input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 56, 170, .15); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch input { width: 22px; height: 22px; accent-color: var(--pink); flex-shrink: 0; }
.seg { display: flex; background: var(--surface-2); border-radius: 14px; padding: 3px; gap: 3px; border: 1px solid var(--line); }
.seg button { flex: 1; border: 0; background: none; padding: 9px 4px; border-radius: 11px; font-weight: 800; color: var(--muted); cursor: pointer; font-size: 13px; transition: background .2s, color .2s; }
.seg button.active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--pink), 0 0 12px rgba(255, 56, 170, .15); }

/* ---------- toasts / banners / modals ---------- */
.toasts { position: fixed; top: calc(10px + var(--top-inset)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 100; pointer-events: none; padding: 0 16px; }
.toast {
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line);
  padding: 10px 14px; border-radius: 12px; font-weight: 700; font-size: 14px; max-width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4); animation: toastIn .2s ease;
}
.toast.bad { border-color: rgba(255, 79, 109, .6); }
.toast.ok { border-color: rgba(46, 229, 157, .6); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }
.banners { position: fixed; top: calc(8px + var(--top-inset)); left: 0; right: 0; z-index: 110; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 10px; pointer-events: none; }
.banner-pop {
  pointer-events: auto; width: 100%; max-width: 560px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #221541, #2c1450); border: 2px solid var(--pink);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, .45) inset, 0 12px 30px rgba(0, 0, 0, .55);
  border-radius: 16px; padding: 12px 12px 14px; touch-action: none;
}
.bp-main { display: flex; align-items: center; gap: 12px; }
.bp-title { font-weight: 900; }
.bp-text { font-size: 13px; color: #cfc9ef; margin-top: 2px; }
.bp-actions { display: flex; gap: 8px; margin-top: 10px; }
.bp-actions .btn { flex: 1; }
.bp-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--cyan); transform-origin: left; }
.modal-back { position: fixed; inset: 0; background: rgba(4, 4, 12, .65); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal {
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border-top-left-radius: 22px; border-top-right-radius: 22px;
  border: 1px solid var(--line); border-bottom: 0; width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto;
  padding: 18px var(--gutter) calc(18px + var(--safe-bottom)); animation: slideUp .22s cubic-bezier(.2, .9, .3, 1);
}
.modal::before { content: ""; display: block; width: 42px; height: 4px; border-radius: 4px; background: var(--line); margin: -8px auto 12px; }
.modal .modal-title { font-size: 19px; font-weight: 900; margin-bottom: 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(60px); opacity: 0; } }
/* centred 8-BIT dialog (confirmations) */
.modal-back.center { align-items: center; padding: 0 22px calc(20px + var(--safe-bottom)); }
.modal.dialog {
  max-width: 400px; border-radius: 18px; padding: 16px 16px 14px; border: 2px solid var(--pink); border-bottom: 2px solid var(--pink);
  background: linear-gradient(160deg, #221541, #120f2c); box-shadow: 0 0 0 2px rgba(0, 229, 255, .35) inset, 0 0 26px rgba(255, 56, 170, .35), 0 24px 60px rgba(0, 0, 0, .6);
  animation: dialogIn .22s cubic-bezier(.2, .9, .3, 1); image-rendering: pixelated;
}
.modal.dialog::before { display: none; }
@keyframes dialogIn { from { transform: scale(.9) translateY(10px); opacity: 0; } }
.dialog-logo { display: flex; justify-content: center; opacity: .9; }
.dialog-logo svg { height: 12px; width: auto; }
.dialog-text { text-align: center; font-weight: 800; font-size: 16px; padding: 2px 4px 6px; line-height: 1.35; }
.dialog-body .btn-row .btn { padding: 12px 10px; }

/* ---------- fx ---------- */
.fx-ghost { transition: none !important; }
/* the dragged clone must follow the finger instantly: no inherited transitions, its own GPU layer */
.fx-drag { box-shadow: 0 14px 30px rgba(0, 0, 0, .55) !important; filter: brightness(1.05); transition: none !important; animation: none !important; will-change: transform; backface-visibility: hidden; }
.drag-src { opacity: .25; }
.drop-hover { outline: 3px dashed var(--gold); outline-offset: 3px; }
.fx-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 120; overflow: hidden; }
.fx-confetti i { position: absolute; top: 0; display: block; border-radius: 1px; }
.fx-float { position: fixed; z-index: 90; pointer-events: none; font-weight: 900; font-size: 18px; color: var(--gold); text-shadow: 0 2px 6px rgba(0, 0, 0, .7); white-space: nowrap; }
.fx-float.bad { color: var(--bad); }
.fx-float.ok { color: var(--ok); }

/* ---------- avatars ---------- */
.avatar {
  width: var(--s, 40px); height: var(--s, 40px); border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  font-weight: 900; color: #fff; font-size: calc(var(--s, 40px) * .42); position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.avatar .online-dot { position: absolute; right: 0; bottom: 0; width: 28%; height: 28%; background: var(--ok); border: 2px solid var(--bg); border-radius: 50%; z-index: 1; }
.guild-avatar { border-radius: 30%; background: linear-gradient(150deg, #3b2d7a, #1a1440); border: 1px solid rgba(0, 229, 255, .35); font-size: calc(var(--s, 40px) * .55); }

/* computer players: the ring colour tells the difficulty */
.avatar.bot { background: linear-gradient(150deg, #2a2847, #14122b); border: 2px solid var(--line); font-size: calc(var(--s, 40px) * .52); }
.avatar.bot.lvl-easy { border-color: var(--ok); }
.avatar.bot.lvl-medium { border-color: var(--warn); }
.avatar.bot.lvl-hard { border-color: #ff7a3d; }
.avatar.bot.lvl-nightmare { border-color: var(--pink); box-shadow: 0 0 12px rgba(255, 56, 170, .55); animation: glowPulse 2s infinite; }
.bot-tag { color: var(--muted); background: rgba(255, 255, 255, .06); border-color: var(--line); }
.bot-tag.lvl-easy { color: var(--ok); border-color: rgba(46, 229, 157, .45); background: rgba(46, 229, 157, .1); }
.bot-tag.lvl-medium { color: var(--warn); border-color: rgba(255, 185, 56, .45); background: rgba(255, 185, 56, .1); }
.bot-tag.lvl-hard { color: #ff7a3d; border-color: rgba(255, 122, 61, .45); background: rgba(255, 122, 61, .1); }
.bot-tag.lvl-nightmare { color: var(--pink); border-color: rgba(255, 56, 170, .5); background: rgba(255, 56, 170, .12); }
.seg.levels button.active.lvl-easy { box-shadow: inset 0 -2px 0 var(--ok); color: var(--ok); }
.seg.levels button.active.lvl-medium { box-shadow: inset 0 -2px 0 var(--warn); color: var(--warn); }
.seg.levels button.active.lvl-hard { box-shadow: inset 0 -2px 0 #ff7a3d; color: #ff7a3d; }
.seg.levels button.active.lvl-nightmare { box-shadow: inset 0 -2px 0 var(--pink), 0 0 14px rgba(255, 56, 170, .35); color: var(--pink); }
.level-desc.lvl-nightmare { color: var(--pink); }
.bots-tip { margin-top: 0; }
.btn.danger-glow { background: linear-gradient(135deg, #ff2d78, #7c1fff); animation: glowPulse 1.6s infinite; }

/* ---------- profile ---------- */
.profile-card { padding: 20px 16px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; background: linear-gradient(160deg, #2a1552, #120c2a); border: 2px solid rgba(255, 56, 170, .5); }
.avatar-edit { position: relative; cursor: pointer; border-radius: 50%; padding: 4px; background: conic-gradient(from 0deg, var(--pink), var(--cyan), var(--accent-2), var(--pink)); }
.avatar-edit .avatar { border: 3px solid var(--bg); }
.avatar-cam { position: absolute; right: 2px; bottom: 2px; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--bg); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.avatar-edit.uploading::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 4px solid transparent; border-top-color: #fff; animation: spin .8s linear infinite; }
.editable { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; max-width: 100%; }
.editable .pen { font-size: 13px; opacity: .6; }
.editable.bio { color: var(--muted); font-size: 14px; }
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.guild-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: rgba(0, 229, 255, .12); border: 1px solid rgba(0, 229, 255, .35); color: var(--cyan); font-weight: 800; font-size: 13px; cursor: pointer; }
.rank { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; max-width: 260px; }
.rank-title { font: 900 13px "Courier New", monospace; letter-spacing: .15em; color: var(--gold); text-shadow: 2px 2px 0 rgba(0, 0, 0, .5); }
.rank-bar { width: 100%; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--pink)); transition: width .8s ease; }
.rank-next { font-size: 11px; color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 21px; font-weight: 900; }
.stat span { font-size: 12px; color: var(--muted); }
table.gstats { width: 100%; border-collapse: collapse; font-size: 14px; }
table.gstats td, table.gstats th { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: center; }
table.gstats th { color: var(--muted); font-weight: 700; font-size: 12px; }
table.gstats td:first-child, table.gstats th:first-child { text-align: left; }

/* ---------- top ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin: 6px 0 14px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; text-align: center; min-width: 0; }
.pod-name { font-weight: 800; font-size: 13px; max-width: 100%; }
.pod-value { font-weight: 900; font-size: 13px; color: var(--gold); }
.pod-step { width: 100%; border-radius: 12px 12px 0 0; display: flex; justify-content: center; padding-top: 6px; font-size: 22px; background: linear-gradient(180deg, var(--surface-3), var(--surface)); border: 1px solid var(--line); border-bottom: 0; }
.pod-1 .pod-step { height: 74px; background: linear-gradient(180deg, rgba(255, 210, 63, .35), var(--surface)); border-color: rgba(255, 210, 63, .5); }
.pod-2 .pod-step { height: 54px; }
.pod-3 .pod-step { height: 40px; }
.pod-1 .avatar { box-shadow: 0 0 0 3px var(--gold), 0 0 20px rgba(255, 210, 63, .5); }

/* ---------- chats ---------- */
.chat-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 8px var(--gutter); border-bottom: 1px solid var(--line); background: rgba(11, 12, 22, .9); flex-shrink: 0; }
.chat-head .title { font-weight: 900; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px var(--gutter); display: flex; flex-direction: column; gap: 6px; }
.msg { display: flex; align-items: flex-end; gap: 6px; max-width: 86%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 7px 10px 5px; min-width: 60px; word-break: break-word; user-select: text; -webkit-user-select: text; }
.msg.mine .msg-bubble { background: linear-gradient(135deg, #7a2bb8, #b0288f); border-color: transparent; border-radius: 16px 16px 4px 16px; }
.msg-author { display: block; font-size: 12px; color: var(--cyan); margin-bottom: 2px; cursor: pointer; }
.msg-text { white-space: pre-wrap; }
.msg-time { display: block; text-align: right; font-size: 10px; color: rgba(255, 255, 255, .5); margin-top: 2px; }
.msg.system { align-self: center; max-width: 92%; font-size: 12px; color: #c9c4f2; background: rgba(124, 107, 255, .12); border: 1px dashed rgba(124, 107, 255, .35); padding: 5px 10px; border-radius: 999px; text-align: center; }
.chat-bar { display: flex; gap: 8px; align-items: flex-end; padding: 8px var(--gutter) calc(8px + var(--safe-bottom)); border-top: 1px solid var(--line); background: rgba(11, 12, 22, .95); flex-shrink: 0; }
.chat-input { min-height: 44px; max-height: 120px; }
.send-btn { width: 46px; height: 44px; padding: 0; flex-shrink: 0; font-size: 18px; }
.chat-blocked { padding: 14px var(--gutter) calc(14px + var(--safe-bottom)); text-align: center; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; }

/* room chat */
.chat-btn .qbadge { top: -6px; right: -6px; }
.rc-back { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .35); }
.rc-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; max-width: 640px; margin: 0 auto; max-height: 62vh;
  display: flex; flex-direction: column; background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; padding-bottom: var(--safe-bottom);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, .5);
}
.rc-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.rc-list { flex: 1; min-height: 120px; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.rc-msg { display: flex; align-items: flex-end; gap: 6px; max-width: 88%; }
.rc-msg.mine { align-self: flex-end; }
.rc-bubble { background: var(--surface-3); border-radius: 14px; padding: 6px 10px; word-break: break-word; }
.rc-bubble b { display: block; font-size: 11px; color: var(--cyan); }
.rc-msg.mine .rc-bubble { background: linear-gradient(135deg, #7a2bb8, #b0288f); }
.rc-quick { display: flex; gap: 6px; overflow-x: auto; padding: 6px 14px; scrollbar-width: none; }
.rc-quick .chip { flex-shrink: 0; padding: 6px 10px; font-size: 13px; }
.rc-input { display: flex; gap: 8px; padding: 6px 14px 10px; }
.rc-input .btn { width: 48px; padding: 0; }
.speech {
  position: fixed; top: calc(58px + var(--top-inset)); left: 50%; transform: translateX(-50%); z-index: 72; max-width: 86%;
  background: #fff; color: #1a1030; padding: 8px 12px; border-radius: 14px; font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4); cursor: pointer;
}
.speech::after { content: ""; position: absolute; top: -6px; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top: 0; border-bottom-color: #fff; }

/* ---------- guilds ---------- */
.guild-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 4px; }
.gh-emblem {
  --s: 76px; width: var(--s); height: var(--s); border-radius: 22px; display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--s) * .55); flex-shrink: 0; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #3b2d7a, #16103a); border: 2px solid var(--cyan); box-shadow: 0 0 0 3px rgba(255, 56, 170, .35), 0 0 24px rgba(0, 229, 255, .25);
}
.gh-emblem img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.emblem-edit { border-radius: 26px; }
.emblem-edit .gh-emblem { border-color: var(--bg); }
.emblem-edit.uploading::after { border-radius: 26px; }
.perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 4px; }
.perk { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.perk b { font-size: 24px; }
.perk span { font-weight: 800; font-size: 12px; }
.perk small { color: var(--muted); font-size: 11px; }
.guild-card { display: flex; align-items: center; gap: 14px; padding: 16px; background: linear-gradient(150deg, #2d1a5e, #120c2a); border: 2px solid rgba(0, 229, 255, .45); }
.guild-level { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; }
.lvl { font-weight: 900; color: var(--gold); white-space: nowrap; }
.xp-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .4); overflow: hidden; }
.xp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--accent-2)); }
.guild-desc { margin-top: 10px; color: #cfc9ef; font-size: 14px; }
.guild-actions { display: flex; gap: 8px; margin-top: 12px; }
.guild-actions .btn { flex: 1; }
.guild-actions .btn:nth-child(n+3) { flex: 0 0 52px; }
.quest { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.quest.done { border-color: rgba(46, 229, 157, .5); background: linear-gradient(150deg, rgba(46, 229, 157, .1), var(--surface)); }
.quest-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.quest-title { font-weight: 800; font-size: 14px; }
.quest-bar { height: 10px; border-radius: 5px; background: rgba(0, 0, 0, .45); margin: 6px 0 4px; overflow: hidden; }
.quest-bar i { display: block; height: 100%; border-radius: 5px; background: repeating-linear-gradient(90deg, var(--pink) 0 8px, var(--accent-2) 8px 16px); transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.quest.done .quest-bar i { background: var(--ok); }
.quest-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.quest-reward { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 900; color: var(--gold); font-size: 13px; }
.quest-reward.off { color: var(--muted); font-size: 10px; font-weight: 700; text-align: center; }
.quest-reward.off .coin { filter: grayscale(1); opacity: .5; }
.quest-reward.got { color: var(--ok); font-size: 18px; }
.quest-reward.got small { font-size: 11px; color: var(--muted); }
.quest.nope { opacity: .75; border-color: var(--line); background: var(--surface); }
.quest-nope { color: var(--bad); font-weight: 700; }
.quest-take { color: var(--gold); font-weight: 700; }
.quest-claim { flex-shrink: 0; animation: glowPulse 2s infinite; white-space: nowrap; }
.rank-card { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px; border-radius: 16px; background: linear-gradient(150deg, rgba(255, 210, 63, .12), var(--surface)); border: 1px solid rgba(255, 210, 63, .35); }
.rank-place { font: 900 24px "Courier New", monospace; color: var(--gold); min-width: 48px; text-align: center; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-opt { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 22px; cursor: pointer; }
.emoji-opt.active { border-color: var(--pink); box-shadow: 0 0 0 2px var(--pink); background: var(--surface-3); }

/* ---------- room ---------- */
.room-head { display: flex; align-items: center; gap: 6px; padding: 8px var(--gutter); border-bottom: 1px solid var(--line); flex-shrink: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--g1, #2c2352) 35%, transparent), transparent 70%); }
.room-head .title { font-weight: 900; }
.room-head .icon-btn { width: 34px; height: 34px; }
.room-emoji { font-size: 24px; }
.code-chip { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .1em; font-weight: 900; background: var(--surface-2); border: 1px dashed var(--line); padding: 4px 6px; border-radius: 8px; cursor: pointer; font-size: 12px; }
.waiting { gap: 12px; }
.radar { position: relative; width: 170px; height: 170px; margin: 6px auto 0; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--g1, #2c2352) 55%, transparent), transparent 70%); }
.radar-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--gl, rgba(124, 107, 255, .5)); animation: ring 2.4s ease-out infinite; }
.radar-ring.r2 { animation-delay: 1.2s; }
@keyframes ring { from { transform: scale(.35); opacity: 1; } to { transform: scale(1); opacity: 0; } }
.radar-sweep { position: absolute; inset: 12%; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 75%, var(--gl, rgba(124, 107, 255, .5)) 100%); animation: spin 2.2s linear infinite; }
.radar-emoji { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 56px; animation: float 3s ease-in-out infinite; }
.seat-list { display: flex; flex-direction: column; gap: 8px; }
.seat-empty { border-style: dashed; color: var(--muted); justify-content: center; min-height: 58px; }
.waiting-dots::after { content: ""; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.result-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(22, 22, 41, .97); border-top: 2px solid var(--pink); border-radius: 22px 22px 0 0;
  padding: 14px var(--gutter) calc(14px + var(--safe-bottom)); box-shadow: 0 -12px 30px rgba(0, 0, 0, .5);
}
.result-sheet.win { border-top-color: var(--ok); }
.result-sheet.lose { border-top-color: var(--bad); }
.result-logo { display: flex; justify-content: center; margin-bottom: 2px; }
.result-logo svg { height: 34px; filter: drop-shadow(0 0 12px currentColor); }
.result-title { font-size: 24px; font-weight: 900; text-align: center; }
.result-title.win { color: var(--ok); }
.result-title.lose { color: var(--bad); }
.result-money { text-align: center; font-weight: 900; font-size: 20px; min-height: 26px; }
.result-money.win { color: var(--ok); }
.result-money.lose { color: var(--bad); }

.player-strip { display: flex; align-items: center; gap: 10px; padding: 6px var(--gutter); flex-shrink: 0; }
.player-strip .name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-strip.turn .name::after { content: " • ход"; color: var(--ok); font-size: 12px; }
.clock { margin-left: auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 900; font-size: 17px; background: var(--surface-2); border: 1px solid var(--line); padding: 3px 10px; border-radius: 8px; min-width: 72px; text-align: center; }
.clock.running { background: var(--text); color: var(--bg); }
.clock.low { background: var(--bad); color: #fff; border-color: var(--bad); }
.hint { text-align: center; color: var(--muted); font-size: 14px; padding: 4px 0; min-height: 26px; }
/* one line, always: a wrapping hint would resize the table above it */
.durak-bottom .hint, .poker-bottom .hint, .bj-bottom .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 8px; padding-right: 8px; }
.hint.act { color: var(--ok); font-weight: 800; }
.timer-bar { height: 4px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.timer-bar > i { display: block; height: 100%; background: var(--ok); transition: width .25s linear; }
.timer-bar.low > i { background: var(--bad); }

/* duel layout: strips + board that fits the remaining space */
.duel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.board-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 var(--gutter); container-type: size; }
.board-wrap > * { width: 100%; max-width: 100%; }
@supports (width: 1cqw) {
  .board-wrap > .fit { width: min(100cqw, 100cqh); }
  .board-wrap > .c4-wrap.fit { width: min(100cqw, calc((100cqh - 50px) * 7 / 6)); }
}
.duel-bottom { flex-shrink: 0; padding: 0 var(--gutter) calc(8px + var(--safe-bottom)); }
.history { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); white-space: nowrap; overflow-x: auto; padding: 4px 0; }

/* ---------- playing cards ---------- */
.card {
  --cw: 46px;
  width: var(--cw); height: calc(var(--cw) * 1.42); border-radius: calc(var(--cw) * .12);
  background: linear-gradient(160deg, #ffffff, #eef0f4); color: #1a1d24; position: relative; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35); font-weight: 800;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card .cr { position: absolute; top: 3%; left: 8%; font-size: calc(var(--cw) * .34); line-height: 1; text-align: center; }
.card .cr small { display: block; font-size: calc(var(--cw) * .28); }
.card .cs { position: absolute; right: 8%; bottom: 5%; font-size: calc(var(--cw) * .5); line-height: 1; }
.card.red { color: #d3263a; }

.card.sm { --cw: 34px; }
.card.xs { --cw: 22px; }
.card.lg { --cw: 60px; }
.card.sel { transform: translateY(-16px); box-shadow: 0 0 0 3px var(--gold), 0 6px 14px rgba(0, 0, 0, .5); }
.card.playable { box-shadow: 0 0 0 2px rgba(46, 204, 143, .9), 0 2px 6px rgba(0, 0, 0, .35); }
.card.dim { filter: brightness(.6); }
.card.ghost { background: rgba(255, 255, 255, .06); box-shadow: none; border: 1px dashed rgba(255, 255, 255, .25); }
.card.caught { box-shadow: 0 0 0 3px var(--bad), 0 0 16px var(--bad); }
.card.suspect { box-shadow: 0 0 0 3px var(--pink); }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(255, 207, 90, .35); } }

.hand { display: flex; justify-content: center; padding: 20px 6px 6px; flex-shrink: 0; }
.hand .card { --cw: var(--hand-cw, 52px); margin-left: var(--overlap, -14px); cursor: grab; touch-action: none; }
.hand .card:first-child { margin-left: 0; }
.fan { display: flex; }
.fan .card { margin-left: -16px; }
.fan .card:first-child { margin-left: 0; }

.felt {
  background: var(--felt-bg, radial-gradient(ellipse at center, var(--felt), var(--felt-2)));
  border-radius: 22px; border: 6px solid var(--felt-border, #3a2616); box-shadow: var(--felt-shadow, inset 0 0 30px rgba(0, 0, 0, .45));
  position: relative;
}

/* ---------- chess / checkers boards ---------- */
.board { display: grid; aspect-ratio: 1; border-radius: 8px; overflow: hidden; position: relative; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); box-shadow: var(--board-shadow, 0 6px 20px rgba(0, 0, 0, .45)); }
.sq { position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; min-width: 0; min-height: 0; }
.sq.light { background: var(--sq-light, #ecdab9); }
.sq.dark { background: var(--sq-dark, #ae8a68); }
.sq.last::before { content: ""; position: absolute; inset: 0; background: rgba(255, 214, 64, .38); }
.sq.sel::before { content: ""; position: absolute; inset: 0; background: rgba(91, 140, 255, .55); }
.sq.check::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255, 40, 40, .9), rgba(255, 40, 40, 0) 70%); }
.sq.move::after { content: ""; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: rgba(20, 30, 20, .35); z-index: 2; }
.sq.capture::after { content: ""; position: absolute; inset: 4%; border-radius: 50%; border: 4px solid rgba(20, 30, 20, .35); z-index: 2; }
.sq.drop-hover { outline: 3px solid var(--gold); outline-offset: -3px; }
.sq .coord { position: absolute; font-size: 9px; font-weight: 700; opacity: .7; pointer-events: none; }
.sq .coord.f { right: 2px; bottom: 1px; }
.sq .coord.r { left: 2px; top: 1px; }
.sq.light .coord { color: var(--coord-light, #ae8a68); }
.sq.dark .coord { color: var(--coord-dark, #ecdab9); }
.piece {
  position: relative; z-index: 3; line-height: 1; font-size: calc(var(--sq, 42px) * .82);
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", "DejaVu Sans", "Apple Symbols", serif;
  touch-action: none; cursor: grab;
}
.piece.w { color: var(--pw-color, #fff); text-shadow: var(--pw-shadow, 0 0 1px #000, 0 0 2px #000, 1px 1px 0 #333, -1px -1px 0 #333, 1px -1px 0 #333, -1px 1px 0 #333); }
.piece.b { color: var(--pb-color, #1d1d1d); text-shadow: var(--pb-shadow, 0 0 1px rgba(255, 255, 255, .6)); }
.board.checkers .sq.light { background: var(--sq-light, #e8d3b0); }
.board.checkers .sq.dark { background: var(--sq-dark, #6b4a33); }
.board.checkers .sq.path::before { content: ""; position: absolute; inset: 0; background: rgba(255, 214, 64, .3); }
.board.checkers .sq.step::after { content: ""; position: absolute; width: 34%; height: 34%; border-radius: 50%; background: rgba(46, 204, 143, .75); z-index: 4; }
.disc {
  width: 78%; height: 78%; border-radius: 50%; position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: center; font-size: calc(var(--sq, 42px) * .45);
  touch-action: none; cursor: grab;
}
.disc.w { background: var(--dw-bg, radial-gradient(circle at 35% 30%, #fff, #d9d6cf 60%, #a9a499)); box-shadow: var(--dw-shadow, 0 3px 0 #7d786e, 0 4px 6px rgba(0, 0, 0, .5)); color: #b8860b; }
.disc.b { background: var(--db-bg, radial-gradient(circle at 35% 30%, #555, #2a2a2a 60%, #111)); box-shadow: var(--db-shadow, 0 3px 0 #000, 0 4px 6px rgba(0, 0, 0, .5)); color: var(--gold); }
.sq.sel .disc { outline: 3px solid var(--accent); outline-offset: 2px; }
.sq.can .disc { box-shadow: 0 0 0 3px rgba(46, 204, 143, .8), 0 4px 6px rgba(0, 0, 0, .5); }

.ttt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; aspect-ratio: 1; }
.ttt .cell {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: calc(var(--sq, 100px) * .55); font-weight: 900; cursor: pointer;
}
.ttt .cell.X { color: var(--accent); text-shadow: 0 0 14px rgba(91, 140, 255, .6); }
.ttt .cell.O { color: var(--warn); text-shadow: 0 0 14px rgba(245, 183, 59, .6); }
.ttt .cell.win { background: rgba(46, 204, 143, .2); border-color: var(--ok); }

.c4-wrap { display: flex; flex-direction: column; gap: 4px; }
.c4 {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; padding: 8px;
  background: #1f4fd6; border-radius: 14px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), 0 6px 20px rgba(0, 0, 0, .4);
}
.c4 .hole { aspect-ratio: 1; border-radius: 50%; background: var(--bg); cursor: pointer; box-shadow: inset 0 3px 4px rgba(0, 0, 0, .6); position: relative; }
.c4 .disc4 { position: absolute; inset: 0; border-radius: 50%; }
.c4 .disc4.p1 { background: radial-gradient(circle at 35% 35%, #ff7a7a, #e0243a); }
.c4 .disc4.p2 { background: radial-gradient(circle at 35% 35%, #ffe680, #f0b400); }
.c4 .hole.win .disc4 { box-shadow: 0 0 0 3px #fff, 0 0 12px #fff; }
.c4-arrows { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; padding: 0 8px; }
.c4-arrows button { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 2px; }

/* ---------- nardy (backgammon), upright board ---------- */
.nardy {
  display: flex; flex-direction: column; aspect-ratio: 5 / 8; position: relative; isolation: isolate;
  padding: 6px; border-radius: 14px; border: 6px solid var(--nardy-border, #2a1608);
  background: var(--nardy-bg, linear-gradient(160deg, #6b4423, #3a2314)); box-shadow: var(--nardy-shadow, inset 0 0 30px rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .45));
}
@supports (width: 1cqw) { .board-wrap > .nardy.fit { width: min(100cqw, calc(100cqh * 5 / 8)); } }
.nhalf { flex: 1; display: flex; gap: 10px; min-height: 0; }
.ncol { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pt { flex: 1; position: relative; display: flex; align-items: center; min-height: 0; cursor: pointer; padding: 0 2px; }
.pt.rgt { flex-direction: row-reverse; }
.pt .tri { position: absolute; inset: 1px 0; z-index: 0; background: var(--tri, #b67a3c); transition: filter .15s; }
.pt.odd .tri { background: var(--tri-odd, #e6c79a); }
.pt.lft .tri { clip-path: polygon(0 0, 100% 50%, 0 100%); }
.pt.rgt .tri { clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.pt.target .tri, .barchk.target, .ntray.target { filter: brightness(1.35); }
.pt.target::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border: 2px dashed rgba(46, 229, 157, .85); border-radius: 6px; }
.pt.drop-hover .tri { filter: brightness(1.6); }
.pt .stack { display: flex; align-items: center; position: relative; z-index: 1; height: 100%; }
.pt.rgt .stack { flex-direction: row-reverse; }
.chk {
  height: calc(100% - 6px); max-height: 38px; aspect-ratio: 1; border-radius: 50%; flex-shrink: 0; position: relative;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(0, 0, 0, .15); touch-action: none;
}
.pt .chk + .chk { margin-left: -4px; }
.pt.rgt .chk + .chk { margin-left: 0; margin-right: -4px; }
.chk.c0 { background: var(--dw-bg, radial-gradient(circle at 35% 30%, #fff, #d9d6cf 60%, #a9a499)); box-shadow: var(--dw-shadow, 0 2px 0 rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(0, 0, 0, .15)); }
.chk.c1 { background: var(--db-bg, radial-gradient(circle at 35% 30%, #5a5a70, #26263a 60%, #0e0e18)); box-shadow: var(--db-shadow, 0 2px 0 rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(0, 0, 0, .15)); }
.chk b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.pt.can .chk.top { box-shadow: 0 0 0 3px rgba(46, 229, 157, .85), 0 2px 0 rgba(0, 0, 0, .45); }
.pt.sel .chk.top, .barchk.sel .chk { box-shadow: 0 0 0 3px var(--accent), 0 0 14px var(--accent); }
.die-tag { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--ok); color: #04241a; font: 900 12px/20px "Courier New", monospace; text-align: center; pointer-events: none; }
.pt.lft .die-tag { right: 6px; }
.pt.rgt .die-tag { left: 6px; }
.nbar { height: 50px; flex-shrink: 0; margin: 4px 0; display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 8px; background: rgba(0, 0, 0, .28); position: relative; isolation: isolate; }
.nbar::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; image-rendering: pixelated; background: var(--logo-engrave) center / 18% auto no-repeat; }
.ntray { width: 56px; height: 100%; border-radius: 6px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .12); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; flex-shrink: 0; }
.ntray.theirs { margin-left: auto; }
.ntray-n { font: 900 16px "Courier New", monospace; }
.ntray-l { font-size: 9px; color: rgba(255, 255, 255, .65); text-transform: uppercase; letter-spacing: .05em; }
.ntray.target { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(46, 229, 157, .6); }
.nbarbox { display: flex; gap: 6px; align-items: center; height: 100%; }
.barchk { height: 100%; display: flex; align-items: center; padding: 3px; border-radius: 6px; }
.barchk .chk { height: calc(100% - 4px); }
.barchk.can .chk { box-shadow: 0 0 0 3px rgba(46, 229, 157, .85), 0 2px 0 rgba(0, 0, 0, .45); }
.ndice { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ndice.mine .die { box-shadow: 0 0 0 2px var(--ok), 0 4px 10px rgba(0, 0, 0, .5); }
.die.mini { width: 34px; height: 34px; border-radius: var(--die-mini-radius, 8px); padding: 5px; gap: 2px; box-shadow: var(--die-mini-shadow, inset 0 -3px 0 rgba(0, 0, 0, .14), 0 4px 10px rgba(0, 0, 0, .5)); }
.die.mini.used { opacity: .35; }
.ndice .dbl { font: 900 13px "Courier New", monospace; color: var(--gold); }

/* ---------- battleship ---------- */
.sea { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; background: #0b2447; padding: 3px; border-radius: 10px; aspect-ratio: 1; position: relative; }
.sea .cell { background: #19376d; border-radius: 3px; position: relative; display: flex; align-items: center; justify-content: center; font-size: 12px; min-width: 0; }
.sea.target .cell { cursor: crosshair; }
.sea .cell.ship { background: #7b8fa6; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25); }
.sea .cell.ship.sel { background: var(--gold); }
.sea .cell.miss::after { content: ""; width: 26%; height: 26%; border-radius: 50%; background: #a5c9ff; opacity: .7; }
.sea .cell.hit { background: #ff8a3d; }
.sea .cell.hit::after { content: "✕"; color: #fff; font-weight: 900; }
.sea .cell.sunk { background: #d7263d; }
.sea .cell.sunk::after { content: "✕"; color: #fff; font-weight: 900; }
.sea .cell.last { outline: 2px solid var(--gold); outline-offset: -2px; }
.sea .cell.preview-ok { background: rgba(46, 204, 143, .75); }
.sea .cell.preview-bad { background: rgba(255, 90, 106, .75); }
.sea.disabled { opacity: .75; }
.bs-row { display: flex; gap: 10px; align-items: center; padding-top: 6px; }
.bs-row .sea { width: 40%; flex-shrink: 0; }
.bs-row .bs-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bs-row .player-strip { padding: 0; gap: 8px; }
.bs-row .clock { font-size: 15px; min-width: 60px; padding: 2px 6px; }
.bs-row .hint { text-align: left; min-height: 44px; } /* two lines reserved: no jumps when the text wraps */
.fx-splash, .fx-boom { position: absolute; inset: -40%; border-radius: 50%; pointer-events: none; z-index: 5; }
.fx-splash { border: 3px solid #a5c9ff; animation: ripple .6s ease-out forwards; }
.fx-boom { background: radial-gradient(circle, #fff3a0 0, #ff8a3d 35%, rgba(255, 60, 0, 0) 70%); animation: boom .6s ease-out forwards; }
@keyframes ripple { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
@keyframes boom { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

/* ---------- poker ---------- */
.poker { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.poker-table {
  flex: 1; min-height: 190px; margin: 26px var(--gutter) 6px; border-radius: 140px;
  /* sizes scale with the number of seats: a heads-up table has far more free felt than a full one */
  --bw: clamp(34px, min(12vw, 8vh), 50px); --sw: 88px; --xs: 30px; --sm: 42px; --sf: 13px;
}
.poker-table.n4, .poker-table.n5 { --bw: clamp(38px, min(13vw, 8.5vh), 56px); --sw: 92px; --xs: 32px; --sm: 44px; }
.poker-table.n2, .poker-table.n3 { --bw: clamp(40px, min(16vw, 10vh), 70px); --sw: 104px; --xs: 38px; --sm: 50px; --sf: 14px; }
.poker-center { position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.poker-board { display: flex; gap: 6px; }
.poker-board .card { --cw: var(--bw); } /* community cards use the free felt */
.pot { background: rgba(0, 0, 0, .35); padding: 4px 14px; border-radius: 999px; font-weight: 800; font-size: 16px; color: var(--gold); }
.p-seat {
  position: absolute; transform: translate(-50%, -50%); width: var(--sw);
  display: flex; flex-direction: column; align-items: center; gap: 2px; z-index: 2;
}
.p-seat .box { background: rgba(10, 14, 20, .88); border: 1px solid var(--line); border-radius: 12px; padding: 5px 10px; text-align: center; width: 100%; }
.p-seat.turn .box { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(46, 204, 143, .35); }
.p-seat.folded { opacity: .45; }
.p-seat .nm { font-size: var(--sf); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-seat .ch { font-size: var(--sf); color: var(--gold); font-weight: 700; }
.p-seat .act { font-size: 11px; color: var(--muted); min-height: 13px; }
.p-seat .cards { display: flex; gap: 3px; min-height: calc(var(--xs) * 1.42); }
.p-seat .cards .card.xs { --cw: var(--xs); }
.p-seat .cards .card.sm { --cw: var(--sm); }
.p-seat .bet { font-size: 12px; font-weight: 800; color: #2a1d00; background: var(--gold); border-radius: 999px; padding: 2px 9px; }
.p-seat .won { font-size: 12px; font-weight: 800; color: var(--ok); }
.p-seat .hn { font-size: 11px; color: var(--gold); font-weight: 700; }
.dealer-btn { position: absolute; top: -6px; right: -2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: #111; font-size: 10px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.poker-bottom { flex-shrink: 0; padding: 0 var(--gutter) calc(8px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 6px; position: relative; }
.poker-actions { min-height: 46px; }
.poker-bottom .status, .bj-bottom .status { min-height: 36px; } /* with or without the small button */
.poker-actions.idle { align-items: center; justify-content: center; }
.raise-panel {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(100% - 4px); z-index: 5;
  display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .5); animation: slideUp .18s cubic-bezier(.2, .9, .3, 1);
}
.my-hand { display: flex; justify-content: center; gap: 6px; min-height: 60px; align-items: flex-end; }
.raise-row { display: flex; gap: 6px; }
.raise-row .chip { flex: 1; text-align: center; padding: 6px 4px; font-size: 12px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.chip-token { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle, #fff 0 25%, var(--gold) 26% 60%, #b8860b 61%); box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }

/* ---------- blackjack ---------- */
.bj { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bj-table {
  flex: 1; min-height: 0; padding: 12px 10px 14px; margin: 8px var(--gutter); border-radius: 22px 22px 120px 120px; display: flex; flex-direction: column;
  --hw: clamp(38px, 11.5vw, 52px); --dw: clamp(44px, 13.5vw, 60px); /* hand / dealer card width; a small table gets bigger cards */
}
.bj-table.n2, .bj-table.n3 { --hw: clamp(40px, 13.5vw, 58px); --dw: clamp(46px, 15vw, 64px); }
.bj-dealer { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bj-dealer .bj-wait { height: calc(var(--dw) * 1.42); display: flex; align-items: center; color: rgba(255, 255, 255, .6); }
.bj-shoe { position: absolute; right: 14px; top: 12px; }
.bj-seats { flex: 1; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 10px; margin-top: 12px; }
.bj-seat { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 90px; }
.bj-seat .nm { font-size: 13px; font-weight: 700; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bj-seat.me .nm { color: var(--gold); }
.bj-hand { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px; border-radius: 10px; }
.bj-hand.active { background: rgba(46, 204, 143, .18); box-shadow: 0 0 0 2px rgba(46, 204, 143, .6); }
.bj-hand .fan .card { --cw: var(--hw); margin-left: calc(var(--cw) * -.55); }
.bj-hand .fan .card:first-child { margin-left: 0; }
.bj-dealer .fan .card { --cw: var(--dw); }
.bj-dealer .fan .card + .card { margin-left: -16px; }
.bj-hand .val, .bj-dealer .val { font-size: 16px; }
.val { background: rgba(0, 0, 0, .45); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 800; padding: 1px 8px; }
.res { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 6px; }
.res.win, .res.blackjack { background: var(--ok); color: #04241a; }
.res.lose, .res.bust { background: var(--bad); color: #fff; }
.res.push { background: var(--surface-3); }
.bet-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: #2a1d00; font-size: 11px; font-weight: 900; }
.bj-bottom { flex-shrink: 0; padding: 0 var(--gutter) calc(8px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 6px; min-height: 168px; justify-content: flex-end; } /* fixed height: the table stays put between phases */

/* ---------- durak ---------- */
.durak { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.durak-opps { display: flex; justify-content: space-around; gap: 6px; padding: 6px var(--gutter) 2px; flex-wrap: wrap; flex-shrink: 0; }
.opp { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; position: relative; }
.opp .nm { font-size: 12px; font-weight: 700; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp .role { font-size: 11px; font-weight: 700; min-height: 14px; }
.opp.out { opacity: .5; }
.opp.active-turn .avatar { box-shadow: 0 0 0 3px var(--ok); }
.opp .fan .card { margin-left: -15px; }
.durak-table { flex: 1; min-height: 150px; margin: 4px var(--gutter); display: flex; flex-direction: column; transition: box-shadow .15s; }
.durak-table.drop-hover { outline: none; box-shadow: inset 0 0 0 3px var(--gold), inset 0 0 30px rgba(0, 0, 0, .45); }
.durak-deck { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 64px; height: 80px; }
.durak-deck .card { --cw: 40px; }
.durak-deck .trump { position: absolute; left: 14px; top: 8px; transform: rotate(90deg); }
.durak-deck .stack { position: absolute; left: 0; top: 12px; }
.durak-deck .cnt { position: absolute; left: 0; bottom: -20px; width: 52px; text-align: center; font-size: 13px; font-weight: 800; }
.trump-suit { position: absolute; top: 8px; right: 12px; font-size: 26px; background: rgba(0, 0, 0, .3); border-radius: 10px; padding: 0 9px; }
.discard { position: absolute; bottom: 8px; right: 12px; font-size: 12px; color: rgba(255, 255, 255, .7); min-width: 30px; min-height: 20px; }
/* table cards scale with the free space: big while the table is empty, tighter when it fills up (--pw set in JS) */
.pairs { flex: 1; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 14px 12px; padding: 0 8px 0 66px; min-height: 0; --pw: 70px; }
.pair { position: relative; width: calc(var(--pw) + var(--pw) * .22); height: calc(var(--pw) * 1.42 + var(--pw) * .45); border-radius: 8px; }
.pair .card { position: absolute; top: 0; left: 0; --cw: var(--pw); }
.pair .card.def { top: calc(var(--pw) * .45); left: calc(var(--pw) * .22); }
/* the ring pulses on its own layer (opacity only) so it never repaints the table while a card is dragged */
.pair.target .card:first-child { box-shadow: 0 0 0 3px var(--gold); }
.pair.target .card:first-child::after {
  content: ""; position: absolute; inset: -3px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 5px rgba(255, 207, 90, .35); animation: ringPulse 1s infinite; will-change: opacity;
}
@keyframes ringPulse { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
.pair.drop-hover .card:first-child { box-shadow: 0 0 0 4px var(--ok); }
.durak-bottom { flex-shrink: 0; padding-bottom: calc(4px + var(--safe-bottom)); }
.durak-actions { display: flex; gap: 8px; padding: 0 var(--gutter); min-height: 40px; }
.durak-actions .btn { flex: 1; padding: 9px 10px; }
.felt-hint { position: absolute; left: 8%; right: 8%; top: calc(50% + 20px); font-size: 12.5px; color: rgba(255,255,255,.72); text-align: center; } /* right under the centered 8-BIT engraving */
.catch-bar { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 6; }


/* ---------- 8-BIT branding: engravings, card backs, watermarks ---------- */
.card.back {
  background: var(--cb-bg, var(--logo-back) center / 70% auto no-repeat,
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .1) 0 3px, transparent 3px 7px),
    linear-gradient(160deg, #5a2bd6, #2d1a8a));
  border: 2px solid var(--cb-border, #f4f5f8);
  image-rendering: pixelated; overflow: hidden;
}
/* the sheen of the royal back: present on every back, shown only where --cb-sheen says so */
.card.back::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 220%; pointer-events: none; display: var(--cb-sheen, none);
  background: linear-gradient(115deg, transparent 44%, rgba(255, 255, 255, .45) 50%, transparent 56%); animation: sheenX 2.8s linear infinite; will-change: transform;
}
.card.back.xs { background-size: 82% auto, auto, auto; }
.felt { isolation: isolate; }
.felt::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; image-rendering: pixelated;
  background: var(--logo-engrave) 50% 50% / 30% auto no-repeat;
}
/* every engraving sits exactly in the middle of its table */
.durak-table::before { background-size: 32% auto; }
.poker-table::before { background-size: 22% auto; }
.bj-table::before { background-size: 24% auto; }
.board::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; image-rendering: pixelated;
  background: var(--logo-dark) center / 44% auto no-repeat; opacity: .12;
}
.sea::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; image-rendering: pixelated;
  background: var(--logo-watermark) center / 48% auto no-repeat; opacity: .07;
}
.ttt { position: relative; }
.ttt::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; image-rendering: pixelated;
  background: var(--logo-watermark) center / 58% auto no-repeat; opacity: .05;
}
.c4-brand {
  height: 18px; margin: -6px 0 0; border-radius: 0 0 14px 14px; image-rendering: pixelated;
  background: var(--logo-engrave-blue) center / auto 62% no-repeat, #1f4fd6;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), 0 6px 14px rgba(0, 0, 0, .35);
}
.chip-token::after { content: "8"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 900 9px "Courier New", monospace; color: #7a5200; }
.chip-token { position: relative; }

/* ---------- weekly bonus ---------- */
.bonus-banner { border-color: var(--gold); cursor: pointer; }
.bonus-banner .small { color: var(--muted); }
.bonus-next { margin: 0 0 10px; }

/* ---------- chip shop ---------- */
.tap { cursor: pointer; }
.hero-plus { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); color: #2a1d00; font-size: 14px; font-weight: 900; margin-left: 2px; }
.lobby-hero[data-shop] { --g1: #7a5a00; --g2: #241a00; --gl: rgba(255, 210, 63, .55); }
.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pack {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 16px; padding: 14px 12px 12px; cursor: pointer;
  background: linear-gradient(150deg, #2c2352, #141029); border: 2px solid rgba(255, 255, 255, .08);
  display: flex; flex-direction: column; gap: 3px; transition: transform .15s, border-color .2s, box-shadow .2s;
}
.pack:active { transform: scale(.96); }
.pack.hot { background: linear-gradient(150deg, #4b2a8a, #1c0f40); }
.pack.sel { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 210, 63, .25), 0 0 24px rgba(255, 210, 63, .3); }
.pack-bonus { position: absolute; top: 8px; right: 8px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 900; padding: 2px 7px; border-radius: 999px; }
.pack-chips { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 900; }
.pack-chips .coin { width: 20px; height: 20px; }
.pack-title { font-size: 11px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.pack-price { margin-top: 4px; font-weight: 900; color: var(--gold); font-size: 16px; }
.pay-wait { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 30px; font-weight: 900; }
.pay-wait .coin { width: 28px; height: 28px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--surface-3); border-top-color: var(--pink); animation: spin .9s linear infinite; margin: 4px auto; }

/* ---------- «Лудка»: luck games against the house ---------- */
[data-luck="coin"] { --g1: #7a5a00; --g2: #241a00; --gl: rgba(255, 210, 63, .55); }
[data-luck="dice"] { --g1: #3a1e6e; --g2: #150a2a; --gl: rgba(179, 92, 255, .55); }
[data-luck="roulette"] { --g1: #8d1a1a; --g2: #2a0808; --gl: rgba(255, 79, 109, .55); }
[data-luck="slots"] { --g1: #4b22b8; --g2: #170d40; --gl: rgba(255, 56, 170, .55); }
[data-luck="mines"] { --g1: #1f3f7a; --g2: #0a1530; --gl: rgba(0, 229, 255, .5); }
[data-luck="crash"] { --g1: #a3321e; --g2: #2e0c05; --gl: rgba(255, 122, 61, .55); }
.luck-grid .game-card { min-height: 122px; }
.ok-text { color: var(--ok); }
.bad-text { color: var(--bad); }

.luck-stage {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 18px; min-height: 230px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px;
  background: linear-gradient(160deg, #1b1738, #0e0b20); border: 1px solid var(--line); box-shadow: inset 0 0 40px rgba(0, 0, 0, .35);
}
.luck-stage::before { /* the quiet 8-BIT watermark behind every stage */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; image-rendering: pixelated;
  background: var(--logo-watermark) center / 42% auto no-repeat; opacity: .05;
}
.luck-result {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 5; text-align: center; white-space: nowrap;
  padding: 6px 14px; border-radius: 12px; background: rgba(11, 12, 22, .88); border: 1px solid var(--line); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; line-height: 1.2;
}
.luck-result b { font-size: 20px; font-weight: 900; }
.luck-result span { font-size: 12px; color: var(--muted); }
.luck-result.win { border-color: var(--ok); }
.luck-result.win b { color: var(--ok); }
.luck-result.lose { border-color: rgba(255, 79, 109, .6); }
.luck-result.lose b { color: var(--bad); }
.luck-actions { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.luck-actions .btn-row .btn { flex-direction: column; gap: 1px; padding: 10px 6px; font-size: 14px; }
.luck-actions .btn .odds { display: block; font-size: 11px; font-weight: 800; opacity: .75; }
.luck-page.busy .luck-bet { opacity: .55; pointer-events: none; }
.bet-tools { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.bet-tools .btn { flex: 1; }
.bet-field { flex: none; min-width: 140px; padding: 8px 12px; gap: 5px; font-weight: 900; border-color: rgba(255, 56, 170, .45); }
.bet-field .pen { font-size: 12px; opacity: .8; }
.keypad-display { font: 900 32px "Courier New", monospace; text-align: center; padding: 10px; min-height: 60px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; letter-spacing: .04em; }
.keypad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad-key { padding: 14px 0; font-size: 20px; font-weight: 900; }
.luck-history { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; min-height: 22px; }
.ltag { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--surface-3); border: 1px solid transparent; }
.ltag.win { background: rgba(46, 229, 157, .16); color: var(--ok); }
.ltag.lose { background: rgba(255, 79, 109, .14); color: var(--bad); }
.ltag.red { background: #c8102e; color: #fff; }
.ltag.black { background: #181826; color: #fff; border-color: var(--line); }
.ltag.green { background: #1a8f4e; color: #fff; }
.ltag.hit { box-shadow: 0 0 0 2px var(--gold); }
.luck-stats { margin-top: 8px; }

/* coin */
.coin-stage { perspective: 900px; padding: 10px 0; }
.coin3d { width: 150px; height: 150px; position: relative; transform-style: preserve-3d; }
.coin3d .face {
  position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 45%, #fff2b3 0 8%, var(--gold) 9% 66%, #e09a00 67% 74%, var(--gold) 75%);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .22), inset 0 8px 0 rgba(255, 255, 255, .25), 0 0 0 5px #b87400, 0 14px 30px rgba(0, 0, 0, .55);
}
.coin3d .face.tails { transform: rotateY(180deg); }
.coin3d .ring { width: 78%; height: 78%; border-radius: 50%; border: 3px dashed rgba(122, 82, 0, .5); display: flex; align-items: center; justify-content: center; }

/* dice */
.stage-dice { justify-content: flex-start; padding-top: 26px; padding-bottom: 60px; } /* the result badge sits under the sum */
.dice-stage { display: flex; gap: 26px; padding: 4px 0; }
.die {
  width: 96px; height: 96px; border-radius: var(--die-radius, 18px); position: relative; isolation: isolate;
  background: var(--die-bg, linear-gradient(145deg, #fff, #d9d8ea)); box-shadow: var(--die-shadow, inset 0 -6px 0 rgba(0, 0, 0, .14), inset 0 2px 0 #fff, 0 12px 26px rgba(0, 0, 0, .5));
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 13px; gap: 5px;
}
.die::before { /* 8-BIT engraved into every face */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; image-rendering: pixelated; border-radius: inherit;
  background: var(--logo-dark) center / 62% auto no-repeat; opacity: .08;
}
.die i { border-radius: var(--pip-radius, 50%); background: var(--pip-bg, radial-gradient(circle at 35% 35%, #4a4468, #14122a)); box-shadow: var(--pip-shadow, inset 0 2px 3px rgba(0, 0, 0, .6)); opacity: 0; transform: scale(.6); transition: opacity .05s, transform .05s; }
.die.v1 i:nth-child(5), .die.v2 i:nth-child(3), .die.v2 i:nth-child(7), .die.v3 i:nth-child(3), .die.v3 i:nth-child(5), .die.v3 i:nth-child(7),
.die.v4 i:nth-child(1), .die.v4 i:nth-child(3), .die.v4 i:nth-child(7), .die.v4 i:nth-child(9),
.die.v5 i:nth-child(1), .die.v5 i:nth-child(3), .die.v5 i:nth-child(5), .die.v5 i:nth-child(7), .die.v5 i:nth-child(9),
.die.v6 i:nth-child(1), .die.v6 i:nth-child(3), .die.v6 i:nth-child(4), .die.v6 i:nth-child(6), .die.v6 i:nth-child(7), .die.v6 i:nth-child(9) { opacity: 1; transform: none; }
.dice-sum { font: 900 30px "Courier New", monospace; min-height: 36px; text-shadow: 3px 3px 0 rgba(0, 0, 0, .5); }
.dice-sum.win { color: var(--ok); }
.dice-sum.lose { color: var(--bad); }

/* roulette */
.wheel-wrap { position: relative; width: min(270px, 74vw); aspect-ratio: 1; margin: 14px 0 6px; }
.wheel { width: 100%; height: 100%; border-radius: 50%; background: #181826; box-shadow: 0 0 0 6px #3a2616, 0 0 0 8px #b87400, 0 14px 34px rgba(0, 0, 0, .55); will-change: transform; }
.wheel svg { width: 100%; height: 100%; display: block; border-radius: 50%; }
.wheel-hub {
  position: absolute; inset: 31%; border-radius: 50%; image-rendering: pixelated;
  background: var(--logo-engrave) center / 60% auto no-repeat, radial-gradient(circle at 40% 35%, #3a3760, #161629 70%);
  box-shadow: 0 0 0 3px #b87400, 0 6px 16px rgba(0, 0, 0, .6);
}
.wheel-pointer { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 0; height: 0; z-index: 3; border: 11px solid transparent; border-top: 20px solid var(--gold); filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .6)); }
.roulette-num {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0); z-index: 4; width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font: 900 24px "Courier New", monospace; color: #fff; border: 3px solid #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .6); transition: transform .25s cubic-bezier(.2, .9, .3, 1.3);
}
.roulette-num.show { transform: translate(-50%, -50%) scale(1); }
.roulette-num.red { background: #c8102e; }
.roulette-num.black { background: #181826; }
.roulette-num.green { background: #1a8f4e; }
.roulette-bets .chip small { font-size: 11px; opacity: .75; font-weight: 800; }
.chip.red.active { background: #c8102e; box-shadow: 0 0 14px rgba(200, 16, 46, .5); }
.chip.black.active { background: #181826; box-shadow: 0 0 0 1px var(--line), 0 0 14px rgba(255, 255, 255, .12); }
.num-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.num { padding: 9px 0; border-radius: 9px; border: 2px solid transparent; font: 900 14px "Courier New", monospace; color: #fff; cursor: pointer; }
.num.red { background: #c8102e; }
.num.black { background: #181826; border-color: var(--line); }
.num.green { background: #1a8f4e; grid-column: span 2; }
.num.active { border-color: var(--gold); box-shadow: 0 0 10px rgba(255, 210, 63, .5); }

/* slots */
.slot-machine { padding: 10px 12px 12px; border-radius: 18px; background: linear-gradient(180deg, #5a2bd6, #2d1a8a); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .14), 0 14px 30px rgba(0, 0, 0, .5); }
.slot-marquee { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 2px 0 8px; font: 900 12px "Courier New", monospace; letter-spacing: .3em; color: rgba(255, 255, 255, .85); }
.reels { display: flex; gap: 8px; }
.reel {
  width: 78px; height: 192px; overflow: hidden; border-radius: 10px; position: relative;
  background: linear-gradient(180deg, #d8d6ea, #fff 50%, #d8d6ea);
  box-shadow: inset 0 0 0 2px #b87400, inset 0 12px 14px rgba(0, 0, 0, .22), inset 0 -12px 14px rgba(0, 0, 0, .22);
}
.reel .strip { will-change: transform; }
.reel .sym { height: 64px; display: flex; align-items: center; justify-content: center; font-size: 40px; line-height: 1; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .2)); }
.reel .payline { position: absolute; left: 4px; right: 4px; top: 50%; height: 0; border-top: 2px dashed rgba(255, 56, 170, .55); pointer-events: none; }
.reel.hit { box-shadow: inset 0 0 0 3px var(--gold), 0 0 18px rgba(255, 210, 63, .6); }
.paytable { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 10px; font-size: 14px; }
.paytable .pay { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.paytable .pay b { color: var(--gold); }

/* mines */
.mines-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.mines-info { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 14px; font-weight: 800; min-height: 22px; }
.mines-info b { font-size: 18px; font-weight: 900; }
.mines-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: min(300px, 100%); }
.tile {
  aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; font-size: 22px; line-height: 1; color: #fff;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #2a2847, #1a1833); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .35), 0 2px 0 rgba(0, 0, 0, .3);
  transition: transform .1s, background .2s;
}
.tile:not(:disabled):active { transform: scale(.92); }
.tile:disabled { cursor: default; }
.tile.gem { background: linear-gradient(145deg, #1c7a58, #0e3d2c); border-color: var(--ok); box-shadow: 0 0 12px rgba(46, 229, 157, .35); }
.tile.mine { background: linear-gradient(145deg, #7a1e2e, #3a0a12); border-color: rgba(255, 79, 109, .6); }
.tile.mine.hit { box-shadow: 0 0 0 3px var(--bad), 0 0 22px var(--bad); }
.tile.dim { opacity: .55; }

/* crash */
.stage-crash { padding: 0; min-height: 250px; }
/* one cell larger than the stage and moved with a transform: streaming it costs no repaint */
.crash-grid { position: absolute; inset: -26px; z-index: -1; will-change: transform; background: repeating-linear-gradient(0deg, rgba(255, 56, 170, .10) 0 1px, transparent 1px 26px), repeating-linear-gradient(90deg, rgba(0, 229, 255, .08) 0 1px, transparent 1px 26px); }
.crash-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.crash-svg .line { fill: none; stroke: var(--cyan); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
/* the glow is a wide translucent stroke under the line — a drop-shadow filter would re-blur every frame */
.crash-svg .glow { fill: none; stroke: var(--cyan); stroke-opacity: .35; stroke-width: 9; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.crash-svg .area { fill: rgba(0, 229, 255, .12); }
.crash-svg.crashed .line, .crash-svg.crashed .glow { stroke: var(--bad); }
.crash-svg.crashed .area { fill: rgba(255, 79, 109, .12); }
.rocket { position: absolute; left: 0; top: 97%; font-size: 30px; line-height: 1; transform: translate(-50%, -50%); z-index: 2; pointer-events: none; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .35)); }
.crash-mult { position: absolute; top: 34px; left: 0; right: 0; text-align: center; font: 900 44px "Courier New", monospace; letter-spacing: -.02em; text-shadow: 3px 3px 0 rgba(0, 0, 0, .6); z-index: 2; }
.crash-mult.crashed { color: var(--bad); }
.crash-mult.won { color: var(--ok); }
.crash-mult.wait { color: var(--cyan); font-size: 36px; }
.crash-hist { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 2; display: flex; gap: 4px; overflow: hidden; }
.crash-hist .ltag { font-size: 11px; padding: 1px 6px; flex-shrink: 0; }
.ltag.gold { background: rgba(255, 210, 63, .2); color: var(--gold); }
.crash-timer { position: absolute; left: 14%; right: 14%; top: 92px; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; z-index: 2; }
.crash-timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--pink), var(--cyan)); transition: width .1s linear; }
.crash-players { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.crash-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.crash-row.me { border-color: rgba(255, 56, 170, .5); }
.crash-row .nm { flex: 1; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crash-row .st { font-weight: 900; }
.crash-row .st.win { color: var(--ok); }
.crash-row .st.lose { color: var(--bad); }
.crash-status { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 2; text-align: center; font-size: 13px; color: rgba(255, 255, 255, .75); padding: 0 16px; }
.stage-crash .luck-result { bottom: 36px; }

@media (max-height: 700px) {
  .card { --cw: 40px; }
  .card.lg { --cw: 50px; }
  .player-strip { padding: 4px var(--gutter); }
  .hand { padding-top: 16px; }
  .radar { width: 130px; height: 130px; }
}
@media (max-width: 360px) {
  :root { --gutter: 10px; }
  .poker-table { --sw: 78px; }
  .poker-table.n2, .poker-table.n3 { --sw: 92px; }
  .perks { grid-template-columns: 1fr; }
  .tab { font-size: 9.5px; }
}
/* ==================== cosmetics (the market) ==================== */
/* Skins are data attributes on <body> (or on a preview box) and plain CSS — no runtime cost.   */
/* Animated skins move only transforms and opacity (composited), never layout or big repaints.  */

/* ---- rarity colours ---- */
.r-common { --rc: #cfd3dc; }
.r-rare { --rc: var(--cyan); }
.r-epic { --rc: var(--accent-2); }
.r-legendary { --rc: var(--gold); }

@keyframes spinBack { to { transform: rotate(-360deg); } }
@keyframes flicker { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes blinkName { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes glitchJitter {
  0%, 89%, 100% { text-shadow: -1.5px 0 var(--pink), 1.5px 0 var(--cyan); transform: none; }
  90% { text-shadow: -3px 0 var(--pink), 3px 0 var(--cyan); transform: translateX(1px); }
  93% { text-shadow: 2px 0 var(--pink), -2px 0 var(--cyan); transform: translateX(-1px); }
  96% { text-shadow: -1px 1px var(--pink), 1px -1px var(--cyan); transform: none; }
}
@keyframes sheenX { from { transform: translateX(-40%); } to { transform: translateX(40%); } }

/* ---- avatar frames: two rings just inside the circle edge (.avatar clips its overflow) ---- */
.avatar.framed { --ring: radial-gradient(circle closest-side, transparent 76%, #000 78%); --ring-in: radial-gradient(circle closest-side, transparent 64%, #000 66%, #000 73%, transparent 75%); }
.avatar.framed::after,
.avatar.fr-pixel::before, .avatar.fr-matrix::before, .avatar.fr-gold::before, .avatar.fr-fire::before, .avatar.fr-ice::before,
.avatar.fr-lightning::before, .avatar.fr-space::before, .avatar.fr-glitch::before, .avatar.fr-royal::before, .avatar.fr-platinum::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; z-index: 2;
}
.avatar.fr-pixel::after { background: repeating-conic-gradient(from 0deg, #fff 0 12deg, #7c6bff 12deg 24deg); -webkit-mask: var(--ring); mask: var(--ring); animation: spin 9s steps(15) infinite; }
.avatar.fr-pixel::before { background: repeating-conic-gradient(from 6deg, var(--pink) 0 12deg, transparent 12deg 24deg); -webkit-mask: var(--ring-in); mask: var(--ring-in); animation: spinBack 9s steps(15) infinite; }
.avatar.fr-shadow::after { box-shadow: inset 0 0 0 3px #15151f, inset 0 0 14px 5px rgba(0, 0, 0, .95); }
.avatar.fr-candy::after { background: repeating-conic-gradient(#fff 0 20deg, #ff6bb5 20deg 40deg); -webkit-mask: var(--ring); mask: var(--ring); animation: spin 6s linear infinite; }
.avatar.fr-neon::after { box-shadow: inset 0 0 0 2px #00e5ff, inset 0 0 0 4px rgba(0, 229, 255, .25), inset 0 0 12px rgba(0, 229, 255, .95); }
.avatar.fr-pinkneon::after { box-shadow: inset 0 0 0 2px #ff38aa, inset 0 0 0 4px rgba(255, 56, 170, .25), inset 0 0 12px rgba(255, 56, 170, .95); }
.avatar.fr-matrix::after { background: repeating-conic-gradient(#2ee59d 0 8deg, transparent 8deg 16deg); -webkit-mask: var(--ring); mask: var(--ring); animation: spin 5s steps(22) infinite; }
.avatar.fr-matrix::before { box-shadow: inset 0 0 10px rgba(46, 229, 157, .85); }
.avatar.fr-gold::after { box-shadow: inset 0 0 0 2px #ffd23f, inset 0 0 0 4px #7a5a00, inset 0 0 0 6px #ffd23f; }
.avatar.fr-gold::before { background: conic-gradient(from 0deg, transparent 0 76%, rgba(255, 255, 255, .95) 86%, transparent 96%); -webkit-mask: var(--ring); mask: var(--ring); animation: spin 2.8s linear infinite; }
.avatar.fr-fire::after { background: conic-gradient(#ff3d00, #ffb300, #ff3d00, #ff6d00, #ff3d00, #ffb300, #ff3d00); -webkit-mask: var(--ring); mask: var(--ring); animation: spin 2.2s linear infinite; }
.avatar.fr-fire::before { background: conic-gradient(from 180deg, rgba(255, 220, 0, .95), transparent 25%, rgba(255, 120, 0, .95) 50%, transparent 75%, rgba(255, 220, 0, .95)); -webkit-mask: var(--ring-in); mask: var(--ring-in); animation: spinBack 1.6s linear infinite, flicker .9s ease-in-out infinite; }
.avatar.fr-ice::after { box-shadow: inset 0 0 0 3px #d8f4ff, inset 0 0 0 5px rgba(90, 184, 255, .6), inset 0 0 12px rgba(160, 220, 255, .95); }
.avatar.fr-ice::before { background: conic-gradient(from 0deg, transparent 0 70%, rgba(255, 255, 255, .95) 80%, transparent 90%); -webkit-mask: var(--ring); mask: var(--ring); animation: spin 4s linear infinite; }
.avatar.fr-lightning::after { background: repeating-conic-gradient(from 0deg, #fff 0 4deg, transparent 4deg 40deg, #00e5ff 40deg 46deg, transparent 46deg 90deg); -webkit-mask: var(--ring); mask: var(--ring); animation: spin 1.2s steps(6) infinite, flicker .35s steps(2) infinite; }
.avatar.fr-lightning::before { box-shadow: inset 0 0 10px rgba(0, 229, 255, .9); }
.avatar.fr-space::after, .avatar.fr-space::before {
  background:
    radial-gradient(circle at 20% 15%, #fff 0 1.2px, transparent 2px), radial-gradient(circle at 80% 30%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 60% 90%, #fff 0 1.2px, transparent 2px), radial-gradient(circle at 15% 70%, #9ad 0 1px, transparent 2px),
    radial-gradient(circle at 90% 75%, #fff 0 1px, transparent 2px), radial-gradient(circle at 45% 6%, #fff 0 1px, transparent 2px), #0a0530;
  -webkit-mask: var(--ring); mask: var(--ring);
}
.avatar.fr-space::before { background-color: transparent; animation: twinkle 1.8s ease-in-out infinite; transform: rotate(40deg); }
.avatar.fr-glitch::after { background: conic-gradient(#ff38aa, #00e5ff, #ff38aa, #00e5ff, #ff38aa); -webkit-mask: var(--ring); mask: var(--ring); animation: spin 1.6s steps(9) infinite; }
.avatar.fr-glitch::before { background: conic-gradient(from 90deg, #00e5ff, transparent 30%, #ff38aa 60%, transparent); -webkit-mask: var(--ring-in); mask: var(--ring-in); animation: spinBack 1.1s steps(7) infinite; }
.avatar.fr-rainbow::after { background: conic-gradient(#ff38aa, #ffd23f, #2ee59d, #00e5ff, #b35cff, #ff38aa); -webkit-mask: var(--ring); mask: var(--ring); animation: spin 3s linear infinite; }
.avatar.fr-royal::after { box-shadow: inset 0 0 0 2px #ffd23f, inset 0 0 0 4px #7a5a00, inset 0 0 0 6px #ffd23f, inset 0 0 10px rgba(255, 210, 63, .5); }
.avatar.fr-royal::before {
  background:
    radial-gradient(circle at 50% 8%, #ff3b5c 0 2.2px, transparent 3.4px), radial-gradient(circle at 92% 50%, #3b82f6 0 2.2px, transparent 3.4px),
    radial-gradient(circle at 50% 92%, #ff3b5c 0 2.2px, transparent 3.4px), radial-gradient(circle at 8% 50%, #3b82f6 0 2.2px, transparent 3.4px),
    conic-gradient(from 0deg, transparent 0 80%, rgba(255, 255, 255, .9) 88%, transparent 96%);
  -webkit-mask: var(--ring); mask: var(--ring); animation: spin 5s linear infinite;
}
.avatar.fr-champion::after { box-shadow: inset 0 0 0 3px #ffd23f, inset 0 0 0 5px var(--bg), inset 0 0 0 7px #ffd23f, inset 0 0 12px rgba(255, 210, 63, .7); }
.avatar.fr-champion::before { content: "👑"; position: absolute; top: -1px; left: 50%; transform: translateX(-50%); font-size: calc(var(--s, 40px) * .28); line-height: 1; z-index: 3; }
.avatar.fr-platinum::after { background: conic-gradient(#e8f6ff, #b8c9ff, #fff, #dbe9ff, #a8d8ff, #e8f6ff); -webkit-mask: var(--ring); mask: var(--ring); animation: spin 3.5s linear infinite; }
.avatar.fr-platinum::before { box-shadow: inset 0 0 14px rgba(255, 255, 255, .9); }

/* ---- name styles ---- */
.pname-text.ns-shadow { color: #0d0d14; text-shadow: 0 0 1px #fff, 0 0 2px #fff, 1px 1px 0 #fff, -1px -1px 0 #fff; font-weight: 900; }
.pname-text.ns-pink { color: #ff6bc0; text-shadow: 0 0 6px rgba(255, 56, 170, .7); }
.pname-text.ns-cyan { color: var(--cyan); text-shadow: 0 0 6px rgba(0, 229, 255, .6); }
.pname-text.ns-pixel { font-family: "Courier New", ui-monospace, monospace; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; text-shadow: 2px 2px 0 rgba(0, 0, 0, .7); }
.pname-text.ns-matrix { color: #2ee59d; font-family: "Courier New", ui-monospace, monospace; font-weight: 900; text-shadow: 0 0 6px rgba(46, 229, 157, .7); }
.pname-text.ns-blink { animation: blinkName 1s steps(2) infinite; }
.pname-text.ns-ice, .pname-text.ns-gold, .pname-text.ns-chrome, .pname-text.ns-fire, .pname-text.ns-rainbow, .pname-text.ns-royal {
  -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 900;
}
.pname-text.ns-ice { background-image: linear-gradient(90deg, #fff, #bfeaff, #5ab8ff); }
.pname-text.ns-gold { background-image: linear-gradient(90deg, #ffd23f, #fff1b8, #e0a500); }
.pname-text.ns-chrome { background-image: linear-gradient(180deg, #fff 0, #c9ced8 45%, #7d838f 52%, #e6e9f0 100%); }
.pname-text.ns-fire { background-image: linear-gradient(90deg, #ffd23f, #ff7a3d, #ff2d55, #ffd23f); background-size: 300% 100%; animation: nsShift 2.5s linear infinite; }
.pname-text.ns-rainbow { background-image: linear-gradient(90deg, #ff38aa, #ffd23f, #2ee59d, #00e5ff, #b35cff, #ff38aa); background-size: 300% 100%; animation: nsShift 6s linear infinite; }
@keyframes nsShift { to { background-position: 300% 0; } }
.pname-text.ns-glitch { color: #fff; text-shadow: -1.5px 0 var(--pink), 1.5px 0 var(--cyan); animation: glitchJitter 2.4s steps(1) infinite; }
.pname-text.ns-royal { background-image: linear-gradient(90deg, #ffd23f, #fff1b8, #e0a500, #ffd23f); background-size: 250% 100%; animation: nsShift 4s linear infinite; }
.pname-text.ns-royal::before { content: "👑 "; -webkit-text-fill-color: initial; color: initial; }

/* ---- titles ---- */
.ptitle {
  display: inline-block; padding: 1px 6px; border-radius: 6px; font: 800 9.5px/1.5 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; color: var(--rc, var(--muted));
  background: rgba(255, 255, 255, .06); border: 1px solid color-mix(in srgb, var(--rc, var(--muted)) 45%, transparent);
}
.ptitle.r-epic { background: rgba(179, 92, 255, .12); }
.ptitle.r-legendary {
  color: #ffe27a; box-shadow: 0 0 8px rgba(255, 210, 63, .35);
  background: linear-gradient(90deg, rgba(255, 210, 63, .12) 0 40%, rgba(255, 210, 63, .5) 50%, rgba(255, 210, 63, .12) 60% 100%);
  background-size: 220% 100%; animation: nsShift 2.6s linear infinite;
}

/* ---- card backs (each skin is a set of custom properties; .card.back reads them) ---- */
[data-back="red"] { --cb-bg: var(--logo-back) center / 70% auto no-repeat, repeating-linear-gradient(45deg, rgba(255, 255, 255, .12) 0 3px, transparent 3px 7px), linear-gradient(160deg, #d6203a, #7a0e1f); --cb-border: #f4f5f8; --cb-sheen: none; }
[data-back="blue"] { --cb-bg: var(--logo-back) center / 70% auto no-repeat, repeating-linear-gradient(45deg, rgba(255, 255, 255, .12) 0 3px, transparent 3px 7px), linear-gradient(160deg, #2a6ad6, #0f2f7a); --cb-border: #f4f5f8; --cb-sheen: none; }
[data-back="carbon"] { --cb-bg: var(--logo-back) center / 70% auto no-repeat, repeating-linear-gradient(45deg, rgba(255, 255, 255, .08) 0 2px, transparent 2px 6px), repeating-linear-gradient(-45deg, rgba(255, 255, 255, .08) 0 2px, transparent 2px 6px), linear-gradient(160deg, #2b2f38, #14161c); --cb-border: #9aa0ad; --cb-sheen: none; }
[data-back="pixel"] { --cb-bg: var(--logo-back) center / 70% auto no-repeat, conic-gradient(#3b2d7a 25%, #6a4fd8 0 50%, #3b2d7a 0 75%, #6a4fd8 0) 0 0 / 10px 10px; --cb-border: #f4f5f8; --cb-sheen: none; }
[data-back="neon"] { --cb-bg: var(--logo-back) center / 70% auto no-repeat, repeating-linear-gradient(0deg, rgba(0, 229, 255, .35) 0 1px, transparent 1px 8px), repeating-linear-gradient(90deg, rgba(0, 229, 255, .35) 0 1px, transparent 1px 8px), #0b0f22; --cb-border: var(--cyan); --cb-sheen: none; }
[data-back="ice"] { --cb-bg: var(--logo-back) center / 70% auto no-repeat, repeating-linear-gradient(60deg, rgba(255, 255, 255, .25) 0 1px, transparent 1px 11px), repeating-linear-gradient(-60deg, rgba(255, 255, 255, .25) 0 1px, transparent 1px 11px), linear-gradient(160deg, #bfeaff, #4a9be0); --cb-border: #fff; --cb-sheen: none; }
[data-back="matrix"] { --cb-bg: var(--logo-back) center / 70% auto no-repeat, repeating-linear-gradient(90deg, rgba(46, 229, 157, .35) 0 1px, transparent 1px 5px), repeating-linear-gradient(0deg, rgba(46, 229, 157, .18) 0 2px, transparent 2px 6px), #06140e; --cb-border: #2ee59d; --cb-sheen: none; }
[data-back="joker"] { --cb-bg: var(--logo-back) center / 70% auto no-repeat, repeating-linear-gradient(45deg, rgba(195, 255, 61, .35) 0 4px, transparent 4px 12px), repeating-linear-gradient(-45deg, rgba(195, 255, 61, .35) 0 4px, transparent 4px 12px), linear-gradient(160deg, #6a1fbf, #2a0a5a); --cb-border: #c3ff3d; --cb-sheen: none; }
[data-back="retro"] { --cb-bg: var(--logo-back) center / 92% auto no-repeat, repeating-linear-gradient(0deg, rgba(0, 0, 0, .35) 0 1px, transparent 1px 3px), linear-gradient(160deg, #1d1b3a, #0b0a1c); --cb-border: #f4f5f8; --cb-sheen: none; }
[data-back="gold"] { --cb-bg: var(--logo-back) center / 70% auto no-repeat, repeating-linear-gradient(45deg, rgba(255, 210, 63, .32) 0 4px, transparent 4px 10px), repeating-linear-gradient(-45deg, rgba(255, 210, 63, .32) 0 4px, transparent 4px 10px), linear-gradient(160deg, #7a5a00, #3a2a00); --cb-border: var(--gold); --cb-sheen: none; }
[data-back="lava"] { --cb-bg: var(--logo-back) center / 70% auto no-repeat, radial-gradient(circle at 25% 30%, rgba(255, 179, 0, .9) 0 8px, transparent 16px), radial-gradient(circle at 75% 65%, rgba(255, 61, 0, .9) 0 9px, transparent 18px), radial-gradient(circle at 55% 15%, rgba(255, 120, 0, .8) 0 5px, transparent 12px), linear-gradient(160deg, #3a0a00, #150300); --cb-border: #ffb03d; --cb-sheen: none; }
[data-back="rainbow"] { --cb-bg: var(--logo-back) center / 70% auto no-repeat, linear-gradient(160deg, #ff38aa, #ffd23f, #2ee59d, #00e5ff, #b35cff); --cb-border: #fff; --cb-sheen: none; }
[data-back="space"] { --cb-bg: var(--logo-back) center / 70% auto no-repeat, radial-gradient(circle at 20% 30%, #fff 0 1px, transparent 2px), radial-gradient(circle at 70% 60%, #fff 0 1px, transparent 2px), radial-gradient(circle at 40% 80%, #fff 0 1px, transparent 2px), radial-gradient(circle at 85% 20%, #fff 0 1px, transparent 2px), radial-gradient(circle at 60% 15%, #9ad 0 1px, transparent 2px), radial-gradient(ellipse at 50% 50%, #5a2bd6 0, #0a0530 70%); --cb-border: #cbd7ff; --cb-sheen: none; }
[data-back="royal"] { --cb-bg: var(--logo-back) center / 70% auto no-repeat, repeating-linear-gradient(45deg, rgba(255, 210, 63, .22) 0 3px, transparent 3px 9px), radial-gradient(ellipse at 50% 40%, #8a1030, #3a0414 75%); --cb-border: var(--gold); --cb-sheen: block; }

/* ---- table cloth ---- */
[data-felt="blue"] { --felt: #174a7a; --felt-2: #0c2a4a; --felt-bg: radial-gradient(ellipse at center, var(--felt), var(--felt-2)); --felt-border: #3a2616; --felt-shadow: inset 0 0 30px rgba(0, 0, 0, .45); }
[data-felt="red"] { --felt: #7a1a2a; --felt-2: #45101a; --felt-bg: radial-gradient(ellipse at center, var(--felt), var(--felt-2)); --felt-border: #3a2616; --felt-shadow: inset 0 0 30px rgba(0, 0, 0, .45); }
[data-felt="wood"] { --felt: #7a4a22; --felt-2: #3a2010; --felt-bg: repeating-linear-gradient(90deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 14px), radial-gradient(ellipse at center, var(--felt), var(--felt-2)); --felt-border: #3a2616; --felt-shadow: inset 0 0 30px rgba(0, 0, 0, .45); }
[data-felt="carbon"] { --felt: #2b2f38; --felt-2: #14161c; --felt-bg: repeating-linear-gradient(45deg, rgba(255, 255, 255, .06) 0 2px, transparent 2px 6px), repeating-linear-gradient(-45deg, rgba(255, 255, 255, .06) 0 2px, transparent 2px 6px), radial-gradient(ellipse at center, var(--felt), var(--felt-2)); --felt-border: #3a2616; --felt-shadow: inset 0 0 30px rgba(0, 0, 0, .45); }
[data-felt="black"] { --felt: #2a2a34; --felt-2: #121218; --felt-bg: radial-gradient(ellipse at center, var(--felt), var(--felt-2)); --felt-border: #3a2616; --felt-shadow: inset 0 0 30px rgba(0, 0, 0, .45); }
[data-felt="ice"] { --felt: #3a86c8; --felt-2: #1f4a7a; --felt-bg: radial-gradient(ellipse at center, var(--felt), var(--felt-2)); --felt-border: #d8f4ff; --felt-shadow: inset 0 0 30px rgba(0, 0, 0, .45); }
[data-felt="matrix"] { --felt: #0f3a2a; --felt-2: #07211a; --felt-bg: repeating-linear-gradient(0deg, rgba(46, 229, 157, .14) 0 1px, transparent 1px 22px), repeating-linear-gradient(90deg, rgba(46, 229, 157, .14) 0 1px, transparent 1px 22px), radial-gradient(ellipse at center, var(--felt), var(--felt-2)); --felt-border: #1f5a3f; --felt-shadow: inset 0 0 30px rgba(0, 0, 0, .45); }
[data-felt="purple"] { --felt: #4a1a7a; --felt-2: #24103f; --felt-bg: radial-gradient(ellipse at center, var(--felt), var(--felt-2)); --felt-border: #3a2616; --felt-shadow: inset 0 0 30px rgba(0, 0, 0, .45), 0 0 0 2px rgba(0, 229, 255, .45), 0 0 26px rgba(0, 229, 255, .28); }
[data-felt="lava"] { --felt: #2a0a00; --felt-2: #100300; --felt-bg: radial-gradient(circle at 20% 30%, rgba(255, 120, 0, .55) 0 30px, transparent 90px), radial-gradient(circle at 80% 70%, rgba(255, 40, 0, .5) 0 40px, transparent 110px), radial-gradient(circle at 60% 20%, rgba(255, 179, 0, .35) 0 20px, transparent 70px), radial-gradient(ellipse at center, var(--felt), var(--felt-2)); --felt-border: #5a1a00; --felt-shadow: inset 0 0 30px rgba(0, 0, 0, .45); }
[data-felt="space"] { --felt: #141a3a; --felt-2: #05071a; --felt-bg: radial-gradient(circle at 15% 25%, #fff 0 1px, transparent 2px), radial-gradient(circle at 70% 15%, #fff 0 1.2px, transparent 2.4px), radial-gradient(circle at 85% 65%, #fff 0 1px, transparent 2px), radial-gradient(circle at 35% 80%, #9ad 0 1px, transparent 2px), radial-gradient(circle at 55% 50%, #fff 0 1px, transparent 2px), radial-gradient(circle at 25% 55%, #fff 0 .8px, transparent 1.8px), radial-gradient(ellipse at center, var(--felt), var(--felt-2)); --felt-border: #2a2f5a; --felt-shadow: inset 0 0 30px rgba(0, 0, 0, .45); }
[data-felt="gold"] { --felt: #1e1a10; --felt-2: #0a0906; --felt-bg: radial-gradient(ellipse at center, var(--felt), var(--felt-2)); --felt-border: #8a6a10; --felt-shadow: inset 0 0 30px rgba(0, 0, 0, .55), 0 0 0 2px rgba(255, 210, 63, .35), 0 0 22px rgba(255, 210, 63, .18); }
[data-felt="royal"] { --felt: #7a1030; --felt-2: #3a0414; --felt-bg: radial-gradient(ellipse at center, var(--felt), var(--felt-2)); --felt-border: #c9a227; --felt-shadow: inset 0 0 0 3px rgba(255, 210, 63, .35), inset 0 0 30px rgba(0, 0, 0, .55), 0 0 0 2px rgba(255, 210, 63, .3); }

/* ---- pieces, discs and checkers (fixed colours: the two sides stay apart under any theme) ---- */
[data-pieces="shadow"] { --pw-color: #cfd3dc; --pw-shadow: 0 0 1px #000, 0 0 2px #000; --pb-color: #3a3f4a; --pb-shadow: 0 0 1px rgba(255, 255, 255, .5); --dw-bg: radial-gradient(circle at 35% 30%, #d0d3da, #9a9ea8 60%, #6b6f78); --dw-shadow: 0 3px 0 #55595f, 0 4px 6px rgba(0, 0, 0, .5); --db-bg: radial-gradient(circle at 35% 30%, #5a5f6a, #2a2e36 60%, #14161b); --db-shadow: 0 3px 0 #0a0b0e, 0 4px 6px rgba(0, 0, 0, .5); }
[data-pieces="candy"] { --pw-color: #ff8ad0; --pw-shadow: 0 0 1px #6b0040, 1px 1px 0 #6b0040; --pb-color: #7dffd6; --pb-shadow: 0 0 1px #005a3f, 1px 1px 0 #005a3f; --dw-bg: radial-gradient(circle at 35% 30%, #ffd6ec, #ff6bb5 60%, #b3236f); --dw-shadow: 0 3px 0 #7a1050, 0 4px 6px rgba(0, 0, 0, .5); --db-bg: radial-gradient(circle at 35% 30%, #d8fff2, #5fe0b8 60%, #1f8a6a); --db-shadow: 0 3px 0 #0f5a45, 0 4px 6px rgba(0, 0, 0, .5); }
[data-pieces="neon"] { --pw-color: #00e5ff; --pw-shadow: 0 0 7px #00e5ff, 0 0 1px #000; --pb-color: #ff38aa; --pb-shadow: 0 0 7px #ff38aa, 0 0 1px #000; --dw-bg: radial-gradient(circle at 35% 30%, #a5f6ff, #00b8d4 60%, #006b7d); --dw-shadow: 0 0 8px #00e5ff, 0 3px 0 #004a58; --db-bg: radial-gradient(circle at 35% 30%, #ff8ad0, #ff38aa 60%, #8a1a5c); --db-shadow: 0 0 8px #ff38aa, 0 3px 0 #5c0f3d; }
[data-pieces="matrix"] { --pw-color: #7dff5a; --pw-shadow: 0 0 7px #2ee59d, 0 0 1px #000; --pb-color: #0f3a2a; --pb-shadow: 0 0 1px #7dff5a, 0 0 3px #2ee59d; --dw-bg: radial-gradient(circle at 35% 30%, #c8ffb0, #2ee59d 60%, #0f6a45); --dw-shadow: 0 0 8px #2ee59d, 0 3px 0 #0a4a30; --db-bg: radial-gradient(circle at 35% 30%, #1f5a3f, #0f3a2a 60%, #06140e); --db-shadow: 0 0 6px rgba(46, 229, 157, .6), 0 3px 0 #041a10; }
[data-pieces="gold"] { --pw-color: #ffd23f; --pw-shadow: 0 0 1px #6b4a00, 1px 1px 0 #7a5a00, -1px -1px 0 #7a5a00; --pb-color: #e6e9f0; --pb-shadow: 0 0 1px #333, 1px 1px 0 #666, -1px -1px 0 #666; --dw-bg: radial-gradient(circle at 35% 30%, #fff1b8, #ffd23f 55%, #a67c00); --dw-shadow: 0 3px 0 #6b4a00, 0 4px 6px rgba(0, 0, 0, .5); --db-bg: radial-gradient(circle at 35% 30%, #fff, #c9ced8 55%, #7d838f); --db-shadow: 0 3px 0 #4a4f5a, 0 4px 6px rgba(0, 0, 0, .5); }
[data-pieces="icefire"] { --pw-color: #d8f4ff; --pw-shadow: 0 0 8px #5ab8ff, 0 0 1px #003; --pb-color: #ff7a3d; --pb-shadow: 0 0 8px #ff3d00, 0 0 1px #300; --dw-bg: radial-gradient(circle at 35% 30%, #fff, #9fdcff 55%, #3a86c8); --dw-shadow: 0 0 8px #5ab8ff, 0 3px 0 #1f5a8a; --db-bg: radial-gradient(circle at 35% 30%, #ffd08a, #ff6d00 55%, #8a1a00); --db-shadow: 0 0 8px #ff3d00, 0 3px 0 #5c1000; }
[data-pieces="ghost"] { --pw-color: rgba(255, 255, 255, .75); --pw-shadow: 0 0 10px #fff, 0 0 2px #fff; --pb-color: rgba(179, 92, 255, .8); --pb-shadow: 0 0 10px #b35cff, 0 0 2px #b35cff; --dw-bg: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .9), rgba(255, 255, 255, .45) 60%, rgba(255, 255, 255, .2)); --dw-shadow: 0 0 10px #fff; --db-bg: radial-gradient(circle at 35% 30%, rgba(200, 150, 255, .9), rgba(179, 92, 255, .5) 60%, rgba(179, 92, 255, .25)); --db-shadow: 0 0 10px #b35cff; }
[data-pieces="royal"] { --pw-color: #ffd23f; --pw-shadow: 0 0 6px rgba(255, 210, 63, .8), 1px 1px 0 #7a5a00, -1px -1px 0 #7a5a00; --pb-color: #ff3b5c; --pb-shadow: 0 0 6px rgba(255, 59, 92, .8), 1px 1px 0 #5a0010, -1px -1px 0 #5a0010; --dw-bg: radial-gradient(circle at 35% 30%, #fff1b8, #ffd23f 55%, #a67c00); --dw-shadow: 0 0 8px rgba(255, 210, 63, .7), 0 3px 0 #6b4a00; --db-bg: radial-gradient(circle at 35% 30%, #ffb3c0, #ff3b5c 55%, #8a0020); --db-shadow: 0 0 8px rgba(255, 59, 92, .7), 0 3px 0 #5a0010; }

/* ---- boards (chess and checkers squares, backgammon points) ---- */
[data-board="wood"] { --sq-light: #c9a26e; --sq-dark: #6b3f22; --coord-light: #6b3f22; --coord-dark: #c9a26e; --nardy-bg: linear-gradient(160deg, #4a2c14, #24140a); --nardy-border: #2a1608; --tri: #8a5a2a; --tri-odd: #c9a26e; --board-shadow: 0 6px 20px rgba(0, 0, 0, .45); --nardy-shadow: inset 0 0 30px rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .45); }
[data-board="candy"] { --sq-light: #fff0f7; --sq-dark: #ff8ad0; --coord-light: #ff38aa; --coord-dark: #fff0f7; --nardy-bg: linear-gradient(160deg, #ff8ad0, #b3236f); --nardy-border: #7a1050; --tri: #7dffd6; --tri-odd: #fff0f7; --board-shadow: 0 6px 20px rgba(0, 0, 0, .45); --nardy-shadow: inset 0 0 30px rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .45); }
[data-board="carbon"] { --sq-light: #3a3f4a; --sq-dark: #1a1d24; --coord-light: #9aa0ad; --coord-dark: #9aa0ad; --nardy-bg: linear-gradient(160deg, #2b2f38, #14161c); --nardy-border: #4a4f5a; --tri: #3a3f4a; --tri-odd: #9aa0ad; --board-shadow: 0 0 0 2px #4a4f5a, 0 6px 20px rgba(0, 0, 0, .45); --nardy-shadow: inset 0 0 30px rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .45); }
[data-board="neon"] { --sq-light: #1c2340; --sq-dark: #0d1226; --coord-light: var(--cyan); --coord-dark: var(--cyan); --nardy-bg: linear-gradient(160deg, #141b38, #0a0d1f); --nardy-border: #1c2340; --tri: #24306a; --tri-odd: #0e8aa0; --board-shadow: 0 0 0 2px rgba(0, 229, 255, .5), 0 0 24px rgba(0, 229, 255, .25); --nardy-shadow: inset 0 0 30px rgba(0, 0, 0, .45), 0 0 0 2px rgba(0, 229, 255, .45); }
[data-board="ice"] { --sq-light: #e6f4ff; --sq-dark: #7fb3d9; --coord-light: #5a8ab0; --coord-dark: #e6f4ff; --nardy-bg: linear-gradient(160deg, #4a7aa8, #2a4a6a); --nardy-border: #1f3a55; --tri: #9ec9e8; --tri-odd: #e6f4ff; --board-shadow: 0 6px 20px rgba(0, 0, 0, .45); --nardy-shadow: inset 0 0 30px rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .45); }
[data-board="matrix"] { --sq-light: #10402c; --sq-dark: #061a11; --coord-light: #2ee59d; --coord-dark: #2ee59d; --nardy-bg: linear-gradient(160deg, #0f3a2a, #06140e); --nardy-border: #1f5a3f; --tri: #10402c; --tri-odd: #2ee59d; --board-shadow: 0 0 0 2px rgba(46, 229, 157, .5), 0 0 22px rgba(46, 229, 157, .2); --nardy-shadow: inset 0 0 30px rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .45); }
[data-board="marble"] { --sq-light: linear-gradient(135deg, #f7f4ee, #e6e1d6); --sq-dark: linear-gradient(135deg, #a5a5a5, #7c7c7c); --coord-light: #7c7c7c; --coord-dark: #f7f4ee; --nardy-bg: linear-gradient(160deg, #6a6a6a, #3d3d3d); --nardy-border: #2a2a2a; --tri: #cfc9be; --tri-odd: #f7f4ee; --board-shadow: 0 6px 20px rgba(0, 0, 0, .45); --nardy-shadow: inset 0 0 30px rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .45); }
[data-board="lava"] { --sq-light: linear-gradient(135deg, #ff7a3d, #c8300f); --sq-dark: #1a0600; --coord-light: #3a0a00; --coord-dark: #ff7a3d; --nardy-bg: linear-gradient(160deg, #3a0a00, #150300); --nardy-border: #5a1a00; --tri: #c8300f; --tri-odd: #ffb03d; --board-shadow: 0 0 0 2px rgba(255, 122, 61, .5), 0 0 22px rgba(255, 61, 0, .3); --nardy-shadow: inset 0 0 30px rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .45); }
[data-board="space"] { --sq-light: #1c2340; --sq-dark: radial-gradient(circle at 30% 30%, #fff 0 .8px, transparent 1.6px), radial-gradient(circle at 70% 65%, #fff 0 .8px, transparent 1.6px), #070a1c; --coord-light: #9ad; --coord-dark: #9ad; --nardy-bg: linear-gradient(160deg, #141a3a, #05071a); --nardy-border: #2a2f5a; --tri: #24306a; --tri-odd: #7c6bff; --board-shadow: 0 0 0 2px #2a2f5a, 0 0 22px rgba(124, 107, 255, .3); --nardy-shadow: inset 0 0 30px rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .45); }
[data-board="gold"] { --sq-light: #3a3020; --sq-dark: #151208; --coord-light: var(--gold); --coord-dark: var(--gold); --nardy-bg: linear-gradient(160deg, #2a2214, #0f0c06); --nardy-border: #8a6a10; --tri: #3a3020; --tri-odd: #8a6a10; --board-shadow: 0 0 0 2px rgba(255, 210, 63, .55), 0 0 22px rgba(255, 210, 63, .2); --nardy-shadow: inset 0 0 30px rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .45); }

/* ---- dice (the big luck dice and the small backgammon dice) ---- */
[data-dice="black"] { --die-bg: linear-gradient(145deg, #3a3a48, #15151f); --die-shadow: inset 0 -6px 0 rgba(0, 0, 0, .45), inset 0 2px 0 rgba(255, 255, 255, .12), 0 12px 26px rgba(0, 0, 0, .5); --die-mini-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3), 0 4px 10px rgba(0, 0, 0, .5); --pip-bg: radial-gradient(circle at 35% 35%, #fff, #b5b5c5); --pip-shadow: inset 0 -1px 2px rgba(0, 0, 0, .35); --pip-radius: 50%; --die-radius: 18px; --die-mini-radius: 8px; }
[data-dice="pixel"] { --die-bg: #f4f5f8; --die-shadow: inset -4px -4px 0 #b8bcc8, inset 4px 4px 0 #fff, 0 12px 26px rgba(0, 0, 0, .5); --die-mini-shadow: inset -2px -2px 0 #b8bcc8, inset 2px 2px 0 #fff, 0 4px 10px rgba(0, 0, 0, .5); --pip-bg: #14122a; --pip-shadow: none; --pip-radius: 0; --die-radius: 6px; --die-mini-radius: 3px; }
[data-dice="ice"] { --die-bg: linear-gradient(145deg, rgba(220, 245, 255, .95), rgba(120, 190, 240, .95)); --die-shadow: inset 0 -6px 0 rgba(0, 60, 120, .25), inset 0 2px 0 #fff, 0 0 16px rgba(160, 220, 255, .5), 0 12px 26px rgba(0, 0, 0, .5); --die-mini-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3), 0 4px 10px rgba(0, 0, 0, .5); --pip-bg: radial-gradient(circle at 35% 35%, #1f5a8a, #0a2a4a); --pip-shadow: inset 0 -1px 2px rgba(0, 0, 0, .35); --pip-radius: 50%; --die-radius: 18px; --die-mini-radius: 8px; }
[data-dice="neon"] { --die-bg: linear-gradient(145deg, #121833, #080b1c); --die-shadow: inset 0 0 0 2px var(--cyan), inset 0 -6px 0 rgba(0, 0, 0, .45), 0 0 16px rgba(0, 229, 255, .4); --die-mini-shadow: inset 0 0 0 1.5px var(--cyan), 0 0 10px rgba(0, 229, 255, .4); --pip-bg: radial-gradient(circle at 35% 35%, #fff, var(--cyan)); --pip-shadow: 0 0 6px var(--cyan); --pip-radius: 50%; --die-radius: 18px; --die-mini-radius: 8px; }
[data-dice="gold"] { --die-bg: linear-gradient(145deg, #ffe58a, #d4a300); --die-shadow: inset 0 -6px 0 rgba(0, 0, 0, .2), inset 0 2px 0 #fff6c2, 0 12px 26px rgba(0, 0, 0, .5); --die-mini-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3), 0 4px 10px rgba(0, 0, 0, .5); --pip-bg: radial-gradient(circle at 35% 35%, #4a3a00, #1a1200); --pip-shadow: inset 0 -1px 2px rgba(0, 0, 0, .35); --pip-radius: 50%; --die-radius: 18px; --die-mini-radius: 8px; }
[data-dice="emerald"] { --die-bg: linear-gradient(145deg, rgba(90, 230, 160, .9), rgba(10, 110, 70, .95)); --die-shadow: inset 0 -6px 0 rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .4), 0 0 16px rgba(46, 229, 157, .45), 0 12px 26px rgba(0, 0, 0, .5); --die-mini-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3), 0 4px 10px rgba(0, 0, 0, .5); --pip-bg: radial-gradient(circle at 35% 35%, #fff, #d8ffec); --pip-shadow: inset 0 -1px 2px rgba(0, 0, 0, .35); --pip-radius: 50%; --die-radius: 18px; --die-mini-radius: 8px; }
[data-dice="ruby"] { --die-bg: linear-gradient(145deg, rgba(255, 70, 100, .9), rgba(120, 0, 30, .95)); --die-shadow: inset 0 -6px 0 rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .4), 0 0 18px rgba(255, 60, 90, .45), 0 12px 26px rgba(0, 0, 0, .5); --die-mini-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3), 0 4px 10px rgba(0, 0, 0, .5); --pip-bg: radial-gradient(circle at 35% 35%, #fff, #ffd0d8); --pip-shadow: inset 0 -1px 2px rgba(0, 0, 0, .35); --pip-radius: 50%; --die-radius: 18px; --die-mini-radius: 8px; }
[data-dice="space"] { --die-bg: radial-gradient(circle at 20% 20%, #fff 0 1px, transparent 2px), radial-gradient(circle at 80% 30%, #fff 0 .8px, transparent 1.6px), radial-gradient(circle at 60% 85%, #fff 0 .8px, transparent 1.6px), linear-gradient(145deg, #1a2050, #05071a); --die-shadow: inset 0 0 0 2px #2a2f5a, inset 0 -6px 0 rgba(0, 0, 0, .4), 0 0 18px rgba(124, 107, 255, .45), 0 12px 26px rgba(0, 0, 0, .5); --die-mini-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3), 0 4px 10px rgba(0, 0, 0, .5); --pip-bg: radial-gradient(circle at 35% 35%, #fff, #7c6bff); --pip-shadow: 0 0 6px #7c6bff, 0 0 12px #00e5ff; --pip-radius: 50%; --die-radius: 18px; --die-mini-radius: 8px; }

/* ---- app themes (accent colours; the layout stays the same) ---- */
[data-theme="night"] { --accent: #6b7fb3; --accent-2: #8fa3d6; --pink: #a3b3e6; --cyan: #cdd8ff; --surface: #141826; --surface-2: #1b2033; --surface-3: #242b42; --line: #2f3752; --muted: #8b95b8; }
[data-theme="lavender"] { --accent: #b39cff; --accent-2: #d3b3ff; --pink: #e6a3ff; --cyan: #d9cfff; --surface: #1a1530; --surface-2: #231d40; --surface-3: #2e2754; --line: #3e3568; --muted: #a596d0; }
[data-theme="ocean"] { --accent: #1fbfb0; --accent-2: #2ee5c4; --pink: #5ad8ff; --cyan: #b8fff2; --surface: #0f2027; --surface-2: #142a33; --surface-3: #1b3843; --line: #234a56; --muted: #7fb3b0; }
[data-theme="vapor"] { --accent: #ff71ce; --accent-2: #b967ff; --pink: #01cdfe; --cyan: #05ffa1; --gold: #fffb96; --surface: #1c1233; --surface-2: #26184a; --surface-3: #33205f; --line: #452b7a; --muted: #b58fd6; }
[data-theme="matrix"] { --accent: #2ee59d; --accent-2: #1fbf6f; --pink: #7dff5a; --cyan: #2ee59d; --gold: #d6ff3f; --bg-2: #0c1a12; --surface: #0f1d16; --surface-2: #142a1e; --surface-3: #1b3a29; --line: #1f4a33; --muted: #7fb59a; }
[data-theme="sunset"] { --accent: #ff7a3d; --accent-2: #ff3d7a; --pink: #ffb03d; --cyan: #ff7a3d; --surface: #241418; --surface-2: #30181d; --surface-3: #3d1f26; --line: #4a2630; --muted: #c08a8a; }
[data-theme="ice"] { --accent: #5ab8ff; --accent-2: #8fd8ff; --pink: #bfeaff; --cyan: #fff; --surface: #10182a; --surface-2: #152036; --surface-3: #1c2a47; --line: #26385c; --muted: #8fa8d0; }
[data-theme="acid"] { --accent: #c3ff3d; --accent-2: #b35cff; --pink: #c3ff3d; --cyan: #e0ff7a; --surface: #141a12; --surface-2: #1c2418; --surface-3: #26301f; --line: #33402a; --muted: #9fb58a; }
[data-theme="blood"] { --accent: #ff2d55; --accent-2: #b3001b; --pink: #ff4f6d; --cyan: #ffb3c0; --gold: #ffd23f; --surface: #1c0a0e; --surface-2: #260d13; --surface-3: #33121a; --line: #4a1a24; --muted: #c08a94; }
[data-theme="gold"] { --accent: #ffd23f; --accent-2: #f0a500; --pink: #ffd23f; --cyan: #fff1b8; --surface: #171512; --surface-2: #211d15; --surface-3: #2e281c; --line: #3d3524; --muted: #b3a27a; }
body[data-theme] { background: radial-gradient(120% 60% at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), radial-gradient(80% 50% at 100% 110%, color-mix(in srgb, var(--pink) 10%, transparent), transparent 60%), var(--bg); }

/* ---- the market page ---- */
.quick-row.four { grid-template-columns: repeat(4, 1fr); }
.quick-row.four .quick { font-size: 12px; padding: 9px 4px; }
.lobby-hero[data-market] { --g1: #5a1a7a; --g2: #200a30; --gl: rgba(255, 56, 170, .55); }
.mk-cats { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.mk-cats::-webkit-scrollbar { display: none; }
.mk-cat { flex-shrink: 0; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 800; font-size: 13px; color: var(--muted); white-space: nowrap; cursor: pointer; transition: color .15s, border-color .15s; }
.mk-cat.active { color: var(--text); border-color: var(--pink); background: rgba(255, 56, 170, .12); }
.mk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.mk-item {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 16px; background: var(--surface); border: 2px solid var(--line);
  cursor: pointer; display: flex; flex-direction: column; transition: transform .12s, border-color .2s, box-shadow .2s;
}
.mk-item:active { transform: scale(.97); }
.mk-item.r-rare { border-color: rgba(0, 229, 255, .35); }
.mk-item.r-epic { border-color: rgba(179, 92, 255, .5); }
.mk-item.r-legendary { border-color: rgba(255, 210, 63, .6); box-shadow: 0 0 18px rgba(255, 210, 63, .15); }
.mk-item.on { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(46, 229, 157, .25); }
.mk-prev { height: 104px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; background: linear-gradient(160deg, var(--surface-2), var(--surface)); }
.mk-prev::before { content: ""; position: absolute; inset: 0; background: var(--logo-dark) center / 46% auto no-repeat; opacity: .05; image-rendering: pixelated; pointer-events: none; }
.mk-prev > * { position: relative; }
.mk-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; }
.mk-title { font-weight: 800; font-size: 13px; line-height: 1.2; }
.mk-rar { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--rc, var(--muted)); }
.mk-rar.big { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent); background: color-mix(in srgb, var(--rc) 12%, transparent); }
.mk-price { display: flex; align-items: center; gap: 5px; font-weight: 900; color: var(--gold); font-size: 13px; margin-top: 2px; }
.mk-price .coin { width: 14px; height: 14px; }
.mk-price.have { color: var(--ok); }
.mk-price.lock { color: var(--muted); font-weight: 700; font-size: 11px; }
.mk-badge { position: absolute; top: 6px; left: 6px; z-index: 2; font-size: 9.5px; font-weight: 900; letter-spacing: .06em; padding: 2px 6px; border-radius: 999px; background: var(--pink); color: #fff; }
.mk-badge.on { background: var(--ok); color: #05301c; }
.mk-badge.season { background: var(--warn); color: #3a2500; }
.mk-stage { height: 200px; border-radius: 16px; background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.mk-stage::before { content: ""; position: absolute; inset: 0; background: var(--logo-dark) center / 40% auto no-repeat; opacity: .05; image-rendering: pixelated; pointer-events: none; }
.mk-stage > * { position: relative; }
.mk-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: rgba(255, 255, 255, .06); border: 1px solid color-mix(in srgb, var(--rc, var(--muted)) 45%, transparent); color: var(--rc, var(--text)); }
.btn.active { border-color: var(--pink); color: var(--pink); }

/* previews */
.mk-name { font-size: 16px; font-weight: 800; max-width: 100%; padding: 0 8px; }
.mk-name .pname { flex-wrap: wrap; justify-content: center; }
.mk-fan { position: relative; width: 110px; height: 84px; }
.mk-fan .card { --cw: 46px; position: absolute; left: 50%; top: 50%; transform-origin: 50% 120%; }
.mk-fan .card.l { transform: translate(-50%, -50%) rotate(-18deg) translateX(-14px); }
.mk-fan .card.m { transform: translate(-50%, -50%) rotate(0); }
.mk-fan .card.r { transform: translate(-50%, -50%) rotate(18deg) translateX(14px); }
.mk-fan.big { width: 220px; height: 150px; }
.mk-fan.big .card { --cw: 78px; }
.mk-felt-wrap { width: 150px; }
.mk-felt-wrap.big { width: 260px; }
.mk-felt { height: 84px; display: flex; align-items: center; justify-content: center; border-width: 4px; }
.mk-felt-wrap.big .mk-felt { height: 150px; }
.mk-felt-cards { display: flex; gap: 6px; }
.mk-felt-wrap.big .mk-felt-cards .card { --cw: 52px; }
.mk-board-wrap { width: 120px; }
.mk-board-wrap.big { width: 240px; }
.mk-board { --sq: 30px; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); aspect-ratio: 2; }
.mk-board-wrap.big .mk-board { --sq: 60px; }
.mk-board::after { display: none; }
.mk-board .sq { display: flex; align-items: center; justify-content: center; position: relative; }
.mk-board .disc { width: 74%; height: 74%; }
.mk-dice { display: flex; gap: 10px; }
.mk-dice .die.mini { width: 44px; height: 44px; border-radius: 10px; padding: 6px; }
.mk-dice.big .die.mini { width: 80px; height: 80px; border-radius: 16px; padding: 11px; gap: 4px; }
.mk-rocket { position: relative; width: 130px; height: 80px; }
.mk-rocket.big { width: 260px; height: 150px; }
.mk-rocket .mk-trail { position: absolute; left: 6%; bottom: 18%; width: 80%; height: 6px; border-radius: 6px; transform: rotate(-24deg); transform-origin: left center; background: linear-gradient(90deg, var(--t1), var(--t2), var(--t3)); box-shadow: 0 0 10px var(--t2); }
.mk-rocket.big .mk-trail { height: 10px; }
.mk-rocket span { position: absolute; right: 8%; top: 12%; font-size: 30px; line-height: 1; filter: drop-shadow(0 0 8px var(--t3)); transform: rotate(-20deg); }
.mk-rocket.big span { font-size: 56px; }
.mk-win { font-size: 44px; line-height: 1; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .35)); }
.mk-stage .mk-win { font-size: 84px; }
.mk-theme { width: 140px; padding: 8px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.mk-theme.big { width: 260px; padding: 12px; gap: 10px; }
.mk-theme-bar { display: flex; align-items: center; gap: 6px; }
.mk-theme-bar i { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); }
.mk-theme-bar b { font: 900 11px "Courier New", monospace; letter-spacing: .15em; color: var(--pink); }
.mk-theme-row { display: flex; align-items: center; gap: 6px; }
.mk-theme .btn.sm { padding: 5px 9px; font-size: 11px; pointer-events: none; }
.mk-theme .balance { padding: 3px 8px 3px 5px; font-size: 11px; }
.mk-theme .balance .coin { width: 12px; height: 12px; }
.mk-dot { width: 12px; height: 12px; border-radius: 3px; }
.mk-dot.pink { background: var(--pink); }
.mk-dot.cyan { background: var(--cyan); }
.fx-coin { border-radius: 50% !important; }

/* ---- market extras: animated legendary borders, the "animated" mark ---- */
@property --mka { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes mkSpin { to { --mka: 360deg; } }
.mk-item.r-legendary {
  border-color: transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--mka), rgba(255, 210, 63, .15) 0 55%, #ffd23f 70%, #fff1b8 76%, rgba(255, 210, 63, .15) 90%) border-box;
  animation: mkSpin 4s linear infinite;
}
.mk-item.r-epic { background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(160deg, rgba(179, 92, 255, .7), rgba(179, 92, 255, .15)) border-box; border-color: transparent; }
.mk-stage.r-legendary::after { content: ""; position: absolute; inset: -60%; background: conic-gradient(from 0deg, transparent 0 70%, rgba(255, 210, 63, .18) 85%, transparent); animation: spin 6s linear infinite; pointer-events: none; }
.mk-anim { position: absolute; top: 6px; right: 8px; z-index: 2; color: var(--gold); font-size: 13px; text-shadow: 0 0 6px rgba(255, 210, 63, .8); animation: twinkle 1.6s ease-in-out infinite; }
.fx-glyph { font-size: 20px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.fx-matrix { color: #2ee59d; font: 900 15px/18px "Courier New", ui-monospace, monospace; white-space: pre; text-shadow: 0 0 6px rgba(46, 229, 157, .8); }

/* ---- banned ---- */
.banned-screen {
  position: relative; isolation: isolate; overflow: hidden; margin: 12vh var(--gutter) 0; padding: 28px 20px; border-radius: 22px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px; background: linear-gradient(160deg, #3a0a14, #14060a);
  border: 2px solid var(--bad); box-shadow: 0 0 0 3px rgba(255, 79, 109, .2), 0 0 40px rgba(255, 79, 109, .25);
}
.banned-icon { font-size: 64px; line-height: 1; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .4)); animation: float 3.2s ease-in-out infinite; }
.banned-text { color: rgba(255, 255, 255, .8); font-size: 14px; }
.banned-reason { padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 79, 109, .4); font-size: 14px; }

/* ---- trophies ---- */
.tro-badge {
  --s: 44px; width: var(--s); height: var(--s); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0; font-size: calc(var(--s) * .48); line-height: 1; background: var(--surface-3);
  box-shadow: inset 0 0 0 3px var(--tc, #8f8cb0), 0 3px 8px rgba(0, 0, 0, .4);
}
.tro-badge span { position: relative; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .4)); }
.tro-badge.tier-bronze { --tc: #cd7f32; background: radial-gradient(circle at 35% 30%, #7a5230, #2a1a10); }
.tro-badge.tier-silver { --tc: #d0d4de; background: radial-gradient(circle at 35% 30%, #6a7080, #24272e); }
.tro-badge.tier-gold { --tc: #ffd23f; background: radial-gradient(circle at 35% 30%, #8a6a10, #2e2200); }
.tro-badge.tier-platinum { --tc: #e8f6ff; background: radial-gradient(circle at 35% 30%, #3b5a8a, #0e1a33); box-shadow: inset 0 0 0 3px #e8f6ff, 0 0 14px rgba(160, 220, 255, .6); }
.tro-badge.tier-platinum::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; background: conic-gradient(#e8f6ff, #b8c9ff, #fff, #a8d8ff, #e8f6ff); -webkit-mask: radial-gradient(circle closest-side, transparent 82%, #000 84%); mask: radial-gradient(circle closest-side, transparent 82%, #000 84%); animation: spin 3s linear infinite; }
.tro-badge.locked { filter: grayscale(1); opacity: .45; }
.tro-badge.empty { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--line); color: var(--muted); }
.tro-row { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 2px; }
.tro-row.tap { cursor: pointer; }
.tro-counts { display: flex; gap: 10px; font-weight: 800; font-size: 13px; }
.tc-bronze { color: #e0a060; } .tc-silver { color: #d8dbe4; } .tc-gold { color: #ffd23f; } .tc-platinum { color: #bfeaff; } .tc-platinum.off { opacity: .4; }
.tro-show { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tro-hero { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; margin-bottom: 10px; background: linear-gradient(160deg, #3a2a10, #14100a); border: 2px solid rgba(255, 210, 63, .5); }
.tro-hero.platinum { background: linear-gradient(160deg, #1a2a4a, #0a0f22); border-color: #bfeaff; box-shadow: 0 0 24px rgba(160, 220, 255, .25); }
.tro-hero-icon { font-size: 48px; line-height: 1; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .35)); }
.tro-big { display: flex; gap: 10px; font-weight: 900; font-size: 15px; flex-wrap: wrap; margin: 4px 0; }
.tro-progress { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .4); overflow: hidden; margin: 4px 0; }
.tro-progress i { display: block; height: 100%; background: linear-gradient(90deg, #cd7f32, #d0d4de, #ffd23f); transition: width .8s ease; }
.tro-showcase { margin: 6px 0 12px; }
.tro-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.tro-item.tier-bronze { --tc2: #cd7f32; } .tro-item.tier-silver { --tc2: #d0d4de; } .tro-item.tier-gold { --tc2: #ffd23f; } .tro-item.tier-platinum { --tc2: #bfeaff; }
.tro-item.done { border-color: color-mix(in srgb, var(--tc2, var(--gold)) 55%, transparent); background: linear-gradient(150deg, color-mix(in srgb, var(--tc2, var(--gold)) 12%, var(--surface)), var(--surface)); }
.tro-title { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tro-tier { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .06); color: var(--tc2, var(--muted)); }
.tro-desc { font-size: 12px; color: var(--muted); }
.tro-date { font-size: 11px; color: var(--ok); margin-top: 2px; }
.tro-bar { position: relative; height: 14px; border-radius: 7px; background: rgba(0, 0, 0, .4); overflow: hidden; margin-top: 5px; }
.tro-bar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--accent) 0 8px, var(--accent-2) 8px 16px); }
.tro-bar b { position: absolute; inset: 0; font-size: 10px; font-weight: 800; text-align: center; line-height: 14px; color: #fff; text-shadow: 0 0 3px #000; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- USDT wallet (REAL_MONEY) ---------- */
.usdt {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; position: relative;
  background: radial-gradient(circle at 50% 50%, #d9fff0 0 16%, #26a17b 17% 60%, #1b7a5c 61%);
  box-shadow: 0 0 6px rgba(38, 161, 123, .55), inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.usdt::after { content: "₮"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 900 11px/1 "Courier New", monospace; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
.usdt.sm { width: 14px; height: 14px; }
.usdt.sm::after { font-size: 9px; }
.balance.usdt-pill { border-color: rgba(38, 161, 123, .6); color: #a8f0d3; box-shadow: 0 0 10px rgba(38, 161, 123, .2); }
.balance.usdt-pill.up { color: var(--ok); border-color: var(--ok); }
.wallet-seg { margin: 0 0 10px; }
.wallet-seg button { display: flex; align-items: center; justify-content: center; gap: 6px; }
.wallet-seg button.active.usdt-on { box-shadow: inset 0 -2px 0 #26a17b, 0 0 12px rgba(38, 161, 123, .2); color: #a8f0d3; }
.lobby-hero[data-shop="usdt"] { background: linear-gradient(160deg, #0f2a22, #0c1a2a); border-color: rgba(38, 161, 123, .5); }
.dep-presets .chip { gap: 4px; }
.dep-presets .chip.active { background: linear-gradient(135deg, #26a17b, #146b50); box-shadow: 0 0 14px rgba(38, 161, 123, .35); }
.rm-terms .rm-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.rm-terms .panel.small { padding: 10px 12px; font-size: 13px; }
.wd-item .addr { font-family: "Courier New", monospace; font-size: 11px; word-break: break-all; color: var(--muted); margin: 2px 0; }
.input.mono { font-family: "Courier New", monospace; font-size: 13px; letter-spacing: .02em; }

/* support attachments */
.msg-media { display: block; max-width: min(240px, 60vw); max-height: 280px; border-radius: 12px; margin: 2px 0 6px; object-fit: cover; background: #000; cursor: zoom-in; }
.msg-media.full { max-width: 92vw; max-height: 78vh; object-fit: contain; cursor: default; margin: 0 auto; }
video.msg-media { cursor: default; }
.msg.uploading .msg-bubble { opacity: .6; }
.attach-btn { font-size: 18px; }

/* maintenance: the "technical works" screen (full-screen overlay, both themes) */
.mt-screen { position: fixed; inset: 0; z-index: 900; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px 16px; overflow: hidden; }
.mt-bits { position: absolute; inset: 0; pointer-events: none; }
.mt-bits span { position: absolute; bottom: -20px; background: var(--pink); opacity: .28; animation: mt-float linear infinite; }
.mt-bits span:nth-child(3n) { background: var(--cyan); }
.mt-bits span:nth-child(4n) { background: var(--gold); }
.mt-card { position: relative; width: min(420px, 100%); box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding: 26px 20px 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.mt-gears { position: relative; width: 160px; height: 112px; }
.mt-gear { position: absolute; animation: mt-spin 7s linear infinite; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .35)); }
.mt-gear.big { width: 100px; height: 100px; left: 6px; top: 6px; color: var(--pink); }
.mt-gear.small { width: 60px; height: 60px; left: 98px; top: 46px; color: var(--cyan); animation-direction: reverse; animation-duration: 4.2s; }
.mt-wrench { position: absolute; right: -4px; top: -6px; font-size: 34px; line-height: 1; animation: mt-bob 2.4s ease-in-out infinite; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .4)); }
.mt-text { color: var(--text); font-size: 15px; line-height: 1.45; }
.mt-bar { width: 100%; height: 16px; box-sizing: border-box; padding: 2px; border: 2px solid var(--line); background: var(--surface-2); overflow: hidden; }
.mt-bar-fill { height: 100%; width: 36%; background: repeating-linear-gradient(90deg, var(--pink) 0 8px, var(--cyan) 8px 16px); animation: mt-slide 2.4s ease-in-out infinite; }
.mt-wait { font-weight: 900; letter-spacing: .04em; text-transform: uppercase; font-size: 13px; color: var(--muted); }
.mt-dots::after { content: '...'; display: inline-block; width: 0; overflow: hidden; vertical-align: bottom; animation: mt-dots 1.6s steps(4, end) infinite; }
@keyframes mt-spin { to { transform: rotate(360deg); } }
@keyframes mt-bob { 0%, 100% { transform: translateY(0) rotate(-10deg); } 50% { transform: translateY(-9px) rotate(12deg); } }
@keyframes mt-slide { 0% { margin-left: 0; } 50% { margin-left: 64%; } 100% { margin-left: 0; } }
@keyframes mt-dots { to { width: 1.3em; } }
@keyframes mt-float { from { transform: translateY(0) rotate(0); } to { transform: translateY(-110vh) rotate(360deg); } }
body[data-mode="usdt"] .mt-gear.big { color: var(--gold); }
body[data-mode="usdt"] .mt-gear.small { color: #b9a56a; }
body[data-mode="usdt"] .mt-bar-fill { background: repeating-linear-gradient(90deg, var(--gold) 0 8px, #6b5a2a 8px 16px); }
body[data-mode="usdt"] .mt-bits span { background: var(--gold); opacity: .18; }

/* deposits on the player's own blockchain address (wallet page, USDT mode) */
.dep-way { margin-bottom: 10px; }
.chain-box { align-items: center; text-align: center; }
.chain-title { font-size: 15px; }
.chain-qr { width: 168px; height: 168px; padding: 8px; background: #fff; border-radius: 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); image-rendering: pixelated; }
.chain-addr { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
  font-family: "Courier New", monospace; font-size: 13px; letter-spacing: .02em; word-break: break-all; user-select: all; -webkit-user-select: all; cursor: pointer; }
.chain-warn { margin-top: 6px; color: #ffb454; }
body[data-mode="usdt"] .chain-addr { background: rgba(255, 255, 255, .04); border-color: rgba(212, 175, 55, .35); color: #f3e9c9; }
.wd-item { flex-direction: column; align-items: stretch; gap: 3px; }
.wd-item .wd-top, .wd-item .wd-foot { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wd-item .wd-foot .sub { min-width: 0; }

/* =====================================================================================
   USDT MODE — a separate, restrained face of the product: graphite and gold, serif headings,
   thin lines, quiet motion. Everything hangs off <body data-mode="usdt">; the chips mode is untouched.
   ===================================================================================== */
body[data-mode="usdt"] {
  --bg: #07090d; --bg-2: #0b0f15; --surface: #0f141b; --surface-2: #151c25; --surface-3: #1c2531; --line: #222d3a;
  --text: #eef1f5; --muted: #8290a3; --accent: #c9a961; --accent-2: #e3c67f; --pink: #c9a961; --cyan: #b7c2d1;
  --ok: #3ccf91; --warn: #e0b45a; --bad: #e0556b; --gold: #d6b96f; --felt: #10352a; --felt-2: #081f17; --radius: 14px;
  --serif: "Playfair Display", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(90% 55% at 50% -10%, rgba(201, 169, 97, .12), transparent 60%),
    radial-gradient(60% 40% at 100% 110%, rgba(201, 169, 97, .05), transparent 60%),
    var(--bg);
}
/* the pixel-art engravings and scanlines belong to the chips mode */
body[data-mode="usdt"] .gc-scan, body[data-mode="usdt"] .hero-grid, body[data-mode="usdt"] .felt::before, body[data-mode="usdt"] .board::after,
body[data-mode="usdt"] .sea::after, body[data-mode="usdt"] .ttt::before, body[data-mode="usdt"] .die::before, body[data-mode="usdt"] .luck-stage::before,
body[data-mode="usdt"] .card.back::after, body[data-mode="usdt"] .chip-token::after { display: none; }
body[data-mode="usdt"] .c4-brand { background: #0f141b; box-shadow: none; border-top: 1px solid rgba(201, 169, 97, .35); }

/* --- typography --- */
body[data-mode="usdt"] .h1, body[data-mode="usdt"] .hero-hi, body[data-mode="usdt"] .modal-title, body[data-mode="usdt"] .result-title,
body[data-mode="usdt"] .dialog-text, body[data-mode="usdt"] .game-card .gt, body[data-mode="usdt"] .lobby-hero .h1, body[data-mode="usdt"] .h2 {
  font-family: var(--serif); font-weight: 600; letter-spacing: .01em;
}
body[data-mode="usdt"] .section-title { font-size: 11px; letter-spacing: .22em; color: #9a8a63; font-weight: 700; display: flex; align-items: center; gap: 10px; }
body[data-mode="usdt"] .section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(201, 169, 97, .35), transparent); }
body[data-mode="usdt"] .section-title .muted { color: #6f7b8a; }

/* --- chrome --- */
body[data-mode="usdt"] .topbar { background: rgba(7, 9, 13, .84); border-bottom: 1px solid rgba(201, 169, 97, .18); }
body[data-mode="usdt"] .topbar .who .name { font-weight: 600; letter-spacing: .01em; }
body[data-mode="usdt"] .tabbar { background: rgba(7, 9, 13, .94); border-top: 1px solid rgba(201, 169, 97, .18); }
body[data-mode="usdt"] .tab { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; gap: 4px; }
body[data-mode="usdt"] .tab .ico { filter: none; height: 22px; display: flex; align-items: center; }
body[data-mode="usdt"] .tab .ico .pi { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s; }
body[data-mode="usdt"] .tab.active { color: var(--gold); }
body[data-mode="usdt"] .tab.active .ico { transform: none; }
body[data-mode="usdt"] .tab.active::after { background: var(--gold); box-shadow: none; height: 2px; left: 38%; right: 38%; }
body[data-mode="usdt"] .tab .dot { background: var(--gold); color: #1a1408; }
body[data-mode="usdt"] .balance { background: rgba(201, 169, 97, .08); border-color: rgba(201, 169, 97, .35); color: #f3e9d2; font-weight: 700; letter-spacing: .01em; }
body[data-mode="usdt"] .balance.usdt-pill { box-shadow: none; }
body[data-mode="usdt"] .balance.up { color: var(--ok); border-color: var(--ok); box-shadow: 0 0 12px rgba(60, 207, 145, .25); }
body[data-mode="usdt"] .usdt { background: radial-gradient(circle at 50% 50%, #fff2cf 0 14%, #c9a961 15% 62%, #8f7440 63%); box-shadow: 0 0 0 1px rgba(255, 240, 200, .35), 0 0 6px rgba(201, 169, 97, .5); }
body[data-mode="usdt"] .usdt::after { color: #1a1408; text-shadow: none; }
body[data-mode="usdt"] .icon-btn { border-radius: 10px; background: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .1); }
body[data-mode="usdt"] .qbadge { background: var(--gold); color: #1a1408; }
body[data-mode="usdt"] .grip i { background: rgba(201, 169, 97, .4); box-shadow: none; }

/* --- controls --- */
body[data-mode="usdt"] .btn { border-radius: 12px; box-shadow: none; background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .1); font-weight: 700; letter-spacing: .01em; transition: transform .12s ease, background .15s, border-color .15s, opacity .15s; }
body[data-mode="usdt"] .btn:active { transform: scale(.985); box-shadow: none; }
body[data-mode="usdt"] .btn.primary { background: linear-gradient(135deg, #e3c67f, #c9a961 55%, #a88a4a); color: #1a1408; box-shadow: 0 8px 22px rgba(201, 169, 97, .18); }
body[data-mode="usdt"] .btn.primary:active { box-shadow: none; }
body[data-mode="usdt"] .btn.gold { background: transparent; border: 1px solid rgba(201, 169, 97, .55); color: var(--gold); box-shadow: none; }
body[data-mode="usdt"] .btn.ok { background: linear-gradient(135deg, #3fd39a, #2aa676); color: #06241a; box-shadow: none; }
body[data-mode="usdt"] .btn.pink { background: var(--gold); color: #1a1408; box-shadow: none; }
body[data-mode="usdt"] .btn.sm { border-radius: 10px; box-shadow: none; }
body[data-mode="usdt"] .btn.danger-glow { background: linear-gradient(135deg, #e0556b, #8a2a3a); animation: none; }
body[data-mode="usdt"] .chip { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .1); font-weight: 700; }
body[data-mode="usdt"] .chip.active, body[data-mode="usdt"] .dep-presets .chip.active { background: linear-gradient(135deg, #e3c67f, #b8964f); border-color: transparent; color: #1a1408; box-shadow: 0 6px 16px rgba(201, 169, 97, .2); }
body[data-mode="usdt"] .chip.active .usdt { box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
body[data-mode="usdt"] .seg { background: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .08); border-radius: 12px; }
body[data-mode="usdt"] .seg button.active, body[data-mode="usdt"] .wallet-seg button.active.usdt-on { background: rgba(201, 169, 97, .12); color: #f3e9d2; box-shadow: inset 0 -2px 0 var(--gold); }
body[data-mode="usdt"] .seg.levels button.active { color: var(--gold); box-shadow: inset 0 -2px 0 var(--gold); }
body[data-mode="usdt"] .input { background: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .1); border-radius: 12px; }
body[data-mode="usdt"] .input:focus { border-color: rgba(201, 169, 97, .6); box-shadow: 0 0 0 3px rgba(201, 169, 97, .12); }
body[data-mode="usdt"] .switch input { accent-color: var(--gold); }
body[data-mode="usdt"] .bet-field { border-color: rgba(201, 169, 97, .45); }
body[data-mode="usdt"] .code-chip, body[data-mode="usdt"] .clock { border-radius: 8px; border-color: rgba(201, 169, 97, .35); }

/* --- surfaces --- */
body[data-mode="usdt"] .item, body[data-mode="usdt"] .panel, body[data-mode="usdt"] .stat, body[data-mode="usdt"] .quick,
body[data-mode="usdt"] .crash-row, body[data-mode="usdt"] .paytable .pay, body[data-mode="usdt"] .room-seats {
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .015)); border-color: rgba(255, 255, 255, .08); border-radius: 12px;
}
body[data-mode="usdt"] .item.unread { border-color: rgba(201, 169, 97, .5); }
body[data-mode="usdt"] .item.glow-item { border-color: rgba(60, 207, 145, .45); box-shadow: none; }
body[data-mode="usdt"] .tip { background: rgba(201, 169, 97, .06); border: 1px solid rgba(201, 169, 97, .25); color: #d9cdb0; border-radius: 12px; }
body[data-mode="usdt"] .banner { background: rgba(255, 255, 255, .03); border-color: rgba(201, 169, 97, .4); border-radius: 12px; }
body[data-mode="usdt"] .banner.glow { animation: none; border-color: var(--gold); }
body[data-mode="usdt"] .warn-banner { border-color: rgba(224, 180, 90, .5); }
body[data-mode="usdt"] .toast { background: rgba(12, 16, 22, .96); border-color: rgba(201, 169, 97, .35); border-radius: 12px; }
body[data-mode="usdt"] .banner-pop { background: linear-gradient(160deg, #121820, #0b0f15); border: 1px solid rgba(201, 169, 97, .5); box-shadow: 0 16px 40px rgba(0, 0, 0, .6); border-radius: 14px; }
body[data-mode="usdt"] .bp-text { color: var(--muted); }
body[data-mode="usdt"] .bp-timer { background: var(--gold); }
body[data-mode="usdt"] .modal { background: linear-gradient(180deg, #121820, #0b0f15); border-color: rgba(201, 169, 97, .25); border-top-left-radius: 20px; border-top-right-radius: 20px; }
body[data-mode="usdt"] .modal::before { background: rgba(201, 169, 97, .35); }
body[data-mode="usdt"] .modal.dialog { background: linear-gradient(160deg, #121820, #0b0f15); border: 1px solid rgba(201, 169, 97, .5); box-shadow: 0 24px 60px rgba(0, 0, 0, .65); image-rendering: auto; border-radius: 16px; }
body[data-mode="usdt"] .modal-back { background: rgba(3, 5, 8, .72); backdrop-filter: blur(6px); }
body[data-mode="usdt"] .skeleton { border-radius: 12px; }
body[data-mode="usdt"] .keypad-display { font-family: var(--serif); }

/* --- home --- */
body[data-mode="usdt"] .hero { background: linear-gradient(160deg, #121a24, #0a0e14 70%); border: 1px solid rgba(201, 169, 97, .35); box-shadow: 0 20px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06); border-radius: 16px; min-height: 140px; }
body[data-mode="usdt"] .hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 90% at 90% 0%, rgba(201, 169, 97, .18), transparent 60%); pointer-events: none; }
body[data-mode="usdt"] .hero::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(201, 169, 97, .6), transparent); }
body[data-mode="usdt"] .hero-body { padding: 18px 18px 16px; gap: 10px; }
body[data-mode="usdt"] .hero-hi { font-size: 20px; color: #f3e9d2; }
body[data-mode="usdt"] .hero-coins { background: rgba(201, 169, 97, .1); border: 1px solid rgba(201, 169, 97, .35); font-weight: 700; }
body[data-mode="usdt"] .hero-plus { background: var(--gold); color: #1a1408; }
body[data-mode="usdt"] .quick { font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
body[data-mode="usdt"] .quick span { font-size: 20px; filter: grayscale(1) brightness(1.35); }
body[data-mode="usdt"] [data-game], body[data-mode="usdt"] [data-luck], body[data-mode="usdt"] .lobby-hero[data-shop], body[data-mode="usdt"] .guild-card, body[data-mode="usdt"] .profile-card,
body[data-mode="usdt"] .lobby-hero { --g1: #131a23; --g2: #0a0e14; --gl: rgba(201, 169, 97, .28); }
body[data-mode="usdt"] .game-card, body[data-mode="usdt"] .lobby-hero, body[data-mode="usdt"] .profile-card { border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
body[data-mode="usdt"] .game-card::after { width: 160px; height: 160px; right: -70px; top: -70px; opacity: .5; }
body[data-mode="usdt"] .game-card::before, body[data-mode="usdt"] .lobby-hero::before { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(201, 169, 97, .45), transparent); z-index: 1; }
body[data-mode="usdt"] .game-card .emoji {
  animation: none; filter: grayscale(.25) saturate(.8); font-size: 24px; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(201, 169, 97, .25); margin-bottom: 8px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
body[data-mode="usdt"] .game-card .gt { font-size: 17px; color: #f3e9d2; }
body[data-mode="usdt"] .game-card .gd { color: var(--muted); }
body[data-mode="usdt"] .game-card:active, body[data-mode="usdt"] .game-card.picked { transform: scale(.98); box-shadow: 0 0 0 1px rgba(201, 169, 97, .6), 0 12px 30px rgba(0, 0, 0, .4); }
body[data-mode="usdt"] .game-card .online { background: rgba(60, 207, 145, .12); border: 1px solid rgba(60, 207, 145, .35); }
body[data-mode="usdt"] .lobby-emoji { font-size: 34px; filter: grayscale(.25) saturate(.8); width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(201, 169, 97, .3); flex-shrink: 0; }
body[data-mode="usdt"] .lobby-desc { color: var(--muted); }
body[data-mode="usdt"] .lobby-hero .h1 { color: #f3e9d2; }
body[data-mode="usdt"] .profile-card { background: linear-gradient(160deg, #131a23, #0a0e14); border-color: rgba(201, 169, 97, .3); }
body[data-mode="usdt"] .avatar-edit { background: conic-gradient(from 0deg, #e3c67f, #8f7440, #e3c67f); }
body[data-mode="usdt"] .rank-title { font-family: var(--serif); letter-spacing: .2em; text-shadow: none; font-weight: 600; }
body[data-mode="usdt"] .rank-bar i { background: linear-gradient(90deg, #8f7440, var(--gold)); }
body[data-mode="usdt"] .rank-card { background: linear-gradient(150deg, rgba(201, 169, 97, .1), var(--surface)); border-color: rgba(201, 169, 97, .3); }
body[data-mode="usdt"] .rank-place { font-family: var(--serif); }
body[data-mode="usdt"] .pod-step { background: linear-gradient(180deg, var(--surface-3), var(--surface)); border-color: rgba(255, 255, 255, .08); }
body[data-mode="usdt"] .pod-1 .pod-step { background: linear-gradient(180deg, rgba(201, 169, 97, .3), var(--surface)); border-color: rgba(201, 169, 97, .5); }
body[data-mode="usdt"] .pod-1 .avatar { box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(201, 169, 97, .4); }
body[data-mode="usdt"] .gtag { color: var(--gold); background: rgba(201, 169, 97, .1); border-color: rgba(201, 169, 97, .35); }
body[data-mode="usdt"] .tag.warn { background: rgba(201, 169, 97, .15); color: var(--gold); }
body[data-mode="usdt"] .lobby-hero[data-shop="usdt"] { background: linear-gradient(160deg, #131a23, #0a0e14); border-color: rgba(201, 169, 97, .35); }
body[data-mode="usdt"] .balance.big { font-family: var(--serif); font-size: 22px; font-weight: 600; }
body[data-mode="usdt"] .wd-item .addr { color: #9a8a63; }

/* --- rooms & tables --- */
body[data-mode="usdt"] .room-head { background: linear-gradient(90deg, rgba(201, 169, 97, .08), transparent 70%); border-bottom-color: rgba(201, 169, 97, .18); }
body[data-mode="usdt"] .room-head .title { font-family: var(--serif); font-weight: 600; }
body[data-mode="usdt"] .result-title { font-size: 26px; letter-spacing: .02em; }
body[data-mode="usdt"] .result-title.win { color: var(--gold); text-shadow: 0 0 24px rgba(201, 169, 97, .4); }
body[data-mode="usdt"] .result-money.win { color: var(--gold); }
body[data-mode="usdt"] .seat-empty { border-color: rgba(201, 169, 97, .25); }
body[data-mode="usdt"] .bet-chip { background: var(--gold); color: #1a1408; }
body[data-mode="usdt"] .bj-seat.me .nm { color: var(--gold); }
body[data-mode="usdt"] .card.sel { box-shadow: 0 0 0 2px var(--gold), 0 6px 14px rgba(0, 0, 0, .5); }
body[data-mode="usdt"] .card.playable { box-shadow: 0 0 0 2px rgba(201, 169, 97, .85), 0 2px 6px rgba(0, 0, 0, .35); }
body[data-mode="usdt"] .card.suspect { box-shadow: 0 0 0 3px var(--gold); }
body[data-mode="usdt"] .durak-table.drop-hover { box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 30px rgba(0, 0, 0, .45); }
body[data-mode="usdt"] .ttt .cell.X { color: var(--gold); text-shadow: 0 0 14px rgba(201, 169, 97, .5); }
body[data-mode="usdt"] .ttt .cell.O { color: #e6d8bc; text-shadow: 0 0 14px rgba(230, 216, 188, .4); }
body[data-mode="usdt"] .ttt .cell.win { background: rgba(201, 169, 97, .15); border-color: var(--gold); }
body[data-mode="usdt"] .c4 .disc4.p1 { background: radial-gradient(circle at 35% 35%, #c96a6a, #7a1e2a); }
body[data-mode="usdt"] .c4 .disc4.p2 { background: radial-gradient(circle at 35% 35%, #fff2cf, #c9a961); }
body[data-mode="usdt"] .c4 { background: #182232; }
body[data-mode="usdt"] .sea { background: #0b1220; }
body[data-mode="usdt"] .sea .cell { background: #16202f; }
body[data-mode="usdt"] .sea .cell.ship { background: #6f7f93; }
body[data-mode="usdt"] .sea .cell.ship.sel { background: var(--gold); }
body[data-mode="usdt"] .sea .cell.last { outline-color: var(--gold); }
body[data-mode="usdt"] .sq.last::before { background: rgba(201, 169, 97, .35); }
body[data-mode="usdt"] .board.checkers .sq.path::before { background: rgba(201, 169, 97, .3); }
body[data-mode="usdt"] .die-tag { background: var(--gold); color: #1a1408; }
/* the skins of the USDT mode: ivory and walnut, a navy back with a gold lattice, a velvet felt with a gold rail */
body[data-mode="usdt"] {
  --cb-bg: radial-gradient(circle at 50% 50%, rgba(201, 169, 97, .28) 0 16%, transparent 17%), repeating-linear-gradient(45deg, rgba(201, 169, 97, .18) 0 1px, transparent 1px 8px), repeating-linear-gradient(-45deg, rgba(201, 169, 97, .18) 0 1px, transparent 1px 8px), linear-gradient(160deg, #182232, #0b1018);
  --cb-border: #c9a961; --cb-sheen: none;
  --felt-bg: radial-gradient(ellipse at center, #14432f, #071a12 78%); --felt-border: #6f5a2f;
  --felt-shadow: inset 0 0 40px rgba(0, 0, 0, .55), 0 0 0 1px rgba(201, 169, 97, .5), 0 16px 40px rgba(0, 0, 0, .5);
  --sq-light: #e6d8bc; --sq-dark: #4a3626; --coord-light: rgba(74, 54, 38, .7); --coord-dark: rgba(230, 216, 188, .7);
  --board-shadow: 0 0 0 1px rgba(201, 169, 97, .55), 0 14px 36px rgba(0, 0, 0, .55);
  --pw-color: #f3ead6; --pw-shadow: 0 2px 0 #b9ad95, 0 4px 8px rgba(0, 0, 0, .5); --pb-color: #1a1612; --pb-shadow: 0 2px 0 #000, 0 4px 8px rgba(0, 0, 0, .6);
  --dw-bg: radial-gradient(circle at 35% 35%, #fff8e6, #d9cbaa 70%); --dw-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), 0 3px 6px rgba(0, 0, 0, .5);
  --db-bg: radial-gradient(circle at 35% 35%, #4a4034, #15110d 70%); --db-shadow: inset 0 -3px 0 rgba(0, 0, 0, .5), 0 3px 6px rgba(0, 0, 0, .6);
  --nardy-bg: linear-gradient(180deg, #2b1c12, #16100a); --nardy-border: #6f5a2f; --nardy-shadow: 0 0 0 1px rgba(201, 169, 97, .5), inset 0 0 30px rgba(0, 0, 0, .5);
  --tri: #d8c49a; --tri-odd: #6a4a2c;
  --die-bg: linear-gradient(145deg, #fffaf0, #e6dcc6); --die-shadow: inset 0 -6px 0 rgba(0, 0, 0, .12), inset 0 2px 0 #fff, 0 12px 26px rgba(0, 0, 0, .5); --die-radius: 16px;
  --pip-bg: radial-gradient(circle at 35% 35%, #3a3128, #0e0b08); --pip-shadow: inset 0 2px 3px rgba(0, 0, 0, .6); --pip-radius: 50%; --die-mini-radius: 7px;
}

/* --- the casino --- */
body[data-mode="usdt"] .luck-stage { background: linear-gradient(180deg, #121a23, #0a0e14); border: 1px solid rgba(201, 169, 97, .3); border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 16px 40px rgba(0, 0, 0, .45); }
body[data-mode="usdt"] .luck-result { border-radius: 12px; background: rgba(12, 16, 22, .96); }
body[data-mode="usdt"] .luck-result.win { border-color: var(--gold); }
body[data-mode="usdt"] .luck-result.win b { color: var(--gold); }
body[data-mode="usdt"] .luck-result b { font-family: var(--serif); font-weight: 600; }
body[data-mode="usdt"] .ltag.win { background: rgba(201, 169, 97, .15); color: var(--gold); }
body[data-mode="usdt"] .ltag.hit { box-shadow: 0 0 0 2px var(--gold); }
body[data-mode="usdt"] .crash-grid { background: repeating-linear-gradient(0deg, rgba(201, 169, 97, .07) 0 1px, transparent 1px 26px), repeating-linear-gradient(90deg, rgba(201, 169, 97, .05) 0 1px, transparent 1px 26px); }
body[data-mode="usdt"] .crash-svg .line, body[data-mode="usdt"] .crash-svg .glow { stroke: var(--gold); }
body[data-mode="usdt"] .crash-svg .area { fill: rgba(201, 169, 97, .1); }
body[data-mode="usdt"] .crash-mult { font-family: var(--serif); font-weight: 600; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
body[data-mode="usdt"] .crash-mult.wait { color: var(--gold); }
body[data-mode="usdt"] .crash-mult.won { color: var(--ok); }
body[data-mode="usdt"] .crash-timer i { background: linear-gradient(90deg, #8f7440, var(--gold)); }
body[data-mode="usdt"] .rocket { color: var(--gold); text-shadow: 0 0 14px rgba(201, 169, 97, .8); }
body[data-mode="usdt"] .crash-row.me { border-color: rgba(201, 169, 97, .5); }
body[data-mode="usdt"] .dice-sum { font-family: var(--serif); text-shadow: none; font-weight: 600; }
body[data-mode="usdt"] .coin3d .face { background: radial-gradient(circle at 50% 45%, #fff2cf 0 8%, #d6b96f 9% 66%, #8f7440 67% 74%, #d6b96f 75%); box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .22), inset 0 8px 0 rgba(255, 255, 255, .2), 0 0 0 4px #6f5a2f, 0 14px 30px rgba(0, 0, 0, .55); }
body[data-mode="usdt"] .coin3d .ring { border: 2px solid rgba(90, 70, 30, .5); }
body[data-mode="usdt"] .wheel { box-shadow: 0 0 0 6px #2a2118, 0 0 0 8px #c9a961, 0 14px 34px rgba(0, 0, 0, .55); }
body[data-mode="usdt"] .wheel-hub { background: radial-gradient(circle at 40% 35%, #2a2f38, #0f141b 70%); box-shadow: 0 0 0 3px #c9a961, 0 6px 16px rgba(0, 0, 0, .6); }
body[data-mode="usdt"] .roulette-num { font-family: var(--serif); border-color: var(--gold); }
body[data-mode="usdt"] .num { font-family: var(--serif); font-weight: 600; }
body[data-mode="usdt"] .num.active { border-color: var(--gold); box-shadow: 0 0 10px rgba(201, 169, 97, .5); }
body[data-mode="usdt"] .slot-machine { background: linear-gradient(180deg, #1a2230, #0d1219); box-shadow: inset 0 0 0 1px rgba(201, 169, 97, .5), 0 14px 30px rgba(0, 0, 0, .5); }
body[data-mode="usdt"] .slot-marquee { font-family: var(--serif); color: var(--gold); letter-spacing: .35em; }
body[data-mode="usdt"] .reel { background: linear-gradient(180deg, #d9d2c2, #fff 50%, #d9d2c2); box-shadow: inset 0 0 0 2px #c9a961, inset 0 12px 14px rgba(0, 0, 0, .22), inset 0 -12px 14px rgba(0, 0, 0, .22); }
body[data-mode="usdt"] .reel .payline { border-top-color: rgba(201, 169, 97, .6); }
body[data-mode="usdt"] .reel.hit { box-shadow: inset 0 0 0 3px var(--gold), 0 0 18px rgba(201, 169, 97, .5); }
body[data-mode="usdt"] .tile { background: linear-gradient(145deg, #1c2531, #0f141b); border-color: rgba(201, 169, 97, .25); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .35); border-radius: 8px; }
body[data-mode="usdt"] .tile.gem { background: linear-gradient(145deg, #1b5d45, #0c2e22); border-color: var(--ok); box-shadow: 0 0 10px rgba(60, 207, 145, .3); }
body[data-mode="usdt"] .tile.mine { background: linear-gradient(145deg, #5e1e2a, #2a0a10); }

/* --- the wordmark (replaces the pixel logo in the USDT mode) --- */
.wordmark { display: inline-flex; align-items: baseline; gap: .45em; line-height: 1; font-family: var(--serif, Georgia, serif); white-space: nowrap; }
.wordmark b { font-weight: 600; font-size: var(--wm, 28px); letter-spacing: .14em; color: #f3e9d2; text-shadow: 0 0 24px rgba(201, 169, 97, .25); }
.wordmark i { font-style: normal; font-size: calc(var(--wm, 28px) * .42); letter-spacing: .38em; color: var(--gold, #d6b96f); text-transform: uppercase; font-weight: 600; }
.dialog-logo .wordmark { --wm: 14px; }
.banned-screen .wordmark { --wm: 22px; }

/* --- the welcome screen of the USDT mode --- */
.usdt-intro {
  position: fixed; inset: 0; z-index: 300; background: #05070a; color: #f3e9d2; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; animation: uiFade .6s ease-out both;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.usdt-intro.out { animation: uiOut .7s ease-in forwards; pointer-events: none; }
.ui-glow { position: absolute; left: 50%; top: 42%; width: 140vmax; height: 140vmax; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(201, 169, 97, .16), transparent 32%); animation: uiBreathe 3.2s ease-in-out infinite; pointer-events: none; }
.ui-body { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 0 28px; text-align: center; }
.ui-eyebrow { font-size: 10px; letter-spacing: .5em; text-indent: .5em; color: #8f7440; text-transform: uppercase; animation: uiRise .9s .2s cubic-bezier(.22, .61, .36, 1) both; }
.ui-brand { display: flex; font-family: "Playfair Display", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif; font-size: 58px; font-weight: 600; letter-spacing: .16em; text-indent: .16em; color: #f3e9d2; text-shadow: 0 0 40px rgba(201, 169, 97, .25); }
.ui-brand span { display: inline-block; animation: uiLetter 1.1s cubic-bezier(.22, .61, .36, 1) both; animation-delay: calc(.25s + var(--i) * .09s); }
.ui-rule { width: 180px; height: 1px; position: relative; overflow: hidden; }
.ui-rule i { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, #e3c67f, transparent); transform: scaleX(0); animation: uiRule 1.2s .75s cubic-bezier(.22, .61, .36, 1) forwards; }
.ui-mode { font-size: 15px; letter-spacing: .6em; text-indent: .6em; color: #e3c67f; text-transform: uppercase; animation: uiRise .9s 1s cubic-bezier(.22, .61, .36, 1) both; }
.ui-sub { font-size: 14px; color: #9aa6b5; animation: uiRise .9s 1.2s cubic-bezier(.22, .61, .36, 1) both; }
.ui-license { font-size: 11px; color: #6f7b8a; max-width: 320px; line-height: 1.4; animation: uiRise .9s 1.35s cubic-bezier(.22, .61, .36, 1) both; }
.ui-foot { margin-top: 6px; font-size: 11px; letter-spacing: .25em; text-indent: .25em; color: #8f7440; text-transform: uppercase; animation: uiRise .9s 1.5s cubic-bezier(.22, .61, .36, 1) both; }
.ui-bar { position: absolute; left: 50%; bottom: calc(66px + var(--safe-bottom)); width: 120px; height: 1px; transform: translateX(-50%); background: rgba(255, 255, 255, .08); overflow: hidden; }
.ui-bar i { display: block; height: 100%; background: #e3c67f; transform: scaleX(0); transform-origin: left; animation: uiBar 3.1s .3s linear forwards; }
.ui-skip { position: absolute; bottom: calc(40px + var(--safe-bottom)); font-size: 10px; letter-spacing: .2em; color: #4d5866; text-transform: uppercase; animation: uiRise 1s 2s both; }
@keyframes uiFade { from { opacity: 0; } }
@keyframes uiOut { to { opacity: 0; transform: scale(1.02); } }
@keyframes uiBreathe { 50% { transform: translate(-50%, -50%) scale(1.08); opacity: .8; } }
@keyframes uiRise { from { opacity: 0; transform: translateY(14px); } }
@keyframes uiLetter { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } 60% { filter: blur(0); } }
@keyframes uiRule { to { transform: scaleX(1); } }
@keyframes uiBar { to { transform: scaleX(1); } }

/* --- the win of the USDT mode: gold dust --- */
.fx-gold i { position: absolute; border-radius: 50%; background: radial-gradient(circle, #fff6d8 0 30%, #e3c67f 55%, transparent 72%); box-shadow: 0 0 8px rgba(227, 198, 127, .9); }
.fx-gold b { position: absolute; left: 8%; right: 8%; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, #e3c67f, transparent); transform-origin: center; }
/* the USDT mode wears nothing from the market: no frames, titles, name styles or guild tags on names */
body[data-mode="usdt"] .avatar.framed::before, body[data-mode="usdt"] .avatar.framed::after, body[data-mode="usdt"] .ptitle, body[data-mode="usdt"] .gtag:not(.bot-tag) { display: none; }
body[data-mode="usdt"] .pname-text[class*="ns-"] { font-family: inherit; color: inherit; text-shadow: none; animation: none; background: none; -webkit-text-fill-color: inherit; letter-spacing: 0; text-transform: none; font-weight: inherit; filter: none; }

/* ---------- USDT mode · artwork & motion: one stroke weight, one gold, serif numerals ---------- */
body[data-mode="usdt"] .pa { display: block; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
body[data-mode="usdt"] .game-card .emoji .pa, body[data-mode="usdt"] .lobby-emoji .pa, body[data-mode="usdt"] .radar-emoji .pa, body[data-mode="usdt"] .quick .pa { width: 100%; height: 100%; color: #e3c67f; }
body[data-mode="usdt"] .game-card .emoji { padding: 10px; filter: none; }
body[data-mode="usdt"] .lobby-emoji { padding: 14px; filter: none; }
body[data-mode="usdt"] .quick span { width: 24px; height: 24px; filter: none; }
body[data-mode="usdt"] .radar-emoji { padding: 27%; animation: none; color: #e3c67f; }
body[data-mode="usdt"] .radar-emoji .pa { stroke-width: 1.2; filter: drop-shadow(0 0 10px rgba(227, 198, 127, .5)); }
body[data-mode="usdt"] .radar-ring { border: 1px solid rgba(201, 169, 97, .45); animation: ring 3.2s ease-out infinite; }
body[data-mode="usdt"] .radar-sweep { background: conic-gradient(from 0deg, transparent 0 80%, rgba(201, 169, 97, .35) 100%); animation: spin 3.4s linear infinite; }

/* cards: ivory faces with serif ranks, the guilloché back */
body[data-mode="usdt"] { --cb-bg: var(--pm-card-back) center / 100% 100% no-repeat, #0b1018; --cb-border: rgba(201, 169, 97, .7); }
body[data-mode="usdt"] .card { background: linear-gradient(180deg, #fffdf6, #f1e9d8); border-color: #d9cdb0; color: #1a1612; box-shadow: 0 2px 6px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(201, 169, 97, .25); }
body[data-mode="usdt"] .card .cr { font-family: var(--serif); font-weight: 600; }
body[data-mode="usdt"] .card.red { color: #b3202f; }
body[data-mode="usdt"] .card.back { border-width: 1px; image-rendering: auto; color: transparent; }
body[data-mode="usdt"] .card.ghost { background: rgba(255, 255, 255, .04); border: 1px dashed rgba(201, 169, 97, .35); }

/* the table: an inner line and the engraved monogram */
body[data-mode="usdt"] .felt::after { content: ""; position: absolute; inset: 14px; z-index: -1; border-radius: 40px; border: 1px solid rgba(201, 169, 97, .22); background: var(--pm-felt-mark) center / 46% auto no-repeat; pointer-events: none; }
body[data-mode="usdt"] .durak-table::after { background-size: 40% auto; }
body[data-mode="usdt"] .poker-table::after { background-size: 34% auto; background-position: center 78%; }

/* bets as casino tokens */
body[data-mode="usdt"] .chip.coin-chip { padding: 6px 12px 6px 7px; gap: 8px; }
body[data-mode="usdt"] .chip.coin-chip .usdt, body[data-mode="usdt"] .chip.coin-chip .coin {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle, #10161f 0 40%, transparent 42%), repeating-conic-gradient(#e3c67f 0 18deg, #10161f 18deg 36deg);
  box-shadow: 0 0 0 1.5px #c9a961, 0 2px 4px rgba(0, 0, 0, .5);
}
body[data-mode="usdt"] .chip.coin-chip .usdt::after { font-size: 9px; color: #e3c67f; }
body[data-mode="usdt"] .chip.coin-chip.active .usdt, body[data-mode="usdt"] .chip.coin-chip.active .coin { background: radial-gradient(circle, #1a1408 0 40%, transparent 42%), repeating-conic-gradient(#fff3cf 0 18deg, #1a1408 18deg 36deg); box-shadow: 0 0 0 1.5px #1a1408; }
body[data-mode="usdt"] .chip.coin-chip.active .usdt::after { color: #fff3cf; }
body[data-mode="usdt"] .bet-field .usdt { width: 16px; height: 16px; }

/* quiet motion: a sheen on the main button, a breathing hairline, the tab underline growing, a pulse on gains */
body[data-mode="usdt"] .btn.primary { position: relative; overflow: hidden; }
body[data-mode="usdt"] .btn.primary::after { content: ""; position: absolute; top: -60%; bottom: -60%; left: -40%; width: 30%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent); transform: skewX(-20deg); animation: pmSheen 5s ease-in-out infinite; pointer-events: none; }
@keyframes pmSheen { 0%, 60% { left: -40%; } 85%, 100% { left: 130%; } }
body[data-mode="usdt"] .hero::after { animation: pmLine 3.5s ease-in-out infinite; }
@keyframes pmLine { 50% { opacity: .35; } }
body[data-mode="usdt"] .tab.active::after { animation: pmTab .4s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes pmTab { from { transform: scaleX(0); } }
body[data-mode="usdt"] .balance.up { animation: pmPulse .8s ease-out; }
@keyframes pmPulse { 0% { box-shadow: 0 0 0 0 rgba(60, 207, 145, .5); } 100% { box-shadow: 0 0 0 14px rgba(60, 207, 145, 0); } }
body[data-mode="usdt"] .skeleton { background: linear-gradient(90deg, #0f141b 0%, #1a2230 40%, #0f141b 80%); background-size: 200% 100%; }
body[data-mode="usdt"] .hint.act { color: var(--gold); }
body[data-mode="usdt"] .player-strip.turn .name::after { color: var(--gold); }
body[data-mode="usdt"] .empty .big { filter: grayscale(1) opacity(.55); animation: none; }

/* the roulette: a highlight running around the rim, a gold pointer */
body[data-mode="usdt"] .wheel-wrap::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; pointer-events: none; background: conic-gradient(from 0deg, transparent 0 62%, rgba(255, 255, 255, .28) 74%, transparent 86%); -webkit-mask: radial-gradient(circle, transparent 0 calc(50% - 9px), #000 calc(50% - 8px)); mask: radial-gradient(circle, transparent 0 calc(50% - 9px), #000 calc(50% - 8px)); animation: spin 7s linear infinite; }
body[data-mode="usdt"] .wheel-pointer { border-top-color: #e3c67f; }

/* the crash: a gold orb with a halo instead of a rocket, rings instead of a grid, a shockwave on the crash */
body[data-mode="usdt"] .rocket { width: 14px; height: 14px; font-size: 0; line-height: 0; }
body[data-mode="usdt"] .rocket::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 38% 38%, #fff7dc, #e3c67f 45%, #8f7440); box-shadow: 0 0 10px 3px rgba(227, 198, 127, .75); }
body[data-mode="usdt"] .rocket::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 1px solid rgba(227, 198, 127, .7); animation: pmHalo 1.5s ease-out infinite; }
@keyframes pmHalo { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
body[data-mode="usdt"] .crash-svg.crashed + .rocket::before { background: radial-gradient(circle at 38% 38%, #ffd7dc, #e0556b 45%, #6a1b28); box-shadow: 0 0 12px 4px rgba(224, 85, 107, .7); }
body[data-mode="usdt"] .crash-svg.crashed + .rocket::after { border-color: rgba(224, 85, 107, .8); animation: pmShock .9s ease-out forwards; }
@keyframes pmShock { from { transform: scale(.4); opacity: 1; border-width: 3px; } to { transform: scale(5); opacity: 0; border-width: 1px; } }
body[data-mode="usdt"] .crash-grid { background: repeating-radial-gradient(circle at 0% 100%, rgba(201, 169, 97, .09) 0 1px, transparent 1px 36px), linear-gradient(180deg, rgba(201, 169, 97, .04), transparent 60%); }
body[data-mode="usdt"] .crash-mult { letter-spacing: .02em; font-size: 46px; }
body[data-mode="usdt"] .crash-hist .ltag { background: rgba(255, 255, 255, .04); border: 1px solid rgba(201, 169, 97, .25); }
body[data-mode="usdt"] .crash-status { color: #9a8a63; letter-spacing: .04em; }

/* mines: dark stone tiles, an emerald that breathes, a crimson mine */
body[data-mode="usdt"] .tile { padding: 0; background: linear-gradient(145deg, #1a2330, #0e131a); border: 1px solid rgba(201, 169, 97, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), inset 0 -2px 0 rgba(0, 0, 0, .4); display: flex; align-items: center; justify-content: center; }
body[data-mode="usdt"] .tile .pa { width: 66%; height: 66%; stroke: none; }
body[data-mode="usdt"] .tile.gem { background: radial-gradient(circle at 50% 40%, #1f6b4d, #0b2e22 75%); border-color: rgba(60, 207, 145, .7); box-shadow: 0 0 14px rgba(60, 207, 145, .35), inset 0 0 12px rgba(60, 207, 145, .25); animation: pmGem 1.8s ease-in-out infinite alternate; }
@keyframes pmGem { to { box-shadow: 0 0 22px rgba(60, 207, 145, .55), inset 0 0 16px rgba(60, 207, 145, .35); } }
body[data-mode="usdt"] .tile.mine { background: radial-gradient(circle at 50% 45%, #4a1620, #1a0810 75%); border-color: rgba(224, 85, 107, .55); }
body[data-mode="usdt"] .tile.mine.hit { box-shadow: 0 0 0 2px var(--bad), 0 0 26px var(--bad); animation: pmHit .5s ease-out; }
@keyframes pmHit { from { transform: scale(1.25); } }

/* slots: drawn symbols on ivory reels, a lit marquee line */
body[data-mode="usdt"] .reel .sym { filter: none; }
body[data-mode="usdt"] .reel .sym .pa { width: 42px; height: 42px; stroke: none; }
body[data-mode="usdt"] .pay-syms { display: inline-flex; gap: 2px; align-items: center; }
body[data-mode="usdt"] .pay-syms .pa { width: 24px; height: 24px; stroke: none; }
body[data-mode="usdt"] .slot-machine { position: relative; padding: 12px 12px 14px; border: 1px solid rgba(201, 169, 97, .5); }
body[data-mode="usdt"] .slot-machine::before { content: ""; position: absolute; left: 12%; right: 12%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, #e3c67f, transparent); animation: pmLine 2.4s ease-in-out infinite; }

/* the coin: minted faces, a shadow on the table */
body[data-mode="usdt"] .coin-stage { position: relative; }
body[data-mode="usdt"] .coin3d.minted .face { background: none; box-shadow: 0 14px 30px rgba(0, 0, 0, .55); }
body[data-mode="usdt"] .coin3d.minted .face .pa { width: 100%; height: 100%; stroke: none; }
body[data-mode="usdt"] .coin-stage::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 130px; height: 16px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, .6), transparent 70%); }

/* dice on a velvet tray */
body[data-mode="usdt"] .dice-stage { padding: 16px 26px; border-radius: 18px; background: radial-gradient(ellipse at center, #14432f, #071a12 80%); box-shadow: inset 0 0 30px rgba(0, 0, 0, .55), 0 0 0 1px rgba(201, 169, 97, .45); }
body[data-mode="usdt"] .die i { background: radial-gradient(circle at 35% 35%, #2a2118, #0a0805); }

/* trophies as medallions */
body[data-mode="usdt"] .tro-badge { background: radial-gradient(circle at 35% 30%, #2a3140, #0f141b); box-shadow: inset 0 0 0 2px var(--tc), inset 0 0 0 4px #0f141b, inset 0 0 0 5px rgba(255, 255, 255, .08), 0 6px 14px rgba(0, 0, 0, .5); }
body[data-mode="usdt"] .tro-badge span { font-family: var(--serif); color: var(--tc); filter: none; font-weight: 600; }
body[data-mode="usdt"] .tro-badge.tier-bronze { --tc: #b87333; }
body[data-mode="usdt"] .tro-badge.tier-silver { --tc: #cfd3dc; }
body[data-mode="usdt"] .tro-badge.tier-gold { --tc: #e3c67f; }
body[data-mode="usdt"] .tro-badge.tier-platinum { --tc: #e6f0fa; box-shadow: inset 0 0 0 2px var(--tc), 0 0 16px rgba(230, 240, 250, .35); }
body[data-mode="usdt"] .tro-badge.tier-platinum::after { animation-duration: 6s; }
body[data-mode="usdt"] .tro-hero { background: linear-gradient(160deg, #131a23, #0a0e14); border: 1px solid rgba(201, 169, 97, .35); }
body[data-mode="usdt"] .tro-hero-icon { color: var(--gold); font-family: var(--serif); }
body[data-mode="usdt"] .mk-cat.active { color: var(--gold); border-color: rgba(201, 169, 97, .6); background: rgba(201, 169, 97, .1); }
body[data-mode="usdt"] .tro-bar i { background: linear-gradient(90deg, #8f7440, var(--gold)); }

/* small boards */
body[data-mode="usdt"] .ttt .cell { font-family: var(--serif); background: linear-gradient(145deg, #1a2330, #0e131a); border-color: rgba(201, 169, 97, .25); }
body[data-mode="usdt"] .c4 { background: #182232; box-shadow: inset 0 0 0 1px rgba(201, 169, 97, .45); }

/* the wallet page: the balance as an account card */
body[data-mode="usdt"] .shop-page .balance.big { flex-direction: column; gap: 4px; padding: 16px 38px; border-radius: 16px; background: linear-gradient(160deg, #141c28, #0b1017); border: 1px solid rgba(201, 169, 97, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 16px 36px rgba(0, 0, 0, .45); font-size: 30px; }
body[data-mode="usdt"] .shop-page .balance.big .usdt, body[data-mode="usdt"] .shop-page .balance.big .coin { width: 26px; height: 26px; }
body[data-mode="usdt"] .room-emoji { width: 26px; height: 26px; color: #e3c67f; display: flex; align-items: center; justify-content: center; }
body[data-mode="usdt"] .room-emoji .pa { width: 100%; height: 100%; }

/* ---------- support (the USDT wallet page → a conversation with the administration) ---------- */
.sp-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px; background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .015)); border: 1px solid rgba(201, 169, 97, .38); color: var(--text); text-align: left; cursor: pointer; font: inherit; transition: transform .12s, border-color .15s; }
.sp-link:active { transform: scale(.985); border-color: rgba(201, 169, 97, .7); }
.sp-link b { font-weight: 700; }
.sp-ico { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(201, 169, 97, .1); border: 1px solid rgba(201, 169, 97, .3); color: #e3c67f; flex-shrink: 0; }
.sp-arrow { font-size: 22px; line-height: 1; }
.sp-avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(201, 169, 97, .12); border: 1px solid rgba(201, 169, 97, .45); display: flex; align-items: center; justify-content: center; color: #e3c67f; flex-shrink: 0; }
.sp-ico .pa, .sp-avatar .pa { width: 24px; height: 24px; display: block; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sp-avatar .pa { width: 22px; height: 22px; }
body[data-mode="usdt"] .msg-bubble { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .1); }
body[data-mode="usdt"] .msg.mine .msg-bubble { background: linear-gradient(135deg, #b8964f, #8f7440); border-color: transparent; color: #1a1408; }
body[data-mode="usdt"] .msg.mine .msg-time { color: rgba(26, 20, 8, .6); }
body[data-mode="usdt"] .msg-author { color: var(--gold); }
body[data-mode="usdt"] .msg.system { color: #d9cdb0; background: rgba(201, 169, 97, .08); border: 1px solid rgba(201, 169, 97, .35); border-radius: 12px; text-align: left; padding: 8px 12px; }
body[data-mode="usdt"] .chat-head, body[data-mode="usdt"] .chat-bar { background: rgba(7, 9, 13, .92); border-color: rgba(201, 169, 97, .18); }
body[data-mode="usdt"] .chat-head .title { font-family: var(--serif); font-weight: 600; }
/* six tabs (with support): a touch tighter so every label fits a phone */
.tabbar.six .tab { font-size: 9.5px; letter-spacing: 0; }
.tabbar.six .tab .ico { font-size: 20px; }
body[data-mode="usdt"] .tabbar.six .tab { font-size: 8.5px; letter-spacing: .02em; }
