body.index {
    max-height: 100vh;
    height: 100vh;
    /*background-image: url("/static/img/stauty.png") no-repeat left bottom;*/
    background: linear-gradient(to right, #0198b2, #7dd857);
    padding:20px 30px 60px 30px;
    font-family: "ShantellBold";
}
body.segundas {
    min-height: 100vh;
    /*background-image: url("/static/img/stauty.png") no-repeat left bottom;*/
    background: linear-gradient(to right, #0198b2, #7dd857);
    padding:30px;
    font-family: "ShantellBold";
}
img.stauty {
    position: absolute;
    bottom: 0px;
    left: 0px;
    z-index: 1;
    height:62%;
}
img.twopieces
 {
    position: absolute;
    bottom: -100px;
    left: -150px;
    z-index: 1;
    height:62%;
}
img.ajustes {
    position: absolute;
    top: 0px;
    right: 20px;
}
.screen {
    height: 100%;
    background-image: url("/static/img/fondo.png");
    position: relative;
    padding: 140px;
    background-size: cover;
}
@font-face {
      font-family: 'ShantellBold';
      font-style: normal;
      font-weight: 400;
      src: url(/static/fonts/ShantellSans-VariableFont_BNCE,INFM,SPAC,wght.ttf) format('truetype');
}
@font-face {
      font-family: 'LazyDog';
      font-style: normal;
      font-weight: 400;
      src: url(/static/fonts/lazy_dog.ttf) format('truetype');
}
@font-face {
    font-family: 'ChessSansPiratf';
    src: url('/static/fonts/ChessSansPiratf.woff') format('woff'),
         url('/static/fonts/ChessSansPiratf.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}


/* ── Login ── */
.login-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-box {
    background: #f5e6b0;
    border: 2px solid #e0c870;
    border-radius: 14px;
    padding: 36px 40px;
    width: 340px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.15);
}
.login-box h2 {
    margin: 0 0 6px 0;
    color: #1a3a1a;
    font-size: 1.6em;
    text-align: center;
}
.login-box .login-sub {
    text-align: center;
    font-size: 0.85em;
    color: #5a7a5a;
    margin-bottom: 24px;
}
.login-box label {
    display: block;
    font-size: 0.85em;
    color: #555;
    margin-bottom: 4px;
}
.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c8b060;
    border-radius: 6px;
    font-size: 1em;
    margin-bottom: 16px;
    background: #fffdf0;
}
.login-box input:focus {
    outline: none;
    border-color: #4a9558;
    box-shadow: 0 0 0 2px #b8e0c0;
}
.login-box button {
    width: 100%;
    padding: 10px;
    background: #2e6b3e;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    font-weight: bold;
}
.login-box button:hover { background: #4a9558; }
.login-error {
    background: #fde8e8;
    color: #a71d2a;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 0.9em;
    margin-bottom: 16px;
    text-align: center;
}
.login-bar {
    display:flex;
    align-items:center;
    gap:14px;
    justify-content: end
}
.login-bar span {
    font-size:18px;
    color:#1a3a1a;
}
    /* ── Columna izquierda ── */
    #izquierda-scroll {
        max-height: 50vh;
        overflow-y: scroll;
    }

    .capitulo-bloque { border-bottom: 1px solid #eee; }

    .capitulo-header {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        cursor: pointer;
        user-select: none;
        background: transparent;
        transition: background 0.15s;
    }
    .capitulo-header:hover { background: rgba(0,0,0,0.06); }
    .capitulo-header.activo {
        background: rgba(0,0,0,0.08);
        font-weight: bold;
        color: #c4ff6d;
    }
    .capitulo-numero {
        background-color: #56dbe0;
        border: 1px solid #4b8666;
        border-radius: 50px;
        display: block;
        text-align: center;
        align-content: center;
        margin: 0px 12px 0px 0px;
        font-family: "LazyDog";
        font-weight: bold;
        font-size: 22px;
        height: 32px;
        width: 32px;
        min-width: 32px;
        line-height: 32px;
    }
    .capitulo-titulo { flex: 1; font-size: 28px;color:56dbe0; }
    .capitulo-trofeo { width: 22px; height: auto; margin-right: 6px; }
    .flecha {
        font-size: 0.75em;
        color: #999;
        transition: transform 0.2s;
    }
    .flecha.abierto { transform: rotate(90deg); }

    .progreso-bar-wrap {
        height: 4px;
        background: #e0e0e0;
        margin: 0 16px 4px;
        border-radius: 2px;
    }
    .progreso-bar {
        height: 4px;
        background: #28a745;
        border-radius: 2px;
        transition: width 0.4s ease;
    }
    .progreso-bar.completo { background: #1a5276; }

    .problemas-lista {
        display: none;
    }
    .problemas-lista.abierto { display: block; }

    .problema-item {
        display: flex;
        align-items: center;
        padding: 8px 16px 8px 40px;
        font-size: 24px;
        color: #56dbe0;
        cursor: pointer;
    }
    .problema-item:hover { background: #eaf2fb; color: #1a5276; }
    .problema-item.activo { background: rgba(0,0,0,0.08); color: #c4ff6d; font-weight: bold; }
    .problema-item:last-child { border-bottom: none; }
    .problema-check {
        margin-left: auto;
        display: none;
        width: 22px;
        height: 22px;
        min-width: 22px;
        border-radius: 50%;
        background: #f5c400;
        color: #1a3a1a;
        font-size: 0.8em;
        font-weight: bold;
        align-items: center;
        justify-content: center;
    }
    .problema-item.hecho .problema-check { display: flex; }
    .sin-problemas {
        padding: 8px 16px 8px 40px;
        font-size: 0.85em;
        color: #aaa;
        font-style: italic;
    }

    /* ── Columna centro ── */
    #problema-titulo {
        font-size: 1em;
        font-weight: bold;
        color: #1a5276;
        margin-bottom: 12px;
        text-align: center;
        min-height: 1.4em;
    }
    .placeholder-tablero {
        width: 100%;
        aspect-ratio: 1;
        border: 2px dashed #ccc;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #bbb;
        font-size: 0.95em;
    }
    #tablero { width: 100%; }

    .nav-controles {
        margin-top: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 66px;
    }
    .nav-controles button {
        cursor: pointer;
        border: none;
        background: none;
        padding: 0;
    }
    .nav-btn-circulo {
        width: 40px;
        height: 40px;
        border-radius: 50% !important;
        border: 1px solid #4b8666 !important;
        background: #ffad30 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1em;
        flex-shrink: 0;
        transition: background 0.15s;
    }
    .nav-btn-circulo:hover { background: #e89a1a !important; }
    .nav-btn-circulo img { width: 22px; height: 22px; display: block; }



    /* ── Columna derecha ── */
    #completado {
        margin: 12px;
        padding: 12px;
        background: #d4edda;
        border: 2px solid #28a745;
        border-radius: 6px;
        text-align: center;
        font-size: 1.2em;
        font-weight: bold;
        color: #155724;
    }
    #pgn-intro {
        background: #edeed1;
        border-radius: 10px;
        color: #000;
        overflow-y: scroll;
        max-height: 90vh;
        padding: 20px;
        font-size: 1.25rem;
    }
    #moveLog {
        overflow-y: auto;
        font-size: 20px;
        max-height: 60vh;
        padding: 20px;
        font-size: 1.25rem;
    }
    #moveLog .move-notation {
        font-family: 'ChessSansPiratf', monospace;
        font-size: 24px;
    }
    #moveLog .move-comment {
        font-family: Arial, sans-serif;
        font-size: 24px;
        font-style: italic;
        padding-left: 8px;
    }

/* ── Modal jugar ── */
#jugar-modal {
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
#jugar-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
}
#jugar-modal-content {
    position: relative;
    width: min(520px, 90vw);
    z-index: 1;
    background: #2e6b3e;
    border-radius: 14px;
    padding: 16px;
}
#jugar-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    color: #c4ff6d;
    font-family: 'ShantellBold', Arial, sans-serif;
    font-size: 1em;
    font-weight: bold;
}
#jugar-modal-header button {
    background: rgba(0,0,0,0.3);
    color: #c4ff6d;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-family: 'ShantellBold', Arial, sans-serif;
    font-size: 0.9em;
}
#jugar-modal-header button:hover { background: rgba(0,0,0,0.55); }
#jugar-tablero { width: 100%; }

