:root {
    --bg-from: #1a0b2e;
    --bg-via: #2d0a3e;
    --bg-to: #0f0524;
    --heart-light: #ff5e7e;
    --heart-dark: #c4001d;
    --accent: #ff3366;
    --text: #f4ecff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    font-family: 'Manrope', system-ui, -apple-system, Segoe UI, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 50% 18%, rgba(120, 25, 150, 0.55) 0%, transparent 55%),
        linear-gradient(160deg, var(--bg-from) 0%, var(--bg-via) 45%, var(--bg-to) 100%);
    background-attachment: fixed;
}

.demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 56px;
    padding: 48px 24px;
}

.title {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: rgba(244, 236, 255, 0.5);
}

.stage {
    position: relative;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 320px;
    height: 300px;
}

/* Сердце */
#heart {
    position: relative;
    width: 300px;
    height: 270px;
    animation: pulse 1.5s ease-in-out infinite;
}

#heart::before,
#heart::after {
    position: absolute;
    content: "";
    left: 150px;
    top: 0;
    width: 150px;
    height: 240px;
    background: linear-gradient(160deg, var(--heart-light), var(--heart-dark));
    border-radius: 150px 150px 0 0;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}

#heart::after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

#k {
    position: absolute;
    top: 48px;
    left: 165px;
    z-index: -1;
    width: 0;
    height: 0;
    animation: glow 1.5s ease-in-out infinite;
}

#heart.stopped {
    animation: none;
    transform: scale(1);
}

#k.stopped {
    animation: none;
    box-shadow: none;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 195px 45px rgba(255, 51, 102, 0.45);
    }
    50% {
        box-shadow: 0 0 195px 80px rgba(255, 94, 126, 0.6);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Панель управления */
.panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    width: min(420px, 90vw);
}

.udars {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.udars label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(244, 236, 255, 0.55);
}

#pole {
    width: 130px;
    padding: 12px 0;
    text-align: center;
    font-family: inherit;
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    outline: none;
    user-select: text;
    -webkit-user-select: text;
    transition: border-color 0.2s ease;
}

#pole:focus {
    border-color: var(--accent);
}

.buttons {
    display: flex;
    gap: 16px;
}

button {
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text);
    padding: 14px 30px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.25s ease, opacity 0.2s ease;
}

#adr {
    background: linear-gradient(135deg, var(--heart-light), var(--accent));
    box-shadow: 0 8px 24px rgba(255, 51, 102, 0.35);
}

#raz {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
