* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #e8f0f5;
    color: #263238;
}

.contenedor {
    width: 95%;
    max-width: 1250px;
    margin: 20px auto;
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}


/* ENCABEZADO */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    padding: 20px;

    background: #2c6e49;
    color: white;

    border-radius: 15px;
}

header h1 {
    margin: 0;
    font-size: 30px;
}

header p {
    margin-bottom: 0;
}

.puntaje {
    background: white;
    color: #263238;

    padding: 15px 25px;

    border-radius: 15px;

    font-size: 22px;
    font-weight: bold;
}


/* PANEL DE FICHAS */

.panel-fichas {
    margin-top: 25px;

    padding: 20px;

    background: #f4f8fa;

    border-radius: 15px;

    text-align: center;
}

.panel-fichas h2 {
    margin-top: 0;
}

.fichas-disponibles {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.tipo-ficha {
    width: 170px;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 8px;
}

.tipo-ficha span {
    color: #666;
}


/* FICHAS */

.ficha {
    cursor: grab;
    user-select: none;
    transition: transform 0.2s;
}

.ficha:hover {
    transform: scale(1.08);
}

.ficha:active {
    cursor: grabbing;
}


/* MILLAR - CUBO */

.cubo {
    width: 75px;
    height: 75px;

    background: #3b82c4;

    border: 3px solid #1d4f7a;

    position: relative;

    box-shadow:
        12px -12px 0 #5aa1dc,
        12px -12px 0 3px #1d4f7a;
}


/* CENTENA - CUADRADO */

.centena {
    width: 70px;
    height: 70px;

    background: #f0c64d;

    border: 3px solid #9c7a00;
}


/* DECENA - RECTÁNGULO */

.decena {
    width: 28px;
    height: 70px;

    background: #e57373;

    border: 3px solid #9f3030;
}


/* UNIDAD - CUADRADO PEQUEÑO */

.unidad {
    width: 25px;
    height: 25px;

    background: #7ac36a;

    border: 2px solid #397d2d;
}


/* RETO */

.reto {
    text-align: center;

    margin: 30px 0;

    padding: 25px;

    background: #fff8dc;

    border: 3px dashed #d4a900;

    border-radius: 20px;
}

.reto p {
    font-size: 20px;
    font-weight: bold;

    margin-top: 0;
}

#numeroObjetivo {
    font-size: 65px;
    font-weight: bold;
    color: #d35400;
}


/* ZONAS */

.zonas {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.zona-contenedor {
    text-align: center;
}

.zona-contenedor h3 {
    margin-bottom: 8px;
}

.contador {
    margin-bottom: 8px;
    font-weight: bold;
}

.zona-soltar {
    min-height: 280px;

    padding: 15px;

    border: 3px dashed #7f8c8d;

    border-radius: 15px;

    background: #fafafa;

    display: flex;

    flex-wrap: wrap;

    align-content: flex-start;

    justify-content: center;

    align-items: flex-start;

    gap: 12px;

    transition: background 0.2s;
}

.zona-soltar.sobre {
    background: #d9f7df;
    border-color: #2c9c45;
}


/* FICHAS DENTRO DE LAS ZONAS */

.ficha-colocada {
    cursor: pointer;
    flex-shrink: 0;
}

.ficha-colocada:hover {
    opacity: 0.7;
}


/* BOTONES */

.botones {
    display: flex;
    justify-content: center;
    gap: 20px;

    margin: 30px 0;
}

button {
    border: none;

    padding: 16px 30px;

    font-size: 18px;
    font-weight: bold;

    border-radius: 12px;

    cursor: pointer;

    transition: transform 0.2s;
}

button:hover {
    transform: scale(1.05);
}

#comprobar {
    background: #2c9c45;
    color: white;
}

#limpiar {
    background: #e74c3c;
    color: white;
}


/* MENSAJES */

.mensaje {
    min-height: 60px;

    text-align: center;

    font-size: 25px;
    font-weight: bold;

    padding: 15px;

    border-radius: 15px;
}

.correcto {
    background: #d7f5df;
    color: #19763a;
}

.error {
    background: #ffdada;
    color: #b71c1c;

    animation: vibrar 0.4s;
}

@keyframes vibrar {

    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    50% {
        transform: translateX(10px);
    }

    75% {
        transform: translateX(-10px);
    }

    100% {
        transform: translateX(0);
    }

}


/* INSTRUCCIONES */

.instrucciones {
    margin-top: 20px;

    padding: 15px 25px;

    background: #edf6ff;

    border-radius: 15px;
}


/* RESPONSIVE */

@media (max-width: 850px) {

    .zonas {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 550px) {

    header {
        flex-direction: column;
        text-align: center;
    }

    .zonas {
        grid-template-columns: 1fr;
    }

    #numeroObjetivo {
        font-size: 50px;
    }

}

/* =====================================================
   RESPALDO VISUAL DE LAS FICHAS COLOCADAS
   ===================================================== */

/* MILLAR */

.zona-soltar .ficha-colocada[data-tipo="millares"] {
    width: 62px;
    height: 62px;

    background: #3c91c9;

    border: 3px solid #1f5e8a;

    position: relative;

    display: block;

    visibility: visible;

    opacity: 1;
}


/* CENTENA */

.zona-soltar .ficha-colocada[data-tipo="centenas"] {
    width: 58px;
    height: 58px;

    background: #f3c94f;

    border: 3px solid #aa8200;

    display: block;

    visibility: visible;

    opacity: 1;
}


/* DECENA */

.zona-soltar .ficha-colocada[data-tipo="decenas"] {
    width: 24px;
    height: 58px;

    background: #e97a6c;

    border: 3px solid #a53d32;

    display: block;

    visibility: visible;

    opacity: 1;
}


/* UNIDAD */

.zona-soltar .ficha-colocada[data-tipo="unidades"] {
    width: 22px;
    height: 22px;

    background: #75bf6a;

    border: 2px solid #397b31;

    display: block;

    visibility: visible;

    opacity: 1;
}

.ficha-colocada {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.ficha{
    border-radius:6px;
}

.cubo{
    width:75px;
    height:75px;
    background:#3498db;
    border:3px solid #21618c;
}

.centena{
    width:70px;
    height:70px;
    background:#27ae60;
    border:3px solid #1e8449;
}

.decena{
    width:28px;
    height:70px;
    background:#f39c12;
    border:3px solid #b9770e;
}

.unidad{
    width:25px;
    height:25px;
    background:#e74c3c;
    border:2px solid #922b21;
}

.zona-soltar{
    min-height:280px;
    border:3px dashed #b0bec5;
    border-radius:12px;
    padding:10px;
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    align-content:flex-start;
}

.zona-soltar.sobre{
    background:#e8f5e9;
    border-color:#2e7d32;
}

.correcto{
    background:#d4edda;
    color:#155724;
    padding:12px;
    border-radius:10px;
}

.error{
    background:#f8d7da;
    color:#721c24;
    padding:12px;
    border-radius:10px;
}