body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #050505;
}

#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 30000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    pointer-events: all;
}

#intro-image {
    max-width: 80%;
    max-height: 80%;
    opacity: 0;
    filter: brightness(1.2) contrast(1.1);
}

#intro-video {
    display: none;
}

#dialogue-container {
    position: fixed;
    left: 50%;
    bottom: 8%;
    transform: translateX(-50%);
    width: 52%;
    max-width: 500px;

    color: #e6e6e6;
    font-family: Palatino, "Book Antiqua", Georgia, serif;
    font-size: 1.35em;
    line-height: 1.55;

    pointer-events: none;
    z-index: 40000;
    display: none;

    letter-spacing: 0.015em;
    font-weight: 400;

    /* SH2-style soft glow + depth */
    text-shadow:
        0 0 6px rgba(0, 0, 0, 0.9),
        1px 1px 2px rgba(0, 0, 0, 0.9),
        0 0 14px rgba(255, 255, 255, 0.08);
}


#dialogue-text {
    display: inline;
}

#continue-prompt {
    display: block;
    font-size: 0.4em;
    margin-top: 15px;
    opacity: 0;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-align: right;
    color: rgba(255, 255, 255, 0.4);
    font-family: Garamond, serif;
    text-shadow: 2px 2px 2px #000;
    -webkit-text-fill-color: #fff; /* Reset for non-clipped text */
}

/* CRT Menu Styling */
#crt-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 150, 0.9); /* Classic blue CRT background */
    z-index: 1000;
    display: none;
    flex-direction: column;
    padding: 40px;
    box-sizing: border-box;
    color: #fff;
    font-family: 'VCR', 'Courier New', Courier, monospace;
    text-transform: uppercase;
}

.crt-header {
    font-size: 2.5em;
    border-bottom: 4px solid #fff;
    margin-bottom: 30px;
    padding-bottom: 10px;
    letter-spacing: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crt-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
    scrollbar-width: none;
}

.crt-list::-webkit-scrollbar {
    display: none;
}

.crt-item {
    font-size: 1.4em;
    margin-bottom: 15px;
    padding: 10px;
    display: flex;
    gap: 20px;
    border: 2px solid transparent;
    animation: crt-text-glow 2s infinite alternate;
}

.crt-time {
    color: #ffff00;
    min-width: 120px;
}

.crt-track {
    color: #fff;
}

@keyframes crt-text-glow {
    from { text-shadow: 0 0 5px rgba(255,255,255,0.5); }
    to { text-shadow: 0 0 15px rgba(255,255,255,0.8); }
}

.tv-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* This creates the "CRT Glass" look with a heavy vignette and a slight reflection */
    background: radial-gradient(
        circle at 30% 20%, 
        rgba(255, 255, 255, 0.04) 0%, 
        transparent 60%
    );
    border-radius: 80px;
    /* Heavy vignette for the tube corners and deepening effect */
    box-shadow: inset 0 0 100px 30px rgba(0, 0, 0, 0.9);
    z-index: 20000;
}
#three-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    filter:
      contrast(1.3)
      brightness(0.9)
      saturate(1.9)
      sepia(0.2)
      blur(0.3px);

}
#css-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.dg.ac {
    z-index: 10001 !important;
}

#css-container > div {
    pointer-events: auto;
}
#noise-overlay {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 10000;
  opacity: 0.3;

  background-image: url("data:image/svg+xml,<svg viewBox='0 0 128 128' xmlns='http://www.w3.org/2000/svg'><filter id='noiseFilter'><feTurbulence type='fractalNoise' baseFrequency='0.99' numOctaves='2'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23noiseFilter)'/></svg>");
  
  background-size: 64px 64px;
  animation: grain 0.3s steps(12) infinite;
  mix-blend-mode: hard-light;
}


@keyframes grain {
    0%, 100% { transform:translate(0, 0); }
    10% { transform:translate(-5%, -10%); }
    20% { transform:translate(-15%, 5%); }
    30% { transform:translate(7%, -25%); }
    40% { transform:translate(-5%, 25%); }
    50% { transform:translate(-15%, 10%); }
    60% { transform:translate(15%, 0%); }
    70% { transform:translate(0%, 15%); }
    80% { transform:translate(3%, 35%); }
    90% { transform:translate(-10%, 10%); }
}

