/* ── Metahuman Welcome Screen — PlayStation-style JRPG Menu ── */

/* ── Background overlay ── */
#mhn-welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;

    /* Deep PS-style blue-black gradient */
    background:
        radial-gradient(ellipse 100% 60% at 50% 0%,   rgba(60, 90, 200, 0.18) 0%, transparent 65%),
        radial-gradient(ellipse 80%  50% at 80% 100%, rgba(120, 60, 200, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60%  40% at 20% 60%,  rgba(40, 70, 160, 0.10) 0%, transparent 55%),
        #04070f;

    opacity: 0;
    animation: mhn-fade-in 0.9s ease forwards;
}

@keyframes mhn-fade-in {
    to { opacity: 1; }
}

/* CRT scanlines */
#mhn-welcome-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0, 0, 0, 0.06) 3px,
        rgba(0, 0, 0, 0.06) 4px
    );
    pointer-events: none;
    z-index: 0;
    animation: mhn-scanline-drift 8s linear infinite;
}

@keyframes mhn-scanline-drift {
    from { background-position: 0 0; }
    to   { background-position: 0 100px; }
}

/* Ambient light particles */
#mhn-welcome-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 12% 22%, rgba(180,200,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 78% 14%, rgba(180,200,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 45% 75%, rgba(180,200,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 88% 60%, rgba(200,160,255,0.35) 0%, transparent 100%),
        radial-gradient(1px 1px at 22% 88%, rgba(180,200,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 62% 8%,  rgba(180,200,255,0.4) 0%, transparent 100%),
        radial-gradient(2px 2px at 5%  50%, rgba(100,140,255,0.2) 0%, transparent 100%),
        radial-gradient(2px 2px at 95% 30%, rgba(160,100,255,0.2) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* ── PS-style wave strip (horizontal accent line) ── */
.mhn-welcome-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    padding: 0 2rem;
    animation: mhn-panel-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

@keyframes mhn-panel-in {
    from { opacity: 0; transform: translateX(-24px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Header ── */
.mhn-welcome-header {
    margin-bottom: 2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(100, 140, 255, 0.2);
    position: relative;
}

/* Glowing underline accent */
.mhn-welcome-header::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0;
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, rgba(100,160,255,0.8), transparent);
    box-shadow: 0 0 8px rgba(100,160,255,0.6);
}

/* ── Logo ── */
.mhn-welcome-logo {
    margin-bottom: 1.25rem;
}
.mhn-welcome-logo img {
    max-height: 64px;
    width: auto;
    opacity: 0.9;
    filter: drop-shadow(0 0 12px rgba(100,160,255,0.5));
}

.mhn-welcome-title {
    font-family: 'Cinzel Decorative', 'Cinzel', serif;
    font-size: clamp(1.2rem, 3.8vw, 1.75rem);
    font-weight: 700;
    color: #fff;
    text-shadow:
        0 0 30px rgba(100,160,255,0.5),
        0 0 60px rgba(100,140,255,0.2);
    margin: 0 0 0.4rem;
    letter-spacing: 0.04em;
    line-height: 1.25;
}

.mhn-welcome-subtitle {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    color: rgba(180, 200, 255, 0.45);
    margin: 0;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

/* ── Divider ── */
.mhn-welcome-divider {
    display: none; /* hidden in PS mode — using header border instead */
}

/* ── Menu — PS XMB-style vertical list ── */
.mhn-welcome-menu {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.mhn-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.1rem 0.8rem 0.9rem;
    background: transparent;
    border: none;
    border-left: 2px solid transparent;
    border-bottom: 1px solid rgba(100, 140, 255, 0.07);
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: clamp(0.78rem, 2.4vw, 0.92rem);
    font-weight: 600;
    letter-spacing: 0.12em;
    color: rgba(180, 200, 255, 0.5);
    text-transform: uppercase;
    width: 100%;
    text-align: left;
    transition: color 0.15s, background 0.15s, border-color 0.15s, padding-left 0.15s;
    opacity: 0;
    animation: mhn-item-in 0.3s ease var(--delay, 0.65s) forwards;
    position: relative;
}

.mhn-menu-item:last-child {
    border-bottom: none;
}

@keyframes mhn-item-in {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}

.mhn-menu-item:hover,
.mhn-menu-item.is-active {
    color: #e8eeff;
    background: rgba(80, 120, 255, 0.1);
    border-left-color: rgba(100, 160, 255, 0.85);
    padding-left: 1.25rem;
    outline: none;
}

.mhn-menu-item:focus-visible {
    outline: 1px solid rgba(100,160,255,0.5);
    outline-offset: -2px;
}

/* Active item glow line */
.mhn-menu-item.is-active {
    box-shadow:
        inset 0 0 20px rgba(80,120,255,0.05),
        -1px 0 0 0 rgba(100,160,255,0.3);
}

/* ▶ cursor triangle */
.mhn-item-cursor {
    font-size: 0.5rem;
    color: rgba(100, 170, 255, 0.9);
    opacity: 0;
    flex-shrink: 0;
    line-height: 1;
    transition: opacity 0.08s;
    filter: drop-shadow(0 0 4px rgba(100,170,255,0.9));
}

.mhn-menu-item.is-active .mhn-item-cursor,
.mhn-menu-item:hover .mhn-item-cursor {
    opacity: 1;
    animation: mhn-blink 0.9s step-end infinite;
}

@keyframes mhn-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ── Hint ── */
.mhn-welcome-hint {
    margin: 1.75rem 0 0;
    font-family: 'Cinzel', serif;
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(100, 140, 255, 0.22);
}

/* ── Exit animation ── */
#mhn-welcome-overlay.is-exiting {
    animation: mhn-fade-out 0.32s ease forwards;
    pointer-events: none;
}

@keyframes mhn-fade-out {
    to { opacity: 0; transform: scale(1.01); }
}

/* ── Responsive ── */
@media (max-width: 520px) {
    .mhn-welcome-inner {
        padding: 0 1.25rem;
    }
    .mhn-welcome-title {
        font-size: 1.1rem;
    }
    .mhn-menu-item {
        padding: 0.75rem 0.9rem;
    }
}
