:root {
    --color-enoxia-green: #4fffa8;
    --color-watcher-cyan: #00f3ff;
    --color-avarice-red: #ff3333;
    --color-magenta-magic: #d946ef;
    --bg-deep-space: #030305;
}

body {
    margin: 0;
    overflow-x: hidden;
    background-color: var(--bg-deep-space);
    color: white;
    font-family: 'Share Tech Mono', monospace;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* UI GLITCH EFFECT */
.ui-glitch-active {
    animation: ui-glitch 0.2s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: var(--color-watcher-cyan);
}

@keyframes ui-glitch {
    0% {
        transform: translate(0)
    }

    20% {
        transform: translate(-2px, 2px)
    }

    40% {
        transform: translate(-2px, -2px)
    }

    60% {
        transform: translate(2px, 2px)
    }

    80% {
        transform: translate(2px, -2px)
    }

    100% {
        transform: translate(0)
    }
}

/* UI Overlay */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    z-index: 50;
    pointer-events: none;
    display: flex;
    justify-content: center;
}

.nav-container {
    pointer-events: auto;
    display: flex;
    gap: 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem 2rem;
    border-radius: 99px;
    border: 1px solid rgba(0, 243, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: border-color 0.2s, box-shadow 0.2s;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-container.glitching {
    border-color: var(--color-magenta-magic);
    box-shadow: 0 0 15px var(--color-magenta-magic);
}

.nav-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-watcher-cyan);
    text-shadow: 0 0 10px var(--color-watcher-cyan);
}

/* Sections */
main {
    position: relative;
    z-index: 10;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

section {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
    padding-top: 80px;
}

section.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Typography */
/* The Main Title Style */
.enoxia-title-style {
    font-family: 'Cinzel Decorative', serif;
    text-shadow:
        0 0 10px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(79, 255, 168, 0.2);
    line-height: 1;
    position: relative;
    z-index: 20;
}

#welcome-text {
    font-size: clamp(4rem, 8vw, 8rem);
    color: var(--color-enoxia-green);
}

/* Section Headers using the same style but smaller */
.section-header {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--color-watcher-cyan);
    margin-bottom: 2rem;
    text-align: center;
}

#status-bar {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--color-watcher-cyan);
    background: rgba(0, 0, 0, 0.6);
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 243, 255, 0.3);
    backdrop-filter: blur(4px);
    transition: all 0.5s ease;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    width: 90%;
    max-width: 1200px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 1rem;
}

.card-grid::-webkit-scrollbar {
    width: 6px;
}

.card-grid::-webkit-scrollbar-track {
    background: #050505;
}

.card-grid::-webkit-scrollbar-thumb {
    background: #00f3ff;
    border-radius: 3px;
}

.manifest-card {
    background: rgba(10, 15, 20, 0.7);
    border: 1px solid rgba(0, 243, 255, 0.2);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    position: relative;
}

.manifest-card:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--color-watcher-cyan);
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

.manifest-card.targeting {
    border-color: #ffff00;
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.3);
}

.manifest-card.targeting::after {
    content: '[ TARGET LOCKED ]';
    position: absolute;
    top: -10px;
    right: 10px;
    background: #ffff00;
    color: black;
    font-size: 0.6rem;
    padding: 2px 6px;
    font-weight: bold;
}

/* Action Buttons */
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--color-watcher-cyan);
    color: var(--color-watcher-cyan);
    padding: 1rem 2rem;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.action-btn:hover {
    background: var(--color-watcher-cyan);
    color: black;
    box-shadow: 0 0 20px var(--color-watcher-cyan);
}

/* Modal */
#modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

#modal-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

#modal-content {
    background: #0a0a0e;
    appearance: none;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--color-watcher-cyan);
    border-radius: 99px;
    outline: none;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-watcher-cyan);
    cursor: pointer;
    box-shadow: 0 0 10px var(--color-watcher-cyan);
    transition: transform 0.2s;
}

#volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-watcher-cyan);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px var(--color-watcher-cyan);
    transition: transform 0.2s;
}

#volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.volume-visible {
    display: flex !important;
    animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* D&D Specific Styles for Manifest */
.ddb-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--color-watcher-cyan);
    object-fit: cover;
}

.hp-bar-bg {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 10px;
    position: relative;
}

.hp-bar-fill {
    height: 100%;
    background: var(--color-enoxia-green);
    transition: width 0.5s ease;
}

/* ENGAGE DATA STREAM ANIMATION */
.datastream-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 15;
    backdrop-filter: blur(1px);
}

.manifest-card:hover .datastream-overlay {
    opacity: 1;
}

.datastream-text {
    color: #ffff00;
    font-weight: bold;
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: pulse-text 1.5s infinite;
}

@keyframes pulse-text {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 10px #ffff00;
    }
}

/* --- HOLOGRAPHIC AVATAR EFFECT --- */
.manifest-card:hover .ddb-avatar {
    filter: sepia(1) hue-rotate(180deg) saturate(3) contrast(1.2);
    box-shadow: 0 0 15px var(--color-watcher-cyan), inset 0 0 10px var(--color-watcher-cyan);
    animation: holo-flicker 0.1s infinite;
    position: relative;
}

@keyframes holo-flicker {
    0% {
        opacity: 0.9;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.95;
    }
}

/* Volume controls auto-hide */
.volume-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
}

/* --- LIMBO (CHAOS PLANE) OVERLAY --- */
#chaos-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: black;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#chaos-overlay.hidden {
    display: none;
}

#matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.8;
}

.chaos-center-text {
    position: relative;
    z-index: 10;
    text-align: center;
    animation: pulse-red 0.5s infinite alternate;
    mix-blend-mode: difference;
}

.chaos-center-text h1 {
    font-family: 'Cinzel Decorative', serif;
    font-size: clamp(2.5rem, 10vw, 6rem);
    color: #ff0000;
    text-shadow: 0 0 20px #ff0000;
    margin-bottom: 0.5rem;
    letter-spacing: 0.2em;
    animation: text-glitch 3s infinite;
}

.chaos-center-text p {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.8rem, 4vw, 1.5rem);
    color: #ffaaaa;
    letter-spacing: 0.5em;
    margin-bottom: 3rem;
}

#chaos-exit-btn {
    background: transparent;
    border: 2px solid #ff0000;
    color: #ff0000;
    padding: 1rem 2rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#chaos-exit-btn:hover {
    background: #ff0000;
    color: black;
    box-shadow: 0 0 30px #ff0000;
}

@keyframes pulse-red {
    from {
        text-shadow: 0 0 10px #ff0000;
        opacity: 0.8;
    }

    to {
        text-shadow: 0 0 30px #ff0000, 0 0 10px #ffffff;
        opacity: 1;
    }
}

/* EXTREME GLITCH EFFECT (Applied to body when Limbo is active) */
.extreme-glitch {
    animation: extreme-glitch-anim 0.1s infinite;
    overflow: hidden;
}

@keyframes extreme-glitch-anim {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-2px, 2px);
    }

    50% {
        transform: translate(2px, -2px);
    }

    75% {
        transform: translate(-2px, -2px);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* CHROMATIC ABERRATION */
.chromatic-aberration {
    animation: chromatic-pulse 2s infinite alternate;
}

@keyframes chromatic-pulse {
    0% {
        text-shadow: 2px 0 #ff0000, -2px 0 #0000ff;
    }

}

/* ENGAGE DATA STREAM ANIMATION */
.datastream-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 15;
    backdrop-filter: blur(1px);
}

.manifest-card:hover .datastream-overlay {
    opacity: 1;
}

.datastream-text {
    color: #ffff00;
    font-weight: bold;
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: pulse-text 1.5s infinite;
}

@keyframes pulse-text {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 10px #ffff00;
    }
}

