body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #1a1a1a;
    font-family: 'Courier New', monospace;
    color: #a0a0a0;
}

canvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.health-container {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 200px;
    height: 30px;
    background-color: #222;
    border-radius: 10px;
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.8),
        inset -3px -3px 6px rgba(65, 65, 65, 0.3);
}

.health-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #8b0000, #ff0000);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.sanity-container {
    position: absolute;
    bottom: 70px;
    left: 30px;
    width: 200px;
    height: 16px;
    background-color: #222;
    border-radius: 8px;
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.8),
        inset -3px -3px 6px rgba(65, 65, 65, 0.3);
}

.sanity-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #4b0082, #9370db);
    border-radius: 8px;
    transition: width 0.3s ease;
}

.inventory {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 10px;
}

.item-slot {
    width: 60px;
    height: 60px;
    background-color: #333;
    border-radius: 10px;
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.8),
        inset -3px -3px 6px rgba(65, 65, 65, 0.3),
        0 0 10px rgba(100, 100, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #444;
}

.item-slot img {
    max-width: 80%;
    max-height: 80%;
}

.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
}

.message-box {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #222;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8),
        -3px -3px 6px rgba(65, 65, 65, 0.3);
    opacity: 0;
    transition: opacity 0.5s ease;
    max-width: 70%;
    text-align: center;
}

.message-box.visible {
    opacity: 1;
}

.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    pointer-events: auto;
}

.title {
    font-size: 3em;
    margin-bottom: 1em;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    color: #a0a0a0;
}

.start-button {
    padding: 15px 40px;
    font-size: 1.5em;
    background-color: #222;
    color: #a0a0a0;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.8),
        -5px -5px 10px rgba(65, 65, 65, 0.3);
    transition: all 0.3s ease;
    outline: none;
    font-family: 'Courier New', monospace;
}

.start-button:hover {
    background-color: #300;
    color: #ddd;
}

.start-button:active {
    box-shadow: inset 5px 5px 10px rgba(0, 0, 0, 0.8),
        inset -5px -5px 10px rgba(65, 65, 65, 0.3);
}

.pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 1s ease;
}

.game-over.visible {
    opacity: 1;
}

.game-over-text {
    font-size: 4em;
    color: #800;
    margin-bottom: 1em;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
}

.restart-button {
    padding: 15px 40px;
    font-size: 1.5em;
    background-color: #222;
    color: #a0a0a0;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.8),
        -5px -5px 10px rgba(65, 65, 65, 0.3);
    transition: all 0.3s ease;
    outline: none;
    font-family: 'Courier New', monospace;
}

.restart-button:hover {
    background-color: #300;
    color: #ddd;
}

.restart-button:active {
    box-shadow: inset 5px 5px 10px rgba(0, 0, 0, 0.8),
        inset -5px -5px 10px rgba(65, 65, 65, 0.3);
}

.instructions {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #666;
    background-color: #222;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8),
        -3px -3px 6px rgba(65, 65, 65, 0.3);
    font-size: 0.9em;
}