/*
 * «Ставки» — телефон. Мир: ночной тотализатор-бар (docs/bets-spec.md §7.1).
 * Чёрное стекло, неоновая вывеска, цифры коэффициентов на «перекидных» флапах, купон с перфорацией.
 * Лайм — выигрыш/рост, маджента — проигрыш/штраф/вывеска, янтарь — цифры табло.
 * Прокручивается только #app внутри оболочки (#shell): страница целиком не двигается, горизонтального скролла нет.
 */
:root {
  --bg: #07090c; --glass: #0d1217; --glass-2: #121a21; --glass-3: #18222b; --line: #1f2b34; --line-2: #2c3b47;
  --text: #eef2ee; --dim: #8a98a0; --lime: #b6ff2e; --magenta: #ff2e88; --amber: #ffd34d; --ink: #06090b;
  --disp: "Big Shoulders Display", "Oswald", "Roboto Condensed", "Arial Narrow", Impact, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gut: 12px;
  /* общий переключатель языка (i18n.js) в цвет мира */
  --lang-switch-bg: #0d1217; --lang-switch-border: #2c3b47; --lang-switch-fg: #8a98a0;
  --lang-switch-active-bg: #b6ff2e; --lang-switch-active-fg: #06090b; --lang-switch-active-border: transparent;
  --lang-switch-font: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
body .lang-switch { top: calc(6px + env(safe-area-inset-top)); }
body .lang-switch button { min-width: 44px !important; min-height: 40px !important; }
body.in-game .lang-switch { display: none; } /* на игровом экране он закрывал бы таймер */
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--text); overflow: hidden; overscroll-behavior: none; }
body { font-family: var(--mono); font-size: 14px; line-height: 1.35; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }

#shell { position: relative; display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 560px; margin: 0 auto; overflow: hidden;
  background: radial-gradient(120% 50% at 50% -10%, rgba(255, 46, 136, .13), transparent 60%), var(--bg); }
#app { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
#app > .game { height: 100%; }

