:root {
    --accent: #ffd700;
    --text: #f0e6ff;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-dark: #0d0616;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: 'Lato', sans-serif; 
    background: var(--bg-dark); 
    color: var(--text); 
    min-height: 100vh; 
    overflow-x: hidden; 
    position: relative;
}

/* --- FONDO MÍSTICO POTENCIADO --- */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1b1133 0%, #050208 100%);
    z-index: -1;
}

/* Capa 1: Estrellas pequeñas constantes */
.stars::before {
    content: "";
    position: absolute;
    width: 200%; height: 200%;
    top: -50%; left: -50%;
    background-image: 
        radial-gradient(1.5px 1.5px at 10% 10%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 20% 40%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 50% 30%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 80% 80%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 90% 20%, #fff, transparent);
    background-size: 250px 250px;
    opacity: 0.6; /* Más visibles */
    animation: moveStars 180s linear infinite;
}

/* Capa 2: Estrellas con brillo y parpadeo */
.stars::after {
    content: "";
    position: absolute;
    width: 100%; height: 100%;
    background-image: 
        radial-gradient(2.5px 2.5px at 15% 15%, #fff, transparent),
        radial-gradient(3px 3px at 65% 35%, var(--accent), transparent),
        radial-gradient(2.5px 2.5px at 45% 85%, #fff, transparent),
        radial-gradient(2px 2px at 85% 60%, #fff, transparent);
    background-size: 350px 350px;
    opacity: 0.8;
    filter: drop-shadow(0 0 5px white);
    animation: twinkle 3s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.3; transform: scale(0.8); filter: brightness(1); }
    100% { opacity: 1; transform: scale(1.2); filter: brightness(1.5) drop-shadow(0 0 8px var(--accent)); }
}

@keyframes moveStars {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- RESTO DE ESTILOS MANTENIDOS --- */
.container { max-width: 950px; margin: 0 auto; padding: 20px; text-align: center; position: relative; z-index: 1; }

h1 { font-family: 'Cinzel', serif; color: var(--accent); letter-spacing: 3px; text-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }
.subtitle { font-style: italic; opacity: 0.8; margin-bottom: 25px; display: block; font-size: 0.9rem; }

.control-panel { 
    background: rgba(255, 255, 255, 0.03); 
    padding: 25px; 
    border-radius: 20px; 
    border: 1px solid rgba(255,215,0,0.15); 
    backdrop-filter: blur(8px);
    margin-bottom: 20px; 
}

.input-wrapper input { 
    width: 100%; 
    padding: 12px; 
    border-radius: 10px; 
    border: 1px solid rgba(255,215,0,0.4); 
    background: rgba(0,0,0,0.4); 
    color: white; 
    margin-bottom: 15px; 
    outline: none; 
}

.button-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
button { 
    padding: 12px 20px; 
    border-radius: 10px; 
    border: none; 
    font-family: 'Cinzel', serif; 
    font-weight: bold; 
    cursor: pointer; 
    transition: 0.3s; 
}

.btn-main { background: var(--bg-glass); color: var(--accent); border: 1px solid var(--accent); }
.btn-special { background: var(--accent); color: #1a0f2e; }
.btn-clean { background: rgba(255, 107, 107, 0.15); color: #ff6b6b; border: 1px solid #ff6b6b; }

.btn-link { 
    background: none; 
    color: var(--accent); 
    text-decoration: underline; 
    margin-top: 15px; 
    display: block; 
    width: 100%; 
    font-size: 0.9rem;
}

.deck-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); 
    gap: 15px; 
    margin-top: 20px; 
    padding: 25px; 
    background: rgba(0,0,0,0.4); 
    border-radius: 20px; 
    max-height: 500px; 
    overflow-y: auto;
    border: 1px solid rgba(255,215,0,0.1);
}

.deck-card { 
    background: rgba(255,255,255,0.03); 
    border: 1px solid rgba(255,215,0,0.1); 
    border-radius: 12px; 
    padding: 10px; 
    cursor: pointer; 
    transition: 0.3s; 
}
.deck-card:hover { transform: scale(1.05); border-color: var(--accent); }
.deck-card img { width: 100%; border-radius: 6px; }
.deck-card p { font-size: 0.65rem; margin-top: 8px; text-transform: uppercase; }

.card-result { 
    display: grid; 
    grid-template-columns: 300px 1fr; 
    gap: 40px; 
    background: rgba(20, 10, 40, 0.85); 
    backdrop-filter: blur(12px);
    padding: 40px; 
    border-radius: 25px; 
    text-align: left; 
    margin-top: 20px; 
    border: 1px solid var(--accent);
}

.card-image-container img { 
    width: 100%; 
    border-radius: 15px; 
    border: 2px solid var(--accent); 
}

.interp-box { 
    background: rgba(255,255,255,0.03); 
    padding: 15px; 
    border-radius: 15px; 
    border-left: 4px solid var(--accent); 
    margin-bottom: 15px; 
}

.three-cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.mini-card { background: var(--bg-glass); padding: 10px; border-radius: 15px; border: 1px solid var(--accent); }
.mini-card img { width: 100%; border-radius: 8px; }

footer { margin-top: 60px; padding: 40px; }
.anniversary-msg { font-family: 'Cinzel', serif; color: var(--accent); font-size: 1.3rem; }

@media (max-width: 768px) {
    .card-result { grid-template-columns: 1fr; text-align: center; }
    .three-cards-grid { grid-template-columns: 1fr; }
}

/* ===== MODO LECTURA DE MESA ===== */

.btn-mode {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    background: linear-gradient(45deg, rgba(255,215,0,0.2), rgba(255,107,107,0.2));
    border: 2px solid var(--accent);
    color: var(--accent);
    border-radius: 15px;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-mode:hover {
    background: rgba(255,215,0,0.3);
    transform: translateY(-2px);
}

.table-panel {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255,215,0,0.3);
}

.table-instructions {
    opacity: 0.8;
    margin-bottom: 20px;
    font-style: italic;
}

.table-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.table-card-input {
    background: rgba(0,0,0,0.3);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255,215,0,0.2);
}

.table-card-input label {
    display: block;
    margin-bottom: 8px;
    color: var(--accent);
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
}

.table-card-input select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,215,0,0.4);
    background: rgba(0,0,0,0.5);
    color: white;
    margin-bottom: 10px;
    font-family: 'Lato', sans-serif;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem !important;
    color: var(--text) !important;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.btn-full {
    width: 100%;
    margin-top: 10px;
}

/* RESULTADO DE LECTURA DE MESA */

.table-result {
    background: rgba(20, 10, 40, 0.9);
    backdrop-filter: blur(12px);
    padding: 40px;
    border-radius: 25px;
    border: 2px solid var(--accent);
    margin-top: 30px;
    animation: fadeIn 0.5s ease;
}

.table-result h3 {
    color: var(--accent);
    font-family: 'Cinzel', serif;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.table-cards-display {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.table-card {
    text-align: center;
    background: rgba(255,255,255,0.03);
    padding: 15px;
    border-radius: 15px;
    border: 1px solid rgba(255,215,0,0.2);
}

.position-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 10px;
    opacity: 0.9;
}

.table-card img {
    width: 100%;
    max-width: 150px;
    border-radius: 10px;
    border: 2px solid var(--accent);
    margin-bottom: 10px;
    transition: transform 0.3s;
}

.table-card img.reversed {
    transform: rotate(180deg);
}

.table-card h5 {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--text);
}

.table-interpretations .interp-box {
    margin-bottom: 20px;
    line-height: 1.8;
}

.table-interpretations .interp-box p {
    font-size: 1rem;
}

/* Imagen invertida en resultado individual */
#cardImage.reversed {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .table-inputs {
        grid-template-columns: 1fr;
    }
    
    .table-cards-display {
        grid-template-columns: 1fr;
    }
}

