/* ═══════════════════════════════════════════════════════════════════════════════════════════
   🏛️ THE HOUSE — Victorian Gothic Design System
   
   Color Palette: Dark mahogany, rich wood, brass fixtures, billiard green, library carpet
   Typography: Cinzel (display), Crimson Text (body), JetBrains Mono (code)
   Motion: Candlelight flicker, fog drift, dramatic reveals
   
═══════════════════════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   CSS VARIABLES
═══════════════════════════════════════════════════════════════ */

:root {
    /* Mansion Colors */
    --mansion-dark: #1a0f0f;
    --mansion-darker: #0d0707;
    --mansion-wood: #4a2c2a;
    --mansion-wood-light: #6b4040;
    --mansion-gold: #c9a227;
    --mansion-gold-dim: rgba(201, 162, 39, 0.4);
    --mansion-brass: #b5861e;
    --mansion-green: #1e3d2f;
    --mansion-red: #8b0000;
    --mansion-cream: #f5e6d3;
    
    /* Character Colors */
    --scarlet: #dc143c;
    --mustard: #e6b800;
    --white: #f5f5f5;
    --green: #228b22;
    --plum: #8e4585;
    --peacock: #00ced1;
    --grove-green: #2d5a27;
    
    /* Colony Colors (matching characters) */
    --spark: #ff4444;
    --forge: #ffcc00;
    --flow: #44ccaa;
    --nexus: #228b22;
    --beacon: #8e4585;
    --grove: #2d5a27;
    --crystal: #00ced1;
    --kagami: #c9a227;
    
    /* Atmosphere */
    --candlelight: #ffb347;
    --candlelight-dim: rgba(255, 179, 71, 0.3);
    --shadow: rgba(0, 0, 0, 0.8);
    --mystery: #2d1b4e;
    --fog: rgba(245, 230, 211, 0.03);
    
    /* Typography */
    --font-display: 'Cinzel', 'Times New Roman', serif;
    --font-body: 'Crimson Text', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Timing */
    --ease-dramatic: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-candle: cubic-bezier(0.37, 0, 0.63, 1);
    
    /* Durations */
    --candle-flicker: 4s;
    --fog-drift: 20s;
}

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════════════ */

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

::selection {
    background: var(--mansion-gold);
    color: var(--mansion-darker);
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--mansion-wood) var(--mansion-dark);
    font-size: clamp(14px, 1.1vw, 18px);
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    background: var(--mansion-darker);
    color: var(--mansion-cream);
    line-height: 1.8;
    cursor: none;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

@media (max-width: 768px) {
    body { cursor: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   LOADING SCREEN
═══════════════════════════════════════════════════════════════ */

#loading {
    position: fixed;
    inset: 0;
    background: var(--mansion-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    transition: opacity 1.5s var(--ease-dramatic), visibility 1.5s;
}

#loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-icon {
    font-size: 5rem;
    animation: loadingPulse 2s var(--ease-candle) infinite;
}

@keyframes loadingPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
}

.loading-quote {
    margin-top: 2rem;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--mansion-gold);
    opacity: 0.8;
}

.loading-bar {
    width: 200px;
    height: 2px;
    background: rgba(201, 162, 39, 0.2);
    margin: 1.5rem auto 0;
    border-radius: 1px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--mansion-gold), var(--candlelight));
    width: 0%;
    transition: width 0.4s var(--ease-dramatic);
}

.loading-text {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: rgba(245, 230, 211, 0.4);
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════
   CANVAS LAYERS
═══════════════════════════════════════════════════════════════ */

canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

#candlelight-canvas { z-index: 1; }
#dust-canvas { z-index: 2; }
#passage-canvas { z-index: 3; }

/* ═══════════════════════════════════════════════════════════════
   ATMOSPHERE
═══════════════════════════════════════════════════════════════ */

.atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.fog {
    position: absolute;
    inset: 0;
    opacity: 0.4;
}

.fog-1 {
    background: 
        radial-gradient(ellipse 80% 50% at 20% 30%, var(--fog), transparent 60%),
        radial-gradient(ellipse 60% 70% at 80% 70%, var(--fog), transparent 50%);
    animation: fogDrift1 var(--fog-drift) var(--ease-candle) infinite;
}

.fog-2 {
    background:
        radial-gradient(ellipse 70% 40% at 70% 20%, var(--fog), transparent 50%),
        radial-gradient(ellipse 50% 60% at 30% 80%, var(--fog), transparent 40%);
    animation: fogDrift2 calc(var(--fog-drift) * 1.5) var(--ease-candle) infinite;
}

@keyframes fogDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(3%, 2%) scale(1.05); }
    66% { transform: translate(-2%, 3%) scale(0.98); }
}

