.game-logo {
    max-width: 2rem;
}


body.game-active {
    overflow: hidden;
}

body.game-active #gameRoot {
    display: block !important;
    padding: 1rem 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    z-index: 999999;
    box-sizing: border-box;
    background:
        radial-gradient(hsla(260, 90%, 4%, 1) 92px, transparent 485px),
        radial-gradient(hsla(280, 85%, 15%, 0.9) 118px, transparent 625px),
        radial-gradient(hsla(240, 80%, 10%, 0.95) 73px, transparent 395px),
        radial-gradient(hsla(280, 75%, 13%, 0.85) 145px, transparent 720px),
        radial-gradient(hsla(200, 85%, 12%, 0.9) 88px, transparent 540px),
        radial-gradient(hsla(270, 90%, 11%, 0.95) 132px, transparent 680px),
        radial-gradient(hsla(250, 75%, 8%, 0.8) 67px, transparent 440px),
        radial-gradient(hsla(310, 80%, 14%, 0.7) 108px, transparent 590px),
        radial-gradient(hsla(180, 75%, 13%, 0.8) 97px, transparent 765px),
        linear-gradient(135deg, #050308 0%, #0a0612 50%, #08050f 100%);
    background-size: 1215px 1840px, 1680px 975px, 825px 1390px, 1470px 1125px, 695px 1755px, 1920px 840px, 1065px 1580px, 780px 1260px, 1545px 1015px, 100% 100%;
    background-position: 345px 1165px, 1725px 420px, 95px 1890px, 1085px 95px, 1540px 1420px, 285px 745px, 865px 1685px, 1390px 580px, 520px 315px, center;
    background-repeat: repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, no-repeat;
}

@media (min-width: 1200px) {

    body.game-active #gameRoot .game-container,
    body.game-active #gameRoot .game-header {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }

    body.game-active #gameRoot .game-header {
        justify-content: center;
    }
}

#gameRoot * {
    -webkit-tap-highlight-color: transparent;
}

#gameRoot {
    height: 100%;
    margin: 0;
    padding: 2rem 0;

    -webkit-overflow-scrolling: touch;
    -webkit-text-size-adjust: 100%;

    background-color: var(--wp--preset--color--periwinkle-light);
    overscroll-behavior: none;
}

#gameRoot h2,
#gameRoot h3,
#gameRoot h4 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 1rem;
    color: currentColor;
    /* Kiválasztás tiltása */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

#gameRoot .levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    justify-content: flex-start;
    gap: 1.5rem;
    max-width: var(--wp--style--global--content-size);
    margin-left: auto !important;
    margin-right: auto !important;

}

#gameRoot h2,
#gameRoot h3 {
    max-width: var(--wp--style--global--content-size);
    margin-left: auto !important;
    margin-right: auto !important;
    padding-right: var(--wp--style--root--padding-right);
    padding-left: var(--wp--style--root--padding-left);
}

@media (max-width: 768px) {
    #gameRoot .levels-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

.game-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}



.game-title {
    text-align: center;
    font-weight: bold;
    font-size: smaller;
}

.game-container {
    position: relative;
    max-height: 100vh;
}

#gameRoot .level-button,
#gameRoot .category-button {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    font-family: inherit;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: currentColor;
    padding: 1rem 1rem;
    min-height: 60px;
    /* Backdrop blur modern böngészőkben */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        inset -2px -2px 4px 0px rgba(255, 255, 255, 0.1),
        0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-radius: 1rem;
    transition: all 0.2s ease;
    font-size: smaller;
    cursor: pointer;
    text-align: left;
    position: relative;

    border: 1px solid rgba(70, 100, 255, 0.3);

    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
    background: linear-gradient(to top, rgba(10, 0, 20, 0.8), transparent);

}

#gameRoot .level-button:hover,
#gameRoot .category-button:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(70, 100, 255, 0.35);
    border-color: rgba(100, 130, 255, 0.8);


}

#gameRoot .level-button img {
    width: 100%;
    max-width: 100%;
    height: auto;
}

#gameRoot .level-button.free {}

#gameRoot .level-button.premium {
    background: #fff6c8;
}

#gameRoot .game-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    font-size: 0.8rem;
}

#gameRoot .game-controls > div {
    text-align: center;
}

#gameRoot .button svg {
    fill: currentColor;
    max-width: 1.5rem;
    max-height: 1.5rem;
}




#gameRoot .game-controls > div > span {
    position: relative;
    top: -0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 0.25rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.premium .badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.free .badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.locked .badge {
    background: rgba(100, 116, 139, 0.5);
    color: #cbd5e1;
}

[data-difficulty=easy] {
    color: #10b981;
}

[data-difficulty=medium] {
    color: #06b6d4;
}

[data-difficulty=hard] {
    color: #f59e0b;
}

[data-difficulty=expert] {
    color: #ef4444;
}

.progress-bar-bg {
    background: #d9e0eb;
    border: solid 5px #fff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    border-radius: 2rem;
    margin-bottom: 2rem;
    font-size: smaller;
}

.progress-bar-fill {
    border-radius: 2rem;
}

.progress-text {
    padding: 0 1rem;
    white-space: nowrap;
}

/* Lebegő exit gomb */
.exit-button {
    position: fixed;
    border-radius: 0px 0px 0px 100px;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(-135deg, black 0%, black 50%, transparent 50%, transparent 100%);
    padding: 8px;
    color: #fff;
    display: block;
    z-index: 100;
    border: 0;
    cursor: pointer;
    font-size: 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    line-height: 20px;
}