/* ===== ESTILOS PARA MONETIZACIÓN ===== */

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 2px solid #9d4edd;
    border-radius: 20px;
    padding: 30px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 0 40px rgba(157, 78, 221, 0.4);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Auth Modal */
.auth-content h2 {
    color: #e0aaff;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.auth-content p {
    color: #b8c0cc;
    margin-bottom: 20px;
}

.auth-content input {
    width: 100%;
    padding: 15px;
    border: 2px solid #5a189a;
    border-radius: 10px;
    background: #0f0f23;
    color: #fff;
    font-size: 1rem;
    margin-bottom: 15px;
    text-align: center;
}

.auth-content input:focus {
    outline: none;
    border-color: #9d4edd;
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.5);
}

.auth-note {
    font-size: 0.85rem;
    color: #7f8c9a;
    margin-top: 15px;
}

/* User Bar */
.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: #e0aaff;
    font-weight: bold;
    font-size: 1.1rem;
}

.credits-badge {
    background: linear-gradient(135deg, #5a189a, #9d4edd);
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.star {
    font-size: 1.2rem;
}

.btn-shop {
    background: linear-gradient(135deg, #7b2cbf, #9d4edd);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(157, 78, 221, 0.4);
}

.btn-shop:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(157, 78, 221, 0.6);
}

/* Shop Modal */
.shop-content {
    max-width: 500px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #7f8c9a;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #e0aaff;
}

.shop-content h2 {
    color: #e0aaff;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.credits-display {
    background: linear-gradient(135deg, #240046, #3c096c);
    color: #fff;
    padding: 15px 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.credits-icon {
    font-size: 1.5rem;
}

.shop-packages {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.package {
    background: linear-gradient(145deg, #240046, #10002b);
    border: 2px solid #5a189a;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.package:hover {
    border-color: #9d4edd;
    transform: translateX(10px);
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.4);
}

.package-credits {
    color: #e0aaff;
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.package-price {
    color: #7f8c9a;
    font-size: 1.1rem;
}

.package-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #5a189a;
    color: #fff;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
}

.package-badge.popular {
    background: #e63946;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Payment Section */
.payment-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #5a189a;
}

.payment-info {
    color: #b8c0cc;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.btn-pay {
    display: block;
    background: linear-gradient(135deg, #00b4d8, #0077b6);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 180, 216, 0.4);
}

.btn-pay:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 180, 216, 0.6);
}

.btn-confirm {
    background: linear-gradient(135deg, #2d6a4f, #40916c);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(45, 106, 79, 0.5);
}

/* Responsive */
@media (max-width: 600px) {
    .user-bar {
        flex-direction: column;
        text-align: center;
    }
    
    .user-info {
        flex-direction: column;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .package:hover {
        transform: translateY(-5px);
    }
}

/* =================== ESTILOS PARA LECTURAS MEJORADAS (TEMA OSCURO) =================== */

.reading-section {
    background: var(--bg-glass);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-left: 5px solid var(--accent);
    backdrop-filter: blur(8px);
}

.reading-intro {
    font-style: italic;
    color: var(--text);
    opacity: 0.8;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 3px solid var(--accent);
}

.cards-flow {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-reading {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-reading:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
}

.reading-wisdom {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.3), rgba(90, 24, 154, 0.3));
    color: var(--text);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    border: 1px solid rgba(157, 78, 221, 0.5);
}

.table-reading {
    background: var(--bg-glass);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    backdrop-filter: blur(8px);
}

.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.table-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.table-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.2);
}

.table-position {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 0.9em;
}

.position-element {
    font-size: 1.2em;
    margin-right: 5px;
}

.table-synthesis {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(157, 78, 221, 0.1));
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    color: var(--text);
    border-left: 5px solid var(--accent);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

/* --- ESTILOS PARA EL PANEL DE ADMINISTRACIÓN --- */
.admin-panel {
    background: var(--bg-glass); /* Fondo de cristal oscuro y semitransparente */
    border: 2px solid var(--accent); /* Borde dorado/púrpura que combina con todo */
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    display: none; /* El JavaScript lo cambiará a 'block' */
    backdrop-filter: blur(8px); /* El mismo efecto de desenfoque que los otros paneles */
    color: var(--text); /* Asegura que el texto sea legible */
}

.admin-panel h3 {
    color: var(--accent);
    font-family: 'Cinzel', serif;
    margin-bottom: 15px;
}

.admin-panel input {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: rgba(0,0,0,0.4);
    color: var(--text);
}

/* Resumen de lectura */
.reading-summary {
    margin-top: 30px;
    animation: fadeIn 0.5s ease-out;
}

.reading-summary p {
    margin-bottom: 12px;
    line-height: 1.5;
}

.reading-summary hr {
    margin: 20px 0;
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e6b422, transparent);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mejoras para el modo mesa */
.table-cards-display {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.table-cards-display > div {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 10px;
    transition: transform 0.3s ease;
}

.table-cards-display > div:hover {
    transform: translateY(-5px);
}

.table-interpretations {
    margin-top: 30px;
}

/* ===== LECTURA GENERADA POR IA ===== */

.ai-reading {
    margin-top: 30px;
    padding: 28px 30px;
    background: linear-gradient(135deg, rgba(106, 13, 173, 0.12) 0%, rgba(255, 215, 0, 0.04) 100%);
    border-radius: 15px;
    border-left: 3px solid var(--accent);
    text-align: left;
    animation: fadeIn 0.6s ease-out;
}

.ai-reading h3 {
    color: var(--accent);
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    margin-bottom: 18px;
    letter-spacing: 1px;
}

.ai-reading p {
    line-height: 1.85;
    margin-bottom: 16px;
    color: var(--text);
}

.ai-reading p:last-child {
    margin-bottom: 0;
}

.ai-reading strong {
    color: var(--accent);
    font-weight: 600;
}

.ai-loading {
    color: var(--accent);
    opacity: 0.75;
    font-style: italic;
    animation: aiPulse 1.4s ease-in-out infinite;
}

.ai-fallback {
    color: #b8a0cc;
    font-style: italic;
    line-height: 1.6;
}

/* =================== AUTENTICACION =================== */

/* Gate: sin sesion solo se ve esta pantalla, el sitio queda oculto */
.auth-gate {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 30%, #1e1e3a 0%, #0d0d1a 70%);
    z-index: 2000;
    padding: 24px;
    overflow-y: auto;
}

.auth-gate__box {
    width: 100%;
    max-width: 420px;
    padding: 36px 30px 30px;
    background: rgba(26, 26, 46, 0.92);
    border: 1px solid rgba(230, 180, 34, 0.35);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}

.auth-gate__title {
    margin: 0 0 6px;
    font-family: 'Cinzel', serif;
    font-size: 1.85rem;
    color: #e6b422;
    text-align: center;
}

.auth-gate__subtitle {
    margin: 0 0 26px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.auth-fatal {
    text-align: center;
}

.auth-fatal__msg {
    margin: 0 0 10px;
    color: #ff8a95;
    font-size: 1rem;
    font-weight: 600;
}

.auth-fatal__hint {
    margin: 0 0 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    line-height: 1.5;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.btn-auth {
    padding: 7px 16px;
    border: 1px solid rgba(230, 180, 34, 0.5);
    border-radius: 999px;
    background: transparent;
    color: #e6b422;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-auth:hover {
    background: rgba(230, 180, 34, 0.12);
    border-color: #e6b422;
}

.btn-auth--primary {
    background: #e6b422;
    color: #1a1a2e;
    border-color: #e6b422;
    font-weight: 600;
}

.btn-auth--primary:hover {
    background: #f0c94f;
}

.btn-auth--full {
    width: 100%;
    margin-top: 6px;
    padding: 11px;
    font-size: 1rem;
}

.btn-auth:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.auth-user {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.72);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-badge {
    font-size: 0.78rem;
    padding: 4px 11px;
    border-radius: 999px;
    font-weight: 600;
}

.auth-badge--pending {
    background: rgba(255, 193, 7, 0.16);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.auth-badge--approved {
    background: rgba(40, 167, 69, 0.16);
    color: #4ade80;
    border: 1px solid rgba(40, 167, 69, 0.4);
}

.ai-access-notice {
    margin: 16px auto 0;
    max-width: 560px;
    padding: 11px 18px;
    text-align: center;
    font-size: 0.9rem;
    color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.32);
    border-radius: 10px;
}

.auth-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 20, 0.82);
    backdrop-filter: blur(5px);
    z-index: 1000;
    padding: 20px;
}

.auth-modal__content {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 32px 28px 28px;
    background: #1a1a2e;
    border: 1px solid rgba(230, 180, 34, 0.35);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.auth-modal__title {
    margin: 0 0 20px;
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: #e6b422;
    text-align: center;
}

.auth-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 1.7rem;
    cursor: pointer;
    line-height: 1;
}

.auth-modal__close:hover {
    color: #e6b422;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.28);
    padding: 4px;
    border-radius: 10px;
}

.auth-tab {
    flex: 1;
    padding: 9px;
    background: none;
    border: none;
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.65);
    font-family: 'Lato', sans-serif;
    font-size: 0.93rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab--active {
    background: rgba(230, 180, 34, 0.18);
    color: #e6b422;
    font-weight: 600;
}

.auth-field {
    display: block;
    margin-bottom: 14px;
}

.auth-field > span {
    display: block;
    margin-bottom: 6px;
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.75);
}

.auth-field input {
    width: 100%;
    padding: 11px 13px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9px;
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
}

.auth-field input:focus {
    outline: none;
    border-color: #e6b422;
    box-shadow: 0 0 0 2px rgba(230, 180, 34, 0.16);
}

.auth-field small {
    display: block;
    margin-top: 5px;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.45);
}

.auth-error {
    margin-bottom: 14px;
    padding: 10px 13px;
    background: rgba(220, 53, 69, 0.14);
    border: 1px solid rgba(220, 53, 69, 0.42);
    border-radius: 8px;
    color: #ff8a95;
    font-size: 0.87rem;
}

.auth-hint {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    line-height: 1.5;
}

/* =================== PANEL ADMIN =================== */

.admin-loading,
.admin-empty {
    padding: 48px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-family: 'Lato', sans-serif;
}

.admin-denied {
    padding: 70px 20px;
    text-align: center;
}

.admin-denied h1 {
    font-family: 'Cinzel', serif;
    color: #ff8a95;
    margin-bottom: 14px;
}

.admin-denied p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 26px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 28px 0 22px;
    border-bottom: 1px solid rgba(230, 180, 34, 0.2);
    margin-bottom: 26px;
}

.admin-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 1.7rem;
    color: #e6b422;
    margin: 0;
}

