/* Kryvania · Demo Tutorial interactivo (app-tutorial.js).
   Capa de guía sobre el juego: foco sobre la zona explicada y una burbuja con el texto.
   No bloquea el tablero: solo la burbuja recibe clics. */

.tut-root {
    position: fixed;
    inset: 0;
    z-index: 2147483400;
    pointer-events: none;
}
.tut-root.hidden { display: none; }

.tut-dim {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 18, .62);
    transition: opacity .25s ease;
}
.tut-dim.hidden { display: none; }

.tut-spot {
    position: fixed;
    border-radius: 14px;
    border: 2px solid rgba(253, 224, 138, .95);
    box-shadow: 0 0 0 4px rgba(244, 199, 106, .22), 0 0 26px rgba(244, 199, 106, .55);
    transition: left .28s ease, top .28s ease, width .28s ease, height .28s ease;
    animation: tutSpotPulse 2.2s ease-in-out infinite;
}
.tut-spot.hidden { display: none; }
/* En los pasos de recorrido se oscurece todo menos la zona explicada. */
.tut-root.is-dim .tut-spot {
    box-shadow: 0 0 0 4px rgba(244, 199, 106, .22), 0 0 26px rgba(244, 199, 106, .55), 0 0 0 200vmax rgba(2, 6, 18, .62);
}
/* En los pasos de acción el foco es más vivo y verde: "haz esto aquí". */
.tut-spot.is-action {
    border-color: rgba(134, 239, 172, .95);
    box-shadow: 0 0 0 4px rgba(74, 222, 128, .22), 0 0 28px rgba(74, 222, 128, .55);
    animation-name: tutSpotPulseAction;
}

.tut-bubble {
    position: fixed;
    width: 380px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    overflow: auto;
    padding: 14px 16px 12px;
    border: 1px solid rgba(244, 199, 106, .6);
    border-radius: 16px;
    background:
        radial-gradient(ellipse at 20% -10%, rgba(244, 199, 106, .16), transparent 55%),
        linear-gradient(180deg, rgba(16, 22, 40, .98), rgba(9, 13, 26, .985));
    box-shadow: 0 0 0 1px rgba(10, 8, 2, .9), 0 24px 60px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 236, 179, .12);
    color: #e2e8f0;
    pointer-events: auto;
    transition: left .28s ease, top .28s ease;
    animation: tutBubbleIn .32s cubic-bezier(.2, .9, .3, 1.1) both;
}
.tut-bubble.is-action { border-color: rgba(134, 239, 172, .6); }
.tut-bubble.is-tip { border-color: rgba(125, 211, 252, .65); }
.tut-root.is-minimized .tut-bubble,
.tut-root.is-minimized .tut-dim { display: none; }
.tut-root.is-minimized.is-dim .tut-spot { box-shadow: 0 0 0 4px rgba(244, 199, 106, .22), 0 0 26px rgba(244, 199, 106, .55); }

