/* ==========================================================================
   Naru2day — Episodios Game Styles
   Theme: Naruto orange · dark ninja · parchment final
   ========================================================================== */

/* ── 1. LAYOUT PRINCIPAL ── */
.ep-game-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.ep-page-header {
    text-align: center;
    padding: 28px 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ep-page-title {
    font-family: 'Reggae One', system-ui, sans-serif;
    font-size: clamp(1.4rem, 4vw, 2rem);
    background: linear-gradient(180deg, #FFB347 0%, var(--wn-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: 0.5px;
    filter: drop-shadow(0 2px 6px rgba(255, 107, 0, 0.35));
}

.ep-help-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--wn-orange);
    background: transparent;
    color: var(--wn-orange);
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.ep-help-btn:hover {
    background: var(--wn-orange);
    color: #fff;
}

/* ── 2. TARJETA PRINCIPAL DEL JUEGO ── */
.ep-game-card {
    background: url('../img/Fondo_Pergamino.webp') center center / cover no-repeat;
    background-color: #CE9D66;
    border: 2px solid #C19A6B;
    border-top: 3px solid #8B5A2B;
    border-radius: 20px;
    padding: 24px 28px 28px;
    box-shadow:
        0 2px 0 rgba(139, 90, 43, 0.3),
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    position: relative;
    overflow: hidden;
}

/* Brillo sutil en la esquina superior izquierda */
/* Brillo sutil en la esquina superior izquierda */
.ep-game-card::before {
    display: none;
}

/* ── 3. CABECERA DE RONDA (contador + score en vivo) ── */
.ep-round-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 18px;
    flex-wrap: wrap;
}

.ep-round-counter {
    font-family: 'Reggae One', system-ui, sans-serif;
    font-size: clamp(1.1rem, 3.5vw, 1.5rem);
    color: #8B5A2B;
    margin: 0;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.4);
}

.ep-live-score {
    font-family: 'Reggae One', system-ui, sans-serif;
    font-size: 1.1rem;
    color: #4A2E15;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid #C19A6B;
    border-radius: 20px;
    padding: 4px 16px;
    white-space: nowrap;
    transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.ep-live-score.score-updated {
    color: #8B5A2B;
    border-color: #8B5A2B;
    background: rgba(139, 90, 43, 0.1);
}

.ep-live-score-value {
    color: #8B5A2B;
    font-weight: 900;
}

/* ── 3. BADGE DE SERIE ── */
.ep-serie-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 6px;
    padding: 5px 14px;
    margin: 0 auto 12px;
    width: fit-content;
    animation: ep-slide-in 0.3s ease;
}

.ep-serie-badge--classic {
    background: rgba(139, 90, 43, 0.1);
    border: 1px solid #C19A6B;
    color: #8B5A2B;
}

.ep-serie-badge--classic::before {
    content: '🍃 ';
}

.ep-serie-badge--shippuden {
    background: rgba(100, 149, 237, 0.15);
    border: 1px solid rgba(100, 149, 237, 0.5);
    color: #4A76C9;
}

.ep-serie-badge--shippuden::before {
    content: '⚡ ';
}

/* ── 4. IMAGEN DEL EPISODIO ── */
.ep-image-wrap {
    position: relative;
    border: 2px solid #C19A6B;
    border-radius: 14px;
    overflow: hidden;
    background: #EFE1C6;
    width: 100%;
    max-width: 700px;
    aspect-ratio: 16 / 9;
    margin: 0 auto 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(139, 90, 43, 0.1);
    transition: border-color 0.3s;
}

.ep-image-wrap:hover {
    border-color: #8B5A2B;
}

.ep-image-wrap.ep-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 13, 20, 0.8);
}

.ep-image-wrap.ep-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 107, 0, 0.15);
    border-top-color: var(--wn-orange);
    border-radius: 50%;
    animation: ep-spin 0.8s linear infinite;
    z-index: 2;
}

@keyframes ep-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

#episode-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 12px;
    transition: opacity 0.3s;
    user-select: none;
    -webkit-user-drag: none;
}

.ep-image-wrap.ep-loading #episode-image {
    opacity: 0;
}

/* ── 4. ZONA DINÁMICA (formulario / resultado) ── */
#episode-dynamic-area {
    margin: 0 auto;
    max-width: 500px;
    text-align: center;
    padding-top: 20px;
}

/* Formulario de intento */
.ep-input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    justify-content: center;
    margin: 0 auto 8px;
}

#guess-input {
    flex: 0 0 60%;
    min-width: 130px;
    padding: 13px 20px;
    font-size: 1.35rem;
    text-align: center;
    color: #3E2723;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid #C19A6B;
    border-radius: 50px;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
    -moz-appearance: textfield;
}

#guess-input::-webkit-inner-spin-button,
#guess-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

#guess-input::placeholder {
    color: #8B5A2B;
    font-size: 1rem;
    opacity: 0.7;
}

#guess-input:focus {
    border-color: #8B5A2B;
    box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.05);
    background: #fff;
}

