/**
 * flappy.css - Flappy Dad Game Styles
 */

/* ========================================
   RESET
   ======================================== */

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

/* ========================================
   BODY & LAYOUT
   ======================================== */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #87CEEB 0%, #5BA3CF 100%);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    touch-action: manipulation;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* ========================================
   HEADER
   ======================================== */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 420px;
    margin-bottom: 10px;
    position: relative;
    z-index: 101;
}

h1 {
    color: white;
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.back-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid white;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.back-btn:hover, .back-btn:active {
    background: white;
    color: #5BA3CF;
}

.trophy-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid white;
    padding: 8px 14px;
    font-size: 1.3rem;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.trophy-btn:hover, .trophy-btn:active {
    background: white;
}

/* ========================================
   CANVAS CONTAINER
   ======================================== */

.canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    display: block;
}

/* ========================================
   MODE SELECTOR
   ======================================== */

.mode-selector {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    z-index: 10;
}

.mode-selector h2 {
    color: white;
    font-size: 1.6rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.mode-buttons {
    display: flex;
    gap: 20px;
}

.mode-btn {
    border: none;
    border-radius: 16px;
    padding: 20px 28px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 130px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mode-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

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

.mode-easy {
    background: #2ECC40;
    color: white;
}

.mode-hard {
    background: #E74C3C;
    color: white;
}

.mode-emoji {
    font-size: 2.5rem;
    line-height: 1;
}

.mode-title {
    font-size: 1.4rem;
    font-weight: bold;
}

.mode-desc {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ========================================
   GAME OVER OVERLAY
   ======================================== */

.game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    z-index: 10;
}

.game-over-overlay h2 {
    color: #FF6B6B;
    font-size: 2.2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.go-score {
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
}

.go-highscore {
    color: #FFD700;
    font-size: 1.2rem;
}

.go-rank {
    color: #2ECC40;
    font-size: 1rem;
    min-height: 1.2em;
}

.go-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.go-btn {
    border: none;
    border-radius: 25px;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 200px;
}

.go-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.go-play-again {
    background: #2ECC40;
    color: white;
}

.go-leaderboard {
    background: #3498DB;
    color: white;
}

.go-change-mode {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
}

.back-link {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin-top: 8px;
    text-decoration: none;
}

.back-link:hover {
    color: white;
}

/* ========================================
   PAUSE OVERLAY
   ======================================== */

.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.pause-text {
    color: white;
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.pause-hint {
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
}

/* ========================================
   PAUSE BUTTON
   ======================================== */

.pause-btn {
    position: fixed;
    top: 70px;
    right: 15px;
    background: rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
    font-size: 1.2rem;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    z-index: 100;
    transition: background 0.2s;
    line-height: 1;
}

.pause-btn:hover {
    background: rgba(0,0,0,0.5);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 440px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.4rem;
    }

    .mode-buttons {
        gap: 12px;
    }

    .mode-btn {
        min-width: 110px;
        padding: 16px 20px;
    }

    .mode-emoji {
        font-size: 2rem;
    }

    .mode-title {
        font-size: 1.2rem;
    }

    .game-over-overlay h2 {
        font-size: 1.8rem;
    }

    .go-score {
        font-size: 1.4rem;
    }

    .go-btn {
        min-width: 170px;
        padding: 10px 24px;
        font-size: 0.9rem;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
