/* 🎮 Flappy Bird Clone - Styles */
/* Modern, responsive design with mobile-first approach */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Arial', 'Helvetica', sans-serif;
    background: linear-gradient(135deg, #70c5ce 0%, #5dade2 100%);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Game Container */
.game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    background: linear-gradient(135deg, #70c5ce 0%, #5dade2 100%);
}

/* Main Game Canvas */
.game-canvas {
    border: 3px solid #2c3e50;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: #70c5ce;
    display: block;
    max-width: 100vw;
    max-height: 100vh;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Canvas fallback message */
.no-canvas-support {
    padding: 40px;
    text-align: center;
    color: #2c3e50;
    font-size: 18px;
    line-height: 1.6;
}

.no-canvas-support ul {
    text-align: left;
    display: inline-block;
    margin-top: 20px;
}

/* Loading Screen */
.loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #f39c12;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Game UI Overlay */
.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* Screen Base Styles */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.screen-content {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    min-width: 300px;
}

/* Start Screen */
.game-title {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-subtitle {
    font-size: 1.2em;
    color: #7f8c8d;
    margin-bottom: 30px;
}

.instructions {
    margin: 20px 0;
    padding: 20px;
    background: rgba(112, 197, 206, 0.1);
    border-radius: 10px;
}

.instruction-item {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
    font-size: 1.1em;
    color: #2c3e50;
}

.instruction-icon {
    font-size: 1.5em;
    margin-right: 10px;
    width: 30px;
}

/* Game HUD */
.game-hud {
    pointer-events: none;
}

.score-display {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.score-value {
    font-size: 3em;
    font-weight: bold;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    font-family: 'Arial Black', Arial, sans-serif;
}

.pause-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    pointer-events: all;
}

/* Game Over Screen */
.game-over-title {
    font-size: 2em;
    color: #e74c3c;
    margin-bottom: 20px;
}

.final-score {
    margin: 20px 0;
    padding: 20px;
    background: rgba(241, 196, 15, 0.1);
    border-radius: 10px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    font-size: 1.3em;
    color: #2c3e50;
}

.score-label {
    font-weight: bold;
}

/* Buttons */
.game-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    min-width: 120px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    pointer-events: all;
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

.game-button.primary {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.game-button.secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.game-button.small {
    padding: 10px 15px;
    font-size: 1em;
    min-width: auto;
}

/* Game Over Buttons */
.game-over-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.pause-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* High Score Display */
.high-score-display {
    margin-top: 20px;
    font-size: 1.2em;
    color: #7f8c8d;
}

/* Audio Controls */
.audio-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 200;
}

.audio-button {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.audio-button:hover {
    background: white;
    transform: scale(1.1);
}

/* Debug Info */
.debug-info {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    z-index: 300;
}

/* Error Screen */
.error-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.error-content {
    text-align: center;
    color: white;
    padding: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
}

.error-content h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

/* Responsive Design */

/* Mobile Phones (< 768px) */
@media (max-width: 767px) {
    .game-canvas {
        width: 100vw;
        height: 100vh;
        border: none;
        border-radius: 0;
        object-fit: contain;
    }
    
    .game-container {
        padding: 0;
    }
    
    .screen-content {
        min-width: 280px;
        max-width: 95%;
        padding: 15px;
    }
    
    .game-title {
        font-size: 2em;
    }
    
    .score-value {
        font-size: 2.5em;
    }
    
    .game-button {
        padding: 12px 25px;
        font-size: 1em;
        min-width: 100px;
    }
    
    .instruction-item {
        font-size: 1em;
    }
    
    .audio-controls {
        bottom: 10px;
        right: 10px;
    }
    
    .audio-button {
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }
}

/* Tablets (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .game-canvas {
        max-width: 90vw;
        max-height: 90vh;
    }
}

/* Large Screens (> 1024px) */
@media (min-width: 1025px) {
    .game-canvas {
        width: 400px;
        height: 600px;
    }
}

/* Landscape Mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .game-canvas {
        width: 100vh;
        height: 100vw;
        transform: rotate(90deg);
    }
    
    .game-ui {
        transform: rotate(90deg);
        width: 100vh;
        height: 100vw;
        left: calc(50% - 50vh);
        top: calc(50% - 50vw);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .game-canvas {
        image-rendering: auto;
    }
}

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

/* Focus styles for keyboard navigation */
.game-button:focus,
.audio-button:focus {
    outline: 3px solid #f39c12;
    outline-offset: 2px;
}

/* Print styles (hide game when printing) */
@media print {
    .game-container {
        display: none;
    }
}
