/* Стиль CONTR BRAIN: синий лёд против красного огня, золото короны, рубленые буквы */
:root {
  --bg: #04060e; --bg2: #0b0f1f; --card: #0e1428; --card2: #141c38; --line: #1f2a52;
  --text: #f2f5ff; --muted: #8e9ac4;
  --ice: #5ecbff; --blue: #1e8bff; --blue2: #0a5be0; --red: #ff2d3d; --red2: #c40f22; --gold: #ffc531; --green: #2fe08a;
  --r: 16px;
  --c0: #8e9ac4; --c1: #1e8bff; --c2: #a855f7; --c3: #ff2d3d; --c4: #ffc531;
  /* редкости Steal a Brainrot */
  --r-common: #a9b3c9; --r-rare: #2fe08a; --r-epic: #a855f7; --r-legendary: #ffc531; --r-mythic: #ff2d3d;
  --r-god: #ff5ad8; --r-secret: #f2f5ff; --r-og: #22e6ff;
  --head: "Russo One", "Arial Black", Impact, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.35 -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding: 64px 0 82px; min-height: 100vh; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70% 45% at -10% 15%, rgba(30, 139, 255, .38), transparent 70%),
    radial-gradient(70% 45% at 110% 15%, rgba(255, 45, 61, .34), transparent 70%),
    radial-gradient(60% 40% at 50% 110%, rgba(255, 197, 49, .10), transparent 70%),
    var(--bg); }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .14;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cpath d='M30 0 L50 60 L35 62 L60 130 L42 132 L70 240' stroke='%235ecbff' stroke-width='1.4' fill='none'/%3E%3Cpath d='M200 0 L180 50 L196 54 L170 120 L188 124 L160 240' stroke='%23ff4d5a' stroke-width='1.4' fill='none'/%3E%3C/svg%3E"); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; color: var(--text); }
img { display: block; }
.hd { font-family: var(--head); letter-spacing: .5px; text-transform: uppercase; }

/* шапка */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: 58px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; background: rgba(4, 6, 14, .9); backdrop-filter: blur(12px);
  border-bottom: 2px solid transparent; border-image: linear-gradient(90deg, var(--blue), var(--gold), var(--red)) 1; }
