/* ===== ROLEPLAY CREATOR — Styles ===== */
:root {
    --bg-deep: #0a0a1a;
    --bg-mid: #12102a;
    --bg-card: rgba(255,255,255,0.04);
    --bg-card-hover: rgba(255,255,255,0.08);
    --glass-border: rgba(255,255,255,0.08);
    --glass-blur: 18px;
    --accent-pink: #ff2d95;
    --accent-purple: #7c3aed;
    --accent-cyan: #06b6d4;
    --accent-gold: #f5c842;
    --text-primary: #f0e6ff;
    --text-muted: #8b7aa8;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Trait colors */
    --clr-infatuation: #ff69b4;
    --clr-attraction: #ff5733;
    --clr-confidence: #9b59b6;
    --clr-personality: #2ecc71;
    --clr-agreeableness: #f1c40f;
    --clr-dominance: #8e44ad;
    --clr-playfulness: #00bcd4;
    --clr-passion: #e74c3c;
}

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

html, body {
    height: 100%; width: 100%;
    font-family: var(--font-body);
    background: linear-gradient(145deg, var(--bg-deep), var(--bg-mid));
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

#particleCanvas {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

/* ===== Glass Panel ===== */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* ===== Language Toggle ===== */
.lang-toggle {
    position: fixed; top: 12px; right: 12px; z-index: 100;
    display: flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 30px;
    background: rgba(255,255,255,0.07); border: 1px solid var(--glass-border);
    color: var(--text-primary); font-family: var(--font-body);
    font-size: 13px; cursor: pointer; transition: all .3s;
    backdrop-filter: blur(12px);
}
.lang-toggle:hover { background: rgba(255,255,255,0.14); transform: scale(1.05); }
.lang-flag { font-size: 16px; }

/* ===== Screens ===== */
.screen {
    position: fixed; inset: 0; z-index: 1;
    display: flex; align-items: flex-start; justify-content: center;
    opacity: 0; pointer-events: none;
    transform: translateX(60px);
    transition: opacity .4s ease, transform .4s ease;
    overflow-y: auto; overflow-x: hidden;
    padding: 20px 16px 90px;
    -webkit-overflow-scrolling: touch;
}
.screen.active {
    opacity: 1; pointer-events: all; transform: translateX(0);
}
.screen-inner {
    width: 100%; max-width: 440px;
    display: flex; flex-direction: column; align-items: center; gap: 20px;
    padding-top: 10px;
    position: relative; z-index: 2;
}

/* ===== Typography ===== */
.main-title {
    font-family: var(--font-heading); font-size: 32px; font-weight: 800;
    text-align: center; letter-spacing: -0.5px;
}
.title-accent {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.subtitle {
    color: var(--text-muted); font-size: 14px; text-align: center; margin-top: -10px;
}
.screen-title {
    font-family: var(--font-heading); font-size: 24px; font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Character Card ===== */
.character-card {
    width: 100%; padding: 24px 20px; display: flex; flex-direction: column;
    align-items: center; gap: 22px;
}
.photo-frame {
    position: relative; width: 180px; height: 240px;
}
.character-photo {
    width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-md);
    position: relative; z-index: 2;
}
.photo-placeholder {
    width: 100%; height: 100%; border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(124,58,237,.2), rgba(255,45,149,.2));
    display: none; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; font-size: 40px; z-index: 2; position: relative;
    border: 2px dashed rgba(255,255,255,.15);
}
.photo-placeholder small { font-size: 12px; color: var(--text-muted); }
.photo-ring {
    position: absolute; inset: -4px; border-radius: calc(var(--radius-md) + 4px);
    border: 2px solid var(--accent-pink); z-index: 1;
    animation: ringPulse 3s ease-in-out infinite;
}
@keyframes ringPulse {
    0%, 100% { opacity: .4; box-shadow: 0 0 15px rgba(255,45,149,.15); }
    50% { opacity: 1; box-shadow: 0 0 30px rgba(255,45,149,.35); }
}

/* ===== Age Warning / Disclaimer Modal ===== */
.age-warning {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(10,10,26,.85);
    backdrop-filter: blur(8px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 24px;
    animation: warningFadeIn .3s ease;
}
.age-warning-box {
    background: linear-gradient(145deg, rgba(30,25,50,.9), rgba(20,15,35,.9));
    border: 1px solid rgba(255,80,50,.3);
    padding: 24px; border-radius: var(--radius-md);
    max-width: 340px; text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.age-warning-inner {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 20px; font-weight: 700; color: #ff8c42; margin-bottom: 12px;
}
.age-warning-icon { font-size: 28px; }
.age-disclaimer {
    font-size: 13px; line-height: 1.5; color: var(--text-muted); margin-bottom: 20px;
}
.btn-warning-close {
    background: rgba(255,80,50,.15); color: #ff8c42;
    border: 1px solid rgba(255,80,50,.4);
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-weight: 600; cursor: pointer; transition: all .2s;
    font-family: var(--font-heading);
}
.btn-warning-close:hover { background: rgba(255,80,50,.3); }
@keyframes warningFadeIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Form Fields ===== */
.form-fields { width: 100%; display: flex; flex-direction: column; gap: 18px; }
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label {
    font-size: 13px; font-weight: 500; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px;
    display: flex; align-items: center; gap: 8px;
}
.age-badge {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
    padding: 2px 10px; border-radius: 20px; font-size: 14px; font-weight: 700;
    color: #fff; text-transform: none; letter-spacing: 0;
}
.neon-input, .neon-select {
    width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
    color: var(--text-primary); font-family: var(--font-body); font-size: 15px;
    outline: none; transition: all .3s;
    -webkit-appearance: none; appearance: none;
}
.neon-input:focus, .neon-select:focus {
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(255,45,149,.15);
}
/* Fix #4: Select dropdown styling */
.neon-select option {
    background: #1a1035;
    color: var(--text-primary);
    padding: 8px;
}
.select-wrapper { position: relative; }
.select-arrow {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none; font-size: 14px;
}
.slider-wrapper { display: flex; flex-direction: column; gap: 4px; }
.neon-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 6px; border-radius: 3px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-pink), var(--accent-purple));
    outline: none;
}
.neon-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 24px; height: 24px; border-radius: 50%;
    background: #fff; cursor: pointer;
    box-shadow: 0 0 12px rgba(255,45,149,.5), 0 2px 8px rgba(0,0,0,.3);
    border: 3px solid var(--accent-pink); transition: transform .2s;
}
.neon-slider::-webkit-slider-thumb:active { transform: scale(1.2); }
.neon-slider::-moz-range-thumb {
    width: 24px; height: 24px; border-radius: 50%;
    background: #fff; cursor: pointer; border: 3px solid var(--accent-pink);
    box-shadow: 0 0 12px rgba(255,45,149,.5);
}
.slider-labels {
    display: flex; justify-content: space-between;
    font-size: 11px; color: var(--text-muted); padding: 0 2px;
}

