/* game.css — интерфейс Don’t Splash: «бассейные» залы.
   Образ: кремовые плиточные панели (сетка швов), бирюзовые «водяные» ленты, глянцевые кнопки-пилюли как надувные игрушки
   (зелёная — вперёд, красно-белая «спасательный круг» — спасение, золотая — монеты, фиолетовая — реклама).
   Шрифт — Unbounded (OFL, assets/licenses/unbounded). Разметку делает js/GameUI.js; декоративные слои pointer-events: none. */

/* Путь строковым литералом для сканера ассетов сборки: 'assets/fonts/unbounded.ttf' */
@font-face {
    font-family: 'BPM Unbounded';
    src: url('../assets/fonts/unbounded.ttf') format('truetype');
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --bpm-ink: #0b3d47;
    --bpm-ink-a: rgba(11, 61, 71, .55);
    --bpm-water: #22bfb8;
    --bpm-water-l: #8ae8e0;
    --bpm-water-d: #0d8a93;
    --bpm-deep: #0a5560;
    --bpm-cream: #f8f2de;
    --bpm-cream2: #fffaec;
    --bpm-grout: rgba(133, 112, 66, .2);
    --bpm-green: #46d977;
    --bpm-red: #e5383b;
    --bpm-gold: #ffc928;
    --bpm-purple: #8d5cf0;
    --bpm-font: 'BPM Unbounded', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
    --bpm-sa-t: max(env(safe-area-inset-top, 0px), var(--lory-safe-top, 0px));
    --bpm-sa-r: max(env(safe-area-inset-right, 0px), var(--lory-safe-right, 0px));
    --bpm-sa-b: max(env(safe-area-inset-bottom, 0px), var(--lory-safe-bottom, 0px));
    --bpm-sa-l: max(env(safe-area-inset-left, 0px), var(--lory-safe-left, 0px));
    --bpm-tile:
        linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 38%),
        repeating-linear-gradient(0deg, transparent 0 27px, var(--bpm-grout) 27px 28px),
        repeating-linear-gradient(90deg, transparent 0 27px, var(--bpm-grout) 27px 28px);
}

/* ------------------------------------------------------------------------------------------------------------
   Основа
   ------------------------------------------------------------------------------------------------------------ */
