@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;600;900&display=swap');

:root {
    --a4-primary: #ff00de;
    --a4-secondary: #00ffff;
    --a4-bg: #0a001a;
    --a4-glass: rgba(255, 255, 255, 0.05);
    --a4-glass-border: rgba(255, 255, 255, 0.1);
}

/* Global Styles */
html,
body,
* {
    cursor: url('cursor.svg'), auto !important;
}

/* Override any pointer cursor */
a,
button,
[role="button"],
input,
select,
textarea,
label {
    cursor: url('cursor.svg'), auto !important;
}

body:not(.gameIsStarted) {
    background: transparent !important;
    font-family: 'Outfit', sans-serif !important;
    color: #fff !important;
    overflow: hidden;
    /* Centering Fix */
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    height: 100vh !important;
    width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    /* For orbs */
    cursor: url('cursor.svg'), auto !important;
}

/* Force cursor when UI interaction is active */
body.ui-interaction-active,
body.ui-interaction-active * {
    cursor: url('cursor.svg'), auto !important;
    pointer-events: auto !important;
    /* Ensure everything is clickable */
}

/* Ensure buttons show the custom cursor too */
button,
a,
input,
.session-id,
.pwa-install-btn {
    cursor: url('cursor.svg'), auto !important;
}

/* Moving Orbs */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.1;
    z-index: -1;
    pointer-events: none;
}

.bg-orb.one {
    width: 600px;
    height: 600px;
    background: var(--a4-primary);
    top: -100px;
    left: -100px;
    animation: floatOrb1 15s ease-in-out infinite alternate;
}

.bg-orb.two {
    width: 500px;
    height: 500px;
    background: var(--a4-secondary);
    bottom: -100px;
    right: -100px;
    animation: floatOrb2 20s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    50% {
        transform: translate(150px, 100px) scale(1.1) rotate(180deg);
    }

    100% {
        transform: translate(300px, 200px) scale(1.2) rotate(360deg);
    }
}

@keyframes floatOrb2 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    50% {
        transform: translate(-150px, -100px) scale(1.05) rotate(-180deg);
    }

    100% {
        transform: translate(-300px, -200px) scale(1.1) rotate(-360deg);
    }
}



/* Game Starting Transition */
body.game-starting .start-container,
body.game-starting .disclaimer,
body.game-starting .developed-by,
body.game-starting .click-to-play {
    animation: fadeOutZoom 1.5s ease-out forwards;
}

@keyframes fadeOutZoom {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Logo Zoom & Center Animation */
body.game-starting .a4games-banner {
    animation: zoomCenter 1.5s cubic-bezier(0.2, 1, 0.3, 1) forwards;
    z-index: 2000;
    /* Ensure it stays on top */
}

@keyframes zoomCenter {
    0% {
        transform: scale(1) translateY(0);
    }

    100% {
        transform: scale(1.4) translateY(22vh);
    }
}

/* Background Blur */
body.game-starting::before,
body.game-starting .bg-orb {
    filter: blur(20px);
    transition: filter 1.5s ease;
}

/* Animated Background Particles */
/* Animated Background Particles */
body:not(.gameIsStarted)::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(2px 2px at 40% 70%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(2px 2px at 60% 40%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(2px 2px at 80% 80%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 10% 10%, rgba(255, 0, 222, 0.6), transparent),
        radial-gradient(1px 1px at 90% 90%, rgba(0, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.3), transparent);
    background-size: 550px 550px;
    background-position: 0 0;
    animation: particleFloat 60s linear infinite;
    pointer-events: none;
    z-index: -1;
}

/* Hide Orbs when game starts */
body.gameIsStarted .bg-orb {
    display: none;
}

@keyframes particleFloat {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 550px 550px;
        /* Match background-size for seamless loop */
    }
}

/* Hide banner when game starts, but keep session ID */
body.gameIsStarted .a4games-banner {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.8s ease-out !important;
}

/* Header Branding with Glow Animation */
.a4games-banner {
    position: relative !important;
    /* Changed from fixed to relative for centering */
    top: auto !important;
    left: auto !important;
    width: 100%;
    text-align: center;
    z-index: 1001;
    pointer-events: none;
    animation: fadeInDown 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.8s ease-out;
    margin-bottom: 2rem !important;
    /* Add spacing below title */
    margin-top: -5vh !important;
    /* Slightly raise visual center */
}

.a4games-logo {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5em;
    color: var(--a4-secondary);
    text-shadow:
        0 0 10px rgba(0, 255, 255, 0.6),
        0 0 20px rgba(0, 255, 255, 0.4),
        0 0 30px rgba(0, 255, 255, 0.2);
    margin-bottom: 1rem;
    animation: pulseGlow 3s ease-in-out infinite;
}

.a4games-title {
    font-size: 5rem;
    font-weight: 900;
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, var(--a4-primary) 50%, var(--a4-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(255, 0, 222, 0.5));
    letter-spacing: 0.05em;
    animation: titleShine 4s ease-in-out infinite;
    line-height: 1.1;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        text-shadow:
            0 0 10px rgba(0, 255, 255, 0.6),
            0 0 20px rgba(0, 255, 255, 0.4),
            0 0 30px rgba(0, 255, 255, 0.2);
    }

    50% {
        text-shadow:
            0 0 15px rgba(0, 255, 255, 0.8),
            0 0 30px rgba(0, 255, 255, 0.6),
            0 0 45px rgba(0, 255, 255, 0.4);
    }
}

