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

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

:root {
    --vhs-white: #e8e0d4;
    --vhs-main: #ff3a5c; /* Red */
    --vhs-accent: #ff7eb3; /* Pink */
    --vhs-secondary-accent: #c77dff; /* Purple */
    --bg: #0c0c14;
    --static-opacity: 0.04;
}

body {
    background: var(--bg);
    font-family: 'VT323', monospace;
    color: var(--vhs-white);
    height: 100vh;
    overflow: hidden;
    cursor: none;
}

/* CUSTOM CURSOR */
.cursor-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--vhs-accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 100000;
    mix-blend-mode: difference;
    transition: transform 0.1s;
}

.cursor-ring {
    position: fixed;
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--vhs-accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 100000;
    mix-blend-mode: difference;
    transition: transform 0.15s ease-out, width 0.2s, height 0.2s;
}

/* VHS STATIC */
.vhs-static {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: var(--static-opacity);
}

.vhs-static canvas { width: 100%; height: 100%; }

/* VHS TRACKING LINES */
.tracking {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

.tracking-line {
    position: absolute;
    width: 110%;
    left: -5%;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    filter: blur(1px);
}

/* RGB SPLIT */
.rgb-split {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9997;
    mix-blend-mode: screen;
}

/* TAPE COUNTER */
.tape-counter {
    position: fixed;
    top: 1.5rem;
    right: 2rem;
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
    color: var(--vhs-white);
    opacity: 0.4;
    z-index: 100;
    text-shadow: 2px 0 var(--vhs-main), -2px 0 var(--vhs-accent);
    letter-spacing: 3px;
}

.rec-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--vhs-main);
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    animation: recBlink 1s step-end infinite;
    box-shadow: 0 0 8px var(--vhs-main);
}

@keyframes recBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* PLAY ICON */
.play-badge {
    position: fixed;
    top: 1.5rem;
    left: 2rem;
    z-index: 100;
    opacity: 0.35;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    color: var(--vhs-white);
    text-shadow: 2px 0 var(--vhs-main), -2px 0 var(--vhs-accent);
}

.play-triangle {
    width: 0;
    height: 0;
    border-left: 12px solid var(--vhs-white);
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    filter: drop-shadow(0 0 4px var(--vhs-white));
}

/* DATE STAMP */
.date-stamp {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    font-size: 1.3rem;
    color: var(--vhs-secondary-accent);
    opacity: 0.3;
    z-index: 100;
    text-shadow: 2px 0 rgba(255, 58, 92, 0.5);
    letter-spacing: 2px;
}

/* === MAIN CONTENT === */
.main {
    position: relative;
    z-index: 50;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 2vh, 2rem);
    overflow-y: auto;
    overflow-x: hidden;
}

/* LOGO */
.logo-wrap {
    position: relative;
    margin-bottom: 0.5rem;
    text-align: center;
}

.logo {
    font-family: 'VT323', monospace;
    font-size: clamp(2.5rem, 8vh, 6rem);
    font-weight: 700;
    color: var(--vhs-white);
    position: relative;
    text-shadow:
        3px 3px 0 var(--vhs-main),
        -3px -3px 0 #4a7dff; /* Blue for contrast */
    animation: vhsWobble 4s ease-in-out infinite;
    user-select: none;
}

@keyframes vhsWobble {
    0%, 100% {
        text-shadow: 3px 3px 0 var(--vhs-main), -3px -3px 0 #4a7dff;
        transform: skewX(0deg);
    }
    25% {
        text-shadow: 4px 2px 0 var(--vhs-main), -2px -4px 0 #4a7dff;
    }
    48% { transform: skewX(0deg); }
    49% { transform: skewX(-2deg); }
    50% { transform: skewX(3deg); }
    51% { transform: skewX(0deg); }
    75% {
        text-shadow: 2px 4px 0 var(--vhs-main), -4px -2px 0 #4a7dff;
    }
}

