* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #030012;
    min-height: 100vh;
    overflow: hidden;
    color: #2c1e0b;
}

/* ===== THE VOID — galaxy background ===== */
.void {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse at 15% 45%, rgba(120, 0, 200, 0.5) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 25%, rgba(160, 60, 240, 0.4) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 85%, rgba(80, 0, 160, 0.45) 0%, transparent 45%),
        radial-gradient(ellipse at 75% 65%, rgba(200, 100, 255, 0.2) 0%, transparent 35%),
        radial-gradient(ellipse at 30% 20%, rgba(40, 0, 100, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 40%, rgba(100, 20, 180, 0.3) 0%, transparent 55%),
        radial-gradient(ellipse at center, #0d0520 0%, #08021a 60%, #030012 100%);
}

/* Nebula swirl */
.nebula {
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(140, 40, 220, 0.25) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 60%, rgba(80, 20, 180, 0.2) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 30%, rgba(200, 100, 255, 0.15) 0%, transparent 35%);
    animation: nebulaRotate 60s linear infinite;
}

@keyframes nebulaRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Stars layer */
.stars {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background-image:
        radial-gradient(1px 1px at 5% 12%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 11% 58%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 18% 30%, #fff 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 24% 78%, rgba(200,180,255,0.9) 0%, transparent 100%),
        radial-gradient(1px 1px at 30% 5%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 35% 45%, #fff 0%, transparent 100%),
        radial-gradient(2px 2px at 40% 88%, rgba(180,140,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 47% 22%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 52% 62%, #fff 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 58% 38%, rgba(220,200,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 63% 8%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 68% 72%, #fff 0%, transparent 100%),
        radial-gradient(2px 2px at 73% 50%, rgba(190,160,255,0.9) 0%, transparent 100%),
        radial-gradient(1px 1px at 78% 18%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 82% 85%, #fff 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 87% 32%, rgba(210,180,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 91% 55%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 95% 92%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 3% 42%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(2px 2px at 15% 95%, rgba(170,130,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 22% 15%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 44% 70%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 55% 5%, rgba(200,170,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 66% 48%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 76% 82%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 88% 65%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(2px 2px at 33% 55%, rgba(190,150,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 8% 75%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 97% 35%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 42% 2%, #fff 0%, transparent 100%);
    animation: starTwinkle 3s ease-in-out infinite alternate;
}

@keyframes starTwinkle {
    0% { opacity: 0.5; }
    50% { opacity: 0.9; }
    100% { opacity: 0.7; }
}

.void-layer {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

/* Void text */
.void-text {
    position: absolute;
    font-family: 'Courier New', monospace;
    color: rgba(180, 100, 255, 0);
    font-size: clamp(14px, 2.5vw, 22px);
    white-space: nowrap;
    letter-spacing: 3px;
    text-transform: lowercase;
    user-select: none;
    pointer-events: none;
    z-index: 3;
}

.v1 { top: 12%; left: 8%; animation: bleed 4s 1s infinite; }
.v2 { top: 35%; right: 5%; animation: bleed 5s 2s infinite; }
.v3 { bottom: 25%; left: 15%; animation: bleed 3.5s 3s infinite; }
.v4 { top: 55%; left: 3%; animation: bleed 6s 0s infinite; font-size: clamp(10px, 1.5vw, 14px); }
.v5 { bottom: 10%; right: 10%; animation: bleed 4.5s 4s infinite; }
.v6 { top: 75%; left: 40%; animation: bleed 5s 1.5s infinite; }
.v7 { top: 20%; right: 15%; animation: bleed 4s 3.5s infinite; font-size: clamp(10px, 1.5vw, 14px); }

@keyframes bleed {
    0%, 100% { color: rgba(180, 100, 255, 0); text-shadow: none; }
    5% { color: rgba(180, 100, 255, 0.7); text-shadow: 0 0 20px rgba(180, 100, 255, 0.3); }
    10% { color: rgba(180, 100, 255, 0.9); text-shadow: 0 0 30px rgba(180, 100, 255, 0.5), 0 0 60px rgba(100, 0, 180, 0.3); }
    20% { color: rgba(180, 100, 255, 0.6); }
    30% { color: rgba(180, 100, 255, 0); text-shadow: none; }
}

/* ===== SCANLINES ===== */
.scanlines {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
}

/* ===== GOLD BACKGROUND — crumbles from outside in ===== */
.gold-bg {
    position: fixed;
    inset: 0;
    z-index: 5;
    background-color: #cfae2e;
    animation: goldCrumble 8s ease-in forwards, goldCrumble2 12s 8s ease-in forwards;
    pointer-events: none;
}

@keyframes goldCrumble {
    0% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
    15% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
    30% {
        clip-path: polygon(0% 0%, 100% 0%, 100% 2%, 97% 2%, 97% 6%, 100% 6%, 100% 100%, 0% 100%, 0% 88%, 4% 88%, 4% 84%, 0% 84%);
        opacity: 0.95;
    }
    50% {
        clip-path: polygon(2% 0%, 100% 0%, 100% 3%, 93% 3%, 93% 10%, 100% 10%, 100% 45%, 95% 45%, 95% 52%, 100% 52%, 100% 100%, 5% 100%, 5% 90%, 0% 90%, 0% 78%, 6% 78%, 6% 72%, 0% 72%, 0% 15%, 2% 15%);
        opacity: 0.9;
    }
    70% {
        clip-path: polygon(5% 2%, 35% 2%, 35% 0%, 65% 0%, 65% 4%, 96% 4%, 96% 0%, 100% 0%, 100% 12%, 94% 12%, 94% 20%, 100% 20%, 100% 40%, 92% 40%, 92% 55%, 100% 55%, 100% 100%, 82% 100%, 82% 94%, 68% 94%, 68% 100%, 8% 100%, 8% 93%, 0% 93%, 0% 76%, 7% 76%, 7% 66%, 0% 66%, 0% 38%, 5% 38%, 5% 28%, 0% 28%, 0% 16%, 5% 16%);
        opacity: 0.8;
    }
    85% {
        clip-path: polygon(10% 5%, 25% 5%, 25% 0%, 40% 0%, 40% 8%, 52% 8%, 52% 0%, 68% 0%, 68% 6%, 88% 6%, 88% 0%, 100% 0%, 100% 15%, 90% 15%, 90% 25%, 100% 25%, 100% 35%, 88% 35%, 88% 58%, 100% 58%, 100% 72%, 93% 72%, 93% 88%, 100% 88%, 100% 100%, 78% 100%, 78% 90%, 60% 90%, 60% 100%, 35% 100%, 35% 92%, 18% 92%, 18% 100%, 8% 100%, 8% 88%, 0% 88%, 0% 72%, 8% 72%, 8% 60%, 0% 60%, 0% 42%, 6% 42%, 6% 30%, 0% 30%, 0% 18%, 10% 18%);
        opacity: 0.65;
    }
    100% {
        clip-path: polygon(15% 8%, 22% 8%, 22% 3%, 35% 3%, 35% 12%, 42% 12%, 42% 3%, 55% 3%, 55% 10%, 65% 10%, 65% 3%, 75% 3%, 75% 8%, 85% 8%, 85% 3%, 95% 3%, 95% 18%, 88% 18%, 88% 28%, 95% 28%, 95% 38%, 85% 38%, 85% 48%, 95% 48%, 95% 62%, 88% 62%, 88% 75%, 95% 75%, 95% 92%, 82% 92%, 82% 85%, 72% 85%, 72% 95%, 55% 95%, 55% 88%, 42% 88%, 42% 95%, 28% 95%, 28% 88%, 15% 88%, 15% 95%, 5% 95%, 5% 82%, 12% 82%, 12% 68%, 5% 68%, 5% 55%, 12% 55%, 12% 42%, 5% 42%, 5% 28%, 12% 28%, 12% 18%, 15% 18%);
        opacity: 0.55;
    }
}

@keyframes goldCrumble2 {
    0% {
        clip-path: polygon(15% 8%, 22% 8%, 22% 3%, 35% 3%, 35% 12%, 42% 12%, 42% 3%, 55% 3%, 55% 10%, 65% 10%, 65% 3%, 75% 3%, 75% 8%, 85% 8%, 85% 3%, 95% 3%, 95% 18%, 88% 18%, 88% 28%, 95% 28%, 95% 38%, 85% 38%, 85% 48%, 95% 48%, 95% 62%, 88% 62%, 88% 75%, 95% 75%, 95% 92%, 82% 92%, 82% 85%, 72% 85%, 72% 95%, 55% 95%, 55% 88%, 42% 88%, 42% 95%, 28% 95%, 28% 88%, 15% 88%, 15% 95%, 5% 95%, 5% 82%, 12% 82%, 12% 68%, 5% 68%, 5% 55%, 12% 55%, 12% 42%, 5% 42%, 5% 28%, 12% 28%, 12% 18%, 15% 18%);
        opacity: 0.55;
    }
    40% {
        clip-path: polygon(20% 12%, 28% 12%, 28% 8%, 38% 8%, 38% 15%, 48% 15%, 48% 8%, 58% 8%, 58% 14%, 68% 14%, 68% 8%, 78% 8%, 78% 12%, 88% 12%, 88% 22%, 82% 22%, 82% 32%, 88% 32%, 88% 42%, 80% 42%, 80% 55%, 88% 55%, 88% 68%, 82% 68%, 82% 80%, 88% 80%, 88% 88%, 78% 88%, 78% 82%, 68% 82%, 68% 90%, 52% 90%, 52% 82%, 42% 82%, 42% 88%, 30% 88%, 30% 82%, 20% 82%, 20% 88%, 12% 88%, 12% 76%, 18% 76%, 18% 62%, 12% 62%, 12% 48%, 18% 48%, 18% 38%, 12% 38%, 12% 24%, 20% 24%);
        opacity: 0.42;
    }
    70% {
        clip-path: polygon(30% 20%, 38% 20%, 38% 15%, 48% 15%, 48% 22%, 58% 22%, 58% 15%, 68% 15%, 68% 20%, 78% 20%, 78% 28%, 72% 28%, 72% 40%, 78% 40%, 78% 52%, 72% 52%, 72% 65%, 78% 65%, 78% 78%, 68% 78%, 68% 72%, 58% 72%, 58% 80%, 48% 80%, 48% 72%, 38% 72%, 38% 78%, 28% 78%, 28% 68%, 32% 68%, 32% 55%, 28% 55%, 28% 42%, 32% 42%, 32% 32%, 28% 32%, 28% 24%, 30% 24%);
        opacity: 0.3;
    }
    100% {
        clip-path: polygon(40% 30%, 48% 30%, 48% 25%, 55% 25%, 55% 32%, 62% 32%, 62% 25%, 68% 25%, 68% 35%, 62% 35%, 62% 48%, 68% 48%, 68% 62%, 62% 62%, 62% 70%, 55% 70%, 55% 62%, 48% 62%, 48% 68%, 40% 68%, 40% 58%, 44% 58%, 44% 45%, 40% 45%, 40% 35%);
        opacity: 0.15;
    }
}

/* ===== THE SURFACE — card sits on top, untouched ===== */
.surface {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

.card {
    position: relative;
    background-color: #e6c85a;
    border: 4px solid #2c1e0b;
    border-radius: 16px;
    box-shadow: 8px 8px 0px rgba(44, 30, 11, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: cardShake 4s 3s infinite, cardDecay 6s 1s forwards;
}

@keyframes cardDecay {
    0% { filter: none; }
    30% { filter: saturate(0.6) brightness(0.95); }
    60% { filter: saturate(0.2) brightness(0.85); }
    100% { filter: saturate(0) brightness(0.75) sepia(0.1); }
}

@keyframes cardShake {
    0%, 85%, 100% { transform: translate(0, 0) rotate(0deg); }
    87% { transform: translate(-3px, 2px) rotate(-0.5deg); }
    89% { transform: translate(4px, -2px) rotate(0.4deg); }
    91% { transform: translate(-2px, 3px) rotate(-0.2deg); }
    93% { transform: translate(3px, -3px) rotate(0.5deg); }
    95% { transform: translate(-4px, 1px) rotate(-0.3deg); }
    97% { transform: translate(2px, -1px) rotate(0.2deg); }
}

/* ===== CRACKS in the card ===== */
.crack {
    position: absolute;
    background: linear-gradient(135deg, transparent 40%, rgba(10, 0, 0, 0.9) 50%, transparent 60%);
    z-index: 10;
    pointer-events: none;
    opacity: 0;
}

.crack-1 {
    width: 120px;
    height: 3px;
    top: 30%;
    right: -20px;
    transform: rotate(-25deg);
    animation: crackAppear 6s 3s forwards;
}

.crack-2 {
    width: 80px;
    height: 2px;
    bottom: 20%;
    left: -10px;
    transform: rotate(15deg);
    animation: crackAppear 6s 4s forwards;
}

.crack-3 {
    width: 150px;
    height: 3px;
    top: 60%;
    left: 20%;
    transform: rotate(-40deg);
    animation: crackAppear 6s 5s forwards;
}

@keyframes crackAppear {
    0% { opacity: 0; width: 0; }
    30% { opacity: 0; width: 0; }
    70% { opacity: 0.7; }
    100% { opacity: 1; }
}

.image-container {
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.main-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;

}

.login-container {
    padding: 40px;
    width: 100%;
}

/* ===== GLITCH TEXT ===== */
h1 {
    margin-bottom: 10px;
    color: #2c1e0b;
    font-weight: 800;
    position: relative;
    animation: textGlitch 3s 2s infinite;
}

h1::before,
h1::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    opacity: 0;
}

h1::before {
    color: rgba(180, 100, 255, 0.8);
    animation: glitchLayer1 3s 2s infinite;
}

h1::after {
    color: rgba(0, 150, 150, 0.5);
    animation: glitchLayer2 3s 2s infinite;
}

@keyframes textGlitch {
    0%, 82%, 100% { transform: none; }
    84% { transform: skewX(-4deg); }
    86% { transform: skewX(5deg) translateX(3px); }
    88% { transform: skewX(-2deg) translateX(-2px); }
    90% { transform: skewX(3deg) translateX(4px); }
    92% { transform: none; }
}

@keyframes glitchLayer1 {
    0%, 82%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); }
    84% { opacity: 1; clip-path: inset(20% 0 30% 0); transform: translateX(-6px); }
    86% { opacity: 1; clip-path: inset(60% 0 10% 0); transform: translateX(5px); }
    88% { opacity: 1; clip-path: inset(10% 0 50% 0); transform: translateX(-3px); }
    90% { opacity: 0; clip-path: inset(0 0 100% 0); }
}

@keyframes glitchLayer2 {
    0%, 83%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); }
    85% { opacity: 1; clip-path: inset(40% 0 20% 0); transform: translateX(7px); }
    87% { opacity: 1; clip-path: inset(10% 0 60% 0); transform: translateX(-5px); }
    89% { opacity: 1; clip-path: inset(50% 0 15% 0); transform: translateX(4px); }
    91% { opacity: 0; clip-path: inset(0 0 100% 0); }
}

p {
    color: #4a3618;
    margin-bottom: 30px;
    font-weight: 500;
}

.signup-btn {
    background-color: #2c1e0b;
    color: #e6c85a;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    transition: background-color 0.2s ease;
    animation: btnFlicker 4s 3s infinite;
}

@keyframes btnFlicker {
    0%, 90%, 100% { opacity: 1; }
    91% { opacity: 0.2; }
    92% { opacity: 0.9; }
    93% { opacity: 0.1; }
    94% { opacity: 1; }
    95% { opacity: 0.3; }
    96% { opacity: 0.8; }
    97% { opacity: 0.15; }
    98% { opacity: 1; }
}

.signup-btn:hover {
    background-color: #423018;
    transform: translateY(-2px);
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}

/* ===== GLITCH BAR — horizontal tear ===== */
.glitch-bar {
    position: fixed;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(180, 100, 255, 0.6);
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: screen;
}

@media (min-width: 600px) {
    .card {
        flex-direction: row;
        text-align: left;
    }

    .image-container {
        width: 50%;
        height: 400px;
    }

    .login-container {
        width: 50%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
    }
}
