/* ============================================================
   REVAMED MANSION — STORY SYSTEM STYLES
   ============================================================ */

/* Dialogue Overlay */
.dialogue-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: min(90%, 500px);
    background: rgba(5, 5, 7, 0.85); /* Vibhuti Obsidian */
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(212, 175, 55, 0.2); /* Laser-etched gold */
    border-radius: 12px;
    padding: 28px;
    z-index: 10000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
    color: #e2e8f0;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
    pointer-events: none;
    box-sizing: border-box;
}

.dialogue-overlay.visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.dialogue-header {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: #ffd700;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: bold;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    padding-bottom: 8px;
}

.dialogue-text {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
    color: #e2e8f0;
    min-height: 60px;
}

.dialogue-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dialogue-choice-btn {
    min-height: 44px;
    padding: 10px 16px;
    background: rgba(23, 21, 28, 0.6);
    border: 1px solid rgba(135, 100, 50, 0.4);
    border-radius: 6px;
    color: #d8d2cb;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.dialogue-choice-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.6);
    color: #fff;
}

.dialogue-choice-btn:active {
    transform: scale(0.98);
}

/* Presence Silhouette */
.presence-silhouette {
    position: absolute;
    left: 45%;
    bottom: 22%;
    width: 10%;
    height: 48%;
    background: linear-gradient(to bottom, rgba(5, 5, 7, 0.95), rgba(20, 16, 28, 0.8));
    border-radius: 40% 40% 10% 10% / 60% 60% 10% 10%;
    filter: blur(2px);
    box-shadow: 
        0 0 15px rgba(212, 175, 55, 0.15),
        inset 0 0 8px rgba(212, 175, 55, 0.05);
    z-index: 10;
    cursor: pointer;
    animation: silhouetteBreathe 4s ease-in-out infinite alternate;
    opacity: 0.9;
    pointer-events: auto;
}

.presence-silhouette::before {
    content: "";
    position: absolute;
    top: 5%;
    left: 15%;
    width: 70%;
    height: 25%;
    background: radial-gradient(ellipse, rgba(5, 5, 7, 1) 40%, transparent 70%);
    border-radius: 50%;
}

.presence-silhouette::after {
    /* Glowing faceless gaze */
    content: "";
    position: absolute;
    top: 10%;
    left: 40%;
    width: 20%;
    height: 4%;
    background: rgba(212, 175, 55, 0.45);
    border-radius: 50%;
    filter: blur(1px);
    opacity: 0.8;
}

@keyframes silhouetteBreathe {
    0% {
        transform: translateY(0) scaleX(1);
        box-shadow: 0 0 12px rgba(212, 175, 55, 0.1);
    }
    100% {
        transform: translateY(-6px) scaleX(1.03);
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
    }
}

/* Clue Journal Sidebar */
.clue-journal-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: min(400px, 90vw);
    height: 100svh;
    background: rgba(5, 5, 7, 0.85); /* Vibhuti Obsidian */
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-left: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    color: #e2e8f0;
    box-sizing: border-box;
}

.clue-journal-panel.visible {
    right: 0;
}

.clue-journal-header {
    padding: 24px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clue-journal-title {
    font-size: 13px;
    letter-spacing: 0.18em;
    color: #ffd700;
    margin: 0;
    text-transform: uppercase;
    font-weight: bold;
}

.clue-journal-close-btn {
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.clue-journal-close-btn:hover {
    color: #fff;
}

.clue-journal-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.journal-clues-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.clue-item {
    background: rgba(23, 21, 28, 0.4);
    border: 1px solid rgba(135, 100, 50, 0.2);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: border-color 0.2s ease;
}

.clue-item.unlocked {
    border-color: rgba(212, 175, 55, 0.4);
}

.clue-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.clue-badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
}

.clue-badge.locked {
    background: #2d3748;
    color: #a0aec0;
}

.clue-badge.unlocked {
    background: rgba(212, 175, 55, 0.15);
    color: #ffd700;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.clue-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0;
}

.clue-item.unlocked .clue-item-title {
    color: #ffd700;
}

.clue-item-desc {
    font-size: 13px;
    line-height: 1.5;
    color: #718096;
    margin: 0;
}

.clue-item.unlocked .clue-item-desc {
    color: #cbd5e1;
}

/* Portrait Changes */
.portrait-art.changed .portrait-face {
    background: radial-gradient(circle, #5a1818 0%, #170505 80%);
    box-shadow: 
        0 0 10px rgba(212, 175, 55, 0.3),
        inset 0 0 6px rgba(212, 175, 55, 0.2);
}

.portrait-art.changed .portrait-face::after {
    /* Glowing golden eyes */
    content: "·  ·";
    position: absolute;
    left: 0;
    right: 0;
    top: 25%;
    text-align: center;
    font-size: 16px;
    color: #ffd700;
    text-shadow: 0 0 5px #ffd700, 0 0 10px #ffd700;
    letter-spacing: 2px;
    font-weight: bold;
}

.library-portrait.changed {
    background:
        radial-gradient(
            ellipse at center 34%,
            rgba(20, 10, 30, 0.95) 0 15%,
            transparent 16%
        ),
        linear-gradient(
            #301b3b,
            #10071c
        );
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.25);
}

.library-portrait.changed::after {
    /* Glowing necklace/crest key around his neck */
    content: "";
    position: absolute;
    left: 45%;
    top: 40%;
    width: 10%;
    height: 12%;
    background: #ffd700;
    border-radius: 50%;
    box-shadow: 0 0 8px #ffd700, 0 0 15px #ffd700;
    filter: blur(0.5px);
}

/* Transition flash */
.story-flash {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, rgba(90, 20, 130, 0.25) 0%, rgba(5, 5, 7, 0) 70%);
    z-index: 10002;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.story-flash.active {
    opacity: 1;
}

.front-door-art.jammed {
    border-color: #5a1818 !important;
    box-shadow: inset 0 0 15px rgba(90, 24, 24, 0.8) !important;
}
