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

:root {
    --bg: #0d0e14;
    --bg-deep: #08090d;
    --bg-elevated: #14151c;
    --bg-hover: #1a1c25;
    --bg-tint: rgba(20, 21, 28, 0.7);
    
    --line: rgba(201, 169, 97, 0.06);
    --line-strong: rgba(201, 169, 97, 0.12);
    --line-soft: rgba(255, 255, 255, 0.04);
    
    --ink-primary: rgba(244, 232, 200, 0.95);
    --ink-secondary: rgba(244, 232, 200, 0.65);
    --ink-tertiary: rgba(244, 232, 200, 0.42);
    --ink-quaternary: rgba(244, 232, 200, 0.22);
    
    --gold: #c9a961;
    --gold-bright: #e8c878;
    --gold-soft: rgba(201, 169, 97, 0.45);
    --gold-faint: rgba(201, 169, 97, 0.08);
    --gold-deep: #8b7038;
    
    --layer-1: #9b8dd6;
    --layer-2: #7a9dc7;
    --layer-3: #6ab39a;
    --layer-4: #c9a961;
    
    --layer-1-bg: rgba(155, 141, 214, 0.06);
    --layer-2-bg: rgba(122, 157, 199, 0.06);
    --layer-3-bg: rgba(106, 179, 154, 0.06);
    --layer-4-bg: rgba(201, 169, 97, 0.06);
    
    --red-soft: #d97757;
    --green-soft: #6ab39a;
    
    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 20px;
    --s6: 28px;
    --s7: 40px;
    --s8: 56px;
    
    --r-sm: 4px;
    --r-md: 6px;
    --r-lg: 12px;
    --r-pill: 999px;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
}

html { font-size: 15px; }

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    background: var(--bg);
    color: var(--ink-primary);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.005em;
}

/* ═══ BRAIN LOGO — انیمیشن CSS فقط برای aura و neuron ═══ */
.brain-aura {
    transform-origin: center;
    animation: brainAuraPulse 4s ease-in-out infinite;
}
@keyframes brainAuraPulse {
    0%, 100% { opacity: 0.2; transform: scale(0.95); }
    50% { opacity: 0.4; transform: scale(1.05); }
}
.brain-neuron {
    fill: var(--gold);
    opacity: 0.5;
    transform-origin: center;
}
.brain-neuron-mid {
    fill: var(--gold-bright);
    opacity: 0.8;
}

/* 🆕 هسته بدون انیمیشن CSS - JS کنترل می‌کنه برای تپش غیرمتقارن */
.brain-core,
.brain-core-mid,
.brain-core-outer {
    transform-origin: center;
    transform-box: fill-box;
    transition: transform 0.05s linear, opacity 0.05s linear;
}

/* نورون‌ها متناوب نورانی */
.brain-outer circle:nth-child(1) { animation: neuronFlash 8s ease-in-out infinite 0s; }
.brain-outer circle:nth-child(2) { animation: neuronFlash 8s ease-in-out infinite 0.6s; }
.brain-outer circle:nth-child(3) { animation: neuronFlash 8s ease-in-out infinite 1.2s; }
.brain-outer circle:nth-child(4) { animation: neuronFlash 8s ease-in-out infinite 1.8s; }
.brain-outer circle:nth-child(5) { animation: neuronFlash 8s ease-in-out infinite 2.4s; }
.brain-outer circle:nth-child(6) { animation: neuronFlash 8s ease-in-out infinite 3.0s; }
.brain-outer circle:nth-child(7) { animation: neuronFlash 8s ease-in-out infinite 3.6s; }
.brain-outer circle:nth-child(8) { animation: neuronFlash 8s ease-in-out infinite 4.2s; }
.brain-outer circle:nth-child(9) { animation: neuronFlash 8s ease-in-out infinite 4.8s; }
.brain-outer circle:nth-child(10) { animation: neuronFlash 8s ease-in-out infinite 5.4s; }
.brain-outer circle:nth-child(11) { animation: neuronFlash 8s ease-in-out infinite 6.0s; }
.brain-outer circle:nth-child(12) { animation: neuronFlash 8s ease-in-out infinite 6.6s; }

.brain-middle circle:nth-child(1) { animation: neuronFlashMid 6s ease-in-out infinite 0.3s; }
.brain-middle circle:nth-child(2) { animation: neuronFlashMid 6s ease-in-out infinite 1.0s; }
.brain-middle circle:nth-child(3) { animation: neuronFlashMid 6s ease-in-out infinite 1.7s; }
.brain-middle circle:nth-child(4) { animation: neuronFlashMid 6s ease-in-out infinite 2.4s; }
.brain-middle circle:nth-child(5) { animation: neuronFlashMid 6s ease-in-out infinite 3.1s; }
.brain-middle circle:nth-child(6) { animation: neuronFlashMid 6s ease-in-out infinite 3.8s; }
.brain-middle circle:nth-child(7) { animation: neuronFlashMid 6s ease-in-out infinite 4.5s; }
.brain-middle circle:nth-child(8) { animation: neuronFlashMid 6s ease-in-out infinite 5.2s; }

@keyframes neuronFlash {
    0%, 90%, 100% { opacity: 0.5; }
    5%, 10% { opacity: 1; filter: drop-shadow(0 0 6px var(--gold-bright)); }
}
@keyframes neuronFlashMid {
    0%, 92%, 100% { opacity: 0.8; }
    4%, 8% { opacity: 1; filter: drop-shadow(0 0 8px var(--gold-bright)); }
}

.logo-brain { 
    width: 32px; 
    height: 32px; 
}

/* ═══════════════════════════════════════
   LANGUAGE SCREEN
   ═══════════════════════════════════════ */
