/* meltdown.quest - Styles */
/* Color Palette */
:root {
    --reactor-black: #0a0a0a;
    --meltdown-red: #ff003c;
    --plasma-cyan: #00f0ff;
    --terminal-green: #39ff14;
    --ash-gray: #9a9a9a;
    --static-white: #e0e0e0;
    --whiteout: #f0f0f0;
    --reactor-purple: #1a0a1e;
    --neutral-dark: #333333;
    --dark-gray: #555555;
    --light-gray: #c8c8c8;
    --meltdown-progress: 0;
}

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

html {
    scroll-behavior: auto;
    overflow-x: hidden;
}

body {
    background: var(--reactor-black);
    color: var(--static-white);
    font-family: 'Share Tech Mono', monospace;
    overflow-x: hidden;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: unset;
}

/* Layer 0 - Pixel Grid Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.04) 0px,
        rgba(0, 0, 0, 0.04) 1px,
        transparent 1px,
        transparent 8px
    ),
    repeating-linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.04) 0px,
        rgba(0, 0, 0, 0.04) 1px,
        transparent 1px,
        transparent 8px
    );
    pointer-events: none;
    z-index: 1000;
}

/* CRT Scanline Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    pointer-events: none;
    z-index: 1001;
}

/* Meltdown Progress Bar */
#meltdown-progress-bar {
    position: fixed;
    left: 0;
    top: 0;
    width: 4px;
    height: 100vh;
    z-index: 1002;
    background: var(--neutral-dark);
}

#meltdown-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(var(--meltdown-progress) * 100%);
    background: var(--terminal-green);
    transition: height 0.1s linear, background-color 0.3s;
}

/* Macro Glitch Animation */
@keyframes macroGlitch {
    0%, 97% { transform: translateX(0); }
    97.5% { transform: translateX(-4px); }
    98% { transform: translateX(3px); }
    98.5% { transform: translateX(-2px); }
    99% { transform: translateX(0); }
}

@keyframes macroGlitchFast {
    0%, 92% { transform: translateX(0); }
    93% { transform: translateX(-5px); }
    94% { transform: translateX(4px); }
    95% { transform: translateX(-3px); }
    96% { transform: translateX(0); }
}

/* Section base */
.act {
    position: relative;
    overflow: hidden;
}

.section-divider {
    width: 100%;
    height: 2px;
    background: var(--meltdown-red);
    position: relative;
}

.section-divider::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--meltdown-red);
    opacity: 0.3;
}

/* ====================== */
/* ACT 1 - WARNING        */
/* ====================== */
#act-warning {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--reactor-black);
    animation: macroGlitch 8s infinite;
}

.act-warning-content {
    text-align: center;
    position: relative;
}

.pixel-title {
    display: flex;
    justify-content: center;
    gap: clamp(0.3rem, 1vw, 0.8rem);
    margin-bottom: 2rem;
}

.pixel-letter {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    line-height: 0.9;
    color: var(--meltdown-red);
    text-shadow:
        2px 0 var(--plasma-cyan),
        -2px 0 var(--meltdown-red);
    display: inline-block;
}

.pixel-letter:nth-child(odd) {
    animation: letterJitter1 0.2s steps(4) infinite;
}

.pixel-letter:nth-child(even) {
    animation: letterJitter2 0.3s steps(4) infinite;
    color: var(--plasma-cyan);
    text-shadow:
        2px 0 var(--meltdown-red),
        -2px 0 var(--plasma-cyan);
}

@keyframes letterJitter1 {
    0% { transform: translate(0, 0); }
    25% { transform: translate(2px, -1px); }
    50% { transform: translate(-1px, 2px); }
    75% { transform: translate(3px, 1px); }
    100% { transform: translate(0, 0); }
}

@keyframes letterJitter2 {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-2px, 1px); }
    50% { transform: translate(1px, -3px); }
    75% { transform: translate(-1px, 2px); }
    100% { transform: translate(0, 0); }
}

