* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== НЕОНОВАЯ ПАЛИТРА ===== */
:root {
    --neon-pink: #ff2bd6;
    --neon-cyan: #00f0ff;
    --neon-purple: #b14bff;
    --neon-green: #39ff14;
    --neon-yellow: #fff200;
    --neon-red: #ff3860;
    --glass-bg: rgba(15, 10, 30, 0.75);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-main: #f0f0ff;
}

body {
    background: radial-gradient(ellipse at top, #1a0b2e 0%, #0a0515 60%, #000 100%);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, sans-serif;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== ГЛАВНАЯ ПАНЕЛЬ ===== */
#ui {
    padding: 0;
    z-index: 10;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.player-container {
    padding: 7px 0px 0px;
    max-width: 900px;
    margin: 0 auto;
}

/* ===== Прогресс-бар + сложность + калибровка в одной строке ===== */
.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1px;
}

.time-current, .time-total {
    font-size: 11px;
    color: #aaa;
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    flex-shrink: 0;
}

.time-current { text-align: right; }
.time-total { text-align: left; }

.progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    transition: height 0.2s;
    min-width: 0;
}

.progress-bar:hover { height: 5px; }

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px var(--neon-cyan);
}

.progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 0 8px var(--neon-cyan), 0 0 4px rgba(0,0,0,0.5);
}

.progress-bar:hover .progress-thumb { opacity: 1; }

/* ===== Сложность и калибровка в строке прогресса ===== */
.difficulty-select {
    flex-shrink: 0;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.difficulty-select:hover,
.difficulty-select:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0,240,255,0.3);
}

.calib-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, rgba(255,43,214,0.15), rgba(0,240,255,0.15));
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    padding: 0;
}

.calib-btn:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0,240,255,0.4);
    transform: rotate(90deg);
}

.calib-btn.active {
    background: linear-gradient(135deg, rgba(255,43,214,0.35), rgba(0,240,255,0.35));
    border-color: var(--neon-cyan);
    box-shadow: 0 0 14px rgba(0,240,255,0.5);
}

/* ===== Кнопки управления ===== */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.control-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    color: #ccc;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    color: #fff;
    background: rgba(0,240,255,0.15);
    border-color: var(--neon-cyan);
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(0,240,255,0.4);
}

.control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.control-btn:disabled:hover {
    transform: none;
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.15);
    box-shadow: none;
}

.play-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    color: #fff;
    border-radius: 50%;
    padding: 0;
    border: none;
    box-shadow: 0 0 16px rgba(255,43,214,0.5);
    transition: all 0.25s;
}

.play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 24px var(--neon-pink), 0 0 48px rgba(255,43,214,0.3);
}

.play-btn:disabled {
    background: #333;
    color: #666;
    box-shadow: none;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.play-btn svg {
    width: 22px;
    height: 22px;
}

/* ===== Название трека (по центру) ===== */
.track-info-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 10px;
    margin-bottom: 4px;
    min-height: 22px;
}

.track-name-display {
    font-size: 11px;
    color: #fff;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    text-shadow: 0 0 8px rgba(255,255,255,0.2);
    max-width: 100%;
}

/* ===== Статус (внутри плейлиста) ===== */
#status {
    color: #888;
    font-size: 10px;
    text-align: center;
    padding: 8px 4px 4px;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 21px;
}

/* ===== Кнопка загрузки ===== */
.upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(255,43,214,0.15), rgba(0,240,255,0.15));
    border: 1px solid rgba(255,255,255,0.2);
    color: #ddd;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    margin-bottom: 12px;
}

.upload-btn:hover {
    background: linear-gradient(135deg, rgba(255,43,214,0.3), rgba(0,240,255,0.3));
    border-color: var(--neon-cyan);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 0 16px rgba(0,240,255,0.3);
}

.upload-btn svg { width: 16px; height: 16px; }

