/* =========================================
   GLOBAL STYLES
========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Noto Sans Malayalam', sans-serif;
    background: #ffffff;
    color: #181d21;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

/* =========================================
   MATHRUBHUMI HEADER
========================================= */

.game-header {
    width: 100%;
    background: #005d91;
    color: white;
}

.game-header-container {
    max-width: 1200px;
    min-height: 70px;
    margin: auto;
    padding: 15px 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.back-to-games {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    width: fit-content;
}

.back-to-games:hover {
    color: #b9e7ff;
}

.mathrubhumi-logo {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    color: white;
}

.mathrubhumi-logo span {
    color: #b9e7ff;
}

/* =========================================
   GAME START SCREEN
========================================= */

.game-main {
    width: 100%;
}

.game-start-screen {
    position: relative;
    width: 100%;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #17324d;
}

/* Game Background Image */

.game-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Dark Background Overlay */

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

/* Game Start Content */

.game-start-content {
    position: relative;
    z-index: 2;
    max-width: 850px;
    padding: 40px 25px;
    text-align: center;
    color: white;
}

.game-category {
    display: inline-block;
    padding: 7px 20px;
    background: #005d91;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 18px;
}

.game-start-content h1 {
    font-size: clamp(36px, 5vw, 70px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 15px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.malayalam-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
}

.game-description {
    font-size: 16px;
    line-height: 1.8;
    max-width: 650px;
    margin: 0 auto 25px;
}

/* =========================================
   PLAY GAME BUTTON
========================================= */

.start-game-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #005d91;
    color: #ffffff;
    border: 3px solid #ffffff;
    border-radius: 35px;
    padding: 13px 32px;
    font-size: 20px;
    font-weight: 700;
    margin-top: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: 0.3s;
}

.start-game-btn:hover {
    background: #007bb5;
    transform: scale(1.05);
}

.game-unavailable {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
}

/* =========================================
   ACTUAL GAME PLAYER
========================================= */

.game-player-section {
    width: 100%;
    background: #eef3f8;
}

/* Game Toolbar */

.game-player-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    background: #ffffff;
    border-bottom: 1px solid #dce4ec;
}

.game-player-toolbar h3 {
    font-size: 18px;
    color: #17324d;
}

.game-player-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.game-player-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: #005d91;
    color: white;
    border: none;
    border-radius: 7px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    transition: 0.2s;
}

.game-player-actions button:hover {
    background: #00466e;
}

#closeGameBtn {
    background: #dc3545;
}

#closeGameBtn:hover {
    background: #b91c1c;
}

/* =========================================
   GAME IFRAME
========================================= */

.game-frame-container {
    width: 100%;
    height: 75vh;
    min-height: 550px;
    background: #ffffff;
}

#gameFrame {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

/* Fullscreen */

.game-frame-container:fullscreen {
    width: 100vw;
    height: 100vh;
    min-height: 0;
}

.game-frame-container:fullscreen iframe {
    width: 100%;
    height: 100%;
}

/* Fallback Link */

.game-fallback {
    text-align: center;
    padding: 12px;
    background: #eef3f8;
}

.game-fallback a {
    font-size: 13px;
    color: #005d91;
}

.game-fallback a:hover {
    text-decoration: underline;
}

/* =========================================
   COMMON FOOTER
========================================= */

.game-footer {
    background: #073b5c;
    color: #ffffff;
    padding: 30px 20px 18px;
}

.game-footer-container {
    max-width: 1200px;
    margin: auto;
}

/* =========================================
   DISCOVER MORE GAMES
========================================= */

.discover-games h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 15px;
}

.related-games-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

/* Related Game Card */

.related-game-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #235775;
    border-radius: 8px;
    min-width: 0;
    transition: 0.3s;
}

.related-game-card:hover {
    background: #347697;
    transform: translateY(-3px);
}

/* Related Game Thumbnail */

