body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #222;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    color: #2a5d9f;
}

img {
    border-radius: 8px;
}

h2 {
    color: #1a8fa8;
}

li {
    color: #610DE0;
}

p {
    color: #0C7D4A;
}

h2 {
    border-bottom: 2px solid #137a90;
    padding-bottom: 6px;
    margin-top: 32px;
}

ul {
    line-height: 1.8;
}

img {
    border: 3px solid #2a5d9f;
    padding: 4px;
    background-color: white;
}

.card {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 16px;
}

.card h2 {
    margin-top: 0;
}


.card {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

img {
    margin-bottom: 20px;
}

.row {
    display: flex;
    gap: 20px;
}

.row .card {
    flex: 1;
}

.menu {
    display: flex;
    gap: 20px;
    padding: 12px 16px;
    background-color: #2a5d9f;
    border-radius: 8px;
    margin-bottom: 20px;
}

.menu a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.menu a:hover {
    color: #ffd966;
    text-decoration: underline;
}

html {
    scroll-behavior: smooth;
}

@media (max-width: 700px) {
    .row {
        flex-direction: column;
    }

    .menu {
        flex-wrap: wrap;
    }

    body {
        padding: 12px;
    }
}

img {
    max-width: 100%;
    height: auto;
}

input {
    padding: 8px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

#guess-btn,
#new-game {
    background: #2a5d9f;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 9px 16px;
    cursor: pointer;
}

#lang-btn {
    margin-left: auto;
    background: white;
    color: #2a5d9f;
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    font-weight: bold;
    cursor: pointer;
}

.heroes {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.hero {
    flex: 1 1 220px;
}

.hero img {
    width: 100%;
}

.buy-btn,
#earn-btn {
    background: #2a5d9f;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 9px 16px;
    cursor: pointer;
}

.owned {
    color: #1a7f37;
    font-weight: bold;
}

.buy-btn {
    background: #2a5d9f;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 9px 16px;
    cursor: pointer;
}

.owned {
    color: #1a7f37;
    font-weight: bold;
}

#field {
    position: relative;
    width: 100%;
    /* поле подстраивается под высоту окна: от 420 до 640 пикселей */
    height: clamp(420px, calc(100vh - 120px), 640px);
    background: #1b1b2f;
    border-radius: 8px;
    overflow: hidden;
}

#player {
    position: absolute;
    width: 80px;
    height: 80px;
    object-fit: cover;
    box-sizing: border-box;
    border: 2px solid #a855f7;
    border-radius: 12px;
    padding: 0;
    margin: 0;
    background: transparent;
    max-width: none;
}

#shop-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
}

#shop-btn,
#shop-close {
    background: #2a5d9f;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 9px 16px;
    cursor: pointer;
}

.shop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    overflow: auto;
    padding: 20px;
    z-index: 10;
}

.shop-inner {
    max-width: 900px;
    margin: 0 auto;
}

.shop .card {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.select-btn {
    background: #2a5d9f;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 9px 16px;
    cursor: pointer;
}

#hud {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-weight: bold;
    z-index: 1;
}

#coin {
    position: absolute;
    width: 24px;
    height: 24px;
    box-sizing: border-box;
    border-radius: 50%;
    background: #facc15;
    border: 3px solid #ca8a04;
}

.bullet {
    position: absolute;
    width: 10px;
    height: 18px;
    border-radius: 5px;
    background: #38bdf8;
}

.shop .hero {
    flex: 0 1 220px;
}

.shop .hero {
    box-sizing: border-box;
    flex: 0 1 200px;
}

.enemy {
    position: absolute;
    width: 36px;
    height: 36px;
    box-sizing: border-box;
    border-radius: 8px;
    background: #ef4444;
    border: 3px solid #991b1b;
}

#pause-btn {
    position: absolute;
    top: 10px;
    left: 105px;
    z-index: 1;
    background: #2a5d9f;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 9px 16px;
    cursor: pointer;
}

#pause-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 48px;
    font-weight: bold;
    z-index: 1;
}

#player.sprite {
    width: 90px;
    height: 90px;
    border: none;
    border-radius: 0;
    object-fit: contain;
}

#lives {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #ef4444;
    font-size: 22px;
    letter-spacing: 3px;
    z-index: 1;
}

#gameover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2;
}

#gameover.hidden {
    display: none;
}

#gameover-title {
    color: white;
    font-size: 40px;
    font-weight: bold;
}

#restart-btn {
    background: #2a5d9f;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 9px 16px;
    cursor: pointer;
}

#shop-btn {
    z-index: 3;
}

#levels {
    margin-bottom: 12px;
}

.level-btn {
    background: #e5e7eb;
    color: #222;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    margin-left: 6px;
    cursor: pointer;
}

.level-btn.active {
    background: #2a5d9f;
    color: white;
}

.enemy.explode {
    background: #facc15;
    border-color: #ffffff;
    animation: pop 0.3s ease-out forwards;
}

.enemy.crash {
    background: #ffffff;
    border-color: #ef4444;
    animation: pop 0.3s ease-out forwards;
}

@keyframes pop {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(2.2);
        opacity: 0;
    }
}

#field.hurt {
    box-shadow: inset 0 0 0 4px #ef4444;
    animation: shake 0.3s;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-6px);
    }

    50% {
        transform: translateX(6px);
    }

    75% {
        transform: translateX(-4px);
    }

    100% {
        transform: translateX(0);
    }
}

#menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2;
}

#menu.hidden {
    display: none;
}

#menu-title {
    color: white;
    font-size: 34px;
    font-weight: bold;
    text-align: center;
}

#menu-levels {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

#start-btn {
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 36px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
}

#menu .level-btn {
    margin: 0;
    border: 2px solid #ffffff;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    opacity: 0.6;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
}

#menu .level-btn[data-level="easy"] {
    background: none;
}

#menu .level-btn[data-level="normal"] {
    background: none;
    color: #ffffff;
}

#menu .level-btn[data-level="hard"] {
    background: none;
}

#menu .level-btn:hover {
    opacity: 1;
}

#menu .level-btn.active {
    opacity: 1;
    transform: scale(1.12);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.7);
}

#menu-title.over {
    color: #ef4444;
    text-shadow: 0 0 16px rgba(239, 68, 68, 0.6);
}

#start-btn {
    background: #7c3aed;
    color: white;
    border: 3px solid #ffffff;
    border-radius: 10px;
    padding: 12px 40px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
}

#start-btn:hover {
    background: #8b5cf6;
}

#hitbox {
    position: absolute;
    border: 1px dashed #22c55e;
    pointer-events: none;
    display: none;
    z-index: 1;
}

body.debug #hitbox {
    display: block;
}

.popup {
    position: absolute;
    color: #facc15;
    font-size: 20px;
    font-weight: bold;
    pointer-events: none;
    z-index: 1;
    animation: floatup 0.7s ease-out forwards;
}

@keyframes floatup {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-40px);
        opacity: 0;
    }
}

#kills-hud {
    position: absolute;
    top: 36px;
    right: 10px;
    color: white;
    font-weight: bold;
    z-index: 1;
}

#menu-stats {
    color: #facc15;
    font-size: 20px;
    min-height: 24px;
    text-align: center;
}

#sound-btn {
    position: absolute;
    top: 10px;
    left: 200px;
    z-index: 3;
    background: #2a5d9f;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 9px 12px;
    cursor: pointer;
}

#full-btn {
    position: absolute;
    top: 10px;
    left: 250px;
    z-index: 3;
    background: #2a5d9f;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 9px 12px;
    cursor: pointer;
}

body.fullgame {
    overflow: hidden;
}

body.fullgame #field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    z-index: 5;
}
.stats {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    font-size: 15px;
}

.stats li {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    border-bottom: 1px solid #ddd;
}

.enemy .hpbar {
    position: absolute;
    left: -3px;
    top: -10px;
    width: 36px;
    height: 5px;
    background: #450a0a;
    border: 1px solid #ffffff;
    border-radius: 3px;
    box-sizing: border-box;
    overflow: hidden;
}

.enemy .hpfill {
    width: 100%;
    height: 100%;
    background: #22c55e;
}

.enemy.damaged {
    background: #ffffff;
}

#lives .shield {
    color: #3b82f6;
    margin-left: 8px;
}

.stats li {
    align-items: center;
    gap: 8px;
}

.stats li span {
    flex: 1;
}

.up-btn {
    padding: 2px 8px;
    font-size: 13px;
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.up-btn:hover {
    background: #15803d;
}

.stats .max {
    font-size: 12px;
    color: #b45309;
    font-style: normal;
    font-weight: bold;
}

#skill-btn {
    position: absolute;
    left: 10px;
    bottom: 10px;
    width: 64px;
    height: 64px;
    padding: 0;
    border-radius: 50%;
    border: 3px solid #ffffff;
    background: #7c3aed;
    color: white;
    font-size: 28px;
    cursor: pointer;
    overflow: hidden;
    z-index: 1;
    --cd: 0%;
}

#skill-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(rgba(0, 0, 0, 0.7) var(--cd), transparent 0);
    pointer-events: none;
}

#skill-btn.cooling {
    filter: grayscale(0.6);
}

#skill-time {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    z-index: 1;
    pointer-events: none;
}

.shadow {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle, #e9d5ff 0%, #7c3aed 50%, #1e1b4b 100%);
    box-shadow: 0 0 12px 4px #7c3aed;
    z-index: 2;
}

#field:has(#menu:not(.hidden)) #skill-btn {
    visibility: hidden;
}

.star {
    position: absolute;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    font-size: 24px;
    color: #fde047;
    text-shadow: 0 0 8px #facc15, 0 0 16px #fef9c3;
    pointer-events: none;
    z-index: 2;
}

#player.invisible {
    opacity: 0.3;
    filter: blur(1px);
}

.enemy.boss {
    width: 120px;
    height: 120px;
    border-radius: 18px;
    border: 5px solid #450a0a;
    background: #b91c1c;
    box-shadow: 0 0 24px 6px rgba(239, 68, 68, 0.7);
}

.enemy.boss .hpbar {
    left: -5px;
    top: -18px;
    width: 120px;
    height: 10px;
}

.enemy.boss.damaged {
    background: #ffffff;
}

.banner {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fca5a5;
    font-size: 44px;
    font-weight: bold;
    text-shadow: 0 0 12px #ef4444, 0 2px 0 #000;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
    animation: bannerfade 1.8s ease-out forwards;
}

@keyframes bannerfade {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.6);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

#help-btn {
    position: absolute;
    top: 10px;
    left: 300px;
    z-index: 3;
    background: #2a5d9f;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 9px 12px;
    cursor: pointer;
}

#help {
    position: absolute;
    inset: 0;
    background: #0b0b14;
    color: white;
    overflow-y: auto;
    z-index: 4;
}

.help-inner {
    padding: 16px 24px 24px;
    text-align: left;
}

.help-inner h3 {
    color: #facc15;
    margin: 16px 0 6px;
}

.help-inner ul {
    margin: 0;
    padding-left: 22px;
}

.help-inner li {
    margin: 3px 0;
    line-height: 1.35;
}

#help-close {
    position: sticky;
    top: 0;
    float: right;
    background: #7c3aed;
    color: white;
    border: 2px solid white;
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
}

#field:has(#help:not(.hidden)) #skill-btn {
    visibility: hidden;
}

.help-inner li {
    color: #ffffff;
}

/* картинки врагов */
.enemy {
    width: 68px;
    height: 68px;
    border: none;
    border-radius: 0;
    background: url("demon-game.png") center / contain no-repeat;
}

.enemy .hpbar {
    left: 0;
    top: -8px;
    width: 68px;
}

.enemy.explode,
.enemy.crash,
.enemy.damaged {
    background: url("demon-game.png") center / contain no-repeat;
    border: none;
}

.enemy.explode {
    filter: brightness(3) sepia(1) hue-rotate(5deg);
}

.enemy.crash {
    filter: brightness(3);
}

.enemy.damaged {
    filter: brightness(2.2);
}

.enemy.boss,
.enemy.boss.explode,
.enemy.boss.crash,
.enemy.boss.damaged {
    width: 150px;
    height: 150px;
    border: none;
    border-radius: 0;
    background: url("demonboss-game.png") center / contain no-repeat;
    box-shadow: none;
}

.enemy.boss .hpbar {
    left: 0;
    top: -16px;
    width: 150px;
    height: 10px;
}

#skill-btn {
    border-radius: 50%;
    border: none;
    background-color: transparent;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    overflow: visible;
}

#skill-btn::after {
    border-radius: 50%;
}

#boss-hud {
    position: absolute;
    top: 62px;
    right: 10px;
    color: #fca5a5;
    font-weight: bold;
    z-index: 1;
}

/* ===== телефон ===== */
#touch-controls,
#rotate {
    display: none;
}

body.touch {
    overflow: hidden;
    padding: 0;
    margin: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

body.touch .menu {
    display: none;
}

body.touch #field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    z-index: 5;
    touch-action: none;
}

body.touch #topbtns {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    gap: 6px;
    z-index: 3;
}

body.touch #topbtns button {
    position: static;
    padding: 7px 10px;
    font-size: 13px;
    border-radius: 6px;
}

body.touch #lives {
    top: 8px;
    font-size: 18px;
}

body.touch #hud,
body.touch #kills-hud,
body.touch #boss-hud {
    font-size: 13px;
    right: 8px;
}

body.touch #hud { top: 6px; }
body.touch #kills-hud { top: 24px; }
body.touch #boss-hud { top: 42px; }

body.touch #touch-controls {
    display: block;
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

body.touch #dpad {
    position: absolute;
    left: 14px;
    bottom: 14px;
    width: 156px;
    height: 156px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    pointer-events: auto;
}

.dp,
#attack-btn {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.18);
    color: white;
    font-size: 22px;
    padding: 0;
}

.dp {
    border-radius: 12px;
}

.dp.down,
#attack-btn.down {
    background: rgba(168, 85, 247, 0.7);
}

#dp-up { grid-column: 2; grid-row: 1; }
#dp-left { grid-column: 1; grid-row: 2; }
#dp-right { grid-column: 3; grid-row: 2; }
#dp-down { grid-column: 2; grid-row: 3; }

body.touch #attack-btn {
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    font-size: 40px;
    pointer-events: auto;
    background: rgba(239, 68, 68, 0.35);
}

body.touch #attack-btn.down {
    background: rgba(239, 68, 68, 0.8);
}

body.touch #skill-btn {
    left: auto;
    right: 138px;
    bottom: 22px;
    width: 64px;
    height: 64px;
    z-index: 3;
}

body.touch #field:has(#menu:not(.hidden)) #touch-controls,
body.touch #field:has(#help:not(.hidden)) #touch-controls {
    visibility: hidden;
}

body.touch #menu {
    overflow-y: auto;
}

body.touch .shop {
    padding: 10px;
}

/* раньше в вертикальном положении просили повернуть телефон; теперь можно играть и так */
@media (orientation: portrait) and (max-width: 0px) {
    body.touch #rotate {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 100;
        align-items: center;
        justify-content: center;
        background: #0b0b14;
        color: white;
        font-size: 22px;
        font-weight: bold;
        text-align: center;
        padding: 24px;
    }
}

/* цвет пуль у героев */
.bullet[data-hero="kaiden"] {
    background: #a855f7;
    box-shadow: 0 0 8px 2px #7c3aed;
}

.bullet[data-hero="luna"] {
    background: #facc15;
    box-shadow: 0 0 8px 2px #f59e0b;
}

.bullet[data-hero="arion"] {
    background: #7dd3fc;
    box-shadow: 0 0 8px 2px #38bdf8;
}

/* кнопка магазина: иконка */
#shop-btn {
    width: 56px;
    height: 56px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: url("shop-icon.png") center / contain no-repeat;
}

#topbtns {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    z-index: 3;
}

#topbtns button {
    position: static;
}

body.touch #topbtns {
    align-items: center;
}

body.touch #topbtns #shop-btn {
    width: 46px;
    height: 46px;
    padding: 0;
}

/* иконки-кнопки */
#pause-btn {
    width: 56px;
    height: 56px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: url("btn-pause.png") center / contain no-repeat;
}

body.touch #topbtns #pause-btn {
    width: 46px;
    height: 46px;
    padding: 0;
}

#shop-close,
#help-close,
.select-btn {
    display: inline-flex;
    align-items: flex-start;
    justify-content: center;
    width: 104px;
    height: 104px;
    padding: 15px 0 0;
    border: none;
    border-radius: 14px;
    background: url("btn-close.png") center / contain no-repeat;
    color: #5b4636;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.select-btn {
    background-image: url("btn-select.png");
}

#help-close {
    border: none;
    margin-bottom: 6px;
}

/* плашки для кнопок «Закрыть» и «Выбрать» (поменьше) */
#shop-close,
#help-close,
.select-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 64px;
    padding: 0 0 2px;
    border: none;
    border-radius: 10px;
    background: url("plate-close.png") center / 100% 100% no-repeat;
    color: #5b4636;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.select-btn {
    background-image: url("plate-select.png");
}

#help-close {
    margin-bottom: 6px;
}

/* кнопка подсказки: магический кристалл */
#help-btn {
    position: relative;
    width: 56px;
    height: 56px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#help-btn:hover { transform: scale(1.1); }
#help-btn:active { transform: scale(0.95); }

body.touch #topbtns #help-btn {
    width: 46px;
    height: 46px;
    padding: 0;
}

.crystal-ring-outer {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px dashed rgba(56, 189, 248, 0.6);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3), inset 0 0 8px rgba(56, 189, 248, 0.2);
    animation: spinSlow 12s linear infinite;
    transition: all 0.4s ease;
}

#help-btn:hover .crystal-ring-outer {
    border-color: #38bdf8;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.8), inset 0 0 12px rgba(56, 189, 248, 0.5);
    animation-duration: 4s;
}

.crystal-diamond-frame {
    position: absolute;
    width: 36px;
    height: 36px;
    border: 2px solid #fde047;
    transform: rotate(45deg);
    box-shadow: 0 0 10px rgba(253, 224, 71, 0.4);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#help-btn:hover .crystal-diamond-frame {
    transform: rotate(135deg) scale(1.05);
    border-color: #fef08a;
    box-shadow: 0 0 16px rgba(253, 224, 71, 0.9);
}

.crystal-core {
    position: relative;
    width: 29px;
    height: 29px;
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 50%, #bae6fd 100%);
    transform: rotate(45deg);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.7), inset 0 0 8px rgba(255, 255, 255, 0.8);
    z-index: 2;
}

.crystal-icon {
    transform: rotate(-45deg);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 900;
    font-size: 18px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(3, 105, 161, 0.9), 0 0 8px #ffffff;
    user-select: none;
}

.crystal-spark {
    position: absolute;
    width: 5px;
    height: 5px;
    background: #fde047;
    border-radius: 50%;
    box-shadow: 0 0 6px #fde047, 0 0 10px #ffffff;
    opacity: 0;
    pointer-events: none;
}

#help-btn:hover .spark-1 { animation: floatSpark 1.4s ease-out infinite; top: 4px; left: 10px; }
#help-btn:hover .spark-2 { animation: floatSpark 1.6s ease-out 0.3s infinite; bottom: 6px; right: 8px; }
#help-btn:hover .spark-3 { animation: floatSpark 1.2s ease-out 0.6s infinite; top: 10px; right: 3px; }

@keyframes spinSlow {
    to { transform: rotate(360deg); }
}

@keyframes floatSpark {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    40% { opacity: 1; transform: translateY(-6px) scale(1.2); }
    100% { transform: translateY(-16px) scale(0); opacity: 0; }
}

/* окно подсказки в стиле визуальной новеллы */
#help {
    background: rgba(8, 12, 24, 0.97);
}

.help-inner {
    border: 2px solid rgba(56, 189, 248, 0.6);
    border-radius: 16px;
    margin: 14px;
    padding-top: 22px;
}

.help-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    color: white;
    background: linear-gradient(90deg, #0ea5e9, #4f46e5);
    border: 1px solid rgba(125, 211, 252, 0.5);
}

#topbtns #help-btn {
    position: relative;
}

#topbtns #help-btn {
    left: auto;
    top: auto;
}

/* кнопка магазина: таверна RPG */
#topbtns #shop-btn {
    position: relative;
    width: 66px;
    height: 66px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#topbtns #shop-btn:hover { transform: scale(1.1) translateY(-2px); }
#topbtns #shop-btn:active { transform: scale(0.95); }

body.touch #topbtns #shop-btn {
    width: 54px;
    height: 54px;
    zoom: 0.85;
}

.guild-halo {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.35) 0%, transparent 70%);
    border: 1.5px dashed rgba(251, 191, 36, 0.65);
    animation: spinSlow 14s linear infinite;
    transition: all 0.4s ease;
}

#shop-btn:hover .guild-halo {
    box-shadow: 0 0 22px rgba(245, 158, 11, 0.65);
    border-color: #fde047;
    animation-duration: 5s;
}

