/* Reemplaza la regla body y añade el keyframe */
body {
    margin: 0;
    padding: 0;
    background-color: #150c18;
    background-image: 
        radial-gradient(1px 1px at 10% 20%, #ffffff, transparent),
        radial-gradient(1.5px 1.5px at 30% 50%, #ffffff, transparent),
        radial-gradient(1px 1px at 60% 10%, #ffffff, transparent),
        radial-gradient(2px 2px at 80% 40%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1.5px 1.5px at 40% 80%, rgba(255,255,255,0.6), transparent);
    background-size: 200px 200px;
    color: #fdf5e6;
    /* Cambio de fuente principal */
    font-family: 'Nunito', sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    /* Animación de fondo */
    animation: moverEstrellas 150s linear infinite;
}

/* --- SCROLLBAR PERSONALIZADO --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #150c18; 
}
::-webkit-scrollbar-thumb {
    background: #53355a; 
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #d4af37; 
}

@keyframes moverEstrellas {
    from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
    to { background-position: -500px 500px, -400px 400px, -300px 300px, -200px 200px, -100px 100px; }
}

/* Aplicar la fuente elegante a títulos y botones */
h2, h3, .menu-btn {
    font-family: 'Philosopher', sans-serif;
}

#app-container {
    width: 100%;
    max-width: 400px;
    background-color: rgba(59, 35, 64, 0.85);
    backdrop-filter: blur(5px);
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

/* --- ANIMACIONES DE PANTALLA --- */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.screen.active {
    display: flex;
    animation: fadeIn 0.4s ease-out forwards;
}

.screen.fade-out {
    display: flex;
    animation: fadeOut 0.3s ease-in forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-15px); }
}

/* --- MENÚ PRINCIPAL --- */
#pantalla-menu { justify-content: flex-start; padding-top: 10px; }   

.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    margin-bottom: 15px;
}

.menu-btn {
    background-color: #d4af37;
    color: #1a0f1c;
    border: none;
    padding: 20px 10px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 80px;
}

.menu-btn:hover {
    background-color: #f5cc47;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}
.menu-btn:active { transform: scale(0.95); }

.logo-marca { width: 80%; max-width: 200px; margin-bottom: 20px; }
.chibi-img { width: 150%; max-width: 350px; height: auto; margin-top: -20px; margin-bottom: 0; }

/* --- GRIDS Y TARJETAS DE COLECCIONES --- */
.coleccion-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    margin-bottom: 20px;
}
.ropa-grid { grid-template-columns: repeat(2, 1fr); }

