* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    padding: 20px;
}

.container {
    max-width: 100%;
    padding: 10px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    display: none;
}

@media (min-width: 768px) {
    .container {
        max-width: 900px;
        padding: 20px;
    }
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.timer {
    position: fixed;
    bottom: 20px;
    left: 20px;
    text-align: left;
    font-size: 16px;
    font-weight: bold;
    color: #2E7D32;
    background-color: #f8f8f8;
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 100px;
}

.timer span {
    min-width: 20px;
    display: inline-block;
}

@media (min-width: 768px) {
    .timer {
        font-size: 18px;
        padding: 6px 12px;
    }
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transition: opacity 0.5s ease, visibility 0.5s ease, filter 0.3s ease, transform 0.5s ease, display 0.9s ease;
}

.hidden {
    opacity: 0;
    visibility: hidden;
    display: none;
}

.success-message {
    background-color: #d4edda; /* Color de fondo verde claro */
    color: #155724; /* Color de texto verde oscuro */
    padding: 15px; /* Espaciado interno */
    border: 1px solid #c3e6cb; /* Borde verde claro */
    border-radius: 5px; /* Bordes redondeados */
    margin-top: 10px; /* Espaciado superior */
    font-size: 16px; /* Tamaño de fuente */
    text-align: center; /* Centrar el texto */
    transition: opacity 0.5s ease; /* Transición suave */
    opacity: 1; /* Opacidad inicial */
}

/* Opcional: para hacer que el mensaje desaparezca después de un tiempo */
.success-message.hidden {
    opacity: 0; /* Ocultar el mensaje */
}

.word-list {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
    order: 1;
}

.word-list h4 {
    margin-bottom: 15px;
    color: #2E7D32;
}

.word-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.word-list li {
    display: inline-block;
    padding: 8px 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
}
/*
.word-list span.found {
    text-decoration: line-through;
    color: #2E7D32;
}*/

.grid-container {
    position: relative;
    margin: 0 auto;
    width: 100%;
    max-width: 600px;
}

.grid {
    position: relative;
    z-index: 1;
    order: 2;
    display: grid;
    grid-template-columns: repeat(13, minmax(20px, 1fr));
    gap: 1px;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    width: 100%;
}

#highlightCanvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2;
    width: 100%;
    height: 100%;
}

@media (min-width: 768px) {
    .grid {
        grid-template-columns: repeat(13, 40px);
        gap: 2px;
    }
    
    .cell {
        font-size: 20px;
    }
}

.cell {
    width: 100%;
    aspect-ratio: 1;
    min-width: 25px;
    border: 1.5px solid #e6e6e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    font-size: 18px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: white;
    touch-action: none;
    position: relative;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cell:hover {
    background-color: rgba(102, 187, 106, 0.3);
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    border: 2px solid rgba(102, 187, 106, 0.5);
    z-index: 1;
}

.eraser-mode .cell[data-found="true"]:hover {
    background-color: rgba(255, 87, 34, 0.3);
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    border: 2px solid rgba(255, 87, 34, 0.5);
}

.cell.selecting,
.cell.first-selected {
    background-color: #4CAF50;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    z-index: 2;
}

.cell.selecting:hover,
.cell.first-selected:hover {
    background-color: #4CAF50;
    transform: scale(1.1);
}

.cell.first-selected {
    background-color: #2E7D32;
    transform: scale(1.15);
    box-shadow: 0 4px 8px rgba(0,0,0,0.25);
    z-index: 3;
}

/* Estilo para celdas que pertenecen a palabras encontradas */
.cell[data-found="true"] {
    font-weight: 800;
    color: #0a380d;
    text-shadow: 0 0 1px rgba(5, 27, 7, 0.3);
}

.cell.found {
    /* background-color: #2E7D32; */ /* Verde oscuro */
    color: #000;
}

.cell.not-found {
    background-color: #352acf;
    color: white;
}

.highlight {
    background-color: yellow;
    border: 2px solid red;
}

@media (min-width: 768px) {
    .cell {
        width: 35px;
        height: 35px;
        font-size: 17px;
    }
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(13, minmax(20px, 1fr));
        gap: 1px;
    }
    
    .cell {
        font-size: 16px;
        touch-action: none; /* Prevenir el scroll en móviles */
    }
    
    .cell.selecting,
    .cell.first-selected {
        transform: scale(1.2); /* Hacer la selección más visible en móviles */
    }
    
    .word-list {
        font-size: 14px;
        margin-bottom: 10px;
    }
}

.blurred {
    filter: blur(5px);
    pointer-events: none;
}

.start-button {
    display: block;
    margin: 14px auto;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background-color: #2E7D32;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@media (min-width: 768px) {
    .start-button {
        padding: 15px 40px;
        font-size: 20px;
    }
}

.start-button:hover {
    background-color: #1B5E20;
}

.instructions-button {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    background-color: #1976D2;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    z-index: 1000;
}

.instructions-button:hover {
    background-color: #1565C0;
    transform: scale(1.05);
}

/* Estilos para el modal */
.modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 13px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    width: 90%;
    max-width: 500px;
}

.modal-content .instructions-modal {
    padding: 23px 30px;
}

.form-column {
    width: 100%;
}

.form-column h2 {
    color: #2E7D32;
    text-align: center;
    margin-bottom: 19px;
    font-size: 20px;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #2E7D32;
    outline: none;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.1);
}

.submit-button {
    width: 100%;
    padding: 12px;
    background-color: #2E7D32;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.submit-button:hover {
    background-color: #1B5E20;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 17px 30px;
        width: 95%;
    }
    
    .form-group input {
        font-size: 14px;
    }
}

.player-data {
    display: none;
}

