/* =============================================
   COSMIC DARK THEME — Welcome / Help Screens
   Phong cách: Vũ trụ tối, sâu thẳm huyền bí
   ============================================= */

:root {
    --intro-bg: #090a0f;
    --intro-panel: rgba(255, 255, 255, 0.1);
    --intro-border: rgba(255, 255, 255, 0.2);
    --intro-text: #ffffff;
    --intro-muted: #d7e3f4;
    --intro-blue: #4299e1;
    --intro-teal: #4fd1c5;
    --intro-pink: #f687b3;
    --intro-purple: #9f7aea;
}

body {
    background: #f3f7fb;
    color: #1f2937;
}

#welcomeScreen,
#helpScreen {
    color: var(--intro-text);
    background: var(--intro-bg);
}

/* Nền sao nhấp nháy chuyển động */
.stars {
    background-image:
        radial-gradient(2px 2px at 20px 30px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 40px 70px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 50px 160px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 90px 40px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 130px 80px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 160px 120px, #fff, rgba(0, 0, 0, 0));
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: moveStars 150s linear infinite;
}

.stars1 {
    animation-duration: 50s;
    opacity: 0.3;
}

.stars2 {
    animation-duration: 100s;
    opacity: 0.2;
    transform: scale(1.5);
}

.stars3 {
    animation-duration: 150s;
    opacity: 0.1;
    transform: scale(2);
}

@keyframes moveStars {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-200px);
    }
}

#welcomeScreen::after,
#helpScreen::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(66, 153, 225, 0.15) 0, rgba(0, 0, 0, 0) 60%);
}

.ws-logo-container::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: -1;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(66, 153, 225, 0.4) 0, rgba(159, 122, 234, 0.2) 40%, rgba(0, 0, 0, 0) 70%);
    filter: blur(15px);
    transform: translate(-50%, -50%);
    animation: pulseNebula 4s ease-in-out infinite alternate;
}

.ws-logo {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    animation: floatLogo 6s ease-in-out infinite;
}

@keyframes pulseNebula {
    from {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes floatLogo {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.ws-game-title {
    color: #fff;
    background: linear-gradient(to right, var(--intro-teal), var(--intro-pink), var(--intro-teal));
    background-size: 200% auto;
    filter: drop-shadow(0 0 10px rgba(246, 135, 179, 0.5));
    animation: gradientText 5s linear infinite;
    margin: 0;
    font-family: "Baloo 2", "Quicksand", Arial, sans-serif;
    font-size: clamp(2.4rem, 7vw, 5rem);
    line-height: 1.15;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes gradientText {
    from {
        background-position: 0 center;
    }
    to {
        background-position: 200% center;
    }
}

.ws-game-subtitle {
    color: var(--intro-muted);
    opacity: 0;
    animation: fadeIn 2s ease-out 0.5s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 0.92;
        transform: translateY(0);
    }
}

/* Nút bấm vũ trụ phát sáng */
.ws-btn-primary-cosmic,
#helpScreen .btn-fullscreen,
#helpScreen .btn-play {
    color: #fff;
    background: #0f172a;
    border-radius: 10px;
}

.ws-btn-primary-cosmic {
    border-radius: 50px;
}

.ws-btn-primary-cosmic::before,
#helpScreen .btn-fullscreen::before,
#helpScreen .btn-play::before {
    content: "";
    position: absolute;
    inset: -3px;
    z-index: -1;
    background: linear-gradient(45deg, var(--intro-blue), var(--intro-purple), #ed64a6, var(--intro-blue));
    background-size: 400%;
    border-radius: inherit;
    opacity: 0.85;
    animation: animateBorder 4s linear infinite;
}

.ws-btn-primary-cosmic::after,
#helpScreen .btn-fullscreen::after,
#helpScreen .btn-play::after {
    content: "";
    position: absolute;
    inset: 3px;
    z-index: -1;
    background: #0f172a;
    border-radius: inherit;
    transition: background 0.3s;
}

.ws-btn-primary-cosmic span,
#helpScreen .btn-fullscreen span,
#helpScreen .btn-play span {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.ws-btn-primary-cosmic:hover,
#helpScreen .btn-fullscreen:hover,
#helpScreen .btn-play:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45);
}

.ws-btn-primary-cosmic:hover::after,
#helpScreen .btn-fullscreen:hover::after,
#helpScreen .btn-play:hover::after {
    background: #1e3a8a;
}

@keyframes animateBorder {
    0% {
        background-position: 0 0;
    }
    50% {
        background-position: 300% 0;
    }
    100% {
        background-position: 0 0;
    }
}

.ws-more-games-link {
    color: #a0aec0;
}

.ws-more-games-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.ws-credit {
    color: rgba(255, 255, 255, 0.45);
}

.ws-credit a {
    color: var(--intro-purple);
}

.instruction-box,
.question-count {
    border: 1px solid var(--intro-border);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.08));
}

.check-icon {
    color: #a7f3d0;
}

.game-screen-root {
    background: var(--intro-bg);
}
