:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(22, 30, 49, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --accent: #a855f7;
    --text: #f8fafc;
    --text-muted: #94a3b8;

    /* Colores del tablero */
    --tile-light: #e2e8f0;
    --tile-dark: #475569;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.15), transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.15), transparent 30%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    text-align: center;
}

.instructions {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    max-width: 500px;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.main-container {
    display: flex;
    flex-direction: row;
    gap: 2.5rem;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    max-width: 1000px;
    flex-wrap: wrap;
}

/* Tablero de Ajedrez */
.chessboard-wrapper {
    position: relative;
}

.chessboard {
    display: grid;
    grid-template-columns: repeat(8, 60px);
    grid-template-rows: repeat(8, 60px);
    border: 6px solid #1e293b;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.tile {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s, transform 0.1s;
}

.tile.light {
    background-color: var(--tile-light);
    color: #1e293b;
}

.tile.dark {
    background-color: var(--tile-dark);
    color: #f8fafc;
}

.tile:hover {
    filter: brightness(1.2);
    transform: scale(1.02);
    z-index: 10;
}

/* Estados de las casillas */
.tile.start {
    background-color: var(--primary) !important;
    color: white;
}

.tile.end {
    background-color: var(--accent) !important;
    color: white;
}

.tile.path-step {
    background-color: rgba(59, 130, 246, 0.4) !important;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.95);
    }
}

.step-number {
    background-color: #1e293b;
    border: 2px solid white;
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Panel de Control Lateral */
.panel {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    width: 320px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.panel h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.console-out {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 1rem;
    font-family: monospace;
    font-size: 0.85rem;
    color: #34d399;
    height: 220px;
    overflow-y: auto;
    white-space: pre-line;
    margin-bottom: 1.5rem;
}

button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}