/* ClawBot · /level — AI 10-level quiz funnel */
:root {
    --bg: #0a0a0a;
    --panel: #0d1326;
    --panel-2: #11183a;
    --text: #e5e5e5;
    --text-dim: #9ba0ad;
    --accent: #FF6B35;
    --neon-teal: #00e5ff;
    --neon-magenta: #ff2bd6;
    --border: rgba(0, 229, 255, 0.18);
    --border-strong: rgba(0, 229, 255, 0.45);
}

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

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 43, 214, 0.08), transparent 60%),
        radial-gradient(ellipse 60% 60% at 50% 100%, rgba(0, 229, 255, 0.06), transparent 60%),
        var(--bg);
}

/* Header */
.lv-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.lv-logo {
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.lv-logo img { display: block; }
.lv-logo:hover { color: var(--accent); }
.lv-badge {
    font-size: 13px;
    color: var(--neon-teal);
    border: 1px solid var(--border-strong);
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 229, 255, 0.06);
    font-weight: 500;
}
.lv-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.lv-lang {
    font-size: 13px;
    color: var(--text-dim);
    text-decoration: none;
    border: 1px solid var(--border-strong);
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.03);
    font-weight: 500;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.lv-lang:hover {
    color: var(--text);
    border-color: var(--neon-teal);
    background: rgba(0, 229, 255, 0.08);
}

.lv-main { max-width: 720px; margin: 0 auto; padding: 24px 20px 80px; }

.step { animation: fadeIn 0.35s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

button, .btn-primary, .btn-secondary {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}
button:focus-visible, a:focus-visible {
    outline: 2px solid var(--neon-teal);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #ff8a5b);
    color: #fff;
    padding: 16px 32px;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(255, 107, 53, 0.45); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: transparent;
    color: var(--text-dim);
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: color 0.15s ease, border-color 0.15s ease;
}
.btn-secondary:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.3); }

/* 1. Intro */
.intro-inner { text-align: center; padding-top: 12px; }

/* Hero banner: 10-level ladder poster — sets the tone instantly */
.intro-hero {
    position: relative;
    margin: 0 auto 24px;
    max-width: 720px;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(0, 229, 255, 0.18), 0 0 100px rgba(255, 43, 214, 0.12);
    animation: heroEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.intro-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.intro-hero-fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(7, 9, 18, 0.85) 100%);
    pointer-events: none;
}
@keyframes heroEntrance {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

.intro-tease {
    font-size: 13px;
    font-weight: 600;
    color: var(--neon-teal);
    letter-spacing: 0.04em;
    margin: 0 0 14px;
    opacity: 0.85;
}
#intro-h1 {
    font-size: clamp(34px, 9vw, 56px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, var(--neon-teal) 50%, var(--neon-magenta) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}
.intro-sub {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 36px;
}
.intro-sub-dim { color: var(--text-dim); font-size: 14px; }

.silhouettes {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    max-width: 480px;
    margin: 0 auto 36px;
}
@media (min-width: 540px) {
    .silhouettes { grid-template-columns: repeat(10, 1fr); max-width: 560px; gap: 8px; }
}
.sil {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--border);
}
.sil {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    cursor: pointer;
    animation: silEntrance 0.5s ease-out both;
    animation-delay: calc(var(--n, 0) * 40ms);
}
.sil:nth-child(1) { --n: 0; }
.sil:nth-child(2) { --n: 1; }
.sil:nth-child(3) { --n: 2; }
.sil:nth-child(4) { --n: 3; }
.sil:nth-child(5) { --n: 4; }
.sil:nth-child(6) { --n: 5; }
.sil:nth-child(7) { --n: 6; }
.sil:nth-child(8) { --n: 7; }
.sil:nth-child(9) { --n: 8; }
.sil:nth-child(10) { --n: 9; }
@keyframes silEntrance {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}
.sil img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.78) saturate(1.05);
    transition: filter 0.2s ease;
}
.sil:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.25);
    border-color: var(--neon-teal);
    z-index: 1;
}
.sil:hover img {
    filter: brightness(1) saturate(1.15);
}
.sil span {
    position: absolute;
    bottom: 4px;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(7, 9, 18, 0.85);
    border: 1px solid rgba(0, 229, 255, 0.4);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: var(--neon-teal);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

.intro-foot {
    margin-top: 24px;
    color: var(--text-dim);
    font-size: 13px;
}

/* 2. Quiz */
#step-quiz { padding-top: 8px; }
.btn-back {
    background: transparent;
    color: var(--text-dim);
    font-size: 14px;
    padding: 6px 0;
    margin-bottom: 12px;
}
.btn-back:hover { color: var(--text); }
.btn-back[hidden] { display: none; }

.progress-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}
.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--panel);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.progress-fill {
    height: 100%;
    width: 10%;
    background: linear-gradient(90deg, var(--neon-teal), var(--neon-magenta));
    border-radius: 999px;
    transition: width 0.35s ease;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}