.logo { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.logo img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 12px rgba(94, 203, 255, .5); flex: none; }
.logo b { font-family: var(--head); font-size: 19px; white-space: nowrap; line-height: 1; }
.t-ice { background: linear-gradient(180deg, #bdf0ff, var(--ice) 45%, var(--blue2)); -webkit-background-clip: text; background-clip: text;
  color: transparent; filter: drop-shadow(0 0 6px rgba(94, 203, 255, .6)); }
.t-fire { background: linear-gradient(180deg, #ffb0b0, var(--red) 50%, var(--red2)); -webkit-background-clip: text; background-clip: text;
  color: transparent; filter: drop-shadow(0 0 6px rgba(255, 45, 61, .6)); }
.t-gold { background: linear-gradient(180deg, #fff1b0, var(--gold) 55%, #d08800); -webkit-background-clip: text; background-clip: text; color: transparent; }
.balance { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 12px; background: var(--card);
  border: 1px solid rgba(255, 197, 49, .35); font-weight: 800; box-shadow: inset 0 0 12px rgba(255, 197, 49, .08); }
.coin { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font: 900 11px var(--head);
  color: #5a3a00; background: radial-gradient(circle at 35% 30%, #fff0a0, var(--gold) 55%, #c98200); flex: none;
  box-shadow: 0 0 6px rgba(255, 197, 49, .6); }
.plus { width: 40px; height: 40px; border-radius: 12px; font: 700 26px/1 var(--head);
  background: linear-gradient(180deg, #ffd85c, #f0a000); color: #3a2400; box-shadow: 0 3px 0 #a86f00, 0 0 16px rgba(255, 197, 49, .45); }

main { padding: 12px; }

/* нижние вкладки */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(4, 6, 14, .95); padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
  border-top: 2px solid transparent; border-image: linear-gradient(90deg, var(--blue), var(--gold), var(--red)) 1; }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; position: relative; }
.tabs i { font-style: normal; font-size: 22px; filter: grayscale(.85); opacity: .6; transition: .15s; }
.tabs button.on { color: #fff; font-weight: 700; }
.tabs button.on i { filter: drop-shadow(0 0 8px rgba(94, 203, 255, .9)); opacity: 1; transform: translateY(-2px) scale(1.08); }
.tabs button[data-tab="battles"].on i { filter: drop-shadow(0 0 8px rgba(255, 45, 61, .9)); }
.tabs button.on::after { content: ""; position: absolute; top: -8px; left: 25%; right: 25%; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--blue), var(--red)); box-shadow: 0 0 10px var(--blue); }

/* общие */
.h { font: 17px var(--head); text-transform: uppercase; letter-spacing: .5px; margin: 20px 2px 10px; display: flex; align-items: center; justify-content: space-between; }
.h small { font: 500 12px -apple-system, "Segoe UI", sans-serif; text-transform: none; color: var(--muted); }
.muted { color: var(--muted); }
.card { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border-radius: 14px;
  font: 16px var(--head); text-transform: uppercase; letter-spacing: .5px;
  background: linear-gradient(180deg, #4fb4ff, var(--blue) 50%, var(--blue2)); box-shadow: 0 4px 0 #06399a, 0 0 18px rgba(30, 139, 255, .35);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #06399a; }
.btn.gold { background: linear-gradient(180deg, #ffe07a, var(--gold) 50%, #e69500); color: #3a2400; box-shadow: 0 4px 0 #a86f00, 0 0 18px rgba(255, 197, 49, .35); text-shadow: none; }
.btn.red { background: linear-gradient(180deg, #ff6b74, var(--red) 50%, var(--red2)); box-shadow: 0 4px 0 #7d0614, 0 0 18px rgba(255, 45, 61, .4); }
.btn.green { background: linear-gradient(180deg, #5ff0a6, #1cc06a); box-shadow: 0 4px 0 #0c7a40, 0 0 18px rgba(47, 224, 138, .3); }
.btn.ghost { background: var(--card2); box-shadow: none; border: 1px solid var(--line); font-size: 14px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; min-width: 0; }
.price { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.price .coin { width: 16px; height: 16px; font-size: 9px; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }

/* баннер CONTR BRAIN */
.hero { position: relative; height: 170px; border-radius: 18px; overflow: hidden; border: 2px solid transparent;
  background: linear-gradient(var(--bg), var(--bg)) padding-box, linear-gradient(90deg, var(--blue), var(--gold), var(--red)) border-box; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 80%; }
.hero .cta { position: absolute; z-index: 2; right: 10px; top: 10px; }
.hero .cta .btn { width: auto; padding: 8px 12px; font-size: 12px; }

/* топ дроп */
.topdrop { display: flex; align-items: center; gap: 12px; padding: 12px; margin-top: 12px; border-radius: var(--r);
  background: linear-gradient(90deg, rgba(255, 197, 49, .18), rgba(255, 197, 49, .02)); border: 1px solid rgba(255, 197, 49, .45);
  box-shadow: 0 0 20px rgba(255, 197, 49, .12); }
.topdrop .pic { width: 64px; height: 64px; flex: none; }
.topdrop .t1 { font: 11px var(--head); color: var(--gold); letter-spacing: .5px; }
.topdrop .t2 { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topdrop .grow { flex: 1; min-width: 0; }

/* лента */
.feed { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.feed::-webkit-scrollbar { display: none; }
.feed .f { flex: none; width: 74px; text-align: center; font-size: 11px; color: var(--muted); }
.feed .f .pic { width: 74px; height: 74px; border-radius: 12px; background: var(--card); border-bottom: 3px solid var(--rc, var(--c0)); }
.feed .f b { display: block; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* картинки */
.pic { position: relative; display: grid; place-items: center; overflow: hidden; }
.pic img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
.pic .ph { font-size: 34px; }
.glow { background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--rc, var(--c0)) 50%, transparent), transparent 70%); }

.search { width: 100%; margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); outline: none; }
.search:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 139, 255, .2); }

/* сетки */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.case { position: relative; padding: 10px; border-radius: var(--r); text-align: center; overflow: hidden; border: 2px solid transparent;
  background: linear-gradient(180deg, var(--card2), var(--card)) padding-box, linear-gradient(135deg, var(--blue), transparent 45%, transparent 55%, var(--red)) border-box; }
.case:nth-child(even) { background: linear-gradient(180deg, var(--card2), var(--card)) padding-box, linear-gradient(225deg, var(--red), transparent 45%, transparent 55%, var(--blue)) border-box; }
.case .pic { height: 118px; }
.case .t { font: 14px var(--head); text-transform: uppercase; margin: 6px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case .price { padding: 5px 12px; border-radius: 10px; background: rgba(255, 197, 49, .12); border: 1px solid rgba(255, 197, 49, .3); }
.br { position: relative; padding: 8px 6px; border-radius: 12px; background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line);
  border-bottom: 3px solid var(--rc, var(--c0)); text-align: center; font-size: 12px; }
.br .pic { height: 74px; }
.br .n { font-weight: 700; margin: 4px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br .ch { position: absolute; top: 4px; left: 6px; z-index: 1; font-size: 10px; color: var(--muted); font-weight: 700; }
.br .wd { position: absolute; top: 4px; right: 6px; font-size: 11px; }
.br.sel { outline: 2px solid var(--ice); background: #10244d; box-shadow: 0 0 14px rgba(94, 203, 255, .4); }

/* экран кейса */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.casehead { text-align: center; }
.casehead .pic { height: 170px; }
.casehead h2 { margin: 6px 0 12px; font: 24px var(--head); text-transform: uppercase; }
.roll { position: relative; height: 128px; margin: 10px -12px 14px; overflow: hidden; background: rgba(0, 0, 0, .35);
  border-top: 2px solid var(--blue); border-bottom: 2px solid var(--red); }
.roll .strip { display: flex; gap: 6px; padding: 10px 0; will-change: transform; }
.roll .strip .br { flex: none; width: 100px; }
.roll::before, .roll::after { content: ""; position: absolute; left: 50%; z-index: 2; transform: translateX(-50%); border: 9px solid transparent; }
.roll::before { top: 0; border-top-color: var(--gold); }
.roll::after { bottom: 0; border-bottom-color: var(--gold); }
.roll .line { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--gold); z-index: 2; box-shadow: 0 0 10px var(--gold); }

/* апгрейд */
.upg { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.upg > * { min-width: 0; }
.slot { min-height: 150px; border-radius: var(--r); border: 2px dashed var(--line); display: grid; place-items: center; padding: 8px;
  text-align: center; color: var(--muted); font-size: 13px; }
.slot.full { border-style: solid; color: var(--text); }
.slot.full.l { border-color: var(--blue); box-shadow: 0 0 16px rgba(30, 139, 255, .3); }
.slot.full.r { border-color: var(--red); box-shadow: 0 0 16px rgba(255, 45, 61, .3); }
.slot .pic { width: 90px; height: 90px; margin: 0 auto; }
.dial { position: relative; width: 120px; height: 120px; }
.dial svg { width: 120px; height: 120px; transform: rotate(-90deg); filter: drop-shadow(0 0 8px rgba(30, 139, 255, .6)); }
.dial .pct { position: absolute; inset: 0; display: grid; place-items: center; font: 22px var(--head); }
.dial .needle { position: absolute; left: 50%; top: 50%; width: 4px; height: 54px; margin-left: -2px; background: var(--gold);
  border-radius: 2px; transform-origin: 50% 0; transform: rotate(180deg); box-shadow: 0 0 10px var(--gold); }

/* бесплатно */
.cond { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); margin-top: 8px; }
.cond .ok { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 900; background: var(--red); }
.cond .ok.y { background: var(--green); }
.cond .grow { flex: 1; min-width: 0; }
.cond .btn { width: auto; padding: 8px 12px; font-size: 12px; box-shadow: none; }
.timer { font: 30px var(--head); text-align: center; margin: 10px 0; font-variant-numeric: tabular-nums; }

/* батлы */
.bt { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 10px; border-radius: var(--r); border: 2px solid transparent;
  background: linear-gradient(180deg, var(--card2), var(--card)) padding-box, linear-gradient(90deg, var(--blue), var(--red)) border-box; }
.bt.done { opacity: .75; background: linear-gradient(180deg, var(--card2), var(--card)) padding-box, linear-gradient(90deg, var(--line), var(--line)) border-box; }
.bt .pic { width: 58px; height: 58px; flex: none; }
.bt .grow { flex: 1; min-width: 0; }
.bt .t { font: 14px var(--head); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt .btn { width: auto; padding: 9px 12px; font-size: 12px; }
.seats { display: flex; gap: 4px; margin: 4px 0; }
.seats span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--bg2); border: 1px dashed var(--line); }
.seats span.f { border: 0; background: linear-gradient(135deg, var(--blue), var(--red)); }
.seats span.me { box-shadow: 0 0 0 2px var(--gold); }
.vs { font: 26px var(--head); text-align: center; margin: 4px 0 10px; }
.arena { display: grid; gap: 6px; }
.arena .col { min-width: 0; border-radius: 14px; padding: 8px 6px; background: var(--card); border: 2px solid var(--line); text-align: center; transition: .3s; }
.arena .col:nth-child(odd) { border-color: rgba(30, 139, 255, .5); }
.arena .col:nth-child(even) { border-color: rgba(255, 45, 61, .5); }
.arena .col.win { border-color: var(--gold); box-shadow: 0 0 22px rgba(255, 197, 49, .45); background: linear-gradient(180deg, rgba(255, 197, 49, .14), var(--card)); }
.arena .col.lost { opacity: .55; }
.arena .who { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arena .sum { margin: 4px 0 8px; }
.arena .cell { height: 92px; margin-top: 6px; border-radius: 10px; background: rgba(0, 0, 0, .25); display: grid; place-items: center; overflow: hidden; }
.arena .cell .br { width: 100%; padding: 4px; border: 0; background: none; border-bottom: 3px solid var(--rc); border-radius: 10px; }
.arena .cell .br .pic { height: 48px; }
.arena .cell.spin .br { animation: flick .12s steps(1) infinite; }
@keyframes flick { 50% { opacity: .35; } }
.wait { color: var(--muted); font-size: 12px; padding: 30px 0; }
.crown { font-size: 22px; line-height: 1; }
.opts { display: flex; gap: 6px; margin: 6px 0 12px; }
.opts button { flex: 1; padding: 10px 0; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font: 15px var(--head); }
.opts button.on { border-color: var(--ice); background: #10244d; box-shadow: 0 0 12px rgba(94, 203, 255, .35); }
.pick { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.pick .case { flex: none; width: 118px; padding: 6px; }
.pick .case .pic { height: 70px; }
.pick .case.on { box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(255, 197, 49, .4); }

/* профиль */
.prof { display: flex; align-items: center; gap: 12px; }
.ava { width: 58px; height: 58px; border-radius: 50%; overflow: hidden; flex: none; border: 2px solid var(--gold); box-shadow: 0 0 14px rgba(255, 197, 49, .4); }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stats div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; font-size: 12px; color: var(--muted); }
.stats b { display: block; color: var(--text); font: 16px var(--head); }
.reflink { display: flex; gap: 8px; margin-top: 8px; }
.reflink input { flex: 1; min-width: 0; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); font-size: 12px; }
.reflink .btn { width: auto; padding: 10px 14px; font-size: 13px; box-shadow: none; }
.list .li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list .li:last-child { border: 0; }
.list .li .grow { flex: 1; min-width: 0; }
.list .num { width: 26px; text-align: center; font: 15px var(--head); color: var(--muted); }

/* шторка */
.sheet-bg { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .65); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-height: 88vh; overflow-y: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #101733, var(--bg2)); border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .25s;
  border-top: 2px solid transparent; border-image: linear-gradient(90deg, var(--blue), var(--gold), var(--red)) 1; }
.open .sheet-bg { opacity: 1; pointer-events: auto; }
.open .sheet { transform: none; }
.sheet h3 { margin: 0 0 12px; font: 21px var(--head); text-transform: uppercase; text-align: center; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: -6px auto 12px; }
.amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.amounts button { padding: 12px 6px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-weight: 800; }
.amounts button.on { border-color: var(--gold); background: rgba(255, 197, 49, .1); box-shadow: 0 0 12px rgba(255, 197, 49, .3); }
.amounts small { display: block; font-weight: 600; color: var(--muted); font-size: 11px; }
.field { width: 100%; padding: 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); outline: none; margin: 8px 0; }
.prize { text-align: center; }
.prize .pic { width: 180px; height: 180px; margin: 0 auto; }
.prize .n { font: 22px var(--head); text-transform: uppercase; margin: 6px 0; }
.win { color: var(--gold); text-shadow: 0 0 14px rgba(255, 197, 49, .6); }
.lose { color: var(--red); }
.toast { position: fixed; left: 16px; right: 16px; bottom: 92px; z-index: 40; padding: 12px 14px; border-radius: 12px; background: #1a2a55;
  border: 1px solid var(--blue); text-align: center; font-weight: 600; opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none; }
.toast.on { opacity: 1; transform: none; }
.toast.err { background: #4a1020; border-color: var(--red); }
.spin { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--line); border-top-color: var(--ice); border-right-color: var(--red); border-radius: 50%; animation: s .8s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }
.center { display: grid; place-items: center; min-height: 40vh; }

/* редкость брейнрота */
.br .rar { font: 9px var(--head); letter-spacing: .4px; text-transform: uppercase; color: var(--rc); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br { box-shadow: inset 0 -26px 30px -26px color-mix(in srgb, var(--rc) 55%, transparent); }
.br.god { border-bottom-color: transparent; }
.br.god::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; border-radius: 0 0 12px 12px;
  background: linear-gradient(90deg, #ff2d3d, #ffc531, #2fe08a, #1e8bff, #a855f7); }
.br.god .rar { background: linear-gradient(90deg, #ff5a5a, #ffd84a, #4dff9a, #4db8ff, #c27bff); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.roll .strip .br .rar, .arena .cell .br .rar { display: none; }

/* ================= анимации ================= */
@keyframes up { from { opacity: 0; transform: translateY(12px); } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
@keyframes shine { 0%, 60% { transform: translateX(-120%) skewX(-20deg); } 100% { transform: translateX(260%) skewX(-20deg); } }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes rays { to { transform: rotate(360deg); } }
@keyframes glowpulse { 50% { box-shadow: 0 0 28px rgba(255, 197, 49, .35); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes bounce { 40% { transform: translateY(-6px) scale(1.15); } }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); opacity: .9; } }
@keyframes skel { to { background-position: -200% 0; } }
@keyframes splash { 50% { transform: scale(1.06); filter: drop-shadow(0 0 24px rgba(94, 203, 255, .8)); } }
@keyframes flashup { 0% { color: var(--green); transform: scale(1.12); } }
@keyframes flashdown { 0% { color: var(--red); } }

/* появление экранов и плиток (без JS: новые элементы анимируются сами) */
main > * { animation: up .32s ease-out both; }
main > *:nth-child(2) { animation-delay: .04s; } main > *:nth-child(3) { animation-delay: .08s; }
main > *:nth-child(4) { animation-delay: .12s; } main > *:nth-child(n+5) { animation-delay: .16s; }
.grid > * { animation: pop .3s ease-out both; }
.grid > *:nth-child(2) { animation-delay: .03s; } .grid > *:nth-child(3) { animation-delay: .06s; }
.grid > *:nth-child(4) { animation-delay: .09s; } .grid > *:nth-child(5) { animation-delay: .12s; }
.grid > *:nth-child(6) { animation-delay: .15s; } .grid > *:nth-child(n+7) { animation-delay: .18s; }
main.still > *, main.still .grid > * { animation: none; }
.roll .strip .br, .arena .br { animation: none; }

/* нажатия */
.case, .br, .bt, .amounts button, .opts button { transition: transform .12s, box-shadow .2s; }
.case:active, .br:active, .bt:active, .amounts button:active, .opts button:active { transform: scale(.96); }
.tabs button.on i { animation: bounce .35s ease-out; }

/* блик по карточкам кейсов и баннеру */
.case::after, .hero::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .16), transparent); animation: shine 4.5s ease-in-out infinite; }
.case:nth-child(2n)::after { animation-delay: 1.2s; } .case:nth-child(3n)::after { animation-delay: 2.1s; }
.case .pic img { transition: transform .3s; }
.case:active .pic img { transform: scale(1.06) rotate(-2deg); }
.topdrop { animation: glowpulse 2.6s ease-in-out infinite; }
.topdrop .pic img { animation: float 3s ease-in-out infinite; }

/* баланс: вверх - зелёным, вниз - красным */
.balance b.up { animation: flashup .7s ease-out; display: inline-block; }
.balance b.down { animation: flashdown .7s ease-out; }

/* загрузка: скелетоны */
.skel { border-radius: 14px; background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%); background-size: 200% 100%;
  animation: skel 1.1s linear infinite; }
.skels { display: grid; gap: 10px; }
.skels .g { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

/* заставка при запуске */
.splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; align-content: center; gap: 14px; background: var(--bg);
  transition: opacity .35s; }
.splash img { width: 96px; height: 96px; border-radius: 24px; animation: splash 1.2s ease-in-out infinite; }
.splash b { font: 26px var(--head); }
.splash.off { opacity: 0; pointer-events: none; }

/* рулетка: края в тени, выигрыш подсвечен */
.roll { -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.roll .br.won { transform: scale(1.08); z-index: 1; box-shadow: 0 0 22px var(--rc), inset 0 0 18px color-mix(in srgb, var(--rc) 40%, transparent);
  transition: transform .3s, box-shadow .3s; }
.roll.spinning .line { animation: glowpulse .4s infinite; }
.fastrow { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.switch { position: relative; width: 40px; height: 22px; border-radius: 11px; background: var(--line); transition: .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on { background: var(--blue); }
.switch.on::after { left: 21px; }
.setrow { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.setrow:last-child { border: 0; }

/* выигрыш: лучи цвета редкости, всплытие, конфетти */
.prize { position: relative; }
.prize .rays { position: absolute; left: 50%; top: 90px; width: 340px; height: 340px; margin: -170px 0 0 -170px; pointer-events: none; opacity: .55;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rc, var(--gold)) 70%, transparent) 0 10deg, transparent 10deg 24deg);
  -webkit-mask-image: radial-gradient(circle, #000 10%, transparent 68%); mask-image: radial-gradient(circle, #000 10%, transparent 68%);
  animation: rays 12s linear infinite; }
.prize .pic { position: relative; animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.prize .pic img { animation: float 2.6s ease-in-out .5s infinite; }
.prize .n, .prize > .price { position: relative; animation: up .4s .15s both; }
.prize .rar { position: relative; font: 12px var(--head); letter-spacing: 1px; text-transform: uppercase; color: var(--rc); animation: up .4s .1s both; }
.confetti { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 8px; height: 14px; border-radius: 2px; animation: fall var(--t) cubic-bezier(.25, .6, .5, 1) var(--d) forwards; }
.sheet.lose-shake { animation: shake .45s; }

/* апгрейд: итог на круге */
.dial.win svg { filter: drop-shadow(0 0 16px var(--green)); }
.dial.lose { animation: shake .45s; }
.dial.lose svg { filter: drop-shadow(0 0 16px var(--red)); }
.dial .needle { transition: none; }
.dial .needle::after { content: ""; position: absolute; bottom: -6px; left: -4px; border: 6px solid transparent; border-top: 8px solid var(--gold); }

/* батлы: раскрытие и корона */
.arena .cell > .br { animation: pop .3s ease-out both; }
.arena .cell.spin > .br { animation: flick .12s steps(1) infinite; }
.arena .col.win .crown { animation: bounce .6s ease-out 2; }

/* нет связи */
.offline { position: fixed; top: 62px; left: 12px; right: 12px; z-index: 25; padding: 8px 12px; border-radius: 10px; text-align: center; font-size: 13px;
  font-weight: 700; background: #4a1020; border: 1px solid var(--red); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ================= правки 05.12: картинки, ширина, колесо, кейсы ================= */
/* картинка всегда вписана в рамку (раньше на широком экране вылезала и обрезалась) */
.pic > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; }
.pic > .ph { position: relative; z-index: 1; }
/* на компьютере - колонка шириной с телефон, как в Telegram */
main { max-width: 560px; margin: 0 auto; }
.top, .tabs { padding-left: max(12px, calc(50% - 268px)); padding-right: max(12px, calc(50% - 268px)); }

/* колесо апгрейда */
.dial { width: 150px; height: 150px; }
.dial svg { width: 150px; height: 150px; transform: none; filter: drop-shadow(0 0 14px rgba(30, 139, 255, .35)); }
.dial .arc { transition: stroke-dasharray .45s cubic-bezier(.2, .8, .2, 1); }
.dial .pct { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 26px var(--head); line-height: 1; }
.dial .pct small { font: 10px var(--head); letter-spacing: 2px; color: var(--muted); margin-top: 4px; }
.dial .pct.zero { color: var(--muted); }
.dial .needle { left: 0; top: 0; width: 100%; height: 100%; margin: 0; background: none; box-shadow: none; border-radius: 0;
  transform-origin: 50% 50%; transform: rotate(0deg); pointer-events: none; }
.dial .needle::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: auto; margin-left: -9px; border: 9px solid transparent;
  border-top: 14px solid var(--gold); border-bottom: 0; filter: drop-shadow(0 0 6px rgba(255, 197, 49, .9)); }
.dial .needle::before { content: ""; position: absolute; left: 50%; top: 10px; width: 2px; height: 22px; margin-left: -1px; border-radius: 1px;
  background: linear-gradient(var(--gold), transparent); }
.dial.win .pct { color: var(--green); text-shadow: 0 0 14px rgba(47, 224, 138, .7); }
.dial.lose .pct { color: var(--red); }
.upg { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.slot { min-height: 160px; background: rgba(14, 20, 40, .6); }
.slot.full { background: linear-gradient(180deg, color-mix(in srgb, var(--rc, var(--blue)) 18%, var(--card2)), var(--card)); }
.slot .pic { width: 100%; max-width: 110px; height: 96px; }

/* карточки кейсов */
.case, .case:nth-child(even) { padding: 8px 8px 10px; border-radius: 18px; border: 2px solid transparent;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--rc, var(--blue)) 30%, transparent), transparent 70%) padding-box,
    linear-gradient(180deg, var(--card2), var(--card)) padding-box,
    linear-gradient(160deg, color-mix(in srgb, var(--rc, var(--blue)) 90%, #fff 10%), rgba(31, 42, 82, .6) 45%, rgba(31, 42, 82, .6) 60%, var(--rc, var(--red))) border-box;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35), 0 0 18px color-mix(in srgb, var(--rc, var(--blue)) 18%, transparent); }
.case .pic { height: 128px; }
.case .pic::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 6px; height: 12px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); filter: blur(5px); }
.case .pic img { animation: float 3.2s ease-in-out infinite; }
.case:nth-child(2n) .pic img { animation-delay: -1.1s; } .case:nth-child(3n) .pic img { animation-delay: -2.2s; }
.case .best { position: absolute; top: 8px; left: 8px; z-index: 2; padding: 3px 7px; border-radius: 8px; font: 10px var(--head);
  color: var(--gold); background: rgba(0, 0, 0, .5); border: 1px solid rgba(255, 197, 49, .35); letter-spacing: .3px; }
.case .t { margin: 6px 0 8px; font-size: 15px; letter-spacing: .5px; }
.case .cprice { display: flex; justify-content: center; }
.case .cprice .price { padding: 6px 14px; border-radius: 10px; font-size: 15px; color: #3a2400;
  background: linear-gradient(180deg, #ffe07a, var(--gold) 55%, #e69500); box-shadow: 0 3px 0 #a86f00; }
.case .cprice .price .coin { box-shadow: none; }
.pick .case .pic img { animation: none; }
.pick .case .best { display: none; }
.slot-in { width: 100%; display: grid; justify-items: center; gap: 2px; }
.slot .sn { width: 100%; font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-empty { display: grid; justify-items: center; gap: 6px; font-size: 12px; }
.slot-empty b { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 26px var(--head);
  color: var(--muted); border: 2px dashed var(--line); }
.slot.l .slot-empty b { color: var(--ice); border-color: rgba(94, 203, 255, .4); }
.slot.r .slot-empty b { color: var(--red); border-color: rgba(255, 45, 61, .4); }

/* ================= иконки и настройки ================= */
.ic { display: inline-grid; place-items: center; font-style: normal; }
.ic svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tabs .ic { width: 27px; height: 27px; font-size: 0; filter: grayscale(1) brightness(.75); opacity: .55; transition: .2s; }
.tabs button.on .ic { filter: drop-shadow(0 0 7px rgba(94, 203, 255, .85)) drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); opacity: 1;
  transform: translateY(-3px) scale(1.12); animation: bounce .35s ease-out; }
.tabs button[data-tab="upgrade"].on .ic, .tabs button[data-tab="free"].on .ic { filter: drop-shadow(0 0 7px rgba(255, 197, 49, .85)) drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
.tabs button[data-tab="battles"].on .ic, .tabs button[data-tab="free"].on .ic { filter: drop-shadow(0 0 7px rgba(255, 45, 61, .85)) drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
.tabs button.on::after { top: -7px; }

.prof .grow { flex: 1; min-width: 0; }
.gearbtn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--muted);
  background: var(--card); border: 1px solid var(--line); flex: none; }
.gearbtn .ic { width: 22px; height: 22px; }
.gearbtn:active { transform: rotate(45deg); transition: transform .2s; }

.shead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.shead h3 { margin: 0; text-align: left; text-transform: none; font-size: 24px; }
.sclose { width: 40px; height: 40px; border-radius: 10px; font-size: 18px; color: var(--ice); background: var(--card); border: 1px solid var(--line); }
.sgroup { font: 13px var(--head); letter-spacing: .6px; text-transform: uppercase; color: var(--ice); margin: 16px 2px 8px; }
.sbox { border-radius: 14px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.srow { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; text-align: left; }
.srow + .srow { border-top: 1px solid var(--line); }
.stile { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--tc);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 3px 10px rgba(0, 0, 0, .35); }
.stile .ic { width: 24px; height: 24px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
.stext { flex: 1; min-width: 0; display: grid; gap: 2px; }
.stext b { font-size: 16px; }
.stext small { color: var(--muted); font-size: 12.5px; }
.srow .switch { width: 48px; height: 28px; border-radius: 14px; }
.srow .switch::after { width: 22px; height: 22px; }
.srow .switch.on { background: linear-gradient(90deg, var(--blue2), var(--blue)); box-shadow: 0 0 10px rgba(30, 139, 255, .5); }
.srow .switch.on::after { left: 23px; }

/* лёгкий режим: без украшений и лишних анимаций (рулетка и стрелка крутятся как обычно) */
.lite *:not(.strip):not(.needle), .lite *::before, .lite *::after { animation: none !important; }
.lite body::after, body.lite::after { display: none; }
.lite .top, .lite .tabs { backdrop-filter: none; }
.lite .case::after, .lite .hero::after { display: none; }

/* режим стримера: суммы и личное — размыты */
.streamer .price, .streamer #balance-v, .streamer .hide-s, .streamer .reflink input, .streamer .stats b, .streamer .amounts small {
  filter: blur(7px); user-select: none; }
.streamer .price .coin { filter: none; }