/* --- HOLOGRAPHIC AVATAR EFFECT --- */
.manifest-card:hover .ddb-avatar {
    filter: sepia(1) hue-rotate(180deg) saturate(3) contrast(1.2);
    box-shadow: 0 0 15px var(--color-watcher-cyan), inset 0 0 10px var(--color-watcher-cyan);
    animation: holo-flicker 0.1s infinite;
    position: relative;
}

@keyframes holo-flicker {
    0% {
        opacity: 0.9;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.95;
    }
}

/* Volume controls auto-hide */
.volume-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
}

/* --- LIMBO (CHAOS PLANE) OVERLAY --- */
#chaos-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: black;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#chaos-overlay.hidden {
    display: none;
}

#matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.8;
}

.chaos-center-text {
    position: relative;
    z-index: 10;
    text-align: center;
    animation: pulse-red 0.5s infinite alternate;
    mix-blend-mode: difference;
}

.chaos-center-text h1 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 6rem;
    color: #ff0000;
    text-shadow: 0 0 20px #ff0000;
    margin-bottom: 0.5rem;
    letter-spacing: 0.2em;
    animation: text-glitch 3s infinite;
}

.chaos-center-text p {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.5rem;
    color: #ffaaaa;
    letter-spacing: 0.5em;
    margin-bottom: 3rem;
}

#chaos-exit-btn {
    background: transparent;
    border: 2px solid #ff0000;
    color: #ff0000;
    padding: 1rem 3rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#chaos-exit-btn:hover {
    background: #ff0000;
    color: black;
    box-shadow: 0 0 30px #ff0000;
}

@keyframes pulse-red {
    from {
        text-shadow: 0 0 10px #ff0000;
        opacity: 0.8;
    }

    to {
        text-shadow: 0 0 30px #ff0000, 0 0 10px #ffffff;
        opacity: 1;
    }
}

/* EXTREME GLITCH EFFECT (Applied to body when Limbo is active) */
.extreme-glitch {
    animation: extreme-glitch-anim 0.1s infinite;
    overflow: hidden;
}

@keyframes extreme-glitch-anim {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-2px, 2px);
    }

    50% {
        transform: translate(2px, -2px);
    }

    75% {
        transform: translate(-2px, -2px);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* CHROMATIC ABERRATION */
.chromatic-aberration {
    animation: chromatic-pulse 2s infinite alternate;
}

@keyframes chromatic-pulse {
    0% {
        text-shadow: 2px 0 #ff0000, -2px 0 #0000ff;
    }

    100% {
        text-shadow: 4px 0 #ff0000, -4px 0 #0000ff;
    }
}

/* Fix Audio Toggle Jitter */
#audio-toggle {
    width: 3rem;
    height: 3rem;
    display: flex;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 15;
    backdrop-filter: blur(1px);
}

.manifest-card:hover .datastream-overlay {
    opacity: 1;
}

.datastream-text {
    color: #ffff00;
    font-weight: bold;
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: pulse-text 1.5s infinite;
}

@keyframes pulse-text {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 10px #ffff00;
    }
}

/* --- HOLOGRAPHIC AVATAR EFFECT --- */
.manifest-card:hover .ddb-avatar {
    filter: sepia(1) hue-rotate(180deg) saturate(3) contrast(1.2);
    box-shadow: 0 0 15px var(--color-watcher-cyan), inset 0 0 10px var(--color-watcher-cyan);
    animation: holo-flicker 0.1s infinite;
    position: relative;
}

@keyframes holo-flicker {
    0% {
        opacity: 0.9;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.95;
    }
}

/* Volume controls auto-hide */
.volume-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
}

/* --- LIMBO (CHAOS PLANE) OVERLAY --- */
#chaos-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: black;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#chaos-overlay.hidden {
    display: none;
}

#matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.8;
}

.chaos-center-text {
    position: relative;
    z-index: 10;
    text-align: center;
    animation: pulse-red 0.5s infinite alternate;
    mix-blend-mode: difference;
}