#submit-guess-btn {
    flex: 1 1 auto;
    padding: 0 26px;
    font-family: 'Reggae One', system-ui, sans-serif;
    font-size: 1.1rem;
    color: #fff;
    background: linear-gradient(135deg, #8B5A2B 0%, #5c4033 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    align-self: stretch;
    box-shadow: 0 4px 14px rgba(139, 90, 43, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    white-space: nowrap;
}

#submit-guess-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 90, 43, 0.5), inset 0 -2px 0 rgba(0, 0, 0, 0.15);
    filter: brightness(1.08);
}

#submit-guess-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(139, 90, 43, 0.3);
}

#submit-guess-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── 5. RESULTADO DE RONDA ── */
.ep-result-card {
    background: transparent;
    border: none;
    border-top: 1px dashed rgba(139, 90, 43, 0.4);
    border-radius: 0;
    margin-top: 16px;
    padding: 18px 10px 0;
    box-shadow: none;
    animation: ep-slide-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ep-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ep-result-label {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #8B5A2B;
    margin: 0 0 4px;
}

.ep-result-answer {
    color: #4A2E15;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 800;
    margin: 0 0 12px;
    line-height: 1.3;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.4);
}

.ep-result-serie {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 107, 0, 0.12);
    border: 1px solid rgba(255, 107, 0, 0.3);
    color: var(--wn-orange);
    border-radius: 4px;
    padding: 2px 8px;
    margin-bottom: 6px;
}

.ep-result-score {
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 900;
    margin: 0 0 4px;
    line-height: 1.2;
}

.ep-result-score.perfect {
    color: #F9D71C;
    text-shadow: -1px -1px 0 #8B5A2B, 1px -1px 0 #8B5A2B, -1px 1px 0 #8B5A2B, 1px 1px 0 #8B5A2B, 0 0 12px rgba(249, 215, 28, 0.5);
}

.ep-result-score.great {
    color: var(--wn-green);
}

.ep-result-score.good {
    color: var(--wn-orange);
}

.ep-result-score.miss {
    color: var(--wn-text-muted);
}

.ep-result-diff {
    font-size: 0.82rem;
    color: var(--wn-text-muted);
    margin: 0 0 16px;
}

#next-episode-btn {
    background: linear-gradient(135deg, #8B5A2B 0%, #5c4033 100%);
    border: none;
    color: #fff;
    font-family: 'Reggae One', system-ui, sans-serif;
    font-size: 1.1rem;
    padding: 12px 36px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(139, 90, 43, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    margin-top: 4px;
}

#next-episode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(139, 90, 43, 0.55), inset 0 -2px 0 rgba(0, 0, 0, 0.15);
    filter: brightness(1.08);
}

#next-episode-btn:active {
    transform: translateY(1px);
}

/* ── 6. PANTALLA FINAL (PERGAMINO) ── */
#final-screen {
    display: none;
    max-width: 620px;
    margin: 24px auto;
    animation: ep-slide-in 0.45s cubic-bezier(0.34, 1.3, 0.64, 1);
}

#final-screen.visible {
    display: block;
}

.ep-parchment {
    background-image: url('../img/Pergamino_sin_tinta.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-color: transparent;
    padding: 52px 48px 44px;
    text-align: center;
    position: relative;
}

.ep-parchment-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 8px;
    display: block;
}

.ep-parchment-title {
    font-family: 'Reggae One', system-ui, sans-serif;
    font-size: clamp(1.3rem, 4vw, 1.7rem);
    color: #3d2b1a;
    margin: 12px 0 4px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.ep-parchment-desc {
    color: #5a3e2b;
    font-size: 0.92rem;
    margin: 0 0 16px;
}

.ep-parchment-score-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #7a5c3e;
    margin: 0 0 6px;
}

.ep-parchment-score {
    font-family: 'Reggae One', system-ui, sans-serif;
    font-size: clamp(2.2rem, 7vw, 3.2rem);
    color: #2a7a3a;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.1), 0 0 20px rgba(42, 122, 58, 0.25);
    margin: 0 0 6px;
    line-height: 1.1;
}

.ep-parchment-comeback {
    color: #7a5c3e;
    font-size: 0.85rem;
    margin: 0;
}

/* Divider */
.ep-parchment-divider {
    width: 60px;
    height: 2px;
    background: rgba(100, 65, 30, 0.3);
    border-radius: 2px;
    margin: 16px auto;
}

/* Countdown dentro del pergamino */
.ep-countdown-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 14px 0 10px;
    color: #7a5c3e;
    font-size: 0.88rem;
}

.ep-countdown-timer {
    font-family: 'Reggae One', system-ui, sans-serif;
    font-size: 1.25rem;
    color: #2a7a3a;
    min-width: 90px;
    font-variant-numeric: tabular-nums;
}

/* Botón compartir debajo del pergamino */
.ep-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 340px;
    margin: 14px auto 0;
    padding: 13px 24px;
    background: linear-gradient(135deg, var(--wn-orange) 0%, var(--wn-orange-dark) 100%);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-family: 'Reggae One', system-ui, sans-serif;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 107, 0, 0.4);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    text-decoration: none;
}

