/* ===================== RESET & BASE ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background: #000;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #f0e6d3;
}

canvas {
    display: block;
}

/* ===================== LOADING SCREEN ===================== */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.museum-name-sub {
    font-size: 1.3rem;
    color: #c9a96e;
    letter-spacing: 0.15em;
    margin-bottom: 0.2rem !important;
    font-style: italic;
}

.loading-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #e8d5b7;
    letter-spacing: 0.1em;
}

.loading-content p {
    font-size: 1.1rem;
    color: #a89b8c;
    margin-bottom: 1.5rem;
}

.loading-bar {
    width: 300px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    margin: 0 auto 1rem;
}

.loading-fill {
    width: 0%;
    height: 100%;
    background: #c9a96e;
    border-radius: 2px;
    transition: width 0.3s;
}

/* ===================== START SCREEN ===================== */
#start-screen {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.start-content h1 {
    font-size: 3rem;
    color: #e8d5b7;
    letter-spacing: 0.15em;
    margin-bottom: 0.3rem;
}

.start-content h2 {
    font-size: 1.2rem;
    color: #a89b8c;
    font-weight: normal;
    margin-bottom: 2rem;
    font-style: italic;
}

.start-instructions {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 2;
    color: #c0b3a1;
    margin-bottom: 2rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.key {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: monospace;
    font-size: 0.85rem;
}

#start-button {
    background: #c9a96e;
    color: #1a1a2e;
    border: none;
    padding: 14px 48px;
    font-size: 1.2rem;
    font-family: 'Georgia', serif;
    letter-spacing: 0.1em;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s, transform 0.1s;
}

#start-button:hover {
    background: #d4b87a;
    transform: scale(1.02);
}

/* ===================== HUD ===================== */
#hud {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
}

#room-label {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.1rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(232, 213, 183, 0.8);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: opacity 0.5s;
}

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: rgba(255, 255, 255, 0.4);
    font-family: monospace;
    pointer-events: none;
}

#interact-prompt {
    position: absolute;
    top: 58%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    color: #c9a96e;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

#minimap {
    position: absolute;
    bottom: 20px;
    right: 20px;
    border: 2px solid rgba(201, 169, 110, 0.5);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

/* ===================== CONTROLS LEGEND ===================== */
#controls-legend {
    position: absolute;
    top: 20px;
    left: 20px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.75rem;
    line-height: 2;
    color: rgba(232, 213, 183, 0.7);
    pointer-events: none;
    letter-spacing: 0.03em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.45);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(201, 169, 110, 0.15);
}

#controls-legend .key {
    font-size: 0.7rem;
    padding: 2px 6px;
    margin-right: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(201, 169, 110, 0.8);
}

/* ===================== EXHIBIT OVERLAY ===================== */
#exhibit-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(10, 10, 20, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.overlay-content {
    background: #1e1e2f;
    border: 1px solid rgba(201, 169, 110, 0.3);
    border-radius: 12px;
    max-width: 720px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 3rem;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.overlay-content.overlay-wide {
    max-width: 740px;
}

.overlay-content.overlay-wide #overlay-body {
    line-height: 1.6;
}

.overlay-content.overlay-wide #overlay-body p {
    margin-bottom: 0;
}

.overlay-content::-webkit-scrollbar {
    width: 6px;
}

.overlay-content::-webkit-scrollbar-track {
    background: transparent;
}

.overlay-content::-webkit-scrollbar-thumb {
    background: rgba(201, 169, 110, 0.3);
    border-radius: 3px;
}

#overlay-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #a89b8c;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

#overlay-close:hover {
    color: #e8d5b7;
}

#overlay-title {
    font-size: 1.8rem;
    color: #e8d5b7;
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

#overlay-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #c0b3a1;
}

#overlay-body h3 {
    color: #c9a96e;
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

#overlay-body p {
    margin-bottom: 1rem;
}

#overlay-body .artifact-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    margin: 1rem 0;
}

#overlay-body .reflection {
    border-left: 3px solid #c9a96e;
    padding-left: 1.2rem;
    margin-top: 1.5rem;
    font-style: italic;
    color: #a89b8c;
}

/* ===================== MOBILE FALLBACK ===================== */
#mobile-fallback {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: #1a1a2e;
    overflow-y: auto;
    padding: 2rem;
}

#mobile-fallback h1 {
    font-size: 1.8rem;
    color: #e8d5b7;
    text-align: center;
    margin-bottom: 0.5rem;
}

#mobile-fallback .mobile-subtitle {
    text-align: center;
    color: #a89b8c;
    font-style: italic;
    margin-bottom: 2rem;
}

#mobile-fallback .mobile-section {
    background: #1e1e2f;
    border: 1px solid rgba(201, 169, 110, 0.2);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

#mobile-fallback .mobile-section h2 {
    color: #c9a96e;
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

