/* ═══════════════════════════════════════════════════════════════
   REALITY FRACTURE — Forbidden Artifacts & Chambers
   High-tech styling, neon glows, levitation, and full screen
   classified chambers.
   ═══════════════════════════════════════════════════════════════ */

.artifacts__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-4);
}

/* ── Artifact Card Container ────────────────────────────────── */
.artifact-card {
    position: relative;
    background: rgba(4, 4, 12, 0.85);
    border: 1px solid var(--border-ghost);
    cursor: none;
    overflow: hidden;
    perspective: 1000px;
    transition: border-color var(--duration-normal) var(--ease-out-expo),
                box-shadow var(--duration-normal) var(--ease-out-expo),
                transform var(--duration-slow) var(--ease-out-expo);
    --accent-dim: rgba(0, 212, 255, 0.15);
}

/* Levitating and border glows on hover */
.artifact-card:hover {
    transform: translateY(-12px) scale(1.01);
    border-color: var(--accent);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7),
                0 0 30px rgba(0, 0, 0, 0.3),
                0 0 15px var(--accent-dim);
}

.artifact-card__inner {
    position: relative;
    padding: var(--sp-5);
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

/* ── Containment Field (Pulse and Grid) ────────────────────── */
.artifact-card__containment-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 40%, rgba(4, 4, 12, 0.9) 100%),
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 100% 100%, 16px 16px, 16px 16px;
    background-position: center;
    opacity: 0.15;
    transition: opacity var(--duration-normal) ease, transform var(--duration-slow) var(--ease-out-expo);
}

.artifact-card:hover .artifact-card__containment-field {
    opacity: 0.45;
    transform: scale(1.04);
    animation: containment-pulse 4s ease-in-out infinite alternate;
}

@keyframes containment-pulse {
    0% {
        box-shadow: inset 0 0 20px rgba(0,0,0,0.8), inset 0 0 10px var(--accent-dim);
    }
    100% {
        box-shadow: inset 0 0 40px rgba(0,0,0,0.5), inset 0 0 30px var(--accent-dim);
    }
}

/* ── Holographic Scanner Line ───────────────────────────────── */
.artifact-card__scanner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    pointer-events: none;
    z-index: 4;
}

.artifact-card:hover .artifact-card__scanner {
    opacity: 0.8;
    animation: scan-vertical 2.5s linear infinite;
}

@keyframes scan-vertical {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

/* ── Animated Artifact Core Visual ──────────────────────────── */
.artifact-card__visual {
    position: relative;
    width: 100%;
    height: 180px;
    background: rgba(2, 2, 6, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.03);
    margin-bottom: var(--sp-4);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.artifact-card__canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ── Shifting Glyphs Overlay ────────────────────────────────── */
.artifact-card__glyphs {
    position: absolute;
    inset: var(--sp-2);
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--accent);
    opacity: 0.1;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
    line-height: 1.2;
    transition: opacity var(--duration-normal) ease;
}

.artifact-card:hover .artifact-card__glyphs {
    opacity: 0.45;
}

/* ── Reality Distortion Edge Effect ────────────────────────── */
.artifact-card__distortion {
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    pointer-events: none;
    z-index: 3;
    transition: all var(--duration-normal) ease;
}

.artifact-card:hover .artifact-card__distortion {
    border-color: rgba(255, 255, 255, 0.04);
    backdrop-filter: contrast(1.1) brightness(1.05);
    -webkit-backdrop-filter: contrast(1.1) brightness(1.05);
}

/* ── Text Content ──────────────────────────────────────────── */
.artifact-card__serial {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    color: var(--accent);
    margin-bottom: var(--sp-1);
    opacity: 0.6;
    display: block;
}

.artifact-card__title {
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: var(--sp-2);
    color: var(--text-primary);
    transition: color var(--duration-normal) ease;
}

.artifact-card:hover .artifact-card__title {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

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

.artifact-card__desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 300;
    margin-bottom: var(--sp-3);
    flex-grow: 1;
}

/* ── Status Indicator ──────────────────────────────────────── */
.artifact-card__status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 12px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #555;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.1);
}

.status-dot--unstable {
    background: var(--electric-blue);
    box-shadow: 0 0 8px var(--electric-blue);
    animation: status-pulse 1s ease-in-out infinite;
}

.status-dot--warning {
    background: var(--spectral-cyan);
    box-shadow: 0 0 8px var(--spectral-cyan);
    animation: status-pulse 1.5s ease-in-out infinite;
}

.status-dot--critical {
    background: var(--neon-violet);
    box-shadow: 0 0 8px var(--neon-violet);
    animation: status-pulse 0.7s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ── Circuit Borders / Corner accents ──────────────────────── */
.artifact-card__circuit-border {
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    pointer-events: none;
    z-index: 5;
}

.artifact-card__circuit-border::before,
.artifact-card__circuit-border::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: rgba(255, 255, 255, 0.15);
    border-style: solid;
    opacity: 0.4;
    transition: border-color var(--duration-normal) ease, opacity var(--duration-normal) ease;
}

