/* BADSEED SOIL - Gateway Styles */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: 'Courier New', monospace;
    -webkit-user-select: none;
    user-select: none;
    cursor: none;
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -50%);
    transition: opacity 0.15s ease;
}

.custom-cursor img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ========== INTRO SPLASH ========== */
.intro-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.intro-splash video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.intro-splash.fading {
    animation: introFadeOut 0.8s ease-out forwards;
}

.intro-splash.hidden {
    display: none;
}

@keyframes introFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* ========== CUSTOM CONTEXT MENU ========== */
.context-menu {
    position: fixed;
    background: #000;
    border: 1px solid rgba(192, 192, 192, 0.6);
    border-radius: 3px;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.3),
                0 0 30px rgba(192, 192, 192, 0.1);
    z-index: 500;
    min-width: 160px;
    padding: 8px 0;
}

.context-menu.hidden {
    display: none;
}

.context-menu-header {
    color: rgba(192, 192, 192, 0.9);
    text-shadow: 0 0 8px rgba(192, 192, 192, 0.8),
                 0 0 15px rgba(192, 192, 192, 0.5);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 3px;
    padding: 8px 16px;
    text-align: center;
}

.context-menu-divider {
    height: 1px;
    background: rgba(192, 192, 192, 0.3);
    margin: 6px 0;
}

.context-menu-item {
    display: block;
    color: rgba(192, 192, 192, 0.8);
    text-shadow: 0 0 6px rgba(192, 192, 192, 0.7),
                 0 0 12px rgba(192, 192, 192, 0.4);
    font-size: 11px;
    letter-spacing: 1px;
    padding: 10px 16px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.context-menu-item:hover {
    color: rgba(192, 192, 192, 1);
    background: rgba(192, 192, 192, 0.1);
    text-shadow: 0 0 10px rgba(192, 192, 192, 1),
                 0 0 20px rgba(192, 192, 192, 0.7);
}

/* Fullscreen context menu (mobile long-press) */
.context-menu.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.context-menu.fullscreen .context-menu-header {
    font-size: 18px;
    letter-spacing: 5px;
    padding: 20px;
    margin-bottom: 10px;
}

.context-menu.fullscreen .context-menu-divider {
    width: 60%;
    margin: 12px auto;
}

.context-menu.fullscreen .context-menu-item {
    font-size: 16px;
    letter-spacing: 2px;
    padding: 18px 30px;
    text-align: center;
    width: 100%;
    max-width: 280px;
}

/* Gateway Container */
.gateway {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: #000;
}

.gateway.hidden {
    display: none;
}

/* Seed Background */
.seed-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
}

.seed-image {
    width: 300px;
    height: auto;
    opacity: 0.4;
    position: relative;
    z-index: 2;
}

/* Silver glow behind seed - egg shaped */
.seed-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    height: 500px;
    background: radial-gradient(
        ellipse 50% 60%,
        rgba(192, 192, 192, 0.3) 0%,
        rgba(192, 192, 192, 0.15) 30%,
        rgba(192, 192, 192, 0.05) 50%,
        transparent 70%
    );
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    z-index: 1;
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Iframe hover sync - faster pulse when iframe content is hovered */
.seed-glow.iframe-hover-pulse {
    animation: iframeHoverPulse 1.5s ease-in-out infinite;
}

@keyframes iframeHoverPulse {
    0%, 100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.05);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* Iframe trigger pulse - single burst effect */
.seed-glow.iframe-trigger-pulse {
    animation: iframeTriggerPulse 0.6s ease-out forwards;
}

@keyframes iframeTriggerPulse {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3);
    }
    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Card ready state - subtle indicator that iframe is loaded */
.card.iframe-ready {
    border-color: rgba(192, 192, 192, 0.6);
}

.card.iframe-ready::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border: 1px solid rgba(192, 192, 192, 0);
    transition: border-color 0.3s ease;
}

/* Cards Container */
.cards-container {
    display: flex;
    gap: 40px;
    z-index: 10;
    position: relative;
}

/* Individual Card */
.card {
    width: 280px;
    height: 180px;
    border: 1px solid rgba(192, 192, 192, 0.5);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.8);
    cursor: none;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.card:hover {
    border-color: rgba(192, 192, 192, 0.9);
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.2);
    transform: scale(1.02);
}

.card:active {
    transform: scale(0.98);
}

.card iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
}

/* Video Overlay */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-overlay video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Landscape mode (desktop) - respect height, center horizontally */
@media (orientation: landscape) {
    .video-overlay video {
        width: auto;
        height: 100%;
        max-width: 100%;
    }
}

/* Portrait mode (mobile) - respect width, center vertically */
@media (orientation: portrait) {
    .video-overlay video {
        width: 100%;
        height: auto;
        max-height: 100%;
    }
}

.video-overlay.hidden {
    display: none;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-screen.hidden {
    display: none;
}

/* Loading text at top */
.loading-text {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: rgba(192, 192, 192, 0.5);
    letter-spacing: 2px;
    z-index: 10;
}

.loading-text .dot {
    animation: dotFade 1.5s ease-in-out infinite;
}

.loading-text .dot1 {
    animation-delay: 0s;
}

.loading-text .dot2 {
    animation-delay: 0.3s;
}

.loading-text .dot3 {
    animation-delay: 0.6s;
}

@keyframes dotFade {
    0%, 20% { opacity: 0.2; }
    40%, 60% { opacity: 1; }
    80%, 100% { opacity: 0.2; }
}

.loading-screen.fading {
    animation: fadeToBlack 500ms ease-out forwards;
}

.loading-screen.fading .loading-text {
    animation: fadeOut 400ms ease-out forwards;
}

.loading-screen.fading .loading-favicon-container {
    animation: fadeOut 400ms ease-out forwards;
}

.loading-screen.fading #energy-canvas {
    animation: fadeOut 400ms ease-out forwards;
}

@keyframes fadeToBlack {
    0% { background: #000; }
    100% { background: #000; }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Energy canvas - full screen behind favicon */
#energy-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.loading-favicon-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 200px;
    height: 250px;
    z-index: 10;
}

.loading-favicon {
    width: 64px;
    height: auto;
    position: relative;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(192, 192, 192, 0.8))
            drop-shadow(0 0 40px rgba(192, 192, 192, 0.4));
    animation: faviconPulse 1.5s ease-in-out infinite;
}

@keyframes faviconPulse {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(192, 192, 192, 0.8))
                drop-shadow(0 0 40px rgba(192, 192, 192, 0.4));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(192, 192, 192, 1))
                drop-shadow(0 0 60px rgba(192, 192, 192, 0.6));
        transform: scale(1.05);
    }
}

/* Responsive */
@media (max-width: 960px) {
    .cards-container {
        flex-direction: column;
        gap: 20px;
    }

    .card {
        width: 260px;
        height: 160px;
    }

    .seed-image {
        width: 200px;
    }

    .seed-glow {
        width: 280px;
        height: 280px;
    }
}
