@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap');

:root {
    --background-color: #121212;
    --surface-color: #1E1E1E;
    --primary-color: #BB86FC;
    --secondary-color: #03DAC6;
    --on-surface-color: #E0E0E0;
    --on-surface-light-color: #8A8A8A;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--background-color);
    color: var(--on-surface-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.container {
    background-color: var(--surface-color);
    padding: 2rem 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

p {
    color: var(--on-surface-light-color);
    margin-bottom: 2rem;
}

.controls {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

button {
    font-family: 'Noto Sans JP', sans-serif;
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: var(--primary-color);
    color: #000;
    font-weight: 700;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(187, 134, 252, 0.3);
}

button:disabled {
    background-color: #333;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.output {
    margin-bottom: 1rem;
}

.note-display {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    min-height: 70px;
}

.meter-container {
    position: relative;
    width: 80%;
    margin: 0 auto 1rem;
    height: 30px;
    background: linear-gradient(to right, #ff4d4d, #4dff4d, #ff4d4d);
    border-radius: 4px;
    border: 1px solid #444;
}

.meter-needle {
    position: absolute;
    top: -5px;
    left: 50%; /* Set by JS */
    width: 4px;
    height: 40px;
    background-color: var(--on-surface-color);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.1s linear;
}

.meter-scale {
    display: flex;
    justify-content: space-between;
    width: 80%;
    margin: 0 auto;
    font-size: 0.8rem;
    color: var(--on-surface-light-color);
}

.clarity {
    color: var(--on-surface-light-color);
    min-height: 20px;
}

.history-container {
    margin-bottom: 2rem;
    text-align: left;
}

.history-container h2 {
    font-size: 1rem;
    color: var(--on-surface-light-color);
    margin-bottom: 0.5rem;
    text-align: center;
}

#pitch-history {
    list-style: none;
    padding: 0.5rem 1rem;
    margin: 0 auto;
    max-height: 100px;
    width: 80%;
    overflow-y: auto;
    background-color: #1A1A1A;
    border-radius: 4px;
    color: var(--on-surface-color);
}

#pitch-history li {
    padding: 0.25rem 0;
    border-bottom: 1px solid #333;
}

#pitch-history li:last-child {
    border-bottom: none;
}

.waveform-canvas {
    width: 100%;
    height: 100px;
    background-color: #1A1A1A;
    border-radius: 4px;
}
