body.game-active {
    overflow: hidden;
}

body.game-active #gameRoot {
    display: block !important;
    padding: 1rem 3rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    z-index: 999999;
    box-sizing: border-box;
    background: radial-gradient(75% 75% at 2% 9%, #ffeb001c 0%, #89ff0700 71%), radial-gradient(70% 53% at 36% 76%, #4b00ff1c 0%, #073AFF00 100%), linear-gradient(125deg, #e1fff2 1%, #c1ebf9 100%);
}

@media (min-width: 1200px) {
    body.game-active #gameRoot {
        padding: 1rem 25vw;
    }
}

/* NE használj szelektort a gameRoot gyermekeire! */
/* Hagyd, hogy az eredeti stílusaik maradjanak */
#gameRoot * {
    -webkit-tap-highlight-color: transparent;
}

#gameRoot {
    height: 100%;
    margin: 0;
    padding: 2rem 0;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    -webkit-text-size-adjust: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    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;
    padding-right: var(--wp--style--root--padding-right);
    padding-left: var(--wp--style--root--padding-left);
}

#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: 2rem;
    margin-bottom: 2rem;
}

.game-header img {
    max-width: 100px;
}

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

.game-container {
    position: relative;

}

#gameRoot .level-button,
#gameRoot .category-button {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.9);
    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;
}

#gameRoot .level-button:hover,
#gameRoot .category-button:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 1);
    box-shadow:
        inset -2px -2px 4px 0px rgba(255, 255, 255, 0.2),
        0 8px 16px -2px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

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

#gameRoot .level-button.free {}

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

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

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

.free .badge {
    background: linear-gradient(135deg, #a2e710 0%, #58d510 100%);
    color: white;
}


.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;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: #000;
    color: #fff;
    display: block;
    z-index: 100;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
}

/* Hover/focus: finom „lebegés” */
.exit-button:hover,
.exit-button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
    outline: none;
}

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