#tv-content-wrapper {
    width: 800px; 
    height: 600px;
    background: #0b0b0b;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    /* border: 0; */
    /* border-radius: 60px; */
    border: 15px solid #050505;
    box-sizing: border-box;
    box-shadow: inset 0 0 40px rgba(0,0,0,1);
    mask-image: radial-gradient(white, black);
}

.tv-container {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    width: 800px !important; /* Smaller resolution */
    height: 600px !important;
    transform-origin: center;
    background-color: #000 !important;
    border-radius: 50px !important;
    box-sizing: border-box;
    box-shadow: inset 0 0 100px rgba(0,0,0,1);
    
    overflow: hidden  !important;
    outline: 1px solid transparent; 
    transform-style: preserve-3d !important; 
    backface-visibility: hidden !important;
    will-change: transform;
    transform: translateZ(0);
}

@keyframes crt-flicker {
    0% { 
        filter: brightness(1) contrast(1) blur(0.2px);
        box-shadow: 
            inset 0 0 80px 20px rgba(0, 0, 0, 1),
            0 0 30px rgba(200, 230, 255, 0.06),
            0 0 80px rgba(200, 230, 255, 0.03);
    }
    15% { 
        filter: brightness(1.02) contrast(1.03) blur(0.3px);
        box-shadow: 
            inset 0 0 80px 20px rgba(0, 0, 0, 1),
            0 0 50px rgba(200, 230, 255, 0.1),
            0 0 120px rgba(200, 230, 255, 0.05);
    }
    30% { 
        filter: brightness(0.98) contrast(0.97) blur(0.2px);
        box-shadow: 
            inset 0 0 80px 20px rgba(0, 0, 0, 1),
            0 0 25px rgba(200, 230, 255, 0.04),
            0 0 60px rgba(200, 230, 255, 0.02);
    }
    45% { 
        filter: brightness(1.04) contrast(1.08) blur(0.4px);
        box-shadow: 
            inset 0 0 80px 20px rgba(0, 0, 0, 1),
            0 0 60px rgba(200, 230, 255, 0.12),
            0 0 150px rgba(200, 230, 255, 0.06);
    }
    60% { 
        filter: brightness(0.96) contrast(0.92) blur(0.2px);
        box-shadow: 
            inset 0 0 80px 20px rgba(0, 0, 0, 1),
            0 0 20px rgba(200, 230, 255, 0.03),
            0 0 50px rgba(200, 230, 255, 0.01);
    }
    85% { 
        filter: brightness(1.01) contrast(1.02) blur(0.3px);
        box-shadow: 
            inset 0 0 80px 20px rgba(0, 0, 0, 1),
            0 0 40px rgba(200, 230, 255, 0.08),
            0 0 100px rgba(200, 230, 255, 0.04);
    }
    100% { 
        filter: brightness(1) contrast(1) blur(0.2px);
        box-shadow: 
            inset 0 0 80px 20px rgba(0, 0, 0, 1),
            0 0 30px rgba(200, 230, 255, 0.06),
            0 0 80px rgba(200, 230, 255, 0.03);
    }
}

/* Overriding fixed positions for 3D projection */
.lines, .noise, #screen, .screen-container {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
}

.main {
    position: absolute !important;
    top: 10% !important;
    left: 5% !important;
    width: 90% !important;
    height: 80% !important;
}

/* Scale down the logo and buttons further */
.center-container img {
    max-width: 60% !important;
}
#audio-button {
    width: 60px !important;
    height: 60px !important;
}
.vhs {
    font-size: 0.8em !important;
}

#slideout, #slideout-hotspot, footer {
    display: none !important; /* Hide these in 3D view */
}

.lines, 
.noise, 
.screen-container, 
.screen-wrapper, 
#screen, 
.image,
.video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 100px !important;
    overflow: hidden !important;
    background-color: transparent !important;
    backface-visibility: hidden !important;
    will-change: opacity;
}

.image, .video {
    object-fit: cover;
    display: block !important;
    transform: translateZ(0.1px);
    -webkit-transform: translateZ(0.1px);
}

.lines::before {
    border-radius: 100px !important;
}
.dg.main {
    opacity: 0.8; /* Slight overall transparency */
}
.dg li:not(.folder) {
    background: rgba(0, 0, 0, 0.3) !important; /* Transparent rows */
}
.dg .cr.number, .dg .cr.string, .dg .cr.function, .dg .cr.boolean {
    background: transparent !important;
}
#vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999; /* Below the noise, above everything else */
    background: radial-gradient(circle, transparent 90%, rgba(0,0,0,0.9) 100%);
}