.bpm-layer, .bpm-layer *, .bpm-layer *::before, .bpm-layer *::after { box-sizing: border-box; }
.bpm-layer {
    position: fixed; inset: 0; pointer-events: none;
    font-family: var(--bpm-font); font-weight: 700; color: var(--bpm-ink); line-height: 1.15;
    -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
    text-rendering: optimizeLegibility;
}
:where(.bpm-layer button) { font: inherit; color: inherit; margin: 0; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.bpm-layer button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.bpm-layer [hidden] { display: none !important; }
.bpm-ico { display: block; width: 1.5em; height: 1.5em; flex: none; object-fit: contain; pointer-events: none; overflow: visible; }
.bpm-stroke {
    color: #fff; -webkit-text-stroke: .17em var(--bpm-ink); paint-order: stroke fill;
    text-shadow: 0 .09em 0 var(--bpm-ink), 0 .16em .25em rgba(0, 30, 40, .35);
}
.bpm-soft { text-shadow: 0 1px 0 rgba(0, 0, 0, .35), 0 0 6px rgba(0, 30, 40, .45); color: #fff; }

/* ------------------------------------------------------------------------------------------------------------
   Кнопки-пилюли
   ------------------------------------------------------------------------------------------------------------ */
.bpm-btn {
    --c1: #5de387; --c2: #27ad52; --cd: #167a3a; --fg: #fff;
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    min-height: 44px; padding: .6em 1.25em; border: 0; border-radius: 999px; overflow: hidden;
    background: linear-gradient(180deg, var(--c1), var(--c2));
    color: var(--fg); font-size: 13px; font-weight: 800; letter-spacing: .01em; text-align: center; white-space: nowrap;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .28);
    box-shadow: 0 5px 0 var(--cd), 0 8px 10px rgba(0, 40, 50, .35), inset 0 0 0 2px rgba(255, 255, 255, .3);
    pointer-events: auto; transition: transform .08s, box-shadow .08s, filter .15s;
}
.bpm-btn::before {
    content: ''; position: absolute; left: 9%; right: 9%; top: 6%; height: 40%; border-radius: 999px; pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, .06));
}
.bpm-btn > * { position: relative; }
.bpm-btn .bpm-ico { width: 1.55em; height: 1.55em; }
.bpm-btn:hover:not(:disabled) { filter: brightness(1.07); }
.bpm-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--cd), 0 3px 6px rgba(0, 40, 50, .35), inset 0 0 0 2px rgba(255, 255, 255, .3); }
.bpm-btn:disabled { filter: grayscale(.65) brightness(.96); opacity: .72; cursor: default; }
.bpm-btn.big { min-height: 64px; padding: .7em 1.6em; font-size: clamp(17px, 5.6vw, 24px); }
.bpm-btn.small { min-height: 44px; padding: .4em .95em; font-size: 12px; }
.bpm-btn.tiny { min-height: 44px; padding: .3em .8em; font-size: 11px; }
.bpm-btn.block { display: flex; width: 100%; }
.bpm-btn.gold { --c1: #ffe36b; --c2: #ffb800; --cd: #bf7600; --fg: #5a3300; text-shadow: 0 1px 0 rgba(255, 255, 255, .55); }
.bpm-btn.ad { --c1: #a982ff; --c2: #6f3fe0; --cd: #4a24a8; }
.bpm-btn.teal { --c1: #4fe0d8; --c2: #14a5ac; --cd: #0b7077; }
.bpm-btn.blue { --c1: #6cc5ff; --c2: #2c86e0; --cd: #1a5aa3; }
.bpm-btn.orange { --c1: #ffb15a; --c2: #f0701f; --cd: #a8480d; }
.bpm-btn.ghost { --c1: #fffdf2; --c2: #ece3c6; --cd: #bdb08a; --fg: var(--bpm-ink); text-shadow: none; box-shadow: 0 5px 0 var(--cd), 0 8px 10px rgba(0, 40, 50, .25), inset 0 0 0 2px #fff; }
.bpm-btn.ghost::before { opacity: .55; }
.bpm-btn.red { --c1: #ff6a68; --c2: #d3262b; --cd: #8f1319; }
/* красно-белый «спасательный круг»: полосатый обод вокруг красной пилюли */
.bpm-btn.rescue {
    --cd: #8f1319; border: 5px solid transparent;
    background: linear-gradient(180deg, #ff6a68, #cf2229) padding-box, repeating-linear-gradient(60deg, #e5383b 0 11px, #fff 11px 22px) border-box;
    box-shadow: 0 5px 0 var(--cd), 0 8px 10px rgba(0, 40, 50, .35);
}
.bpm-btn.rescue::before { left: 12%; right: 12%; top: 4%; height: 38%; }
.bpm-btn .pips { display: inline-flex; gap: 3px; margin-left: .15em; }
.bpm-btn .pips i { width: .6em; height: .6em; border-radius: 50%; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.bpm-btn .pips i.on { background: #ffe36b; box-shadow: 0 0 0 1px #8a5c00; }
.bpm-btn .sub { display: block; font-size: .62em; font-weight: 700; opacity: .92; letter-spacing: 0; margin-top: .2em; }
.bpm-btn .col { display: flex; flex-direction: column; align-items: center; }
.bpm-round {
    flex: none;
    --c1: #5de3dc; --c2: #14a5ac; --cd: #0b7077;
    position: relative; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; overflow: hidden;
    background: linear-gradient(180deg, var(--c1), var(--c2)); pointer-events: auto;
    box-shadow: 0 4px 0 var(--cd), 0 6px 8px rgba(0, 40, 50, .35), inset 0 0 0 2px rgba(255, 255, 255, .35); transition: transform .08s, box-shadow .08s;
}
.bpm-round::before { content: ''; position: absolute; left: 14%; right: 14%; top: 7%; height: 38%; border-radius: 50%; background: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, .05)); pointer-events: none; }
.bpm-round .bpm-ico { position: relative; width: 56%; height: 56%; }
.bpm-round:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cd), 0 3px 5px rgba(0, 40, 50, .35), inset 0 0 0 2px rgba(255, 255, 255, .35); }
.bpm-round.red { --c1: #ff6a68; --c2: #d3262b; --cd: #8f1319; }
.bpm-x { position: relative; flex: none; }

/* Монеты, чипы, плашки */
.bpm-coinpill {
    display: inline-flex; align-items: center; gap: .4em; padding: .25em .85em .25em .35em; border-radius: 999px; font-size: 14px; font-weight: 800; color: #fff;
    background: linear-gradient(180deg, #0d7f89, #0a5560); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55), 0 3px 0 rgba(0, 40, 50, .4);
    text-shadow: 0 1px 0 rgba(0, 0, 0, .45); white-space: nowrap;
}
.bpm-coinpill .bpm-ico { width: 1.7em; height: 1.7em; }
.bpm-coinpill.bump { animation: bpm-bump .35s ease-out; }
.bpm-chip { display: inline-flex; align-items: center; gap: .3em; padding: .22em .65em; border-radius: 999px; font-size: 10px; font-weight: 800; background: rgba(11, 61, 71, .1); color: var(--bpm-ink); white-space: nowrap; }
.bpm-chip.ok { background: #cdf6d8; color: #0e6a2b; }
.bpm-chip.gold { background: #ffe9a0; color: #7a4b00; }
.bpm-chip .bpm-ico { width: 1.5em; height: 1.5em; }
.bpm-plate {
    color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .5), 0 0 6px rgba(0, 30, 40, .5);
    background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 45%), repeating-linear-gradient(90deg, transparent 0 17px, rgba(255, 255, 255, .06) 17px 18px), rgba(8, 82, 94, .86);
    border-radius: 1.1em; box-shadow: inset 0 0 0 .16em rgba(255, 255, 255, .85), 0 .22em 0 rgba(0, 30, 40, .35), 0 .4em .8em rgba(0, 30, 40, .25);
}

/* ------------------------------------------------------------------------------------------------------------
   Окна (магазин, снаряжение, улучшения, скины, инвентарь, новый забег)
   ------------------------------------------------------------------------------------------------------------ */
#bpm-win {
    z-index: 40; display: none; align-items: center; justify-content: center; pointer-events: auto;
    padding: calc(var(--bpm-sa-t) + 10px) calc(var(--bpm-sa-r) + 10px) calc(var(--bpm-sa-b) + 10px) calc(var(--bpm-sa-l) + 10px);
    background: radial-gradient(ellipse at 50% 45%, rgba(23, 154, 160, .55), rgba(5, 52, 66, .88) 85%);
}
#bpm-win.on { display: flex; animation: bpm-fade .16s ease-out; }
.bpm-panel {
    position: relative; display: flex; flex-direction: column; width: min(1000px, 100%); max-height: 100%; min-height: 0; overflow: hidden;
    border-radius: 26px; border: 5px solid #fffdf2; background-color: var(--bpm-cream); background-image: var(--bpm-tile);
    box-shadow: 0 0 0 4px var(--bpm-water), 0 9px 0 4px var(--bpm-water-d), 0 26px 44px rgba(0, 25, 35, .55);
}
#bpm-win.pop .bpm-panel { animation: bpm-pop .22s cubic-bezier(.2, 1.35, .4, 1); }
.bpm-head {
    position: relative; flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; overflow: hidden;
    background: linear-gradient(180deg, #4fe1d9, #17a5a8 70%, #13979c); border-bottom: 4px solid var(--bpm-water-d);
}
.bpm-head::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .55) 50%, transparent 62%) 0 0 / 220% 100%; animation: bpm-shimmer 5s linear infinite;
}
.bpm-head > * { position: relative; z-index: 1; }
.bpm-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bpm-title .bpm-ico { width: 1.7em; height: 1.7em; }
.bpm-title span { overflow: hidden; text-overflow: ellipsis; }
.bpm-tabs { flex: none; display: flex; gap: 8px; padding: 10px 12px 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.bpm-tabs::-webkit-scrollbar { display: none; }
.bpm-tab {
    flex: none; min-height: 44px; padding: .5em 1.1em; border: 0; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; color: var(--bpm-ink);
    background: #fffdf2; box-shadow: inset 0 0 0 3px #bfe6e1, 0 3px 0 #a7cfc9; pointer-events: auto; transition: transform .08s;
}
.bpm-tab.on { background: linear-gradient(180deg, #ffe36b, #ffbd1a); box-shadow: inset 0 0 0 3px #fff3b8, 0 3px 0 #bf7600; }
.bpm-tab:active { transform: translateY(2px); }
.bpm-body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    scrollbar-width: thin; scrollbar-color: var(--bpm-water) transparent; pointer-events: auto;
}
.bpm-body > * + * { margin-top: 12px; }
.bpm-win-toast {
    position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 20px); max-width: 90%; padding: .7em 1.2em; border-radius: 999px; font-size: 12px; text-align: center;
    color: #fff; background: rgba(8, 82, 94, .95); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .8), 0 4px 0 rgba(0, 30, 40, .4); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 5; text-shadow: 0 1px 0 rgba(0, 0, 0, .4);
}
.bpm-win-toast.show { opacity: 1; transform: translate(-50%, 0); }
.bpm-h2 { display: flex; align-items: center; gap: .5em; margin: 0 0 8px; font-size: 13px; font-weight: 900; letter-spacing: .02em; text-transform: uppercase; color: var(--bpm-deep); }
.bpm-h2 small { font-size: 10px; font-weight: 700; text-transform: none; opacity: .7; letter-spacing: 0; }
.bpm-note { margin: 0; font-size: 11px; font-weight: 600; line-height: 1.35; color: #3b6a73; }

.bpm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.bpm-card {
    position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 18px; min-width: 0;
    background: linear-gradient(180deg, #ffffff, #fff8e6); border: 3px solid #cde9e4; box-shadow: 0 4px 0 #b4d6cf; transition: transform .12s, box-shadow .12s;
}
.bpm-card.special { border-color: #ffd86a; box-shadow: 0 4px 0 #dcae2c, 0 0 0 3px rgba(255, 216, 106, .35); background: linear-gradient(180deg, #fffdf0, #fff1c7); }
.bpm-card.locked .bpm-card-ico { filter: grayscale(1) brightness(.9); opacity: .6; }
.bpm-card.owned { border-color: #9be3b0; box-shadow: 0 4px 0 #6fc88a; }
.bpm-card-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bpm-card-ico { position: relative; flex: none; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; background: radial-gradient(circle at 35% 30%, #fff, #d6f3ef 70%); box-shadow: inset 0 0 0 3px #bfe6e1; }
.bpm-card-ico .bpm-ico { width: 78%; height: 78%; }
.bpm-card-ico .lockbadge { position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; }
.bpm-card-txt { min-width: 0; flex: 1; }
.bpm-card h3 { margin: 0; font-size: 13px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.bpm-card p { margin: 3px 0 0; font-size: 10px; font-weight: 600; line-height: 1.35; color: #3b6a73; }
.bpm-card .have { margin-top: 4px; }
.bpm-card-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.bpm-card-foot > .bpm-btn, .bpm-card-foot > .bpm-need { flex: 1 1 100%; }
.bpm-card-foot .bpm-refills { flex: 1 1 100%; }
.bpm-ribbon { position: absolute; top: -2px; right: 10px; padding: .25em .7em .35em; border-radius: 0 0 10px 10px; font-size: 9px; font-weight: 900; color: #fff; background: linear-gradient(180deg, #ff8a3d, #e5503b); text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }

/* Снаряжение: слоты */
.bpm-loadout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bpm-lslot {
    position: relative; display: flex; align-items: center; gap: 8px; min-height: 66px; padding: 8px; border-radius: 16px; min-width: 0;
    background: linear-gradient(180deg, #e9fbf8, #c9f0ec); border: 3px solid var(--bpm-water); box-shadow: 0 4px 0 var(--bpm-water-d);
}
.bpm-lslot.empty { background: rgba(255, 255, 255, .45); border-style: dashed; box-shadow: none; justify-content: center; color: #4a8c94; font-size: 11px; }
.bpm-lslot .no { position: absolute; left: 6px; top: 3px; font-size: 9px; font-weight: 900; color: var(--bpm-deep); opacity: .65; }
.bpm-lslot .bpm-ico { width: 40px; height: 40px; }
.bpm-lslot .tx { min-width: 0; flex: 1; }
.bpm-lslot .tx b { display: block; font-size: 11px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bpm-lslot .tx span { font-size: 10px; font-weight: 700; color: #3b6a73; }
.bpm-lslot .rm { position: absolute; right: -8px; top: -12px; width: 44px; height: 44px; min-height: 0; }
.bpm-lslot .rm .bpm-ico { width: 52%; height: 52%; }
.bpm-refills { display: flex; flex-wrap: wrap; gap: 6px; }
.bpm-refills .bpm-btn { flex: 1 1 auto; }

/* Улучшения */
.bpm-pipsrow { display: flex; gap: 5px; }
.bpm-pipsrow i { flex: 1; height: 10px; border-radius: 99px; background: #cfe3df; box-shadow: inset 0 0 0 2px #b4d0cb; }
.bpm-pipsrow i.on { background: linear-gradient(180deg, #7dffa7, #30c765); box-shadow: inset 0 0 0 2px #1d9a4a; }
.bpm-nownext { display: flex; align-items: center; justify-content: center; gap: 8px; padding: .5em .6em; border-radius: 12px; background: rgba(11, 61, 71, .07); font-size: 12px; font-weight: 800; }
.bpm-nownext b { color: var(--bpm-deep); }
.bpm-nownext i { font-style: normal; color: #2aa957; }
.bpm-nownext small { font-size: 9px; opacity: .6; display: block; text-align: center; font-weight: 700; }
.bpm-nownext > span { text-align: center; }
.bpm-need { display: flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: .4em .8em; border-radius: 999px; font-size: 11px; background: #eee6cd; color: #7a6a3c; box-shadow: inset 0 0 0 2px #d9cda7; }
.bpm-need .bpm-ico { width: 1.6em; height: 1.6em; }
.bpm-need.max { background: #cdf6d8; color: #0e6a2b; box-shadow: inset 0 0 0 2px #8fdca6; }

/* Скины */
.bpm-skins { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.bpm-skin-pane {
    position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 10px; margin: -12px -12px 0; border-radius: 0 0 20px 20px;
    background: linear-gradient(180deg, #e7faf7, #c6efe9); border-bottom: 4px solid var(--bpm-water); box-shadow: 0 8px 14px rgba(0, 40, 50, .18);
}
.bpm-skin-pane .stage { flex: none; display: grid; place-items: center; width: 92px; height: 116px; border-radius: 18px; background: radial-gradient(circle at 50% 80%, #fff, #bfeee9 65%); box-shadow: inset 0 0 0 3px #9bdcd5; }
.bpm-skin-pane .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bpm-skin-pane h3 { margin: 0; font-size: 15px; font-weight: 900; overflow-wrap: anywhere; }
.bpm-skin-pane .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bpm-skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.bpm-skin {
    --rc: #9fc9d1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 8px 4px 6px; text-align: center; cursor: pointer; pointer-events: auto;
    border-radius: 16px; border: 3px solid var(--rc); background: linear-gradient(180deg, #ffffff, #fff4d8); box-shadow: 0 4px 0 color-mix(in srgb, var(--rc) 70%, #000); transition: transform .1s;
}
.bpm-skin:hover { transform: translateY(-2px); }
.bpm-skin.sel { outline: 4px solid var(--bpm-gold); outline-offset: 1px; }
.bpm-skin.rare { --rc: #5aa8f0; }
.bpm-skin.epic { --rc: #a36bf2; }
.bpm-skin.legendary { --rc: #ffb71a; background: linear-gradient(180deg, #fffdf0, #ffe9a6); }
.bpm-skin.legendary::after { content: ''; position: absolute; inset: 0; border-radius: 13px; pointer-events: none; background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, .8) 50%, transparent 62%) 0 0 / 250% 100%; animation: bpm-shimmer 3.2s linear infinite; }
.bpm-skin .nm { font-size: 10px; font-weight: 800; line-height: 1.2; min-height: 2.4em; display: flex; align-items: center; justify-content: center; overflow-wrap: anywhere; }
.bpm-skin .st { font-size: 9px; font-weight: 800; min-height: 1.6em; display: flex; align-items: center; justify-content: center; gap: 3px; color: #3b6a73; }
.bpm-skin .st .bpm-ico { width: 1.6em; height: 1.6em; }
.bpm-skin .eq { position: absolute; left: 4px; top: 4px; width: 22px; height: 22px; }
.bpm-rar { --rc: #6b8f97; color: #fff; background: var(--rc); padding: .2em .65em; border-radius: 99px; font-size: 9px; font-weight: 900; text-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.bpm-rar.rare { --rc: #3d8fe0; } .bpm-rar.epic { --rc: #8a4fe0; } .bpm-rar.legendary { --rc: #e89a00; }

/* Новый забег */
.bpm-levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.bpm-lv {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 6px 3px; min-width: 0; border-radius: 16px;
    border: 3px solid #bfe6e1; background: linear-gradient(180deg, #fff, #effbf9); box-shadow: 0 4px 0 #a7cfc9; pointer-events: auto; text-align: center; transition: transform .08s;
}
.bpm-lv:active { transform: translateY(2px); }
.bpm-lv b { font-size: 20px; font-weight: 900; line-height: 1; }
.bpm-lv span { font-size: 8px; font-weight: 700; line-height: 1.15; max-width: 100%; overflow-wrap: anywhere; hyphens: auto; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #3b6a73; }
.bpm-lv.sel { border-color: var(--bpm-gold); background: linear-gradient(180deg, #fffbe3, #ffeaa0); box-shadow: 0 4px 0 #cc9300, 0 0 0 3px rgba(255, 201, 40, .45); }
.bpm-lv.locked { background: linear-gradient(180deg, #e6ecec, #d3dcdc); border-color: #b7c4c4; box-shadow: 0 4px 0 #9eacac; }
.bpm-lv.locked b { opacity: .55; }
.bpm-lv .bpm-ico { position: absolute; width: 20px; height: 20px; right: -5px; top: -7px; filter: drop-shadow(0 1px 0 rgba(0, 40, 50, .4)); }
.bpm-lv .bpm-ico.done { left: -5px; right: auto; }
.bpm-create-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.bpm-steppers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bpm-box { padding: 10px; border-radius: 18px; background: rgba(255, 255, 255, .72); border: 3px solid #cde9e4; box-shadow: 0 4px 0 #b4d6cf; min-width: 0; }
.bpm-step { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bpm-step .val { flex: 1; text-align: center; font-size: 28px; font-weight: 900; line-height: 1; color: var(--bpm-deep); }
.bpm-step .val small { display: block; margin-top: .25em; font-size: 10px; font-weight: 800; color: #2aa957; }
.bpm-step .bpm-round { width: 46px; height: 46px; font-size: 26px; font-weight: 900; color: #fff; line-height: 1; }
.bpm-step .bpm-round:disabled { filter: grayscale(.8); opacity: .55; }
.bpm-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.bpm-info .nm { font-size: 17px; font-weight: 900; overflow-wrap: anywhere; }
.bpm-reward { display: inline-flex; align-items: center; gap: .35em; padding: .25em .8em .25em .35em; border-radius: 999px; font-size: 14px; font-weight: 900; background: #ffe9a0; color: #7a4b00; box-shadow: inset 0 0 0 2px #f2c64a; }
.bpm-reward .bpm-ico { width: 1.6em; height: 1.6em; }

/* Инвентарь */
.bpm-inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)); gap: 8px; }
.bpm-slot-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 16px; background: linear-gradient(180deg, #fff, #effbf9); border: 3px solid #bfe6e1; box-shadow: 0 4px 0 #a7cfc9; text-align: center; min-width: 0; }
.bpm-slot-tile .bpm-ico { width: 44px; height: 44px; }
.bpm-slot-tile b { font-size: 10px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.bpm-slot-tile .n { font-size: 15px; font-weight: 900; color: var(--bpm-deep); }
.bpm-slot-tile.zero { opacity: .6; }
.bpm-slot-tile.zero .n { color: #b3261e; }
.bpm-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 8px; }
.bpm-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 14px; background: rgba(255, 255, 255, .72); border: 3px solid #cde9e4; min-width: 0; }
.bpm-row .bpm-ico { width: 34px; height: 34px; }
.bpm-row .tx { flex: 1; min-width: 0; font-size: 11px; font-weight: 800; }
.bpm-row .tx .bpm-pipsrow { margin-top: 5px; }
.bpm-row .v { font-size: 11px; font-weight: 900; color: var(--bpm-deep); white-space: nowrap; }
.bpm-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------------------------------------------------------------
   Мини-аватар из цветов вида: CSS-блоки + знаки для волос, шапки и аксессуаров (размер — --av)
   ------------------------------------------------------------------------------------------------------------ */
.bpm-av { --ia: rgba(11, 61, 71, .55); position: relative; width: 6em; height: 9.4em; font-size: var(--av, 10px); flex: none; pointer-events: none; }
.bpm-av i { position: absolute; display: block; }
.bpm-av .head { left: 1.5em; top: 0; width: 3em; height: 3em; z-index: 3; background: var(--sk); border-radius: .55em; box-shadow: 0 0 0 .15em var(--ia), inset 0 -.35em 0 rgba(0, 0, 0, .07); }
.bpm-av .head::before, .bpm-av .head::after { content: ''; position: absolute; top: 1.3em; width: .42em; height: .62em; border-radius: .2em; background: #1d2630; }
.bpm-av .head::before { left: .72em; } .bpm-av .head::after { right: .72em; }
.bpm-av .body { left: 1.25em; top: 3.15em; width: 3.5em; height: 3.2em; z-index: 2; background: var(--sh); border-radius: .5em .5em .3em .3em; box-shadow: 0 0 0 .15em var(--ia), inset 0 -.4em 0 rgba(0, 0, 0, .08); }
.bpm-av .arm { top: 3.25em; width: 1.1em; height: 3em; z-index: 1; background: var(--sk); border-radius: .45em; box-shadow: 0 0 0 .15em var(--ia); overflow: hidden; }
.bpm-av .arm::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1.25em; background: var(--sh); }
.bpm-av .arm.l { left: .05em; } .bpm-av .arm.r { right: .05em; }
.bpm-av .leg { top: 6.3em; width: 1.65em; height: 2.35em; z-index: 1; background: var(--pa); border-radius: .3em .3em .25em .25em; box-shadow: 0 0 0 .15em var(--ia); }
.bpm-av .leg::after { content: ''; position: absolute; left: -.12em; right: -.12em; bottom: -.58em; height: .75em; background: var(--se); border-radius: .25em .25em .4em .4em; box-shadow: 0 0 0 .15em var(--ia); }
.bpm-av .leg.l { left: 1.45em; } .bpm-av .leg.r { right: 1.45em; }
.bpm-av .hair, .bpm-av .hat, .bpm-av .acc { background: var(--ha); }
.bpm-av .hair { z-index: 4; box-shadow: 0 0 0 .15em var(--ia); }
.bpm-av .hair.short { left: 1.35em; top: -.3em; width: 3.3em; height: 1.35em; border-radius: .95em .95em .25em .25em; }
.bpm-av .hair.spiky { left: 1.35em; top: -.95em; width: 3.3em; height: 1.95em; box-shadow: none; clip-path: polygon(0 100%, 0 46%, 14% 56%, 22% 0, 38% 42%, 50% 6%, 62% 42%, 78% 0, 86% 56%, 100% 46%, 100% 100%); }
.bpm-av .hair.long { left: 1.35em; top: -.3em; width: 3.3em; height: 1.35em; border-radius: .95em .95em .25em .25em; }
.bpm-av .hair.long::before, .bpm-av .hair.long::after { content: ''; position: absolute; top: .55em; width: .8em; height: 3.5em; background: var(--ha); border-radius: .3em; box-shadow: 0 0 0 .15em var(--ia); z-index: -1; }
.bpm-av .hair.long::before { left: 0; } .bpm-av .hair.long::after { right: 0; }
.bpm-av .hair.bun { left: 1.35em; top: -.3em; width: 3.3em; height: 1.35em; border-radius: .95em .95em .25em .25em; }
.bpm-av .hair.bun::after { content: ''; position: absolute; left: 1.15em; top: -.95em; width: 1em; height: 1em; border-radius: 50%; background: var(--ha); box-shadow: 0 0 0 .15em var(--ia); z-index: -1; }
.bpm-av .hair.mohawk { left: 2.15em; top: -1.25em; width: 1.7em; height: 2.05em; border-radius: .6em .6em .1em .1em; }
.bpm-av .hair.curly { left: 1.15em; top: -.55em; width: 3.7em; height: 1.65em; border-radius: 1.2em; box-shadow: 0 0 0 .15em var(--ia), -.15em .55em 0 -.05em var(--ha), .15em .55em 0 -.05em var(--ha); }
.bpm-av .hat { z-index: 5; background: var(--hc); box-shadow: 0 0 0 .15em var(--ia); }
.bpm-av .hat.cap { left: 1.3em; top: -.5em; width: 3.4em; height: 1.4em; border-radius: 1.3em 1.3em .2em .2em; }
.bpm-av .hat.cap::after { content: ''; position: absolute; left: .75em; bottom: -.45em; width: 1.9em; height: .55em; border-radius: .25em .25em .5em .5em; background: var(--hc); filter: brightness(.78); box-shadow: 0 0 0 .15em var(--ia); }
.bpm-av .hat.swimcap { left: 1.3em; top: -.4em; width: 3.4em; height: 1.75em; border-radius: 1.5em 1.5em .5em .5em; background: linear-gradient(90deg, transparent 0 40%, rgba(255, 255, 255, .35) 40% 55%, transparent 55%), var(--hc); }
.bpm-av .hat.beanie { left: 1.3em; top: -.8em; width: 3.4em; height: 1.75em; border-radius: 1.4em 1.4em .3em .3em; background: linear-gradient(0deg, rgba(0, 0, 0, .22) 0 .5em, transparent .5em), var(--hc); }
.bpm-av .hat.beanie::before { content: ''; position: absolute; left: 1.2em; top: -.6em; width: 1em; height: 1em; border-radius: 50%; background: #fff; box-shadow: 0 0 0 .15em var(--ia); }
.bpm-av .hat.bucket { left: 1.5em; top: -.6em; width: 3em; height: 1.4em; border-radius: .9em .9em .15em .15em; }
.bpm-av .hat.bucket::after { content: ''; position: absolute; left: -.65em; right: -.65em; bottom: -.2em; height: .55em; border-radius: .5em; background: var(--hc); filter: brightness(.82); box-shadow: 0 0 0 .15em var(--ia); }
.bpm-av .hat.crown { left: 1.45em; top: -1em; width: 3.1em; height: 1.45em; box-shadow: none; clip-path: polygon(0 100%, 0 18%, 20% 55%, 35% 0, 50% 50%, 65% 0, 80% 55%, 100% 18%, 100% 100%); background: radial-gradient(circle at 50% 72%, #e5383b .26em, transparent .3em), linear-gradient(180deg, #ffe36b, #ffb800); }
.bpm-av .acc { background: transparent; z-index: 6; }
.bpm-av .acc.goggles { left: 1.15em; top: .8em; width: 3.7em; height: 1.1em; background: radial-gradient(circle at 25% 50%, #aef0ff .38em, #17313c .4em .62em, transparent .64em), radial-gradient(circle at 75% 50%, #aef0ff .38em, #17313c .4em .62em, transparent .64em), linear-gradient(#17313c, #17313c) 0 50% / 100% .2em no-repeat; }
.bpm-av .acc.snorkel { right: .55em; top: -.1em; width: .5em; height: 3.1em; background: #ffcf33; border-radius: .25em; box-shadow: 0 0 0 .13em var(--ia); }
.bpm-av .acc.snorkel::after { content: ''; position: absolute; left: -.85em; bottom: -.05em; width: 1.2em; height: .55em; background: #ff7a3d; border-radius: .25em; box-shadow: 0 0 0 .13em var(--ia); }
.bpm-av .acc.floaties { left: -.2em; top: 3.5em; width: 6.4em; height: 1.1em; z-index: 4; }
.bpm-av .acc.floaties::before, .bpm-av .acc.floaties::after { content: ''; position: absolute; top: 0; width: 1.55em; height: 1.1em; border-radius: .55em; background: repeating-linear-gradient(90deg, #ff8a1f 0 .4em, #fff .4em .8em); box-shadow: 0 0 0 .13em var(--ia); }
.bpm-av .acc.floaties::before { left: 0; } .bpm-av .acc.floaties::after { right: 0; }
.bpm-av .acc.backpack { left: .95em; top: 2.55em; width: 4.1em; height: 3.9em; z-index: 1; background: #d9652b; border-radius: .9em; box-shadow: 0 0 0 .15em var(--ia); }
.bpm-av .acc.straps { left: 1.9em; top: 3.15em; width: 2.2em; height: 2.6em; z-index: 3; background: linear-gradient(90deg, #a8431a 0 .42em, transparent .42em calc(100% - .42em), #a8431a calc(100% - .42em)); }
.bpm-av .acc.scarf { left: 1.2em; top: 2.85em; width: 3.6em; height: .85em; z-index: 4; background: var(--hc2, #e5383b); border-radius: .4em; box-shadow: 0 0 0 .13em var(--ia); }
.bpm-av .acc.scarf::after { content: ''; position: absolute; left: 2.35em; top: .55em; width: .85em; height: 1.9em; background: var(--hc2, #e5383b); border-radius: .3em; box-shadow: 0 0 0 .13em var(--ia); }
.bpm-av .acc.ring { left: .85em; top: 3.3em; width: 4.3em; height: 2.7em; z-index: 4; border-radius: 1.4em; background: repeating-linear-gradient(90deg, #e5383b 0 .7em, #fff .7em 1.4em); box-shadow: 0 0 0 .13em var(--ia); -webkit-mask: radial-gradient(ellipse 1.35em .55em at 50% 50%, transparent 97%, #000 100%); mask: radial-gradient(ellipse 1.35em .55em at 50% 50%, transparent 97%, #000 100%); }
.bpm-av .acc.headphones { left: 1.2em; top: -.45em; width: 3.6em; height: 2.4em; z-index: 6; border: .32em solid #2b2f3a; border-bottom: 0; border-radius: 1.8em 1.8em 0 0; }
.bpm-av .acc.headphones::before, .bpm-av .acc.headphones::after { content: ''; position: absolute; top: 1.05em; width: .85em; height: 1.35em; background: #2b2f3a; border-radius: .3em; box-shadow: 0 0 0 .1em var(--ia); }
.bpm-av .acc.headphones::before { left: -.55em; } .bpm-av .acc.headphones::after { right: -.55em; }

/* ------------------------------------------------------------------------------------------------------------
   HUD: блоки HudLayout (data-hl), размеры внутри — em от масштаба --hl-k
   ------------------------------------------------------------------------------------------------------------ */
#bpm-hud { z-index: 20; }
#bpm-hud:not(.on) #bpm-swim, #bpm-hud:not(.on) #bpm-dir { display: none !important; }
#bpm-top { z-index: 80; }
.bpm-stars .bpm-ico.dim { filter: grayscale(1) brightness(.8); opacity: .55; }
.bpm-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; padding: 8px 12px; border-top: 4px solid #bfe6e1; background: rgba(255, 255, 255, .78); pointer-events: auto; }
.bpm-foot .bpm-btn.big { min-height: 52px; font-size: 20px; padding: .5em 1.4em; }
.bpm-hudb { pointer-events: none; font-size: calc(14px * var(--hl-k, 1)); }
.bpm-hudb[data-hl] { overflow: visible; }
#bpm-level { display: none; flex-direction: column; justify-content: center; gap: .35em; padding: .35em .8em .55em; }
#bpm-hud.has-level #bpm-level { display: flex; }
#bpm-level .r1 { display: flex; align-items: center; gap: .55em; min-width: 0; }
#bpm-level .n { flex: none; min-width: 1.9em; padding: .12em .5em; border-radius: 99px; text-align: center; font-size: .95em; font-weight: 900; color: #5a3300; background: linear-gradient(180deg, #ffe36b, #ffb800); text-shadow: none; box-shadow: inset 0 0 0 .13em #fff3b8; }
#bpm-level .nm { min-width: 0; flex: 1; font-size: .82em; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#bpm-hud.no-lvl-n #bpm-level .n { display: none; }
#bpm-hud.no-lvl-n #bpm-progress, #bpm-hud.no-lvl-n #bpm-level .r2 { display: none; }
#bpm-level .r2 { display: flex; align-items: center; gap: .6em; }
#bpm-level .r2 .bpm-bar { flex: 1; }
#bpm-level .st { flex: none; font-size: .72em; font-weight: 900; color: #ffe36b; }
.bpm-bar { position: relative; height: .85em; border-radius: 99px; background: rgba(0, 25, 35, .45); box-shadow: inset 0 0 0 .1em rgba(255, 255, 255, .5); }
.bpm-bar > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: linear-gradient(180deg, #8bfbf0, #20bfb6); transition: width .25s ease-out; }
.bpm-bar > i::after { content: ''; position: absolute; right: -.1em; top: 50%; width: 1.1em; height: 1.1em; margin-top: -.55em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #ffd23f 70%); box-shadow: 0 0 0 .14em var(--bpm-ink), 0 0 .5em rgba(255, 220, 90, .8); }
.bpm-bar > b { position: absolute; inset: 0; pointer-events: none; }
.bpm-bar > b u { position: absolute; top: -.12em; bottom: -.12em; width: .16em; margin-left: -.08em; border-radius: 2px; background: rgba(255, 255, 255, .9); }
.bpm-bar > b u.done { background: #ffd23f; }
#bpm-coins { display: none; align-items: center; gap: .45em; padding: .3em .7em .3em .4em; font-size: calc(15px * var(--hl-k, 1)); font-weight: 800; white-space: nowrap; }
#bpm-hud.on #bpm-coins { display: flex; }
#bpm-coins .bpm-ico { width: 1.7em; height: 1.7em; }
#bpm-coins .v { min-width: 0; flex: 1; text-align: right; }
#bpm-run { display: none; align-items: center; justify-content: center; font-size: calc(14px * var(--hl-k, 1)); font-weight: 900; color: #5a3300; text-shadow: none; background: linear-gradient(180deg, #ffe36b, #ffb800); box-shadow: inset 0 0 0 .15em #fff3b8, 0 .22em 0 #bf7600; }
#bpm-hud.on #bpm-run.on { display: flex; animation: bpm-bump .35s ease-out; }
#bpm-coins.bump { animation: bpm-bump .35s ease-out; }
.bpm-pausebtn {
    display: none; place-items: center; padding: 0; border: 0; border-radius: 50%; overflow: hidden; min-width: 44px; min-height: 44px; pointer-events: auto;
    background: linear-gradient(180deg, #5de3dc, #14a5ac); box-shadow: 0 .25em 0 #0b7077, 0 .45em .6em rgba(0, 40, 50, .35), inset 0 0 0 .14em rgba(255, 255, 255, .4);
}
.bpm-pausebtn .bpm-ico { width: 52%; height: 52%; }
.bpm-pausebtn:active { transform: translateY(.15em); }
#bpm-hud.on .bpm-pausebtn { display: grid; }
#bpm-threat { display: none; align-items: center; gap: .55em; padding: .3em .85em .3em .5em; font-size: calc(15px * var(--hl-k, 1)); font-weight: 800; white-space: nowrap; transition: background .2s; }
#bpm-hud.has-threat #bpm-threat { display: flex; }
#bpm-threat .ic { flex: none; width: 2.1em; height: 2.1em; }
#bpm-threat .ic .bpm-ico { width: 100%; height: 100%; }
#bpm-threat .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#bpm-threat .eta { font-size: 1.15em; font-weight: 900; color: #ffe36b; min-width: 1.6em; text-align: right; }
#bpm-threat .eta:empty { display: none; }
#bpm-threat[data-state="calm"] { background-color: rgba(8, 100, 100, .82); }
#bpm-threat[data-state="listening"] { background-color: rgba(176, 116, 8, .9); }
#bpm-threat[data-state="rushing"] { background-color: rgba(190, 36, 44, .93); animation: bpm-alarm .7s ease-in-out infinite; }
#bpm-threat[data-state="near"] { background-color: rgba(120, 12, 28, .96); animation: bpm-alarm .38s ease-in-out infinite, bpm-jitter .3s linear infinite; }
#bpm-dir { position: fixed; left: 50%; top: 46%; width: 0; height: 0; z-index: 21; display: none; pointer-events: none; }
#bpm-hud.dir #bpm-dir { display: block; }
#bpm-dir .a { position: absolute; left: 0; top: 0; width: var(--da, 56px); height: var(--da, 56px); margin: calc(var(--da, 56px) / -2); transform: rotate(var(--ang, 0deg)) translateY(calc(-1 * var(--dr, 120px))); filter: drop-shadow(0 3px 0 rgba(0, 30, 40, .55)); animation: bpm-nudge .5s ease-in-out infinite alternate; }
#bpm-dir .a .bpm-ico { width: 100%; height: 100%; }
#bpm-swim { display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .3em; }
#bpm-swim.on { display: flex; animation: bpm-bob 1.2s ease-in-out infinite alternate; }
#bpm-swim .t { font-size: 1.9em; font-weight: 900; line-height: 1; }
#bpm-swim .s { padding: .3em .9em; border-radius: 99px; font-size: .78em; font-weight: 800; color: #fff; background: rgba(8, 82, 94, .88); box-shadow: inset 0 0 0 .14em rgba(255, 255, 255, .8); text-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
#bpm-swim.can .s { background: rgba(34, 160, 80, .93); }
#bpm-hotbar { display: none; align-items: flex-end; justify-content: center; gap: .5em; font-size: calc(16px * var(--hl-k, 1)); }
#bpm-hud.on.has-hotbar #bpm-hotbar { display: flex; }   /* слоты — только в забеге и лобби, не под меню */
.bpm-slot {
    position: relative; flex: none; width: 3.5em; height: 3.5em; padding: 0; border: .2em solid var(--bpm-water); border-radius: .95em; overflow: hidden; pointer-events: auto;
    background-color: var(--bpm-cream2); background-image: var(--bpm-tile); background-size: auto, 1.2em 1.2em, 1.2em 1.2em;
    box-shadow: 0 .25em 0 var(--bpm-water-d), 0 .45em .7em rgba(0, 30, 40, .35); transition: transform .08s;
}
.bpm-slot:active { transform: translateY(.15em); }
.bpm-slot .ic { position: absolute; inset: 11% 11% 17%; }
.bpm-slot .ic .bpm-ico, .bpm-pushbtn .ic .bpm-ico { width: 100%; height: 100%; }
.bpm-slot .n { position: absolute; right: .3em; bottom: .25em; min-width: 1.35em; padding: .02em .28em; border-radius: 99px; font-size: .68em; font-weight: 900; line-height: 1.35; color: #5a3300; background: linear-gradient(180deg, #ffe36b, #ffb800); box-shadow: 0 0 0 .13em var(--bpm-ink); text-align: center; }
.bpm-slot .k { position: absolute; left: .22em; top: .12em; font-size: .6em; font-weight: 900; color: var(--bpm-deep); opacity: .75; display: none; }
html:not(.hl-touch) .bpm-slot .k { display: block; }
.bpm-slot .cd { position: absolute; inset: 0; background: conic-gradient(from 0deg, rgba(5, 40, 50, .7) calc(var(--cd, 0) * 360deg), transparent 0); pointer-events: none; }
.bpm-slot.empty { background: rgba(255, 255, 255, .35); border-style: dashed; border-color: rgba(255, 255, 255, .8); box-shadow: none; pointer-events: none; }
.bpm-slot.empty .ic, .bpm-slot.empty .n { display: none; }
.bpm-slot.zero .ic { filter: grayscale(1); opacity: .5; }
.bpm-slot.zero .n { background: #ff6a68; color: #fff; }
.bpm-slot.active { border-color: var(--bpm-gold); box-shadow: 0 0 0 .2em rgba(255, 201, 40, .55), 0 .25em 0 #bf7600, 0 0 1em rgba(255, 201, 40, .8); animation: bpm-glow .8s ease-in-out infinite alternate; }
.bpm-pushbtn {
    --rim: #ff8a4d; --rim-d: #c2561b;
    position: relative; flex: none; width: 3.5em; height: 3.5em; margin-left: .3em; padding: 0; border: .2em solid var(--rim); border-radius: .95em; overflow: hidden; pointer-events: auto;
    background-color: #fff3e2; background-image: var(--bpm-tile); background-size: auto, 1.2em 1.2em, 1.2em 1.2em;
    box-shadow: 0 .25em 0 var(--rim-d), 0 .45em .7em rgba(0, 30, 40, .35), 0 0 .9em rgba(255, 138, 77, .6); transition: transform .08s;
}
#bpm-push[hidden] { display: none; }
.bpm-pushbtn .ic { position: absolute; inset: 11% 11% 17%; }
.bpm-pushbtn .n { position: absolute; right: .3em; bottom: .25em; min-width: 1.35em; padding: .02em .28em; border-radius: 99px; font-size: .68em; font-weight: 900; line-height: 1.35; color: #5a3300; background: linear-gradient(180deg, #ffe36b, #ffb800); box-shadow: 0 0 0 .13em var(--bpm-ink); text-align: center; }
.bpm-pushbtn .k { position: absolute; left: .22em; top: .12em; font-size: .6em; font-weight: 900; color: #a8480d; opacity: .85; display: none; }
html:not(.hl-touch) .bpm-pushbtn .k { display: block; }
.bpm-pushbtn .cd { position: absolute; inset: 0; background: conic-gradient(from 0deg, rgba(5, 40, 50, .7) calc(var(--cd, 0) * 360deg), transparent 0); pointer-events: none; }
.bpm-pushbtn:active { transform: translateY(.15em); }
#bpm-prompt { min-height: 44px; display: none; align-items: center; justify-content: center; padding: .35em 1.1em; border: 0; border-radius: 999px; font-size: calc(15px * var(--hl-k, 1)); font-weight: 800; text-align: center; color: var(--bpm-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: auto; background: linear-gradient(180deg, #fffdf2, #f1e8c8); box-shadow: inset 0 0 0 .16em #fff, 0 .22em 0 #a99a68, 0 .5em .8em rgba(0, 30, 40, .3); }
#bpm-prompt.on { display: flex; animation: bpm-fade .15s ease-out; }
#bpm-chat { display: none; flex-direction: column; justify-content: flex-end; gap: .2em; overflow: hidden; font-size: calc(12px * var(--hl-k, 1)); font-weight: 700; }
#bpm-hud.on #bpm-chat:not(:empty) { display: flex; }
html.hl-low #bpm-chat { display: none !important; }
@media (max-width: 759px) { #bpm-chat { display: none !important; } }   /* телефон: чат достал бы до персонажа в центре */
#bpm-chat { max-width: 30vw; }
#bpm-win { z-index: 70; }   /* окна (рекорды из паузы и результата) — над плашками */
#bpm-capture { position: fixed; left: 50%; top: 62%; transform: translateX(-50%); z-index: 40; display: none; pointer-events: none; padding: .55em 1.1em; border-radius: 1em; background: rgba(5, 50, 62, .82); color: #fff; font-weight: 800; font-size: 15px; text-align: center; box-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
#bpm-capture.on { display: block; }
.bpm-credits { margin: .9em 0 0; font-size: 10px; font-weight: 600; color: #5b7480; text-align: center; }
#bpm-chat .row { padding: .22em .65em; border-radius: .8em; background: rgba(5, 50, 62, .55); color: #fff; text-shadow: 0 1px 2px #000; line-height: 1.25; animation: bpm-chatin .2s ease-out, bpm-chatout .7s ease-in 7s forwards; overflow-wrap: anywhere; }
#bpm-chat .row b { margin-right: .4em; font-weight: 900; }
#bpm-chat .row.sys { color: #bfe9f1; font-style: normal; background: rgba(5, 50, 62, .4); }
#bpm-toast { display: none; align-items: center; justify-content: center; padding: .3em 1em; text-align: center; font-size: calc(15px * var(--hl-k, 1)); font-weight: 800; }
#bpm-toast.on { display: flex; animation: bpm-toastin .22s ease-out; }
#bpm-toast span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ------------------------------------------------------------------------------------------------------------
   Главное меню
   ------------------------------------------------------------------------------------------------------------ */
#bpm-menu { z-index: 30; display: none; pointer-events: none; overflow: hidden; }
#bpm-menu.on { display: block; }
body.bpm-win-open #bpm-menu { display: none; }
.bpm-menu-bg {
    position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse at 50% 38%, rgba(255, 255, 255, 0) 30%, rgba(6, 70, 84, .55) 100%), linear-gradient(180deg, rgba(6, 70, 84, .35), rgba(6, 70, 84, 0) 30%, rgba(6, 70, 84, 0) 62%, rgba(6, 70, 84, .6));
}
.bpm-bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bpm-bubbles i { position: absolute; bottom: -40px; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff, rgba(255, 255, 255, .2) 60%, rgba(255, 255, 255, .5)); animation: bpm-rise 9s linear infinite; opacity: 0; }
.bpm-menu-top { position: absolute; left: calc(var(--bpm-sa-l) + 10px); right: calc(var(--bpm-sa-r) + 10px); top: calc(var(--bpm-sa-t) + 10px); display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.bpm-menu-top > * { pointer-events: auto; }
.bpm-menu-l { display: flex; gap: 8px; }
.bpm-howto-r { display: none !important; }
.bpm-menu-in {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 2.2vh, 22px); overflow-y: auto;
    padding: calc(var(--bpm-sa-t) + 64px) calc(var(--bpm-sa-r) + 14px) calc(var(--bpm-sa-b) + 14px) calc(var(--bpm-sa-l) + 14px); pointer-events: none;
}
.bpm-menu-in > * { pointer-events: none; }
.bpm-menu-in button { pointer-events: auto; }
.bpm-logo { text-align: center; transform: rotate(-2deg); animation: bpm-float 4.5s ease-in-out infinite; }
.bpm-logo .l1 { font-size: clamp(18px, 5.4vmin, 40px); font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.bpm-logo .l2 { font-size: clamp(34px, 12.5vmin, 92px); font-weight: 900; line-height: 1; letter-spacing: -.01em; text-transform: uppercase; color: #ffe36b; margin-top: .05em; }
.bpm-logo .wave { display: block; height: 14px; margin: .5em auto 0; width: 80%; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='36' height='14' viewBox='0 0 36 14'><path d='M0 7Q9 0 18 7T36 7' fill='none' stroke='%230b3d47' stroke-width='7' stroke-linecap='round'/><path d='M0 7Q9 0 18 7T36 7' fill='none' stroke='%237fe3dc' stroke-width='3.5' stroke-linecap='round'/></svg>") 0 0 / 36px 14px repeat-x; animation: bpm-wavex 2.4s linear infinite; }
.bpm-tag { margin: 0; max-width: 30em; text-align: center; font-size: clamp(11px, 2.4vmin, 15px); font-weight: 800; }
.bpm-menu-btns { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(420px, 100%); }
.bpm-menu-btns .bpm-btn { width: 100%; }
.bpm-quick { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; width: min(560px, 100%); }
.bpm-quick > * { grid-column: span 2; }
.bpm-qbtn {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .3em; min-height: 64px; padding: .5em .2em .45em; border: 0; border-radius: 18px; font-size: 10px; font-weight: 800; color: var(--bpm-ink); min-width: 0;
    background: linear-gradient(180deg, #ffffff, #f4ecd0); box-shadow: inset 0 0 0 3px #bfe6e1, 0 5px 0 #8dbfb8, 0 8px 10px rgba(0, 40, 50, .3); pointer-events: auto; transition: transform .08s;
}
.bpm-qbtn .bpm-ico { width: 2.6em; height: 2.6em; }
.bpm-qbtn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bpm-qbtn:active { transform: translateY(3px); box-shadow: inset 0 0 0 3px #bfe6e1, 0 2px 0 #8dbfb8; }
.bpm-qbtn:hover { filter: brightness(1.04); }

/* ------------------------------------------------------------------------------------------------------------
   Экраны: «схватили», результат, пауза, скример
   ------------------------------------------------------------------------------------------------------------ */
.bpm-screen { display: none; align-items: center; justify-content: center; padding: calc(var(--bpm-sa-t) + 10px) calc(var(--bpm-sa-r) + 12px) calc(var(--bpm-sa-b) + 10px) calc(var(--bpm-sa-l) + 12px); pointer-events: auto; overflow-y: auto; }
.bpm-screen.on { display: flex; }
#bpm-down { z-index: 50; background: radial-gradient(ellipse at 50% 50%, rgba(120, 10, 30, .35), rgba(60, 0, 20, .86) 85%); }
#bpm-down.on { animation: bpm-fade .2s ease-out; }
#bpm-result { z-index: 52; background: radial-gradient(ellipse at 50% 45%, rgba(40, 190, 190, .5), rgba(5, 52, 66, .9) 85%); }
#bpm-pause { z-index: 60; background: radial-gradient(ellipse at 50% 45%, rgba(23, 154, 160, .45), rgba(5, 52, 66, .88) 85%); }
.bpm-dialog {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(460px, 100%); max-height: 100%; padding: 18px 16px 16px; text-align: center; margin: auto;
    border-radius: 26px; border: 5px solid #fffdf2; background-color: var(--bpm-cream); background-image: var(--bpm-tile); box-shadow: 0 0 0 4px var(--bpm-water), 0 9px 0 4px var(--bpm-water-d), 0 26px 44px rgba(0, 25, 35, .55);
    animation: bpm-pop .24s cubic-bezier(.2, 1.35, .4, 1);
}
.bpm-dialog.danger { box-shadow: 0 0 0 4px #e5383b, 0 9px 0 4px #8f1319, 0 26px 44px rgba(40, 0, 10, .6); }
.bpm-dialog h1 { margin: 0; font-size: clamp(22px, 6.4vmin, 36px); font-weight: 900; line-height: 1.1; }
.bpm-dialog h1.shake { animation: bpm-jitter .35s linear infinite; }
.bpm-dialog .sub { margin: 0; font-size: 11px; font-weight: 700; color: #3b6a73; }
.bpm-dialog .btns { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.bpm-dialog .btns.row { flex-direction: row; flex-wrap: wrap; }
.bpm-dialog .btns.row > * { flex: 1 1 auto; }
.bpm-dialog .btns.row > .bpm-round { flex: none; }
.bpm-dialog .btns .bpm-btn { white-space: normal; line-height: 1.15; }
.bpm-timer { position: relative; width: 100%; height: 22px; border-radius: 99px; background: rgba(11, 61, 71, .18); box-shadow: inset 0 0 0 3px rgba(11, 61, 71, .35); overflow: hidden; }
.bpm-timer > i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 99px; background: repeating-linear-gradient(60deg, #e5383b 0 12px, #fff 12px 24px); transition: width .12s linear; }
.bpm-timer > i.low { animation: bpm-alarm .35s ease-in-out infinite; }
.bpm-timer > span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 900; color: #fff; -webkit-text-stroke: 3px var(--bpm-ink); paint-order: stroke fill; }
.bpm-stats { display: grid; grid-template-columns: 1fr; gap: 6px; width: 100%; }
.bpm-stat { display: flex; align-items: center; gap: 8px; padding: .4em .8em; border-radius: 14px; background: rgba(255, 255, 255, .75); box-shadow: inset 0 0 0 3px #cde9e4; font-size: 12px; font-weight: 800; }
.bpm-stat .bpm-ico { width: 1.9em; height: 1.9em; }
.bpm-stat span { flex: 1; text-align: left; }
.bpm-stat b { font-size: 1.15em; font-weight: 900; color: var(--bpm-deep); white-space: nowrap; }
.bpm-stat.total { background: linear-gradient(180deg, #fff3b8, #ffd86a); box-shadow: inset 0 0 0 3px #f2c64a; font-size: 14px; }
.bpm-stat.total b { font-size: 1.4em; color: #7a4b00; }
.bpm-stat.total.x2 b { animation: bpm-bump .5s ease-out; color: #d13b00; }
.bpm-stars { display: flex; gap: 6px; justify-content: center; }
.bpm-stars .bpm-ico { width: 44px; height: 44px; animation: bpm-starin .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.bpm-stars .bpm-ico:nth-child(2) { animation-delay: .12s; width: 56px; height: 56px; margin-top: -8px; }
.bpm-stars .bpm-ico:nth-child(3) { animation-delay: .24s; }
#bpm-scare { z-index: 70; display: none; pointer-events: none; }
#bpm-scare.on { display: block; animation: bpm-scare .85s ease-out both; background: radial-gradient(ellipse at 50% 50%, rgba(255, 40, 40, .15) 10%, rgba(120, 0, 0, .55) 60%, rgba(30, 0, 0, .95) 100%); }
#bpm-scare .flash { position: absolute; inset: 0; background: #ff2a2a; animation: bpm-flash .85s ease-out both; }
#bpm-scare .eye { position: absolute; left: 50%; top: 50%; width: min(70vmin, 520px); height: min(70vmin, 520px); margin: calc(min(70vmin, 520px) / -2) 0 0 calc(min(70vmin, 520px) / -2); animation: bpm-lunge .85s cubic-bezier(.1, .8, .2, 1) both; }
#bpm-scare .eye .bpm-ico { width: 100%; height: 100%; }
body.bpm-shake #world3d, body.bpm-shake #bpm-hud { animation: bpm-shake .5s linear; }

/* ------------------------------------------------------------------------------------------------------------
   Адаптивность
   ------------------------------------------------------------------------------------------------------------ */
@media (min-width: 640px) {
    .bpm-btn { font-size: 14px; } .bpm-btn.small { font-size: 12px; }
    .bpm-card h3 { font-size: 14px; } .bpm-card p { font-size: 11px; }
    .bpm-title { font-size: 24px; }
    .bpm-body { padding: 16px; } .bpm-tabs { padding: 12px 16px 4px; }
    .bpm-skin-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
    .bpm-qbtn { font-size: 11px; min-height: 76px; }
    .bpm-lv span { font-size: 8.5px; letter-spacing: -.03em; }
    .bpm-create-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
    .bpm-stats { grid-template-columns: 1fr 1fr; } .bpm-stat.total, .bpm-stat.wide { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
    .bpm-skins { grid-template-columns: 260px minmax(0, 1fr); }
    .bpm-skin-pane { position: sticky; top: 0; flex-direction: column; margin: 0; border-radius: 20px; border: 4px solid var(--bpm-water); text-align: center; }
    .bpm-skin-pane .stage { width: 150px; height: 190px; --av: 16px; }
    .bpm-skin-pane .info { align-items: center; }
    .bpm-skin-pane .row { justify-content: center; }
}
/* низкий альбомный экран: 640×360, 568×320 */
@media (max-height: 460px) and (orientation: landscape) {
    #bpm-win { padding-top: calc(var(--bpm-sa-t) + 4px); padding-bottom: calc(var(--bpm-sa-b) + 4px); }
    .bpm-panel { border-radius: 20px; border-width: 4px; }
    .bpm-head { padding: 4px 8px 4px 12px; }
    .bpm-title { font-size: 16px; }
    .bpm-body { padding: 8px 10px; } .bpm-body > * + * { margin-top: 8px; }
    .bpm-tabs { padding: 6px 10px 2px; }
    .bpm-card { padding: 8px; gap: 6px; } .bpm-card-ico { width: 44px; height: 44px; }
    .bpm-lslot { min-height: 56px; }
    .bpm-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
    .bpm-skins { grid-template-columns: 210px minmax(0, 1fr); gap: 10px; }
    .bpm-skin-pane { position: sticky; top: 0; flex-direction: column; margin: 0; padding: 8px; border-radius: 16px; border: 4px solid var(--bpm-water); text-align: center; gap: 6px; }
    .bpm-skin-pane .stage { width: 100px; height: 112px; --av: 9px; }
    .bpm-skin-pane h3 { font-size: 12px; }
    .bpm-skin-pane .info { align-items: center; gap: 4px; }
    .bpm-skin-pane .row { justify-content: center; }
    .bpm-skin-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
    .bpm-create-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px; }
    .bpm-levels { gap: 6px; }
    .bpm-steppers { grid-template-columns: 1fr; gap: 6px; }
    .bpm-steppers .bpm-note { display: none; }
    .bpm-steppers .bpm-box { display: flex; align-items: center; gap: 8px; padding: 5px 10px; }
    .bpm-steppers .bpm-h2 { flex: 1; margin: 0; font-size: 10px; min-width: 0; }
    .bpm-steppers .bpm-step { flex: none; gap: 6px; }
    .bpm-steppers .bpm-step .val { min-width: 1.5em; font-size: 20px; }
    .bpm-steppers .bpm-step .val small { display: none; }
    .bpm-steppers .bpm-step .bpm-round { width: 44px; height: 44px; }
    .bpm-lv { min-height: 54px; } .bpm-lv b { font-size: 17px; }
    .bpm-step .val { font-size: 22px; }
    .bpm-dialog { padding: 12px 14px 12px; gap: 8px; }
    .bpm-dialog h1 { font-size: clamp(18px, 6vh, 26px); }
    .bpm-btn.big { min-height: 52px; font-size: 20px; }
    .bpm-stats { grid-template-columns: 1fr 1fr; gap: 4px; }
    .bpm-stat { padding: .25em .6em; }
    .bpm-stars .bpm-ico { width: 32px; height: 32px; } .bpm-stars .bpm-ico:nth-child(2) { width: 40px; height: 40px; }
    #bpm-swim .t { font-size: 1.5em; }
}
@media (max-height: 460px) and (orientation: landscape) {
    .bpm-menu-in { flex-direction: row; justify-content: center; gap: clamp(14px, 4vw, 44px); padding-top: calc(var(--bpm-sa-t) + 52px); padding-bottom: calc(var(--bpm-sa-b) + 8px); }
    .bpm-menu-in > .bpm-logo { flex: 1 1 0; min-width: 0; max-width: 44%; }
    .bpm-menu-in > .bpm-menu-btns { flex: 1 1 0; min-width: 0; max-width: 380px; gap: 8px; }
    .bpm-menu-in > .bpm-tag { display: none; }
    .bpm-quick { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
    .bpm-quick > * { grid-column: span 2; }
    .bpm-quick > :nth-child(4) { grid-column: 2 / span 2; }
    .bpm-qbtn { min-height: 52px; font-size: 9px; padding-top: .35em; } .bpm-qbtn .bpm-ico { width: 2.5em; height: 2.5em; }
    .bpm-btn.big { min-height: 50px; }
    .bpm-howto-w { display: none !important; }
    .bpm-howto-r { display: grid !important; }
    .bpm-logo .l1 { font-size: 16px; } .bpm-logo .l2 { font-size: clamp(30px, 11vh, 52px); }
    .bpm-menu-top .bpm-round { width: 44px; height: 44px; }
}
@media (max-width: 459px) {
    .bpm-title { font-size: 15px; gap: 6px; }
    .bpm-title .bpm-ico { width: 1.5em; height: 1.5em; }
    .bpm-head { gap: 6px; padding-left: 10px; }
    .bpm-head .bpm-coinpill { font-size: 12px; }
    .bpm-quick { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .bpm-quick > :nth-child(4) { grid-column: 2 / span 2; }
    .bpm-loadout { grid-template-columns: 1fr; gap: 6px; }
    .bpm-lslot { min-height: 54px; }
    .bpm-levels { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
    .bpm-lv { min-height: 56px; padding: 4px 1px; } .bpm-lv b { font-size: 17px; } .bpm-lv span { display: none; }
    .bpm-steppers { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
    .bpm-btn.big { font-size: 21px; }
    .bpm-title { font-size: 14px; }
    .bpm-title .bpm-ico { display: none; }
    .bpm-head .bpm-coinpill { font-size: 11px; padding-right: .6em; }
}

/* ------------------------------------------------------------------------------------------------------------
   Меню: 8 быстрых кнопок (4 в ряд, последний ряд по центру), красные точки подарка и колеса
   ------------------------------------------------------------------------------------------------------------ */
.bpm-quick { --qg: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--qg); }
.bpm-quick > * { grid-column: auto; flex: 0 0 calc((100% - 3 * var(--qg)) / 4); }
.bpm-quick > [hidden] { display: none; }
.bpm-qbtn .bdg {
    position: absolute; right: 5px; top: 5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; font-size: 11px; font-weight: 900; line-height: 20px; text-align: center; color: #fff;
    background: linear-gradient(180deg, #ff6a68, #d3262b); box-shadow: 0 0 0 2px #fff, 0 2px 4px rgba(0, 30, 40, .4); animation: bpm-bump 1.4s ease-in-out infinite; pointer-events: none;
}
.bpm-qbtn .bdg.t { background: #4f8a93; font-size: 9px; animation: none; padding: 0 4px; }
.bpm-qbtn.hot { box-shadow: inset 0 0 0 3px #ffd86a, 0 5px 0 #c99a2c, 0 8px 10px rgba(0, 40, 50, .3); background: linear-gradient(180deg, #fffdf0, #fff0c4); }

/* ------------------------------------------------------------------------------------------------------------
   Вкладки со значками (косметика) и картинки следов / побед
   ------------------------------------------------------------------------------------------------------------ */
.bpm-tab { display: inline-flex; align-items: center; gap: .45em; }
.bpm-tab .bpm-ico { width: 1.8em; height: 1.8em; }
.bpm-glyph { display: block; width: 100%; height: 100%; overflow: visible; }
.bpm-glyph .a { fill: var(--c2, #fff); }
.bpm-glyph .s { stroke: var(--c2, #fff); }
.bpm-ico .a { fill: #fff; fill-opacity: .85; }
.bpm-ico .s { stroke: rgba(255, 255, 255, .9); }
.bpm-fx { position: relative; width: 100%; height: 100%; min-height: 60px; overflow: hidden; color: var(--c1, #fff); pointer-events: none; }
.bpm-fx i { position: absolute; display: block; width: 22%; max-width: 24px; aspect-ratio: 1; opacity: 0; filter: drop-shadow(0 1px 0 rgba(11, 61, 71, .5)); }
.bpm-fx.trail i { left: calc(76% - var(--i) * 12%); bottom: 16%; animation: bpm-fxtrail 1.8s linear infinite; animation-delay: calc(var(--i) * -.3s); }
.bpm-fx.win i { left: 50%; top: 58%; --fa: calc(var(--i) * 60deg); animation: bpm-fxburst 1.8s ease-out infinite; animation-delay: calc(var(--i) * -.3s); }
.bpm-fx.rb { animation: bpm-hue 3s linear infinite; }
@keyframes bpm-fxtrail { 0% { opacity: 0; transform: translate(0, 0) scale(.5) rotate(0); } 18% { opacity: 1; } 100% { opacity: 0; transform: translate(-28px, -38px) scale(1.1) rotate(90deg); } }
@keyframes bpm-fxburst { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--fa)) translateY(0) scale(.4); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--fa)) translateY(-34px) scale(1.15); } }
@keyframes bpm-hue { to { filter: hue-rotate(360deg); } }

/* ------------------------------------------------------------------------------------------------------------
   Карточки косметики: редкость — рамка, у редких и выше — свечение и блеск; мифические — переливающаяся рамка
   ------------------------------------------------------------------------------------------------------------ */
@property --bpm-ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.bpm-skin .art { position: relative; display: grid; place-items: end center; width: 100%; height: 74px; padding-top: 8px; }
.bpm-skin .art .bpm-av { margin-bottom: 2px; }
.bpm-skin .art.z-trail, .bpm-skin .art.z-victory { place-items: stretch; padding-top: 0; }
.bpm-skin .art.z-hair, .bpm-skin .art.z-hat { place-items: start center; height: 82px; padding-top: 18px; overflow: hidden; border-radius: 10px; }
.bpm-skin .art.z-acc { height: 88px; }
.bpm-skin.closed .art { opacity: .92; }
.bpm-skin.on { background: linear-gradient(180deg, #f1fff4, #d5f6de); }
.bpm-skin.rare { animation: bpm-glow-rare 2.8s ease-in-out infinite; }
.bpm-skin.epic { --rc: #a36bf2; animation: bpm-glow-epic 2.2s ease-in-out infinite; }
.bpm-skin.epic::after { content: ''; position: absolute; inset: 0; border-radius: 13px; pointer-events: none; background: linear-gradient(110deg, transparent 40%, rgba(214, 190, 255, .75) 50%, transparent 60%) 0 0 / 260% 100%; animation: bpm-shimmer 3.6s linear infinite; }
.bpm-skin.legendary { animation: bpm-glow-leg 2s ease-in-out infinite; }
.bpm-skin.mythic {
    --rc: #e05cc9; border-color: transparent; animation: bpm-glow-myth 2.4s ease-in-out infinite;
    background: linear-gradient(180deg, #fffefb, #ffeefc) padding-box, conic-gradient(from var(--bpm-ang), #ff5f9e, #ffd23f, #46f0b0, #4fb4ff, #b26bff, #ff5f9e) border-box;
}
.bpm-skin.mythic::before { content: ''; position: absolute; inset: 0; border-radius: 13px; pointer-events: none; background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .9) 0 2px, transparent 3px), radial-gradient(circle at 80% 65%, rgba(255, 255, 255, .9) 0 2px, transparent 3px), radial-gradient(circle at 55% 12%, rgba(255, 220, 255, .9) 0 1.5px, transparent 2.5px); animation: bpm-twinkle 1.6s ease-in-out infinite alternate; }
.bpm-skin.mythic::after { content: ''; position: absolute; inset: 0; border-radius: 13px; pointer-events: none; background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, .85) 50%, transparent 62%) 0 0 / 250% 100%; animation: bpm-shimmer 2.6s linear infinite; }
.bpm-skin.legendary .art, .bpm-skin.epic .art, .bpm-skin.mythic .art { z-index: 1; }
.bpm-rar.mythic { --rc: #c23fb0; background: linear-gradient(90deg, #ff5f9e, #b26bff, #4fb4ff); }
.bpm-skin-pane.rare .stage { box-shadow: inset 0 0 0 3px #7fb8f5, 0 0 14px rgba(90, 168, 240, .55); }
.bpm-skin-pane.epic .stage { box-shadow: inset 0 0 0 3px #b98cf7, 0 0 16px rgba(163, 107, 242, .65); }
.bpm-skin-pane.legendary .stage { box-shadow: inset 0 0 0 3px #ffc94d, 0 0 18px rgba(255, 183, 26, .75); }
.bpm-skin-pane.mythic .stage { box-shadow: inset 0 0 0 3px #f08be0, 0 0 20px rgba(224, 92, 201, .8); animation: bpm-glow-myth 2.4s ease-in-out infinite; }
.bpm-skin-pane .stage { position: relative; overflow: hidden; }
.bpm-skin-pane .stage .bpm-fx { position: absolute; inset: 0; }
.bpm-skin-pane .stage .bpm-av { z-index: 2; }
.bpm-skin-pane .hint { margin: 0; font-size: 10px; font-weight: 600; line-height: 1.3; color: #3b6a73; }
@keyframes bpm-glow-rare { 0%, 100% { box-shadow: 0 4px 0 color-mix(in srgb, var(--rc) 70%, #000), 0 0 0 rgba(90, 168, 240, 0); } 50% { box-shadow: 0 4px 0 color-mix(in srgb, var(--rc) 70%, #000), 0 0 10px rgba(90, 168, 240, .65); } }
@keyframes bpm-glow-epic { 0%, 100% { box-shadow: 0 4px 0 color-mix(in srgb, var(--rc) 70%, #000), 0 0 4px rgba(163, 107, 242, .3); } 50% { box-shadow: 0 4px 0 color-mix(in srgb, var(--rc) 70%, #000), 0 0 14px rgba(163, 107, 242, .85); } }
@keyframes bpm-glow-leg { 0%, 100% { box-shadow: 0 4px 0 color-mix(in srgb, var(--rc) 70%, #000), 0 0 6px rgba(255, 183, 26, .4); } 50% { box-shadow: 0 4px 0 color-mix(in srgb, var(--rc) 70%, #000), 0 0 18px rgba(255, 183, 26, .95); } }
@keyframes bpm-glow-myth { 0% { --bpm-ang: 0deg; box-shadow: 0 4px 0 #a8349a, 0 0 8px rgba(255, 95, 158, .6); } 50% { box-shadow: 0 4px 0 #a8349a, 0 0 20px rgba(79, 180, 255, .85); } 100% { --bpm-ang: 360deg; box-shadow: 0 4px 0 #a8349a, 0 0 8px rgba(255, 95, 158, .6); } }
@keyframes bpm-twinkle { from { opacity: .25; } to { opacity: 1; } }

/* ------------------------------------------------------------------------------------------------------------
   Подарок дня
   ------------------------------------------------------------------------------------------------------------ */
.bpm-days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bpm-day {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 8px 6px 8px; text-align: center; border-radius: 16px;
    border: 3px solid #cde9e4; background: linear-gradient(180deg, #fff, #effbf9); box-shadow: 0 4px 0 #b4d6cf;
}
.bpm-day .dn { font-size: 11px; font-weight: 900; color: var(--bpm-deep); }
.bpm-day .pts { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 66px; justify-content: center; }
.bpm-day .pt { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1px 5px; font-size: 11px; font-weight: 900; color: var(--bpm-deep); max-width: 100%; }
.bpm-day .pt .bpm-ico { width: 30px; height: 30px; }
.bpm-day .pt b { overflow-wrap: break-word; }
.bpm-day .stt { display: flex; align-items: center; justify-content: center; gap: 3px; min-height: 1.6em; font-size: 9px; font-weight: 800; color: #3b6a73; }
.bpm-day .stt .bpm-ico { width: 1.7em; height: 1.7em; }
.bpm-day.claimed { background: linear-gradient(180deg, #e8fbed, #c9f2d4); border-color: #9be3b0; box-shadow: 0 4px 0 #6fc88a; }
.bpm-day.claimed .pts { opacity: .6; }
.bpm-day.today { border-color: var(--bpm-gold); background: linear-gradient(180deg, #fffbe3, #ffe9a0); box-shadow: 0 4px 0 #cc9300, 0 0 0 3px rgba(255, 201, 40, .5); animation: bpm-glow .9s ease-in-out infinite alternate; }
.bpm-day.today .stt { color: #7a4b00; font-size: 10px; }
.bpm-day.locked .pts { opacity: .75; }
.bpm-day.seven { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; border-color: #d3b2ff; background: linear-gradient(180deg, #fcf8ff, #eadcff); box-shadow: 0 4px 0 #b78be8; }
.bpm-day.seven .goal { flex: 1 1 100%; display: flex; align-items: center; gap: 12px; text-align: left; min-width: 0; }
.bpm-day.seven .av { flex: none; display: grid; place-items: center; width: 82px; height: 104px; padding-top: 8px; border-radius: 16px; background: radial-gradient(circle at 50% 80%, #fff, #d9c3ff 70%); box-shadow: inset 0 0 0 3px #c4a3f5, 0 0 14px rgba(163, 107, 242, .5); }
.bpm-day.seven .av .bpm-ico { width: 58px; height: 58px; }
.bpm-day.seven .tx { min-width: 0; flex: 1; }
.bpm-day.seven h3 { margin: 5px 0 3px; font-size: 15px; font-weight: 900; overflow-wrap: anywhere; }
.bpm-day.seven p { margin: 0; font-size: 10px; font-weight: 600; line-height: 1.35; color: #5b4a7a; }
.bpm-day.seven.today { border-color: #a36bf2; box-shadow: 0 4px 0 #7a43c9, 0 0 0 3px rgba(163, 107, 242, .5); }
.bpm-got { display: flex; align-items: center; gap: 8px; padding: .55em .9em; border-radius: 14px; font-size: 12px; font-weight: 800; color: #0e6a2b; background: #cdf6d8; box-shadow: inset 0 0 0 2px #8fdca6; animation: bpm-pop .3s ease-out; }
.bpm-got .bpm-ico { width: 1.9em; height: 1.9em; }
.bpm-got.win { color: #7a4b00; background: #fff0b0; box-shadow: inset 0 0 0 2px #f2c64a; }
.bpm-reward.timer { font-size: 13px; }

/* ------------------------------------------------------------------------------------------------------------
   Колесо фортуны
   ------------------------------------------------------------------------------------------------------------ */
.bpm-wheel-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; justify-items: center; }
.bpm-wheel-box { width: min(100%, 300px); padding-top: 12px; }
.bpm-wheel { position: relative; width: 100%; aspect-ratio: 1; }
.bpm-wheel-disc { position: absolute; inset: 0; will-change: transform; filter: drop-shadow(0 6px 6px rgba(0, 40, 50, .35)); }
.bpm-wheel-disc svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bpm-wheel-disc text { font-family: var(--bpm-font); font-size: 13px; font-weight: 900; fill: #fff; stroke: #0b3d47; stroke-width: 3.5px; paint-order: stroke fill; stroke-linejoin: round; }
.bpm-wheel-disc path.win { stroke: #e5383b; stroke-width: 3.5px; }
.bpm-wheel-ptr { position: absolute; left: 50%; top: -12px; z-index: 3; width: 38px; height: 44px; transform: translateX(-50%); background: #0b3d47; clip-path: polygon(50% 100%, 0 0, 100% 0); filter: drop-shadow(0 3px 2px rgba(0, 30, 40, .4)); }
.bpm-wheel-ptr::after { content: ''; position: absolute; left: 6px; right: 6px; top: 4px; bottom: 10px; background: linear-gradient(180deg, #ff7a78, #d3262b); clip-path: polygon(50% 100%, 0 0, 100% 0); }
.bpm-wheel-side { display: flex; flex-direction: column; gap: 10px; width: 100%; min-width: 0; }
.bpm-wheel-btns { display: grid; gap: 10px; }
.bpm-wheel-btns .hint { text-align: center; }
.bpm-wheel-btns .bpm-btn { white-space: normal; line-height: 1.2; padding-top: .5em; padding-bottom: .5em; }
.bpm-wheel-btns .bpm-btn .lbl { min-width: 0; }
.bpm-wheel-btns .bpm-btn.big { font-size: 20px; min-height: 56px; }
.bpm-prizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 6px; }
.bpm-prize { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 8px; border-radius: 12px; border: 2px solid #cde9e4; background: rgba(255, 255, 255, .78); font-size: 10px; font-weight: 800; }
.bpm-prize .bpm-ico { width: 28px; height: 28px; }
.bpm-prize span { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.bpm-prize small { flex: none; font-size: 9px; opacity: .65; }
.bpm-prize.win { background: #fff3b8; border-color: #f2c64a; }

/* ------------------------------------------------------------------------------------------------------------
   Рекорды
   ------------------------------------------------------------------------------------------------------------ */
.bpm-rec-best { display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; padding: .45em .95em .45em .5em; border-radius: 99px; font-size: 14px; font-weight: 900; color: #7a4b00; background: #ffe9a0; box-shadow: inset 0 0 0 2px #f2c64a; }
.bpm-rec-best .bpm-ico { width: 1.9em; height: 1.9em; }
.bpm-rec-empty { padding: 28px 8px; text-align: center; font-size: 14px; }
.bpm-rec-list { display: grid; gap: 6px; }
.bpm-rec-row { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 56px; padding: 6px 12px 6px 8px; border-radius: 14px; border: 3px solid #cde9e4; background: rgba(255, 255, 255, .82); }
.bpm-rec-row .rk { flex: none; min-width: 2.2em; text-align: center; font-size: 15px; font-weight: 900; color: var(--bpm-deep); }
.bpm-rec-row.top1 .rk { color: #d98f00; } .bpm-rec-row.top2 .rk { color: #6f8189; } .bpm-rec-row.top3 .rk { color: #b5651d; }
.bpm-rec-row .av { flex: none; display: grid; place-items: center; width: 42px; height: 42px; overflow: hidden; border-radius: 50%; font-size: 13px; font-weight: 900; color: #fff; background: linear-gradient(180deg, #8ae8e0, #22bfb8); box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px #0b3d47; }
.bpm-rec-row .av img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bpm-rec-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 800; }
.bpm-rec-row .sc { flex: none; font-size: 15px; font-weight: 900; color: var(--bpm-deep); }
.bpm-rec-row.me { border-color: var(--bpm-gold); background: linear-gradient(180deg, #fffbe3, #ffeaa0); box-shadow: 0 0 0 3px rgba(255, 201, 40, .5); }

/* ------------------------------------------------------------------------------------------------------------
   Адаптивность новых окон
   ------------------------------------------------------------------------------------------------------------ */
@media (min-width: 640px) {
    .bpm-days { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .bpm-wheel-grid { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); justify-items: stretch; }
    .bpm-wheel-box { justify-self: center; }
    .bpm-quick { --qg: 10px; }
}
@media (max-height: 460px) and (orientation: landscape) {
    .bpm-quick { --qg: 6px; }
    .bpm-qbtn { font-size: 8.5px; } .bpm-qbtn span { letter-spacing: -.02em; }
    .bpm-menu-in > .bpm-menu-btns { max-width: 420px; }
    .bpm-days { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
    .bpm-day { padding: 5px 4px; gap: 3px; }
    .bpm-day .pts { min-height: 46px; } .bpm-day .pt .bpm-ico { width: 24px; height: 24px; }
    .bpm-day.seven .av { width: 60px; height: 76px; padding-top: 6px; } .bpm-day.seven .av .bpm-ico { width: 44px; height: 44px; }
    .bpm-day.seven h3 { font-size: 13px; margin: 2px 0; }
    .bpm-wheel-grid { grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 10px; justify-items: stretch; }
    .bpm-wheel-box { width: min(42vw, 64vh); padding-top: 10px; justify-self: center; }
    .bpm-wheel-side { gap: 6px; }
    .bpm-prizes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); gap: 4px; }
    .bpm-prize { padding: 3px 6px; } .bpm-prize .bpm-ico { width: 22px; height: 22px; }
    .bpm-rec-row { min-height: 48px; }
    .bpm-skin .art { height: 66px; }
    .bpm-skin .art.z-hair, .bpm-skin .art.z-hat { height: 72px; padding-top: 14px; }
    .bpm-skin .art.z-acc { height: 78px; }
}
@media (max-height: 460px) and (orientation: landscape) and (max-width: 700px) {
    .bpm-lv span { display: none; }
}
@media (max-width: 459px) {
    .bpm-quick { grid-template-columns: none; }
    .bpm-qbtn { font-size: 9px; } .bpm-qbtn span { letter-spacing: -.02em; }
    .bpm-tab { padding: .5em .9em; }
}

/* ------------------------------------------------------------------------------------------------------------
   Анимации
   ------------------------------------------------------------------------------------------------------------ */
@keyframes bpm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bpm-pop { from { opacity: 0; transform: scale(.9) translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes bpm-shimmer { from { background-position: 200% 0; } to { background-position: -100% 0; } }
@keyframes bpm-bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes bpm-alarm { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
@keyframes bpm-jitter { 0% { transform: translate(0, 0); } 25% { transform: translate(2px, -1px); } 50% { transform: translate(-2px, 1px); } 75% { transform: translate(1px, 2px); } 100% { transform: translate(0, 0); } }
@keyframes bpm-nudge { from { margin-top: calc(var(--da, 56px) / -2); } to { margin-top: calc(var(--da, 56px) / -2 - 8px); } }
@keyframes bpm-bob { from { transform: translateY(0); } to { transform: translateY(6px); } }
@keyframes bpm-glow { from { filter: brightness(1); } to { filter: brightness(1.18); } }
@keyframes bpm-chatin { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes bpm-chatout { to { opacity: 0; } }
@keyframes bpm-toastin { from { opacity: 0; transform: translateY(-10px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes bpm-float { 0%, 100% { transform: rotate(-2deg) translateY(0); } 50% { transform: rotate(-1deg) translateY(-6px); } }
@keyframes bpm-wavex { from { background-position-x: 0; } to { background-position-x: 36px; } }
@keyframes bpm-rise { 0% { transform: translateY(0) translateX(0) scale(.6); opacity: 0; } 10% { opacity: .9; } 100% { transform: translateY(-110vh) translateX(26px) scale(1.2); opacity: 0; } }
@keyframes bpm-starin { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bpm-scare { 0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bpm-flash { 0% { opacity: .95; } 22% { opacity: .1; } 34% { opacity: .75; } 100% { opacity: 0; } }
@keyframes bpm-lunge { 0% { transform: scale(.2); opacity: 0; } 20% { opacity: 1; } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes bpm-shake { 0%, 100% { transform: translate(0, 0); } 10% { transform: translate(-9px, 6px); } 20% { transform: translate(8px, -7px); } 30% { transform: translate(-7px, -5px); } 40% { transform: translate(6px, 7px); } 50% { transform: translate(-5px, 4px); } 60% { transform: translate(4px, -4px); } 70% { transform: translate(-3px, 3px); } 80% { transform: translate(2px, -2px); } 90% { transform: translate(-1px, 1px); } }
@media (prefers-reduced-motion: reduce) {
    .bpm-layer *, .bpm-layer *::before, .bpm-layer *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    body.bpm-shake #world3d, body.bpm-shake #bpm-hud { animation: none; }
}
