body.gmbh-maisie-game-page {
    background: #FAF6EE;
}

.gmbmg-main {
    min-height: 70vh;
    background:
        radial-gradient(circle at 10% 10%, rgba(194, 161, 74, 0.12), transparent 22%),
        radial-gradient(circle at 90% 8%, rgba(220, 230, 243, 0.95), transparent 25%),
        #FAF6EE;
}

.gmbmg-hero {
    padding: 58px 0 28px;
    text-align: center;
}

.gmbmg-hero-inner {
    max-width: 830px;
}

.gmbmg-back-link {
    display: inline-flex;
    margin-bottom: 22px;
    color: #1B2A4D;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(194, 161, 74, 0.75);
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
}

.gmbmg-hero .gmb-eyebrow {
    display: flex;
    justify-content: center;
}

body.gmbh-maisie-game-page .gmbmg-hero h1 {
    margin-bottom: 16px;
    font-size: clamp(2.8rem, 6vw, 5rem);
}

.gmbmg-hero p:last-child {
    color: rgba(43, 43, 51, 0.76);
    font-size: 1.12rem;
}

.gmbmg-game-section {
    padding: 20px 0 90px;
}

.gmbmg-shell {
    position: relative;
    overflow: hidden;
    padding: clamp(18px, 3vw, 34px);
    border: 1px solid rgba(27, 42, 77, 0.13);
    border-radius: 32px;
    background:
        radial-gradient(circle at 5% 5%, rgba(194, 161, 74, 0.15), transparent 17%),
        radial-gradient(circle at 95% 8%, rgba(220, 230, 243, 0.95), transparent 22%),
        #FFFFFF;
    box-shadow: 0 24px 68px rgba(27, 42, 77, 0.16);
}

.gmbmg-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(110px, 0.55fr)) repeat(2, auto);
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.gmbmg-stat {
    padding: 10px 16px;
    border: 1px solid rgba(27, 42, 77, 0.12);
    border-radius: 16px;
    background: #FAF6EE;
    text-align: center;
}

.gmbmg-stat span {
    display: block;
    color: rgba(43, 43, 51, 0.62);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gmbmg-stat strong {
    color: #1B2A4D;
    font-size: 1.25rem;
}

.gmbmg-tool {
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid rgba(27, 42, 77, 0.18);
    border-radius: 999px;
    background: #FFFFFF;
    color: #1B2A4D;
    font-weight: 700;
    cursor: pointer;
}

.gmbmg-tool:hover,
.gmbmg-tool:focus-visible {
    border-color: #C2A14A;
    outline: none;
    box-shadow: 0 8px 18px rgba(27, 42, 77, 0.12);
}

.gmbmg-message {
    min-height: 34px;
    margin: 0 0 18px;
    color: #1B2A4D;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
}

.gmbmg-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(8px, 1.4vw, 16px);
    width: min(100%, 860px);
    margin: 0 auto;
}

.gmbmg-card {
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    perspective: 900px;
}

.gmbmg-card:focus-visible {
    outline: 4px solid #C2A14A;
    outline-offset: 4px;
}

.gmbmg-card-inner {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 360ms ease;
}

.gmbmg-card.is-flipped .gmbmg-card-inner,
.gmbmg-card.is-matched .gmbmg-card-inner {
    transform: rotateY(180deg);
}

.gmbmg-card-face {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 3px solid #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 10px 22px rgba(27, 42, 77, 0.16);
    backface-visibility: hidden;
}

.gmbmg-card-back {
    background:
        radial-gradient(circle at 50% 44%, rgba(225, 201, 120, 0.3), transparent 24%),
        linear-gradient(145deg, #0F7D82 0%, #145E67 100%);
}

.gmbmg-card-back::before {
    content: "♥";
    display: grid;
    width: 48%;
    aspect-ratio: 1;
    place-items: center;
    border: 3px dashed rgba(250, 246, 238, 0.65);
    border-radius: 50%;
    color: #E1C978;
    font-size: clamp(1.7rem, 5vw, 3.4rem);
    text-shadow: 0 2px 0 rgba(27, 42, 77, 0.18);
}

.gmbmg-card-front {
    transform: rotateY(180deg);
    background: #FFFFFF;
}

.gmbmg-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gmbmg-card.is-matched .gmbmg-card-face {
    border-color: #C2A14A;
    box-shadow: 0 0 0 4px rgba(194, 161, 74, 0.18), 0 12px 24px rgba(27, 42, 77, 0.16);
}

.gmbmg-bottom-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
}

.gmbmg-complete {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    overflow: auto;
    padding: 24px;
    background: rgba(16, 29, 59, 0.72);
    backdrop-filter: blur(7px);
}

.gmbmg-complete.is-hidden {
    display: none;
}

.gmbmg-complete-card {
    position: relative;
    z-index: 2;
    width: min(100%, 520px);
    padding: 40px 30px;
    border: 2px solid #C2A14A;
    border-radius: 28px;
    background: #FAF6EE;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
    text-align: center;
}

.gmbmg-complete-card .gmb-text-link {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.gmbmg-complete-heart {
    display: grid;
    width: 78px;
    height: 78px;
    place-items: center;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #0F7D82;
    color: #E1C978;
    font-size: 2.4rem;
}

.gmbmg-complete-moves {
    margin-bottom: 24px;
    color: rgba(43, 43, 51, 0.72);
}

.gmbmg-confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.gmbmg-confetti span {
    position: absolute;
    top: -30px;
    width: 12px;
    height: 18px;
    border-radius: 3px;
    background: #C2A14A;
    animation: gmbmgConfetti 2.8s linear infinite;
}

.gmbmg-confetti span:nth-child(3n) { background: #0F7D82; }
.gmbmg-confetti span:nth-child(3n + 1) { background: #DCE6F3; }

@keyframes gmbmgConfetti {
    to {
        transform: translateY(110vh) rotate(560deg);
    }
}

@media (max-width: 760px) {
    .gmbmg-hero {
        padding-top: 36px;
    }

    .gmbmg-game-section {
        padding-bottom: 58px;
    }

    .gmbmg-shell {
        padding: 14px;
        border-radius: 22px;
    }

    .gmbmg-toolbar {
        grid-template-columns: repeat(2, 1fr);
    }

    .gmbmg-board {
        gap: 8px;
    }

    .gmbmg-card,
    .gmbmg-card-face {
        border-radius: 14px;
    }

    .gmbmg-card-face {
        border-width: 2px;
    }

    .gmbmg-bottom-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .gmbmg-bottom-actions .gmb-button {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .gmbmg-board {
        gap: 6px;
    }

    .gmbmg-card,
    .gmbmg-card-face {
        border-radius: 11px;
    }

    .gmbmg-card-back::before {
        border-width: 2px;
        font-size: 1.5rem;
    }

    .gmbmg-tool {
        padding-inline: 10px;
        font-size: 0.84rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gmbmg-card-inner,
    .gmbmg-confetti span {
        animation: none !important;
        transition: none !important;
    }
}

@media (prefers-color-scheme: dark) {
    body.gmbh-maisie-game-page,
    body.gmbh-maisie-game-page .gmbmg-main,
    body.gmbh-maisie-game-page .gmbmg-shell,
    body.gmbh-maisie-game-page .gmbmg-complete-card {
        color-scheme: only light;
    }
}