.ep-share-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(255, 107, 0, 0.55);
    filter: brightness(1.08);
    text-decoration: none;
}

.ep-share-btn i {
    font-size: 1.15rem;
}

/* ── 7. TUTORIAL MODAL ── */
.ep-tutorial-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 13, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 1;
    transition: opacity 0.25s;
}

.ep-tutorial-overlay.hidden {
    display: none;
}

.ep-tutorial-box {
    background: url('../img/Fondo_Pergamino.webp') center center / cover no-repeat;
    background-color: #CE9D66;
    border: 2px solid #C19A6B;
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    text-align: center;
}

.ep-tutorial-title {
    font-family: 'Reggae One', system-ui, sans-serif;
    font-size: 1.5rem;
    color: #4A2E15;
    margin: 0 0 20px;
}

.ep-tutorial-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
    text-align: left;
}

.ep-tut-step {
    background: rgba(139, 90, 43, 0.12);
    border: 1px solid rgba(139, 90, 43, 0.3);
    border-radius: 12px;
    padding: 12px 10px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    text-align: left;
}

.ep-tut-step-emoji {
    font-size: 1.6rem;
    line-height: 1;
    grid-row: 1 / -1;
    grid-column: 1;
    align-self: center;
}

.ep-tut-step h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #4A2E15;
    margin: 0 0 2px;
    grid-row: 1;
    grid-column: 2;
    align-self: end;
}

.ep-tut-step p {
    font-size: 0.78rem;
    color: #5c4033;
    margin: 0;
    line-height: 1.4;
    grid-row: 2;
    grid-column: 2;
    align-self: start;
}

.ep-tutorial-play-btn {
    display: inline-block;
    padding: 13px 40px;
    background: linear-gradient(135deg, var(--wn-orange) 0%, var(--wn-orange-dark) 100%);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-family: 'Reggae One', system-ui, sans-serif;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 107, 0, 0.4);
    transition: transform 0.15s, filter 0.15s;
}

.ep-tutorial-play-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

/* ── 8. VOLVER AL MENÚ ── */
.ep-back-link {
    display: block;
    text-align: center;
    margin: 24px auto 0;
    color: var(--wn-text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s;
}

.ep-back-link:hover {
    color: var(--wn-orange);
}



.ep-howto-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 20px 0;
}

.ep-howto-step {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(160, 120, 64, 0.5);
    border-radius: 14px;
    padding: 18px 14px;
    text-align: center;
}

.ep-howto-step .step-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.ep-howto-step strong {
    display: block;
    color: #3E2000;
    font-size: 0.88rem;
    margin-bottom: 4px;
}

.ep-howto-step span {
    color: #5a3200;
    font-size: 0.78rem;
    line-height: 1.4;
}



/* ── 10. RESPONSIVE ── */
@media (max-width: 600px) {
    .ep-game-wrap {
        padding: 0 10px 32px;
    }

    .ep-game-card {
        padding: 16px 14px 20px;
    }

    .ep-round-header {
        margin: 0 0 14px;
    }

    .ep-parchment {
        padding: 40px 24px 34px;
    }

    .ep-parchment-score {
        font-size: 2.4rem;
    }

    .ep-input-row {
        gap: 8px;
    }

    #guess-input {
        flex: 0 0 56%;
        padding: 11px 16px;
        font-size: 1.2rem;
    }

    #submit-guess-btn {
        font-size: 0.95rem;
        padding: 0 18px;
    }

    .ep-result-card {
        padding: 16px 16px 14px;
    }

    .ep-result-answer {
        font-size: 1rem;
    }

    .ep-result-score {
        font-size: 1.5rem;
    }

    #next-episode-btn {
        font-size: 0.95rem;
        padding: 10px 28px;
    }

    .ep-tutorial-steps {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ep-howto-steps {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ep-howto-step {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        column-gap: 16px;
        align-items: center;
        text-align: left;
        padding: 14px 18px;
    }

    .ep-howto-step .step-emoji {
        grid-row: 1 / -1;
        grid-column: 1;
        font-size: 2.2rem;
        margin-bottom: 0;
    }

    .ep-howto-step strong {
        grid-row: 1;
        grid-column: 2;
        align-self: end;
        margin-bottom: 2px;
    }

    .ep-howto-step span {
        grid-row: 2;
        grid-column: 2;
        align-self: start;
    }
}

/* ══════════════════════════════════════════════════
   RANKING TOP 5
   ══════════════════════════════════════════════════ */

#game-ranking {
    margin: 20px auto 0;
    width: 100%;
    max-width: 480px;
    background: url('../img/Fondo_Pergamino.webp') center center / cover no-repeat;
    background-color: #CE9D66;
    border: 2px solid #C19A6B;
    border-radius: 16px;
    padding: 20px 20px 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

#game-ranking.hidden {
    display: none;
}

