@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
    --bg: #0d020d;
    --cyan: #00ffff;
    --magenta: #ff00ff;
    --green: #00ff41;
    --red: #ff4141;
    --yellow: #ffff00;
    --font: 'VT323', monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: var(--cyan);
    font: 1.3rem/1.6 var(--font);
    background: var(--bg);
    text-shadow: 0 0 5px var(--cyan);
    background-image:
        linear-gradient(rgba(255, 0, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 255, 0.07) 1px, transparent 1px);
    background-size: 25px 25px;
    animation: scroll-background 30s linear infinite;
}

@keyframes scroll-background {
    to { background-position: 500px 500px; }
}

.logo-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999;
}

.glitch-logo {
    --logo-image: url('../images/webp/nyxbrkrlabs.webp');
    position: relative;
    display: inline-block;
    width: 120px;
}

.glitch-logo img {
    width: 100%;
    height: auto;
    display: block;
}

.glitch-logo::before,
.glitch-logo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--logo-image);
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    pointer-events: none;
}

.glitch-logo.glitch::before {
    animation: glitchTop .3s linear;
    opacity: .6;
}

.glitch-logo.glitch::after {
    animation: glitchBottom .3s linear;
    opacity: .4;
}

@keyframes glitchTop {
    0% { transform: translate(0); clip-path: inset(0 0 85% 0); }
    10% { transform: translate(-8px, -4px); }
    20% { transform: translate(6px, 3px); }
    30% { transform: translate(-5px, 2px); }
    40% { transform: translate(3px, -5px); }
    50% { transform: translate(-6px, 4px); }
    60% { transform: translate(5px, -3px); }
    100% { transform: translate(0); }
}

@keyframes glitchBottom {
    0% { transform: translate(0); clip-path: inset(85% 0 0 0); }
    10% { transform: translate(7px, 3px); }
    20% { transform: translate(-4px, -2px); }
    30% { transform: translate(5px, -6px); }
    40% { transform: translate(-7px, 2px); }
    50% { transform: translate(6px, -4px); }
    100% { transform: translate(0); }
}

.error-header {
    text-align: center;
    color: var(--red);
    text-shadow: 0 0 8px var(--red);
    flex-shrink: 0;
}

.error-header h1 {
    font-size: 5rem;
    margin: 0;
    letter-spacing: 5px;
}

.error-header p {
    margin: 0;
    font-size: 1.5rem;
    color: var(--yellow);
    text-shadow: 0 0 5px var(--yellow);
}

#game-wrapper {
    width: 95%;
    max-width: 1600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    min-height: 0;
    position: relative;
}

#game-container {
    border: 2px solid var(--magenta);
    padding: 15px;
    background: linear-gradient(rgba(10, 10, 10, 0.95), rgba(10, 10, 10, 0.95));
    box-shadow: 0 0 20px var(--magenta), inset 0 0 15px rgba(255, 0, 255, 0.3);
}

#hud {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px 10px;
    font-size: 1.1rem;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--green);
}

#hud span {
    display: inline-block;
    white-space: pre;
    color: var(--green);
    text-shadow: 0 0 5px var(--green);
}

/* Raycaster Styles */
#raycaster-view {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: pixelated;
    background: #000;
}

#game-canvas {
    width: 100%;
    display: block;
    height: auto;
    background: #1a1a1a;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#instructions {
    padding-top: 10px;
    text-align: center;
    color: var(--magenta);
    text-shadow: 0 0 5px var(--magenta);
    font-size: 1rem;
    flex-shrink: 0;
}

#touch-controls {
    position: fixed;
    bottom: 5vh;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10vw;
    z-index: 1000;
    pointer-events: none;
}

.touch-button {
    width: 62px;
    height: 62px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 12px;
    color: rgba(0, 255, 255, 0.7);
    background: rgba(13, 2, 13, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 1.5rem;
    user-select: none;
    pointer-events: auto;
    transition: transform 0.05s ease, background 0.1s ease, box-shadow 0.1s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

#touch-shoot {
    width: 90px;
    height: 90px;
    margin-left: auto;
    margin-right: -15px;
    border-color: rgba(0, 255, 65, 0.5);
    border-radius: 50%;
    color: rgba(0, 255, 65, 0.7);
    background: rgba(0, 255, 65, 0.05);
    font-size: 3rem;
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.15);
}

.touch-button:active {
    background-color: rgba(0, 255, 255, 0.3);
    transform: scale(0.85);
    box-shadow: 0 0 30px var(--cyan);
    border-color: var(--cyan);
    color: #fff;
}

#touch-shoot:active {
    background-color: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 40px var(--green);
    border-color: var(--green);
}