.player-info {
    background-color: #f8f8f8;
    border-radius: 6px;
    padding: 15px;
    margin: 15px auto;
    max-width: 600px;
    font-size: 14px;
}

.player-info-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.player-info p {
    margin: 0;
    color: #666;
    line-height: 1.4;
}

.player-info p span:first-child {
    color: #2E7D32;
    font-weight: 500;
    margin-right: 5px;
}

.player-info p span:last-child {
    color: #444;
}

@media (max-width: 480px) {
    .player-info-content {
        grid-template-columns: 1fr;
    }
    
    .player-info {
        font-size: 13px;
        padding: 12px;
    }
}

.close-button {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
}

.close-button:hover {
    color: #000;
}

.enter-button {
    display: none;
}

@media (max-width: 768px) {
    .enter-button {
        display: none;
    }
}

#PreguntaGeneral {
    margin: 20px 0;
    padding: 15px;
    border: 2px solid #4CAF50; /* Borde verde */
    border-radius: 10px; /* Bordes redondeados */
    background-color: #f0f8f0; /* Fondo suave */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Sombra sutil */
}

#PreguntaGeneral h3 {
    color: #4CAF50; /* Color del título */
    margin-bottom: 10px;
}

#PreguntaGeneral input {
    width: calc(70% - 10px); /* Ajustar el ancho */
    padding: 10px;
    margin-right: 5px;
    border: 1px solid #ccc; /* Borde del campo de texto */
    border-radius: 5px; /* Bordes redondeados */
}

#PreguntaGeneral button {
    padding: 10px 15px;
    background-color: #4CAF50; /* Color del botón */
    color: white;
    border: none;
    border-radius: 5px; /* Bordes redondeados */
    cursor: pointer; /* Cambiar el cursor al pasar por encima */
    margin-top: 6px;
}

#PreguntaGeneral button:hover {
    background-color: #45a049; /* Color del botón al pasar el mouse */
}

/* Estilos para el modal de instrucciones */
.instructions-modal {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.instructions-section {
    padding: 20px;
}

.instructions-section h3 {
    color: #2E7D32;
    margin: 20px 0 10px;
    font-size: 1.2em;
}

.instructions-section h4 {
    color: #4CAF50;
    margin: 15px 0 8px;
    font-size: 1.1em;
}

.instructions-section ul {
    list-style-type: none;
    padding-left: 20px;
    margin-bottom: 15px;
}

.instructions-section ul li {
    position: relative;
    padding: 5px 0;
    padding-left: 20px;
}

.instructions-section ul li::before {
    content: '•';
    color: #4CAF50;
    position: absolute;
    left: 0;
    font-size: 1.2em;
}

/* Estilos responsivos para el modal de instrucciones */
@media (max-width: 768px) {
    .instructions-modal {
        max-width: 90%;
        margin: 20px auto;
    }

    .instructions-section {
        padding: 15px;
    }

    .instructions-section h3 {
        font-size: 1.1em;
    }

    .instructions-section h4 {
        font-size: 1em;
    }

    .instructions-section ul li {
        font-size: 0.95em;
    }
}

.game-controls {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    gap: 10px;
    position: relative;
    z-index: 10;
}

.eraser-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 20;
}

.eraser-button:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.eraser-button.active {
    background-color: #e9ecef;
    border-color: #0d6efd;
    color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

.eraser-icon {
    font-size: 16px;
}

.eraser-mode {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="%23495057"><path d="M16.24 3c-.51 0-1.02.2-1.41.59L2.59 14.73c-.78.77-.78 2.04 0 2.83L5.03 20h7.66l8.72-8.72c.78-.77.78-2.04 0-2.83l-4.85-4.86c-.39-.39-.9-.59-1.41-.59M17 18l-2 2h7v-2h-5z"/></svg>') 12 12, auto;
}

@media (max-width: 768px) {
    .eraser-button {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .eraser-icon {
        font-size: 15px;
    }
}

/* Estilo para mostrar el ícono del borrador al pasar sobre celdas seleccionadas */
.hover-eraser {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="%23495057"><path d="M16.24 3c-.51 0-1.02.2-1.41.59L2.59 14.73c-.78.77-.78 2.04 0 2.83L5.03 20h7.66l8.72-8.72c.78-.77.78-2.04 0-2.83l-4.85-4.86c-.39-.39-.9-.59-1.41-.59M17 18l-2 2h7v-2h-5z"/></svg>') 12 12, auto;
}

/* Estilos para el botón borrador */
#eraser-button {
    padding: 10px 15px;
    background-color: #f0f0f0;
    border: 2px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

#eraser-button:hover {
    background-color: #e0e0e0;
    transform: scale(1.05);
}

#eraser-button.active {
    background-color: #ff6b6b;
    color: white;
    border-color: #ff4444;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
    transform: scale(1.1);
}

/* Cursor personalizado para celdas resaltadas en modo borrador */
.eraser-mode .cell {
    cursor: default;
}
/*
.eraser-mode .cell:hover {
    background-color: inherit;
    transform: none;
}*/

/* Solo mostrar el cursor borrador en celdas que pertenecen a palabras encontradas */
.eraser-mode .cell[data-found="true"] {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="%23ff4444"><path d="M15.14 3c-.51 0-1.02.2-1.41.59L2.59 14.73c-.78.77-.78 2.04 0 2.83L5.03 20h7.66l8.72-8.72c.78-.77.78-2.04 0-2.83l-4.85-4.86c-.39-.39-.9-.59-1.41-.59M17 18l-2 2h7v-2h-5z"/></svg>') 0 24, auto;
}

.eraser-mode .cell[data-found="true"]:hover {
    background-color: rgba(255, 87, 34, 0.2);
    transform: scale(1.05);
}

/* Estilos para el toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: #4CAF50;
}

.toast.warning {
    background-color: #ff6b6b;
}