.lang-screen {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: genesisFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-screen.hidden { display: none; }
.lang-screen.fading {
    animation: genesisFadeOut 0.8s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

.lang-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.lang-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--s6);
    max-width: 600px;
    width: 100%;
    animation: genesisContentIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.lang-mark {
    width: 110px;
    height: 110px;
    margin-bottom: var(--s5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-mark svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 32px rgba(201, 169, 97, 0.25));
}

.lang-title {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 42px;
    font-weight: 300;
    letter-spacing: 0.05em;
    line-height: 1;
    margin-bottom: var(--s2);
    background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lang-subtitle {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 13px;
    font-weight: 300;
    font-style: italic;
    color: var(--ink-tertiary);
    margin-bottom: var(--s7);
    letter-spacing: 0.05em;
}

.lang-options {
    display: flex;
    gap: var(--s4);
    flex-wrap: wrap;
    justify-content: center;
}

.lang-option {
    min-width: 160px;
    padding: var(--s4) var(--s5);
    background: rgba(20, 21, 28, 0.6);
    border: 1px solid var(--gold-soft);
    border-radius: var(--r-sm);
    color: var(--ink-primary);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s1);
}

.lang-option:hover {
    background: rgba(20, 21, 28, 0.9);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 0 24px rgba(201, 169, 97, 0.15);
}

.lang-option-name {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 20px;
    font-weight: 500;
    color: var(--gold-bright);
    letter-spacing: 0.02em;
}

.lang-option-native {
    font-size: 10px;
    color: var(--ink-tertiary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════
   🆕 GENDER SCREEN
   ═══════════════════════════════════════ */
.gender-screen {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: genesisFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.gender-screen.hidden { display: none; }
.gender-screen.fading {
    animation: genesisFadeOut 0.8s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

.gender-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--s6);
    max-width: 560px;
    width: 100%;
    animation: genesisContentIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.gender-mark {
    width: 100px;
    height: 100px;
    margin-bottom: var(--s5);
}

.gender-mark svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 28px rgba(201, 169, 97, 0.25));
}

.gender-title {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 32px;
    font-weight: 300;
    color: var(--ink-primary);
    margin-bottom: var(--s2);
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.gender-subtitle {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 14px;
    font-weight: 300;
    font-style: italic;
    color: var(--ink-tertiary);
    margin-bottom: var(--s7);
    letter-spacing: 0.05em;
}

.gender-options {
    display: flex;
    gap: var(--s5);
    flex-wrap: wrap;
    justify-content: center;
}

.gender-option {
    min-width: 160px;
    padding: var(--s5) var(--s5);
    background: rgba(20, 21, 28, 0.6);
    border: 1px solid var(--gold-soft);
    border-radius: var(--r-sm);
    color: var(--gold-bright);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s3);
}

.gender-option:hover {
    background: rgba(20, 21, 28, 0.9);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 0 24px rgba(201, 169, 97, 0.15);
}

.gender-option-name {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════
   GENESIS SCREEN — کوچک‌تر و فشرده‌تر
   ═══════════════════════════════════════ */
.genesis {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: genesisFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.genesis.hidden { display: none; }

.genesis.fading {
    animation: genesisFadeOut 0.8s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

@keyframes genesisFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes genesisFadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(1.05); }
}

.genesis-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.genesis-grid {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle, var(--gold-soft) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.04;
    animation: gridFloat 60s linear infinite;
}

@keyframes gridFloat {
    from { background-position: 0 0; }
    to { background-position: 40px 40px; }
}

.genesis-vignette {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 50% 50%, rgba(201, 169, 97, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, transparent 60%, var(--bg-deep) 100%);
}

/* 🆕 محتوای genesis — فشرده‌تر، بدون اسکرول */
.genesis-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--s4);
    max-width: 560px;
    width: 100%;
    animation: genesisContentIn 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

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

.genesis-mark {
    width: 100px;
    height: 100px;
    margin-bottom: var(--s4);
    flex-shrink: 0;
}

.genesis-brain {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 28px rgba(201, 169, 97, 0.25));
}

.genesis-title {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 42px;
    font-weight: 300;
    letter-spacing: 0.02em;
    line-height: 1;
    margin-bottom: var(--s1);
    background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.genesis-subtitle {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 13px;
    font-weight: 300;
    font-style: italic;
    color: var(--ink-tertiary);
    margin-bottom: var(--s6);
    letter-spacing: 0.05em;
}

.genesis-prompt-wrap {
    width: 100%;
    margin-bottom: var(--s5);
}

.genesis-prompt {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 22px;
    font-weight: 300;
    color: var(--ink-primary);
    margin-bottom: var(--s4);
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.genesis-input-wrap {
    position: relative;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}

.genesis-input {
    width: 100%;
    background: rgba(20, 21, 28, 0.6);
    border: 1px solid var(--gold-soft);
    border-radius: var(--r-sm);
    color: var(--ink-primary);
    padding: 14px 100px 14px var(--s5);
    font-size: 16px;
    font-weight: 400;
    font-family: inherit;
    outline: none;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[dir="rtl"] .genesis-input {
    padding: 14px var(--s5) 14px 100px;
}

.genesis-input:focus {
    background: rgba(20, 21, 28, 0.85);
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold-soft), 0 0 32px rgba(201, 169, 97, 0.15);
}

.genesis-input::placeholder {
    color: var(--ink-quaternary);
    font-weight: 300;
    font-style: italic;
}

.genesis-mic {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--ink-tertiary);
    border: 1px solid var(--line-strong);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[dir="ltr"] .genesis-mic { right: 50px; }
[dir="rtl"] .genesis-mic { left: 50px; }

.genesis-mic:hover {
    color: var(--gold-bright);
    border-color: var(--gold-soft);
    background: var(--bg-elevated);
}

.genesis-mic.recording {
    background: var(--red-soft);
    border-color: var(--red-soft);
    color: white;
    animation: micPulseAnim 1.5s ease-in-out infinite;
}

@keyframes micPulseAnim {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 87, 0.6); }
    50% { box-shadow: 0 0 0 12px rgba(217, 119, 87, 0); }
}

.genesis-submit {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    background: var(--gold);
    color: var(--bg-deep);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.4;
}

[dir="ltr"] .genesis-submit { right: 10px; }
[dir="rtl"] .genesis-submit { left: 10px; }

.genesis-submit.active { 
    opacity: 1;
    box-shadow: 0 0 16px rgba(201, 169, 97, 0.4);
}

.genesis-submit:hover.active {
    transform: translateY(-50%) scale(1.05);
    background: var(--gold-bright);
}

.genesis-submit svg { width: 16px; height: 16px; stroke-width: 1.6; }
[dir="rtl"] .genesis-submit svg { transform: rotate(180deg); }

.mic-status {
    margin-top: var(--s3);
    display: inline-flex;
    align-items: center;
    gap: var(--s3);
    padding: 6px var(--s4);
    background: var(--bg-elevated);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    font-size: 11px;
    color: var(--ink-secondary);
    letter-spacing: 0.04em;
}

.mic-status.hidden { display: none; }

.mic-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red-soft);
    animation: micDotPulse 1s ease-in-out infinite;
}

