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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    min-height: 100vh;
    padding: 40px 20px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-content {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.main-content > * {
    flex: 1 1 400px;
}

.tuner-display {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    min-width: 350px;
}

.controls-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 300px;
}

.microphone-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.microphone-selector label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mic-select {
    width: 100%;
    padding: 12px 15px;
    font-size: 1em;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.mic-select:hover:not(:disabled) {
    border-color: #667eea;
    background-color: #fafbff;
}

.mic-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.mic-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.note-display {
    text-align: center;
    margin-bottom: 20px;
}

.note-name {
    font-size: 4em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.cents {
    font-size: 1.5em;
    color: #666;
    font-weight: 500;
}

.frequency-display {
    text-align: center;
    font-size: 1.3em;
    color: #555;
    margin-bottom: 10px;
}

.amplitude-display {
    text-align: center;
    font-size: 1.1em;
    color: #666;
    margin-bottom: 25px;
    font-weight: 500;
}

.amplitude-display span:first-child {
    color: #888;
    font-weight: 400;
}

.tuner-indicator {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.gauge-container {
    position: relative;
    width: 400px;
    height: 250px;
    margin: 0 auto;
}

#gaugeCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.gauge-needle {
    position: absolute;
    bottom: 50px;
    left: 50%;
    width: 150px;
    height: 150px;
    transform: translateX(-50%);
    pointer-events: none;
    transform-origin: 50% 80%;
    transition: transform 0.1s ease;
}

.gauge-needle line {
    transition: stroke 0.3s ease;
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.toggle-btn {
    flex: 1;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-btn.start-btn {
    background: #667eea;
    color: white;
}

.toggle-btn.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.toggle-btn.stop-btn {
    background: #f5576c;
    color: white;
}

.toggle-btn.stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

/* Responsive design */
@media (max-width: 600px) {
    .container {
        padding: 25px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .note-name {
        font-size: 3em;
    }
    
    .controls {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
}

/* Animation for when tuner is active */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.tuner-display.active {
    animation: pulse 2s ease-in-out infinite;
}
