/* Piano Game - Stylesheet */
:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --dark-bg: #0a0a0a;
    --nav-bg: rgba(10, 10, 10, 0.8);
    --text-white: #ffffff;
    --text-gray: #a3a3a3;
    --transition: all 0.3s ease;

    /* Default Dark Theme Gradients */
    --bg-gradient-1: #0f0c29;
    --bg-gradient-2: #302b63;
    --bg-gradient-1: #0f0c29;
    --bg-gradient-2: #302b63;
    --bg-gradient-3: #24243e;

    /* Semantic Backgrounds */
    --section-bg: rgba(0, 0, 0, 0.3);
    --section-bg-alt: rgba(0, 0, 0, 0.5);
    --card-bg: rgba(255, 255, 255, 0.05);
    --footer-bg: #000000;

    --element-bg: #111111;
    --element-border: #333333;
    --key-cap-bg: #222222;
    --key-text: #ffffff;
}

[data-theme="light"] {
    --primary: #4f46e5;
    --dark-bg: #f8fafc;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --text-white: #111827;
    --text-gray: #4b5563;

    --bg-gradient-1: #e0e7ff;
    --bg-gradient-2: #f3e8ff;
    --bg-gradient-1: #e0e7ff;
    --bg-gradient-2: #f3e8ff;
    --bg-gradient-3: #fae8ff;

    /* Semantic Backgrounds Light */
    --section-bg: rgba(255, 255, 255, 0.4);
    --section-bg-alt: rgba(255, 255, 255, 0.6);
    --card-bg: rgba(255, 255, 255, 0.6);
    --footer-bg: #f1f5f9;

    --element-bg: #ffffff;
    --element-border: #e2e8f0;
    --key-cap-bg: #f1f5f9;
    --key-text: #1e293b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(-45deg, var(--bg-gradient-1), var(--bg-gradient-2), var(--bg-gradient-3));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-white);
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-white);
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(15deg);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.hidden {
    display: none !important;
}

.navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
}

.logo-icon {
    font-size: 1.8rem;
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-white);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Play Button */
.btn-play {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
    filter: brightness(1.1);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 2rem 4rem;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent 40%),
        radial-gradient(circle at bottom left, rgba(79, 70, 229, 0.1), transparent 40%);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* Hero Content */
.hero-content {
    max-width: 600px;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.highlight {
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

/* Hero Actions */
.hero-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
    filter: brightness(1.1);
}

.btn-secondary {
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

/* Hero Visual - Piano Showcase */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
}

.piano-showcase {
    display: flex;
    background: #1a1a1a;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: perspective(1000px) rotateY(-10deg) rotateX(5deg);
    transition: var(--transition);
}

.piano-showcase:hover {
    transform: perspective(1000px) rotateY(0) rotateX(0);
}

.key {
    position: relative;
    border-radius: 0 0 5px 5px;
    transition: 0.1s;
}

.key.white {
    width: 60px;
    height: 240px;
    background: white;
    border: 1px solid #ccc;
    z-index: 1;
}

.key.white:active {
    background: #eee;
    transform: translateY(2px);
}



/* Mobile Responsiveness */
@media (max-width: 768px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-actions {
        justify-content: center;
    }
}

/* Features Section */
.features {
    padding: 6rem 2rem;
    background: var(--section-bg);
    position: relative;
    backdrop-filter: blur(10px);
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 4rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.feature-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-white);
}

.feature-card p {
    color: var(--text-gray);
    line-height: 1.6;
}

/* How to Play Section */
.how-to-play {
    padding: 6rem 2rem;
    background: var(--section-bg-alt);
    text-align: center;
    backdrop-filter: blur(10px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.guide-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-top: 2rem;
    text-align: left;
}

.step {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    transition: var(--transition);
}

.step:hover {
    background: var(--primary-glow);
    transform: translateX(10px);
}

.step-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.8;
}

.step h3 {
    margin-bottom: 0.5rem;
    color: var(--text-white);
}

.step p {
    color: var(--text-gray);
    font-size: 0.95rem;
}

/* Keyboard Guide Visual */
.keyboard-guide {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    background: var(--element-bg);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--element-border);
}

