/* Игровые экраны: нижняя панель, профиль, «Мир», бои. */

/* Прокручиваемые экраны: только вертикально, без «резинки», которая утаскивает весь экран */
#screen-collection, #screen-world, #screen-battle, #screen-rules, #screen-net {
  overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y;
}
.coll-grid > * { min-width: 0; }
/* Карточки вне экрана WebKit не рисует вовсе (iPhone: память и плавность прокрутки) */
.coll-grid > .card, .coll-grid > .world-item { content-visibility: auto; contain-intrinsic-size: auto 160px; }
.coll { overflow-x: clip; } /* сияние и наклон карточек не раздвигают экран вбок */

/* ---- Нижняя панель ---- */
/* Высота считается сверх системной полоски снизу (safe area), а не внутри неё */
.app { --tab-h: 64px; --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px)); }
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + var(--safe-b)); display: flex; z-index: 40; background: rgba(14, 11, 24, 0.97); border-top: 1px solid var(--line); padding: 0 4px var(--safe-b); }
.tabbar[hidden], .app.wide .tabbar { display: none; }
.tabbar button { flex: 1; min-width: 0; height: var(--tab-h); background: none; border: 0; color: var(--text-mute); font: 500 11px var(--font-body); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 6px 0 4px; position: relative; cursor: pointer; white-space: nowrap; }
.tabbar button i { font-style: normal; font-size: 22px; line-height: 1; }
.tabbar button.active { color: var(--acid); }
.tabbar button b { position: absolute; top: 4px; left: calc(50% + 10px); font: 400 7px var(--font-pixel); color: var(--acid-ink); background: var(--acid); border-radius: 99px; padding: 3px 4px; }
.tabbar button b:empty { display: none; }
.app.has-tabbar:not(.wide) .screen { bottom: calc(var(--tab-h) + var(--safe-b)); }
.btn.pink { background: var(--pink); color: #fff; box-shadow: 0 4px 0 #a01e57; }
.btn[hidden] { display: none; }

/* ---- Профиль ---- */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(8, 6, 14, 0.7); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-body { width: min(440px, 100%); box-sizing: border-box; background: var(--bg-2); border-radius: 18px 18px 0 0; padding: 10px 18px 24px; display: grid; gap: 14px; animation: sheet-up 0.25s ease-out;
  max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; } /* выше экрана — прокрутка, а не уезжающий верх */
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto; }
.sheet-body h2 { margin: 0; font: 700 18px var(--font-display); }
.prof-name { font: 600 16px var(--font-body); color: var(--acid); }
.prof-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.prof-stats div { background: var(--surface); border-radius: 10px; padding: 10px 4px; text-align: center; display: grid; gap: 4px; }
.prof-stats b { font: 400 13px var(--font-pixel); }
.prof-stats span, .prof-line { font-size: 12px; color: var(--text-dim); }
.prof-toggle { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border-radius: 12px; padding: 12px; cursor: pointer; }
.prof-toggle input { width: 20px; height: 20px; accent-color: var(--acid); flex: none; margin-top: 2px; }
.prof-toggle span { display: grid; gap: 4px; }
.prof-toggle small { color: var(--text-dim); font-size: 12px; line-height: 1.45; }
.prof-toggle i { color: var(--acid); font-style: normal; }

/* ---- Мир ---- */
#screen-world, #screen-battle, #screen-net { overflow-y: auto; } /* #screen-net — «Сеть» (features/0021) */
.world-total { font: 400 8px var(--font-pixel); color: var(--text-mute); margin-left: auto; }
/* Фильтр редкости — 3 в ряд, крупные кнопки (0103: были узкие и сплюснутые) */
.world-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding-bottom: 8px; }
.world-chips button { min-height: 34px; background: var(--surface); color: var(--c, var(--text)); border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; font: 400 9px var(--font-pixel); cursor: pointer; }
.world-chips button.on { border-color: var(--c, var(--acid)); background: var(--surface-2); }
.world-selects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.world-selects select { min-width: 0; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 4px; font-size: 11px; }
.world-item { position: relative; min-width: 0; }
.world-item .card { --card-w: 100%; cursor: pointer; }
.mine-tag { display: block; width: fit-content; margin: 5px auto 0; font: 400 7px var(--font-pixel); background: var(--acid); color: var(--acid-ink); border-radius: 99px; padding: 4px 8px; }
.world-more { text-align: center; color: var(--text-mute); font-size: 12px; padding: 18px; min-height: 20px; }

/* ---- Бои: выбор ---- */
.btl-hint { color: var(--text-dim); font-size: 12px; line-height: 1.45; margin: 0 0 12px; }
.btl-challenge { background: var(--surface); border: 1px solid var(--pink); border-radius: 10px; padding: 8px 10px; font-size: 13px; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btl-fighter { min-width: 0; cursor: pointer; border-radius: 10px; padding: 3px; border: 2px solid transparent; position: relative; isolation: isolate; }
.btl-fighter.sel { border-color: var(--acid); box-shadow: 0 0 16px rgba(200, 255, 46, 0.3); }
.btl-fighter .card { --card-w: 100%; pointer-events: none; }
.btl-meta { display: grid; grid-template-columns: 1fr auto; gap: 3px 6px; font-size: 10px; color: var(--text-dim); margin-top: 4px; }
.btl-meta i { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--acid) var(--w), var(--surface-2) var(--w)); }
.btl-adv { position: absolute; top: 6px; left: 6px; z-index: 3; font: normal 400 8px var(--font-pixel); color: var(--acid); text-shadow: 0 1px 2px #000; }
.btl-go { position: sticky; bottom: 0; z-index: 10; padding: 12px 0 4px; background: linear-gradient(transparent, var(--bg) 40%); }
.btl-go .btn { width: 100%; }
.btl-go .btn:disabled { filter: grayscale(1) brightness(0.6); }

/* ---- Бои: VS ---- */
.btl-vs { min-height: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; }
.vs-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; width: 100%; }
.vs-card { margin: 0; display: grid; gap: 6px; justify-items: center; min-width: 0; }
.vs-card .card { --card-w: 100%; cursor: pointer; }
.vs-card figcaption { font-size: 11px; color: var(--text-dim); text-align: center; line-height: 1.3; }
.vs-me { animation: vs-in-l 0.5s ease-out; }
.vs-en { animation: vs-in-r 0.5s ease-out; }
@keyframes vs-in-l { from { transform: translateX(-120%) rotate(-10deg); } }
@keyframes vs-in-r { from { transform: translateX(120%) rotate(10deg); } }
.vs-x { font: 900 26px var(--font-display); color: var(--pink); text-shadow: 0 0 18px rgba(255, 61, 139, 0.6); animation: pop 0.4s 0.4s backwards; }
.vs-tip { margin: 0; font-size: 11px; color: var(--text-mute); }
.btl-vs .btn { width: 100%; max-width: 320px; }

