@import url('https://fonts.googleapis.com/css2?family=Nova+Square&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

body {
    font-family: 'VT323', monospace;
    overflow-x: hidden;
    min-height: 100vh;
}

.game-text {
    font-family: "Share Tech Mono", monospace;
    font-weight: 400;
    font-style: normal;
}

.card-glow {
    box-shadow: 0 0 15px rgba(154, 119, 241, 0.7);
    transition: all 0.3s ease;
}

.card-glow:hover {
    box-shadow: 0 0 25px rgba(154, 119, 241, 0.9);
    transform: translateY(-2px);
}

.btn-pokemon {
    background: linear-gradient(45deg, #6B5B95, #9D5CC5);
    border: 3px solid #4A3B77;
    box-shadow: 0 4px 0 #4A3B77;
    transition: all 0.1s;
}

.btn-pokemon:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #4A3B77;
}

.badge-container {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    border: 4px solid #FFD700;
}

.badge-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: rotate(45deg) translateX(-100%);
    }

    100% {
        transform: rotate(45deg) translateX(100%);
    }
}

.pixel-border {
    border: 4px solid #2C78C2;
    box-shadow: 0 0 0 8px #2C78C2;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00;
    animation: confetti-fall 5s ease-in-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.poke-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(157, 92, 197, 0.7);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(157, 92, 197, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(157, 92, 197, 0);
    }
}

.chart-container {
    position: relative;
    height: 300px;
    /* O la altura que desees, p.ej. 40vh */
    width: 100%;
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: absolute;
    width: 15px;
    height: 15px;
    top: -10px;
    z-index: 50;
    animation-name: fall;
    animation-timing-function: linear;
    pointer-events: none;
}

.confetti-emoji {
    background-color: transparent !important;
    font-size: 24px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

/* --- SISTEMA FLASHCARD 3D ROBUSTO --- */

.flashcard-scene {
    perspective: 1000px;
    width: 100%;
    /* Quitamos el height fijo para que se adapte al contenido */
    position: relative;
}

.flashcard-slider {
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.4s ease;
    transform-style: preserve-3d;
    width: 100%;
}

.slide-out-left {
    transform: translateX(-120%) rotate(-5deg);
    opacity: 0;
}

.prepare-entry {
    transition: none !important;
    transform: translateX(120%) rotate(5deg);
    opacity: 0;
}

.flashcard-flipper {
    position: relative;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;

    /* TRUCO CSS GRID: Apila frente y dorso sin position:absolute */
    display: grid;
    grid-template-columns: 1fr;
}

.is-flipped {
    transform: rotateY(180deg);
}

.flashcard-face {
    /* Ambas ocupan la misma celda del grid */
    grid-row: 1;
    grid-column: 1;

    width: 100%;
    max-width: 100%;
    box-sizing: border-box;

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 1.5rem;
    /* rounded-3xl de tailwind */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    /* shadow-2xl */

    /* Aseguramos que el contenido dicte el alto */
    height: auto;
    min-height: 24rem;
    /* Altura mínima estética */
    display: flex;
    flex-direction: column;
}

.text-break-word {
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    hyphens: auto;
}

/* Ajuste específico para el dorso */
.flashcard-back {
    transform: rotateY(180deg);
}