@keyframes fogDrift2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-3%, -2%); }
}

.vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, var(--mansion-darker) 100%);
}

/* ═══════════════════════════════════════════════════════════════
   CUSTOM CURSOR
═══════════════════════════════════════════════════════════════ */

#cursor {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--candlelight);
    border-radius: 50%;
    box-shadow: 
        0 0 10px var(--candlelight),
        0 0 20px var(--candlelight-dim),
        0 0 40px rgba(255, 179, 71, 0.2);
    transition: width 0.2s, height 0.2s, background 0.2s;
}

.cursor-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, border-color 0.3s;
}

#cursor.hovering .cursor-dot {
    width: 10px;
    height: 10px;
    background: var(--mansion-gold);
}

#cursor.hovering .cursor-ring {
    width: 60px;
    height: 60px;
    border-color: var(--mansion-gold);
}

@media (max-width: 768px) {
    #cursor { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   MANSION CONTAINER
═══════════════════════════════════════════════════════════════ */

.mansion {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 2rem 6rem;
    position: relative;
    z-index: 10;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════════ */

.mansion-header {
    text-align: center;
    padding: 5rem 0 4rem;
    position: relative;
}

.header-decoration {
    font-size: 1.5rem;
    color: var(--mansion-gold-dim);
    letter-spacing: 1em;
    margin-bottom: 1.5rem;
}

.mansion-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 600;
    letter-spacing: 0.3em;
    color: var(--mansion-cream);
    text-shadow: 
        0 0 40px var(--candlelight-dim),
        0 4px 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
}

.mansion-subtitle {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.4em;
    color: var(--mansion-gold);
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.mansion-tagline {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-style: italic;
    color: rgba(245, 230, 211, 0.6);
}

/* ═══════════════════════════════════════════════════════════════
   DEDICATION
═══════════════════════════════════════════════════════════════ */

.dedication {
    text-align: center;
    padding: 4rem 0;
    margin-bottom: 4rem;
}

.dedication-frame {
    display: inline-block;
    padding: 2.5rem 4rem;
    border: 2px solid var(--mansion-gold-dim);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(74, 44, 42, 0.25), rgba(26, 15, 15, 0.5));
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dedication-frame::before,
.dedication-frame::after {
    content: '✧';
    position: absolute;
    color: var(--mansion-gold);
    font-size: 1rem;
}

.dedication-frame::before { top: -0.6rem; left: 50%; transform: translateX(-50%); }
.dedication-frame::after { bottom: -0.6rem; left: 50%; transform: translateX(-50%); }

.dedication-to {
    font-family: var(--font-display);
    font-size: 1.8rem;
    letter-spacing: 0.1em;
    color: var(--mansion-gold);
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 10px rgba(201, 162, 39, 0.3);
}

.dedication-role {
    font-size: 0.9rem;
    color: rgba(245, 230, 211, 0.7);
    letter-spacing: 0.12em;
    margin-bottom: 1.25rem;
}

.dedication-note {
    font-style: italic;
    font-size: 1.05rem;
    color: rgba(245, 230, 211, 0.85);
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   SECTIONS
═══════════════════════════════════════════════════════════════ */

section {
    margin-bottom: 7rem;
    padding: 2rem 0;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s var(--ease-dramatic), transform 1s var(--ease-dramatic);
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    color: var(--mansion-gold);
    text-align: center;
    margin-bottom: 1.25rem;
    position: relative;
    text-shadow: 0 2px 20px rgba(201, 162, 39, 0.3);
}

.section-title::after {
    content: '';
    display: block;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--mansion-gold), transparent);
    margin: 1.25rem auto 0;
}

.section-subtitle {
    text-align: center;
    font-style: italic;
    font-size: 1.1rem;
    color: rgba(245, 230, 211, 0.7);
    margin-bottom: 2.5rem;
}

.section-intro {
    text-align: center;
    max-width: 750px;
    margin: 0 auto 3.5rem;
    font-size: 1.15rem;
    color: rgba(245, 230, 211, 0.85);
    line-height: 2;
}

.section-intro strong {
    color: var(--mansion-gold);
    font-weight: 600;
}

.section-intro em {
    color: var(--candlelight);
}

/* ═══════════════════════════════════════════════════════════════
   FLOOR PLAN
═══════════════════════════════════════════════════════════════ */

.floor-plan-container {
    margin: 3rem 0;
}

.floor-plan {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem;
    background: linear-gradient(135deg, rgba(74, 44, 42, 0.2), rgba(26, 15, 15, 0.4));
    border: 2px solid var(--mansion-wood);
    border-radius: 12px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(201, 162, 39, 0.1);
}

.floor {
    margin-bottom: 2.5rem;
}

.floor-label {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    color: var(--mansion-gold);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    text-align: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--mansion-gold-dim);
}