.admin-header__right {
    display: flex;
    gap: 10px;
}

.btn-admin {
    padding: 8px 16px;
    border: 1px solid rgba(230, 180, 34, 0.45);
    border-radius: 9px;
    background: transparent;
    color: #e6b422;
    font-family: 'Lato', sans-serif;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-admin:hover {
    background: rgba(230, 180, 34, 0.12);
}

.btn-admin--primary {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
    font-weight: 600;
}

.btn-admin--primary:hover {
    background: #218838;
}

.btn-admin--danger {
    border-color: rgba(220, 53, 69, 0.5);
    color: #ff8a95;
}

.btn-admin--danger:hover {
    background: rgba(220, 53, 69, 0.14);
}

.admin-stats {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.admin-stat {
    flex: 1 1 140px;
    padding: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 13px;
}

.admin-stat--pending {
    border-color: rgba(255, 193, 7, 0.34);
    background: rgba(255, 193, 7, 0.06);
}

.admin-stat--approved {
    border-color: rgba(40, 167, 69, 0.34);
    background: rgba(40, 167, 69, 0.06);
}

/* Metricas de uso: son informativas, asi que van en dorado y no en el
   verde de aprobacion, para que no se confundan con estado de usuarios. */
.admin-stat--usage {
    border-color: rgba(230, 180, 34, 0.34);
    background: rgba(255, 193, 7, 0.06);
}

.admin-stat--usage .admin-stat__num {
    font-size: 1.5rem;
}

.admin-stat--usage .admin-stat__label {
    font-size: 0.72rem;
}

.admin-stat__num {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 2.1rem;
    color: #e6b422;
    line-height: 1;
}

.admin-stat__label {
    display: block;
    margin-top: 7px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.admin-filters {
    display: flex;
    gap: 7px;
}

.admin-filter {
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-family: 'Lato', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-filter--active {
    background: rgba(230, 180, 34, 0.16);
    border-color: #e6b422;
    color: #e6b422;
    font-weight: 600;
}

.admin-users {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.admin-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 17px 19px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 13px;
}

.admin-user--pending {
    border-left: 3px solid #ffc107;
}

.admin-user__info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.admin-user__name {
    font-weight: 600;
    color: #fff;
}

.admin-user__email,
.admin-user__date {
    font-size: 0.83rem;
    color: rgba(255, 255, 255, 0.55);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Consumo de lecturas con IA de cada usuario. */
.admin-user__usage {
    display: block;
    margin-top: 4px;
    font-size: 0.82rem;
    color: #c0aee0;
}

/* Consumo de las ultimas 24 h, que es lo que decide si topa con el
   limite. En rojo cuando ya llego. */
.admin-user__quota {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.74rem;
    background: rgba(255, 193, 7, 0.12);
    color: #e6b422;
}

.admin-user__quota--full {
    background: rgba(220, 53, 69, 0.16);
    color: #ff8a95;
}

.admin-user__quota--unknown {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.45);
}

.admin-limit {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.55);
}

.admin-limit-select {
    padding: 4px 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: rgba(20, 12, 38, 0.9);
    color: #fff;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Boton que pide la lectura con IA. Dice lo que cuesta en tiradas
   porque cada lectura descuenta una. */
.btn-ai-reading {
    display: block;
    width: 100%;
    margin: 18px 0 6px;
    padding: 13px 18px;
    border: 1px solid rgba(230, 180, 34, 0.5);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(230, 180, 34, 0.16), rgba(147, 51, 234, 0.16));
    color: #f5e6a8;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.1s;
}

.btn-ai-reading:hover:not(:disabled) {
    border-color: rgba(230, 180, 34, 0.9);
}

.btn-ai-reading:active:not(:disabled) {
    transform: scale(0.99);
}

.btn-ai-reading:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* El aviso de tiradas disponibles cambia de color cuando se agotan,
   para que se note sin leer la frase. */
.ai-access-notice--empty {
    border-color: rgba(220, 53, 69, 0.5) !important;
    background: rgba(220, 53, 69, 0.1) !important;
    color: #ffb3bb !important;
}

.admin-user__actions {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-wrap: wrap;
}

.admin-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 999px;
}

.admin-status--pending {
    background: rgba(255, 193, 7, 0.14);
    color: #ffc107;
}

.admin-status--approved {
    background: rgba(40, 167, 69, 0.14);
    color: #4ade80;
}

.admin-error {
    padding: 18px;
    background: rgba(220, 53, 69, 0.12);
    border: 1px solid rgba(220, 53, 69, 0.4);
    border-radius: 10px;
    color: #ff8a95;
    font-family: 'Lato', sans-serif;
}

@media (max-width: 600px) {
    .admin-user { flex-direction: column; align-items: flex-start; }
    .admin-header h1 { font-size: 1.35rem; }
}

@keyframes aiPulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.9; }
}

/* ------------------------------------------------------------
   Accesibilidad: movimiento reducido

   El fondo de estrellas (moveStars, 180s, infinito) y los pulsos
   son animaciones continuas. Sin este bloque no hay forma de que
   alguien con sensibilidad al movimiento las corte desde el
   sistema, y ademas consumen bateria en el telefono.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