.progress-text {
    font-size: 13px;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.quiz-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px 22px;
    box-shadow: 0 4px 32px rgba(0, 229, 255, 0.06);
}
.quiz-card.slide-out { animation: slideOut 0.2s ease-in forwards; }
.quiz-card.slide-in { animation: slideIn 0.25s ease-out; }
@keyframes slideOut { to { opacity: 0; transform: translateX(-40px); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }

/* Story scene: 16:9 image above question */
.quiz-scene {
    margin: -8px -6px 18px;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #0a0a0a;
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.18), 0 0 80px rgba(255, 43, 214, 0.10);
}
.quiz-scene img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    animation: sceneFade 0.45s ease-out;
}
@keyframes sceneFade { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }

/* Chapter tag (e.g. "Day 1", "Month 6") */
.quiz-chapter {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--neon-teal);
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.22);
    border-radius: 999px;
    padding: 4px 12px;
    margin-bottom: 14px;
}
.quiz-chapter:empty { display: none; }

/* Story narrative — italicized stage-setting */
.quiz-narrative {
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-dim);
    font-style: italic;
    margin-bottom: 16px;
}
.quiz-narrative:empty { display: none; }

.quiz-q {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 24px;
    color: var(--text);
}
.quiz-options { display: flex; flex-direction: column; gap: 12px; }
.quiz-opt {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    text-align: left;
    font-size: 15px;
    line-height: 1.45;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
    width: 100%;
}
.quiz-opt:hover {
    border-color: var(--border-strong);
    background: rgba(0, 229, 255, 0.06);
}
.quiz-opt:active { transform: scale(0.99); }
.quiz-opt-letter {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 229, 255, 0.12);
    color: var(--neon-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

/* Loading bridge */
.loading-inner {
    text-align: center;
    padding: 80px 20px;
}
.spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid rgba(0, 229, 255, 0.15);
    border-top-color: var(--neon-teal);
    margin: 0 auto 20px;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-dim); font-size: 15px; }

/* 3. Reveal */
.reveal-inner { text-align: center; padding-top: 12px; }
.reveal-num {
    font-size: clamp(60px, 18vw, 96px);
    font-weight: 800;
    line-height: 1;
    color: #fff;
    text-shadow: 0 0 28px rgba(255, 43, 214, 0.6), 0 0 60px rgba(0, 229, 255, 0.4);
    margin-bottom: 18px;
    font-variant-numeric: tabular-nums;
}
.reveal-img-wrap {
    width: min(88vw, 420px);
    aspect-ratio: 1;
    margin: 0 auto 24px;
    border-radius: 28px;
    overflow: hidden;
    background: var(--panel);
    box-shadow: 0 0 60px rgba(0, 229, 255, 0.18), 0 0 100px rgba(255, 43, 214, 0.12);
}
@media (min-width: 768px) {
    .reveal-img-wrap { width: 460px; }
}
.reveal-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: revealPop 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes revealPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.reveal-name {
    font-size: clamp(26px, 6vw, 36px);
    font-weight: 700;
    color: var(--neon-teal);
    text-shadow: 0 0 18px rgba(0, 229, 255, 0.7), 0 0 36px rgba(0, 229, 255, 0.3);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}
.reveal-identity {
    font-size: 17px;
    line-height: 1.5;
    color: var(--text);
    margin: 0 auto 14px;
    max-width: 460px;
}
.reveal-pct {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 28px;
}

.upgrade-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 20px;
    margin: 0 auto 40px;
    max-width: 540px;
    text-align: left;
}
.upgrade-card summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--neon-magenta);
    font-size: 15px;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.upgrade-card summary::-webkit-details-marker { display: none; }
.upgrade-card summary::after {
    content: '+';
    font-size: 20px;
    color: var(--text-dim);
    transition: transform 0.2s ease;
}
.upgrade-card[open] summary::after { content: '−'; }
.upgrade-tip {
    margin-top: 12px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}