#touch-dpad {
    display: grid;
    grid-template-areas:
        ". up ."
        "left . right"
        ". down .";
    gap: 12px;
}

#touch-jump {
    grid-area: up;
}

#touch-down {
    grid-area: down;
}

#touch-left {
    grid-area: left;
}

#touch-right {
    grid-area: right;
}

@media (hover: hover) and (pointer: fine) {

    #touch-controls,
    #instructions {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    body {
        padding: 5px;
        justify-content: flex-start;
    }

    .error-header {
        margin-bottom: 5px;
    }

    .error-header h1 {
        font-size: 1.5rem;
        letter-spacing: normal;
    }

    .error-header p {
        font-size: 0.8rem;
        margin-top: -5px;
    }

    .logo-container {
        width: 60px;
        top: 5px;
        left: 5px;
    }

    #game-wrapper {
        width: 100%;
    }

    #hud {
        font-size: 0.9rem;
    }

    .touch-button {
        width: 58px;
        height: 58px;
        font-size: 1.4rem;
    }

    #touch-shoot {
        width: 78px;
        height: 78px;
    }

    #touch-controls {
        bottom: 10px;
        padding: 0 10px;
    }

    #touch-dpad {
        gap: 5px;
    }
}

#game-over-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 2000;
}

#game-over-title {
    font-size: 3rem;
    margin: 0;
    text-shadow: 0 0 10px red;
}

#final-score {
    font-size: 1.5rem;
    margin: 10px 0 20px 0;
}

#retry-button {
    font-family: 'VT323', monospace;
    font-size: 1.5rem;
    padding: 10px 20px;
    background-color: #1a1a1a;
    border: 2px solid #00ffff;
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
    cursor: pointer;
}

#retry-button:hover {
    background-color: #00ffff;
    color: #050505;
    text-shadow: none;
}

.hidden {
    display: none !important;
}


@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

/* All CSS is the same as the previous version */

body {
    background-color: #050505;
    color: #00ffff;
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-shadow: 0 0 5px #00ffff
}

.logo-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999
}

.glitch-logo {
    --logo-image: url('../images/webp/nyxbrkrlabs.webp');
    position: relative;
    display: inline-block;
    width: 120px;
    height: auto
}

.glitch-logo img {
    width: 100%;
    height: auto;
    display: block
}

.glitch-logo::before,
.glitch-logo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--logo-image);
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    pointer-events: none
}

.glitch-logo.glitch::before {
    animation: glitchTop .3s linear;
    opacity: .6
}

.glitch-logo.glitch::after {
    animation: glitchBottom .3s linear;
    opacity: .4
}

@keyframes glitchTop {
    0% {
        transform: translate(0, 0);
        clip-path: inset(0 0 85% 0)
    }

    10% {
        transform: translate(-8px, -4px)
    }

    20% {
        transform: translate(6px, 3px)
    }

    30% {
        transform: translate(-5px, 2px)
    }

    40% {
        transform: translate(3px, -5px)
    }

    50% {
        transform: translate(-6px, 4px)
    }

    60% {
        transform: translate(5px, -3px)
    }

    100% {
        transform: translate(0, 0)
    }
}

@keyframes glitchBottom {
    0% {
        transform: translate(0, 0);
        clip-path: inset(85% 0 0 0)
    }

    10% {
        transform: translate(7px, 3px)
    }

    20% {
        transform: translate(-4px, -2px)
    }

    30% {
        transform: translate(5px, -6px)
    }

    40% {
        transform: translate(-7px, 2px)
    }

    50% {
        transform: translate(6px, -4px)
    }

    100% {
        transform: translate(0, 0)
    }
}

.error-header {
    text-align: center;
    color: #ff4141;
    text-shadow: 0 0 8px #ff4141;
    margin-bottom: 30px
}

.error-header h1 {
    font-size: 5rem;
    margin: 0;
    letter-spacing: 5px
}

.error-header p {
    font-size: 1.5rem;
    margin: 0
}

#game-container {
    width: 100%;
    max-width: 900px;
    border: 2px solid #ff00ff;
    padding: 25px;
    box-shadow: 0 0 20px #ff00ff, inset 0 0 15px rgba(255, 0, 255, .3);
    background: linear-gradient(rgba(10, 10, 10, .95), rgba(10, 10, 10, .95)), url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAJElEQVQIW2NkwAT/gZgAIwYGBgYGFgZkZITLgDaGAgC4jQYgxlw0cwAAAABJRU5ErkJggg==') repeat
}