.chaos-center-text h1 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 6rem;
    color: #ff0000;
    text-shadow: 0 0 20px #ff0000;
    margin-bottom: 0.5rem;
    letter-spacing: 0.2em;
    animation: text-glitch 3s infinite;
}

.chaos-center-text p {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.5rem;
    color: #ffaaaa;
    letter-spacing: 0.5em;
    margin-bottom: 3rem;
}

#chaos-exit-btn {
    background: transparent;
    border: 2px solid #ff0000;
    color: #ff0000;
    padding: 1rem 3rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#chaos-exit-btn:hover {
    background: #ff0000;
    color: black;
    box-shadow: 0 0 30px #ff0000;
}

@keyframes pulse-red {
    from {
        text-shadow: 0 0 10px #ff0000;
        opacity: 0.8;
    }

    to {
        text-shadow: 0 0 30px #ff0000, 0 0 10px #ffffff;
        opacity: 1;
    }
}

/* EXTREME GLITCH EFFECT (Applied to body when Limbo is active) */
.extreme-glitch {
    animation: extreme-glitch-anim 0.1s infinite;
    overflow: hidden;
}

@keyframes extreme-glitch-anim {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-2px, 2px);
    }

    50% {
        transform: translate(2px, -2px);
    }

    75% {
        transform: translate(-2px, -2px);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* CHROMATIC ABERRATION */
.chromatic-aberration {
    animation: chromatic-pulse 2s infinite alternate;
}

@keyframes chromatic-pulse {
    0% {
        text-shadow: 2px 0 #ff0000, -2px 0 #0000ff;
    }

    100% {
        text-shadow: 4px 0 #ff0000, -4px 0 #0000ff;
    }
}

/* Fix Audio Toggle Jitter */
#audio-toggle {
    width: 3rem;
    height: 3rem;
    display: flex;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 15;
    backdrop-filter: blur(1px);
}

.manifest-card:hover .datastream-overlay {
    opacity: 1;
}

.datastream-text {
    color: #ffff00;
    font-weight: bold;
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: pulse-text 1.5s infinite;
}

@keyframes pulse-text {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 10px #ffff00;
    }
}

/* --- HOLOGRAPHIC AVATAR EFFECT --- */
.manifest-card:hover .ddb-avatar {
    filter: sepia(1) hue-rotate(180deg) saturate(3) contrast(1.2);
    box-shadow: 0 0 15px var(--color-watcher-cyan), inset 0 0 10px var(--color-watcher-cyan);
    animation: holo-flicker 0.1s infinite;
    position: relative;
}

@keyframes holo-flicker {
    0% {
        opacity: 0.9;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.95;
    }
}

/* Volume controls auto-hide */
.volume-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
}

/* --- LIMBO (CHAOS PLANE) OVERLAY --- */
#chaos-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: black;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#chaos-overlay.hidden {
    display: none;
}

#matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.8;
}

.chaos-center-text {
    position: relative;
    z-index: 10;
    text-align: center;
    animation: pulse-red 0.5s infinite alternate;
    mix-blend-mode: difference;
}

.chaos-center-text h1 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 6rem;
    color: #ff0000;
    text-shadow: 0 0 20px #ff0000;
    margin-bottom: 0.5rem;
    letter-spacing: 0.2em;
    animation: text-glitch 3s infinite;
}

.chaos-center-text p {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.5rem;
    color: #ffaaaa;
    letter-spacing: 0.5em;
    margin-bottom: 3rem;
}

#chaos-exit-btn {
    background: transparent;
    border: 2px solid #ff0000;
    color: #ff0000;
    padding: 1rem 3rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#chaos-exit-btn:hover {
    background: #ff0000;
    color: black;
    box-shadow: 0 0 30px #ff0000;
}

@keyframes pulse-red {
    from {
        text-shadow: 0 0 10px #ff0000;
        opacity: 0.8;
    }

    to {
        text-shadow: 0 0 30px #ff0000, 0 0 10px #ffffff;
        opacity: 1;
    }
}

