/* vietnamese */
@font-face {
    font-family: "Quicksand";
    src: url("../fonts/quicksand/6xKtdSZaM9iE8KbpRA_hJFQNcOM.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* latin-ext */
@font-face {
    font-family: "Quicksand";
    src: url("../fonts/quicksand/6xKtdSZaM9iE8KbpRA_hJVQNcOM.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: "Quicksand";
    src: url("../fonts/quicksand/6xKtdSZaM9iE8KbpRA_hK1QN.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* vietnamese */
@font-face {
    font-family: "Baloo 2";
    src: url("../fonts/baloo2/wXKrE3kTposypRyd51fcANwr.woff2") format("woff2");
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* latin-ext */
@font-face {
    font-family: "Baloo 2";
    src: url("../fonts/baloo2/wXKrE3kTposypRyd51bcANwr.woff2") format("woff2");
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: "Baloo 2";
    src: url("../fonts/baloo2/wXKrE3kTposypRyd51jcAA.woff2") format("woff2");
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =============================================
   WELCOME/HELP BASE STYLESHEET (Khung sườn & Layout)
   Chỉ chứa cấu trúc bố cục, không chứa màu sắc và o oải hương nền cụ thể.
   ============================================= */

* {
    box-sizing: border-box;
}

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

body {
    font-family: "Quicksand", Arial, sans-serif;
}

#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: var(--intro-bg);
}

#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;
}

/* Cấu trúc sao/bong bóng nền dùng chung */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

/* ---- 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 {
    max-width: 120px;
    height: auto;
}

/* ---- 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;
}

.ws-game-title {
    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;
}

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

.ws-game-subtitle {
    max-width: 740px;
    margin: 0.5rem auto 0;
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 600;
    line-height: 1.6;
}

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

.ws-btn-primary-cosmic,
#helpScreen .btn-fullscreen,
#helpScreen .btn-play {
    position: relative;
    z-index: 1;
    overflow: hidden;
    min-height: 56px;
    padding: 1rem 2.5rem;
    font-family: "Quicksand", Arial, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    border: 0;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ws-btn-primary-cosmic {
    border-radius: 50px;
    font-size: clamp(1rem, 4vw, 1.5rem);
}

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

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

.ws-btn-primary-cosmic:hover span,
#helpScreen .btn-fullscreen:hover span,
#helpScreen .btn-play:hover span {
    transform: scale(1.04);
}

.ws-more-games-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.ws-more-games-link:hover {
    transform: translateY(-1px);
}

.ws-credit {
    position: absolute;
    bottom: 1rem;
    left: 0;
    z-index: 10;
    width: 100%;
    font-size: 0.9rem;
    text-align: center;
}

.ws-credit a {
    font-weight: 700;
    text-decoration: none;
}

.instruction-box,
.question-count {
    border-width: 1px;
    border-style: solid;
    border-radius: 12px;
}

.instruction-box h5,
.instruction-box p {
    overflow-wrap: anywhere;
}

.instruction-box p {
    opacity: 0.9;
}

.check-icon {
    margin-top: 2px;
    font-size: 1.4rem;
}

.game-screen-root {
    min-height: 100vh;
    padding: 2rem;
}

.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.8rem;
    }
}
