:root {
    --bg-0: #090b10;
    --bg-1: #111520;
    --card: rgba(19, 23, 34, 0.92);
    --surface: #191f2e;
    --border: rgba(229, 184, 121, 0.16);
    --border-soft: rgba(255, 255, 255, 0.08);
    --text: #f8fafc;
    --muted: #94a3b8;
    --gold: #e5b879;
    --gold-strong: #f59e0b;
    --emerald: #10b981;
    --red: #ef4444;
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: radial-gradient(circle at top center, #1b1716 0%, var(--bg-0) 58%);
    color: var(--text);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.ambient-glow {
    position: fixed;
    border-radius: 999px;
    filter: blur(110px);
    pointer-events: none;
    z-index: 0;
}
.ambient-gold { width: 340px; height: 340px; top: -110px; left: 50%; transform: translateX(-50%); background: rgba(229, 184, 121, 0.16); }
.ambient-slate { width: 280px; height: 280px; bottom: -100px; right: -60px; background: rgba(56, 189, 248, 0.08); }

.promo-strip {
    position: relative;
    z-index: 2;
    background: linear-gradient(90deg, rgba(229, 184, 121, 0.14), rgba(16, 185, 129, 0.12));
    border-bottom: 1px solid var(--border);
    padding: 7px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #f6dcb4;
    text-align: center;
}
.promo-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 0 8px var(--emerald);
    flex-shrink: 0;
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(9, 11, 16, 0.84);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
    max-width: 740px;
    margin: 0 auto;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(145deg, #211c17, #131722);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-size: 14px; font-weight: 800; letter-spacing: 0.4px; }
.gold-text { color: var(--gold); }
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 500; }

.status-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399; font-size: 11px; font-weight: 700;
    white-space: nowrap;
}
.live-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--emerald);
    animation: pulseLive 1.8s infinite;
}
@keyframes pulseLive {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.8); }
}

.shell {
    position: relative;
    z-index: 2;
    max-width: 740px;
    margin: 0 auto;
    padding: 14px 12px 32px;
}