#output {
    height: 500px;
    overflow-y: auto;
    border: 2px solid #ff00ff;
    border-radius: 14px;
    margin-bottom: 15px;
    padding: 18px 14px;
    background: rgba(255, 0, 255, 0.04);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.15);
}

#output p {
    margin: 0 0 12px 0
}

.prompt {
    color: #ff00ff
}

.system {
    color: #ffff00
}

.location {
    color: #00ff41;
    font-weight: 700;
    text-transform: uppercase
}

.error {
    color: #ff4141
}

#input-container {
    display: flex
}

#input-label {
    margin-right: 10px;
    color: #00ffff
}

#command-input {
    flex-grow: 1;
    background-color: transparent;
    border: none;
    color: #fff;
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
    outline: none
}

::-webkit-scrollbar {
    width: 8px
}

::-webkit-scrollbar-track {
    background: #1a1a1a
}

::-webkit-scrollbar-thumb {
    background: #ff00ff
}

::-webkit-scrollbar-thumb:hover {
    background: #ff6dff
}


@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

/* All CSS is the same as the previous version */

body {
    background-color: #050505;
    color: #00ffff;
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-shadow: 0 0 5px #00ffff
}

.logo-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999
}

.glitch-logo {
    --logo-image: url('../images/webp/nyxbrkrlabs.webp');
    position: relative;
    display: inline-block;
    width: 120px;
    height: auto
}

.glitch-logo img {
    width: 100%;
    height: auto;
    display: block
}

.glitch-logo::before,
.glitch-logo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--logo-image);
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    pointer-events: none
}

.glitch-logo.glitch::before {
    animation: glitchTop .3s linear;
    opacity: .6
}

.glitch-logo.glitch::after {
    animation: glitchBottom .3s linear;
    opacity: .4
}

@keyframes glitchTop {
    0% {
        transform: translate(0, 0);
        clip-path: inset(0 0 85% 0)
    }

    10% {
        transform: translate(-8px, -4px)
    }

    20% {
        transform: translate(6px, 3px)
    }

    30% {
        transform: translate(-5px, 2px)
    }

    40% {
        transform: translate(3px, -5px)
    }

    50% {
        transform: translate(-6px, 4px)
    }

    60% {
        transform: translate(5px, -3px)
    }

    100% {
        transform: translate(0, 0)
    }
}

@keyframes glitchBottom {
    0% {
        transform: translate(0, 0);
        clip-path: inset(85% 0 0 0)
    }

    10% {
        transform: translate(7px, 3px)
    }

    20% {
        transform: translate(-4px, -2px)
    }

    30% {
        transform: translate(5px, -6px)
    }

    40% {
        transform: translate(-7px, 2px)
    }

    50% {
        transform: translate(6px, -4px)
    }

    100% {
        transform: translate(0, 0)
    }
}

.error-header {
    text-align: center;
    color: #ff4141;
    text-shadow: 0 0 8px #ff4141;
    margin-bottom: 30px
}

.error-header h1 {
    font-size: 5rem;
    margin: 0;
    letter-spacing: 5px
}

.error-header p {
    font-size: 1.5rem;
    margin: 0
}

#game-container {
    width: 100%;
    max-width: 900px;
    border: 2px solid #ff00ff;
    padding: 25px;
    box-shadow: 0 0 20px #ff00ff, inset 0 0 15px rgba(255, 0, 255, .3);
    background: linear-gradient(rgba(10, 10, 10, .95), rgba(10, 10, 10, .95)), url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAJElEQVQIW2NkwAT/gZgAIwYGBgYGFgZkZITLgDaGAgC4jQYgxlw0cwAAAABJRU5ErkJggg==') repeat
}

#output {
    height: 500px;
    overflow-y: auto;
    border: 2px solid #ff00ff;
    border-radius: 14px;
    margin-bottom: 15px;
    padding: 18px 14px;
    background: rgba(255, 0, 255, 0.04);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.15);
}

#output p {
    margin: 0 0 12px 0
}

.prompt {
    color: #ff00ff
}

.system {
    color: #ffff00
}

.location {
    color: #00ff41;
    font-weight: 700;
    text-transform: uppercase
}

.error {
    color: #ff4141
}

#input-container {
    display: flex
}

#input-label {
    margin-right: 10px;
    color: #00ffff
}

#command-input {
    flex-grow: 1;
    background-color: transparent;
    border: none;
    color: #fff;
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
    outline: none
}

::-webkit-scrollbar {
    width: 8px
}

::-webkit-scrollbar-track {
    background: #1a1a1a
}

::-webkit-scrollbar-thumb {
    background: #ff00ff
}

::-webkit-scrollbar-thumb:hover {
    background: #ff6dff
}
/* Realistic glitch logo effect with distortion and random directions */
.glitch-logo {
    overflow: hidden;
    position: relative;
}