/* ===== ИГРОВОЕ ПОЛЕ И СТАТИСТИКА ===== */
canvas {
    display: block;
    background: #000;
    box-shadow: 0 0 60px rgba(255,43,214,0.2), 0 0 120px rgba(0,240,255,0.1);
    max-width: 100vw;
    border-radius: 4px;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.stats-row {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;

    background: rgba(15, 10, 30, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 24px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);

    opacity: 0;
    animation: fadeInStats 0.5s ease-out 0.5s forwards;
}

@keyframes fadeInStats {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 60px;
}

.stat-label {
    font-size: 9px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 20px;
    color: #fff;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

#score { color: var(--neon-cyan); text-shadow: 0 0 12px rgba(0, 240, 255, 0.5); }
#combo { color: var(--neon-pink); text-shadow: 0 0 12px rgba(255, 43, 214, 0.5); }
#accuracy { color: var(--neon-green); text-shadow: 0 0 12px rgba(57, 255, 20, 0.5); }

.hp-item {
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}

#hpBar {
    width: 120px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

#hpFill {
    height: 100%;
    width: 100%;
    transition: width 0.2s ease-out, background 0.4s, box-shadow 0.4s;
    border-radius: 6px;
}

#hpFill.hp-high { background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan)); box-shadow: 0 0 10px var(--neon-green); }
#hpFill.hp-medium { background: linear-gradient(90deg, var(--neon-yellow), #ff9500); box-shadow: 0 0 12px var(--neon-yellow); }
#hpFill.hp-low { background: linear-gradient(90deg, var(--neon-red), #ff0055); box-shadow: 0 0 16px var(--neon-red); animation: hpPulse 0.6s ease-in-out infinite; }

@keyframes hpPulse {
    0%, 100% { filter: brightness(1); }
    50%      { filter: brightness(1.6); }
}

#hpText {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 9px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    z-index: 2;
    letter-spacing: 0.5px;
}

#info {
    position: absolute;
    bottom: 80px;
    color: #888;
    font-size: 10px;
    text-align: center;
    z-index: 5;
    pointer-events: none;
}

/* ===== ТЕКСТ ПОПАДАНИЙ И КОМБО ===== */
#hitText {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 56px;
    font-weight: 900;
    pointer-events: none;
    opacity: 0;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 20px currentColor;
    z-index: 25;
}

#hitText.show { animation: hitPop 0.6s ease-out forwards; }
#hitText.hit-perfect { color: var(--neon-yellow); text-shadow: 0 0 24px var(--neon-yellow), 0 0 48px rgba(255,242,0,0.4); }
#hitText.hit-great   { color: var(--neon-green);  text-shadow: 0 0 20px var(--neon-green); }
#hitText.hit-good    { color: var(--neon-cyan);   text-shadow: 0 0 16px var(--neon-cyan); }
#hitText.hit-miss    { color: var(--neon-red);    text-shadow: 0 0 16px var(--neon-red); }

@keyframes hitPop {
    0%   { opacity: 0; transform: translate(-50%, -50%) translateY(10px) scale(0.6); }
    30%  { opacity: 1; transform: translate(-50%, -50%) translateY(-10px) scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, -50%) translateY(-50px) scale(0.9); }
}

#comboDisplay {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 72px;
    font-weight: 900;
    color: var(--neon-pink);
    text-shadow: 0 0 20px var(--neon-pink), 0 0 40px rgba(255,43,214,0.5);
    pointer-events: none;
    opacity: 0;
    transition: transform 0.15s ease-out, color 0.3s, text-shadow 0.3s;
    z-index: 20;
    letter-spacing: 3px;
}

#comboDisplay.show { opacity: 1; }
#comboDisplay.pulse { animation: comboPulse 0.3s ease-out; }

