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

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

.display-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

#score-display {
    font-size: 24px;
    color: white;
    font-weight: bold;
}

#current-room-display {
    font-size: 24px;
    color: white;
    font-weight: bold;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

#game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
    z-index: 1;
}

#sprint-container {
    margin-top: 10px;
    width: 85%;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    display: inline-block;
}

#sprint-bar {
    height: 100%;
    width: 100%;
    background-color: #3498db;
    transition: width 0.3s;
}

#health-container {
    width: 85%;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

#health-bar {
    height: 100%;
    width: 100%;
    background-color: #e74c3c;
    transition: width 0.3s;
}

.room-lighting {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transition: all 1s ease;
    mix-blend-mode: multiply;
    z-index: 2;
}

#room {
    flex-grow: 1;
    background-color: #888;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: all 1s ease;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
}

#player {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.1s ease-out;
    image-rendering: pixelated;
    box-shadow: 0 0 20px rgba(255,255,0,0.5);
    border: 2px solid rgba(255,255,0,0.8);
    background-color: yellow;
    background-size: cover;
    background-position: center;
}

#player.ghost {
    opacity: 0.7;
    filter: brightness(1.5) grayscale(1);
}

.holding-flashlight {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    border: 2px solid rgba(255, 215, 0, 0.8);
}

.other-player {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.1s ease-out;
    z-index: 5;
}

#door {
    position: absolute;
    width: 40px;
    height: 80px;
    background-color: #654321;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid #432100;
    border-right: none;
}

.starting-door {
    position: absolute;
    width: 40px;
    height: 80px;
    background-color: #654321;
    border: 4px solid #432100;
    border-left: none;
    cursor: not-allowed;
}

#boost-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

#boost-button {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: #3498db;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    vertical-align: middle;
    box-shadow: 0 3px 5px rgba(0,0,0,0.2);
    transition: transform 0.1s, box-shadow 0.1s;
}

#boost-button:active {
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

#joystick-container {
    margin-top: 20px;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#joystick-base {
    width: 120px;
    height: 120px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#joystick-handle {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    position: absolute;
    cursor: pointer;
    user-select: none;
    touch-action: none;
}

#enemy {
    position: absolute;
    width: 100px;  
    height: 100px; 
    border-radius: 50%;
    background-image: url('IMG_2914.jpeg');
    background-size: cover;
    background-position: center;
    transform: translate(-50%, -50%);
    transition: all 0.1s ease-out;
}

#x10-enemy {
    position: absolute;
    width: 100px;  
    height: 100px; 
    border-radius: 50%;
    background-image: url('IMG_2915.jpeg');
    background-size: cover;
    background-position: center;
    transform: translate(-50%, -50%);
    transition: all 0.1s ease-out;
}

[id$="-enemy"] {
    image-rendering: pixelated !important;
    filter: brightness(0.8) contrast(1.2);
    border: 2px solid rgba(255,255,255,0.3);
}

.username-label {
    white-space: nowrap;
    pointer-events: none;
}

#entities-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    font-family: Arial, sans-serif;
}

#entities-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

#entities-text {
    font-size: 18px;
    font-weight: bold;
}

#entity-timer {
    color: #ff5555;
    font-size: 16px;
}

#entity-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid white;
}

.hidden {
    display: none;
}

.locker {
    position: absolute;
    background-color: #4169E1;
    border: 2px solid #1E90FF;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    background-image: linear-gradient(45deg, rgba(0,0,0,0.1) 25%, transparent 25%),
                      linear-gradient(-45deg, rgba(0,0,0,0.1) 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, rgba(0,0,0,0.1) 75%),
                      linear-gradient(-45deg, transparent 75%, rgba(0,0,0,0.1) 75%);
    background-size: 4px 4px;
    transition: all 0.3s ease;
}

.locker-x {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.locker-x::before,
.locker-x::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 2px;
    background-color: rgba(255, 0, 0, 0.3);
    transform-origin: center;
}

.locker-x::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.locker-x::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.locker[data-working="true"]:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(65, 105, 225, 0.5);
}