.guild-wing {
    position: absolute;
    width: 17px;
    height: 24px;
    background: linear-gradient(135deg, #fef08a, #f59e0b);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

.guild-wing-left {
    left: 0;
    clip-path: polygon(100% 25%, 0% 0%, 20% 50%, 0% 75%, 35% 85%, 100% 75%);
    transform-origin: right center;
}

.guild-wing-right {
    right: 0;
    clip-path: polygon(0% 25%, 100% 0%, 80% 50%, 100% 75%, 65% 85%, 0% 75%);
    transform-origin: left center;
}

#shop-btn:hover .guild-wing-left { transform: rotate(-18deg) translateX(-3px); }
#shop-btn:hover .guild-wing-right { transform: rotate(18deg) translateX(3px); }

.guild-medallion {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, #fde68a, #d97706 65%, #78350f 100%);
    border: 2px solid #fef08a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.65), inset 0 0 10px rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    z-index: 2;
}

.guild-coin {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffffff, #fde047 50%, #d97706);
    border: 1px solid #fffbeb;
    box-shadow: 0 0 6px #fde047;
    opacity: 0;
    pointer-events: none;
    z-index: 3;
}

#shop-btn:hover .coin-1 { animation: coinPopLeft 1.3s ease-out infinite; top: 12px; left: 14px; }
#shop-btn:hover .coin-2 { animation: coinPopRight 1.5s ease-out 0.25s infinite; top: 10px; right: 14px; }
#shop-btn:hover .coin-3 { animation: coinPopCenter 1.2s ease-out 0.5s infinite; top: 5px; left: 29px; }

@keyframes coinPopLeft {
    0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
    35% { opacity: 1; }
    100% { transform: translate(-14px, -20px) scale(1.1); opacity: 0; }
}

@keyframes coinPopRight {
    0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
    35% { opacity: 1; }
    100% { transform: translate(14px, -22px) scale(1.1); opacity: 0; }
}

@keyframes coinPopCenter {
    0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
    35% { opacity: 1; }
    100% { transform: translate(0, -26px) scale(1.2); opacity: 0; }
}

/* поправка: кнопка магазина не налезает на соседей */
#topbtns #shop-btn {
    margin: 0 12px 0 6px;
}

body.touch #topbtns #shop-btn {
    margin: 0 10px 0 4px;
}

#topbtns #shop-btn {
    top: auto;
    left: auto;
}

/* кнопка паузы: хроно-кристалл */
#topbtns #pause-btn {
    position: relative;
    width: 64px;
    height: 64px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    top: auto;
    left: auto;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#topbtns #pause-btn:hover { transform: scale(1.08); }
#topbtns #pause-btn:active { transform: scale(0.95); }

body.touch #topbtns #pause-btn {
    width: 54px;
    height: 54px;
    zoom: 0.85;
}

.chrono-rune-wheel {
    position: absolute;
    width: 64px;
    height: 64px;
    animation: spinRune 16s linear infinite;
    transition: filter 0.45s ease;
    z-index: 1;
    max-width: none;
    margin: 0;
}

#pause-btn:hover .chrono-rune-wheel {
    animation-duration: 6s;
    filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.75));
}

.chrono-freeze-ring {
    position: absolute;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(103, 232, 249, 0.75);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

#pause-btn:hover .chrono-freeze-ring.ring-a { animation: chronoPulse 1.6s ease-out infinite; }
#pause-btn:hover .chrono-freeze-ring.ring-b { animation: chronoPulse 1.6s ease-out 0.65s infinite; }

.chrono-gold-frame {
    position: relative;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #fef08a 0%, #f59e0b 52%, #b45309 100%);
    clip-path: polygon(50% 0%, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 15% 85%, 0% 50%, 15% 15%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.chrono-inner-core {
    width: 37px;
    height: 37px;
    background: radial-gradient(circle at 30% 25%, #a5f3fc 0%, #0284c7 60%, #082f49 100%);
    clip-path: polygon(50% 0%, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 15% 85%, 0% 50%, 15% 15%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chrono-bars {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.chrono-bar {
    width: 5px;
    height: 16px;
    border-radius: 3px;
    background: linear-gradient(to bottom, #ffffff, #67e8f9);
    box-shadow: 0 0 8px #22d3ee;
}

#pause-btn.is-paused .chrono-rune-wheel {
    animation-play-state: paused;
    filter: drop-shadow(0 0 10px rgba(253, 224, 71, 0.9));
}

#pause-btn.is-paused .chrono-freeze-ring {
    animation-play-state: paused;
    opacity: 0.45;
    border-color: #fde047;
    transform: scale(1.18);
}

#pause-btn.is-paused .chrono-inner-core {
    background: radial-gradient(circle at 35% 30%, #fef9c3 0%, #d97706 65%, #451a03 100%);
}

#pause-btn.is-paused .chrono-bar {
    background: linear-gradient(to bottom, #ffffff, #fde047);
    box-shadow: 0 0 10px #fef08a;
}

@keyframes spinRune {
    to { transform: rotate(360deg); }
}

@keyframes chronoPulse {
    0% { transform: scale(0.95); opacity: 0.85; }
    100% { transform: scale(1.42); opacity: 0; }
}

/* кнопка звука: звуковая волна */
#topbtns #sound-btn {
    position: relative;
    width: 60px;
    height: 60px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    top: auto;
    left: auto;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#topbtns #sound-btn:hover { transform: scale(1.08); }
#topbtns #sound-btn:active { transform: scale(0.94); }

body.touch #topbtns #sound-btn {
    width: 54px;
    height: 54px;
    zoom: 0.85;
}

.wave-ripple {
    position: absolute;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(34, 211, 238, 0.7);
    opacity: 0;
    pointer-events: none;
}

#sound-btn:not(.is-muted):hover .wave-ripple.r1 { animation: rippleExpand 1.5s ease-out infinite; }
#sound-btn:not(.is-muted):hover .wave-ripple.r2 { animation: rippleExpand 1.5s ease-out 0.55s infinite; }

.wave-rim-ring {
    position: absolute;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #22d3ee 0%, #818cf8 50%, #c084fc 100%);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.45);
    animation: slowOrbit 10s linear infinite;
    z-index: 1;
}

.wave-rim-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 25%, #172554 0%, #090d16 75%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: slowOrbitBack 10s linear infinite;
}

.wave-speaker {
    display: flex;
    align-items: center;
    color: #cffafe;
}

.wave-eq-group {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 2px;
    height: 16px;
}

.wave-mini-bar {
    width: 2.5px;
    height: 12px;
    border-radius: 2px;
    background: linear-gradient(to top, #22d3ee, #e879f9);
    animation: miniWave 0.75s ease-in-out infinite;
}

.wave-mini-bar:nth-child(2) { animation-delay: 0.18s; }
.wave-mini-bar:nth-child(3) { animation-delay: 0.36s; }

.wave-cut-slash {
    position: absolute;
    width: 42px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #fb7185, #f43f5e, #fde047);
    box-shadow: 0 0 10px #f43f5e;
    transform: rotate(-38deg) scaleX(0);
    opacity: 0;
    z-index: 4;
    pointer-events: none;
    transition: transform 0.32s cubic-bezier(0.22, 1.5, 0.36, 1), opacity 0.25s ease;
}

#sound-btn.is-muted .wave-cut-slash {
    transform: rotate(-38deg) scaleX(1);
    opacity: 1;
}

#sound-btn.is-muted .wave-mini-bar {
    animation: none;
    transform: scaleY(0.25);
    opacity: 0.3;
}

#sound-btn.is-muted .wave-rim-ring {
    background: linear-gradient(135deg, #f43f5e 0%, #9f1239 55%, #fb7185 100%);
    box-shadow: 0 0 16px rgba(244, 63, 94, 0.55);
    animation-play-state: paused;
}

#sound-btn.is-muted .wave-rim-inner {
    animation-play-state: paused;
}

@keyframes rippleExpand {
    0% { transform: scale(0.95); opacity: 0.85; }
    100% { transform: scale(1.42); opacity: 0; }
}

@keyframes slowOrbit {
    to { transform: rotate(360deg); }
}

@keyframes slowOrbitBack {
    to { transform: rotate(-360deg); }
}

@keyframes miniWave {
    0%, 100% { transform: scaleY(0.35); }
    50% { transform: scaleY(1); }
}

/* кнопка полного экрана: пространственный разлом */
#topbtns #full-btn {
    position: relative;
    width: 60px;
    height: 60px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    top: auto;
    left: auto;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#topbtns #full-btn:hover { transform: scale(1.08); }
#topbtns #full-btn:active { transform: scale(0.94); }

body.touch #topbtns #full-btn {
    width: 54px;
    height: 54px;
    zoom: 0.85;
}

.rift-compass-ring {
    position: absolute;
    width: 58px;
    height: 58px;
    animation: slowOrbit 16s linear infinite;
    max-width: none;
    margin: 0;
}

.rift-orb-rim {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #22d3ee, #818cf8 50%, #c084fc);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.45);
}

.rift-orb-core {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #1e1b4b, #090913 78%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rift-chevrons {
    position: relative;
    width: 24px;
    height: 24px;
}

.rift-chev {
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: #67e8f9;
    transition: transform 0.32s ease, border-color 0.3s ease;
}

.rift-chev.tl { top: 1px; left: 1px; border-top: 2px solid; border-left: 2px solid; }
.rift-chev.tr { top: 1px; right: 1px; border-top: 2px solid; border-right: 2px solid; }
.rift-chev.bl { bottom: 1px; left: 1px; border-bottom: 2px solid; border-left: 2px solid; }
.rift-chev.br { bottom: 1px; right: 1px; border-bottom: 2px solid; border-right: 2px solid; }

#full-btn:not(.is-fullscreen):hover .rift-chev.tl { transform: translate(-3px, -3px); }
#full-btn:not(.is-fullscreen):hover .rift-chev.tr { transform: translate(3px, -3px); }
#full-btn:not(.is-fullscreen):hover .rift-chev.bl { transform: translate(-3px, 3px); }
#full-btn:not(.is-fullscreen):hover .rift-chev.br { transform: translate(3px, 3px); }

#full-btn.is-fullscreen .rift-chev { border-color: #fde047; }
#full-btn.is-fullscreen .rift-chev.tl { transform: translate(3px, 3px) rotate(180deg); }
#full-btn.is-fullscreen .rift-chev.tr { transform: translate(-3px, 3px) rotate(180deg); }
#full-btn.is-fullscreen .rift-chev.bl { transform: translate(3px, -3px) rotate(180deg); }
#full-btn.is-fullscreen .rift-chev.br { transform: translate(-3px, -3px) rotate(180deg); }

/* кнопки «Закрыть» и «Выбрать»: магические печати (Fantasy RPG) */
#shop-close,
#help-close,
.select-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    padding: 0;
    margin: 6px;
    border: 2.5px solid transparent;
    border-radius: 50%;
    font-size: 0;
    line-height: 0;
    color: transparent;
    cursor: pointer;
    outline: none;
    background:
        radial-gradient(circle at 35% 30%, #4c0519 0%, #2e1065 62%, #090913 100%) padding-box,
        linear-gradient(135deg, #fb7185 0%, #e11d48 48%, #7e22ce 100%) border-box;
    box-shadow: 0 0 16px rgba(225, 29, 72, 0.5);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.select-btn {
    background:
        radial-gradient(circle at 35% 30%, #064e3b 0%, #065f46 52%, #090913 100%) padding-box,
        linear-gradient(135deg, #fde047 0%, #10b981 52%, #059669 100%) border-box;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
}

#shop-close::before,
#help-close::before,
.select-btn::before {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1.5px dashed rgba(103, 232, 249, 0.55);
    animation: slowOrbit 16s linear infinite;
    pointer-events: none;
}

#shop-close::after,
#help-close::after,
.select-btn::after {
    content: "✕";
    font-size: 24px;
    line-height: 1;
    font-weight: bold;
    color: #fda4af;
    text-shadow: 0 0 8px rgba(251, 113, 133, 0.9);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.select-btn::after {
    content: "✓";
    color: #fde047;
    text-shadow: 0 0 8px rgba(253, 224, 71, 0.9);
}

#shop-close:hover,
#help-close:hover,
.select-btn:hover {
    transform: scale(1.09);
}

#shop-close:hover::before,
#help-close:hover::before,
.select-btn:hover::before {
    animation-duration: 6s;
}

#shop-close:hover::after,
#help-close:hover::after {
    transform: rotate(90deg) scale(1.1);
}

.select-btn:hover::after {
    transform: scale(1.14);
}

#shop-close:active,
#help-close:active,
.select-btn:active {
    transform: scale(0.93);
}

#shop-close:hover,
#help-close:hover {
    box-shadow: 0 0 26px rgba(244, 63, 94, 0.85);
}

.select-btn:hover {
    box-shadow: 0 0 26px rgba(52, 211, 153, 0.85), 0 0 14px rgba(253, 224, 71, 0.6);
}

#help-close {
    margin-bottom: 6px;
}

/* переливающиеся портреты героев (наклон, аура, блик, голография, частицы) */
@property --holo-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.hero-frame {
    --c1: #fda4af;
    --c2: #7c3aed;
    --glow: 168, 85, 247;
    position: relative;
    margin-bottom: 14px;
    border-radius: 18px;
    padding: 3px;
    background: linear-gradient(145deg, #d8b4fe 0%, #9333ea 45%, #3b0764 100%);
    box-shadow: 0 8px 22px rgba(var(--glow), 0.3);
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px));
    transition: transform 0.18s ease-out, box-shadow 0.35s ease;
    will-change: transform;
}

.hero-frame[data-hero="luna"] {
    --glow: 251, 191, 36;
    background: linear-gradient(145deg, #fef08a 0%, #f59e0b 48%, #78350f 100%);
}

.hero-frame[data-hero="arion"] {
    --glow: 34, 211, 238;
    background: linear-gradient(145deg, #a5f3fc 0%, #0284c7 48%, #1e1b4b 100%);
}

.hero-frame:hover {
    --ty: -5px;
    box-shadow: 0 16px 36px rgba(var(--glow), 0.6), 0 0 20px rgba(var(--glow), 0.45);
}

.hero-frame.is-tilting {
    transition: transform 0.06s linear, box-shadow 0.25s ease;
}

.portrait-stage {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    background: #070812;
    line-height: 0;
}

.portrait-stage img.portrait-media {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    transition: transform 0.45s ease;
}

.hero-frame:hover img.portrait-media {
    transform: scale(1.04);
}

.fx-aura-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    box-shadow: inset 0 0 30px rgba(var(--glow), 0.55), inset 0 -20px 30px rgba(var(--glow), 0.3);
    animation: auraPulse 3.6s ease-in-out infinite;
}

.fx-shimmer-layer {
    position: absolute;
    inset: -30%;
    pointer-events: none;
    z-index: 4;
    opacity: 0.72;
    background: linear-gradient(
        115deg,
        transparent 28%,
        rgba(255, 255, 255, 0.08) 40%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.08) 60%,
        transparent 72%
    );
    transform: translateX(-65%) rotate(8deg);
    animation: shimmerSweep 4.6s ease-in-out infinite;
    mix-blend-mode: screen;
}

.hero-frame[data-hero="luna"] .fx-shimmer-layer { animation-delay: 1.1s; }
.hero-frame[data-hero="arion"] .fx-shimmer-layer { animation-delay: 2.2s; }

.fx-holo-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0.5;
    background: conic-gradient(
        from var(--holo-angle, 130deg) at var(--mx, 50%) var(--my, 50%),
        rgba(244, 114, 182, 0.28),
        rgba(129, 140, 248, 0.28),
        rgba(34, 211, 238, 0.32),
        rgba(253, 224, 71, 0.28),
        rgba(244, 114, 182, 0.28)
    );
    mix-blend-mode: color-dodge;
    animation: holoRotate 9s linear infinite;
}

.fx-particles-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 6;
    overflow: hidden;
}

.spark-dot {
    position: absolute;
    border-radius: 999px;
    animation: particleRise var(--dur, 3.2s) linear var(--delay, 0s) infinite;
}

@keyframes shimmerSweep {
    0% { transform: translateX(-65%) rotate(8deg); }
    55% { transform: translateX(65%) rotate(8deg); }
    100% { transform: translateX(65%) rotate(8deg); }
}

@keyframes holoRotate {
    0% { --holo-angle: 0deg; }
    100% { --holo-angle: 360deg; }
}

@keyframes auraPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes particleRise {
    0% { transform: translateY(20px) scale(0.5); opacity: 0; }
    25% { opacity: 0.95; }
    85% { opacity: 0.85; }
    100% { transform: translateY(-130px) scale(1.15); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .fx-shimmer-layer, .fx-holo-layer, .fx-aura-layer, .spark-dot {
        animation: none;
    }
}

/* аниме-кнопки меню */
#menu {
    background: radial-gradient(circle at 20% 20%, rgba(168,85,247,.28), transparent 45%),
                radial-gradient(circle at 80% 80%, rgba(56,189,248,.22), transparent 45%),
                rgba(6,8,18,.88);
}
#menu-title {
    font-size: 30px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em;
    text-shadow: 0 0 22px rgba(168,85,247,.7);
}
#menu-title.over { text-shadow: 0 0 22px rgba(244,63,94,.8); }
#menu-stats {
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px; padding: 8px 18px; font-weight: 800; font-size: 18px;
}
#menu-stats:empty { display: none; }
#menu-levels { gap: 14px; }

#menu .level-btn, #menu #start-btn {
    position: relative; overflow: hidden; isolation: isolate;
    border: none; background: none; color: #fff; opacity: 1;
    font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    cursor: pointer; transition: transform .16s ease, filter .16s ease;
}
#menu .level-btn::before, #menu #start-btn::before {
    content: ""; position: absolute; inset: 0; z-index: -2;
    border-radius: 12px; transform: skewX(-8deg);
    transition: box-shadow .16s ease;
}
#menu .level-btn::after, #menu #start-btn::after {
    content: ""; position: absolute; top: 0; left: -120%; width: 55%; height: 100%; z-index: -1;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
    transform: skewX(-20deg); transition: left .45s ease;
}
#menu .level-btn:hover::after, #menu #start-btn:hover::after { left: 140%; }
#menu .level-btn:hover, #menu #start-btn:hover { transform: translateY(-2px); filter: brightness(1.12); }
#menu .level-btn:active, #menu #start-btn:active { transform: scale(.97); }

#menu .level-btn { padding: 14px 24px; font-size: 15px; color: #fff; }
#menu .level-btn[data-level="easy"]::before   { background: linear-gradient(135deg,#15803d,#22c55e); box-shadow: 0 8px 22px rgba(34,197,94,.3); }
#menu .level-btn[data-level="normal"]::before { background: linear-gradient(135deg,#0369a1,#38bdf8); box-shadow: 0 8px 22px rgba(56,189,248,.3); }
#menu .level-btn[data-level="hard"]::before   { background: linear-gradient(135deg,#be123c,#f43f5e); box-shadow: 0 8px 22px rgba(244,63,94,.32); }
#menu .level-btn.active { transform: none; box-shadow: none; }
#menu .level-btn.active::before { outline: 2px solid #fff; outline-offset: 0; box-shadow: 0 0 0 3px rgba(255,255,255,.22), 0 0 18px rgba(255,255,255,.35); }

#menu #start-btn { padding: 16px 56px; font-size: 20px; border-radius: 12px; }
#menu #start-btn::before { background: linear-gradient(135deg,#a855f7,#38bdf8); box-shadow: 0 10px 28px rgba(168,85,247,.45); }
#menu .level-btn[data-level="normal"]{color:#fff}

/* ===== аниме HUD: сердечки и счётчики ===== */
#stats-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    min-width: 140px;
    padding: 8px 13px;
    border-radius: 14px;
    background: rgba(8, 13, 28, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(6px);
    text-align: right;
}

#stats-panel #hud,
#stats-panel #kills-hud,
#stats-panel #boss-hud {
    position: static;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
}

#stats-panel #hud { color: #fcd34d; }
#stats-panel #kills-hud { color: #a5f3fc; }
#stats-panel #boss-hud { color: #fb7185; }
#stats-panel strong { color: #ffffff; font-variant-numeric: tabular-nums; }

#lives {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3px;
    max-width: 34%;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.65);
    border: 1px solid rgba(244, 63, 94, 0.3);
    backdrop-filter: blur(4px);
    letter-spacing: 0;
}

#lives:empty { display: none; }

#lives .heart {
    width: 16px;
    height: 16px;
    fill: #fb7185;
    filter: drop-shadow(0 0 5px rgba(244, 63, 94, 0.75));
}

#lives .heart.shield {
    fill: #38bdf8;
    filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.75));
}

#lives .heart.empty {
    fill: rgba(148, 163, 184, 0.32);
    filter: none;
}

#lives .shield-group {
    display: contents;
}

body.touch #stats-panel {
    top: 6px;
    right: 8px;
    min-width: 112px;
    padding: 4px 9px;
    border-radius: 11px;
}

body.touch #stats-panel #hud,
body.touch #stats-panel #kills-hud,
body.touch #stats-panel #boss-hud {
    font-size: 11px;
    gap: 10px;
}

body.touch #lives .heart {
    width: 13px;
    height: 13px;
}

/* ===== главный экран: карточка как в демо ===== */
#menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: min(92%, 540px);
    box-sizing: border-box;
    padding: 18px 26px 20px;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.78);
    border: 1px solid rgba(100, 116, 139, 0.6);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(99, 102, 241, 0.08);
    backdrop-filter: blur(8px);
}