.rooms-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.room {
    padding: 2rem 1.5rem;
    background: linear-gradient(180deg, rgba(26, 15, 15, 0.9), rgba(45, 27, 27, 0.8));
    border: 1px solid var(--mansion-wood);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s var(--ease-dramatic);
    position: relative;
    overflow: hidden;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.room::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--candlelight-dim), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.room:hover {
    transform: translateY(-4px);
    border-color: var(--mansion-gold);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 30px var(--candlelight-dim);
}

.room:hover::before {
    opacity: 1;
}

.room-hall {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.1), rgba(26, 15, 15, 0.8));
    border-color: var(--mansion-gold-dim);
}

.room-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.room-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--mansion-cream);
    margin-bottom: 0.35rem;
    position: relative;
    z-index: 1;
}

.room-character {
    font-size: 0.8rem;
    color: rgba(245, 230, 211, 0.6);
    font-style: italic;
    position: relative;
    z-index: 1;
}

/* Room color accents */
.room[data-colony="spark"]:hover { border-color: var(--spark); box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 30px rgba(255,68,68,0.3); }
.room[data-colony="forge"]:hover { border-color: var(--forge); box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 30px rgba(255,204,0,0.3); }
.room[data-colony="flow"]:hover { border-color: var(--flow); box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 30px rgba(68,204,170,0.3); }
.room[data-colony="nexus"]:hover { border-color: var(--nexus); box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 30px rgba(34,139,34,0.3); }
.room[data-colony="beacon"]:hover { border-color: var(--beacon); box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 30px rgba(142,69,133,0.3); }
.room[data-colony="grove"]:hover { border-color: var(--grove); box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 30px rgba(45,90,39,0.3); }
.room[data-colony="crystal"]:hover { border-color: var(--crystal); box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 30px rgba(0,206,209,0.3); }

.passages-indicator {
    text-align: center;
    padding: 1rem;
    margin: 1rem 0;
}

.passage-hint {
    font-style: italic;
    font-size: 0.9rem;
    color: var(--mansion-gold-dim);
    opacity: 0.7;
}

.structure-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px dashed var(--mansion-gold-dim);
}

.structure {
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, rgba(45, 27, 78, 0.25), rgba(26, 15, 15, 0.6));
    border: 1px solid var(--mystery);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s var(--ease-dramatic);
}

.structure:hover {
    transform: translateY(-4px);
    border-color: var(--mansion-gold);
    background: linear-gradient(135deg, rgba(45, 27, 78, 0.4), rgba(26, 15, 15, 0.7));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.structure-icon {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.structure-name {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.05em;
    color: var(--mansion-cream);
    margin-bottom: 0.35rem;
}

.structure-desc {
    font-size: 0.8rem;
    color: rgba(245, 230, 211, 0.65);
}

/* ═══════════════════════════════════════════════════════════════
   CHARACTER CARDS
═══════════════════════════════════════════════════════════════ */

.character-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 700px) {
    .character-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
}

.character-card {
    background: linear-gradient(180deg, rgba(26, 15, 15, 0.95), rgba(45, 27, 27, 0.9));
    border: 2px solid var(--mansion-wood);
    border-radius: 10px;
    padding: 2.5rem 2.5rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s var(--ease-dramatic);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.card-glow {
    position: absolute;
    inset: -50%;
    background: conic-gradient(from 0deg, transparent, var(--mansion-gold), transparent);
    animation: cardRotate 8s linear infinite paused;
    opacity: 0;
    transition: opacity 0.5s;
}

@keyframes cardRotate {
    to { transform: rotate(360deg); }
}

.character-card:hover {
    transform: translateY(-8px);
    border-color: var(--mansion-gold);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.character-card:hover .card-glow {
    animation-play-state: running;
    opacity: 0.1;
}

.character-portrait {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.character-info {
    position: relative;
    z-index: 1;
}

.character-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--mansion-cream);
    margin-bottom: 0.4rem;
}

.character-colony {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--mansion-gold);
    margin-bottom: 0.6rem;
    letter-spacing: 0.02em;
}

.character-role {
    font-size: 0.9rem;
    color: rgba(245, 230, 211, 0.7);
    margin-bottom: 1.25rem;
    font-weight: 500;
}

.character-quote {
    font-style: italic;
    font-size: 1rem;
    color: var(--candlelight);
    border-left: 3px solid var(--mansion-gold-dim);
    padding: 0.75rem 1rem;
    margin: 1.25rem 0;
    background: rgba(201, 162, 39, 0.05);
    border-radius: 0 4px 4px 0;
}

.character-essence {
    font-size: 0.9rem;
    color: rgba(245, 230, 211, 0.75);
    line-height: 1.7;
}

/* Character-specific colors */
.character-card[data-character="scarlet"]:hover { border-color: var(--scarlet); box-shadow: 0 15px 50px rgba(220, 20, 60, 0.25); }
.character-card[data-character="mustard"]:hover { border-color: var(--mustard); box-shadow: 0 15px 50px rgba(230, 184, 0, 0.25); }
.character-card[data-character="white"]:hover { border-color: var(--white); box-shadow: 0 15px 50px rgba(245, 245, 245, 0.15); }
.character-card[data-character="green"]:hover { border-color: var(--green); box-shadow: 0 15px 50px rgba(34, 139, 34, 0.25); }
.character-card[data-character="plum"]:hover { border-color: var(--plum); box-shadow: 0 15px 50px rgba(142, 69, 133, 0.25); }
.character-card[data-character="peacock"]:hover { border-color: var(--peacock); box-shadow: 0 15px 50px rgba(0, 206, 209, 0.25); }
.character-card[data-character="motorist"]:hover { border-color: var(--grove-green); box-shadow: 0 15px 50px rgba(45, 90, 39, 0.25); }

/* Wadsworth - golden border */
.character-wadsworth {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.15), rgba(26, 15, 15, 0.95));
    border: 2px solid var(--mansion-gold);
    box-shadow: 0 15px 50px rgba(201, 162, 39, 0.2);
}

