/* ===== PAGE SETUP ===== */
html, body {
    height: 100%;
    overflow: hidden;
}

/* ===== HORIZONTAL BOOK ===== */
.book {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.book-track {
    display: flex;
    height: 100%;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.page {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.page-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 28px;
    max-width: 460px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
}

.page-center-left {
    text-align: left;
}

/* Page fade-in when active */
.page .page-inner { opacity: 0; transform: translateY(8px); transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s; }
.page.active .page-inner { opacity: 1; transform: translateY(0); }

/* Scrollable page variant (life audit) */
.page-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 60px 28px 40px;
    max-width: 460px;
    margin: 0 auto;
    width: 100%;
}

/* ===== BUTTONS ===== */
.btn-begin {
    padding: 14px 40px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Varela Round', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-begin:hover { opacity: 0.85; }
.btn-begin:active { transform: scale(0.97); }
.btn-begin:disabled { opacity: 0.25; cursor: not-allowed; }

.btn-next {
    margin-top: 32px;
}

.page-center-left .btn-begin {
    margin-left: auto;
    margin-right: 0;
    display: block;
    width: fit-content;
}

.btn-skip {
    background: none;
    border: none;
    font-size: 14px;
    font-family: 'Varela Round', sans-serif;
    color: #999;
    cursor: pointer;
    padding: 10px 0;
    transition: color 0.2s;
}

.btn-skip:hover { color: #666; }

/* ===== AUTO-ADVANCE LINES ===== */
.auto-lines {
    text-align: left;
    max-width: 360px;
    width: 100%;
}

.al-line {
    font-size: 17px;
    color: #111;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.al-line.al-visible { opacity: 1; transform: translateY(0); }

.al-line.al-bold {
    font-weight: 700;
    font-size: 22px;
    margin-bottom: 2px;
}

.al-line.al-dim { color: #888; }

.al-spacer {
    height: 16px;
    opacity: 0;
}

.al-spacer.al-visible { opacity: 1; }

/* Bot intro variant */
.bot-intro {
    text-align: center;
    max-width: 400px;
}

.bot-intro .al-line {
    font-size: 22px;
    font-weight: 600;
    text-align: center;
}

.bot-intro .al-line.al-dim {
    font-size: 17px;
    font-weight: 400;
}

/* ===== QUESTION SCREENS ===== */
.tf-question {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.3px;
    margin-bottom: 28px;
    color: #111;
    text-align: left;
}

.tf-sub {
    font-size: 14px;
    color: #999;
    margin-top: -20px;
    margin-bottom: 20px;
}

.tf-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.tf-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Varela Round', sans-serif;
    color: #333;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    line-height: 1.45;
}

.tf-option:hover { border-color: rgba(0,0,0,0.25); background: #fafafa; }
.tf-option:active { transform: scale(0.98); }
.tf-option.selected { border-color: #111; background: #111; color: #fff; }
.tf-option.selected .tf-option-key { background: rgba(255,255,255,0.2); color: #fff; border-color: transparent; }

.tf-option-key {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    transition: all 0.2s;
}

.tf-continue-btn {
    margin-top: 20px;
    margin-left: auto;
    margin-right: 0;
    display: block;
    width: fit-content;
}

/* Multi-select option (no key badge) */
.tf-option-multi {
    padding: 13px 18px;
}

.tf-option-multi .tf-option-text {
    flex: 1;
}

/* ===== TOOL GRID (3-col) ===== */
.tf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    width: 100%;
    margin-bottom: 8px;
}

.tf-grid-option {
    padding: 12px 8px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    font-size: 13px;
    font-family: 'Varela Round', sans-serif;
    color: #333;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    line-height: 1.3;
}

.tf-grid-option:hover { border-color: rgba(0,0,0,0.25); }
.tf-grid-option:active { transform: scale(0.96); }
.tf-grid-option.selected { border-color: #111; background: #111; color: #fff; }

/* ===== DOMAIN LABEL ===== */
.domain-label {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 8px;
    font-weight: 600;
}

/* ===== REVEAL SCREENS ===== */
.reveal-screen {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.reveal-content {
}

.reveal-item {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-headline {
    font-size: 18px;
    color: #111;
    line-height: 1.65;
    margin-bottom: 24px;
    text-align: left;
}

.reveal-line {
    font-size: 16px;
    color: #888;
    line-height: 1.6;
    margin-top: 20px;
    font-style: italic;
}

.reveal-pre {
    font-size: 18px;
    color: #111;
    font-weight: 600;
    margin-bottom: 24px;
}

.reveal-insight {
    font-size: 16px;
    color: #888;
    line-height: 1.65;
    font-style: italic;
    margin-top: 20px;
    text-align: left;
}

.reveal-social-proof {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.reveal-proof-name {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    margin-bottom: 4px;
}

.reveal-proof-text {
    font-size: 14px;
    color: #666;
    line-height: 1.55;
    font-style: italic;
}

.reveal-cascade {
    font-size: 15px;
    color: #888;
    line-height: 1.65;
    text-align: left;
}

/* Tool icons in reveal 1 */
.tool-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}

.tool-icon {
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 12px;
    color: #555;
}

.y-hub-icon {
    width: 48px;
    height: 48px;
    background: #111;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    margin: 16px auto;
}

/* ===== RADAR CHART ===== */
.radar-container {
    width: 260px;
    height: 260px;
    margin: 0 auto;
}

.radar-container svg {
    width: 100%;
    height: 100%;
}

/* ===== LOADING ===== */
.loading-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 400px;
}

.bot-naming-step { width: 100%; max-width: 320px; text-align: center; }
.bot-naming-step .tf-input { margin-bottom: 20px; }
.loading-step { width: 100%; display: flex; flex-direction: column; align-items: center; }

.loader-bar {
    width: 200px;
    height: 2px;
    background: rgba(0,0,0,0.06);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loader-bar-fill {
    height: 100%;
    background: #111;
    border-radius: 2px;
    width: 0%;
}

.loader-text {
    font-size: 13px;
    color: #999;
    margin-top: 16px;
    letter-spacing: 0.3px;
    transition: opacity 0.4s ease;
}

.loader-text.swapping { opacity: 0; }

.loader-error { text-align: center; margin-top: 24px; }
.loader-error-text { font-size: 14px; color: #888; margin-bottom: 16px; }
.btn-retry { width: auto; padding: 12px 28px; margin-top: 0; }

/* Email capture within loading screen */
.email-capture {
    margin-top: 32px;
    width: 100%;
    max-width: 320px;
    animation: fadeIn 0.6s ease;
}

.email-capture-label {
    font-size: 15px;
    color: #111;
    margin-bottom: 12px;
    text-align: center;
}

.email-capture input {
    margin-bottom: 12px;
}

.email-capture .btn-begin {
    width: 100%;
}

/* ===== FORK ===== */
.fork-sub {
    font-size: 15px;
    color: #888;
    line-height: 1.6;
    margin-bottom: 32px;
}

.fork-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* ===== IMPORT (screen 29) ===== */
.import-wrap {
    width: 100%;
    max-width: 440px;
    padding: 0 0 20px;
}

.import-line {
    font-size: 17px;
    color: #111;
    line-height: 1.5;
    margin: 0;
    text-align: left;
}

.import-spacer {
    height: 16px;
}

.ai-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.ai-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 12px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Varela Round', sans-serif;
    font-weight: 500;
    text-decoration: none;
    color: #111;
    transition: border-color 0.2s;
}

.ai-btn:hover { border-color: #111; }
.ai-btn-svg { width: 20px; height: 20px; flex-shrink: 0; }

.prompt-copy-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.prompt-copy-text {
    flex: 1;
    font-size: 13px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prompt-copy-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Varela Round', sans-serif;
    color: #888;
    padding: 4px 10px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.prompt-copy-btn:hover { color: #111; border-color: #aaa; }
.prompt-copy-btn.copied { color: #2a9d5c; border-color: #2a9d5c; }

.import-paste-label {
    font-size: 14px;
    color: #aaa;
    margin-top: 8px;
    margin-bottom: 12px;
    text-align: left;
}

.import-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

#aiContextInput {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
    font-size: 14px;
}

/* ===== CHARACTER CARD ===== */
.card {
    width: 380px;
    max-width: 100%;
    border-radius: 22px;
    padding: 28px 28px 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3), 0 12px 40px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.08);
    margin: 0 auto;
    animation: sheetReveal 0.6s ease;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(115deg, transparent 0%, transparent 30%, rgba(255,255,255,0.12) 45%, rgba(255,255,255,0.03) 50%, transparent 55%, transparent 100%);
    pointer-events: none;
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.055;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    pointer-events: none;
}

.card > * { position: relative; z-index: 2; }

/* Card text — light mode */
.card .player-name { color: rgba(255,255,255,0.95); font-size: 13px; font-weight: 600; letter-spacing: 0.2px; }
.card .player-num { color: rgba(255,255,255,0.4); font-size: 11px; letter-spacing: 1px; }
.card .card-brand { color: rgba(255,255,255,0.4); font-size: 11px; letter-spacing: 1px; }
.card .archetype-name { background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.7)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: rgba(255,255,255,0.95); font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -0.5px; margin-bottom: 4px; }
.card .rising { color: rgba(255,255,255,0.4); font-size: 13px; font-style: italic; margin-bottom: 18px; }
.card .rising span { color: rgba(255,255,255,0.7); }
.card .subtitle { color: rgba(255,255,255,0.6); font-size: 14px; line-height: 1.65; font-style: italic; font-weight: 300; margin-bottom: 20px; }
.card .trait-label { color: rgba(255,255,255,0.4); font-size: 7px; letter-spacing: 3px; text-transform: uppercase; font-weight: 600; margin-bottom: 3px; }
.card .trait-value { color: rgba(255,255,255,0.95); font-size: 16px; font-weight: 400; }
.card .trait-value-blind { color: rgba(255,255,255,0.95); }
.card .stat-label { color: rgba(255,255,255,0.4); font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 500; }
.card .stat-val { color: rgba(255,255,255,0.95); font-size: 19px; font-weight: 500; }
.card .stat-bar-bg { background: rgba(255,255,255,0.1); height: 3px; border-radius: 2px; overflow: hidden; }
.card .stat-bar-fill { height: 100%; border-radius: 2px; background: rgba(255,255,255,0.6); width: 0%; transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1); }
.card .stat-bar-fill.stat-bar-high { background: rgba(255,255,255,0.9); }
.card .stat-bar-fill.stat-bar-low { background: rgba(255,255,255,0.2); }
.card .y-mark { color: rgba(255,255,255,0.06); font-size: 11px; text-align: center; margin-top: 8px; letter-spacing: 4px; font-weight: 500; }

/* Card dark text mode */
.card[data-text-mode="dark"] .player-name { color: rgba(0,0,0,0.85); }
.card[data-text-mode="dark"] .player-num { color: rgba(0,0,0,0.45); }
.card[data-text-mode="dark"] .card-brand { color: rgba(0,0,0,0.45); }
.card[data-text-mode="dark"] .archetype-name { background: none; -webkit-background-clip: unset; -webkit-text-fill-color: rgba(0,0,0,0.85); background-clip: unset; color: rgba(0,0,0,0.85); }
.card[data-text-mode="dark"] .rising { color: rgba(0,0,0,0.45); }
.card[data-text-mode="dark"] .rising span { color: rgba(0,0,0,0.65); }
.card[data-text-mode="dark"] .subtitle { color: rgba(0,0,0,0.55); }
.card[data-text-mode="dark"] .trait-label { color: rgba(0,0,0,0.45); }
.card[data-text-mode="dark"] .trait-value { color: rgba(0,0,0,0.85); }
.card[data-text-mode="dark"] .stat-label { color: rgba(0,0,0,0.45); }
.card[data-text-mode="dark"] .stat-val { color: rgba(0,0,0,0.85); }
.card[data-text-mode="dark"] .stat-bar-bg { background: rgba(0,0,0,0.1); }
.card[data-text-mode="dark"] .stat-bar-fill { background: rgba(0,0,0,0.5); }
.card[data-text-mode="dark"] .stat-bar-fill.stat-bar-high { background: rgba(0,0,0,0.7); }
.card[data-text-mode="dark"] .stat-bar-fill.stat-bar-low { background: rgba(0,0,0,0.18); }
.card[data-text-mode="dark"] .y-mark { color: rgba(0,0,0,0.06); }

.header-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; }
.traits { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin-bottom: 22px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin-bottom: 22px; }
.stat { display: flex; flex-direction: column; gap: 5px; }
.stat-top { display: flex; justify-content: space-between; align-items: baseline; }

.btn-share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    color: #999;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-top: 16px;
}

.btn-share-icon:hover { color: #111; border-color: #111; }

.card-continue-btn {
    margin-top: 20px;
    transition: opacity 0.6s ease;
}

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(6px); transition: opacity 1.6s ease, transform 1.4s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-blur { opacity: 0; filter: blur(14px); transform: translateY(6px); transition: opacity 2s ease, filter 2.2s ease, transform 1.8s ease; }
.reveal-blur.visible { opacity: 1; filter: blur(0px); transform: translateY(0); }

@keyframes sheetReveal {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Screenshot mode */
.screenshot-mode {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

.screenshot-mode .reveal,
.screenshot-mode .reveal-blur {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    transition: none !important;
}

.screenshot-mode .archetype-name {
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
}

.screenshot-mode::before,
.screenshot-mode::after {
    display: none !important;
}

/* ===== LIFE AUDIT ===== */
.audit-wrap {
    text-align: left;
}

.audit-section {
    margin-bottom: 40px;
}

.audit-heading {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 12px;
    font-weight: 600;
}

.audit-body {
    font-size: 16px;
    color: #333;
    line-height: 1.7;
}

.audit-body ul {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.audit-body ul li {
    padding: 6px 0;
    padding-left: 16px;
    position: relative;
    font-size: 15px;
    color: #555;
    line-height: 1.55;
}

.audit-body ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 13px;
    width: 6px;
    height: 6px;
    background: #ddd;
    border-radius: 50%;
}

.audit-body .audit-openclaw {
    font-size: 13px;
    color: #999;
    margin-top: 16px;
    line-height: 1.6;
}

.audit-trail {
    margin: 48px 0;
    text-align: center;
}

.audit-trail-line {
    font-size: 18px;
    color: #111;
    font-weight: 600;
    font-style: italic;
    line-height: 1.6;
}

.audit-price {
    text-align: center;
    margin-bottom: 32px;
}

.audit-price .audit-body {
    font-size: 15px;
    color: #888;
    margin-bottom: 16px;
}

.audit-price-tag {
    font-size: 28px;
    font-weight: 700;
    color: #111;
}

.audit-continue-btn {
    width: 100%;
    margin-top: 16px;
    margin-bottom: 40px;
}

/* ===== FORM ===== */
.form-bot-ready {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    margin-bottom: 12px;
}

.apply-context {
    font-size: 14px;
    color: #888;
    line-height: 1.6;
    margin-bottom: 24px;
    text-align: center;
}

.apply-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.form-field { text-align: left; }

.form-label {
    display: block;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #999;
    margin-bottom: 6px;
    font-weight: 500;
}

.btn-apply {
    width: 100%;
    padding: 14px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Varela Round', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: 6px;
}

.btn-apply:hover:not(:disabled) { opacity: 0.85; }
.btn-apply:disabled { opacity: 0.3; cursor: not-allowed; }

.apply-error { font-size: 14px; color: #c00; margin-top: 12px; text-align: center; }

/* ===== CONFIRMATION ===== */
.confirm-title { font-size: 28px; font-weight: 700; color: #111; margin-bottom: 14px; }
.confirm-sub { font-size: 14px; color: #888; line-height: 1.6; margin-bottom: 32px; }

.confirm-steps { text-align: left; margin: 0 auto; max-width: 320px; }
.confirm-step { font-size: 15px; color: #333; padding: 8px 0; letter-spacing: 0.3px; }

.manifesto-link {
    display: inline-block;
    margin-top: 28px;
    font-size: 13px;
    color: #999;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: color 0.3s;
}

.manifesto-link:hover { color: #000; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .tf-question { font-size: 19px; }
    .tf-option { padding: 13px 15px; font-size: 14px; }
    .tf-grid-option { padding: 10px 6px; font-size: 11px; }
    .domain-label { font-size: 10px; }
    .card { padding: 24px 22px 20px; border-radius: 18px; }
    .card .archetype-name { font-size: 28px; }
    .card .stat-val { font-size: 17px; }
    .bot-intro .al-line { font-size: 19px; }
    .reveal-headline { font-size: 16px; }
    .audit-trail-line { font-size: 16px; }
    .audit-price-tag { font-size: 24px; }
    .form-bot-ready { font-size: 19px; }
    .radar-container { width: 220px; height: 220px; }
}