.system-log {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: var(--ash-gray);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.scroll-chevron {
    display: flex;
    justify-content: center;
}

.chevron-arrow {
    display: block;
    width: 20px;
    height: 20px;
    border-right: 3px solid var(--plasma-cyan);
    border-bottom: 3px solid var(--plasma-cyan);
    transform: rotate(45deg);
    animation: chevronPulse 1.5s ease-in-out infinite;
}

@keyframes chevronPulse {
    0%, 100% { opacity: 0.3; transform: rotate(45deg) translateY(0); }
    50% { opacity: 1; transform: rotate(45deg) translateY(5px); }
}

/* ====================== */
/* ACT 2 - ESCALATION     */
/* ====================== */
#act-escalation {
    background: var(--reactor-black);
    padding: clamp(2rem, 5vw, 6rem);
    animation: macroGlitch 8s infinite;
}

.broken-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    perspective: 1000px;
}

.pixel-card {
    background: rgba(10, 10, 10, 0.9);
    border: 2px solid var(--meltdown-red);
    padding: clamp(1.2rem, 2vw, 2rem);
    position: relative;
    box-shadow: 4px 4px 0 var(--plasma-cyan);
    opacity: 0;
    transform: scaleY(0.01);
    transform-origin: top center;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.pixel-card.visible {
    opacity: 1;
    transform: scaleY(1);
}

.card-1 {
    grid-column: 1 / 7;
    transform: rotate(1deg);
}
.card-1.visible { transform: rotate(1deg) scaleY(1); }

.card-2 {
    grid-column: 6 / 13;
    transform: rotate(-1deg);
    margin-top: -8px;
}
.card-2.visible { transform: rotate(-1deg) scaleY(1); }

.card-3 {
    grid-column: 1 / 8;
    transform: rotate(2deg);
    margin-top: -16px;
}
.card-3.visible { transform: rotate(2deg) scaleY(1); }

.card-4 {
    grid-column: 7 / 13;
    transform: rotate(-3deg);
}
.card-4.visible { transform: rotate(-3deg) scaleY(1); }

.card-5 {
    grid-column: 2 / 7;
    transform: rotate(1deg);
    margin-top: -8px;
}
.card-5.visible { transform: rotate(1deg) scaleY(1); }

.card-6 {
    grid-column: 6 / 12;
    transform: rotate(-1deg);
}
.card-6.visible { transform: rotate(-1deg) scaleY(1); }

/* Card Icons - CSS Pixel Art */
.card-icon {
    width: 1px;
    height: 1px;
    margin-bottom: 1rem;
    position: relative;
}

/* Radiation Trefoil - 16x16 pixel art */
.icon-radiation {
    box-shadow:
        6px 1px 0 var(--meltdown-red), 7px 1px 0 var(--meltdown-red), 8px 1px 0 var(--meltdown-red), 9px 1px 0 var(--meltdown-red),
        5px 2px 0 var(--meltdown-red), 6px 2px 0 var(--meltdown-red), 9px 2px 0 var(--meltdown-red), 10px 2px 0 var(--meltdown-red),
        4px 3px 0 var(--meltdown-red), 5px 3px 0 var(--meltdown-red), 10px 3px 0 var(--meltdown-red), 11px 3px 0 var(--meltdown-red),
        4px 4px 0 var(--meltdown-red), 11px 4px 0 var(--meltdown-red),
        3px 5px 0 var(--meltdown-red), 7px 5px 0 var(--meltdown-red), 8px 5px 0 var(--meltdown-red), 12px 5px 0 var(--meltdown-red),
        3px 6px 0 var(--meltdown-red), 6px 6px 0 var(--meltdown-red), 7px 6px 0 var(--meltdown-red), 8px 6px 0 var(--meltdown-red), 9px 6px 0 var(--meltdown-red), 12px 6px 0 var(--meltdown-red),
        2px 7px 0 var(--meltdown-red), 6px 7px 0 var(--meltdown-red), 9px 7px 0 var(--meltdown-red), 13px 7px 0 var(--meltdown-red),
        2px 8px 0 var(--meltdown-red), 6px 8px 0 var(--meltdown-red), 9px 8px 0 var(--meltdown-red), 13px 8px 0 var(--meltdown-red),
        1px 9px 0 var(--meltdown-red), 7px 9px 0 var(--meltdown-red), 8px 9px 0 var(--meltdown-red), 14px 9px 0 var(--meltdown-red),
        1px 10px 0 var(--meltdown-red), 14px 10px 0 var(--meltdown-red),
        2px 11px 0 var(--meltdown-red), 13px 11px 0 var(--meltdown-red),
        3px 12px 0 var(--meltdown-red), 12px 12px 0 var(--meltdown-red),
        4px 13px 0 var(--meltdown-red), 5px 13px 0 var(--meltdown-red), 10px 13px 0 var(--meltdown-red), 11px 13px 0 var(--meltdown-red),
        6px 14px 0 var(--meltdown-red), 7px 14px 0 var(--meltdown-red), 8px 14px 0 var(--meltdown-red), 9px 14px 0 var(--meltdown-red);
    transform: scale(2);
    transform-origin: top left;
    margin-bottom: 2.5rem;
}

/* Melting Skull - 16x16 pixel art */
.icon-skull {
    box-shadow:
        5px 1px 0 var(--plasma-cyan), 6px 1px 0 var(--plasma-cyan), 7px 1px 0 var(--plasma-cyan), 8px 1px 0 var(--plasma-cyan), 9px 1px 0 var(--plasma-cyan), 10px 1px 0 var(--plasma-cyan),
        4px 2px 0 var(--plasma-cyan), 5px 2px 0 var(--plasma-cyan), 10px 2px 0 var(--plasma-cyan), 11px 2px 0 var(--plasma-cyan),
        3px 3px 0 var(--plasma-cyan), 12px 3px 0 var(--plasma-cyan),
        3px 4px 0 var(--plasma-cyan), 5px 4px 0 var(--static-white), 6px 4px 0 var(--static-white), 9px 4px 0 var(--static-white), 10px 4px 0 var(--static-white), 12px 4px 0 var(--plasma-cyan),
        3px 5px 0 var(--plasma-cyan), 5px 5px 0 var(--reactor-black), 6px 5px 0 var(--static-white), 9px 5px 0 var(--reactor-black), 10px 5px 0 var(--static-white), 12px 5px 0 var(--plasma-cyan),
        4px 6px 0 var(--plasma-cyan), 11px 6px 0 var(--plasma-cyan),
        4px 7px 0 var(--plasma-cyan), 7px 7px 0 var(--plasma-cyan), 8px 7px 0 var(--plasma-cyan), 11px 7px 0 var(--plasma-cyan),
        5px 8px 0 var(--plasma-cyan), 6px 8px 0 var(--plasma-cyan), 7px 8px 0 var(--plasma-cyan), 8px 8px 0 var(--plasma-cyan), 9px 8px 0 var(--plasma-cyan), 10px 8px 0 var(--plasma-cyan),
        5px 9px 0 var(--plasma-cyan), 7px 9px 0 var(--plasma-cyan), 8px 9px 0 var(--plasma-cyan), 10px 9px 0 var(--plasma-cyan),
        5px 10px 0 var(--plasma-cyan), 10px 10px 0 var(--plasma-cyan),
        4px 11px 0 var(--plasma-cyan), 6px 11px 0 var(--plasma-cyan), 9px 11px 0 var(--plasma-cyan), 11px 11px 0 var(--plasma-cyan),
        4px 12px 0 var(--plasma-cyan), 11px 12px 0 var(--plasma-cyan),
        3px 13px 0 var(--plasma-cyan), 7px 13px 0 var(--plasma-cyan), 12px 13px 0 var(--plasma-cyan),
        3px 14px 0 var(--plasma-cyan), 8px 14px 0 var(--plasma-cyan), 12px 14px 0 var(--plasma-cyan);
    transform: scale(2);
    transform-origin: top left;
    margin-bottom: 2.5rem;
}

/* Broken Monitor */
.icon-monitor {
    box-shadow:
        2px 1px 0 var(--ash-gray), 3px 1px 0 var(--ash-gray), 4px 1px 0 var(--ash-gray), 5px 1px 0 var(--ash-gray), 6px 1px 0 var(--ash-gray), 7px 1px 0 var(--ash-gray), 8px 1px 0 var(--ash-gray), 9px 1px 0 var(--ash-gray), 10px 1px 0 var(--ash-gray), 11px 1px 0 var(--ash-gray), 12px 1px 0 var(--ash-gray), 13px 1px 0 var(--ash-gray),
        2px 2px 0 var(--ash-gray), 3px 2px 0 var(--terminal-green), 4px 2px 0 var(--terminal-green), 5px 2px 0 var(--terminal-green), 6px 2px 0 var(--terminal-green), 7px 2px 0 var(--terminal-green), 8px 2px 0 var(--terminal-green), 9px 2px 0 var(--terminal-green), 10px 2px 0 var(--terminal-green), 11px 2px 0 var(--terminal-green), 12px 2px 0 var(--terminal-green), 13px 2px 0 var(--ash-gray),
        2px 3px 0 var(--ash-gray), 3px 3px 0 var(--terminal-green), 7px 3px 0 var(--static-white), 8px 3px 0 var(--static-white), 12px 3px 0 var(--terminal-green), 13px 3px 0 var(--ash-gray),
        2px 4px 0 var(--ash-gray), 3px 4px 0 var(--terminal-green), 6px 4px 0 var(--static-white), 9px 4px 0 var(--static-white), 12px 4px 0 var(--terminal-green), 13px 4px 0 var(--ash-gray),
        2px 5px 0 var(--ash-gray), 3px 5px 0 var(--terminal-green), 5px 5px 0 var(--static-white), 10px 5px 0 var(--static-white), 12px 5px 0 var(--terminal-green), 13px 5px 0 var(--ash-gray),
        2px 6px 0 var(--ash-gray), 3px 6px 0 var(--terminal-green), 7px 6px 0 var(--static-white), 8px 6px 0 var(--static-white), 12px 6px 0 var(--terminal-green), 13px 6px 0 var(--ash-gray),
        2px 7px 0 var(--ash-gray), 3px 7px 0 var(--terminal-green), 4px 7px 0 var(--terminal-green), 5px 7px 0 var(--terminal-green), 6px 7px 0 var(--terminal-green), 7px 7px 0 var(--terminal-green), 8px 7px 0 var(--terminal-green), 9px 7px 0 var(--terminal-green), 10px 7px 0 var(--terminal-green), 11px 7px 0 var(--terminal-green), 12px 7px 0 var(--terminal-green), 13px 7px 0 var(--ash-gray),
        2px 8px 0 var(--ash-gray), 3px 8px 0 var(--ash-gray), 4px 8px 0 var(--ash-gray), 5px 8px 0 var(--ash-gray), 6px 8px 0 var(--ash-gray), 7px 8px 0 var(--ash-gray), 8px 8px 0 var(--ash-gray), 9px 8px 0 var(--ash-gray), 10px 8px 0 var(--ash-gray), 11px 8px 0 var(--ash-gray), 12px 8px 0 var(--ash-gray), 13px 8px 0 var(--ash-gray),
        6px 9px 0 var(--ash-gray), 7px 9px 0 var(--ash-gray), 8px 9px 0 var(--ash-gray), 9px 9px 0 var(--ash-gray),
        5px 10px 0 var(--ash-gray), 6px 10px 0 var(--ash-gray), 7px 10px 0 var(--ash-gray), 8px 10px 0 var(--ash-gray), 9px 10px 0 var(--ash-gray), 10px 10px 0 var(--ash-gray);
    transform: scale(2);
    transform-origin: top left;
    margin-bottom: 2.5rem;
}

/* Warning Triangle */
.icon-warning {
    box-shadow:
        7px 1px 0 var(--terminal-green), 8px 1px 0 var(--terminal-green),
        6px 2px 0 var(--terminal-green), 9px 2px 0 var(--terminal-green),
        6px 3px 0 var(--terminal-green), 7px 3px 0 var(--reactor-black), 8px 3px 0 var(--reactor-black), 9px 3px 0 var(--terminal-green),
        5px 4px 0 var(--terminal-green), 7px 4px 0 var(--static-white), 8px 4px 0 var(--static-white), 10px 4px 0 var(--terminal-green),
        5px 5px 0 var(--terminal-green), 7px 5px 0 var(--static-white), 8px 5px 0 var(--static-white), 10px 5px 0 var(--terminal-green),
        4px 6px 0 var(--terminal-green), 7px 6px 0 var(--reactor-black), 8px 6px 0 var(--reactor-black), 11px 6px 0 var(--terminal-green),
        4px 7px 0 var(--terminal-green), 11px 7px 0 var(--terminal-green),
        3px 8px 0 var(--terminal-green), 7px 8px 0 var(--static-white), 8px 8px 0 var(--static-white), 12px 8px 0 var(--terminal-green),
        3px 9px 0 var(--terminal-green), 7px 9px 0 var(--reactor-black), 8px 9px 0 var(--reactor-black), 12px 9px 0 var(--terminal-green),
        2px 10px 0 var(--terminal-green), 3px 10px 0 var(--terminal-green), 4px 10px 0 var(--terminal-green), 5px 10px 0 var(--terminal-green), 6px 10px 0 var(--terminal-green), 7px 10px 0 var(--terminal-green), 8px 10px 0 var(--terminal-green), 9px 10px 0 var(--terminal-green), 10px 10px 0 var(--terminal-green), 11px 10px 0 var(--terminal-green), 12px 10px 0 var(--terminal-green), 13px 10px 0 var(--terminal-green);
    transform: scale(2);
    transform-origin: top left;
    margin-bottom: 2.5rem;
}

/* Falling Blocks */
.icon-blocks {
    box-shadow:
        2px 1px 0 var(--meltdown-red), 3px 1px 0 var(--meltdown-red),
        2px 2px 0 var(--meltdown-red), 3px 2px 0 var(--meltdown-red),
        6px 2px 0 var(--plasma-cyan), 7px 2px 0 var(--plasma-cyan),
        6px 3px 0 var(--plasma-cyan), 7px 3px 0 var(--plasma-cyan),
        10px 1px 0 var(--terminal-green), 11px 1px 0 var(--terminal-green),
        10px 2px 0 var(--terminal-green), 11px 2px 0 var(--terminal-green),
        4px 5px 0 var(--meltdown-red), 5px 5px 0 var(--meltdown-red),
        4px 6px 0 var(--meltdown-red), 5px 6px 0 var(--meltdown-red),
        8px 4px 0 var(--plasma-cyan), 9px 4px 0 var(--plasma-cyan),
        8px 5px 0 var(--plasma-cyan), 9px 5px 0 var(--plasma-cyan),
        1px 7px 0 var(--terminal-green), 2px 7px 0 var(--terminal-green),
        1px 8px 0 var(--terminal-green), 2px 8px 0 var(--terminal-green),
        12px 6px 0 var(--meltdown-red), 13px 6px 0 var(--meltdown-red),
        12px 7px 0 var(--meltdown-red), 13px 7px 0 var(--meltdown-red),
        6px 8px 0 var(--plasma-cyan), 7px 8px 0 var(--plasma-cyan),
        6px 9px 0 var(--plasma-cyan), 7px 9px 0 var(--plasma-cyan),
        10px 9px 0 var(--terminal-green), 11px 9px 0 var(--terminal-green),
        10px 10px 0 var(--terminal-green), 11px 10px 0 var(--terminal-green),
        3px 10px 0 var(--meltdown-red), 4px 10px 0 var(--meltdown-red),
        3px 11px 0 var(--meltdown-red), 4px 11px 0 var(--meltdown-red);
    transform: scale(2);
    transform-origin: top left;
    margin-bottom: 2.5rem;
}

.card-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--static-white);
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow:
        2px 0 var(--plasma-cyan),
        -2px 0 var(--meltdown-red);
}