.character-wadsworth:hover {
    border-color: var(--candlelight);
    box-shadow: 0 20px 60px rgba(201, 162, 39, 0.35);
}

/* ═══════════════════════════════════════════════════════════════
   FANO PLANE / SECRET PASSAGES
═══════════════════════════════════════════════════════════════ */

.fano-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .fano-container {
        grid-template-columns: 1fr;
    }
}

.fano-plane {
    background: rgba(26, 15, 15, 0.8);
    border: 1px solid var(--mansion-wood);
    padding: 2rem;
    border-radius: 50%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fano-svg {
    width: 100%;
    height: 100%;
}

.fano-line {
    stroke: var(--mansion-gold-dim);
    stroke-width: 1;
    fill: none;
    transition: stroke 0.3s, stroke-width 0.3s;
}

.fano-circle {
    stroke: var(--mansion-gold-dim);
    stroke-width: 1;
    fill: none;
}

.fano-node {
    fill: var(--mansion-dark);
    stroke: var(--mansion-gold);
    stroke-width: 2;
    cursor: pointer;
    transition: fill 0.3s, r 0.3s;
}

.fano-node:hover {
    fill: var(--mansion-gold);
    r: 25;
}

.fano-node[data-colony="spark"] { stroke: var(--spark); }
.fano-node[data-colony="forge"] { stroke: var(--forge); }
.fano-node[data-colony="flow"] { stroke: var(--flow); }
.fano-node[data-colony="nexus"] { stroke: var(--nexus); }
.fano-node[data-colony="beacon"] { stroke: var(--beacon); }
.fano-node[data-colony="grove"] { stroke: var(--grove); }
.fano-node[data-colony="crystal"] { stroke: var(--crystal); }

.fano-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    fill: rgba(245, 230, 211, 0.6);
    text-anchor: middle;
}

.passage-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.passage-item {
    padding: 1rem 1.5rem;
    background: rgba(26, 15, 15, 0.6);
    border-left: 3px solid var(--mansion-gold-dim);
    cursor: pointer;
    transition: all 0.3s var(--ease-dramatic);
}

.passage-item:hover {
    background: rgba(74, 44, 42, 0.4);
    border-color: var(--mansion-gold);
    transform: translateX(5px);
}

.passage-rooms {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--mansion-cream);
    display: block;
    margin-bottom: 0.25rem;
}

.passage-equation {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--mansion-gold);
    display: block;
    margin-bottom: 0.25rem;
}

.passage-line {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(245, 230, 211, 0.4);
}

.passage-rule {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(74, 44, 42, 0.2);
    border: 1px dashed var(--mansion-wood);
    font-size: 0.95rem;
    color: rgba(245, 230, 211, 0.8);
}

.passage-rule strong {
    color: var(--mansion-gold);
}

