/* ==========================================
   SS3D PREMIUM PRO MAX HUB (v7.20.0) — dashboard.html
   Dark cosmic theme; also styles the modal/button classes js/auth.js drives.
   ========================================== */
:root {
    --pm-bg: #05070f;
    --pm-surface: rgba(255, 255, 255, 0.05);
    --pm-surface-strong: rgba(255, 255, 255, 0.09);
    --pm-border: rgba(255, 255, 255, 0.12);
    --pm-text: #e8ecf5;
    --pm-muted: #94a3b8;
    --pm-gold: #fcd34d;
    --pm-blue: #38bdf8;
    --pm-aero: #f97316;
    --pm-artemis: #a78bfa;
    --pm-exo: #38bdf8;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: radial-gradient(1200px 700px at 80% -10%, #1b1f4b 0%, transparent 60%), radial-gradient(900px 600px at -10% 20%, #0b2a4a 0%, transparent 55%), var(--pm-bg);
    color: var(--pm-text);
    min-height: 100vh;
}

.starfield {
    position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.55;
    background-image:
        radial-gradient(1px 1px at 20px 30px, #fff, transparent),
        radial-gradient(1px 1px at 120px 90px, #cbd5ff, transparent),
        radial-gradient(1.5px 1.5px at 210px 160px, #fff, transparent),
        radial-gradient(1px 1px at 300px 40px, #fde68a, transparent);
    background-size: 340px 200px;
}

a { color: var(--pm-blue); }
a:focus-visible, button:focus-visible, .mission-card:focus-visible { outline: 3px solid var(--pm-gold); outline-offset: 3px; }

/* ---------- Header ---------- */
.pm-header, .pm-main, .pm-footer { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

.pm-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 10px; }
.pm-back { color: var(--pm-muted); text-decoration: none; font-weight: 700; font-size: 0.9rem; }
.pm-back:hover { color: #fff; }
.pm-brand { display: flex; align-items: center; gap: 12px; }
.pm-gem { font-size: 2.2rem; filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.6)); }
.pm-brand h1 { margin: 0; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: clamp(1.3rem, 3.5vw, 1.9rem); background: linear-gradient(90deg, #fde68a, #38bdf8 60%, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pm-brand p { margin: 2px 0 0; color: var(--pm-muted); font-size: 0.85rem; }
.pm-account { display: flex; align-items: center; gap: 10px; }
.pm-pill { background: var(--pm-surface-strong); color: var(--pm-text); border: 1px solid var(--pm-border); border-radius: 999px; padding: 9px 16px; font-weight: 700; font-size: 0.85rem; cursor: pointer; font-family: inherit; }
.pm-pill:hover { background: rgba(255, 255, 255, 0.16); }

.pro-badge { background: linear-gradient(45deg, #fef08a, #fde047); color: #854d0e; padding: 5px 12px; border-radius: 20px; font-weight: 800; font-size: 0.75rem; }

/* ---------- Layout ---------- */
.pm-main { padding-top: 10px; padding-bottom: 40px; }
.pm-hero { padding: 26px 0 8px; max-width: 760px; }
.pm-hero h2 { font-family: 'Nunito', sans-serif; font-size: clamp(1.5rem, 4vw, 2.3rem); margin: 0 0 10px; }
.pm-hero p { color: var(--pm-muted); line-height: 1.6; margin: 0; }
.pm-section-title { font-family: 'Nunito', sans-serif; font-size: 1.15rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--pm-muted); margin: 28px 0 14px; }

/* ---------- Mission cards ---------- */
.mission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
.mission-card {
    --accent: var(--pm-blue);
    position: relative; overflow: hidden; cursor: pointer;
    background: linear-gradient(160deg, var(--pm-surface-strong), var(--pm-surface));
    border: 1px solid var(--pm-border); border-top: 3px solid var(--accent);
    border-radius: 20px; padding: 24px 22px 22px;
    display: flex; flex-direction: column; gap: 6px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.mission-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--accent); }
.card-aero { --accent: var(--pm-aero); }
.card-artemis { --accent: var(--pm-artemis); }
.card-exo { --accent: var(--pm-exo); }
.mission-icon { font-size: 2.6rem; }
.mission-card h3 { margin: 4px 0 0; font-family: 'Nunito', sans-serif; font-size: 1.4rem; }
.mission-tag { margin: 0 0 6px; color: var(--accent); font-weight: 800; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.mission-card p { margin: 0; color: #cbd5e1; line-height: 1.55; font-size: 0.92rem; }
.mission-card ul { margin: 10px 0 14px; padding-left: 18px; color: var(--pm-muted); font-size: 0.85rem; line-height: 1.6; }
.mission-go { margin-top: auto; font-weight: 800; color: var(--accent); }

.lock-overlay {
    display: none; position: absolute; inset: 0; z-index: 2;
    background: rgba(5, 7, 15, 0.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    align-items: center; justify-content: center;
}
.lock-overlay span { background: #0f172a; border: 1px solid var(--pm-border); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 800; }
.pro-locked .lock-overlay { display: flex; }

.pm-upsell { margin-top: 24px; padding: 20px; text-align: center; border: 1px dashed rgba(252, 211, 77, 0.45); border-radius: 18px; background: rgba(252, 211, 77, 0.06); }
.pm-upsell p { margin: 0 0 14px; color: #e2e8f0; font-weight: 700; }
.pm-upsell del { color: #f87171; }
.pm-upsell .price { color: #34d399; font-size: 1.15rem; font-weight: 900; }
.pm-upsell .per-mo { color: var(--pm-blue); }

/* ---------- Hangar ---------- */
.pm-hangar-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.pm-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.pm-filter { background: transparent; color: var(--pm-muted); border: 1px solid var(--pm-border); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 0.8rem; cursor: pointer; font-family: inherit; }
.pm-filter.active { background: var(--pm-blue); color: #04121f; border-color: var(--pm-blue); }
.pm-hint { color: var(--pm-muted); font-size: 0.85rem; margin: 0 0 12px; }
.pm-empty { color: var(--pm-muted); padding: 22px; text-align: center; border: 1px dashed var(--pm-border); border-radius: 14px; margin: 0; }
.hangar-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.hangar-item { box-sizing: border-box; min-width: 0; flex-wrap: wrap; display: flex; align-items: center; gap: 10px 14px; background: var(--pm-surface); border: 1px solid var(--pm-border); border-radius: 14px; padding: 12px 14px; }
.hangar-icon { font-size: 1.8rem; }
.hangar-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; border: 1px solid var(--pm-border); }
.hangar-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hangar-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hangar-body span { color: var(--pm-muted); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hangar-launch { text-decoration: none; display: inline-block; text-align: center; }
.hangar-btn { width: auto; padding: 8px 14px; font-size: 0.82rem; }

.pm-footer { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; padding-top: 10px; padding-bottom: 36px; font-size: 0.85rem; }

/* ---------- Buttons / inputs (also used by auth.js modals) ---------- */
.btn { border: none; padding: 13px; border-radius: 12px; font-size: 0.95rem; font-weight: 800; font-family: inherit; cursor: pointer; width: 100%; transition: 0.2s; }
.btn:hover { transform: translateY(-2px); }
.btn-blue { background: var(--pm-blue); color: #04121f; }
.btn-yellow { background: var(--pm-gold); color: #3b2a00; width: auto; padding: 12px 30px; }
.btn-red { background: #ef4444; color: #fff; }
.btn-ghost { background: rgba(255, 255, 255, 0.1); color: var(--pm-text); }
.text-input { width: 100%; padding: 12px 14px; margin-bottom: 12px; border-radius: 10px; border: 1px solid var(--pm-border); background: rgba(255, 255, 255, 0.06); color: var(--pm-text); font-family: inherit; font-size: 0.95rem; }
.text-input:focus { outline: none; border-color: var(--pm-blue); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25); }

.modal-overlay { position: fixed; inset: 0; background: rgba(2, 4, 12, 0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 10000; display: flex; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.custom-modal-box { position: relative; width: 92%; max-width: 400px; background: #0f172a; border: 1px solid var(--pm-border); border-radius: 22px; padding: 32px 26px; text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }
.custom-modal-box h2 { margin: 0 0 12px; font-family: 'Nunito', sans-serif; }
.custom-modal-box p { color: var(--pm-muted); line-height: 1.5; white-space: pre-line; }
.custom-modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.close-btn { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--pm-muted); font-size: 1.6rem; cursor: pointer; line-height: 1; }
.close-btn:hover { color: #f87171; }
.btn-google { width: 100%; background: #fff; color: #334155; border: none; border-radius: 12px; padding: 12px; font-weight: 800; font-family: inherit; cursor: pointer; }
.auth-divider { display: flex; align-items: center; color: var(--pm-muted); font-size: 0.8rem; margin: 16px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--pm-border); }
.auth-divider::before { margin-right: 0.6em; }
.auth-divider::after { margin-left: 0.6em; }
#auth-error-msg { color: #f87171; font-size: 0.85rem; margin-top: 10px; min-height: 1em; }

@media (max-width: 600px) {
    .pm-header { flex-direction: column; align-items: flex-start; }
    .hangar-body { flex-basis: calc(100% - 60px); }
    .hangar-btn { flex: 1 1 calc(50% - 7px); width: auto; min-width: 0; white-space: normal; padding: 8px 10px; }
    .hangar-note { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    .mission-card, .btn { transition: none; }
    .mission-card:hover, .btn:hover { transform: none; }
}

/* v7.23.0: why a world can't be deployed */
.hangar-note { display: block; margin-top: 4px; color: #fcd34d; font-size: 0.72rem; line-height: 1.35; max-width: 46ch; }

/* v7.23.3: browser-storage reminder */
.pm-warn { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(251,191,36,0.45); background: rgba(251,191,36,0.08); color: #fde68a; font-size: 0.82rem; line-height: 1.45; }
.pm-warn strong { color: #fef3c7; }

/* sign-in: password rule + forgot password */
.pw-row { position: relative; }
.pw-row .text-input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 8px; top: 7px; background: none; border: 0; color: #0ea5e9; font-weight: 700; font-size: 0.8rem; cursor: pointer; padding: 6px; font-family: inherit; }
.pw-hint { font-size: 0.8rem; color: #64748b; text-align: left; margin: -8px 0 14px; }
.pw-hint.ok { color: #16a34a; } .pw-hint.bad { color: #ef4444; }
.auth-link { background: none; border: 0; color: #0ea5e9; font-weight: 700; font-size: 0.85rem; cursor: pointer; margin-top: 12px; font-family: inherit; text-decoration: underline; }
.auth-link:disabled { opacity: .5; cursor: default; text-decoration: none; }
#auth-error-msg.info { color: #16a34a; }
#auth-error-msg { height: auto !important; min-height: 20px; }
.pw-rule { padding-left: 4px; } .pw-rule.ok { color: #16a34a; } .pw-rule.bad { color: #ef4444; }
#pw-hint { line-height: 1.5; }
#auth-modal-overlay .custom-modal-box { max-height: 94vh; overflow-y: auto; }
a.auth-link { display: inline-block; text-decoration: underline; }
