html, body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
    padding: 0;
}

canvas {
    display: block;
}

#blocker {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2500;
    background-color: transparent;
    user-select: none;
}

#instructions {
    width: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 16px;
    cursor: pointer;
    color: red;
    font-family: sans-serif;
    font-weight: bold;
    text-shadow: 2px 2px 4px #000000;
    background-color: transparent;
    padding: 20px;
    border-radius: 5px;
    user-select: none; /* Add this to prevent text selection */
}

#loading-text {
    font-size: 48px;
}

#loading-progress {
    font-size: 36px;
    margin-top: 10px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

#loading-spinner {
    width: 80px;
    height: 80px;
    margin-top: 20px;
    animation: spin 4s linear infinite;
}

#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background-color: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; /* So it doesn't interfere with raycasting */
    opacity: 0.5;
    user-select: none;
}

#grab-icon-container {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    display: none; /* Hidden by default */
    filter: drop-shadow(0 0 2px black);
}

#grab-icon {
    width: 100%;
    height: 100%;
}

#currency-display-container {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 20px;
    font-family: monospace;
    color: #ff3333;
    text-shadow: 1px 1px 2px black;
    pointer-events: none;
    user-select: none;
}

#currency-symbol {
    margin-right: 5px;
}

#currency-display {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 32px;
    font-family: monospace;
    color: #ffd700;
    text-shadow: 1px 1px 2px black;
    pointer-events: none;
    user-select: none;
}

#tunnel-vision-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.6) 80%, black 100%);
    opacity: 0;
    z-index: 1000;
}

#cinematic-bar-top,
#cinematic-bar-bottom {
    position: fixed;
    left: 0;
    width: 100%;
    height: 50%;
    background-color: black;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    top: -100%; /* Keep initial position off-screen for transition */
}

#cinematic-bar-bottom {
    bottom: -100%;
    top: auto; /* Override top for bottom bar */
}

#cinematic-bar-top.visible {
    top: 0;
    opacity: 1;
}

#cinematic-bar-bottom.visible {
    bottom: 0;
    opacity: 1;
}

#cinematic-bar-top {
    top: -100%;
}

#cinematic-bar-bottom {
    bottom: -100%;
}

#pause-menu {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex; /* Changed from none to flex by default, controlled by JS */
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

#pause-content {
    width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    font-family: sans-serif;
    background-color: rgba(0,0,0,0.3);
    padding: 20px;
    border-radius: 5px;
    user-select: none;
}

#continue-button {
    background-color: #333;
    color: white;
    border: 1px solid #555;
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 5px;
    margin-top: 20px;
}

#continue-button:hover {
    background-color: #555;
}

/* --- Shop UI Redesign --- */

#shop-menu {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    user-select: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#shop-menu.visible {
    opacity: 1;
}

#shop-content {
    width: 500px; /* Wider for better spacing */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #f0f0f0; /* Off-white for readability */
    font-family: 'monospace', sans-serif;
    background-color: #1a1a1a;
    padding: 30px;
    border-radius: 8px;
    border: 2px solid #ff3333;
    box-shadow: 0 0 25px rgba(255, 51, 51, 0.6); /* Glowing effect */
}

#shop-content h2 {
    font-family: 'Creepster', cursive;
    font-size: 48px;
    color: #ff3333;
    margin-top: 0;
    margin-bottom: 25px;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}

#shop-items {
    width: 100%;
    margin-bottom: 20px;
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 10px; /* For scrollbar */
}

/* Custom scrollbar for shop items */
#shop-items::-webkit-scrollbar {
  width: 8px;
}
#shop-items::-webkit-scrollbar-track {
  background: #2c2c2c;
  border-radius: 4px;
}
#shop-items::-webkit-scrollbar-thumb {
  background-color: #ff3333;
  border-radius: 4px;
  border: 2px solid #2c2c2c;
}


.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    /* Removed border-bottom for a cleaner look */
}

.shop-item p {
    margin: 0;
    font-size: 20px;
    text-align: left;
    flex-grow: 1;
}

.shop-item-price {
    color: #ffd700;
    margin-left: 15px; /* Space between name and price */
}

.buy-button, #close-shop-button {
    background-color: transparent;
    color: #ff3333;
    border: 2px solid #ff3333;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s ease;
    margin-left: 20px;
}