/* ── Vídeo ── */
#video-modal {
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
#video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
}
#video-modal-content {
    position: relative;
    width: 80vw;
    max-width: 960px;
    z-index: 1;
}
#video-modal-cerrar {
    position: absolute;
    top: -36px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6em;
    cursor: pointer;
    line-height: 1;
}
#video-modal-cerrar:hover { color: #ffad30; }

/* ── Popup completado ── */
#completado-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
#completado-popup {
    background: #fff;
    border-radius: 18px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.35);
    animation: popup-in 0.3s ease;
}
@keyframes popup-in {
    from { transform: scale(0.7); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
#completado-emoji {
    font-size: 3.5em;
    margin-bottom: 12px;
}
#completado-texto {
    font-family: "ShantellBold", Arial, sans-serif;
    font-size: 2em;
    font-weight: bold;
    color: #1a5276;
    margin-bottom: 24px;
}
#completado-cerrar {
    padding: 10px 28px;
    background: #2e6b3e;
    color: #c4ff6d;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-family: "ShantellBold", Arial, sans-serif;
    font-weight: bold;
    cursor: pointer;
}
#completado-cerrar:hover { background: #4a9558; }

/* ── Pista ── */
.pista-origen {
    background-color: rgba(255, 220, 0, 0.75) !important;
    animation: pista-pulso 0.6s ease-in-out infinite alternate;
}
.pista-destino {
    background-color: rgba(255, 140, 0, 0.65) !important;
    animation: pista-pulso 0.6s ease-in-out infinite alternate;
}
@keyframes pista-pulso {
    from { opacity: 0.6; }
    to   { opacity: 1; }
}