.conn { flex: none; max-height: 0; overflow: hidden; background: var(--magenta); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .06em; text-align: center; text-transform: uppercase; transition: max-height .2s; }
.conn.on { max-height: 40px; padding: 6px 12px; }
.toast { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(8px); max-width: calc(100% - 32px); padding: 9px 14px; background: var(--glass-3); border: 1px solid var(--line-2);
  color: var(--text); font-size: 13px; font-weight: 700; text-align: center; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 20; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.bad { border-color: var(--magenta); color: #ffd1e4; }

/* ---------- вывеска и общие страницы ---------- */
.sign { font-family: var(--disp); font-weight: 900; font-size: 40px; line-height: 1; letter-spacing: .14em; text-transform: uppercase; color: #fff; text-align: center;
  text-shadow: 0 0 3px #fff, 0 0 10px var(--magenta), 0 0 26px var(--magenta), 0 0 48px var(--magenta); animation: hum 6s infinite; }
.sign.sm { font-size: 26px; }
@keyframes hum { 0%, 91%, 95%, 100% { opacity: 1 } 92% { opacity: .5 } 94% { opacity: .85 } }
.page { min-height: 100%; display: flex; flex-direction: column; gap: 14px; padding: 58px var(--gut) calc(18px + var(--safe-b)); }
.page > * { flex: none; min-width: 0; }
.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); text-align: center; }
.lede { color: #c5d0d5; text-align: center; font-size: 14px; line-height: 1.5; }
.card { background: var(--glass); border: 1px solid var(--line); padding: 14px; }
.card h2 { font-family: var(--disp); font-weight: 800; font-size: 24px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.room { font-family: var(--disp); font-weight: 900; font-size: 30px; letter-spacing: .22em; color: var(--amber); text-align: center; text-shadow: 0 0 14px rgba(255, 211, 77, .35); }
.fld { position: relative; margin: 10px 0 4px; }
.fld input, .codeform input { width: 100%; min-height: 48px; padding: 10px 14px; background: #05070a; border: 1px solid var(--line-2); border-radius: 0; color: var(--text); font-size: 18px; font-weight: 700; outline: none; }
.fld input:focus, .codeform input:focus { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime), 0 0 18px rgba(182, 255, 46, .2); }
.fld .cnt { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; color: var(--dim); }
.fld .cnt[data-state="full"] { color: var(--magenta); }
.err { min-height: 18px; color: #ff7fb2; font-size: 13px; font-weight: 700; }
.btn { display: block; width: 100%; min-height: 48px; padding: 12px 18px; background: var(--lime); color: var(--ink); font-weight: 800; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; border-bottom: 3px solid #6c9e10; text-align: center; text-decoration: none; }
.btn:active { transform: translateY(2px); border-bottom-width: 1px; }
.btn.ghost { background: var(--glass-2); color: var(--text); border-bottom-color: #000; }
.btn:disabled { opacity: .5; }
.link { min-height: 44px; padding: 8px 12px; color: var(--dim); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; text-align: center; }
.codeform { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.codeform .btn { width: auto; min-width: 84px; }
.center { min-height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 58px var(--gut) 24px; text-align: center; }
.center h2 { font-family: var(--disp); font-weight: 800; font-size: 30px; letter-spacing: .08em; text-transform: uppercase; }
.center p { color: #c5d0d5; line-height: 1.5; }
.claimbtns { display: grid; gap: 6px; }

.rules { display: grid; gap: 8px; }
.rules .r { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 10px; background: var(--glass); border: 1px solid var(--line); font-size: 13px; color: #c5d0d5; }
.rules .r i { font-style: normal; font-size: 22px; text-align: center; }
.fine { font-size: 11px; color: var(--dim); text-align: center; line-height: 1.5; }

/* лобби */
.plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; background: var(--glass-2); border: 1px solid var(--line); }
.who b { font-family: var(--disp); font-weight: 800; font-size: 18px; letter-spacing: .04em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.who.me { border-color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); }
.who.off { opacity: .45; }
.who.new { animation: drop .45s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes drop { 0% { transform: translateY(-14px) scale(.8); opacity: 0 } 100% { transform: none; opacity: 1 } }
.av { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: #07090c; font: 900 15px var(--disp); text-transform: uppercase; }
.livepill { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--lime); }
.livepill i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25 } }
.wrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------- флапы ---------- */
.flap { display: inline-flex; gap: 2px; align-items: center; justify-content: flex-start; vertical-align: middle; }
.flap span { position: relative; width: 14px; height: 24px; display: grid; place-items: center; background: linear-gradient(#232c33 50%, #1a2128 50%); color: var(--amber); font-weight: 800; font-size: 16px; border-radius: 2px; font-variant-numeric: tabular-nums; }
.flap span::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #000; opacity: .7; }
.flap span.dot, .flap span.sp { background: none; width: 7px; }
.flap span.dot::after, .flap span.sp::after { display: none; }
.flap span.sp { width: 6px; }
.flap.lg span { width: 20px; height: 34px; font-size: 24px; }
.flap.lg span.dot { width: 9px; } .flap.lg span.sp { width: 9px; }
.flap.xl span { width: 26px; height: 44px; font-size: 32px; }
.flap.xl span.dot { width: 11px; } .flap.xl span.sp { width: 11px; }
.flap.sm span { width: 11px; height: 19px; font-size: 13px; }
.flap.sm span.dot { width: 6px; } .flap.sm span.sp { width: 5px; }
.flap.lime span { color: var(--lime); }
.flap.pink span { color: var(--magenta); }
.flap span.flip { animation: flip .38s cubic-bezier(.3, .1, .3, 1) backwards; }
@keyframes flip { 0% { transform: rotateX(-95deg); filter: brightness(.4) } 100% { transform: rotateX(0); filter: none } }

/* ---------- игра: каркас ---------- */
.game { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; min-height: 0; }
.game > * { min-width: 0; min-height: 0; }

.top { padding: 8px var(--gut) 6px; background: linear-gradient(#0a0f14, var(--bg)); border-bottom: 1px solid var(--line); }
.t1 { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.stackbox small, .evname small { display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.stackbox .flap span { width: 15px; height: 26px; font-size: 18px; }
.stackbox .flap span.sp { width: 6px; }
.evname { min-width: 0; text-align: center; }
.evname b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-family: var(--disp); font-weight: 800; font-size: 19px; line-height: 1.02; letter-spacing: .04em; text-transform: uppercase; overflow-wrap: anywhere; }
.clock { min-width: 58px; height: 44px; padding: 0 8px; display: grid; place-items: center; background: #05070a; border: 1px solid var(--line-2); font-family: var(--disp); font-weight: 900; font-size: 30px; line-height: 1; color: var(--lime); text-shadow: 0 0 12px rgba(182, 255, 46, .4); font-variant-numeric: tabular-nums; }
.clock.txt { font-size: 12px; letter-spacing: .08em; font-family: var(--mono); font-weight: 800; text-transform: uppercase; min-width: 72px; text-align: center; text-shadow: none; color: var(--dim); }
.clock.hot { color: var(--magenta); border-color: var(--magenta); text-shadow: 0 0 12px rgba(255, 46, 136, .6); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { box-shadow: 0 0 14px rgba(255, 46, 136, .7) } }
.tbar { height: 3px; margin: 6px 0 5px; background: var(--line); overflow: hidden; }
.tbar i { display: block; height: 100%; width: 100%; background: var(--lime); box-shadow: 0 0 8px var(--lime); transform-origin: left; }
.tbar.hot i { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }
.t2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--dim); min-height: 22px; }
.t2 b { color: var(--text); font-size: 13px; }
.t2 .need b { color: var(--amber); }
.who-s { display: flex; align-items: center; gap: 3px; min-width: 0; }
.who-s .dotp { position: relative; flex: none; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; font: 900 11px var(--disp); color: #07090c; opacity: .4; }
.who-s .dotp.ok { opacity: 1; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--lime); }
.who-s .dotp.ok::after { content: "✓"; position: absolute; right: -5px; bottom: -6px; font: 900 10px var(--mono); color: var(--lime); text-shadow: 0 0 3px #000, 0 0 3px #000; }
.who-s .dotp.out { opacity: .15; }
.who-s .cnt2 { margin-left: 5px; font-weight: 800; color: var(--text); white-space: nowrap; }

.tabs { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 8px var(--gut) 6px; scrollbar-width: none; background: var(--bg); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--glass); color: var(--dim);
  font-family: var(--disp); font-weight: 800; font-size: 17px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); background: var(--lime); border-color: var(--lime); }
.tab i { font-style: normal; min-width: 18px; height: 18px; padding: 0 4px; display: inline-grid; place-items: center; border-radius: 9px; background: var(--magenta); color: #fff; font: 800 11px var(--mono); }

.mid { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 8px var(--gut) 10px; -webkit-overflow-scrolling: touch; }
.mid.frozen .mk { pointer-events: none; }
.mid.frozen .mk:not(.on) { opacity: .45; }
.mkgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mk { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 66px; padding: 8px 10px 8px; text-align: left; background: var(--glass); border: 1px solid var(--line); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: border-color .15s, background .15s, transform .08s; }
.mk:active { transform: scale(.97); background: var(--glass-3); }
.mk .lb { font-family: var(--disp); font-weight: 800; font-size: 17px; line-height: 1.08; letter-spacing: .03em; text-transform: uppercase; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; padding-right: 36px; }
.mk .od { display: flex; align-items: center; gap: 6px; }
.mk .od em { font-style: normal; font-size: 11px; color: var(--dim); margin-left: auto; }
.mk .od .x { font-size: 12px; color: var(--dim); font-weight: 800; }
.mk .stk { position: absolute; top: 6px; right: 6px; min-width: 30px; height: 24px; padding: 0 6px; display: grid; place-items: center; border-radius: 12px; background: var(--lime); color: var(--ink); font: 900 13px var(--mono); box-shadow: 0 0 10px rgba(182, 255, 46, .5); }
.mk .stk.pop { animation: chipop .3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes chipop { 0% { transform: scale(.4) } 100% { transform: scale(1) } }
.mk.on { border-color: var(--lime); background: linear-gradient(135deg, rgba(182, 255, 46, .14), var(--glass) 70%); box-shadow: 0 0 0 1px var(--lime) inset; }
.mk.on .flap span { color: var(--lime); }
.mk.long .lb { font-size: 15px; }
.mkgrid.one { grid-template-columns: 1fr; }
.empty { padding: 24px 8px; text-align: center; color: var(--dim); }

/* ракета: своя цель */
.rk { margin-bottom: 10px; padding: 10px 12px 12px; background: var(--glass); border: 1px solid var(--line-2); }
.rk .cap { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.rk .bigrow { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 2px; }
.rk .bigx { font-family: var(--disp); font-weight: 900; font-size: 52px; line-height: 1; color: var(--lime); text-shadow: 0 0 16px rgba(182, 255, 46, .4); font-variant-numeric: tabular-nums; }
.rk .bigx small { font-size: 28px; }
.rk .pp { text-align: right; }
.rk .pp b { display: block; font-family: var(--disp); font-weight: 900; font-size: 34px; line-height: 1; color: var(--amber); font-variant-numeric: tabular-nums; }
.rk .pp small { display: block; font-size: 10px; color: var(--dim); letter-spacing: .06em; }
.rk .sl { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 6px; align-items: center; margin-top: 8px; }
.rk .sl button { min-height: 44px; background: var(--glass-3); border: 1px solid var(--line-2); font-weight: 800; font-size: 20px; color: var(--text); }
.rk .sl button:active { background: var(--lime); color: var(--ink); }
.rk input[type=range] { width: 100%; height: 44px; accent-color: var(--lime); background: none; touch-action: pan-y; }
.rk .foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 6px; }
.rk .win { font-size: 12px; color: var(--text); line-height: 1.4; }
.rk .win .note { color: var(--dim); font-size: 11px; }
.rk .win b { color: var(--text); }
.rk .add { width: auto; min-width: 118px; min-height: 44px; padding: 8px 14px; }
.rk .tix { display: flex; justify-content: space-between; font-size: 10px; color: var(--dim); margin-top: -4px; }
@media (max-height: 740px) { .rk .tix, .rk .win .note { display: none; } .rk { padding: 8px 10px 10px; } .rk .bigx { font-size: 40px; } .rk .pp b { font-size: 28px; } .rk .sl { margin-top: 4px; } }

/* ---------- купон ---------- */
.slip { position: relative; overflow: hidden; background: var(--glass); border-top: 2px dashed var(--line-2); padding: 8px var(--gut) 8px; }
.slip::before, .slip::after { content: ""; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); }
.slip::before { left: -8px; } .slip::after { right: -8px; }
.sh { display: flex; align-items: baseline; gap: 8px; min-height: 24px; }
.sh .ti { font-family: var(--disp); font-weight: 900; font-size: 19px; letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.sh .sm { margin-left: auto; text-align: right; font-size: 12px; color: var(--dim); white-space: nowrap; }
.sh .sm b { font-size: 16px; color: var(--text); }
.sh .pen { color: var(--magenta); font-weight: 800; }
.sh .okm { color: var(--lime); font-weight: 800; }
.sl { max-height: 160px; overflow-y: auto; overscroll-behavior: contain; margin: 2px 0 4px; }
.ln { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 40px; gap: 8px; align-items: center; min-height: 40px; border-top: 1px solid var(--line); font-size: 13px; }
.ln:first-child { border-top: 0; }
.ln.ro { grid-template-columns: minmax(0, 1fr) auto auto; padding-right: 2px; }
.ln .lb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ln .lb i { font-style: normal; color: var(--amber); font-weight: 800; margin-left: 6px; font-size: 12px; }
.ln .st { font-weight: 800; }
.ln .wn { color: var(--lime); font-weight: 800; min-width: 52px; text-align: right; }
.ln .rm { width: 40px; height: 40px; color: var(--dim); font-size: 18px; }
.ln .rm:active { color: var(--magenta); }
.ln.hint { display: block; color: var(--dim); padding: 9px 0; text-align: center; font-size: 12px; }
.chips { display: flex; gap: 6px; align-items: center; margin: 4px 0 6px; overflow-x: auto; scrollbar-width: none; padding: 6px 6px 4px; margin-left: -6px; margin-right: -6px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font: 900 13px var(--mono); color: var(--ink); position: relative; border: 2px dashed rgba(0, 0, 0, .4); box-shadow: 0 2px 0 rgba(0, 0, 0, .5), inset 0 0 0 3px var(--c); background: var(--c); }
.chip::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .35); }
.chip[aria-pressed="true"] { transform: translateY(-3px); outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 14px var(--c); }
.chips .free { margin-left: auto; font-size: 11px; color: var(--dim); text-align: right; white-space: nowrap; padding-left: 6px; }
.chips .free b { color: var(--text); font-size: 13px; }
.acts { display: grid; grid-template-columns: 1fr 1fr 1fr 1.7fr; gap: 6px; }
.acts button { min-height: 44px; padding: 0 4px; background: var(--glass-3); border-bottom: 3px solid #000; color: var(--text); font-weight: 800; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.acts button:active { transform: translateY(2px); border-bottom-width: 1px; }
.acts button:disabled { opacity: .4; }
.acts .go { background: var(--lime); color: var(--ink); border-bottom-color: #6c9e10; font-size: 14px; letter-spacing: .1em; }
.acts .go.warn { background: var(--magenta); color: #fff; border-bottom-color: #8f1650; }
.stamp { display: grid; place-items: center; min-height: 52px; border: 2px solid var(--lime); color: var(--lime); font-family: var(--disp); font-weight: 900; font-size: 26px; letter-spacing: .18em; text-transform: uppercase; transform: rotate(-1.5deg); text-shadow: 0 0 12px rgba(182, 255, 46, .5); animation: stampin .35s cubic-bezier(.3, 1.5, .5, 1); }
.stamp small { display: block; font: 700 11px var(--mono); letter-spacing: .04em; color: var(--dim); text-shadow: none; text-transform: none; }
@keyframes stampin { 0% { transform: rotate(-1.5deg) scale(2.2); opacity: 0 } 100% { transform: rotate(-1.5deg) scale(1); opacity: 1 } }

/* ---------- чат и реакции ---------- */
.bar { position: relative; background: #05070a; border-top: 1px solid var(--line); padding: 6px var(--gut) calc(6px + var(--safe-b)); }
.chat { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 6px; margin-bottom: 6px; }
.chat input { min-height: 42px; padding: 8px 12px; background: var(--glass); border: 1px solid var(--line-2); border-radius: 0; font-size: 16px; outline: none; }
.chat input:focus { border-color: var(--lime); }
.chat button { min-height: 42px; background: var(--glass-3); color: var(--lime); font-size: 20px; font-weight: 900; border-bottom: 3px solid #000; }
.rx { display: grid; grid-template-columns: repeat(6, 1fr) auto; gap: 4px; }
.rx button { min-height: 42px; font-size: 22px; background: var(--glass); border: 1px solid var(--line); }
.rx button:active { background: var(--glass-3); transform: scale(.94); }
.rx .cht { display: none; min-width: 48px; }
.fl { position: absolute; bottom: 40px; font-size: 28px; pointer-events: none; animation: floatup 1.2s ease-out forwards; z-index: 10; }
@keyframes floatup { 0% { transform: translateY(0) scale(.6); opacity: 0 } 15% { opacity: 1 } 100% { transform: translateY(-150px) scale(1.2); opacity: 0 } }
.kb .slip { display: none; }

/* ---------- сцена («смотрите на экран») ---------- */
.look { text-align: center; padding: 6px 0 12px; }
.look .ev { font-size: 44px; line-height: 1; margin-bottom: 4px; }
.look .big { font-family: var(--disp); font-weight: 900; font-size: 34px; line-height: 1; letter-spacing: .1em; text-transform: uppercase; color: #fff; text-shadow: 0 0 4px #fff, 0 0 14px var(--magenta), 0 0 32px var(--magenta); animation: hum 4s infinite; }
.look .sub { margin-top: 6px; color: var(--dim); font-size: 12px; }
.track { display: flex; justify-content: space-between; margin: 12px 4px 4px; }
.track i { width: 14px; height: 14px; border-radius: 50%; background: #2a1a22; animation: chase 1.4s infinite; }
.track i:nth-child(1) { animation-delay: 0s } .track i:nth-child(2) { animation-delay: .12s } .track i:nth-child(3) { animation-delay: .24s } .track i:nth-child(4) { animation-delay: .36s }
.track i:nth-child(5) { animation-delay: .48s } .track i:nth-child(6) { animation-delay: .6s } .track i:nth-child(7) { animation-delay: .72s } .track i:nth-child(8) { animation-delay: .84s } .track i:nth-child(9) { animation-delay: .96s }
@keyframes chase { 0%, 60%, 100% { background: #2a1a22; box-shadow: none } 20% { background: var(--magenta); box-shadow: 0 0 12px var(--magenta), 0 0 24px var(--magenta) } }
.hdr { margin: 12px 0 6px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.cps { display: grid; gap: 6px; }
.cp { padding: 8px 10px; background: var(--glass); border: 1px solid var(--line); }
.cp.me { border-color: var(--lime); }
.cp .h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cp .h b { font-family: var(--disp); font-weight: 800; font-size: 17px; letter-spacing: .04em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cp .h span { margin-left: auto; font-weight: 800; font-size: 13px; white-space: nowrap; }
.cp .h .pen { color: var(--magenta); margin-left: 6px; }
.cp .bs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pill { max-width: 100%; padding: 3px 7px; background: var(--glass-3); border: 1px solid var(--line-2); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill b { color: var(--amber); margin-left: 4px; }
.cp .none { color: var(--dim); font-size: 12px; margin-top: 4px; }

/* ---------- развязка ---------- */
.res { text-align: center; padding: 4px 0 8px; }
.res .tag { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.res .net { font-family: var(--disp); font-weight: 900; font-size: 60px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.res.win .net { color: var(--lime); text-shadow: 0 0 24px rgba(182, 255, 46, .5); animation: stampin .5s cubic-bezier(.3, 1.5, .5, 1); }
.res.lose .net { color: var(--magenta); text-shadow: 0 0 24px rgba(255, 46, 136, .5); }
.res.even .net { color: var(--amber); }
.res .out { margin-top: 2px; font-size: 14px; font-weight: 800; color: #fff; }
.est { display: inline-block; margin-top: 6px; padding: 3px 8px; border: 1px dashed var(--amber); color: var(--amber); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.voidmsg { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--amber); color: var(--amber); font-size: 12px; }
.rl { display: grid; gap: 0; margin-top: 6px; background: var(--glass); border: 1px solid var(--line); }
.rline { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line); font-size: 13px; }
.rline:first-child { border-top: 0; }
.rline .ic { font-weight: 900; text-align: center; }
.rline .lb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.rline .lb small { display: block; font-size: 11px; color: var(--dim); font-weight: 500; }
.rline .am { font-weight: 800; text-align: right; white-space: nowrap; }
.rline.win .ic, .rline.win .am { color: var(--lime); }
.rline.lose .ic, .rline.lose .am { color: var(--magenta); }
.rline.void .ic, .rline.void .am { color: var(--amber); }
.rline.pen .ic, .rline.pen .am { color: var(--magenta); }
.board { display: grid; gap: 4px; }
.row { display: grid; grid-template-columns: 22px 26px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 10px; background: var(--glass); border: 1px solid var(--line); }
.row.me { border-color: var(--lime); }
.row.out { opacity: .5; }
.row .pl { font: 900 15px var(--disp); color: var(--dim); text-align: center; }
.row .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--disp); font-weight: 800; font-size: 17px; letter-spacing: .04em; text-transform: uppercase; }
.row .s { font-weight: 800; }
.row .d { font-size: 12px; font-weight: 800; min-width: 46px; text-align: right; }
.row .d.up { color: var(--lime); } .row .d.dn { color: var(--magenta); }

/* ---------- вылет, финал ---------- */
.gone { text-align: center; padding: 10px 6px 4px; }
.gone .big { font-family: var(--disp); font-weight: 900; font-size: 42px; letter-spacing: .1em; text-transform: uppercase; color: var(--magenta); text-shadow: 0 0 20px rgba(255, 46, 136, .5); line-height: 1; }
.gone p { margin-top: 6px; color: #c5d0d5; font-size: 13px; }
.status { margin: 10px 0 4px; padding: 8px 10px; background: var(--glass); border: 1px solid var(--line); font-size: 12px; color: var(--dim); text-align: center; }
.status b { color: var(--text); }
.final { text-align: center; }
.final .medal { width: 96px; height: 96px; margin: 8px auto 6px; border-radius: 50%; display: grid; place-items: center; font: 900 46px var(--disp); color: var(--ink); background: radial-gradient(circle at 35% 30%, #fff6c8, var(--amber) 55%, #b88a10); box-shadow: 0 0 40px rgba(255, 211, 77, .5); }
.final .medal.m2 { background: radial-gradient(circle at 35% 30%, #fff, #c9d3d8 55%, #7d8c93); box-shadow: 0 0 30px rgba(200, 215, 220, .35); }
.final .medal.m3 { background: radial-gradient(circle at 35% 30%, #ffd9b0, #d58b4a 55%, #8a4a1a); box-shadow: 0 0 30px rgba(213, 139, 74, .35); }
.final .medal.m0 { background: var(--glass-3); color: var(--dim); box-shadow: none; border: 1px solid var(--line-2); }
.final h2 { font-family: var(--disp); font-weight: 900; font-size: 36px; letter-spacing: .08em; text-transform: uppercase; color: #fff; text-shadow: 0 0 4px #fff, 0 0 14px var(--magenta), 0 0 30px var(--magenta); line-height: 1.05; }
.final .wn { margin-top: 8px; color: #c5d0d5; }
.final .wn b { color: var(--lime); }
.final .board { margin-top: 12px; text-align: left; }
.final .fine { margin-top: 12px; }
.rain { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.rain i { position: absolute; top: -20px; width: 12px; height: 12px; border-radius: 50%; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg) } }

/* ---------- ступени по высоте ---------- */
@media (max-height: 740px) {
  .chat { display: none; }
  .bar.chatopen .chat { display: grid; }
  .rx .cht { display: block; }
  .spec .chat { display: grid; }
  .spec .rx .cht { display: none; }
  .sl { max-height: 120px; }
}
@media (max-height: 700px) {
  .sign { font-size: 32px; }
  .sh { min-height: 20px; } .sh .ti { font-size: 16px; } .sh .sm b { font-size: 15px; }
  .slip .wrow { min-height: 14px !important; }
  .ln.hint { padding: 5px 0; }
  .acts button { min-height: 42px; }
  .evname b { font-size: 17px; }
  .top { padding-top: 6px; }
  .tbar { margin: 4px 0; }
  .tab { min-height: 40px; font-size: 16px; }
  .tabs { padding-top: 6px; padding-bottom: 4px; }
  .mk { min-height: 58px; padding-top: 6px; padding-bottom: 6px; }
  .mk .lb { font-size: 16px; }
  .sl { max-height: 80px; }
  .chips { margin-top: 0; margin-bottom: 2px; }
  .chip { width: 42px; height: 42px; font-size: 12px; }
  .res .net { font-size: 50px; }
  .look .big { font-size: 28px; }
  .look .ev { font-size: 34px; }
}
@media (max-height: 600px) {
  .slip { padding-top: 6px; padding-bottom: 6px; }
  .sl { max-height: 80px; }
}
@media (max-width: 359px) {
  :root { --gut: 10px; }
  .stackbox .flap span { width: 13px; }
  .tab { padding: 0 11px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .game { grid-template-rows: auto minmax(0, 1fr) auto auto; }
  .sl { max-height: 40px; }
  .look { padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sign, .look .big, .track i, .clock.hot, .livepill i { animation: none; }
  .flap span.flip, .stamp, .mk .stk.pop, .who.new { animation: none; }
}

/* колонка рынков: вкладки сверху, список под ними */
.midcol { display: flex; flex-direction: column; min-height: 0; }
.midcol > .mid { flex: 1; min-height: 0; }

/* правила события: карточка сверху рынков */
.rules { margin: 8px var(--gut) 0; border: 1px solid var(--line); background: var(--glass); }
.rules .rh { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: none; border: 0; color: var(--lime); font-family: var(--disp); font-weight: 800; font-size: 16px; letter-spacing: .1em; text-transform: uppercase; min-height: 40px; }
.rules .rh i { font-style: normal; width: 24px; height: 24px; border: 1px solid var(--lime); border-radius: 50%; display: grid; place-items: center; font-size: 15px; line-height: 1; }
.rules p { margin: 0; padding: 0 12px 6px; font-size: 14px; line-height: 1.45; color: var(--text); }
.rules small { display: block; padding: 0 12px 10px; font-size: 12px; color: var(--dim); }

/* знакомство перед ставками: таймер янтарный, внизу подсказка вместо купона */
.clock.intro { color: var(--amber); }
.introbar { padding: 14px var(--gut); text-align: center; font-size: 14px; line-height: 1.4; color: var(--amber); border-top: 1px dashed #4a3f1a; background: rgba(255, 211, 77, .06); }
#mid.introm .mk { opacity: .8; }

/* событие заменено сценическим (ev.fallback): причина из ev.fallbackWhy */
.fbnote { margin: 0 0 8px; padding: 6px 10px; border: 1px dashed var(--line-2, #2c3b46); color: var(--dim); font-size: 12px; line-height: 1.3; }
.sg { text-transform: none; }
