:root {
    --bg-deep: #060814;
    --bg-card: #0e1326;
    --bg-card-hover: #161e38;
    --accent-gold: #f3e0aa;
    --accent-gold-glow: rgba(243, 224, 170, 0.25);
    --text-main: #f0f2f9;
    --text-muted: #949eb8;
    --border-color: rgba(243, 224, 170, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Fondo de estrellas */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(circle at 50% 20%, #111832 0%, #060814 80%);
}

.star {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.app-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 100vh;
    max-height: 920px;
    background: rgba(10, 14, 30, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1;
}

@media (min-width: 481px) {
    .app-wrapper {
        border-radius: 24px;
        height: 88vh;
    }
}

/* Pantallas y Navegación */
.screen {
    display: none;
    flex: 1;
    padding: 24px 20px;
    flex-direction: column;
    animation: fadeIn 0.4s ease forwards;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.header-nav {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.header-nav h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: var(--accent-gold);
    margin: 0 auto;
    font-weight: 600;
}

.btn-back {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: var(--transition);
}

.btn-back:hover {
    color: var(--accent-gold);
}

/* Hero Screen */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    flex: 1;
    padding: 10px 0;
}

.moon-glow-container {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-gold-glow) 0%, transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    animation: floatMoon 4s ease-in-out infinite;
}

@keyframes floatMoon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.moon-symbol {
    font-size: 2.8rem;
}

.app-subtitle {
    font-size: 0.75rem;
    letter-spacing: 3px;
    color: var(--accent-gold);
    margin-bottom: 8px;
    font-weight: 600;
}

.app-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 14px;
    line-height: 1.2;
}

.app-quote {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--accent-gold);
    margin-bottom: 16px;
    line-height: 1.4;
    padding: 0 10px;
}

.app-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Botones */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #f3e0aa 0%, #d4b56a 100%);
    color: #0c1021;
    border: none;
    padding: 16px 24px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(212, 181, 106, 0.2);
    margin-bottom: 12px;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    width: 100%;
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 14px 24px;
    border-radius: 14px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--accent-gold);
}

/* Formulario */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
}

.form-instruction {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.4;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-main);
    margin-bottom: 6px;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    background: rgba(6, 8, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    color: #ffffff;
    font-size: 0.95rem;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(243, 224, 170, 0.15);
}

.demo-notice {
    background: rgba(243, 224, 170, 0.05);
    border-left: 3px solid var(--accent-gold);
    padding: 10px 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-radius: 0 8px 8px 0;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Tarjeta de Resultado */
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px 20px;
    flex: 1;
    overflow-y: auto;
    margin-bottom: 16px;
}

.result-header {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.result-moon-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.result-tag {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.result-archetype-name {
    font-family: 'Cinzel', serif;
    font-size: 1.7rem;
    color: var(--accent-gold);
    font-weight: 700;
    margin-bottom: 6px;
}

.result-phase-name {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.result-section {
    margin-bottom: 18px;
}

.result-section h4 {
    font-size: 0.9rem;
    color: var(--accent-gold);
    margin-bottom: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-section p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.action-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Catálogo de Arquetipos */
.catalog-intro {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.4;
}

.archetypes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.archetype-card-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.archetype-card-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-gold);
}

.archetype-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.archetype-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.archetype-icon {
    font-size: 1.6rem;
}

.archetype-name {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    color: var(--accent-gold);
    font-weight: 600;
}

.archetype-range {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.archetype-chevron {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.archetype-card-item.expanded .archetype-chevron {
    transform: rotate(180deg);
}

.archetype-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, margin-top 0.3s ease;
}

.archetype-card-item.expanded .archetype-details {
    max-height: 500px;
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
}

.archetype-details p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 8px;
}