#menu-card #menu-title {
    font-family: "Cinzel", Georgia, serif;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-shadow: 0 0 16px rgba(129, 140, 248, 0.6);
}

#menu-card #menu-title.over {
    color: #fda4af;
    text-shadow: 0 0 16px rgba(244, 63, 94, 0.6);
}

#menu-card #menu-stats {
    padding: 5px 14px;
    font-size: 15px;
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 999px;
}

#menu-card #menu-levels { gap: 12px; }
#menu-card #start-btn { width: 100%; }

body.touch #menu-card {
    gap: 8px;
    padding: 10px 18px 12px;
}

body.touch #menu-card #menu-title { font-size: 20px; }
body.touch #menu-card #menu-stats { font-size: 13px; padding: 3px 12px; }
body.touch #menu-card .level-btn { padding: 10px 16px; font-size: 13px; }
body.touch #menu-card #start-btn { padding: 11px 30px; font-size: 16px; }

/* сердечки не залезают под кнопки слева и счётчики справа */
#lives {
    left: 380px;
    right: 170px;
    transform: none;
    width: fit-content;
    max-width: none;
    margin: 0 auto;
}

body.touch #lives {
    left: 290px;
    right: 130px;
}

/* ===== карточки героев в тёмном аниме-стиле ===== */
.card.hero {
    --accent: #fda4af;
    --accent-rgb: 253, 164, 175;
    background: linear-gradient(170deg, #12142b 0%, #0a0c1c 100%);
    border: 1px solid rgba(var(--accent-rgb), 0.45);
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 22px rgba(var(--accent-rgb), 0.18);
    color: #e2e8f0;
}

.card.hero[data-card="kaiden"] { --accent: #c084fc; --accent-rgb: 192, 132, 252; }
.card.hero[data-card="luna"] { --accent: #fbbf24; --accent-rgb: 251, 191, 36; }
.card.hero[data-card="arion"] { --accent: #38bdf8; --accent-rgb: 56, 189, 248; }

.card.hero h2 {
    margin: 4px 0 2px;
    padding-bottom: 8px;
    font-family: "Cinzel", Georgia, serif;
    font-size: 24px;
    letter-spacing: 0.06em;
    color: #ffffff;
    text-shadow: 0 0 14px rgba(var(--accent-rgb), 0.8);
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--accent), transparent) 1;
}

.card.hero > p {
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.35;
    margin: 8px 0;
}

.card.hero .stats {
    margin: 8px 0 12px;
    font-size: 14px;
}

.card.hero .stats li {
    padding: 5px 9px;
    margin-bottom: 4px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid rgba(var(--accent-rgb), 0.7);
}

.card.hero .stats li span {
    color: #94a3b8;
    font-weight: 600;
}

.card.hero .stats li b {
    color: #ffffff;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.card.hero .up-btn {
    min-width: 54px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 800;
    color: #3b2400;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.35);
    transition: transform 0.15s, filter 0.15s;
}

.card.hero .up-btn:hover {
    background: linear-gradient(135deg, #fef3c7, #fbbf24);
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.card.hero .stats .max {
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #fef3c7;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(251, 191, 36, 0.55);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.card.hero .buy-btn {
    width: 100%;
    padding: 10px 16px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
    background: linear-gradient(135deg, #a855f7, #38bdf8);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.4);
}

.card.hero .buy-btn:hover {
    filter: brightness(1.12);
}

.card.hero .owned {
    color: #86efac;
}

.card.hero > p:last-child {
    color: #fcd34d;
    font-weight: 700;
}

.shop .card.hero {
    flex: 0 0 210px;
    box-sizing: border-box;
}

/* карточки героев: шире, чтобы «Сила навыка» не переносилась; особенность заметнее */
.shop .card.hero {
    flex: 0 0 240px;
}

.card.hero .stats li {
    flex-wrap: nowrap;
    gap: 6px;
}

.card.hero .stats li span {
    white-space: nowrap;
    font-size: 13px;
}

.card.hero .stats .max {
    padding: 2px 7px;
    font-size: 10px;
}

.card.hero > p:not(:last-child),
.card.hero > h2 + p {
    margin: 10px 0 8px;
    padding: 8px 10px 8px 12px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: #ffffff;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.28), rgba(var(--accent-rgb), 0.06));
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.7);
}

.card.hero > h2 + p::before {
    content: "✦ ";
    color: var(--accent);
}

/* ===== кнопка атаки на телефоне (аниме-стиль) ===== */
#attack-btn {
    --atk-rim: #ff6b93;
    --atk-glow: rgba(255, 30, 86, 0.7);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    overflow: visible;
    border: 2.5px solid var(--atk-rim);
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.28) 0%, transparent 48%),
        linear-gradient(155deg, #4a0b24 0%, #190929 100%);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.45),
        inset 0 -6px 12px rgba(0, 0, 0, 0.65),
        0 8px 24px rgba(0, 0, 0, 0.65);
    transition: transform 0.12s cubic-bezier(0.22, 1, 0.36, 1), filter 0.14s ease;
}

#attack-btn::before {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 107, 147, 0.55);
    box-shadow: 0 0 22px var(--atk-glow), inset 0 0 14px var(--atk-glow);
    pointer-events: none;
    transition: transform 0.14s ease;
}

#attack-btn svg {
    width: 36px;
    height: 36px;
    color: #fff;
    filter: drop-shadow(0 0 8px var(--atk-glow));
    pointer-events: none;
}

#attack-btn .atk-label {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
    color: #fff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85), 0 0 10px var(--atk-glow);
    pointer-events: none;
}

body.touch #attack-btn,
body.touch #attack-btn.down,
#attack-btn.down {
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.28) 0%, transparent 48%),
        linear-gradient(155deg, #4a0b24 0%, #190929 100%);
}

#attack-btn.down,
body.touch #attack-btn.down {
    transform: scale(0.89);
    filter: brightness(1.3);
}

#attack-btn.down::before {
    transform: scale(1.1);
}

body.touch #attack-btn {
    width: 100px;
    height: 100px;
    font-size: 0;
}

/* ===== джойстик, переключатель и круглые стрелки ===== */
#stick-zone, #stick, #ctrl-toggle { display: none; }

body.touch #stick-zone {
    display: block;
    position: absolute;
    left: 0;
    top: 90px;
    bottom: 0;
    width: 46%;
    pointer-events: auto;
    touch-action: none;
}

body.touch #stick {
    display: block;
    position: absolute;
    left: 22px;
    bottom: 22px;
    width: 124px;
    height: 124px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.55) 0%, rgba(15, 23, 42, 0.25) 70%);
    border: 2px solid rgba(125, 211, 252, 0.45);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.25), inset 0 0 18px rgba(56, 189, 248, 0.2);
    opacity: 0.6;
    transition: opacity 0.15s;
}

body.touch #stick.active {
    opacity: 1;
    transition: none;
}

#stick-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.6) 0%, transparent 50%),
        linear-gradient(155deg, #38bdf8 0%, #6d28d9 100%);
    border: 2px solid #bae6fd;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55), 0 0 16px rgba(56, 189, 248, 0.6);
}

body.touch #ctrl-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 14px;
    bottom: 176px;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(125, 211, 252, 0.55);
    background: radial-gradient(circle at 30% 25%, rgba(30, 41, 82, 0.95), rgba(8, 13, 28, 0.96));
    color: #e0f2fe;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 0 8px rgba(56, 189, 248, 0.25);
    pointer-events: auto;
    touch-action: manipulation;
}

#ctrl-toggle svg { width: 20px; height: 20px; }
body.ctrl-stick #ctrl-toggle .ic-pad { display: none; }
body:not(.ctrl-stick) #ctrl-toggle .ic-stick { display: none; }

body.touch.ctrl-stick #dpad { display: none; }
body.touch:not(.ctrl-stick) #stick-zone,
body.touch:not(.ctrl-stick) #stick { display: none; }

body.touch #dpad .dp {
    border-radius: 50%;
    border: 2px solid rgba(125, 211, 252, 0.6);
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.22) 0%, transparent 50%),
        linear-gradient(155deg, #16213f 0%, #0a0e1f 100%);
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.5);
    color: #bae6fd;
    font-size: 18px;
    margin: 3px;
    transition: transform 0.1s, filter 0.1s;
}

body.touch #dpad .dp.down {
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.35) 0%, transparent 50%),
        linear-gradient(155deg, #38bdf8 0%, #6d28d9 100%);
    color: #fff;
    transform: scale(0.9);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.7);
}

/* ===== шапка магазина в тёмном аниме-стиле ===== */
.shop-inner > .card {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    padding: 10px 14px;
    border-radius: 16px;
    background: linear-gradient(170deg, #12142b 0%, #0a0c1c 100%);
    border: 1px solid rgba(251, 191, 36, 0.4);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 20px rgba(251, 191, 36, 0.12);
    color: #fde68a;
}

.shop-inner > .card > p {
    margin: 0;
}

.shop-inner > .card > p:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 8px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(251, 191, 36, 0.5);
    font-size: 18px;
    font-weight: 800;
    color: #fcd34d;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.45);
}

.shop-inner > .card > p:first-child::before {
    content: "";
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #fef9c3 0%, #facc15 45%, #b45309 100%);
    border: 2px solid #fde68a;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.6), inset 0 -3px 5px rgba(120, 53, 15, 0.5);
}

.shop-inner > .card > p:first-child strong {
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.shop-inner > .card > #notice {
    flex: 1;
    text-align: center;
    font-weight: 700;
    color: #fda4af;
}

.shop-inner > .card > #shop-close {
    order: 3;
    margin-left: auto;
    flex: none;
}

/* новые сложности */
#menu .level-btn[data-level="extreme"]::before {
    background: linear-gradient(135deg, #6d28d9, #c026d3);
    box-shadow: 0 8px 22px rgba(192, 38, 211, 0.4);
}

#menu .level-btn[data-level="hardcore"]::before {
    background: linear-gradient(135deg, #0a0a0a, #7f1d1d 55%, #dc2626);
    box-shadow: 0 8px 22px rgba(220, 38, 38, 0.5), 0 0 0 1px rgba(248, 113, 113, 0.5);
}

#menu-card #menu-levels {
    gap: 10px;
}

#menu-card .level-btn {
    padding-left: 18px;
    padding-right: 18px;
    font-size: 13px;
}

body.touch #menu-card .level-btn {
    padding: 9px 11px;
    font-size: 11px;
}

body.touch #menu-card #menu-levels {
    gap: 6px;
}

/* ===== удар врага по герою ===== */
#field.hurt::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 45%, rgba(239, 68, 68, 0.55) 100%);
    animation: hurtVignette 0.45s ease-out forwards;
}

@keyframes hurtVignette {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.impact {
    position: absolute;
    width: 0;
    height: 0;
    z-index: 3;
    pointer-events: none;
}

.impact-ring {
    position: absolute;
    left: -14px;
    top: -14px;
    width: 28px;
    height: 28px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 3px solid #fecaca;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.85), rgba(239, 68, 68, 0.35) 60%, transparent 70%);
    box-shadow: 0 0 18px #ef4444, 0 0 36px rgba(239, 68, 68, 0.7);
    animation: impactRing 0.5s ease-out forwards;
}

.impact-spark {
    position: absolute;
    left: -3px;
    top: -3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fca5a5;
    box-shadow: 0 0 8px #ef4444;
    animation: impactSpark 0.5s ease-out forwards;
}

.impact.shielded .impact-ring {
    border-color: #bae6fd;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.85), rgba(56, 189, 248, 0.35) 60%, transparent 70%);
    box-shadow: 0 0 18px #38bdf8, 0 0 36px rgba(56, 189, 248, 0.7);
}

.impact.shielded .impact-spark {
    background: #bae6fd;
    box-shadow: 0 0 8px #38bdf8;
}

@keyframes impactRing {
    0% { transform: scale(0.4); opacity: 1; }
    100% { transform: scale(4.2); opacity: 0; }
}

@keyframes impactSpark {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

#player.hit {
    animation: playerHit 0.6s linear;
}

@keyframes playerHit {
    0%, 40%, 80% { filter: brightness(2.2) drop-shadow(0 0 14px #ef4444) saturate(1.5); opacity: 1; }
    20%, 60% { filter: brightness(1) ; opacity: 0.35; }
    100% { filter: none; opacity: 1; }
}

/* ===== одна кнопка-меню вместо ряда кнопок ===== */
#topbtns-list {
    display: none;
    align-items: center;
    gap: 8px;
    animation: topListIn 0.22s ease-out;
}

#topbtns.open #topbtns-list {
    display: flex;
}

@keyframes topListIn {
    from { opacity: 0; transform: translateX(-14px); }
    to { opacity: 1; transform: translateX(0); }
}

#topbtns #menu-toggle {
    position: relative;
    flex: none;
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #c4b5fd;
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        linear-gradient(155deg, #3b1d7a 0%, #120a2e 100%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 14px rgba(168, 85, 247, 0.45), inset 0 -4px 8px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: transform 0.15s, filter 0.15s;
}

#topbtns #menu-toggle:hover { transform: scale(1.08); filter: brightness(1.15); }
#topbtns #menu-toggle:active { transform: scale(0.93); }

#menu-toggle span {
    display: block;
    width: 20px;
    height: 3px;
    border-radius: 2px;
    background: #f5f3ff;
    box-shadow: 0 0 6px rgba(196, 181, 253, 0.9);
    transition: transform 0.2s, opacity 0.2s;
}

#topbtns.open #menu-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#topbtns.open #menu-toggle span:nth-child(2) { opacity: 0; }
#topbtns.open #menu-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

body.touch #topbtns #menu-toggle {
    width: 42px;
    height: 42px;
    gap: 4px;
    padding: 0;
    border-radius: 50%;
}

body.touch #menu-toggle span {
    width: 16px;
    height: 2.5px;
}

body.touch #topbtns.open #menu-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
body.touch #topbtns.open #menu-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

body.touch #topbtns-list {
    gap: 6px;
}

/* ===== кнопки паузы: начать сначала и покинуть бой ===== */
#menu-actions {
    display: none;
    gap: 10px;
    width: 100%;
}

#menu.is-pause #menu-actions {
    display: flex;
}

#menu.is-pause #menu-levels {
    display: none;
}

#menu-actions button {
    position: relative;
    flex: 1;
    overflow: hidden;
    isolation: isolate;
    border: none;
    background: none;
    padding: 12px 14px;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: transform 0.16s ease, filter 0.16s ease;
}

#menu-actions button::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    border-radius: 12px;
    transform: skewX(-8deg);
}

#menu-actions button::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 55%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    transition: left 0.45s ease;
}

#menu-actions button:hover::after { left: 140%; }
#menu-actions button:hover { transform: translateY(-2px); filter: brightness(1.12); }
#menu-actions button:active { transform: scale(0.97); }

#restart-btn::before {
    background: linear-gradient(135deg, #0f766e, #2dd4bf);
    box-shadow: 0 8px 22px rgba(45, 212, 191, 0.3);
}

#leave-btn::before {
    background: linear-gradient(135deg, #7f1d1d, #ef4444);
    box-shadow: 0 8px 22px rgba(239, 68, 68, 0.35);
}

body.touch #menu-actions button {
    padding: 9px 10px;
    font-size: 12px;
}

/* ===== окно подтверждения и кнопка «Стереть данные» ===== */
#confirm {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(2, 4, 12, 0.78);
    backdrop-filter: blur(3px);
}

#confirm.hidden {
    display: none;
}

#confirm-card {
    width: min(92vw, 400px);
    box-sizing: border-box;
    padding: 20px 22px;
    border-radius: 18px;
    text-align: center;
    background: linear-gradient(170deg, #1a1030 0%, #0a0c1c 100%);
    border: 1px solid rgba(248, 113, 113, 0.55);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 26px rgba(239, 68, 68, 0.22);
    animation: confirmIn 0.18s ease-out;
}

@keyframes confirmIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

#confirm-title {
    margin: 0 0 8px;
    font-family: "Cinzel", Georgia, serif;
    font-size: 22px;
    letter-spacing: 0.05em;
    color: #fecaca;
    text-shadow: 0 0 14px rgba(239, 68, 68, 0.7);
}

#confirm-text {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.4;
    color: #cbd5e1;
}

#confirm-buttons {
    display: flex;
    gap: 10px;
}

#confirm-buttons button {
    position: relative;
    flex: 1;
    overflow: hidden;
    isolation: isolate;
    border: none;
    background: none;
    padding: 12px 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: transform 0.16s ease, filter 0.16s ease;
}

#confirm-buttons button::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 12px;
    transform: skewX(-8deg);
}

#confirm-no::before {
    background: linear-gradient(135deg, #0369a1, #38bdf8);
    box-shadow: 0 8px 22px rgba(56, 189, 248, 0.3);
}

#confirm-yes::before {
    background: linear-gradient(135deg, #7f1d1d, #ef4444);
    box-shadow: 0 8px 22px rgba(239, 68, 68, 0.35);
}

#confirm-buttons button:hover { transform: translateY(-2px); filter: brightness(1.12); }
#confirm-buttons button:active { transform: scale(0.97); }

#reset-btn {
    flex: none;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(248, 113, 113, 0.6);
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

#reset-btn:hover {
    background: rgba(239, 68, 68, 0.28);
    transform: translateY(-1px);
}

body.touch #reset-btn {
    padding: 5px 10px;
    font-size: 11px;
}

/* ===== Найра: гравитация ===== */
.hero-frame[data-hero="naira"] {
    --glow: 196, 181, 253;
    background: linear-gradient(145deg, #f5f3ff 0%, #8b5cf6 48%, #1e1b4b 100%);
}

.card.hero[data-card="naira"] { --accent: #c4b5fd; --accent-rgb: 196, 181, 253; }

.bullet[data-hero="naira"] {
    background: #e9d5ff;
    box-shadow: 0 0 8px 2px #c4b5fd;
}

#field.gravity::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 70%, rgba(139, 92, 246, 0.38) 0%, rgba(30, 27, 75, 0.45) 55%, transparent 80%);
    animation: gravityPulse 1.4s ease-in-out infinite;
}

@keyframes gravityPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.04); }
}

#field.gravity .enemy {
    filter: hue-rotate(250deg) brightness(0.8);
}

/* магазин: 4 героя в один ряд (Найра рядом с Арионом) */
.shop-inner {
    max-width: 1060px;
}

.heroes {
    justify-content: center;
}

/* сердечки строго по центру поля */
#lives,
body.touch #lives {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    margin: 0;
    max-width: 300px;
}

/* магазин: сетка по 4 героя в ряд, неполный последний ряд выровнен влево */
.heroes {
    display: grid;
    grid-template-columns: repeat(auto-fill, 240px);
    justify-content: center;
    gap: 20px;
}

.shop .card.hero {
    flex: none;
    width: 240px;
    margin-bottom: 0;
}

/* огненный взрыв Арии */
.burst {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;
    background: radial-gradient(circle, rgba(255, 237, 160, 0.85) 0%, rgba(251, 146, 60, 0.6) 40%, rgba(220, 38, 38, 0.35) 70%, rgba(220, 38, 38, 0) 100%);
    box-shadow: 0 0 30px 8px rgba(249, 115, 22, 0.7), inset 0 0 30px rgba(254, 215, 170, 0.6);
    transform-origin: center;
    animation: burst-boom 0.7s ease-out forwards;
}

@keyframes burst-boom {
    0% { transform: scale(0.1); opacity: 1; }
    70% { opacity: 0.9; }
    100% { transform: scale(1); opacity: 0; }
}

