/* === base.css — современный стиль в стиле metronome-giga === */

:root {
    --bg-body: #f8f9fa;
    --text: #333;
    --text-muted: #767777;
    --accent: #3498db;
    --accent-hover: #2980b9;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --white: #fff;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    --border: 1px solid #d8d8d8;
    --radius: 5px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === Navbar === */
.navbar {
    background-color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand h2 {
    color: var(--white);
    font-size: 1.5rem;
    margin: 0;
}

.nav-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    height: 60px;
    padding: 5px;
    background-color: var(--white);
    border-radius: var(--radius);
    border: var(--border);
    box-shadow: var(--shadow);
}

.nav-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-align: center;
}

/* === Sound Toggle === */
.sound-toggle {
    display: flex;
    gap: 8px;
}

.radio-label input {
    display: none;
}

.radio-btn {
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    font-size: 0.7rem;
    border-radius: 50%;
    background: #8d8d8d;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.radio-label input:checked+.radio-btn {
    background: var(--success);
}

.radio-btn:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* === Tempo Control === */
.tempo-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ctrl-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: white;
    color: rgb(65, 65, 65);
    font-size: 1.2rem;
    border-radius: 4px;
    border: 1px solid #d8d8d8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s;
}

.ctrl-btn:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.slider {
    width: 80px;
    height: 6px;
    -webkit-appearance: none;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    outline: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.slider:hover {
    box-shadow: 0 3px 4px rgba(0, 0, 0, 0.2);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* === Select === */
.nav-select {
    font-size: 0.85rem;
    padding: 6px 8px;
    border-radius: var(--radius);
    background: var(--white);
    color: #505050;
    min-width: 80px;
    text-align: center;
    transition: var(--transition);
    border: var(--border);
    box-shadow: var(--shadow-sm);
}

.nav-select:hover {
    box-shadow: var(--shadow);
}

/* === Play Button === */
.play-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--success);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M8 5v14l11-7z'/%3E%3C/svg%3E");
    background-size: 40%;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.play-btn:hover {
    box-shadow: var(--shadow);
}

.startStopBtnChangeBackImg {
    background-color: var(--danger);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M6 6h4v12H6zm8 0h4v12h-4z'/%3E%3C/svg%3E");
}

/* === File Input Group === */
.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

#fileInput {
    /* display: none; */
}

.filename {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 120px;
    text-align: center;
}

.reset-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.reset-btn:hover {
    background: #c0392b;
}

/* === Визуализация метронома === */
.metronome-visualization {
    display: flex;
    gap: 6px;
}

.metronome-step {
    width: 12px;
    height: 12px;
    background: #ddd;
    border-radius: 50%;
    transition: background 0.05s;
}

.metronome-step.active {
    background: var(--danger);
}

.metronome-step.active-yellow {
    background: var(--warning);
}

/* === Основной контент === */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--white);
    padding: 20px;
}

/* === Подсказка по клавишам === */
.keyboard-hint {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    color: #888;
    background: var(--white);
    padding: 6px 10px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.dNone {
    display: none;
}

/* === Адаптивность === */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 12px;
    }

    .nav-group {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        overflow: hidden;
    }

    .nav-label {
        min-width: 60px;
    }

    .slider,
    .nav-select,
    .play-btn {
        transform: scale(0.9);
    }

}