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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.5em;
    color: #f0c040;
    text-shadow: 0 0 20px rgba(240, 192, 64, 0.3);
}

/* ============================================
   CONTROLES SUPERIORES
   ============================================ */
.top-controls {
    text-align: center;
    margin-bottom: 20px;
}

.btn-reset-top {
    padding: 10px 30px;
    background: #f0c040;
    color: #1a1a2e;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(240, 192, 64, 0.3);
}

.btn-reset-top:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(240, 192, 64, 0.5);
}

.game-wrapper {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.board-container {
    flex: 0 0 auto;
    max-width: 100%;
}

/* ============================================
   TABLERO
   ============================================ */
.board {
    display: grid;
    grid-template-columns: repeat(9, 60px);
    grid-template-rows: repeat(10, 60px);
    background: #d4a050;
    border: 3px solid #8b6b3a;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: fit-content;
    margin: 0 auto;
}

.cell {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s;
    background: #d4a050;
}

.cell:hover {
    background: rgba(255, 255, 255, 0.15);
}

.cell.selected {
    background: rgba(255, 255, 0, 0.3) !important;
    box-shadow: inset 0 0 20px rgba(255, 255, 0, 0.3);
}

.cell.valid-move {
    background: rgba(0, 200, 255, 0.15) !important;
}

.cell.in-check {
    background: rgba(255, 0, 0, 0.3) !important;
    animation: checkPulse 0.8s infinite;
}

@keyframes checkPulse {
    0%, 100% { background: rgba(255, 0, 0, 0.3); }
    50% { background: rgba(255, 0, 0, 0.6); }
}

/* ============================================
   PIEZAS
   ============================================ */
.piece {
    font-size: 40px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    user-select: none;
    z-index: 2;
    line-height: 1;
}

.piece.red {
    color: #cc0000;
    filter: drop-shadow(0 0 5px rgba(204, 0, 0, 0.5));
}

.piece.black {
    color: #222;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

.piece.pulse {
    animation: piecePulse 0.8s infinite;
}

@keyframes piecePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.piece:hover {
    transform: scale(1.1);
}

/* ============================================
   PUNTOS DE MOVIMIENTO
   ============================================ */
.dot {
    width: 15px;
    height: 15px;
    background: #0088ff;
    border-radius: 50%;
    position: absolute;
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 15px rgba(0, 136, 255, 0.6);
    pointer-events: none;
}

.dot.capture-dot {
    background: #ff4444;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.8);
    width: 20px;
    height: 20px;
    border: 2px solid #ff0000;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
}

/* ============================================
   ESTADO DEL JUEGO
   ============================================ */
.game-status {
    margin-top: 15px;
    margin-bottom: 15px;
}

.status-banner {
    padding: 12px 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    animation: slideDown 0.5s ease;
}

.status-banner.check {
    background: rgba(255, 215, 0, 0.25);
    border: 2px solid #ffd700;
    color: #ffd700;
}

.status-banner.game-over-banner {
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid #f0c040;
    color: #f0c040;
}

.status-banner .reset-btn {
    margin-left: 15px;
    padding: 5px 15px;
    background: #f0c040;
    color: #1a1a2e;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.status-banner .reset-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(240, 192, 64, 0.4);
}

/* ============================================
   SECCIÓN DE AYUDA
   ============================================ */
.help-section {
    margin-top: 25px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.help-section h2 {
    color: #f0c040;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.help-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.help-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(240, 192, 64, 0.3);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.help-card.special {
    border-color: rgba(255, 215, 0, 0.3);
}

.help-card.special:hover {
    border-color: #f0c040;
}

.help-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.help-symbol {
    font-size: 28px;
    line-height: 1;
}

.help-header h3 {
    color: #fff;
    font-size: 1.1em;
    margin: 0;
}

.special-badge {
    background: #f0c040;
    color: #1a1a2e;
    font-size: 0.7em;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: bold;
}

.help-content {
    font-size: 0.9em;
    line-height: 1.6;
}

.help-content p {
    margin: 5px 0;
    color: #ddd;
}

.help-content .highlight {
    color: #ff6b6b;
    font-weight: bold;
}

/* ============================================
   REGLAS
   ============================================ */
.rules-section {
    background: rgba(255, 215, 0, 0.05);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 215, 0, 0.1);
    margin-top: 10px;
}

.rules-section h3 {
    color: #f0c040;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.rules-section ul {
    list-style: none;
    padding: 0;
}

.rules-section ul li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #ddd;
    line-height: 1.6;
}

.rules-section ul li:last-child {
    border-bottom: none;
}

.rules-section ul li strong {
    color: #f0c040;
}

/* ============================================
   PANEL LATERAL
   ============================================ */
.side-panel {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
}

.game-info {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.turn-indicator {
    font-size: 1.2em;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
}

.turn-indicator.check-warning {
    border: 2px solid #ffd700;
    animation: checkPulse 0.8s infinite;

}

.turn-indicator .red {
    color: #ff3333;
    font-weight: bold;
}

.turn-indicator .black {
    color: #aaa;
    font-weight: bold;
}

.check-badge {
    display: inline-block;
    background: #ffd700;
    color: #1a1a2e;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-left: 10px;
    font-weight: bold;
}

.game-over {
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid #f0c040;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-top: 10px;
}

.game-over button {
    margin-top: 10px;
    padding: 8px 20px;
    background: #f0c040;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.game-over button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(240, 192, 64, 0.4);
}

.pieces-list {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.pieces-list h3 {
    margin-bottom: 15px;
    color: #f0c040;
    text-align: center;
}

.pieces-category {
    margin-bottom: 15px;
}

.pieces-category h4 {
    margin-bottom: 8px;
    color: #ccc;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.piece-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.piece-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.piece-item.red {
    border-left: 3px solid #cc0000;
}

.piece-item.black {
    border-left: 3px solid #444;
}

.piece-symbol {
    font-size: 24px;
    margin-right: 10px;
    width: 30px;
    text-align: center;
}

.piece-name {
    font-size: 0.95em;
}

.piece-info {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 20px;
    min-height: 150px;
}

.piece-info h3 {
    color: #f0c040;
    margin-bottom: 10px;
}

.move-description {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    border-left: 4px solid #f0c040;
    line-height: 1.6;
    font-size: 0.95em;
}

.move-description strong {
    color: #f0c040;
}

/* ============================================
   NOTIFICACIONES
   ============================================ */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    display: none;
    max-width: 90%;
    text-align: center;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.notification.success {
    background: rgba(46, 204, 113, 0.95);
    color: #fff;
    border: 2px solid #2ecc71;
}

.notification.error {
    background: rgba(231, 76, 60, 0.95);
    color: #fff;
    border: 2px solid #e74c3c;
}

.notification.info {
    background: rgba(52, 152, 219, 0.95);
    color: #fff;
    border: 2px solid #3498db;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .board {
        grid-template-columns: repeat(9, 45px);
        grid-template-rows: repeat(10, 45px);
    }
    
    .cell {
        width: 45px;
        height: 45px;
        min-width: 45px;
        min-height: 45px;
    }
    
    .piece {
        font-size: 28px;
    }
    
    .dot {
        width: 10px;
        height: 10px;
    }
    
    .dot.capture-dot {
        width: 14px;
        height: 14px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .side-panel {
        min-width: 200px;
        max-width: 100%;
    }
    
    .help-grid {
        grid-template-columns: 1fr;
    }
    
    .notification {
        font-size: 0.9em;
        padding: 10px 20px;
    }
}