/* ============================================================
   onboarding.css — Pantalla de inicio y tutorial
   ============================================================ */

/* ── Overlay principal ───────────────────────────────────── */
#onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: radial-gradient(ellipse at 40% 40%, #1a0a3e 0%, #06030f 75%);
    display: flex;
    align-items: flex-start;       /* evita centrado que corta el contenido */
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;              /* scroll cuando el contenido supera la pantalla */
    -webkit-overflow-scrolling: touch;
    opacity: 1;
    transition: opacity .5s ease;
}
#onboarding-overlay.hiding {
    opacity: 0;
    pointer-events: none;
}

/* ── Partículas de fondo (estrellas estáticas CSS) ───────── */
#onboarding-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 20%  30%, rgba(255,255,255,.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 55%  15%, rgba(255,255,255,.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 75%  60%, rgba(255,255,255,.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 10%  70%, rgba(255,255,255,.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 90%  20%, rgba(255,255,255,.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 40%  85%, rgba(255,255,255,.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 65%  45%, rgba(255,255,255,.4) 0%, transparent 100%),
        radial-gradient(2px 2px at 30%  55%, rgba(180,140,255,.5) 0%, transparent 100%),
        radial-gradient(2px 2px at 80%  80%, rgba(140,180,255,.4) 0%, transparent 100%);
    pointer-events: none;
}

/* ── Contenedor de slides ────────────────────────────────── */
#ob-container {
    max-width: 600px;
    width: 100%;
    position: relative;
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* ── Slides ──────────────────────────────────────────────── */
.ob-slide {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    animation: ob-slide-in .35s cubic-bezier(.22,1,.36,1) both;
}
.ob-slide.active { display: flex; }

@keyframes ob-slide-in {
    from { opacity: 0; transform: translateX(28px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes ob-slide-back {
    from { opacity: 0; transform: translateX(-28px); }
    to   { opacity: 1; transform: translateX(0); }
}
.ob-slide.back { animation-name: ob-slide-back; }

/* ── Slide 0: Portada ────────────────────────────────────── */
#ob-logo {
    font-size: 72px;
    line-height: 1;
    animation: ob-float 3s ease-in-out infinite;
}
@keyframes ob-float {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}
#ob-game-title {
    font-size: 38px;
    font-weight: 800;
    color: #FFD700;
    text-shadow: 0 0 40px rgba(255,215,0,.45);
    letter-spacing: -1px;
    line-height: 1.1;
    margin: 0;
}
#ob-game-subtitle {
    font-size: 17px;
    color: #9d8fd4;
    letter-spacing: .5px;
    margin-top: -8px;
}
.ob-narrative {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-left: 3px solid #BA55D3;
    border-radius: 12px;
    padding: 20px 24px;
    font-size: 15px;
    color: #d0c8f0;
    line-height: 1.8;
    text-align: left;
    width: 100%;
}
.ob-narrative strong { color: #FFD700; }

/* ── Slides 1-3: Tutorial ────────────────────────────────── */
.ob-tutorial-icon {
    font-size: 52px;
    line-height: 1;
    animation: ob-float 2.5s ease-in-out infinite;
}
.ob-tutorial-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}
.ob-tutorial-desc {
    font-size: 17px;
    color: #b0a8d8;
    line-height: 1.75;
    max-width: 460px;
}

/* Cuadrícula de controles */
.ob-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}
.ob-control-item {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: #c0b8e8;
}
.ob-key {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    border-bottom: 3px solid rgba(255,255,255,.15);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Lista de objetivos */
.ob-goal-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ob-goal-item {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}
.ob-goal-emoji { font-size: 26px; flex-shrink: 0; }
.ob-goal-text  { font-size: 15px; color: #c0b8e8; line-height: 1.5; }
.ob-goal-text strong { color: #fff; font-weight: 600; display: block; margin-bottom: 2px; }

/* Drives preview */
.ob-drives-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
}
.ob-drive-card {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
}
.ob-drive-card .emoji { font-size: 17px; }
.ob-drive-card .name  { font-size: 15px; color: #9d8fd4; margin-top: 4px; line-height: 1.3; }

/* ── Progress dots ───────────────────────────────────────── */
#ob-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 4px;
}
.ob-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    transition: background .3s, transform .3s;
}
.ob-dot.active {
    background: #BA55D3;
    transform: scale(1.3);
}

/* ── Botones de navegación ───────────────────────────────── */
#ob-nav {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
}
.ob-btn {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    padding: 13px 30px;
    cursor: pointer;
    transition: transform .15s, filter .15s;
    letter-spacing: .3px;
}
.ob-btn:hover  { filter: brightness(1.15); }
.ob-btn:active { transform: scale(.96); }
.ob-btn-primary {
    background: linear-gradient(135deg, #7b2fbe, #c44dff);
    color: #fff;
    flex: 1;
    max-width: 260px;
}
.ob-btn-secondary {
    background: rgba(255,255,255,.07);
    color: #9d8fd4;
    border: 1px solid rgba(255,255,255,.12);
}
.ob-btn-start {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a0a00;
    font-size: 17px;
    padding: 14px 40px;
    box-shadow: 0 4px 20px rgba(255,165,0,.4);
    width: 100%;
    max-width: 320px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 520px) {
    #ob-game-title      { font-size: 26px; }
    .ob-tutorial-title  { font-size: 17px; }
    .ob-controls-grid   { grid-template-columns: 1fr; }
    .ob-drives-grid     { grid-template-columns: repeat(2, 1fr); }
}

/* ── Ajuste al design system ─────────────────────────────── */
#ob-container, #ob-game-title, .ob-btn, .ob-narrative { font-family: var(--font, 'Inter', sans-serif); }
#ob-game-title { letter-spacing: -1px; }