#interact-button {
    position: absolute;
    background-color: #4CAF50;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.2s;
}

#interact-button:hover {
    background-color: #45a049;
}

#static-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    animation: static 50ms steps(4, end) infinite;
    opacity: 0.3;
    pointer-events: none;
    z-index: 50;
    display: none;
    mix-blend-mode: overlay;
    filter: contrast(1.2) brightness(0.8);
}

@keyframes static {
    0% { background-position: 0 0; }
    25% { background-position: 30% 0; }
    50% { background-position: -30% 0; }
    75% { background-position: 0 30%; }
    100% { background-position: 0 -30%; }
}

.chat-container {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 300px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 10px;
    z-index: 1000;
}

.chat-toggle-button {
    position: fixed;
    top: 20px;
    left: 340px;
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 14px;
    z-index: 1000;
}

.chat-toggle-button:hover {
    background: #2980b9;
}

.chat-messages {
    margin-bottom: 10px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.chat-message {
    margin: 5px 0;
    word-wrap: break-word;
}

.chat-username {
    color: #3498db;
    font-weight: bold;
}

.chat-text {
    color: white;
}

.chat-input {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    color: black;
    font-size: 14px;
}

.chat-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3498db;
}

.table {
    position: absolute;
    width: 150px;
    height: 80px;
    background-color: #8B4513;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.tv {
    position: absolute;
    width: 120px;
    height: 80px;
    background-color: #333;
    border: 4px solid #222;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    cursor: pointer;
}

.tv:hover {
    transform: scale(1.05);
}

.tv::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 60%;
    background-color: #111;
    border-radius: 2px;
}

.settings-container {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 300px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 15px;
    z-index: 1000;
    font-family: Arial, sans-serif;
}

.settings-toggle-button {
    position: fixed;
    top: 60px;
    left: 340px;
    padding: 8px 16px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 14px;
    z-index: 1000;
}

.settings-toggle-button:hover {
    background: #27ae60;
}

.settings-section {
    margin-bottom: 15px;
}

.settings-label {
    color: white;
    margin-bottom: 5px;
    font-size: 14px;
}

.settings-select {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    color: black;
    font-size: 14px;
}

.settings-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px #2ecc71;
}

.flashlight-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background-color: white;
    border: 2px solid #333;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.3s, box-shadow 0.3s;
}

.flashlight-toggle:hover {
    transform: scale(1.1);
}

.flashlight-toggle.active {
    background-color: #ffd700;
    box-shadow: 0 0 15px #ffd700;
}

.flashlight-light {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.player-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

.blood-particle {
    position: absolute;
    pointer-events: none;
    z-index: 3;
    transition: all 0.1s linear;
}

.money-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #2ecc71;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 24px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    z-index: 1000;
    text-shadow: 0 0 5px rgba(46, 204, 113, 0.5);
}

.dialogue-container {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.krabby-chat-button {
    transition: background-color 0.3s;
}

.krabby-chat-button:hover {
    background-color: #A0522D;
}

.krabby-chat-dialogue {
    max-height: 80vh;
    overflow-y: auto;
}

.krabby-chat-option {
    text-align: left;
    white-space: normal;
    word-wrap: break-word;
}

.krabby-chat-response {
    line-height: 1.4;
}

.painting {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.painting:hover {
    transform: translateY(-50%) scale(1.05);
}

.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 150px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 2;
}

@keyframes slideDown {
    from { transform: translate(-50%, -100%); }
    to { transform: translate(-50%, 0); }
}

@keyframes slideUp {
    from { transform: translate(-50%, 0); }
    to { transform: translate(-50%, -100%); }
}

.badge-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 215, 0, 0.9);
    color: black;
    padding: 15px 30px;
    border-radius: 5px;
    font-family: 'PressStart2P', monospace;
    z-index: 1002;
}

.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('IMG_3013.jpeg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: black;
    z-index: 10000;
    animation: fadeOut 1s ease-out forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        display: none;
    }
}