.related-game-card img {
    width: 70px;
    height: 65px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.related-placeholder {
    width: 70px;
    height: 65px;
    background: #dceef9;
    color: #005d91;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border-radius: 6px;
    flex-shrink: 0;
}

/* Related Game Information */

.related-game-info {
    flex: 1;
    min-width: 0;
}

.related-game-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: #b9e7ff;
    text-transform: uppercase;
    margin-bottom: 5px;
    overflow-wrap: anywhere;
}

.related-game-info p {
    font-size: 12px;
    color: #ffffff;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* All Games Link */

.all-games-link {
    text-align: center;
    margin: 15px 0;
}

.all-games-link a {
    font-size: 14px;
    font-weight: 600;
    color: #8edcff;
}

.all-games-link a:hover {
    text-decoration: underline;
}

/* =========================================
   FOOTER BOTTOM
========================================= */

.game-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* Social Media Sharing */

.share-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-section span {
    font-size: 14px;
    font-weight: 600;
}

.share-button {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    transition: 0.3s;
}

.share-button.facebook:hover {
    background: #1877f2;
}

.share-button.twitter:hover {
    background: #000000;
}

.share-button.whatsapp:hover {
    background: #25d366;
}

.share-button.copy-link:hover {
    background: #007bb5;
}

/* Copyright */

.copyright {
    font-size: 12px;
    color: #ffffff;
}

/* =========================================
   TABLET RESPONSIVE
========================================= */

@media (max-width: 992px) {

    .game-start-screen {
        min-height: 500px;
    }

    .game-start-content h1 {
        font-size: 48px;
    }

    .related-games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .game-frame-container {
        min-height: 450px;
    }

}

/* =========================================
   MOBILE RESPONSIVE
========================================= */

@media (max-width: 600px) {

    .game-header-container {
        grid-template-columns: 1fr auto;
        padding: 12px 15px;
        min-height: 60px;
    }

    .header-right {
        display: none;
    }

    .mathrubhumi-logo {
        font-size: 22px;
    }

    .back-to-games {
        font-size: 11px;
    }

    .game-start-screen {
        min-height: 450px;
    }

    .game-start-content {
        padding: 25px 15px;
    }

    .game-start-content h1 {
        font-size: 36px;
    }

    .malayalam-title {
        font-size: 22px;
    }

    .game-description {
        font-size: 13px;
    }

    .start-game-btn {
        font-size: 16px;
        padding: 12px 25px;
    }

    .game-player-toolbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }

    .game-player-actions {
        gap: 6px;
    }

    .game-player-actions button {
        font-size: 11px;
        padding: 9px 12px;
    }

    .game-frame-container {
        height: 75vh;
        min-height: 350px;
    }

    .related-games-grid {
        grid-template-columns: 1fr;
    }

    .game-footer {
        padding: 25px 15px 15px;
    }

    .game-footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

}

/* AI Generated Image Credit */

.landing-copyright {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
}

.ai-image-credit {
    font-size: 12px;
    font-weight: 400;
    color: #555555;
}

.copyright-divider {
    color: #999999;
}

/* Mobile Responsive */

@media (max-width: 600px) {

    .landing-copyright {
        flex-direction: column;
        text-align: center;
        gap: 6px;
    }

    .copyright-divider {
        display: none;
    }

}

/* =========================================
   COMPACT, DIMMED FOOTER
   (smaller text + muted colours; overrides earlier footer rules)
========================================= */

.home-footer,
.game-footer {
    padding-top: 14px;
    padding-bottom: 12px;
}

.footer-all-games {
    padding-bottom: 10px;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.footer-all-games a,
.all-games-link a {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
}

.footer-all-games a:hover,
.all-games-link a:hover {
    color: rgba(255, 255, 255, 0.85);
}

.footer-bottom,
.game-footer-bottom {
    padding-top: 10px;
    border-top-color: rgba(255, 255, 255, 0.1);
}

.footer-share span,
.share-section span {
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
}

.footer-share,
.share-section {
    gap: 6px;
}

.footer-share button,
.share-button {
    width: 26px;
    height: 26px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.55);
}

.footer-share button:hover,
.share-button:hover {
    color: #ffffff;
}

.landing-copyright,
.footer-copyright,
.copyright {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.45);
}