/* ===== Buttons ===== */
.btn-primary, .btn-secondary {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 28px; border-radius: var(--radius-md);
    font-family: var(--font-heading); font-size: 15px; font-weight: 600;
    cursor: pointer; border: none; transition: all .3s;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
    color: #fff;
    box-shadow: 0 4px 20px rgba(255,45,149,.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(255,45,149,.4); }
.btn-primary:active { transform: scale(.97); }
.btn-secondary {
    background: rgba(255,255,255,.06); color: var(--text-primary);
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover { background: rgba(255,255,255,.12); }
.btn-arrow { font-size: 18px; }
.btn-next { width: 100%; justify-content: center; margin-top: 4px; }

/* ===== MIND BUILDER ===== */

/* Full-bleed brain background */
.mind-bg {
    position: fixed; inset: 0; z-index: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.mind-bg-img {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.3;
    filter: blur(1px) saturate(1.2);
    transition: opacity 0.4s ease;
}
.mind-bg-overlay {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, transparent 10%, var(--bg-deep) 85%);
}

/* Ambient brain glow (base style — positioned inside mind-lab) */
.brain-glow-ambient {
    width: 180px; height: 180px; border-radius: 50%;
    background: radial-gradient(circle, rgba(124,58,237,.15), transparent 70%);
    transition: all .8s ease;
    animation: brainPulse 4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes brainPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .5; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: .8; }
}

.points-counter {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 20px; border-radius: 30px;
    background: rgba(255,255,255,.06); border: 1px solid var(--glass-border);
    font-size: 14px;
}
.points-icon { font-size: 20px; }
.points-value {
    font-weight: 700; font-family: var(--font-heading);
    color: var(--accent-cyan);
}

/* Mind Lab — bottle circle container */
.mind-lab {
    position: relative; width: 340px; height: 340px;
    margin: 0 auto;
}

/* Ambient brain glow inside mind-lab */
.mind-lab .brain-glow-ambient {
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 180px; height: 180px; border-radius: 50%;
    margin: 0;
}

/* Center info display */
.mind-center-info {
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 4;
    display: flex; flex-direction: column; align-items: center;
    gap: 2px; text-align: center;
    pointer-events: none;
}
.mind-center-info.pulse {
    animation: centerPulse .35s ease;
}
@keyframes centerPulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.12); }
    100% { transform: translate(-50%, -50%) scale(1); }
}
.center-icon { font-size: 28px; }
.center-name {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .5px;
}
.center-status {
    font-size: 14px; font-weight: 700; font-family: var(--font-heading);
}