.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 4px;
}
.step-pill {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12px; font-weight: 700; color: var(--muted);
    white-space: nowrap;
}
.step-num {
    width: 22px; height: 22px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface); border: 1px solid var(--border-soft);
    font-size: 11px; font-family: var(--font-mono);
}
.step-pill.active { color: var(--gold); }
.step-pill.active .step-num {
    background: var(--gold); color: #111; border-color: var(--gold);
    box-shadow: 0 0 12px rgba(229, 184, 121, 0.4);
}
.step-pill.done { color: #34d399; }
.step-pill.done .step-num { background: var(--emerald); color: #052e16; border-color: var(--emerald); }
.step-line { flex: 1; height: 1px; background: var(--border-soft); }

.studio-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.step-pane { display: none; animation: fadeIn 0.28s ease; }
.step-pane.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.pane-head { text-align: center; margin-bottom: 14px; }
.pane-head.compact { margin-bottom: 12px; }
.eyebrow {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
    background: rgba(229, 184, 121, 0.14);
    border: 1px solid rgba(229, 184, 121, 0.35);
    color: var(--gold);
    margin-bottom: 6px;
}
.eyebrow.success {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}
.pane-head h1, .pane-head h2 {
    font-size: clamp(20px, 4.6vw, 26px);
    font-weight: 800;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}
.pane-head p { font-size: 13px; color: var(--muted); line-height: 1.45; }

.device-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.dev-card {
    position: relative;
    background: linear-gradient(170deg, rgba(30, 36, 52, 0.9), rgba(15, 19, 29, 0.96));
    border: 1px solid var(--border-soft);
    border-radius: 15px;
    padding: 13px 11px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.dev-card:hover:not(.sold-out) {
    transform: translateY(-2px);
    border-color: var(--gold);
    box-shadow: 0 10px 26px rgba(229, 184, 121, 0.14);
}
.dev-card.featured {
    border-color: rgba(229, 184, 121, 0.5);
    background: linear-gradient(170deg, rgba(48, 38, 28, 0.55), rgba(15, 19, 29, 0.96));
}
.dev-card.sold-out { opacity: 0.58; cursor: not-allowed; }

.dev-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 999px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}
.dev-card.featured .dev-badge { background: rgba(229, 184, 121, 0.22); color: #f6dcb4; border: 1px solid rgba(229, 184, 121, 0.4); }
.dev-card.fold .dev-badge { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; }
.dev-card.sold-out .dev-badge { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }

.dev-img {
    width: 112px;
    height: 112px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55));
}
.dev-name {
    font-size: 14.5px;
    font-weight: 800;
    line-height: 1.25;
    min-height: 2.5em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}
.dev-spec {
    font-size: 11px;
    color: var(--muted);
    margin: 2px 0 8px;
    line-height: 1.3;
}
.dev-price-line {
    display: flex; align-items: baseline; justify-content: center; gap: 7px;
    margin-bottom: 6px;
}
.dev-free { font-size: 18px; font-weight: 800; color: var(--emerald); }
.dev-strike { font-size: 12px; color: #64748b; text-decoration: line-through; }

.dev-stock {
    font-size: 10.5px;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 9px;
}
.dev-card.sold-out .dev-stock { color: #94a3b8; }

.dev-cta {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 9px 10px;
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 800;
    background: linear-gradient(135deg, #e5b879, #c89347);
    color: #0b0d12;
    cursor: pointer;
    margin-top: auto;
}
.dev-card.sold-out .dev-cta {
    background: #273042;
    color: #94a3b8;
    cursor: not-allowed;
}

.trust-row {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.trust-cell {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 8px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #cbd5e1;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    text-align: center;
}

/* Step 2 Preview & Config */
.preview-stage {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #181d2b, #0e121c);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.preview-aura {
    position: absolute;
    width: 130px; height: 130px; border-radius: 50%;
    left: 10px; top: 50%; transform: translateY(-50%);
    filter: blur(34px);
    opacity: 0.45;
    background: #e5b879;
    transition: background 0.25s ease;
    pointer-events: none;
}
.preview-img { position: relative; z-index: 1; width: 88px; height: 88px; object-fit: contain; flex-shrink: 0; }
.preview-meta { position: relative; z-index: 1; min-width: 0; flex: 1; }
.preview-tag { display: inline-block; font-size: 10px; font-weight: 800; color: #34d399; margin-bottom: 3px; }
.preview-meta h3 { font-size: 17px; font-weight: 800; margin-bottom: 2px; }
.preview-sub { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.preview-price-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.price-free { font-size: 18px; font-weight: 800; color: var(--emerald); }
.price-strike { font-size: 12.5px; color: #64748b; text-decoration: line-through; }
.waiver-badge {
    font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px;
    background: rgba(16, 185, 129, 0.16); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35);
}

.cfg-block { margin-bottom: 13px; }
.cfg-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--gold);
    margin-bottom: 7px;
}
.swatch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.swatch-btn {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    padding: 9px 10px;
    color: var(--text);
    font-family: var(--font-main);
    font-size: 12.5px;
    font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    text-align: left;
}
.swatch-btn.active { border-color: var(--gold); background: rgba(229, 184, 121, 0.1); }
.swatch-dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35); flex-shrink: 0; }

.storage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stor-btn {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    padding: 9px 6px;
    color: var(--text);
    font-family: var(--font-main);
    cursor: pointer;
    text-align: center;
}
.stor-btn.active { border-color: var(--gold); background: rgba(229, 184, 121, 0.12); }
.stor-cap { display: block; font-size: 13.5px; font-weight: 800; }
.stor-sub { display: block; font-size: 10.5px; color: #34d399; font-weight: 700; margin-top: 2px; }

.form-split { display: grid; grid-template-columns: 1fr 1.15fr; gap: 8px; }
.studio-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    padding: 11px 12px;
    color: var(--text);
    font-family: var(--font-main);
    font-size: 13px;
    outline: none;
}
.studio-input:focus { border-color: var(--gold); }
.form-error { color: #f87171; font-size: 12px; font-weight: 600; margin-top: 6px; min-height: 16px; }

.invoice-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 13px;
    font-size: 12.5px;
}
.inv-row { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); }
.inv-row.total { border-top: 1px solid var(--border-soft); margin-top: 5px; padding-top: 7px; font-size: 14px; font-weight: 800; color: var(--text); }
.emerald { color: var(--emerald); font-weight: 700; }

.action-bar { display: flex; gap: 9px; }
.btn-back {
    padding: 12px 14px;
    border-radius: 11px;
    border: 1px solid var(--border-soft);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.btn-primary {
    flex: 1;
    padding: 12px 16px;
    border-radius: 11px;
    border: 0;
    background: linear-gradient(135deg, #e5b879, #c89347);
    color: #0b0d12;
    font-family: var(--font-main);
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
}

/* Step 3 Processing & Offers */
.alloc-stage { text-align: center; padding: 14px 4px; }
.orbital-spinner {
    width: 46px; height: 46px; margin: 0 auto 12px;
    border-radius: 50%;
    border: 3px solid rgba(229, 184, 121, 0.2);
    border-top-color: var(--gold);
    animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.alloc-sub { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.alloc-list {
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex; flex-direction: column; gap: 9px;
}
.alloc-item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.al-dot { width: 10px; height: 10px; border-radius: 50%; background: #475569; flex-shrink: 0; }
.alloc-item.working { color: var(--gold); font-weight: 700; }
.alloc-item.working .al-dot { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.alloc-item.done { color: #34d399; font-weight: 600; }
.alloc-item.done .al-dot { background: var(--emerald); }
.alloc-item.alert { color: #f87171; font-weight: 700; }
.alloc-item.alert .al-dot { background: var(--red); }

.summary-ticket {
    background: linear-gradient(145deg, #161b29, #0e131e);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 13px;
}
.ticket-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ticket-left img { width: 52px; height: 52px; object-fit: contain; flex-shrink: 0; }
.ticket-serial { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--gold); }
.ticket-model { font-size: 14px; font-weight: 800; }
.ticket-meta { font-size: 11.5px; color: var(--muted); }
.ticket-right { text-align: right; flex-shrink: 0; }
.locked-pill {
    display: inline-block; font-size: 10px; font-weight: 800; padding: 3px 8px;
    border-radius: 999px; background: rgba(239, 68, 68, 0.16); color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}
.ticket-user { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gate-header { text-align: center; margin-bottom: 12px; }
.gate-header h2 { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.gate-header p { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* Offers list */
.fn-quest-cards-list { display: flex; flex-direction: column; gap: 9px; }
.fn-offer-loading {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 24px 12px; font-size: 12.5px; color: var(--muted);
}
.fn-verifying-spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2.5px solid rgba(229, 184, 121, 0.25);
    border-top-color: var(--gold);
    animation: spin 0.8s linear infinite;
}
.quest-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 13px;
    padding: 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.quest-card.featured {
    border-color: rgba(229, 184, 121, 0.55);
    background: linear-gradient(135deg, rgba(229, 184, 121, 0.09), var(--surface));
}
.quest-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.quest-ico { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #0f172a; }
.quest-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }
.quest-badge {
    font-size: 9.5px; font-weight: 800; padding: 2px 6px; border-radius: 6px;
    background: rgba(229, 184, 121, 0.18); color: #f6dcb4;
}
.quest-time { font-size: 10px; color: #34d399; font-weight: 700; }
.quest-title {
    font-size: 13.5px; font-weight: 800; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: 2px;
}
.quest-desc { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.quest-action { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.fn-quest-action-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 13px; border-radius: 10px;
    background: linear-gradient(135deg, #e5b879, #c89347);
    color: #0b0d12; text-decoration: none;
    font-size: 12px; font-weight: 800; white-space: nowrap;
}
.fn-quest-action-btn.btn-verifying { background: #1e293b; color: #f8fafc; border: 1px solid var(--gold); }
.quest-free { font-size: 10px; color: var(--muted); }

.verifying-notice {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 12.5px;
    color: #cbd5e1;
    gap: 8px;
}

.foot {
    text-align: center;
    margin-top: 14px;
    font-size: 11px;
    color: #64748b;
}

@media (max-width: 540px) {
    .studio-card { padding: 14px 10px; }
    .device-grid { gap: 8px; }
    .dev-img { width: 92px; height: 92px; }
    .form-split { grid-template-columns: 1fr; }
    .trust-row { grid-template-columns: 1fr; gap: 6px; }
    .quest-card { flex-direction: column; align-items: stretch; }
    .quest-action { align-items: stretch; }
    .fn-quest-action-btn { width: 100%; }
}
