
/* =====================================
   GENERAL
===================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #100903;
    font-family: Georgia, serif;
}

#title-screen,
.scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.scene {
    isolation: isolate;
    background: #160d07;
}

/* =====================================
   SHOP BACKGROUND
===================================== */

.background {
    position: absolute;
    inset: -3%;
    z-index: -5;
    background-image: url("images/main-shop.png");
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    transform: scale(1.04);
    will-change: transform;
    transition: transform 0.5s ease-out;
}

.scene-vignette {
    position: absolute;
    inset: 0;
    z-index: -3;
    pointer-events: none;

    background:
        linear-gradient(
            to bottom,
            rgba(10, 5, 2, 0.10),
            transparent 30%,
            transparent 65%,
            rgba(8, 4, 2, 0.42)
        ),
        radial-gradient(
            ellipse at center,
            transparent 30%,
            rgba(0, 0, 0, 0.43) 100%
        );
}

/* =====================================
   WINDOW LIGHT RAYS
===================================== */

.window-light {
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
    mix-blend-mode: screen;
}

.ray {
    position: absolute;
    top: 3%;
    height: 125%;
    transform-origin: top left;
    transform: rotate(-25deg);

    background: linear-gradient(
        to bottom,
        rgba(255, 225, 175, 0.01) 0%,
        rgba(255, 225, 175, 0.13) 18%,
        rgba(255, 211, 145, 0.10) 55%,
        rgba(255, 198, 120, 0.025) 88%,
        transparent 100%
    );

    filter: blur(12px);
    animation: ray-sweep 32s ease-in-out infinite alternate;
}

.ray-one {
    left: 4%;
    width: 13%;
    animation-duration: 35s;
}

.ray-two {
    left: 10%;
    width: 17%;
    opacity: 0.8;
    animation-duration: 42s;
    animation-delay: -13s;
}

.ray-three {
    left: 16%;
    width: 11%;
    opacity: 0.65;
    animation-duration: 38s;
    animation-delay: -21s;
}

.ray-four {
    left: 21%;
    width: 19%;
    opacity: 0.55;
    animation-duration: 46s;
    animation-delay: -8s;
}

.ray-five {
    left: 28%;
    width: 12%;
    opacity: 0.45;
    animation-duration: 40s;
    animation-delay: -27s;
}

@keyframes ray-sweep {
    0% {
        transform: translate(0, 0) rotate(-25deg) scaleX(0.8);
        opacity: 0.35;
    }

    50% {
        opacity: 0.85;
    }

    100% {
        transform: translate(45px, 0) rotate(-21deg) scaleX(1.2);
        opacity: 0.55;
    }
}

/* =====================================
   AMBIENT SHOP LIGHT
===================================== */

.ambient-glow {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;

    background:
        radial-gradient(
            ellipse at 78% 12%,
            rgba(255, 166, 54, 0.12),
            transparent 26%
        ),
        radial-gradient(
            ellipse at 18% 35%,
            rgba(255, 190, 105, 0.10),
            transparent 32%
        );

    animation: ambient-flicker 19s ease-in-out infinite;
}

@keyframes ambient-flicker {
    0%, 100% { opacity: 0.8; }
    35% { opacity: 1; }
    60% { opacity: 0.78; }
    80% { opacity: 0.94; }
}

/* =====================================
   DUST PARTICLES
===================================== */

#dust-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* =====================================
   CURSOR LIGHT
===================================== */

.cursor-glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;

    background: radial-gradient(
        circle,
        rgba(255, 190, 90, 0.10) 0%,
        rgba(255, 170, 65, 0.035) 38%,
        transparent 72%
    );

    transform: translate(-50%, -50%);
    left: 50%;
    top: 50%;
    opacity: 0.8;
    mix-blend-mode: screen;
}

/* =====================================
   LOGO AND TITLE ENTRANCE
===================================== */

.title-content {
    position: absolute;
    top: 46%;
    left: 50%;
    width: min(82vw, 1050px);

    transform: translate(-50%, -50%);

    display: flex;
    flex-direction: column;
    align-items: center;

    z-index: 5;

    animation: title-entrance 5s ease-out both;
}

@keyframes title-entrance {
    0% {
        opacity: 0;
        transform: translate(-50%, -45%);
        filter: blur(10px);
    }

    65% {
        opacity: 0.85;
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%);
        filter: blur(0);
    }
}

/* LOGO IMAGE */

.logo-wrap {
    position: relative;
    width: 100%;
    isolation: isolate;
}

.logo-wrap .game-logo {
    display: block;
    width: 100%;
    height: auto;
    position: relative;
    z-index: 1;
    object-fit: contain;

    filter:
        drop-shadow(0 8px 22px rgba(0, 0, 0, 0.8))
        drop-shadow(0 0 20px rgba(255, 166, 48, 0.20));

    animation: logo-breathe 14s ease-in-out infinite;
}

