/* ===== FLAPPING BIRD - GAME STYLES ===== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Arial', 'Helvetica', sans-serif;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: none;
}

body {
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 100%);
}

/* Game Container */
#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 100%);
}

/* Canvas */
#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

/* Screen Overlays */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    z-index: 10;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Start Screen */
#startScreen {
    background: linear-gradient(to bottom, rgba(74, 144, 226, 0.95) 0%, rgba(135, 206, 235, 0.95) 100%);
}

.title-container {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease;
}

.game-title {
    font-size: 56px;
    font-weight: bold;
    color: #ffffff;
    text-shadow:
        3px 3px 0px rgba(0, 0, 0, 0.3),
        6px 6px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: 4px;
    margin-bottom: 20px;
}

.bird-icon {
    font-size: 64px;
    animation: bounce 1s ease-in-out infinite;
}

.instructions {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeIn 0.8s ease;
}

.instruction-text {
    font-size: 28px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
}

.instruction-subtext {
    font-size: 18px;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Best Score Display */
.best-score-container {
    position: absolute;
    bottom: 60px;
    text-align: center;
    animation: fadeIn 1s ease;
}

.best-label {
    font-size: 16px;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.best-score {
    font-size: 36px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Game Buttons */
.game-button {
    padding: 16px 48px;
    font-size: 22px;
    font-weight: bold;
    color: #ffffff;
    background: linear-gradient(to bottom, #4CAF50 0%, #388E3C 100%);
    border: none;
    border-radius: 50px;
    box-shadow:
        0 4px 0 #2E7D32,
        0 6px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: fadeIn 1s ease;
}

.game-button:active {
    transform: translateY(4px);
    box-shadow:
        0 0 0 #2E7D32,
        0 2px 10px rgba(0, 0, 0, 0.3);
}

.game-button.secondary {
    background: linear-gradient(to bottom, #757575 0%, #616161 100%);
    box-shadow:
        0 4px 0 #424242,
        0 6px 20px rgba(0, 0, 0, 0.3);
}

.game-button.secondary:active {
    box-shadow:
        0 0 0 #424242,
        0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Game Over Screen */
#gameOverScreen {
    background: linear-gradient(to bottom, rgba(244, 67, 54, 0.95) 0%, rgba(211, 47, 47, 0.95) 100%);
}

.game-over-content {
    text-align: center;
    animation: scaleIn 0.5s ease;
}

.game-over-title {
    font-size: 48px;
    font-weight: bold;
    color: #ffffff;
    text-shadow:
        3px 3px 0px rgba(0, 0, 0, 0.3),
        6px 6px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: 4px;
    margin-bottom: 40px;
}

.score-panel {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px 60px;
    margin-bottom: 40px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    min-width: 250px;
}

.score-label {
    font-size: 20px;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.score-value {
    font-size: 36px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* In-Game UI */
#gameUI {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

#gameUI.hidden {
    display: none;
}

.score-display {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 56px;
    font-weight: bold;
    color: #ffffff;
    text-shadow:
        3px 3px 0px rgba(0, 0, 0, 0.3),
        6px 6px 10px rgba(0, 0, 0, 0.2);
    z-index: 15;
}

.ready-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    font-weight: bold;
    color: #FFD700;
    text-shadow:
        2px 2px 0px rgba(0, 0, 0, 0.5),
        4px 4px 10px rgba(0, 0, 0, 0.3);
    animation: pulse 1s ease-in-out infinite;
    z-index: 15;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.8;
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 600px) {
    .game-title {
        font-size: 42px;
    }

    .bird-icon {
        font-size: 48px;
    }

    .instruction-text {
        font-size: 24px;
    }

    .instruction-subtext {
        font-size: 16px;
    }

    .game-button {
        padding: 14px 40px;
        font-size: 18px;
    }

    .game-over-title {
        font-size: 36px;
    }

    .score-panel {
        padding: 25px 40px;
    }

    .score-row {
        min-width: 200px;
    }

    .score-label {
        font-size: 16px;
    }

    .score-value {
        font-size: 28px;
    }

    .score-display {
        font-size: 42px;
        top: 30px;
    }

    .ready-message {
        font-size: 32px;
    }
}

@media (max-width: 400px) {
    .game-title {
        font-size: 36px;
    }

    .game-button {
        padding: 12px 32px;
        font-size: 16px;
    }

    .score-display {
        font-size: 36px;
    }
}

/* Landscape Mode */
@media (max-height: 500px) and (orientation: landscape) {
    .game-title {
        font-size: 32px;
        margin-bottom: 10px;
    }

    .bird-icon {
        font-size: 36px;
    }

    .instructions {
        margin-bottom: 20px;
    }

    .instruction-text {
        font-size: 20px;
    }

    .game-button {
        padding: 10px 30px;
        font-size: 16px;
        margin: 5px;
    }

    .best-score-container {
        bottom: 30px;
    }

    .best-label {
        font-size: 12px;
    }

    .best-score {
        font-size: 24px;
    }
}