/* ═══════════════════════════════════════════════════════════════
   ARCHITECTURE GRID
═══════════════════════════════════════════════════════════════ */

.architecture-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 3rem auto;
    max-width: 1000px;
}

@media (max-width: 768px) {
    .architecture-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
}

.arch-card {
    padding: 2rem;
    background: linear-gradient(180deg, rgba(26, 15, 15, 0.95), rgba(45, 27, 27, 0.9));
    border: 2px solid var(--mansion-wood);
    border-radius: 10px;
    transition: all 0.4s var(--ease-dramatic);
}

.arch-card:hover {
    transform: translateY(-4px);
    border-color: var(--mansion-gold);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.arch-card-danger {
    border-color: var(--mansion-red);
    background: linear-gradient(180deg, rgba(139, 0, 0, 0.15), rgba(26, 15, 15, 0.95));
}

.arch-card-danger:hover {
    border-color: #ff4444;
    box-shadow: 0 15px 40px rgba(139, 0, 0, 0.3);
}

.arch-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.arch-card h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--mansion-cream);
    margin-bottom: 0.25rem;
}

.arch-path {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--mansion-gold);
    margin-bottom: 1rem;
}

.arch-desc {
    font-size: 0.95rem;
    color: rgba(245, 230, 211, 0.8);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.arch-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.arch-files code {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--mansion-gold-dim);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   SUSPECTS COMPACT
═══════════════════════════════════════════════════════════════ */

.suspects-compact, .passages-compact {
    margin: 3rem auto;
    max-width: 1000px;
    padding: 2rem;
    background: rgba(26, 15, 15, 0.5);
    border: 1px solid var(--mansion-wood);
    border-radius: 10px;
}

.subsection-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--mansion-gold);
    text-align: center;
    margin-bottom: 0.5rem;
}

.subsection-intro {
    text-align: center;
    font-size: 0.9rem;
    color: rgba(245, 230, 211, 0.6);
    margin-bottom: 1.5rem;
}

.suspect-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 700px) {
    .suspect-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.suspect-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: rgba(26, 15, 15, 0.6);
    border: 1px solid var(--mansion-wood);
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s var(--ease-dramatic);
}

.suspect-mini:hover {
    border-color: var(--mansion-gold);
    transform: translateY(-2px);
}

.suspect-mini.character-wadsworth {
    border-color: var(--mansion-gold);
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.1), rgba(26, 15, 15, 0.8));
}

.suspect-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.suspect-name {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--mansion-cream);
}

.suspect-role {
    font-size: 0.7rem;
    color: var(--mansion-gold-dim);
}

/* ═══════════════════════════════════════════════════════════════
   PASSAGES COMPACT
═══════════════════════════════════════════════════════════════ */

.passage-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 600px) {
    .passage-grid {
        grid-template-columns: 1fr;
    }
}

.passage-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(26, 15, 15, 0.6);
    border: 1px solid var(--mansion-wood);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.passage-from, .passage-to {
    color: var(--mansion-cream);
}

.passage-arrow {
    color: var(--mansion-gold);
}

/* ═══════════════════════════════════════════════════════════════
   LIFECYCLE FLOW
═══════════════════════════════════════════════════════════════ */

.lifecycle-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-width: 600px;
    margin: 3rem auto;
}

.lifecycle-step {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(26, 15, 15, 0.9), rgba(45, 27, 27, 0.8));
    border: 1px solid var(--mansion-wood);
    border-radius: 10px;
}

.step-number {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--mansion-gold);
    min-width: 2.5rem;
    text-align: center;
}

.step-content h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--mansion-cream);
    margin-bottom: 0.25rem;
}

.step-content code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--mansion-gold);
    display: block;
    margin-bottom: 0.5rem;
}

.step-content p {
    font-size: 0.9rem;
    color: rgba(245, 230, 211, 0.7);
}

.lifecycle-arrow {
    font-size: 1.5rem;
    color: var(--mansion-gold);
    padding: 0.5rem 0;
}

/* ═══════════════════════════════════════════════════════════════
   BASEMENT (MATHEMATICS)
═══════════════════════════════════════════════════════════════ */

.basement-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin: 3rem auto;
    max-width: 1000px;
}

@media (max-width: 768px) {
    .basement-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
}

.basement-item {
    padding: 2.5rem;
    background: linear-gradient(135deg, rgba(45, 27, 78, 0.25), rgba(26, 15, 15, 0.6));
    border: 2px solid var(--mystery);
    border-radius: 10px;
    transition: all 0.4s var(--ease-dramatic);
}

