/* ===========================================
   REQQUEST 3D: OFFICE EDITION - GAME STYLES
   =========================================== */

/* Base Styles */
body { 
    margin: 0; 
    overflow: hidden; 
    background-color: #0f172a; 
    font-family: 'Inter', sans-serif; 
    user-select: none;
    touch-action: pan-x pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}

#game-ui { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    pointer-events: none; 
}

.interactive { 
    pointer-events: auto; 
}

/* Animations */
@keyframes fadeInUp { 
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    } 
    to { 
        opacity: 1; 
        transform: translateY(0); 
    } 
}

.animate-fade-in-up { 
    animation: fadeInUp 0.8s ease-out forwards; 
}

@keyframes popIn { 
    from { 
        transform: scale(0.9); 
        opacity: 0; 
    } 
    to { 
        transform: scale(1); 
        opacity: 1; 
    } 
}

/* Dialog Box */
.dialog-box {
    background: rgba(15, 23, 42, 0.98);
    border: 2px solid #64748b;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Button Options */
.btn-option {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid #334155;
    transition: all 0.2s;
}

.btn-option:hover {
    transform: translateX(5px);
    border-color: #6366f1;
    background: #334155;
}

/* Damage Overlay */
.damage-overlay {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: radial-gradient(circle, transparent 50%, rgba(220, 38, 38, 0.5) 100%);
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.2s; 
    z-index: 50;
}

/* Key Hint Badges */
.key-hint {
    border: 1px solid #475569; 
    background: #1e293b; 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-size: 0.8em; 
    color: #94a3b8; 
    font-weight: bold;
}

/* ===========================================
   MOBILE TOUCH CONTROLS
   =========================================== */

/* Joystick Container */
.joystick-container {
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 120px;
    height: 120px;
    z-index: 60;
    display: none; /* Hidden by default, shown via JS on mobile */
}

.joystick-base {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.6);
    border: 2px solid rgba(100, 116, 139, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.joystick-stick {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(145deg, #6366f1, #4f46e5);
    border: 2px solid #818cf8;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.5);
    transition: all 0.1s ease-out;
}

/* Mobile Action Buttons */
.mobile-controls {
    position: fixed;
    bottom: 80px;
    right: 20px;
    display: none; /* Hidden by default */
    flex-direction: column;
    gap: 12px;
    z-index: 60;
}

.mobile-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid rgba(100, 116, 139, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    cursor: pointer;
    user-select: none;
    touch-action: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.2s;
}

.mobile-btn:active {
    background: rgba(99, 102, 241, 0.8);
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.5);
}

.mobile-btn.interact-btn {
    background: linear-gradient(145deg, #22c55e, #16a34a);
    border-color: #4ade80;
    width: 70px;
    height: 70px;
    font-size: 28px;
    animation: pulse-interact 2s infinite;
}

@keyframes pulse-interact {
    0%, 100% { 
        box-shadow: 0 4px 20px rgba(34, 197, 94, 0.5);
    }
    50% { 
        box-shadow: 0 4px 30px rgba(34, 197, 94, 0.8);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Show mobile controls */
    .joystick-container,
    .mobile-controls {
        display: flex;
    }
    
    /* Hide keyboard hints and controls hint */
    .key-hint,
    #game-ui > div:last-child {
        display: none !important;
    }
    
    /* Adjust HUD for mobile */
    #game-ui > div:first-child {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    #game-ui > div:first-child > div {
        max-width: 100%;
        font-size: 0.85rem;
    }
    
    #game-ui > div:first-child > div .text-3xl {
        font-size: 1.5rem;
    }
    
    /* Smaller dialog on mobile */
    #dialog-panel {
        max-width: 95%;
        padding: 16px;
        margin-bottom: 20px;
    }
    
    #dialog-panel .text-2xl {
        font-size: 1.25rem;
    }
    
    #dialog-panel .text-lg {
        font-size: 0.95rem;
    }
    
    #dialog-panel .text-4xl {
        font-size: 2rem;
    }
    
    /* Adjust prompt for mobile */
    #prompt {
        margin-top: 0;
    }
    
    #prompt > div {
        font-size: 0.75rem;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .joystick-container {
        width: 100px;
        height: 100px;
        bottom: 60px;
        left: 15px;
    }
    
    .joystick-base {
        width: 100px;
        height: 100px;
    }
    
    .joystick-stick {
        width: 40px;
        height: 40px;
    }
    
    .mobile-controls {
        bottom: 60px;
        right: 15px;
        gap: 8px;
    }
    
    .mobile-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .mobile-btn.interact-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    /* Adjust overlay screens for small mobile */
    #intro-screen .text-4xl,
    #boss-screen .text-5xl,
    #win-screen .text-6xl {
        font-size: 2rem;
    }
    
    #intro-screen .text-xl,
    #boss-screen .text-xl,
    #win-screen .text-2xl {
        font-size: 1rem;
    }
    
    #intro-screen button,
    #boss-screen button,
    #win-screen button {
        font-size: 0.95rem;
        padding: 12px 24px;
    }
}

/* Landscape orientation optimization */
@media (max-width: 896px) and (orientation: landscape) {
    .joystick-container {
        bottom: 20px;
        left: 20px;
        width: 90px;
        height: 90px;
    }
    
    .joystick-base {
        width: 90px;
        height: 90px;
    }
    
    .joystick-stick {
        width: 35px;
        height: 35px;
    }
    
    .mobile-controls {
        bottom: 20px;
        right: 20px;
    }
    
    #game-ui > div:first-child {
        flex-direction: row;
        gap: 12px;
        font-size: 0.75rem;
    }
    
    #game-ui > div:first-child > div .text-3xl {
        font-size: 1.25rem;
    }
}