/* EXTREME GLITCH EFFECT (Applied to body when Limbo is active) */
.extreme-glitch {
    animation: extreme-glitch-anim 0.1s infinite;
    overflow: hidden;
}

@keyframes extreme-glitch-anim {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-2px, 2px);
    }

    50% {
        transform: translate(2px, -2px);
    }

    75% {
        transform: translate(-2px, -2px);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* CHROMATIC ABERRATION */
.chromatic-aberration {
    animation: chromatic-pulse 2s infinite alternate;
}

@keyframes chromatic-pulse {
    0% {
        text-shadow: 2px 0 #ff0000, -2px 0 #0000ff;
    }

    100% {
        text-shadow: 4px 0 #ff0000, -4px 0 #0000ff;
    }
}

/* Fix Audio Toggle Jitter */
#audio-toggle {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 1 !important;
    z-index: 60;
}

/* COSMOGONY PROCESSING ANIMATION */
.processing-text {
    display: inline-block;
    position: relative;
    padding-right: 20px;
    /* Reserve space for dots */
}

.processing-text::after {
    content: '.';
    position: absolute;
    left: 100%;
    top: 0;
    animation: dots 1.5s steps(4, end) infinite;
    color: var(--color-enoxia-green);
    margin-left: 2px;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60% {
        content: '...';
    }

    80%,
    100% {
        content: '';
    }
}

@keyframes text-glitch {

    0%,
    80%,
    100% {
        transform: translate(0);
        text-shadow: 0 0 20px #ff0000;
    }

    82% {
        transform: translate(-2px, 2px);
        text-shadow: 2px 0 #00ffff, -2px 0 #ff0000;
    }

    84% {
        transform: translate(2px, -2px);
        text-shadow: -2px 0 #00ffff, 2px 0 #ff0000;
    }

    86% {
        transform: translate(0);
        text-shadow: 0 0 20px #ff0000;
    }
}

/* CSS CHAOS DEBRIS */
.chaos-shard {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 40px solid rgba(255, 0, 0, 0.8);
    opacity: 0.8;
    pointer-events: none;
    animation: float-debris 4s infinite linear;
    transform-style: preserve-3d;
}

.chaos-shard::before {
    content: '';
    position: absolute;
    top: 0;
    left: -20px;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 40px solid transparent;
    /* Inner cutout for wireframe look */
    transform: scale(0.8) translateY(2px);
}

@keyframes float-debris {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    50% {
        transform: translateY(-20px) rotate(180deg) scale(1.2);
    }

    100% {
        transform: translateY(0) rotate(360deg) scale(1);
    }
}

/* Randomized Text Glitch Helper */
.glitch-char {
    display: inline-block;
    animation: text-glitch 0.2s infinite;
    /* Fast base speed, delays added via JS */
}

/* Scanline Effect */
#chaos-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px);
    pointer-events: none;
    z-index: 5;
    animation: scanline-scroll 10s linear infinite;
}

@keyframes scanline-scroll {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100%;
    }
}


/* Cosmogony Player Styles */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--color-watcher-cyan);
    border-radius: 3px;
}