@keyframes titleShine {

    0%,
    100% {
        filter: drop-shadow(0 0 20px rgba(255, 0, 222, 0.5));
    }

    50% {
        filter: drop-shadow(0 0 30px rgba(255, 0, 222, 0.8));
    }
}

/* Session ID at bottom */
.session-id {
    position: fixed;
    bottom: 0.8rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 400;
    letter-spacing: 0.1em;
    z-index: 1001;
    animation: fadeInUp 1.5s ease-out 0.5s both;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    padding: 0.8rem 2rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    white-space: nowrap;
    min-width: auto;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.session-id:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(0, 255, 255, 0.4);
    color: rgba(0, 255, 255, 0.8);
    transform: translate(-50%, -3px);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Container Animations */
.start-container {
    animation: fadeIn 1s ease-out 0.3s both;
    position: relative;
    z-index: 1;
    padding-bottom: 2rem;
    max-height: none !important;
    overflow-y: visible !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Hide original elements */
.cover {
    display: none !important;
}

.follow-container {
    display: none !important;
}

.jsdos-key {
    display: none !important;
}

/* Modern Play Button with Hover Effects */
#click-to-play-button {
    background: linear-gradient(135deg, rgba(255, 0, 222, 0.2) 0%, rgba(0, 255, 255, 0.15) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background-clip: padding-box !important;
    position: relative !important;
    color: #fff !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    padding: 1.5rem 6rem !important;
    border-radius: 100px !important;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 0 20px rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(20px) !important;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.25em !important;
    cursor: pointer !important;
    overflow: hidden !important;
}

/* Reset unwanted animations from index.html that caused 'brute bar' */
#click-to-play-button::before,
#click-to-play-button::after {
    animation: none !important;
    transform: none !important;
}

#click-to-play-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--a4-primary), var(--a4-secondary));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 100px !important;
}

#click-to-play-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translate(-50%, -50%) scale(0.5);
    /* Proper centering for after */
    border-radius: 100px !important;
}

#click-to-play-button:hover::before {
    opacity: 0.2;
}

#click-to-play-button:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.5);
}

#click-to-play-button:hover {
    transform: translateY(-5px) !important;
    box-shadow:
        0 0 60px rgba(255, 0, 222, 0.5),
        0 0 0 2px rgba(255, 255, 255, 0.4),
        inset 0 0 30px rgba(255, 255, 255, 0.2) !important;
    letter-spacing: 0.35em !important;
    background: linear-gradient(135deg, rgba(255, 0, 222, 0.3) 0%, rgba(0, 255, 255, 0.25) 100%) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

#click-to-play-button:active {
    transform: translateY(-2px) scale(0.98) !important;
    box-shadow: 0 10px 30px rgba(255, 0, 222, 0.3) !important;
}

/* Glassmorphism Containers - Kept from original */
.disclaimer,
.jsdos-key {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(30px) saturate(150%) !important;
    border-radius: 20px !important;
    padding: 2rem !important;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    animation: slideInUp 0.8s ease-out both;
    transition: all 0.3s ease !important;
    max-width: 700px !important;
    /* Ensure proper width in flex col */
    margin: 1rem 0 !important;
}

.disclaimer {
    animation-delay: 0.4s;
}

.jsdos-key {
    animation-delay: 0.5s;
    flex-direction: row !important;
    padding: 1.2rem 2.5rem !important;
    border-radius: 50px !important;
    gap: 1.5rem !important;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.disclaimer:hover,
.jsdos-key:hover {
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

#disclaimer-text {
    font-weight: 900 !important;
    color: var(--a4-primary) !important;
    text-transform: uppercase;
    font-size: 1.1em;
    letter-spacing: 0.05em;
    text-shadow: 0 0 15px rgba(255, 0, 222, 0.4);
}

/* Input Styling */
.jsdos-key-input {
    border: none !important;
    border-bottom: 2px solid rgba(0, 255, 255, 0.3) !important;
    background: transparent !important;
    border-radius: 0 !important;
    font-family: 'Outfit', sans-serif !important;
    width: 200px !important;
    color: #fff !important;
    padding: 0.5rem 0 !important;
    transition: all 0.3s ease !important;
}

.jsdos-key-input:focus {
    border-bottom-color: var(--a4-secondary) !important;
    outline: none !important;
    box-shadow: 0 2px 10px rgba(0, 255, 255, 0.3) !important;
}

.jsdos-key-input::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
}

/* Checkbox Styling */
input[type="checkbox"] {
    accent-color: var(--a4-primary) !important;
    width: 1.2rem !important;
    height: 1.2rem !important;
    cursor: pointer !important;
}

