/* Three.js canvas container */
#three-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background-color: #2a3228;
}

/* Body styling */
body {
    margin: 0;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #2a3228;
}

/* Accessible controls - compact edge toolbar (top-right) */
.accessible-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(40, 35, 30, 0.92);
    border: 1px solid #6b4f35;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    z-index: 100;
    pointer-events: auto;
    color: #d4c4a8;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}

/* Toolbar toggle button */
.toolbar-toggle {
    background: none;
    border: none;
    color: #d4c4a8;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 10px 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    transition: background 0.2s ease;
}

.toolbar-toggle:hover {
    background: rgba(154, 120, 68, 0.2);
}

.toolbar-toggle:focus {
    outline: none;
    border: 2px solid #9a7844;
    box-shadow: 0 0 0 3px rgba(154, 120, 68, 0.3);
}

/* Instruction text */
.selection-instruction {
    margin: 0;
    padding: 0 12px;
    color: #a89a7a;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Object buttons group (collapsible) */
.object-buttons {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    min-width: 180px;
    background: rgba(50, 45, 40, 0.95);
    border-left: 1px solid #6b4f35;
    border-radius: 0 0 10px 10px;
}

.object-buttons:not([style*="display: none"]) {
    display: flex;
}

.object-button {
    background: transparent;
    color: #d4c4a8;
    border: none;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
    width: 100%;
}

.object-button:hover {
    background: rgba(154, 120, 68, 0.2);
}

/* Save Game: the prominent action inside the room picker */
.save-game-button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 2px;
    border-radius: 6px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(122, 88, 52, 0.95), rgba(71, 51, 32, 0.98));
    border: 1px solid #d4a574;
    color: #fff0d2;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.save-game-button span {
    font-size: 13px;
    letter-spacing: 0.8px;
}

.save-game-button small {
    color: #e0c9a5;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: none;
}

.save-game-button:hover {
    background: linear-gradient(180deg, rgba(150, 109, 64, 1), rgba(88, 63, 39, 1));
    border-color: #f0d0a0;
}

.save-game-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(212, 165, 116, 0.55);
    border-color: #f0d0a0;
}

.save-game-button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.save-game-status {
    min-height: 0;
    margin: 0 0 2px;
    padding: 0 6px;
    color: #d4a574;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.toolbar-divider {
    height: 1px;
    margin: 4px 0 6px;
    background: #6b4f35;
    opacity: 0.65;
}

.object-button:focus {
    outline: none;
    background: rgba(154, 120, 68, 0.3);
    box-shadow: 0 0 0 2px rgba(154, 120, 68, 0.4);
}

/* Interaction overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Hotspot indicators - simplified, no hint text */
.hotspot {
    position: absolute;
    width: auto;
    height: auto;
    min-width: 100px;
    background: rgba(40, 35, 30, 0.95);
    border: 1px solid #6b4f35;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    color: #d4c4a8;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 50;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.hotspot-label {
    font-size: 11px;
}

/* Close-up panel */
.close-up-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(40, 35, 30, 0.98);
    border: 1px solid #6b4f35;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.3);
    z-index: 100;
    max-width: 280px;
    pointer-events: auto;
    line-height: 1.7;
    animation: slideUp 0.3s ease-out;
    backdrop-filter: blur(4px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-up-panel h3 {
    margin: 0 0 8px 0;
    color: #d4c4a8;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.close-up-panel p {
    margin: 0;
    color: #a89a7a;
    font-size: 12px;
    line-height: 1.6;
}

/* Back button */
.back-to-room {
    position: fixed;
    top: 20px;
    left: 20px;
    background: #4a3220;
    color: #d4c4a8;
    border: 1px solid #6b4f35;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    z-index: 100;
    pointer-events: auto;
    display: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-to-room:hover {
    background: #5a3e2a;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.back-to-room:focus {
    outline: none;
    border: 2px solid #9a7844;
    box-shadow: 0 0 0 3px rgba(154, 120, 68, 0.3);
}

.back-to-room:active {
    transform: translateY(0);
}

/* Focus styles */
.object-focused {
    outline: 2px solid #d4c4a8;
    outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .accessible-controls {
        top: 12px;
        right: 12px;
        padding: 0;
    }
    
    .toolbar-toggle {
        padding: 8px 12px;
        min-width: 40px;
        height: 40px;
    }
    
    .selection-instruction {
        display: none;
    }
    
    .object-buttons {
        min-width: 160px;
        padding: 6px 10px;
    }
    
    .object-button {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .close-up-panel {
        bottom: 12px;
        left: 12px;
        right: 12px;
        max-width: none;
        padding: 12px 16px;
    }
    
    .back-to-room {
        top: 12px;
        left: 12px;
        padding: 8px 14px;
        font-size: 11px;
    }
    
    .hotspot {
        min-width: 80px;
        padding: 4px 8px;
        font-size: 10px;
    }
}
