/* --- CONFIGURACIÓN DE LA SOPA (GRILLA ESTÁTICA) --- */
.sopa-container {
    display: grid;
    gap: 0; /* Sin espacio para que los bordes de las celdas se unan */
    border: 2px solid #333;
    width: fit-content;
    margin: 0 auto;
    background: white;
}

.sopa-container .cell {
    width: var(--cell-size); /* Hereda los 40px definidos en style.css */
    height: var(--cell-size);
    border: 0.5px solid #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* Tipografía monoespaciada: fundamental para sopas de letras */
    font-family: 'Courier New', Courier, monospace; 
    font-weight: bold;
    font-size: 1.3rem;
    text-transform: uppercase;
    background: white;
    color: #222;
    
    /* Quitamos el cursor de mano ya que no es interactiva */
    cursor: default; 
    user-select: none;
}

/* --- ÁREA DE EXPORTACIÓN --- */
#exportAreaSopa {
    display: inline-block; 
    padding: 40px;
    background: white;
    width: 100%;
    min-width: fit-content;
    text-align: center;
}

/* Título de la lista de palabras en el PNG */
.sidebar h3 {
    margin: 1.5rem 0 1rem 0;
    font-size: 1.2rem;
    color: var(--primary-color);
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    text-align: center;
    font-family: sans-serif;
}

/* Lista de palabras en formato horizontal (tags) */
.word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    list-style: none;
    padding: 10px 0;
}

.word-list span {
    padding: 6px 14px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #444;
    text-transform: uppercase;
    font-family: sans-serif;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* --- OPTIMIZACIÓN PARA IMPRESIÓN DIRECTA --- */
@media print {
    body {
        background: white;
    }
    .navbar, .button-group, .input-group, p, h2, .toast-container {
        display: none !important;
    }
    #exportAreaSopa {
        padding: 0;
        margin: 0;
        border: none;
    }
    .sopa-container {
        page-break-inside: avoid;
    }
}
/* --- SISTEMA DE TOASTS --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: sans-serif;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease-out;
    transition: all 0.5s ease;
}

.toast.success {
    border-left: 5px solid #4caf50;
}

.toast.error {
    border-left: 5px solid #f44336;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}