/* General Body Styles */
body {
    font-family: 'Arial', sans-serif;
    background-color: #fff; /* Revert to white */
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}


/* Header Styles */
header {
    background-color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

header .logo img {
    height: 50px;
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

header nav ul li {
    margin-left: 20px;
}

header nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

/* Main Content Styles */
main {
    flex: 1;
    padding: 20px;
}

/* Footer Styles */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    width: 100%;
}

/* Form Styles */
.form-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.form-container h2 {
    text-align: center;
    margin-bottom: 20px;
}

.form-container .form-group {
    margin-bottom: 15px;
}

.form-container .form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-container .form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.form-container .btn {
    width: 100%;
    padding: 10px;
    border: none;
    background-color: #5cb85c;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

.form-container .btn:hover {
    background-color: #4cae4c;
}

/* Chessboard Styles */
#board-wrapper {
    position: relative;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center; /* Changed from flex-start to center */
}

.board-top-row {
    position: absolute;
    top: 8px;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    z-index: 10;
    padding: 0 5px;
}

#user-elo-rating {
    position: absolute;
    left: 20px;
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
    white-space: nowrap;
}

#difficulty-stars {
    color: #cccccc;
    font-size: 18px;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

#difficulty-stars .fa-star {
    margin: 0 2px;
}

#turn-indicator {
    width: 25px;
    height: 25px;
    border: 2px solid;
    border-radius: 4px;
    z-index: 10;
}

#turn-indicator.turn-white {
    background-color: #f0f0f0;
    border-color: #333;
}

#turn-indicator.turn-black {
    background-color: #333;
    border-color: #f0f0f0;
}

#stopwatch {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0;
    margin: 0 auto;
}

#board {
    width: 100% !important;
    /* max-width: 400px; */
    touch-action: none;
    margin-top: 0;
    margin: 0 auto;
}

.in-check-glow {
  box-shadow: inset 0 0 25px #ff0000;
}

#rating{
    text-align: left;
    border:solid 1px red;
}

/* ===== Estilos para el Panel de Administración y Vistas Principales ===== */

.admin-container {
    width: 100% !important;
    max-width: 1750px !important;
    margin: 0 auto !important;
    display: block !important;
    background-color: transparent !important;
    padding: 0 1.25rem !important;
}

/* Estilos del menú lateral (Sidebar) */
.sidebar {
    width: 260px;
    background-color: #2c3e50;
    color: #ecf0f1;
    height: 100vh;
    position: fixed; /* Menú lateral fijo */
    top: 0;
    left: 0;
    z-index: 1000; /* Asegura que esté por encima del contenido */
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #34495e;
}

.sidebar-logo {
    max-width: 160px;
    margin-bottom: 10px;
}

.sidebar-header h3 {
    margin: 0;
    font-weight: 300;
    color: #ecf0f1;
}