.basement-item:hover {
    transform: translateY(-6px);
    border-color: var(--mansion-gold);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.basement-icon {
    font-size: 3rem;
    margin-bottom: 1.25rem;
    color: var(--mansion-gold);
    filter: drop-shadow(0 2px 8px rgba(201, 162, 39, 0.3));
}

.basement-item h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: 0.03em;
    color: var(--mansion-cream);
    margin-bottom: 0.4rem;
}

.basement-ref {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--mansion-gold);
    margin-bottom: 1.25rem;
}

.basement-item p {
    font-size: 0.95rem;
    color: rgba(245, 230, 211, 0.75);
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.basement-item code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--mansion-gold);
    background: rgba(0, 0, 0, 0.4);
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    display: inline-block;
}

.basement-quote {
    text-align: center;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--candlelight);
    margin-top: 3rem;
    padding: 2rem;
    border-top: 2px solid var(--mansion-gold-dim);
    border-bottom: 2px solid var(--mansion-gold-dim);
    background: rgba(201, 162, 39, 0.05);
    border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   ATTIC (WORLD MODEL)
═══════════════════════════════════════════════════════════════ */

.attic-content {
    max-width: 700px;
    margin: 0 auto;
}

.world-model {
    background: rgba(26, 15, 15, 0.8);
    border: 1px solid var(--mansion-wood);
    padding: 2rem;
    margin-bottom: 2rem;
}

.world-model h3 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--mansion-gold);
    margin-bottom: 1.5rem;
}

.model-tree {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.tree-item {
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tree-branch {
    color: var(--mansion-gold-dim);
}

.tree-name {
    color: var(--mansion-cream);
    font-weight: 500;
}

.tree-detail {
    color: rgba(245, 230, 211, 0.5);
    font-size: 0.75rem;
}

.attic-insight {
    font-size: 1rem;
    color: rgba(245, 230, 211, 0.8);
    text-align: center;
    margin-bottom: 1.5rem;
}

.attic-quote {
    text-align: center;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--candlelight);
    padding: 1rem;
    border-left: 3px solid var(--mansion-gold);
    background: rgba(74, 44, 42, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   WALLS (SAFETY)
═══════════════════════════════════════════════════════════════ */

.safety-system {
    max-width: 800px;
    margin: 0 auto;
}

.safety-invariant {
    text-align: center;
    padding: 2rem;
    background: rgba(139, 0, 0, 0.1);
    border: 2px solid var(--mansion-red);
    margin-bottom: 2rem;
}

.invariant-formula {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--mansion-cream);
    margin-bottom: 0.5rem;
}

.invariant-meaning {
    font-size: 0.9rem;
    color: rgba(245, 230, 211, 0.7);
}

.safety-tiers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .safety-tiers {
        grid-template-columns: 1fr;
    }
}

    /* ═══════════════════════════════════════════════════════════════
       SAFETY ZONES (THE WALLS)
    ═══════════════════════════════════════════════════════════════ */

    .safety-hero {
        text-align: center;
        margin-bottom: 2.5rem;
    }

    .safety-formula {
        font-family: var(--font-display);
        font-size: 3.5rem;
        color: var(--mansion-red);
        text-shadow: 0 0 20px rgba(139, 0, 0, 0.4);
        margin-bottom: 0.5rem;
        font-weight: 700;
        letter-spacing: 0.05em;
    }

    .safety-explain {
        font-style: italic;
        color: rgba(245, 230, 211, 0.6);
    }

    .safety-zones {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        margin-bottom: 3rem;
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
    }

    @media (max-width: 700px) {
        .safety-zones {
            grid-template-columns: 1fr;
        }
    }

    .safety-zone {
        padding: 1.5rem;
        border-radius: 8px;
        text-align: center;
        border: 1px solid transparent;
        transition: all 0.3s var(--ease-dramatic);
    }

    .safety-zone.safe {
        background: rgba(34, 139, 34, 0.15);
        border-color: var(--green);
    }

    .safety-zone.caution {
        background: rgba(230, 184, 0, 0.15);
        border-color: var(--mustard);
    }

    .safety-zone.danger {
        background: rgba(139, 0, 0, 0.15);
        border-color: var(--mansion-red);
    }

    .zone-indicator {
        font-family: var(--font-mono);
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        opacity: 0.8;
    }

    .zone-status {
        font-weight: 700;
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .safety-zone p {
        font-size: 0.9rem;
        opacity: 0.7;
    }

    .safety-quote {
        text-align: center;
        font-style: italic;
        font-size: 1.1rem;
        color: var(--mansion-red);
        border-top: 1px solid var(--mansion-wood);
        border-bottom: 1px solid var(--mansion-wood);
        padding: 2rem;
        background: rgba(139, 0, 0, 0.05);
        margin: 0 auto;
        max-width: 800px;
    }

    .quote-attr {
        display: block;
        font-size: 0.85rem;
        color: var(--mansion-gold-dim);
        margin-top: 0.75rem;
        font-style: normal;
        text-transform: uppercase;
        letter-spacing: 0.1em;
    }

/* ═══════════════════════════════════════════════════════════════
   ENDINGS
═══════════════════════════════════════════════════════════════ */

.ending-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 3rem auto;
    max-width: 1000px;
}

@media (max-width: 800px) {
    .ending-buttons {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
}

.ending-btn {
    padding: 2.5rem 2rem;
    background: linear-gradient(180deg, rgba(26, 15, 15, 0.9), rgba(45, 27, 27, 0.8));
    border: 2px solid var(--mansion-wood);
    border-radius: 10px;
    color: var(--mansion-cream);
    cursor: pointer;
    transition: all 0.4s var(--ease-dramatic);
    text-align: center;
    font-family: inherit;
}

.ending-btn:hover {
    transform: translateY(-6px);
    border-color: var(--mansion-gold);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.ending-btn.active {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.2), rgba(26, 15, 15, 0.95));
    border-color: var(--mansion-gold);
    box-shadow: 0 15px 40px rgba(201, 162, 39, 0.2);
}

.ending-letter {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--mansion-gold);
    display: block;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 10px rgba(201, 162, 39, 0.3);
}

