.puzzle-container{
    margin-top:40px;
    text-align:center;
}
#puzzle{
    margin:20px auto;
    width:320px;
    height:320px;
    display:grid;
    grid-template-columns:repeat(5, 1fr);
    grid-template-rows:repeat(5, 1fr);
    gap:0;
}

.tile{
    width:100%;
    height:100%;
    cursor:pointer;
    background-repeat:no-repeat;
    background-size:320px 320px;
    position:relative;
}

.tile.empty{
    background:none;
}
.tile span.piece-number{
    position:absolute;
    top:4px;
    right:6px;
    font-size:12px;
    font-weight:700;
    color:#000;
    background:rgba(255,255,255,0.7);
    padding:2px 5px;
    border-radius:6px;
    pointer-events:none;
}

/* === COLOREAR === */
.coloring-game{
    text-align:center;
    margin:40px auto;
}
.palette{
    display:flex;
    justify-content:center;
    gap:10px;
    flex-wrap:wrap;
    margin-bottom:10px;
}
.palette .color{
    width:36px;
    height:36px;
    border-radius:50%;
    border:none;
}
#colorCanvas{
    border:2px solid #000;
    border-radius:12px;
    background:#fff;
    touch-action:none;
    max-width:100%;
}
/* === GROSOR DEL LÁPIZ === */
.brush-sizes{
    display:flex;
    justify-content:center;
    gap:10px;
    margin:10px 0;
}
.brush{
    padding:6px 12px;
    border-radius:20px;
    border:none;
    font-weight:600;
    cursor:pointer;
}
.brush.active{
    background:#333;
    color:#fff;
}
.modal-overlay{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.6);
    justify-content:center;
    align-items:center;
    z-index:9999;
}

.modal-box{
    background:white;
    width:90%;
    max-width:900px;
    padding:20px;
    border-radius:15px;
    position:relative;
}

.modal-close{
    position:absolute;
    top:10px;
    right:15px;
    font-size:28px;
    cursor:pointer;
}
/* ===== BOTONES MOBILE ===== */
.game-buttons{
    display:flex;
    flex-direction:column;
    gap:15px;
    margin:40px 20px;
}

.game-buttons button{
    padding:18px;
    font-size:18px;
    font-weight:700;
    border-radius:14px;
    border:none;
    background:#111;
    color:#fff;
    width:100%;
}

/* ===== OCULTAR JUEGOS ===== */
.hidden-game{
    display:none;
}
/* ===== WRAPPER FULL WIDTH ===== */
.game-wrapper{
    width:100%;
    margin:0;
    padding:0;
}

/* ===== IFRAME FULL SIZE ===== */
.game-wrapper iframe{
    width:100%;
    height:100vh; /* ocupa toda la pantalla */
    border:none;
    border-radius:0;
}

/* En móvil que use toda la altura */
@media (max-width:768px){
    .game-wrapper iframe{
        height:100vh;
    }
}