:root {
    --bg: #0d0d0f;
    --surface: #141418;
    --border: #2a2a35;
    --accent: #5865f2;
    --accent2: #eb459e;
    --accent3: #fee75c;
    --text: #e8e8f0;
    --muted: #6b6b80;
    --glow: rgba(88, 101, 242, 0.4);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Space Mono', monospace;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Animated grid background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(88,101,242,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(88,101,242,0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gridMove {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

/* Glowing orb */
body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(88,101,242,0.12) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50%       { opacity: 1;   transform: translate(-50%, -50%) scale(1.1); }
}

/* ── Layout ── */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
}

.logo {
    font-family: 'Bebas Neue', cursive;
    font-size: clamp(2.5rem, 8vw, 5rem);
    letter-spacing: 0.05em;
    line-height: 1;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeSlideIn 0.6s ease both;
}

.tagline {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 3rem;
    animation: fadeSlideIn 0.6s 0.1s ease both;
}

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

/* ── Card ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2.5rem;
    position: relative;
    animation: fadeSlideIn 0.6s 0.2s ease both;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
}

/* ── Typography helpers ── */
.label {
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
}

.question {
    font-family: 'Bebas Neue', cursive;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    letter-spacing: 0.04em;
    line-height: 1.1;
    margin-bottom: 2rem;
    color: var(--text);
}

.question span { color: var(--accent2); }

/* ── Form elements ── */
input[type="text"] {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text);
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
    padding: 1rem 1.25rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--glow);
}

input[type="text"]::placeholder { color: var(--muted); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.85rem 1.75rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn:hover {
    background: #4752c4;
    box-shadow: 0 0 20px var(--glow);
    transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

/* ── Choice buttons ── */
.choices {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.choice-btn {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text);
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    padding: 1.1rem 1.5rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.choice-btn::after {
    content: '→';
    position: absolute;
    right: 1.25rem;
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.2s;
    color: var(--accent);
}

.choice-btn:hover {
    border-color: var(--accent);
    background: rgba(88,101,242,0.08);
    box-shadow: 0 0 0 1px var(--accent);
    padding-right: 3rem;
}

.choice-btn:hover::after { opacity: 1; transform: translateX(0); }
.choice-btn:hover .num   { background: var(--accent); color: #fff; }

.num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 3px;
    background: var(--border);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.2s;
}

/* Stagger animations */
.choice-btn:nth-child(1) { animation: fadeSlideIn 0.5s 0.1s ease both; }
.choice-btn:nth-child(2) { animation: fadeSlideIn 0.5s 0.2s ease both; }
.choice-btn:nth-child(3) { animation: fadeSlideIn 0.5s 0.3s ease both; }
.choice-btn:nth-child(4) { animation: fadeSlideIn 0.5s 0.4s ease both; }

/* ── Results ── */
.result-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    border-left: 3px solid var(--accent2);
    animation: fadeSlideIn 0.5s ease both;
}

.result-label {
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent2);
    margin-bottom: 0.75rem;
}

.result-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text);
}

.result-text strong { color: var(--accent3); font-weight: 700; }

.result-text .big {
    display: block;
    font-family: 'Bebas Neue', cursive;
    font-size: 3rem;
    letter-spacing: 0.05em;
    color: var(--accent2);
    line-height: 1;
    margin: 0.5rem 0;
}

/* ── Back link ── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    margin-top: 2rem;
    transition: color 0.2s;
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'Space Mono', monospace;
}

.back-link:hover { color: var(--text); }

/* ── Name badge ── */
.name-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(88,101,242,0.15);
    border: 1px solid rgba(88,101,242,0.3);
    border-radius: 100px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
}

.avatar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3ba55c;
    flex-shrink: 0;
}

/* ── Misc ── */
.emoji-big {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
}

.step-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

/* ── Loading overlay ── */
#loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
}

#loading-overlay.active {
    display: flex;
    animation: fadeSlideIn 0.3s ease both;
}

.loader-spinner {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-right-color: var(--accent2);
    animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#loading-text {
    font-family: 'Space Mono', monospace;
    font-size: clamp(1rem, 3vw, 1.4rem);
    color: var(--text);
    text-align: center;
    max-width: 480px;
    padding: 0 2rem;
    min-height: 3em;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    transition: opacity 0.25s ease;
}

#loading-text.fade-out { opacity: 0; }

.loading-dots span {
    display: inline-block;
    animation: blink 1.2s infinite;
    font-size: 1.5em;
    line-height: 1;
    color: var(--accent);
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 80%, 100% { opacity: 0.15; }
    40%            { opacity: 1; }
}

.loading-bar-wrap {
    width: 280px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 2px;
    transition: width 0.8s ease;
}