.ending-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.6rem;
}

.ending-quote {
    font-style: italic;
    font-size: 0.9rem;
    color: rgba(245, 230, 211, 0.65);
    display: block;
}

.ending-content {
    padding: 3rem;
    background: linear-gradient(180deg, rgba(26, 15, 15, 0.7), rgba(45, 27, 27, 0.6));
    border: 2px solid var(--mansion-wood);
    border-radius: 10px;
    min-height: 200px;
    max-width: 1000px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s var(--ease-dramatic);
}

.ending-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.ending-content h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--mansion-gold);
    margin-bottom: 1.25rem;
}

.ending-content p {
    margin-bottom: 1.25rem;
    color: rgba(245, 230, 211, 0.85);
    line-height: 1.8;
}

.ending-content ul {
    list-style: none;
    margin: 1.5rem 0;
    padding-left: 0;
}

.ending-content li {
    padding: 0.5rem 0;
    color: rgba(245, 230, 211, 0.8);
}

.ending-content blockquote {
    font-style: italic;
    color: var(--candlelight);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-left: 3px solid var(--mansion-gold);
    background: rgba(201, 162, 39, 0.05);
    border-radius: 0 6px 6px 0;
}

/* ═══════════════════════════════════════════════════════════════
   THE REVEAL
═══════════════════════════════════════════════════════════════ */

.wadsworth-speech {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .wadsworth-speech {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

.wadsworth-avatar {
    font-size: 4rem;
    flex-shrink: 0;
}

.speech-bubble {
    flex: 1;
    padding: 2rem;
    background: rgba(74, 44, 42, 0.3);
    border: 1px solid var(--mansion-wood);
    position: relative;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 20px;
    border: 10px solid transparent;
    border-right-color: var(--mansion-wood);
}

@media (max-width: 768px) {
    .speech-bubble::before {
        display: none;
    }
}

.speech-text {
    font-style: italic;
    font-size: 1.2rem;
    color: var(--candlelight);
}

.evidence-board {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
    margin: 0 auto 4rem;
    max-width: 1000px;
}

@media (max-width: 900px) {
    .evidence-board {
        grid-template-columns: repeat(3, 1fr);
        max-width: 600px;
    }
}

@media (max-width: 500px) {
    .evidence-board {
        grid-template-columns: repeat(2, 1fr);
        max-width: 350px;
    }
}

.evidence-item {
    padding: 2rem 1rem;
    background: linear-gradient(180deg, rgba(26, 15, 15, 0.9), rgba(45, 27, 27, 0.8));
    border: 2px solid var(--mansion-wood);
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s var(--ease-dramatic);
}

.evidence-item:hover {
    transform: translateY(-4px);
    border-color: var(--mansion-gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.evidence-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 500;
    color: var(--mansion-gold);
    display: block;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(201, 162, 39, 0.3);
}

.evidence-label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: rgba(245, 230, 211, 0.6);
    text-transform: uppercase;
}

.final-equation {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.12), rgba(26, 15, 15, 0.6));
    border: 2px solid var(--mansion-gold-dim);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    margin: 0 auto;
}

