/* Variables */
:root {
    --primary-color: #4A90E2;
    --success-color: #2ECC71;
    --error-color: #E74C3C;
    --text-color: #2C3E50;
    --background-color: #F5F6FA;
    --white-key-width: calc(100% / 14); /* Based on total white keys (14) */
    --white-key-height: calc((100vw - 40px) / 14 * 4); /* 4:1 ratio, accounting for padding */
    --black-key-width: calc(var(--white-key-width) * 0.6);
    --black-key-height: calc(var(--white-key-height) * 0.6);
}

/* ...existing main styles... */

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px auto;
    width: 95vw;
}

.score, .target-note, .time, .high-score {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0;  /* Remove bottom margin since we're using gap */
    padding: 10px 20px;
    border-radius: 8px;
    background: var(--background-color);
}

.high-score {
    font-weight: 600;
}

/* ...existing piano styles... */

.piano {
    display: flex;
    position: relative;
    width: 100%;
    height: var(--white-key-height);
    min-height: 150px; /* Minimum height for playability */
    margin: 30px auto;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 8px 8px;
    transition: opacity 0.3s, filter 0.3s;
    min-width: calc(var(--white-key-width) * 14); /* 14 white keys total */
}

.piano.disabled {
    opacity: 0.6;
    filter: grayscale(70%);
    transition: opacity 0.3s, filter 0.3s;
}

.key {
    position: relative;
    cursor: pointer;
}

.white {
    width: var(--white-key-width);
    height: 100%;
    background-color: white;
    border: 1px solid #eee;
    border-radius: 0 0 4px 4px;
    z-index: 1;
}

.black {
    width: var(--black-key-width);
    height: 60%;
    background-color: #333;
    margin-left: calc(var(--black-key-width) * -0.5);
    margin-right: calc(var(--black-key-width) * -0.5);
    border-radius: 0 0 3px 3px;
    z-index: 2;
}

.key.correct {
    background-color: var(--success-color);
}

.key.wrong {
    background-color: var(--error-color);
}

.white:hover:not(.correct):not(.wrong) {
    background-color: #f8f9fa;
}

.black:hover:not(.correct):not(.wrong) {
    background-color: #444;
}

/* ...existing controls styles... */

.toggle-container {
    display: flex;
    align-items: center;
    background: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.toggle-label {
    margin-left: 10px;
    font-weight: normal;
    color: var(--text-color);
    opacity: 0.8;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.switch input:checked + .slider {
    background-color: var(--primary-color);
}

.switch input:checked + .slider:before {
    transform: translateX(18px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.start-button {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 500;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(74, 144, 226, 0.2);
    margin-bottom: 0;  /* Remove bottom margin */
}

.start-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(74, 144, 226, 0.3);
}

.start-button.cancel {
    background-color: var(--error-color);
    box-shadow: 0 4px 6px rgba(231, 76, 60, 0.2);
}

.start-button:disabled {
    background-color: #cbd5e0;
    transform: none;
    box-shadow: none;
}

.hidden {
    visibility: hidden;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px; /* Increased gap for better spacing */
    width: 100%;
    margin-bottom: 30px; /* Increased margin for better separation from piano */
}

.time {
    min-width: 120px; /* Ensure consistent width */
    text-align: center;
}

.stats-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: center;
    width: 100%;
}

.title-container {
    text-align: center;
    margin-bottom: 20px;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

h1 {
    color: var(--text-color);
    margin: 0 0 10px 0;
}

/* ...existing code... */

.not-started {
    color: var(--background-color);
}

/* ...existing code... */

.time-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.time {
    font-size: 1rem;
    color: var(--text-color);
}

/* ...existing code... */

.time-slider {
    -webkit-appearance: none;
    width: 120px;
    height: 8px;
    border-radius: 4px;
    background: white;
    outline: none;
}

.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.time-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ...existing code... */

.target-note {
    font-size:1rem;
}
#target-note {
    display: block;  /* Make the note span block-level */
    width:100%;
    text-align: center;
    font-size:3rem;
}

/* ...existing code... */