.sidebar-nav {
    flex-grow: 1;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.sidebar-nav li a {
    display: block;
    padding: 15px 25px;
    color: #ecf0f1;
    text-decoration: none;
    font-size: 1.0em;
    transition: background-color 0.3s, padding-left 0.3s, border-left 0.3s;
    border-left: 3px solid #3498db;
}

.sidebar-nav li a:hover {
    background-color: #34495e;
    padding-left: 30px;
    border-left: 3px solid #3498db;
}

/* Estilos del contenido principal (Pantalla completa y despejada) */
.main-content {
    flex-grow: 1;
    width: 100% !important;
    max-width: 100% !important;
    padding: 24px 8px !important;
    background-color: transparent !important;
}

/* Modernización global para vistas de administración y contenedores */
.admin-container .card,
.dashboard-container .card,
.container .card {
    border-radius: 16px;
    border: 1px solid #edf2f7;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.admin-container .card-header,
.container .card-header {
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
    border-bottom: 1px solid #edf2f7;
    padding: 16px 22px;
    font-weight: 600;
}

.admin-container .table-responsive,
.container .table-responsive {
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    background: #ffffff;
    border: 1px solid #edf2f7;
    overflow: hidden;
}

.admin-container thead th,
.container thead th {
    background-color: #f8fafc;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 18px;
    border-bottom: 2px solid #e2e8f0;
}

.admin-container tbody td,
.container tbody td {
    padding: 14px 18px;
    vertical-align: middle;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.admin-container tbody tr:hover,
.container tbody tr:hover {
    background-color: #f8fafc;
}

.admin-container .form-control,
.admin-container .form-select,
.container .form-control,
.container .form-select {
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.admin-container .form-control:focus,
.admin-container .form-select:focus,
.container .form-control:focus,
.container .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}

/* Contenedores con ancho extendido */
.container,
.dashboard-container {
    max-width: 1700px !important;
    width: 100% !important;
}

/* Estilos para los íconos de módulos en admin/index.php */
.module-icons-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.module-icon {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: #2c3e50;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.module-icon:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.module-icon .icon {
    font-size: 3em;
    margin-bottom: 15px;
    color: #3498db;
}

.module-icon span {
    font-size: 1.1em;
    font-weight: 500;
    display: block;
}

/* Botón grande de Crear Diagrama */
.crear-diagrama-btn {
    display: inline-block;
    padding: 15px 30px;
    background-color: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
}
.crear-diagrama-btn:hover {
    background-color: #229954;
}
.active-move {
    background-color: #d1ecf1; /* Light blue background */
    font-weight: bold;
}

/* Mobile-specific optimizations for categoria.php */
@media (max-width: 767.98px) {
    /* Reduce logo size on mobile */
    header .logo img {
        height: 35px;
    }

    /* Hide non-essential info for a cleaner, Lichess-like puzzle view */
    .categoria-page .breadcrumb,
    .categoria-page .container > p.mb-2 {
        display: none;
    }

    /* Use flexbox to reorder content for a mobile-first experience */
    .categoria-page .container {
        display: flex;
        flex-direction: column;
    }

    /* --- Order of elements --- */
    /* 1. Board is the first and most prominent element */
    .categoria-page .row.mt-4 {
        order: 1;
        margin-top: 0 !important; /* Remove top margin */
    }

    /* 2. Result message (Correcto/Incorrecto) appears right below the board */
    .categoria-page #result-message-container {
        order: 2;
        margin-top: 0.5rem;
    }

    /* 3. Problem/solved counts appear below the result message */
    .categoria-page .row.mb-3 {
        order: 3;
        text-align: center;
    }

    /* 4. Category title container (now just holds report button) */
    .categoria-page .d-flex.justify-content-between.align-items-center {
        order: 4;
        flex-direction: column;
        gap: 0.5rem; /* Add space between title and button */
        margin-top: 1rem;
    }

    /* --- Styling adjustments --- */
    /* Ensure columns inside the reordered rows take full width */
    .categoria-page .row.mt-4 > div,
    .categoria-page .row.mb-3 > div {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
        text-align: center !important; /* Force center alignment */
    }

    /* Center the problem count text elements */
    .categoria-page .col-md-6.text-center.text-md-start,
    .categoria-page .col-md-6.text-center.text-md-end {
        text-align: center !important;
    }
    
    /* Make sure the board wrapper doesn't have excessive margins */
    #board-wrapper {
        margin: 0 auto;
    }

    /* Styles for new title/stopwatch layout */
    #stopwatch {
        font-size: 1.2rem;
        font-weight: bold;
        margin: 0;
    }

    #title-stopwatch-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        max-width: 460px; /* Match board-wrapper max-width */
        margin: 0 auto 0.5rem auto;
        padding: 0 10px;
        box-sizing: border-box;
    }

    #title-stopwatch-wrapper h3 {
        font-size: 1.1rem; /* Slightly smaller than stopwatch */
        margin: 0;
        font-weight: normal;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .categoria-page .lichess-menu-center h3 {
        font-size: 0.7rem !important; /* Make text very small on mobile */
    }

    .lichess-menu .user-name {
        font-size: 0.8rem; /* Smaller font size for username on mobile */
    }

    .categoria-page .container-fluid p {
        font-size: 0.7rem;
    }

    .categoria-page .col-lg-3 h4 {
        font-size: 0.8rem;
    }

    .categoria-page #move-sequence-display,
    .categoria-page #desarrollo-content {
        font-size: 0.7rem;
    }
}

/* Control the height of the logo in its new 3-column desktop layout */
.desktop-view-container .col-md-4.text-center img {
    height: 75px;
}

@media (min-width: 992px) {
    .container-fluid {
        padding-left: 8rem;
        padding-right: 8rem;
    }
}

.chessboard-container {
    padding-left: 2rem;
    padding-right: 2rem;
}

.lichess-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.lichess-menu-left,
.lichess-menu-right {
    display: flex;
    align-items: center;
}

.lichess-menu-center {
    flex-grow: 1;
    text-align: center;
}

.lichess-menu h3 {
    margin-bottom: 0;
    font-size: 1.25rem;
}

.lichess-menu .btn-link {
    color: #212529;
    text-decoration: none;
}

.lichess-menu .user-rating {
    font-weight: bold;
    margin-right: 1rem;
}

#miniBoard .board-b72b1 {
    width: 100px !important;
    height: 100px !important;
}