.tut-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.tut-badge {
    padding: 2px 9px;
    border-radius: 999px;
    background: linear-gradient(100deg, #78350f, #d97706 45%, #fde68a 50%, #d97706 55%, #78350f);
    color: #1f1300;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.tut-bubble.is-action .tut-badge { background: linear-gradient(100deg, #14532d, #16a34a 45%, #bbf7d0 50%, #16a34a 55%, #14532d); color: #04150a; }
.tut-bubble.is-tip .tut-badge { background: linear-gradient(100deg, #0c4a6e, #0284c7 45%, #bae6fd 50%, #0284c7 55%, #0c4a6e); color: #021320; }
.tut-progress {
    flex: 1;
    color: #94a3b8;
    font-size: .74rem;
    font-weight: 700;
}
.tut-icon {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 8px;
    background: rgba(255, 255, 255, .04);
    color: #cbd5e1;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}
.tut-icon:hover { border-color: rgba(244, 199, 106, .7); color: #fde68a; }
.tut-icon.hidden { display: none; }

.tut-title {
    margin: 2px 0 8px;
    color: #fde7b0;
    font-size: 1.08rem;
    letter-spacing: .02em;
}
.tut-text { font-size: .92rem; line-height: 1.45; }
.tut-text p { margin: 0 0 8px; }
.tut-text ul { margin: 0 0 8px; padding-left: 18px; }
.tut-text li { margin-bottom: 4px; }
.tut-text b { color: #fff3c4; }

.tut-task {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 4px 0 10px;
    padding: 8px 10px;
    border: 1px solid rgba(134, 239, 172, .4);
    border-radius: 10px;
    background: rgba(22, 101, 52, .22);
    color: #dcfce7;
    font-weight: 800;
    font-size: .88rem;
}
.tut-task.hidden { display: none; }
.tut-task-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 10px #4ade80;
    animation: tutDot 1.2s ease-in-out infinite;
}
.tut-done {
    margin: 4px 0 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(234, 179, 8, .25), rgba(234, 179, 8, .05));
    color: #fde68a;
    font-weight: 900;
    letter-spacing: .04em;
    animation: tutBubbleIn .3s ease-out both;
}
.tut-done.hidden { display: none; }

.tut-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}
.tut-actions .hidden { display: none; }
.tut-actions .tut-back { margin-right: auto; }
/* "Siguiente" en espera mientras hay una ventana del duelo o una carta presentándose. */
.tut-actions .tut-next:disabled { opacity: .45; cursor: not-allowed; filter: saturate(.5); }

.tut-fab {
    position: fixed;
    left: 14px;
    bottom: 14px;
    padding: 9px 16px;
    border: 1px solid rgba(244, 199, 106, .7);
    border-radius: 999px;
    background: linear-gradient(180deg, #2a1f08, #120c03);
    color: #fde68a;
    font-weight: 900;
    letter-spacing: .08em;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .55), 0 0 18px rgba(244, 199, 106, .35);
    pointer-events: auto;
    cursor: pointer;
}
.tut-fab.hidden { display: none; }

.tut-menu-button { position: relative; }
.tut-menu-button::after {
    content: "Nuevo";
    position: absolute;
    top: -9px;
    right: -8px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-size: .62rem;
    font-weight: 900;
    letter-spacing: .06em;
}

/* Partida guiada: la carta que hay que usar ahora. */
body.tutorial-active #gameBoard .game-card.tut-card-focus {
    outline: 3px solid rgba(134, 239, 172, .95);
    outline-offset: 3px;
    animation: tutCardFocus 1.4s ease-in-out infinite;
}
/* Mulligan de la práctica: solo «Mantener mano». */
body.tut-keep-only .initial-mulligan-modal [data-full],
body.tut-keep-only .initial-mulligan-modal [data-three],
body.tut-keep-only .initial-mulligan-modal .initial-mulligan-card {
    opacity: .4;
    filter: grayscale(.5);
    pointer-events: none;
}
body.tut-keep-only .initial-mulligan-modal [data-keep] {
    box-shadow: 0 0 0 2px rgba(134, 239, 172, .95), 0 0 18px rgba(74, 222, 128, .6);
}
/* Ventana de Cánticos de la práctica: solo «No intervenir». */
body.tut-cantico-pass-only #canticoWindowOverlay [data-cantico-action]:not([data-cantico-action="pass"]) {
    opacity: .4;
    filter: grayscale(.5);
    pointer-events: none;
}
body.tut-cantico-pass-only #canticoWindowOverlay [data-cantico-action="pass"] {
    box-shadow: 0 0 0 2px rgba(134, 239, 172, .95), 0 0 18px rgba(74, 222, 128, .6);
}

@keyframes tutCardFocus {
    0%, 100% { box-shadow: 0 0 12px rgba(74, 222, 128, .45); }
    50% { box-shadow: 0 0 28px rgba(74, 222, 128, .9); }
}
@keyframes tutSpotPulse {
    0%, 100% { border-color: rgba(253, 224, 138, .95); }
    50% { border-color: rgba(255, 247, 214, 1); }
}
@keyframes tutSpotPulseAction {
    0%, 100% { border-color: rgba(134, 239, 172, .95); }
    50% { border-color: rgba(220, 252, 231, 1); }
}
@keyframes tutBubbleIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes tutDot { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }

@media (prefers-reduced-motion: reduce) {
    .tut-spot, .tut-bubble, .tut-task-dot, .tut-done { animation: none !important; transition: none !important; }
    body.tutorial-active #gameBoard .game-card.tut-card-focus { animation: none !important; box-shadow: 0 0 18px rgba(74, 222, 128, .7); }
}
@media (max-width: 760px) {
    .tut-bubble { font-size: .9rem; padding: 12px 13px 10px; }
}