.item-card {
    background-color: #3b2340;
    border-radius: 8px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.item-card:hover { 
    transform: scale(1.05) translateY(-5px); 
    border-color: #d4af37;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.item-card img { width: 100%; aspect-ratio: 2/3; object-fit: contain; border-radius: 5px; }
.ropa-card img { aspect-ratio: 1/1; }

.item-title {
    font-size: 10px;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fdf5e6;
}

/* --- BOTONES Y PAGINACIÓN --- */
.paginacion-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: auto;
    padding-top: 20px;
}

.btn-nav, .btn-full {
    background-color: #53355a;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-nav { padding: 10px 15px; }
.btn-nav:hover:not(:disabled) { background-color: #6a4473; transform: translateY(-2px); }
.btn-nav:active:not(:disabled) { transform: scale(0.95); }
.btn-nav:disabled {
    background-color: #2c1a30;
    color: #666;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-full { padding: 15px; width: 100%; margin-top: 10px; background-color: #d4af37; color: #1a0f1c;}
.btn-full:hover { background-color: #f5cc47; }
.btn-full:active { transform: scale(0.98); }

/* --- PANTALLAS DE DETALLE --- */
.detalle-img { width: 80%; max-width: 250px; object-fit: contain; border-radius: 10px; margin-bottom: 15px; }
.detalle-box {
    background-color: rgba(255,255,255,0.08);
    padding: 15px;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.1);
}

/* --- LECTURA TAROT --- */
.tarotista-img { width: 100%; max-width: 300px; margin-bottom: 20px; }
.cartas-container { display: flex; justify-content: center; gap: 10px; perspective: 1000px; width: 100%; margin-bottom:20px; }
/* Busca esta línea y asegúrate de que quede así: */
.carta-card { 
    width: 30%; 
    aspect-ratio: 2/3; 
    position: relative; 
    cursor: pointer; 
    transform-style: preserve-3d; 
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1); 
    border-radius: 5px; 
}

/* Añade esta nueva regla debajo para el resplandor */
.carta-card:not(.volteada) .carta-face.carta-back {
    animation: resplandorCarta 2s infinite alternate;
}

@keyframes resplandorCarta {
    from { box-shadow: 0 0 5px rgba(212, 175, 55, 0.1); border: 1px solid transparent; }
    to { box-shadow: 0 0 20px rgba(212, 175, 55, 0.7); border: 1px solid rgba(212, 175, 55, 0.5); }
}.carta-card:hover:not(.volteada) { transform: scale(1.05) translateY(-5px); }
.carta-card.volteada { transform: rotateY(180deg); cursor: default; }

.carta-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 5px; overflow: hidden; background-color: #3b2340; box-shadow: 0 4px 8px rgba(0,0,0,0.4); }
.carta-face img { width: 100%; height: 100%; object-fit: contain; display: block; }
.carta-front { transform: rotateY(180deg); border: 1px solid #d4af37; box-sizing: border-box; }

h2 { font-size: 20px; font-weight: normal; }
h3 { font-size: 16px; margin: 5px 0;}
p { font-size: 14px; line-height: 1.5;}

/* ==========================================
   MODO COMPARTIR (IG STORIES)
   ========================================== */
.story-frame {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    aspect-ratio: 9/16;
    background: linear-gradient(135deg, rgba(26, 15, 28, 0.9), rgba(59, 35, 64, 0.9));
    border: 1px solid #d4af37;
    border-radius: 15px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 0 25px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
}

/* Efecto sutil de fondo para la historia */
.story-frame::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(212,175,55,0.1) 0%, transparent 60%);
    z-index: 0;
}

.story-frame > * {
    z-index: 1; /* Asegura que el texto y cartas estén sobre el brillo de fondo */
}

.story-frame h2 {
    color: #d4af37;
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 22px;
}

.story-cards {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 15px 0;
}

.story-cards img {
    width: 33%;
    border-radius: 5px;
    border: 1px solid #d4af37;
    box-shadow: 0 5px 15px rgba(0,0,0,0.6);
}

/* Efecto de cartas en abanico */
.story-cards img:nth-child(1) { transform: rotate(-8deg) translateY(10px) translateX(10px); }
.story-cards img:nth-child(2) { transform: scale(1.1); z-index: 2; }
.story-cards img:nth-child(3) { transform: rotate(8deg) translateY(10px) translateX(-10px); }

.story-text {
    background-color: rgba(0,0,0,0.5);
    padding: 10px; /* Redujimos el relleno interno */
    border-radius: 10px;
    font-style: italic;
    font-size: 3px; /* Letra más pequeña para que encaje todo */
    line-height: 1.3; /* Interlineado más compacto */
    text-align: center;
    border-top: 2px solid #d4af37;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden; /* Esto evita que el texto se salga visualmente del cuadro negro */
}

.story-brand {
    color: #fdf5e6;
    font-weight: bold;
    letter-spacing: 2px;
    font-size: 14px;
    background-color: #d4af37;
    color: #1a0f1c;
    padding: 5px 15px;
    border-radius: 20px;
}

/* ==========================================
   MODAL GUÍA DE TALLAS
   ========================================== */
.modal-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    border-radius: inherit;
    animation: fadeIn 0.3s ease-out forwards;
}

.modal-content {
    background-color: #1a0f1c;
    border: 1px solid #d4af37;
    border-radius: 12px;
    padding: 20px;
    width: 85%;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.9);
    text-align: center;
}

.tabla-tallas {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    color: #fdf5e6;
}

.tabla-tallas th, .tabla-tallas td {
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 10px 5px;
    font-size: 13px;
}

.tabla-tallas th {
    background-color: rgba(212, 175, 55, 0.15);
    color: #d4af37;
    font-weight: bold;
}

/* ==========================================
   EASTER EGG: CARTA SECRETA
   ========================================== */
.carta-secreta-brillo .carta-front {
    animation: brilloSecreto 2s infinite alternate !important;
    border: 2px solid #fff !important;
}

@keyframes brilloSecreto {
    0% { box-shadow: 0 0 10px rgba(255,255,255,0.5), 0 0 20px rgba(212,175,55,0.5); transform: rotateY(180deg) scale(1); }
    100% { box-shadow: 0 0 25px rgba(255,255,255,1), 0 0 40px rgba(212,175,55,1); transform: rotateY(180deg) scale(1.05); }
}

/* Brillo para cuando la carta secreta se revela en la colección */
.animacion-revelacion-secreta {
    animation: brilloSecretoDetalle 2s infinite alternate !important;
    border: 2px solid #fff !important;
    border-radius: 10px; 
}

@keyframes brilloSecretoDetalle {
    0% { box-shadow: 0 0 10px rgba(255,255,255,0.5), 0 0 20px rgba(212,175,55,0.5); transform: scale(1); }
    100% { box-shadow: 0 0 25px rgba(255,255,255,1), 0 0 40px rgba(212,175,55,1); transform: scale(1.05); }
}