/* ============================================================
   SWIPE HISTÓRICO: EL INSTINTO DOCENTE — CUSTOM STYLES
   ============================================================ */

::selection {
    background: rgba(5, 150, 105, 0.3);
    color: #f5f5f4;
}

/* ---- LOADER ---- */

.loader {
    width: 52px;
    height: 52px;
    border: 3px solid rgba(214, 211, 209, 0.12);
    border-top-color: #059669;
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- SWIPE CARD ---- */

.swipe-card {
    position: relative;
    background: linear-gradient(145deg, #faf8f4, #f0ebe3);
    color: #1e293b;
    border-radius: 1.25rem;
    padding: 2.5rem 1.75rem 1.75rem;
    min-height: 300px;
    max-height: 72vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    will-change: transform;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.06),
        0 10px 40px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.swipe-card:active {
    cursor: grabbing;
}

.card-number {
    position: absolute;
    top: 0.85rem;
    right: 1.25rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    color: #a8a29e;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.card-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.08rem;
    line-height: 1.8;
    color: #1e293b;
    text-align: left;
}

/* ---- CARD STAMP OVERLAYS ---- */

.card-overlay-left,
.card-overlay-right {
    position: absolute;
    top: 1.1rem;
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    opacity: 0;
    pointer-events: none;
    padding: 0.2rem 0.6rem;
    border-radius: 0.35rem;
    border: 3.5px solid;
    z-index: 10;
}

.card-overlay-left {
    left: 1.1rem;
    color: #dc2626;
    border-color: #dc2626;
    transform: rotate(-15deg);
}

.card-overlay-right {
    right: 1.1rem;
    color: #059669;
    border-color: #059669;
    transform: rotate(12deg);
}

/* ---- SCORE FEEDBACK POPUP ---- */

.score-feedback {
    position: fixed;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    font-size: 2.8rem;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
    z-index: 200;
    animation: scoreFloat 1.3s ease-out forwards;
}

.score-feedback.correct {
    color: #10b981;
    text-shadow: 0 0 40px rgba(16, 185, 129, 0.35);
}

.score-feedback.incorrect {
    color: #ef4444;
    text-shadow: 0 0 40px rgba(239, 68, 68, 0.35);
}

@keyframes scoreFloat {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    15% {
        transform: translate(-50%, -50%) scale(1.15);
    }
    30% {
        transform: translate(-50%, -55%) scale(1);
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -120%) scale(0.9);
    }
}

/* ---- CARD ENTRANCE ---- */

.card-enter {
    animation: cardEntrance 0.32s cubic-bezier(0.175, 0.885, 0.32, 1.05);
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: scale(0.93) translateY(14px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ---- PROGRESS BAR ---- */

.progress-fill {
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- LEADERBOARD ---- */

.leaderboard-row {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    will-change: transform;
}

.leaderboard-row.animated {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- PLAYER CARD (waiting room) ---- */

.player-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 0.7rem 1rem;
    text-align: center;
    font-size: 0.88rem;
    color: #d6d3d1;
    animation: playerFadeIn 0.4s ease-out backwards;
    backdrop-filter: blur(4px);
}

@keyframes playerFadeIn {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---- SESSION CODE GLOW ---- */

.code-glow {
    text-shadow:
        0 0 20px rgba(52, 211, 153, 0.25),
        0 0 50px rgba(52, 211, 153, 0.08);
}

/* ---- PODIUM ---- */

.podium-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: podiumRise 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

.podium-column:nth-child(1) { animation-delay: 0.3s; }
.podium-column:nth-child(2) { animation-delay: 0.1s; }
.podium-column:nth-child(3) { animation-delay: 0.5s; }

@keyframes podiumRise {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---- MISSED CARD ENTRANCE ---- */

.missed-card {
    animation: fadeSlideIn 0.5s ease-out backwards;
}

.missed-card:nth-child(1) { animation-delay: 0.1s; }
.missed-card:nth-child(2) { animation-delay: 0.25s; }
.missed-card:nth-child(3) { animation-delay: 0.4s; }

@keyframes fadeSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- SCREEN TRANSITION ---- */

.screen-enter {
    animation: screenFade 0.35s ease-out;
}

@keyframes screenFade {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

/* ---- PULSE GLOW (session code button) ---- */

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4); }
    50%      { box-shadow: 0 0 0 14px rgba(5, 150, 105, 0); }
}

/* ---- SCROLLBAR ---- */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }
