/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One:wght@400&family=Inter:wght@400;500;600;700&display=swap');

/* Nav-menu isolation fixes */
.site-header,
.site-header *,
.main-nav,
.main-nav *,
.mobile-menu-toggle,
.mobile-menu-toggle * {
    box-sizing: border-box !important;
    font-family: Arial, sans-serif !important;
    user-select: auto !important;
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
}

/* Ensure nav has proper layering */
.site-header {
    position: relative !important;
    z-index: 1000 !important;
    width: 100% !important;
}

.main-nav {
    position: relative !important;
    z-index: 999 !important;
}

.mobile-menu-toggle {
    z-index: 1001 !important;
}

/* Mobile nav specific fixes */
@media screen and (max-width: 768px) {
    .site-header {
        padding-top: 4rem !important;
    }
    
    .main-nav {
        position: absolute !important;
        top: 3.5rem !important;
        left: 1rem !important;
        right: 1rem !important;
        width: calc(100% - 2rem) !important;
        background-color: #333 !important;
        border-radius: 0.5rem !important;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
        max-width: none !important;
        min-width: auto !important;
    }
    
    .game-logo {
        font-size: 1.2rem;
    }
    
    .high-score-display {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98D8E8 50%, #B6E2F0 100%);
    min-height: 100vh;
}

#boarddiv {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin: 2rem auto;
    padding: 1rem;
}

/* Game Header Integration */
.game-header-integrated {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.game-logo {
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    font-weight: 400;
    color: #2c3e50;
    margin: 0;
    text-align: center;
    flex: 1;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.high-score-display {
    font-size: 0.85rem;
    font-weight: 600;
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(39, 174, 96, 0.2);
    flex-shrink: 0;
}

.canvas-container {
    position: relative;
    width: 100%;
    max-width: 400px;
}

#board {
    touch-action: manipulation;
    background-image: url("./flyingbirdbg.png");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.1s ease;
    max-width: 100%;
    height: auto;
}

#board:active {
    transform: scale(0.98);
}

/* Game UI Overlays */
.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.score-display {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    z-index: 15;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.start-screen,
.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    z-index: 20;
    pointer-events: all;
}

.start-screen h1,
.game-over-screen h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    margin: 0 0 1rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    color: #FFD700;
}

.start-screen p,
.game-over-screen p {
    font-size: 1.2rem;
    margin: 0.5rem 0;
    font-weight: 500;
}

.play-button,
.restart-button {
    background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 2rem;
    cursor: pointer;
    margin-top: 1.5rem;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.play-button:hover,
.restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.play-button:active,
.restart-button:active {
    transform: translateY(0);
}

.final-score {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    margin: 1rem 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.final-score h2 {
    margin: 0 0 0.5rem 0;
    font-family: 'Fredoka One', cursive;
    color: #FFD700;
}

.final-score p {
    margin: 0.25rem 0;
    font-size: 1rem;
}

.instructions {
    max-width: 300px;
    line-height: 1.5;
    opacity: 0.9;
}

.high-score {
    color: #FFD700;
    font-weight: 700;
}

/* Controls hint */
.controls-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    opacity: 0.8;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.4; }
}

/* Responsive Design */
@media (max-width: 480px) {
    #boarddiv {
        padding: 0.5rem;
    }
    
    .start-screen h1,
    .game-over-screen h1 {
        font-size: 2.5rem;
    }
    
    .score-display {
        font-size: 1.4rem;
        top: 15px;
        right: 15px;
        padding: 0.4rem 0.8rem;
    }
    
    .play-button,
    .restart-button {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .instructions {
        max-width: 250px;
        font-size: 1rem;
    }
}

@media (max-height: 600px) {
    .start-screen h1,
    .game-over-screen h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .start-screen p,
    .game-over-screen p {
        font-size: 1rem;
        margin: 0.25rem 0;
    }
    
    .play-button,
    .restart-button {
        margin-top: 1rem;
        padding: 0.7rem 1.5rem;
    }
}

/* Particle effects container */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* Hide scrollbars */
body::-webkit-scrollbar {
    display: none;
}

body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