.landing-copyright .ai-image-credit,
.footer-copyright .ai-image-credit,
.copyright .ai-image-credit,
.game-footer .ai-image-credit {
    font-size: 10px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
}

.landing-copyright .copyright-divider,
.footer-copyright .copyright-divider,
.game-footer .copyright-divider {
    color: rgba(255, 255, 255, 0.25);
}

@media (max-width: 600px) {

    .landing-copyright,
    .footer-copyright,
    .copyright {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 2px;
    }

    .landing-copyright .copyright-divider,
    .footer-copyright .copyright-divider,
    .game-footer .copyright-divider {
        display: none;
    }

}

/* =========================================
   FIT GAMES ON PHONES (scaled by play_game.php)
========================================= */

.game-frame-container {
    position: relative;
    overflow: hidden;
}

#gameFrame {
    transform-origin: 0 0;
}

@media (max-width: 600px) {

    .game-frame-container {
        height: calc(100svh - 170px);
        min-height: 420px;
    }

}

/* =========================================
   GAME LANDING SCREEN (full page, like the mockup)
========================================= */

/* While the landing screen is showing, hide the normal page chrome */
body.gl-landing .game-header,
body.gl-landing .kids-sections,
body.gl-landing .game-footer {
    display: none !important;
}

.gl-hero {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: #f5f7fa;
    font-family: 'Poppins', 'Noto Sans Malayalam', sans-serif;
}

.gl-hero[hidden] {
    display: none;
}

/* Background art: right side, softly washed out */

.gl-art {
    position: absolute;
    inset: 0 0 0 30%;
    background-size: cover;
    background-position: center;
}

.gl-fade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            #f5f7fa 0%,
            #f5f7fa 30%,
            rgba(245, 247, 250, 0.92) 40%,
            rgba(245, 247, 250, 0.6) 55%,
            rgba(245, 247, 250, 0.38) 75%,
            rgba(245, 247, 250, 0.3) 100%
        );
}

/* Top bar */

.gl-topbar,
.gl-content,
.gl-bottombar {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding-left: 40px;
    padding-right: 40px;
    box-sizing: border-box;
}

.gl-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 26px;
}

.gl-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gl-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #16191d;
    background: #ffffff;
    border: 1px solid #d9dee5;
    border-radius: 999px;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.gl-back:hover {
    border-color: #005d91;
    box-shadow: 0 4px 12px rgba(0, 93, 145, 0.12);
}

.gl-back i {
    font-size: 12px;
    color: #005d91;
}

.gl-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.gl-logo-mark {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    background: #1976bc;
    border-radius: 6px;
}

.gl-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.gl-logo-text strong {
    font-size: 14px;
    font-weight: 700;
    color: #005d91;
}

.gl-logo-text small {
    font-family: 'Noto Sans Malayalam', sans-serif;
    font-size: 10px;
    color: #16191d;
}

.gl-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    color: #16191d;
    background: #ffc21a;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(255, 180, 0, 0.3);
}

.gl-badge small {
    font-size: 11px;
    font-weight: 600;
}

/* Main content */

.gl-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 30px;
    padding-bottom: 30px;
}

.gl-content > * {
    max-width: 520px;
}

.gl-title {
    margin: 0 0 14px;
    font-family: 'Luckiest Guy', 'Noto Sans Malayalam', 'Poppins', cursive;
    font-weight: 400;
    line-height: 0.92;
    letter-spacing: 1px;
    text-transform: uppercase;
    overflow-wrap: normal;
    word-break: normal;
}

.gl-title-top,
.gl-title-bottom {
    display: block;
    font-size: clamp(42px, 6vw, 88px);
}

/* Long game names get a smaller title */

.gl-title-long .gl-title-top,
.gl-title-long .gl-title-bottom {
    font-size: clamp(36px, 4.6vw, 66px);
}

.gl-title-top {
    color: #16191d;
}

.gl-title-bottom {
    color: #ffb400;
}

.gl-malayalam {
    margin: 0 0 56px;
    font-family: 'Noto Sans Malayalam', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #005d91;
}

.gl-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
}

.gl-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #005d91;
}