@keyframes comboPulse {
    0%   { transform: translate(-50%, -50%) scale(1); }
    50%  { transform: translate(-50%, -50%) scale(1.4); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

#comboDisplay.combo-50 { color: var(--neon-green); text-shadow: 0 0 24px var(--neon-green), 0 0 48px rgba(57,255,20,0.4); }
#comboDisplay.combo-100 { color: var(--neon-yellow); text-shadow: 0 0 28px var(--neon-yellow), 0 0 56px rgba(255,242,0,0.4); transform: translate(-50%, -50%) scale(1.15); }
#comboDisplay.combo-200 { color: var(--neon-pink); text-shadow: 0 0 32px var(--neon-pink), 0 0 64px rgba(255,43,214,0.6); transform: translate(-50%, -50%) scale(1.3); animation: comboFire 0.4s ease-in-out infinite alternate; }

@keyframes comboFire {
    from { transform: translate(-50%, -50%) scale(1.3) rotate(-1deg); }
    to   { transform: translate(-50%, -50%) scale(1.35) rotate(1deg); }
}

/* ===== ЭКРАН СМЕРТИ ===== */
#deathScreen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 0, 15, 0.8);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

#deathScreen.show { display: flex; animation: deathFadeIn 0.6s ease-out; }

@keyframes deathFadeIn { from { opacity: 0; } to { opacity: 1; } }

#deathScreen h1 {
    font-size: 64px;
    color: var(--neon-red);
    text-shadow: 0 0 30px var(--neon-red), 0 0 60px rgba(255,56,96,0.5);
    margin-bottom: 24px;
    letter-spacing: 6px;
    animation: deathTitle 0.8s ease-out;
}

@keyframes deathTitle {
    0%   { transform: scale(0.3); opacity: 0; }
    60%  { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

#deathScreen .stats {
    font-size: 20px;
    margin: 8px 0;
    color: #fff;
    opacity: 0;
    animation: statSlide 0.5s ease-out forwards;
}

#deathScreen .stats:nth-of-type(1) { animation-delay: 0.3s; }
#deathScreen .stats:nth-of-type(2) { animation-delay: 0.5s; }
#deathScreen .stats:nth-of-type(3) { animation-delay: 0.7s; }

@keyframes statSlide {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}

#deathScreen button {
    margin-top: 24px;
    padding: 12px 32px;
    font-size: 18px;
    background: linear-gradient(135deg, rgba(255,43,214,0.2), rgba(0,240,255,0.2));
    border: 1px solid var(--neon-cyan);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.25s;
    opacity: 0;
    animation: statSlide 0.5s ease-out 0.9s forwards;
}

#deathScreen button:hover {
    background: linear-gradient(135deg, rgba(255,43,214,0.4), rgba(0,240,255,0.4));
    box-shadow: 0 0 20px var(--neon-cyan);
    transform: translateY(-2px);
}

#damageFlash {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    opacity: 0;
    z-index: 50;
    box-shadow: inset 0 0 120px 40px var(--neon-red);
}

#damageFlash.show { animation: damageFlash 0.35s ease-out; }

@keyframes damageFlash {
    0%   { opacity: 0.9; }
    100% { opacity: 0; }
}

/* ===== ПЛЕЙЛИСТ ===== */
#playlist {
    position: absolute;
    top: 100px;
    left: 15px;
    width: 260px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 12px;
    z-index: 50;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
}

#playlist.collapsed { transform: translateX(-290px); }

/* ===== Кнопка-переключатель (круглая, в углу плейлиста) ===== */
#playlist-toggle {
    position: absolute;
    top: 128px;
    left: 23px;
    z-index: 52;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 0;
    display: none;
    background: none;
    border: 1px solid #00f0ff;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(0,240,255,0.6), 0 2px 8px rgba(0,0,0,0.4);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
}

/* Крестик когда плейлист ОТКРЫТ */
#playlist-toggle::before {
    content: '×';
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    margin-top: -2px;
}

#playlist-toggle:active {
    transform: scale(0.95);
}

/* Когда плейлист СКРЫТ — показываем текст "🎵 Плейлист" */
#playlist.collapsed ~ #playlist-toggle::before {
    content: '';
    font-size: 14px;
}

#playlist.collapsed ~ #playlist-toggle::after {
    content: ' Плейлист';
    font-size: 12px;
    font-weight: 600;
    margin-left: 2px;
    letter-spacing: 0.5px;
}

#playlist.collapsed ~ #playlist-toggle {
    width: auto;
    padding: 8px 14px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 0 16px rgba(0,240,255,0.5), 0 2px 8px rgba(0,0,0,0.4);
}

#playlist.collapsed ~ #playlist-toggle:hover {
    background: #100a1f;
    box-shadow: 0 0 13px rgba(0, 240, 255, 0.8);
    transform: scale(1.05);
}

#playlist h3 {
    color: var(--neon-pink);
    font-size: 13px;
    margin-bottom: 8px;
    text-align: center;
    text-shadow: 0 0 10px var(--neon-pink);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.track {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    margin: 4px 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    position: relative;
}

.track:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--neon-cyan);
    transform: translateX(4px);
    box-shadow: 0 0 12px rgba(0,240,255,0.2);
}

.track.active {
    background: linear-gradient(90deg, rgba(0,240,255,0.2), transparent);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 16px rgba(0,240,255,0.4), inset 0 0 20px rgba(0,240,255,0.05);
}

.track-info { flex: 1; overflow: hidden; min-width: 0; }

.track-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #ddd;
    display: block;
}

