/* Responsywne style bazowe */
@media screen and (max-width: 1024px) {
    #game-container {
        font-size: 16px;
    }

    #hud {
        scale: 0.9;
    }

    #inventory {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }

    .inventory-slot {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
    }

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

    #hud {
        scale: 0.8;
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0,0,0,0.5);
        border-radius: 10px;
        padding: 10px;
    }

    #inventory {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 3px;
        max-width: 90vw;
    }

    .inventory-slot {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    #math-shortcuts {
        display: flex;
        justify-content: center;
        gap: 10px;
    }

    #game-controls {
        display: flex;
        justify-content: center;
        gap: 10px;
    }

    .journal-tabs {
        display: flex;
        justify-content: center;
        gap: 10px;
    }

    #start-screen {
        padding: 20px;
    }

    .instructions {
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    body {
        font-size: 12px;
    }

    #game-container {
        font-size: 12px;
    }

    #hud {
        scale: 0.7;
        bottom: 5px;
    }

    .inventory-slot {
        width: 25px;
        height: 25px;
        font-size: 10px;
    }

    #math-shortcuts button {
        padding: 5px 10px;
        font-size: 10px;
    }

    #game-controls button {
        padding: 5px 10px;
        font-size: 10px;
    }

    .journal-page {
        padding: 10px;
    }

    #progress {
        padding: 15px;
    }

    .achievement {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    #game-controls {
        display: flex;
        justify-content: center;
        gap: 15px;
    }

    .inventory-slot {
        min-width: 45px;
        min-height: 45px;
        touch-action: manipulation;
    }

    #math-shortcuts button {
        min-width: 50px;
        touch-action: manipulation;
    }
    
    /* Virtual joystick for mobile */
    .virtual-joystick {
        position: fixed;
        bottom: 20px;
        left: 20px;
        width: 120px;
        height: 120px;
        background: rgba(255, 255, 255, 0.3);
        border: 2px solid rgba(255, 255, 255, 0.5);
        border-radius: 50%;
        z-index: 100;
        touch-action: none;
    }
    
    .virtual-joystick-knob {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 50%;
        transform: translate(-50%, -50%);
        pointer-events: none;
    }
    
    /* Mobile action buttons */
    .mobile-actions {
        position: fixed;
        bottom: 20px;
        right: 20px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        z-index: 100;
    }
    
    .mobile-action-btn {
        width: 60px;
        height: 60px;
        background: rgba(0, 0, 0, 0.7);
        border: 2px solid #fff;
        border-radius: 50%;
        color: #fff;
        font-size: 24px;
        touch-action: manipulation;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Orientacja pozioma na urządzeniach mobilnych */
@media screen and (max-height: 500px) and (orientation: landscape) {
    #hud {
        scale: 0.6;
        bottom: 0;
    }

    #game-container {
        font-size: 10px;
    }
}