#completado-trofeo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
}
#completado-trofeo-texto {
    font-family: "ShantellBold", Arial, sans-serif;
    font-size: 1.1em;
    font-weight: bold;
    color: #1a5276;
}
#completado-trofeo-nombre {
    font-size: 0.95em;
    color: #555;
    margin-top: 4px;
}

/* ── Popup trofeo ── */
#trofeo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
#trofeo-popup {
    background: #fff;
    border-radius: 18px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.35);
    animation: popup-in 0.3s ease;
}
#trofeo-img {
    width: 100px;
    height: auto;
    margin-bottom: 16px;
}
#trofeo-texto {
    font-family: "ShantellBold", Arial, sans-serif;
    font-size: 1.8em;
    font-weight: bold;
    color: #1a5276;
    margin-bottom: 8px;
}
#trofeo-capitulo-nombre {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 24px;
}
#trofeo-cerrar {
    padding: 10px 28px;
    background: #f5c400;
    color: #1a3a1a;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-family: "ShantellBold", Arial, sans-serif;
    font-weight: bold;
    cursor: pointer;
}
#trofeo-cerrar:hover { background: #e6b800; }

h1, h2, h3 {
    font-family: "ShantellBold";
    font-weight: 900;
}
h1.cabecera {
    font-size: 80px;
}
h2.cabecera {
    font-size: 45px;
    color:#56dbe0;
}
h2.cabecera a {
    text-decoration: none;
    color:#56dbe0;
}
h2.titulo {
    font-size: 38px;
    color:#c4ff6d;
}
h3 {
    font-size: 25px;
}

.screen {
    height: 100%;
    background-image: url("/static/img/fondo.png");
    position: relative;
    padding: 140px;
    background-size: cover;
}

.derecha {
    background: #edeed1;
  border-radius: 10px;
  color: #000;
  overflow-y: scroll;
  max-height: 90vh;
  padding: 20px;
  font-size: 1.25rem;
}

.cuadro {
    height: 230px;
    background-repeat: no-repeat;
    background-position: center;
    align-content: center;
    text-align: center;
    background-origin: content-box;
    background-size: contain;
    padding: 20px;
}
.cuadro:hover > a > img.estrella {
    width: 70px !important;
}
.cuadro:hover > a > h2 {
    font-size: 2.4rem;
}
.cuadro1 {
    background-image: url("/static/img/cuadro_1.png");
}
.cuadro2 {
    background-image: url("/static/img/cuadro_2.png");
}
.cuadro3 {
    background-image: url("/static/img/cuadro_3.png");
}
.cuadro4 {
    background-image: url("/static/img/cuadro_4.png");
}
.cuadro a {
    text-decoration: none;
    color:#000;
}
.cuadro:hover > a > img.estrella {
    width: 70px !important;
}
img.estrella {
    width: 60px;
    height: auto;
    padding: 4px;
}
img.estrella.small {
    width: 20px;
}

.footer {
  position: absolute;
  bottom: 0px;
  left: 20%;
  background-color: #24532e;
  color: #fff;
  padding: 20px;
  border-radius: 20px;
  width: 70%;
  margin: 0 auto 20px auto;
  text-align: center;
}


@media (min-height: 918px) {
    .cuadro {
        height: 300px;
    }
}
@media (min-height: 1062px) {
    .cuadro {
        height: 400px;
    }
}