/* 8 BALL — стиль бильярдного клуба: дерево, сукно, латунь, кожа */
:root {
  --felt: #1f6b3a; --felt-2: #17532d; --felt-3: #123f22;
  --wood: #6b4423; --wood-2: #8a5a30; --wood-3: #3e2613;
  --brass: #d4a83a; --brass-2: #f0d17a; --brass-3: #8c6a1f;
  --leather: #2a1c12; --leather-2: #3a2819; --leather-3: #1c120b;
  --cream: #f3e7cf; --text: #f6ecd8; --muted: #bfa985; --gold: #f0d17a; --red: #d4573f; --green: #4fd68a; --blue: #4f8fc9;
  --radius: 14px; --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Шум — растровый тайл (public/noise.png, 360×360 = 120 CSS px при 3x), отрисованный один раз из SVG feTurbulence
     (fractalNoise .9, 2 октавы, альфа .18). SVG с фильтром растрировался заново при каждом показе окна: на Galaxy A15 в
     Telegram это давало 5–7 пауз по 100–170 мс на каждое открытие окна/вкладки (замер test/perf-device-ab.js). */
  --noise: url(/noise.png?v=1) 0 0 / 120px 120px;
  --panel: linear-gradient(180deg, #3b2a1c 0%, #2a1c12 100%);
  --panel-shadow: 0 8px 22px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,225,170,.14), inset 0 -1px 0 rgba(0,0,0,.4);
  --brass-line: 1px solid rgba(212,168,58,.55);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* touch-action: manipulation — без задержки тапа (~250 мс) на распознавание двойного тапа: WebView Telegram не смотрит на user-scalable=no */
html, body { touch-action: manipulation; margin: 0; padding: 0; height: 100%; overflow: hidden; background: var(--leather-3); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", Arial, sans-serif; font-size: 15px; -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%; }
body { background: radial-gradient(900px 600px at 50% -10%, rgba(240,209,122,.16), transparent 60%), radial-gradient(700px 500px at 50% 110%, rgba(31,107,58,.25), transparent 60%), var(--leather-3); }
body::before { content: ''; position: fixed; inset: 0; background: var(--noise); opacity: .6; pointer-events: none; z-index: 0; }
.display, h1, h2, .modal-title, .playbtn .t, .result-hero .big, .stat-row .v, .pcard .nm, .code { font-family: 'Oswald', 'Arial Narrow', -apple-system, sans-serif; letter-spacing: .02em; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; z-index: 1; }
#topbar-wrap { padding: calc(var(--safe-top) + 10px) 12px 0; flex: none; }
#topbar-wrap.hidden { display: none; }
.screen { display: flex; flex: 1; flex-direction: column; min-height: 0; padding: 6px 12px 0; overflow: hidden; }
/* Неактивные экраны не display:none, а спрятаны на месте (visibility): их стили и раскладка остаются готовыми,
   и переключение не пересчитывает весь экран с нуля. Анимации в них стоят на паузе. */
.screen:not(.active):not(.peek) { position: absolute; left: 0; right: 0; pointer-events: none; visibility: hidden; transform: translate3d(100vw, 0, 0); }
/* Экраны пейджера — постоянные слои композитора: неактивные лежат за краем экрана уже растеризованными (JS ставит
   transform на ±ширину), и слайд только двигает готовые текстуры. Без этого на телефоне (3x, Mali) первые кадры
   перехода ждали растеризации двух полноэкранных слоёв — 60–130 мс. */
/* без постоянных will-change-слоёв: в WebView Telegram пять полноэкранных слоёв 3x переполняли память тайлов — заморозки на сотни мс при любом открытии окна */
/* Игровой экран не в пейджере и со своим position: relative — вне игры он просто выключен, чтобы не занимать место в раскладке */
#screen-game:not(.active) { position: absolute; inset: 0; visibility: hidden; pointer-events: none; transform: none; }
/* Декор на паузе (бесконечные анимации меню): на скрытых экранах и в режиме body.decor-paused — под открытым окном,
   во время слайда и после 10 с без касаний. Список конкретный: одноразовые появления и transition не трогаем. */
:is(.screen:not(.active):not(.peek), body.decor-paused .screen) :is(.pulse, .banner .ic, .banner.chalk, .tile.ready .ic, #btn-wheel .ic, #btn-practice .ic, .quest.done .ic, .pod .pav, .tourney.live .cta) { animation-play-state: paused !important; }
:is(.screen:not(.active):not(.peek), body.decor-paused .screen) .playbtn::after, :is(.screen:not(.active):not(.peek), body.decor-paused .screen) .quest.done:not(.claimed)::after { animation-play-state: paused !important; } /* размеры известны и вне игры — стол и шары прогреваются заранее */
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 96px; }
.scroll::-webkit-scrollbar { display: none; }
h1 { font-size: 26px; margin: 4px 0 10px; font-weight: 700; color: var(--brass-2); text-shadow: 0 2px 0 rgba(0,0,0,.5); text-transform: uppercase; }
h2 { font-size: 13px; margin: 20px 0 8px; color: var(--brass); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; display: flex; align-items: center; gap: 10px; }
h2::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(212,168,58,.5), transparent); }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.card { background: var(--panel); border: var(--brass-line); border-radius: var(--radius); padding: 12px; box-shadow: var(--panel-shadow); position: relative; }
.card::after { content: ''; position: absolute; inset: 4px; border: 1px dashed rgba(212,168,58,.18); border-radius: calc(var(--radius) - 4px); pointer-events: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.bold { font-weight: 700; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; font-weight: 800; font-size: 15px; background: linear-gradient(180deg, #4a3421, #2f1f13); border: 1px solid rgba(212,168,58,.5); color: var(--cream); box-shadow: 0 5px 14px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,225,170,.18), inset 0 -2px 0 rgba(0,0,0,.35); transition: transform .08s, filter .1s; position: relative; overflow: hidden; }
.btn:active { transform: translateY(1px) scale(.985); filter: brightness(1.1); }
.btn.primary { background: linear-gradient(180deg, #2c8a4c 0%, #1f6b3a 60%, #17532d 100%); color: var(--cream); border-color: rgba(240,209,122,.6); box-shadow: 0 8px 22px rgba(31,107,58,.45), inset 0 1px 0 rgba(255,255,255,.22), inset 0 -3px 0 rgba(0,0,0,.3); }
.btn.gold { background: linear-gradient(180deg, #f5dc8a 0%, #d4a83a 55%, #a87f22 100%); color: #2b1d0c; border-color: rgba(255,240,200,.7); box-shadow: 0 8px 22px rgba(212,168,58,.35), inset 0 1px 0 rgba(255,255,255,.6), inset 0 -3px 0 rgba(0,0,0,.2); text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.btn.blue { background: linear-gradient(180deg, #5b9bd6, #3a6ea5 60%, #2c5480); color: #fff; border-color: rgba(200,230,255,.5); box-shadow: 0 6px 18px rgba(58,110,165,.4), inset 0 1px 0 rgba(255,255,255,.35); }
.btn.purple { background: linear-gradient(180deg, #a04a6c, #7a2e4a 60%, #5a2036); color: #fff; border-color: rgba(255,200,220,.4); box-shadow: 0 6px 18px rgba(122,46,74,.4), inset 0 1px 0 rgba(255,255,255,.3); }
.btn.danger { background: linear-gradient(180deg, #7a2f24, #5a2019); color: #ffd9d0; border-color: rgba(255,120,100,.4); box-shadow: 0 5px 14px rgba(0,0,0,.4); }
.btn.ghost { background: transparent; box-shadow: none; border-color: rgba(212,168,58,.35); }
.btn.big { padding: 18px 20px; font-size: 18px; border-radius: 14px; width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn.flat { background: transparent; border-color: transparent; box-shadow: none; color: var(--brass); padding: 6px 8px; font-size: 13px; font-weight: 700; border-radius: 8px; }
.btn.flat:active { background: rgba(212,168,58,.12); filter: none; transform: none; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4b8a5c, #1f6b3a 70%); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 16px; overflow: hidden; flex: none; color: var(--cream); box-shadow: 0 0 0 2px var(--brass-3), 0 0 0 3px rgba(0,0,0,.6), 0 4px 10px rgba(0,0,0,.5); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.lg { width: 66px; height: 66px; font-size: 24px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; background: linear-gradient(180deg, #3f2c1b, #2a1c12); font-weight: 800; font-size: 13px; border: 1px solid rgba(212,168,58,.45); white-space: nowrap; box-shadow: inset 0 1px 0 rgba(255,225,170,.12), 0 2px 6px rgba(0,0,0,.4); color: var(--cream); }
.chip.gold { color: #2b1d0c; background: linear-gradient(180deg, #f5dc8a, #d4a83a 70%, #b98d2a); border-color: rgba(255,240,200,.7); text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.chip.gold b { color: #2b1d0c !important; }
.chip.pop { animation: coinPop .5s ease-out; }
@keyframes coinPop { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }
.bar { height: 7px; border-radius: 5px; background: rgba(0,0,0,.5); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.6), 0 1px 0 rgba(255,225,170,.08); }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #d4a83a, #f0d17a); border-radius: 5px; transition: width .6s var(--e-out); position: relative; overflow: hidden; }
.bar > i::after { content: ''; position: absolute; top: -2px; bottom: -2px; left: -70%; width: 60%; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.85), rgba(255,255,255,0)); transform: skewX(-22deg); opacity: 0; pointer-events: none; }
.bar > i.shine::after { animation: barShine .75s ease-out; }
.bar > i.shine { animation: barPulse .6s ease-out; }
@keyframes barShine { 0% { left: -70%; opacity: 1; } 100% { left: 120%; opacity: 0; } }
@keyframes barPulse { 0% { filter: brightness(1); } 30% { filter: brightness(1.6) saturate(1.2); } 100% { filter: brightness(1); } }
.bar.green > i { background: linear-gradient(90deg, #2c8a4c, #4fd68a); }
.bar.gold > i { background: linear-gradient(90deg, #d4a83a, #f0d17a); }
.badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: linear-gradient(180deg, #e06a52, #b83b28); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.5); border: 1px solid rgba(255,200,180,.5); }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.shake { animation: shake .5s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.fade-in { animation: fadeIn .25s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* «сквиш» при появлении: элементы видны сразу, без задержек и прозрачности — анимация только для плавности
   (лёгкое сжатие → перелёт → оседание, все одновременно) */
@keyframes squishIn { 0% { transform: scale(.9, .9); } 55% { transform: scale(1.05, .95); } 78% { transform: scale(.98, 1.02); } 100% { transform: none; } }
.stat-row .card, .reward-list .reward, .ach-pop, .showcase .sc-slot { animation: squishIn .42s var(--e-back); }
.showcase { display: flex; gap: 8px; margin: 6px 0 10px; }
.showcase .sc-slot { flex: 1; text-align: center; padding: 10px 6px; background: var(--panel); border: var(--brass-line); border-radius: 14px; box-shadow: var(--panel-shadow); min-width: 0; }
.showcase .sc-slot .ic { font-size: 30px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.showcase .sc-slot .t { font-weight: 800; font-size: 12px; margin-top: 4px; line-height: 1.15; }
.showcase .sc-slot.secret { background: linear-gradient(180deg, #161616, #050505); border-color: #3a3a3a; }
.showcase .sc-slot.empty { opacity: .45; border-style: dashed; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-12deg); } 88% { transform: rotate(10deg); } 92% { transform: rotate(-8deg); } 96% { transform: rotate(6deg); } }
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes shine { 0%, 60%, 100% { filter: brightness(1); } 70% { filter: brightness(1.6) drop-shadow(0 0 8px rgba(240,209,122,.8)); } }

/* ---- nav: деревянная планка ---- */
#nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; padding: 8px 8px calc(var(--safe-bottom) + 8px); background: linear-gradient(180deg, #5a3a1e, #3e2613 60%, #2b1a0e); border-top: 2px solid rgba(212,168,58,.6); z-index: 20; box-shadow: 0 -10px 30px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,225,170,.25); }
#nav::before { content: ''; position: absolute; inset: 0; background: var(--noise); opacity: .5; pointer-events: none; }
#nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; font-size: 11px; font-weight: 700; color: rgba(243,231,207,.65); border-radius: 12px; position: relative; transition: background .2s, color .2s; }
#nav button .ic { font-size: 22px; line-height: 1; filter: grayscale(.5) brightness(.9); transition: filter .2s, transform .2s; }
#nav button.active { color: var(--cream); background: linear-gradient(180deg, #2c8a4c, #1f6b3a); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 0 0 1px rgba(240,209,122,.5), 0 4px 10px rgba(0,0,0,.4); }
#nav button.active .ic { filter: none; transform: translateY(-2px) scale(1.12); }
#nav.hidden { display: none; }

/* ---- главная ---- */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 8px 10px; border-radius: 14px; background: linear-gradient(180deg, #6b4423, #4a2f18 70%, #3e2613); border: 1px solid rgba(240,209,122,.45); box-shadow: 0 8px 20px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,225,170,.25); position: relative; }
.topbar::before { content: ''; position: absolute; inset: 0; background: var(--noise); opacity: .45; border-radius: 14px; pointer-events: none; }
.topbar > * { position: relative; }
.topbar .name { font-weight: 800; font-size: 15px; color: var(--cream); }
.topbar .lvl { font-size: 12px; color: var(--brass-2); font-weight: 700; }
.banner { position: relative; border-radius: var(--radius); padding: 14px; min-height: 86px; display: flex; align-items: center; gap: 12px; overflow: hidden; background: linear-gradient(135deg, #3a2819, #241a12 70%); border: var(--brass-line); margin-bottom: 12px; box-shadow: var(--panel-shadow); }
.banner::before { content: ''; position: absolute; inset: 0; background: var(--noise); opacity: .5; pointer-events: none; }
.banner.gold { background: linear-gradient(135deg, #6a4a12, #3a2a0a 70%); }
.banner.green { background: linear-gradient(135deg, #1f6b3a, #123f22 70%); }
.banner.red { background: linear-gradient(135deg, #7a2f24, #3a1610 70%); }
.banner .ic { font-size: 38px; line-height: 1; flex: none; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); animation: floatY 3s ease-in-out infinite; position: relative; }
.banner .title { font-weight: 800; font-size: 15px; color: var(--cream); text-shadow: 0 1px 2px rgba(0,0,0,.5); position: relative; }
.banner .sub { font-size: 12px; color: var(--muted); margin-top: 3px; position: relative; }
.banner .timer { font-variant-numeric: tabular-nums; font-weight: 900; color: var(--gold); }
.banner .dots { position: absolute; right: 12px; bottom: 7px; display: flex; gap: 4px; }
.banner .dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(240,209,122,.3); }
.banner .dots i.on { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.playbtn { position: relative; width: 100%; padding: 22px 20px; border-radius: 16px; background: radial-gradient(600px 200px at 50% 0%, rgba(255,255,220,.14), transparent 60%), linear-gradient(180deg, #2c8a4c 0%, #1f6b3a 55%, #17532d 100%); color: var(--cream); text-align: left; box-shadow: 0 12px 30px rgba(0,0,0,.5), inset 0 0 0 3px #6b4423, inset 0 0 0 4px rgba(240,209,122,.7), inset 0 1px 0 rgba(255,255,255,.2); margin: 4px 0 12px; overflow: hidden; border: 1px solid rgba(240,209,122,.6); }
.playbtn::before { content: ''; position: absolute; inset: 0; background: var(--noise); opacity: .55; pointer-events: none; }
.playbtn:active { transform: scale(.985); }
.playbtn .t { font-size: 28px; font-weight: 700; text-transform: uppercase; text-shadow: 0 2px 0 rgba(0,0,0,.4); position: relative; padding-right: 84px; }
.playbtn .s { font-size: 13px; font-weight: 700; color: rgba(243,231,207,.8); margin-top: 2px; position: relative; padding-right: 84px; line-height: 1.25; }
.ball8 { position: absolute; right: 18px; top: 50%; width: 56px; height: 56px; margin-top: -28px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 50%, #2a2a2a, #0e0e0e 55%, #000 100%); transform-origin: 50% 100%; will-change: transform; }
/* сфера сама не вращается: свет и тень неподвижны; вокруг вертикальной оси едут только две «восьмёрки» (JS: BallAnim) */
.ball8 .hl { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; z-index: 2; opacity: 1; background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.42), rgba(255,255,255,.08) 22%, rgba(255,255,255,0) 40%), radial-gradient(circle at 72% 82%, rgba(0,0,0,.55), rgba(0,0,0,0) 50%), radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 62%, rgba(0,0,0,.5) 100%); }
.ball8 span, .ball8 .b8 { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fffdf6, #e6e1d3 70%, #cfc8b6); color: #111; font-weight: 900; font-size: 16px; display: flex; align-items: center; justify-content: center; font-family: 'Oswald', sans-serif; box-shadow: inset -2px -2px 4px rgba(0,0,0,.18); will-change: transform; }
.ball8 span, .ball8 .b8, .ball8 .hl { will-change: transform, opacity; }
.ball8 span { transform: none; opacity: 1; }
.ball8 .b8 { transform: translateX(60px); opacity: 0; }
.ball8-shadow { position: absolute; right: 18px; top: 50%; width: 56px; height: 56px; margin-top: -28px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(0,0,0,.6), rgba(0,0,0,.25) 45%, rgba(0,0,0,0) 70%); transform-origin: 50% 50%; transform: translateY(24px) scale(1, .32); filter: blur(1.5px); will-change: transform, opacity; }
  12%  { transform: translateX(13px) scaleX(.72); opacity: 1; }
  22%  { transform: translateX(19px) scaleX(.22); opacity: 1; }
  25%  { transform: translateX(21px) scaleX(.06); opacity: 0; }
  75%  { transform: translateX(-21px) scaleX(.06); opacity: 0; }
  78%  { transform: translateX(-19px) scaleX(.22); opacity: 1; }
  88%  { transform: translateX(-13px) scaleX(.72); opacity: 1; }
  100% { transform: translateX(0) scaleX(1); opacity: 1; }
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--panel); border: var(--brass-line); border-radius: var(--radius); padding: 14px 12px; text-align: left; position: relative; box-shadow: var(--panel-shadow); overflow: hidden; transition: transform .08s; color: var(--cream); }
.tile::before { content: ''; position: absolute; inset: 0; background: var(--noise); opacity: .45; pointer-events: none; }
.tile:active { transform: scale(.97); }
.tile .ic { font-size: 28px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); display: inline-block; position: relative; }
.tile .t { font-weight: 800; margin-top: 6px; position: relative; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 2px; position: relative; }
.tile.ready { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(240,209,122,.4), 0 10px 26px rgba(212,168,58,.25), var(--panel-shadow); background: linear-gradient(180deg, #5a4318, #2a1c12); }
.tile.ready .ic { animation: wiggle 4s ease-in-out infinite; }
#btn-wheel .ic { animation: spinSlow 9s linear infinite; }
#btn-practice .ic { animation: floatY 3.5s ease-in-out infinite; }
.stat-head { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.stat-head h2 { flex: 1; margin: 0; }
.stats-scroll { max-height: 64vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px 4px; }
.stats-scroll h2:first-child { margin-top: 4px; }
.stats-list { display: flex; flex-direction: column; gap: 4px; }
.stats-list .sr { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,.04); animation: squishIn .42s var(--e-back); }
.stats-list .sr .k { color: var(--muted); font-size: 13px; }
.stats-list .sr .v { color: var(--brass-2); font-family: 'Oswald', 'Arial Narrow', -apple-system, sans-serif; font-size: 15px; letter-spacing: .02em; }
.stat-row { display: flex; gap: 8px; margin: 10px 0; }
.stat-row .card { flex: 1; text-align: center; padding: 10px 6px; }
.stat-row .v { font-weight: 700; font-size: 20px; color: var(--brass-2); }
.stat-row .k { font-size: 11px; color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel); border: var(--brass-line); border-radius: 14px; box-shadow: var(--panel-shadow); }
.item .rank { width: 26px; text-align: center; font-weight: 900; color: var(--brass); flex: none; font-family: 'Oswald', sans-serif; font-size: 16px; }
.item.me { border-color: var(--green); background: linear-gradient(180deg, #1f6b3a, #17532d); }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #6b5a45; display: inline-block; margin-right: 4px; }
.online-dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; }
.tabs button { padding: 8px 14px; border-radius: 999px; background: linear-gradient(180deg, #3f2c1b, #2a1c12); border: 1px solid rgba(212,168,58,.35); font-weight: 800; font-size: 13px; white-space: nowrap; color: var(--muted); }
.tabs button.active { background: linear-gradient(180deg, #f5dc8a, #d4a83a); color: #2b1d0c; border-color: rgba(255,240,200,.7); box-shadow: 0 4px 12px rgba(212,168,58,.35); }

/* ---- магазин ---- */
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lz { display: grid; min-width: 0; }
.cue-card { background: var(--panel); border: var(--brass-line); border-radius: var(--radius); padding: 12px; position: relative; overflow: hidden; box-shadow: var(--panel-shadow); }
.cue-card::before { content: ''; position: absolute; inset: 0; background: var(--noise); opacity: .45; pointer-events: none; }
.cue-card > * { position: relative; }
.cue-card.limited { border-color: rgba(212,87,63,.7); background: linear-gradient(180deg, #5a2a20, #2a1c12 70%); }
.cue-card.legendary { border-color: var(--gold); background: linear-gradient(180deg, #5a4318, #2a1c12 70%); }
.cue-card.epic { border-color: rgba(160,74,108,.7); }
.cue-card .cue-vis { width: 100%; height: auto; aspect-ratio: 5 / 1; margin: 6px 0 8px; display: block; }
.cue-card[data-open] { cursor: pointer; }
.cue-card.rare { border-color: rgba(79,143,201,.55); }
.cue-card.epic { border-color: rgba(160,74,108,.7); background: linear-gradient(180deg, #4a2438, #2a1c12 70%); }
.cue-card.legendary { border-color: var(--gold); background: linear-gradient(180deg, #5a4318, #2a1c12 70%); box-shadow: 0 0 0 1px rgba(240,209,122,.35), 0 10px 26px rgba(212,168,58,.25); }
.cue-card.secret { background: linear-gradient(180deg, #151010, #0a0706 70%); border-color: rgba(212,168,58,.35); }
.cue-card.secret .nm { color: var(--brass); }
.cue-card .tag.secret { background: linear-gradient(180deg, #333, #111); color: var(--gold); border: 1px solid rgba(212,168,58,.5); }
.cue-card .tag.anim { background: linear-gradient(180deg, #7c4dff, #4a2fa0); color: #fff; }
.cue-card .nm { font-weight: 800; color: var(--cream); }
.cue-card .rar { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--brass); }
.cue-card .stats, .cue-card-stats { display: grid; grid-template-columns: 46px 1fr; gap: 5px 8px; font-size: 11px; margin: 8px 0; align-items: center; color: var(--muted); }
.cue-card .stats .bar, .cue-card-stats .bar { height: 13px; position: relative; }
.cue-card .stats .bar > i, .cue-card-stats .bar > i { transition: none; }
.cue-card .stats .bv, .cue-card-stats .bv { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); font-size: 9px; font-weight: 900; line-height: 1; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.9); }
.cue-card-stats { font-size: 13px; grid-template-columns: 56px 1fr; }
.cue-card-stats .bar { height: 16px; } .cue-card-stats .bv { font-size: 11px; }
.cue-scene { width: 100%; height: auto; aspect-ratio: 4 / 3; display: block; border-radius: 12px; margin: 10px 0 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.45), 0 8px 22px rgba(0,0,0,.45); }
.cue-card .tag { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 900; padding: 3px 8px; border-radius: 999px; background: linear-gradient(180deg, #e06a52, #b83b28); color: #fff; box-shadow: 0 3px 10px rgba(0,0,0,.4); z-index: 1; }
.cue-card .tag.disc { background: linear-gradient(180deg, #f5dc8a, #d4a83a); color: #2b1d0c; }
.cue-card .old { text-decoration: line-through; color: rgba(43,29,12,.55); font-size: 11px; margin-right: 4px; }
.table-card { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--panel); border: var(--brass-line); border-radius: 14px; box-shadow: var(--panel-shadow); }
.table-card .sw { width: 52px; height: 72px; flex: none; display: block; }

/* ---- задания ---- */
.quest { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel); border: var(--brass-line); border-radius: 14px; box-shadow: var(--panel-shadow); }
.quest .ic { font-size: 26px; width: 34px; text-align: center; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.quest .t { font-weight: 800; font-size: 14px; color: var(--cream); }
.quest .tier { font-size: 10px; letter-spacing: -1px; margin-left: 4px; color: rgba(240,209,122,.55); vertical-align: 1px; }
.quest .tier.t3 { color: #ff8a3d; }
.quest .bar { margin-top: 6px; }
.quest.done { border-color: var(--green); background: linear-gradient(180deg, #1f6b3a, #17532d); }
.quest.done .ic { animation: wiggle 3s ease-in-out infinite; }
.quest.claimed { opacity: .5; }
.hist-sum { font-size: 13px; margin: 2px 0 8px; } .hist-sum .w { color: var(--green); font-weight: 800; } .hist-sum .l { color: #ff8a7a; font-weight: 800; }
.hist-list { gap: 6px; }
.hist-scroll { max-height: 42vh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-right: 2px; border-radius: 12px; }
.hist-more { text-align: center; padding: 8px 0 2px; }
/* кнопки внизу окна профиля прилипают к низу видимой области: длинная история их не прячет */
#modal .box .modal-foot { position: sticky; bottom: calc(-1 * (var(--safe-bottom) + 18px)); margin-top: 12px; padding: 10px 0 calc(var(--safe-bottom) + 10px); background: linear-gradient(180deg, rgba(0,0,0,0), var(--panel) 30%); z-index: 2; }
.hist { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--panel); border: var(--brass-line); border-radius: 12px; border-left-width: 4px; }
.hist.won { border-left-color: var(--green); } .hist.lost { border-left-color: #c0392b; }
.hist .res { font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 6px; flex: none; }
.hist .res.w { background: rgba(44,138,76,.35); color: #8fe3ad; } .hist .res.l { background: rgba(192,57,43,.3); color: #ffb3a7; } .hist .res.d { background: rgba(255,255,255,.1); color: var(--muted); }
.hist .plus { color: #8fe3ad; font-weight: 800; } .hist .minus { color: #ffb3a7; font-weight: 800; }
.hist .rep { flex: none; padding: 6px 9px; margin-left: 4px; } .hist .rep.dim { opacity: .35; }
.hist[data-replay-row] { cursor: pointer; }
/* реплей: всплывающая подсказка над пальцем при перемотке */
#rp-tip { position: fixed; transform: translate(-50%, -100%); padding: 7px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--gold); color: var(--gold); font-weight: 900; font-size: 14px; white-space: nowrap; z-index: 65; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.6); }
#rp-tip.hidden { display: none; }
.quest.secret { background: linear-gradient(180deg, #161616, #050505); border-color: #3a3a3a; box-shadow: 0 6px 16px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.05); }
.quest.secret .t { color: #8a8a8a; letter-spacing: .04em; }
.quest.secret .ic { filter: grayscale(1) brightness(.55) drop-shadow(0 4px 8px rgba(0,0,0,.6)); }

/* ---- модалки: кожаная панель ---- */
#modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: flex-end; justify-content: center; }
/* затемнение — отдельный слой с анимацией opacity (та же rgba(10,6,3,.72)): анимация background перерисовывала весь экран каждый кадр */
/* Базовое состояние окна и затемнения — невидимое, анимации появления с fill forwards: если композитор WebView запустит анимацию
   на кадр позже коммита, первый кадр будет пустым, а не «окно уже на месте → прыжок назад → выезд» (это и был блик в Telegram) */
#modal::before { content: ''; position: absolute; inset: 0; z-index: 0; background: rgba(10,6,3,.72); pointer-events: none; opacity: 0; animation: backdropIn .22s ease-out forwards; }
#modal.closing::before { animation: backdropOut .18s ease-in forwards; }
#modal.open { display: flex; }
#modal .box { opacity: 0; z-index: 1; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; background: var(--panel); border-radius: 22px 22px 0 0; padding: 18px 16px calc(var(--safe-bottom) + 18px); animation: sheetIn .38s var(--e-back) forwards; transform-origin: 50% 100%; border-top: 3px solid var(--brass); box-shadow: 0 -20px 60px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,225,170,.15); position: relative; }
#modal .box::before { content: ''; position: absolute; inset: 0; background: var(--noise); opacity: .45; pointer-events: none; border-radius: inherit; }
#modal .box > * { position: relative; }
#modal.center { align-items: center; padding: 16px; }
#modal.center .box { border-radius: 22px; animation: popIn .34s var(--e-back) forwards; border: 2px solid var(--brass); transform-origin: 50% 60%; }
/* второе имя тех же кадров: переключение класса alt перезапускает анимацию появления при смене содержимого окна */
#modal .box.alt { animation-name: sheetInB; }
#modal.center .box.alt { animation-name: popInB; }
#modal.closing { pointer-events: none; }
#modal.closing .box { animation: sheetOut .18s var(--e-in) forwards; }
/* Тень листа. box-shadow с размытием 60px растрируется заново при каждом открытии окна: в WebView Telegram на Galaxy A15 это
   3–5 пауз по 120–150 мс на каждое открытие (замер test/tg-ab.sh — варианты noshadow/outeronly). На телефоне лист во всю ширину,
   видна только полоса тени над ним, поэтому её рисует .shade — градиент с профилем той же гауссианы (σ = 30px, сдвиг 20px,
   заходит на 22px под скруглённые углы), высотой с лист (--box-h из ResizeObserver) и с теми же анимациями, что у листа. */
#modal .shade { display: none; position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; width: 100%; max-width: 520px; height: var(--box-h, 0px); pointer-events: none; opacity: 0; transform-origin: 50% 100%; animation: sheetIn .38s var(--e-back) forwards; }
#modal .shade::before { content: ''; position: absolute; left: 0; right: 0; bottom: calc(100% - 22px); height: 132px; background: linear-gradient(to top, rgba(0,0,0,.64) 0, rgba(0,0,0,.52) 22px, rgba(0,0,0,.44) 32px, rgba(0,0,0,.35) 42px, rgba(0,0,0,.26) 52px, rgba(0,0,0,.18) 62px, rgba(0,0,0,.11) 72px, rgba(0,0,0,.064) 82px, rgba(0,0,0,.033) 92px, rgba(0,0,0,.016) 102px, rgba(0,0,0,.007) 112px, rgba(0,0,0,0) 132px); }
#modal .shade.alt { animation-name: sheetInB; }
#modal.closing .shade { animation: sheetOut .18s var(--e-in) forwards; }
@media (max-width: 520px) { #modal:not(.center) .box { box-shadow: inset 0 1px 0 rgba(255,225,170,.15); } #modal:not(.center) .shade { display: block; } }
#modal.center.closing .box { animation: popOut .15s var(--e-in) forwards; }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; color: var(--brass-2); text-transform: uppercase; }
.modal-sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.stake-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stake { padding: 14px; border-radius: 14px; background: linear-gradient(180deg, #1f6b3a, #17532d); border: 1px solid rgba(240,209,122,.5); text-align: left; position: relative; box-shadow: var(--panel-shadow); color: var(--cream); }
.stake .c { font-size: 24px; }
.stake .n { font-weight: 800; margin-top: 4px; font-family: 'Oswald', sans-serif; font-size: 17px; text-transform: uppercase; }
.stake .v { color: var(--gold); font-weight: 900; }
.stake .w { font-size: 11px; color: rgba(243,231,207,.7); }
.stake.locked { opacity: .55; background: var(--panel); }
.stake .lock { position: absolute; top: 10px; right: 10px; font-size: 14px; }
.daily-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.day { padding: 10px 4px; border-radius: 12px; background: linear-gradient(180deg, #3f2c1b, #2a1c12); border: 1px solid rgba(212,168,58,.35); text-align: center; font-size: 12px; color: var(--muted); }
.day .r { font-weight: 900; color: var(--gold); font-size: 14px; }
.day.got { opacity: .45; }
.day.next { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 20px rgba(240,209,122,.35); background: linear-gradient(180deg, #5a4318, #2a1c12); color: var(--cream); }
.day.big { grid-column: span 2; background: linear-gradient(135deg, #6a4a12, #2a1c12); }
.wheel-wrap { position: relative; width: 290px; height: 290px; margin: 6px auto; filter: drop-shadow(0 16px 30px rgba(0,0,0,.6)); }
.wheel-wrap canvas { width: 100%; height: 100%; }
.wheel-wrap .ptr { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 28px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)); }
.result-hero { text-align: center; padding: 8px 0 12px; }
.result-hero .big { font-size: 40px; font-weight: 700; text-transform: uppercase; }
.result-hero .big.win { color: var(--brass-2); text-shadow: 0 2px 0 rgba(0,0,0,.5), 0 0 24px rgba(240,209,122,.5); animation: shine 3s ease-in-out infinite; }
.result-hero .big.lose { color: var(--muted); }
.reward-list { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.reward { padding: 8px 12px; border-radius: 12px; background: linear-gradient(180deg, #3f2c1b, #2a1c12); border: var(--brass-line); font-weight: 900; box-shadow: var(--panel-shadow); }
.reward.plus { color: var(--green); }
.reward.minus { color: var(--red); }
.spin-pick { width: 200px; height: 200px; border-radius: 50%; margin: 12px auto; background: radial-gradient(circle at 38% 32%, #fff, #d9dde6 55%, #8e95a5); position: relative; box-shadow: inset -10px -14px 26px rgba(0,0,0,.3), 0 16px 34px rgba(0,0,0,.6); touch-action: none; }
.spin-pick .dot { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8a9e, #d62828); border: 3px solid #fff; transform: translate(-50%, -50%); left: 50%; top: 50%; box-shadow: 0 3px 8px rgba(0,0,0,.5); }
.spin-pick .cross { position: absolute; left: 50%; top: 50%; width: 1px; height: 100%; background: rgba(0,0,0,.15); transform: translateX(-50%); }
.spin-pick .cross.h { width: 100%; height: 1px; transform: translateY(-50%); left: 0; }
.searching { text-align: center; padding: 20px 0; }
.searching .vs { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 14px 0; }
.searching .q { width: 66px; height: 66px; border-radius: 50%; border: 2px dashed var(--brass); display: flex; align-items: center; justify-content: center; font-size: 26px; animation: spinSlow 3s linear infinite; }
.code { font-size: 30px; letter-spacing: .25em; font-weight: 700; text-align: center; padding: 12px; background: rgba(0,0,0,.45); border-radius: 12px; margin: 10px 0; box-shadow: inset 0 2px 6px rgba(0,0,0,.6); color: var(--gold); border: 1px solid rgba(212,168,58,.35); }

/* ---- toast ---- */
#toasts { position: fixed; top: calc(var(--safe-top) + 12px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 100; pointer-events: none; }
.toast { padding: 10px 16px; background: linear-gradient(180deg, #4a3421, #2f1f13); border: 1px solid rgba(212,168,58,.6); border-radius: 12px; font-weight: 800; font-size: 14px; box-shadow: 0 12px 34px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,225,170,.15); animation: fadeIn .2s; max-width: 92%; text-align: center; color: var(--cream); }
.toast.gold { color: var(--gold); }

/* ---- загрузка ---- */
#loading { position: fixed; inset: 0; z-index: 200; background: radial-gradient(700px 500px at 50% 30%, #2b1d12, var(--leather-3) 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
#loading .ball { width: 76px; height: 76px; border-radius: 50%; background: radial-gradient(circle at 35% 28%, #5a5a5a, #000 68%); position: relative; box-shadow: 0 16px 34px rgba(0,0,0,.7), inset -6px -8px 16px rgba(0,0,0,.6); animation: bounce 1.2s ease-in-out infinite; }
#loading .ball::after { content: '8'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 32px; height: 32px; border-radius: 50%; background: #fff; color: #000; font-weight: 900; display: flex; align-items: center; justify-content: center; font-size: 19px; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
#loading .msg { color: var(--brass); font-weight: 800; letter-spacing: .06em; font-family: 'Oswald', sans-serif; text-transform: uppercase; }
#loading.hidden { display: none; }

/* ---- игра: пол бильярдной под столом ---- */
#screen-game { padding: 0; position: relative; background:
  radial-gradient(60% 45% at 50% 42%, rgba(255,230,160,.18), rgba(255,230,160,0) 70%),
  repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 2px, transparent 2px 46px),
  repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 9px),
  linear-gradient(180deg, #4a2f18, #2e1c0f);
}
#screen-game::before { content: ''; position: absolute; inset: 0; background: var(--noise); opacity: .5; pointer-events: none; }
#screen-game::after { content: ''; position: absolute; inset: 0; background: radial-gradient(80% 60% at 50% 45%, transparent 40%, rgba(0,0,0,.65) 100%); pointer-events: none; }
#gt { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; }
#gc { position: absolute; left: 0; top: 0; touch-action: none; z-index: 2; }
#game-top { position: absolute; left: 0; right: 0; top: 0; z-index: 5; padding: calc(var(--tg-safe-area-inset-top, var(--safe-top)) + var(--tg-content-safe-area-inset-top, 0px) + 6px) 8px 4px; pointer-events: none; }
#game-top .pcards { display: flex; gap: 8px; }
.pcard { flex: 1; display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 12px; background: linear-gradient(180deg, #4a3421, #2a1c12); border: 1px solid rgba(212,168,58,.5); position: relative; min-width: 0; box-shadow: var(--panel-shadow); transition: border-color .3s, box-shadow .3s; pointer-events: auto; }
.pcard.right { flex-direction: row-reverse; text-align: right; }
.pcard .nm { font-weight: 600; font-size: 14px; line-height: 1.1; color: var(--cream); }
.pcard .balls { display: flex; gap: 2px; margin-top: 3px; flex-wrap: wrap; min-height: 10px; }
.pcard.right .balls { justify-content: flex-end; }
.pcard .balls i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.45); box-shadow: inset -1px -1px 2px rgba(0,0,0,.5), inset 1px 1px 1px rgba(255,255,255,.5); }
.pcard .balls i.stripe { background: linear-gradient(to bottom, #fff 22%, var(--c) 22%, var(--c) 78%, #fff 78%) !important; }
.pcard .balls .lbl { font-size: 10px; color: var(--muted); font-weight: 700; }
.pcard { transition: border-color .35s var(--e-out), box-shadow .35s var(--e-out), background .35s var(--e-out), transform .35s var(--e-back); }
.pcard.active { transform: scale(1.03); border-color: var(--gold); box-shadow: 0 0 0 1px rgba(240,209,122,.5), 0 0 22px rgba(240,209,122,.3); background: linear-gradient(180deg, #2c8a4c, #1f6b3a); }
.pcard .ring { position: relative; width: 36px; height: 36px; border-radius: 50%; padding: 3px; background: conic-gradient(var(--gold) var(--p, 100%), rgba(0,0,0,.35) 0); flex: none; display: flex; transition: background .25s linear; }
.pcard.active .ring { box-shadow: 0 0 12px rgba(240,209,122,.5); }
.pcard .ring.warn { background: conic-gradient(var(--red) var(--p, 100%), rgba(0,0,0,.35) 0); box-shadow: 0 0 14px rgba(212,87,63,.6); }
.pcard .ring .avatar { width: 100%; height: 100%; font-size: 12px; box-shadow: none; border: 2px solid #1c120b; }
.pcard .tm { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 800; position: absolute; top: 4px; right: 8px; }
.pcard.right .tm { right: auto; left: 8px; }
.pcard.active .tm { color: var(--gold); }
.pcard .tm.warn { color: var(--red) !important; }
#hint { display: block; flex: 1; min-width: 0; text-align: center; margin: 0 6px; height: 26px; line-height: 24px; padding: 0 10px; font-size: 11px; border-radius: 999px; background: linear-gradient(180deg, #4a3421, #2a1c12); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid rgba(212,168,58,.5); box-shadow: 0 6px 16px rgba(0,0,0,.5); pointer-events: none; color: var(--cream); }
#hint.hidden { visibility: hidden; }
#hint.good { background: linear-gradient(180deg, #2c8a4c, #1f6b3a); color: var(--cream); border-color: rgba(240,209,122,.6); animation: pop .25s; }
#hint.bad { background: linear-gradient(180deg, #b83b28, #7a2f24); color: #fff; border-color: rgba(255,200,180,.5); animation: pop .25s; }
#power { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 36px; height: 42%; border-radius: 18px; background: linear-gradient(180deg, #2a1c12, #1c120b); border: 2px solid var(--brass-3); touch-action: none; display: none; box-shadow: inset 0 2px 8px rgba(0,0,0,.8), 0 8px 20px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.5); z-index: 6; }
#power.show { display: block; }
#power .pfx { position: absolute; left: -6px; top: -160px; width: calc(100% + 12px); height: calc(100% + 204px); pointer-events: none; z-index: 1; } /* размеры дублирует game.js (PFX_PAD_*) */
#power .fill { transition: box-shadow .12s; }
#power .fill { position: absolute; left: 4px; right: 4px; bottom: 4px; height: 0; border-radius: 12px; z-index: 0; background: linear-gradient(to top, #4fd68a 0%, #f0d17a 50%, #ff8a3d 78%, #d4573f 100%); background-repeat: no-repeat; background-position: left bottom; box-shadow: 0 0 12px rgba(240,209,122,.45), inset 0 1px 0 rgba(255,255,255,.35); transition: none; }
#power .ticks { position: absolute; left: 6px; right: 6px; top: 24px; bottom: 24px; background: repeating-linear-gradient(0deg, rgba(240,209,122,.35) 0 1px, transparent 1px 10%); pointer-events: none; }
#power .ticks::before { content: ''; position: absolute; left: 30%; right: 30%; top: 0; bottom: 0; background: repeating-linear-gradient(0deg, rgba(240,209,122,.55) 0 1px, transparent 1px 25%); }
#power .knob { position: absolute; left: 1px; right: 1px; height: 40px; border-radius: 16px; z-index: 2; background: linear-gradient(180deg, #f5dc8a, #d4a83a 60%, #a87f22); box-shadow: 0 4px 12px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.6), inset 0 -2px 0 rgba(0,0,0,.25); top: 0; display: flex; align-items: center; justify-content: center; color: #2b1d0c; font-size: 16px; font-weight: 900; }
#power .knob::before, #power .knob::after { content: ''; position: absolute; left: 8px; right: 8px; height: 1px; background: rgba(0,0,0,.35); }
#power .knob::before { top: 11px; } #power .knob::after { bottom: 11px; }
#power .lbl { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: 10px; font-weight: 900; color: var(--brass); letter-spacing: .1em; font-family: 'Oswald', sans-serif; }
#power .pct { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
#invite { position: fixed; left: 10px; right: 10px; top: calc(var(--tg-safe-area-inset-top, var(--safe-top)) + var(--tg-content-safe-area-inset-top, 0px) + 64px); z-index: 60; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel); border: 2px solid var(--gold); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.6); animation: slideUp .3s var(--e-back); }
#invite.hidden { display: none; }
#invite .grow { flex: 1; min-width: 0; }
#invite .bold { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#invite .btns { display: flex; gap: 6px; flex: none; }
#game-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px calc(var(--tg-safe-area-inset-bottom, var(--safe-bottom)) + 6px); }
#game-bottom .btn { padding: 9px 13px; }
#spinbtn { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #fff, #d9dde6 55%, #8e95a5); position: relative; box-shadow: 0 6px 16px rgba(0,0,0,.6), inset -4px -6px 10px rgba(0,0,0,.25), 0 0 0 2px var(--brass-3); flex: none; }
#spinbtn .dot { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8a9e, #d62828); transform: translate(-50%, -50%); left: 50%; top: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.emote-fly { position: absolute; top: 96px; font-size: 42px; animation: emote 2.2s ease-out forwards; pointer-events: none; z-index: 30; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.emote-fly.txt { font-size: 20px; font-weight: 900; background: linear-gradient(180deg, #4a3421, #2a1c12); padding: 6px 12px; border-radius: 12px; border: 1px solid rgba(212,168,58,.5); color: var(--cream); }
@keyframes emote { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 15% { opacity: 1; transform: translateY(0) scale(1.1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }
.emote-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.emote-grid button { font-size: 28px; padding: 10px; background: linear-gradient(180deg, #3f2c1b, #2a1c12); border-radius: 12px; border: var(--brass-line); font-weight: 900; box-shadow: var(--panel-shadow); color: var(--cream); }
.lb-me { position: sticky; bottom: 0; margin-top: 8px; }
.ach-pop { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: linear-gradient(135deg, #6a4a12, #2a1c12); border: 1px solid var(--gold); margin-bottom: 8px; box-shadow: 0 8px 24px rgba(212,168,58,.2); }
.ach-pop .ic { font-size: 30px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
input { color-scheme: dark; }

/* ---- полы и атмосфера стран ---- */
#screen-game.theme-london { background: radial-gradient(60% 45% at 50% 42%, rgba(255,230,160,.18), rgba(255,230,160,0) 70%), repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 2px, transparent 2px 46px), repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 9px), linear-gradient(180deg, #4a2f18, #2e1c0f); }
#screen-game.theme-sydney { background: radial-gradient(70% 50% at 50% 40%, rgba(255,255,230,.35), rgba(255,255,230,0) 70%), repeating-linear-gradient(90deg, rgba(0,0,0,.12) 0 2px, transparent 2px 40px), linear-gradient(180deg, #d9b98a 0%, #c79a63 60%, #a8784a 100%); }
#screen-game.theme-berlin { background: radial-gradient(30% 20% at 15% 20%, rgba(255,64,160,.35), transparent 70%), radial-gradient(28% 18% at 85% 75%, rgba(80,220,120,.3), transparent 70%), radial-gradient(24% 16% at 80% 15%, rgba(255,230,60,.28), transparent 70%), repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 1px, transparent 1px 34px), repeating-linear-gradient(90deg, rgba(0,0,0,.14) 0 1px, transparent 1px 34px), linear-gradient(180deg, #5c5f66, #3c3f45); }
#screen-game.theme-moscow { background: radial-gradient(60% 45% at 50% 42%, rgba(255,230,160,.16), transparent 70%), linear-gradient(90deg, transparent 0 12%, rgba(212,168,58,.55) 12% 13%, #8e1b2a 13% 87%, rgba(212,168,58,.55) 87% 88%, transparent 88%), repeating-linear-gradient(45deg, rgba(0,0,0,.16) 0 2px, transparent 2px 22px), repeating-linear-gradient(-45deg, rgba(255,255,255,.05) 0 2px, transparent 2px 22px), linear-gradient(180deg, #6b4423, #4a2f18); }
#screen-game.theme-tokyo { background: radial-gradient(22% 14% at 8% 12%, rgba(255,79,216,.55), transparent 70%), radial-gradient(22% 14% at 92% 22%, rgba(56,217,245,.5), transparent 70%), radial-gradient(18% 12% at 10% 80%, rgba(255,235,59,.35), transparent 70%), radial-gradient(20% 12% at 90% 85%, rgba(255,79,216,.4), transparent 70%), repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 8px), linear-gradient(180deg, #0b0b16, #14102a); }
#screen-game.theme-dubai { background: radial-gradient(60% 45% at 50% 42%, rgba(255,240,200,.45), transparent 70%), repeating-linear-gradient(60deg, rgba(184,150,58,.18) 0 1px, transparent 1px 38px), repeating-linear-gradient(-30deg, rgba(184,150,58,.12) 0 1px, transparent 1px 52px), linear-gradient(180deg, #f1e7d2, #d9caa8); }
#screen-game.theme-vegas { background: radial-gradient(30% 20% at 10% 15%, rgba(255,79,216,.45), transparent 70%), radial-gradient(30% 20% at 90% 20%, rgba(56,217,245,.4), transparent 70%), repeating-conic-gradient(from 45deg, rgba(240,209,122,.14) 0 25%, rgba(0,0,0,.15) 0 50%) 0 0 / 56px 56px, linear-gradient(180deg, #2a1442, #160b26); }
#screen-game.theme-monaco { background: radial-gradient(70% 40% at 50% 0%, rgba(120,190,255,.45), transparent 70%), radial-gradient(60% 45% at 50% 45%, rgba(255,255,255,.35), transparent 70%), repeating-linear-gradient(60deg, rgba(150,160,180,.16) 0 1px, transparent 1px 46px), linear-gradient(180deg, #f5f2ea, #d8d3c6); }
#screen-game.theme-macau { background: radial-gradient(14% 10% at 12% 14%, rgba(255,60,40,.7), transparent 70%), radial-gradient(14% 10% at 88% 16%, rgba(255,60,40,.65), transparent 70%), radial-gradient(14% 10% at 12% 86%, rgba(255,60,40,.55), transparent 70%), radial-gradient(14% 10% at 88% 84%, rgba(255,60,40,.55), transparent 70%), radial-gradient(circle at 50% 50%, rgba(240,209,122,.35) 0 2px, transparent 3px) 0 0 / 34px 34px, linear-gradient(180deg, #6a0c0c, #3a0606); }
#screen-game.theme-dubai::after, #screen-game.theme-monaco::after, #screen-game.theme-sydney::after { background: radial-gradient(80% 60% at 50% 45%, transparent 40%, rgba(0,0,0,.45) 100%); }
.playbtn.wheel-ready { box-shadow: 0 0 0 3px var(--gold), 0 12px 30px rgba(212,168,58,.45), inset 0 0 0 3px #6b4423; }
.playbtn.wheel-ready .s { color: var(--gold); }
.stake { background: linear-gradient(180deg, var(--cloth, #1f6b3a), color-mix(in srgb, var(--cloth, #1f6b3a) 70%, #000)); border: 3px solid var(--rail, #5a3a1e); box-shadow: 0 0 0 1px rgba(240,209,122,.5), var(--panel-shadow); }

/* ---- новостная лента: меловая доска в деревянной раме ---- */
.banner.chalk { overflow: visible; margin-top: 30px; height: 108px; min-height: 108px; max-height: 108px; box-sizing: border-box; transform-origin: 50% -30px; animation: swing 7s ease-in-out infinite; background: radial-gradient(120% 80% at 20% 0%, rgba(255,255,255,.07), transparent 60%), #1c2a24; border: 6px solid #5a3a1e; border-radius: 10px; box-shadow: inset 0 0 0 2px #3e2613, inset 0 0 30px rgba(0,0,0,.6), 0 8px 22px rgba(0,0,0,.5); padding: 16px 14px 14px; min-height: 96px; }
.banner.chalk::before { opacity: .9; border-radius: 4px; background: var(--noise), radial-gradient(40% 60% at 80% 90%, rgba(255,255,255,.06), transparent 70%); }
.banner.chalk.gold, .banner.chalk.green, .banner.chalk.red { background: #1c2a24; }
.banner.chalk .chalk-tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); white-space: nowrap; z-index: 3; padding: 2px 10px; background: linear-gradient(180deg, #f5dc8a, #d4a83a); color: #2b1d0c; font: 700 11px 'Oswald', sans-serif; letter-spacing: .12em; text-transform: uppercase; border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.banner.chalk .title { font-family: 'Caveat', 'Marck Script', cursive; font-size: 21px; line-height: 1.05; color: #f4f1e8; text-shadow: 0 0 6px rgba(255,255,255,.25); transform: rotate(-1deg); font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-height: 46px; }
.banner.chalk .sub { font-family: 'Caveat', cursive; font-size: 16px; color: rgba(244,241,232,.75); margin-top: 2px; transform: rotate(-1deg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner.chalk .grow { min-width: 0; }
.banner.chalk .timer { color: #f5dc8a; font-family: 'Caveat', cursive; font-size: 18px; }
.banner.chalk .ic { font-size: 34px; filter: grayscale(.15) drop-shadow(0 0 6px rgba(255,255,255,.35)); animation: none; }
.banner.chalk .dots { bottom: 6px; right: 10px; gap: 5px; }
.banner.chalk .dots i { width: 10px; height: 3px; border-radius: 2px; background: rgba(244,241,232,.3); transform: rotate(-8deg); }
.banner.chalk .dots i.on { background: #f4f1e8; box-shadow: 0 0 4px rgba(255,255,255,.6); }

/* ---- витрина турнира: бархат и золотой пьедестал ---- */
.tournament { display: block; width: 100%; text-align: left; margin: 14px 0 6px; padding: 12px 12px 10px; border-radius: 16px; position: relative; overflow: hidden; color: var(--cream); background: radial-gradient(70% 60% at 50% 0%, rgba(240,209,122,.22), transparent 70%), repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 6px, transparent 6px 12px), linear-gradient(180deg, #5a1630, #2f0b1a); border: 2px solid var(--brass); box-shadow: 0 10px 26px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.08), inset 0 1px 0 rgba(255,255,255,.15); }
.tournament::before { content: ''; position: absolute; inset: 0; background: var(--noise); opacity: .35; pointer-events: none; }
.tournament:active { transform: scale(.985); }
.tournament .trib { display: flex; justify-content: space-between; align-items: center; font-family: 'Oswald', sans-serif; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; color: var(--brass-2); text-shadow: 0 1px 0 rgba(0,0,0,.6); position: relative; }
.tournament .tleft { font-size: 12px; color: var(--cream); letter-spacing: .02em; }
.tournament .tleft b { color: var(--gold); font-variant-numeric: tabular-nums; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 10px 0 8px; position: relative; }
.pod { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.pod .pav { position: relative; z-index: 1; }
.pod .pav .avatar { box-shadow: 0 0 0 2px var(--brass), 0 4px 10px rgba(0,0,0,.6); }
.pod .pname { font-size: 12px; font-weight: 800; max-width: 100%; text-align: center; }
.pod .pblock { width: 100%; border-radius: 8px 8px 4px 4px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 4px; box-shadow: inset 0 2px 0 rgba(255,255,255,.35), inset 0 -4px 0 rgba(0,0,0,.35), 0 6px 14px rgba(0,0,0,.45); }
.pod .pn { font-family: 'Oswald', sans-serif; font-size: 20px; font-weight: 700; line-height: 1; color: rgba(0,0,0,.55); }
.pod .ptr { font-size: 10px; font-weight: 800; color: rgba(0,0,0,.65); margin-top: 2px; white-space: nowrap; }
.pod.first .pblock { height: 70px; background: linear-gradient(180deg, #f5dc8a, #d4a83a 60%, #a87f22); }
.pod.first .pav .avatar { width: 40px; height: 40px; font-size: 15px; }
.pod.second .pblock { height: 56px; background: linear-gradient(180deg, #e6e9ee, #b8bec8 60%, #8d95a1); }
.pod.third .pblock { height: 46px; background: linear-gradient(180deg, #d9a071, #b5743f 60%, #8a5426); }
.avatar.empty { background: rgba(255,255,255,.12); color: var(--muted); box-shadow: 0 0 0 2px rgba(255,255,255,.2); }
.tournament .tfoot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: rgba(243,231,207,.85); border-top: 1px solid rgba(240,209,122,.35); padding-top: 8px; position: relative; }
.tournament .tfoot b { color: var(--gold); }
.tournament .tprize { font-size: 11px; }

/* ---- плитки: разные акценты ---- */
.tile-friend { background: linear-gradient(180deg, #1f3b5c, #14263c 70%); border-color: rgba(120,180,255,.5); }
.tile-friend .ic { filter: drop-shadow(0 0 8px rgba(120,180,255,.6)); }
.tile-practice { background: linear-gradient(180deg, #5a3a12, #3a2508 70%); border-color: rgba(255,170,60,.5); }
.tile-practice .ic { filter: drop-shadow(0 0 8px rgba(255,170,60,.6)); }

/* ---- доска подвешена к плашке на двух верёвках ---- */
@keyframes swing { 0%, 100% { transform: rotate(-.5deg); } 50% { transform: rotate(.5deg); } }
.topbar { margin-bottom: 0; }
.banner.chalk .rope { position: absolute; top: -37px; width: 7px; height: 38px; background: repeating-linear-gradient(-45deg, #c9a36a 0 3px, #8f6a3a 3px 6px); border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 2px 4px rgba(0,0,0,.5); z-index: 2; }
.banner.chalk .rope.l { left: 7%; } .banner.chalk .rope.r { right: 7%; }
.banner.chalk .rope::before { content: ''; position: absolute; top: -4px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f5dc8a, #a87f22 70%); box-shadow: 0 1px 3px rgba(0,0,0,.7), inset 0 -1px 0 rgba(0,0,0,.4); }
.banner.chalk .rope::after { content: ''; position: absolute; bottom: -2px; left: 50%; width: 14px; height: 9px; margin-left: -7px; border-radius: 6px; background: repeating-linear-gradient(90deg, #c9a36a 0 2px, #8f6a3a 2px 4px); box-shadow: 0 1px 3px rgba(0,0,0,.6); }

/* ---- кнопка «Играть» закреплена над навигацией ---- */
.home-footer { position: fixed; left: 12px; right: 12px; bottom: calc(var(--safe-bottom) + 78px); z-index: 15; }
.home-footer .playbtn { margin: 0; padding: 16px 20px; box-shadow: 0 14px 34px rgba(0,0,0,.6), inset 0 0 0 3px #6b4423, inset 0 0 0 4px rgba(240,209,122,.7), inset 0 1px 0 rgba(255,255,255,.2); }
.home-footer .playbtn .t { font-size: 26px; }
#screen-home .scroll { padding-bottom: 190px; }
.playmenu { display: flex; flex-direction: column; gap: 10px; }
.playmenu button { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px; border-radius: 14px; border: 1px solid rgba(240,209,122,.5); color: var(--cream); box-shadow: var(--panel-shadow); }
.playmenu .ic { font-size: 30px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.playmenu .t { font-family: 'Oswald', sans-serif; font-size: 19px; text-transform: uppercase; letter-spacing: .03em; }
.playmenu .s { font-size: 12px; color: rgba(243,231,207,.75); margin-top: 2px; }
.playmenu .pm-online { background: linear-gradient(180deg, #2c8a4c, #1f6b3a 70%); }
.playmenu .pm-friend { background: linear-gradient(180deg, #1f3b5c, #14263c 70%); border-color: rgba(120,180,255,.5); }
.playmenu .pm-practice { background: linear-gradient(180deg, #5a3a12, #3a2508 70%); border-color: rgba(255,170,60,.5); }

/* ---- слоты стикеров ---- */
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slot { position: relative; aspect-ratio: 1; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--cream); background: var(--panel); border: 1px solid rgba(212,168,58,.4); box-shadow: var(--panel-shadow); }
.slot.empty { border-style: dashed; border-color: rgba(212,168,58,.6); }
.slot .plus { font-size: 30px; line-height: 1; color: var(--brass-2); }
.slot .sl { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.slot .sub { font-size: 11px; color: var(--brass); }
.slot.buy { background: linear-gradient(180deg, #5a4318, #2a1c12); border-color: var(--gold); }
.slot.filled .stk { width: 64px; height: 64px; }
.slot .x { position: absolute; top: 4px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.5); color: var(--cream); font-size: 11px; display: flex; align-items: center; justify-content: center; }
.stk { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.stk svg, .stk video, .stk img { width: 100%; height: 100%; object-fit: contain; }
.emote-grid.stickers { margin-bottom: 8px; }
.emote-grid.stickers button { padding: 4px; }
.emote-fly.sticker { top: 90px; background: none; padding: 0; animation: stickerFly 3.2s ease-out forwards; }
.emote-fly.sticker .stk { width: 120px; height: 120px; filter: drop-shadow(0 10px 16px rgba(0,0,0,.55)); }
@keyframes stickerFly { 0% { opacity: 0; transform: translateY(16px) scale(.5); } 12% { opacity: 1; transform: translateY(0) scale(1.08); } 20% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-24px) scale(.9); } }

/* ---- перелистывание экранов свайпом ---- */
.screen.peek { display: flex; position: absolute; left: 0; right: 0; z-index: 2; }
.screen.peek { backface-visibility: hidden; }

/* ---- эффекты наград ---- */
#fxlayer { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.fx { position: absolute; display: flex; align-items: center; justify-content: center; will-change: transform, opacity; }
.fx.coin { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c8, #f0d17a 32%, #d4a83a 62%, #8c6a1f 100%); box-shadow: 0 2px 5px rgba(0,0,0,.55), inset 0 0 0 2px rgba(255,255,255,.28), inset 0 -2px 3px rgba(0,0,0,.25); }
.fx.coin::after { content: ''; position: absolute; inset: 22%; border-radius: 50%; border: 1.5px solid rgba(140,106,31,.6); }
.fx.trophy { font-size: 22px; filter: drop-shadow(0 3px 5px rgba(0,0,0,.6)); }
.fx.xp { width: auto !important; height: auto !important; padding: 2px 6px; border-radius: 999px; font-family: 'Oswald', sans-serif; font-weight: 900; line-height: 1; letter-spacing: .06em; color: #2b1d0c; background: linear-gradient(115deg, #fff8d6 0%, #f5dc8a 28%, #d4a83a 50%, #f5dc8a 72%, #fff8d6 100%); background-size: 250% 100%; animation: fxShine .7s linear infinite; box-shadow: 0 0 10px rgba(255,225,140,.9), 0 2px 4px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.7); text-shadow: 0 1px 0 rgba(255,255,255,.4); }
@keyframes fxShine { from { background-position: 0% 0; } to { background-position: 250% 0; } }
.fx.ach { font-size: 24px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.6)); }
.chip.hit, #nav button.hit { animation: chipHit .22s ease-out; }
@keyframes chipHit { 0% { transform: scale(1); } 35% { transform: scale(1.22, .9) rotate(-3deg); } 60% { transform: scale(.94, 1.08) rotate(2deg); } 80% { transform: scale(1.04, .98); } 100% { transform: scale(1) rotate(0); } }


/* ---- сезон: уровни по очкам (как у FACEIT) ---- */
.lvl { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 7px; font-size: 12px; font-weight: 900; color: #1a1208; border: 1px solid rgba(0,0,0,.35); box-shadow: inset 0 1px 0 rgba(255,255,255,.35); vertical-align: middle; }
.lvl.l1 { background: #b8bec4; } .lvl.l2 { background: #7ed67a; } .lvl.l3 { background: #4fcf62; } .lvl.l4 { background: #f5d84a; } .lvl.l5 { background: #f4c13a; } .lvl.l6 { background: #f4a72e; } .lvl.l7 { background: #f28b2b; } .lvl.l8 { background: #ef6a2a; color: #fff; } .lvl.l9 { background: #e8482a; color: #fff; } .lvl.l10 { background: #d4262b; color: #fff; box-shadow: 0 0 10px rgba(212,38,43,.6), inset 0 1px 0 rgba(255,255,255,.35); }
.reward.pts { color: var(--gold); }

/* ---- карточка турнира на главной ---- */
.tourney { display: block; width: 100%; text-align: left; margin: 8px 0 0; padding: 10px 12px; border-radius: 14px; position: relative; overflow: hidden; color: var(--cream); background: radial-gradient(80% 70% at 50% 0%, rgba(43,181,168,.22), transparent 70%), linear-gradient(180deg, #14302e, #0e1f1e); border: 2px solid rgba(43,181,168,.55); box-shadow: 0 8px 18px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.08); font: inherit; }
.tourney::before { content: ''; position: absolute; inset: 0; background: var(--noise); opacity: .3; pointer-events: none; }
.tourney:active { transform: scale(.985); }
.tourney .tt { display: flex; justify-content: space-between; align-items: center; font-family: 'Oswald', sans-serif; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: #8fe3d8; }
.tourney .tt b { color: #fff; font-weight: 500; font-size: 12px; letter-spacing: .02em; text-transform: none; font-family: inherit; }
.tourney .ts { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: rgba(243,231,207,.85); }
.tourney .cta { flex: none; padding: 6px 12px; border-radius: 10px; font-weight: 900; font-size: 12px; background: linear-gradient(180deg, #4fd6c8, #21a396); color: #06211f; box-shadow: 0 3px 8px rgba(0,0,0,.4); }
.tourney.live { border-color: var(--gold); background: radial-gradient(80% 70% at 50% 0%, rgba(240,209,122,.25), transparent 70%), linear-gradient(180deg, #3a2a10, #22180a); }
.tourney.live .tt { color: var(--gold2); } .tourney.live .cta { background: linear-gradient(180deg, #f0d17a, #c8952c); color: #1a1208; animation: pulse 1.4s ease-in-out infinite; }

/* ---- окно турнира и сетка ---- */
.tour-head { display: flex; gap: 10px; align-items: center; }
.tour-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.tour-kv .card { padding: 8px 10px; } .tour-kv .v { font-size: 18px; font-weight: 900; color: var(--gold); } .tour-kv .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tour-players { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tour-players .pp { display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border-radius: 20px; background: rgba(0,0,0,.3); border: 1px solid var(--line2); font-size: 12px; max-width: 100%; }
.tour-players .pp .avatar { width: 22px; height: 22px; font-size: 11px; }
.bracket { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 10px; -webkit-overflow-scrolling: touch; }
.bracket .rnd { flex: none; width: 150px; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.bracket .rn { font-size: 11px; color: var(--brass); text-transform: uppercase; letter-spacing: .08em; text-align: center; margin-bottom: 2px; }
.bracket .bm { border-radius: 10px; background: rgba(0,0,0,.35); border: 1px solid var(--line2); overflow: hidden; }
.bracket .bm.live { border-color: var(--gold); box-shadow: 0 0 10px rgba(240,209,122,.35); }
.bracket .bm[data-watch] { cursor: pointer; }
.bracket .bm .watch { font-size: 10px; text-align: center; color: var(--gold); padding: 3px 0 1px; letter-spacing: .04em; }
#screen-game.spectating #power, #screen-game.spectating #btn-emote, #screen-game.spectating #spinbtn { display: none !important; }
.bracket .bp { display: flex; align-items: center; gap: 6px; padding: 5px 7px; font-size: 12px; border-bottom: 1px solid rgba(255,255,255,.06); }
.bracket .bp:last-child { border-bottom: 0; }
.bracket .bp.w { background: rgba(63,191,111,.14); color: #d9f5e0; font-weight: 800; }
.bracket .bp.l { opacity: .55; }
.bracket .bp.me { outline: 1px solid var(--gold); outline-offset: -1px; }
.bracket .bp .avatar { width: 20px; height: 20px; font-size: 10px; flex: none; }
.bracket .bp .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tour-list .item { cursor: pointer; }
.tour-status { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 800; }
.tour-status.registration { background: rgba(43,181,168,.25); color: #8fe3d8; } .tour-status.running { background: rgba(240,209,122,.25); color: var(--gold2); } .tour-status.finished { background: rgba(255,255,255,.1); color: var(--muted); } .tour-status.scheduled { background: rgba(77,163,255,.2); color: #9cc9ff; } .tour-status.cancelled { background: rgba(224,86,74,.2); color: #ff9a90; }


/* ==== 12 принципов: единые кривые движения ==== */
:root { --e-out: cubic-bezier(.2,.8,.2,1); --e-back: cubic-bezier(.34,1.56,.64,1); --e-in: cubic-bezier(.4,0,1,1); --e-soft: cubic-bezier(.45,0,.2,1); }
@keyframes sheetIn { 0% { transform: translateY(56px) scaleY(.96); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes sheetInB { 0% { transform: translateY(56px) scaleY(.96); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes sheetOut { from { transform: none; opacity: 1; } to { transform: translateY(40px); opacity: 0; } }
@keyframes popIn { 0% { transform: scale(.82) translateY(10px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes popInB { 0% { transform: scale(.82) translateY(10px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes popOut { from { transform: none; opacity: 1; } to { transform: scale(.9); opacity: 0; } }
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdropOut { from { opacity: 1; } to { opacity: 0; } }

/* нажатия: быстрое вжатие, пружинящее отпускание (squash & stretch, slow out) */
.btn, .tile, .playbtn, .tournament, .tourney, .item, .quest, .playmenu button, .shop-card, .cue-card, .stake, .pack, .lb-me, .season-card { transition: transform .22s var(--e-back), filter .2s, box-shadow .25s var(--e-out), border-color .25s var(--e-out); }
.btn:active, .tile:active, .playbtn:active, .tournament:active, .tourney:active, .playmenu button:active { transition-duration: .07s; transition-timing-function: var(--e-in); }
.btn:active { transform: translateY(1px) scale(.96, .94); }
.playbtn:active { transform: scale(.975, .96); }
.playmenu button:active { transform: scale(.97); }

/* вкладки: иконка подпрыгивает при выборе (anticipation → overshoot → settle) */
#nav button .ic { transition: filter .25s, transform .3s var(--e-back); }
#nav button.active .ic { animation: navPop .5s var(--e-back); }
@keyframes navPop { 0% { transform: translateY(2px) scale(.8, 1.15); } 40% { transform: translateY(-6px) scale(1.25, .9); } 70% { transform: translateY(-1px) scale(1.05, 1.1); } 100% { transform: translateY(-2px) scale(1.12); } }

/* тосты: падают сверху по дуге с перелётом, уходят вверх */
.toast { animation: toastIn .45s var(--e-back); transition: opacity .28s var(--e-in), transform .28s var(--e-in); }
@keyframes toastIn { 0% { transform: translateY(-26px) scale(.86, 1.08); opacity: 0; } 55% { transform: translateY(3px) scale(1.04, .96); opacity: 1; } 100% { transform: none; opacity: 1; } }
.toast.out { opacity: 0; transform: translateY(-14px) scale(.96); }

/* доска новостей: новая запись «выписывается» справа, иконка выскакивает, табличка вздрагивает (secondary action) */
.banner.chalk .grow { animation: chalkIn .55s var(--e-out); }
.banner.chalk .ic { animation: chalkIc .6s var(--e-back); }
.banner.chalk .chalk-tag { animation: tagJiggle .7s var(--e-back); }
@keyframes chalkIn { 0% { opacity: 0; transform: translateX(14px); } 100% { opacity: 1; transform: none; } }
@keyframes chalkIc { 0% { transform: scale(.4) rotate(-20deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes tagJiggle { 0% { transform: translateX(-50%) rotate(0); } 30% { transform: translateX(-50%) rotate(-4deg) translateY(1px); } 60% { transform: translateX(-50%) rotate(3deg); } 100% { transform: translateX(-50%) rotate(0); } }

/* кнопка «играть»: редкий блик по поверхности (appeal), при готовом колесе — заметнее */
.playbtn::after { content: ''; position: absolute; top: -20%; bottom: -20%; left: -40%; width: 30%; pointer-events: none; background: linear-gradient(100deg, rgba(255,255,255,0), rgba(255,255,255,.14) 45%, rgba(255,255,255,.28) 50%, rgba(255,255,255,.14) 55%, rgba(255,255,255,0)); transform: skewX(-18deg); will-change: transform; animation: playShine 7s var(--e-soft) infinite; }
.playbtn.wheel-ready::after { animation-duration: 2.6s; }
@keyframes playShine { 0%, 78% { transform: translateX(0) skewX(-18deg); } 100% { transform: translateX(566.667%) skewX(-18deg); } }

/* окно результата: трофей падает и пружинит, награды выкатываются по очереди (overlapping action, staging) */
.result-hero > div:first-child { display: inline-block; animation: heroDrop .7s var(--e-back); transform-origin: 50% 100%; }
@keyframes heroDrop { 0% { transform: translateY(-50px) scale(.5); opacity: 0; } 50% { transform: translateY(4px) scale(1.15, .88); opacity: 1; } 72% { transform: translateY(-4px) scale(.95, 1.06); } 100% { transform: none; } }
.result-hero .big { animation: bigIn .5s var(--e-back) .15s both; }
@keyframes bigIn { 0% { transform: scale(.6); opacity: 0; letter-spacing: .3em; } 100% { transform: none; opacity: 1; } }


/* поиск соперника: аватар дышит, знак вопроса нетерпеливо крутится, VS пульсирует (anticipation) */
.searching .vs .avatar { animation: floatY 2.2s ease-in-out infinite; }
.searching .vs .q { display: inline-block; font-size: 34px; animation: qWobble 1.6s var(--e-soft) infinite; }
.searching .vs b { animation: pulse 1.2s ease-in-out infinite; display: inline-block; }
@keyframes qWobble { 0%, 100% { transform: rotate(-8deg) scale(1); } 25% { transform: rotate(6deg) scale(1.1, .92); } 50% { transform: rotate(-4deg) scale(.95, 1.06); } 75% { transform: rotate(8deg) scale(1.05); } }

/* задания: выполненное, но не забранное — зовёт; забранное — мягко уходит на второй план */
.quest.done:not(.claimed)::after { content: ''; position: absolute; inset: 0; border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 1px rgba(63,191,111,.6), 0 0 22px rgba(63,191,111,.35); opacity: 0; will-change: opacity; animation: glowIn 2.4s ease-in-out infinite; }
.quest.done:not(.claimed) .btn { animation: pulse 1.6s ease-in-out infinite; }
.quest.claimed { transition: opacity .45s var(--e-out), transform .45s var(--e-out); transform: scale(.985); }
.quest .ic { transition: transform .3s var(--e-back); } .quest.done .ic { transform: scale(1.12) rotate(-6deg); }

/* подиум сезона: лидер парит, остальные чуть дышат (secondary action) */
.podium .pod.first .pav { animation: floatY 3s ease-in-out infinite; }
.podium .pod.second .pav { animation: floatY 3.6s ease-in-out .6s infinite; }
.podium .pod.third .pav { animation: floatY 3.3s ease-in-out 1.2s infinite; }

/* карточка хода в матче: кольцо «дышит» у того, чей ход */
.pcard.active .ring, .pcard.active .ring.warn { box-shadow: none; }
.pcard.active .ring::before, .pcard.active .ring::after { content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; will-change: opacity; }
.pcard.active .ring::before { box-shadow: 0 0 10px rgba(240,209,122,.4); animation: glowOut 1.8s ease-in-out infinite; }
.pcard.active .ring::after { box-shadow: 0 0 20px rgba(240,209,122,.75); animation: glowIn 1.8s ease-in-out infinite; }
@keyframes glowIn { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes glowOut { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* уменьшенная анимация — для тех, кто её отключил в системе */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