@keyframes logo-breathe {
    0%, 100% {
        transform: translateY(0);
        filter:
            drop-shadow(0 8px 22px rgba(0, 0, 0, 0.8))
            drop-shadow(0 0 15px rgba(255, 166, 48, 0.15));
    }

    50% {
        transform: translateY(-5px);
        filter:
            drop-shadow(0 8px 22px rgba(0, 0, 0, 0.8))
            drop-shadow(0 0 30px rgba(255, 190, 75, 0.32));
    }
}

/* =====================================
   GOLD LOGO REFLECTION
===================================== */

.logo-shine {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;

    background: linear-gradient(
        110deg,
        transparent 35%,
        rgba(255, 255, 255, 0.03) 42%,
        rgba(255, 242, 205, 0.65) 49%,
        rgba(255, 255, 235, 0.85) 50%,
        rgba(255, 219, 145, 0.35) 52%,
        transparent 60%
    );

    background-size: 250% 100%;
    background-position: 120% 0;

    -webkit-mask-image: url("images/frannis-logo.png");
    mask-image: url("images/frannis-logo.png");

    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;

    opacity: 0;

    animation: metallic-shine 5s ease-in-out 5s infinite;
}

@keyframes metallic-shine {
    0%, 65% {
        background-position: 120% 0;
        opacity: 0;
    }

    68% {
        opacity: 0.8;
    }

    82% {
        background-position: -20% 0;
        opacity: 0.75;
    }

    88%, 100% {
        background-position: -20% 0;
        opacity: 0;
    }
}

/* =====================================
   PRESS START
===================================== */

#start-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 27px;

    margin-top: clamp(22px, 4vh, 42px);
    padding: 15px 25px;

    border: none;
    outline: none;
    background: transparent;

    color: #ffe8bd;
    font-family: Georgia, serif;
    cursor: pointer;

    animation:
        start-entrance 2s ease-out 5s both,
        start-pulse 3.5s ease-in-out 7s infinite;

    transition: opacity 1.5s ease;

    text-shadow:
        0 2px 5px rgba(0, 0, 0, 1),
        0 3px 12px rgba(0, 0, 0, 0.95),
        0 0 12px rgba(255, 190, 100, 0.5);
}

/* Delayed entrance, separate from logo */

@keyframes start-entrance {
    from {
        opacity: 0;
        filter: blur(5px);
    }

    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* PRESS START lettering */

.button-text {
    font-size: clamp(19px, 1.9vw, 25px);
    font-weight: bold;
    letter-spacing: 0.38em;
    white-space: nowrap;
}

.start-star {
    color: #f4ca82;
    font-size: 16px;

    text-shadow:
        0 0 8px rgba(255, 205, 120, 0.9),
        0 0 18px rgba(255, 166, 52, 0.7);
}

/* Continuous subtle glow pulse */

@keyframes start-pulse {
    0%, 100% {
        opacity: 0.78;
        filter: brightness(0.9);

        text-shadow:
            0 2px 5px rgba(0, 0, 0, 1),
            0 3px 12px rgba(0, 0, 0, 0.95),
            0 0 8px rgba(255, 190, 100, 0.3);
    }

    50% {
        opacity: 1;
        filter: brightness(1.3);

        text-shadow:
            0 2px 5px rgba(0, 0, 0, 1),
            0 3px 12px rgba(0, 0, 0, 0.95),
            0 0 15px rgba(255, 218, 150, 1),
            0 0 32px rgba(255, 165, 60, 0.75);
    }
}

/* Absolutely no hover movement or extra hover effect */

#start-button:hover {
    transform: none;
    filter: none;
}

/* =====================================
   START TRANSITION
===================================== */

#transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: #090502;
    opacity: 0;
    pointer-events: none;
    transition: opacity 2.5s ease;
}

#transition-overlay.active {
    opacity: 1;
}

body.started #start-button {
    opacity: 0;
    transform: translateY(15px);
    pointer-events: none;
}

body.started .game-logo {
    animation: logo-exit 3.5s ease forwards;
}

@keyframes logo-exit {
    to {
        opacity: 0;
        transform: scale(1.04);
        filter: blur(12px);
    }
}

/* =====================================
   MOBILE
===================================== */

@media (max-width: 700px) {
    .background {
        background-position: 42% center;
    }

    .title-content {
        width: 94vw;
        top: 45%;
    }

    #start-button {
        margin-top: 25px;
        gap: 18px;
    }

    .button-text {
        font-size: 17px;
    }

    .cursor-glow {
        display: none;
    }
}

/* =====================================
   REDUCED MOTION ACCESSIBILITY
===================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
