/* ═══════════════════════════════════════════════════════════════
   REALITY FRACTURE — Chamber Overlay System
   Full-screen explorable chambers + interactive elements
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay Container ─────────────────────────────────────── */
.chamber-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--void);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
    overflow: hidden;
}

.chamber-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.chamber-overlay.entering {
    opacity: 1;
    pointer-events: none;
}

/* ── Transition Canvas ─────────────────────────────────────── */
.transition-canvas {
    position: fixed;
    inset: 0;
    z-index: 10001;
    pointer-events: none;
}

/* ── Chamber Header ────────────────────────────────────────── */
.chamber-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-ghost);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-shrink: 0;
}

.chamber-header__left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chamber-header__id {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    color: var(--electric-blue);
    padding: 4px 12px;
    border: 1px solid var(--electric-blue-dim);
}

.chamber-header__title {
    font-family: var(--font-grotesk);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.chamber-header__title em {
    font-family: var(--font-serif);
    font-weight: 400;
    font-style: italic;
}

.chamber-header__status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--text-dim);
}

.chamber-header__status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--spectral-cyan);
    box-shadow: 0 0 8px var(--spectral-cyan);
    animation: dot-blink 2s ease-in-out infinite;
}

/* ── Exit Button ───────────────────────────────────────────── */
.chamber-exit {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: none;
    transition: all 0.3s ease;
}

.chamber-exit:hover {
    border-color: var(--electric-blue);
    color: var(--electric-blue);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

.chamber-exit__icon {
    width: 12px;
    height: 12px;
    position: relative;
}

.chamber-exit__icon::before,
.chamber-exit__icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 1px;
    background: currentColor;
}

.chamber-exit__icon::before { transform: translate(-50%, -50%) rotate(45deg); }
.chamber-exit__icon::after { transform: translate(-50%, -50%) rotate(-45deg); }

/* ── Chamber Body ──────────────────────────────────────────── */
.chamber-body {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 0;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

/* ── Chamber Canvas (center background) ────────────────────── */
.chamber-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ── Side Panels ───────────────────────────────────────────── */
.chamber-panel {
    position: relative;
    z-index: 5;
    padding: 24px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-right: 1px solid var(--border-ghost);
    scrollbar-width: thin;
    scrollbar-color: var(--surface-light) transparent;
}

.chamber-panel:last-child {
    border-right: none;
    border-left: 1px solid var(--border-ghost);
}

.chamber-panel__title {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    color: var(--electric-blue);
    text-transform: uppercase;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-ghost);
}

/* ── Center Area ───────────────────────────────────────────── */
.chamber-center {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ── Log Entries ───────────────────────────────────────────── */
.log-entry {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-ghost);
    transition: background 0.3s ease;
}

.log-entry:hover {
    background: rgba(0, 212, 255, 0.02);
}

.log-entry__time {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    color: var(--electric-blue);
    opacity: 0.6;
    display: block;
    margin-bottom: 4px;
}

.log-entry__text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 300;
}

.log-entry__text--classified {
    color: var(--neon-violet);
    font-style: italic;
}

/* ── Interactive Shards (Chamber 001) ──────────────────────── */
.floating-shard {
    position: absolute;
    padding: 16px 20px;
    background: rgba(0, 212, 255, 0.04);
    border: 1px solid rgba(0, 212, 255, 0.15);
    cursor: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 220px;
    backdrop-filter: blur(6px);
    z-index: 10;
}

.floating-shard:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--electric-blue);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.15),
                inset 0 0 30px rgba(0, 212, 255, 0.03);
    transform: scale(1.05) translateY(-4px);
}

.floating-shard.active {
    border-color: var(--spectral-cyan);
    background: rgba(6, 255, 208, 0.08);
    box-shadow: 0 0 40px rgba(6, 255, 208, 0.2);
}

.floating-shard__id {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.25em;
    color: var(--electric-blue);
    display: block;
    margin-bottom: 6px;
}