.card-body {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: var(--ash-gray);
}

/* ====================== */
/* ACT 3 - CRITICAL MASS  */
/* ====================== */
#act-critical {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 60% 40%, var(--meltdown-red), var(--reactor-purple), var(--reactor-black) 70%);
    position: relative;
    overflow: hidden;
}

.reactor-chamber {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reactor-statement {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(4rem, 10vw, 8rem);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--reactor-black);
    text-shadow:
        0 0 20px var(--meltdown-red),
        0 0 40px var(--meltdown-red),
        0 0 80px rgba(255, 0, 60, 0.5);
    text-align: center;
    line-height: 1.1;
    padding: clamp(2rem, 5vw, 6rem);
    max-width: 90%;
    z-index: 2;
}

/* Falling pixel debris */
.pixel-debris {
    position: absolute;
    width: 8px;
    height: 8px;
    z-index: 1;
}

@keyframes debrisFall {
    0% { transform: translateY(-100px); opacity: 1; }
    100% { transform: translateY(calc(100vh + 100px)); opacity: 0.3; }
}


.debris-1 { background: var(--meltdown-red); left: 5%; animation: debrisFall 7s linear infinite; animation-delay: 0s; }
.debris-2 { background: var(--plasma-cyan); left: 12%; animation: debrisFall 5s linear infinite; animation-delay: 1.2s; }
.debris-3 { background: var(--terminal-green); left: 20%; animation: debrisFall 9s linear infinite; animation-delay: 0.5s; }
.debris-4 { background: var(--meltdown-red); left: 28%; animation: debrisFall 6s linear infinite; animation-delay: 2.1s; }
.debris-5 { background: var(--plasma-cyan); left: 35%; animation: debrisFall 8s linear infinite; animation-delay: 0.8s; }
.debris-6 { background: var(--terminal-green); left: 42%; animation: debrisFall 4s linear infinite; animation-delay: 3.5s; }
.debris-7 { background: var(--meltdown-red); left: 48%; animation: debrisFall 10s linear infinite; animation-delay: 1.5s; }
.debris-8 { background: var(--plasma-cyan); left: 55%; animation: debrisFall 6.5s linear infinite; animation-delay: 0.3s; }
.debris-9 { background: var(--terminal-green); left: 62%; animation: debrisFall 7.5s linear infinite; animation-delay: 2.8s; }
.debris-10 { background: var(--meltdown-red); left: 68%; animation: debrisFall 5.5s linear infinite; animation-delay: 1.8s; }
.debris-11 { background: var(--plasma-cyan); left: 75%; animation: debrisFall 9.5s linear infinite; animation-delay: 0.7s; }
.debris-12 { background: var(--terminal-green); left: 82%; animation: debrisFall 4.5s linear infinite; animation-delay: 3.2s; }
.debris-13 { background: var(--meltdown-red); left: 88%; animation: debrisFall 8.5s linear infinite; animation-delay: 1.1s; }
.debris-14 { background: var(--plasma-cyan); left: 93%; animation: debrisFall 6s linear infinite; animation-delay: 2.4s; }
.debris-15 { background: var(--terminal-green); left: 97%; animation: debrisFall 7s linear infinite; animation-delay: 0.6s; }
.debris-16 { background: var(--meltdown-red); left: 8%; animation: debrisFall 11s linear infinite; animation-delay: 4.1s; }
.debris-17 { background: var(--plasma-cyan); left: 16%; animation: debrisFall 3.5s linear infinite; animation-delay: 0.2s; }
.debris-18 { background: var(--terminal-green); left: 25%; animation: debrisFall 12s linear infinite; animation-delay: 5.0s; }
.debris-19 { background: var(--meltdown-red); left: 33%; animation: debrisFall 4s linear infinite; animation-delay: 1.7s; }
.debris-20 { background: var(--plasma-cyan); left: 40%; animation: debrisFall 8s linear infinite; animation-delay: 3.3s; }
.debris-21 { background: var(--terminal-green); left: 50%; animation: debrisFall 5s linear infinite; animation-delay: 0.9s; }
.debris-22 { background: var(--meltdown-red); left: 58%; animation: debrisFall 10.5s linear infinite; animation-delay: 2.6s; }
.debris-23 { background: var(--plasma-cyan); left: 65%; animation: debrisFall 6.5s linear infinite; animation-delay: 1.4s; }
.debris-24 { background: var(--terminal-green); left: 78%; animation: debrisFall 9s linear infinite; animation-delay: 3.8s; }
.debris-25 { background: var(--meltdown-red); left: 85%; animation: debrisFall 7.5s linear infinite; animation-delay: 0.4s; }

