/* =============================================
   AQUARIUM THEME — Welcome / Help Screens
   Phong cách: Đại dương thủy cung, trong trẻo, dễ thương
   ============================================= */

:root {
    --intro-bg:     #dcfdfa;
    --intro-panel:  rgba(255, 255, 255, 0.83);
    --intro-border: rgba(0, 168, 204, 0.3);
    --intro-text:   #005a70;
    --intro-muted:  #007c92;
    --c-aqua-blue:  #00a8cc;
    --c-aqua-mint:  #3dd9a4;
    --c-aqua-coral: #ff7f50;
    --c-aqua-gold:  #ffd23f;
    --c-aqua-shell: #e0f2fe;
}

* { box-sizing: border-box; }

html, body {
    min-height: 100%;
    margin: 0;
}

body {
    font-family: "Quicksand", Arial, sans-serif;
    background: linear-gradient(160deg, #dcfdfa 0%, #cbe2fc 50%, #b8f3ee 100%);
    color: var(--intro-text);
}

/* ---- Welcome & Help screens ---- */
#welcomeScreen,
#helpScreen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    color: var(--intro-text);
    background: linear-gradient(160deg, #dcfdfa 0%, #e0f2fe 45%, #a5ebd9 100%);
}

#helpScreen {
    z-index: 99998;
    display: none;
}

#welcomeScreen.fade-out,
#helpScreen.fade-out {
    pointer-events: none;
    opacity: 0;
    transform: scale(1.06);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* ---- Rising Sea Bubbles ---- */
.stars {
    position: absolute;
    top: 0; left: 0;
    z-index: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.stars::before,
.stars::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0) 70%);
    box-shadow: inset -2px -2px 5px rgba(0, 168, 204, 0.3), 0 3px 6px rgba(0, 168, 204, 0.1);
    opacity: 0.45;
    animation: floatSeaBubble 12s linear infinite;
}

.stars1::before { width: 45px; height: 45px; left: 10%; bottom: -50px; animation-duration: 8s;  animation-delay: 0s; }
.stars1::after  { width: 30px; height: 30px; left: 75%; bottom: -50px; animation-duration: 11s; animation-delay: 2s; }
.stars2::before { width: 55px; height: 55px; left: 45%; bottom: -50px; animation-duration: 14s; animation-delay: 1s; }
.stars2::after  { width: 25px; height: 25px; left: 28%; bottom: -50px; animation-duration: 9s;  animation-delay: 3s; }
.stars3::before { width: 40px; height: 40px; left: 88%; bottom: -50px; animation-duration: 13s; animation-delay: 0.5s; }
.stars3::after  { width: 20px; height: 20px; left: 60%; bottom: -50px; animation-duration: 7s;  animation-delay: 4.5s; }

@keyframes floatSeaBubble {
    0%   { transform: translateY(0) scale(0.9) translateX(0); opacity: 0.1; }
    50%  { opacity: 0.6; transform: translateY(-50vh) scale(1.1) translateX(15px); }
    100% { transform: translateY(-110vh) scale(1) translateX(-10px); opacity: 0; }
}

/* Emoji Trang Trí Thủy Cung */
#welcomeScreen::before {
    content: "🐳";
    position: absolute; top: 7%; right: 9%;
    font-size: 3.6rem; z-index: 1;
    animation: floatAquaEmoji 5s ease-in-out infinite;
    animation-delay: 0s;
}
#welcomeScreen::after {
    content: "🐠";
    position: absolute; bottom: 15%; left: 8%;
    font-size: 3rem; z-index: 1;
    animation: floatAquaEmoji 6s ease-in-out infinite;
    animation-delay: 1.5s;
}

@keyframes floatAquaEmoji {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50%       { transform: translateY(-15px) rotate(4deg); }
}

/* ---- Header / Logo ---- */
.ws-header {
    position: absolute;
    top: 0; left: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem;
}

.ws-logo-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    margin-left: 15px;
}

.ws-logo-container::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    z-index: -1;
    width: 130px; height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,168,204,0.4) 0, rgba(61,217,164,0.15) 50%, rgba(0,0,0,0) 70%);
    filter: blur(12px);
    transform: translate(-50%, -50%);
    animation: pulseAquaGlow 4s ease-in-out infinite alternate;
}

.ws-logo {
    max-width: 120px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0,168,204,0.3));
    animation: floatLogoAqua 6s ease-in-out infinite;
}

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

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