.track.active .track-name {
    color: var(--neon-cyan);
    font-weight: bold;
    text-shadow: 0 0 8px var(--neon-cyan);
}

.track-meta { color: #888; font-size: 10px; display: block; margin-top: 2px; }

.track.analyzed .track-meta { color: var(--neon-green); }
.track.analyzing .track-meta { color: var(--neon-yellow); }
.track.analyze-error .track-meta { color: var(--neon-red); }

.track-refresh, .track-del {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.7;
    transition: all 0.2s;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.track-refresh { color: var(--neon-cyan); }
.track-refresh:hover { opacity: 1; background: rgba(0,240,255,0.2); transform: scale(1.1) rotate(180deg); }

.track-del { color: var(--neon-red); }
.track-del:hover { opacity: 1; background: rgba(255,56,96,0.2); transform: scale(1.1); }

.empty-playlist {
    color: #666;
    text-align: center;
    font-size: 11px;
    padding: 15px 0;
}

.analysis-progress {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
    display: none;
}

.analysis-progress.active { display: block; }

.analysis-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-cyan));
    width: 40%;
    box-shadow: 0 0 8px var(--neon-cyan);
    animation: progressSweep 1.2s ease-in-out infinite;
}

@keyframes progressSweep {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(300%); }
}

/* ===== КАЛИБРАЦИЯ ===== */
#calibration {
    position: absolute;
    top: 120px;
    right: 15px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px;
    z-index: 100;
    display: none;
    width: 260px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    font-size: 12px;
}

#calibration.active {
    display: block;
    animation: calibSlideIn 0.3s ease-out;
}

@keyframes calibSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

#calibration h2 {
    color: var(--neon-pink);
    text-align: center;
    margin-bottom: 10px;
    font-size: 14px;
    text-shadow: 0 0 10px var(--neon-pink);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.cal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0;
    gap: 10px;
}

.cal-row label {
    color: #ccc;
    font-size: 11px;
    white-space: nowrap;
}

.cal-row input, .cal-row select {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 4px 6px;
    border-radius: 6px;
    width: 65px;
    font-size: 12px;
    text-align: center;
    transition: all 0.2s;
}

.cal-row input:focus, .cal-row select:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan);
}

.cal-buttons {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.cal-buttons button {
    flex: 1;
    min-width: 60px;
    padding: 6px 8px;
    font-size: 11px;
    background: linear-gradient(135deg, rgba(255,43,214,0.15), rgba(0,240,255,0.15));
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.25s;
}

.cal-buttons button:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0,240,255,0.4);
    transform: translateY(-1px);
}

#metroIndicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    margin: 8px auto;
    transition: all 0.08s;
    border: 2px solid rgba(255,255,255,0.2);
}

#metroIndicator.beat1 {
    background: var(--neon-pink);
    border-color: #fff;
    box-shadow: 0 0 20px var(--neon-pink), 0 0 40px rgba(255,43,214,0.5);
    transform: scale(1.3);
}

#metroIndicator.beat {
    background: var(--neon-cyan);
    border-color: #fff;
    box-shadow: 0 0 16px var(--neon-cyan), 0 0 32px rgba(0,240,255,0.4);
    transform: scale(1.2);
}

.beatCounter {
    text-align: center;
    font-size: 13px;
    color: var(--neon-cyan);
    margin: 4px 0;
    min-height: 18px;
    text-shadow: 0 0 8px var(--neon-cyan);
    font-variant-numeric: tabular-nums;
}

.hint {
    color: #888;
    font-size: 10px;
    text-align: center;
    margin-top: 8px;
    line-height: 1.4;
}

.calcInfo {
    background: rgba(255,43,214,0.1);
    border: 1px solid var(--neon-pink);
    border-radius: 8px;
    padding: 6px;
    margin: 8px 0;
    font-size: 11px;
    color: var(--neon-cyan);
    text-align: center;
    box-shadow: inset 0 0 10px rgba(255,43,214,0.1);
}

/* ===== ТРЯСКА КАМЕРЫ ===== */
.shake { animation: cameraShake 0.3s ease-out; }

@keyframes cameraShake {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-4px, 2px); }
    40% { transform: translate(4px, -2px); }
    60% { transform: translate(-3px, -2px); }
    80% { transform: translate(3px, 2px); }
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
    #playlist { width: 220px; }
    #calibration { width: 220px; }
}