@keyframes micDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.4); }
}

.genesis-hint {
    margin-top: var(--s3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    font-size: 11px;
    color: var(--ink-tertiary);
    flex-wrap: wrap;
    font-style: italic;
}

.genesis-hint-label { 
    color: var(--ink-quaternary);
    letter-spacing: 0.05em;
}

.genesis-hint-examples {
    color: var(--gold-soft);
    transition: opacity 0.5s ease;
    min-width: 180px;
    display: inline-block;
    font-weight: 400;
}

.genesis-hint-examples.fading { opacity: 0; }

.genesis-footer { 
    margin-top: var(--s5);
    padding-top: var(--s3);
    border-top: 1px solid var(--line);
    width: 100%;
    max-width: 380px;
}

.genesis-footer p {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 11px;
    font-weight: 300;
    font-style: italic;
    color: var(--ink-quaternary);
    letter-spacing: 0.04em;
}

.genesis-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    z-index: 100;
    animation: genesisFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.genesis-loading.hidden { display: none !important; }

.genesis-loading-brain {
    width: 120px;
    height: 120px;
    margin-bottom: var(--s5);
}

.genesis-loading-brain svg {
    width: 100%; 
    height: 100%;
    filter: drop-shadow(0 0 40px rgba(201, 169, 97, 0.4));
}

.genesis-loading-text {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 20px;
    font-weight: 300;
    color: var(--ink-primary);
    margin-bottom: var(--s2);
    letter-spacing: 0.01em;
    text-align: center;
    padding: 0 var(--s4);
}

.genesis-loading-text .identity-highlight {
    color: var(--gold-bright);
    font-weight: 500;
    font-style: italic;
}

.genesis-loading-detail {
    font-size: 12px;
    font-weight: 300;
    color: var(--ink-tertiary);
    text-align: center;
    max-width: 380px;
    line-height: 1.6;
    transition: opacity 0.4s ease;
    min-height: 20px;
    padding: 0 var(--s4);
    letter-spacing: 0.02em;
}

/* ═══ APP ═══ */
.app {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.app.hidden { display: none; }

.header {
    height: 64px;
    padding: 0 var(--s5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    position: relative;
    gap: var(--s4);
}

.header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--gold-soft) 50%, transparent 100%);
    opacity: 0.5;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--s3);
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-name {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 19px;
    font-weight: 400;
    color: var(--gold-bright);
    letter-spacing: 0.04em;
}

.logo-tagline {
    font-size: 10px;
    font-weight: 300;
    color: var(--ink-tertiary);
    margin-top: 2px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* 🆕 Mood Bar */
.mood-bar {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.mood-bar.hidden { display: none; }

.mood-indicator {
    display: flex;
    align-items: center;
    gap: var(--s2);
    padding: 6px var(--s4);
    background: var(--bg-elevated);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    font-size: 11px;
}

.mood-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    transition: background 0.5s ease, box-shadow 0.5s ease;
    box-shadow: 0 0 8px var(--gold);
}

.mood-label {
    color: var(--ink-secondary);
    font-size: 11px;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

/* احساسات مختلف برای Mood */
.mood-indicator[data-mood="serene"] .mood-dot { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.mood-indicator[data-mood="joyful"] .mood-dot { background: var(--gold-bright); box-shadow: 0 0 12px var(--gold-bright); }
.mood-indicator[data-mood="reflective"] .mood-dot { background: var(--layer-2); box-shadow: 0 0 8px var(--layer-2); }
.mood-indicator[data-mood="growing"] .mood-dot { background: var(--green-soft); box-shadow: 0 0 12px var(--green-soft); }
.mood-indicator[data-mood="curious"] .mood-dot { background: var(--layer-1); box-shadow: 0 0 8px var(--layer-1); }

.identity-bar {
    display: flex;
    align-items: center;
    gap: var(--s3);
    flex-shrink: 0;
}

.identity-bar.hidden { display: none; }

.identity-display {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: 6px var(--s4);
    background: var(--bg-elevated);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-sm);
}

.identity-display-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--gold-soft);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.identity-display-value {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-primary);
    font-style: italic;
}

.header-actions {
    display: flex;
    gap: var(--s1);
}

.btn-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    color: var(--ink-tertiary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-icon:hover {
    background: var(--bg-elevated);
    border-color: var(--line-strong);
    color: var(--gold-bright);
}

.btn-icon.active {
    color: var(--gold-bright);
}

.btn-icon.muted {
    color: var(--ink-quaternary);
    opacity: 0.5;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    position: relative;
}

.main:has(.map:not(.hidden)) {
    grid-template-columns: 340px 1fr 360px;
}

.panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

.panel-header {
    height: 48px;
    padding: 0 var(--s5);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid var(--line);
}

.panel-title {
    font-size: 10px;
    font-weight: 500;
    color: var(--gold-soft);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--s4) var(--s4) var(--s5);
}

.panel-details {
    border-left: 1px solid var(--line);
    order: 1;
}

.panel-details.hidden { display: none; }

.empty-state {
    text-align: center;
    color: var(--ink-quaternary);
    padding: var(--s8) var(--s4);
}

.empty-state-mark {
    width: 52px;
    height: 52px;
    margin: 0 auto var(--s4);
    border: 1px solid var(--gold-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-soft);
}

.empty-state p {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 13px;
    line-height: 1.7;
    color: var(--ink-tertiary);
    font-weight: 300;
    font-style: italic;
}

.concept-name {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 24px;
    font-weight: 400;
    color: var(--gold-bright);
    margin-bottom: var(--s2);
    line-height: 1.2;
    letter-spacing: 0.01em;
    padding: 0 var(--s2);
}

.concept-meta {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    font-size: 10px;
    font-weight: 400;
    color: var(--ink-secondary);
    margin-bottom: var(--s4);
    padding: 0 var(--s2);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.concept-meta-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.concept-block {
    margin-bottom: var(--s3);
    padding: var(--s3) var(--s4);
    border-radius: var(--r-md);
    background: var(--bg-elevated);
    border: 1px solid var(--line-strong);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.concept-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--block-color, var(--gold));
    opacity: 0.6;
}

[dir="rtl"] .concept-block::before {
    left: auto;
    right: 0;
}