.equation-setup {
    font-style: italic;
    font-size: 1.15rem;
    color: rgba(245, 230, 211, 0.75);
    margin-bottom: 1.5rem;
}

.equation-result {
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.eq-term {
    opacity: 0;
    animation: termAppear 0.5s var(--ease-spring) forwards;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.eq-term:nth-child(1) { animation-delay: 0.1s; }
.eq-term:nth-child(2) { animation-delay: 0.3s; }
.eq-term:nth-child(3) { animation-delay: 0.5s; }
.eq-term:nth-child(4) { animation-delay: 0.7s; }
.eq-term:nth-child(5) { animation-delay: 0.9s; }
.eq-term:nth-child(6) { animation-delay: 1.1s; }
.eq-term:nth-child(7) { animation-delay: 1.3s; }

.eq-sum {
    font-size: 4rem;
    opacity: 0;
    animation: termAppear 0.5s var(--ease-spring) forwards;
    animation-delay: 1.5s;
    filter: drop-shadow(0 4px 12px rgba(201, 162, 39, 0.4));
}

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

/* ═══════════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════════ */

.mansion-footer {
    text-align: center;
    padding: 4rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--mansion-wood);
}

.footer-quote {
    font-style: italic;
    font-size: 1.1rem;
    color: rgba(245, 230, 211, 0.7);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.footer-signature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sig-kanji {
    font-size: 3rem;
    color: var(--mansion-gold);
    cursor: pointer;
    transition: all 0.5s var(--ease-dramatic);
}

.sig-kanji:hover {
    transform: scale(1.2);
    text-shadow: 0 0 40px var(--mansion-gold);
}

.sig-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 0.3em;
    color: var(--mansion-cream);
}

.footer-meta {
    font-size: 0.8rem;
    color: rgba(245, 230, 211, 0.4);
    margin-bottom: 1rem;
}

.meta-divider {
    margin: 0 0.5rem;
}

.footer-wadsworth {
    font-style: italic;
    font-size: 0.9rem;
    color: var(--mansion-gold-dim);
}

/* ═══════════════════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════════════════ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 50000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 7, 7, 0.95);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    margin: 2rem;
    padding: 3rem;
    background: var(--mansion-dark);
    border: 1px solid var(--mansion-gold);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.5s var(--ease-spring);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--mansion-wood);
    color: var(--mansion-cream);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-close:hover {
    border-color: var(--mansion-gold);
    color: var(--mansion-gold);
}

.modal-body h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--mansion-gold);
    margin-bottom: 0.5rem;
}

.modal-body .modal-subtitle {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--mansion-gold-dim);
    margin-bottom: 1.5rem;
}

.modal-body p {
    margin-bottom: 1rem;
    color: rgba(245, 230, 211, 0.8);
    line-height: 1.8;
}

.modal-body code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    color: var(--mansion-gold);
}

.modal-body blockquote {
    font-style: italic;
    padding: 1rem;
    border-left: 3px solid var(--mansion-gold);
    background: rgba(74, 44, 42, 0.3);
    margin: 1rem 0;
    color: var(--candlelight);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .mansion {
        padding: 2rem 1rem 4rem;
    }
    
    .mansion-title {
        letter-spacing: 0.15em;
    }
    
    .rooms-row {
        grid-template-columns: 1fr;
    }
    
    .structure-row {
        grid-template-columns: 1fr;
    }
    
    .character-grid {
        grid-template-columns: 1fr;
    }
    
    .basement-grid {
        grid-template-columns: 1fr;
    }
    
    .safety-zones {
        grid-template-columns: 1fr;
    }
    
    .evidence-board {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .fano-plane {
        border-radius: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SPECIAL EFFECTS
═══════════════════════════════════════════════════════════════ */

/* Flames animation for Mrs. White */
.flames-active {
    animation: flamesOnFace 2s ease-in-out infinite !important;
}

@keyframes flamesOnFace {
    0%, 100% { filter: hue-rotate(0deg); }
    25% { filter: hue-rotate(10deg) saturate(1.5); }
    50% { filter: hue-rotate(-10deg) saturate(1.2); }
    75% { filter: hue-rotate(5deg) saturate(1.3); }
}

/* Rainbow mode for Konami */
.rainbow-mode {
    animation: rainbow 3s linear infinite;
}

@keyframes rainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Passage reveal animation */
.passage-reveal .fano-line {
    stroke: var(--mansion-gold);
    stroke-width: 3;
    animation: passagePulse 1s ease-in-out infinite;
}

@keyframes passagePulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
