* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Metropolis', 'Arial', sans-serif;
}

body {
    min-height: 100vh;
    background-color: #000000;
}

.metronome {
    width: 300px;
    background-color: #000000;
    border-radius: 15px;
    padding: 20px;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    margin-left: auto;
    margin-right: auto;
}

.title {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ffffff;
}

.tempo-container,
.time-signature {
    margin-bottom: 20px;
}

.tempo-label,
.time-signature-label,
.sound-selector-label {
    font-size: 14px;
    margin-bottom: 8px;
    color: #ffffff;
    text-align: center;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #333;
    outline: none;
    margin: 10px 0;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #5F1A57;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #5F1A57;
    cursor: pointer;
    border: none;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 10px 0 25px;
}

.play-button, .volume-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid #5F1A57;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    outline: none;
}

.volume-button {
    background-color: #ffffff;
    border: 2px solid #5F1A57;
}

.volume-button.muted svg path {
    fill: #888;
}

.play-button svg, .volume-button svg {
    width: 30px;
    height: 30px;
    color: #5F1A57;
}

.volume-button svg {
    color: #5F1A57;
    width: 24px;
    height: 24px;
}

.play-button.active svg {
    width: 24px;
    height: 24px;
}

.time-signature-selectors {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.time-signature-field {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #5F1A57;
    height: 1cm;
    box-sizing: border-box;
}

.time-select-container {
    position: relative;
    display: flex;
    align-items: center;
}

.time-select {
    background-color: #ffffff;
    color: #5F1A57;
    border: none;
    font-size: 16px;
    font-weight: bold;
    padding: 5px;
    width: 70px;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
}

.time-select-arrows {
    display: flex;
    flex-direction: column;
    margin-left: 5px;
}

.time-select-arrows.left-arrows {
    margin-left: 0;
    margin-right: 5px;
}

.time-select-arrow {
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #5F1A57;
    font-size: 14px;
    user-select: none;
}

.time-select-arrow:hover {
    background-color: rgba(95, 26, 87, 0.1);
    border-radius: 50%;
}

.time-divider {
    font-size: 22px;
    margin: 0 5px;
    color: #5F1A57;
    font-weight: bold;
}

.tempo-controls {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.tempo-btn {
    width: 1cm;
    height: 1cm;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid #5F1A57;
    color: #5F1A57;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.tempo-display {
    flex: 1;
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    color: #ffffff;
    cursor: text;
    min-width: 70px;
    user-select: all;
}

.tempo-display:focus {
    outline: 2px solid #5F1A57;
    border-radius: 4px;
    padding: 2px 4px;
    background-color: #333;
}

.tap-container {
    margin-top: 15px;
    display: flex;
    justify-content: center;
}

.tap-button {
    background-color: #ffffff;
    border: 2px solid #5F1A57;
    border-radius: 6px;
    color: #5F1A57;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    letter-spacing: 1px;
    height: 1cm;
    box-sizing: border-box;
}

.tap-button:active {
    background-color: #e0e0e0;
    color: #5F1A57;
    transform: scale(0.98);
}

.tap-button.active {
    background-color: #e0e0e0;
    color: #5F1A57;
    animation: pulse 0.5s ease-out;
}

.volume-popup {
    position: absolute;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    border: 2px solid #5F1A57;
    border-radius: 10px;
    padding: 15px;
    width: 200px;
    display: none;
    z-index: 10;
}

.volume-popup.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.volume-popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.volume-popup-label {
    font-size: 12px;
    color: #5F1A57;
    margin-bottom: 10px;
}

.volume-slider-container {
    width: 100%;
    display: flex;
    align-items: center;
}

.volume-percentage {
    margin-left: 10px;
    width: 40px;
    font-size: 14px;
    text-align: center;
    color: #5F1A57;
}

.accent-checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    margin-top: -15px;
}

.accent-checkbox-label {
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.accent-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: #ffffff;
    border: 2px solid #5F1A57;
    border-radius: 4px;
    margin-right: 10px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.accent-checkbox:checked ~ .checkmark::after {
    content: "";
    width: 10px;
    height: 10px;
    background-color: #5F1A57;
    border-radius: 2px;
}

.sound-selector-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

.sound-presets {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.sound-preset-btn {
    background-color: #ffffff;
    border: 2px solid #5F1A57;
    border-radius: 4px;
    color: #5F1A57;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sound-preset-btn:hover {
    background-color: #f0f0f0;
}

.sound-preset-btn.active {
    background-color: #5F1A57;
    color: #ffffff;
}

.instrument-select {
    background-color: #ffffff;
    border: 2px solid #5F1A57;
    border-radius: 4px;
    color: #5F1A57;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%235F1A57' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 5px center;
    padding-right: 25px;
}

.instrument-label {
    font-size: 12px;
    color: #ffffff;
    margin-left: 5px;
    cursor: pointer;
}

.instrument-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(95, 26, 87, 0.3);
}

.instrument-select option {
    background-color: #ffffff;
    color: #5F1A57;
}

.instrument-select option:checked {
    background-color: #5F1A57;
    color: #ffffff;
}

.instrument-select.active {
    background-color: #5F1A57;
    color: #ffffff;
}

.spectrogram-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#spectrogram {
    width: 240px;
    height: 60px;
    background-color: #222;
    border: 2px solid #5F1A57;
    border-radius: 8px;
    cursor: crosshair;
    overflow: hidden;
}

.frequency-display {
    margin-top: 5px;
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    cursor: text;
}

.frequency-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 0;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 5px 10px;
}

.frequency-arrow {
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #5F1A57;
    font-size: 14px;
    user-select: none;
    background-color: #ffffff;
    border-radius: 50%;
    margin: 0 5px;
}

.frequency-arrow:hover {
    background-color: #e0e0e0;
}

#frequencyValue {
    min-width: 30px;
    display: inline-block;
    user-select: all;
    font-family: 'Metropolis', monospace;
    font-size: 16px;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

#frequencyValue:focus {
    outline: 2px solid #5F1A57;
    border-radius: 4px;
    padding: 2px 4px;
    background-color: #333;
}

.timer-container {
    margin-top: 20px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-label-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    width: 100%;
}

.timer-label {
    font-size: 14px;
    color: #ffffff;
    margin-right: 8px;
}

.timer-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.timer-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.timer-checkbox-label .checkmark {
    height: 16px;
    width: 16px;
    margin-right: 0;
}

.timer-checkbox:checked ~ .checkmark::after {
    content: "";
    width: 8px;
    height: 8px;
    background-color: #5F1A57;
    border-radius: 2px;
}

.timer-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.timer-display {
    background-color: #ffffff;
    border: 2px solid #5F1A57;
    border-radius: 8px;
    padding: 8px 12px;
    color: #5F1A57;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    flex: 1;
    height: 1cm;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.timer-btn {
    width: 1cm;
    height: 1cm;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid #5F1A57;
    color: #5F1A57;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.timer-slider-container {
    display: none;
}

.timer-minutes {
    margin-left: 10px;
    font-size: 14px;
    color: #ffffff;
    min-width: 50px;
}

.timer-control-mode {
    display: flex;
    justify-content: center;
    margin-top: 8px;
    gap: 10px;
}

.timer-mode-btn {
    background-color: #ffffff;
    border: 2px solid #5F1A57;
    border-radius: 4px;
    color: #5F1A57;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timer-mode-btn.active {
    background-color: #5F1A57;
    color: #ffffff;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}