#miniBoard img {
    width: 12.5px !important;
    height: 12.5px !important;
}

/* ==========================================================================
   ESTILOS PARA LA PÁGINA DE LOGIN (MODERN CHESS TRAINER THEME - MODO CLARO)
   ========================================================================== */

html, body.login-page {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #1e293b !important;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    position: relative;
    overflow-x: hidden;
}

/* Background chess subtle grid decoration in light mode */
body.login-page::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px),
        radial-gradient(rgba(16, 185, 129, 0.05) 1px, transparent 1px) !important;
    background-size: 36px 36px !important;
    background-position: 0 0, 18px 18px !important;
    pointer-events: none;
    z-index: 0;
}

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
    margin: auto;
}

.login-card {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-top: 4px solid #10b981 !important;
    border-radius: 20px !important;
    padding: 40px 32px !important;
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08),
                0 0 20px rgba(16, 185, 129, 0.06) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12),
                0 0 25px rgba(16, 185, 129, 0.12) !important;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo-img {
    width: 210px;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08)) !important;
    transition: transform 0.3s ease;
}

.login-logo-img:hover {
    transform: scale(1.03);
}

.login-title {
    font-weight: 700 !important;
    font-size: 1.6rem !important;
    color: #0f172a !important;
    margin-top: 18px !important;
    margin-bottom: 6px !important;
    letter-spacing: -0.02em !important;
}

.login-subtitle {
    color: #64748b !important;
    font-size: 0.9rem !important;
    margin-bottom: 0 !important;
}

.login-form .form-label {
    color: #334155 !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    margin-bottom: 6px !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-icon-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-group .input-icon-left {
    position: absolute;
    left: 14px;
    color: #94a3b8 !important;
    font-size: 1.05rem;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 4;
}

.input-icon-group .form-control {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    border-radius: 12px !important;
    padding: 12px 14px 12px 42px !important;
    font-size: 0.95rem !important;
    transition: all 0.25s ease;
}

.input-icon-group .form-control.has-toggle {
    padding-right: 44px !important;
}

.input-icon-group .form-control::placeholder {
    color: #94a3b8 !important;
}

.input-icon-group .form-control:focus {
    background-color: #ffffff !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15) !important;
    color: #0f172a !important;
}

.input-icon-group .form-control:focus ~ .input-icon-left {
    color: #10b981 !important;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    z-index: 4;
    transition: color 0.2s ease;
}

.password-toggle-btn:hover {
    color: #10b981 !important;
}

.btn-login {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    padding: 12px 20px !important;
    border-radius: 12px !important;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25) !important;
    transition: all 0.25s ease;
    cursor: pointer;
}

.btn-login:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35) !important;
}

.login-divider {
    border-top: 1px solid #e2e8f0 !important;
    margin: 24px 0 20px 0 !important;
}

.login-footer-links {
    text-align: center;
    font-size: 0.875rem;
}

.login-footer-links p {
    margin-bottom: 8px !important;
    color: #64748b !important;
}

.login-link {
    color: #059669 !important;
    text-decoration: none;
    font-weight: 600 !important;
    transition: color 0.2s ease;
}

.login-link:hover {
    color: #047857 !important;
    text-decoration: underline;
}

.login-link-muted {
    color: #64748b !important;
    text-decoration: none;
    font-size: 0.85rem !important;
    transition: color 0.2s ease;
}

.login-link-muted:hover {
    color: #0f172a !important;
    text-decoration: underline;
}

.login-alert {
    background-color: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #991b1b !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    font-size: 0.9rem !important;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px !important;
}

/* ==========================================================================
   ESTILOS PARA EL DASHBOARD DE INICIO (INDEX.PHP - MODO CLARO PREMIUM)
   ========================================================================== */

.dashboard-container {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

/* Hero Section */
.index-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px 24px;
    margin-bottom: 2.2rem;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.04);
    position: relative;
    overflow: hidden;
}

.index-hero-title {
    font-weight: 800;
    font-size: 1.75rem;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.index-hero-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.section-heading-custom {
    font-weight: 700;
    font-size: 1.3rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.4rem;
}

.section-divider-custom {
    border-top: 2px solid #e2e8f0;
    margin-top: 0.4rem;
    margin-bottom: 1.5rem;
}

/* Card Styles */
.course-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 30px -10px rgba(15, 23, 42, 0.12),
                0 0 15px rgba(16, 185, 129, 0.1);
    border-color: #cbd5e1;
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    height: 190px;
    overflow: hidden;
    background-color: #f1f5f9;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.course-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.type-badge-custom {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.badge-test {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
}

