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

/* Override celebration container for Bootstrap Modal overlay */
#effect_container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    pointer-events: none !important;
}
/* Fullscreen Layout Styles */
.game-screen-root {
    min-height: 100vh !important;
    padding: 0 !important;
    position: relative !important;
    overflow: hidden !important;
    width: 100vw !important;
    height: 100vh !important;
}

.game-main-container {
    display: block !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;
    grid-template-columns: none !important;
    gap: 0 !important;
}

.canvas-area {
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    position: absolute !important;
    inset: 0 !important;
    backdrop-filter: none !important;
}

#gameCanvas {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

.game-header-overlay {
    position: absolute !important;
    top: 15px !important;
    left: 20px !important;
    right: 320px !important;
    z-index: 10 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    pointer-events: none !important;
}

.game-header-overlay h2,
.game-header-overlay button,
.game-header-overlay div {
    pointer-events: auto !important;
}

.game-header-overlay h2 {
    background: rgba(255, 255, 255, 0.75) !important;
    padding: 8px 24px !important;
    border-radius: 50px !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(10px) !important;
    font-size: 1.3rem !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    font-family: 'Baloo 2', 'Quicksand', sans-serif !important;
}

.control-sidebar {
    position: absolute !important;
    top: 15px !important;
    right: 20px !important;
    width: 280px !important;
    height: auto !important;
    z-index: 10 !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border: 3px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 24px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
    backdrop-filter: blur(10px) !important;
    max-height: calc(100vh - 40px) !important;
    overflow-y: auto !important;
}
/* ==========================================================================
   CSS Overrides for Floating settings button, Bottom Right spin button,
   and Sidebar to Modal conversion.
   ========================================================================== */
.control-sidebar {
    display: none !important;
}
.canvas-area {
    width: 100% !important;
    flex: 1 !important;
}
.btn-settings-overlay {
    position: absolute !important;
    top: 20px !important;
    right: 30px !important;
    z-index: 1000 !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: #333333 !important;
    font-size: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    padding: 0 !important;
}
.btn-settings-overlay:hover {
    background: rgba(255, 255, 255, 0.5) !important;
    transform: rotate(45deg) scale(1.05) !important;
}
#spinBtn {
    position: absolute !important;
    right: 30px !important;
    bottom: 30px !important;
    z-index: 1000 !important;
    margin: 0 !important;
    width: auto !important;
    min-width: 180px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
}

.btn-bgm-overlay {
    position: absolute !important;
    top: 20px !important;
    right: 90px !important;
    z-index: 1000 !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: #ff8f00 !important;
    font-size: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    padding: 0 !important;
}
.btn-bgm-overlay:hover {
    background: rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.05) !important;
}
.btn-bgm-overlay.muted {
    color: #757575 !important;
    background: rgba(0, 0, 0, 0.1) !important;
}

