/* ============ RESET / BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0a0e1a;
    color: #e8edf6;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

:root {
    --primary: #2273F0;
    --primary-hover: #1860d6;
    --primary-glow: rgba(34, 115, 240, 0.35);
    --bg: #0a0e1a;
    --bg-card: #131826;
    --bg-card-hover: #1a2030;
    --border: #1f2638;
    --border-strong: #2a3447;
    --text: #e8edf6;
    --text-muted: #8a93a6;
    --text-soft: #b8c0d0;
    --success: #22c55e;
}

/* ============ TOPBAR ============ */
.topbar {
    padding: 18px 20px;
    display: flex;
    justify-content: center;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-logo {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
}

/* ============ STAGE ============ */
.stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 60px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    position: relative;
}

/* ============ SCREENS ============ */
.screen {
    display: none;
    width: 100%;
    animation: fadeIn 0.35s ease;
}
.screen.active { display: block; }
.screen-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ TYPOGRAPHY ============ */
.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(34, 115, 240, 0.15);
    color: #6ba3ff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid rgba(34, 115, 240, 0.3);
}
.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.3);
}

.headline {
    font-size: 32px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
}
.hl {
    background: linear-gradient(135deg, #2273F0 0%, #6ba3ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sub {
    font-size: 15px;
    color: var(--text-soft);
    margin: 0;
    max-width: 380px;
}

/* ============ BUTTONS ============ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 360px;
    padding: 18px 24px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #fff;
    font-size: 16.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 10px 30px var(--primary-glow), 0 2px 0 rgba(255,255,255,0.1) inset;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    margin-top: 8px;
}
.btn-primary:active { transform: translateY(1px); box-shadow: 0 6px 20px var(--primary-glow); }
@media (hover: hover) {
    .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 40px var(--primary-glow); }
}

.btn-cta {
    animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 10px 30px var(--primary-glow); }
    50% { box-shadow: 0 14px 40px rgba(34, 115, 240, 0.55); }
}

/* ============ PROGRESS ============ */
.progress-wrap {
    width: 100%;
    max-width: 480px;
    margin: 0 auto 22px;
    text-align: center;
}
.progress-track {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary) 0%, #6ba3ff 100%);
    border-radius: 999px;
    transition: width 0.4s ease;
}
.progress-text {
    display: block;
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ============ QUESTIONS ============ */
.q-title {
    font-size: 26px;
    line-height: 1.2;
    font-weight: 800;
    margin: 0 0 22px;
    letter-spacing: -0.3px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 420px;
}

.opt {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 14px;
    text-align: left;
    transition: all 0.18s ease;
}
.opt strong {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
}
.opt:active { transform: scale(0.98); }
@media (hover: hover) {
    .opt:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }
}
.opt.selected {
    border-color: var(--primary);
    background: rgba(34, 115, 240, 0.08);
    box-shadow: 0 0 0 4px rgba(34, 115, 240, 0.12);
}

.opt-emoji {
    font-size: 30px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    flex-shrink: 0;
}
.opt-color {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.08);
}
.opt-color-neutral { background: linear-gradient(135deg, #fff 0%, #fff 50%, #1a1a1a 50%, #1a1a1a 100%); }
.opt-color-bold { background: linear-gradient(135deg, #ef4444 0%, #f59e0b 50%, #2273F0 100%); }
.opt-color-special { background: linear-gradient(135deg, #c0c0c0 0%, #e8e4d0 35%, #b08d57 70%, #475569 100%); }

/* ============ SIZE GRID ============ */
.size-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 380px;
}
.size-btn {
    aspect-ratio: 1 / 1;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    transition: all 0.15s ease;
}
.size-btn:active { transform: scale(0.94); }
@media (hover: hover) {
    .size-btn:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }
}
.size-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 6px 18px var(--primary-glow);
}

/* ============ LOADING ============ */
.loading-inner { padding-top: 60px; gap: 22px; }
.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
}

/* ============ RESULT ============ */
.result-inner { padding-top: 20px; gap: 18px; }
.result-title {
    font-size: 30px;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin: 0;
}
.result-sub {
    font-size: 15px;
    color: var(--text-soft);
    margin: 0 0 8px;
    max-width: 380px;
}

/* ============ TABLET / DESKTOP ============ */
@media (min-width: 720px) {
    .topbar-logo { height: 32px; }
    .stage { padding: 64px 20px 80px; max-width: 560px; }
    .headline { font-size: 40px; }
    .sub { font-size: 16.5px; }
    .q-title { font-size: 30px; }
    .opt { padding: 20px 22px; }
    .opt strong { font-size: 19px; }
    .result-title { font-size: 34px; }
}
