/* ============================================
   R-CORE ARCADEGON — INTRO OVERLAY V2
   Theme: Red & Blue Neon Cyberpunk
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* ---- MAIN OVERLAY ---- */
.intro-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 50% 40%, #0a001a 0%, #000d1a 50%, #000 80%);
    color: #ff3355;
    font-family: "Press Start 2P", monospace;
    font-size: 13px;
    padding: 50px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ---- PARTICLE CANVAS ---- */
#particleCanvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

/* ---- R-CORE LOGO ---- */
.boot-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 40px;
    opacity: 0;
    transform: scale(0.5) translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: blur(6px);
    user-select: none;
    z-index: 1;
    position: relative;
}

.boot-logo.logo-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
}

.boot-logo.logo-glowing .logo-r,
.boot-logo.logo-glowing .logo-core {
    animation: logoPulse 1.2s ease-in-out infinite;
}

.boot-logo.logo-dim {
    opacity: 0.5;
    transform: scale(0.8) translateY(-20px);
    filter: blur(2px);
    transition: opacity 1s ease, transform 1s ease, filter 1s ease;
}

.logo-line {
    display: flex;
    align-items: baseline;
    gap: 0;
}

.logo-r {
    font-size: 72px;
    color: #ff0044;
    text-shadow:
        0 0 20px #ff0044,
        0 0 40px #ff0044,
        0 0 80px #0055ff,
        0 0 120px #0055ff66;
    line-height: 1;
    animation: rgbShift 3s ease-in-out infinite;
}

.logo-dash {
    font-size: 72px;
    color: #3388ff;
    text-shadow: 0 0 20px #3388ff;
    line-height: 1;
    animation: dashFlicker 1.5s infinite;
}

.logo-core {
    font-size: 72px;
    color: #3388ff;
    text-shadow:
        0 0 20px #3388ff,
        0 0 40px #0055ff,
        0 0 80px #0055ff88;
    line-height: 1;
}

.logo-arcadegon {
    font-size: 20px;
    color: #ff4477;
    letter-spacing: 10px;
    text-shadow:
        0 0 10px #ff4477,
        0 0 30px #3388ff,
        0 0 60px #3388ff66;
    margin-top: 2px;
    animation: textFlicker 3s infinite;
}