.floating-shard__text {
    font-size: var(--text-sm);
    color: var(--text-dim);
    line-height: 1.5;
    font-weight: 300;
    font-style: italic;
    transition: color 0.3s ease;
}

.floating-shard:hover .floating-shard__text {
    color: var(--text-secondary);
}

/* ── Timeline Events (Chamber 002) ─────────────────────────── */
.echo-moment {
    padding: 14px 16px;
    border: 1px solid var(--border-ghost);
    margin-bottom: 8px;
    cursor: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.echo-moment::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--neon-violet);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.echo-moment:hover {
    border-color: var(--neon-violet-dim);
    background: rgba(139, 92, 246, 0.04);
}

.echo-moment:hover::before {
    opacity: 1;
}

.echo-moment.expanded {
    border-color: var(--neon-violet);
    background: rgba(139, 92, 246, 0.06);
}

.echo-moment.expanded::before {
    opacity: 1;
}

.echo-moment__time {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--neon-violet);
    display: block;
    margin-bottom: 4px;
}

.echo-moment__title {
    font-family: var(--font-grotesk);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.echo-moment__desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
    display: none;
}

.echo-moment.expanded .echo-moment__desc {
    display: block;
    animation: title-reveal 0.5s ease forwards;
}

/* ── Ruin Structures (Chamber 003) ─────────────────────────── */
.ruin-node {
    padding: 14px 16px;
    border: 1px solid var(--border-ghost);
    margin-bottom: 8px;
    cursor: none;
    transition: all 0.3s ease;
}

.ruin-node:hover {
    border-color: var(--spectral-cyan-dim);
    background: rgba(6, 255, 208, 0.03);
}

.ruin-node.discovered {
    border-color: rgba(6, 255, 208, 0.3);
    background: rgba(6, 255, 208, 0.04);
}

.ruin-node__name {
    font-family: var(--font-grotesk);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.ruin-node__info {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.ruin-node__hidden {
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-ghost);
    font-size: 0.8rem;
    color: var(--spectral-cyan);
    line-height: 1.5;
    font-style: italic;
}

.ruin-node.discovered .ruin-node__hidden {
    display: block;
    animation: title-reveal 0.5s ease forwards;
}

/* ── Dream Counter (Chamber 004) ───────────────────────────── */
.dream-counter {
    text-align: center;
    padding: 20px;
    border: 1px solid var(--border-ghost);
    margin-bottom: 16px;
}

.dream-counter__value {
    font-family: var(--font-grotesk);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--spectral-cyan);
    line-height: 1;
}

.dream-counter__label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.3em;
    color: var(--text-dim);
    margin-top: 4px;
}

.dream-click-zone {
    position: absolute;
    inset: 0;
    z-index: 8;
    cursor: none;
}

.dream-click-zone::after {
    content: 'CLICK TO GENERATE NEW REGION';
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    color: var(--text-dim);
    opacity: 0.4;
    pointer-events: none;
}

/* ── Void Entity Input (Chamber 005) ───────────────────────── */
.void-input-wrap {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 8px;
    width: 90%;
    max-width: 500px;
}

.void-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    letter-spacing: 0.05em;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(8px);
    cursor: text;
}

.void-input:focus {
    border-color: var(--neon-violet);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.void-input::placeholder {
    color: var(--text-dim);
    font-style: italic;
}

.void-send {
    padding: 12px 20px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--neon-violet-dim);
    color: var(--neon-violet);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: none;
    transition: all 0.3s ease;
}

.void-send:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--neon-violet);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.void-response {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    max-width: 500px;
    width: 90%;
    text-align: center;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--neon-violet-dim);
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    font-style: italic;
    color: var(--neon-violet);
    line-height: 1.6;
    opacity: 0;
    transition: opacity 0.6s ease;
    backdrop-filter: blur(8px);
}

.void-response.visible {
    opacity: 1;
}