.concept-block:hover {
    border-color: var(--gold-soft);
    box-shadow: var(--shadow-sm);
}

.concept-block-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: var(--s2);
    color: var(--block-color, var(--gold));
}

.concept-block-text {
    font-size: 12.5px;
    color: var(--ink-primary);
    line-height: 1.7;
    font-weight: 300;
}

.concept-block:nth-of-type(1) {
    --block-color: var(--layer-1);
    background: var(--layer-1-bg);
}
.concept-block:nth-of-type(2) {
    --block-color: var(--layer-2);
    background: var(--layer-2-bg);
}
.concept-block:nth-of-type(3) {
    --block-color: var(--layer-3);
    background: var(--layer-3-bg);
}

.concept-block-integrated {
    --block-color: var(--gold-bright) !important;
    margin-top: var(--s3) !important;
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.08) 0%, rgba(232, 200, 120, 0.04) 100%) !important;
    border-color: var(--gold-soft) !important;
    padding: var(--s4) !important;
}

.concept-block-integrated::before {
    width: 3px !important;
    background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%) !important;
    opacity: 1 !important;
}

.concept-block-integrated .concept-block-label {
    color: var(--gold-bright) !important;
}

.concept-block-integrated .concept-block-text {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--ink-primary);
    line-height: 1.7;
    font-style: italic;
}

/* ═══ MAP ═══ */
.map {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-deep);
    order: 2;
    position: relative;
}

.map.hidden { display: none; }

.map-canvas {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.layout-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 50% 50%, rgba(201, 169, 97, 0.025) 0%, transparent 60%),
        var(--bg-deep);
}

.layout-canvas.hidden { display: none; }

.layout-selector {
    position: absolute;
    top: var(--s4);
    left: var(--s4);
    z-index: 11;
    display: flex;
    gap: 2px;
    padding: 4px;
    background: rgba(13, 14, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
}

[dir="rtl"] .layout-selector {
    left: auto;
    right: var(--s4);
}

.layout-btn {
    width: 32px; 
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--r-sm);
    color: var(--ink-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.layout-btn:hover {
    color: var(--gold-bright);
    background: var(--bg-elevated);
}

.layout-btn.active {
    background: var(--gold);
    color: var(--bg-deep);
    box-shadow: 0 0 16px rgba(201, 169, 97, 0.3);
}

.map-controls {
    position: absolute;
    bottom: var(--s8);
    left: var(--s4);
    z-index: 10;
    display: flex;
    gap: 2px;
    padding: 3px;
    background: rgba(13, 14, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-sm);
}

[dir="rtl"] .map-controls {
    left: auto;
    right: var(--s4);
}

.map-controls.hidden { display: none; }

.map-tab {
    background: transparent;
    border: none;
    color: var(--ink-tertiary);
    padding: 6px 14px;
    border-radius: var(--r-pill);
    cursor: pointer;
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    letter-spacing: 0.05em;
}

.map-tab:hover { color: var(--ink-secondary); }

.map-tab.active {
    background: var(--gold);
    color: var(--bg-deep);
}

.three-controls {
    position: absolute;
    top: var(--s4);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    padding: var(--s2) var(--s4);
    background: rgba(13, 14, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    font-size: 11px;
    color: var(--ink-tertiary);
    pointer-events: none;
    box-shadow: var(--shadow-sm);
    animation: hintFade 6s ease-out forwards;
    letter-spacing: 0.03em;
}

.three-controls.hidden { display: none; }

@keyframes hintFade {
    0%, 60% { opacity: 1; }
    100% { opacity: 0; }
}

.legend {
    position: absolute;
    bottom: var(--s4);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: var(--s4);
    padding: var(--s2) var(--s4);
    background: rgba(13, 14, 20, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--s2);
    font-size: 10.5px;
    color: var(--ink-secondary);
    font-weight: 400;
    white-space: nowrap;
    letter-spacing: 0.04em;
}

.legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--c);
    box-shadow: 0 0 8px var(--c);
    flex-shrink: 0;
}

.legend-num {
    color: var(--gold-soft);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.legend-divider {
    width: 1px;
    height: 12px;
    background: var(--line-strong);
}

.three-tooltip {
    position: absolute;
    background: var(--bg-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--gold-soft);
    border-radius: var(--r-sm);
    padding: var(--s3) var(--s4);
    font-size: 13px;
    color: var(--ink-primary);
    pointer-events: none;
    z-index: 100;
    max-width: 240px;
    line-height: 1.5;
    transform: translate(-50%, -100%);
    margin-top: -12px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: opacity 0.15s ease;
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    font-style: italic;
}

.three-tooltip.visible { opacity: 1; }

/* ═══ CHAT ═══ */
.panel-chat {
    border-right: 1px solid var(--line);
    order: 3;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--s4);
}

.messages {
    display: flex;
    flex-direction: column;
    gap: var(--s5);
}

.message {
    display: flex;
    flex-direction: column;
    animation: messageIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.msg-author {
    font-size: 9px;
    font-weight: 600;
    color: var(--gold-soft);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: var(--s2);
    display: flex;
    align-items: center;
    gap: var(--s2);
}

/* 🆕 دکمه پخش صدا روی پیام */
.msg-tts-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--ink-tertiary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-inline-start: var(--s1);
}

.msg-tts-btn:hover {
    color: var(--gold-bright);
    border-color: var(--gold-soft);
    background: var(--bg-elevated);
}

.msg-tts-btn.playing {
    color: var(--gold-bright);
    border-color: var(--gold);
    background: var(--gold-faint);
    animation: ttsPulse 1.5s ease-in-out infinite;
}

@keyframes ttsPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 169, 97, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(201, 169, 97, 0); }
}

.msg-tts-btn svg {
    width: 11px;
    height: 11px;
}

.message.user-message .msg-author {
    text-align: end;
    color: var(--ink-quaternary);
    justify-content: flex-end;
}

.msg-content {
    color: var(--ink-primary);
    line-height: 1.85;
    word-wrap: break-word;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 0.005em;
}

.message.user-message .msg-content {
    padding: var(--s3) var(--s4);
    background: var(--bg-elevated);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    margin-inline-start: var(--s7);
    box-shadow: var(--shadow-sm);
}

