﻿/* ========================================
   GLOBAL RESET & LAYOUT
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Courier New', monospace, sans-serif;
    background: #000;
    color: #0f0;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.5;
}

/* ========================================
   CRT EFFECT CONTAINER
   ======================================== */
#crt {
    flex: 1;
    position: relative;
    background: #111;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

    /* Scanlines */
    #crt::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        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: 100;
    }

    /* CRT Glow */
    #crt::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(circle at center, transparent 0%, rgba(0, 255, 0, 0.05) 100%);
        pointer-events: none;
        animation: flicker 3s infinite alternate;
        z-index: 99;
    }

@keyframes flicker {
    0%, 100% {
        opacity: 0.98;
    }

    50% {
        opacity: 0.94;
    }
}

/* ========================================
   MAIN CONTAINER
   ======================================== */
.container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ========================================
   HEADER
   ======================================== */
header {
    text-align: center;
    margin: 2rem 0 3rem;
    margin-bottom: 1.5rem; /* Reduced from ~3rem */
}

h1 {
    font-size: 2.3rem;
    color: #0f0;
    text-shadow: 0 0 12px #0f0, 0 0 20px #0f0;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.glitch {
    font-size: 1.3rem;
    color: #0ff;
    animation: glitch 2.5s infinite;
    font-weight: bold;
}

@keyframes glitch {
    0%, 100% {
        text-shadow: 2px 0 #f0f, -2px 0 #0ff;
        clip-path: inset(0 0 0 0);
    }

    20% {
        clip-path: inset(90% 0 0 0);
    }

    40% {
        clip-path: inset(0 0 90% 0);
    }

    60% {
        clip-path: inset(10% 0 80% 0);
    }
}

/* ========================================
   SECTIONS
   ======================================== */
section {
    margin: 2.5rem 0;
    padding: 2rem;
    background: rgba(0, 20, 0, 0.35);
    border: 1px solid #0f0;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.15);
    backdrop-filter: blur(2px);
}

h2 {
    color: #0ff;
    margin-bottom: 1.3rem;
    text-align: center;
    font-size: 1.6rem;
    text-shadow: 0 0 10px #0ff;
    letter-spacing: 1px;
}

/* ========================================
   SVG CONTAINER
   ======================================== */
.svg-container {
    width: 100%;
    max-width: 320px;
    height: 480px;
    margin: 1.5rem auto;
    border: 2px solid #0f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 20px #0f0, 0 0 40px rgba(0, 255, 0, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.5);
    background: #001;
    transition: all 0.3s ease;
    position: relative;
}

    .svg-container svg {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }

    .svg-container:hover {
        transform: scale(1.02);
        box-shadow: 0 0 30px #0f0, 0 0 60px rgba(0, 255, 0, 0.4);
    }

/* ========================================
   PUZZLE GRID
   ======================================== */
#tile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    max-width: 520px;
    margin: 2rem auto;
    padding: 0 10px;
}

.tile {
    width: 100%;
    aspect-ratio: 1;
    background: #001a00;
    border: 2px dashed #0f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.9rem;
    color: #0ff;
    cursor: grab;
    user-select: none;
    transition: all 0.25s ease;
    box-shadow: 0 0 12px rgba(0, 255, 0, 0.3);
    text-shadow: 0 0 8px #0ff;
    position: relative;
}

    .tile:active {
        cursor: grabbing;
        transform: scale(0.92);
        box-shadow: 0 0 20px #0f0;
    }

    .tile:hover {
        background: #003300;
        border-style: solid;
        box-shadow: 0 0 20px #0f0, 0 0 30px rgba(0, 255, 0, 0.4);
        transform: translateY(-3px);
    }

/* SVG inside tile */
.svg-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

    .svg-icon svg {
        width: 100%;
        height: 100%;
        filter: drop-shadow(0 0 3px rgba(0, 255, 0, 0.4));
        transition: filter 0.3s ease;
    }

.tile:hover .svg-icon svg {
    filter: drop-shadow(0 0 12px #0f0);
}

.tile-number {
    font-size: 10px;
    color: #666;
    font-weight: bold;
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
}

.tile.dragging {
    opacity: 0.5;
    transform: scale(0.9);
    z-index: 1000;
}

/* ========================================
   BUTTONS
   ======================================== */
button {
    background: #001;
    color: #0f0;
    border: 1px solid #0f0;
    padding: 1rem 2rem;
    margin: 0.7rem;
    font-family: inherit;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 0 15px #0f0;
    transition: all 0.3s ease;
    min-width: 180px;
}

    button:hover {
        background: #003300;
        transform: translateY(-3px);
        box-shadow: 0 0 25px #0f0, 0 5px 15px rgba(0, 255, 0, 0.3);
    }

    button:active {
        transform: translateY(1px);
    }

/* ========================================
   FOOTER
   ======================================== */
footer {
    background: rgba(0, 20, 0, 0.8);
    color: #0aa;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
    border-top: 1px solid #0f0;
    margin-top: auto;
    z-index: 10;
    backdrop-filter: blur(3px);
}

    footer p {
        margin: 0.4rem 0;
    }

    footer a {
        color: #0ff;
        text-decoration: none;
        font-weight: bold;
    }

        footer a:hover {
            text-decoration: underline;
            color: #0ff;
            text-shadow: 0 0 8px #0ff;
        }

/* ========================================
   UTILITY
   ======================================== */
.hidden {
    display: none;
}

#hint {
    color: #ff0;
    font-style: italic;
    text-align: center;
    margin-top: 1.2rem;
    font-size: 1.1rem;
    text-shadow: 0 0 10px #ff0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.tweet {
    font-style: italic;
    color: #0ff;
    text-align: center;
    margin: 1.3rem 0;
    font-size: 1.1rem;
    text-shadow: 0 0 8px #0ff;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    h1 {
        font-size: 1.9rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .svg-container {
        width: 260px;
        height: 390px;
    }

    #tile-grid {
        gap: 10px;
        max-width: 400px;
    }

    .tile {
        font-size: 1.6rem;
    }

    button {
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.6rem;
    }

    .svg-container {
        width: 220px;
        height: 330px;
    }

    #tile-grid {
        gap: 8px;
        max-width: 320px;
    }

    .tile {
        font-size: 1.4rem;
    }

    button {
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
    }

    footer {
        font-size: 0.8rem;
        padding: 1rem;
    }
}
/* === FACTORY LORE === */
.factory-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: rgba(0, 20, 0, 0.3);
    border: 1px solid #0f0;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    text-align: center;
}

