.kids-active-game {
    position: relative;
    width: 100%;
    height: 100vh;           
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    overflow: hidden;        
    padding: 0;
    margin: 0 auto;
}

.kids-active-game iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block;
}

.kids-active-game iframe,
.kids-active-game > * {
    width: 100% !important;
    max-width: 900px;
    height: 75vh !important;
    border: none;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(255,255,255,0.25);
    object-fit: contain;
}
.kgm-game-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.kgm-game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 2px solid transparent;
    padding: 10px;
    border-radius: 10px;
    background: #f6f6f6;
    cursor: pointer;
    transition: 0.3s;
}

.kgm-game-card:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.kgm-game-card.active {
    border-color: #0073aa;
    background: #e2f5ff;
}

.kgm-game-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.kgm-title {
    display: block;
    font-weight: 600;
    margin-top: 5px;
}

.kgm-no-image {
    width: 100%;
    height: 120px;
    background: #ddd;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}
    
/* hide native radio button but keep functionality */
.kgm-game-card input[type="radio"] {
    display: none;
}
#kgm-preview-modal {
    position: fixed;
    top:0; left:0;
    width:100%;
    height:100%;
    background: rgba(0,0,0,0.8);
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:9999;
}

#kgm-preview-content {
    width: 60%;
    height: 80%;
    background:#fff;
    padding:15px;
    border-radius:10px;
    position:relative;
}

#kgm-close-preview {
    position:absolute;
    top:10px;
    right:10px;
}

#kgm-preview-frame iframe {
    width:100%;
    height:100%;
    border:none;
}
/* Game selection grid wrapper */
.kgm-game-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    margin-top: 20px;
    align-items: flex-start;
}

/* Individual game card */
.kgm-game-card {
    border: 2px solid transparent;
    padding: 12px;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: 0.25s;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

/* Hover effect */
.kgm-game-card:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Active game highlighting */
.kgm-game-card.active {
    border-color: #0073aa;
    background: #e8f6ff;
}

/* Thumbnail image */
.kgm-game-card img.kgm-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #f6f6f6;
}

/* Title style */
.kgm-title {
    font-weight: 600;
    margin: 8px 0;
}

/* Hidden native radio */
.kgm-game-card input[type="radio"] {
    display: none;
}

/* Radio visible below thumbnail */
.kgm-radio-holder {
    display: flex;
    justify-content: center;
    margin-top: 6px;
}

/* Preview button placement */
.kgm-preview-btn {
    margin-top: 8px;
    font-size: 13px !important;
}
/* Force grid styling inside admin page */
body.wp-admin .kgm-game-selector {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    gap: 25px !important;
}
body.wp-admin .kgm-game-card {
    background: #fff !important;
    padding: 10px !important;
    border-radius: 10px !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: 0.3s !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important;
    border: 2px solid transparent !important;
}
body.wp-admin .kgm-game-card img {
    width: 100% !important;
    height: 160px !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    margin-bottom: 10px !important;
}
/* Show radio visibly */
body.wp-admin .kgm-game-card input[type="radio"] {
    display: inline-block !important;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Center radio button under thumbnail */
body.wp-admin .kgm-radio-holder {
    margin-top: 6px;
    text-align: center;
}
.kgm-frame-wrapper {
    position: relative;
    text-align: center;
    background: #000;
    padding: 20px 0;
}

.kgm-frame-container iframe {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    border: none;
}

.kgm-fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    z-index: 999;
    background: #ffffff;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px;
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
    user-select: none;
}
.kgm-fullscreen-btn:hover {
    background: #f2c94c;
}
