/* css/acachos.css */

#acachos-view .acachos-panel,
#acachos-view .acachos-tab-content {
    display: none;
    animation: fadeInAcachos 0.3s ease-in-out;
}

#acachos-view .acachos-panel.active,
#acachos-view .acachos-tab-content.active {
    display: block;
}

@keyframes fadeInAcachos {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === PESTAÑAS LOBBY === */
.acachos-tabs {
    display: flex;
    width: 100%; /* SOLUCIÓN: Obliga a las pestañas a ocupar todo el ancho */
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

.acachos-tab {
    flex: 1;
    padding: 15px 5px;
    border: none;
    background: transparent;
    color: #666;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.acachos-tab i { font-size: 1.2rem; }
.acachos-tab.active { background: #305c2a; color: #fff; }

/* === TABLAS LOBBY === */
.acachos-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.acachos-table th {
    background: #305c2a;
    color: #fff;
    padding: 12px 15px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.acachos-table td {
    padding: 15px;
    border-bottom: 1px solid #f1f1f1;
    font-size: 0.95rem;
    vertical-align: middle;
}

.acachos-table tr:last-child td { border-bottom: none; }
.acachos-table tr:hover td { background: #fafafa; }

.acachos-fila-perfil { cursor: pointer; transition: background 0.2s; }
.acachos-medal { font-size: 1.2rem; }
.acachos-tiempo-verde { color: #2d5a27; font-weight: 800; }
.acachos-tiempo-naranja { color: #e67e22; font-weight: 800; }

/* Acordeón de reglas */
.acachos-reglas-content.active { display: block !important; }

/* === JUEGO === */
.acachos-tablero-wrapper {
    width: 100%;
    max-width: 95vw;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    position: relative;
    border: 4px solid #2d5a27;
    border-radius: 8px;
    overflow: hidden;
    background: #ecf0f1;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

@media (min-width: 768px) {
    .acachos-tablero-wrapper { max-width: 65vh; }
}

.acachos-tablero {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 2px;
    background-color: #333;
}

.acachos-pieza {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    cursor: grab;
    box-sizing: border-box;
    transition: transform 0.1s, box-shadow 0.1s;
    user-select: none;
    touch-action: none;
}

.acachos-pieza.dragging {
    opacity: 0.8;
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    cursor: grabbing;
    z-index: 100;
}

.acachos-pieza.drag-over {
    border: 3px dashed #f1c40f;
    transform: scale(0.95);
    opacity: 0.7;
}

.acachos-tablero.completado {
    gap: 0;
    background-color: transparent;
}
.acachos-tablero.completado .acachos-pieza {
    cursor: default;
    border: none !important;
}

.acachos-mini-ref-wrapper:hover .acachos-lupa-overlay { background: rgba(227, 24, 33, 0.9) !important; }
.acachos-aviso-pulso { animation: pulsoPeligro 1.5s infinite ease-in-out; }

@keyframes pulsoPeligro {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}