.factory-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    border: 2px solid #0f0;
    border-radius: 10px;
    box-shadow: 0 0 20px #0f0;
    margin: 1rem 0;
    filter: brightness(0.8) contrast(1.2);
}

.lore-text {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #0f0;
}

    .lore-text p {
        margin: 0.8rem 0;
    }

.glitch-text {
    font-weight: bold;
    color: #0ff;
    animation: glitch 2s infinite;
    font-size: 1.2rem;
}
.lore-btn {
    background: #100;
    color: #0f0;
    border: 1px solid #0f0;
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 6px;
    box-shadow: 0 0 12px #0f0;
    transition: all 0.3s ease;
}

    .lore-btn:hover:not(:disabled) {
        background: #003300;
        box-shadow: 0 0 20px #0f0;
    }

    .lore-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* FACTORY IMAGE */
.factory-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    border: 2px solid #0f0;
    border-radius: 10px;
    box-shadow: 0 0 20px #0f0;
    margin: 1rem 0;
}


.factory-image {
    width: 100%;
    max-width: 400px; /* 50% of original ~800px */
    height: auto;
    border: 2px solid #0f0;
    border-radius: 10px;
    box-shadow: 0 0 20px #0f0;
    margin: 1rem auto;
    display: block;
    filter: brightness(0.8) contrast(1.2);
}
.vault-image {
    width: 100%;
    max-width: 200px; /* 90% smaller than ~800px → ~80px */
    height: auto;
    border: 1px solid #0f0;
    border-radius: 6px;
    box-shadow: 0 0 12px #0f0;
    margin: 0.8rem auto;
    display: block;
    filter: brightness(0.9) contrast(1.2);
    transition: all 0.3s ease;
}

    .vault-image:hover {
        box-shadow: 0 0 20px #0f0;
        transform: scale(1.05);
    }
@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 40px #f00;
    }

    50% {
        box-shadow: 0 0 60px #f00, 0 0 80px rgba(255, 0, 0, 0.5);
    }
}
.back-link {
    display: block;
    text-align: center;
    margin: 3rem 0;
    font-size: 1.1rem;
}
.elliot-image {
    width: 100%;
    max-width: 200px; /* 50% of 400px */
    height: auto;
    border: 2px solid #0f0;
    border-radius: 12px;
    box-shadow: 0 0 25px #0f0;
    filter: brightness(0.9) contrast(1.3);
    transition: all 0.3s ease;
}

    .elliot-image:hover {
        box-shadow: 0 0 35px #0f0, 0 0 50px rgba(0, 255, 0, 0.3);
        transform: scale(1.02);
    }
/* === PHASE 2 STYLES === */
.phase2-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.phase2-title {
    color: #0ff;
    text-shadow: 0 0 15px #0ff;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
}

.phase2-text {
    line-height: 1.8;
    margin: 1.5rem 0;
    text-align: center;
    font-size: 1.1rem;
}

.clawed-image {
    width: 100%;
    max-width: 300px; /* 50% smaller */
    height: auto;
    border: 2px solid #0f0;
    border-radius: 12px;
    box-shadow: 0 0 25px #0f0;
    filter: brightness(0.9) contrast(1.3);
    display: block;
    margin: 2rem auto;
}

.back-link {
    display: block;
    text-align: center;
    margin: 3rem 0;
    color: #0ff;
    text-decoration: underline;
    font-size: 1.1rem;
}

    .back-link:hover {
        color: #0f0;
        text-shadow: 0 0 12px #0f0;
    }

/* === PHASE 2 TEXT WRAP AROUND IMAGE === */
.clawed-image2 {
    width: 100%;
    max-width: 225px; /* 25% smaller */
    height: auto;
    border: 2px solid #0f0;
    border-radius: 12px;
    box-shadow: 0 0 25px #0f0;
    filter: brightness(0.9) contrast(1.3);
    float: left;
    margin: 1rem 1.5rem 1rem 0;
    shape-outside: margin-box;
}

.phase2-text-wrap {
    overflow: hidden;
    line-height: 1.8;
    margin: 1rem 0;
    text-align: left;
}

@media (max-width: 600px) {
    .clawed-image2 {
        float: none;
        display: block;
        margin: 1rem auto;
        max-width: 200px;
    }

    .phase2-text-wrap {
        text-align: center;
    }
}

/* ENSURE SCROLLING */
html, body {
    height: auto !important;
    min-height: 100vh;
    overflow-y: auto !important;
}

#crt {
    min-height: 100vh;
    overflow-y: visible;
}