/* Bottles Ring */
.bottles-ring { position: absolute; inset: 0; }
.bottle {
    position: absolute; top: 50%; left: 50%;
    width: 68px;
    transform: translate(-50%, -50%);
    cursor: pointer; user-select: none;
    transition: transform .2s;
    z-index: 5;
    touch-action: none;
}
.bottle:active { transform: translate(-50%, -50%) scale(1.12) !important; }
.bottle-body {
    width: 100%; position: relative;
    display: flex; flex-direction: column; align-items: center;
    gap: 1px;
}
.bottle-neck {
    width: 16px; height: 7px; margin: 0 auto;
    background: rgba(255,255,255,.08);
    border: 1.5px solid rgba(255,255,255,.12);
    border-bottom: none;
    border-radius: 3px 3px 0 0;
}
.bottle-vial {
    width: 36px; height: 44px; position: relative;
    border-radius: 4px 4px 10px 10px; overflow: hidden;
    background: rgba(255,255,255,.06);
    border: 1.5px solid rgba(255,255,255,.12);
}
.bottle-fill {
    position: absolute; bottom: 0; left: 0; right: 0;
    transition: height .4s ease; border-radius: 0 0 8px 8px;
}
.bottle-trait-name {
    font-size: 8px; font-weight: 700; color: var(--text-primary);
    text-align: center; white-space: nowrap;
    text-transform: uppercase; letter-spacing: .3px;
    margin-top: 2px; line-height: 1.1;
    max-width: 68px; overflow: hidden; text-overflow: ellipsis;
}
.bottle-level-text {
    font-size: 9px; font-weight: 600;
    text-align: center; white-space: nowrap;
    line-height: 1;
}

/* Pour effect */
.pour-effects { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.pour-drop {
    position: absolute; width: 10px; height: 10px; border-radius: 50%;
    animation: pourAnim .6s ease-in forwards;
}
@keyframes pourAnim {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(.3); opacity: 0; }
}

/* Bottle shake */
.bottle-shake {
    animation: shake .4s ease !important;
}
@keyframes shake {
    0%, 100% { transform: translate(-50%, -50%) rotate(0); }
    25% { transform: translate(-50%, -50%) rotate(-6deg); }
    75% { transform: translate(-50%, -50%) rotate(6deg); }
}

/* Radar Chart standalone */
.radar-standalone {
    display: block; margin: 0 auto;
    opacity: .9;
}

/* ===== CHOICE CARDS (replaces flip cards) ===== */
.cards-title {
    font-family: var(--font-heading); font-size: 16px; font-weight: 600;
    color: var(--text-muted); text-align: center;
}
.choice-cards {
    width: 100%; display: flex; flex-direction: column; gap: 10px;
}
.choice-card {
    padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
}
.choice-question {
    font-size: 14px; font-weight: 600; text-align: center;
    color: var(--text-muted);
}
.choice-options {
    display: flex; gap: 8px;
}
.choice-btn {
    flex: 1; padding: 10px 8px; border-radius: var(--radius-sm);
    border: 1.5px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.03);
    color: var(--text-muted); font-family: var(--font-body);
    font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all .25s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.choice-btn:hover { background: rgba(255,255,255,.08); }