label {
    cursor: pointer !important;
    transition: color 0.2s ease !important;
}

label:hover {
    color: var(--a4-secondary) !important;
}

/* Links */
a {
    color: var(--a4-secondary) !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    position: relative !important;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--a4-secondary);
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

a:hover {
    color: #fff !important;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5) !important;
}

/* Loading Screen Enhancements */
.intro-container {
    background: #000 !important;
    z-index: 2000 !important;
}

.loader-container {
    animation: fadeIn 0.5s ease-out;
}

.progress-bar-container {
    height: 4px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: none !important;
    border-radius: 2px !important;
    overflow: hidden !important;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--a4-secondary), var(--a4-primary)) !important;
    box-shadow:
        0 0 20px var(--a4-secondary),
        0 0 40px var(--a4-primary) !important;
    animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {

    0%,
    100% {
        box-shadow:
            0 0 20px var(--a4-secondary),
            0 0 40px var(--a4-primary);
    }

    50% {
        box-shadow:
            0 0 30px var(--a4-secondary),
            0 0 60px var(--a4-primary);
    }
}

#status {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 300 !important;
    letter-spacing: 0.3em !important;
    text-transform: uppercase !important;
    font-size: 0.9rem !important;
    color: var(--a4-secondary) !important;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5) !important;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* Credits */
.developed-by {
    opacity: 0.3 !important;
    font-size: 0.7rem !important;
    animation: fadeIn 1s ease-out 1s both;
    transition: opacity 0.3s ease !important;
}

.developed-by:hover {
    opacity: 0.6 !important;
}

/* Game Launch Transition */
body.gameIsStarted .start-container {
    animation: zoomOut 1s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}

@keyframes zoomOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .a4games-title {
        font-size: 3rem !important;
    }

    #click-to-play-button {
        font-size: 1.8rem !important;
        padding: 1.2rem 3rem !important;
    }

    .disclaimer,
    .jsdos-key {
        padding: 1.5rem !important;
    }
}

/* PWA Install Button */
.pwa-install-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    bottom: auto;
    right: auto;
    z-index: 1002;
    /* Higher than banner */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--a4-secondary);
    padding: 10px 20px;
    border-radius: 30px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 0.8rem;
}

.pwa-install-btn:hover {
    background: rgba(255, 0, 222, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 255, 0.2);
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
    border-color: rgba(0, 255, 255, 0.4);
}

.pwa-install-btn[hidden] {
    display: none !important;
}

/* Relocate PWA button when game is started */
body.gameIsStarted .pwa-install-btn {
    top: auto !important;
    left: auto !important;
    bottom: 10px !important;
    right: 20px !important;
}

/* Language Toggle Button */
.lang-toggle-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1002;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--a4-secondary);
    padding: 10px 20px;
    border-radius: 30px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 0.8rem;
}

.lang-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 255, 0.2);
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
    border-color: rgba(0, 255, 255, 0.4);
}

body.gameIsStarted .lang-toggle-btn {
    display: none !important;
}

.exit-game-btn {
    position: fixed;
    bottom: 10px;
    left: 20px;
    z-index: 1002;
    background: rgba(255, 0, 222, 0.1);
    backdrop-filter: blur(10px);
    background: rgba(10, 0, 26, 0.8);
    /* Dark background for better visibility */
    border: 1px solid rgba(255, 0, 222, 0.3);
    color: var(--a4-primary);
    padding: 10px 20px;
    border-radius: 30px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 0.8rem;
}

.exit-game-btn:hover {
    background: rgba(255, 0, 222, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 222, 0.3);
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 0, 222, 0.6);
    border-color: rgba(255, 0, 222, 0.6);
}

body.gameIsStarted .exit-game-btn {
    display: flex !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
}

.pwa-install-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    animation: bounceIcon 2s infinite;
}

@keyframes bounceIcon {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-3px);
    }

    60% {
        transform: translateY(-1.5px);
    }
}

/* Notifications */
.a4-notification-area {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 350px;
    max-width: 90vw;
    pointer-events: none;
    /* Let clicks pass through */
}

.a4-notification {
    background: rgba(10, 0, 26, 0.9);
    backdrop-filter: blur(15px);
    border-left: 4px solid var(--a4-primary);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left-width: 4px;
}

.a4-notification.visible {
    opacity: 1;
    transform: translateX(0);
}

.a4-notification.slide-out {
    opacity: 0;
    transform: translateX(50px);
}

.a4-notification.error {
    border-left-color: #ff00de;
    background: linear-gradient(90deg, rgba(255, 0, 222, 0.1), rgba(10, 0, 26, 0.9));
}

.a4-notification.info {
    border-left-color: #00ffff;
}

.notif-icon {
    flex-shrink: 0;
    color: var(--a4-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.a4-notification.error .notif-icon {
    color: var(--a4-primary);
    animation: shake 0.5s ease-in-out;
}

.notif-content {
    line-height: 1.4;
    font-weight: 300;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}