.gl-pill {
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #3d2a00;
    background: #ffc21a;
    border-radius: 999px;
}

.gl-desc {
    max-width: 330px !important;
    margin: 0 0 36px;
    font-size: 14px;
    line-height: 1.6;
    color: #2d3540;
}

.gl-start {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 260px;
    padding: 13px 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: #ffffff;
    background: #0a5a95;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 0 #07436f;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.gl-start:hover {
    background: #0b67aa;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #07436f, 0 14px 24px rgba(10, 90, 149, 0.25);
}

.gl-start:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #07436f;
}

.gl-start-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #0a5a95;
    background: #ffffff;
    border-radius: 50%;
    transform: rotate(-35deg);
}

.gl-unavailable {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    font-weight: 600;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
}

/* Bottom bar */

.gl-bottombar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 18px;
    padding-bottom: 22px;
}

.gl-bottombar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 40px;
    right: 40px;
    height: 1px;
    background: rgba(22, 25, 29, 0.12);
}

.gl-share {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gl-share span {
    font-size: 13px;
    font-weight: 700;
    color: #005d91;
    margin-right: 4px;
}

.gl-share button {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #ffffff;
    background: #0a5a95;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}

.gl-share button:hover {
    background: #0b67aa;
    transform: translateY(-2px);
}

.gl-copy {
    margin: 0;
    font-size: 12px;
    color: #16191d;
}

/* Night mode */

html[data-theme="dark"] .gl-hero {
    background: #0f1720;
}

html[data-theme="dark"] .gl-fade {
    background: linear-gradient(
        90deg,
        #0f1720 0%,
        #0f1720 30%,
        rgba(15, 23, 32, 0.92) 40%,
        rgba(15, 23, 32, 0.55) 55%,
        rgba(15, 23, 32, 0.25) 75%,
        rgba(15, 23, 32, 0.15) 100%
    );
}

html[data-theme="dark"] .gl-title-top,
html[data-theme="dark"] .gl-copy,
html[data-theme="dark"] .gl-desc {
    color: #f1f5f9;
}

html[data-theme="dark"] .gl-malayalam,
html[data-theme="dark"] .gl-eyebrow,
html[data-theme="dark"] .gl-share span,
html[data-theme="dark"] .gl-logo-text strong {
    color: #7cc4f5;
}

html[data-theme="dark"] .gl-logo-text small {
    color: #e2e8f0;
}

/* Tablet */

@media (max-width: 900px) {

    .gl-art {
        inset: 0;
    }

    .gl-fade {
        background: linear-gradient(
            90deg,
            rgba(245, 247, 250, 0.96) 0%,
            rgba(245, 247, 250, 0.85) 60%,
            rgba(245, 247, 250, 0.6) 100%
        );
    }

}

/* Round icon button (phone top bar) */

.gl-round {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #0a5a95;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
    text-decoration: none;
}

/* Phone - full-screen picture with text at the bottom */

@media (max-width: 600px) {

    .gl-topbar,
    .gl-content,
    .gl-bottombar {
        padding-left: 18px;
        padding-right: 18px;
    }

    .gl-topbar {
        padding-top: 14px;
    }

    .gl-back,
    .gl-badge {
        display: none;
    }

    .gl-round {
        display: inline-flex;
    }

    .gl-logo-mark {
        width: 32px;
        height: 32px;
        font-size: 17px;
    }

    .gl-logo-text strong {
        font-size: 15px;
    }

    .gl-logo-text small {
        font-size: 11px;
    }

    .gl-art {
        inset: 0;
    }

    .gl-fade {
        background: linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.3) 0%,
            rgba(255, 255, 255, 0.4) 35%,
            rgba(255, 255, 255, 0.72) 55%,
            rgba(255, 255, 255, 0.9) 72%,
            #ffffff 88%
        );
    }

    html[data-theme="dark"] .gl-fade {
        background: linear-gradient(
            180deg,
            rgba(15, 23, 32, 0.3) 0%,
            rgba(15, 23, 32, 0.45) 35%,
            rgba(15, 23, 32, 0.75) 55%,
            rgba(15, 23, 32, 0.92) 72%,
            #0f1720 88%
        );
    }

    .gl-hero {
        background: #ffffff;
    }

    .gl-content {
        justify-content: flex-end;
        padding-top: 160px;
        padding-bottom: 26px;
    }

    .gl-title-top,
    .gl-title-bottom {
        font-size: 52px;
    }

    .gl-title-long .gl-title-top,
    .gl-title-long .gl-title-bottom {
        font-size: 38px;
    }

    .gl-malayalam {
        font-size: 15px;
        margin-bottom: 24px;
    }

    .gl-eyebrow {
        font-size: 12px;
    }

    .gl-desc {
        max-width: none !important;
        font-size: 14px;
        margin-bottom: 30px;
    }

    .gl-start {
        width: 100%;
        max-width: none;
        padding: 15px 20px;
        font-size: 20px;
        box-shadow: 0 5px 0 #07436f, 0 12px 22px rgba(10, 90, 149, 0.25);
    }

    .gl-bottombar {
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        text-align: center;
        padding-top: 20px;
        padding-bottom: 24px;
    }

    .gl-bottombar::before {
        left: 18px;
        right: 18px;
    }

    .gl-share span {
        color: #16191d;
    }

    .gl-share button {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .gl-copy {
        font-weight: 600;
    }

}

/* Play button in the same chunky font as the title */

.gl-start {
    font-family: 'Luckiest Guy', 'Noto Sans Malayalam', 'Poppins', cursive;
    font-weight: 400;
    font-size: 26px;
    letter-spacing: 0.5px;
    width: 280px;
    padding: 12px 20px;
    gap: 12px;
}

@media (max-width: 600px) {

    .gl-start {
        width: 100%;
        font-size: 28px;
        padding: 13px 20px;
    }

}

/* AI image note next to the copyright */

.gl-copy {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.gl-ai-note {
    color: inherit;
}

.gl-copy-divider {
    color: inherit;
}

html[data-theme="dark"] .gl-ai-note {
    color: inherit;
}

@media (max-width: 600px) {

    .gl-copy {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .gl-ai-note {
        font-weight: 400;
        font-size: 11px;
    }

    .gl-copy-divider {
        display: none;
    }

}

/* Bigger game name + tidy Play button */

.gl-title-top,
.gl-title-bottom {
    font-size: clamp(54px, 7.5vw, 110px);
}

.gl-title-long .gl-title-top,
.gl-title-long .gl-title-bottom {
    font-size: clamp(46px, 6vw, 88px);
}

.gl-content > .gl-title {
    max-width: 720px;
}

.gl-start {
    margin-top: 8px;
    line-height: 1;
    justify-content: center;
}

.gl-start-icon {
    flex-shrink: 0;
    margin-top: -2px;
}

.gl-meta + .gl-start {
    margin-top: 26px;
}

@media (max-width: 600px) {

    .gl-title-top,
    .gl-title-bottom {
        font-size: 62px;
    }

    .gl-title-long .gl-title-top,
    .gl-title-long .gl-title-bottom {
        font-size: 46px;
    }

}

/* =========================================
   GAME PLAYING SCREEN (full page, like the mockup)
========================================= */

body.gl-playing .game-header,
body.gl-playing .kids-sections,
body.gl-playing .game-footer {
    display: none !important;
}

body.gl-playing {
    background: #ffffff;
}

.game-player-section {
    background: #ffffff;
}

.game-player-section[hidden] {
    display: none;
}

/* Top bar */

.gp-topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    height: 76px;
    padding: 0 24px;
    background: #ffffff;
    box-sizing: border-box;
}

.gp-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.gp-topbar-right {
    justify-self: end;
}

.gp-title {
    margin: 0;
    font-family: 'Luckiest Guy', 'Noto Sans Malayalam', 'Poppins', cursive;
    font-weight: 400;
    font-size: 30px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #16191d;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50vw;
}

/* Game area */

.gp-frame {
    position: relative;
    height: calc(100vh - 76px) !important;
    height: calc(100svh - 76px) !important;
    min-height: 360px !important;
    overflow: hidden;
    background: #0f1720;
    border-radius: 18px 18px 0 0;
}

.gp-frame:fullscreen {
    height: 100vh !important;
    border-radius: 0;
}

/* Floating buttons over the game */

.gp-controls {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 5;
    display: flex;
    gap: 10px;
}

.gp-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s, box-shadow 0.15s;
}

.gp-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.gp-btn-white {
    color: #0a5a95;
    background: #ffffff;
}

.gp-btn-blue {
    color: #ffffff;
    background: #0a5a95;
}

.gp-btn-pink,
#closeGameBtn.gp-btn-pink,
#closeGameBtn.gp-btn-pink:hover {
    color: #c81e3a;
    background: #ffd6de;
}

