/**
 * Responsive Styles - Scratch & Guess Animals
 * Breakpoints and responsive adjustments
 */

/* ============================================
   LANDSCAPE MODE (Primary)
   ============================================ */

@media (orientation: landscape) {
    .game-screen {
        flex-direction: row;
        height: calc(var(--vh, 1vh) * 100);
        max-height: calc(var(--vh, 1vh) * 100);
        overflow: hidden;
    }

    .game-screen__scratch-area {
        flex: 1;
        height: 100%;
        padding: 60px var(--spacing-xl);
        min-height: 0;
    }

    .game-screen__scratch-container {
        max-width: none;
        max-height: none;
    }

    .bottom-bar {
        left: auto;
        right: 0;
        top: 0;
        bottom: 0;
        width: auto;
        flex-direction: column;
        padding: var(--spacing-md);
        padding-top: 70px;
        background: linear-gradient(270deg, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
    }

    .bottom-bar__input-container {
        width: 200px;
    }

    .bottom-bar__warmth {
        top: auto;
        left: -220px;
        transform: translateY(-50%);
    }

    .bottom-bar__warmth--visible {
        transform: translateY(-50%);
    }
}

/* ============================================
   PORTRAIT MODE
   ============================================ */

@media (orientation: portrait) {
    .game-screen {
        flex-direction: column;
        min-height: 0;
        height: calc(var(--vh, 1vh) * 100);
        max-height: calc(var(--vh, 1vh) * 100);
        overflow: hidden;
    }

    .game-screen .top-bar {
        position: relative;
        order: -1;
        background: transparent;
        flex-shrink: 0;
    }

    .game-screen .bottom-bar {
        position: relative;
        order: 1;
        background: transparent;
        flex-shrink: 0;
    }

    .game-screen__scratch-area {
        width: 100%;
        padding: var(--spacing-xs);
        order: 0;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .game-screen__scratch-container {
        margin: 0 auto;
    }

    .home-screen {
        padding: var(--spacing-md);
    }

    .home-screen__logo {
        margin-bottom: var(--spacing-lg);
    }

    .home-screen__title {
        font-size: clamp(28px, 10vw, 48px);
    }

    .home-screen__categories {
        margin-bottom: var(--spacing-lg);
    }
}

/* ============================================
   LARGE SCREENS (Desktop)
   ============================================ */

@media (min-width: 1200px) {
    .home-screen__categories {
        max-width: 400px;
    }

    .game-screen__scratch-container {
        max-width: 900px;
    }

    .win-overlay__content {
        max-width: 600px;
    }

    .leaderboard-screen,
    .settings-screen {
        max-width: 800px;
        margin: 0 auto;
    }
}

/* ============================================
   MEDIUM SCREENS (Tablet)
   ============================================ */

@media (max-width: 1024px) and (min-width: 768px) {
    .game-screen__scratch-container {
        max-width: 700px;
    }
}

/* ============================================
   SMALL SCREENS (Mobile)
   ============================================ */

@media (max-width: 767px) {
    :root {
        --spacing-lg: 16px;
        --spacing-xl: 24px;
    }

    .home-screen {
        padding: var(--spacing-lg);
    }

    .home-screen__title {
        font-size: 32px;
    }

    .home-screen__subtitle {
        font-size: var(--font-size-md);
    }

    .home-screen__category-btn {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: var(--font-size-md);
    }

    .home-screen__category-icon {
        font-size: 24px;
    }

    .top-bar {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .top-bar__btn {
        width: 40px;
        height: 40px;
    }

    .top-bar__points {
        padding: var(--spacing-xs) var(--spacing-md);
    }

    .top-bar__points-value {
        font-size: var(--font-size-lg);
    }

    .bottom-bar {
        padding: var(--spacing-sm) var(--spacing-md);
        gap: var(--spacing-sm);
    }

    .bottom-bar__progress .progress-circle {
        width: 48px;
        height: 48px;
    }

    .bottom-bar__input {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-sm);
    }

    .bottom-bar__btn {
        width: 48px;
        height: 48px;
    }

    .win-overlay__card {
        padding: var(--spacing-lg);
    }

    .win-overlay__title {
        font-size: var(--font-size-xxl);
    }

    .win-overlay__score-value {
        font-size: 36px;
    }

    .win-overlay__buttons {
        flex-direction: column;
    }

    .win-overlay__buttons .btn {
        width: 100%;
    }

    .leaderboard-screen,
    .settings-screen {
        padding: var(--spacing-md);
    }

    .leaderboard-screen__title,
    .settings-screen__title {
        font-size: var(--font-size-xl);
    }

    .leaderboard-entry {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .leaderboard-entry__rank {
        width: 32px;
        height: 32px;
        font-size: var(--font-size-sm);
    }

    .settings-item__input {
        width: 150px;
    }

    .settings-item__slider {
        width: 120px;
    }
}

/* ============================================
   EXTRA SMALL SCREENS
   ============================================ */

@media (max-width: 380px) {
    .home-screen__title {
        font-size: 28px;
    }

    .bottom-bar__input {
        font-size: 14px;
    }

    .bottom-bar__btn {
        width: 44px;
        height: 44px;
    }

    .win-overlay__score-card {
        flex-direction: column;
        gap: var(--spacing-md);
    }
}

/* ============================================
   TOUCH DEVICE ADJUSTMENTS
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets on touch devices */
    .top-bar__btn,
    .bottom-bar__btn {
        min-width: 48px;
        min-height: 48px;
    }

    /* Remove hover effects that don't work on touch */
    .btn:hover,
    .top-bar__btn:hover,
    .bottom-bar__btn:hover {
        transform: none;
    }

    .btn:active,
    .top-bar__btn:active,
    .bottom-bar__btn:active {
        transform: scale(0.95);
    }
}

/* ============================================
   HIGH DPI / RETINA DISPLAYS
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Thinner borders on high DPI */
    .card,
    .glass {
        border-width: 0.5px;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

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

    .animate-bounce,
    .animate-pulse,
    .animate-shake {
        animation: none !important;
    }
}

/* ============================================
   PRINT (for screenshots)
   ============================================ */

@media print {
    .top-bar,
    .bottom-bar,
    .home-screen__nav {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}