/* ── Signal Transmissions (Chamber 006) ────────────────────── */
.transmission {
    padding: 14px 16px;
    border: 1px solid var(--border-ghost);
    margin-bottom: 8px;
    cursor: none;
    transition: all 0.3s ease;
    position: relative;
}

.transmission:hover {
    border-color: var(--electric-blue-dim);
}

.transmission.restoring {
    pointer-events: none;
}

.transmission.restored {
    border-color: rgba(6, 255, 208, 0.3);
    background: rgba(6, 255, 208, 0.03);
}

.transmission__id {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.25em;
    color: var(--electric-blue);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.transmission__status {
    font-size: 0.5rem;
    padding: 2px 8px;
    border: 1px solid var(--border-ghost);
    color: var(--text-dim);
}

.transmission__status--corrupted {
    color: rgba(255, 80, 80, 0.7);
    border-color: rgba(255, 80, 80, 0.2);
}

.transmission__status--restored {
    color: var(--spectral-cyan);
    border-color: rgba(6, 255, 208, 0.2);
}

.transmission__progress {
    height: 2px;
    background: var(--border-ghost);
    margin: 8px 0;
    overflow: hidden;
    display: none;
}

.transmission.restoring .transmission__progress {
    display: block;
}

.transmission__progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--electric-blue), var(--spectral-cyan));
    transition: width 2s ease-in-out;
}

.transmission__message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-style: italic;
    display: none;
}

.transmission.restored .transmission__message {
    display: block;
    animation: title-reveal 0.6s ease forwards;
}

/* ── ARC-007 Special Styles ────────────────────────────────── */
.chamber-overlay--007 {
    background: var(--void);
}

.chamber-007-reveal {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.chamber-007-reveal__text {
    font-family: var(--font-serif);
    font-size: clamp(1.2rem, 2.5vw, var(--text-2xl));
    font-style: italic;
    color: var(--text-dim);
    line-height: 1.8;
    max-width: 600px;
    opacity: 0;
    transform: translateY(20px);
    animation: title-reveal 1.5s ease forwards;
}

.chamber-007-reveal__text em {
    color: var(--neon-violet);
    font-style: italic;
}

.chamber-007-reveal__text--delay-1 { animation-delay: 2s; }
.chamber-007-reveal__text--delay-2 { animation-delay: 4.5s; }
.chamber-007-reveal__text--delay-3 { animation-delay: 7s; }

.chamber-007-reveal__final {
    margin-top: 48px;
    font-family: var(--font-grotesk);
    font-size: clamp(1.5rem, 3vw, var(--text-3xl));
    font-weight: 700;
    color: var(--text-primary);
    opacity: 0;
    animation: title-reveal 2s ease forwards;
    animation-delay: 9.5s;
}

/* ── Archive Card States ───────────────────────────────────── */
.archive-card--visited .archive-card__inner {
    border-color: rgba(6, 255, 208, 0.15);
}

.archive-card--visited .archive-card__number::after {
    content: ' ✓';
    color: var(--spectral-cyan);
}

.archive-card--secret {
    display: none;
}

.archive-card--secret.unlocked {
    display: block;
    animation: portal-open 1.5s ease forwards;
}

.archive-card--secret .archive-card__inner {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.1);
}

.archive-card--secret .archive-card__number {
    color: var(--neon-violet);
}

.archive-card--secret .archive-card__title em {
    color: var(--neon-violet);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .chamber-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .chamber-panel {
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-ghost);
    }

    .chamber-panel:last-child {
        border-left: none;
        border-top: 1px solid var(--border-ghost);
        max-height: 200px;
    }
}

@media (max-width: 768px) {
    .chamber-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .chamber-header__status {
        display: none;
    }

    .chamber-panel {
        padding: 16px;
        max-height: 160px;
    }

    .void-input-wrap {
        bottom: 20px;
        flex-direction: column;
    }

    .floating-shard {
        max-width: 160px;
        padding: 10px 14px;
    }
}
