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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f8f9fa;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

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

.nav-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    padding: 8px 10px;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.nav-label {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 5px;
    text-align: center;
    white-space: nowrap;
}

.nav-href{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    height: 60px;
    padding: 5px;
    background-color: white;
    border-radius: 5px;
    border: 1px solid rgb(231, 231, 231);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    color: #333;
}
.nav-href:visited{
    color: #333;
}

/* Радио-переключатели паттернов */
.pattern-toggle {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.radio-label {
    display: flex;
    align-items: center;
}

.radio-label input {
    display: none;
}

.radio-btn {
    display: inline-block;
    min-width: 36px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    font-size: 0.7rem;
    border-radius: 4px;
    background: #95a5a6;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    padding: 0 4px;
}

.radio-label input:checked + .radio-btn {
    background: #27ae60;
}

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

/* Темп */
.tempo-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ctrl-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: white;
    color: #444;
    font-size: 1.1rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    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: 0 1px 2px rgba(0,0,0,0.2);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
}

/* Визуализация метронома */
.beat-circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #999;
    transition: background-color 0.05s, box-shadow 0.05s;
}

.beat-circle.primary {
    background-color: #2ecc71;
}

.beat-circle.secondary {
    background-color: #f39c12;
}

.beat-circle.active {
    background-color: #e74c3c;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
}

/* Play/Stop button */
.play-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #27ae60;
    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: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

.play-btn:hover {
    box-shadow: 0 5px 12px rgba(0,0,0,0.3);
}

.play-btn.startStopBtnChangeBackImg {
    background-color: #e74c3c;
    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");
}

/* Основной контент */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    gap: 12px;
}

.pattern-line {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 0 10px;
    max-width: 100%;
}

.note-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #333;
    transition: background 0.05s;
    font-weight: bold;
}

.note-circle.active {
    background: #FF5722;
    color: white;
}

.text-container {
    font-size: 1.1rem;
    margin-top: 10px;
    color: #555;
}

.keyboard-hint {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    color: #777;
    background: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    z-index: 100;
}

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

    .nav-group {
        width: 100%;
        flex-direction: row;
        justify-content: space-around;
        flex-wrap: wrap;
        gap: 8px;
    }

    .pattern-toggle {
        gap: 4px;
    }

    .radio-btn {
        min-width: 32px;
        height: 26px;
        font-size: 0.65rem;
    }

    .nav-href {
        height: 40px;
        border-radius: 4px;
    }

    .play-btn {
        width: 40px;
        height: 40px;
    }
}