@media (max-width: 768px) {
    .player-container { padding: 5px 8px 2px; }
    .player-controls { gap: 8px; margin-bottom: 4px; }
    .play-btn { width: 38px; height: 38px; }
    .play-btn svg { width: 18px; height: 18px; }
    .icon-btn svg { width: 16px; height: 16px; }
    .control-btn { padding: 5px; }

    .progress-container { gap: 6px; margin-bottom: 0; }
    .time-current, .time-total { font-size: 10px; min-width: 32px; }
    .difficulty-select { font-size: 10px; padding: 3px 6px; }
    .calib-btn { width: 26px; height: 26px; font-size: 14px; }

    .track-info-row { padding: 2px 8px; margin-bottom: 2px; }
    .track-name-display { font-size: 10px; }

    .stats-row {
        gap: 10px;
        padding: 6px 12px;
        bottom: 10px;
    }
    .stat-value { font-size: 14px; }
    .stat-label { font-size: 8px; }
    .stat-item { min-width: 50px; }
    #hpBar { width: 80px; height: 16px; }
    #hpText { font-size: 8px; }

    /* Плейлист по умолчанию скрыт */
    #playlist {
        width: 220px;
        max-height: 45vh;
        top: 90px;
        left: 8px;
        transform: translateX(-240px);
    }
    #playlist:not(.collapsed) {
        transform: translateX(0);
    }
    #playlist.collapsed {
        transform: translateX(-240px);
    }

    /* Кнопка-переключатель на планшетах */
    #playlist-toggle {
        display: flex;
        top: 98px;
        left: 16px;
    }

    #calibration {
        position: fixed;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 300px;
        max-height: 80vh;
        overflow-y: auto;
    }

    #deathScreen h1 { font-size: 40px; }
    #deathScreen .stats { font-size: 16px; }
    #deathScreen button { padding: 10px 24px; font-size: 16px; }

    #info { font-size: 10px; bottom: 75px; }
}

@media (max-width: 480px) {
    .player-container { padding: 4px 6px 1px; }
    .player-controls { gap: 6px; margin-bottom: 3px; }
    .play-btn { width: 34px; height: 34px; }
    .play-btn svg { width: 16px; height: 16px; }
    .icon-btn svg { width: 14px; height: 14px; }
    .control-btn { padding: 4px; }

    .progress-container { gap: 4px; }
    .time-current, .time-total { font-size: 9px; min-width: 28px; }
    .difficulty-select { font-size: 9px; padding: 2px 4px; }
    .calib-btn { width: 24px; height: 24px; font-size: 12px; }

    .track-info-row { padding: 1px 6px; }
    .track-name-display { font-size: 9px; }

    .stats-row {
        gap: 6px;
        padding: 5px 8px;
        bottom: 8px;
        flex-wrap: wrap;
    }
    .stat-value { font-size: 12px; }
    .stat-label { font-size: 7px; }
    .stat-item { min-width: 45px; }
    #hpBar { width: 147px; height: 14px; }
    #hpText { font-size: 7px; }

    /* Плейлист на телефонах */
    #playlist {
        width: 200px;
        max-height: 42vh;
        top: 86px;
        left: 6px;
        transform: translateX(-220px);
    }
    #playlist:not(.collapsed) {
        transform: translateX(0);
    }
    #playlist.collapsed {
        transform: translateX(-220px);
    }
    #playlist-toggle {
        top: 87px;
        left: 6px;
    }
    .track { padding: 6px 8px; }
    .track-name { font-size: 11px; }
    .track-meta { font-size: 9px; }

    #comboDisplay { font-size: 48px; }
    #hitText { font-size: 36px; }

    #deathScreen h1 { font-size: 32px; }
    #deathScreen .stats { font-size: 14px; }

    #info { font-size: 10px; bottom: 75px; }
}

@media (max-width: 360px) {
    #playlist { width: 180px; }
    .stats-row { gap: 4px; padding: 4px 6px; }
    .stat-item { min-width: 40px; }
}

/* =====================================================================
   ИСПРАВЛЕНИЕ: Скрытие аудио-элемента без vendor-specific селекторов
   Это убирает предупреждения IDE и гарантированно скрывает плеер
   ===================================================================== */
/* =====================================================================
   ИСПРАВЛЕНИЕ: Полное скрытие аудио элемента
   ===================================================================== */

audio {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
}

audio[hidden],
audio[controls="false"] {
    display: none !important;
    visibility: hidden !important;
}

audio::-webkit-media-controls {
    display: none !important;
}