/* ===========================
   Flappy Shark - Responsive Styles
   =========================== */

/* Mobile Portrait - Show rotate prompt */
@media (max-width: 768px) and (orientation: portrait) {
    #rotate-prompt {
        display: flex !important;
    }

    #game-container > *:not(#rotate-prompt) {
        display: none !important;
    }
}

/* Mobile Landscape - Optimal */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        margin: 0;
        padding: 0;
    }

    #game-container {
        max-width: 100vw;
        max-height: 100vh;
    }

    #gameCanvas {
        width: 100vw !important;
        height: 100vh !important;
        border-radius: 0;
    }

    .game-title {
        font-size: 2em;
    }

    .btn {
        padding: 12px 30px;
        font-size: 1em;
    }

    .hud-score {
        font-size: 1.5em;
    }

    .btn-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }

    .modal-content {
        padding: 30px;
        max-width: 90%;
    }

    .modal-content h3 {
        font-size: 1.5em;
    }

    .modal-content ul {
        font-size: 1em;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .game-title {
        font-size: 1.8em;
    }

    .btn {
        padding: 10px 25px;
        font-size: 0.9em;
    }

    .gameover-title {
        font-size: 2em;
    }

    .score-display {
        font-size: 1.2em;
    }

    .tutorial-text {
        font-size: 1.5em;
    }
}

/* Tablet Portrait */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    #game-container {
        max-width: 90vh;
        max-height: 90vw;
    }

    #gameCanvas {
        width: 90vh;
        height: calc(90vh / (16/9));
    }
}

/* Tablet Landscape & Desktop */
@media (min-width: 769px) and (orientation: landscape) {
    #game-container {
        max-width: 1200px;
        max-height: 675px;
    }

    #gameCanvas {
        max-width: 1200px;
        max-height: 675px;
    }
}

/* Large Desktop */
@media (min-width: 1920px) {
    #game-container {
        max-width: 1600px;
        max-height: 900px;
    }

    .game-title {
        font-size: 3.5em;
    }

    .btn {
        font-size: 1.4em;
        padding: 18px 50px;
    }
}

/* Ultrawide Desktop (21:9) */
@media (min-width: 1920px) and (min-aspect-ratio: 21/9) {
    #game-container {
        max-width: 1920px;
        max-height: 823px;
    }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper text rendering */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

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

/* Touch-specific optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for mobile */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }

    /* Prevent text selection on touch */
    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        user-select: none;
    }
}

/* Landscape with short height (like iPhone in landscape) */
@media (max-height: 500px) and (orientation: landscape) {
    .game-title {
        font-size: 1.8em;
        margin-bottom: 15px;
    }

    .shark-preview {
        width: 80px;
        height: 60px;
        margin-bottom: 15px;
    }

    .best-score-display {
        font-size: 1.2em;
        margin-top: 10px;
    }

    .menu-buttons {
        margin-top: 15px;
    }

    .btn {
        padding: 10px 30px;
    }

    .gameover-title {
        font-size: 2em;
        margin-bottom: 15px;
    }

    .score-display {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
}