.badge-study {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: #ffffff;
}

.course-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.course-card-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.35;
    transition: color 0.2s ease;
}

.course-card:hover .course-card-title {
    color: #059669;
}

.course-card-desc {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.course-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.85rem;
    font-weight: 600;
    color: #059669;
}

.course-card-footer .arrow-icon {
    transition: transform 0.2s ease;
}

.course-card:hover .course-card-footer .arrow-icon {
    transform: translateX(4px);
}

.group-header-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #10b981;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.empty-state-box {
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 36px 20px;
    text-align: center;
    color: #64748b;
}

.card-img-wrapper img.fallback-logo-img {
    object-fit: contain !important;
    padding: 24px !important;
    background-color: #f8fafc !important;
}

/* ==========================================================================
   BADGE 2.0 EN LOGO
   ========================================================================== */

.logo-wrapper-20 {
    position: relative;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    vertical-align: middle;
}

.badge-20 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    margin-left: 6px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
    line-height: 1.2;
    display: inline-block;
    vertical-align: middle;
    border: 1px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.logo-wrapper-20:hover .badge-20 {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.5);
}

.badge-20-lg {
    font-size: 0.85rem;
    padding: 3px 10px;
    border-radius: 20px;
    margin-left: 8px;
}

.badge-20-sm {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 12px;
    margin-left: 5px;
}

/* ==========================================================================
   ESTILOS DE INTERFAZ ESTILO LICHESS PARA CATEGORIA / PUZZLES
   ========================================================================== */

.lichess-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 15px;
}

.lichess-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    padding: 18px 20px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

/* Tablero de Ajedrez */
.lichess-board-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    max-width: calc(var(--board-max-width, 560px) + 36px) !important;
    margin: 0 auto;
    transition: max-width 0.2s ease;
}

#board-wrapper {
    width: 100% !important;
    max-width: var(--board-max-width, 560px) !important;
    margin: 0 auto !important;
    transition: max-width 0.2s ease;
}

#board {
    width: 100% !important;
    max-width: var(--board-max-width, 560px) !important;
    margin: 0 auto !important;
    transition: max-width 0.2s ease;
}

.lichess-board-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    background: #f8fafc;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.lichess-btn-ctrl {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.lichess-btn-ctrl:hover {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

/* Banner de Turno estilo Lichess */
.lichess-turn-card {
    border-left: 5px solid #0284c7;
    padding: 16px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #0284c7;
    transition: all 0.25s ease;
}

.lichess-turn-card.turn-white {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #0284c7;
}

.lichess-turn-card.turn-black {
    background: #1e293b;
    color: #ffffff;
    border: 1px solid #0f172a;
    border-left: 5px solid #64748b;
}

.lichess-turn-card.turn-black .text-muted {
    color: #94a3b8 !important;
}

.turn-icon-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    border: 2px solid #64748b;
}

.turn-icon-dot.white-dot {
    background: #ffffff;
    border-color: #0284c7;
}

.turn-icon-dot.black-dot {
    background: #0f172a;
    border-color: #94a3b8;
}

/* Caja de Mensaje Feedback Lichess */
.lichess-feedback-box {
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.lichess-feedback-box.status-neutral {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.lichess-feedback-box.status-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.lichess-feedback-box.status-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.lichess-feedback-box.status-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Botón Siguiente Lichess */
.lichess-next-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transition: all 0.2s ease;
}

.lichess-next-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
    color: #ffffff;
}

/* Panel de Movimientos PGN Lichess */
.lichess-moves-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace, 'Outfit', sans-serif;
    font-size: 0.9rem;
}

.lichess-moves-table {
    width: 100%;
    margin-bottom: 0;
}

.lichess-moves-table td {
    padding: 4px 8px;
    border: none;
}

.lichess-moves-table .active-move {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    font-weight: bold;
    border-radius: 4px;
}

/* Resumen Estadísticas */
.lichess-stat-badge {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Adaptaciones Móviles para Lichess Layout (< 768px) */
@media (max-width: 768px) {
    .lichess-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        padding-top: 12px !important;
    }
    .lichess-board-card {
        padding: 16px 14px !important;
        border-radius: 12px;
        margin-bottom: 16px;
    }
    .lichess-board-controls {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px;
    }
    .lichess-btn-ctrl {
        padding: 6px 12px;
        font-size: 0.82rem;
    }
    .extra-small {
        font-size: 0.78rem;
    }
}

/* Ocultar notación de filas y columnas en miniaturas del administrador */
.diagram-card .notation-322f9,
#diagram-navigator .notation-322f9 {
    display: none !important;
}


""