.glitch-logo img {
    position: relative;
    z-index: 1;
}

.glitch-logo::before,
.glitch-logo::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--logo-image);
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 2;
    mix-blend-mode: screen;
    filter: hue-rotate(270deg) saturate(2) brightness(1.2) blur(0.5px);
    opacity: 0;
    pointer-events: none;
}

.glitch-logo.glitch::before {
    animation: glitchTopDistort 0.1s ease-in-out infinite;
    opacity: 0.9;
}

.glitch-logo.glitch::after {
    animation: glitchBottomDistort 0.08s ease-in-out infinite reverse;
    opacity: 0.7;
    filter: hue-rotate(180deg) saturate(1.5) brightness(0.8) blur(0.3px);
}

@keyframes glitchTopDistort {
    0% {
        transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1);
        clip-path: inset(0 0 80% 0);
        filter: hue-rotate(300deg) blur(0px);
    }
    10% {
        transform: translate(-12px, -8px) rotate(-2deg) skew(-6deg) scale(1.05);
        clip-path: inset(0 0 60% 0);
        filter: hue-rotate(180deg) blur(0.5px);
    }
    20% {
        transform: translate(15px, 5px) rotate(3deg) skew(4deg) scale(0.95);
        clip-path: inset(10% 0 70% 0);
        filter: hue-rotate(210deg) blur(1px);
    }
    30% {
        transform: translate(-9px, 12px) rotate(-4deg) skew(-3deg) scale(1.02);
        clip-path: inset(0 0 50% 0);
        filter: hue-rotate(120deg) blur(0.8px);
    }
    40% {
        transform: translate(18px, -6px) rotate(5deg) skew(5deg) scale(0.98);
        clip-path: inset(15% 0 75% 0);
        filter: hue-rotate(270deg) blur(0.3px);
    }
    50% {
        transform: translate(-14px, 9px) rotate(-3deg) skew(-4deg) scale(1.03);
        clip-path: inset(0 0 55% 0);
        filter: hue-rotate(180deg) blur(0.7px);
    }
    60% {
        transform: translate(11px, -11px) rotate(2deg) skew(3deg) scale(0.97);
        clip-path: inset(20% 0 80% 0);
        filter: hue-rotate(240deg) blur(1.2px);
    }
    70% {
        transform: translate(-16px, 7px) rotate(-5deg) skew(-2deg) scale(1.04);
        clip-path: inset(0 0 65% 0);
        filter: hue-rotate(270deg) blur(0.4px);
    }
    80% {
        transform: translate(13px, 14px) rotate(4deg) skew(6deg) scale(0.96);
        clip-path: inset(25% 0 85% 0);
        filter: hue-rotate(180deg) blur(0.9px);
    }
    90% {
        transform: translate(-7px, -10px) rotate(-1deg) skew(-5deg) scale(1.01);
        clip-path: inset(0 0 75% 0);
        filter: hue-rotate(270deg) blur(0.6px);
    }
    100% {
        transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1);
        clip-path: inset(0 0 80% 0);
        filter: hue-rotate(300deg) blur(0px);
    }
}

@keyframes glitchBottomDistort {
    0% {
        transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1);
        clip-path: inset(80% 0 0 0);
        filter: hue-rotate(180deg) blur(0px);
    }
    11% {
        transform: translate(10px, 8px) rotate(3deg) skew(5deg) scale(0.98);
        clip-path: inset(60% 0 10% 0);
        filter: hue-rotate(210deg) blur(0.4px);
    }
    22% {
        transform: translate(-13px, -4px) rotate(-4deg) skew(-3deg) scale(1.03);
        clip-path: inset(70% 0 5% 0);
        filter: hue-rotate(240deg) blur(0.8px);
    }
    33% {
        transform: translate(16px, 11px) rotate(2deg) skew(4deg) scale(0.97);
        clip-path: inset(65% 0 15% 0);
        filter: hue-rotate(270deg) blur(0.5px);
    }
    44% {
        transform: translate(-11px, 3px) rotate(-3deg) skew(-6deg) scale(1.02);
        clip-path: inset(75% 0 8% 0);
        filter: hue-rotate(300deg) blur(1px);
    }
    55% {
        transform: translate(14px, -9px) rotate(5deg) skew(2deg) scale(0.99);
        clip-path: inset(80% 0 2% 0);
        filter: hue-rotate(120deg) blur(0.7px);
    }
    66% {
        transform: translate(-8px, 13px) rotate(-2deg) skew(-4deg) scale(1.04);
        clip-path: inset(85% 0 0 0);
        filter: hue-rotate(300deg) blur(0.3px);
    }
    77% {
        transform: translate(17px, -5px) rotate(4deg) skew(6deg) scale(0.96);
        clip-path: inset(72% 0 12% 0);
        filter: hue-rotate(30deg) blur(0.9px);
    }
    88% {
        transform: translate(-12px, 6px) rotate(-5deg) skew(-1deg) scale(1.01);
        clip-path: inset(78% 0 5% 0);
        filter: hue-rotate(120deg) blur(0.6px);
    }
    100% {
        transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1);
        clip-path: inset(80% 0 0 0);
        filter: hue-rotate(180deg) blur(0px);
    }
}


