/* --- Global & Layout --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #0d1117; /* Dark background */
    color: #c9d1d9; /* Light text */
}

/* .game-container styles are mainly controlled by Tailwind classes in index.html */

.game-card {
    max-width: 800px; /* Max width constraint */
    width: 100%;
    box-shadow: 0 0 30px rgba(88, 166, 255, 0.1); /* Blue glow */
    transition: background-color 0.5s, box-shadow 0.5s;
}

/* --- Scene Specific Styles --- */
.scene-room {
    background-color: #1f2937; /* Room base color */
    border: 4px solid #fcd34d;
    position: relative; /* Critical for absolute positioning of thoughts */
    display: flex;
    flex-direction: column;
    padding: 0;
}

.scene-corridor {
    background-color: #000; /* Dark corridor background */
    border: 4px solid #6b7280; /* Monochrome border */
}

/* --- Interactive Elements --- */
.interactive-button {
    transition: all 0.2s;
    cursor: pointer;
}

.interactive-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.corridor-text {
    font-size: 1.2rem;
    color: #c9d1d9;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem;
    border-radius: 6px;
}

/* Visual Novel (VN) Textbox (Also used for room thoughts) */
.vn-textbox {
    min-height: 120px; 
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #58a6ff;
    cursor: pointer;
    text-shadow: 1px 1px 2px #000;
    position: relative;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    padding: 1.5rem; /* Padding to prevent text touching edges */
}

.continue-prompt {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    font-size: 0.875rem; /* text-sm */
    font-weight: normal;
}

/* --- Images & Objects --- */
.room-view-image, .vn-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: opacity 0.3s;
}

/* Transparent click layer for room objects */
.object-overlay {
    background-color: transparent;
    border: 2px solid transparent; 
    z-index: 40;
    transition: all 0.2s ease-in-out;
    pointer-events: auto;
    cursor: pointer; 
}

/* --- Inventory Slot Styles --- */
.inv-slot {
    transition: all 0.2s;
    cursor: pointer;
}

.inv-slot:hover {
    border-color: #fcd34d; /* Yellow border on hover */
    transform: scale(1.05);
}

/* Inventory images fit */
.inv-slot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

/* --- Animations --- */
@keyframes flash {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.flash-text {
    color: rgba(156, 163, 175, 0.7);
    animation: flash 1.5s infinite ease-in-out;
}

/* --- Gallery Styles --- */
.gallery-grid {
    display: grid;
    /* Responsive grid:
      - Mobile: 2 columns
      - Tablet (sm+): 3 columns
    */
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.gallery-slot {
    position: relative;
    aspect-ratio: 4 / 3;
    border: 2px solid #6b7280; /* gray-500 */
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: #1f2937; /* gray-800 */
}

.gallery-slot:hover {
    transform: scale(1.05);
    border-color: #fcd34d; /* amber-300 */
    box-shadow: 0 0 15px rgba(252, 211, 77, 0.3);
}

.gallery-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-slot-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: bold;
    /* Prevent text overflow */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-slot-locked {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #111827; /* gray-900 */
    cursor: not-allowed;
    color: #4b5563; /* gray-600 */
}

.gallery-slot-locked:hover {
    transform: none;
    border-color: #6b7280;
    box-shadow: none;
}

.gallery-slot-locked svg {
    width: 40%;
    height: 40%;
    fill: currentColor;
}

/* --- Prevent Image Dragging/Context Menu --- */
img {
    /* Prevent dragging */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;

    /* Prevent right click save (but this blocks clicks too!) 
       So we override for interactive images below.
    */
    pointer-events: none;

    /* Prevent selection */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Override: Allow clicks on inventory and gallery images */
.inv-slot img,
.gallery-slot img {
    pointer-events: auto;
}