:root {
    --bg-dark: #000000;
    --hacker-green: #0ABAB5;
    --hacker-green-dark: #055A55;
    --hacker-red: #ff0033;
    --hacker-blue: #00ccff;
    --text-dim: #07807B;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

@keyframes crt-power-on {
    0% { transform: scale(1, 0.01); opacity: 0; filter: brightness(5) contrast(3); }
    40% { transform: scale(1, 0.02); opacity: 1; filter: brightness(5) contrast(3); }
    70% { transform: scale(1, 1); filter: brightness(1) contrast(1); }
    100% { transform: scale(1, 1); }
}

body {
    background-color: var(--bg-dark);
    font-family: 'Share Tech Mono', 'Prompt', monospace;
    color: var(--hacker-green);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    animation: crt-power-on 1.2s cubic-bezier(0.86, 0, 0.07, 1) forwards;
}

#matrixCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.25; 
}

.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: 2;
    pointer-events: none;
}

/* CRT tube vignette effect */
body::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.8) 120%);
    z-index: 3;
    pointer-events: none;
}

.screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.1s step-end, visibility 0.1s;
}

.screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

.hidden-fade {
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.hidden-fade.show {
    opacity: 1;
    pointer-events: auto;
}

/* Terminal Container Stylings */
.terminal-container {
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--hacker-green);
    border-radius: 5px;
    padding: 0 1.5rem 1.5rem 1.5rem;
    max-width: 90%;
    width: 700px;
    box-shadow: 0 0 15px var(--hacker-green-dark);
    position: relative;
    backdrop-filter: blur(5px);
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.terminal-header {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 35px;
    background: var(--hacker-green);
    color: var(--bg-dark);
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-weight: bold;
    font-size: 1.1rem;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.terminal-header .title {
    margin-left: auto;
    margin-right: auto;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 1px;
}

.terminal-container.error-border {
    border-color: var(--hacker-red);
    box-shadow: 0 0 25px rgba(255, 0, 51, 0.5);
}
.error-border .terminal-header { background: var(--hacker-red); }

.terminal-container.success-border {
    border-color: var(--hacker-green);
    box-shadow: 0 0 25px rgba(10, 186, 181, 0.4);
}

.terminal-container.secret-border {
    border-color: var(--hacker-blue);
    box-shadow: 0 0 25px rgba(0, 204, 255, 0.4);
}
.secret-border .terminal-header { background: var(--hacker-blue); }

.terminal-body {
    margin-top: 3.5rem; /* space for header */
    font-size: 1.3rem;
    line-height: 2;
    min-height: 150px;
}

/* Typing Effect Elements */
.type-line {
    border-right: 12px solid var(--hacker-green);
    animation: blink-cursor 0.8s step-end infinite;
    white-space: pre-wrap;
    display: block;
    margin-bottom: 0.5rem;
}

@keyframes blink-cursor {
    0%, 100% { border-color: transparent }
    50% { border-color: var(--hacker-green) }
}

/* Hacker Button */
.hacker-btn {
    background: transparent;
    color: var(--hacker-green);
    border: 1px solid var(--hacker-green);
    font-family: 'Share Tech Mono', 'Prompt', monospace;
    font-size: 1.2rem;
    padding: 12px 25px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
    box-shadow: inset 0 0 10px rgba(10, 186, 181, 0.15);
    letter-spacing: 1px;
}

.hacker-btn:hover {
    background: var(--hacker-green);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--hacker-green);
    font-weight: bold;
}

.error-btn {
    color: var(--hacker-red);
    border-color: var(--hacker-red);
    box-shadow: inset 0 0 10px rgba(255, 0, 51, 0.15);
}

.error-btn:hover {
    background: var(--hacker-red);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--hacker-red);
}

/* Utilities */
.text-center { text-align: center; }
.mt-2 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2.5rem; }

/* Troll Screen Specifically */
.error-text {
    color: var(--hacker-red);
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px var(--hacker-red);
}

.funny-title {
    color: #ffcc00;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: bold;
}

.funny-photo-container {
    width: 220px;
    height: 220px;
    margin: 0 auto 1.5rem auto;
    position: relative;
    border: 3px solid var(--hacker-red);
    box-shadow: inset 0 0 20px var(--hacker-red);
}

.funny-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(100%) hue-rotate(-50deg) saturate(200%) contrast(1.2) brightness(0.8);
}

.cyber-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 2;
}

.crosshair {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; height: 60px;
    border: 2px solid var(--hacker-red);
    border-radius: 50%;
}
.crosshair::before, .crosshair::after {
    content: ''; position: absolute; background: var(--hacker-red);
}
.crosshair::before { top: 0; left: 29px; width: 2px; height: 60px; }
.crosshair::after { top: 29px; left: 0; width: 60px; height: 2px; }