.choice-btn.active {
    border-color: var(--accent-pink);
    background: rgba(255,45,149,.12);
    color: var(--text-primary);
    box-shadow: 0 0 12px rgba(255,45,149,.15);
}

.mind-nav-buttons {
    display: flex; gap: 12px; width: 100%; justify-content: center;
    margin-top: 8px;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    display: flex; justify-content: center; gap: 4px;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    background: rgba(10,10,26,.85);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--glass-border);
}
.nav-tab {
    flex: 1; max-width: 120px;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 0; border: none; background: none;
    color: var(--text-muted); cursor: pointer; transition: all .3s;
    border-radius: var(--radius-sm);
}
.nav-tab.active {
    color: var(--accent-pink);
    background: rgba(255,45,149,.08);
}
.nav-icon { font-size: 20px; }
.nav-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* ===== EXPORT CARD ===== */
.export-card {
    width: 100%; max-width: 380px;
    background: #111028; border-radius: var(--radius-lg);
    border: 1px solid rgba(124,58,237,.3);
    overflow: hidden; padding-bottom: 16px;
}
.export-header {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
    padding: 14px; text-align: center;
}
.export-logo {
    font-family: var(--font-heading); font-size: 18px; font-weight: 700; color: #fff;
}
.export-body {
    display: flex; gap: 16px; padding: 16px; align-items: center;
}
.export-photo-col { flex-shrink: 0; }
.export-photo {
    width: 90px; height: 120px; object-fit: cover;
    border-radius: var(--radius-sm); border: 2px solid rgba(255,255,255,.1);
}
.export-info-col { flex: 1; }
.export-name {
    font-family: var(--font-heading); font-size: 22px; font-weight: 700;
}
.export-meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.export-traits {
    padding: 0 16px; display: flex; flex-direction: column; gap: 8px;
}
.export-trait-row {
    display: flex; align-items: center; gap: 8px;
}
.export-trait-name {
    width: 90px; font-size: 11px; text-align: right;
    color: var(--text-muted); text-transform: uppercase; font-weight: 600;
    letter-spacing: .3px; flex-shrink: 0;
}
.export-trait-bar {
    flex: 1; height: 10px; border-radius: 5px;
    background: rgba(255,255,255,.06); overflow: hidden;
}
.export-trait-fill {
    height: 100%; border-radius: 5px; transition: width .3s;
}
.export-trait-val {
    width: 20px; font-size: 12px; font-weight: 700; text-align: center;
}
.export-radar {
    display: block; margin: 12px auto;
}
.export-cards-row {
    display: flex; gap: 8px; padding: 8px 16px; justify-content: center; flex-wrap: wrap;
}
.export-card-chip {
    padding: 5px 12px; border-radius: 20px; font-size: 12px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
    display: flex; align-items: center; gap: 5px;
}
.export-footer {
    text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 8px;
}
.export-actions {
    display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 380px;
    align-items: stretch;
}
.btn-download { justify-content: center; }
.btn-back-full { width: 100%; max-width: 380px; justify-content: center; }

/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px);
    padding: 10px 24px; border-radius: 30px;
    background: rgba(124,58,237,.9); color: #fff;
    font-size: 13px; font-weight: 500; z-index: 200;
    opacity: 0; pointer-events: none; transition: all .3s;
    backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Animations ===== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ===== Desktop ===== */
@media (min-width: 600px) {
    .screen { padding: 40px 24px 100px; }
    .screen-inner { max-width: 520px; }
    .main-title { font-size: 42px; }
    .mind-lab { width: 420px; height: 420px; }
    .bottle { width: 76px; }
    .bottle-trait-name { font-size: 9px; max-width: 76px; }
    .bottle-level-text { font-size: 10px; }
    .export-card { max-width: 440px; }
}
@media (min-width: 900px) {
    .character-card { flex-direction: row; align-items: flex-start; gap: 30px; }
    .photo-frame { width: 200px; height: 280px; flex-shrink: 0; }
}
