/* ========================================
   FINAL MOBILE RESPONSIVE - PRODUCTION READY
   Compact sizes for all mobile devices
   ======================================== */

/* Base responsive font sizing */
:root {
    font-size: 16px;
}

@media (max-width: 600px) {
    :root {
        font-size: 14px;
    }
}

@media (max-width: 375px) {
    :root {
        font-size: 12px;
    }
}

/* ========================================
   GAME GRID - Ultra Compact
   ======================================== */

@media (max-width: 600px) {
    /* Number grid - compact spacing */
    .number-grid {
        gap: clamp(3px, 0.8vw, 6px) !important;
    }

    /* Number buttons - compact size */
    .number-btn {
        /* Remove all fixed sizes */
        min-height: auto !important;
        max-height: none !important;
        min-width: clamp(28px, 6vw, 36px) !important;
        max-width: clamp(28px, 6vw, 36px) !important;
        height: clamp(28px, 6vw, 36px) !important;
        width: clamp(28px, 6vw, 36px) !important;
        aspect-ratio: 1 !important;
        font-size: clamp(9px, 2vw, 13px) !important;
        font-weight: 700 !important;
        border-radius: clamp(5px, 1.2vw, 8px) !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* ========================================
   BUTTONS - Compact Sizes
   ======================================== */

@media (max-width: 600px) {
    /* Bet buttons */
    .bet-btn {
        min-height: auto !important;
        min-width: auto !important;
        padding: clamp(0.4rem, 1.2vw, 0.7rem) clamp(0.7rem, 1.8vw, 1rem) !important;
        font-size: clamp(0.7rem, 1.6vw, 0.9rem) !important;
        border-radius: clamp(0.4rem, 1vw, 0.7rem) !important;
        flex: 0 1 auto !important;
    }

    /* Action buttons */
    .action-btn {
        min-height: auto !important;
        padding: clamp(0.6rem, 1.6vw, 0.9rem) clamp(0.9rem, 2.2vw, 1.3rem) !important;
        font-size: clamp(0.8rem, 1.8vw, 1rem) !important;
        border-radius: clamp(0.5rem, 1.3vw, 0.8rem) !important;
    }

    /* Play button */
    .play-btn {
        min-height: auto !important;
        padding: clamp(0.7rem, 2vw, 1.2rem) clamp(1.3rem, 3.5vw, 2rem) !important;
        font-size: clamp(0.9rem, 2.5vw, 1.3rem) !important;
        border-radius: clamp(0.6rem, 1.8vw, 1rem) !important;
        font-weight: 900 !important;
    }
}

/* ========================================
   TYPOGRAPHY - Compact Text
   ======================================== */

@media (max-width: 600px) {
    /* Balance */
    .balance-value {
        font-size: clamp(0.9rem, 3vw, 1.4rem) !important;
        font-weight: 900 !important;
    }

    .balance-label {
        font-size: clamp(0.65rem, 1.6vw, 0.85rem) !important;
    }

    /* Section titles */
    .section-title {
        font-size: clamp(0.8rem, 2.2vw, 1.2rem) !important;
        margin-bottom: clamp(0.5rem, 1.5vw, 0.9rem) !important;
    }

    /* Info text */
    .selection-info {
        font-size: clamp(0.65rem, 1.6vw, 0.85rem) !important;
    }

    /* Timer and multiplier */
    .timer-value, .multiplier-value {
        font-size: clamp(1rem, 2.8vw, 1.4rem) !important;
    }

    .timer-label, .multiplier-label {
        font-size: clamp(0.6rem, 1.5vw, 0.8rem) !important;
    }
}

/* ========================================
   CONTAINERS - Compact Spacing
   ======================================== */

@media (max-width: 600px) {
    .game-container {
        padding: clamp(0.4rem, 1.2vw, 0.8rem) !important;
    }

    .game-header {
        padding: clamp(0.7rem, 1.8vw, 1.1rem) !important;
        border-radius: clamp(0.8rem, 1.8vw, 1.1rem) !important;
        margin-bottom: clamp(0.6rem, 1.5vw, 0.9rem) !important;
    }

    .game-main {
        padding: clamp(0.7rem, 1.8vw, 1.1rem) !important;
        border-radius: clamp(0.8rem, 1.8vw, 1.1rem) !important;
        margin-bottom: clamp(0.6rem, 1.5vw, 0.9rem) !important;
    }
}

/* ========================================
   TUTORIAL OVERLAY - Compact
   ======================================== */

@media (max-width: 600px) {
    .tutorial-overlay {
        padding: clamp(0.6rem, 1.5vw, 1.1rem) !important;
    }

    .tutorial-step {
        padding: clamp(1rem, 2.5vw, 1.6rem) !important;
        border-radius: clamp(0.8rem, 2vw, 1.3rem) !important;
        max-width: calc(100% - clamp(1.2rem, 3vw, 2.5rem)) !important;
    }

    .tutorial-step h3 {
        font-size: clamp(1rem, 2.6vw, 1.3rem) !important;
        margin-bottom: clamp(0.6rem, 1.6vw, 0.9rem) !important;
    }

    .tutorial-step p {
        font-size: clamp(0.8rem, 2vw, 1rem) !important;
        margin-bottom: clamp(0.8rem, 2vw, 1.2rem) !important;
    }

    .tutorial-btn {
        padding: clamp(0.6rem, 1.6vw, 0.8rem) clamp(1rem, 2.5vw, 1.5rem) !important;
        font-size: clamp(0.8rem, 2vw, 1rem) !important;
        border-radius: clamp(0.5rem, 1.3vw, 0.8rem) !important;
    }

    .tutorial-highlight {
        border-width: clamp(2px, 0.4vw, 2.5px) !important;
        border-radius: clamp(0.8rem, 2vw, 1rem) !important;
    }
}

/* ========================================
   DRAWING OVERLAY - Compact
   ======================================== */

@media (max-width: 600px) {
    .drawing-content {
        padding: clamp(1rem, 2.5vw, 1.6rem) !important;
        border-radius: clamp(0.8rem, 2vw, 1.3rem) !important;
        max-width: calc(100% - clamp(1.2rem, 3vw, 2.5rem)) !important;
    }

    .drawing-title {
        font-size: clamp(1.1rem, 3vw, 1.5rem) !important;
        margin-bottom: clamp(0.8rem, 2vw, 1.2rem) !important;
    }

    .drawn-numbers {
        gap: clamp(0.3rem, 0.8vw, 0.5rem) !important;
    }

    .drawn-number {
        width: clamp(2.4rem, 6vw, 3rem) !important;
        height: clamp(2.4rem, 6vw, 3rem) !important;
        font-size: clamp(0.95rem, 2.4vw, 1.2rem) !important;
        border-radius: clamp(0.6rem, 1.5vw, 0.8rem) !important;
    }
}

/* ========================================
   ANIMATIONS - Relative Scaling
   ======================================== */

@media (max-width: 600px) {
    /* Scale animations - relative only */
    .number-btn.selected {
        transform: scale(1.05) !important;
    }

    .number-btn:hover {
        transform: translateY(-0.1rem) !important;
    }

    .bet-btn.active {
        transform: scale(1.02) !important;
    }

    .play-btn:hover:not(:disabled) {
        transform: translateY(-0.1rem) scale(1.03) !important;
    }

    /* Glow effects - responsive */
    .number-btn.selected {
        box-shadow: 
            0 0 clamp(0.6rem, 1.8vw, 1rem) rgba(255, 215, 0, 0.6),
            0 0 clamp(1.2rem, 3.5vw, 2rem) rgba(255, 215, 0, 0.4) !important;
    }

    .play-btn {
        box-shadow: 0 0 clamp(0.8rem, 2.5vw, 1.8rem) rgba(255, 215, 0, 0.5) !important;
    }

    .play-btn:hover:not(:disabled) {
        box-shadow: 0 0 clamp(1.2rem, 3.5vw, 2.5rem) rgba(255, 215, 0, 0.8) !important;
    }
}

/* ========================================
   SAFE AREA SUPPORT
   ======================================== */

@supports (padding: max(0px)) {
    @media (max-width: 600px) {
        .game-container {
            padding-top: max(0.4rem, env(safe-area-inset-top)) !important;
            padding-bottom: max(0.4rem, env(safe-area-inset-bottom)) !important;
            padding-left: max(0.4rem, env(safe-area-inset-left)) !important;
            padding-right: max(0.4rem, env(safe-area-inset-right)) !important;
        }
    }
}

/* ========================================
   TURBO BUTTON - Compact & Styled
   ======================================== */

@media (max-width: 600px) {
    .turbo-toggle {
        min-height: auto !important;
        padding: clamp(0.4rem, 1vw, 0.6rem) clamp(0.7rem, 1.8vw, 1rem) !important;
        font-size: clamp(0.7rem, 1.6vw, 0.9rem) !important;
        border-radius: clamp(0.4rem, 1vw, 0.7rem) !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.3rem !important;
    }
    
    .turbo-toggle .svg-icon {
        width: clamp(12px, 3vw, 16px) !important;
        height: clamp(12px, 3vw, 16px) !important;
    }
}

/* ========================================
   LANDSCAPE MODE - Extra Compact
   ======================================== */

@media (max-width: 600px) and (orientation: landscape) {
    :root {
        font-size: 11px;
    }

    .game-container {
        padding: 0.3rem !important;
    }

    .game-header {
        padding: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    .game-main {
        padding: 0.7rem !important;
    }

    .number-grid {
        gap: 0.25rem !important;
    }

    .number-btn {
        min-width: 2rem !important;
        min-height: 2rem !important;
        max-width: 2rem !important;
        max-height: 2rem !important;
        font-size: 0.75rem !important;
    }

    .balance-value {
        font-size: 1rem !important;
    }

    .section-title {
        font-size: 0.95rem !important;
        margin-bottom: 0.6rem !important;
    }
    
    .turbo-toggle {
        padding: 0.3rem 0.7rem !important;
        font-size: 0.7rem !important;
    }
}