/* Night mode */

html[data-theme="dark"] body.gl-playing,
html[data-theme="dark"] .game-player-section,
html[data-theme="dark"] .gp-topbar {
    background: #0f1720;
}

html[data-theme="dark"] .gp-title {
    color: #f1f5f9;
}

/* Phone */

@media (max-width: 600px) {

    .gp-topbar {
        height: 60px;
        padding: 0 12px;
        gap: 8px;
    }

    .gp-frame {
        height: calc(100vh - 60px) !important;
        height: calc(100svh - 60px) !important;
        border-radius: 14px 14px 0 0;
    }

    .gp-logo,
    .gl-back span {
        display: none;
    }

    .gp-topbar .gl-back {
        display: inline-flex;
        width: 38px;
        height: 38px;
        padding: 0;
        justify-content: center;
    }

    .gp-title {
        font-size: 22px;
        max-width: 60vw;
    }

    .gp-controls {
        top: 10px;
        right: 10px;
        gap: 8px;
    }

    .gp-btn {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

}

/* Top bar without the game name */

.gp-topbar {
    display: flex;
    justify-content: flex-start;
}

/* Logo on top of the game - only in fullscreen */

.gp-fs-logo {
    display: none;
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 5;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    pointer-events: none;
}

.gp-frame:fullscreen .gp-fs-logo,
.gp-frame:-webkit-full-screen .gp-fs-logo {
    display: flex;
}

.gp-fs-logo .gl-logo-text {
    display: flex;
}

@media (max-width: 600px) {

    .gp-fs-logo {
        top: 10px;
        left: 10px;
        padding: 0;
    }

    .gp-fs-logo .gl-logo-mark {
        width: 28px;
        height: 28px;
        font-size: 15px;
    }

    .gp-fs-logo .gl-logo-text strong {
        font-size: 13px;
    }

    .gp-fs-logo .gl-logo-text small {
        font-size: 10px;
    }

}

/* Footer under the game (playing screen) */

.gp-bottombar {
    max-width: none;
    height: 64px;
    padding-top: 0;
    padding-bottom: 0;
    background: #ffffff;
}

.gp-bottombar::before {
    left: 24px;
    right: 24px;
}

/* leave room for the footer so it is visible without scrolling */
.gp-frame {
    height: calc(100vh - 76px - 64px) !important;
    height: calc(100svh - 76px - 64px) !important;
}

.gp-frame:fullscreen {
    height: 100vh !important;
}

html[data-theme="dark"] .gp-bottombar {
    background: #0f1720;
}

@media (max-width: 600px) {

    /* on phones the game keeps the full screen; footer is just below it */
    .gp-frame {
        height: calc(100vh - 60px) !important;
        height: calc(100svh - 60px) !important;
    }

    .gp-bottombar {
        height: auto;
        padding-top: 18px;
        padding-bottom: 22px;
    }

    .gp-bottombar::before {
        left: 18px;
        right: 18px;
    }

}

/* =========================================
   PLAYING SCREEN - frosted (blurred) header and footer
========================================= */

.game-player-section {
    position: relative;
    overflow: hidden;
    background: #f5f7fa;
}

.gp-bg {
    position: absolute;
    inset: -40px;
    z-index: 0;
    background-size: cover;
    background-position: center;
    filter: blur(28px) saturate(1.2);
    opacity: 0.55;
    pointer-events: none;
}

.gp-topbar,
.gp-frame,
.gp-bottombar {
    position: relative;
    z-index: 1;
}

.gp-topbar,
.gp-bottombar {
    background: rgba(255, 255, 255, 0.45);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    backdrop-filter: blur(16px) saturate(1.3);
}

.gp-bottombar::before {
    background: rgba(22, 25, 29, 0.1);
}

html[data-theme="dark"] .game-player-section {
    background: #0f1720;
}

html[data-theme="dark"] .gp-bg {
    opacity: 0.35;
}

html[data-theme="dark"] .gp-topbar,
html[data-theme="dark"] .gp-bottombar {
    background: rgba(15, 23, 32, 0.55);
}

/* Landing title in the Luckiest Guy font */

.gl-title {
    font-family: 'Luckiest Guy', 'Noto Sans Malayalam', 'Poppins', cursive;
    font-weight: 400;
    letter-spacing: 1px;
    line-height: 1;
}

/* Phone: bigger game name */

@media (max-width: 600px) {

    .gl-title-top,
    .gl-title-bottom {
        font-size: 72px;
    }

    .gl-title-long .gl-title-top,
    .gl-title-long .gl-title-bottom {
        font-size: 58px;
    }

}

/* =========================================
   PLAYING SCREEN - buttons in the header, logo on phones too
========================================= */

.gp-topbar {
    justify-content: space-between;
}

.gp-topbar .gp-controls {
    position: static;
    display: flex;
    gap: 10px;
}

.gp-topbar .gp-btn {
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.15);
}

