:root {
    --archaeological-sand: #D4B896;
    --excavation-brown: #8B4513;
    --stratum-grey: #696969;
    --discovery-gold: #DAA520;
    --field-note-cream: #F5F5DC;
    --charcoal-ink: #2F2F2F;
    --rust-patina: #B7410E;
    --aged-paper: #FDF5E6;
}

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

body {
    font-family: 'Courier Prime', monospace;
    background: linear-gradient(135deg, var(--archaeological-sand) 0%, var(--aged-paper) 100%);
    color: var(--charcoal-ink);
    line-height: 1.5;
    min-height: 100vh;
}

.excavation-site {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.dig-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--field-note-cream);
    border: 3px solid var(--excavation-brown);
    border-radius: 0;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.site-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--excavation-brown);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 0 var(--discovery-gold);
}

.dig-briefing {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--stratum-grey);
    font-style: italic;
}

.excavation-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--archaeological-sand);
    border: 2px solid var(--excavation-brown);
}

.stratigraphy-selector {
    display: flex;
    gap: 1rem;
}

.layer-btn {
    padding: 0.8rem 1.5rem;
    background: var(--stratum-grey);
    color: white;
    border: none;
    font-family: 'Courier Prime', monospace;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.layer-btn:hover {
    background: var(--rust-patina);
    transform: translateY(-2px);
}

.layer-btn.active {
    background: var(--discovery-gold);
    color: var(--charcoal-ink);
}

.confidence-meter {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.meter-label {
    font-weight: 700;
    color: var(--excavation-brown);
}

.confidence-bar {
    width: 200px;
    height: 20px;
    background: var(--stratum-grey);
    border: 2px solid var(--excavation-brown);
    position: relative;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--rust-patina), var(--discovery-gold));
    width: 15%;
    transition: width 0.5s ease;
}

.excavation-workspace {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.artefact-collection {
    background: var(--field-note-cream);
    border: 3px solid var(--excavation-brown);
    padding: 2rem;
    height: fit-content;
}

.collection-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--excavation-brown);
    margin-bottom: 2rem;
    text-align: center;
    border-bottom: 2px solid var(--discovery-gold);
    padding-bottom: 1rem;
}

.artefact-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.artefact {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--archaeological-sand);
    border: 2px solid var(--stratum-grey);
    cursor: grab;
    transition: all 0.3s ease;
    position: relative;
}

.artefact:hover {
    border-color: var(--discovery-gold);
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.artefact:active {
    cursor: grabbing;
}

.artefact-icon {
    font-size: 2rem;
    filter: sepia(1) hue-rotate(30deg);
}

.artefact-label {
    font-weight: 700;
    flex-grow: 1;
}

.provenance {
    font-size: 0.8rem;
    color: var(--stratum-grey);
    font-style: italic;
}

.excavation-grid {
    background: white;
    border: 4px solid var(--excavation-brown);
    padding: 2rem;
    position: relative;
    min-height: 500px;
}

.room-layout {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 3px;
    height: 400px;
    background: var(--stratum-grey);
    padding: 3px;
}

.grid-square {
    background: var(--aged-paper);
    border: 2px dashed var(--archaeological-sand);
    position: relative;
    transition: all 0.3s ease;
}

.grid-square:hover {
    background: var(--field-note-cream);
    border-color: var(--discovery-gold);
}

.grid-square[data-room="kitchen"] {
    background: #FFE4E1;
}

.grid-square[data-room="living"] {
    background: #E6F3FF;
}

.grid-square[data-room="bedroom"] {
    background: #F0F8E6;
}

.grid-square[data-room="bathroom"] {
    background: #FFF5EE;
}

.grid-square[data-room="hallway"] {
    background: #F5F5DC;
}

.room-labels {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.room-label {
    position: absolute;
    font-weight: 700;
    color: var(--stratum-grey);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.kitchen-label {
    top: 10px;
    left: 10px;
}

.living-label {
    top: 10px;
    right: 10px;
}

.bedroom-label {
    bottom: 10px;
    left: 10px;
}

.bathroom-label {
    bottom: 10px;
    right: 100px;
}

.placed-artefact {
    position: absolute;
    background: var(--discovery-gold);
    padding: 0.5rem;
    border: 2px solid var(--excavation-brown);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    z-index: 10;
    cursor: move;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.archaeological-findings {
    background: var(--field-note-cream);
    border: 3px solid var(--excavation-brown);
    padding: 2rem;
}

.findings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--discovery-gold);
    padding-bottom: 1rem;
}

.findings-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--excavation-brown);
}

.excavation-status {
    font-weight: 700;
    color: var(--stratum-grey);
}

.status-text {
    color: var(--rust-patina);
}

.narrative-scroll {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 1rem;
}

.initial-observation {
    font-style: italic;
    color: var(--stratum-grey);
    margin-bottom: 1rem;
}

.narrative-entry {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--aged-paper);
    border-left: 4px solid var(--discovery-gold);
    font-size: 1.1rem;
    line-height: 1.6;
}

.narrative-entry.revelation {
    background: var(--discovery-gold);
    color: var(--charcoal-ink);
    font-weight: 700;
    border-left-color: var(--excavation-brown);
    animation: revelation-glow 1s ease-in-out;
}

@keyframes revelation-glow {
    0% { box-shadow: 0 0 0 rgba(218, 165, 32, 0.7); }
    50% { box-shadow: 0 0 20px rgba(218, 165, 32, 0.7); }
    100% { box-shadow: 0 0 0 rgba(218, 165, 32, 0.7); }
}

.site-footer {
    margin-top: 4rem;
    padding: 2rem;
    background: var(--stratum-grey);
    color: white;
    text-align: center;
    font-size: 0.9rem;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--discovery-gold);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-sep::before {
    content: ' | ';
    margin: 0 0.5rem;
}

@media (max-width: 768px) {
    .excavation-workspace {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .excavation-tools {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stratigraphy-selector {
        flex-wrap: wrap;
        justify-content: center;
    }
}