body {
    margin: 0;
    background: #111;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

canvas {
    display: block;
    margin: auto;
    background: url('background/entrence_hall.png') no-repeat center center;
    background-size: cover;
    border: 2px solid #555;
    max-width: 100%;
    max-height: 100vh;
}

/* Start screen styles */
#startScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('background/house.png') no-repeat center center;
    background-size: cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#startScreen img {
    max-width: 80%;
    max-height: 60%;
    object-fit: contain;
}

#startScreen button {
    margin-top: 10px;
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    background: #5b1313;
    color: white;
    border: none;
    border-radius: 5px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#startScreen #startButton {
    background: #5b1313;
}

#startScreen #startButton:hover, #startScreen #startButton.focused {
    transform: scale(1.05);
    background-color: #7b3333;
}

#startScreen #secondaryButton {
    background: #135b13;
}

#startScreen #secondaryButton:hover, #startScreen #secondaryButton.focused {
    transform: scale(1.05);
    background-color: #337b33;
}

/* Options screen styles */
#optionsScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fffefe;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#optionsScreen h1 {
    color: #333;
    font-size: 36px;
    margin-bottom: 20px;
}

#optionsScreen .option {
    margin: 10px 0;
    display: flex;
    align-items: center;
}

#optionsScreen label {
    font-size: 18px;
    margin-right: 10px;
    color: #333;
}

#optionsScreen input[type="range"] {
    width: 200px;
    cursor: pointer;
}

#optionsScreen input[type="range"].focused {
    outline: 2px solid #135b13;
}

#optionsScreen button {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    background: #135b13;
    color: white;
    border: none;
    border-radius: 5px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#optionsScreen #restartGameButton {
    background: #f00;
}

#optionsScreen #restartGameButton:hover, #optionsScreen #restartGameButton.focused {
    transform: scale(1.05);
    background-color: #d00;
}

#optionsScreen button:hover, #optionsScreen button.focused {
    transform: scale(1.05);
    background-color: #337b33;
}

/* Hide game elements initially */
#gameCanvas, #hotbar, #mobileControls, #gameOverScreen {
    display: none;
}

/* Mobile controls styles */
#mobileControls {
    position: fixed;
    bottom: 20px;
    width: 100%;
    display: none;
    justify-content: space-between;
    z-index: 5;
    pointer-events: none;
}

#leftControls, #rightControls {
    display: flex;
    gap: 10px;
}

#leftControls {
    position: absolute;
    left: 10px;
    bottom: 10px;
}

#rightControls {
    position: absolute;
    right: 10px;
    bottom: 10px;
}

#leftControls button, #rightControls button {
    width: 60px;
    height: 60px;
    font-size: 24px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 10px; 
    touch-action: manipulation;
    cursor: pointer;
    pointer-events: auto;
}

#leftControls button:active, #rightControls button:active {
    background: rgba(0, 0, 0, 0.9);
}

/* Hotbar styles */
#hotbar {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    flex-direction: row;
    gap: 5px;
}

.hotbar-slot {
    width: 50px;
    height: 50px;
    background: #333;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #555;
    border-radius: 5px;
    cursor: pointer;
    touch-action: manipulation;
}

.hotbar-slot.active {
    border-color: #ff0000;
    background: #444;
}

/* Game over screen styles */
#gameOverScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#gameOverScreen h1 {
    color: white;
    font-size: 48px;
    margin-bottom: 20px;
}

#gameOverScreen button {
    padding: 10px 20px;
    font-size: 24px;
    background: #f00;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#gameOverScreen button:hover, #gameOverScreen button.focused {
    background-color: #d00;
}

/* Responsive design */
@media (max-width: 600px) {
    #startScreen img {
        max-width: 90%;
        max-height: 50%;
    }

    #startScreen button, #optionsScreen button {
        font-size: 16px;
        padding: 8px 16px;
    }

    #optionsScreen h1 {
        font-size: 28px;
    }

    #mobileControls {
        display: flex;
    }
}