.glitch-logo.glitch img {
    opacity: 0;
}


/* Random glitch types */
.glitch-logo.glitch.glitch-type1::before {
    animation: glitchTopType1 0.1s ease-in-out infinite;
}

.glitch-logo.glitch.glitch-type1::after {
    animation: glitchBottomType1 0.08s ease-in-out infinite reverse;
}

@keyframes glitchTopType1 {
0% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(0 0 80% 0); filter: hue-rotate(var(--hue1-1)) blur(0px);
}
    10% { transform: translate(-15px, -10px) rotate(-3deg) skew(-7deg) scale(1.06); clip-path: inset(0 0 60% 0); filter: hue-rotate(180deg) blur(0.6px); }
    20% { transform: translate(18px, 7px) rotate(4deg) skew(5deg) scale(0.94); clip-path: inset(10% 0 70% 0); filter: hue-rotate(210deg) blur(1.1px); }
    30% { transform: translate(-11px, 14px) rotate(-5deg) skew(-4deg) scale(1.03); clip-path: inset(0 0 50% 0); filter: hue-rotate(120deg) blur(0.9px); }
    40% { transform: translate(20px, -8px) rotate(6deg) skew(6deg) scale(0.97); clip-path: inset(15% 0 75% 0); filter: hue-rotate(270deg) blur(0.4px); }
    50% { transform: translate(-17px, 11px) rotate(-4deg) skew(-5deg) scale(1.04); clip-path: inset(0 0 55% 0); filter: hue-rotate(180deg) blur(0.8px); }
    60% { transform: translate(13px, -13px) rotate(3deg) skew(4deg) scale(0.96); clip-path: inset(20% 0 80% 0); filter: hue-rotate(240deg) blur(1.3px); }
    70% { transform: translate(-19px, 9px) rotate(-6deg) skew(-3deg) scale(1.05); clip-path: inset(0 0 65% 0); filter: hue-rotate(270deg) blur(0.5px); }
    80% { transform: translate(16px, 16px) rotate(5deg) skew(7deg) scale(0.95); clip-path: inset(25% 0 85% 0); filter: hue-rotate(180deg) blur(1px); }
    90% { transform: translate(-8px, -12px) rotate(-2deg) skew(-6deg) scale(1.02); clip-path: inset(0 0 75% 0); filter: hue-rotate(270deg) blur(0.7px); }
    100% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(0 0 80% 0); filter: hue-rotate(300deg) blur(0px); }
}

@keyframes glitchBottomType1 {
0% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(80% 0 0 0); filter: hue-rotate(var(--hue2-1)) blur(0px);
}
    11% { transform: translate(12px, 10px) rotate(4deg) skew(6deg) scale(0.97); clip-path: inset(60% 0 10% 0); filter: hue-rotate(210deg) blur(0.5px); }
    22% { transform: translate(-16px, -5px) rotate(-5deg) skew(-4deg) scale(1.04); clip-path: inset(70% 0 5% 0); filter: hue-rotate(240deg) blur(0.9px); }
    33% { transform: translate(19px, 13px) rotate(3deg) skew(5deg) scale(0.96); clip-path: inset(65% 0 15% 0); filter: hue-rotate(270deg) blur(0.6px); }
    44% { transform: translate(-14px, 4px) rotate(-4deg) skew(-7deg) scale(1.03); clip-path: inset(75% 0 8% 0); filter: hue-rotate(300deg) blur(1.1px); }
    55% { transform: translate(17px, -11px) rotate(6deg) skew(3deg) scale(0.98); clip-path: inset(80% 0 2% 0); filter: hue-rotate(120deg) blur(0.8px); }
    66% { transform: translate(-10px, 15px) rotate(-3deg) skew(-5deg) scale(1.05); clip-path: inset(85% 0 0 0); filter: hue-rotate(300deg) blur(0.4px); }
    77% { transform: translate(21px, -7px) rotate(5deg) skew(7deg) scale(0.95); clip-path: inset(72% 0 12% 0); filter: hue-rotate(30deg) blur(1px); }
    88% { transform: translate(-15px, 8px) rotate(-6deg) skew(-2deg) scale(1.02); clip-path: inset(78% 0 5% 0); filter: hue-rotate(120deg) blur(0.7px); }
    100% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(80% 0 0 0); filter: hue-rotate(180deg) blur(0px); }
}