.subtext {
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--vhs-secondary-accent);
    margin-bottom: clamp(0.8rem, 2vh, 2rem);
    opacity: 0.7;
    text-shadow: 1px 1px 0 rgba(199, 125, 255, 0.3);
    text-align: center;
}


/* REWIND INTRO */
.rewind-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.rewind-icon {
    font-size: 4rem;
    color: var(--vhs-white);
    text-shadow: 3px 3px 0 var(--vhs-main), -3px -3px 0 #4a7dff;
    animation: rewindPulse 0.5s ease-in-out infinite alternate;
}

@keyframes rewindPulse {
    from { transform: scale(1); opacity: 0.8; }
    to { transform: scale(1.1); opacity: 1; }
}

.rewind-text {
    font-family: 'VT323', monospace;
    font-size: 1.5rem;
    letter-spacing: 8px;
    color: var(--vhs-accent);
    text-shadow: 2px 0 var(--vhs-main);
    animation: rewindFlicker 0.3s step-end infinite;
}

@keyframes rewindFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.rewind-bar {
    width: 200px;
    height: 4px;
    background: #2a2a3a;
    border-radius: 2px;
    overflow: hidden;
}

.rewind-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4a7dff, var(--vhs-secondary-accent), var(--vhs-main));
    border-radius: 2px;
    transition: width 0.05s;
}

/* HORIZONTAL DISTORTION BANDS */
.distortion-band {
    position: fixed;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 9996;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(1px);
    opacity: 0;
}

/* RESPONSIVE */
@media (max-width: 740px) {
    .tape-counter { font-size: 1rem; top: 1rem; right: 1rem; }
    .play-badge { top: 1rem; left: 1rem; font-size: 1rem; }
    .date-stamp { bottom: 1rem; right: 1rem; font-size: 1rem; }
}

/* LOGIN FORM STYLES */
.login-box {
    background: #1a1a28;
    border: 3px solid #2a2a3a;
    border-radius: 6px;
    padding: clamp(1rem, 2vh, 2rem);
    width: 100%;
    max-width: 400px;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03);
}

.tabs {
    display: flex;
    border-bottom: 2px solid #2a2a3a;
    margin-bottom: clamp(0.75rem, 1.5vh, 1.5rem);
}

.tab {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: var(--vhs-white);
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: none;
    opacity: 0.4;
    position: relative;
    transition: opacity 0.3s;
}

.tab.active {
    opacity: 1;
    color: var(--vhs-accent);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--vhs-accent);
    box-shadow: 0 0 8px var(--vhs-accent);
}

.form input[type="text"],
.form input[type="email"],
.form input[type="password"] {
    width: 100%;
    background: #0c0c14;
    border: 2px solid #2a2a3a;
    border-radius: 4px;
    padding: 0.75rem;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    color: var(--vhs-white);
    margin-bottom: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form input:focus {
    outline: none;
    border-color: var(--vhs-secondary-accent);
    box-shadow: 0 0 12px var(--vhs-secondary-accent);
}

.form button {
    width: 100%;
    background: var(--vhs-main);
    border: none;
    border-radius: 4px;
    padding: 0.8rem;
    font-family: 'Silkscreen', cursive;
    font-size: 1rem;
    color: var(--vhs-white);
    letter-spacing: 2px;
    cursor: none;
    transition: background 0.3s, box-shadow 0.3s;
}

.form button:hover {
    background: var(--vhs-accent);
    box-shadow: 0 0 12px var(--vhs-accent);
}

.form .remember, .form a {
    font-size: 0.9em;
    color: #ccc;
    text-decoration: none;
}
.form a:hover {
    color: var(--vhs-accent);
    text-decoration: underline;
}

.hidden {
    display: none;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #1a1a28;
    color: var(--vhs-white);
    padding: 12px 20px;
    border-radius: 6px;
    border: 2px solid #2a2a3a;
    box-shadow: 0 0 15px rgba(0,0,0,0.7);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 999;
    font-size: 1rem;
    text-shadow: 1px 1px 0 var(--vhs-main);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}