.logo-version {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 3px;
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.boot-logo.logo-visible .logo-version {
    opacity: 1;
}

/* ---- RGB SHIFT on R letter ---- */
@keyframes rgbShift {
    0%, 100% { filter: none; }
    25% { filter: drop-shadow(2px 0 0 #00ffff) drop-shadow(-2px 0 0 #ff0044); }
    50% { filter: drop-shadow(-2px 0 0 #00ffff) drop-shadow(2px 0 0 #ff0044); }
    75% { filter: drop-shadow(1px 0 0 #ff0044) drop-shadow(-1px 0 0 #00ffff); }
}

@keyframes logoPulse {
    0%, 100% {
        text-shadow:
            0 0 20px #ff0044,
            0 0 40px #ff0044,
            0 0 80px #0055ff,
            0 0 120px #0055ff66;
    }
    50% {
        text-shadow:
            0 0 30px #ff0044,
            0 0 60px #ff0044,
            0 0 100px #0055ff,
            0 0 160px #0055ffaa;
    }
}

@keyframes dashFlicker {
    0%, 100% { opacity: 1; }
    48% { opacity: 1; }
    50% { opacity: 0.05; }
    52% { opacity: 1; }
    94% { opacity: 1; }
    96% { opacity: 0.2; }
    98% { opacity: 1; }
}

/* ---- BOOT SEQUENCE ---- */
.boot-sequence {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 700px;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.boot-sequence.boot-visible {
    opacity: 1;
}

/* Loading bar */
.boot-bar-wrap {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.boot-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff0044, #ff3366, #3388ff, #0055ff);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: barShimmer 1s linear infinite;
    box-shadow: 0 0 10px #ff336688, 0 0 20px #0055ff44;
}

@keyframes barShimmer {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* Boot text */
.crt-text {
    white-space: pre-line;
    text-align: left;
    width: 100%;
    font-size: 11px;
    line-height: 2;
    color: #ff3366;
    text-shadow:
        0 0 8px #ff3366,
        0 0 16px #0055ff66;
    opacity: 0.9;
    animation: textFlicker 4s infinite;
    position: relative;
}

@keyframes textFlicker {
    0%, 100% { opacity: 0.9; }
    3% { opacity: 0.7; }
    6% { opacity: 0.9; }
    50% { opacity: 0.85; }
    53% { opacity: 0.65; }
    55% { opacity: 0.9; }
}

/* Blinking cursor */
.cursor-blink {
    animation: cursorPulse 0.7s infinite;
    color: #ff3366;
}

@keyframes cursorPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ---- STATUS INDICATOR ---- */
.boot-status {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.25);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.boot-status.status-visible {
    opacity: 1;
}

.boot-status i {
    font-size: 14px;
    animation: signalPulse 2s infinite;
}

@keyframes signalPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ---- CRT SCANLINES ---- */
.scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 85, 255, 0.06) 2px,
        rgba(0, 85, 255, 0.06) 4px
    );
    pointer-events: none;
    z-index: 10;
}

/* ---- STATIC NOISE ---- */
.static-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    pointer-events: none;
    z-index: 11;
    opacity: 0.04;
    animation: staticShift 0.4s infinite steps(4);
}

@keyframes staticShift {
    0% { background-position: 0 0; }
    25% { background-position: -5px -3px; }
    50% { background-position: 3px -7px; }
    75% { background-position: -2px 5px; }
    100% { background-position: 0 0; }
}

/* ---- VIGNETTE ---- */
.vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
    z-index: 9;
}

/* ---- RGB SPLIT LAYERS (for glitch) ---- */
.rgb-split {
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: screen;
}

.rgb-split.r {
    background: rgba(255, 0, 0, 0.03);
}
.rgb-split.g {
    background: rgba(0, 255, 255, 0.03);
}
.rgb-split.b {
    background: rgba(0, 0, 255, 0.03);
}

@keyframes rgbGlitchR {
    0%, 90% { transform: translate(0); opacity: 0; }
    91% { transform: translate(3px, -1px); opacity: 0.15; }
    93% { transform: translate(-2px, 2px); opacity: 0.1; }
    95% { transform: translate(4px, 0); opacity: 0.12; }
    100% { transform: translate(0); opacity: 0; }
}

@keyframes rgbGlitchG {
    0%, 88% { transform: translate(0); opacity: 0; }
    89% { transform: translate(-3px, 1px); opacity: 0.1; }
    92% { transform: translate(2px, -2px); opacity: 0.08; }
    94% { transform: translate(-4px, 0); opacity: 0.12; }
    100% { transform: translate(0); opacity: 0; }
}

@keyframes rgbGlitchB {
    0%, 85% { transform: translate(0); opacity: 0; }
    86% { transform: translate(1px, 3px); opacity: 0.12; }
    90% { transform: translate(-3px, -1px); opacity: 0.08; }
    93% { transform: translate(2px, 2px); opacity: 0.1; }
    100% { transform: translate(0); opacity: 0; }
}

/* ---- GLITCH EFFECT ---- */
.intro-glitch {
    animation: glitchFlash 0.25s ease;
    animation-iteration-count: 4;
}

@keyframes glitchFlash {
    0% {
        background: #fff;
        transform: translate(0) skew(0deg);
        filter: brightness(5);
    }
    10% {
        background: #ff0044;
        transform: translate(-5px, 3px) skew(3deg);
        filter: brightness(2);
    }
    20% {
        background: #000;
        transform: translate(4px, -2px) skew(-2deg);
        filter: brightness(3);
    }
    30% {
        background: #0055ff;
        transform: translate(-3px, 4px) skew(4deg);
        filter: brightness(4);
    }
    40% {
        background: #fff;
        transform: translate(6px, -4px) skew(-3deg);
        filter: brightness(6);
    }
    50% {
        background: #000;
        transform: translate(-2px, 2px) skew(1deg);
        filter: brightness(1);
    }
    100% {
        background: #000;
        transform: translate(0) skew(0deg);
        filter: brightness(1);
    }
}

/* ---- WHITEOUT TRANSITION ---- */
.intro-whiteout {
    animation: whiteoutFlash 0.8s forwards;
}

@keyframes whiteoutFlash {
    0% {
        opacity: 1;
        background: #000;
    }
    25% {
        opacity: 1;
        background: #ff0044;
        filter: brightness(6);
    }
    50% {
        background: #fff;
        filter: brightness(10);
    }
    100% {
        opacity: 0;
        background: #fff;
        filter: brightness(0);
        visibility: hidden;
    }
}

/* ---- GLITCH BARS ---- */
.intro-overlay::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff0044, #3388ff, transparent);
    opacity: 0;
    z-index: 12;
    animation: glitchBar 2.5s infinite;
}

.intro-overlay::after {
    content: "";
    position: absolute;
    bottom: 40%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #0055ff, transparent);
    opacity: 0;
    z-index: 12;
    animation: glitchBar2 4.2s infinite;
}

@keyframes glitchBar {
    0%, 92% { opacity: 0; }
    93% { opacity: 0.5; transform: translateY(0); }
    94% { opacity: 0.8; transform: translateY(3px); }
    95% { opacity: 0.2; transform: translateY(-2px); }
    100% { opacity: 0; transform: translateY(0); }
}

@keyframes glitchBar2 {
    0%, 87% { opacity: 0; }
    88% { opacity: 0.3; transform: translateY(0); }
    89% { opacity: 0.6; transform: translateY(-2px); }
    91% { opacity: 0.1; transform: translateY(1px); }
    100% { opacity: 0; transform: translateY(0); }
}

/* ============================================
   EPILEPSY WARNING OVERLAY
   ============================================ */
.warning-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background: radial-gradient(ellipse at center, #0a001a 0%, #000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Press Start 2P', monospace;
    color: #fff;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.warning-overlay.show {
    opacity: 1;
    visibility: visible;
}

.warning-box {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    border: 2px solid #ff2244;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 30px rgba(255, 34, 68, 0.3), inset 0 0 30px rgba(255, 0, 0, 0.05);
    text-align: center;
}

.warning-box::-webkit-scrollbar { width: 4px; }
.warning-box::-webkit-scrollbar-track { background: transparent; }
.warning-box::-webkit-scrollbar-thumb { background: #ff224466; border-radius: 2px; }

.warning-icon {
    font-size: 48px;
    color: #ff2244;
    text-shadow: 0 0 20px #ff2244, 0 0 40px #0044ff44;
    margin-bottom: 16px;
    animation: warnPulse 1s ease-in-out infinite;
}

@keyframes warnPulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.08); opacity: 1; }
}

.warning-title {
    font-size: 16px;
    color: #ff2244;
    text-shadow: 0 0 10px #ff2244;
    margin-bottom: 20px;
}

.warning-text {
    font-size: 10px;
    line-height: 2;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
    text-align: left;
}

.warning-text strong {
    color: #ff4488;
}

.warning-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #ff224466, transparent);
    margin: 20px 0;
}

.warning-scroll-hint {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 16px;
    animation: hintBlink 1.5s infinite;
}

@keyframes hintBlink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.warning-accept-btn {
    display: inline-block;
    padding: 14px 30px;
    background: rgba(255, 34, 68, 0.15);
    border: 2px solid #ff2244;
    color: #ff6688;
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    cursor: pointer;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0.3;
    pointer-events: none;
}

.warning-accept-btn.enabled {
    opacity: 1;
    pointer-events: all;
    background: rgba(255, 34, 68, 0.25);
    color: #ff3366;
    box-shadow: 0 0 15px rgba(255, 34, 68, 0.3);
}

.warning-accept-btn.enabled:hover {
    background: #ff2244;
    color: #000;
    box-shadow: 0 0 25px #ff2244, 0 0 50px #ff224466;
    transform: scale(1.05);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
    .intro-overlay {
        padding: 20px;
    }
    .logo-r,
    .logo-dash,
    .logo-core {
        font-size: 42px;
    }
    .logo-arcadegon {
        font-size: 14px;
        letter-spacing: 4px;
    }
    .crt-text {
        font-size: 9px;
    }
    .boot-logo {
        margin-bottom: 24px;
    }
}
