:root {
  --bg: #08080b;
  --card: #14141a;
  --card2: #1b1b23;
  --line: #26262f;
  --text: #f4f4f7;
  --muted: #86868f;
  --gold: #f5c451;
  --gold2: #ffe08a;
  --green: #46d97a;
  --red: #ff5f6d;
  --common: #8b8b96;
  --rare: #4da3ff;
  --epic: #a86bff;
  --legendary: #ffb020;
  --mythic: #ff5d8f;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(700px 420px at 50% -10%, rgba(245, 196, 81, 0.13), transparent 70%),
    radial-gradient(500px 400px at 100% 40%, rgba(120, 90, 255, 0.08), transparent 70%),
    var(--bg);
  min-height: 100vh;
}

#app { padding-bottom: 92px; max-width: 640px; margin: 0 auto; }

.hidden { display: none !important; }

/* --- верхняя панель --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 6px;
  gap: 10px;
}
.tb-left { display: flex; gap: 12px; }
.stat {
  display: flex; align-items: center; gap: 5px;
  font-size: 14px; color: var(--text); font-weight: 600;
}
.stat b { font-weight: 700; }
.tb-right { display: flex; align-items: center; gap: 8px; }

.pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 8px 7px 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
}
.pill .star { filter: drop-shadow(0 0 6px rgba(245, 196, 81, 0.5)); }
.pill .plus {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold); color: #1a1405;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 800; line-height: 1;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(145deg, #2a2a36, #17171e);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: var(--gold);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.demo-bar {
  margin: 8px 16px 0;
  display: flex; align-items: center; gap: 8px;
  background: rgba(77, 163, 255, 0.12);
  border: 1px solid rgba(77, 163, 255, 0.35);
  color: #9fd0ff;
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 13px;
}
.demo-bar span { flex: 1; }
.mini-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none; border-radius: 10px;
  color: #cfe9ff; font-size: 12px; font-weight: 600;
  padding: 5px 10px; font-family: inherit;
}

/* --- экраны --- */
.screen { padding: 8px 16px 0; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --- карточки каталога --- */
.cards-row {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding: 10px 2px 14px;
  scrollbar-width: none;
}
.cards-row::-webkit-scrollbar { display: none; }

.gcard {
  flex: 0 0 auto;
  width: 88px; height: 112px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, #232330, #16161d);
  color: var(--text);
  font-family: inherit;
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  transition: transform .15s, box-shadow .2s, border-color .2s;
}
.gcard .gval {
  position: absolute; top: 7px; left: 8px;
  font-size: 10px; font-weight: 700;
  color: #dfe4ee;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 2px 6px;
}
.gcard .gemoji { font-size: 30px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.gcard .gname { font-size: 10px; color: #b9bac4; }
.gcard.r-rare { background: linear-gradient(170deg, #1d2c44, #141a24); }
.gcard.r-epic { background: linear-gradient(170deg, #2c2244, #17141f); }
.gcard.r-legendary { background: linear-gradient(170deg, #40301a, #1c1610); }
.gcard.r-mythic { background: linear-gradient(170deg, #452030, #1d1116); }
.gcard.r-telegram { background: linear-gradient(170deg, #12303f, #101a20); }
.gcard.r-nft {
  background: linear-gradient(170deg, #3a2f12, #1a1710);
  border-color: rgba(201, 165, 54, 0.35);
}
.gcard.sel {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(245, 196, 81, 0.35), 0 8px 30px rgba(245, 196, 81, 0.28);
  transform: translateY(-2px);
}
.gcard:active { transform: scale(0.96); }

/* --- круг шанса --- */
.gauge-wrap { display: grid; place-items: center; padding: 6px 0 18px; }
.gauge {
  --p: 0;
  width: 270px; height: 270px;
  border-radius: 50%;
  background: conic-gradient(from -90deg, var(--gold) calc(var(--p) * 1%), #191920 calc(var(--p) * 1%));
  padding: 26px;
  box-shadow: 0 0 60px rgba(245, 196, 81, 0.12), inset 0 0 30px rgba(0,0,0,.4);
  transition: background .3s;
}
.gauge-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #16161d, #0d0d12 70%);
  border: 1px solid #22222b;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
}
.gauge-pct { font-size: 38px; font-weight: 800; letter-spacing: -1px; }
.gauge-label { font-size: 13px; color: var(--muted); }

/* --- слоты --- */
.slots { display: flex; gap: 8px; align-items: center; }
.slot-arrow {
  flex: 0 0 34px; width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 40% 30%, #2a2a36, #16161d);
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 17px; font-weight: 800; line-height: 1;
  box-shadow: 0 0 16px rgba(245, 196, 81, 0.14);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.slot-arrow.on {
  border-color: rgba(245, 196, 81, 0.5);
  box-shadow: 0 0 22px rgba(245, 196, 81, 0.35);
  animation: arrowPulse 1.6s ease-in-out infinite;
}
@keyframes arrowPulse {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}
.slot {
  flex: 1;
  min-width: 0;
  min-height: 132px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, #191922, #111117);
  color: var(--text);
  font-family: inherit;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px;
  position: relative;
}
.slot .s-emoji { font-size: 40px; }
.slot .s-shadow { font-size: 40px; opacity: 0.18; filter: blur(1px); }
.slot .s-name { font-size: 13px; font-weight: 600; }
.slot .s-val { font-size: 11px; color: var(--gold); font-weight: 700; }
.slot .s-cap {
  position: absolute; bottom: 8px; left: 10px; right: 10px;
  font-size: 10px; color: var(--muted); line-height: 1.25; text-align: left;
}
.slot.filled { border-color: rgba(245, 196, 81, 0.4); }

/* --- кнопка буста --- */
.boost-btn {
  width: 100%;
  margin-top: 14px;
  padding: 18px;
  border: none;
  border-radius: 22px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .3px;
  color: #1b1404;
  background: linear-gradient(180deg, var(--gold2), var(--gold));
  box-shadow: 0 10px 30px rgba(245, 196, 81, 0.28);
  transition: transform .12s, opacity .2s;
}
.boost-btn:active { transform: scale(0.98); }
.boost-btn.off {
  background: linear-gradient(180deg, #262630, #1d1d25);
  color: #6d6d78;
  box-shadow: none;
}
.hint { text-align: center; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }

/* --- вкладки --- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 12px;
  width: min(420px, calc(100% - 24px));
  background: rgba(24, 24, 31, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 10px;
  z-index: 20;
}
.tab {
  background: none; border: none; color: #9c9ca8;
  font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 6px;
  border-radius: 14px;
  transition: color .2s, transform .12s;
}
.tab span { font-size: 20px; line-height: 1; }
.tab small { font-size: 9px; letter-spacing: .2px; }
.tab.active { color: var(--gold); }
.tab:active { transform: scale(0.94); }
.tab-main {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold2), var(--gold));
  color: #1b1404;
  display: grid; place-items: center;
  margin-top: -26px;
  box-shadow: 0 8px 26px rgba(245, 196, 81, 0.4);
}
.tab-main span { font-size: 26px; }
.tab-main.active { color: #1b1404; }

/* --- магазин и топ --- */
.section-title {
  font-size: 15px; font-weight: 700;
  margin: 14px 2px 10px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.section-title small { font-size: 11px; color: var(--muted); font-weight: 500; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.item-top { display: flex; align-items: center; gap: 8px; }
.item-emoji { font-size: 26px; }
.item-name { font-size: 13px; font-weight: 600; }
.item-rar { font-size: 10px; color: var(--muted); }
.item-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-size: 13px; font-weight: 700; color: var(--gold); }

.btn {
  border: none; border-radius: 12px;
  font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 8px 12px;
  background: var(--card2);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn.gold { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #1b1404; border: none; }
.btn.wide { width: 100%; padding: 15px; font-size: 15px; border-radius: 16px; }
.btn:active { transform: scale(0.97); }

.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
}
.row .grow { flex: 1; min-width: 0; }
.row .t1 { font-size: 13px; font-weight: 600; }
.row .t2 { font-size: 11px; color: var(--muted); }
.row .amt { font-size: 13px; font-weight: 700; }
.row .amt.plus { color: var(--green); }
.row .amt.minus { color: var(--red); }

.empty {
  text-align: center; color: var(--muted); font-size: 13px;
  padding: 22px; border: 1px dashed var(--line); border-radius: 18px;
}

/* --- профиль --- */
.card {
  background: linear-gradient(160deg, #1c1c26, #121218);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 10px;
}
.big-balance { font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.big-balance small { font-size: 14px; color: var(--muted); font-weight: 500; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.btn-row .btn { flex: 1; padding: 12px; }

.field {
  width: 100%;
  background: #0e0e13;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 13px 14px;
  margin-top: 8px;
  outline: none;
}
.field:focus { border-color: rgba(245, 196, 81, 0.5); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.switch-row .t1 { font-size: 14px; font-weight: 600; }
.switch-row .t2 { font-size: 11px; color: var(--muted); }

.ref-link {
  margin-top: 10px;
  background: #0e0e13;
  border: 1px dashed #33333f;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 11px;
  color: #b9bac4;
  word-break: break-all;
}

/* --- шторка --- */
.sheet {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end;
  animation: fade .2s;
}
.sheet-card {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: #15151c;
  border-radius: 26px 26px 0 0;
  border-top: 1px solid var(--line);
  padding: 18px 18px 26px;
  max-height: 82vh;
  overflow-y: auto;
  animation: up .25s cubic-bezier(.2, .8, .3, 1);
}
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
.sheet-title { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.sheet-sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.amounts .btn { padding: 12px 4px; font-size: 14px; }
.amounts .btn.sel { border-color: var(--gold); color: var(--gold); }
.seg { display: flex; gap: 8px; margin-top: 8px; }
.seg .btn { flex: 1; }
.seg .btn.sel { border-color: var(--gold); color: var(--gold); }

.note { font-size: 11px; color: var(--muted); margin: 10px 0 4px; line-height: 1.4; }

/* --- модалка результата --- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  display: grid; place-items: center;
  padding: 24px;
}
.modal-card {
  width: 100%; max-width: 330px;
  background: linear-gradient(170deg, #1d1d27, #121218);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px 20px;
  text-align: center;
  animation: pop .3s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-emoji { font-size: 62px; line-height: 1.1; filter: drop-shadow(0 10px 24px rgba(0,0,0,.6)); }
.modal-title { font-size: 22px; font-weight: 800; margin: 8px 0 2px; }
.modal-title.win { color: var(--gold); }
.modal-title.lose { color: #9c9ca8; }
.modal-text { font-size: 13px; color: var(--muted); line-height: 1.4; }
.modal-sub { font-size: 11px; color: #5f5f6a; margin-top: 8px; }

/* --- тост --- */
.toast {
  position: fixed; left: 50%; bottom: 172px;
  transform: translate(-50%, 20px);
  background: #24242e;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 60;
  max-width: 86vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --- игры: общий каркас --- */
.chips {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 10px 2px 12px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b9bac4;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
}
.chip.on {
  background: linear-gradient(180deg, var(--gold2), var(--gold));
  color: #1b1404;
  border-color: transparent;
}

.panel {
  background: linear-gradient(170deg, #17171f, #101015);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.panel-title { font-size: 18px; font-weight: 800; }

/* --- колесо --- */
.wheel-wrap {
  position: relative;
  width: 260px; height: 260px;
  margin: 6px auto 4px;
  display: grid; place-items: center;
}
.wheel {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 6px solid #22222c;
  box-shadow: 0 0 40px rgba(245, 196, 81, 0.16), inset 0 0 30px rgba(0, 0, 0, 0.55);
  transition: transform 4s cubic-bezier(.15, .85, .12, 1);
}
.wheel-hub {
  position: absolute;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #2a2a36, #121217);
  border: 3px solid #34343f;
  display: grid; place-items: center;
  font-size: 30px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}
.wheel-arrow {
  position: absolute;
  top: -14px;
  width: 0; height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 18px solid var(--gold);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .7));
}
.legend {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  font-size: 11px; color: #b9bac4;
}
.legend .lg { display: flex; align-items: center; gap: 5px; }
.legend .lg i {
  width: 10px; height: 10px; border-radius: 3px; display: inline-block;
}

/* --- монетка и кости --- */
.coin {
  width: 118px; height: 118px;
  margin: 8px auto 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3a2f1b, #1b1710);
  border: 4px solid #7a5f24;
  display: grid; place-items: center;
  font-size: 56px;
  box-shadow: 0 0 40px rgba(245, 196, 81, 0.22);
}
.coin.flip { animation: coinFlip .55s linear infinite; }
@keyframes coinFlip {
  0% { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(90deg) scale(.9); }
  100% { transform: rotateY(180deg) scale(1); }
}

.dice-big {
  text-align: center;
  font-size: 78px;
  line-height: 1.1;
  color: var(--gold);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .6));
}
.dice-big.shake { animation: shake .5s ease-in-out infinite; }
@keyframes shake {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

#scr-games { padding-bottom: 128px; }

/* --- ряд игр внизу --- */
.game-rail {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 84px;
  width: min(420px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 6px;
  background: rgba(24, 24, 31, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 20px;
  z-index: 19;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}
.rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 7px 2px 6px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: none;
  color: #9c9ca8;
  font-family: inherit;
  transition: background .2s, color .2s, transform .12s;
}
.rail-btn span { font-size: 19px; line-height: 1.1; }
.rail-btn small { font-size: 9.5px; letter-spacing: .2px; }
.rail-btn.on {
  background: linear-gradient(180deg, rgba(245, 196, 81, .22), rgba(245, 196, 81, .08));
  border-color: rgba(245, 196, 81, .45);
  color: var(--gold2);
}
.rail-btn:active { transform: scale(0.95); }

/* --- кубик 3D --- */
.dice-stage {
  height: 150px;
  display: grid;
  place-items: center;
  perspective: 760px;
  margin: 4px 0 2px;
}
.dice3d {
  position: relative;
  width: 92px;
  height: 92px;
  transform-style: preserve-3d;
  transform: rotateX(-18deg) rotateY(-22deg);
  transition: transform 1s cubic-bezier(.18, .85, .2, 1);
}
.dice3d.rolling { animation: diceRoll .6s linear infinite; }
@keyframes diceRoll {
  0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  100% { transform: rotateX(360deg) rotateY(540deg) rotateZ(180deg); }
}
.die-face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(150deg, #fbf8f0, #d7d1c2);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 13px;
  gap: 3px;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, .13), 0 0 20px rgba(245, 196, 81, .12);
}
.die-face i { display: block; border-radius: 50%; background: transparent; }
.die-face i.on {
  background: #1b1b22;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, .35);
}
.die-face.front { transform: translateZ(46px); }
.die-face.back { transform: rotateY(180deg) translateZ(46px); }
.die-face.right { transform: rotateY(90deg) translateZ(46px); }
.die-face.left { transform: rotateY(-90deg) translateZ(46px); }
.die-face.top { transform: rotateX(90deg) translateZ(46px); }
.die-face.bottom { transform: rotateX(-90deg) translateZ(46px); }
.dice-readout {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  min-height: 20px;
}
.dice-readout.win { color: var(--gold2); }
.dice-readout.lose { color: #b9bac4; }
.dice-readout.win,
.dice-readout.lose { font-size: 21px; letter-spacing: .5px; }

/* --- анимация буста --- */
.gauge.spinning {
  animation: gaugeGlow .45s ease-in-out infinite alternate;
}
@keyframes gaugeGlow {
  from {
    transform: scale(.985);
    box-shadow: 0 0 40px rgba(245, 196, 81, .18), inset 0 0 30px rgba(0, 0, 0, .4);
  }
  to {
    transform: scale(1.035);
    box-shadow: 0 0 95px rgba(245, 196, 81, .55), inset 0 0 30px rgba(0, 0, 0, .4);
  }
}
.gauge.spinning .gauge-pct { color: var(--gold2); }
.boost-btn.busy {
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold2) 25%, var(--gold) 50%, var(--gold2) 75%, var(--gold) 100%);
  background-size: 220% 100%;
  color: #1b1404;
  box-shadow: 0 10px 34px rgba(245, 196, 81, .45);
  animation: shine 1s linear infinite;
}
@keyframes shine {
  from { background-position: 0% 0; }
  to { background-position: -220% 0; }
}

/* --- мины --- */
.mines-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.mines-mult { font-size: 28px; font-weight: 800; color: var(--gold); line-height: 1.1; }
.mines-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.cell {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, #232330, #15151c);
  color: var(--gold);
  font-size: 26px;
  font-family: inherit;
  transition: transform .12s, background .2s;
}
.cell:active { transform: scale(0.95); }
.cell.open {
  background: linear-gradient(170deg, #1d2c44, #141a24);
  border-color: rgba(77, 163, 255, .4);
}

/* --- админка --- */
.admin-btns { display: flex; gap: 6px; }
.admin-btns .btn { padding: 8px 10px; }

/* ==========================================================================
   Визуальный слой: глубокий фон, стекло, золотые акценты
   ========================================================================== */

:root {
  --gold: #f7c948;
  --gold2: #ffe9a8;
  --line: #2a2a35;
  --glass: rgba(17, 17, 23, 0.82);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
}

html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body { overflow-x: hidden; }

body::before {
  content: "";
  position: fixed;
  inset: -25% -15%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(closest-side at 18% 6%, rgba(245, 196, 81, 0.20), transparent),
    radial-gradient(closest-side at 88% 20%, rgba(126, 90, 255, 0.17), transparent),
    radial-gradient(closest-side at 50% 96%, rgba(63, 182, 255, 0.11), transparent);
  filter: blur(34px);
  animation: aurora 22s ease-in-out infinite alternate;
}
@keyframes aurora {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(0, -3%, 0) scale(1.08); }
}

#app {
  position: relative;
  z-index: 1;
  padding-bottom: calc(98px + env(safe-area-inset-bottom, 0px));
}

/* шапка */
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  padding: 12px 16px 10px;
  background: linear-gradient(180deg, rgba(8, 8, 11, 0.96) 30%, rgba(8, 8, 11, 0.55) 78%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.tb-left { gap: 8px; }
.stat {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 13px;
}
.stat span { font-size: 13px; opacity: 0.9; }

.pill {
  padding: 6px 6px 6px 12px;
  background:
    linear-gradient(180deg, #1c1c26, #121219) padding-box,
    linear-gradient(135deg, rgba(247, 201, 72, 0.65), rgba(247, 201, 72, 0.06) 55%, rgba(255, 255, 255, 0.12)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.pill .star { font-size: 14px; }
.pill .plus {
  width: 24px; height: 24px;
  background: linear-gradient(160deg, var(--gold2), var(--gold));
  box-shadow: 0 4px 12px rgba(247, 201, 72, 0.4);
}
.avatar {
  width: 36px; height: 36px;
  background: linear-gradient(160deg, #2c2c3a, #15151c);
  border: 1px solid rgba(247, 201, 72, 0.35);
  box-shadow: 0 0 0 3px rgba(247, 201, 72, 0.08), 0 6px 16px rgba(0, 0, 0, 0.4);
  font-size: 15px;
}

.demo-bar {
  margin: 6px 16px 0;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(77, 163, 255, 0.16), rgba(77, 163, 255, 0.07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

/* каталог */
.cards-row { gap: 12px; padding: 12px 2px 16px; }
.gcard {
  width: 92px; height: 118px;
  border-radius: 22px;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.gcard::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 46%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
  pointer-events: none;
}
.gcard .gval {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 9.5px;
}
.gcard .gemoji { font-size: 32px; }
.gcard .gname {
  font-size: 10px; line-height: 1.15;
  padding: 0 4px;
  text-align: center;
  color: #c6c7d2;
}
.gcard.sel {
  border-color: rgba(247, 201, 72, 0.9);
  box-shadow: 0 0 0 2px rgba(247, 201, 72, 0.25), 0 12px 32px rgba(247, 201, 72, 0.25);
}

/* круг шанса */
.gauge-wrap { position: relative; padding: 10px 0 22px; }
.gauge-wrap::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 250px; height: 250px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 201, 72, 0.22), transparent 68%);
  filter: blur(22px);
  pointer-events: none;
}
.gauge {
  position: relative;
  width: 252px; height: 252px;
  padding: 20px;
  background: conic-gradient(
    from -90deg,
    var(--gold2) 0%,
    var(--gold) calc(var(--p) * 1%),
    #1a1a22 calc(var(--p) * 1%),
    #141419 100%
  );
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(247, 201, 72, 0.18),
    inset 0 0 24px rgba(0, 0, 0, 0.45);
}
.gauge::after {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.07);
  pointer-events: none;
}
.gauge-inner {
  position: relative;
  background:
    radial-gradient(circle at 50% 32%, rgba(247, 201, 72, 0.10), transparent 55%),
    radial-gradient(circle at 50% 45%, #16161d, #0b0b10 72%);
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55);
}
.gauge-inner::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.06);
}
.gauge-pct {
  font-size: 42px;
  background: linear-gradient(180deg, #ffffff, #ffd977);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 18px rgba(247, 201, 72, 0.25));
}
.gauge-label {
  font-size: 10px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: #9797a3;
}

/* слоты */
.slot {
  min-height: 128px;
  border-radius: 24px;
  border-color: rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 42%),
    linear-gradient(170deg, #1a1a23, #101015);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color .2s, box-shadow .2s, transform .12s;
}
.slot:active { transform: scale(0.98); }
.slot.filled {
  border-color: rgba(247, 201, 72, 0.55);
  box-shadow:
    0 0 0 1px rgba(247, 201, 72, 0.18),
    0 14px 34px rgba(0, 0, 0, 0.45),
    0 0 30px rgba(247, 201, 72, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.slot .s-emoji { font-size: 42px; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55)); }
.slot .s-cap { font-size: 9.5px; letter-spacing: .2px; }
.slot-arrow {
  background: linear-gradient(160deg, #26262f, #141419);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 18px rgba(247, 201, 72, 0.18);
}

/* кнопка буста */
.boost-btn {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 19px;
  background: linear-gradient(180deg, #ffe9a8, #f7c948 55%, #e0ab2c);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 14px 36px rgba(247, 201, 72, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  letter-spacing: .4px;
}
.boost-btn:not(.off)::after {
  content: "";
  position: absolute;
  top: -10%; left: -60%;
  width: 38%; height: 120%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  animation: btnShine 3.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btnShine {
  0%, 62% { left: -60%; }
  100% { left: 130%; }
}
.boost-btn.off {
  background: linear-gradient(180deg, #24242e, #1a1a22);
  border-color: rgba(255, 255, 255, 0.05);
  color: #6d6d78;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.hint {
  font-size: 11.5px;
  line-height: 1.5;
  max-width: 320px;
  margin: 12px auto 2px;
  color: #8f8f9b;
}

/* вкладки */
.tabbar {
  background: rgba(14, 14, 19, 0.86);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
.tab { color: #8d8d99; gap: 3px; }
.tab span { transition: transform .2s, filter .2s; }
.tab.active span { filter: drop-shadow(0 0 10px rgba(247, 201, 72, 0.6)); transform: translateY(-1px); }
.tab.active small { color: var(--gold); opacity: 1; }
.tab small { opacity: .85; }
.tab-main {
  background: linear-gradient(160deg, #ffe9a8, #f7c948 60%, #e0ab2c);
  box-shadow:
    0 0 0 4px rgba(10, 10, 14, 0.9),
    0 0 0 5px rgba(247, 201, 72, 0.35),
    0 10px 30px rgba(247, 201, 72, 0.45);
}

/* заголовки и списки */
.section-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #b9bac6;
  margin: 18px 2px 12px;
}
.section-title::before {
  content: "";
  display: inline-block;
  width: 3px; height: 13px;
  margin-right: 8px;
  vertical-align: -2px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--gold2), #d9a62f);
  box-shadow: 0 0 10px rgba(247, 201, 72, 0.5);
}
.section-title small { text-transform: none; letter-spacing: 0; }

.item {
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%),
    linear-gradient(165deg, #17171f, #111116);
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 12px 12px 13px;
}
.item-emoji {
  width: 40px; height: 40px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 24px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.item-name { font-size: 12.5px; }
.price { font-size: 12.5px; }

.row {
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 45%),
    var(--card);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  padding: 11px 12px;
}
.row:active { background: var(--card2); }

.btn {
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.btn.gold {
  background: linear-gradient(180deg, #ffe9a8, #f7c948 60%, #e5b23a);
  box-shadow: 0 6px 18px rgba(247, 201, 72, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn.sel {
  border-color: rgba(247, 201, 72, 0.65);
  color: var(--gold);
  box-shadow: 0 0 0 1px rgba(247, 201, 72, 0.18), 0 0 18px rgba(247, 201, 72, 0.16);
}
.empty {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.015);
}

/* профиль */
.card {
  border-radius: 24px;
  border-color: rgba(255, 255, 255, 0.07);
  background:
    radial-gradient(420px 180px at 12% -20%, rgba(247, 201, 72, 0.10), transparent 70%),
    linear-gradient(165deg, #1a1a23, #111116);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.big-balance {
  font-size: 34px;
  background: linear-gradient(180deg, #ffffff, #ffdf8d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 18px rgba(247, 201, 72, 0.18));
}
.big-balance small {
  -webkit-text-fill-color: #86868f;
  color: #86868f;
  font-size: 13px;
}
.field {
  border-radius: 15px;
  background: rgba(8, 8, 12, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
}
.field:focus { box-shadow: 0 0 0 3px rgba(247, 201, 72, 0.10); }
.ref-link {
  border-color: rgba(247, 201, 72, 0.22);
  background: rgba(8, 8, 12, 0.7);
}

/* шторка и модалка */
.sheet {
  background: rgba(3, 3, 6, 0.66);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.sheet-card {
  background:
    radial-gradient(520px 220px at 50% -10%, rgba(247, 201, 72, 0.10), transparent 70%),
    #14141b;
  border-top-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.55);
}
.sheet-card::before {
  content: "";
  display: block;
  width: 44px; height: 4px;
  margin: -6px auto 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}
.sheet-title { font-size: 18px; }
.modal {
  background: rgba(3, 3, 6, 0.74);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.modal-card {
  background:
    radial-gradient(360px 200px at 50% 0%, rgba(247, 201, 72, 0.13), transparent 70%),
    linear-gradient(170deg, #1e1e29, #111116);
  border-color: rgba(247, 201, 72, 0.22);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.modal-emoji { filter: drop-shadow(0 12px 28px rgba(247, 201, 72, 0.25)); }
.modal-title.win {
  background: linear-gradient(180deg, #fff3cf, #f7c948);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* игры */
.panel {
  border-radius: 26px;
  border-color: rgba(255, 255, 255, 0.07);
  background:
    radial-gradient(420px 200px at 50% -18%, rgba(247, 201, 72, 0.09), transparent 70%),
    linear-gradient(170deg, #17171f, #0f0f14);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 18px;
}
.panel-title { letter-spacing: .2px; }
.chip.on {
  background: linear-gradient(180deg, #ffe9a8, #f7c948 65%, #e5b23a);
  box-shadow: 0 6px 18px rgba(247, 201, 72, 0.28);
}
.game-rail {
  background: rgba(14, 14, 19, 0.9);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}
#scr-games { padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px)); }
.rail-btn.on {
  background: linear-gradient(180deg, rgba(247, 201, 72, 0.24), rgba(247, 201, 72, 0.08));
  box-shadow: 0 0 18px rgba(247, 201, 72, 0.18);
}
.cell {
  border-radius: 18px;
  border-color: rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 45%),
    linear-gradient(170deg, #20202b, #131319);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.wheel { border-color: #262631; }
.wheel-wrap::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 201, 72, 0.18), transparent 66%);
  filter: blur(16px);
  pointer-events: none;
}
.coin { box-shadow: 0 0 0 1px rgba(247, 201, 72, 0.25), 0 0 50px rgba(247, 201, 72, 0.28); }

/* мелкие экраны */
@media (max-width: 360px) {
  .gauge { width: 228px; height: 228px; }
  .gauge-pct { font-size: 36px; }
  .slot .s-emoji { font-size: 36px; }
  .slot .s-cap { font-size: 9px; }
  .gcard { width: 84px; height: 110px; }
}

/* ==========================================================================
   Полировка: свет, ритм, акценты
   ========================================================================== */

:root {
  --rc: #8b8b96;
  --gold-line: rgba(247, 201, 72, 0.22);
}

body {
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* мягкое зерно поверх фона — глубина без картинки */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.028;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}

#balance, #demoBal, #refs, #wagered, #chancePct, .big-balance, .price, .amt, .mines-mult {
  font-variant-numeric: tabular-nums;
}

/* шапка */
.topbar::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
  opacity: 0.8;
}
.pill {
  transition: transform .12s, box-shadow .2s;
}
.pill:active { transform: scale(0.96); }
.pill b {
  font-size: 15px;
  letter-spacing: .2px;
  background: linear-gradient(180deg, #ffffff, #ffd97a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat {
  transition: background .2s, border-color .2s;
}
.stat b { letter-spacing: .2px; }

/* каталог: плавное выравнивание карточек и цвет редкости */
.cards-row {
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.gcard {
  scroll-snap-align: start;
  --rc: #8b8b96;
}
.gcard.r-rare { --rc: #4da3ff; }
.gcard.r-epic { --rc: #a86bff; }
.gcard.r-legendary { --rc: #ffb020; }
.gcard.r-mythic { --rc: #ff5d8f; }
.gcard.r-telegram { --rc: #3fc3d9; }
.gcard.r-nft { --rc: #d8b455; }
.gcard::after {
  content: "";
  position: absolute;
  left: 18px; right: 18px; bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--rc), transparent);
  opacity: 0.55;
}
.gcard.sel::after { opacity: 1; }
.gcard:active { transform: scale(0.95) translateY(1px); }

/* круг шанса: медленное световое кольцо */
.gauge-wrap::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 276px; height: 276px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 76%, rgba(247, 201, 72, 0.55) 88%, transparent 96%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  opacity: 0.7;
  pointer-events: none;
  animation: orbit 9s linear infinite;
}
@keyframes orbit {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.gauge.spinning { animation: gaugeGlow .45s ease-in-out infinite alternate; }

/* слоты */
.slot .s-val {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(247, 201, 72, 0.09);
  border: 1px solid rgba(247, 201, 72, 0.20);
  font-size: 10.5px;
}
.slot .s-shadow { filter: blur(0.5px) drop-shadow(0 10px 18px rgba(0, 0, 0, .5)); }

/* кнопка буста */
.boost-btn {
  font-size: 17.5px;
  letter-spacing: .6px;
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.boost-btn:not(.off):active {
  transform: translateY(2px) scale(0.995);
  box-shadow: 0 6px 18px rgba(247, 201, 72, 0.28), inset 0 2px 6px rgba(120, 80, 0, 0.25);
}
.boost-btn:not(.off) {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* нижнее меню: активная вкладка подсвечена плашкой */
.tab {
  position: relative;
  border-radius: 15px;
  padding: 5px 9px 4px;
  transition: color .2s, background .2s, transform .12s;
}
.tab.active {
  background: radial-gradient(circle at 50% 120%, rgba(247, 201, 72, 0.16), rgba(247, 201, 72, 0.03));
  color: var(--gold2);
}
.tab.active small { color: var(--gold2); letter-spacing: .3px; }
.tab-main { padding: 0; border-radius: 50%; }
.rail-btn.on { color: #fff3cf; }

/* магазин: карточка с полоской редкости */
.item {
  position: relative;
  overflow: hidden;
  transition: transform .14s, border-color .2s, box-shadow .2s;
}
.item::before {
  content: "";
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--rc, #8b8b96);
  box-shadow: 0 0 14px var(--rc, #8b8b96);
  opacity: 0.85;
}
.item:active { transform: scale(0.985); }
.item .item-emoji {
  font-size: 23px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.10), transparent 70%),
    rgba(255, 255, 255, 0.045);
}
.item .btn.gold {
  padding: 7px 11px;
  font-size: 12px;
  border-radius: 11px;
}

/* топ: призовые места */
.top-row.p1 {
  background:
    linear-gradient(90deg, rgba(247, 201, 72, 0.17), rgba(247, 201, 72, 0.02));
  border-color: rgba(247, 201, 72, 0.38);
  box-shadow: 0 8px 24px rgba(247, 201, 72, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.top-row.p2 {
  background: linear-gradient(90deg, rgba(200, 212, 228, 0.12), rgba(200, 212, 228, 0.015));
  border-color: rgba(200, 212, 228, 0.28);
}
.top-row.p3 {
  background: linear-gradient(90deg, rgba(214, 141, 86, 0.13), rgba(214, 141, 86, 0.015));
  border-color: rgba(214, 141, 86, 0.28);
}
.top-row.p1 .t1, .top-row.p2 .t1, .top-row.p3 .t1 { font-size: 14px; }

/* заявки: цвет статуса */
.row.st-new .t2 { color: #f2c46a; }
.row.st-done .t2 { color: var(--green); }
.row.st-rejected .t2 { color: var(--red); }

/* профиль */
.card { position: relative; overflow: hidden; }
.card > * { position: relative; }
.big-balance {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.big-balance small { letter-spacing: .2px; }
.field {
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field::placeholder { color: #62626e; }
.btn {
  min-height: 38px;
  transition: transform .12s, box-shadow .2s, background .2s, border-color .2s;
}

/* шторка: аккуратные суммы и кнопки */
.amounts { grid-template-columns: repeat(3, 1fr); }
.amounts .btn {
  padding: 13px 4px;
  border-radius: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sheet-card .btn.wide.gold { margin-top: 14px; }
.sheet-title { letter-spacing: .2px; }

/* модалка: лучи за подарком */
.modal-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.modal-card > * { position: relative; z-index: 1; }
.modal-card::before {
  content: "";
  position: absolute;
  left: 50%; top: 34%;
  width: 520px; height: 520px;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(247, 201, 72, 0.13) 0deg 4deg,
    transparent 4deg 16deg
  );
  -webkit-mask: radial-gradient(circle at 50% 50%, #000 0 22%, transparent 62%);
  mask: radial-gradient(circle at 50% 50%, #000 0 22%, transparent 62%);
  opacity: 0.9;
  animation: rays 40s linear infinite;
}
@keyframes rays {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* игры: панель и рельс */
.panel-title {
  font-size: 19px;
  letter-spacing: .1px;
}
.panel .btn.wide.gold {
  font-size: 15.5px;
  letter-spacing: .3px;
  padding: 15px;
  border-radius: 16px;
}
.chip { transition: background .2s, color .2s, border-color .2s, transform .12s; }
.chip:active { transform: scale(0.96); }
.legend .lg {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* тост */
.toast {
  background: rgba(28, 28, 37, 0.96);
  border-color: rgba(247, 201, 72, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
}

@media (max-width: 360px) {
  .gauge-wrap::after { width: 250px; height: 250px; }
  .tab { padding: 4px 6px 3px; }
  .big-balance { font-size: 30px; }
}

/* меньше движения — тем же людям спокойнее */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .boost-btn::after { display: none; }
  .slot-arrow.on { animation: none; }
  .gauge.spinning { animation: none; }
  .screen { animation: none; }
  .gauge-wrap::after { animation: none; opacity: .35; }
  .modal-card::before { animation: none; }
}


/* ==========================================================================
   Рулетка, кейсы, башня, честная игра
   ========================================================================== */

/* семь игр в нижнем ряду */
.game-rail { grid-template-columns: repeat(7, 1fr); }
.game-rail .rail-btn { padding: 7px 0 6px; }
.game-rail .rail-btn span { font-size: 18px; }
.game-rail .rail-btn small { font-size: 8.5px; white-space: nowrap; }

/* рулетка */
.rl-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #12121a, #0c0c11);
  padding: 8px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.rl-tape { display: flex; gap: 6px; padding: 0 6px; will-change: transform; }
.rl-cell {
  flex: 0 0 auto;
  width: 44px; height: 52px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 800;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.rl-cell.red { background: linear-gradient(180deg, #b7323f, #7d1b25); }
.rl-cell.black { background: linear-gradient(180deg, #2b2b36, #15151c); }
.rl-cell.green { background: linear-gradient(180deg, #2f8f5b, #17603a); }
.rl-pointer {
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  transform: translateX(-1px);
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
  box-shadow: 0 0 14px rgba(247, 201, 72, .8);
  pointer-events: none;
}
.rl-sel {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold2);
  margin-top: 2px;
}
.rl-bets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rl-bets.two { grid-template-columns: repeat(2, 1fr); }
.rl-bets .btn { padding: 10px 4px; font-size: 12px; }
.rl-numbers { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.rn {
  padding: 9px 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .07);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  background: #1a1a22;
}
.rn.red { background: linear-gradient(180deg, #7d1b25, #4f1116); }
.rn.black { background: linear-gradient(180deg, #2b2b36, #15151c); }
.rn.green { background: linear-gradient(180deg, #2f8f5b, #17603a); }
.rn.sel { outline: 2px solid var(--gold); outline-offset: 1px; }
.rn:active { transform: scale(.94); }

/* кейсы */
.case-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.case-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(247, 201, 72, .18), transparent 70%),
    linear-gradient(170deg, #1a1a23, #101015);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  overflow: hidden;
}
.case-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), transparent 35%);
  pointer-events: none;
}
.cs-face {
  font-size: 46px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .55));
}
.cs-name { font-size: 15px; font-weight: 800; }
.cs-preview { display: flex; gap: 5px; opacity: .9; }
.cs-emoji { font-size: 18px; }
.cs-top { font-size: 11px; color: var(--muted); }
.cs-price { font-size: 14px; font-weight: 800; color: var(--gold); }
.case-card .btn { max-width: 220px; }
.case-strip-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #12121a, #0b0b10);
  padding: 10px 0;
}
.case-strip { display: flex; gap: 8px; padding: 0 8px; will-change: transform; }
.case-cell {
  flex: 0 0 auto;
  width: 62px; height: 74px;
  border-radius: 14px;
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--rc, var(--line));
  background: linear-gradient(170deg, #1d1d27, #121218);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.case-cell span { font-size: 26px; }
.case-cell small { font-size: 10px; color: var(--gold); font-weight: 700; }
.case-line {
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  transform: translateX(-1px);
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
  box-shadow: 0 0 14px rgba(247, 201, 72, .75);
  pointer-events: none;
}

/* башня */
.tower-grid { display: flex; flex-direction: column; gap: 6px; }
.tw-row {
  display: grid;
  grid-template-columns: 22px repeat(3, 1fr) 48px;
  gap: 6px;
  align-items: center;
  padding: 3px 4px;
  border-radius: 12px;
}
.tw-row.on { background: rgba(247, 201, 72, .07); box-shadow: inset 0 0 0 1px rgba(247, 201, 72, .22); }
.tw-floor { font-size: 11px; color: var(--muted); text-align: center; }
.tw-mult { font-size: 12px; font-weight: 700; color: #b9bac4; text-align: right; }
.tw-row.on .tw-mult { color: var(--gold2); }
.tw-cell {
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, #232330, #15151c);
  color: var(--gold);
  font-family: inherit;
  font-size: 18px;
  display: grid; place-items: center;
}
.tw-cell.pick {
  cursor: pointer;
  background: linear-gradient(170deg, #2a2a3a, #191922);
  border-color: rgba(247, 201, 72, .4);
  box-shadow: 0 0 16px rgba(247, 201, 72, .12);
  animation: twPulse 1.8s ease-in-out infinite;
}
.tw-cell.pick:active { transform: scale(.95); }
.tw-cell.safe { background: linear-gradient(170deg, #1d2c44, #141a24); border-color: rgba(77, 163, 255, .4); }
.tw-cell.muted { opacity: .35; }
.tw-cell.locked { opacity: .18; }
@keyframes twPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(247, 201, 72, .10); }
  50% { box-shadow: 0 0 22px rgba(247, 201, 72, .28); }
}

/* честная игра */
.fair-hash {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10.5px;
  line-height: 1.5;
  color: #b9bac4;
  word-break: break-all;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

@media (max-width: 360px) {
  .game-rail .rail-btn small { font-size: 8px; }
  .rl-cell { width: 40px; height: 48px; }
  .tw-row { grid-template-columns: 18px repeat(3, 1fr) 42px; gap: 4px; }
  .tw-cell { height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .tw-cell.pick { animation: none; }
}