.key-guide {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.key-cap {
    width: 60px;
    height: 60px;
    background: var(--key-cap-bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--key-text);
    box-shadow: 0 4px 0 var(--element-border);
    border: 1px solid var(--element-border);
    transition: var(--transition);
}

.key-guide:hover .key-cap {
    transform: translateY(4px);
    box-shadow: 0 0 0 #000;
    background: var(--primary);
    border-color: var(--primary);
}

.key-guide span {
    font-size: 0.8rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

    .guide-container {
        grid-template-columns: 1fr;
    }
}

/* Footer Section */
footer {
    background: var(--footer-bg);
    padding: 3rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    transition: var(--transition);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-white);
    font-size: 1.2rem;
    font-weight: 700;
    opacity: 0.8;
}

.copyright {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-link {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.social-link:hover {
    color: var(--primary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: perspective(1000px) rotateY(-10deg) rotateX(5deg) translateY(0);
    }

    50% {
        transform: perspective(1000px) rotateY(-10deg) rotateX(5deg) translateY(-20px);
    }

    100% {
        transform: perspective(1000px) rotateY(-10deg) rotateX(5deg) translateY(0);
    }
}

/* Apply Animations */
.hero-content {
    animation: fadeIn 1s ease-out;
}

.hero-visual {
    animation: fadeIn 1s ease-out 0.3s backwards;
}

.piano-showcase {
    animation: float 6s ease-in-out infinite;
}

.piano-showcase:hover {
    animation-play-state: paused;
}

.feature-card {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.feature-card:nth-child(1) {
    animation-delay: 0.2s;
}

.feature-card:nth-child(2) {
    animation-delay: 0.4s;
}

.feature-card:nth-child(3) {
    animation-delay: 0.6s;
}

/* Learn Preview Section (Home Page) */
.learn-preview-section {
    padding: 6rem 2rem;
    background: var(--section-bg);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.learn-preview-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 80% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.learn-preview-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.learn-preview-text {
    position: relative;
    z-index: 2;
}

.learn-preview-desc {
    font-size: 1.15rem;
    color: var(--text-gray);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.learn-features {
    list-style: none;
    margin-bottom: 2.5rem;
}

.learn-features li {
    font-size: 1rem;
    color: var(--text-white);
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.learn-features li:last-child {
    border-bottom: none;
}

.learn-preview-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Mini Piano Visual */
.mini-piano {
    display: flex;
    background: linear-gradient(180deg, var(--element-bg) 0%, var(--footer-bg) 100%);
    padding: 1.5rem 1.5rem 0.5rem;
    border-radius: 1rem;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(99, 102, 241, 0.15);
    transform: perspective(800px) rotateX(5deg);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.mini-piano:hover {
    transform: perspective(800px) rotateX(0deg) scale(1.02);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.6),
        0 0 80px rgba(99, 102, 241, 0.25);
}

.mini-key {
    border-radius: 0 0 6px 6px;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.mini-key.white {
    width: 50px;
    height: 180px;
    background: linear-gradient(180deg, #fff 0%, #f0f0f0 80%, #ddd 100%);
    border: 1px solid #bbb;
    margin: 0 1px;
    box-shadow: 0 4px 0 #aaa, 0 6px 10px rgba(0, 0, 0, 0.2);
}

.mini-key.black {
    width: 32px;
    height: 110px;
    background: linear-gradient(180deg, #333 0%, #111 100%);
    margin: 0 -16px;
    z-index: 10;
    box-shadow: 0 3px 0 #000, 0 5px 8px rgba(0, 0, 0, 0.4);
}

.mini-piano:hover .mini-key.white:nth-child(3) {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #aaa, 0 2px 5px rgba(0, 0, 0, 0.15);
}

.mini-piano:hover .mini-key.black:nth-child(4) {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #000, 0 2px 4px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .learn-preview-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .learn-features {
        display: inline-block;
        text-align: left;
    }

    .mini-piano {
        transform: none;
    }

    .mini-key.white {
        width: 40px;
        height: 140px;
    }

    .mini-key.black {
        width: 26px;
        height: 85px;
        margin: 0 -13px;
    }
}

/* Game Section */
/* Game Section (Optimized) */
.game-section {
    min-height: 100vh;
    background: radial-gradient(circle at center, var(--section-bg-alt) 0%, var(--dark-bg) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 500px;
    height: 85vh;
    /* Taller */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 10;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.score-box,
.high-score-box {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.score-box span,
.high-score-box span {
    color: var(--primary);
    margin-left: 0.5rem;
}

.game-board {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .game-board {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.lane {
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    height: 100%;
}

.lane:last-child {
    border-right: none;
}

/* Hit Zone Indicator */
.lane::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to top, rgba(99, 102, 241, 0.2), transparent);
    pointer-events: none;
    border-top: 1px solid rgba(99, 102, 241, 0.3);
}

.key-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: rgba(20, 20, 20, 0.8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 800;
    font-size: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .key-indicator {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-gray);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
}

.lane.active .key-indicator {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 20px var(--primary), 0 0 10px var(--primary) inset;
    transform: translateX(-50%) translateY(4px);
    border-color: transparent;
}

.lane.active {
    background: linear-gradient(to top, rgba(99, 102, 241, 0.15), transparent 40%);
}

.tile {
    position: absolute;
    left: 10%;
    width: 80%;
    height: 120px;
    background: linear-gradient(180deg, var(--primary) 0%, #4338ca 100%);
    border-radius: 12px;
    box-shadow: 0 0 15px var(--primary-glow), 0 4px 0 rgba(0, 0, 0, 0.2) inset;
    z-index: 2;
}

[data-theme="light"] .tile {
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4), 0 4px 0 rgba(255, 255, 255, 0.3) inset;
}

.tile.hit {
    transform: scale(1.1);
    opacity: 0;
    transition: transform 0.1s ease, opacity 0.1s ease;
    filter: brightness(2);
}


/* Google Login Button */
.btn-google-login {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: #3c4043;
    border: 1px solid #dadce0;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 1rem;
}

.btn-google-login:hover {
    background: #f7f8f8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-color: #d2e3fc;
}

.google-icon {
    width: 18px;
    height: 18px;
}

/* Game Container - (Existing Styles Continue) */
.game-container {
    width: 100%;
    max-width: 500px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Learn Section (Clean) */
.learn-section {
    padding: 0;
    padding-top: 80px;
    /* Header Height */
    height: 100vh;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    overflow: hidden;
}

.piano-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5rem;
    background: white;
}

.piano-keys-list {
    display: flex;
    list-style: none;
    position: relative;
    width: 95%;
    /* Use most of screen width */
    justify-content: center;
}

.piano-key {
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: background 0.05s, transform 0.05s;
    flex-shrink: 0;
}

/* 22 White Keys (C3 to C6) -> 100% / 22 = ~4.5% */
.piano-key.white {
    width: 4.5%;
    height: 60vh;
    /* Taller keys */
    background: white;
    border: 1px solid #333;
    border-radius: 0 0 8px 8px;
    color: #333;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 2rem;
    font-size: 1.2rem;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.piano-key.white.active {
    background: #f3f3f3;
    box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.1);
    transform: translateY(2px);
}

/* Black Keys */
.piano-key.black {
    width: 3%;
    /* Relative to screen width? Black key width ~60% of white. 4.5 * 0.6 = 2.7 */
    height: 35vh;
    /* 60% of white height approx */
    background: #111;
    margin: 0 -1.5%;
    /* Overlap half width */
    z-index: 10;
    border-radius: 0 0 5px 5px;
    color: white;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1.5rem;
    font-size: 1rem;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.piano-key.black.active {
    background: #000;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.key-label {
    font-weight: 800;
    pointer-events: none;
    position: absolute;
    bottom: 20px;
}

.key-sublabel {
    position: absolute;
    bottom: 5px;
    font-size: 0.7rem;
    opacity: 0.6;
}

.game-header {
    display: flex;
    justify-content: space-between;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.game-board {
    flex: 1;
    background: #000;
    border: 2px solid #333;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    box-shadow: 0 0 50px rgba(99, 102, 241, 0.1);
}

.lane {
    position: relative;
    border-right: 1px solid #222;
    height: 100%;
}

.lane:last-child {
    border-right: none;
}

.key-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
    font-weight: bold;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.1s;
    z-index: 5;
}

.lane.active .key-indicator {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--primary);
    transform: translateX(-50%) scale(1.1);
}

.lane.active {
    background: linear-gradient(to top, rgba(99, 102, 241, 0.2), transparent 30%);
}

.tile {
    position: absolute;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, #4f46e5, #6366f1);
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    top: -120px;
    /* Start above view */
    left: 0;
    z-index: 10;
}

.tile::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    height: 30%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 2px;
}

/* hit effect */
.tile.hit {
    background: #22c55e;
    /* Green */
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.1s ease-out;
}

.tile.missed {
    background: #ef4444 !important;
    /* Red */
}

/* Overlay */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
    /* Enhance blur */
}

.game-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#overlay-title {
    font-size: 4rem;
    /* Larger */
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

#overlay-subtitle {
    color: var(--text-gray);
    margin-bottom: 3rem;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

#overlay-subtitle {
    color: var(--text-gray);
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

/* Control Bar (Chrome Piano Style) */
.control-bar {
    background: #222;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #111;
    height: 80px;
}

.control-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.center {
    flex: 1;
    justify-content: center;
}

.app-title {
    font-family: 'Brush Script MT', cursive;
    color: white;
    font-size: 2.5rem;
    margin: 0 2rem;
    font-weight: normal;
}

.control-btn {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.control-btn:hover {
    border-color: #888;
    color: white;
}

.toggle-btn.active {
    border-color: #d946ef;
    color: white;
    box-shadow: 0 0 10px rgba(217, 70, 239, 0.3);
}

.action-btn.rec {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.action-btn.play {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: white;
}

.action-btn.stop {
    background: #eab308;
    border-color: #eab308;
    color: black;
}

/* ========================================
   OPTIMIZED LEARN PAGE STYLES
   ======================================== */

/* Body override for learn page */
.learn-page-body {
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Learn Header - Minimal & Elegant */
.learn-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.75rem 1.5rem;
}

.learn-header-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.learn-controls {
    display: flex;
    gap: 0.75rem;
}

.learn-control-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.learn-control-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: white;
}

.learn-control-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: white;
}

.learn-control-btn.muted svg path:last-child {
    display: none;
}

.learn-nav-links {
    display: flex;
    gap: 1rem;
}

/* Main Content */
.learn-main {
    padding-top: 60px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Piano Section - Full Screen */
.piano-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem 1rem 3rem;
    position: relative;
}

.piano-container {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    position: relative;
}

/* Optimized Piano Keys */
.learn-page-body .piano-keys-list {
    display: flex;
    list-style: none;
    position: relative;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.learn-page-body .piano-key {
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: transform 0.05s ease, box-shadow 0.1s ease;
    flex-shrink: 0;
}

/* White Keys - Optimized */
.learn-page-body .piano-key.white {
    width: clamp(35px, 4vw, 55px);
    height: clamp(180px, 40vh, 320px);
    background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 80%, #e8e8e8 100%);
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 8px 8px;
    color: #555;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 1rem;
    font-size: clamp(0.7rem, 1vw, 0.95rem);
    box-shadow:
        0 6px 0 #bbb,
        0 8px 10px rgba(0, 0, 0, 0.15),
        inset 0 -30px 50px rgba(0, 0, 0, 0.03);
    z-index: 1;
    margin: 0 1px;
}

.learn-page-body .piano-key.white:hover {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 80%, #f0f0f0 100%);
}

.learn-page-body .piano-key.white.active {
    background: linear-gradient(180deg, #f0f0f0 0%, #e5e5e5 80%, #d8d8d8 100%);
    box-shadow:
        0 2px 0 #aaa,
        0 3px 5px rgba(0, 0, 0, 0.1),
        inset 0 -10px 30px rgba(0, 0, 0, 0.05);
    transform: translateY(4px);
}

/* Black Keys - Optimized */
.learn-page-body .piano-key.black {
    width: clamp(22px, 2.5vw, 38px);
    height: clamp(110px, 25vh, 200px);
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 60%, #111 100%);
    margin: 0 calc(clamp(22px, 2.5vw, 38px) / -2);
    z-index: 10;
    border-radius: 0 0 6px 6px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 0.75rem;
    font-size: clamp(0.6rem, 0.8vw, 0.8rem);
    box-shadow:
        0 4px 0 #000,
        0 6px 8px rgba(0, 0, 0, 0.4),
        inset 0 -15px 20px rgba(0, 0, 0, 0.3),
        inset 0 2px 5px rgba(255, 255, 255, 0.1);
    border: 1px solid #333;
    border-top: none;
}

.learn-page-body .piano-key.black:hover {
    background: linear-gradient(180deg, #333 0%, #222 60%, #1a1a1a 100%);
}

.learn-page-body .piano-key.black.active {
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 60%, #000 100%);
    box-shadow:
        0 1px 0 #000,
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 -5px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(3px);
}

/* Key Labels */
.learn-page-body .key-label {
    font-weight: 700;
    pointer-events: none;
    opacity: 0.9;
    font-size: inherit;
    transition: opacity 0.2s ease;
}

.learn-page-body .key-sublabel {
    font-size: 0.65em;
    opacity: 0.5;
    pointer-events: none;
    margin-top: 2px;
}

/* Hide labels toggle */
.learn-page-body .piano-keys-list.hide-labels .key-label,
.learn-page-body .piano-keys-list.hide-labels .key-sublabel {
    opacity: 0;
}

/* Keyboard Hint */
.keyboard-hint {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(99, 102, 241, 0.95);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    z-index: 100;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.dismiss-hint {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.2s ease;
}

.dismiss-hint:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .learn-page-body .piano-key.white {
        width: clamp(30px, 3.5vw, 45px);
        height: clamp(160px, 35vh, 280px);
    }

    .learn-page-body .piano-key.black {
        width: clamp(18px, 2.2vw, 32px);
        height: clamp(100px, 22vh, 180px);
        margin: 0 calc(clamp(18px, 2.2vw, 32px) / -2);
    }
}

@media (max-width: 768px) {
    .learn-header-container {
        padding: 0 0.5rem;
    }

    .learn-control-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .learn-nav-links .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .piano-section {
        padding: 1rem 0.5rem 2rem;
    }

    .learn-page-body .piano-key.white {
        width: clamp(24px, 3vw, 36px);
        height: clamp(140px, 30vh, 220px);
        padding-bottom: 0.5rem;
    }

    .learn-page-body .piano-key.black {
        width: clamp(15px, 1.8vw, 26px);
        height: clamp(85px, 18vh, 140px);
        margin: 0 calc(clamp(15px, 1.8vw, 26px) / -2);
        padding-bottom: 0.4rem;
    }

    .keyboard-hint {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .learn-header {
        padding: 0.5rem 0.75rem;
    }

    .logo-text {
        display: none;
    }

    .learn-page-body .piano-key.white {
        width: clamp(18px, 2.5vw, 28px);
        height: clamp(120px, 28vh, 180px);
        font-size: 0.6rem;
    }

    .learn-page-body .piano-key.black {
        width: clamp(12px, 1.5vw, 20px);
        height: clamp(70px, 16vh, 110px);
        margin: 0 calc(clamp(12px, 1.5vw, 20px) / -2);
        font-size: 0.5rem;
    }

    .keyboard-hint span {
        display: none;
    }

    .keyboard-hint::before {
        content: "Use keyboard!";
    }
}

/* ========================================
   HOW TO PLAY PAGE STYLES
   ======================================== */

.how-to-play-page {
    background: var(--dark-bg);
}

.how-to-play-main {
    padding-top: 80px;
}

/* HTP Hero */
.htp-hero {
    padding: 6rem 2rem 4rem;
    text-align: center;
    background: radial-gradient(circle at center top, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
}

.htp-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.htp-subtitle {
    font-size: 1.25rem;
    color: var(--text-gray);
    max-width: 500px;
    margin: 0 auto;
}

/* HTP Sections */
.htp-section {
    padding: 5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.htp-section:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

/* Game Mechanics Steps */
.htp-steps {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.htp-step {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.htp-step:hover {
    transform: translateX(10px);
    border-color: var(--primary);
}

.htp-step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.htp-step-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: white;
}

.htp-step-content p {
    color: var(--text-gray);
    line-height: 1.6;
}

.htp-step-visual {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Step Visuals */
.visual-tile-demo {
    width: 40px;
    height: 80px;
    background: #111;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.demo-tile {
    width: 100%;
    height: 40px;
    background: linear-gradient(180deg, var(--primary), #818cf8);
    border-radius: 4px;
    position: absolute;
    animation: tilefall 2s ease-in-out infinite;
}

@keyframes tilefall {
    0% {
        top: -40px;
    }

    70% {
        top: 60px;
        opacity: 1;
    }

    71% {
        opacity: 0;
    }

    100% {
        top: 60px;
        opacity: 0;
    }
}

.visual-hitzone {
    text-align: center;
}

.hitzone-line {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    border-radius: 2px;
    margin-bottom: 0.5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 15px var(--primary);
    }
}

.visual-hitzone span {
    font-size: 0.75rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.visual-score {
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-example {
    font-size: 2rem;
    font-weight: 800;
    color: #22c55e;
    animation: scorepop 1.5s ease-in-out infinite;
}

@keyframes scorepop {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Controls Section */
.htp-controls-section {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
}

.controls-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
    align-items: start;
}

.keyboard-visual {
    background: #111;
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid #333;
}

.key-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.key-btn {
    width: 80px;
    height: 100px;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 1px solid #444;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 0 #000;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.key-btn:hover {
    transform: translateY(4px);
    box-shadow: 0 0 0 #000;
    background: linear-gradient(180deg, var(--primary) 0%, #4f46e5 100%);
    border-color: var(--primary);
}

.key-letter {
    font-size: 2rem;
    font-weight: 800;
    color: white;
}

.key-lane {
    font-size: 0.7rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.controls-tips {
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.controls-tips h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: white;
}

.controls-tips ul {
    list-style: none;
}

.controls-tips li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-gray);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.controls-tips li:last-child {
    border-bottom: none;
}

.controls-tips li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* Scoring Cards */
.scoring-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.scoring-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 2.5rem;
    border-radius: 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.scoring-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.scoring-card.miss {
    border-color: rgba(239, 68, 68, 0.3);
}

.scoring-card.miss:hover {
    border-color: #ef4444;
}

.scoring-card.highscore {
    border-color: rgba(234, 179, 8, 0.3);
}

.scoring-card.highscore:hover {
    border-color: #eab308;
}

.scoring-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.scoring-card h3 {
    font-size: 1.25rem;
    color: white;
    margin-bottom: 0.5rem;
}

.scoring-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.scoring-card.miss .scoring-value {
    color: #ef4444;
}

.scoring-card.highscore .scoring-value {
    color: #eab308;
}

.scoring-desc {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* CTA Section */
.htp-cta {
    padding: 6rem 2rem;
    text-align: center;
    background: linear-gradient(180deg, transparent 0%, rgba(99, 102, 241, 0.1) 100%);
}

.htp-cta h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.htp-cta p {
    color: var(--text-gray);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Active nav link */
.nav-links a.active {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .htp-step {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .htp-step-number {
        margin: 0 auto;
    }

    .htp-step-visual {
        display: none;
    }

    .controls-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .key-btn {
        width: 60px;
        height: 80px;
    }

    .key-letter {
        font-size: 1.5rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}

/* ========================================
   LEADERBOARD PAGE STYLES
   ======================================== */

.leaderboard-page {
    background: var(--dark-bg);
}

.leaderboard-main {
    padding-top: 80px;
}

/* Leaderboard Hero */
.lb-hero {
    padding: 5rem 2rem 3rem;
    text-align: center;
    background: radial-gradient(circle at center top, rgba(234, 179, 8, 0.15) 0%, transparent 50%);
}

.lb-title {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.lb-subtitle {
    font-size: 1.2rem;
    color: var(--text-gray);
}

/* Your Stats Card */
.your-stats {
    padding: 0 2rem 3rem;
}

.stats-card {
    max-width: 700px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(79, 70, 229, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-divider {
    width: 1px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
}

/* Leaderboard Section */
.lb-section {
    padding: 3rem 2rem 5rem;
}

.lb-table-container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    overflow: hidden;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
}

.lb-table thead {
    background: rgba(255, 255, 255, 0.05);
}

.lb-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.lb-table td {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.lb-table tbody tr {
    transition: background 0.2s ease;
}

.lb-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.rank-cell {
    font-weight: 700;
    width: 80px;
}

.rank-cell.top-rank {
    font-size: 1.5rem;
}

.name-cell {
    font-weight: 600;
    color: white;
}

.score-cell {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.date-cell {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* User's Row Highlight */
.your-row {
    background: rgba(99, 102, 241, 0.15) !important;
    border-left: 3px solid var(--primary);
}

.your-row .name-cell {
    color: var(--primary);
}

/* Table Medals Animation */
.lb-table tbody tr:nth-child(1) .rank-cell,
.lb-table tbody tr:nth-child(2) .rank-cell,
.lb-table tbody tr:nth-child(3) .rank-cell {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {

    0%,
    100% {
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    }

    50% {
        text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    }
}

/* Note Section */
.lb-note {
    max-width: 600px;
    margin: 2rem auto 0;
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.lb-note p {
    color: var(--text-gray);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.lb-note .btn {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-card {
        flex-direction: column;
        gap: 1.5rem;
    }

    .stat-divider {
        width: 50px;
        height: 1px;
    }

    .lb-table th,
    .lb-table td {
        padding: 0.75rem 1rem;
    }

    .lb-table .date-cell {
        display: none;
    }

    .rank-cell {
        width: 60px;
    }
}

@media (max-width: 480px) {

    .lb-table th,
    .lb-table td {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }

    .score-cell {
        font-size: 1rem;
    }
}

/* ======================================
   SONGS PAGE STYLES
   ====================================== */

/* Songs Page Body */
.songs-page-body {
    background: linear-gradient(180deg, #0a0a0a 0%, #0f0f15 100%);
    min-height: 100vh;
}

/* Songs Header */
.songs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
}

.songs-header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.songs-nav-links {
    display: flex;
    gap: 1rem;
}

/* Songs Main Content */
.songs-main {
    padding-top: 80px;
    min-height: 100vh;
}

/* Song Selection Section */
.song-selection {
    padding: 3rem 2rem;
}

.songs-header-content {
    text-align: center;
    margin-bottom: 3rem;
}

.songs-subtitle {
    color: var(--text-gray);
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* Difficulty Filter */
.difficulty-filter {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-gray);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--text-white);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

/* Songs Grid */
.songs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Song Card */
.song-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.song-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 30px var(--primary-glow);
}

.song-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.song-icon {
    font-size: 2.5rem;
}

.song-difficulty {
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.difficulty-easy {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.difficulty-medium {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.difficulty-hard {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.song-card-body {
    margin-bottom: 1.25rem;
}

.song-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 0.35rem;
}

.song-card-artist {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.song-card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-gray);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

/* Song Play Section */
.song-play-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}

.song-play-section.hidden {
    display: none;
}

.song-game-container {
    width: 100%;
    max-width: 500px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Song Info Bar */
.song-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1.25rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.back-btn:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.1);
}

.song-now-playing {
    text-align: center;
    flex: 1;
}

.song-title-display {
    display: block;
    font-weight: 600;
    color: var(--text-white);
    font-size: 0.95rem;
}

.song-artist-display {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.song-stats {
    display: flex;
    gap: 1.5rem;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* Song Progress Bar */
.song-progress-container {
    position: relative;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.song-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #818cf8);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    right: 0;
    top: -22px;
    font-size: 0.75rem;
    color: var(--text-gray);
}

/* Song Game Board */
.song-game-board {
    flex: 1;
    background: linear-gradient(to bottom, #0a0a0a 0%, #111 80%, #1a1a1a 100%);
    border: 1px solid #333;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

/* Song Overlay */
.song-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    z-index: 20;
    text-align: center;
    padding: 2rem;
}

.song-overlay.hidden {
    display: none;
}

.song-overlay h2 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.song-overlay p {
    color: var(--text-gray);
    font-size: 1rem;
    line-height: 1.8;
}

/* Missed tile animation */
.tile.missed {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%) !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6) !important;
    opacity: 0.5;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Mobile Responsive for Songs Page */
@media (max-width: 768px) {
    .songs-header-container {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .songs-nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .songs-grid {
        grid-template-columns: 1fr;
    }

    .song-info-bar {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .song-now-playing {
        order: -1;
        width: 100%;
    }

    .song-stats {
        width: 100%;
        justify-content: center;
    }

    .difficulty-filter {
        flex-wrap: wrap;
    }
}

/* Piano Key Hint Highlight */
.piano-key.hint {
    background: linear-gradient(to bottom, #22c55e, #16a34a) !important;
    box-shadow: 0 0 15px #22c55e, 0 0 5px #22c55e inset !important;
    transform: translateY(2px);
    border-color: #15803d !important;
}

.piano-key.hint::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 15px solid #22c55e;
    animation: bounce 0.5s infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateX(-50%) translateY(0);
    }

    to {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Control Bar Styles */
.control-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.control-select,
.learn-select {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.control-select:hover,
.learn-select:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary);
}

.control-select option,
.learn-select option {
    background: #1a1a1a;
    color: white;
}

.divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 0.5rem;
}

/* Active State for Buttons */
.control-btn.active,
.learn-control-btn.active {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* Metronome specific */
#metronome-btn.active {
    animation: pulse-border 0.5s infinite;
}

@keyframes pulse-border {
    0% {
        border-color: var(--primary);
    }

    50% {
        border-color: white;
    }

    100% {
        border-color: var(--primary);
    }
}

/* Learn controls layout correction */
.learn-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}