body {
    font-family: Arial, sans-serif;
    text-align: center;
    margin: 0;
    background-color: #ffffff; /* inverted */
    color: #000000;            /* inverted */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.subtitle {
    font-size: 10pt;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 25px;
    margin-bottom: 0;
    color: #000000; /* inverted */
}

.title {
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    color: #000000; /* inverted */
    font-size: 3em;
    margin-top: 0;
}

.top-container {
    display: flex;
    align-items: center;
    margin-top: 20px;
    gap: 10px;
    width: 100%;
    justify-content: space-between;
}

/* Prevent text selection inside buttons */
button, 
button * {
    -webkit-user-select: none; /* Safari / iOS */
    -ms-user-select: none;     /* IE / old Edge */
    user-select: none;         /* Standard */
}

button {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

/* Only apply hover effects on devices that support it */
@media (hover: hover) and (pointer: fine) {
    button:hover {
        transform: scale(1.1);
    }
}

#start-game {
    background-color: black; /* inverted */
    color: white;            /* inverted */
    flex-grow: 1;
}

#start-game:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;   /* no scaling when disabled */
    animation: none !important;   /* stop wiggle when disabled */
}

#start-game:disabled:hover {
    transform: none;              /* block hover scaling */
}

/* Note button styles */
.note-button {
    width: 120px;
    height: 120px;
    font-size: 20px;
    cursor: pointer;
    border: none;
    color: white;
    border-radius: 10px;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); /* subtle bounce */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3); /* normal depth */
}

.note-button:active {
    transform: scale(0.92); /* press in */
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6);
}

.color1 { background-color: #1D929A; }
.color2 { background-color: #e3c33b; color: black; }
.color3 { background-color: #F46C3F; }
.color4 { background-color: #A7226F; }

#game-message {
    margin: 10px 0;
    font-size: 18px;
    color: #000000; /* inverted */
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.buttons-container {
    display: grid;
    grid-template-columns: repeat(3, 120px);
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.score-container {
    display: flex;
    gap: 10px;
}

#current-level, #high-score {
    font-size: 16px;
    color: #000000; /* inverted */
    border: 2px solid gray;
    padding: 8px;
    border-radius: 5px;
}

/* Wiggle animation for hints */
@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-4deg); }
    75% { transform: rotate(4deg); }
}

.wiggle {
    animation: wiggle 1.4s ease-in-out infinite;
}

/* Smoothly stop the wiggle */
@keyframes wiggle-stop {
    0% { transform: rotate(-4deg); }
    50% { transform: rotate(4deg); }
    100% { transform: rotate(0deg); }
}

.wiggle-stop {
    animation: wiggle-stop 0.8s ease forwards;
}

/* Mobile-friendly adjustments */
@media screen and (max-width: 600px) {
    body {
        margin-top: 25px;
        justify-content: flex-start;
    }
    .container { padding: 0; }
    .subtitle { font-size: 8pt; }
    .note-button {
        width: 80px;
        height: 80px;
        font-size: 14px;
    }
    .buttons-container {
        grid-template-columns: repeat(3, 80px);
        gap: 10px;
        margin: 15px 0;
    }
    .title { font-size: 2em; }
    .top-container {
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin-top: 0;
        gap: 0;
    }
    #start-game { width: 100%; }
    .score-container {
        width: 100%;
        justify-content: space-between;
        margin-top: 10px;
    }
    #game-message {
        margin-top: 5px;
        font-size: 14px;
    }
    #current-level { width: 40%; }
    #high-score { width: 60%; }
}
