/* Footer styles */
.footer {
    background: #f4f4f4;
    color: #333;
    padding: 24px 0 12px 0;
    text-align: center;
    font-size: 1rem;
    border-top: 1px solid #ddd;
    margin-top: 40px;
}
.footer-content a {
    color: #2196F3;
    text-decoration: none;
    margin: 0 8px;
    transition: color 0.2s;
}
.footer-content a:hover {
    color: #1769aa;
    text-decoration: underline;
}
.footer-copy {
    margin-top: 8px;
    font-size: 0.95em;
    color: #888;
}
/* Casillas resaltadas en rojo al mostrar la solución */
.objetivo-azul {
    box-shadow: 0 0 0 3px #1976d2, 0 0 10px #1976d2;
    background-color: #90caf9 !important;
    border-color: #1976d2 !important;
    z-index: 10;
    transition: background 0.2s, box-shadow 0.2s;
}
/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    text-align: center;
    background: white;
    padding: 10px;
    border-radius: 15px;
    /* sin sombra */
}

h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5em;
}

/* Tablero de ajedrez */
.board-container {
    display: block;
    border: none;
    border-radius: 10px;
    padding: 10px;
    background: transparent;
    margin-bottom: 20px;
    max-width: 700px;
    width: 100%;
    word-break: break-word;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
}

.board-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.board-middle {
    display: flex;
    align-items: center;
    gap: 15px;
}

:root {
  --tablero-size: calc(min(60vw, 60vh));
  --tamano-casilla: calc(var(--tablero-size) / 8);
}

.chessboard {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: var(--tablero-size);
    height: var(--tablero-size);
    gap: 1px;
    background: #f0f0f0;
}

/* Contenedores de flechas */
.arrows-top, .arrows-bottom {
    display: flex;
    gap: 2px;
    align-items: center;
}

.arrows-left, .arrows-right {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

/* Estilos base para todas las flechas */
.arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    background: #e8f4fd;
    border: 3px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Tamaños específicos para cada orientación */
.arrow-top, .arrow-bottom, .arrow-left, .arrow-right {
    width: calc(var(--tamano-casilla) * 0.96);
    height: calc(var(--tamano-casilla) * 0.96);
    font-size: 18px;
}

.arrow:hover {
    transform: scale(1.15);
    background: #90caf9;
    color: white;
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
    border-color: #667eea;
}

.arrow.active {
    background: #ff4757;
    color: white;
    animation: arrowPulse 1s infinite;
    border-color: #ff4757;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.6);
}

@keyframes arrowPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Casillas del tablero */
.square {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
    font-weight: bold;
    font-size: 10px;
    position: relative;
}

/* Colores alternados del tablero - sutiles */
.square.white {
    background-color: #ffffff;
}

.square.blue {
    background-color: #e8f4fd;
}

.square.marked {
    background-color: #4CAF50 !important;
    color: white;
    animation: pulse 0.5s ease-in-out;
    border: 2px solid #4CAF50;
    transition: border 0.3s ease;
}

.square.marked::after {
    content: "";
}

/* Efecto especial para casillas acumuladas */
.square.marked.accumulated {
    border: 3px solid #4CAF50 !important;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* Animación para casillas marcadas */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Cuadros verdes y grises */
.square.verde {
    background-color: #4CAF50 !important;
    border: 2px solid #388E3C !important;
}

.square.gris {
    background-color: #bdbdbd !important;
    border: 2px solid #757575 !important;
}

/* Controles */
.controls {
    margin: 20px 0;
}

.controls button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    margin: 0 10px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.controls button:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.comprobar {
    background: #ff9800 !important;
    color: #fff !important;
    border: none;
    padding: 12px 24px;
    margin: 0 10px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.comprobar:hover {
    background: #fb8c00 !important;
}

.boton {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    margin: 0 10px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.boton:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.boton, .comprobar {
    min-width: 150px;
    box-sizing: border-box;
}

.botones {
    text-align: center;
}

#objetivoContainer {
    text-align: center;
}

/* Información */
.info {
    color: #666;
    font-size: 14px;
}

.info p {
    margin: 5px 0;
}

#markedSquares {
    font-weight: bold;
    color: #333;
}

/* Etiquetas de coordenadas */
.coordinate {
    display: none;
}

/* Modal obligatorio al abrir la web */
.intro-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: flex-start;
    justify-content: center;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
}
.intro-modal-content {
    background: #fff;
    padding: 20px 22px;
    border-radius: 10px;
    max-width: 520px;
    width: calc(100% - 40px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    position: relative;
    text-align: left;
    max-height: 80vh;
    overflow-y: auto;
}
.intro-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}
.intro-modal h2 { margin-bottom: 8px; color: #222; }
.intro-modal p { color: #444; line-height: 1.4; }

/* Imagen dentro del modal introductorio */
.intro-image {
    max-width: 60%;
    height: auto;
    display: block;
    margin: 12px auto;
    border-radius: 6px; /* opcional */
}

/* Lista dentro del modal introductorio */
.intro-list {
    margin: 10px 0 0 20px;
    color: #444;
}
.intro-list li {
    margin-bottom: 6px;
    line-height: 1.3;
}

/* Responsive: mejorar márgenes y padding en móvil */
@media (max-width: 600px) {
    .container {
        max-width: 100%;
        margin: 12px auto;
        padding: 10px 4px;
        border-radius: 10px;
        box-shadow: 0 1px 8px rgba(0,0,0,0.05);
    }
    h1, h2 {
        font-size: 1.3em;
    }
    .faq {
        margin-top: 18px !important;
        padding: 0 2px;
    }
}

/* Evitar selección de texto en botones principales */
#resetBoard,
#colorToggleBtn,
#comprobarBtn,
#objetivoBtn {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