.glitch-logo.glitch.glitch-type2::before {
    animation: glitchTopType2 0.12s ease-in-out infinite;
}

.glitch-logo.glitch.glitch-type2::after {
    animation: glitchBottomType2 0.09s ease-in-out infinite reverse;
}

@keyframes glitchTopType2 {
0% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(0 0 80% 0); filter: hue-rotate(var(--hue1-1)) blur(0px);
}
    12% { transform: translate(14px, -12px) rotate(5deg) skew(6deg) scale(1.07); clip-path: inset(0 0 60% 0); filter: hue-rotate(210deg) blur(0.7px); }
    24% { transform: translate(-19px, 9px) rotate(-4deg) skew(-5deg) scale(0.93); clip-path: inset(10% 0 70% 0); filter: hue-rotate(270deg) blur(1.2px); }
    36% { transform: translate(16px, 15px) rotate(3deg) skew(4deg) scale(1.01); clip-path: inset(0 0 50% 0); filter: hue-rotate(210deg) blur(0.8px); }
    48% { transform: translate(-13px, -7px) rotate(-6deg) skew(-6deg) scale(0.99); clip-path: inset(15% 0 75% 0); filter: hue-rotate(180deg) blur(0.5px); }
    60% { transform: translate(21px, 6px) rotate(4deg) skew(7deg) scale(1.06); clip-path: inset(0 0 55% 0); filter: hue-rotate(300deg) blur(1px); }
    72% { transform: translate(-17px, -14px) rotate(-3deg) skew(-4deg) scale(0.94); clip-path: inset(20% 0 80% 0); filter: hue-rotate(270deg) blur(0.9px); }
    84% { transform: translate(12px, 18px) rotate(6deg) skew(5deg) scale(1.03); clip-path: inset(0 0 65% 0); filter: hue-rotate(210deg) blur(0.6px); }
    96% { transform: translate(-9px, -11px) rotate(-5deg) skew(-7deg) scale(0.98); clip-path: inset(25% 0 85% 0); filter: hue-rotate(300deg) blur(0.8px); }
    100% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(0 0 80% 0); filter: hue-rotate(300deg) blur(0px); }
}

@keyframes glitchBottomType2 {
0% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(80% 0 0 0); filter: hue-rotate(var(--hue2-1)) blur(0px);
}
    10% { transform: translate(-11px, 12px) rotate(-4deg) skew(-5deg) scale(0.96); clip-path: inset(60% 0 10% 0); filter: hue-rotate(240deg) blur(0.6px); }
    20% { transform: translate(18px, -8px) rotate(5deg) skew(6deg) scale(1.05); clip-path: inset(70% 0 5% 0); filter: hue-rotate(270deg) blur(1px); }
    30% { transform: translate(-15px, 16px) rotate(-3deg) skew(-6deg) scale(0.97); clip-path: inset(65% 0 15% 0); filter: hue-rotate(240deg) blur(0.7px); }
    40% { transform: translate(20px, 4px) rotate(4deg) skew(4deg) scale(1.02); clip-path: inset(75% 0 8% 0); filter: hue-rotate(300deg) blur(0.9px); }
    50% { transform: translate(-14px, -13px) rotate(-6deg) skew(-4deg) scale(0.99); clip-path: inset(80% 0 2% 0); filter: hue-rotate(120deg) blur(0.5px); }
    60% { transform: translate(17px, 11px) rotate(3deg) skew(7deg) scale(1.04); clip-path: inset(85% 0 0 0); filter: hue-rotate(300deg) blur(1.1px); }
    70% { transform: translate(-12px, -9px) rotate(-5deg) skew(-3deg) scale(0.95); clip-path: inset(72% 0 12% 0); filter: hue-rotate(240deg) blur(0.8px); }
    80% { transform: translate(19px, 14px) rotate(6deg) skew(5deg) scale(1.01); clip-path: inset(78% 0 5% 0); filter: hue-rotate(180deg) blur(0.6px); }
    90% { transform: translate(-16px, 7px) rotate(-4deg) skew(-7deg) scale(0.98); clip-path: inset(80% 0 0 0); filter: hue-rotate(300deg) blur(0.9px); }
    100% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(80% 0 0 0); filter: hue-rotate(180deg) blur(0px); }
}