.msg-content h1, .msg-content h2, .msg-content h3 {
    font-family: 'Cormorant Garamond', 'Vazirmatn', serif;
    margin: var(--s3) 0 var(--s2);
    font-weight: 500;
    color: var(--gold-bright);
}

.msg-content h1 { font-size: 19px; }
.msg-content h2 { font-size: 17px; }
.msg-content h3 { font-size: 15px; }

.msg-content p { margin: var(--s2) 0; }

.msg-content strong { 
    font-weight: 500; 
    color: var(--gold-bright); 
}

.msg-content em {
    color: var(--gold-soft);
    font-style: italic;
}

.msg-content ul, .msg-content ol {
    margin: var(--s2) 0;
    padding-inline-start: var(--s5);
}

.msg-content li { margin: var(--s1) 0; }

.msg-content code {
    background: var(--bg-elevated);
    border: 1px solid var(--line-strong);
    padding: 2px 6px;
    border-radius: var(--r-sm);
    font-family: 'SF Mono', monospace;
    font-size: 12px;
    color: var(--gold-bright);
    direction: ltr;
}

.typing {
    display: flex;
    align-items: center;
    gap: var(--s3);
    margin-top: var(--s4);
}

.typing.hidden { display: none; }

.typing-author {
    font-size: 9px;
    font-weight: 600;
    color: var(--gold-soft);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 5px;
    height: 5px;
    background: var(--gold-soft);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

.chat-input {
    padding: var(--s3) var(--s4);
    background: var(--bg);
    border-top: 1px solid var(--line);
    flex-shrink: 0;
}

.chat-input-inner {
    display: flex;
    gap: var(--s2);
    align-items: flex-end;
    background: var(--bg-elevated);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    padding: var(--s2);
    transition: all 0.25s ease;
}

.chat-input-inner:focus-within {
    border-color: var(--gold-soft);
    box-shadow: 0 0 0 1px var(--gold-faint), 0 0 24px rgba(201, 169, 97, 0.08);
}

#messageInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--ink-primary);
    padding: var(--s2) var(--s3);
    font-size: 14px;
    resize: none;
    outline: none;
    font-family: inherit;
    max-height: 120px;
    line-height: 1.6;
    font-weight: 300;
}

#messageInput::placeholder {
    color: var(--ink-tertiary);
    font-weight: 300;
    font-style: italic;
}

.btn-mic {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--ink-tertiary);
    border: 1px solid var(--line-strong);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-mic:hover {
    color: var(--gold-bright);
    border-color: var(--gold-soft);
    background: var(--bg-hover);
}

.btn-mic.recording {
    background: var(--red-soft);
    border-color: var(--red-soft);
    color: white;
    animation: micPulseAnim 1.5s ease-in-out infinite;
}

.btn-mic svg {
    width: 16px;
    height: 16px;
}

.btn-send {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    background: var(--gold);
    color: var(--bg-deep);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-send:hover { 
    transform: scale(1.05); 
    background: var(--gold-bright);
    box-shadow: 0 0 16px rgba(201, 169, 97, 0.3);
}

.btn-send:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.btn-send svg { width: 14px; height: 14px; }
[dir="rtl"] .btn-send svg { transform: rotate(180deg); }

.continue-btn-wrap {
    margin-top: var(--s3);
    animation: messageIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.continue-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s2) var(--s4);
    background: var(--bg-elevated);
    border: 1px solid var(--gold-soft);
    border-radius: var(--r-pill);
    color: var(--gold-bright);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.04em;
}

.continue-btn:hover {
    background: var(--gold-faint);
    border-color: var(--gold);
    transform: translateY(-1px);
}

.continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.continue-btn svg { width: 14px; height: 14px; }
[dir="rtl"] .continue-btn svg { transform: rotate(180deg); }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-soft); }

@media (max-width: 1100px) {
    .main:has(.map:not(.hidden)) {
        grid-template-columns: 1fr;
        grid-template-rows: 220px 1fr 220px;
    }
    .legend { gap: var(--s3); padding: var(--s2) var(--s3); }
    .legend-item { font-size: 10px; }
    .mood-bar { display: none; }
}

@media (max-width: 640px) {
    .header { padding: 0 var(--s3); height: 56px; }
    .identity-display-label { display: none; }
    .genesis-content { padding: var(--s3); }
    .genesis-title { font-size: 36px; }
    .genesis-prompt { font-size: 17px; }
    .genesis-input { font-size: 15px; }
    .genesis-mark { width: 80px; height: 80px; }
    .lang-options, .gender-options { flex-direction: column; }
    .lang-option, .gender-option { min-width: 220px; }
}

/* صفحه‌های کوچک ارتفاع کم */
@media (max-height: 700px) {
    .genesis-mark { width: 80px; height: 80px; margin-bottom: var(--s3); }
    .genesis-title { font-size: 36px; }
    .genesis-subtitle { margin-bottom: var(--s5); }
    .genesis-prompt { font-size: 19px; margin-bottom: var(--s3); }
    .genesis-prompt-wrap { margin-bottom: var(--s4); }
    .genesis-footer { margin-top: var(--s4); padding-top: var(--s2); }
}

/* ═══════════════════════════════════════════════════════════════
   Selfa Happiness Panel — Phase 3
   این بخش به انتهای style.css اضافه می‌شه
   استفاده از CSS variables موجود برای هماهنگی با سایت
═══════════════════════════════════════════════════════════════ */

/* moodBar حالا قابل کلیکه */
.mood-bar {
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mood-bar:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

/* اضافه کردن یه نشانه‌ی کوچک که قابل کلیکه */
.mood-bar::after {
    content: 'ⓘ';
    font-size: 0.7em;
    opacity: 0.5;
    margin-right: 6px;
    vertical-align: middle;
}

/* رنگ‌های جدید برای حالت‌های happiness — ادغام با moods قدیمی */
/* (استفاده از همون متغیرهای رنگ موجود) */

/* ═══════════════════════════════════════════════════════════════
   Happiness Panel Modal
═══════════════════════════════════════════════════════════════ */

.happiness-panel {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: auto;
    animation: happinessPanelFadeIn 0.25s ease-out;
}

.happiness-panel.hidden {
    display: none;
}

.happiness-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 9, 13, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.happiness-panel-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-elevated, #14151c);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 32px 28px 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    animation: happinessPanelSlideUp 0.3s ease-out;
}

@keyframes happinessPanelFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.happiness-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.happiness-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.happiness-header {
    text-align: center;
    margin-bottom: 24px;
}