/* 4. Anchor */
.anchor-block {
    margin: 40px 0;
    padding: 28px 22px;
    background: linear-gradient(135deg, rgba(255, 43, 214, 0.06), rgba(0, 229, 255, 0.04));
    border: 1px solid var(--border);
    border-radius: 20px;
}
.anchor-h {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text);
}
.anchor-cols {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
@media (min-width: 600px) {
    .anchor-cols { flex-direction: row; }
}
.anchor-col {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s ease, transform 0.15s ease;
    display: block;
}
.anchor-col:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.anchor-name {
    font-weight: 600;
    color: var(--neon-teal);
    margin-bottom: 8px;
    font-size: 15px;
}
.anchor-desc {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-dim);
}
.anchor-bridge {
    text-align: center;
    margin-top: 20px;
    font-size: 16px;
    color: var(--text);
    font-weight: 500;
    font-style: italic;
}

/* 5. CTA */
.cta-block {
    text-align: center;
    padding: 32px 0 16px;
}
.cta-h {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}
.cta-sub {
    font-size: 15px;
    color: var(--text-dim);
    line-height: 1.6;
    margin: 0 auto 28px;
    max-width: 460px;
}
.btn-cta { font-size: 18px; padding: 18px 36px; margin-bottom: 16px; }
#btn-restart { display: block; margin: 4px auto 0; }

/* 6. Share */
.share-block {
    margin-top: 48px;
    padding: 24px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}
.share-h {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
}
.share-preview {
    width: 280px;
    max-width: 70vw;
    aspect-ratio: 1080 / 1920;
    margin: 0 auto 24px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    position: relative;
}
/* Share card — rendered at 1080x1920 (9:16, mobile-native), scaled visually via parent width */
.share-card {
    width: 1080px;
    height: 1920px;
    background: linear-gradient(160deg, #0a0a0a 0%, #0d1326 60%, #1a0a26 100%);
    color: var(--text);
    padding: 100px 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-family: 'Inter', -apple-system, sans-serif;
}
.share-preview .share-card {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    /* scale factor set via JS to match container width / 1080 */
}

.sc-top {
    width: 100%;
    margin-bottom: 40px;
    flex-shrink: 0;
}
.sc-brand {
    font-size: 36px;
    color: var(--neon-teal);
    font-weight: 600;
    letter-spacing: 0.04em;
}
.sc-num {
    font-size: 200px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    text-shadow: 0 0 60px rgba(255, 43, 214, 0.55), 0 0 120px rgba(0, 229, 255, 0.4);
    margin-bottom: 36px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.sc-img-wrap {
    width: 880px;
    height: 880px;
    border-radius: 48px;
    margin-bottom: 40px;
    background-color: #0a0a0a;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}
.sc-name {
    font-size: 80px;
    font-weight: 700;
    color: var(--neon-teal);
    text-shadow: 0 0 30px rgba(0, 229, 255, 0.7);
    margin-bottom: 24px;
    flex-shrink: 0;
}
.sc-identity {
    font-size: 38px;
    line-height: 1.4;
    color: var(--text);
    max-width: 920px;
    margin-bottom: auto;
    flex-shrink: 0;
}
.sc-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px solid rgba(0, 229, 255, 0.2);
    flex-shrink: 0;
    gap: 30px;
}
.sc-foot-text {
    font-size: 36px;
    color: var(--text-dim);
    text-align: left;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}
.sc-qr {
    width: 240px;
    height: 240px;
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.sc-qr #sc-qr-target {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sc-qr canvas,
.sc-qr img {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}
.btn-share { padding: 14px 24px; font-size: 15px; }
.share-toast {
    margin-top: 16px;
    font-size: 14px;
    color: var(--neon-teal);
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.share-toast.show { opacity: 1; }

/* Offscreen render target for html2canvas — keep at true 1080x1350 */
.share-card-render {
    position: fixed;
    top: -10000px;
    left: -10000px;
    transform: none !important;
    z-index: -1;
    pointer-events: none;
}

/* Mobile tweaks */
@media (max-width: 380px) {
    .lv-main { padding: 20px 16px 80px; }
    .quiz-card { padding: 22px 18px; }
    .quiz-q { font-size: 19px; }
    .quiz-opt { padding: 14px 14px; font-size: 14px; }
}
