:root {
    --bg-base: #05050a;
    --neon-cyan: #00f3ff;
    --neon-purple: #bc13fe;
    --neon-pink: #ff0055;
    --neon-yellow: #fcee0a;
    --text-primary: #e0e0e0;
    --text-muted: #6b8ea1;
    --font-display: 'Orbitron', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --glitch-offset-1: 2px;
    --glitch-offset-2: -2px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: crosshair;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-mono);
    height: 100vh;
    overflow: hidden;
    position: relative;
    user-select: none;
}

/* Background Canvas */
#matrixCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    opacity: 0.25;
}

/* CRT and Lighting Effects */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.2) 50%,
        rgba(0,0,0,0.2)
    );
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none;
    opacity: 0.6;
}

.vignette {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, transparent 40%, rgba(0,0,0,0.85) 120%);
    z-index: 11;
    pointer-events: none;
}

.noise {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABZJREFUeNpi2rV7928bExPTfyBgAAgwAAwXBE1yWvHRAAAAAElFTkSuQmCC) repeat;
    opacity: 0.05;
    z-index: 12;
    pointer-events: none;
}

/* UI Overlay */
.ui-layer {
    position: relative;
    z-index: 20;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
}

/* HUD System */
.hud-header, .hud-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--neon-cyan);
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.5);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hud-label {
    opacity: 0.7;
}

.hud-value {
    font-weight: bold;
}

.hud-value.danger {
    color: var(--neon-pink);
    text-shadow: 0 0 5px rgba(255, 0, 85, 0.5);
    animation: blink-fast 0.5s infinite;
}

.blink-slow {
    animation: blink 2s infinite;
}

.status-bar {
    width: 200px;
    height: 8px;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--neon-cyan);
    padding: 1px;
}

.status-fill {
    height: 100%;
    width: 0%;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    animation: loading 10s ease infinite;
}

@keyframes loading {
    0% { width: 0%; }
    50% { width: 100%; }
    50.1% { width: 0%; }
    100% { width: 80%; }
}

/* Main Content area */
.main-content {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cyber-container {
    position: relative;
    padding: 4rem 5rem;
    background: rgba(5, 5, 10, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 243, 255, 0.2);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.1), inset 0 0 20px rgba(0, 243, 255, 0.05);
    text-align: center;
    transform: translateZ(0); /* Force hardware accel */
    overflow: hidden;
}

.cyber-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 2px solid transparent;
    background: linear-gradient(45deg, var(--neon-cyan), transparent, var(--neon-pink)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Sci-Fi Corners */
.corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--neon-cyan);
}
.corner.top-left { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.corner.top-right { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.corner.bottom-left { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.corner.bottom-right { bottom: -2px; right: -2px; border-left: none; border-top: none; }

/* Typography Glitch Effect */
.glitch-wrapper {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.glitch {
    position: relative;
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5rem;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    margin: 0;
}

.glitch::before,
.glitch::after {
    content: attr(data-title);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-base);
}

.glitch::before {
    left: var(--glitch-offset-1);
    text-shadow: -2px 0 var(--neon-cyan);
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
    animation: glitch-top 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: var(--glitch-offset-2);
    text-shadow: -2px 0 var(--neon-pink);
    clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
    animation: glitch-bottom 4s infinite linear alternate-reverse;
}

.glitch.neon-text {
    font-size: 6rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 15px rgba(0, 243, 255, 0.8), 0 0 30px rgba(0, 243, 255, 0.5);
    margin-top: -15px;
    letter-spacing: 0.8rem;
    padding-left: 0.8rem;
}

.glitch.neon-text::before { text-shadow: -2px 0 var(--neon-pink); background: transparent; }
.glitch.neon-text::after { text-shadow: 2px 0 var(--neon-yellow); background: transparent; }

/* Custom Glitch Animations */
@keyframes glitch-top {
    0% { clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%); transform: translate(0); }
    20% { clip-path: polygon(0 15%, 100% 15%, 100% 40%, 0 40%); transform: translate(-2px, 2px); }
    40% { clip-path: polygon(0 10%, 100% 10%, 100% 25%, 0 25%); transform: translate(2px, -2px); }
    60% { clip-path: polygon(0 5%, 100% 5%, 100% 50%, 0 50%); transform: translate(-2px, 0); }
    80% { clip-path: polygon(0 20%, 100% 20%, 100% 30%, 0 30%); transform: translate(2px, 2px); }
    100% { clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%); transform: translate(0); }
}

@keyframes glitch-bottom {
    0% { clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%); transform: translate(0); }
    20% { clip-path: polygon(0 60%, 100% 60%, 100% 90%, 0 90%); transform: translate(2px, -2px); }
    40% { clip-path: polygon(0 75%, 100% 75%, 100% 100%, 0 100%); transform: translate(-2px, 2px); }
    60% { clip-path: polygon(0 50%, 100% 50%, 100% 80%, 0 80%); transform: translate(2px, 0); }
    80% { clip-path: polygon(0 80%, 100% 80%, 100% 95%, 0 95%); transform: translate(-2px, -2px); }
    100% { clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%); transform: translate(0); }
}

/* Divider Elements */
.divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    gap: 15px;
}

.divider .line {
    height: 1px;
    flex-grow: 1;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    opacity: 0.5;
}

.divider .node {
    width: 6px;
    height: 6px;
    background: var(--neon-yellow);
    box-shadow: 0 0 10px var(--neon-yellow);
    transform: rotate(45deg);
}

/* Info Panel / Typewriter */
.info-panel {
    min-height: 2.5rem;
    margin-bottom: 2.5rem;
}

.typewriter {
    font-size: 1.1rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.typewriter::after {
    content: '_';
    color: var(--neon-cyan);
    animation: blink-fast 1s infinite;
}

/* button styles */
.action-area {
    display: flex;
    justify-content: center;
}

.cyber-btn {
    position: relative;
    background: rgba(0, 243, 255, 0.1);
    color: var(--neon-cyan);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 15px 30px;
    border: 1px solid var(--neon-cyan);
    outline: none;
    display: flex;
    align-items: center;
    gap: 10px;
    clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.cyber-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.4), transparent);
    transform: skewX(-45deg);
    transition: 0.5s;
}

.cyber-btn:hover {
    background: var(--neon-cyan);
    color: var(--bg-base);
    box-shadow: 0 0 20px var(--neon-cyan);
}

.cyber-btn:hover::before {
    left: 200%;
}

.cyber-btn:hover .btn-icon {
    transform: translateX(5px);
}

.btn-icon {
    transition: transform 0.3s ease;
}

/* Animations */
@keyframes blink { 50% { opacity: 0.3; } }
@keyframes blink-fast { 50% { opacity: 0; } }

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    .cyber-container {
        padding: 2rem;
    }
    .glitch { font-size: 2.5rem; }
    .glitch.neon-text { font-size: 3.5rem; }
    .hud-header, .hud-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .status-bar { width: 100px; }
}