.glitch-logo.glitch.glitch-type3::before {
    animation: glitchTopType3 0.11s ease-in-out infinite;
}

.glitch-logo.glitch.glitch-type3::after {
    animation: glitchBottomType3 0.07s ease-in-out infinite reverse;
}

@keyframes glitchTopType3 {
0% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(0 0 80% 0); filter: hue-rotate(var(--hue1-1)) blur(0px);
}
    15% { transform: translate(-20px, 8px) rotate(-6deg) skew(-8deg) scale(1.08); clip-path: inset(0 0 60% 0); filter: hue-rotate(120deg) blur(0.8px); }
    30% { transform: translate(17px, -14px) rotate(5deg) skew(6deg) scale(0.92); clip-path: inset(10% 0 70% 0); filter: hue-rotate(180deg) blur(1.3px); }
    45% { transform: translate(-13px, 19px) rotate(-4deg) skew(-5deg) scale(1.00); clip-path: inset(0 0 50% 0); filter: hue-rotate(180deg) blur(0.9px); }
    60% { transform: translate(22px, -6px) rotate(7deg) skew(7deg) scale(0.97); clip-path: inset(15% 0 75% 0); filter: hue-rotate(240deg) blur(0.6px); }
    75% { transform: translate(-18px, 12px) rotate(-5deg) skew(-6deg) scale(1.06); clip-path: inset(0 0 55% 0); filter: hue-rotate(300deg) blur(1.1px); }
    90% { transform: translate(15px, -17px) rotate(4deg) skew(5deg) scale(0.94); clip-path: inset(20% 0 80% 0); filter: hue-rotate(300deg) blur(0.7px); }
    100% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(0 0 80% 0); filter: hue-rotate(300deg) blur(0px); }
}

@keyframes glitchBottomType3 {
0% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(80% 0 0 0); filter: hue-rotate(var(--hue2-1)) blur(0px);
}
    14% { transform: translate(16px, -10px) rotate(5deg) skew(7deg) scale(0.95); clip-path: inset(60% 0 10% 0); filter: hue-rotate(210deg) blur(0.7px); }
    28% { transform: translate(-21px, 13px) rotate(-6deg) skew(-6deg) scale(1.06); clip-path: inset(70% 0 5% 0); filter: hue-rotate(240deg) blur(1px); }
    42% { transform: translate(19px, -15px) rotate(4deg) skew(5deg) scale(0.96); clip-path: inset(65% 0 15% 0); filter: hue-rotate(270deg) blur(0.8px); }
    56% { transform: translate(-17px, 11px) rotate(-5deg) skew(-7deg) scale(1.03); clip-path: inset(75% 0 8% 0); filter: hue-rotate(300deg) blur(1.2px); }
    70% { transform: translate(23px, -8px) rotate(6deg) skew(6deg) scale(0.98); clip-path: inset(80% 0 2% 0); filter: hue-rotate(120deg) blur(0.9px); }
    84% { transform: translate(-14px, 17px) rotate(-4deg) skew(-5deg) scale(1.05); clip-path: inset(85% 0 0 0); filter: hue-rotate(300deg) blur(0.5px); }
    100% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(80% 0 0 0); filter: hue-rotate(180deg) blur(0px); }
}

.glitch-logo.glitch.glitch-type4::before {
    animation: glitchTopType4 0.13s ease-in-out infinite;
}

.glitch-logo.glitch.glitch-type4::after {
    animation: glitchBottomType4 0.1s ease-in-out infinite reverse;
}

@keyframes glitchTopType4 {
0% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(0 0 80% 0); filter: hue-rotate(var(--hue1-1)) blur(0px);
}
    11% { transform: translate(19px, 11px) rotate(6deg) skew(8deg) scale(1.09); clip-path: inset(0 0 60% 0); filter: hue-rotate(40deg) blur(0.9px); }
    22% { transform: translate(-22px, -9px) rotate(-7deg) skew(-7deg) scale(0.91); clip-path: inset(10% 0 70% 0); filter: hue-rotate(270deg) blur(1.4px); }
    33% { transform: translate(16px, 20px) rotate(5deg) skew(6deg) scale(0.99); clip-path: inset(0 0 50% 0); filter: hue-rotate(180deg) blur(1px); }
    44% { transform: translate(-18px, -12px) rotate(-6deg) skew(-8deg) scale(1.02); clip-path: inset(15% 0 75% 0); filter: hue-rotate(300deg) blur(0.7px); }
    55% { transform: translate(24px, 7px) rotate(7deg) skew(9deg) scale(1.07); clip-path: inset(0 0 55% 0); filter: hue-rotate(240deg) blur(1.2px); }
    66% { transform: translate(-20px, -16px) rotate(-5deg) skew(-6deg) scale(0.93); clip-path: inset(20% 0 80% 0); filter: hue-rotate(240deg) blur(1px); }
    77% { transform: translate(14px, 22px) rotate(6deg) skew(7deg) scale(1.04); clip-path: inset(0 0 65% 0); filter: hue-rotate(120deg) blur(0.8px); }
    88% { transform: translate(-12px, -14px) rotate(-7deg) skew(-9deg) scale(0.96); clip-path: inset(25% 0 85% 0); filter: hue-rotate(240deg) blur(1.1px); }
    100% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(0 0 80% 0); filter: hue-rotate(300deg) blur(0px); }
}