/* Top-Left Corner */
.artifact-card__circuit-border::before {
    top: 8px;
    left: 8px;
    border-width: 1px 0 0 1px;
}

/* Bottom-Right Corner */
.artifact-card__circuit-border::after {
    bottom: 8px;
    right: 8px;
    border-width: 0 1px 1px 0;
}

.artifact-card:hover .artifact-card__circuit-border::before,
.artifact-card:hover .artifact-card__circuit-border::after {
    border-color: var(--accent);
    opacity: 1;
    box-shadow: 0 0 4px var(--accent);
}


/* ═══════════════════════════════════════════════════════════════
   FULLSCREEN ARTIFACT CHAMBERS OVERLAY
   ═══════════════════════════════════════════════════════════════ */

.artifact-chamber {
    position: fixed;
    inset: 0;
    z-index: 10005;
    background: #000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    font-family: var(--font-body);
}

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

/* Chamber Header */
.artifact-chamber__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background: rgba(3, 3, 8, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10;
}

.artifact-chamber__brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.artifact-chamber__serial {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    color: var(--accent);
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.01);
}

.artifact-chamber__title {
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

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

.artifact-chamber__status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: var(--text-dim);
}

.artifact-chamber__close-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    cursor: none;
    transition: all 0.3s ease;
}

.artifact-chamber__close-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

/* Chamber Layout Body */
.artifact-chamber__body {
    flex: 1;
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

/* Side Panels */
.artifact-chamber__panel {
    background: rgba(2, 2, 6, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    overflow-y: auto;
    scrollbar-width: none;
    z-index: 5;
}

.artifact-chamber__panel::-webkit-scrollbar {
    display: none;
}

.artifact-chamber__panel--right {
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.artifact-chamber__panel-header {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    color: var(--accent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.artifact-chamber__panel-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.artifact-chamber__metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.artifact-chamber__metric-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    text-transform: uppercase;
}

.artifact-chamber__metric-value {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-primary);
    font-weight: 500;
}

.artifact-chamber__log-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    line-height: 1.5;
}

.artifact-chamber__log-entry {
    padding: 8px;
    background: rgba(255,255,255,0.01);
    border-left: 2px solid var(--accent);
    color: var(--text-secondary);
}

.artifact-chamber__log-time {
    color: var(--accent);
    display: block;
    margin-bottom: 2px;
    font-size: 0.58rem;
}

/* Center Interactive Canvas Container */
.artifact-chamber__center {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(10, 10, 24, 0.2) 0%, #000 100%);
}

.artifact-chamber__main-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.artifact-chamber__interactive-ui {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.artifact-chamber__interactive-ui * {
    pointer-events: all;
}

/* Drag overlay for knife */
.reality-knife-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
}

/* Oracle Orbiter panel */
.transmission-node {
    padding: 10px 14px;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.15);
    margin-bottom: 8px;
    cursor: none;
    transition: all 0.3s ease;
}

.transmission-node:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.1);
}

.transmission-node__meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--accent);
    margin-bottom: 4px;
}

.transmission-node__snippet {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transmission-node__full {
    display: none;
    font-size: 0.75rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.transmission-node.active .transmission-node__full {
    display: block;
    animation: title-reveal 0.4s ease forwards;
}

/* Labyrinth Game Styling */
.maze-instructions {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    background: rgba(0,0,0,0.6);
    padding: 6px 16px;
    border: 1px solid rgba(255,255,255,0.05);
    pointer-events: none;
}

/* Seamkeeper Stabilization button */
.stabilizer-widget {
    margin-top: 16px;
}

.stabilize-btn {
    width: 100%;
    padding: 12px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--neon-violet);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    cursor: none;
    transition: all 0.3s ease;
}

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

/* Shard list visual for Forge */
.shard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shard-item {
    padding: 8px 12px;
    background: rgba(255,255,255,0.01);
    border: 1px solid rgba(255,255,255,0.04);
    font-size: 0.72rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.shard-item.collected {
    border-color: rgba(200, 255, 0, 0.3);
    background: rgba(200, 255, 0, 0.03);
    color: var(--text-primary);
}

.shard-item__id {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--accent);
    display: block;
    margin-bottom: 2px;
}

/* Screen shake animation class */
.shake-element {
    animation: screen-shake 0.4s ease infinite;
}

@keyframes screen-shake {
    0%, 100% { transform: translate(0, 0); }
    10%, 90% { transform: translate(-2px, -1px); }
    20%, 80% { transform: translate(2px, 1px); }
    30%, 70% { transform: translate(-1px, 2px); }
    40%, 60% { transform: translate(1px, -2px); }
    50% { transform: translate(-2px, 2px); }
}

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

    .artifact-chamber__panel {
        max-height: 180px;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .artifact-chamber__panel--right {
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.05);
    }
}