/* ---- Main layout ---- */
.ws-main {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ws-content-wrapper {
    width: 100%;
    max-width: 1000px;
    padding: 2rem;
    text-align: center;
    animation: fadeInScaleAqua 1s ease-out forwards;
}

@keyframes fadeInScaleAqua {
    from { opacity: 0; transform: scale(0.93); }
    to   { opacity: 1; transform: scale(1); }
}

.ws-game-title {
    margin: 0;
    font-family: "Baloo 2", "Quicksand", Arial, sans-serif;
    font-size: clamp(2.4rem, 7vw, 5rem);
    line-height: 1.15;
    color: var(--intro-text);
    background: linear-gradient(to right, var(--c-aqua-blue), var(--c-aqua-mint), var(--c-aqua-blue));
    background-size: 200% auto;
    filter: drop-shadow(0 4px 6px rgba(0,90,112,0.2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: aquaGradientText 5s linear infinite;
}

#helpScreen .ws-game-title {
    font-size: clamp(2rem, 6vw, 3rem);
}

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

.ws-game-subtitle {
    max-width: 740px;
    margin: 0.5rem auto 0;
    color: var(--intro-muted);
    font-size: clamp(1.1rem, 3.2vw, 1.35rem);
    font-weight: 700;
    line-height: 1.6;
    opacity: 0;
    animation: fadeInAqua 2s ease-out 0.5s forwards;
}

@keyframes fadeInAqua {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 0.95; transform: translateY(0); }
}

.ws-button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

/* Nút Jelly đáng yêu */
.ws-btn-primary-cosmic,
#helpScreen .btn-fullscreen,
#helpScreen .btn-play {
    position: relative;
    z-index: 1;
    overflow: hidden;
    min-height: 56px;
    padding: 1rem 2.5rem;
    color: #fff;
    font-family: "Quicksand", Arial, sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: none;
    background: var(--c-aqua-blue);
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 6px 0 #0086a3, 0 8px 16px rgba(0, 168, 204, 0.25);
    transition: all 0.15s ease;
}

.ws-btn-primary-cosmic {
    border-radius: 50px;
    font-size: clamp(1.1rem, 4vw, 1.45rem);
    background: var(--c-aqua-mint);
    box-shadow: 0 6px 0 #2bb082, 0 8px 16px rgba(61,217,164,0.3);
    padding: 1rem 3rem;
    color: #fff;
}

.ws-btn-primary-cosmic::before,
#helpScreen .btn-fullscreen::before,
#helpScreen .btn-play::before {
    display: none;
}

.ws-btn-primary-cosmic::after,
#helpScreen .btn-fullscreen::after,
#helpScreen .btn-play::after {
    display: none;
}

.ws-btn-primary-cosmic span,
#helpScreen .btn-fullscreen span,
#helpScreen .btn-play span {
    position: relative;
    z-index: 2;
    display: inline-block;
    transition: transform 0.1s;
}

.ws-btn-primary-cosmic:hover,
#helpScreen .btn-fullscreen:hover,
#helpScreen .btn-play:hover {
    transform: translateY(2px);
}

.ws-btn-primary-cosmic:hover {
    box-shadow: 0 4px 0 #2bb082, 0 6px 10px rgba(61,217,164,0.2);
}

#helpScreen .btn-fullscreen {
    background: var(--c-aqua-blue);
    box-shadow: 0 6px 0 #0086a3, 0 8px 16px rgba(0,168,204,0.2);
}
#helpScreen .btn-fullscreen:hover {
    box-shadow: 0 4px 0 #0086a3, 0 6px 10px rgba(0,168,204,0.15);
}

#helpScreen .btn-play {
    background: var(--c-aqua-coral);
    box-shadow: 0 6px 0 #d45b2e, 0 8px 16px rgba(255,127,80,0.3);
}
#helpScreen .btn-play:hover {
    box-shadow: 0 4px 0 #d45b2e, 0 6px 10px rgba(255,127,80,0.2);
}

.ws-btn-primary-cosmic:active,
#helpScreen .btn-fullscreen:active,
#helpScreen .btn-play:active {
    transform: translateY(6px);
    box-shadow: none;
}

.ws-more-games-link {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    color: var(--intro-muted);
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.25s ease;
}

.ws-more-games-link:hover {
    color: var(--intro-text);
    background: rgba(0,168,204,0.1);
}

.ws-credit {
    position: absolute;
    bottom: 1rem;
    left: 0;
    z-index: 10;
    width: 100%;
    color: var(--intro-muted);
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
}

.ws-credit a {
    color: var(--c-aqua-blue);
    text-decoration: none;
}

.ws-credit a:hover {
    text-decoration: underline;
}

/* ---- Help Screen Box ---- */
.instruction-box,
.question-count {
    border: 3px solid rgba(0,168,204,0.25);
    border-radius: 18px;
    background: var(--intro-panel);
    box-shadow: 0 8px 24px rgba(0,90,112,0.05);
}

.instruction-box h5 {
    color: var(--intro-text);
    font-family: "Baloo 2", Arial, sans-serif;
    font-size: 1.25rem;
}

.instruction-box p {
    color: var(--intro-muted);
    font-size: 1rem;
    font-weight: 600;
}

.check-icon {
    margin-top: 2px;
    color: var(--c-aqua-mint);
    font-size: 1.5rem;
}

.question-count {
    border-color: rgba(255,127,80,0.25);
    color: var(--c-aqua-coral);
    background: #fffdfb;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.game-screen-root {
    min-height: 100vh;
    padding: 2rem;
    background: linear-gradient(160deg, #dcfdfa 0%, #b8f3ee 100%);
}

.game-placeholder {
    display: flex;
    min-height: calc(100vh - 4rem);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
}

@media (max-width: 575.98px) {
    .ws-logo-container {
        margin-top: 4px;
        margin-left: 4px;
    }

    .ws-logo {
        max-width: 96px;
    }

    .ws-content-wrapper {
        padding: 1rem;
    }

    .instruction-box {
        padding: 1.25rem !important;
    }

    .ws-credit {
        font-size: 0.85rem;
    }
}
