body {
    font-family: sans-serif;
    text-align: center;
    background-color: #f0f0f0;
}

#app {
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 600px;
}

#exercise {
    margin: 20px 0;
}

#notation {
    margin: 20px auto;
    text-align: center;
}

.choices {
    margin: 20px 0;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-gap: 10px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.choice-button {
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: background-color 0.3s;
    display: block;
    margin: 0;
    width: 100%;
    height: 100%;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -webkit-touch-callout: none;
}

/* Apply hover effects only on devices that support hover */
@media (hover: hover) {
    .choice-button:hover {
        background-color: #e0e0e0;
    }
}

/* Add active state for touch devices */
.choice-button:active {
    background-color: #a2a2a2;
    border-color: #666666;
}

/* Remove the original hover that causes the sticky effect on mobile */
.choice-button:hover {
    /* This rule is intentionally empty to override the previous hover style */
}

#score {
    margin: 20px 0;
}

button#start-button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    margin-top: 10px;
}

#timer-container {
    margin: 15px auto;
    width: 80%;
    height: 4px;
    background-color: #eee;
    border-radius: 2px;
    overflow: hidden;
}

#timer-bar {
    height: 100%;
    width: 100%;
    background-color: #4caf50;
    transition: width 1s linear;
}

/* Hide elements initially */
.hidden {
    display: none;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    width: 300px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.modal h2 {
    margin-top: 0;
    color: #333;
}

.modal-button {
    margin-top: 15px;
    padding: 8px 16px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal-button:hover {
    background-color: #45a049;
}

#feedback {
    margin: 10px auto;
    padding: 8px;
    border-radius: 4px;
    font-weight: bold;
    max-width: 80%;
    line-height: 1.2em; /* Adjust to deal with ♭ symbol needing more space */
    min-height: 24px; /* Slightly increased to ensure space for text */
    box-sizing: border-box; /* Include padding in height calculation */
}

#feedback.correct {
    background-color: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
}

#feedback.incorrect {
    background-color: rgba(244, 67, 54, 0.2);
    color: #c62828;
}

.mode-display {
    text-align: right;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1.2em;
    max-width: 500px; /* Match the max-width of the choices grid */
    margin-left: auto;
    margin-right: auto;
    padding-right: 0;
}

/* Controls container styling */
#controls-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 500px;
    margin: 20px auto;
}

/* Mode selection styling */
.mode-selection {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.radio-container {
    margin: 0 15px;
    display: flex;
    align-items: center;
}

.radio-container input[type="radio"] {
    margin-right: 5px;
}

.radio-container label {
    cursor: pointer;
    font-weight: bold;
}
