/* ========== MOBILE RESPONSIVE STYLES ========== */

/* Detecção de dispositivos móveis */
@media only screen and (max-width: 768px) {
    
    /* ========== BODY & CONTAINER ========== */
    body {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        touch-action: manipulation;
    }
    
    .game-container {
        width: 100vw;
        height: 100vh;
        overflow: hidden;
    }
    
    /* ========== CANVAS ========== */
    #gameCanvas {
        width: 100vw !important;
        height: 100vh !important;
        touch-action: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* ========== HUD MOBILE ========== */
    .hud {
        padding: 5px;
        font-size: 12px;
    }
    
    .hud-left,
    .hud-right {
        gap: 5px;
    }
    
    .hud-item {
        padding: 5px 8px;
        min-width: 60px;
    }
    
    .hud-label {
        font-size: 9px;
        margin-bottom: 2px;
    }
    
    .hud-value {
        font-size: 14px;
    }
    
    .health-bar {
        width: 80px;
    }
    
    /* ========== MENU SCREENS ========== */
    .menu-screen {
        padding: 20px 15px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .menu-screen h1 {
        font-size: 28px;
        margin-bottom: 15px;
    }
    
    .menu-screen h2 {
        font-size: 20px;
    }
    
    .controls {
        font-size: 12px;
        margin: 10px 0;
    }
    
    .controls p {
        margin: 5px 0;
    }
    
    /* ========== BUTTONS ========== */
    .btn {
        padding: 12px 20px;
        font-size: 14px;
        margin: 5px 0;
        width: 100%;
        max-width: 300px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn:active {
        transform: scale(0.95);
    }
    
    /* ========== CHEATYMOUZ BADGE ========== */
    .cheatymouz-badge {
        bottom: 10px !important;
        left: 10px !important;
        padding: 8px 12px !important;
        font-size: 10px !important;
    }
    
    .cheatymouz-badge div:first-child {
        font-size: 20px !important;
    }
    
    /* ========== USER INFO ========== */
    .user-info-container {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .user-welcome {
        font-size: 14px;
    }
    
    .logout-btn {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    /* ========== GAME SECTIONS ========== */
    .menu-screen > div[style*="margin-top"] {
        margin-top: 10px !important;
        padding-top: 10px !important;
    }
    
    .menu-screen > div[style*="margin-top"] p {
        font-size: 10px !important;
        margin-bottom: 8px !important;
    }
    
    /* ========== DONATION ========== */
    .donation-container {
        margin-top: 20px !important;
        padding: 15px 10px !important;
    }
    
    .donation-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* ========== VERSION & CREDITS ========== */
    #versionLink {
        font-size: 11px !important;
    }
    
    /* ========== ACHIEVEMENTS ========== */
    .achievements-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    .achievement-card {
        padding: 15px;
    }
    
    .achievement-notification {
        width: 90vw;
        max-width: 350px;
        font-size: 12px;
    }
    
    /* ========== LEADERBOARD ========== */
    .leaderboard-container {
        padding: 15px;
    }
    
    .leaderboard-table {
        font-size: 12px;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 5px;
    }
    
    /* ========== GAME MODES ========== */
    .game-modes-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .mode-card {
        padding: 15px;
    }
    
    /* ========== HOW TO PLAY ========== */
    .htp-tabs {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .htp-tab-btn {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .htp-content {
        padding: 15px;
    }
    
    /* ========== SETTINGS ========== */
    .settings-layout {
        flex-direction: column;
    }
    
    .settings-preview {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .settings-panel {
        width: 100%;
    }
    
    #crosshairPreview {
        width: 100%;
        height: 250px;
    }
    
    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .setting-slider {
        width: 100%;
    }
    
    /* ========== CHANGELOG ========== */
    .changelog-container {
        padding: 15px;
    }
    
    .version-card {
        padding: 15px;
    }
    
    .version-tags {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .version-tag {
        font-size: 9px;
        padding: 3px 8px;
    }
    
    .change-list {
        font-size: 12px;
    }
    
    /* ========== ADMIN PANEL ========== */
    #adminSection {
        display: none !important; /* Ocultar em mobile */
    }
    
    /* ========== GAME OVER ========== */
    .game-over {
        padding: 20px;
    }
    
    .game-over h2 {
        font-size: 28px;
    }
    
    .stats {
        font-size: 14px;
    }
    
    /* ========== VICTORY SCREEN ========== */
    .victory-content {
        padding: 20px;
        max-width: 100%;
    }
    
    .victory-title {
        font-size: 24px;
    }
    
    .victory-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    /* ========== FLOATING TEXTS ========== */
    .floating-text {
        font-size: 16px !important;
    }
    
    /* ========== PARTICLES ========== */
    /* Reduzir partículas em mobile para performance */
    
    /* ========== CROSSHAIR ========== */
    /* Crosshair maior em mobile */
    
    /* ========== TOOLTIPS ========== */
    .cheatymouz-badge + div {
        width: 90vw !important;
        max-width: 400px !important;
        padding: 20px !important;
    }
}

/* ========== LANDSCAPE MODE (Mobile Horizontal) ========== */
@media only screen and (max-width: 768px) and (orientation: landscape) {
    .hud {
        font-size: 11px;
    }
    
    .hud-item {
        padding: 4px 6px;
        min-width: 50px;
    }
    
    .hud-label {
        font-size: 8px;
    }
    
    .hud-value {
        font-size: 12px;
    }
    
    .menu-screen {
        padding: 15px 10px;
    }
    
    .menu-screen h1 {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* ========== SMALL PHONES ========== */
@media only screen and (max-width: 375px) {
    .hud {
        font-size: 10px;
    }
    
    .hud-item {
        padding: 4px 6px;
        min-width: 50px;
    }
    
    .hud-label {
        font-size: 8px;
    }
    
    .hud-value {
        font-size: 12px;
    }
    
    .menu-screen h1 {
        font-size: 24px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .cheatymouz-badge {
        display: none; /* Ocultar em telas muito pequenas */
    }
}

/* ========== TOUCH CONTROLS ========== */
.mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: space-around;
    align-items: center;
    padding: 10px;
    z-index: 1000;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

@media only screen and (max-width: 768px) {
    .mobile-controls {
        display: flex;
    }
}

.mobile-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 70, 85, 0.8) 0%, rgba(255, 100, 100, 0.8) 100%);
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 15px rgba(255, 70, 85, 0.4);
    transition: all 0.1s ease;
}

.mobile-btn:active {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(255, 70, 85, 0.6);
}

.mobile-btn.pause {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.8) 0%, rgba(255, 200, 0, 0.8) 100%);
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.4);
}

.mobile-btn.pause:active {
    box-shadow: 0 2px 8px rgba(255, 165, 0, 0.6);
}

/* ========== PERFORMANCE OPTIMIZATIONS ========== */
@media only screen and (max-width: 768px) {
    /* Desabilitar animações pesadas */
    .hud-item {
        animation: none !important;
    }
    
    /* Simplificar gradientes */
    .btn {
        background: rgba(255, 70, 85, 0.8) !important;
    }
    
    /* Reduzir blur effects */
    .menu-screen,
    .game-over,
    .victory-screen {
        backdrop-filter: blur(5px) !important;
    }
    
    /* Desabilitar sombras complexas */
    .version-card,
    .achievement-card,
    .mode-card {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    }
}

/* ========== ORIENTATION WARNING ========== */
.orientation-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 99999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.orientation-warning-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: rotate-phone 2s ease-in-out infinite;
}

@keyframes rotate-phone {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

.orientation-warning-text {
    font-size: 20px;
    color: #fff;
    margin-bottom: 10px;
}

.orientation-warning-subtext {
    font-size: 14px;
    color: #999;
}

/* Mostrar aviso apenas em portrait em telas pequenas */
@media only screen and (max-width: 768px) and (orientation: portrait) and (max-height: 600px) {
    .orientation-warning {
        display: flex;
    }
}

/* ========== ACCESSIBILITY ========== */
@media only screen and (max-width: 768px) {
    /* Aumentar área de toque */
    button,
    a,
    .clickable {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Melhorar contraste */
    .hud-value {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    }
    
    /* Scroll suave */
    * {
        -webkit-overflow-scrolling: touch;
    }
}
