* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    padding: 10px;
}

.game-container {
    position: relative;
    width: 100%;
    max-width: 1120px;
    height: 100vh;
    max-height: 800px;
    background-color: #000;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    z-index: 10;
}

.hidden {
    display: none;
}

#start-screen {
    background-image: url('../textures/title_final.png');
    background-size: contain;
    background-position: center top;
    background-repeat: no-repeat;
    padding-top: 40%;
}

.start-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.7);
}

button {
    padding: 10px 20px;
    font-size: 20px;
    background-color: #ff0;
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 10px 0;
}

button:hover {
    background-color: #dd0;
}

p {
    margin: 10px 0;
    font-size: 18px;
}

#ui-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    color: #fff;
    font-size: 18px;
}

#notebook-counter {
    margin-bottom: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
}

#item-slot {
    position: relative;
    width: 180px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#item-slots-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

#current-item {
    position: relative;
    z-index: 1;
    color: #000;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(255,255,255,0.6);
}

/* Mobile controls */
#mobile-controls {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 5;
    width: 100%;
}

#use-item-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(255, 255, 0, 0.7);
    color: #000;
    padding: 15px;
    border-radius: 50%;
    font-weight: bold;
    text-align: center;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#joystick-area {
    width: 120px;
    height: 120px;
    position: relative;
}

#joystick-base {
    width: 100px;
    height: 100px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
}

#joystick-stick {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    position: absolute;
}

/* Responsive styles for different screen sizes */
@media (max-width: 768px) {
    button {
        padding: 8px 16px;
        font-size: 18px;
    }
    
    p {
        font-size: 16px;
    }
    
    #ui-overlay {
        font-size: 16px;
    }
    
    #mobile-controls {
        display: block;
    }
}

@media (max-width: 480px) {
    .game-container {
        height: 85vh;
    }
    
    button {
        padding: 6px 12px;
        font-size: 16px;
    }
    
    p {
        font-size: 14px;
    }
    
    #ui-overlay {
        font-size: 14px;
    }
    
    #item-slot {
        width: 120px;
    }
}