.chapter-btn {
    width: 100%;
    text-align: left;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid transparent;
    border-left: 4px solid transparent;
    box-sizing: border-box;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    font-family: 'Share Tech Mono', monospace;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.chapter-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--color-watcher-cyan);
    color: white;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.chapter-btn.active {
    background: rgba(0, 243, 255, 0.2);
    border-color: var(--color-watcher-cyan);
    color: var(--color-watcher-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
    border-left: 4px solid var(--color-watcher-cyan);
}

.chapter-btn.active::before {
    display: none;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Mobile Overrides for Limbo */
@media (max-width: 768px) {
    .chaos-center-text h1 {
        font-size: 2rem !important;
        line-height: 1.2;
        padding: 0 1rem;
    }

    .chaos-center-text p {
        font-size: 1rem !important;
        margin-bottom: 2rem;
    }

    #chaos-exit-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }


}

/* --- WIKI TERMINAL OVERLAY STYLES --- */
#wiki-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#wiki-overlay.hidden {
    display: none !important;
}

/* --- CRT & CONTAINER STYLES --- */
:root {
    --neon-color: #00FFFF;
    --crt-line: rgba(0, 255, 255, 0.1);
}

.hologram-container {
    position: relative;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 60px var(--neon-color), inset 0 0 25px var(--neon-color);
    overflow: hidden;
    width: 100%;
    height: 90vh;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    z-index: 50;
    animation: flicker 0.1s infinite alternate;
    transition: transform 0.1s, filter 0.1s;
}

/* --- ANIMATIONS --- */
@keyframes flicker {

    0%,
    100% {
        opacity: 1;
        filter: brightness(1);
    }

    5% {
        opacity: 0.98;
        filter: brightness(0.98);
    }

    10% {
        opacity: 1;
        filter: brightness(1);
    }

    95% {
        opacity: 1;
        filter: brightness(1);
    }

    100% {
        opacity: 0.96;
        filter: brightness(0.96);
    }
}

.severe-glitch-active {
    animation: none !important;
    animation: hard-glitch 0.2s infinite !important;
    filter: hue-rotate(90deg) contrast(2) !important;
}

@keyframes hard-glitch {
    0% {
        transform: translate(0) skew(0deg);
        opacity: 1;
    }

    20% {
        transform: translate(-10px, 5px) skew(10deg);
        opacity: 0.8;
    }

    40% {
        transform: translate(10px, -5px) skew(-10deg);
        opacity: 0.5;
    }

    60% {
        transform: translate(-5px, 0) skew(5deg);
        opacity: 0.9;
    }

    80% {
        transform: translate(5px, 0) skew(-5deg);
        opacity: 0.4;
    }

    100% {
        transform: translate(0) skew(0deg);
        opacity: 1;
    }
}

.hologram-text {
    text-shadow: 1px 0 2px rgba(255, 0, 0, 0.7), -1px 0 2px rgba(0, 255, 255, 0.7), 0 0 10px var(--neon-color);
}

/* --- UI ELEMENTS --- */
.terminal-input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--neon-color);
    color: var(--neon-color);
    font-family: inherit;
    outline: none;
    transition: box-shadow 0.2s;
}

.terminal-input:focus {
    box-shadow: 0 0 15px var(--neon-color);
}

.audio-btn {
    cursor: pointer;
    border: 1px solid var(--neon-color);
    padding: 2px 8px;
    transition: all 0.3s;
}

.audio-btn:hover {
    background: var(--neon-color);
    color: #000;
}

/* --- IFRAME STYLES --- */
#wiki-iframe {
    flex-grow: 1;
    width: 100%;
    border: none;
    background-color: #010108;
    opacity: 0.9;
    z-index: 20;
    /* Dark Mode Hack + CRT Contrast */
    filter: invert(0.9) hue-rotate(180deg) contrast(1.3) brightness(1.1);
}

.title-bar {
    background: rgba(0, 255, 255, 0.15);
    border-bottom: 2px solid var(--neon-color);
    z-index: 30;
}

/* --- HOLO BUTTONS --- */
.holo-btn {
    border: 1px solid rgba(255, 204, 0, 0.4);
    color: rgba(255, 204, 0, 0.8);
    background: rgba(30, 20, 0, 0.6);
    padding: 2px 8px;
    font-size: 0.7rem;
    font-family: 'Share Tech Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.holo-btn:hover {
    background: rgba(255, 204, 0, 0.2);
    border-color: #FFD700;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    text-shadow: 0 0 5px #FFD700;
}

.holo-btn:active {
    background: #FFD700;
    color: #000;
}

@media (max-width: 600px) {
    .holo-btn {
        font-size: 0.6rem;
        padding: 2px 6px;
    }
}