/* Mobile-first CSS for Musical Buttons */

:root {
    --color-background: #2D3436;
    --color-text: #FFFFFF;
    --color-overlay: rgba(0, 0, 0, 0.9);
    --transition-speed: 0.15s;
    --button-gap: 8px;
    --button-radius: 16px;
}

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

html, body {
    height: 100%;
    height: 100dvh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

/* Start Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background-color: var(--color-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    padding: 2rem;
}

.overlay-emoji {
    font-size: 5rem;
    display: block;
    margin-bottom: 1rem;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.overlay-content h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.overlay-content p {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

.start-button {
    background: linear-gradient(135deg, #FF6B6B, #FF9F43);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--transition-speed) ease;
}

.start-button:active {
    transform: scale(0.95);
}

/* Main App */
#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    height: 100dvh;
    padding: var(--button-gap);
}

#app.hidden {
    display: none;
}

header {
    text-align: center;
    padding: 0.5rem 0;
    flex-shrink: 0;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Button Grid */
.button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--button-gap);
    flex: 1;
    padding: var(--button-gap) 0;
}

/* Music Button */
.music-button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: none;
    border-radius: var(--button-radius);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--transition-speed) ease,
                box-shadow var(--transition-speed) ease,
                filter var(--transition-speed) ease;
    min-height: 80px;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3),
                inset 0 2px 0 rgba(255, 255, 255, 0.2),
                inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.music-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
}

.music-button:active,
.music-button.active {
    transform: scale(0.95);
    filter: brightness(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
                inset 0 2px 0 rgba(255, 255, 255, 0.2),
                inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.music-button .note-label {
    font-size: 2rem;
    line-height: 1;
}

.music-button .note-name {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tablet and Desktop: horizontal layout */
@media (min-width: 600px) {
    header h1 {
        font-size: 2rem;
    }

    .button-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 900px;
        margin: 0 auto;
        width: 100%;
    }

    .music-button {
        min-height: 150px;
    }

    .music-button .note-label {
        font-size: 3rem;
    }

    .music-button .note-name {
        font-size: 1.1rem;
    }
}

/* Wide screens: single row */
@media (min-width: 900px) {
    .button-grid {
        grid-template-columns: repeat(8, 1fr);
        max-width: 1200px;
        align-content: center;
    }

    .music-button {
        min-height: 200px;
    }
}