/* ====================== */
/* ACT 4 - COLLAPSE       */
/* ====================== */
#act-collapse {
    min-height: 50vh;
    background: var(--reactor-black);
    position: relative;
    overflow: hidden;
}

#act-collapse::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 0, 60, 0.05) 0px,
        rgba(255, 0, 60, 0.05) 1px,
        transparent 1px,
        transparent 8px
    ),
    repeating-linear-gradient(
        90deg,
        rgba(255, 0, 60, 0.05) 0px,
        rgba(255, 0, 60, 0.05) 1px,
        transparent 1px,
        transparent 8px
    );
    z-index: 1;
}

.collapse-zone {
    position: relative;
    width: 100%;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.fracture-shard {
    position: absolute;
    background: var(--whiteout);
    opacity: 0;
    animation: fractureReveal 4s ease-in-out infinite;
}

@keyframes fractureReveal {
    0%, 40% { opacity: 0; }
    50% { opacity: 0.8; }
    60%, 100% { opacity: 0; }
}

.shard-1 { width: 120px; height: 80px; top: 10%; left: 5%; clip-path: polygon(0 0, 100% 20%, 80% 100%, 10% 80%); animation-delay: 0s; }
.shard-2 { width: 90px; height: 60px; top: 60%; left: 15%; clip-path: polygon(20% 0, 100% 0, 80% 100%, 0 80%); animation-delay: 0.5s; }
.shard-3 { width: 150px; height: 100px; top: 20%; right: 10%; clip-path: polygon(0 20%, 100% 0, 100% 80%, 20% 100%); animation-delay: 1s; }
.shard-4 { width: 80px; height: 120px; top: 50%; right: 25%; clip-path: polygon(10% 0, 90% 10%, 100% 100%, 0 90%); animation-delay: 1.5s; }
.shard-5 { width: 100px; height: 70px; top: 30%; left: 40%; clip-path: polygon(0 0, 100% 10%, 90% 100%, 10% 90%); animation-delay: 2s; }
.shard-6 { width: 130px; height: 90px; top: 70%; right: 40%; clip-path: polygon(20% 0, 100% 20%, 80% 100%, 0 80%); animation-delay: 2.5s; }
.shard-7 { width: 70px; height: 110px; top: 5%; left: 60%; clip-path: polygon(0 10%, 100% 0, 90% 100%, 10% 90%); animation-delay: 3s; }
.shard-8 { width: 110px; height: 80px; top: 80%; left: 70%; clip-path: polygon(10% 0, 100% 10%, 90% 100%, 0 80%); animation-delay: 3.5s; }

.collapse-log {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: var(--meltdown-red);
    text-align: center;
    z-index: 3;
    text-shadow:
        2px 0 var(--plasma-cyan),
        -2px 0 var(--meltdown-red);
    animation: textGlitch 0.5s steps(3) infinite;
}

@keyframes textGlitch {
    0% { transform: translate(0, 0); }
    33% { transform: translate(-2px, 1px); }
    66% { transform: translate(2px, -1px); }
    100% { transform: translate(0, 0); }
}

/* ====================== */
/* ACT 5 - AFTERMATH      */
/* ====================== */
#act-aftermath {
    min-height: 100vh;
    background: var(--whiteout);
    display: flex;
    align-items: center;
    justify-content: center;
}