#mobile-fallback .mobile-section p {
    color: #c0b3a1;
    line-height: 1.7;
}

#mobile-fallback .mobile-artifact {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(201, 169, 110, 0.15);
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1rem;
}

#mobile-fallback .mobile-artifact h3 {
    color: #e8d5b7;
    margin-bottom: 0.5rem;
}

#mobile-fallback .mobile-artifact .reflection {
    border-left: 3px solid #c9a96e;
    padding-left: 1rem;
    margin-top: 0.8rem;
    font-style: italic;
    color: #a89b8c;
}

/* ===================== VIGNETTE & CINEMATIC ===================== */
#vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
}

/* ===================== MAP BUTTON ===================== */
#brochure-btn {
    position: absolute;
    bottom: 24px;
    left: 24px;
    pointer-events: auto;
    background: rgba(42, 34, 24, 0.85);
    color: #c9a96e;
    border: 1px solid rgba(201, 169, 110, 0.5);
    padding: 8px 18px;
    font-family: 'Georgia', serif;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

#brochure-btn:hover {
    background: rgba(201, 169, 110, 0.2);
    border-color: #c9a96e;
    transform: scale(1.05);
}

#brochure-hint {
    position: absolute;
    bottom: 64px;
    left: 24px;
    font-size: 0.7rem;
    color: rgba(201, 169, 110, 0.45);
    font-family: 'Helvetica Neue', sans-serif;
    pointer-events: none;
    letter-spacing: 0.05em;
}

/* ===================== BROCHURE OVERLAY ===================== */
#brochure-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(10, 8, 5, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.brochure-content {
    background: linear-gradient(145deg, #2a2418 0%, #1e1a14 50%, #2a2418 100%);
    border: 2px solid rgba(201, 169, 110, 0.4);
    border-radius: 12px;
    max-width: 800px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem 3rem;
    position: relative;
    box-shadow: 0 0 60px rgba(201, 169, 110, 0.08), 0 20px 60px rgba(0, 0, 0, 0.6);
}

.brochure-content::-webkit-scrollbar {
    width: 6px;
}

.brochure-content::-webkit-scrollbar-track {
    background: transparent;
}

.brochure-content::-webkit-scrollbar-thumb {
    background: rgba(201, 169, 110, 0.3);
    border-radius: 3px;
}

#brochure-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #a89b8c;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

#brochure-close:hover {
    color: #e8d5b7;
}

.brochure-title {
    text-align: center;
    font-size: 1.6rem;
    color: #e8d5b7;
    letter-spacing: 0.12em;
    margin-bottom: 0.2rem;
}

.brochure-subtitle {
    text-align: center;
    color: #a89b8c;
    font-style: italic;
    font-size: 0.95rem;
    margin-bottom: 1.8rem;
}

/* ===================== BROCHURE MAP ===================== */
.brochure-map {
    display: grid;
    grid-template-areas:
        ".      north  ."
        "west   center east"
        ".      south  .";
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 4px;
    width: 340px;
    height: 280px;
    margin: 0 auto 2rem;
}

.map-wing, .map-center {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid rgba(201, 169, 110, 0.35);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    padding: 6px;
}

.map-wing:hover, .map-center:hover {
    background: rgba(201, 169, 110, 0.15);
    border-color: #c9a96e;
    transform: scale(1.03);
}

.map-north { grid-area: north; background: rgba(123, 107, 142, 0.12); }
.map-south { grid-area: south; background: rgba(165, 165, 184, 0.12); }
.map-west { grid-area: west; background: rgba(139, 115, 85, 0.12); }
.map-east { grid-area: east; background: rgba(107, 142, 107, 0.12); }
.map-center { grid-area: center; background: rgba(201, 169, 110, 0.1); border-color: rgba(201, 169, 110, 0.5); }

.map-wing-label {
    font-size: 0.72rem;
    color: #e8d5b7;
    line-height: 1.4;
    letter-spacing: 0.04em;
}

.map-wing-label em {
    color: #a89b8c;
    font-size: 0.65rem;
}

/* ===================== BROCHURE SECTIONS ===================== */
.brochure-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.brochure-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(201, 169, 110, 0.15);
    border-radius: 8px;
    padding: 1rem 1.2rem;
}

.brochure-section h3 {
    color: #c9a96e;
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    letter-spacing: 0.05em;
}

.brochure-link {
    display: block;
    color: #c0b3a1;
    text-decoration: none;
    font-size: 0.82rem;
    padding: 4px 0;
    padding-left: 12px;
    border-left: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s, padding-left 0.2s;
}

.brochure-link:hover {
    color: #e8d5b7;
    border-left-color: #c9a96e;
    padding-left: 16px;
}

.brochure-footer {
    text-align: center;
    color: #6a6050;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.brochure-footer .key {
    font-size: 0.72rem;
    padding: 1px 6px;
}

/* ===================== ANIMATIONS ===================== */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

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