@media (max-width: 600px) {

    .gp-topbar .gp-logo {
        display: inline-flex;
    }

    .gp-topbar .gp-logo .gl-logo-text {
        display: flex;
    }

    .gp-topbar .gp-logo .gl-logo-mark {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }

    .gp-topbar .gp-logo .gl-logo-text strong {
        font-size: 13px;
    }

    .gp-topbar .gp-logo .gl-logo-text small {
        font-size: 10px;
    }

    .gp-topbar-left {
        gap: 10px;
    }

    .gp-topbar .gp-controls {
        gap: 8px;
    }

}

/* Exit-fullscreen button on the game (only visible in fullscreen) */

.gp-fs-exit {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 6;
}

.gp-frame:fullscreen .gp-fs-exit,
.gp-frame:-webkit-full-screen .gp-fs-exit {
    display: inline-flex;
}

/* Site-wide display font on the game page */

h1, h2, h3, h4,
.gl-start,
.gl-back,
.gl-badge,
.share-section span,
.gl-share span {
    font-family: 'Luckiest Guy', 'Noto Sans Malayalam', 'Poppins', cursive;
    font-weight: 400;
    letter-spacing: 0.5px;
}
.gl-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.gl-logo-img {
    width: 280px;
    height: auto;
    object-fit: contain;
    display: block;
}

@media (max-width: 768px) {
    .gl-logo-img {
        width: 200px;
    }
}
.gl-logo,
.gl-logo-img {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.gl-logo-img {
    width: 280px;
    height: auto;
    display: block;
}

@media (max-width: 600px) {
    .gl-logo-img {
        width: 200px;
    }
}

/* =========================================
   BREAK REMINDER POPUP
========================================= */

.break-overlay[hidden] {
    display: none !important;
}

.break-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.break-popup {
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 28px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    animation: breakPop 0.5s ease;
}

.break-icon {
    font-size: 65px;
    margin-bottom: 15px;
}

.break-popup h2 {
    font-family: 'Luckiest Guy', cursive;
    font-size: 30px;
    color: #005d91;
    margin-bottom: 18px;
}

.break-popup p {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: #475569;
    margin-bottom: 15px;
}

.break-btn {
    display: block;
    background: #16a34a;
    color: #ffffff;
    padding: 14px 24px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 20px;
}

.break-btn:hover {
    background: #15803d;
}

@keyframes breakPop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 600px) {
    .break-popup {
        padding: 22px;
    }

    .break-popup h2 {
        font-size: 25px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .break-popup {
        animation: none;
    }
}