#close-shop-button {
    color: #f0f0f0;
    border-color: #888;
}

.buy-button:hover, #close-shop-button:hover {
    background-color: #ff3333;
    color: #1a1a1a;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.7);
}

#close-shop-button:hover {
    background-color: #888;
    color: #1a1a1a;
    box-shadow: none;
}

.buy-button:disabled {
    background-color: transparent;
    color: #555;
    border-color: #555;
    cursor: not-allowed;
    box-shadow: none;
}

#player-currency {
    font-size: 22px;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 25px;
    border-top: 1px solid #444;
    padding-top: 20px;
    width: 100%;
}

#drunk-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
    opacity: 0;
    transition: opacity 1s ease-in-out, background-color 1s ease-in-out;
    z-index: 1500; /* Above tunnel vision but below cinematics/UI */
    background-color: rgba(0,0,0,0);
}

#eating-progress-container {
    position: fixed;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    z-index: 1000;
}

#eating-progress-bar {
    width: 200px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid white;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

#eating-progress-fill {
    height: 100%;
    background-color: #ff6b35;
    border-radius: 8px;
    width: 0%;
    transition: width 0.1s ease;
}

#eating-text {
    color: white;
    font-family: sans-serif;
    font-size: 16px;
    text-shadow: 1px 1px 2px black;
}

#status-overlay {
    position: fixed;
    bottom: 20px;
    left: 20px;
    font-family: monospace;
    font-size: 24px;
    color: white;
    text-shadow: 2px 2px 4px black;
    pointer-events: none;
    z-index: 100;
    user-select: none;
    opacity: 0.8;
}

#health-status, #sanity-status {
    margin-bottom: 5px;
}

#pov-height-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 100;
    user-select: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#pov-height-bar-container {
    width: 150px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

#pov-height-bar {
    width: 100%;
    height: 100%;
    background-color: white;
    transform-origin: left;
    transition: transform 0.1s ease-out;
}

#pov-height-text {
    color: white;
    font-family: monospace;
    font-size: 14px;
    text-shadow: 1px 1px 2px black;
}

#interaction-hint {
    position: fixed;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-family: sans-serif;
    font-size: 20px;
    border-radius: 5px;
    z-index: 1000;
    pointer-events: none;
    user-select: none;
    text-shadow: 1px 1px 2px black;
}

#xp-bar-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    pointer-events: none;
    user-select: none;
}

#xp-bar {
    width: 300px;
    height: 25px;
    background-color: rgba(0, 0, 0, 0.7);
    border: 2px solid #cc0000;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 5px;
}

#xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #cc0000, #ff3333);
    border-radius: 13px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(204, 0, 0, 0.5);
}

#xp-text {
    color: #ff3333;
    font-family: monospace;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 4px black;
    text-align: center;
}

#note-counter {
    position: fixed;
    top: 70px;
    left: 20px;
    color: #ff3333;
    font-family: monospace;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 4px black;
    pointer-events: none;
    user-select: none;
    z-index: 1000;
}

#note-gallery {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 4000;
    display: none;
    overflow-y: auto;
    padding: 40px;
    box-sizing: border-box;
}

#note-gallery-header {
    text-align: center;
    margin-bottom: 30px;
    color: #ff3333;
    font-family: 'Creepster', cursive;
    font-size: 48px;
    text-shadow: 2px 2px 4px black;
}

#note-gallery-instructions {
    text-align: center;
    margin-bottom: 40px;
    color: #ccc;
    font-family: monospace;
    font-size: 18px;
}

#notes-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#xp-notification {
    position: fixed;
    top: 30%;
    right: 50px;
    background: linear-gradient(45deg, #cc0000, #ff3333);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-family: monospace;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px black;
    box-shadow: 0 0 20px rgba(204, 0, 0, 0.8);
    z-index: 2000;
    pointer-events: none;
    transform: translateX(100px);
    opacity: 0;
    transition: all 0.4s ease;
    border: 2px solid #990000;
}

#xp-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.xp-notification-stack {
    position: fixed;
    right: 50px;
    background: none;
    color: #ff0000;
    font-family: monospace;
    font-weight: bold;
    text-shadow: 2px 2px 4px black;
    z-index: 2000;
    pointer-events: none;
    transform: translateX(100px);
    opacity: 0;
    transition: all 0.4s ease;
}