@keyframes glitchBottomType4 {
0% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(80% 0 0 0); filter: hue-rotate(var(--hue2-1)) blur(0px);
}
    13% { transform: translate(-17px, 14px) rotate(-5deg) skew(-6deg) scale(0.94); clip-path: inset(60% 0 10% 0); filter: hue-rotate(210deg) blur(0.8px); }
    26% { transform: translate(21px, -11px) rotate(6deg) skew(7deg) scale(1.07); clip-path: inset(70% 0 5% 0); filter: hue-rotate(240deg) blur(1.1px); }
    39% { transform: translate(-19px, 18px) rotate(-6deg) skew(-7deg) scale(0.95); clip-path: inset(65% 0 15% 0); filter: hue-rotate(210deg) blur(0.9px); }
    52% { transform: translate(23px, 5px) rotate(5deg) skew(8deg) scale(1.01); clip-path: inset(75% 0 8% 0); filter: hue-rotate(270deg) blur(1.3px); }
    65% { transform: translate(-16px, -17px) rotate(-7deg) skew(-8deg) scale(0.98); clip-path: inset(80% 0 2% 0); filter: hue-rotate(120deg) blur(0.6px); }
    78% { transform: translate(18px, 13px) rotate(6deg) skew(6deg) scale(1.06); clip-path: inset(85% 0 0 0); filter: hue-rotate(240deg) blur(1px); }
    91% { transform: translate(-22px, -8px) rotate(-5deg) skew(-9deg) scale(0.97); clip-path: inset(72% 0 12% 0); filter: hue-rotate(250deg) blur(0.8px); }
    100% { transform: translate(0, 0) rotate(0deg) skew(0deg) scale(1); clip-path: inset(80% 0 0 0); filter: hue-rotate(180deg) blur(0px); }
}


/* Synthwave color palette updates for glitch animations */
.glitch-logo::before,
.glitch-logo::after {
    filter: hue-rotate(300deg) saturate(2) brightness(1.2) blur(0.5px);
}

.glitch-logo.glitch::after {
    filter: hue-rotate(180deg) saturate(1.5) brightness(0.8) blur(0.3px);

}

.crt-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
    border: 25px solid #1a1a1a;
    border-radius: 12px;
    box-shadow: 
        0 0 0 8px #0d0d0d,
        0 0 0 10px #2a2a2a,
        inset 0 -15px 20px rgba(0,0,0,0.8),
        inset 0 2px 4px rgba(255,255,255,0.1),
        0 30px 60px rgba(0,0,0,0.9);
}

.crt-container::after {
    content: " ";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 20px;
    background: linear-gradient(to right, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.8);
}

.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    /* Scanlines + Grain */
    background: 
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%),
        url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAGFBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAt6pY5AAAAB3RSTlMAAAAAAAAAb6m77AAAAC9JREFUeNpjYBgFo2AUjIJRMApGwSgYBaNgFAx9AAAByAABt976MAAAAABJRU5ErkJggg==");
    background-size: 100% 4px, 128px 128px;
    animation: crt-static 0.2s infinite, crt-flicker 0.1s infinite;
    /* CRT Vignette */
    box-shadow: inset 0 0 80px rgba(0,0,0,0.6), inset 0 0 20px rgba(0,255,65,0.05);
}

.crt-overlay::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: rgba(0, 255, 65, 0.02); /* Phosphor Tint */
    pointer-events: none;
    z-index: 11;
}

@keyframes crt-flicker {
    0% { opacity: 0.97; }
    50% { opacity: 1; }
    100% { opacity: 0.98; }
}

@keyframes crt-static {
    0% { background-position: 0 0; }
    20% { background-position: 10px 10px; }
    40% { background-position: -20px 5px; }
    60% { background-position: 5px -10px; }
    80% { background-position: -10px -5px; }
    100% { background-position: 0 0; }
}

#raycaster-view {
    width: 100%;
    display: block;
}