.happiness-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 6px;
    color: rgba(255, 255, 255, 0.95);
}

.happiness-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Orb (دایره مرکزی)
═══════════════════════════════════════════════════════════════ */

.happiness-orb-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 28px;
}

.happiness-orb {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.orb-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 6;
}

.orb-progress {
    fill: none;
    stroke: var(--gold, #d4af37);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 534;
    stroke-dashoffset: 534;
    transition: stroke-dashoffset 1.2s ease, stroke 0.5s ease;
    filter: drop-shadow(0 0 8px var(--gold, #d4af37));
}

.orb-glow {
    fill: var(--gold, #d4af37);
    opacity: 0.08;
    transition: fill 0.5s ease, opacity 0.5s ease;
}

/* رنگ‌های orb بر اساس مود */
.happiness-panel[data-mood="serene"] .orb-progress { stroke: var(--gold, #d4af37); filter: drop-shadow(0 0 12px var(--gold, #d4af37)); }
.happiness-panel[data-mood="serene"] .orb-glow { fill: var(--gold, #d4af37); opacity: 0.12; }

.happiness-panel[data-mood="joyful"] .orb-progress { stroke: var(--gold-bright, #f0c850); filter: drop-shadow(0 0 14px var(--gold-bright, #f0c850)); }
.happiness-panel[data-mood="joyful"] .orb-glow { fill: var(--gold-bright, #f0c850); opacity: 0.14; }

.happiness-panel[data-mood="growing"] .orb-progress { stroke: var(--green-soft, #4ade80); filter: drop-shadow(0 0 12px var(--green-soft, #4ade80)); }
.happiness-panel[data-mood="growing"] .orb-glow { fill: var(--green-soft, #4ade80); opacity: 0.12; }

.happiness-panel[data-mood="reflective"] .orb-progress { stroke: var(--layer-2, #60a5fa); filter: drop-shadow(0 0 10px var(--layer-2, #60a5fa)); }
.happiness-panel[data-mood="reflective"] .orb-glow { fill: var(--layer-2, #60a5fa); opacity: 0.10; }

.happiness-panel[data-mood="curious"] .orb-progress { stroke: var(--layer-1, #a78bfa); filter: drop-shadow(0 0 10px var(--layer-1, #a78bfa)); }
.happiness-panel[data-mood="curious"] .orb-glow { fill: var(--layer-1, #a78bfa); opacity: 0.10; }

.happiness-orb-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.orb-value {
    font-size: 2.6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1;
    direction: ltr;
}

.orb-caption {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════════
   Bars (شاخص‌های inner و outer)
═══════════════════════════════════════════════════════════════ */

.happiness-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
}

.happiness-bar-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bar-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bar-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.bar-value {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    direction: ltr;
}

.bar-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 1s ease;
}

.bar-fill-inner {
    background: linear-gradient(90deg, rgba(167, 139, 250, 0.7), rgba(167, 139, 250, 1));
}

.bar-fill-outer {
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.7), rgba(96, 165, 250, 1));
}

/* ═══════════════════════════════════════════════════════════════
   Reflection (متن کیفی)
═══════════════════════════════════════════════════════════════ */

.happiness-reflection {
    background: rgba(255, 255, 255, 0.03);
    border-right: 3px solid var(--gold, #d4af37);
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 22px;
    transition: border-color 0.5s ease;
}

.happiness-panel[data-mood="growing"] .happiness-reflection { border-right-color: var(--green-soft, #4ade80); }
.happiness-panel[data-mood="reflective"] .happiness-reflection { border-right-color: var(--layer-2, #60a5fa); }
.happiness-panel[data-mood="curious"] .happiness-reflection { border-right-color: var(--layer-1, #a78bfa); }

.reflection-quote {
    font-size: 0.92rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   Trend Chart (نمودار روند)
═══════════════════════════════════════════════════════════════ */

.happiness-trend {
    margin-bottom: 18px;
    width: 100%;
}

.trend-header {
    margin-bottom: 8px;
}

.trend-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ─── Phase G.3 — Trend chart: 3 lines + grid + legend ─── */
.trend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.trend-legend {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.legend-happiness .legend-dot {
    background: #d4af37; /* gold */
}

.legend-inner .legend-dot {
    background: #6ea8fe; /* soft blue */
}

.legend-outer .legend-dot {
    background: #b388ff; /* soft purple */
}

.trend-chart {
    width: 100%;
    min-width: 100%;
    height: 220px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    display: block;
    box-sizing: border-box;
}

/* ─── Grid lines ─── */
.trend-grid-line {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 0.5;
    stroke-dasharray: 2, 2;
    vector-effect: non-scaling-stroke;
}

.trend-grid-label {
    fill: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    font-family: inherit;
}

/* ─── Three lines ─── */
.trend-line {
    fill: none;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.trend-line-happiness {
    stroke: #d4af37; /* gold */
    opacity: 0.95;
}

.trend-line-inner {
    stroke: #6ea8fe; /* soft blue */
    opacity: 0.85;
}

.trend-line-outer {
    stroke: #b388ff; /* soft purple */
    opacity: 0.85;
}

/* ─── Deep-review markers (هر ۵-تا یه marker بزرگ‌تر) ─── */
.trend-deep-marker {
    fill: rgba(212, 175, 55, 0.0);
    stroke: rgba(255, 255, 255, 0.45);
    stroke-width: 1;
}

.trend-deep-marker-inner {
    fill: rgba(110, 168, 254, 0.9);
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 1;
}

.trend-deep-marker-outer {
    fill: rgba(179, 136, 255, 0.9);
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 1;
}

.trend-deep-marker-happiness {
    fill: rgba(212, 175, 55, 0.95);
    stroke: rgba(255, 255, 255, 0.7);
    stroke-width: 1.2;
}

/* ─── small dots for last samples ─── */
.trend-dot {
    fill: var(--gold, #d4af37);
    opacity: 0.6;
}

.trend-dot-inner {
    fill: #6ea8fe;
    opacity: 0.7;
}

.trend-dot-outer {
    fill: #b388ff;
    opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════
   Footer
═══════════════════════════════════════════════════════════════ */

.happiness-footer {
    text-align: center;
    margin-top: 8px;
}

.footer-note {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════
   Responsive
═══════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .happiness-panel-content {
        padding: 24px 18px 18px;
        max-width: 100%;
    }

    .happiness-orb-container {
        width: 160px;
        height: 160px;
    }

    .orb-value {
        font-size: 2.2rem;
    }

    /* Phase G.3.2 — smaller chart on mobile */
    .trend-chart {
        height: 180px;
    }

    .trend-legend {
        gap: 8px;
    }

    .legend-item {
        font-size: 0.65rem;
    }
}



/* ═══════════════════════════════════════════════════════════════
   Phase Pulse — لوگوی تپنده برای moodDot
   ─────────────────────────────────────
   به جای یه نقطه‌ی ساده، یه نسخه‌ی کوچک‌شده‌ی لوگوی سلفا (شبکه‌ی
   مفهومی ۴ لایه) که نفس می‌کشه و رنگش بر اساس happiness عوض می‌شه.
   ═══════════════════════════════════════════════════════════════ */

.mood-dot-svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    animation: selfaPulse 2.6s ease-in-out infinite;
    transition: filter 0.5s ease, opacity 0.5s ease;
    transform-origin: center center;
}

/* تپش آروم — مثل نفس کشیدن */
@keyframes selfaPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.92;
    }
    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

/* hover state: یکم بیشتر می‌درخشه */
.mood-bar:hover .mood-dot-svg {
    filter: brightness(1.2) drop-shadow(0 0 6px currentColor);
    animation-duration: 1.8s; /* تپش سریع‌تر هنگام hover */
}

/* ═══ رنگ‌گذاری بر اساس مود ═══ */
/* لوگوی پایه طلایی هست؛ با hue-rotate و brightness رنگش رو عوض می‌کنیم */

/* serene = طلایی آروم (پیش‌فرض، بدون تغییر) */
.mood-indicator[data-mood="serene"] .mood-dot-svg {
    filter: hue-rotate(0deg) saturate(1.0) drop-shadow(0 0 4px var(--gold, #d4af37));
}

/* joyful = طلایی روشن، شادتر */
.mood-indicator[data-mood="joyful"] .mood-dot-svg {
    filter: hue-rotate(10deg) saturate(1.3) brightness(1.15) drop-shadow(0 0 6px var(--gold-bright, #f0c850));
}

/* growing = سبز (در حال رشد) */
.mood-indicator[data-mood="growing"] .mood-dot-svg {
    filter: hue-rotate(75deg) saturate(1.1) drop-shadow(0 0 5px var(--green-soft, #4ade80));
}

/* reflective = آبی (در حال تأمل) */
.mood-indicator[data-mood="reflective"] .mood-dot-svg {
    filter: hue-rotate(180deg) saturate(0.9) drop-shadow(0 0 4px var(--layer-2, #60a5fa));
}

/* curious = بنفش (در حال جستجو) */
.mood-indicator[data-mood="curious"] .mood-dot-svg {
    filter: hue-rotate(220deg) saturate(1.0) drop-shadow(0 0 5px var(--layer-1, #a78bfa));
}

/* Responsive — در موبایل کمی کوچیک‌تر */
@media (max-width: 480px) {
    .mood-dot-svg {
        width: 20px;
        height: 20px;
    }
}


/* ═══════════════════════════════════════════════════════════════
   Phase F.2 — Login Modal Styles
   شاعرانه و گرم، با روح سلفا
   ═══════════════════════════════════════════════════════════════ */

.login-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease;
}

.login-modal.hidden {
    display: none !important;
}

.login-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.login-modal-content {
    position: relative;
    z-index: 1;
    width: min(440px, calc(100% - 40px));
    padding: 48px 32px;
    background: linear-gradient(
        135deg,
        rgba(15, 15, 20, 0.95) 0%,
        rgba(25, 22, 30, 0.95) 100%
    );
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(212, 175, 55, 0.08);
    text-align: center;
    animation: loginRise 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Logo */
.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    animation: loginPulse 3s ease-in-out infinite;
}

@keyframes loginPulse {
    0%, 100% { transform: scale(1); opacity: 0.95; }
    50%      { transform: scale(1.05); opacity: 1; }
}

.login-logo svg {
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.4));
}

/* Title */
.login-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--gold, #d4af37);
    margin: 0 0 12px 0;
    letter-spacing: 2px;
}

/* Poetic subtitle */
.login-poetic {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 auto 32px auto;
    max-width: 320px;
    font-style: italic;
}

/* Divider */
.login-divider {
    height: 1px;
    background: linear-gradient(
        to left,
        transparent 0%,
        rgba(212, 175, 55, 0.2) 50%,
        transparent 100%
    );
    margin: 0 auto 24px auto;
    max-width: 200px;
}

/* Google button */
.login-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.95);
    color: #1f1f1f;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.login-google-btn:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

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

.login-google-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* "Or" divider */
.login-or {
    margin: 20px 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    position: relative;
}

.login-or::before,
.login-or::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 24px);
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.login-or::before { right: 0; }
.login-or::after  { left:  0; }

/* Email section */
.login-email-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-email-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-family: inherit;
    direction: ltr;
    text-align: center;
    transition: all 0.25s ease;
}

.login-email-input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.login-email-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    text-align: right;
}

.login-magic-btn {
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    color: var(--gold, #d4af37);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
}

.login-magic-btn:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.7);
}

.login-magic-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status message */
.login-status {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    animation: statusFade 0.3s ease;
}

.login-status.hidden {
    display: none;
}

.login-status.success {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.login-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.login-status.loading {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold, #d4af37);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

@keyframes statusFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .login-modal-content {
        padding: 36px 24px;
    }
    .login-title {
        font-size: 28px;
    }
    .login-poetic {
        font-size: 14px;
    }
}


/* Phase F.2.1 — Logout Button */
.logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 4px;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.logout-btn:active {
    transform: scale(0.95);
}

.logout-btn svg {
    pointer-events: none;
}


/* Phase F.2.4 — User Email Badge */
.user-email-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
    padding: 4px 10px;
    margin: 0 6px;
    letter-spacing: 0.3px;
    user-select: text;
    direction: ltr;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.user-email-badge:hover {
    color: rgba(255, 255, 255, 0.6);
}

/* ═══════════════════════════════════════════════════════════════
   Phase F.4 — Slot Selector Panel
   پنل انتخاب slot هویت بعد از login
   با همان سبک Login Modal: gradient تیره، طلایی، breathing animations
   ═══════════════════════════════════════════════════════════════ */

.slot-selector {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease;
}

.slot-selector.hidden {
    display: none !important;
}

.slot-selector-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.slot-selector-content {
    position: relative;
    z-index: 1;
    width: min(720px, calc(100% - 40px));
    padding: 48px 32px;
    background: linear-gradient(
        135deg,
        rgba(15, 15, 20, 0.95) 0%,
        rgba(25, 22, 30, 0.95) 100%
    );
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(212, 175, 55, 0.08);
    text-align: center;
    animation: loginRise 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.slot-selector-header {
    margin-bottom: 32px;
}

.slot-selector-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    animation: loginPulse 3s ease-in-out infinite;
}

.slot-selector-logo svg {
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.4));
}

.slot-selector-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--gold, #d4af37);
    margin: 0 0 12px 0;
    letter-spacing: 1.5px;
}

.slot-selector-subtitle {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 auto;
    max-width: 380px;
    font-style: italic;
}

.slot-selector-divider {
    height: 1px;
    background: linear-gradient(
        to left,
        transparent 0%,
        rgba(212, 175, 55, 0.2) 50%,
        transparent 100%
    );
    margin: 0 auto 32px auto;
    max-width: 280px;
}

/* Cards container */
.slot-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* Single card */
.slot-card {
    position: relative;
    padding: 28px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 18px;
    transition: all 0.3s ease;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
}

.slot-card:hover {
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.slot-card.empty {
    border-style: dashed;
}

.slot-card.locked {
    opacity: 0.85;
}

.slot-card-number {
    font-size: 12px;
    color: rgba(212, 175, 55, 0.6);
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.slot-card-icon {
    font-size: 32px;
    margin-bottom: 12px;
    color: rgba(212, 175, 55, 0.5);
}

.slot-card-empty-text {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    font-style: italic;
    margin: 8px 0 16px 0;
}

.slot-card-identity {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.6;
    margin: 8px 0 12px 0;
    /* Truncate to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 80px;
}

.slot-card-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
}

.slot-card-changes {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.slot-card-locked-badge {
    color: rgba(212, 175, 55, 0.7);
    background: rgba(212, 175, 55, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

/* Card actions */
.slot-card-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slot-card-btn {
    width: 100%;
    padding: 11px 18px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
}

.slot-card-btn.primary {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.9), rgba(212, 175, 55, 1));
    color: #1a1a1a;
}

.slot-card-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.25);
}

.slot-card-btn.secondary {
    background: transparent;
    color: var(--gold, #d4af37);
    border: 1px solid rgba(212, 175, 55, 0.4);
}

.slot-card-btn.secondary:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.7);
}

.slot-card-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Footer with logout */
.slot-selector-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

.slot-selector-logout {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.slot-selector-logout:hover {
    color: rgba(212, 175, 55, 0.8);
}

/* Confirmation modal for "change identity" warning */
.slot-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.slot-confirm-modal.hidden {
    display: none !important;
}

.slot-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.slot-confirm-content {
    position: relative;
    z-index: 1;
    width: min(440px, calc(100% - 40px));
    padding: 36px 28px;
    background: linear-gradient(135deg, rgba(20, 18, 25, 0.97), rgba(30, 25, 35, 0.97));
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    text-align: center;
    animation: loginRise 0.4s ease;
}

.slot-confirm-title {
    color: var(--gold, #d4af37);
    font-size: 18px;
    margin: 0 0 16px 0;
    font-weight: 600;
}

.slot-confirm-message {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.7;
    margin: 0 0 12px 0;
}

.slot-confirm-counter {
    color: rgba(212, 175, 55, 0.8);
    font-size: 13px;
    margin: 0 0 24px 0;
    font-style: italic;
}

.slot-confirm-actions {
    display: flex;
    gap: 12px;
}

.slot-confirm-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 11px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
}

.slot-confirm-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.slot-confirm-cancel:hover {
    background: rgba(255, 255, 255, 0.08);
}

.slot-confirm-proceed {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

.slot-confirm-proceed:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .slot-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .slot-selector-content {
        padding: 36px 20px;
    }
    .slot-selector-title {
        font-size: 24px;
    }
    .slot-card {
        min-height: 180px;
    }
}


/* ════════════════════════════════════════════════════ */
/* Phase Usage Ring — progress ring around settings gear */
/* ════════════════════════════════════════════════════ */
.settings-with-ring {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
}

.usage-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.usage-ring-progress {
    transition: stroke-dashoffset 0.6s ease, stroke 0.3s ease;
}

/* Ring color states */
.usage-ring-progress.usage-good {
    stroke: #4ade80; /* green */
}
.usage-ring-progress.usage-warn {
    stroke: #fbbf24; /* yellow */
}
.usage-ring-progress.usage-low {
    stroke: #f87171; /* red */
}
.usage-ring-progress.usage-paid {
    stroke: #d4af37; /* gold */
}
.usage-ring-progress.usage-loading {
    stroke: rgba(255,255,255,0.2);
}

/* Pulse animation when usage is exhausted — STRONGER red glow */
@keyframes usage-pulse-strong {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
        filter: drop-shadow(0 0 4px rgba(248, 113, 113, 0.8));
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.08);
        filter: drop-shadow(0 0 10px rgba(248, 113, 113, 1));
    }
}

@keyframes usage-ring-flash {
    0%, 100% { stroke: #f87171; stroke-opacity: 1; }
    50% { stroke: #dc2626; stroke-opacity: 0.6; }
}

.settings-with-ring.usage-exhausted {
    animation: usage-pulse-strong 1.2s ease-in-out infinite;
}

.settings-with-ring.usage-exhausted .usage-ring-progress {
    stroke: #f87171 !important;
    stroke-width: 2.5 !important;
    animation: usage-ring-flash 1.2s ease-in-out infinite;
}

.settings-with-ring.usage-exhausted .usage-ring-bg {
    stroke: rgba(248, 113, 113, 0.3) !important;
}

.settings-gear-svg {
    position: relative;
    z-index: 2;
}


/* ════════════════════════════════════════════════════ */
/* Phase Admin Gate — toggleMapBtn visibility control   */
/* ════════════════════════════════════════════════════ */
.admin-only-btn {
    display: none !important;
}
.admin-only-btn.admin-unlocked {
    display: inline-flex !important;
}