/* Кто кого бьёт: на VS, на арене и под карточками выбора */
.matchup { width: 100%; box-sizing: border-box; text-align: center; border-radius: 12px; padding: 10px 12px; font: 600 14px var(--font-body); border: 1px solid var(--line); background: var(--surface); }
.matchup.small { border-radius: 0; border-left: 0; border-right: 0; padding: 5px 10px; font-size: 11px; }
.matchup.up { color: #b8ff7a; background: rgba(61, 220, 132, 0.14); border-color: rgba(61, 220, 132, 0.5); }
.matchup.down { color: #ff9d9d; background: rgba(255, 61, 61, 0.12); border-color: rgba(255, 61, 61, 0.45); }
.matchup.eq { color: var(--text-dim); }
.adv { margin-top: 4px; text-align: center; border-radius: 8px; padding: 4px 2px; font: 600 11px var(--font-body); }
.adv.up { background: #1f6b3a; color: #d9ffe6; }
.adv.down { background: #7a2323; color: #ffe0e0; }
.adv.eq { background: var(--surface-2); color: var(--text-dim); }
.btl-adv { display: none; }

/* Сколько боёв осталось */
.btl-left { background: var(--surface); border: 1px solid rgba(200, 255, 46, 0.35); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; }
.btl-stock { display: grid; gap: 2px; min-width: 0; }
/* Таймер до следующего боя (0104) — справа в плашке */
.btl-next { display: grid; justify-items: end; gap: 3px; text-align: right; }
.btl-next small { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.btl-next .btl-clock, .btl-next b { font: 400 17px var(--font-pixel); color: var(--acid); }
.btl-next.full b { font-size: 11px; color: var(--text-dim); }
.btl-duels .btl-clock { font-variant-numeric: tabular-nums; color: var(--text); }
.btl-nowrap { white-space: nowrap; }
.btl-left b { font: 700 14px var(--font-display); color: var(--acid); }
.btl-left.none b { color: var(--text-dim); }
.btl-left small { font-size: 11px; color: var(--text-mute); }
.btl-left small.btl-duels { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.btl-left small.btl-duels b { font: inherit; color: var(--text); }
.tgl:disabled { opacity: 0.6; }

/* ---- Бои: арена ---- */
.arena { height: 100%; display: flex; flex-direction: column; position: relative; }
.hud { padding: 8px 12px; display: grid; gap: 4px; opacity: 0.8; transition: opacity 0.2s; }
.hud.active { opacity: 1; }
.hud-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; min-width: 0; }
.hud-top b { font: 700 13px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-meta { font: 400 7px var(--font-pixel); white-space: nowrap; }
.hp { position: relative; height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #3ddc84, #c8ff2e); transition: width 0.35s; }
.hp i.low { background: linear-gradient(90deg, #ff3d3d, #ff8a2a); }
.hp-num { position: absolute; right: 6px; top: 2px; font: 400 7px var(--font-pixel); color: #fff; text-shadow: 0 1px 1px #000; }
.hud-bot { display: flex; justify-content: space-between; align-items: center; min-height: 16px; }
.en { display: flex; gap: 3px; }
.en i { width: 12px; height: 6px; border-radius: 2px; background: var(--surface-2); }
.en i.on { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.sts { display: flex; gap: 3px; font-size: 13px; }
.stage-arena { position: relative; flex: 1; min-height: 0; background: #1b1729 center / cover no-repeat; overflow: hidden; }
.ftr { position: absolute; bottom: 5%; width: 46%; height: 70%; }
.ftr-me { left: 2%; }
.ftr-en { right: 2%; bottom: 16%; height: 58%; }
.ftr-body { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; z-index: 1; }
.ftr-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ftr-me .ftr-body img { transform: scaleX(-1); }
.ftr-shadow { position: absolute; bottom: -3%; left: 18%; right: 18%; height: 9%; border-radius: 50%; background: rgba(0, 0, 0, 0.4); }
.ftr.st-shield .ftr-body::after { content: ''; position: absolute; inset: 4% 6%; border-radius: 50%; border: 2px solid rgba(61, 242, 255, 0.7); box-shadow: 0 0 18px rgba(61, 242, 255, 0.4) inset; }
.ftr.st-halluc .ftr-body { animation: halluc 1.2s linear infinite; }
@keyframes halluc { to { filter: hue-rotate(360deg); } }
.ftr.st-curse .ftr-body img { filter: drop-shadow(0 0 8px #8e4bd8); }
.ftr.fallen .ftr-body { transition: transform 0.6s, filter 0.6s, opacity 0.6s; transform: rotate(80deg) translateY(20%); filter: grayscale(1); opacity: 0.6; }
.ftr.winner .ftr-body { animation: win-bounce 0.5s ease-in-out 3; }
@keyframes win-bounce { 50% { transform: translateY(-12%); } }
.float { position: absolute; left: 50%; top: 30%; z-index: 5; transform: translateX(-50%); font: 400 16px var(--font-pixel); color: #fff; text-shadow: 0 2px 0 #000, 0 0 8px #000; white-space: nowrap; pointer-events: none; animation: float-up 1.2s ease-out forwards; }
.float.crit { color: #ffd23a; font-size: 22px; }
.float.heal { color: #3ddc84; }
.float.curse { color: #b44dff; }
.float.small { font-size: 11px; }
.float.tag { top: 12%; font-size: 9px; }
.float.tag.super { color: var(--acid); }
.float.tag.weak, .float.tag.miss { color: var(--text-dim); }
.float.tag.status { color: var(--cyan); }
@keyframes float-up { to { transform: translate(-50%, -60px); opacity: 0; } }
.move-banner { position: absolute; top: 8px; left: 50%; transform: translate(-50%, -160%); z-index: 6; background: rgba(14, 11, 24, 0.9); border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font: 700 12px var(--font-display); white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; transition: transform 0.2s; }
.move-banner.show { transform: translate(-50%, 0); }
.move-banner.me { border-color: var(--acid); }
.move-banner.en { border-color: var(--pink); }
.move-banner.signature { background: linear-gradient(90deg, #5a1d8f, #ff3d8b); }
.chaos { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; font: 900 30px var(--font-display); color: #fff; text-shadow: 3px 0 var(--pink), -3px 0 var(--cyan); opacity: 0; pointer-events: none; }
.chaos.show { animation: chaos-in 0.95s ease-out; }
@keyframes chaos-in { 0% { opacity: 0; transform: scale(2); } 20% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.stage-arena.fx-lag { filter: contrast(1.4) saturate(0.4); }
.stage-arena.fx-glitch { filter: hue-rotate(140deg) saturate(2); }
.stage-arena.fx-e404 { filter: invert(1); }
.btl-log { padding: 4px 12px; font-size: 12px; color: var(--text-dim); min-height: 34px; line-height: 1.4; }
.btl-log .c-me { color: var(--acid); }
.btl-log .c-en { color: var(--pink); }
.btl-actions { padding: 0 10px 8px; display: grid; gap: 6px; }
.btl-timer { height: 3px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.btl-timer i { display: block; height: 100%; width: 0; background: var(--acid); }
.btl-moves { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mv { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 8px 6px; text-align: left; display: grid; align-content: start; gap: 3px; cursor: pointer; min-height: 54px; }
.mv b { font: 700 11px var(--font-display); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mv small { font-size: 9px; color: var(--text-mute); }
.mv-attack { border-color: rgba(200, 255, 46, 0.4); }
.mv-signature { border-color: rgba(255, 61, 139, 0.5); }
.mv:disabled { opacity: 0.4; cursor: default; }
.btl-toggles { display: flex; gap: 6px; justify-content: flex-end; }
.tgl { background: var(--surface); border: 1px solid var(--line); color: var(--text-mute); border-radius: 99px; padding: 4px 12px; font: 400 8px var(--font-pixel); cursor: pointer; }
.tgl.on { color: var(--acid-ink); background: var(--acid); }
.btl-toggles { align-items: center; }
.tgl.skip { margin-right: auto; order: -1; color: var(--text); border-color: var(--acid); padding: 7px 14px; font-size: 9px; }

/* ---- Бои: итог ---- */
.btl-result { position: absolute; inset: 0; z-index: 20; background: rgba(8, 6, 14, 0.9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; opacity: 0; transition: opacity 0.3s; overflow-y: auto; }
.btl-result.show { opacity: 1; }
.btl-result h2 { margin: 0; font: 900 32px var(--font-display); }
.btl-result.won h2 { color: var(--acid); }
.btl-result.lost h2 { color: var(--pink); }
.btl-result p, .btl-result small { margin: 0; color: var(--text-dim); font-size: 13px; text-align: center; }
.btl-result .xp { width: 70%; height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.btl-result .xp i { display: block; height: 100%; width: var(--w); background: var(--acid); transition: width 0.9s ease-out; }
.evo { display: grid; justify-items: center; gap: 6px; }
.evo[hidden] { display: none; }
.evo b { font: 900 22px var(--font-display); color: #ffd23a; animation: pop 0.4s; }
.evo span { font-size: 13px; }
.evo-card .card { --card-w: min(44vw, 170px); }
.evo-card.evo-flashing { animation: evo-flash 0.6s; } /* не .flash: это имя занято белой вспышкой экрана пачки (opacity 0) */
@keyframes evo-flash { 0% { filter: brightness(4); } 100% { filter: brightness(1); } }

.modal .actions { flex-wrap: wrap; justify-content: center; max-width: 420px; }
.modal .actions .btn { white-space: nowrap; }

.world-found { margin: -4px 0 10px; font-size: 12px; color: var(--text-dim); }
.world-found[hidden] { display: none; }

/* ---- Правила ---- */
#screen-rules { overflow-y: auto; }
.coll.rules { padding: 18px 20px 40px; }
.rules .coll-top { margin-bottom: 18px; }
.rules section { margin-bottom: 30px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.rules section:last-child { border-bottom: 0; }
.rules h2 { font: 700 18px var(--font-display); margin: 0 0 14px; }
.rules h3 { font: 700 14px var(--font-display); margin: 22px 0 10px; color: var(--text-dim); }
.rules p, .rules li { font-size: 14px; line-height: 1.65; color: var(--text); }
.rules p { margin: 0 0 12px; }
.r-note { color: var(--text-mute) !important; font-size: 12px !important; }
.r-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5; margin: 12px 0; }
.r-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.r-table td:first-child { padding-left: 0; }
.r-circle, .r-list { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 10px; }
.r-circle small { color: var(--text-mute); }
.rules .wheel { display: block; width: min(100%, 340px); margin: 6px auto 14px; }
.r-table td.nw { white-space: nowrap; }

/* ---- Дружеская дуэль (features/0015) ---- */
.btl-go { display: grid; gap: 8px; }
.btl-challenge.duel { display: grid; gap: 6px; border-color: var(--pink); background: rgba(255, 61, 139, 0.1); }
.btl-challenge.duel small { color: var(--text-dim); font-size: 12px; line-height: 1.4; }
.btl-challenge.duel .btn { justify-self: start; }
.btl-duel { display: block; width: 100%; text-align: left; margin-bottom: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 13px var(--font-body); cursor: pointer; }
.btl-duel.hot { border-color: var(--pink); background: rgba(255, 61, 139, 0.14); animation: duel-pulse 1.6s ease-in-out infinite; }
.btl-duel b { color: var(--acid); }
@keyframes duel-pulse { 50% { box-shadow: 0 0 0 4px rgba(255, 61, 139, 0.2); } }
.duel-h { margin: 0; font: 700 20px var(--font-display); text-align: center; }
.duel-one .card { --card-w: min(46vw, 180px); }
.lobby-status { width: 100%; display: grid; gap: 4px; text-align: center; font-size: 13px; color: var(--text-dim); }
.lobby-status b { font: 400 22px var(--font-pixel); color: var(--acid); }
.duel-count { font: 400 44px var(--font-pixel); color: var(--acid); min-height: 52px; text-shadow: 0 0 18px rgba(200, 255, 46, 0.4); }
.duel-tag { margin-right: auto; font: 400 8px var(--font-pixel); color: var(--pink); }
.duel-banner { position: absolute; left: 16px; right: 16px; bottom: 8px; z-index: 8; text-align: center; padding: 10px 12px; border-radius: 12px; background: rgba(255, 61, 139, 0.18); border: 1px solid var(--pink); font: 600 13px var(--font-body); color: var(--text); }

/* ---- Жизни, кладбище, рот-коины (features/0016) ---- */
#walletBtn b { font: 400 10px var(--font-pixel); color: #ffd23a; }
.wallet-big { font: 400 34px var(--font-pixel); color: #ffd23a; text-align: center; text-shadow: 0 0 18px rgba(255, 210, 58, 0.35); }
.wallet-big small { font-size: 22px; margin-left: 6px; }
.wallet-earn { display: grid; gap: 4px; background: var(--surface); border-radius: 12px; padding: 12px; font-size: 13px; line-height: 1.5; }
.wallet-earn .dim { color: var(--text-mute); font-size: 12px; }
/* Магазин рот-коинов за звёзды (features/0031) */
.wallet-shop { display: grid; gap: 12px; border-radius: 16px; padding: 14px 12px 12px; font-size: 13px;
  background: radial-gradient(130% 80% at 50% 0%, rgba(255, 210, 58, 0.16), var(--surface) 65%); border: 1px solid rgba(255, 210, 58, 0.22); }
.wallet-shop .dim { color: var(--text-mute); font-size: 11px; text-align: center; }
.shop-head { display: grid; gap: 2px; text-align: center; }
.shop-head b { font: 700 15px var(--font-display); }
.shop-head span { font-size: 11px; color: var(--text-dim); }
.shop-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; padding-top: 4px; }
.shop-item { position: relative; display: grid; gap: 4px; justify-items: center; padding: 14px 4px 8px; border-radius: 14px; cursor: pointer; color: var(--text);
  border: 1px solid rgba(255, 210, 58, 0.3);
  background: radial-gradient(120% 90% at 50% 0%, rgba(255, 226, 122, 0.2), rgba(20, 16, 32, 0.95) 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 14px rgba(0, 0, 0, 0.35); transition: transform 0.1s; }
.shop-item:active { transform: scale(0.95); }
.shop-item.tagged { border-color: rgba(255, 210, 58, 0.7); box-shadow: 0 0 18px rgba(255, 210, 58, 0.25), 0 6px 14px rgba(0, 0, 0, 0.35); }
.shop-pile { display: flex; align-items: flex-end; height: 24px; font-size: 18px; }
.shop-pile .coin + .coin { margin-left: -0.55em; }
.shop-pile .coin:nth-child(even) { transform: translateY(-4px); }
.shop-coins { font: 400 14px var(--font-pixel); color: #ffd23a; text-shadow: 0 0 12px rgba(255, 210, 58, 0.4); }
.shop-bonus { font-size: 10px; color: var(--acid); min-height: 12px; }
.shop-price { width: calc(100% - 8px); padding: 5px 0; border-radius: 99px; text-align: center; /* тёмная — чтобы ⭐ не сливалась */
  background: linear-gradient(#3b2b6b, #261c47); color: #fff; font-weight: 700; font-size: 12px;
  border: 1px solid rgba(255, 210, 58, 0.55); box-shadow: 0 2px 0 #140f26; }
.shop-badge { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font: normal 700 9px var(--font-body); text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 99px; background: var(--pink); color: #fff; white-space: nowrap; box-shadow: 0 2px 8px rgba(255, 61, 139, 0.45); }
.shop-item:disabled { opacity: 0.5; }
.wallet-log { display: grid; gap: 4px; max-height: 150px; overflow-y: auto; font-size: 12px; color: var(--text-dim); }
.wallet-log div { display: flex; justify-content: space-between; }
.wallet-log b.up { color: #3ddc84; }
.wallet-log b.down { color: #ff9d9d; }
/* Вкладка «Павшие» в коллекции — без рамки (features/0026) */
.fallen-box { margin-bottom: 16px; }
.fallen-hint { margin: 0 0 10px; font-size: 12px; color: var(--text-dim); }
.fallen-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fallen-item { display: grid; gap: 6px; min-width: 0; }
.fallen-item .card { --card-w: 100%; cursor: pointer; }
.fallen-item small { font-size: 11px; color: var(--text-dim); line-height: 1.35; }
.fallen-item .btn { width: 100%; padding: 9px 6px; font-size: 11px; white-space: normal; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 90; text-align: center; padding: 12px; border-radius: 12px; background: rgba(14, 11, 24, 0.95); border: 1px solid var(--acid); color: var(--text); font-size: 13px; animation: pop 0.3s; }
.world-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.world-mode[hidden] { display: none; }
.world-mode button { padding: 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-dim); font: 600 13px var(--font-body); cursor: pointer; }
.world-mode button.on { color: var(--text); border-color: var(--acid); background: var(--surface-2); }
.world-grave-hint { margin: 0 0 12px; font-size: 12px; line-height: 1.45; color: var(--text-dim); }
.world-grave-hint[hidden], #worldFilters[hidden] { display: none; }
.grave-tag { display: block; width: fit-content; margin: 5px auto 0; font: 400 7px var(--font-pixel); color: var(--text-dim); background: var(--surface-2); border-radius: 99px; padding: 4px 8px; }
.grave-tag.free { color: #0b0a12; background: #ffd23a; }
.btl-result .res-coins { color: #ffd23a !important; font-weight: 600; }
.btl-result .res-life { color: #ff9d9d !important; }
.btl-result .res-mogged { color: #ff9d9d !important; max-width: 300px; line-height: 1.45; }

/* ---- Сцена эволюции (features/0017) ---- */
.evo-scene { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; background: rgba(8, 6, 14, 0.92); overflow: hidden; }
/* Свет: статичное сияние + после вспышки лучи — квадрат меньше экрана, крутится только transform (iPhone тянет) */
.evo-scene { background: radial-gradient(circle at 50% 50%, rgba(255, 210, 58, 0.22), rgba(255, 210, 58, 0.04) 45%, transparent 70%), rgba(8, 6, 14, 0.94); }
.evo-rays { position: absolute; left: 50%; top: 50%; width: 120vmin; height: 120vmin; margin: -60vmin 0 0 -60vmin; border-radius: 50%; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255, 210, 58, 0.26) 0 7deg, transparent 7deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%); will-change: transform; }
.evo-scene.done .evo-rays { opacity: 1; transition: opacity .6s; animation: evo-spin 14s linear infinite; }
@keyframes evo-spin { to { transform: rotate(360deg); } }
.evo-sparks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.evo-stage { position: relative; display: grid; place-items: center; perspective: 900px; }
.evo-ring { position: absolute; inset: -16%; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 244, 184, 0.7), rgba(255, 122, 224, 0.3) 45%, transparent 70%); }
/* Зарядка (0116): карта дрожит всё сильнее и раскаляется */
.evo-scene.charging .evo-ring { animation: evo-charge-glow 1.5s ease-in forwards; }
.evo-scene.charging .evo-card { animation: evo-shake 1.5s linear forwards; }
@keyframes evo-charge-glow { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1.2); } }
@keyframes evo-shake {
  0% { transform: none; filter: brightness(1); }
  15% { transform: translate(-1px, 1px) rotate(-.4deg); }
  25% { transform: translate(1px, -1px) rotate(.4deg); }
  35% { transform: translate(-2px, 1px) rotate(-.8deg); filter: brightness(1.2); }
  45% { transform: translate(2px, -1px) rotate(.8deg); }
  55% { transform: translate(-3px, 2px) rotate(-1.2deg) scale(1.01); filter: brightness(1.5) saturate(1.3); }
  65% { transform: translate(3px, -2px) rotate(1.2deg) scale(1.02); }
  75% { transform: translate(-4px, 2px) rotate(-1.8deg) scale(1.03); filter: brightness(2) saturate(1.5); }
  85% { transform: translate(4px, -3px) rotate(1.8deg) scale(1.04); }
  95% { transform: translate(-5px, 3px) rotate(-2.4deg) scale(1.06); filter: brightness(3); }
  100% { transform: scale(1.08); filter: brightness(4); }
}
/* Вспышка и ударная волна */
.evo-flash { position: absolute; inset: 0; z-index: 3; background: #fff; opacity: 0; pointer-events: none; }
.evo-scene.burst .evo-flash { animation: evo-white .75s ease-out; }
@keyframes evo-white { 0% { opacity: .95; } 100% { opacity: 0; } }
.evo-scene.burst .evo-ring { background: none; border: 4px solid #fff4b8; box-shadow: 0 0 30px #ffd23a, inset 0 0 30px #ff7ae0; animation: evo-wave .9s ease-out forwards; }
@keyframes evo-wave { 0% { opacity: 1; transform: scale(.4); } 100% { opacity: 0; transform: scale(2.8); } }
/* Новая карта — разворот с отскоком; плашка стадии */
.evo-scene.done .evo-card { animation: evo-reveal .9s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes evo-reveal { 0% { transform: scale(.55) rotateY(180deg); filter: brightness(3); } 60% { transform: scale(1.08) rotateY(0); filter: brightness(1.5); } 100% { transform: scale(1); filter: brightness(1); } }
.evo-scene.done .evo-title { animation: pop .4s, evo-glow-text 1.6s ease-in-out .4s infinite alternate; }
@keyframes evo-glow-text { to { text-shadow: 0 0 34px rgba(255, 210, 58, 1), 0 0 8px #fff4b8; } }
.evo-badge { position: relative; z-index: 2; display: grid; justify-items: center; gap: 2px; padding: 8px 18px; border-radius: 14px; background: linear-gradient(#2a1f45, #1b1530); border: 1px solid #ffd23a; box-shadow: 0 0 24px rgba(255, 210, 58, .45); animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.evo-badge[hidden] { display: none; }
.evo-badge b { color: #ffd23a; letter-spacing: 3px; font-size: 16px; }
.evo-badge span { font: 700 14px var(--font-display); }
.evo-badge small { font-size: 12px; color: #c8ff2e; }
@media (prefers-reduced-motion: reduce) { .evo-scene *, .evo-scene.done .evo-rays { animation: none !important; } .evo-flash { display: none; } }
.evo-title { position: relative; font: 900 30px var(--font-display); color: #ffd23a; text-shadow: 0 0 20px rgba(255, 210, 58, 0.7); animation: pop 0.4s; }
.evo-sub { position: relative; font-size: 14px; color: var(--text); }
.evo-scene .evo-card { position: relative; }
.evo-scene .evo-card .card { --card-w: min(64vw, 260px, calc((100dvh - 260px) * 0.716)); }

.evo-scene .evo-ok { position: relative; min-width: 200px; }
.evo-ok[hidden] { display: none; }
.btl-result .res-evo { color: #ffd23a !important; font-weight: 600; }
.vs-back { opacity: 0.85; }
.coll-stats .evo-count { --c: #ffd23a; }

/* ---- «📡 Сеть»: вирусные забеги (features/0021) ---- */
.net .coll-top { justify-content: space-between; }
.net-trend { background: var(--surface); border: 1px solid rgba(255, 61, 139, 0.45); border-radius: 12px; padding: 9px 12px; font-size: 13px; margin-bottom: 12px; line-height: 1.45; }
.net-trend b { color: var(--text); font-weight: 500; white-space: nowrap; }
.net-note { color: var(--text-dim); font-size: 12px; text-align: center; margin: 8px 0; line-height: 1.4; }
.net-list { display: grid; gap: 10px; }
.net-pf { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; text-align: left; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; color: var(--text); font: inherit; cursor: pointer; }
.net-pf:active { transform: translateY(1px); }
.net-pf:disabled { opacity: 0.5; }
.net-pf-icon { font-size: 30px; line-height: 1; text-align: center; }
.net-pf-main { display: grid; gap: 3px; min-width: 0; }
.net-pf-main b { font: 700 15px var(--font-display); }
.net-pf-main small, .net-pf-head small { font-size: 12px; color: var(--text-dim); line-height: 1.35; }
.net-likes { color: var(--text-mute) !important; }
.net-pf-side { display: grid; gap: 4px; justify-items: end; }
.net-risk { font-size: 11px; white-space: nowrap; color: var(--text-dim); }
.net-risk.high { color: #ff8a8a; }
.net-pay { font: 400 9px var(--font-pixel); color: var(--acid); }
.net-pf-head { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; margin-bottom: 12px; }
.net-pf-head > div { display: grid; gap: 2px; min-width: 0; }
.net-pf-head b { font: 700 15px var(--font-display); }
.net-fighter { isolation: isolate; } /* свои слои карточки не вылезают поверх панели запуска */
.net-fighter .card { --card-w: 100%; pointer-events: none; }
.net-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; margin-top: 4px; font-size: 10px; color: var(--text-dim); white-space: nowrap; }
.net-meta b { font: 400 9px var(--font-pixel); color: var(--acid); }
.net-meta span { color: #ff8a8a; }
.net-go { display: grid; gap: 8px; z-index: 10; }
.net-hours { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.net-hours .btn { width: 100%; }
.net-forecast { margin: 0; text-align: center; font-size: 13px; color: var(--text-dim); line-height: 1.4; }
.net-forecast b { color: var(--text); }
.net-forecast .warn { color: #ff8a8a; }
.net-actions { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.net-actions .btn:disabled { filter: grayscale(1) brightness(0.6); }
.net-result { display: grid; gap: 12px; }
.net-result > .btn { width: 100%; }
.net-views { text-align: center; display: grid; gap: 4px; }
.net-views span { font: 400 30px var(--font-pixel); color: var(--acid); text-shadow: 0 0 18px rgba(200, 255, 46, 0.35); }
.net-views small { color: var(--text-dim); font-size: 12px; }
.net-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.net-rows li { background: var(--surface); border-radius: 10px; padding: 9px 12px; display: grid; gap: 2px; font-size: 13px; }
.net-rows li span { color: var(--text-dim); font-size: 12px; }
.net-rows li.banned { border: 1px solid rgba(255, 43, 43, 0.5); }
.net-rows li.banned span { color: #ff8a8a; }
.net-comments { display: grid; gap: 6px; }
.net-comments p { margin: 0; background: var(--surface-2); border-radius: 12px 12px 12px 3px; padding: 8px 11px; font-size: 13px; line-height: 1.35; justify-self: start; }
.net-reward { text-align: center; font: 400 18px var(--font-pixel); color: #ffd23a; }
.btl-net { font-size: 12px; color: var(--cyan); margin: 0 0 10px; line-height: 1.4; }

/* Главная «Сети»: слоты забегов (v2) */
.net-h { margin: 14px 0 8px; font: 700 14px var(--font-display); color: var(--text-dim); }
.net-slots { display: grid; gap: 8px; }
.net-slot { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; background: var(--surface); border: 1px solid rgba(61, 242, 255, 0.35); border-radius: 12px; padding: 9px 10px; }
.net-slot .net-pf-icon { font-size: 24px; }
.net-slot > div { display: grid; gap: 2px; min-width: 0; }
.net-slot b { font-size: 13px; font-weight: 600; }
.net-slot small { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-slot.ready { border-color: var(--acid); box-shadow: 0 0 14px rgba(200, 255, 46, 0.2); cursor: pointer; }
.net-slot.free { display: block; text-align: center; color: var(--text-mute); font-size: 12px; border-style: dashed; border-color: var(--line); }
.net-slot-btns { display: flex; gap: 6px; }
.net-slot-btns .btn { padding: 8px 10px; }
.net-left { font-family: var(--font-pixel); font-size: 10px; color: var(--cyan); }
.net-live { font-size: 10px; color: var(--text-mute); white-space: nowrap; }
.net-pf-head > .btn { padding: 8px 12px; }
.net-pf-head:has(> .btn) { grid-template-columns: auto 34px 1fr; }
.net-likes-line { margin: 0 0 10px; font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.net-send { width: 100%; margin-bottom: 8px; }
.net-send:disabled { filter: grayscale(1) brightness(0.6); }

/* Живая лента площадки — общий вид поста и стиль каждой площадки */
.feed { display: grid; gap: 10px; margin-top: 6px; }
.feed-title { margin: 8px 0 0; font: 700 13px var(--font-display); color: var(--text-dim); }
.feed-list { display: grid; gap: 10px; }
.feed-empty { color: var(--text-mute); font-size: 13px; text-align: center; padding: 18px 0; margin: 0; }
.post { background: var(--surface); border-radius: 14px; padding: 10px 12px; display: grid; gap: 7px; }
.post.mine { box-shadow: inset 0 0 0 2px var(--acid); }
.post.banned { opacity: 0.6; }
.post-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.post-head b { font-size: 13px; }
.post-head small { font-size: 11px; color: var(--text-mute); }
.post-head em { margin-left: auto; font: normal 400 8px var(--font-pixel); color: var(--acid-ink); background: var(--acid); border-radius: 99px; padding: 3px 6px; }
.post-ava { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text); flex: none; }
.post-cap, .post-sound { margin: 0; font-size: 13px; line-height: 1.4; }
.post-sound { font-size: 11px; color: var(--text-dim); }
.post-media { width: 46%; max-width: 170px; }
.post-media .card { --card-w: 100%; pointer-events: none; }
.post-stats { font-size: 12px; color: var(--text-dim); }
.post-stats [data-left] { color: var(--cyan); }
.post-comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.post-comments li { font-size: 12px; line-height: 1.35; color: var(--text); background: var(--surface-2); border-radius: 10px; padding: 5px 9px; animation: post-in 0.4s ease-out; }
.post-comments li b { color: var(--text-dim); font-weight: 600; margin-right: 4px; }
@keyframes post-in { from { opacity: 0; transform: translateY(4px); } }

/* 👵 Бабушкин чат — пузыри мессенджера */
.feed-granny .post { background: #1d2a1f; border-radius: 4px 16px 16px 16px; }
.feed-granny .post.mine { box-shadow: inset 0 0 0 2px #7ed957; }
.feed-granny .post-head b { color: #ff9f6b; }
.feed-granny .post-cap { font-size: 15px; }
.feed-granny .post-ava { background: #ff9f6b; color: #2a1408; }
/* 📱 РилсТок — вертикальное видео */
.feed-reels .post { background: #0d0d14; border: 1px solid #2a2a3d; }
.feed-reels .post-media { width: 62%; max-width: 230px; margin: 0 auto; }
.feed-reels .post-ava { background: linear-gradient(135deg, #ff3d8b, #3df2ff); color: #fff; }
/* 🤖 Нейроканал — посты с промптом */
.feed-neuro .post { background: #10182a; border: 1px solid rgba(0, 229, 195, 0.3); }
.feed-neuro .post-cap { font-family: ui-monospace, monospace; font-size: 12px; color: #9ff5e6; }
.feed-neuro .post-ava { background: #00e5c3; color: #00261f; }
/* 💪 Сигма-паблик — цитата капсом */
.feed-sigma .post { background: #141414; border-left: 4px solid #e6e6e6; border-radius: 4px; }
.feed-sigma .post-cap { font: 700 15px var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; }
.feed-sigma .post-ava { background: #e6e6e6; color: #111; }
/* 🖥 Форум-2007 — тред */
.feed-forum .post { background: #e8e8f0; color: #1a1a2a; border-radius: 2px; border: 1px solid #9aa0b5; }
.feed-forum .post-head { background: #4a5a8a; margin: -10px -12px 0; padding: 6px 10px; }
.feed-forum .post-head b, .feed-forum .post-head small { color: #fff; }
.feed-forum .post-cap { font-weight: 700; color: #1a1a2a; }
.feed-forum .post-stats { color: #4a4a5a; }
.feed-forum .post-comments li { background: #fff; color: #1a1a2a; border-radius: 2px; border: 1px solid #c8cbd8; }
.feed-forum .post-comments li b { color: #4a5a8a; }
.feed-forum .post.mine { box-shadow: inset 0 0 0 2px #ff7a00; }
/* 🕳 Анонимная борда — имиджборда */
.feed-anon .post { background: #f0e0d6; color: #800000; border-radius: 0; border: 1px solid #d9bfb7; }
.feed-anon .post-head b { color: #117743; }
.feed-anon .post-head small { color: #800000; }
.feed-anon .post-cap { color: #800000; font-family: Arial, sans-serif; }
.feed-anon .post-cap .green { color: #789922; }
.feed-anon .post-ava { display: none; }
.feed-anon .post-stats { color: #800000; }
.feed-anon .post-comments li { background: #f7ebe4; color: #800000; border-radius: 0; }
.feed-anon .post-comments li b { color: #117743; }
.feed-anon .post.mine { box-shadow: inset 0 0 0 2px #117743; }
.feed-forum .post-stats [data-left] { color: #2a4ab0; }
.feed-anon .post-stats [data-left] { color: #0f5132; }

/* ===== Арена: «Бои | Игры», мини-игры (features/0023) ===== */
.arena-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.arena-seg button { border: 0; border-radius: 9px; padding: 9px 0; background: transparent; color: var(--text-dim); font: 700 13px var(--font-display); cursor: pointer; white-space: nowrap; }
.arena-seg button.on { background: var(--acid); color: var(--acid-ink); }
/* «Бои»: против компьютера или лобби с людьми (0110) — второй уровень под вкладками Арены */
.btl-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-bottom: 1px solid var(--line); margin: 0 0 12px; }
.btl-modes button { border: 0; border-bottom: 3px solid transparent; background: none; color: var(--text-dim); font: 700 14px var(--font-display); padding: 10px 4px 9px; cursor: pointer; white-space: nowrap; }
.btl-modes button.on { color: var(--acid); border-bottom-color: var(--acid); }
.games-coins { font-size: 13px; color: var(--text-dim); margin: 0 0 10px; line-height: 1.45; }
.games-coins b { color: var(--text); }
.game-tile { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; margin-bottom: 10px;
  background: var(--surface); color: var(--text); border: 1px solid rgba(200, 255, 46, 0.35); border-radius: 14px; padding: 12px; cursor: pointer; }
.game-tile:active { transform: translateY(1px); }
.game-tile:disabled { opacity: 0.5; }
.game-ico { font-size: 34px; line-height: 1; text-align: center; }
.game-main { display: grid; gap: 4px; min-width: 0; }
.game-main b { font: 700 16px var(--font-display); }
.game-main small { font-size: 12px; color: var(--text-dim); line-height: 1.35; }
.game-stat { color: var(--text) !important; }
.game-go { font: 400 14px var(--font-pixel); color: var(--acid); }
.games .coll-top { display: flex; align-items: center; gap: 10px; }
.games .coll-top h1 { margin: 0; }
.algo-rules { list-style: none; margin: 0 0 6px; padding: 12px 14px; display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-size: 15px; line-height: 1.35; }

.algo { display: grid; gap: 8px; justify-items: center; }
.algo-hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; max-width: 480px; font: 400 12px var(--font-pixel); }
.algo-score { font: 900 26px var(--font-display); color: var(--acid); }
.algo-bans { letter-spacing: 2px; text-align: center; }
.algo-time { text-align: right; color: var(--text-dim); }
.algo-stage { position: relative; width: 100%; max-width: 480px; height: min(62dvh, 560px); border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.algo-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: ew-resize; }
.algo-over { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 12px; padding: 16px; text-align: center; background: rgba(11, 10, 18, 0.72); }
.algo-over[hidden] { display: none; }
.algo-over b { font: 700 16px var(--font-display); }
.algo-count { font: 900 64px var(--font-display) !important; color: var(--acid); animation: pop 0.4s; }
.algo-tip { margin: 0; font-size: 12px; color: var(--text-mute); }
.algo-res { display: grid; gap: 8px; text-align: center; padding-top: 8px; }
.algo-res h1 { margin: 0; }
.algo-res p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.45; }
.algo-res p b { color: var(--acid); }
.algo-big { font: 900 64px var(--font-display); color: var(--acid); line-height: 1; display: grid; }
.algo-big small { font: 400 10px var(--font-pixel); color: var(--text-dim); margin-top: 6px; }
.algo-btns { display: grid; gap: 8px; margin-top: 10px; }

.top { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.top li { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; background: var(--surface); border-radius: 10px; padding: 9px 12px; }
.top li span { font: 400 11px var(--font-pixel); color: var(--text-dim); }
.top li:nth-child(1) span { color: #ffd23a; }
.top li:nth-child(2) span { color: #d7dbe6; }
.top li:nth-child(3) span { color: #e0a36a; }
.top li b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top li i { font: 700 16px var(--font-display); font-style: normal; color: var(--acid); }
.top li.mine { outline: 2px solid var(--acid); }
.top-me { text-align: center; color: var(--text-dim); font-size: 13px; }

/* Задания дня и серия (features/0023) */
.quests { background: var(--surface); border: 1px solid rgba(255, 210, 58, 0.4); border-radius: 14px; padding: 12px; margin-bottom: 12px; display: grid; gap: 10px; }
.quests-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.quests-head b { font: 700 15px var(--font-display); }
.quests-head small, .streak small { font-size: 11px; color: var(--text-mute); }
.quest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.quest { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; }
.quest-ico { font-size: 20px; text-align: center; }
.quest-main { display: grid; gap: 5px; min-width: 0; }
.quest-main b { font-weight: 500; font-size: 13px; }
.quest-main i { display: block; height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--acid) var(--w), #2c2640 var(--w)); }
.quest small { font: 400 9px var(--font-pixel); color: var(--text-dim); white-space: nowrap; }
.quest.claimed { opacity: 0.55; }
.quest-ok { font: 700 16px var(--font-display); color: var(--acid); padding: 0 8px; }
.streak { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; }
.streak > span:first-child { font: 700 13px var(--font-display); color: #ffb347; }
.streak-dots { display: flex; gap: 4px; }
.streak-dots i { flex: 1; height: 6px; border-radius: 99px; background: #2c2640; }
.streak-dots i.on { background: #ffb347; box-shadow: 0 0 8px rgba(255, 179, 71, 0.6); }
.streak small { grid-column: 1 / -1; }
.quest-free { margin: 0; font-size: 13px; color: #ffd23a; }
.quest-free.big { text-align: center; font: 700 15px var(--font-display); }
.btl-quest-hint { width: 100%; margin-bottom: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255, 210, 58, 0.55); background: rgba(255, 210, 58, 0.1); color: #ffd23a; font: 500 13px var(--font-body); text-align: left; cursor: pointer; }
#gamesBox > .btn { width: 100%; }

/* «Угадай брейнрота» (features/0023) */
.quiz { display: grid; gap: 10px; justify-items: center; }
.quiz-hud { display: flex; justify-content: space-between; width: 100%; max-width: 480px; font: 400 12px var(--font-pixel); }
.quiz-n { font: 900 22px var(--font-display); color: var(--acid); }
.quiz-score { color: var(--text-dim); align-self: center; }
.quiz-timer { width: 100%; max-width: 480px; height: 6px; border-radius: 99px; background: #2c2640; overflow: hidden; }
.quiz-timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff5d7a, #ffd23a 30%, var(--acid)); }
.quiz-pic { position: relative; width: 100%; max-width: 480px; height: min(34dvh, 300px); display: grid; place-items: center; border-radius: 16px; border: 1px solid var(--line);
  background: radial-gradient(60% 60% at 50% 55%, rgba(200, 255, 46, 0.12), transparent 70%), var(--surface); }
.quiz-pic img { position: absolute; left: 6%; top: 6%; width: 88%; height: 88%; object-fit: contain; }
.quiz-pic img.reveal { transition: filter 0.45s; } /* плавно только при ответе — силуэт появляется сразу тёмным */
.quiz-pic img.sil { filter: brightness(0) drop-shadow(0 0 10px rgba(200, 255, 46, 0.55)); }
.quiz-wait { position: absolute; font: 700 14px var(--font-display); color: var(--text-dim); }
.quiz-wait[hidden] { display: none; }
.quiz-name { min-height: 22px; font: 700 15px var(--font-display); text-align: center; }
.quiz-name.up { color: var(--acid); }
.quiz-name.down { color: #ff8a8a; }
.quiz-opts { display: grid; gap: 8px; width: 100%; max-width: 480px; }
.quiz-opts .btn { width: 100%; text-align: center; }
.quiz-opts .btn.right { background: var(--acid); color: var(--acid-ink); opacity: 1; }
.quiz-opts .btn.wrong { background: #5a1b2b; color: #ffd0d8; opacity: 1; }

/* Кладбище кнопкой в шапке «Мира», рейтинг — вкладкой (features/0086) */
.world .coll-top .grave-btn { margin-left: auto; flex-shrink: 0; }
.world.sub .coll-top .grave-btn { order: -1; margin-left: 0; }
.world.sub .coll-top .world-total { display: none; }
.world .coll-top { flex-wrap: wrap; row-gap: 4px; }
.world .coll-top .world-total { order: 2; flex-basis: 100%; margin: 0; white-space: nowrap; }
@media (max-width: 400px) { .world .coll-top .grave-btn span { display: none; } }
.world-grave-hint b { color: var(--text); font-weight: 600; }
.rate-seg { display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 8px; }
.rate-boards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rate-boards button { display: grid; gap: 2px; justify-items: center; padding: 6px 2px; font-size: 11px; }
.rate-boards button b { font-size: 17px; line-height: 1; }
.rate-two { grid-template-columns: 1fr 1fr; }
.rate-seg button { border: 0; border-radius: 9px; padding: 8px 2px; background: transparent; color: var(--text-dim); font: 600 12px var(--font-body); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rate-seg button.on { background: var(--acid); color: var(--acid-ink); }
.rate-fight[hidden], .rate-me[hidden] { display: none; }
.rate-hint { margin: 4px 2px 10px; font: 600 13px var(--font-body); color: var(--text); text-align: center; }
/* Мини-карта цвета редкости: в легенде с очками, в строках — с числом карт (features/0086) */
.rate-legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 0 6px; }
.rate-legend span { display: grid; justify-items: center; gap: 4px; }
.rate-legend i { background: var(--surface-2); width: 100%; max-width: 46px; aspect-ratio: 5 / 7; display: grid; place-items: center; border-radius: 6px; border: 2px solid var(--c); font: 400 11px var(--font-pixel); font-style: normal; color: var(--text);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 45%, transparent), color-mix(in srgb, var(--c) 10%, transparent) 60%), var(--surface);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 2px 8px color-mix(in srgb, var(--c) 25%, transparent); }
.rate-legend small { font-size: 10px; color: var(--text-dim); white-space: nowrap; }
.rate-legend-cap { margin: 6px 0 12px; text-align: center; font-size: 11px; color: var(--text-mute); }
.rate-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
/* Строка: место | имя и очки сверху, мини-карты на всю ширину под ними */
.top.rate-top li { grid-template-columns: 26px minmax(0, 1fr) auto; row-gap: 6px; column-gap: 8px; }
.rate-top li > div { display: contents; }
.rate-top li > span { grid-row: 1 / 3; }
.rate-top li > div > b { grid-column: 2; grid-row: 1; }
.rate-top li > i { grid-column: 3; grid-row: 1; }
.rate-top li > div > .rate-cards, .rate-top li > div > small { grid-column: 2 / 4; grid-row: 2; }
.rc { display: flex; align-items: center; gap: 4px; font: 600 12px var(--font-body); color: var(--text); }
.rc i { background: var(--c); flex: none; width: 11px; height: 15px; border-radius: 2px; border: 1.5px solid var(--c); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 70%, transparent), color-mix(in srgb, var(--c) 20%, transparent)); }
.rc.none { opacity: .28; }
.top.rate-top li span.rc { font: 400 10px var(--font-pixel); color: var(--text); }
.rate-me { display: grid; gap: 3px; background: var(--surface-2); border: 1px solid var(--acid); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 13px; }
.rate-me b { font: 700 15px var(--font-display); }
.rate-me small { color: var(--text-dim); font-size: 11px; line-height: 1.4; }
.rate-top li small { color: var(--text-dim); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 360px) { .rate-seg button { font-size: 11px; } }
/* Карточка игрока из рейтинга (features/0086) */
.rate-top li[data-ref] { cursor: pointer; }
.rate-top li[data-ref]:active { transform: scale(.98); }
#worldPlayer[hidden] { display: none; }
.pl-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 12px 12px; margin-bottom: 10px; }
.pl-name { font: 700 20px var(--font-display); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 12px; }
.pl-places { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pl-places span { display: grid; justify-items: center; gap: 3px; background: var(--surface-2); border-radius: 10px; padding: 8px 2px; min-width: 0; }
.pl-places i { font-style: normal; font-size: 18px; line-height: 1; }
.pl-places b { font: 700 15px var(--font-display); color: var(--acid); }
.pl-places small { font-size: 10px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pl-chips button.empty { opacity: .45; }

/* Стартовый набор и бонус первой покупки (features/0090) */
.shop-starter { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; width: 100%; margin: 4px 0 10px; padding: 12px 14px;
  border-radius: 14px; border: 1px solid rgba(255, 210, 58, .7); background: linear-gradient(135deg, rgba(255, 210, 58, .22), rgba(255, 61, 139, .14)), var(--surface);
  color: var(--text); text-align: left; cursor: pointer; font-family: var(--font-body); }
.shop-starter b { font: 700 16px var(--font-display); }
.shop-starter span { grid-column: 1; font-size: 13px; }
.shop-starter em { grid-column: 1; font-style: normal; font-size: 11px; color: var(--text-dim); }
.shop-starter .shop-price { grid-row: 1 / 4; grid-column: 2; width: auto; padding: 7px 14px; }
.shop-starter .shop-badge { top: -8px; left: auto; right: 12px; transform: none; }
.shop-first { margin: 0 0 8px; text-align: center; font: 600 13px var(--font-body); color: #ffd23a; }
.shop-coins s { display: block; width: max-content; margin: 0 auto 3px; color: var(--text-mute); font-size: .7em; text-decoration-line: line-through; text-decoration-thickness: 2px; text-decoration-color: #ff5d7a; }

/* «Первые шаги» и «Неделя новичка» (features/0090) */
.onb { background: var(--surface); border: 1px solid rgba(61, 242, 255, .45); border-radius: 14px; padding: 12px; margin-bottom: 12px; display: grid; gap: 10px; }
.onb[hidden] { display: none; }
.onb-note { margin: 0; text-align: center; font-size: 12px; color: var(--text-dim); }
.onb-ch { display: flex; flex-wrap: wrap; gap: 6px; }
.onb-ch .btn { padding: 6px 10px; text-decoration: none; }
.onb-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.onb-week span { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font: 600 11px var(--font-body); white-space: nowrap; }
.onb-week span small { font-size: 9px; color: var(--text-mute); }
.onb-week span.got { opacity: .45; }
.onb-week span.got::after { content: '✓'; font-size: 10px; color: var(--acid); }
.onb-week span.now { border-color: var(--acid); box-shadow: 0 0 0 1px var(--acid), 0 0 12px rgba(200, 255, 46, .35); }
.prof-invite { display: grid; gap: 6px; margin: 4px 0 12px; text-align: center; }
.prof-invite small { font-size: 12px; color: var(--text-dim); }

/* Трекер тиражей (features/0090) */
.world-mode.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ed-list { display: grid; gap: 8px; }
.ed-hint { margin: 0 0 4px; font-size: 12px; line-height: 1.4; color: var(--text-dim); }
.ed-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border-left: 3px solid var(--c); cursor: pointer; }
.ed-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ed-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-main small { font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-bar { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ed-bar i { display: block; height: 100%; background: var(--c); }
.ed-side { display: grid; justify-items: end; gap: 4px; flex-shrink: 0; }
.ed-side em { font: 400 12px var(--font-pixel); font-style: normal; color: var(--text); }

/* ===== Лобби (features/0107) ===== */
.lobby { display: grid; gap: 10px; }
.lobby-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lobby-top > b { font: 700 16px var(--font-display); }
.lobby-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.lobby-seg button, .lobby-maps button { border: 1px solid var(--line); background: var(--surface); color: var(--text-dim); border-radius: 10px; padding: 8px 12px; font: 600 13px var(--font-body); cursor: pointer; }
.lobby-seg button.on, .lobby-maps button.on { border-color: var(--acid); color: var(--text); background: var(--surface-2); }
.lobby-maps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.lobby-label { font-size: 12px; color: var(--text-mute); margin-top: 4px; }
.lobby-hint { margin: 0; font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.lobby-list { display: grid; gap: 8px; }
.lobby-room { display: grid; grid-template-columns: 42px 1fr auto auto; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.lobby-room > b { font: 400 13px var(--font-pixel); color: var(--acid); }
.lobby-who { display: grid; gap: 2px; font: 600 14px var(--font-body); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-who small { font-size: 11px; color: var(--text-mute); font-weight: 400; }
.lobby-dots { display: flex; gap: 3px; }
.lobby-dots i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.lobby-room em { font-style: normal; font: 700 13px var(--font-display); color: var(--acid-ink); background: var(--acid); border-radius: 99px; padding: 6px 12px; }
.lobby-count { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); }
.lobby-count b { color: var(--acid); }
.lobby-card { position: relative; border: 2px solid transparent; border-radius: 12px; background: none; padding: 0; cursor: pointer; }
.lobby-card.sel { border-color: var(--acid); }
.lobby-mark { position: absolute; top: 6px; right: 6px; display: none; width: 22px; height: 22px; border-radius: 50%; background: var(--acid); color: var(--acid-ink); font-style: normal; font-weight: 700; place-items: center; }
.lobby-card.sel .lobby-mark { display: grid; }
.lobby-go { position: sticky; bottom: 8px; }
.lobby-go .btn { width: 100%; }
.lobby-wait { text-align: center; justify-items: center; padding: 24px 8px; }
.lobby-wait-icon { font-size: 48px; animation: lobby-bob 1.6s ease-in-out infinite alternate; }
.lobby-wait h2 { margin: 0; font: 700 20px var(--font-display); }
.lobby-wait p { margin: 0; color: var(--text-dim); }
.lobby-wait p b { font: 400 14px var(--font-pixel); color: var(--acid); }
.lobby-pin { display: grid; gap: 4px; padding: 14px 24px; border-radius: 14px; border: 1px dashed var(--acid); background: var(--surface); }
.lobby-pin b { font: 400 30px var(--font-pixel); letter-spacing: .2em; color: var(--acid); }
.lobby-pin small { font-size: 11px; color: var(--text-mute); }
.lobby-pin { font: inherit; color: inherit; cursor: pointer; transition: transform .12s, background .12s; }
.lobby-pin:active { transform: scale(.97); background: var(--surface-2, var(--surface)); }
.lobby-wait .btn { min-width: 220px; }
.lobby-wait .lobby-top { justify-self: stretch; margin-top: -16px; } /* «← Лобби» — назад, комната живёт (0112) */
.lobby-wait .lobby-top .btn { min-width: 0; }
/* Своя ждущая комната (0108) */
.lobby-mine { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--acid); background: color-mix(in srgb, var(--acid) 10%, var(--surface)); }
.lobby-mine[hidden] { display: none; }
.lobby-mine-info { grid-column: 1 / -1; display: grid; gap: 2px; min-width: 0; }
.lobby-mine-info b { font: 700 14px var(--font-display); }
.lobby-mine-info small { font-size: 11px; color: var(--text-dim); }
.lobby-error { margin: 0; min-height: 1em; font-size: 13px; color: #ff6b7d; }
.lobby-pin-input { width: 100%; box-sizing: border-box; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 400 24px var(--font-pixel); letter-spacing: .4em; text-align: center; }
@keyframes lobby-bob { to { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .lobby-wait-icon { animation: none; } }
/* «Колбы» (0114) */
.fl-game { display: grid; gap: 10px; }
.fl-level { margin: 0; font: 700 14px var(--font-display); color: var(--acid); text-align: center; }
.fl-tip { margin: 0; font-size: 12px; line-height: 1.45; color: var(--text-dim); text-align: center; }
.fl-board { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 18px 9px; padding: 18px 4px 8px; }
.fl-flask { --layer: 32px; position: relative; width: 44px; height: calc(var(--layer) * 4 + 14px); padding: 0 4px 6px; display: flex; flex-direction: column-reverse; gap: 2px; border: 2px solid #8d84aa; border-top: 0; border-radius: 4px 4px 24px 24px; background: linear-gradient(90deg, #ffffff10, #ffffff05 40%, #ffffff12); cursor: pointer; transition: transform .15s ease, border-color .15s ease; -webkit-tap-highlight-color: transparent; }
.fl-flask::before { content: ''; position: absolute; left: -6px; right: -6px; top: 0; height: 4px; border-radius: 3px; background: #8d84aa; }
.fl-flask.up { transform: translateY(-14px); border-color: var(--acid); }
.fl-flask.up::before { background: var(--acid); }
.fl-flask.full { border-color: #c8ff2e88; box-shadow: 0 0 14px #c8ff2e33; }
.fl-flask i { flex: 0 0 var(--layer); display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 15px; background: var(--c); border-radius: 6px; box-shadow: inset 0 -3px 0 #0003, inset 0 2px 0 #ffffff40; }
.fl-flask i:first-child { border-radius: 6px 6px 18px 18px; }
.fl-bar { display: flex; align-items: center; gap: 8px; }
.fl-moves { flex: 1; font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.fl-bar .btn { white-space: nowrap; padding-left: 10px; padding-right: 10px; }
.fl-result { display: grid; gap: 6px; text-align: center; padding: 14px; border-radius: 14px; border: 1px solid var(--acid); background: color-mix(in srgb, var(--acid) 8%, var(--surface)); }
.fl-result[hidden] { display: none; }
.fl-result h2 { margin: 0; font: 700 20px var(--font-display); }
.fl-result p { margin: 0; }
