:root {
    --bg-color: #064e3b;
    /* Deep Forest Green */
    --card-bg: rgba(6, 78, 59, 0.75);
    --text-primary: #ecfdf5;
    --text-secondary: #a7f3d0;
    --accent-primary: #fbbf24;
    /* Gold */
    --accent-secondary: #fcd34d;
    --success: #10b981;
    --error: #ef4444;
    --focus-pink: #ff69b4;
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    min-height: 100dvh;
    /* iOS Safari fix */
    display: flex;
    justify-content: center;
    align-items: center;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(251, 191, 36, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
}

.app-container {
    width: 98%;
    max-width: 900px;
    padding: 2.5rem;
    text-align: center;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

header h1 {
    font-weight: 600;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    letter-spacing: 1px;
    font-size: 1.1rem;
}

.key-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
}

.key-btn {
    background: rgba(6, 95, 70, 0.5);
    border: 1px solid var(--accent-primary);
    color: var(--text-primary);
    padding: 1.2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.key-btn:hover {
    background: var(--accent-primary);
    color: #064e3b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.nav-back-button {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
}

.nav-back-button:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-main);
    text-decoration: none;
    display: inline-block;
}

.secondary-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
}


#score-board {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.streak-label {
    font-size: 1.1rem;
    color: var(--accent-primary);
    font-weight: 600;
}

.hidden {
    display: none !important;
}

.feedback-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
}

#feedback-message {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    min-height: 1.5rem;
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.play-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-main);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
}

.play-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.play-btn:active {
    transform: translateY(0);
}

.piano-container {
    position: relative;
    height: 220px;
    background: #064e3b;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    box-shadow: inset 0 2px 20px rgba(0, 0, 0, 0.8);
}

.white-key {
    position: absolute;
    height: 100%;
    background: #f0fdf4;
    border: 1px solid #a7f3d0;
    color: #065f46;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 12px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.1s;
    border-radius: 0 0 4px 4px;
}

.white-key:hover {
    background: #dcfce7;
}

.black-key {
    position: absolute;
    height: 60%;
    background: #062019;
    z-index: 2;
    border-radius: 0 0 4px 4px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border: 1px solid #064e3b;
}

.black-key:hover {
    background: #065f46;
}

.key-label {
    color: #f59e0b;
    font-size: 1.4rem;
    font-weight: bold;
}

.key-label-black {
    color: #fbbf24;
    font-size: 1rem;
    font-weight: bold;
}

.correct-flash {
    background-color: var(--success) !important;
    border-color: var(--success) !important;
    color: white !important;
}

.incorrect-flash {
    background-color: var(--error) !important;
    border-color: var(--error) !important;
    color: white !important;
}

button:focus,
.white-key:focus,
.black-key:focus,
.white-key.active,
.black-key.active {
    outline: 4px solid var(--focus-pink);
    outline-offset: 2px;
    z-index: 10;
}

.shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

footer {
    margin-top: 2rem;
    color: var(--text-secondary);
    opacity: 0.6;
    font-size: 0.9rem;
}