.aftermath-content {
    text-align: center;
    padding: clamp(2rem, 5vw, 6rem);
}

.aftermath-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3.5rem, 9vw, 7rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--reactor-black);
    line-height: 0.9;
    margin-bottom: 2rem;
}

.aftermath-body {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: var(--dark-gray);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.aftermath-pixel-text {
    font-family: 'Silkscreen', cursive;
    font-size: 12px;
    color: var(--neutral-dark);
    letter-spacing: 0.05em;
}

/* ====================== */
/* RESPONSIVE             */
/* ====================== */
@media (max-width: 768px) {
    .broken-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .card-1, .card-2, .card-3, .card-4, .card-5, .card-6 {
        grid-column: 1 / -1;
        transform: none;
        margin-top: 0;
    }

    .card-1.visible, .card-2.visible, .card-3.visible,
    .card-4.visible, .card-5.visible, .card-6.visible {
        transform: scaleY(1);
    }

    .pixel-title {
        gap: 0.1rem;
    }

    .reactor-statement {
        letter-spacing: 0.1em;
        padding: 2rem;
    }
}

/* Progress bar color transitions */
body.progress-25 #meltdown-progress-bar::after { background: var(--terminal-green); }
body.progress-50 #meltdown-progress-bar::after { background: var(--plasma-cyan); }
body.progress-75 #meltdown-progress-bar::after { background: var(--meltdown-red); }
body.progress-100 #meltdown-progress-bar::after { background: var(--reactor-purple); animation: progressPulse 1s ease-in-out infinite; }

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

/* Glitch intensification in Act 3 */
#act-critical {
    animation: macroGlitchFast 3s infinite;
}

/* Card glitch-in animation */
@keyframes cardGlitchIn {
    0% { transform: scaleY(0.01); opacity: 0; }
    50% { transform: scaleY(0.5); opacity: 0.5; }
    100% { transform: scaleY(1); opacity: 1; }
}