.scanner-line {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: var(--hacker-red);
    box-shadow: 0 0 15px var(--hacker-red);
    animation: scan 2s linear infinite alternate;
}

@keyframes scan {
    0% { top: 0%; }
    100% { top: 100%; }
}

.terminal-text {
    font-size: 1.2rem;
    line-height: 1.7;
    margin-bottom: 0.5rem;
    color: var(--hacker-green);
}
.terminal-text.highlight {
    color: #ffcc00;
    font-weight: bold;
    text-shadow: 0 0 5px #ffcc00;
}

/* Main Screen */
.hbd-text {
    text-align: center;
}
.glow-green {
    font-size: 3rem;
    color: var(--hacker-green);
    text-shadow: 0 0 15px var(--hacker-green);
    margin-bottom: 0.5rem;
}
.name-gradient {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 1.5rem;
}

.message-container p {
    margin-bottom: 0.8rem;
}

.cute-photo-container {
    width: 150px;
    height: 150px;
    margin: 1.5rem auto 1rem auto;
    border: 2px solid var(--hacker-green);
    padding: 5px;
    box-shadow: inset 0 0 15px var(--hacker-green), 0 0 15px var(--hacker-green);
    position: absolute;
    right: 20px;
    top: 60px;
    opacity: 0.7;
}

.cute-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(100%) hue-rotate(135deg) saturate(200%) contrast(1.2); 
}

.cake-container {
    text-align: center;
    font-size: 4rem;
    margin-bottom: 1.5rem;
    filter: sepia(1) hue-rotate(135deg) saturate(3);
}

/* Secret Screen */
.glow-blue {
    font-size: 2rem;
    color: var(--hacker-blue);
    text-shadow: 0 0 15px var(--hacker-blue);
    text-align: center;
}

.photo-placeholder {
    width: 180px;
    height: 180px;
    margin: 2rem auto;
    position: relative;
    border: 3px dashed var(--hacker-blue);
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 0 20px rgba(0, 204, 255, 0.3);
}
.secret-photo {
    width: 100%; height: 100%; object-fit: cover;
    filter: sepia(100%) hue-rotate(180deg) saturate(200%) contrast(1.2) brightness(0.8);
    opacity: 0.6;
    position: absolute; top:0; left:0;
}
.heart-pulse {
    font-size: 3.5rem;
    z-index: 2;
    animation: heartBeat 1s infinite alternate;
    filter: sepia(1) hue-rotate(300deg) saturate(5); 
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    100% { transform: scale(1.3); }
}

/* Glitch Effect Text */
.glitched {
    position: relative;
    display: inline-block;
}
.glitched::before, .glitched::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: transparent;
}
.glitched::before {
    left: 2px; text-shadow: -2px 0 red;
    clip-path: inset(0 0 0 0);
    animation: glitch-anim-1 2.5s infinite linear;
}
.glitched::after {
    left: -2px; text-shadow: -2px 0 blue;
    clip-path: inset(0 0 0 0);
    animation: glitch-anim-2 3s infinite linear;
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(20% 0 80% 0); }
    10% { clip-path: inset(60% 0 10% 0); }
    20% { clip-path: inset(10% 0 50% 0); }
    30% { clip-path: inset(80% 0 5% 0); }
    40% { clip-path: inset(30% 0 40% 0); }
    100% { clip-path: inset(50% 0 30% 0); }
}
@keyframes glitch-anim-2 {
    0% { clip-path: inset(10% 0 60% 0); left: 2px;}
    10% { clip-path: inset(30% 0 20% 0); left: -2px;}
    20% { clip-path: inset(80% 0 10% 0); left: -2px;}
    30% { clip-path: inset(20% 0 50% 0); left: 2px;}
    40% { clip-path: inset(50% 0 30% 0); left: -2px;}
    100% { clip-path: inset(5% 0 80% 0); left: 2px;}
}

.glitched:hover {
    animation: glitch-anim-1 0.15s infinite linear alternate-reverse, glitch-anim-2 0.2s infinite linear alternate-reverse;
}
.glitched:hover::before { filter: brightness(1.5); }
.glitched:hover::after { filter: brightness(1.5); }

/* Responsive */
@media (max-width: 768px) {
    .terminal-container { padding: 0 1rem 1rem 1rem; width: 95%; margin-top: 1rem; }
    .error-text { font-size: 2rem; }
    .glow-green { font-size: 2.2rem; }
    .name-gradient { font-size: 1.8rem; }
    .terminal-text, .terminal-body { font-size: 1rem; }
    .hacker-btn { font-size: 1rem; padding: 10px 15px; }
    .funny-photo-container { width: 150px; height: 150px; }
    .cute-photo-container { position: relative; right: auto; top: auto; width: 120px; height: 120px; }
}