/* ===== Ария: огненный взрыв ===== */
.hero-frame[data-hero="aria"] {
    --glow: 251, 146, 60;
    background: linear-gradient(145deg, #fff7ed 0%, #f97316 48%, #450a0a 100%);
}

.card.hero[data-card="aria"] { --accent: #fb923c; --accent-rgb: 251, 146, 60; }

.bullet[data-hero="aria"] {
    background: #fde68a;
    box-shadow: 0 0 8px 2px #f97316;
}

/* лепестковый вихрь Сакуры */
.petal {
    position: absolute;
    width: 28px;
    height: 28px;
    pointer-events: none;
    z-index: 3;
    border-radius: 80% 0 80% 0;
    background: linear-gradient(135deg, #fff1f2 0%, #fda4af 55%, #fb7185 100%);
    border: 2px solid #111827;
    box-shadow: 0 0 12px 3px rgba(251, 113, 133, 0.75);
}

/* ===== Сакура: лепестковый вихрь ===== */
.hero-frame[data-hero="sakura"] {
    --glow: 251, 113, 133;
    background: linear-gradient(145deg, #fff1f2 0%, #fb7185 48%, #4c0519 100%);
}

.card.hero[data-card="sakura"] { --accent: #fb7185; --accent-rgb: 251, 113, 133; }

.bullet[data-hero="sakura"] {
    background: #fecdd3;
    box-shadow: 0 0 8px 2px #fb7185;
}

/* цепная молния Райдена */
.bolt {
    position: absolute;
    height: 4px;
    transform-origin: 0 50%;
    pointer-events: none;
    z-index: 3;
    background: linear-gradient(90deg, #ffffff, #fde047 50%, #60a5fa);
    box-shadow: 0 0 10px 3px rgba(250, 204, 21, 0.85), 0 0 22px 6px rgba(96, 165, 250, 0.5);
    border-radius: 2px;
    animation: bolt-flash 0.35s ease-out forwards;
}

@keyframes bolt-flash {
    0% { opacity: 1; }
    60% { opacity: 0.9; }
    100% { opacity: 0; }
}

/* ===== Райден: цепная молния ===== */
.hero-frame[data-hero="raiden"] {
    --glow: 250, 204, 21;
    background: linear-gradient(145deg, #fef9c3 0%, #3b82f6 48%, #0f172a 100%);
}

.card.hero[data-card="raiden"] { --accent: #facc15; --accent-rgb: 250, 204, 21; }

.bullet[data-hero="raiden"] {
    background: #fef08a;
    box-shadow: 0 0 8px 2px #60a5fa;
}

/* замедление времени Сёрена */
#field.timeslow::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 60%, rgba(186, 230, 253, 0.16) 0%, rgba(30, 64, 175, 0.3) 70%, rgba(15, 23, 42, 0.4) 100%);
    box-shadow: inset 0 0 60px rgba(125, 211, 252, 0.55);
    animation: timePulse 2s ease-in-out infinite;
}

@keyframes timePulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

#field.timeslow .enemy {
    filter: grayscale(0.6) brightness(0.9) saturate(1.4) hue-rotate(160deg);
}

/* ===== Сёрен: время ===== */
.hero-frame[data-hero="seren"] {
    --glow: 147, 197, 253;
    background: linear-gradient(145deg, #f0f9ff 0%, #60a5fa 48%, #0c1a3d 100%);
}

.card.hero[data-card="seren"] { --accent: #93c5fd; --accent-rgb: 147, 197, 253; }

.bullet[data-hero="seren"] {
    background: #e0f2fe;
    box-shadow: 0 0 8px 2px #60a5fa;
}

/* песчаная буря Зарека */
.sandwave {
    position: absolute;
    left: 0;
    width: 100%;
    height: 90px;
    margin-top: -45px;
    pointer-events: none;
    z-index: 3;
    background: linear-gradient(0deg, rgba(180, 120, 40, 0) 0%, rgba(217, 160, 70, 0.75) 50%, rgba(253, 224, 150, 0.2) 100%);
    box-shadow: 0 0 30px 10px rgba(217, 160, 70, 0.45);
    border-radius: 50% 50% 0 0 / 60% 60% 0 0;
    animation: sand-sweep 0.8s ease-out forwards;
}

@keyframes sand-sweep {
    0% { transform: translateY(40px) scaleY(0.4); opacity: 1; }
    100% { transform: translateY(-340px) scaleY(1.2); opacity: 0; }
}

/* двойники Леи */
.clone {
    position: absolute;
    pointer-events: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    box-sizing: border-box;
    object-fit: contain;
    max-width: none;
    z-index: 2;
    opacity: 0.55;
    filter: hue-rotate(160deg) saturate(1.6) drop-shadow(0 0 10px rgba(244, 114, 182, 0.9));
}

/* барьер Кайро */
.barrier {
    position: absolute;
    left: 0;
    width: 100%;
    height: 8px;
    margin-top: -4px;
    pointer-events: none;
    z-index: 3;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0), #fde68a 15%, #ffffff 50%, #fde68a 85%, rgba(251, 191, 36, 0));
    box-shadow: 0 0 16px 5px rgba(251, 191, 36, 0.8), 0 0 40px 12px rgba(180, 130, 20, 0.35);
    animation: barrierPulse 0.9s ease-in-out infinite;
}

@keyframes barrierPulse {
    0%, 100% { opacity: 0.75; }
    50% { opacity: 1; }
}

/* вампиризм Ноктиса */
#field.vamp::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 60%, rgba(127, 29, 29, 0) 40%, rgba(127, 29, 29, 0.5) 100%);
    box-shadow: inset 0 0 70px rgba(220, 38, 38, 0.6);
    animation: timePulse 1.4s ease-in-out infinite;
}

/* серия ударов Рин */
.slash {
    position: absolute;
    left: 0;
    width: 100%;
    height: 12px;
    margin-top: -6px;
    pointer-events: none;
    z-index: 3;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), #ffffff 20%, #fecaca 50%, #ffffff 80%, rgba(255, 255, 255, 0));
    box-shadow: 0 0 14px 4px rgba(255, 255, 255, 0.85), 0 0 30px 8px rgba(239, 68, 68, 0.6);
    border-radius: 3px;
    animation: bolt-flash 0.35s ease-out forwards;
}


/* ===== закрытый герой: затемнён, по центру аниме-замок ===== */
.hero-frame.locked img.portrait-media {
    filter: brightness(.28) saturate(.55) blur(.5px);
}
.hero-frame.locked:hover img.portrait-media { transform: none; }
.hero-frame.locked .fx-shimmer-layer,
.hero-frame.locked .fx-holo-layer,
.hero-frame.locked .fx-particles-layer { display: none; }
.hero-frame.locked .fx-aura-layer { opacity: .35; }
.hero-lock {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(251, 113, 133, .22), transparent 60%);
}
.hero-lock svg {
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, .7)) drop-shadow(0 4px 8px rgba(0, 0, 0, .7));
    animation: lock-float 3s ease-in-out infinite;
}
@keyframes lock-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}


/* ===== герой «скоро»: тёмная карточка со знаком вопроса ===== */
.soon-q {
    aspect-ratio: 1 / 1;
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 6%;
    box-sizing: border-box;
    font: 900 190px/1 sans-serif;
    color: rgba(255, 241, 184, .38);
    text-shadow: 0 0 24px rgba(251, 113, 133, .6);
    background:
        radial-gradient(circle at 50% 40%, rgba(251, 113, 133, .28), transparent 62%),
        linear-gradient(160deg, #1a1030, #070812);
}
.soon-label {
    color: #fde68a;
    font-weight: 700;
    letter-spacing: .5px;
}

/* ===== особый (миллионный) герой ===== */
.card.hero .soon-label.special {
    font-size: 1.05em;
    background: linear-gradient(90deg, #fde68a, #f472b6, #a78bfa, #67e8f9, #fde68a);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: special-shine 3s linear infinite;
}
.card.hero.special {
    border: 2px solid transparent;
    background:
        linear-gradient(#0d0f1e, #0d0f1e) padding-box,
        linear-gradient(135deg, #fde68a, #f472b6, #a78bfa, #67e8f9) border-box;
    box-shadow: 0 0 28px rgba(244, 114, 182, .35);
}
@keyframes special-shine {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ===== покупка героя: замок раскалывается ===== */
.lock-break { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.lb-dark { position: absolute; inset: 0; background: rgba(5, 6, 14, .72); animation: lb-dark .9s ease forwards; }
.lb-flash {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 241, 184, .95), rgba(251, 191, 36, .35) 40%, transparent 70%);
    opacity: 0; animation: lb-flash .5s ease-out forwards;
}
.lb-shard { position: absolute; inset: 0; animation: lb-fly .9s cubic-bezier(.2, .6, .4, 1) forwards; }
.lb-shard .hero-lock { background: none; }
.lb-shard .hero-lock svg { animation: none; }
@keyframes lb-dark { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes lb-flash { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.3); } }
@keyframes lb-fly {
    0% { transform: translate(0, 0) rotate(0); opacity: 1; }
    20% { opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}


/* ===== косметика: магазин пуль и фонов ===== */
#cosmetics { margin-top: 28px; }
.cos-title {
    border: none; padding: 0; margin: 26px 0 14px; text-align: center; color: #f5e9ff; font-size: 24px;
    text-shadow: 0 0 14px rgba(168, 85, 247, .6);
}
.cos-grid {
    display: grid; grid-template-columns: repeat(auto-fill, 150px);
    justify-content: center; gap: 16px;
}
.cos-card {
    box-sizing: border-box; width: 150px; padding: 10px; text-align: center; color: #fff;
    background: linear-gradient(180deg, #151833, #0d0f22);
    border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.cos-card.locked .cos-prev { filter: brightness(.55) saturate(.7); }
.cos-prev {
    position: relative; height: 90px; margin-bottom: 8px; border-radius: 10px; overflow: hidden;
    background: #1b1b2f; display: flex; align-items: center; justify-content: center;
}
.cos-bullet { position: relative; transform: scale(2); }
.cos-name { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.cos-btn {
    width: 100%; padding: 8px 6px; border: none; border-radius: 10px; cursor: pointer;
    font-weight: 700; font-size: 13px; color: #fff;
    background: linear-gradient(135deg, #a855f7, #38bdf8);
}
.cos-btn.buy { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.cos-btn.sel { background: rgba(52, 211, 153, .18); color: #6ee7b7; border: 1px solid #34d399; cursor: default; }
.cos-btn:not(.sel):hover { filter: brightness(1.12); }

/* ----- скины пуль (перекрывают цвет героя) ----- */
.bullet[data-skin="fire"][data-hero] {
    background: linear-gradient(to top, #ef4444, #fb923c 55%, #fde047);
    box-shadow: 0 0 10px 3px rgba(251, 146, 60, .8);
    border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
}
.bullet[data-skin="ice"][data-hero] {
    background: linear-gradient(to top, #38bdf8, #ffffff);
    box-shadow: 0 0 10px 3px rgba(125, 211, 252, .85);
    border-radius: 3px 3px 6px 6px;
}
.bullet[data-skin="rainbow"][data-hero] {
    background: linear-gradient(to top, #ef4444, #f59e0b, #facc15, #22c55e, #38bdf8, #a855f7, #ef4444);
    background-size: 100% 200%;
    box-shadow: 0 0 9px 2px rgba(255, 255, 255, .55);
    animation: bullet-rainbow .5s linear infinite;
}
@keyframes bullet-rainbow { to { background-position: 0 200%; } }
.bullet[data-skin="heart"][data-hero], .bullet[data-skin="star"][data-hero] {
    background: none; box-shadow: none; overflow: visible;
}
.bullet[data-skin="heart"][data-hero]::before, .bullet[data-skin="star"][data-hero]::before {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    line-height: 1; font-size: 22px;
}
.bullet[data-skin="heart"][data-hero]::before { content: "♥"; color: #fb7185; text-shadow: 0 0 8px #f43f5e; }
.bullet[data-skin="star"][data-hero]::before { content: "★"; color: #fde047; text-shadow: 0 0 8px #f59e0b; }

/* ----- фоны поля (и их превью в магазине) ----- */
#field[data-bg="nebula"], .cos-bg[data-bg="nebula"] {
    background:
        radial-gradient(ellipse at 20% 30%, rgba(168,85,247,.5), transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(56,189,248,.4), transparent 55%),
        radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
        radial-gradient(1px 1px at 90px 80px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 140px 20px, #cfe3ff, transparent),
        radial-gradient(1px 1px at 60px 130px, #fff, transparent),
        radial-gradient(1px 1px at 120px 110px, #ffe9f3, transparent),
        #0b0b1e;
    background-size: 100% 100%, 100% 100%, 160px 160px, 160px 160px, 160px 160px, 160px 160px, 160px 160px, auto;
}
#field[data-bg="sunset"], .cos-bg[data-bg="sunset"] {
    background:
        linear-gradient(to top, rgba(251,146,60,.55), rgba(244,63,94,.35) 40%, transparent 75%),
        radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
        radial-gradient(1px 1px at 90px 80px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 140px 20px, #cfe3ff, transparent),
        radial-gradient(1px 1px at 60px 130px, #fff, transparent),
        radial-gradient(1px 1px at 120px 110px, #ffe9f3, transparent),
        #1c1038;
    background-size: 100% 100%, 160px 160px, 160px 160px, 160px 160px, 160px 160px, 160px 160px, auto;
}
#field[data-bg="aurora"], .cos-bg[data-bg="aurora"] {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(52,211,153,.5), transparent 60%),
        radial-gradient(ellipse at 85% 25%, rgba(56,189,248,.35), transparent 55%),
        radial-gradient(ellipse at 15% 40%, rgba(168,85,247,.3), transparent 55%),
        radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
        radial-gradient(1px 1px at 90px 80px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 140px 20px, #cfe3ff, transparent),
        radial-gradient(1px 1px at 60px 130px, #fff, transparent),
        radial-gradient(1px 1px at 120px 110px, #ffe9f3, transparent),
        #06121f;
    background-size: 100% 100%, 100% 100%, 100% 100%, 160px 160px, 160px 160px, 160px 160px, 160px 160px, 160px 160px, auto;
}
#field[data-bg="sakura"], .cos-bg[data-bg="sakura"] {
    background:
        radial-gradient(ellipse at 70% 20%, rgba(251,113,133,.4), transparent 55%),
        radial-gradient(ellipse at 25% 80%, rgba(244,114,182,.3), transparent 55%),
        radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
        radial-gradient(1px 1px at 90px 80px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 140px 20px, #cfe3ff, transparent),
        radial-gradient(1px 1px at 60px 130px, #fff, transparent),
        radial-gradient(1px 1px at 120px 110px, #ffe9f3, transparent),
        #1a0f22;
    background-size: 100% 100%, 100% 100%, 160px 160px, 160px 160px, 160px 160px, 160px 160px, 160px 160px, auto;
}
#field[data-bg="void"], .cos-bg[data-bg="void"] {
    background:
        radial-gradient(circle at 50% 50%, rgba(0,0,0,.9) 0%, rgba(30,10,60,.6) 35%, transparent 70%),
        radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
        radial-gradient(1px 1px at 90px 80px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 140px 20px, #cfe3ff, transparent),
        radial-gradient(1px 1px at 60px 130px, #fff, transparent),
        radial-gradient(1px 1px at 120px 110px, #ffe9f3, transparent),
        #04040c;
    background-size: 100% 100%, 160px 160px, 160px 160px, 160px 160px, 160px 160px, 160px 160px, auto;
}


/* ===== живые фоны (самые дорогие) ===== */
#field[data-bg="sakura"], .cos-bg[data-bg="sakura"] {
    background-size: 170% 170%, 170% 170%, 160px 160px, 160px 160px, 160px 160px, 160px 160px, 160px 160px, auto;
    animation: bg-sakura 16s linear infinite;
}
@keyframes bg-sakura {
    0% { background-position: 0% 0%, 100% 100%, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
    50% { background-position: 100% 50%, 0% 40%, 80px 160px, 80px 160px, 80px 160px, 80px 160px, 80px 160px, 0 0; }
    100% { background-position: 0% 0%, 100% 100%, 160px 320px, 160px 320px, 160px 320px, 160px 320px, 160px 320px, 0 0; }
}
#field[data-bg="void"], .cos-bg[data-bg="void"] {
    background-position: 50% 50%, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
    background-repeat: no-repeat, repeat, repeat, repeat, repeat, repeat, repeat;
    animation: bg-void 10s ease-in-out infinite;
}
@keyframes bg-void {
    0%, 100% { background-size: 100% 100%, 160px 160px, 160px 160px, 160px 160px, 160px 160px, 160px 160px, auto; background-position: 50% 50%, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
    50% { background-size: 160% 160%, 160px 160px, 160px 160px, 160px 160px, 160px 160px, 160px 160px, auto; background-position: 50% 50%, 0 160px, 0 160px, 0 160px, 0 160px, 0 160px, 0 0; }
}
.cos-badge {
    position: absolute; top: 4px; right: 6px; font-size: 14px; line-height: 1;
    text-shadow: 0 0 6px rgba(253, 224, 71, .9);
}
@media (prefers-reduced-motion: reduce) {
    #field[data-bg], .cos-bg[data-bg] { animation: none; }
}


/* ===== значки за достижения ===== */
.bdg-grid { grid-template-columns: repeat(auto-fill, 170px); }
.bdg-grid .cos-card { width: 170px; }
.bdg-ring {
    width: 74px; height: 74px; margin: 4px auto 10px; border-radius: 50%; padding: 4px; box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
}
.bdg-ring span {
    width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 32px; line-height: 1; background: radial-gradient(circle at 35% 30%, #2a2f5a, #0d0f22);
}
.bdg-ring.bronze, .bdg-pill.bronze { background: linear-gradient(135deg, #fcd9a8, #b45309 55%, #78350f); }
.bdg-ring.silver, .bdg-pill.silver { background: linear-gradient(135deg, #ffffff, #94a3b8 55%, #475569); }
.bdg-ring.gold,   .bdg-pill.gold   { background: linear-gradient(135deg, #fff1b8, #f59e0b 55%, #92400e); }
.bdg-ring.rainbow, .bdg-pill.rainbow {
    background: conic-gradient(from 0deg, #f43f5e, #f59e0b, #facc15, #22c55e, #38bdf8, #a855f7, #f43f5e);
}
.bdg-ring.rainbow { animation: bdg-spin 6s linear infinite; }
.bdg-ring.rainbow span { animation: bdg-spin-back 6s linear infinite; }
@keyframes bdg-spin { to { transform: rotate(360deg); } }
@keyframes bdg-spin-back { to { transform: rotate(-360deg); } }
.bdg-card.locked .bdg-ring { filter: grayscale(1) brightness(.55); }
.bdg-card.locked .bdg-ring span { opacity: .5; }
.bdg-desc { min-height: 34px; margin: -2px 0 8px; font-size: 12px; line-height: 1.3; color: #b8bfe0; }
.bdg-progress { height: 8px; border-radius: 6px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.bdg-progress i { display: block; height: 100%; background: linear-gradient(90deg, #a855f7, #38bdf8); }
.bdg-count { margin-top: 5px; font-size: 12px; color: #9aa3cc; }

/* значок в меню игры */
#menu-badge:empty, #menu-new-badge:empty { display: none; }
#menu-badge { text-align: center; margin-bottom: 8px; }
.bdg-pill {
    display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 800;
    color: #111; text-shadow: 0 0 6px rgba(255, 255, 255, .4);
}
#menu-new-badge {
    text-align: center; margin-bottom: 8px; font-weight: 800; color: #fde047;
    text-shadow: 0 0 10px rgba(250, 204, 21, .7);
}


/* ===== Аврора: более заметное переливание (лучи света + движущиеся пятна) ===== */
#field[data-bg="aurora"], .cos-bg[data-bg="aurora"] {
    background:
        linear-gradient(100deg, transparent 0%, rgba(52,211,153,.28) 50%, transparent 100%),
        linear-gradient(80deg, transparent 0%, rgba(168,85,247,.24) 50%, transparent 100%),
        radial-gradient(ellipse at 50% 0%, rgba(52,211,153,.65), transparent 60%),
        radial-gradient(ellipse at 85% 25%, rgba(56,189,248,.5), transparent 55%),
        radial-gradient(ellipse at 15% 40%, rgba(168,85,247,.45), transparent 55%),
        radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
        radial-gradient(1px 1px at 90px 80px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 140px 20px, #cfe3ff, transparent),
        radial-gradient(1px 1px at 60px 130px, #fff, transparent),
        radial-gradient(1px 1px at 120px 110px, #ffe9f3, transparent),
        #06121f;
    background-size: 320px 100%, 520px 100%, 170% 170%, 170% 170%, 170% 170%, 160px 160px, 160px 160px, 160px 160px, 160px 160px, 160px 160px, auto;
    background-repeat: repeat-x, repeat-x, no-repeat, no-repeat, no-repeat, repeat, repeat, repeat, repeat, repeat, repeat;
    animation: bg-aurora 9s linear infinite;
}
@keyframes bg-aurora {
    0% { background-position: 0 0, 0 0, 0% 0%, 100% 30%, 20% 100%, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
    50% { background-position: 160px 0, -260px 0, 100% 40%, 0% 70%, 80% 0%, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 320px 0, -520px 0, 0% 0%, 100% 30%, 20% 100%, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
}

.bdg-ring span img.bdg-img {
    display: block; width: 100%; height: 100%; max-width: none; margin: 0; padding: 0;
    border: none; border-radius: 50%; background: none;
}
.bdg-pill img.bdg-mini {
    display: inline-block; width: 20px; height: 20px; max-width: none; margin: 0 6px 0 -6px; padding: 0;
    border: none; border-radius: 50%; background: none; vertical-align: -5px;
}


/* ===== расходники ===== */
.items-sub { text-align: center; color: #b8bfe0; margin: -6px 0 14px; font-size: 14px; }
.item-ico {
    width: 68px; height: 68px; margin: 2px auto 10px; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center; font-size: 34px; line-height: 1;
    background: radial-gradient(circle at 35% 30%, #2a2f5a, #0d0f22); border: 2px solid rgba(255, 255, 255, .22);
}
.item-ico img.item-img, .item-chip img.item-img {
    display: block; width: 100%; height: 100%; max-width: none; margin: 0; padding: 0;
    border: none; border-radius: 50%; background: none; object-fit: cover;
}
.item-stock { margin-bottom: 8px; }
.item-stock b { color: #fde047; }
.item-card .bdg-desc { min-height: 34px; }

/* выбор расходников в меню перед боем */
#menu-items { display: flex; justify-content: center; gap: 12px; margin: 0 0 12px; }
#menu-items:empty { display: none; }
.item-chip {
    position: relative; width: 52px; height: 52px; padding: 0; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1; color: #fff;
    background: #10132a; border: 2px solid rgba(255, 255, 255, .25); opacity: .5;
}
.item-chip.on { opacity: 1; border-color: #fde047; box-shadow: 0 0 12px rgba(253, 224, 71, .6); }
.item-chip.empty { cursor: default; filter: grayscale(1); opacity: .35; }
.item-chip b {
    position: absolute; right: -6px; bottom: -4px; padding: 0 6px; font-size: 12px; line-height: 17px;
    background: #0d0f22; border: 1px solid rgba(255, 255, 255, .35); border-radius: 10px;
}
.items-off { width: 100%; text-align: center; font-size: 13px; color: #9aa3cc; }

/* значки включённых расходников возле сердец */
.item-mark { margin-left: 8px; font-size: 18px; filter: drop-shadow(0 0 6px rgba(253, 224, 71, .8)); }


/* ===== дроны-помощники ===== */
.chip-sep { width: 2px; align-self: stretch; margin: 6px 2px; background: rgba(255, 255, 255, .18); border-radius: 2px; }
#menu-items { flex-wrap: wrap; }
.drone {
    position: absolute; z-index: 4; width: 44px; height: 44px; border-radius: 50%; pointer-events: none;
    display: flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1; overflow: visible;
    background: radial-gradient(circle at 35% 30%, #2a2f5a, #0d0f22); border: 2px solid var(--dc, #38bdf8);
    box-shadow: 0 0 12px 2px var(--dc, #38bdf8); animation: drone-float 1.4s ease-in-out infinite;
}
.drone.gunner { --dc: #38bdf8; }
.drone.guard  { --dc: #34d399; }
.drone.medic  { --dc: #f472b6; }
.drone img {
    display: block; width: 100%; height: 100%; max-width: none; margin: 0; padding: 0;
    border: none; border-radius: 50%; background: none; object-fit: cover;
}
@keyframes drone-float { 0%, 100% { margin-top: 0; } 50% { margin-top: -5px; } }
.drone.hit { animation: drone-hit .35s ease-out; }
@keyframes drone-hit { 0% { filter: brightness(3); transform: scale(1.35); } 100% { filter: none; transform: scale(1); } }
.drone.pop { animation: drone-pop .35s ease-in forwards; }
@keyframes drone-pop { to { transform: scale(1.8); opacity: 0; } }
.drone.heal { animation: drone-heal .6s ease-out; }
@keyframes drone-heal { 0% { box-shadow: 0 0 0 0 rgba(244, 114, 182, .9); } 100% { box-shadow: 0 0 0 28px rgba(244, 114, 182, 0); } }


/* ===== окно «Ещё» в магазине ===== */
#extras-btn {
    flex: none; order: 2; padding: 8px 18px; border-radius: 999px; cursor: pointer;
    border: 1px solid rgba(192, 132, 252, .7); color: #f5e9ff; font-weight: 800; font-size: 14px;
    background: linear-gradient(135deg, #7c3aed, #c026d3);
    box-shadow: 0 6px 18px rgba(168, 85, 247, .4);
    transition: transform .15s, filter .15s;
}
#extras-btn:hover { transform: translateY(-2px); filter: brightness(1.12); }
.shop-inner > .card > #extras-btn { margin-left: auto; }
.shop-inner > .card > #extras-btn + * { }
.shop-inner > .card > #shop-close { margin-left: 0; }

#extras {
    position: fixed; inset: 0; z-index: 12; overflow: auto; padding: 20px;
    background: #070914;
}
#extras.hidden { display: none; }
.extras-inner { max-width: 1060px; margin: 0 auto; }
.extras-bar {
    display: flex; align-items: center; gap: 16px; padding: 10px 14px; margin-bottom: 8px;
    border-radius: 16px; border: 1px solid rgba(192, 132, 252, .5);
    background: linear-gradient(170deg, #12142b 0%, #0a0c1c 100%);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
    position: sticky; top: 0; z-index: 2;
}
.extras-bar p { margin: 0; }
.extras-coins {
    display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 8px; border-radius: 999px;
    background: rgba(245, 158, 11, .14); border: 1px solid rgba(251, 191, 36, .5);
    font-size: 18px; font-weight: 800; color: #fcd34d;
}
.extras-coins::before {
    content: ""; width: 26px; height: 26px; border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #fef9c3 0%, #facc15 45%, #b45309 100%);
    border: 2px solid #fde68a;
}
.extras-coins strong { color: #fff; font-variant-numeric: tabular-nums; }
#extras-notice { flex: 1; text-align: center; font-weight: 700; color: #fda4af; }
#extras-close {
    flex: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; position: relative;
    border: 2px solid #ec4899; background: radial-gradient(circle, #831843, #1f0a1a);
    color: #fff; box-shadow: 0 0 14px rgba(236, 72, 153, .5);
}
#extras-close::before, #extras-close::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 3px; border-radius: 2px;
    background: #fff; transform: translate(-50%, -50%) rotate(45deg);
}
#extras-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
#extras-body > :first-child .cos-title { margin-top: 12px; }


/* ===== Зарек: песок ===== */
.hero-frame[data-hero="zarek"] {
    --glow: 251, 191, 36;
    background: linear-gradient(145deg, #fef3c7 0%, #f59e0b 48%, #3b1d06 100%);
}

.card.hero[data-card="zarek"] { --accent: #fbbf24; --accent-rgb: 251, 191, 36; }

.bullet[data-hero="zarek"] {
    background: #fde68a;
    box-shadow: 0 0 8px 2px #f59e0b;
}


/* ===== Рин: клинок ===== */
.hero-frame[data-hero="rin"] {
    --glow: 52, 211, 153;
    background: linear-gradient(145deg, #ecfdf5 0%, #10b981 48%, #022c22 100%);
}

.card.hero[data-card="rin"] { --accent: #34d399; --accent-rgb: 52, 211, 153; }

.bullet[data-hero="rin"] {
    background: #d1fae5;
    box-shadow: 0 0 8px 2px #10b981;
}


/* ===== Эрис: хаос ===== */
.hero-frame[data-hero="eris"] {
    --glow: 217, 70, 239;
    background: linear-gradient(145deg, #fdf4ff 0%, #c026d3 48%, #1e0a3c 100%);
}

.card.hero[data-card="eris"] { --accent: #d946ef; --accent-rgb: 217, 70, 239; }

.bullet[data-hero="eris"] {
    background: #f5d0fe;
    box-shadow: 0 0 8px 2px #d946ef;
}


/* ===== Кайро: барьер ===== */
.hero-frame[data-hero="kairo"] {
    --glow: 251, 191, 36;
    background: linear-gradient(145deg, #fef9c3 0%, #2563eb 48%, #0b1230 100%);
}

.card.hero[data-card="kairo"] { --accent: #fbbf24; --accent-rgb: 251, 191, 36; }

.bullet[data-hero="kairo"] {
    background: #fde68a;
    box-shadow: 0 0 8px 2px #3b82f6;
}


/* ===== Ноктис: вампиризм ===== */
.hero-frame[data-hero="noctis"] {
    --glow: 244, 63, 94;
    background: linear-gradient(145deg, #ffe4e6 0%, #be123c 48%, #1a0508 100%);
}

.card.hero[data-card="noctis"] { --accent: #f43f5e; --accent-rgb: 244, 63, 94; }

.bullet[data-hero="noctis"] {
    background: #fecdd3;
    box-shadow: 0 0 8px 2px #e11d48;
}


/* ===== Лея: клоны ===== */
.hero-frame[data-hero="leya"] {
    --glow: 34, 211, 238;
    background: linear-gradient(145deg, #ecfeff 0%, #06b6d4 48%, #03131a 100%);
}

.card.hero[data-card="leya"] { --accent: #22d3ee; --accent-rgb: 34, 211, 238; }

.bullet[data-hero="leya"] {
    background: #cffafe;
    box-shadow: 0 0 8px 2px #06b6d4;
}


/* ===== Гелиос: солнечный луч ===== */
.hero-frame[data-hero="helios"] {
    --glow: 251, 191, 36;
    background: linear-gradient(145deg, #fffbeb 0%, #f59e0b 48%, #1c1203 100%);
}

.card.hero[data-card="helios"] { --accent: #fbbf24; --accent-rgb: 251, 191, 36; }

.bullet[data-hero="helios"] {
    background: #fef3c7;
    box-shadow: 0 0 8px 2px #f59e0b;
}

.sunbeam {
    position: absolute;
    top: 0;
    pointer-events: none;
    z-index: 3;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(253, 230, 138, 0.9) 25%, #ffffff 50%, rgba(253, 230, 138, 0.9) 75%, rgba(255, 255, 255, 0));
    box-shadow: 0 0 24px 8px rgba(251, 191, 36, 0.7), 0 0 60px 20px rgba(245, 158, 11, 0.35);
    animation: sunbeamPulse 0.25s ease-in-out infinite alternate;
}

@keyframes sunbeamPulse {
    from { opacity: 0.8; }
    to { opacity: 1; }
}


/* ===== Орин: вихрь клинков ===== */
.hero-frame[data-hero="orin"] {
    --glow: 249, 115, 22;
    background: linear-gradient(145deg, #fed7aa 0%, #ea580c 48%, #120a06 100%);
}

.card.hero[data-card="orin"] { --accent: #f97316; --accent-rgb: 249, 115, 22; }

.bullet[data-hero="orin"] {
    background: #ffedd5;
    box-shadow: 0 0 8px 2px #ea580c;
}

.boomblade {
    position: absolute;
    width: 56px;
    height: 56px;
    pointer-events: none;
    z-index: 3;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #fff 0 8%, transparent 8% 22%, #f97316 22% 30%, transparent 30% 50%, #fff 50% 58%, transparent 58% 72%, #f97316 72% 80%, transparent 80%);
    -webkit-mask: radial-gradient(circle, transparent 0 22%, #000 23%);
    mask: radial-gradient(circle, transparent 0 22%, #000 23%);
    filter: drop-shadow(0 0 7px rgba(249, 115, 22, 0.95));
}

.orbblade {
    position: absolute;
    width: 56px;
    height: 16px;
    pointer-events: none;
    z-index: 3;
    border-radius: 50% 50% 50% 50% / 100% 100% 0 0;
    background: linear-gradient(180deg, #ffffff 0%, #d4d4d8 45%, #f97316 100%);
    box-shadow: 0 0 10px 3px rgba(249, 115, 22, 0.85), 0 0 22px 6px rgba(251, 146, 60, 0.45);
}


/* ===== Вайра: токсин ===== */
.hero-frame[data-hero="vaira"] {
    --glow: 132, 204, 22;
    background: linear-gradient(145deg, #f7fee7 0%, #65a30d 48%, #05140a 100%);
}

.card.hero[data-card="vaira"] { --accent: #84cc16; --accent-rgb: 132, 204, 22; }

.bullet[data-hero="vaira"] {
    background: #ecfccb;
    box-shadow: 0 0 8px 2px #65a30d;
}

.toxincloud {
    position: absolute;
    pointer-events: none;
    z-index: 2;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(190, 242, 100, 0.55) 0%, rgba(101, 163, 13, 0.4) 55%, rgba(21, 128, 61, 0) 72%);
    box-shadow: 0 0 40px 14px rgba(132, 204, 22, 0.35);
    animation: toxinPulse 1.1s ease-in-out infinite alternate;
}

@keyframes toxinPulse {
    from { transform: scale(0.94); opacity: 0.8; }
    to { transform: scale(1.04); opacity: 1; }
}


/* ===== Нокс: порталы ===== */
.hero-frame[data-hero="nox"] {
    --glow: 168, 85, 247;
    background: linear-gradient(145deg, #faf5ff 0%, #9333ea 48%, #0d0418 100%);
}

.card.hero[data-card="nox"] { --accent: #a855f7; --accent-rgb: 168, 85, 247; }

.bullet[data-hero="nox"] {
    background: #f3e8ff;
    box-shadow: 0 0 8px 2px #9333ea;
}

.portal {
    position: absolute;
    pointer-events: none;
    z-index: 2;
    border-radius: 50%;
    background: radial-gradient(ellipse, #05010a 30%, #6d28d9 62%, #c084fc 78%, rgba(192, 132, 252, 0) 100%);
    box-shadow: 0 0 22px 8px rgba(168, 85, 247, 0.75);
    animation: portalPulse 0.7s ease-in-out infinite alternate;
}

@keyframes portalPulse {
    from { transform: scale(0.92); }
    to { transform: scale(1.06); }
}


/* ===== Торн: землетрясение ===== */
.hero-frame[data-hero="thorn"] {
    --glow: 20, 184, 166;
    background: linear-gradient(145deg, #ccfbf1 0%, #0f766e 48%, #04100f 100%);
}

.card.hero[data-card="thorn"] { --accent: #14b8a6; --accent-rgb: 20, 184, 166; }

.bullet[data-hero="thorn"] {
    background: #ccfbf1;
    box-shadow: 0 0 8px 2px #14b8a6;
}

.quakewave {
    position: absolute;
    left: 0;
    width: 100%;
    height: 14px;
    margin-top: -7px;
    pointer-events: none;
    z-index: 3;
    background: linear-gradient(90deg, rgba(94, 234, 212, 0), #5eead4 20%, #ffffff 50%, #5eead4 80%, rgba(94, 234, 212, 0));
    box-shadow: 0 0 18px 6px rgba(20, 184, 166, 0.8);
    animation: bolt-flash 0.6s ease-out forwards;
}

#field.shake {
    animation: fieldShake 0.25s linear;
}

@keyframes fieldShake {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-4px, 3px); }
    50% { transform: translate(4px, -3px); }
    75% { transform: translate(-3px, -2px); }
    100% { transform: translate(0, 0); }
}

/* ===== Мира: рассвет ===== */
.hero-frame[data-hero="mira"] {
    --glow: 249, 168, 212;
    background: linear-gradient(145deg, #fff1f2 0%, #f472b6 48%, #1a0612 100%);
}

.card.hero[data-card="mira"] { --accent: #f472b6; --accent-rgb: 244, 114, 182; }

.bullet[data-hero="mira"] {
    background: #fce7f3;
    box-shadow: 0 0 8px 2px #f472b6;
}

.dawnflash {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    background: radial-gradient(circle at 50% 100%, rgba(255, 241, 242, 0.95) 0%, rgba(251, 207, 232, 0.6) 40%, rgba(253, 230, 138, 0) 80%);
    animation: bolt-flash 0.9s ease-out forwards;
}


/* ===== названия навыков и песчаная буря ===== */
.skillname {
    position: absolute;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 6;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: 1px;
    white-space: nowrap;
    text-shadow: 0 0 10px currentColor, 0 0 22px currentColor, 0 2px 4px rgba(0, 0, 0, 0.9);
    animation: skillnameRise 1.3s ease-out forwards;
}

@keyframes skillnameRise {
    0% { opacity: 0; transform: translate(-50%, 10px) scale(0.7); }
    15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
    70% { opacity: 1; transform: translate(-50%, -26px) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -48px) scale(1); }
}

.sandstormfx {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 100%, rgba(217, 160, 70, 0.35) 0%, rgba(180, 120, 40, 0.2) 55%, rgba(120, 80, 20, 0.28) 100%);
    animation: sandFade linear forwards;
}

.sandstormfx::before,
.sandstormfx::after {
    content: "";
    position: absolute;
    inset: -40px;
    background-image:
        radial-gradient(ellipse 9px 1.6px, rgba(253, 224, 150, 0.85) 0 60%, transparent 100%),
        radial-gradient(ellipse 5px 1.2px, rgba(251, 191, 36, 0.75) 0 60%, transparent 100%);
    background-size: 97px 33px, 61px 47px;
    animation: sandDrift 0.7s linear infinite;
}

.sandstormfx::after {
    background-size: 131px 53px, 73px 29px;
    background-position: 40px 20px, 10px 5px;
    animation-duration: 0.5s;
    opacity: 0.7;
}

@keyframes sandDrift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 291px 20px, 183px 14px; }
}

@keyframes sandFade {
    0% { opacity: 0; }
    10% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; }
}


/* ===== эффекты навыков ===== */
.fx {
    position: absolute;
    pointer-events: none;
    z-index: 2;
}

.fxring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid var(--c);
    box-shadow: 0 0 18px var(--c), inset 0 0 18px var(--c);
    transform: translate(-50%, -50%) scale(0.2);
    animation: fxRing ease-out both;
}

@keyframes fxRing {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
    10% { opacity: 0.95; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(var(--s)); }
}

.fxflash {
    inset: 0;
    background: var(--c);
    animation: fxFlash ease-out forwards;
}

@keyframes fxFlash {
    0% { opacity: 0.55; }
    100% { opacity: 0; }
}

.fxtint {
    inset: 0;
    animation: fxTint ease-in-out forwards;
}

@keyframes fxTint {
    0% { opacity: 0; }
    12% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; }
}

.fxdrop {
    color: var(--c);
    line-height: 1;
    text-shadow: 0 0 8px var(--c);
    opacity: 0;
    animation: fxFall linear both;
}

@keyframes fxFall {
    0% { opacity: 0; transform: translateY(0) rotate(0deg); }
    10% { opacity: 0.95; }
    85% { opacity: 0.9; }
    100% { opacity: 0; transform: translateY(var(--h)) rotate(var(--r)); }
}

.fxvortex {
    width: 190px;
    height: 190px;
    margin: -95px 0 0 -95px;
    border-radius: 50%;
    background:
        radial-gradient(circle, #000 0 22%, rgba(15, 5, 30, 0.9) 30%, rgba(124, 58, 237, 0.0) 62%),
        repeating-conic-gradient(from 0deg, rgba(192, 132, 252, 0.55) 0 8deg, rgba(76, 29, 149, 0) 8deg 30deg);
    box-shadow: 0 0 40px 10px rgba(124, 58, 237, 0.55);
    animation: fxVortex linear forwards;
}

@keyframes fxVortex {
    0% { opacity: 0; transform: scale(0.2) rotate(0deg); }
    8% { opacity: 1; transform: scale(1) rotate(60deg); }
    90% { opacity: 1; transform: scale(1) rotate(1500deg); }
    100% { opacity: 0; transform: scale(0.4) rotate(1700deg); }
}

.fxclock {
    width: 210px;
    height: 210px;
    margin: -105px 0 0 -105px;
    border-radius: 50%;
    border: 5px solid rgba(125, 211, 252, 0.8);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.7), inset 0 0 30px rgba(56, 189, 248, 0.45);
    background:
        repeating-conic-gradient(from 0deg, rgba(186, 230, 253, 0.9) 0 2deg, rgba(0, 0, 0, 0) 2deg 30deg);
    -webkit-mask: radial-gradient(circle, transparent 0 62%, #000 63% 100%);
    mask: radial-gradient(circle, transparent 0 62%, #000 63% 100%);
    animation: fxClock linear forwards;
}

.fxclock::before,
.fxclock::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    background: #7dd3fc;
    box-shadow: 0 0 10px #38bdf8;
    transform-origin: 50% 100%;
}

@keyframes fxClock {
    0% { opacity: 0; transform: scale(0.5) rotate(0deg); }
    10% { opacity: 1; transform: scale(1) rotate(-60deg); }
    90% { opacity: 1; transform: scale(1) rotate(-540deg); }
    100% { opacity: 0; transform: scale(1.3) rotate(-620deg); }
}


/* ===== режим выживания: таймер ===== */
#time-hud {
    position: absolute;
    top: 88px;
    right: 10px;
    color: #a5f3fc;
    font-weight: bold;
    z-index: 1;
}

#time-hud.hidden {
    display: none;
}

body.touch #time-hud {
    font-size: 13px;
    right: 8px;
    top: 60px;
}

#stats-panel #time-hud {
    position: static;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 14px;
}

#stats-panel #time-hud.hidden {
    display: none;
}

#menu .level-btn[data-level="survival"]::before {
    background: linear-gradient(135deg, #042f2e, #0f766e 55%, #2dd4bf);
    box-shadow: 0 8px 22px rgba(45, 212, 191, 0.45), 0 0 0 1px rgba(94, 234, 212, 0.5);
}


/* ===== максимум характеристики рядом с текущим значением ===== */
.stats li .stat-max {
    margin-left: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #fcd34d;
    opacity: 0.85;
    white-space: nowrap;
}

.card.hero .stats li { gap: 4px; }
.card.hero .stats li span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.hero .stats li b { white-space: nowrap; }
.card.hero .stats li .stat-max { margin-left: 2px; }
.card.hero .stats li .up-btn { min-width: 44px; padding: 3px 7px; flex-shrink: 0; }
.card.hero .stats li span { letter-spacing: 0; font-size: 12px; }
.card.hero .stats li .up-btn { min-width: 50px; font-size: 11.5px; padding: 3px 6px; }
.card.hero .stats li .up-btn { min-width: 0; font-size: 11px; padding: 3px 5px; }
.card.hero .stats li .stat-max { font-size: 10.5px; }

.up-btn {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

/* пока открыто меню (пауза, конец боя), эффекты навыков не рисуем поверх него */
#field:has(#menu:not(.hidden)) .sunbeam,
#field:has(#menu:not(.hidden)) .fx,
#field:has(#menu:not(.hidden)) .skillname,
#field:has(#menu:not(.hidden)) .toxincloud,
#field:has(#menu:not(.hidden)) .portal,
#field:has(#menu:not(.hidden)) .boomblade,
#field:has(#menu:not(.hidden)) .orbblade,
#field:has(#menu:not(.hidden)) .quakewave,
#field:has(#menu:not(.hidden)) .dawnflash,
#field:has(#menu:not(.hidden)) .sandstormfx,
#field:has(#menu:not(.hidden)) .slash,
#field:has(#menu:not(.hidden)) .barrier {
    visibility: hidden;
}

nav.menu .brand {
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 1.5px;
    margin-right: auto;
}


/* ===== кнопка и окно настроек ===== */
#topbtns #settings-btn {
    position: relative;
    width: 56px;
    height: 56px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.22s;
    -webkit-tap-highlight-color: transparent;
}
body.touch #topbtns #settings-btn { width: 44px; height: 44px; }
#settings-btn .gear-ring, #settings-btn .gear-core { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
#settings-btn svg { width: 100%; height: 100%; overflow: visible; }
#settings-btn .gear-core { animation: gearCW 9s linear infinite; }
#settings-btn .gear-ring { animation: gearCCW 12s linear infinite; }
@keyframes gearCW { to { transform: rotate(360deg); } }
@keyframes gearCCW { to { transform: rotate(-360deg); } }
#settings-btn:hover { transform: scale(1.1); }
#settings-btn:active { transform: scale(0.92); }
#settings-btn:hover .gear-core { animation-duration: 3.5s; }
#settings-btn .ring-kawaii, #settings-btn .ring-persona { display: none; }
#settings-btn .gp { fill: #0b1021; stroke: url(#gg-c); stroke-width: 2.6; }
#settings-btn .gc { fill: #070914; stroke: #00f0ff; stroke-width: 2.2; }
#settings-btn .gd { fill: #fff; }
#settings-btn { filter: drop-shadow(0 0 8px rgba(0, 240, 255, .55)); }
#settings-btn.gear-kawaii { filter: drop-shadow(0 0 9px rgba(255, 105, 180, .7)); }
#settings-btn.gear-kawaii .ring-cyber, #settings-btn.gear-persona .ring-cyber { display: none; }
#settings-btn.gear-kawaii .ring-kawaii, #settings-btn.gear-persona .ring-persona { display: inline; }
#settings-btn.gear-kawaii .gp { fill: url(#gg-k); stroke: #fff; }
#settings-btn.gear-kawaii .gc { fill: #fff5fa; stroke: #ff69b4; }
#settings-btn.gear-kawaii .gd { fill: #ffd166; }
#settings-btn.gear-persona { filter: drop-shadow(3px 3px 0 #e60023); }
#settings-btn.gear-persona .gp { fill: #09090b; stroke: #fff; }
#settings-btn.gear-persona .gc { fill: #e60023; stroke: #fff; }

#settings {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 6, 16, 0.78);
}

#settings.hidden {
    display: none;
}

.settings-card {
    position: relative;
    width: min(360px, 90%);
    padding: 22px 22px 18px;
    border-radius: 18px;
    border: 2px solid rgba(56, 189, 248, 0.6);
    background: rgba(10, 14, 30, 0.97);
    color: #fff;
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.45);
}

.settings-card h3 {
    margin: 0 0 14px;
    color: #facc15;
    letter-spacing: 1px;
}

#settings-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: #7c3aed;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

.set-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.set-name {
    font-weight: 700;
}

.set-seg {
    display: flex;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(125, 211, 252, 0.6);
}

.set-seg button {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: #bae6fd;
    font-weight: 700;
    cursor: pointer;
}

.set-seg button.on {
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    color: #fff;
}

.set-switch {
    position: relative;
    width: 52px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: #334155;
    cursor: pointer;
    transition: background 0.2s;
}

.set-switch i {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
}

.set-switch.on {
    background: #22c55e;
}

.set-switch.on i {
    transform: translateX(24px);
}

#field:has(#settings:not(.hidden)) #skill-btn {
    visibility: hidden;
}


/* ===== Веста: лавовое озеро / Нерио: водяной дракон ===== */
.lavalake {
    position: absolute;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 2;
    border-radius: 40px;
    background:
        radial-gradient(ellipse 26px 12px at 12% 40%, rgba(254,240,138,.9) 0 55%, transparent 100%),
        radial-gradient(ellipse 26px 12px at 38% 65%, rgba(254,240,138,.9) 0 55%, transparent 100%),
        radial-gradient(ellipse 26px 12px at 63% 35%, rgba(254,240,138,.9) 0 55%, transparent 100%),
        radial-gradient(ellipse 26px 12px at 88% 60%, rgba(254,240,138,.9) 0 55%, transparent 100%),
        linear-gradient(180deg, #7f1d1d 0%, #ea580c 35%, #f97316 55%, #b91c1c 100%);
    box-shadow: 0 0 26px 8px rgba(249, 115, 22, 0.75), inset 0 0 22px rgba(254, 240, 138, 0.6);
    transform-origin: center;
    animation: lavaSpread 0.6s ease-out, lavaBubble 1s ease-in-out infinite alternate 0.6s;
    transition: opacity 0.5s;
}

.lavalake.fading { opacity: 0; }

@keyframes lavaSpread {
    from { transform: scaleX(0.05); opacity: 0.4; }
    to { transform: scaleX(1); opacity: 1; }
}

@keyframes lavaBubble {
    from { filter: brightness(1) saturate(1); }
    to { filter: brightness(1.25) saturate(1.2); }
}

.dragonhead,
.dragonseg {
    position: absolute;
    pointer-events: none;
    z-index: 3;
}

.dragonhead {
    width: 110px;
    height: 70px;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.9));
}

.dragonhead svg { display: block; overflow: visible; }

.dragonhead .jaw {
    transform-box: view-box;
    transform-origin: 32px 44px;
    transition: transform 0.08s;
}

.dragonhead.bite .jaw { transform: rotate(16deg); }

.dragonseg {
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 30%, #e0f7ff 0%, #38bdf8 50%, #0369a1 100%);
    box-shadow: 0 0 10px 2px rgba(56, 189, 248, 0.7), inset 0 -4px 6px rgba(3, 105, 161, 0.7);
    border: 1px solid rgba(224, 247, 255, 0.7);
}

.dragonseg::after {
    content: "";
    position: absolute;
    left: 28%;
    top: -42%;
    border-left: 8px solid transparent;
    border-right: 3px solid transparent;
    border-bottom: 13px solid #bae6fd;
    filter: drop-shadow(0 0 4px #38bdf8);
}

.dragonseg.tail::after {
    left: -50%;
    top: -20%;
    border-left: 0;
    border-right: 22px solid #7dd3fc;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
}

#field:has(#menu:not(.hidden)) .stormdome,
#field:has(#menu:not(.hidden)) .soundring,
#field:has(#menu:not(.hidden)) .lavalake,
#field:has(#menu:not(.hidden)) .dragonhead,
#field:has(#menu:not(.hidden)) .dragonseg {
    visibility: hidden;
}


/* ===== Веста: лавовое озеро ===== */
.hero-frame[data-hero="vesta"] {
    --glow: 234, 88, 12;
    background: linear-gradient(145deg, #fef08a 0%, #ea580c 48%, #1c0a04 100%);
}

.card.hero[data-card="vesta"] { --accent: #f97316; --accent-rgb: 249, 115, 22; }

.bullet[data-hero="vesta"] {
    background: #fef08a;
    box-shadow: 0 0 8px 2px #ea580c;
}


/* ===== Нерио: водяной дракон ===== */
.hero-frame[data-hero="nerio"] {
    --glow: 56, 189, 248;
    background: linear-gradient(145deg, #e0f7ff 0%, #0ea5e9 48%, #04102a 100%);
}

.card.hero[data-card="nerio"] { --accent: #38bdf8; --accent-rgb: 56, 189, 248; }

.bullet[data-hero="nerio"] {
    background: #e0f7ff;
    box-shadow: 0 0 8px 2px #0ea5e9;
}

/* значки теперь рисуются со своей оправой, цветное кольцо вокруг не нужно */
.bdg-ring, .bdg-ring.bronze, .bdg-ring.silver, .bdg-ring.gold, .bdg-ring.rainbow {
    width: 92px; height: 92px; padding: 0; background: none; animation: none;
}
.bdg-ring.rainbow span { animation: none; }
.bdg-ring span { background: none; }
.bdg-ring .bdg-img { width: 100%; height: 100%; object-fit: contain; }
.bdg-ring.bronze { filter: drop-shadow(0 0 6px rgba(217, 119, 6, .55)); }
.bdg-ring.silver { filter: drop-shadow(0 0 6px rgba(148, 163, 184, .6)); }
.bdg-ring.gold { filter: drop-shadow(0 0 7px rgba(250, 204, 21, .6)); }
.bdg-ring.rainbow { filter: drop-shadow(0 0 8px rgba(168, 85, 247, .7)); }
.bdg-card.locked .bdg-ring { filter: grayscale(1) brightness(.55); }

/* кнопка «Ещё» с нарисованной рамкой */
#extras-btn {
    width: 190px; height: 48px; padding: 0 0 2px; border: none; border-radius: 0;
    background: url("btn-more.png") center / 100% 100% no-repeat;
    box-shadow: none; filter: drop-shadow(0 4px 10px rgba(168, 85, 247, .45));
    color: #fff; font-size: 15px; font-weight: 800; letter-spacing: .5px;
    text-shadow: 0 1px 3px rgba(40, 0, 70, .9), 0 0 8px rgba(233, 213, 255, .6);
    display: flex; align-items: center; justify-content: center;
}
#extras-btn:hover { transform: translateY(-2px); filter: drop-shadow(0 6px 14px rgba(192, 132, 252, .75)) brightness(1.1); }
#extras-btn:active { transform: translateY(0) scale(.97); }

/* ===== онлайн: таблицы лидеров и аккаунт ===== */
#online { position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center; background: rgba(4, 6, 16, 0.82); }
#online.hidden { display: none; }
.online-card { position: relative; width: min(460px, 94%); max-height: 92%; overflow-y: auto; padding: 20px 18px 16px; border-radius: 18px; border: 2px solid rgba(56, 189, 248, 0.6); background: rgba(10, 14, 30, 0.98); color: #fff; box-shadow: 0 0 30px rgba(79, 70, 229, 0.45); }
.online-card h3 { margin: 0 0 12px; color: #facc15; letter-spacing: 1px; }
#online-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,.6); background: #7c3aed; color: #fff; font-size: 15px; cursor: pointer; }
.online-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.online-tabs button, .online-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(125,211,252,.6); background: transparent; color: #bae6fd; font-weight: 700; cursor: pointer; font-family: inherit; }
.online-tabs button.on, .online-chip.on { background: linear-gradient(90deg, #0ea5e9, #6366f1); color: #fff; }
.online-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.online-chips.small .online-chip { padding: 3px 9px; font-size: 12px; }
.online-table { margin-top: 6px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,.12); }
.online-row { display: flex; gap: 8px; padding: 6px 10px; border-top: 1px solid rgba(255,255,255,.07); font-size: 14px; }
.online-row:first-child { border-top: none; }
.online-row.head { background: rgba(99,102,241,.25); font-weight: 700; font-size: 12px; text-transform: uppercase; }
.online-row .c-rank { width: 44px; flex: none; }
.online-row .c-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-row .c-val { flex: none; font-weight: 700; color: #7dd3fc; }
.online-row.top1 .c-rank, .online-row.top1 .c-name { color: #facc15; }
.online-row.top2 .c-rank, .online-row.top2 .c-name { color: #e5e7eb; }
.online-row.top3 .c-rank, .online-row.top3 .c-name { color: #fdba74; }
.online-row.me { background: rgba(236,72,153,.2); }
.online-note { margin: 10px 0 0; font-size: 13px; color: #cbd5e1; }
.online-note.bad { color: #fca5a5; }
.online-note.good { color: #86efac; }
.online-hello { margin: 0 0 8px; }
.online-account { display: flex; flex-direction: column; gap: 8px; }
.online-input { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(125,211,252,.5); background: #070914; color: #fff; font-size: 15px; font-family: inherit; }
.online-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.online-btn { padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(125,211,252,.6); background: transparent; color: #bae6fd; font-weight: 700; cursor: pointer; font-family: inherit; }
.online-btn.primary { background: linear-gradient(90deg, #0ea5e9, #6366f1); color: #fff; }
.online-btn.ghost { border-color: rgba(255,255,255,.3); color: #cbd5e1; }
.online-btn:disabled { opacity: .5; cursor: default; }
.set-open { padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(125,211,252,.6); background: transparent; color: #bae6fd; font-weight: 700; cursor: pointer; }
#lb-btn { margin-top: 8px; padding: 8px 18px; border-radius: 999px; border: 1px solid rgba(250,204,21,.7); background: rgba(10,14,30,.7); color: #facc15; font-weight: 700; cursor: pointer; font-family: inherit; }
#lb-btn:hover { background: rgba(250,204,21,.15); }

/* если меню всё равно не помещается (маленькое окно), его можно прокрутить */
#menu {
    justify-content: safe center;
    overflow-y: auto;
    padding: 14px 0;
}

/* значок рядом с ником в онлайн-таблицах */
.online-badge { width: 22px; height: 22px; vertical-align: -6px; margin-right: 6px; object-fit: contain; }
.online-badge.emoji { width: auto; height: auto; font-size: 16px; vertical-align: 0; }
.online-badge-line { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.online-badge-line .online-badge { width: 40px; height: 40px; margin: 0; }
#online img.online-badge { display: inline-block; flex: none; border: none; padding: 0; margin: 0 6px 0 0; background: none; box-shadow: none; border-radius: 50%; width: 22px; height: 22px; max-width: none; }
#online .online-badge-line img.online-badge { width: 40px; height: 40px; margin: 0; }
#online .online-row .c-name { display: flex; align-items: center; min-width: 0; }
#online .online-input { box-sizing: border-box; max-width: 100%; }
#online .online-hello { color: #e2e8f0; }

/* ===== страница игры: космический фон вместо белого ===== */
/* фон на всё окно (html), а не только на узкую колонку body */
html {
    min-height: 100%;
    background:
        linear-gradient(rgba(8, 4, 24, 0.35), rgba(8, 4, 24, 0.55)),
        url("space-bg.jpg") center / cover no-repeat fixed,
        linear-gradient(160deg, #1a0b3d 0%, #0b0720 55%, #05030f 100%);
    background-color: #0b0720;
}

body {
    color: #f5e9ff;
    background: transparent;
}

nav.menu {
    align-items: center;
    background: rgba(20, 10, 50, 0.55);
    border: 1px solid rgba(233, 213, 255, 0.35);
    border-radius: 14px;
    box-shadow: 0 0 22px rgba(168, 85, 247, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

nav.menu .brand {
    font-family: "Cinzel", Georgia, serif;
    font-weight: 900;
    font-size: 20px;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #ffffff 10%, #e9d5ff 55%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.8));
}

nav.menu #home-btn {
    padding: 6px 16px;
    border-radius: 999px;
    border: 1px solid rgba(233, 213, 255, 0.6);
    background: rgba(124, 58, 237, 0.35);
    color: #f5e9ff;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: background 0.18s, transform 0.18s;
}

nav.menu #home-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #c026d3 60%, #ec4899);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

#field {
    border: 1px solid rgba(233, 213, 255, 0.3);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.35), 0 12px 40px rgba(0, 0, 0, 0.6);
    border-radius: 12px;
}

body.fullgame #field,
body.touch #field {
    border: none;
    box-shadow: none;
}

/* в бою над полем курсор-прицел (удобно управлять мышью) */
body.mouse-on #field:has(#menu.hidden) {
    cursor: crosshair;
}

/* прицел, пока мышь заперта в поле */
#crosshair {
    position: absolute;
    z-index: 4;
    width: 26px;
    height: 26px;
    margin: -13px 0 0 -13px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.9), inset 0 0 6px rgba(168, 85, 247, 0.6);
    pointer-events: none;
}

#crosshair::before,
#crosshair::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
}

#crosshair::before { width: 2px; height: 34px; opacity: 0.55; }
#crosshair::after { width: 34px; height: 2px; opacity: 0.55; }

#crosshair.hidden { display: none; }

/* медали за 1–3 место в таблицах лидеров */
#online .online-row .c-rank.medal {
    font-size: 20px;
    line-height: 1;
    filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.5));
}
#online .online-row.top1 { background: linear-gradient(90deg, rgba(250, 204, 21, 0.16), transparent 70%); }
#online .online-row.top2 { background: linear-gradient(90deg, rgba(226, 232, 240, 0.12), transparent 70%); }
#online .online-row.top3 { background: linear-gradient(90deg, rgba(251, 146, 60, 0.14), transparent 70%); }
#online .online-row.me { box-shadow: inset 3px 0 0 #ec4899; }


/* ===== Каэль: штормовая тюрьма ===== */
.stormdome {
    position: absolute;
    z-index: 3;
    border-radius: 50%;
    pointer-events: none;
    border: 4px solid rgba(209, 250, 229, 0.85);
    background:
        repeating-conic-gradient(from 0deg, rgba(167, 243, 208, 0.13) 0deg 12deg, transparent 12deg 30deg),
        radial-gradient(circle, rgba(110, 231, 183, 0.05) 40%, rgba(110, 231, 183, 0.35) 100%);
    box-shadow: 0 0 30px rgba(110, 231, 183, 0.8), inset 0 0 40px rgba(209, 250, 229, 0.6);
    animation: domeSpin 0.6s linear infinite;
}
@keyframes domeSpin { to { transform: rotate(360deg); } }

.hero-frame[data-hero="kael"] {
    --glow: 110, 231, 183;
    background: linear-gradient(145deg, #f0fdf4 0%, #6ee7b7 48%, #062019 100%);
}
.card.hero[data-card="kael"] { --accent: #6ee7b7; --accent-rgb: 110, 231, 183; }
/* Каэль: обычная пуля, мятная с серебристым ореолом */
.bullet[data-hero="kael"] {
    background: linear-gradient(180deg, #ffffff, #6ee7b7);
    box-shadow: 0 0 8px 2px #34d399, 0 0 14px 4px rgba(203, 213, 225, .55);
}

/* Лира: обычная пуля, розовая с бирюзовым ореолом */
.bullet[data-hero="lyra"] {
    background: linear-gradient(180deg, #fdf4ff, #f0abfc);
    box-shadow: 0 0 8px 2px #c026d3, 0 0 14px 4px rgba(45, 212, 191, .5);
}

/* ===== новые фоны поля ===== */
/* Космос: картинка с главной страницы, чуть затемнена, чтобы враги были видны */
#field[data-bg="cosmos"], .cos-bg[data-bg="cosmos"] {
    background:
        linear-gradient(rgba(6, 4, 20, 0.45), rgba(6, 4, 20, 0.6)),
        url("space-bg.jpg") center / cover no-repeat,
        #0b0720;
}

/* Снегопад: два слоя снежинок падают с разной скоростью */
#field[data-bg="snow"], .cos-bg[data-bg="snow"] {
    background:
        radial-gradient(2.5px 2.5px at 30px 40px, #fff, transparent),
        radial-gradient(2px 2px at 110px 90px, #e0f2fe, transparent),
        radial-gradient(3px 3px at 170px 150px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 60px 20px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 140px 60px, #dbeafe, transparent),
        radial-gradient(1px 1px at 90px 130px, #fff, transparent),
        radial-gradient(ellipse at 50% 110%, rgba(186, 230, 253, 0.35), transparent 55%),
        linear-gradient(#0b1530, #132447);
    background-size: 200px 200px, 200px 200px, 200px 200px, 160px 160px, 160px 160px, 160px 160px, 100% 100%, 100% 100%;
    animation: bg-snow 14s linear infinite;
}
@keyframes bg-snow {
    from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
    to { background-position: 60px 400px, 60px 400px, 60px 400px, -20px 160px, -20px 160px, -20px 160px, 0 0, 0 0; }
}

/* Глубина: лучи света сверху и пузырьки, которые поднимаются */
#field[data-bg="ocean"], .cos-bg[data-bg="ocean"] {
    background:
        radial-gradient(circle at 40px 60px, transparent 4px, rgba(186, 230, 253, 0.7) 5px, transparent 6px),
        radial-gradient(circle at 150px 140px, transparent 6px, rgba(186, 230, 253, 0.55) 7px, transparent 8px),
        radial-gradient(circle at 100px 30px, transparent 2px, rgba(224, 242, 254, 0.8) 3px, transparent 4px),
        repeating-linear-gradient(105deg, transparent 0 60px, rgba(125, 211, 252, 0.08) 60px 90px, transparent 90px 170px),
        radial-gradient(ellipse at 50% -10%, rgba(56, 189, 248, 0.45), transparent 60%),
        linear-gradient(#063047, #031827 60%, #010a14);
    background-size: 200px 200px, 200px 200px, 200px 200px, 340px 100%, 100% 100%, 100% 100%;
    animation: bg-ocean 12s linear infinite;
}
@keyframes bg-ocean {
    from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
    to { background-position: 20px -400px, -20px -400px, 0 -400px, 340px 0, 0 0, 0 0; }
}

/* Вулкан: светящаяся лава внизу и искры, летящие вверх */
#field[data-bg="volcano"], .cos-bg[data-bg="volcano"] {
    background:
        radial-gradient(2px 2px at 30px 50px, #fde047, transparent),
        radial-gradient(2.5px 2.5px at 120px 120px, #fb923c, transparent),
        radial-gradient(1.5px 1.5px at 170px 30px, #fef08a, transparent),
        radial-gradient(2px 2px at 80px 170px, #f97316, transparent),
        radial-gradient(ellipse at 50% 115%, rgba(249, 115, 22, 0.75), rgba(220, 38, 38, 0.35) 35%, transparent 65%),
        linear-gradient(#120404, #2a0807 60%, #3f0d06);
    background-size: 200px 200px, 200px 200px, 200px 200px, 200px 200px, 100% 100%, 100% 100%;
    animation: bg-volcano 7s linear infinite;
}
@keyframes bg-volcano {
    from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
    to { background-position: 30px -400px, -30px -400px, 10px -400px, -10px -400px, 0 0, 0 0; }
}

/* Гроза: косой дождь и редкие вспышки молнии */
#field[data-bg="storm"], .cos-bg[data-bg="storm"] {
    background:
        repeating-linear-gradient(105deg, transparent 0 14px, rgba(191, 219, 254, 0.18) 14px 15px, transparent 15px 31px),
        repeating-linear-gradient(100deg, transparent 0 22px, rgba(191, 219, 254, 0.1) 22px 23px, transparent 23px 47px),
        radial-gradient(ellipse at 50% -20%, rgba(100, 116, 139, 0.55), transparent 60%),
        linear-gradient(#0f172a, #111827);
    background-size: 100% 120px, 100% 200px, 100% 100%, 100% 100%;
    animation: bg-storm-rain 0.6s linear infinite, bg-storm-flash 7s steps(1) infinite;
}
@keyframes bg-storm-rain {
    from { background-position: 0 0, 0 0, 0 0, 0 0; }
    to { background-position: -30px 120px, -40px 200px, 0 0, 0 0; }
}
@keyframes bg-storm-flash {
    0%, 61%, 63%, 65%, 100% { filter: none; }
    62%, 64% { filter: brightness(1.9); }
}

/* Неоновый город: сетка в стиле синтвейв, бегущая вниз, и закатное солнце */
#field[data-bg="cyber"], .cos-bg[data-bg="cyber"] {
    background:
        repeating-linear-gradient(0deg, rgba(236, 72, 153, 0.35) 0 2px, transparent 2px 46px),
        repeating-linear-gradient(90deg, rgba(34, 211, 238, 0.25) 0 2px, transparent 2px 60px),
        radial-gradient(circle at 50% 38%, rgba(251, 191, 36, 0.55), rgba(236, 72, 153, 0.35) 18%, transparent 32%),
        linear-gradient(#0d0221 0%, #2a0a4a 45%, #12001f 100%);
    background-size: 100% 46px, 60px 100%, 100% 100%, 100% 100%;
    animation: bg-cyber 2.4s linear infinite;
}
@keyframes bg-cyber {
    from { background-position: 0 0, 0 0, 0 0, 0 0; }
    to { background-position: 0 46px, 0 0, 0 0, 0 0; }
}

/* ===== новые скины пуль ===== */
/* Лазер: длинный тонкий луч */
.bullet[data-skin="laser"][data-hero] {
    background: linear-gradient(90deg, #ff2d55, #ffffff 45%, #ffffff 55%, #ff2d55);
    box-shadow: 0 0 8px 2px rgba(255, 45, 85, .9), 0 0 16px 4px rgba(255, 45, 85, .45);
    border-radius: 3px;
    transform: scaleX(0.55) scaleY(1.7);
}
.cos-bullet[data-skin="laser"] { transform: scale(2) scaleX(0.55) scaleY(1.7); }

/* Плазма: пульсирующий светящийся шар (круг рисуется поверх, хитбокс пули не меняется) */
.bullet[data-skin="plasma"][data-hero], .bullet[data-skin="void"][data-hero] {
    background: none; box-shadow: none; overflow: visible;
}
.bullet[data-skin="plasma"][data-hero]::before, .bullet[data-skin="void"][data-hero]::before {
    content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px;
    margin: -8px 0 0 -8px; border-radius: 50%;
}
.bullet[data-skin="plasma"][data-hero]::before {
    background: radial-gradient(circle, #ffffff 0 25%, #67e8f9 50%, #0891b2 100%);
    box-shadow: 0 0 12px 4px rgba(34, 211, 238, .85);
    animation: bullet-plasma .35s ease-in-out infinite alternate;
}
@keyframes bullet-plasma { to { box-shadow: 0 0 18px 7px rgba(34, 211, 238, .95); filter: brightness(1.2); } }

/* Лепестки, Полумесяц, Сюрикены: символ вместо пули */
.bullet[data-skin="petal"][data-hero], .bullet[data-skin="moon"][data-hero], .bullet[data-skin="shuriken"][data-hero] {
    background: none; box-shadow: none; overflow: visible;
}
.bullet[data-skin="petal"][data-hero]::before, .bullet[data-skin="moon"][data-hero]::before, .bullet[data-skin="shuriken"][data-hero]::before {
    position: absolute; left: 50%; top: 50%; line-height: 1; font-size: 22px;
    transform: translate(-50%, -50%);
}
.bullet[data-skin="petal"][data-hero]::before {
    content: "❀"; color: #f9a8d4; text-shadow: 0 0 8px #ec4899;
    animation: bullet-spin 0.9s linear infinite;
}
.bullet[data-skin="moon"][data-hero]::before {
    content: "☾"; color: #fef3c7; font-size: 24px; text-shadow: 0 0 8px #fbbf24, 0 0 14px #a78bfa;
}
.bullet[data-skin="shuriken"][data-hero]::before {
    content: "✦"; color: #e2e8f0; font-size: 24px; text-shadow: 0 0 6px #94a3b8, 0 0 12px #38bdf8;
    animation: bullet-spin 0.35s linear infinite;
}
@keyframes bullet-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Тьма: чёрное ядро с фиолетовым ореолом */
.bullet[data-skin="void"][data-hero]::before {
    background: radial-gradient(circle, #000 0 50%, #4c1d95 72%, #a855f7 100%);
    box-shadow: 0 0 10px 3px rgba(168, 85, 247, .85);
}

/* ===== особый (миллионный) герой: вся карточка радужная ===== */
.card.hero.special {
    --accent: #f0abfc;
    --accent-rgb: 240, 171, 252;
    --rainbow: linear-gradient(90deg, #f87171, #fbbf24, #4ade80, #22d3ee, #818cf8, #e879f9, #f87171);
}
.card.hero.special .hero-frame {
    --glow: 240, 171, 252;
    background: var(--rainbow);
    background-size: 300% 100%;
    animation: special-shine 4s linear infinite;
}
.card.hero.special .fx-aura-layer {
    box-shadow: inset 0 0 30px rgba(251, 191, 36, .45), inset 0 -20px 30px rgba(34, 211, 238, .35);
}
.card.hero.special h2 {
    border-image: var(--rainbow) 1;
    text-shadow: 0 0 10px #f472b6, 0 0 18px #22d3ee;
}
.card.hero.special > h2 + p {
    background:
        linear-gradient(90deg, rgba(248, 113, 113, .22), rgba(251, 191, 36, .18), rgba(74, 222, 128, .16), rgba(34, 211, 238, .16), rgba(232, 121, 249, .22));
    border-left: 3px solid transparent;
    border-image: linear-gradient(180deg, #f87171, #fbbf24, #4ade80, #22d3ee, #e879f9) 1;
    border-radius: 0;
}
.card.hero.special > h2 + p::before {
    color: #fde68a;
}
.card.hero.special .stats li {
    border-left: 3px solid transparent;
    border-image: linear-gradient(180deg, #f87171, #fbbf24, #4ade80, #22d3ee, #e879f9) 1;
    border-radius: 0;
}
.card.hero.special .stats li:nth-child(1) { border-image: linear-gradient(#f87171, #fb923c) 1; }
.card.hero.special .stats li:nth-child(2) { border-image: linear-gradient(#fb923c, #fbbf24) 1; }
.card.hero.special .stats li:nth-child(3) { border-image: linear-gradient(#fbbf24, #4ade80) 1; }
.card.hero.special .stats li:nth-child(4) { border-image: linear-gradient(#4ade80, #22d3ee) 1; }
.card.hero.special .stats li:nth-child(5) { border-image: linear-gradient(#22d3ee, #818cf8) 1; }
.card.hero.special .stats li:nth-child(6) { border-image: linear-gradient(#818cf8, #c084fc) 1; }
.card.hero.special .stats li:nth-child(7) { border-image: linear-gradient(#c084fc, #e879f9) 1; }
.card.hero.special .soon-q {
    color: rgba(255, 255, 255, .3);
    background:
        radial-gradient(circle at 50% 40%, rgba(232, 121, 249, .3), transparent 62%),
        conic-gradient(from 0deg at 50% 45%, rgba(248,113,113,.18), rgba(251,191,36,.18), rgba(74,222,128,.18), rgba(34,211,238,.18), rgba(129,140,248,.18), rgba(232,121,249,.18), rgba(248,113,113,.18)),
        linear-gradient(160deg, #1a1030, #070812);
}
.card.hero.special .hero-lock svg {
    animation: lock-float 3s ease-in-out infinite, lock-rainbow 4s linear infinite;
}
@keyframes lock-rainbow {
    0%   { filter: hue-rotate(0deg) saturate(1.4) drop-shadow(0 0 12px rgba(244, 114, 182, .8)) drop-shadow(0 4px 8px rgba(0, 0, 0, .7)); }
    100% { filter: hue-rotate(360deg) saturate(1.4) drop-shadow(0 0 12px rgba(244, 114, 182, .8)) drop-shadow(0 4px 8px rgba(0, 0, 0, .7)); }
}

/* капча «я не робот» в окне аккаунта */
.online-captcha { min-height: 66px; margin: 10px 0 4px; display: flex; justify-content: center; align-items: center; color: #94a3b8; font-size: 13px; }
.online-btn.danger { border-color: rgba(248,113,113,.55); color: #fca5a5; background: rgba(127,29,29,.25); }
.online-btn.danger:hover { background: rgba(185,28,28,.45); color: #fff; }
.online-note.tester { color: #fde68a; border-left: 3px solid #f59e0b; padding-left: 8px; }

/* управление касанием: строка в настройках только на телефоне; джойстик и кнопка атаки прячутся */
.set-touch-row { display: none; }
body.touch .set-touch-row { display: flex; }
body.touch.touch-follow #stick-zone,
body.touch.touch-follow #stick,
body.touch.touch-follow #dpad,
body.touch.touch-follow #ctrl-toggle,
body.touch.touch-follow #attack-btn { display: none !important; }
body.touch.touch-follow #field { touch-action: none; }

/* выбранная сложность: яркая белая рамка и свечение */
#menu .level-btn.active {
    outline: 3px solid #fff;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.18), 0 0 22px 4px rgba(255, 255, 255, 0.55);
}

/* текст нельзя выделить (кроме полей ввода) */
body { -webkit-user-select: none; user-select: none; }
input, textarea { -webkit-user-select: text; user-select: text; }

/* кнопка «i» у навыка и всплывающее описание */
.card.hero > h2 + p { position: relative; }
.skill-info {
    float: right;
    width: 20px; height: 20px;
    margin: 0 0 0 6px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font: italic 700 12px/1 Georgia, serif;
    cursor: pointer;
    opacity: 0.8;
}
.skill-info:hover { opacity: 1; background: rgba(255, 255, 255, 0.2); }
.skill-tip {
    position: absolute;
    left: 0; right: 0; top: calc(100% + 6px);
    z-index: 20;
    padding: 10px 12px;
    border-radius: 10px;
    background: #0d0f1e;
    border: 1px solid rgba(251, 191, 36, 0.6);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7);
    font-weight: 400;
    font-size: 13px;
    line-height: 1.4;
    color: #e5e7eb;
    text-align: left;
}
.skill-tip b { display: block; color: #fde68a; margin-bottom: 4px; }
.skill-tip span { display: block; }
.skill-tip small { display: block; margin-top: 6px; color: #94a3b8; }

/* телефон: джойстик справа, атака и навык слева */
body.touch.swap-controls #stick-zone { left: auto; right: 0; }
body.touch.swap-controls #dpad { left: auto; right: 14px; }
body.touch.swap-controls #attack-btn { right: auto; left: 18px; }
body.touch.swap-controls #skill-btn { right: auto; left: 138px; }

/* магазин: 6 героев в ряд на широком экране */
.shop-inner { max-width: 1600px; }
.heroes { grid-template-columns: repeat(auto-fill, 240px); }
@media (min-width: 1640px) {
    .heroes { grid-template-columns: repeat(6, 240px); }
}

/* Хрома: семь радужных лучей вокруг героя */
.sevenwheel {
    position: absolute;
    width: 0;
    height: 0;
    z-index: 1;
    pointer-events: none;
}
.seven-ray {
    position: absolute;
    left: 0;
    top: -10px;
    height: 20px;
    transform-origin: 0 50%;
    transform: rotate(var(--a));
    border-radius: 10px;
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,0) 0 28px, rgba(255,255,255,0.55) 34px, rgba(255,255,255,0) 40px),
        linear-gradient(90deg, transparent 0 48px, #fff 56px, var(--c) 120px, var(--c) 72%, transparent 100%);
    background-size: 80px 100%, 100% 100%;
    box-shadow: 0 0 14px var(--c), 0 0 30px var(--c);
    -webkit-mask: linear-gradient(90deg, transparent 0 44px, #000 60px);
    mask: linear-gradient(90deg, transparent 0 44px, #000 60px);
    opacity: 0.92;
    mix-blend-mode: screen;
    animation: seven-flow 0.5s linear infinite, seven-pulse 0.8s ease-in-out infinite alternate;
}
.seven-ray::after {
    content: "";
    position: absolute;
    left: 56px;
    right: 25%;
    top: 7px;
    height: 6px;
    border-radius: 3px;
    background: #fff;
    filter: blur(1px);
    opacity: 0.85;
}
@keyframes seven-flow { to { background-position: 80px 0, 0 0; } }
@keyframes seven-pulse { from { height: 16px; top: -8px; } to { height: 24px; top: -12px; } }
.seven-halo {
    position: absolute;
    left: -62px; top: -62px;
    width: 124px; height: 124px;
    border-radius: 50%;
    background: conic-gradient(#ef4444, #f97316, #facc15, #22c55e, #3b82f6, #6366f1, #a855f7, #ef4444);
    -webkit-mask: radial-gradient(circle, transparent 54%, #000 57%, #000 66%, transparent 69%);
    mask: radial-gradient(circle, transparent 54%, #000 57%, #000 66%, transparent 69%);
    filter: drop-shadow(0 0 8px #fff) blur(0.5px);
    animation: seven-spin 1.6s linear infinite reverse;
}
.seven-halo.h2 {
    left: -88px; top: -88px;
    width: 176px; height: 176px;
    opacity: 0.6;
    -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%, #000 67%, transparent 69%);
    mask: radial-gradient(circle, transparent 62%, #000 64%, #000 67%, transparent 69%);
    animation-duration: 3s;
    animation-direction: normal;
}
@keyframes seven-spin { to { transform: rotate(360deg); } }
.seven-gem {
    position: absolute;
    left: 0; top: 0;
    width: 16px; height: 26px;
    margin: -13px 0 0 -8px;
    transform: rotate(var(--a)) translateX(78px) rotate(90deg);
    background: linear-gradient(160deg, #fff 0%, var(--c) 55%, rgba(0,0,0,0.3) 100%);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    filter: drop-shadow(0 0 6px var(--c)) drop-shadow(0 0 2px #fff);
}
.seven-fx { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.seven-tint {
    position: absolute; inset: -20%;
    background: conic-gradient(from 0deg, rgba(239,68,68,.22), rgba(250,204,21,.2), rgba(34,197,94,.2), rgba(59,130,246,.22), rgba(168,85,247,.22), rgba(239,68,68,.22));
    -webkit-mask: radial-gradient(circle, transparent 38%, #000 75%);
    mask: radial-gradient(circle, transparent 38%, #000 75%);
    animation: seven-spin 6s linear infinite;
}
.seven-spark {
    position: absolute;
    font-size: 18px;
    transform: translate(-50%, -50%);
    text-shadow: 0 0 6px currentColor, 0 0 2px #fff;
    animation: seven-spark 0.7s ease-out forwards;
}
@keyframes seven-spark {
    from { opacity: 1; transform: translate(-50%, -50%) scale(1.3) rotate(0deg); }
    to { opacity: 0; transform: translate(-50%, -90%) scale(0.3) rotate(160deg); }
}
.seven-nova { position: absolute; width: 0; height: 0; z-index: 4; pointer-events: none; }
.seven-nova b { position: absolute; border-radius: 50%; left: 0; top: 0; transform: translate(-50%, -50%); }
.seven-nova .nv-wave {
    width: 40px; height: 40px;
    background: conic-gradient(#ef4444, #f97316, #facc15, #22c55e, #3b82f6, #6366f1, #a855f7, #ef4444);
    -webkit-mask: radial-gradient(circle, transparent 40%, #000 60%, transparent 72%);
    mask: radial-gradient(circle, transparent 40%, #000 60%, transparent 72%);
    animation: nv-grow 1.1s ease-out forwards;
}
.seven-nova .nv-ring {
    width: 40px; height: 40px;
    border: 6px solid #fff;
    box-shadow: 0 0 30px #fff, 0 0 60px #f0abfc;
    animation: nv-grow 0.9s ease-out forwards;
}
.seven-nova .nv-ring.r2 { border-color: #67e8f9; box-shadow: 0 0 30px #38bdf8; animation-delay: 0.15s; opacity: 0; animation-fill-mode: both; }
.seven-nova .nv-core {
    width: 120px; height: 120px;
    background: radial-gradient(circle, #fff 0%, rgba(255,255,255,0.8) 30%, rgba(240,171,252,0.4) 60%, transparent 70%);
    animation: nv-core 0.8s ease-out forwards;
}
@keyframes nv-grow {
    from { width: 40px; height: 40px; opacity: 1; }
    to { width: 1700px; height: 1700px; opacity: 0; }
}
@keyframes nv-core {
    from { transform: translate(-50%, -50%) scale(0.3); opacity: 1; }
    to { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}
.seven-nova i {
    position: absolute;
    left: 0; top: 0;
    width: 14px; height: 24px;
    margin: -12px 0 0 -7px;
    background: linear-gradient(160deg, #fff, var(--c));
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    filter: drop-shadow(0 0 6px var(--c));
    animation: nv-shard 1.1s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes nv-shard {
    from { transform: rotate(var(--a)) translateX(0) rotate(90deg) scale(1.4); opacity: 1; }
    to { transform: rotate(var(--a)) translateX(var(--d)) rotate(450deg) scale(0.6); opacity: 0; }
}
#player.sevenglow {
    animation: sevenhue 1.2s linear infinite;
}
@keyframes sevenhue {
    from { filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 18px #f472b6) hue-rotate(0deg); }
    to { filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 18px #f472b6) hue-rotate(360deg); }
}

/* Хрома: пуля как у всех, но переливается всеми цветами радуги */
.bullet[data-hero="chroma"] {
    background: linear-gradient(180deg, #ffffff, #f87171);
    box-shadow: 0 0 8px 2px #f87171, 0 0 14px 4px rgba(255, 255, 255, .45);
    animation: chroma-bullet 0.7s linear infinite;
}
@keyframes chroma-bullet {
    from { filter: hue-rotate(0deg) saturate(1.6); }
    to { filter: hue-rotate(360deg) saturate(1.6); }
}

/* Повелитель: огромный золотой босс с короной */
.enemy.boss.overlord,
.enemy.boss.overlord.damaged,
.enemy.boss.overlord.explode,
.enemy.boss.overlord.crash {
    width: 230px;
    height: 230px;
    background-image: url("overlord-game.png");
    filter: drop-shadow(0 0 14px #f97316) drop-shadow(0 0 28px rgba(250, 204, 21, 0.6));
}
.enemy.boss.overlord.damaged { filter: brightness(1.8) drop-shadow(0 0 14px #fff); }
.enemy.boss.overlord::before {
    display: none;
    content: "👑";
    position: absolute;
    left: 50%;
    top: -58px;
    transform: translateX(-50%);
    font-size: 46px;
    filter: drop-shadow(0 0 10px #facc15);
    animation: overlord-crown 1.6s ease-in-out infinite;
}
@keyframes overlord-crown {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-6px); }
}
.enemy.boss.overlord .hpbar {
    width: 230px;
    height: 14px;
    top: -20px;
    border: 1px solid #facc15;
}
.enemy.boss.overlord .hpfill {
    background: linear-gradient(90deg, #f59e0b, #facc15, #fde68a);
}
#field.overlord-shake {
    animation: overlord-shake 0.9s ease-in-out;
}
@keyframes overlord-shake {
    0%, 100% { transform: translate(0, 0); }
    15% { transform: translate(-8px, 4px); }
    30% { transform: translate(7px, -5px); }
    45% { transform: translate(-6px, -3px); }
    60% { transform: translate(5px, 4px); }
    75% { transform: translate(-3px, 2px); }
}

/* таблицы лидеров: ник можно нажать и открыть профиль */
#online .c-name.clickable { cursor: pointer; }
#online .c-name.clickable:hover { color: #fde68a; text-decoration: underline; }
.player-modal {
    position: absolute; inset: 0; z-index: 30;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    background: rgba(3, 2, 10, 0.7);
}
.player-card {
    position: relative;
    width: min(440px, 100%);
    max-height: 90%;
    overflow: auto;
    padding: 20px 22px;
    border-radius: 18px;
    background: linear-gradient(160deg, #1a1035, #0b0a1a);
    border: 1px solid rgba(196, 181, 253, 0.45);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.35);
    color: #e5e7eb;
}
.player-close {
    position: absolute; top: 10px; right: 10px;
    width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid rgba(244, 114, 182, 0.7);
    background: #1a0b3d; color: #fff; cursor: pointer;
}
.player-title { margin: 0 0 12px; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: #a5b4fc; }
.player-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.player-head .online-badge { width: 64px !important; height: 64px !important; flex: none; }
.player-head .online-badge.emoji { font-size: 48px; }
.player-nick { font-size: 26px; font-weight: 800; color: #fff; word-break: break-all; }
.player-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.player-fact { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); text-align: center; }
.player-fact b { font-size: 15px; color: #fde68a; }
.player-fact span { font-size: 11px; color: #94a3b8; }
.player-sub { margin: 4px 0 8px; font-weight: 700; color: #e9d5ff; }

/* фраза героя при нажатии на картинку */
.card.hero .portrait-media { cursor: pointer; }
.hero-quote {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 8px;
    z-index: 5;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(10, 6, 28, 0.88);
    border: 1px solid rgba(196, 181, 253, 0.7);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.55);
    color: #f5f3ff;
    font-size: 13px;
    font-style: italic;
    line-height: 1.35;
    text-align: center;
    animation: quote-in 0.25s ease-out;
    transition: opacity 0.4s;
}
.hero-quote.out { opacity: 0; }
@keyframes quote-in {
    from { opacity: 0; transform: translateY(8px) scale(0.95); }
    to { opacity: 1; transform: none; }
}
.card.hero.speaking .portrait-media { animation: hero-talk 0.35s ease-in-out 2; }
@keyframes hero-talk {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

/* ===== Вейл: осколочный рикошет ===== */
.shard-fly {
    position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; z-index: 4; pointer-events: none;
    background: linear-gradient(135deg, #f0f9ff, #818cf8 45%, #6d28d9);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    filter: drop-shadow(0 0 8px #a78bfa) drop-shadow(0 0 16px #60a5fa);
    transition: left .17s linear, top .17s linear, transform .17s linear;
}
.shard-trail {
    position: absolute; height: 3px; transform-origin: 0 50%; z-index: 3; pointer-events: none; border-radius: 2px;
    background: linear-gradient(90deg, rgba(196, 181, 253, 0), #c4b5fd 40%, #fff);
    box-shadow: 0 0 10px 2px rgba(129, 140, 248, .8);
    animation: bolt-flash .3s ease-out forwards;
}
.fx.shard-spark {
    width: 70px; height: 70px; border-radius: 50%; transform: translate(-50%, -50%);
    background: radial-gradient(circle, #fff 0 18%, rgba(167, 139, 250, .8) 38%, transparent 70%);
    animation: shard-spark .4s ease-out forwards;
}
@keyframes shard-spark {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(.3); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
}
.shard-blast { position: absolute; width: 0; height: 0; z-index: 4; pointer-events: none; }
.shard-blast b {
    position: absolute; left: 0; top: 0; width: 60px; height: 60px; border-radius: 50%;
    transform: translate(-50%, -50%) scale(.2);
    border: 5px solid #c4b5fd; box-shadow: 0 0 30px #818cf8, inset 0 0 24px #a78bfa;
    animation: shard-blast .7s ease-out forwards;
}
.shard-blast b.b2 { border-color: #fff; animation-delay: .1s; opacity: 0; animation-fill-mode: both; }
@keyframes shard-blast {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(7); }
}
.shard-bit {
    position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; z-index: 4; pointer-events: none;
    background: linear-gradient(135deg, #fff, #818cf8 50%, #6d28d9);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    filter: drop-shadow(0 0 6px #a78bfa);
    animation: shard-bit .7s ease-out forwards;
}
@keyframes shard-bit {
    0% { opacity: 1; transform: rotate(var(--a)) translateX(0) scale(1); }
    100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) scale(.4); }
}

/* ===== особый кристальный герой (Вейл): ледяно-фиолетовая рамка и замок ===== */
.card.hero.special.crystal {
    --accent: #a5b4fc;
    --accent-rgb: 165, 180, 252;
    --rainbow: linear-gradient(90deg, #e0f2fe, #818cf8, #7c3aed, #38bdf8, #c4b5fd, #e0f2fe);
    background:
        linear-gradient(#0b0d1e, #0b0d1e) padding-box,
        linear-gradient(135deg, #e0f2fe, #818cf8, #7c3aed, #38bdf8) border-box;
    box-shadow: 0 0 28px rgba(129, 140, 248, .45);
}
.card.hero.special.crystal .hero-frame { --glow: 129, 140, 248; }
.card.hero.special.crystal .fx-aura-layer {
    box-shadow: inset 0 0 30px rgba(129, 140, 248, .5), inset 0 -20px 30px rgba(56, 189, 248, .35);
}
.card.hero.special.crystal h2 { text-shadow: 0 0 10px #818cf8, 0 0 18px #38bdf8; }
.card.hero.special.crystal > h2 + p {
    background: linear-gradient(90deg, rgba(224, 242, 254, .16), rgba(129, 140, 248, .22), rgba(124, 58, 237, .22));
    border-image: linear-gradient(180deg, #e0f2fe, #818cf8, #7c3aed) 1;
}
.card.hero.special.crystal > h2 + p::before { color: #c4b5fd; }
.card.hero.special.crystal .stats li { border-image: linear-gradient(180deg, #e0f2fe, #818cf8, #7c3aed) 1; }
.card.hero.special.crystal .stats li:nth-child(odd) { border-image: linear-gradient(#e0f2fe, #818cf8) 1; }
.card.hero.special.crystal .stats li:nth-child(even) { border-image: linear-gradient(#818cf8, #7c3aed) 1; }
.card.hero.special.crystal .soon-q {
    background:
        radial-gradient(circle at 50% 40%, rgba(129, 140, 248, .35), transparent 62%),
        conic-gradient(from 0deg at 50% 45%, rgba(224,242,254,.16), rgba(129,140,248,.2), rgba(124,58,237,.2), rgba(56,189,248,.18), rgba(224,242,254,.16)),
        linear-gradient(160deg, #141036, #05060f);
}
.card.hero.special.crystal .hero-lock svg {
    animation: lock-float 3s ease-in-out infinite, lock-crystal 3s ease-in-out infinite;
}
@keyframes lock-crystal {
    0%, 100% { filter: hue-rotate(245deg) saturate(1.1) brightness(1.1) drop-shadow(0 0 10px rgba(129, 140, 248, .8)) drop-shadow(0 4px 8px rgba(0, 0, 0, .7)); }
    50% { filter: hue-rotate(245deg) saturate(1.3) brightness(1.35) drop-shadow(0 0 18px rgba(165, 180, 252, 1)) drop-shadow(0 4px 8px rgba(0, 0, 0, .7)); }
}
.card.hero.special.crystal .hero-frame[data-hero] { background: linear-gradient(135deg, #e0f2fe, #818cf8 50%, #4c1d95); background-size: 300% 100%; animation: special-shine 5s linear infinite; }
.card.hero .soon-label.special.crystal-label { background-image: linear-gradient(90deg, #e0f2fe, #818cf8, #a78bfa, #38bdf8, #e0f2fe); }
.bullet[data-hero="veyl"] { background: #c4b5fd; box-shadow: 0 0 8px 2px #818cf8; }

/* ===== Горн: таран ===== */
.bullet[data-hero="gorn"] {
    background: linear-gradient(180deg, #fff7ed, #fb923c);
    box-shadow: 0 0 8px 2px #ef4444, 0 0 14px 4px rgba(251, 146, 60, .5);
}
#player.ramglow {
    animation: ramglow .3s ease-in-out infinite alternate;
}
@keyframes ramglow {
    from { filter: drop-shadow(0 0 10px #fb923c) drop-shadow(0 -14px 18px rgba(239, 68, 68, .9)); }
    to { filter: drop-shadow(0 0 16px #fde68a) drop-shadow(0 -22px 26px rgba(239, 68, 68, 1)); }
}
.fx.ram-hit {
    width: 90px; height: 90px; border-radius: 50%; transform: translate(-50%, -50%);
    background: radial-gradient(circle, #fff 0 14%, rgba(251, 146, 60, .9) 34%, rgba(239, 68, 68, .5) 55%, transparent 72%);
    animation: ram-hit .35s ease-out forwards;
}
@keyframes ram-hit {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(.3); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

/* ===== Варг: превращение в волка ===== */
.bullet[data-hero="varg"] {
    background: linear-gradient(180deg, #f8fafc, #93c5fd);
    box-shadow: 0 0 8px 2px #3b82f6, 0 0 14px 4px rgba(191, 219, 254, .5);
}
#player.wolfform {
    filter: drop-shadow(0 0 10px #93c5fd) drop-shadow(0 0 20px rgba(59, 130, 246, .8));
}
.fx.wolf-puff {
    width: 200px; height: 200px; border-radius: 50%; transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 255, 255, .9) 0 15%, rgba(147, 197, 253, .7) 40%, transparent 70%);
    animation: wolf-puff .5s ease-out forwards;
}
@keyframes wolf-puff {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(.3); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}
.fx.wolf-claw {
    width: 80px; height: 80px; transform: translate(-50%, -50%) rotate(-25deg);
    background:
        linear-gradient(90deg, transparent 18%, #e0f2fe 20%, #60a5fa 23%, transparent 25%),
        linear-gradient(90deg, transparent 43%, #e0f2fe 45%, #60a5fa 48%, transparent 50%),
        linear-gradient(90deg, transparent 68%, #e0f2fe 70%, #60a5fa 73%, transparent 75%);
    filter: drop-shadow(0 0 6px #3b82f6);
    animation: wolf-claw .38s ease-out forwards;
}
@keyframes wolf-claw {
    0% { opacity: 0; clip-path: inset(0 0 100% 0); }
    30% { opacity: 1; clip-path: inset(0 0 0 0); }
    100% { opacity: 0; clip-path: inset(0 0 0 0); }
}

/* ===== свои цвета карточек: Лира, Горн, Варг ===== */
.hero-frame[data-hero="lyra"] { --glow: 45, 212, 191; background: linear-gradient(145deg, #ccfbf1 0%, #14b8a6 48%, #0f2e3a 100%); }
.card.hero[data-card="lyra"] { --accent: #2dd4bf; --accent-rgb: 45, 212, 191; }
.hero-frame[data-hero="gorn"] { --glow: 251, 146, 60; background: linear-gradient(145deg, #fed7aa 0%, #ef4444 48%, #1c0a0a 100%); }
.card.hero[data-card="gorn"] { --accent: #fb923c; --accent-rgb: 251, 146, 60; }
.hero-frame[data-hero="varg"] { --glow: 147, 197, 253; background: linear-gradient(145deg, #e0f2fe 0%, #3b82f6 48%, #0f172a 100%); }
.card.hero[data-card="varg"] { --accent: #93c5fd; --accent-rgb: 147, 197, 253; }
.card.hero[data-card="veyl"] { --accent: #a5b4fc; --accent-rgb: 165, 180, 252; }

/* ===== новые расходники и дроны ===== */
#bomb-btn {
    position: absolute; left: 84px; bottom: 10px; width: 64px; height: 64px; padding: 0; z-index: 1;
    border-radius: 50%; border: 3px solid #fde68a; cursor: pointer; font-size: 30px; overflow: hidden;
    background: radial-gradient(circle at 35% 30%, #f97316, #7c2d12);
    box-shadow: 0 0 14px 3px rgba(249, 115, 22, .7);
    animation: bomb-pulse 1s ease-in-out infinite;
}
#bomb-btn.hidden { display: none; }
#bomb-btn img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
@keyframes bomb-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.drone.kamikaze { --dc: #f97316; }
.drone.rocket { --dc: #ef4444; }
.drone.generator { --dc: #a78bfa; }
.rocket-fly {
    position: absolute; z-index: 4; font-size: 26px; line-height: 1; pointer-events: none;
    transform: translate(-50%, -50%); transition: left .38s ease-in, top .38s ease-in;
    filter: drop-shadow(0 0 8px #f97316);
}
.fx.rocket-blast {
    width: 300px; height: 300px; border-radius: 50%; transform: translate(-50%, -50%);
    background: radial-gradient(circle, #fff 0 12%, rgba(251, 146, 60, .9) 30%, rgba(239, 68, 68, .55) 52%, transparent 72%);
    animation: rocket-blast .5s ease-out forwards;
}
@keyframes rocket-blast {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
#field.frozen { box-shadow: inset 0 0 160px rgba(125, 211, 252, .45); }
#field.frozen .enemy { filter: hue-rotate(150deg) brightness(1.25) saturate(1.2); }
.item-card.rare { border-color: #fbbf24; box-shadow: 0 0 16px rgba(251, 191, 36, .35); position: relative; }
.item-rare {
    position: absolute; top: 6px; right: 6px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800;
    color: #3b2400; background: linear-gradient(90deg, #fde68a, #f59e0b);
}
.item-chip.rare { border-color: rgba(251, 191, 36, .7); }
.shard-fall {
    position: absolute; width: 22px; height: 40px; margin: -20px 0 0 -11px; z-index: 4; pointer-events: none;
    background: linear-gradient(180deg, #f0f9ff, #818cf8 50%, #6d28d9);
    clip-path: polygon(50% 0, 100% 35%, 50% 100%, 0 35%);
    filter: drop-shadow(0 0 8px #a78bfa);
    transition: top .15s ease-in;
}
.fx.shard-burst {
    width: 150px; height: 150px; border-radius: 50%; transform: translate(-50%, -50%);
    background: radial-gradient(circle, #fff 0 14%, rgba(167, 139, 250, .85) 34%, rgba(99, 102, 241, .45) 55%, transparent 72%);
    animation: shard-spark .45s ease-out forwards;
}

/* Юл: ледяные акценты и навык «Метель подарков» */
.hero-frame[data-hero="yule"] { --glow: 125, 211, 252; background: linear-gradient(145deg, #f0f9ff 0%, #38bdf8 48%, #082f49 100%); }
.card.hero[data-card="yule"] { --accent: #7dd3fc; --accent-rgb: 125, 211, 252; }
.bullet[data-hero="yule"] { background: linear-gradient(180deg, #ffffff, #7dd3fc); box-shadow: 0 0 8px 2px #38bdf8, 0 0 14px 4px rgba(254, 202, 202, .5); }
.gift-fly {
    position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; z-index: 4; pointer-events: none;
    background: linear-gradient(90deg, transparent 42%, #fde68a 42% 58%, transparent 58%), linear-gradient(0deg, transparent 42%, #fde68a 42% 58%, transparent 58%), #dc2626;
    border: 2px solid #fecaca; border-radius: 6px; box-shadow: 0 0 14px #7dd3fc;
    transition: left .34s ease-in, top .34s ease-in, transform .34s linear;
}
.fx.gift-burst {
    width: 260px; height: 260px; border-radius: 50%; transform: translate(-50%, -50%);
    background: radial-gradient(circle, #fff 0 12%, rgba(186, 230, 253, .9) 30%, rgba(56, 189, 248, .5) 55%, transparent 72%);
    animation: shard-spark .6s ease-out forwards;
}
.fx.gift-flake {
    color: #e0f2fe; font-size: 22px; text-shadow: 0 0 8px #38bdf8; transform: translate(-50%, -50%);
    animation: gift-flake .65s ease-out forwards;
}
@keyframes gift-flake {
    to { transform: translate(-50%, -50%) rotate(var(--a)) translateX(var(--d)) rotate(calc(var(--a) * -1)); opacity: 0; }
}
.enemy.frosted { filter: hue-rotate(150deg) brightness(1.4) saturate(1.1) drop-shadow(0 0 8px #7dd3fc); }

/* Новогоднее событие */
.event-banner { margin: 0 auto 18px; max-width: 760px; padding: 12px 16px; text-align: center; border-radius: 14px; color: #e0f2fe;
    background: linear-gradient(135deg, rgba(8, 47, 73, .85), rgba(30, 58, 138, .7)); border: 1px solid rgba(125, 211, 252, .55); box-shadow: 0 0 18px rgba(56, 189, 248, .35); }
.event-banner b { font-size: 1.15em; letter-spacing: .04em; text-shadow: 0 0 10px #38bdf8; }
.event-banner span { font-size: .9em; opacity: .9; }
.event-banner.hidden, #snow-line.hidden, #hud-snow-row.hidden { display: none; }
.snow-line strong { color: inherit; }
.card.hero .event-tag { margin: 2px auto 6px; padding: 3px 12px; width: fit-content; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .05em;
    color: #082f49; background-image: linear-gradient(90deg, #e0f2fe, #7dd3fc, #fecaca, #7dd3fc, #e0f2fe); box-shadow: 0 0 12px rgba(125, 211, 252, .6); }
#hud-snow-row { display: flex; justify-content: space-between; gap: 8px; color: #bae6fd; }
#stats-panel #hud-snow-row { position: static; font-size: 14px; font-weight: 800; line-height: 1.4; }

/* Страница «Мои герои»: заголовок и панель монет в стиле сайта */
body.heroes-page h1 {
    text-align: center; font-family: "Cardo", Georgia, "Times New Roman", serif; font-size: 2.6rem; letter-spacing: .06em; margin: 22px 0 18px;
    background: linear-gradient(180deg, #ffffff 0%, #e9d5ff 50%, #c084fc 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 0 14px rgba(168, 85, 247, .55));
}
body.heroes-page > .card {
    max-width: 520px; margin: 0 auto 22px; text-align: center; color: #e9d5ff;
    background: linear-gradient(145deg, rgba(30, 16, 64, .82), rgba(12, 8, 32, .88));
    border: 1px solid rgba(192, 132, 252, .45); border-radius: 16px; box-shadow: 0 0 22px rgba(139, 92, 246, .28);
    backdrop-filter: blur(6px);
}
body.heroes-page > .card p { color: #e9d5ff; margin: 6px 0; font-weight: 600; }
body.heroes-page > .card strong { color: #fcd34d; font-variant-numeric: tabular-nums; }
body.heroes-page > .card .snow-line strong { color: #bae6fd; }
body.heroes-page > .card #notice:empty { display: none; }

/* магазин: строка со снежинками не должна выталкивать крестик за экран */
.shop-inner > .card { flex-wrap: wrap; }
.shop-inner > .card > .snow-line {
    margin: 0; padding: 6px 14px; border-radius: 999px; font-size: 16px; font-weight: 800; white-space: nowrap;
    color: #bae6fd; background: rgba(56, 189, 248, .12); border: 1px solid rgba(125, 211, 252, .5);
}
.shop-inner > .card > .snow-line.hidden { display: none; }
.shop-inner > .card > .snow-line strong { color: #fff; }
@media (max-width: 700px) {
    .shop-inner > .card > #shop-close { order: 1; margin-left: auto; }
    .shop-inner > .card > #notice { order: 5; flex-basis: 100%; }
}

/* Снежана: ледяные акценты и «Полночный салют» */
.hero-frame[data-hero="snezhana"] { --glow: 147, 197, 253; background: linear-gradient(145deg, #eff6ff 0%, #60a5fa 48%, #1e1b4b 100%); }
.card.hero[data-card="snezhana"] { --accent: #93c5fd; --accent-rgb: 147, 197, 253; }
.bullet[data-hero="snezhana"] { background: linear-gradient(180deg, #ffffff, #93c5fd); box-shadow: 0 0 8px 2px #60a5fa, 0 0 14px 4px rgba(253, 230, 138, .55); }
.fw-rocket {
    position: absolute; width: 8px; height: 22px; margin: -11px 0 0 -4px; z-index: 4; pointer-events: none; border-radius: 4px;
    background: linear-gradient(180deg, #fff, var(--c)); box-shadow: 0 0 12px 3px var(--c), 0 12px 18px 2px var(--c);
    transition: left .36s ease-out, top .36s ease-out;
}
.fx.fw-burst {
    width: var(--s); height: var(--s); border-radius: 50%; transform: translate(-50%, -50%);
    background: radial-gradient(circle, #fff 0 10%, var(--c) 28%, transparent 66%); opacity: .85;
    animation: shard-spark .65s ease-out forwards;
}
.fx.fw-spark {
    color: var(--c); font-size: 22px; text-shadow: 0 0 10px var(--c); transform: translate(-50%, -50%);
    animation: fw-spark .8s ease-out forwards;
}
@keyframes fw-spark {
    to { transform: translate(-50%, -50%) rotate(var(--a)) translateX(var(--d)) rotate(calc(var(--a) * -1)) translateY(26px); opacity: 0; }
}