/* Hover/focus: finom „lebegés” */
.exit-button:hover,
.exit-button:focus-visible {
    background: linear-gradient(-135deg, gold 0%, gold 50%, transparent 50%, transparent 100%);
    outline: none;
}

@media screen and (max-width: 600px) {
    body.game-active #gameRoot {
        padding: 1rem 0.75rem;
    }
}

@media screen and (max-width: 374px) {
    body.game-active #gameRoot {
        padding: 0.75rem 0px;
    }

    .game-header {
        margin-bottom: 1rem;
    }
}


#gameRoot .button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 4rem;
    padding: 0.5rem 1rem;
    border: none;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    border-radius: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 2px 2px 4px rgba(255, 255, 255, 0.5);
    background-position: center left;
    background-repeat: no-repeat;
    border: 1px solid;
    border-bottom-width: 4px;
    border-right-width: 2px;
    background: linear-gradient(145deg, #f2e7d5, #ede0cc);
    border-color: #d4c4a8;
    color: #6b5d42;
    text-shadow: none;
}

#gameRoot .game-stats {
    display: flex;
    gap: 0.5rem;
    column-gap: 2rem;
    font-size: smaller;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

#gameRoot .game-stats > * {
    flex: 1 1 130px;
}

#gameRoot .button.green {
    background-color: #66bb6a;
    background: linear-gradient(145deg, #66bb6a, #43a047);
    border-color: #2e7d32;
    color: #fff;
}

#gameRoot .button.yellow {
    background-color: #FFC107;
    background: linear-gradient(145deg, #FFEB3B, #FFC107);
    border-color: #FFC107;
    color: #000;
}

#gameRoot .button.blue {
    background-color: #42a5f5;
    background: linear-gradient(145deg, #42a5f5, #1e88e5);
    border-color: #1565c0;
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

#gameRoot .button.orange {
    background-color: #ff9800;
    background: linear-gradient(145deg, #ff9800, #f57c00);
    border-color: #ef6c00;
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

#gameRoot .button.purple {
    background-color: #9c27b0;
    background: linear-gradient(145deg, #ba68c8, #9c27b0);
    border-color: #7b1fa2;
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

#gameRoot .button.pink {
    background-color: #e91e63;
    background: linear-gradient(145deg, #f06292, #e91e63);
    border-color: #c2185b;
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

#gameRoot .button.teal {
    background-color: #009688;
    background: linear-gradient(145deg, #26a69a, #009688);
    border-color: #00796b;
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

#gameRoot .button.gray {
    background-color: #b0bec5;
    background: linear-gradient(145deg, #eceff1, #b0bec5);
    border-color: #78909c;
    color: #37474f;
    text-shadow: none;
}

#gameRoot .button.green {
    background-color: #66bb6a;
    background: linear-gradient(145deg, #66bb6a, #43a047);
    border-color: #2e7d32;
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);

    #gameRoot .button.neutral {
        background: linear-gradient(145deg, #f2e7d5, #ede0cc);
        border-color: #d4c4a8;
        color: #6b5d42;
        text-shadow: none;
    }

    #gameRoot .button:disabled {
        background: linear-gradient(145deg, #f2e7d5, #ede0cc);
        border-color: #d4c4a8;
        color: #6b5d42;
        cursor: not-allowed;
        opacity: 0.5;
    }

    #gameRoot .button.fake:disabled {
        background: transparent;
        border-color: transparent;
        color: #fff;
        cursor: initial;
        opacity: 1;

        box-shadow: none;


    }









    .mahjong-mini-grid {
        display: grid;
        /* 10 oszlop, fix szélességgel a pixelpontosságért */
        grid-template-columns: repeat(10, 1fr);
        gap: 1px;

        /* Méretezés: kicsit kisebb, hogy ne legyen túl nagy a gomb */
        width: 40px;
        height: 50px;
        /* A csempék nem négyzetesek, hanem állók */

        padding: 2px;
        background-color: rgba(0, 0, 0, 0.1);
        /* Halvány háttér a "táblának" */
        border-radius: 4px;
        flex-shrink: 0;
        /* Ne nyomódjon össze, ha hosszú a szöveg */


    }

    .mahjong-mini-pixel {
        width: 100%;
        height: 100%;
        background-color: transparent;
        /* Üres helyek átlátszóak */
        border-radius: 1px;
        transition: all 0.2s ease;
        /* Finom animáció hover-nél */
    }

    .mahjong-mini-pixel.active {
        background-color: #ffeebb;
        /* Elefántcsont / csontszín */
        box-shadow:
            inset 1px 1px 0px #fff,
            /* Fény a tetején */
            1px 1px 0px rgba(0, 0, 0, 0.3),
            /* Árnyék a jobb alján (3D hatás) */
            inset -1px -1px 0px #dcc090;
        /* Sötétebb belső szél */

        border: 1px solid #dcc090;
        /* Vékony keret */
    }


    .level-button:hover .mahjong-mini-pixel.active {
        background-color: #fff;
        /* Kivilágosodik, ha ráviszed az egeret */
        transform: translateY(-1px);
        /* Picit "kiemelkedik" */
        box-shadow:
            1px 2px 1px rgba(0, 0, 0, 0.2);
        /* Nagyobb árnyék */
    }