/* ═══════════════════════════════════════════════════
   🎨 MCU WATCHLIST — Main Styles
   ═══════════════════════════════════════════════════ */

@font-face {
    font-family: 'IRANSans';
    src: url('./Iranian_Sans.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-color: #07070c;
    --bg-radial: radial-gradient(ellipse at top, #16112b 0%, #07070c 55%);
    --text-color: #f5f5f7;
    --subtext-color: #8b8b9a;
    --item-bg: rgba(22, 22, 34, 0.55);
    --item-bg-hover: rgba(34, 34, 52, 0.75);
    --item-border: rgba(255, 255, 255, 0.08);
    --item-border-hover: rgba(255, 255, 255, 0.2);
    --popover-bg: rgba(14, 14, 24, 0.98);
    --progress-wrapper-bg: linear-gradient(135deg, rgba(24, 24, 40, 0.75) 0%, rgba(10, 10, 18, 0.92) 100%);
    --btn-bg: rgba(255, 255, 255, 0.04);
    --btn-border: rgba(255, 255, 255, 0.1);
    --phase-color: #fbbf24;
    --phase-glow: rgba(251, 191, 36, 0.4);
    --imdb-color: #f5c518;
    --user-color: #c084fc;
    --user-glow: rgba(192, 132, 252, 0.3);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --online-color: #34d399;
}

[data-theme="light"] {
    --bg-color: #f5f7fb;
    --bg-radial: radial-gradient(ellipse at top, #e0e7ff 0%, #f5f7fb 55%);
    --text-color: #0f172a;
    --subtext-color: #64748b;
    --item-bg: rgba(255, 255, 255, 0.85);
    --item-bg-hover: rgba(255, 255, 255, 1);
    --item-border: rgba(15, 23, 42, 0.08);
    --item-border-hover: rgba(15, 23, 42, 0.18);
    --popover-bg: rgba(255, 255, 255, 0.98);
    --progress-wrapper-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 244, 251, 0.95) 100%);
    --btn-bg: rgba(15, 23, 42, 0.04);
    --btn-border: rgba(15, 23, 42, 0.1);
    --phase-color: #b45309;
    --phase-glow: rgba(180, 83, 9, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #fbbf24 0%, #ff3838 100%);
    border-radius: 10px;
    border: 2px solid var(--bg-color);
}

body {
    font-family: 'IRANSans', Tahoma, -apple-system, sans-serif;
    background: var(--bg-color);
    background-image: var(--bg-radial);
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    padding: 24px 32px 20px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    transition: background 0.5s ease, color 0.4s ease;
    padding-top: max(24px, env(safe-area-inset-top));
    direction: ltr;
    text-align: left;
}

.bg-particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-particle {
    position: absolute; width: 2px; height: 2px; background: #fbbf24;
    border-radius: 50%; box-shadow: 0 0 8px #fbbf24;
    animation: driftUp linear infinite; opacity: 0;
}
@keyframes driftUp {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 0.9; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-10vh) scale(0.5); opacity: 0; }
}
.bg-particle:nth-child(3n) { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }
.bg-particle:nth-child(3n+1) { background: #c084fc; box-shadow: 0 0 8px #c084fc; }
.bg-particle:nth-child(3n+2) { background: #34d399; box-shadow: 0 0 8px #34d399; }

.modern-icon {
    width: 16px; height: 16px; fill: none; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0; transition: all 0.3s ease;
}

.container { max-width: 1200px; width: 100%; position: relative; z-index: 1; flex-grow: 1; }

/* ═══ Header ═══ */
.header {
    text-align: center; margin-bottom: 32px;
    position: relative; padding: 16px 0; min-height: 150px;
}
.header-logo-wrap { display: inline-block; padding: 0 60px; }
.header h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800; letter-spacing: 3px;
    background: linear-gradient(120deg, #ff3838 0%, #fbbf24 35%, #c084fc 65%, #3b82f6 100%);
    background-size: 300% auto;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    animation: shineText 6s linear infinite;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.25));
}
@keyframes shineText {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.header h1::after {
    content: ''; display: block; height: 2px; margin-top: 12px;
    background: linear-gradient(90deg, transparent, #fbbf24, #ff3838, #fbbf24, transparent);
    background-size: 200% auto;
    animation: lineShine 3s linear infinite;
    border-radius: 2px; box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
}
@keyframes lineShine {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
.header-subtitle-wrap { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; }
.header-subtitle {
    display: inline-block; color: var(--subtext-color); font-size: 0.85rem;
    padding: 6px 16px; background: var(--btn-bg); border: 1px solid var(--btn-border);
    border-radius: 999px; backdrop-filter: blur(10px);
    letter-spacing: 1px; font-weight: 500; direction: rtl;
}
.subtitle-translate-btn {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--btn-bg); border: 1px solid var(--btn-border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; padding: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.subtitle-translate-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981; transform: scale(1.15);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}
.subtitle-translate-btn .modern-icon { width: 15px; height: 15px; stroke: #34d399; }
.subtitle-translate-btn.active {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.6);
}
.subtitle-translate-btn.active .modern-icon { stroke: #000; }

.header-btn {
    position: absolute; top: 16px;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--btn-bg); border: 1px solid var(--btn-border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; overflow: visible; padding: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 50;
}
.header-btn::before {
    content: ''; position: absolute; inset: -4px; border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, var(--glow-color, #fbbf24), transparent 40%);
    opacity: 0; transition: opacity 0.4s ease; z-index: -1; filter: blur(6px);
}
.header-btn:hover::before { opacity: 0.7; animation: pulseGlow 2s ease-in-out infinite; }
@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 0.9; }
}
.header-btn:hover {
    transform: scale(1.12) translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px var(--glow-color, #fbbf24);
    border-color: var(--glow-color, #fbbf24);
}
.header-btn:active { transform: scale(0.95); }

.theme-toggle-btn { left: 0; --glow-color: #fbbf24; }
.theme-toggle-btn:hover {
    border-color: var(--phase-color);
    box-shadow: 0 0 25px var(--phase-glow), 0 8px 25px rgba(0, 0, 0, 0.4);
}
.lang-toggle-btn { left: 60px; --glow-color: #10b981; }
.lang-toggle-btn .modern-icon { width: 22px; height: 22px; stroke: #34d399; }
.lang-toggle-btn.active {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.6);
}
.lang-toggle-btn.active .modern-icon { stroke: #000; }

.theme-icon-box {
    position: relative; width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.theme-icon-box svg {
    position: absolute; top: 0; left: 0; width: 24px; height: 24px;
    fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    transition: opacity 0.3s ease, transform 0.5s ease;
}
.icon-sun { stroke: #fbbf24; opacity: 0; transform: scale(0) rotate(-90deg); }
.icon-moon { stroke: #60a5fa; opacity: 1; transform: scale(1) rotate(0deg); }
[data-theme="light"] .icon-sun { opacity: 1; transform: scale(1) rotate(0deg); }
[data-theme="light"] .icon-moon { opacity: 0; transform: scale(0) rotate(90deg); }

@media (max-width: 750px) {
    .header { min-height: auto; padding-top: 0; }
    .header-btn {
        position: relative; top: 0; display: inline-flex;
        margin: 0 4px 12px; left: auto !important; right: auto !important;
    }
}

/* ═══ RTL overrides ═══ */
.item-content .title-text, .market-card-title, .market-card-label, .market-card-change,
.header-subtitle, .footer-brand, .footer-visits, .chart-popup-title, .lang-native,
.rating-label, .modal-box h3, .phase-info, .phase-title-text, .phase-subtitle-text,
.phase-progress-label, .user-rate-popup h3, .user-rate-popup .urp-subtitle {
    direction: rtl; text-align: right;
}
.item { direction: ltr; }
.item .item-content { direction: ltr; text-align: left; }
.item .item-content .title-text { direction: ltr; text-align: left; }
.item .meta-group { direction: ltr; }

/* ═══ Ad Slots ═══ */
.ad-slot {
    width: 100%; max-width: 1200px; margin: 30px auto; padding: 0 8px;
    display: flex; justify-content: center; align-items: center;
    position: relative; z-index: 1; animation: adFadeIn 0.6s ease;
}
@keyframes adFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
.ad-slot::before {
    content: 'Ad'; position: absolute; top: -8px; right: 12px;
    font-size: 0.55rem; font-weight: 800; color: var(--subtext-color);
    background: var(--item-bg); border: 1px solid var(--item-border);
    padding: 2px 8px; border-radius: 999px; letter-spacing: 1.5px;
    text-transform: uppercase; z-index: 3; backdrop-filter: blur(10px);
}
.ad-slot > div, .ad-slot > a { width: 100%; display: flex; justify-content: center; }
.ad-slot img { max-width: 100%; height: auto; display: block; border-radius: 12px; }

@keyframes pulseText { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes slideSubtitle { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }
@keyframes pulseButton { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes pulseArrow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(3px, -3px) scale(1.15); }
}
@keyframes pulseIcon {
    0%, 100% { transform: scale(1); box-shadow: 0 6px 20px rgba(251, 191, 36, 0.45); }
    50% { transform: scale(1.05); box-shadow: 0 8px 25px rgba(251, 191, 36, 0.65); }
}

@media (max-width: 750px) {
    .ad-slot { margin: 20px auto; padding: 0 4px; }
    .ad-slot.ad-hero > div > a > div { padding: 18px 16px !important; }
    .ad-slot.ad-hero div[style*="font-size: 26px"] { font-size: 20px !important; }
    .ad-slot.ad-hero div[style*="font-size: 20px"] {
        font-size: 14px !important; white-space: normal !important; animation: none !important;
    }
}

/* ═══ Market Widgets ═══ */
.market-widgets {
    display: flex; gap: 16px; margin: 24px auto; max-width: 1200px;
    width: 100%; position: relative; z-index: 1;
}
.market-card {
    flex: 1; background: var(--item-bg); border: 1px solid var(--item-border);
    border-radius: var(--radius-lg); padding: 20px 22px;
    backdrop-filter: blur(20px); position: relative; overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer; user-select: none; direction: rtl;
}
.market-card-sparkline {
    position: absolute; left: 0 !important; right: auto !important;
    top: 0; bottom: 0; width: 55%; opacity: 0.25;
    pointer-events: none; z-index: 0;
    mask-image: linear-gradient(to left, transparent 0%, black 50%, black 100%);
    -webkit-mask-image: linear-gradient(to left, transparent 0%, black 50%, black 100%);
    transition: opacity 0.5s ease;
}
.market-card:hover .market-card-sparkline { opacity: 0.4; }
.market-card-sparkline svg { width: 100%; height: 100%; }
.market-card > *:not(.market-card-sparkline) { position: relative; z-index: 1; }
.market-card::before {
    content: ''; position: absolute; inset: 0; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, transparent 50%);
    opacity: 0; transition: opacity 0.4s ease; pointer-events: none; z-index: 0;
}
.market-card:hover {
    transform: translateY(-4px); border-color: var(--phase-color);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 25px var(--phase-glow);
}
.market-card:hover::before { opacity: 1; }
.market-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px; direction: rtl;
}
.market-card-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.85rem; font-weight: 800; color: var(--text-color);
    letter-spacing: 0.5px; direction: rtl;
}
.market-card-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.market-card-icon.dollar { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35); }
.market-card-icon.brent { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35); }
.market-card-icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.market-card-header-right { display: flex; align-items: center; gap: 8px; direction: ltr; }
.market-card-header-right .market-card-menu { order: -1; }
.market-card-menu {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--btn-bg); border: 1px solid var(--btn-border);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; cursor: pointer; flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.market-card-menu:hover {
    background: rgba(251, 191, 36, 0.15); border-color: var(--phase-color);
    transform: scale(1.12); box-shadow: 0 0 15px var(--phase-glow);
}
.market-card-menu span {
    display: block; width: 14px; height: 2px;
    background: var(--phase-color); border-radius: 2px; transition: all 0.3s ease;
}
.market-card-label {
    font-size: 0.65rem; color: var(--subtext-color); font-weight: 600;
    letter-spacing: 1px; text-transform: uppercase; margin-bottom: 2px;
    direction: ltr; text-align: right;
}
.market-card-value {
    font-size: 1.5rem; font-weight: 900; color: var(--text-color);
    font-variant-numeric: tabular-nums; line-height: 1.2;
    margin-bottom: 4px; direction: rtl; text-align: right;
}
.market-card-value.dollar-value { color: #10b981; }
.market-card-value.brent-value { color: #f59e0b; }
.market-card-change {
    font-size: 0.75rem; font-weight: 700;
    font-variant-numeric: tabular-nums; direction: rtl; text-align: right;
}
.market-card-change.up { color: #10b981; }
.market-card-change.down { color: #ef4444; }

.online-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--online-color); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    animation: onlinePulse 2s infinite; margin-inline-start: 6px; vertical-align: middle;
}
.online-dot.offline { background: #6b7280; animation: none; box-shadow: 0 0 6px rgba(107, 114, 128, 0.6); }
@keyframes onlinePulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.live-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.6rem; font-weight: 800; color: var(--online-color);
    padding: 3px 8px; background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3); border-radius: 999px;
    letter-spacing: 0.5px; text-transform: uppercase; direction: ltr;
    transition: all 0.3s ease;
}
.live-badge.offline {
    color: #6b7280; background: rgba(107, 114, 128, 0.1);
    border-color: rgba(107, 114, 128, 0.3);
}
.live-badge .online-dot { margin: 0; width: 6px; height: 6px; }

/* ═══ Chart Popups ═══ */
.chart-popup {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%; max-width: 700px;
    background: var(--popover-bg); border: 1px solid var(--item-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
    z-index: 99999999; display: none; opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); overflow: hidden;
}
.chart-popup.show { display: block; opacity: 1; transform: translate(-50%, -50%) scale(1); }
.chart-popup-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; border-bottom: 1px solid var(--item-border);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.05), transparent);
}
.chart-popup-title {
    display: flex; align-items: center; gap: 12px;
    font-size: 1rem; font-weight: 800; color: var(--text-color);
}
.chart-popup-title .modern-icon { width: 20px; height: 20px; stroke: var(--phase-color); }
.chart-popup-close {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--btn-bg); border: 1px solid var(--btn-border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.chart-popup-close:hover {
    background: rgba(239, 68, 68, 0.15); border-color: #ef4444;
    transform: scale(1.12); box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}
.chart-popup-close:hover .modern-icon { stroke: #ef4444; }
.chart-popup-close .modern-icon { stroke: var(--subtext-color); }
.chart-popup-body { padding: 20px; }
.chart-popup-chart {
    width: 100%; height: 280px; background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md); overflow: hidden; position: relative;
}
.chart-popup-chart svg { width: 100%; height: 100%; }
.chart-popup-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.chart-stat {
    background: var(--btn-bg); border: 1px solid var(--btn-border);
    border-radius: 12px; padding: 12px; text-align: center;
}
.chart-stat-label {
    font-size: 0.65rem; color: var(--subtext-color); font-weight: 700;
    margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.chart-stat-value {
    font-size: 1rem; font-weight: 800; color: var(--text-color);
    font-variant-numeric: tabular-nums;
}
.chart-popup-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px); z-index: 99999998;
    display: none; opacity: 0; transition: opacity 0.3s ease;
}
.chart-popup-overlay.show { display: block; opacity: 1; }

@media (max-width: 750px) {
    .market-widgets { flex-direction: column; }
    .chart-popup { width: 95%; }
    .chart-popup-chart { height: 220px; }
    .chart-popup-stats { grid-template-columns: 1fr; }
}

/* ═══ Phase Card ═══ */
.phase-card {
    position: relative; margin: 48px 0 28px 0;
    grid-column: 1 / -1; perspective: 1200px;
    cursor: pointer; user-select: none;
}
.phase-card-inner {
    position: relative; padding: 24px 32px; border-radius: 24px;
    background: linear-gradient(135deg, rgba(30, 25, 50, 0.95) 0%, rgba(20, 18, 40, 0.98) 50%, rgba(15, 12, 30, 0.95) 100%);
    border: 1px solid rgba(251, 191, 36, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform-style: preserve-3d;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden; min-height: 120px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
[data-theme="light"] .phase-card-inner {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 247, 251, 0.98) 50%, rgba(255, 255, 255, 0.95) 100%);
    border-color: rgba(180, 83, 9, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.phase-card-inner::before {
    content: ''; position: absolute; inset: 0; border-radius: 24px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.25) 0%, rgba(255, 56, 56, 0.25) 25%, rgba(192, 132, 252, 0.25) 50%, rgba(59, 130, 246, 0.25) 75%, rgba(52, 211, 153, 0.25) 100%);
    background-size: 300% 300%;
    animation: multiColorPulse 5s ease-in-out infinite;
    z-index: 0; pointer-events: none; opacity: 0.9;
}
@keyframes multiColorPulse {
    0% { background-position: 0% 50%; opacity: 0.7; filter: blur(10px); }
    25% { background-position: 50% 0%; opacity: 0.95; filter: blur(15px); }
    50% { background-position: 100% 50%; opacity: 1; filter: blur(18px); }
    75% { background-position: 50% 100%; opacity: 0.95; filter: blur(15px); }
    100% { background-position: 0% 50%; opacity: 0.7; filter: blur(10px); }
}
.phase-card-inner::after {
    content: ''; position: absolute; inset: -3px; border-radius: 27px;
    background: transparent; z-index: -1;
    animation: outerPulseGlow 3s ease-in-out infinite; pointer-events: none;
}
@keyframes outerPulseGlow {
    0%, 100% { box-shadow: 0 0 0px rgba(251, 191, 36, 0), 0 0 0px rgba(192, 132, 252, 0); }
    50% { box-shadow: 0 0 25px rgba(251, 191, 36, 0.5), 0 0 50px rgba(192, 132, 252, 0.35); }
}
.phase-card:hover .phase-card-inner {
    transform: rotateX(-2deg) rotateY(-1deg) translateY(-4px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.phase-content { display: flex; align-items: center; gap: 20px; z-index: 3; position: relative; flex-grow: 1; }
.phase-number {
    font-size: 3rem; font-weight: 900;
    background: linear-gradient(135deg, #fbbf24, #ff3838);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1; letter-spacing: -2px;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.4));
    animation: numberPulse 3s ease-in-out infinite;
}
@keyframes numberPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.phase-info { display: flex; flex-direction: column; gap: 6px; }
.phase-title-text {
    font-size: 1.5rem; font-weight: 800; color: var(--phase-color);
    letter-spacing: 1.5px; text-shadow: 0 0 20px var(--phase-glow);
}
.phase-subtitle-text { font-size: 0.85rem; color: var(--subtext-color); font-weight: 600; letter-spacing: 0.5px; }
.phase-progress-wrap {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 8px; z-index: 3; position: relative; min-width: 120px;
}
.phase-progress-label { font-size: 0.75rem; color: var(--subtext-color); font-weight: 700; letter-spacing: 0.5px; }
.phase-progress-bar {
    width: 100px; height: 6px; background: rgba(0, 0, 0, 0.4);
    border-radius: 999px; overflow: hidden; position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}
.phase-progress-fill {
    height: 100%; background: linear-gradient(90deg, #fbbf24, #ff3838);
    border-radius: 999px;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.6); position: relative;
}
.phase-progress-fill::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmerPhase 2s infinite;
}
@keyframes shimmerPhase {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.phase-progress-value {
    font-size: 0.95rem; font-weight: 800; color: var(--phase-color);
    font-variant-numeric: tabular-nums; text-shadow: 0 0 10px var(--phase-glow);
}
.phase-card.flipping .phase-card-inner { animation: pageFlip 0.7s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pageFlip {
    0% { transform: rotateY(0) scale(1); }
    30% { transform: rotateY(-15deg) scale(0.98); opacity: 0.8; }
    60% { transform: rotateY(10deg) scale(1.01); opacity: 0.9; }
    100% { transform: rotateY(0) scale(1); }
}
.leaf-particle {
    position: fixed; width: 10px; height: 10px;
    pointer-events: none; z-index: 99999;
    border-radius: 50% 0 50% 0; opacity: 0;
    animation: leafFall 2s ease-in forwards;
}
@keyframes leafFall {
    0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg) scale(0.3); opacity: 0; }
}

.checkerboard-popover {
    background-color: var(--popover-bg);
    background-image:
        linear-gradient(45deg, rgba(128, 128, 128, 0.06) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(128, 128, 128, 0.06) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(128, 128, 128, 0.06) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(128, 128, 128, 0.06) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    backdrop-filter: blur(24px);
}

/* ═══ Progress Box ═══ */
.progress-box-wrapper {
    position: sticky; top: 16px; z-index: 50;
    margin-bottom: 40px; background: var(--progress-wrapper-bg);
    padding: 18px 22px; border-radius: 32px;
    border: 1px solid var(--item-border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); overflow: hidden;
}
.progress-box-wrapper::before {
    content: ''; position: absolute; inset: 0; border-radius: 32px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(59, 130, 246, 0.2) 25%, rgba(139, 92, 246, 0.2) 50%, rgba(236, 72, 153, 0.2) 75%, rgba(16, 185, 129, 0.2) 100%);
    background-size: 300% 300%;
    animation: multiColorPulseProgress 4s ease-in-out infinite;
    z-index: 0; pointer-events: none; opacity: 0.9;
}
@keyframes multiColorPulseProgress {
    0% { background-position: 0% 50%; filter: blur(15px); opacity: 0.7; }
    50% { background-position: 100% 50%; filter: blur(22px); opacity: 1; }
    100% { background-position: 0% 50%; filter: blur(15px); opacity: 0.7; }
}
.progress-box-wrapper::after {
    content: ''; position: absolute; inset: -3px; border-radius: 35px;
    background: transparent; z-index: -1;
    animation: outerPulseProgress 3s ease-in-out infinite; pointer-events: none;
}
@keyframes outerPulseProgress {
    0%, 100% { box-shadow: 0 0 0px rgba(251, 191, 36, 0), 0 0 0px rgba(139, 92, 246, 0), 0 0 0px rgba(16, 185, 129, 0); }
    33% { box-shadow: 0 0 30px rgba(251, 191, 36, 0.5), 0 0 50px rgba(139, 92, 246, 0.3); }
    66% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.5), 0 0 50px rgba(16, 185, 129, 0.3); }
}
.progress-box-wrapper.on-fire {
    border-color: #ff3838 !important;
    animation: boxFirePulse 1.4s infinite alternate ease-in-out;
}
@keyframes boxFirePulse {
    0% { box-shadow: 0 0 30px rgba(255, 56, 56, 0.4), 0 0 60px rgba(255, 118, 0, 0.25); }
    100% { box-shadow: 0 0 55px rgba(255, 56, 56, 0.7), 0 0 110px rgba(255, 177, 66, 0.5); }
}
.progress-box { display: flex; align-items: center; gap: 18px; position: relative; z-index: 2; }
.progress-bar-wrapper {
    flex-grow: 1; background-color: rgba(0, 0, 0, 0.4);
    border-radius: 999px; height: 18px; overflow: hidden;
    position: relative; border: 1px solid var(--item-border);
}
[data-theme="light"] .progress-bar-wrapper { background-color: rgba(15, 23, 42, 0.08); }
.progress-fill {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899, #fbbf24, #10b981);
    background-size: 400% 100%; height: 100%; width: 0%;
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    animation: neonGradient 6s linear infinite;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.6); position: relative;
}
.progress-fill::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: shimmerLine 2.5s infinite;
}
@keyframes neonGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes shimmerLine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.global-reset-btn {
    background: var(--btn-bg); border: 1px solid var(--btn-border);
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative; z-index: 3;
}
.global-reset-btn:hover {
    background: rgba(239, 68, 68, 0.15); border-color: #ef4444;
    transform: scale(1.12); box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}
.global-reset-btn:hover .modern-icon { stroke: #ef4444; }
.global-reset-btn .modern-icon { width: 20px; height: 20px; stroke: var(--phase-color); }

/* ═══ Modal Overlay ═══ */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    display: none; justify-content: center; align-items: flex-start;
    z-index: 9999999; animation: modalFadeIn 0.3s ease;
    padding: 100px 20px 40px 20px; overflow-y: auto;
}
.modal-overlay.show { display: flex; }
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
    background: var(--popover-bg); border: 1px solid var(--item-border);
    padding: 28px; border-radius: var(--radius-lg);
    width: 100%; max-width: 420px; text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    position: relative; margin: auto;
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-box.wide { max-width: 760px; text-align: left; }
@keyframes modalSlideUp {
    from { transform: translateY(20px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-box::before {
    content: ''; position: absolute; inset: -1px;
    border-radius: var(--radius-lg); padding: 1px;
    background: linear-gradient(135deg, #ff3838, #fbbf24, #3b82f6);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0.5; pointer-events: none;
}
.modal-translate-btn {
    position: absolute; top: 14px; right: 14px;
    background: var(--btn-bg); border: 1px solid var(--btn-border);
    padding: 4px; border-radius: 12px;
    cursor: pointer; height: 32px; width: 32px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease;
}
.modal-translate-btn.active { background: var(--phase-color); }
.modal-translate-btn.active .modern-icon { stroke: #000; }
.modal-translate-btn .modern-icon { stroke: var(--phase-color); }
.modal-box h3 { margin-top: 24px; font-size: 1.05rem; margin-bottom: 24px; font-weight: 700; line-height: 1.6; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }
.modal-btn {
    flex: 1; padding: 12px 20px; border-radius: 12px;
    font-weight: 700; cursor: pointer; border: none;
    font-size: 0.9rem; font-family: inherit; transition: all 0.3s ease;
}
.modal-btn:hover { transform: translateY(-2px); }
.modal-btn-yes { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.modal-btn-no { background: var(--btn-bg); color: var(--text-color); border: 1px solid var(--item-border); }

/* ═══ Language Modal ═══ */
.lang-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.lang-modal-header h2 {
    font-size: 1.2rem; font-weight: 800;
    background: linear-gradient(120deg, #60a5fa, #c084fc);
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.lang-list {
    display: flex; flex-direction: column;
    gap: 8px; max-height: 60vh; overflow-y: auto;
    padding-inline-end: 4px;
}
.lang-option {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px; background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 14px; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: inherit; color: var(--text-color);
    font-size: 0.9rem; font-weight: 600;
    text-align: start; position: relative; direction: rtl;
}
.lang-option:hover {
    transform: translateX(-4px);
    border-color: var(--phase-color);
    box-shadow: 0 0 20px var(--phase-glow);
}
.lang-option.active {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(255, 56, 56, 0.1));
    border-color: var(--phase-color);
}
.lang-option.active::after {
    content: '✓'; position: absolute;
    left: 18px; top: 50%; transform: translateY(-50%);
    font-size: 1.2rem; color: var(--phase-color); font-weight: 900;
}
.lang-flag { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.lang-info { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; text-align: right; }
.lang-native { font-size: 0.95rem; font-weight: 800; }
.lang-english { font-size: 0.72rem; color: var(--subtext-color); font-weight: 500; }
.lang-badge-soon {
    font-size: 0.62rem; font-weight: 800;
    padding: 3px 8px; border-radius: 999px;
    background: rgba(128, 128, 128, 0.2);
    color: var(--subtext-color); text-transform: uppercase;
}
.lang-option.disabled { opacity: 0.5; cursor: not-allowed; }
.lang-option.disabled:hover { transform: none; border-color: var(--btn-border); box-shadow: none; }

/* ═══ Stats Modal ═══ */
.stats-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; direction: ltr; }
.stats-header h2 {
    font-size: 1.4rem; font-weight: 800;
    background: linear-gradient(120deg, #60a5fa, #c084fc, #fbbf24);
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex; align-items: center; gap: 10px;
}
.stats-header h2 .modern-icon { width: 26px; height: 26px; stroke: #c084fc; }
.stats-close-btn {
    background: var(--btn-bg); border: 1px solid var(--btn-border);
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stats-close-btn:hover {
    background: rgba(239, 68, 68, 0.15); border-color: #ef4444;
    transform: scale(1.12); box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}
.stats-close-btn:hover .modern-icon { stroke: #ef4444; }
.stats-close-btn .modern-icon { stroke: var(--subtext-color); }
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stats-card {
    background: var(--item-bg); border: 1px solid var(--item-border);
    border-radius: var(--radius-md); padding: 16px 14px;
    position: relative; overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    direction: ltr; text-align: left;
}
.stats-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--card-color), transparent);
}
.stats-card::after {
    content: ''; position: absolute; top: -30%; right: -30%;
    width: 80%; height: 80%;
    background: radial-gradient(circle, var(--card-color) 0%, transparent 70%);
    opacity: 0.08; pointer-events: none; transition: opacity 0.4s ease;
}
.stats-card:hover {
    transform: translateY(-4px); border-color: var(--card-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px var(--card-color);
}
.stats-card:hover::after { opacity: 0.2; }
.stats-card-icon {
    width: 42px; height: 42px; border-radius: 12px;
    background: linear-gradient(135deg, var(--card-color), color-mix(in srgb, var(--card-color) 60%, #000));
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 10px; position: relative;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px color-mix(in srgb, var(--card-color) 40%, transparent);
}
.stats-card:hover .stats-card-icon {
    box-shadow: 0 6px 25px var(--card-color);
    transform: scale(1.05);
}
.stats-card-icon .modern-icon { width: 20px; height: 20px; stroke: #fff; }
.stats-card-value {
    font-size: 1.7rem; font-weight: 900;
    color: var(--text-color); line-height: 1;
    margin-bottom: 6px; font-variant-numeric: tabular-nums;
}
.stats-card-label { font-size: 0.72rem; color: var(--subtext-color); font-weight: 700; letter-spacing: 0.3px; }
.stats-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 600px) { .stats-charts { grid-template-columns: 1fr; } }
.stats-chart-box {
    background: var(--item-bg); border: 1px solid var(--item-border);
    border-radius: var(--radius-md); padding: 18px; direction: ltr;
}
.stats-chart-title {
    font-size: 0.8rem; font-weight: 800; color: var(--text-color);
    margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.stats-chart-title .modern-icon { width: 16px; height: 16px; stroke: var(--phase-color); }
.donut-chart { display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; }
.donut-svg { width: 140px; height: 140px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.legend-item {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.78rem; font-weight: 600;
    padding: 6px 10px; border-radius: 8px;
    background: var(--btn-bg); transition: all 0.3s ease;
}
.legend-item:hover { background: rgba(128, 128, 128, 0.15); transform: translateX(3px); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; box-shadow: 0 0 8px currentColor; }
.legend-value { color: var(--text-color); margin-inline-start: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label {
    font-size: 0.72rem; font-weight: 700; color: var(--subtext-color);
    min-width: 60px; text-align: left;
    display: flex; align-items: center; gap: 4px; justify-content: flex-start;
}
.bar-track {
    flex-grow: 1; background: rgba(128, 128, 128, 0.15);
    height: 10px; border-radius: 999px; overflow: hidden;
    position: relative; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}
.bar-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, #fbbf24, #ff3838);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.bar-fill::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmerLine 2s infinite;
}
.bar-value {
    font-size: 0.72rem; font-weight: 800; color: var(--text-color);
    min-width: 60px; text-align: left; font-variant-numeric: tabular-nums;
}
.top-rated-list { max-height: 300px; overflow-y: auto; padding-inline-end: 4px; }
.top-rated-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; background: var(--btn-bg);
    border-radius: 12px; margin-bottom: 6px; font-size: 0.78rem;
    transition: all 0.3s ease; border: 1px solid transparent;
}
.top-rated-row:hover {
    background: rgba(128, 128, 128, 0.12);
    border-color: var(--btn-border); transform: translateX(3px);
}
.top-rated-rank {
    font-weight: 900; color: var(--phase-color); min-width: 30px;
    font-size: 0.8rem; text-align: center;
    background: rgba(251, 191, 36, 0.15); border-radius: 6px; padding: 3px 6px;
}
.top-rated-title {
    flex-grow: 1; font-weight: 600; color: var(--text-color);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ═══ IMDb & User Rating Badges ═══ */
.imdb-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: linear-gradient(135deg, var(--imdb-color), #d4a512);
    color: #000; padding: 3px 8px 3px 4px;
    border-radius: 6px; font-weight: 900; font-size: 0.7rem;
    box-shadow: 0 2px 8px rgba(245, 197, 24, 0.25);
    flex-shrink: 0; direction: ltr;
}
.imdb-badge svg { width: 24px; height: 12px; flex-shrink: 0; }
.imdb-badge svg rect { fill: #000; }
.imdb-badge svg text { fill: var(--imdb-color); font-family: Arial, sans-serif; font-weight: 900; font-size: 9px; }
.imdb-score { font-weight: 900; font-size: 0.78rem; font-variant-numeric: tabular-nums; }

.user-rating-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: linear-gradient(135deg, #c084fc, #8b5cf6);
    color: #fff; padding: 3px 8px 3px 4px;
    border-radius: 6px; font-weight: 900; font-size: 0.7rem;
    box-shadow: 0 2px 8px rgba(192, 132, 252, 0.3);
    flex-shrink: 0; cursor: pointer;
    transition: all 0.3s ease; position: relative; direction: ltr;
}
.user-rating-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(192, 132, 252, 0.5);
}
.user-rating-badge svg { width: 24px; height: 12px; flex-shrink: 0; }
.user-rating-badge svg rect { fill: rgba(0, 0, 0, 0.35); }
.user-rating-badge svg text { fill: #fff; font-family: Arial, sans-serif; font-weight: 900; font-size: 8px; letter-spacing: 0.3px; }
.user-rating-score { font-weight: 900; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.user-rating-count { font-size: 0.6rem; opacity: 0.75; font-weight: 700; }
.user-rating-badge.no-rating {
    background: var(--btn-bg); border: 1px solid var(--btn-border);
    color: var(--subtext-color); box-shadow: none;
}
.user-rating-badge.no-rating svg rect { fill: rgba(128, 128, 128, 0.3); }
.user-rating-badge.no-rating svg text { fill: var(--subtext-color); }
.user-rating-badge.no-rating:hover {
    background: rgba(192, 132, 252, 0.15);
    border-color: #c084fc; color: #c084fc;
}

.ratings-row {
    display: flex; align-items: center; gap: 10px;
    margin-top: 8px; padding-top: 8px;
    border-top: 1px dashed var(--item-border);
    flex-wrap: wrap; z-index: 2; position: relative;
}
.personal-rating {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--btn-bg); border: 1px solid var(--btn-border);
    padding: 3px 8px; border-radius: 8px;
    font-size: 0.65rem; font-weight: 700;
    animation: fadeInRating 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    direction: ltr;
}
@keyframes fadeInRating {
    from { opacity: 0; transform: translateY(-6px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.rating-label { color: var(--subtext-color); font-weight: 700; font-size: 0.65rem; }
.rating-stars-clickable { display: inline-flex; gap: 0; position: relative; }
.rating-star-btn {
    width: 11px; height: 11px; cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    fill: transparent; stroke: var(--subtext-color);
    stroke-width: 1.5; background: none; border: none;
    padding: 0; display: flex; align-items: center; justify-content: center;
}
.rating-star-btn svg { width: 100%; height: 100%; fill: inherit; stroke: inherit; pointer-events: none; }
.rating-star-btn:hover { transform: scale(1.4) translateY(-2px); filter: drop-shadow(0 0 6px currentColor); }
.rating-star-btn.active { fill: currentColor; stroke: currentColor; }
.rating-stars-clickable[data-level="low"] { color: #ef4444; }
.rating-stars-clickable[data-level="mid"] { color: #fbbf24; }
.rating-stars-clickable[data-level="good"] { color: #34d399; }
.rating-stars-clickable[data-level="great"] { color: #c084fc; }
.rating-value {
    color: var(--subtext-color); font-weight: 800;
    font-variant-numeric: tabular-nums;
    min-width: 30px; font-size: 0.65rem; text-align: center;
}
.rating-value.has-score { color: var(--phase-color); text-shadow: 0 0 8px var(--phase-glow); }

/* ═══ Grid / Item ═══ */
.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px; align-items: stretch;
}
.grid-container > .item-wrapper {
    display: flex; flex-direction: column; min-height: 100%;
}
.grid-container > .item-wrapper > .item { flex-grow: 1; height: 100%; }
@media (max-width: 750px) {
    .grid-container { grid-template-columns: 1fr; gap: 14px; }
    body { padding: 16px 12px 120px 12px; }
}
.item-wrapper {
    position: relative; border-radius: var(--radius-lg);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    z-index: 1;
}
.item-wrapper.has-active-popover { z-index: 999999 !important; }
.item-wrapper:hover { transform: translateY(-2px); z-index: 5; }
.item {
    backdrop-filter: blur(20px); background: var(--item-bg);
    padding: 14px 16px; border-radius: var(--radius-lg);
    display: flex; align-items: flex-start; gap: 12px;
    position: relative; border: 1px solid var(--item-border);
    overflow: hidden; isolation: isolate; min-height: 76px; min-width: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.item-wrapper::after {
    content: ''; position: absolute; inset: 0;
    border-radius: var(--radius-lg); padding: 1px;
    background: linear-gradient(135deg, #fbbf24, #ff3838, #c084fc);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity 0.4s ease;
    pointer-events: none; z-index: 10; overflow: hidden;
}
.item-wrapper:hover::after { opacity: 0.7; }
.item-wrapper:hover .item { background: var(--item-bg-hover); }
.water-wave {
    position: absolute; top: 0; left: 0; width: 0%; height: 100%;
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.35), rgba(59, 130, 246, 0.5), rgba(139, 92, 246, 0.35));
    background-size: 200% 100%;
    animation: waterFlow 4s ease infinite;
    transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s ease;
    z-index: 1; pointer-events: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    clip-path: inset(0 round var(--radius-lg));
    opacity: 1; overflow: hidden;
}
.water-wave.active { opacity: 1; }
@keyframes waterFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.item-wrapper.status-completed .water-wave {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.45), rgba(52, 211, 153, 0.6), rgba(34, 197, 94, 0.45));
    background-size: 200% 100%;
    border-radius: var(--radius-lg);
    clip-path: inset(0 round var(--radius-lg));
}
.item-wrapper.status-partial .water-wave {
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    clip-path: inset(0 round var(--radius-lg));
}
.item-wrapper.status-completed .item { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.5); }
.item-wrapper.status-completed::after { background: linear-gradient(135deg, #10b981, #34d399, #10b981); opacity: 0.5; }
.item-wrapper.status-partial .item { border-color: rgba(59, 130, 246, 0.5); }
.item-wrapper.status-partial::after { background: linear-gradient(135deg, #3b82f6, #60a5fa, #3b82f6); opacity: 0.5; }
.item-wrapper.status-ignored .item { border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.06); }
.item-wrapper.status-ignored::after { background: linear-gradient(135deg, #ef4444, #f87171, #ef4444); opacity: 0.5; }

.status-trigger-btn {
    background: var(--btn-bg); border: 1.5px solid var(--btn-border);
    width: 34px; height: 34px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 3; flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-top: 2px; padding: 0; position: relative;
}
.status-trigger-btn:hover {
    transform: scale(1.15);
    border-color: var(--phase-color);
    box-shadow: 0 0 15px var(--phase-glow);
}
.status-trigger-btn .modern-icon { width: 17px; height: 17px; stroke: var(--phase-color); }
.status-trigger-btn.check {
    background: rgba(16, 185, 129, 0.2); border-color: #10b981;
    animation: pulseGreen 2s ease-in-out infinite;
}
.status-trigger-btn.check .modern-icon { stroke: #10b981; }
@keyframes pulseGreen {
    0%, 100% { box-shadow: 0 0 0 rgba(16, 185, 129, 0.5); }
    50% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.5); }
}
.status-trigger-btn.minus {
    background: rgba(59, 130, 246, 0.2); border-color: #3b82f6;
    animation: pulseBlue 2s ease-in-out infinite;
}
.status-trigger-btn.minus .modern-icon { stroke: #3b82f6; }
@keyframes pulseBlue {
    0%, 100% { box-shadow: 0 0 0 rgba(59, 130, 246, 0.5); }
    50% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.5); }
}
.status-trigger-btn.cross {
    background: rgba(239, 68, 68, 0.2); border-color: #ef4444;
    animation: pulseRedBtn 2s ease-in-out infinite;
}
.status-trigger-btn.cross .modern-icon { stroke: #ef4444; }
@keyframes pulseRedBtn {
    0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.5); }
}

.seasons-popover, .status-select-popover, .inline-time-numpad {
    position: absolute; border-radius: var(--radius-md);
    padding: 8px; display: none; flex-direction: column; gap: 6px;
    z-index: 99999999;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
    border: 1px solid var(--item-border-hover);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
}
.seasons-popover.show, .status-select-popover.show, .inline-time-numpad.show { display: flex; opacity: 1; }
.status-select-popover { padding: 44px 10px 10px 10px; min-width: 190px; direction: rtl; }
.seasons-popover { min-width: 110px; direction: rtl; }
.status-select-popover::before, .seasons-popover::before, .inline-time-numpad::before {
    content: ''; position: absolute; inset: -1px;
    border-radius: var(--radius-md); padding: 1px;
    background: linear-gradient(135deg, #fbbf24, #ff3838);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0.6; pointer-events: none;
}
.item-reset-corner-btn {
    position: absolute; top: 8px; right: 8px;
    width: 30px; height: 30px; border-radius: 8px;
    border: 1px solid var(--item-border);
    background: var(--btn-bg); color: var(--subtext-color);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10; padding: 0;
}
.item-reset-corner-btn:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #ef4444; color: #fff;
    transform: scale(1.12);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
}
.item-reset-corner-btn svg {
    width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.5;
    fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.season-opt-btn, .status-opt-btn {
    background: var(--btn-bg); border: 1px solid var(--item-border);
    border-radius: 12px; padding: 9px 12px;
    cursor: pointer; display: flex; align-items: center;
    gap: 10px; width: 100%; font-weight: 700;
    font-size: 0.78rem; color: var(--text-color);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: inherit; direction: rtl; text-align: right;
}
.season-opt-btn:hover, .status-opt-btn:hover { transform: translateX(-3px); background: rgba(128, 128, 128, 0.15); }
.season-opt-btn .modern-icon { width: 15px; height: 15px; stroke: var(--phase-color); }
.season-opt-btn .season-text { color: var(--phase-color); }
.status-opt-btn .modern-icon { width: 15px; height: 15px; }
.status-opt-btn.opt-completed { color: #10b981; }
.status-opt-btn.opt-completed .modern-icon { stroke: #10b981; }
.status-opt-btn.opt-completed:hover { background: rgba(16, 185, 129, 0.12); }
.status-opt-btn.opt-partial { color: #3b82f6; }
.status-opt-btn.opt-partial .modern-icon { stroke: #3b82f6; }
.status-opt-btn.opt-partial:hover { background: rgba(59, 130, 246, 0.12); }
.status-opt-btn.opt-ignored { color: #ef4444; }
.status-opt-btn.opt-ignored .modern-icon { stroke: #ef4444; }
.status-opt-btn.opt-ignored:hover { background: rgba(239, 68, 68, 0.12); }
.status-opt-btn.opt-reset { color: var(--subtext-color); border-style: dashed; }
.status-opt-btn.opt-reset .modern-icon { stroke: var(--subtext-color); }

.inline-time-numpad { width: 230px; direction: ltr; padding: 10px; }
.inline-time-numpad h3 { color: #60a5fa; font-size: 0.78rem; text-align: center; margin-bottom: 8px; font-weight: 700; }
.time-inputs-container { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px; }
.time-input-group { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.time-input-group input {
    width: 52px; height: 32px;
    background: var(--btn-bg); border: 1.5px solid var(--item-border);
    color: var(--text-color); text-align: center;
    border-radius: 12px; font-size: 0.85rem;
    font-family: inherit; font-weight: 700;
}
.time-input-group input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 15px rgba(59, 130, 246, 0.4); }
.time-input-group label { font-size: 0.6rem; color: var(--subtext-color); font-weight: 600; }
.virtual-numpad {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 5px; margin-bottom: 8px; background: var(--btn-bg);
    padding: 5px; border-radius: 12px;
}
.numpad-btn {
    background: var(--item-bg); border: 1px solid var(--item-border);
    color: var(--text-color); padding: 7px 0;
    border-radius: 7px; font-size: 0.8rem;
    font-weight: 700; cursor: pointer; font-family: inherit;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.numpad-btn:hover { background: rgba(59, 130, 246, 0.2); border-color: #3b82f6; transform: scale(1.08); }
.numpad-btn:active { transform: scale(0.95); }
.time-modal-btns { display: flex; gap: 6px; }
.time-modal-btn {
    flex: 1; padding: 8px; border-radius: 12px;
    font-weight: 700; cursor: pointer; border: none;
    font-size: 0.72rem; font-family: inherit;
}
.time-save-btn { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.time-cancel-btn { background: var(--btn-bg); color: var(--text-color); border: 1px solid var(--item-border); }

.item-content {
    display: flex; flex-direction: column; gap: 4px;
    flex-grow: 1; flex-shrink: 1; flex-basis: 0;
    position: relative; z-index: 2;
    min-width: 0; overflow: hidden; width: 100%;
}
.item label {
    font-size: 0.92rem; font-weight: 700;
    cursor: pointer; line-height: 1.4;
    display: block; letter-spacing: 0.2px;
    word-break: break-word; overflow-wrap: break-word;
    white-space: normal; max-width: 100%;
}
.item-wrapper.status-completed label {
    text-decoration: line-through;
    text-decoration-color: rgba(16, 185, 129, 0.6);
    text-decoration-thickness: 2px;
    color: var(--subtext-color);
}
.meta-group {
    display: flex; align-items: center;
    gap: 6px; flex-wrap: wrap;
    max-width: 100%; overflow: hidden;
}
.badge {
    font-size: 0.65rem; font-weight: 800;
    padding: 3px 8px; border-radius: 8px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-movie { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.35); }
.badge-series { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }
.badge-anim { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.35); }
.badge-special { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.year-text { font-size: 0.72rem; color: var(--subtext-color); font-weight: 500; }
.actions-group {
    display: flex; align-items: center; gap: 6px;
    z-index: 3; flex-shrink: 0; flex-grow: 0;
    margin-top: 2px; min-width: fit-content; position: relative;
}
.translate-btn, .main-copy-btn {
    background: var(--btn-bg); border: 1.5px solid var(--btn-border);
    padding: 4px; border-radius: 12px; cursor: pointer;
    height: 34px; width: 34px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.translate-btn:hover, .main-copy-btn:hover {
    background: rgba(251, 191, 36, 0.15);
    border-color: var(--phase-color);
    transform: scale(1.12);
    box-shadow: 0 0 15px var(--phase-glow);
}
.translate-btn .modern-icon, .main-copy-btn .modern-icon { stroke: var(--phase-color); }
.translate-btn.active {
    background: linear-gradient(135deg, var(--phase-color), #f59e0b);
    border-color: var(--phase-color);
}
.translate-btn.active .modern-icon { stroke: #000; }

/* ═══ Toast ═══ */
.toast {
    position: fixed; bottom: 32px; left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: linear-gradient(135deg, var(--phase-color), #f59e0b);
    color: #000; padding: 14px 26px;
    border-radius: 999px; font-weight: 800;
    font-size: 0.88rem; z-index: 99999999;
    opacity: 0; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none; max-width: 90vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.fireworks-rocket {
    position: fixed; bottom: 0; left: 50%;
    width: 10px; height: 42px;
    background: linear-gradient(to top, #ff3838, #ffb142, #fff);
    border-radius: 5px 5px 2px 2px;
    z-index: 99999999; pointer-events: none;
    transform: translateX(-50%); opacity: 0;
    box-shadow: 0 0 20px #ff3838, 0 0 40px #ff7600;
}
@keyframes launchRocket {
    0% { bottom: 0; opacity: 1; }
    80% { opacity: 1; }
    100% { bottom: 85vh; opacity: 0; }
}
.launching { animation: launchRocket 1.3s cubic-bezier(0.25, 1, 0.5, 1) forwards; }
#particleCanvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 99999; }

/* ═══ Footer ═══ */
.site-footer {
    position: relative; width: 100%; max-width: 1200px;
    margin-top: auto; padding: 60px 0 40px 0;
    z-index: 1; animation: footerFadeIn 0.8s ease 0.4s both;
}
@keyframes footerFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.footer-content {
    width: 100%; display: flex; justify-content: space-between;
    align-items: center; gap: 20px; flex-wrap: wrap;
    padding: 20px 28px;
    background: linear-gradient(135deg, rgba(24, 24, 40, 0.85) 0%, rgba(10, 10, 18, 0.95) 100%);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 24px;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    position: relative; overflow: hidden;
    animation: footerPulseGlow 3s ease-in-out infinite;
    direction: ltr;
}
[data-theme="light"] .footer-content { background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 244, 251, 0.98) 100%); }
@keyframes footerPulseGlow {
    0%, 100% {
        border-color: rgba(251, 191, 36, 0.25);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 0px rgba(251, 191, 36, 0);
    }
    50% {
        border-color: rgba(251, 191, 36, 0.7);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 25px rgba(251, 191, 36, 0.5), 0 0 50px rgba(255, 56, 56, 0.25);
    }
}
.footer-content::after {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, #fbbf24, #ff3838, #c084fc, #3b82f6, transparent);
    background-size: 200% auto;
    animation: lineShine 4s linear infinite;
    border-radius: 2px 2px 0 0;
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.8));
}
.footer-brand, .footer-visits {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 0.82rem; font-weight: 600;
    color: var(--subtext-color); letter-spacing: 0.3px;
    position: relative; z-index: 2; direction: ltr;
}
.footer-brand strong {
    background: linear-gradient(120deg, #fbbf24, #ff3838);
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900; letter-spacing: 1.5px;
    animation: shineText 3s linear infinite, namePulse 2.5s ease-in-out infinite;
    font-size: 1rem;
}
@keyframes namePulse {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.4)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 18px rgba(251, 191, 36, 0.9)) drop-shadow(0 0 25px rgba(255, 56, 56, 0.5)); transform: scale(1.08); }
}
.footer-visits strong {
    color: #60a5fa; font-weight: 800;
    font-variant-numeric: tabular-nums; font-size: 1.15rem;
    margin-inline-start: 4px; display: inline-block; min-width: 30px;
    transition: all 0.3s ease;
    animation: visitPulse 2s ease-in-out infinite;
    direction: ltr;
}
@keyframes visitPulse {
    0%, 100% { text-shadow: 0 0 8px rgba(59, 130, 246, 0.4); transform: scale(1); }
    50% { text-shadow: 0 0 15px rgba(59, 130, 246, 0.9), 0 0 30px rgba(59, 130, 246, 0.6), 0 0 45px rgba(96, 165, 250, 0.4); transform: scale(1.05); }
}
.footer-icon { width: 18px; height: 18px; stroke: var(--phase-color); flex-shrink: 0; animation: iconPulse 2s ease-in-out infinite; }
@keyframes iconPulse {
    0%, 100% { filter: drop-shadow(0 0 4px var(--phase-glow)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.9)); transform: scale(1.12); }
}
.footer-visits .footer-icon { stroke: #60a5fa; animation: eyePulse 2s ease-in-out infinite; }
@keyframes eyePulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.5)); transform: scale(1); opacity: 1; }
    50% { filter: drop-shadow(0 0 12px rgba(96, 165, 250, 0.9)); transform: scale(1.15); opacity: 0.85; }
}
@media (max-width: 600px) {
    .footer-content { flex-direction: column; text-align: center; padding: 18px 20px; gap: 14px; }
    .site-footer { padding: 40px 0 32px 0; }
    .footer-brand, .footer-visits { justify-content: center; }
}

/* ═══════════════════════════════════════════════════
   🌟 BOTTOM NAVIGATION BAR
   ═══════════════════════════════════════════════════ */
.bottom-nav {
    position: fixed;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 520px;
    background: rgba(14, 14, 24, 0.78);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 4px;
    z-index: 9999998;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(139, 92, 246, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
[data-theme="light"] .bottom-nav {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 40px rgba(139, 92, 246, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.bottom-nav.hidden {
    transform: translateX(-50%) translateY(120%);
    opacity: 0;
    pointer-events: none;
}
.bottom-nav::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.4), rgba(192, 132, 252, 0.4), rgba(59, 130, 246, 0.4), rgba(16, 185, 129, 0.4));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.6;
    pointer-events: none;
    animation: navBorderPulse 4s ease-in-out infinite;
}
@keyframes navBorderPulse {
    0%, 100% { opacity: 0.4; filter: blur(0px); }
    50% { opacity: 0.9; filter: blur(1px); }
}
.nav-btn {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    padding: 8px 4px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    font-family: inherit;
    color: var(--subtext-color);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    min-height: 52px;
}
.nav-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-color);
    transform: translateY(-2px);
}
[data-theme="light"] .nav-btn:hover {
    background: rgba(15, 23, 42, 0.05);
}
.nav-btn:active { transform: scale(0.94); }
.nav-btn.active {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.18), rgba(59, 130, 246, 0.18));
    color: var(--text-color);
}
.nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #c084fc, #8b5cf6, #3b82f6);
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.8);
    animation: navIndicatorPulse 2s ease-in-out infinite;
}
@keyframes navIndicatorPulse {
    0%, 100% { opacity: 0.7; width: 20px; }
    50% { opacity: 1; width: 28px; }
}
.nav-btn .nav-icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-btn.active .nav-icon {
    stroke: #c084fc;
    filter: drop-shadow(0 0 8px rgba(192, 132, 252, 0.6));
    transform: scale(1.08);
}
.nav-btn .nav-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1;
    white-space: nowrap;
}
.nav-btn.nav-profile { overflow: visible; }
.nav-btn.nav-profile .nav-avatar-wrap {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-btn.nav-profile .nav-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.15);
}
.nav-btn.nav-profile .nav-avatar-wrap svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nav-btn.nav-profile .nav-default-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(128, 128, 128, 0.16);
    border: 1px solid rgba(128, 128, 128, 0.32);
}
.nav-btn.nav-profile .nav-default-avatar svg {
    width: 18px;
    height: 18px;
    stroke: var(--subtext-color);
    opacity: 0.9;
}
.nav-btn.nav-profile.logged-in .nav-avatar-wrap {
    border: 2px solid #34d399;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.6);
}
.nav-btn.nav-profile .nav-online-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--online-color);
    border: 2px solid rgba(14, 14, 24, 0.9);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
    display: none;
}
.nav-btn.nav-profile.logged-in .nav-online-dot {
    display: block;
    animation: onlinePulse 2s infinite;
}
.nav-btn .nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 22px);
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 900;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid rgba(14, 14, 24, 0.9);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
    animation: badgePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-theme="light"] .nav-btn .nav-badge { border-color: rgba(255, 255, 255, 0.9); }
.nav-btn .nav-badge.show { display: flex; }
@keyframes badgePop {
    0% { transform: scale(0); }
    60% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* ═══════════════════════════════════════════════════
   🎬 PHASE NAVIGATOR
   ═══════════════════════════════════════════════════ */
.phase-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999997;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.phase-nav-overlay.show { display: block; opacity: 1; }
.phase-nav-popup {
    position: fixed;
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 80px);
    left: 50%;
    transform: translateX(-50%) translateY(20px) scale(0.92);
    width: calc(100% - 32px);
    max-width: 480px;
    background: rgba(14, 14, 24, 0.94);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 16px;
    z-index: 99999998;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(139, 92, 246, 0.2);
    display: none;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-theme="light"] .phase-nav-popup {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(15, 23, 42, 0.08);
}
.phase-nav-popup.show {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}
.phase-nav-popup::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, #fbbf24, #c084fc, #3b82f6, #10b981);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.7;
    pointer-events: none;
}
.phase-nav-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--phase-color);
    margin-bottom: 12px;
    padding: 0 4px;
    direction: rtl;
}
.phase-nav-title svg {
    width: 18px;
    height: 18px;
    stroke: var(--phase-color);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.phase-nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.phase-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-color);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    min-height: 76px;
}
[data-theme="light"] .phase-nav-item {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.08);
}
.phase-nav-item:hover {
    transform: translateY(-4px);
    border-color: var(--phase-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px var(--phase-glow);
    background: rgba(251, 191, 36, 0.08);
}
.phase-nav-item:active { transform: scale(0.95); }
.phase-nav-item .phase-num-badge {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, #fbbf24, #ff3838);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
    transition: all 0.35s ease;
}
.phase-nav-item[data-phase="2"] .phase-num-badge { background: linear-gradient(135deg, #3b82f6, #60a5fa); box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4); }
.phase-nav-item[data-phase="3"] .phase-num-badge { background: linear-gradient(135deg, #c084fc, #8b5cf6); box-shadow: 0 4px 15px rgba(192, 132, 252, 0.4); }
.phase-nav-item[data-phase="4"] .phase-num-badge { background: linear-gradient(135deg, #10b981, #34d399); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4); }
.phase-nav-item[data-phase="5"] .phase-num-badge { background: linear-gradient(135deg, #f472b6, #ec4899); box-shadow: 0 4px 15px rgba(244, 114, 182, 0.4); }
.phase-nav-item[data-phase="6"] .phase-num-badge { background: linear-gradient(135deg, #06b6d4, #0ea5e9); box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4); }
.phase-nav-item:hover .phase-num-badge { transform: scale(1.12) rotate(-4deg); }
.phase-nav-item .phase-name {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--subtext-color);
    letter-spacing: 0.3px;
    text-align: center;
    line-height: 1.2;
}
.phase-nav-item .phase-progress-mini {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}
.phase-nav-item .phase-progress-mini-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #ff3838);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

/* ═══════════════════════════════════════════════════
   📱 BOTTOM SHEETS
   ═══════════════════════════════════════════════════ */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999990;
    display: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.sheet-overlay.show { display: block; opacity: 1; }

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 520px;
    height: 88vh;
    max-height: 88vh;
    min-height: 320px;
    background: rgba(18, 18, 28, 0.98);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-radius: 28px 28px 0 0;
    z-index: 99999991;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(139, 92, 246, 0.15);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
[data-theme="light"] .bottom-sheet {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.15), 0 0 40px rgba(139, 92, 246, 0.1);
}
.bottom-sheet.show {
    transform: translateX(-50%) translateY(0);
}
.bottom-sheet::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #fbbf24, #c084fc, #3b82f6, #10b981, transparent);
    background-size: 200% auto;
    animation: lineShine 4s linear infinite;
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.8));
}
.sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    margin: 12px auto 4px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
[data-theme="light"] .sheet-handle { background: rgba(15, 23, 42, 0.15); }
.bottom-sheet.show .sheet-handle { background: rgba(192, 132, 252, 0.6); }
.sheet-content {
    padding: 8px 20px 32px;
    overflow-y: auto;
    flex-grow: 1;
    direction: rtl;
    text-align: right;
    scrollbar-width: thin;
}
.sheet-content::-webkit-scrollbar { width: 6px; }
.sheet-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c084fc, #8b5cf6);
    border-radius: 6px;
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--item-border);
    position: relative;
}
.sheet-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--phase-color);
}
.sheet-header-title svg {
    width: 18px;
    height: 18px;
    stroke: var(--phase-color);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sheet-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sheet-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    transform: scale(1.12) rotate(90deg);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}
.sheet-close-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--subtext-color);
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease;
}
.sheet-close-btn:hover svg { stroke: #ef4444; }

/* Profile Sheet */
.sheet-profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0 20px;
    position: relative;
}
.sheet-profile-avatar-wrap {
    position: relative;
    margin-bottom: 14px;
}
.sheet-profile-avatar-wrap img.sheet-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid transparent;
    background: linear-gradient(135deg, #fbbf24, #c084fc, #3b82f6) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    object-fit: cover;
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.3), 0 0 60px rgba(192, 132, 252, 0.25);
}
.sheet-profile-avatar-wrap .sheet-avatar-dot {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--online-color);
    border: 4px solid var(--popover-bg);
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.8);
    animation: onlinePulse 2s infinite;
}
.sheet-profile-avatar-wrap .sheet-avatar-dot.offline {
    background: #6b7280;
    animation: none;
    box-shadow: 0 0 8px rgba(107, 114, 128, 0.6);
}
.sheet-profile-avatar-wrap .sheet-avatar-edit {
    position: absolute;
    bottom: -4px;
    left: -4px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c084fc, #8b5cf6);
    border: 3px solid var(--popover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 5;
    box-shadow: 0 4px 15px rgba(192, 132, 252, 0.5);
}
.sheet-profile-avatar-wrap .sheet-avatar-edit:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 0 25px rgba(192, 132, 252, 0.8);
}
.sheet-profile-avatar-wrap .sheet-avatar-edit svg {
    width: 15px;
    height: 15px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sheet-profile-name {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text-color);
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}
.sheet-profile-username {
    font-size: 0.78rem;
    color: var(--user-color);
    font-family: 'Courier New', monospace;
    direction: ltr;
    padding: 3px 12px;
    background: rgba(192, 132, 252, 0.1);
    border-radius: 999px;
    margin-bottom: 8px;
    font-weight: 700;
}
.sheet-profile-email {
    font-size: 0.75rem;
    color: var(--subtext-color);
    font-family: 'Courier New', monospace;
    direction: ltr;
    margin-bottom: 8px;
}
.sheet-profile-lastseen {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--subtext-color);
    font-weight: 600;
    padding: 5px 14px;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 999px;
    margin-bottom: 4px;
}
.sheet-profile-lastseen .online-dot { margin: 0; }

.sheet-actions-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 16px 0;
}
.sheet-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 8px;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-color);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 80px;
    position: relative;
    overflow: hidden;
}
.sheet-action-btn:hover {
    transform: translateY(-3px);
    border-color: var(--phase-color);
    background: rgba(251, 191, 36, 0.08);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px var(--phase-glow);
}
.sheet-action-btn:active { transform: scale(0.95); }
.sheet-action-btn .action-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.35s ease;
}
.sheet-action-btn .action-icon-wrap.edit { background: linear-gradient(135deg, #c084fc, #8b5cf6); box-shadow: 0 4px 15px rgba(192, 132, 252, 0.4); }
.sheet-action-btn .action-icon-wrap.settings { background: linear-gradient(135deg, #60a5fa, #3b82f6); box-shadow: 0 4px 15px rgba(96, 165, 250, 0.4); }
.sheet-action-btn .action-icon-wrap.admin { background: linear-gradient(135deg, #f472b6, #ec4899); box-shadow: 0 4px 15px rgba(244, 114, 182, 0.4); }
.sheet-action-btn .action-icon-wrap.logout { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4); }
.sheet-action-btn:hover .action-icon-wrap { transform: scale(1.1) rotate(-5deg); }
.sheet-action-btn svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sheet-action-btn .action-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-align: center;
    line-height: 1.2;
}

.sheet-info-card {
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}
.sheet-info-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(192, 132, 252, 0.3));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    pointer-events: none;
}
.sheet-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--item-border);
    gap: 12px;
}
.sheet-info-row:last-child { border-bottom: none; }
.sheet-info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--subtext-color);
    font-weight: 700;
}
.sheet-info-label svg {
    width: 14px;
    height: 14px;
    stroke: var(--phase-color);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sheet-info-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-color);
    direction: ltr;
    font-family: 'Courier New', monospace;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
    white-space: nowrap;
}
.sheet-info-value.rtl { direction: rtl; font-family: inherit; }
.sheet-info-value.hidden-value {
    color: var(--subtext-color);
    font-style: italic;
    font-family: inherit;
}

.sheet-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--phase-color);
    margin: 20px 0 10px;
    padding: 0 4px;
    letter-spacing: 0.3px;
}
.sheet-section-title svg {
    width: 16px;
    height: 16px;
    stroke: var(--phase-color);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sheet-section-title .count-badge {
    font-size: 0.6rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #c084fc, #8b5cf6);
    color: #fff;
    margin-inline-start: auto;
}

/* Settings Sheet */
.settings-group {
    margin-bottom: 20px;
}
.settings-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--phase-color);
    margin-bottom: 10px;
    padding: 0 4px;
}
.settings-group-title svg {
    width: 15px;
    height: 15px;
    stroke: var(--phase-color);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.settings-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 14px;
    margin-bottom: 8px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 100%;
    text-align: right;
    position: relative;
    overflow: hidden;
}
.settings-option:hover {
    border-color: var(--phase-color);
    background: rgba(251, 191, 36, 0.06);
    transform: translateX(-3px);
}
.settings-option.active {
    border-color: var(--phase-color);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(255, 56, 56, 0.1));
}
.settings-option.active::after {
    content: '✓';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--phase-color);
    font-size: 1.1rem;
    font-weight: 900;
}
.settings-option-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.settings-option-icon svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.settings-option-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
    text-align: right;
}
.settings-option-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-color);
}
.settings-option-subtitle {
    font-size: 0.68rem;
    color: var(--subtext-color);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   💬 CHAT
   ═══════════════════════════════════════════════════ */
.chat-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0;
}
.chat-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: inherit;
    color: var(--text-color);
    text-align: right;
    width: 100%;
}
.chat-list-item:hover {
    background: rgba(192, 132, 252, 0.1);
    border-color: #c084fc;
    transform: translateX(-3px);
}
.chat-list-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.chat-list-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--btn-border);
    background: var(--btn-bg);
}
.chat-list-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--online-color);
    border: 3px solid var(--popover-bg);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}
.chat-list-online-dot.offline {
    background: #6b7280;
    box-shadow: 0 0 6px rgba(107, 114, 128, 0.6);
}
.chat-list-info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.chat-list-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-list-preview {
    font-size: 0.7rem;
    color: var(--subtext-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.chat-list-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.chat-list-time {
    font-size: 0.62rem;
    color: var(--subtext-color);
    font-weight: 600;
}
.chat-list-unread {
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #c084fc, #8b5cf6);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.6);
}
.chat-list-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--subtext-color);
    font-size: 0.85rem;
    line-height: 1.8;
}
.chat-list-empty svg {
    width: 60px;
    height: 60px;
    stroke: var(--subtext-color);
    fill: none;
    stroke-width: 1.5;
    opacity: 0.5;
    margin-bottom: 12px;
}

.chat-page {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    background-image: var(--bg-radial);
    z-index: 99999999;
    display: none;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.chat-page.show {
    display: flex;
    transform: translateX(0);
}
.chat-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(14, 14, 24, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--item-border);
    flex-shrink: 0;
    padding-top: max(14px, env(safe-area-inset-top));
    direction: rtl;
}
[data-theme="light"] .chat-page-header { background: rgba(255, 255, 255, 0.95); }
.chat-back-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.chat-back-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}
.chat-back-btn:hover svg { stroke: #ef4444; }
.chat-back-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-color);
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.chat-header-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--btn-border);
    background: var(--btn-bg);
}
.chat-header-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--online-color);
    border: 2px solid var(--popover-bg);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}
.chat-header-online-dot.offline { background: #6b7280; }
.chat-header-info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.chat-header-name {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-header-status {
    font-size: 0.65rem;
    color: var(--subtext-color);
    font-weight: 600;
}
.chat-header-status.online { color: var(--online-color); }
.chat-header-action {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.chat-header-action:hover {
    background: rgba(192, 132, 252, 0.15);
    border-color: #c084fc;
}
.chat-header-action svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-color);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.chat-page-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
.chat-page-messages::-webkit-scrollbar { width: 6px; }
.chat-page-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c084fc, #8b5cf6);
    border-radius: 6px;
}
.chat-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--subtext-color);
    font-size: 0.82rem;
    line-height: 1.8;
}
.chat-empty svg {
    width: 60px;
    height: 60px;
    stroke: var(--subtext-color);
    fill: none;
    stroke-width: 1.5;
    opacity: 0.4;
    margin-bottom: 16px;
}

.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 78%;
    animation: msgFadeIn 0.3s ease;
}
@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.their { align-self: flex-start; align-items: flex-start; }
.chat-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.85rem;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    position: relative;
    direction: rtl;
    text-align: right;
}
.chat-msg.their .chat-msg-bubble {
    background: var(--item-bg);
    border: 1px solid var(--item-border);
    color: var(--text-color);
    border-bottom-right-radius: 4px;
}
.chat-msg.mine .chat-msg-bubble {
    background: linear-gradient(135deg, #c084fc, #8b5cf6);
    color: #fff;
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 15px rgba(192, 132, 252, 0.3);
}
.chat-msg.mine .chat-msg-bubble.read {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
.chat-msg-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6rem;
    color: var(--subtext-color);
    margin-top: 3px;
    padding: 0 6px;
    direction: ltr;
}
.chat-msg-meta .read-check {
    display: flex;
    align-items: center;
    gap: 2px;
}
.chat-msg-meta .read-check svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.chat-msg-meta .read-check.read { color: #3b82f6; }
.chat-msg-meta .read-check.unread { color: var(--subtext-color); }
.chat-msg-deleted {
    font-style: italic;
    opacity: 0.7;
    font-size: 0.78rem;
}
.chat-msg-delete-btn {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.25s ease;
    padding: 0;
    z-index: 3;
}
.chat-msg.mine:hover .chat-msg-delete-btn { opacity: 1; }
.chat-msg-delete-btn:hover { transform: scale(1.15); }
.chat-msg-delete-btn svg {
    width: 12px;
    height: 12px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chat-page-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(14, 14, 24, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--item-border);
    flex-shrink: 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    direction: rtl;
}
[data-theme="light"] .chat-page-input { background: rgba(255, 255, 255, 0.95); }
.chat-input-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.chat-input-action-btn:hover {
    background: rgba(192, 132, 252, 0.15);
    border-color: #c084fc;
}
.chat-input-action-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--subtext-color);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.chat-input-field {
    flex-grow: 1;
    background: var(--btn-bg);
    border: 1.5px solid var(--btn-border);
    border-radius: 999px;
    padding: 11px 18px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    transition: all 0.3s ease;
    direction: rtl;
    min-width: 0;
}
.chat-input-field:focus {
    border-color: #c084fc;
    box-shadow: 0 0 15px rgba(192, 132, 252, 0.3);
    background: rgba(192, 132, 252, 0.05);
}
.chat-input-field::placeholder { color: var(--subtext-color); }
.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c084fc, #8b5cf6);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(192, 132, 252, 0.4);
}
.chat-send-btn:hover {
    transform: scale(1.1) rotate(-8deg);
    box-shadow: 0 6px 25px rgba(192, 132, 252, 0.7);
}
.chat-send-btn:active { transform: scale(0.92); }
.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.chat-send-btn svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ═══ Responsive ═══ */
@media (max-width: 750px) {
    body { padding-bottom: 120px !important; }
    .bottom-nav {
        bottom: max(12px, env(safe-area-inset-bottom));
        width: calc(100% - 24px);
        padding: 6px;
        border-radius: 20px;
    }
    .nav-btn { min-height: 48px; padding: 6px 2px; }
    .nav-btn .nav-icon { width: 20px; height: 20px; }
    .nav-btn .nav-label { font-size: 0.55rem; }
    .phase-nav-popup {
        bottom: calc(max(12px, env(safe-area-inset-bottom)) + 72px);
        width: calc(100% - 24px);
        padding: 14px;
    }
    .phase-nav-grid { gap: 6px; }
    .phase-nav-item { padding: 10px 4px; min-height: 68px; }
    .phase-nav-item .phase-num-badge { width: 30px; height: 30px; font-size: 0.95rem; border-radius: 10px; }
    .phase-nav-item .phase-name { font-size: 0.58rem; }
    .sheet-content { padding: 8px 16px 28px; }
    .sheet-actions-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .sheet-action-btn { min-height: 72px; padding: 10px 4px; }
    .sheet-action-btn .action-icon-wrap { width: 34px; height: 34px; }
    .sheet-action-btn .action-label { font-size: 0.62rem; }
    .chat-msg { max-width: 85%; }
}

@media (max-width: 400px) {
    .nav-btn .nav-label { font-size: 0.5rem; }
    .nav-btn .nav-icon { width: 18px; height: 18px; }
    .sheet-profile-avatar-wrap img.sheet-avatar { width: 85px; height: 85px; }
    .sheet-profile-name { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .bg-particles { display: none; }
}

/* ═══════════════════════════════════════════════════
   🩹 MISSING STYLES (login, first-lang, rate popup,
   birth pickers, raters, stacked avatars, misc)
   ═══════════════════════════════════════════════════ */

/* ── پوشش‌های مشترک (overlay) ── */
.login-overlay, .urp-overlay, .profile-overlay,
.birth-numpad-overlay, .month-wheel-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: none; opacity: 0;
    transition: opacity 0.3s ease;
}
.login-overlay.show, .urp-overlay.show, .profile-overlay.show,
.birth-numpad-overlay.show, .month-wheel-overlay.show { display: block; opacity: 1; }
.login-overlay { z-index: 99999990; }
.urp-overlay { z-index: 99999992; }
.profile-overlay { z-index: 99999994; }
.birth-numpad-overlay, .month-wheel-overlay { z-index: 100000000; }

/* ── پنجره‌های مرکزی مشترک ── */
.login-popup, .user-rate-popup, .birth-input-popup,
.birth-numpad-popup, .month-wheel-popup {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    width: calc(100% - 40px); max-width: 380px;
    background: var(--popover-bg);
    border: 1px solid var(--item-border);
    border-radius: var(--radius-lg);
    padding: 24px 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    text-align: center; color: var(--text-color);
    display: none; opacity: 0;
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: calc(100% - 40px); overflow-y: auto;
}
.login-popup.show, .user-rate-popup.show, .birth-input-popup.show,
.birth-numpad-popup.show, .month-wheel-popup.show {
    display: block; opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.login-popup { z-index: 99999991; }
.user-rate-popup { z-index: 99999993; }
.birth-input-popup { z-index: 99999995; }
.birth-numpad-popup, .month-wheel-popup { z-index: 100000001; max-width: 320px; }

/* ── پنجره ورود ── */
.login-popup h3 { font-size: 1.05rem; font-weight: 800; color: var(--phase-color); margin-bottom: 8px; }
.login-subtitle { font-size: 0.78rem; color: var(--subtext-color); line-height: 1.8; margin-bottom: 18px; }
.google-login-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 16px; border-radius: 12px; border: none; cursor: pointer;
    background: #fff; color: #1f1f1f; font-family: inherit; font-weight: 700; font-size: 0.9rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.google-login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); }
.google-login-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.login-cancel-btn {
    width: 100%; margin-top: 10px; padding: 11px; border-radius: 12px; cursor: pointer;
    background: var(--btn-bg); border: 1px solid var(--btn-border);
    color: var(--text-color); font-family: inherit; font-weight: 700; font-size: 0.85rem;
}
.login-cancel-btn:hover { border-color: var(--item-border-hover); }

/* ── پنجره امتیازدهی ── */
.user-rate-popup h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 6px; }
.user-rate-popup .urp-subtitle { font-size: 0.75rem; color: var(--subtext-color); margin-bottom: 14px; }
.urp-login-hint {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
    font-size: 0.72rem; color: var(--subtext-color);
    padding: 8px 10px; margin-bottom: 14px; border-radius: 10px;
    background: var(--btn-bg); border: 1px dashed var(--btn-border);
}
.urp-login-btn {
    padding: 5px 12px; border-radius: 8px; border: none; cursor: pointer;
    background: linear-gradient(135deg, #c084fc, #8b5cf6); color: #fff;
    font-family: inherit; font-weight: 700; font-size: 0.72rem;
}
.user-rate-stars { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; direction: ltr; margin-bottom: 18px; }
.user-rate-star {
    width: 28px; height: 28px; padding: 0; border: none; background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s ease;
}
.user-rate-star:hover { transform: scale(1.2); }
.user-rate-star svg { width: 24px; height: 24px; fill: transparent; stroke: var(--subtext-color); stroke-width: 1.8; transition: all 0.2s ease; }
.user-rate-star.active svg { fill: var(--phase-color); stroke: var(--phase-color); filter: drop-shadow(0 0 6px var(--phase-glow)); }
.user-rate-actions { display: flex; gap: 8px; }
.user-rate-btn {
    flex: 1; padding: 12px; border-radius: 12px; cursor: pointer;
    font-family: inherit; font-weight: 800; font-size: 0.85rem; border: 1px solid var(--btn-border);
}
.user-rate-cancel { background: var(--btn-bg); color: var(--text-color); }
.user-rate-submit { background: linear-gradient(135deg, #c084fc, #8b5cf6); color: #fff; border: none; }
.user-rate-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── انتخاب اولیه زبان ── */
.first-lang-overlay {
    position: fixed; inset: 0; z-index: 2147483000;
    background: radial-gradient(ellipse at top, #16112b 0%, #07070c 70%);
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.first-lang-overlay.show { display: flex; }
.first-lang-box {
    width: 100%; max-width: 420px; text-align: center; color: var(--text-color);
    background: var(--popover-bg); border: 1px solid var(--item-border);
    border-radius: var(--radius-lg); padding: 28px 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.first-lang-box h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: 10px; line-height: 1.7; }
.first-lang-box p { font-size: 0.8rem; color: var(--subtext-color); line-height: 1.9; margin-bottom: 20px; }
.first-lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.first-lang-btn {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 18px 10px; border-radius: 16px; cursor: pointer;
    background: var(--btn-bg); border: 1.5px solid var(--btn-border);
    color: var(--text-color); font-family: inherit;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.first-lang-btn:hover { transform: translateY(-3px) scale(1.03); border-color: var(--phase-color); background: rgba(251, 191, 36, 0.12); }
.first-lang-btn .flag { font-size: 2rem; line-height: 1; }
.first-lang-btn .name { font-size: 0.95rem; font-weight: 800; }
.first-lang-btn .name-en { font-size: 0.7rem; color: var(--subtext-color); }

/* ── ثبت‌نام / ویرایش پروفایل ── */
.profile-fullname-row input:focus { outline: none; border-color: var(--phase-color) !important; }
.birth-pick-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: 10px 6px; border-radius: 12px; cursor: pointer;
    background: var(--btn-bg); border: 1.5px solid var(--btn-border);
    color: var(--text-color); font-family: inherit;
    transition: all 0.25s ease;
}
.birth-pick-btn:hover { border-color: var(--phase-color); background: rgba(251, 191, 36, 0.1); }
.birth-pick-btn .label { font-size: 0.65rem; color: var(--subtext-color); font-weight: 600; }
.birth-pick-btn .value { font-size: 1.05rem; font-weight: 800; color: var(--phase-color); font-variant-numeric: tabular-nums; }
.birth-pick-btn .value.small { font-size: 0.85rem; }

/* ── کیبورد عددی تاریخ تولد ── */
.birth-numpad-title { font-size: 0.9rem; font-weight: 800; margin-bottom: 14px; color: var(--phase-color); }
.birth-numpad-display {
    font-size: 1.8rem; font-weight: 900; letter-spacing: 3px; direction: ltr;
    padding: 12px; margin-bottom: 14px; border-radius: 14px;
    background: var(--btn-bg); border: 1.5px solid var(--btn-border);
    color: var(--text-color); font-variant-numeric: tabular-nums; min-height: 62px;
}
.birth-numpad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; direction: ltr; margin-bottom: 16px; }
.birth-numpad-grid .numpad-btn { width: 100%; height: 52px; font-size: 1.15rem; }
.birth-numpad-actions, .month-wheel-actions { display: flex; gap: 8px; }
.birth-numpad-cancel, .birth-numpad-ok, .month-wheel-cancel, .month-wheel-ok {
    flex: 1; padding: 12px; border-radius: 12px; cursor: pointer;
    font-family: inherit; font-weight: 800; font-size: 0.85rem;
}
.birth-numpad-cancel, .month-wheel-cancel { background: var(--btn-bg); border: 1px solid var(--btn-border); color: var(--text-color); }
.birth-numpad-ok, .month-wheel-ok { background: linear-gradient(135deg, #c084fc, #8b5cf6); border: none; color: #fff; }

/* ── چرخ انتخاب ماه ── */
.month-wheel-title { font-size: 0.9rem; font-weight: 800; margin-bottom: 14px; color: var(--phase-color); }
.month-wheel-viewport {
    position: relative; height: 200px; overflow: hidden; margin-bottom: 16px;
    border-radius: 14px; background: var(--btn-bg); border: 1px solid var(--btn-border);
    touch-action: none; cursor: grab;
    -webkit-mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent);
    mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent);
}
.month-wheel-viewport::after {
    content: ''; position: absolute; left: 8px; right: 8px; top: 77px; height: 46px;
    border-radius: 10px; border: 1.5px solid var(--phase-color);
    background: rgba(251, 191, 36, 0.08); pointer-events: none;
}
.month-wheel-list { list-style: none; transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1); }
.month-wheel-item {
    height: 46px; line-height: 46px; text-align: center; cursor: pointer;
    font-size: 0.95rem; font-weight: 600; color: var(--subtext-color); opacity: 0.45;
    transition: all 0.2s ease; user-select: none;
}
.month-wheel-item.near { opacity: 0.75; font-size: 1rem; }
.month-wheel-item.active { opacity: 1; color: var(--text-color); font-size: 1.15rem; font-weight: 900; }

/* ── کارت تبریک تولد ── */
.birthday-toast {
    position: fixed; top: 20px; left: 50%;
    transform: translate(-50%, -140%); opacity: 0; pointer-events: none;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px; border-radius: 16px; z-index: 2147482000;
    background: var(--popover-bg); border: 1px solid var(--phase-color);
    box-shadow: 0 10px 30px var(--phase-glow);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}
.birthday-toast.show { transform: translate(-50%, 0); opacity: 1; }
.birthday-cake-svg { width: 26px; height: 26px; fill: none; stroke: var(--phase-color); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.birthday-number { font-size: 1.1rem; font-weight: 900; color: var(--phase-color); }

/* ── آواتارهای روی‌هم‌افتاده‌ی رأی‌دهنده‌ها ── */
.stacked-avatars { display: inline-flex; align-items: center; flex-direction: row; direction: ltr; margin-inline-start: 6px; }
.stack-avatar {
    width: 22px; height: 22px; min-width: 22px; max-width: 22px; flex: 0 0 22px;
    border-radius: 50%; object-fit: cover; display: inline-flex;
    align-items: center; justify-content: center;
    border: 2px solid #8b5cf6; background: #1a1a2e; color: #fff;
    font-size: 0.55rem; font-weight: 800; overflow: hidden;
    margin-left: -8px; position: relative; box-sizing: border-box;
}
.stack-avatar:first-child { margin-left: 0; }
.stack-avatar:nth-child(1) { z-index: 4; }
.stack-avatar:nth-child(2) { z-index: 3; }
.stack-avatar:nth-child(3) { z-index: 2; }
.stack-avatar:nth-child(4) { z-index: 1; }
.stack-avatar svg { width: 14px; height: 14px; fill: #fff; flex-shrink: 0; }
.stack-avatar.anonymous { background: #4b5563; }
.stack-avatar.more { background: rgba(0, 0, 0, 0.4); letter-spacing: 0; }

/* ── پنجره‌ی شناور رأی‌دهنده‌ها ── */
.raters-floating-popup {
    position: fixed; z-index: 99999996; width: min(320px, calc(100vw - 24px));
    max-height: min(68vh, 520px); min-height: 120px; display: flex; flex-direction: column; overflow: hidden;
    box-sizing: border-box;
    background: var(--popover-bg); border: 1px solid var(--item-border);
    border-radius: 16px; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    opacity: 0; transform: translateY(8px) scale(0.96);
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--text-color);
}
.raters-floating-popup.show { opacity: 1; transform: translateY(0) scale(1); }
.raters-floating-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--item-border); flex-shrink: 0;
}
.raters-floating-title { font-size: 0.82rem; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.raters-title-icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 17px; }
.raters-floating-title .count-badge {
    min-width: 20px; padding: 1px 7px; border-radius: 10px; font-size: 0.65rem; font-weight: 800;
    background: rgba(192, 132, 252, 0.2); color: #c084fc; text-align: center;
}
.raters-floating-close {
    width: 26px; height: 26px; border-radius: 8px; border: none; cursor: pointer;
    background: var(--btn-bg); display: flex; align-items: center; justify-content: center;
}
.raters-floating-close svg { width: 14px; height: 14px; fill: none; stroke: var(--subtext-color); stroke-width: 2.5; stroke-linecap: round; }
.raters-floating-close:hover svg { stroke: #ef4444; }
.raters-floating-list { overflow-y: auto; padding: 6px; flex: 1; }
.raters-floating-empty { padding: 24px 14px; text-align: center; font-size: 0.78rem; color: var(--subtext-color); }
.raters-floating-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    border-radius: 12px; cursor: pointer; transition: background 0.2s ease;
}
.raters-floating-row:hover { background: var(--btn-bg); }
.raters-floating-row.no-profile { cursor: default; }
.raters-floating-avatar {
    width: 36px; height: 36px; min-width: 36px; max-width: 36px; flex: 0 0 36px;
    border-radius: 50%; object-fit: cover; border: 2px solid #8b5cf6;
    background: #1a1a2e; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.raters-floating-avatar.anon { background: #4b5563; border-color: #6b7280; }
.raters-floating-avatar svg { width: 20px; height: 20px; fill: #fff; }
.raters-floating-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.raters-floating-name {
    font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; gap: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.raters-floating-badge {
    font-size: 0.55rem; font-weight: 700; padding: 1px 6px; border-radius: 6px;
    background: rgba(107, 114, 128, 0.3); color: var(--subtext-color); flex-shrink: 0;
}
.raters-floating-username { font-size: 0.68rem; color: var(--subtext-color); direction: ltr; text-align: start; }
.raters-floating-rating {
    font-size: 0.75rem; font-weight: 900; color: var(--phase-color);
    padding: 3px 8px; border-radius: 8px; background: rgba(251, 191, 36, 0.12);
    font-variant-numeric: tabular-nums; direction: ltr; flex-shrink: 0;
}

/* ── کپی عنوان و ورودی‌های ساعت/دقیقه ── */
.copy-buttons-container { display: flex; align-items: center; gap: 6px; }
.copy-wrapper { display: flex; align-items: center; gap: 6px; position: relative; }
.numpad-title { color: #60a5fa; font-size: 0.78rem; text-align: center; margin-bottom: 8px; font-weight: 700; }

/* ── کانفتی ── */
.confetti-piece {
    position: fixed; z-index: 2147483001; pointer-events: none;
    animation: confettiFall 3s linear forwards;
}
@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(105vh) rotate(720deg); opacity: 0.9; }
}


/* ── ورود با ایمیل و رمز ── */
.email-auth { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.email-auth-tabs { display: flex; padding: 4px; gap: 4px; border-radius: 12px; background: var(--btn-bg); border: 1px solid var(--btn-border); }
.email-auth-tab {
    flex: 1; padding: 8px; border: none; border-radius: 9px; cursor: pointer;
    background: transparent; color: var(--subtext-color);
    font-family: inherit; font-weight: 700; font-size: 0.8rem; transition: all 0.25s ease;
}
.email-auth-tab.active { background: linear-gradient(135deg, #c084fc, #8b5cf6); color: #fff; box-shadow: 0 2px 10px rgba(192, 132, 252, 0.35); }
.email-auth-input {
    width: 100%; padding: 12px 14px; border-radius: 12px; font-family: inherit; font-size: 0.9rem;
    background: var(--btn-bg); border: 1.5px solid var(--btn-border); color: var(--text-color);
    text-align: left; transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.email-auth-input::placeholder { color: var(--subtext-color); text-align: center; }
.email-auth-input:focus { outline: none; border-color: var(--phase-color); box-shadow: 0 0 0 3px var(--phase-glow); }
.email-auth-msg { display: none; font-size: 0.72rem; line-height: 1.8; padding: 8px 10px; border-radius: 10px; text-align: center; }
.email-auth-msg.show { display: block; }
.email-auth-msg.error { color: #f87171; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); }
.email-auth-msg.ok { color: #34d399; background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.3); }
.email-auth-submit {
    width: 100%; padding: 12px; border: none; border-radius: 12px; cursor: pointer;
    background: linear-gradient(135deg, #c084fc, #8b5cf6); color: #fff;
    font-family: inherit; font-weight: 800; font-size: 0.9rem;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4); transition: transform 0.25s ease, opacity 0.25s ease;
}
.email-auth-submit:hover { transform: translateY(-2px); }
.email-auth-submit:disabled { opacity: 0.6; cursor: wait; transform: none; }
.email-auth-forgot {
    background: none; border: none; cursor: pointer; padding: 2px;
    color: var(--subtext-color); font-family: inherit; font-size: 0.72rem; text-decoration: underline;
}
.email-auth-forgot:hover { color: var(--phase-color); }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--subtext-color); font-size: 0.7rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--item-border); }

.raters-floating-avatar.guests-count { position: relative; }
.raters-floating-avatar.guests-count svg { width: 21px; height: 21px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.guest-count-badge {
    position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
    background: var(--phase-color); color: #111827; border: 2px solid var(--popover-bg);
    font-size: 0.58rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; direction:ltr;
}

/* Profile avatar fallback: always show a real user icon when no photo exists. */
.sheet-avatar-placeholder {
    width: 100px;
    height: 100px;
    min-width: 100px;
    min-height: 100px;
    border-radius: 50%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--btn-bg);
    border: 4px solid var(--btn-border);
    color: var(--subtext-color);
    overflow: hidden;
}
.sheet-avatar-placeholder svg {
    width: 48%;
    height: 48%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* Modern, consistent icons for profile/viewer UI */
.modern-loading-icon { width: 30px; height: 30px; margin: 0 auto 10px; }
.modern-loading-icon svg { width: 100%; height: 100%; fill: none; stroke: var(--phase-color); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; animation: modernIconSpin 1s linear infinite; }
@keyframes modernIconSpin { to { transform: rotate(360deg); } }
.viewer-start-chat-icon { width: 46px; height: 46px; margin: 0 0 16px auto; padding: 0; border-radius: 50%; border: 1px solid rgba(16,185,129,.35); background: linear-gradient(135deg,#10b981,#059669); color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow:0 6px 20px rgba(16,185,129,.28); transition:transform .2s ease, box-shadow .2s ease; }
.viewer-start-chat-icon:hover { transform: translateY(-2px); box-shadow:0 8px 24px rgba(16,185,129,.38); }
.viewer-start-chat-icon svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.viewer-privacy-note { margin-top:16px; display:flex; align-items:center; justify-content:center; gap:7px; font-size:.68rem; color:var(--subtext-color); text-align:center; line-height:1.6; padding:12px; background:var(--btn-bg); border-radius:12px; }
.viewer-privacy-note svg { width:16px; height:16px; flex:0 0 16px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }


/* ===== Modern viewer profile + raters popup refinement ===== */
.viewer-profile-hero {
    display:flex; flex-direction:column; align-items:center; text-align:center;
    padding:8px 0 14px;
}
.viewer-avatar-wrap { position:relative; width:92px; height:92px; margin-bottom:10px; }
.viewer-avatar, .viewer-avatar-fallback {
    width:92px; height:92px; border-radius:50%; box-sizing:border-box;
    border:3px solid rgba(192,132,252,.8);
    background:var(--btn-bg); object-fit:cover; overflow:hidden;
    box-shadow:0 10px 28px rgba(0,0,0,.28);
}
.viewer-avatar-fallback { align-items:center; justify-content:center; color:var(--subtext-color); }
.viewer-avatar-fallback svg { width:42px; height:42px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.viewer-online-dot { position:absolute; right:2px; bottom:3px; width:16px; height:16px; border-radius:50%; background:var(--online-color); border:3px solid var(--popover-bg); box-shadow:0 0 10px rgba(52,211,153,.65); }
.viewer-online-dot.offline { background:#6b7280; box-shadow:none; }
.viewer-profile-name { font-size:1.16rem; font-weight:900; color:var(--text-color); margin-top:2px; }
.viewer-profile-username { margin-top:4px; padding:3px 10px; border-radius:999px; background:rgba(192,132,252,.1); color:var(--user-color); font:700 .72rem 'Courier New',monospace; direction:ltr; }
.viewer-profile-lastseen { display:inline-flex; align-items:center; gap:6px; margin-top:7px; padding:5px 10px; border-radius:999px; background:var(--btn-bg); border:1px solid var(--btn-border); color:var(--subtext-color); font-size:.68rem; font-weight:700; }
.viewer-lastseen-dot { width:7px; height:7px; border-radius:50%; background:var(--online-color); box-shadow:0 0 7px rgba(52,211,153,.55); }
.viewer-lastseen-dot.offline { background:#6b7280; box-shadow:none; }
.viewer-rating-card {
    display:flex; align-items:center; gap:11px; margin:8px 0 12px; padding:11px 13px;
    border-radius:15px; background:linear-gradient(135deg,rgba(139,92,246,.18),rgba(192,132,252,.08));
    border:1px solid rgba(192,132,252,.22); box-shadow:0 8px 22px rgba(0,0,0,.16);
}
.viewer-rating-icon { width:38px; height:38px; flex:0 0 38px; display:flex; align-items:center; justify-content:center; border-radius:12px; background:rgba(251,191,36,.13); color:#fbbf24; }
.viewer-rating-icon svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.viewer-rating-copy { display:flex; align-items:baseline; justify-content:space-between; flex:1; gap:10px; }
.viewer-rating-copy span { color:var(--subtext-color); font-size:.68rem; font-weight:700; }
.viewer-rating-copy strong { color:var(--text-color); font-size:1.2rem; font-weight:900; direction:ltr; font-variant-numeric:tabular-nums; }
.viewer-rating-copy small { font-size:.68rem; color:var(--subtext-color); margin-left:2px; }
.viewer-start-chat-btn {
    width:100%; min-height:44px; margin:0 0 14px; padding:0 16px; border:1px solid rgba(16,185,129,.28);
    border-radius:13px; background:linear-gradient(135deg,#10b981,#059669); color:#fff; cursor:pointer;
    display:flex; align-items:center; justify-content:center; gap:8px; font-family:inherit; font-size:.82rem; font-weight:800;
    box-shadow:0 7px 20px rgba(16,185,129,.2); transition:transform .2s ease,box-shadow .2s ease;
}
.viewer-start-chat-btn:hover { transform:translateY(-1px); box-shadow:0 9px 24px rgba(16,185,129,.3); }
.viewer-start-chat-btn svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

/* The viewer avatar must remain a true circle; remove the old mask trick that could render an oval/diamond on some browsers. */
.sheet-profile-avatar-wrap img.sheet-avatar { -webkit-mask:none !important; mask:none !important; border:3px solid #9b6cff !important; background:var(--btn-bg) !important; border-radius:50% !important; }
.sheet-profile-avatar-wrap .sheet-avatar-placeholder { border-radius:50% !important; }

/* Raters popup: absolute (scrolls with the page like copy/tick popovers), list scrolls inside. */
.raters-floating-popup {
    position:absolute !important; width:min(360px,calc(100vw - 24px)) !important;
    max-height:min(62vh,460px) !important; min-height:150px; border-radius:18px;
    z-index:2147482000;
}
.raters-floating-list { overflow-y:auto !important; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; scrollbar-width:thin; }
.raters-floating-list::-webkit-scrollbar { width:5px; }
.raters-floating-list::-webkit-scrollbar-thumb { background:rgba(156,163,175,.35); border-radius:999px; }
.raters-floating-close { width:30px; height:30px; border-radius:9px; }
.raters-floating-row { min-height:52px; }
.guest-count-badge { width:20px; min-width:20px; height:20px; padding:0; top:-4px; right:-5px; border-width:2px; font-size:.6rem; }


/* ── چشم نمایش رمز (نگه‌داشتن) ── */
.password-field-wrap { position: relative; width: 100%; }
.password-field-wrap .password-field-input { padding-right: 44px; }
.password-eye-btn {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border: none; border-radius: 10px; cursor: pointer;
    background: transparent; display: flex; align-items: center; justify-content: center;
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none;
}
.password-eye-btn .eye-icon { width: 20px; height: 20px; fill: none; stroke: var(--subtext-color); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-eye-btn .eye-closed { display: none; }
.password-eye-btn.revealing .eye-open { display: none; }
.password-eye-btn.revealing .eye-closed { display: block; stroke: var(--phase-color); }


/* ── ردیف رأی مهمان: عدد روی آیکون، بیرون از دایره‌ی بریده‌شده ── */
.guest-avatar-wrap { position: relative; width: 36px; height: 36px; flex: 0 0 36px; }
.guest-avatar-wrap .raters-floating-avatar { width: 36px; height: 36px; min-width: 36px; max-width: 36px; flex: none; }
.guest-avatar-wrap .guest-count-badge {
    position: absolute !important; top: -7px !important; right: -8px !important; left: auto !important;
    min-width: 22px !important; height: 22px !important; padding: 0 5px !important;
    font-size: .72rem !important; font-weight: 900 !important; z-index: 2;
    background: #fbbf24 !important; color: #111827 !important; border: 2px solid var(--popover-bg) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.45); box-sizing: border-box;
}
.raters-floating-name.guest-name { display: block; width: fit-content; align-self: flex-start; unicode-bidi: isolate; }


/* ═══════════════════════════════════════════════════════════
   💬 CHAT (cx-*) — Telegram-style
   ═══════════════════════════════════════════════════════════ */
.cx-iconbtn {
    width: 46px; height: 46px; min-width: 46px; border-radius: 50%; border: 1px solid var(--item-border);
    background: var(--popover-bg); color: var(--text-color); cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; padding: 0;
    -webkit-tap-highlight-color: transparent; transition: transform .2s ease, background .2s ease;
}
.cx-iconbtn:active { transform: scale(.92); }
.cx-iconbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cx-iconbtn.sm { width: 32px; height: 32px; min-width: 32px; border-radius: 10px; border-color: transparent; background: var(--btn-bg); }
.cx-iconbtn.sm svg { width: 16px; height: 16px; }
.cx-iconbtn.flat { border: none; background: transparent; color: var(--subtext-color); width: 40px; height: 40px; min-width: 40px; }

/* آواتار */
.cx-av-wrap { position: relative; width: 48px; height: 48px; flex: 0 0 48px; }
.cx-av { position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.cx-av-wrap .cx-av { width: 48px; height: 48px; }
.cx-av-fb { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 1.15rem; }
.cx-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cx-dot { position: absolute; right: 0; bottom: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--online-color); border: 2.5px solid var(--popover-bg); }

/* ── شیت لیست گفتگوها ── */
.cx-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 10px; direction: rtl; }
.cx-sheet-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.05rem; color: var(--text-color); }
.cx-sheet-title svg { width: 20px; height: 20px; fill: none; stroke: #c084fc; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cx-sheet-search { display: flex; align-items: center; gap: 8px; margin: 0 16px 10px; padding: 0 12px; border-radius: 14px; background: var(--btn-bg); border: 1px solid var(--btn-border); direction: rtl; }
.cx-sheet-search svg { width: 17px; height: 17px; fill: none; stroke: var(--subtext-color); stroke-width: 2; stroke-linecap: round; }
.cx-sheet-search input { flex: 1; min-width: 0; padding: 11px 0; border: none; outline: none; background: transparent; color: var(--text-color); font-family: inherit; font-size: .85rem; }
.cx-list { flex: 1; overflow-y: auto; padding: 0 10px 24px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.cx-li { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; border: none; border-radius: 16px; background: transparent; cursor: pointer; font-family: inherit; color: var(--text-color); text-align: right; direction: rtl; transition: background .2s ease; }
.cx-li:hover, .cx-li:active { background: var(--btn-bg); }
.cx-li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cx-li-top, .cx-li-bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cx-li-name { font-weight: 800; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-li-time { font-size: .68rem; color: var(--subtext-color); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.cx-li-prev { flex: 1; min-width: 0; font-size: .78rem; color: var(--subtext-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-li-prev b { color: #c084fc; font-weight: 700; }
.cx-unread { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: linear-gradient(135deg, #c084fc, #8b5cf6); color: #fff; font-size: .7rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cx-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 44px 20px; text-align: center; color: var(--subtext-color); font-size: .88rem; }
.cx-empty svg { width: 46px; height: 46px; fill: none; stroke: var(--subtext-color); stroke-width: 1.5; opacity: .5; }
.cx-empty small { font-size: .72rem; opacity: .8; line-height: 1.8; }

/* ── صفحه‌ی چت ── */
#chatPage.cx-page {
    position: fixed; left: 0; right: 0; top: 0; bottom: auto; inset: 0 0 auto 0; height: 100%;
    display: flex; flex-direction: column; direction: ltr; z-index: 2147482000; overflow: hidden;
    background: var(--bg-color);
    background-image:
        radial-gradient(circle at 15% 8%, rgba(139, 92, 246, .16), transparent 42%),
        radial-gradient(circle at 85% 92%, rgba(251, 191, 36, .08), transparent 45%),
        radial-gradient(rgba(255, 255, 255, .045) 1px, transparent 1.3px);
    background-size: auto, auto, 22px 22px;
    visibility: hidden; pointer-events: none; transform: translateX(100%);
    transition: transform .35s cubic-bezier(.22, 1, .36, 1), visibility 0s linear .35s;
}
#chatPage.cx-page.show { visibility: visible; pointer-events: auto; transform: none; transition: transform .35s cubic-bezier(.22, 1, .36, 1), visibility 0s; }
[data-theme="light"] #chatPage.cx-page {
    background-image:
        radial-gradient(circle at 15% 8%, rgba(139, 92, 246, .14), transparent 42%),
        radial-gradient(circle at 85% 92%, rgba(251, 191, 36, .12), transparent 45%),
        radial-gradient(rgba(15, 23, 42, .06) 1px, transparent 1.3px);
}
body.cx-chat-open #viewerProfileSheet { z-index: 2147483001 !important; }
body.cx-chat-open #viewerProfileSheetOverlay { z-index: 2147483000 !important; }

.cx-head { position: relative; display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 12px 8px; flex-shrink: 0; z-index: 5; }
.cx-peer { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 54px; padding: 3px 14px 3px 4px; border-radius: 27px; background: var(--popover-bg); border: 1px solid var(--item-border); cursor: pointer; direction: ltr; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.cx-peer .cx-av-wrap { width: 46px; height: 46px; flex-basis: 46px; }
.cx-peer .cx-av-wrap .cx-av { width: 46px; height: 46px; }
.cx-peer-info { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cx-name { font-weight: 800; font-size: 1rem; color: var(--text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.cx-status { font-size: .74rem; color: var(--subtext-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 3px; }
.cx-status.online { color: var(--online-color); }
.cx-status.typing { color: #60a5fa; }
.cx-dots { display: inline-flex; gap: 2px; align-items: flex-end; height: 10px; margin-inline-start: 1px; }
.cx-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: cxDot 1.2s infinite ease-in-out; }
.cx-dots i:nth-child(2) { animation-delay: .15s; }
.cx-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes cxDot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

.cx-dd { position: absolute; top: calc(100% - 2px); right: 12px; min-width: 220px; padding: 6px; border-radius: 16px; background: var(--popover-bg); border: 1px solid var(--item-border); box-shadow: 0 14px 40px rgba(0, 0, 0, .5); z-index: 20; }
.cx-dd[hidden] { display: none; }
.cx-dd button, .cx-actions > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: none; border-radius: 11px; background: transparent; color: var(--text-color); font-family: inherit; font-size: .85rem; cursor: pointer; text-align: start; direction: rtl; }
.cx-dd button:active, .cx-actions > button:active { background: var(--btn-bg); }
.cx-dd button svg, .cx-actions > button svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cx-dd button.danger, .cx-actions > button.danger { color: #f87171; }

.cx-searchbar { display: flex; align-items: center; gap: 8px; margin: 0 12px 6px; padding: 0 8px 0 14px; border-radius: 16px; background: var(--popover-bg); border: 1px solid var(--item-border); flex-shrink: 0; z-index: 4; }
.cx-searchbar[hidden] { display: none; }
.cx-searchbar svg { width: 17px; height: 17px; fill: none; stroke: var(--subtext-color); stroke-width: 2; stroke-linecap: round; }
.cx-searchbar input { flex: 1; min-width: 0; padding: 12px 0; border: none; outline: none; background: transparent; color: var(--text-color); font-family: inherit; font-size: .88rem; }

/* بدنه‌ی پیام‌ها */
.cx-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 6px 12px 12px; display: flex; flex-direction: column; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scroll-behavior: auto; }
.cx-body::-webkit-scrollbar { width: 4px; }
.cx-body::-webkit-scrollbar-thumb { background: rgba(156, 163, 175, .3); border-radius: 99px; }
.cx-body > :first-child { margin-top: auto; }
.cx-loading { display: flex; gap: 6px; justify-content: center; padding: 30px; margin: auto; }
.cx-loading i { width: 9px; height: 9px; border-radius: 50%; background: #c084fc; animation: cxDot 1.1s infinite ease-in-out; }
.cx-loading i:nth-child(2) { animation-delay: .15s; } .cx-loading i:nth-child(3) { animation-delay: .3s; }
.cx-more { align-self: center; margin: 8px 0 12px; padding: 8px 16px; border-radius: 99px; border: 1px solid var(--item-border); background: var(--popover-bg); color: var(--subtext-color); font-family: inherit; font-size: .75rem; cursor: pointer; }
.cx-day { align-self: center; margin: 14px 0 8px; }
.cx-day span { display: inline-block; padding: 4px 13px; border-radius: 99px; font-size: .72rem; font-weight: 700; color: var(--text-color); background: rgba(14, 14, 24, .72); border: 1px solid var(--item-border); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
[data-theme="light"] .cx-day span { background: rgba(255, 255, 255, .85); }

.cx-row { display: flex; max-width: 100%; margin-top: 8px; transition: transform .18s ease; position: relative; }
.cx-row.g-mid { margin-top: 2px; }
.cx-row.mine { justify-content: flex-end; }
.cx-row.their { justify-content: flex-start; }
.cx-row::before { content: ''; position: absolute; top: 50%; width: 30px; height: 30px; margin-top: -15px; border-radius: 50%; opacity: 0; transition: opacity .15s ease; background: rgba(192, 132, 252, .25) center / 16px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c084fc' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14L4 9l5-5'/%3E%3Cpath d='M4 9h10a6 6 0 0 1 6 6v3'/%3E%3C/svg%3E"); }
.cx-row.mine::before { right: -40px; } .cx-row.their::before { left: -40px; }
.cx-row.swiping::before { opacity: 1; }
.cx-row.flash .cx-bub { animation: cxFlash 1.3s ease; }
@keyframes cxFlash { 0%, 60% { box-shadow: 0 0 0 3px rgba(251, 191, 36, .75); } 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); } }

.cx-bub { position: relative; max-width: min(82%, 520px); min-width: 64px; padding: 7px 10px 6px; border-radius: 18px; color: var(--text-color); font-size: .95rem; line-height: 1.7; word-break: break-word; overflow-wrap: anywhere; cursor: pointer; -webkit-tap-highlight-color: transparent; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.cx-row.their .cx-bub { background: var(--popover-bg); border: 1px solid var(--item-border); border-bottom-left-radius: 6px; }
.cx-row.mine .cx-bub { background: linear-gradient(135deg, #4a3a8c, #33276c); border: 1px solid rgba(167, 139, 250, .25); border-bottom-right-radius: 6px; color: #f5f3ff; }
[data-theme="light"] .cx-row.mine .cx-bub { background: linear-gradient(135deg, #e9defd, #ddd0fb); color: #1e1b4b; border-color: rgba(124, 58, 237, .2); }
.cx-row.their.g-mid .cx-bub { border-top-left-radius: 6px; } .cx-row.their:not(.g-last) .cx-bub { border-bottom-left-radius: 6px; }
.cx-row.mine.g-mid .cx-bub { border-top-right-radius: 6px; } .cx-row.mine:not(.g-last) .cx-bub { border-bottom-right-radius: 6px; }
.cx-text { white-space: pre-wrap; }
.cx-text::after { content: ''; display: table; clear: both; }
.cx-text a { color: #7dd3fc; text-decoration: underline; word-break: break-all; }
[data-theme="light"] .cx-text a { color: #1d4ed8; }
.cx-meta { float: right; margin: 7px 0 -3px 10px; display: inline-flex; align-items: center; gap: 4px; font-size: .66rem; line-height: 1; opacity: .75; direction: ltr; white-space: nowrap; user-select: none; }
.cx-meta em { font-style: normal; opacity: .85; }
.cx-meta time { font-variant-numeric: tabular-nums; }

/* تیک‌ها: آبی = ارسال شده/دیده نشده — سبز = دیده شد */
.cx-tick { display: inline-flex; }
.cx-tk { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cx-tick.sent { color: #60a5fa; }
.cx-tick.seen { color: #34d399; }
.cx-tick.pending { color: #9ca3af; }
.cx-meta .cx-tick { opacity: 1; }
[data-theme="light"] .cx-tick.sent { color: #2563eb; }
[data-theme="light"] .cx-tick.seen { color: #059669; }
.cx-tick.pending .cx-tk { width: 13px; height: 13px; stroke-width: 2; }

.cx-quote { margin: 0 0 5px; padding: 4px 8px; border-radius: 8px; border-left: 3px solid #c084fc; background: rgba(192, 132, 252, .14); display: flex; flex-direction: column; gap: 1px; cursor: pointer; font-size: .8rem; line-height: 1.5; overflow: hidden; }
.cx-quote b { color: #c084fc; font-size: .75rem; }
.cx-quote span { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; clear: both; }
.cx-react { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--item-border); background: rgba(255, 255, 255, .08); color: inherit; font-size: .85rem; cursor: pointer; font-family: inherit; }
.cx-react.me { border-color: #c084fc; background: rgba(192, 132, 252, .22); }
.cx-react i { font-style: normal; font-size: .68rem; font-weight: 800; }

/* دکمه‌ی پایین */
.cx-fab { position: absolute; right: 16px; bottom: calc(var(--cx-compose-h, 74px) + 14px); width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--item-border); background: var(--popover-bg); color: var(--text-color); display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 6; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); opacity: 0; transform: scale(.6) translateY(14px); pointer-events: none; transition: all .25s cubic-bezier(.34, 1.56, .64, 1); }
.cx-fab.show { opacity: 1; transform: none; pointer-events: auto; }
.cx-fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cx-fab-n { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: linear-gradient(135deg, #c084fc, #8b5cf6); color: #fff; font-size: .7rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.cx-fab-n[hidden] { display: none; }

/* نوار نوشتن */
.cx-compose { flex-shrink: 0; padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); z-index: 5; display: flex; flex-direction: column; gap: 6px; }
.cx-reply { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 18px; background: var(--popover-bg); border: 1px solid var(--item-border); direction: ltr; }
.cx-reply[hidden] { display: none; }
.cx-reply-ic svg { width: 20px; height: 20px; fill: none; stroke: #c084fc; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cx-reply-bar { width: 3px; align-self: stretch; border-radius: 3px; background: #c084fc; }
.cx-reply-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: .8rem; }
.cx-reply-body b { color: #c084fc; font-size: .78rem; }
.cx-reply-body span { color: var(--subtext-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-inputrow { display: flex; align-items: flex-end; gap: 6px; padding: 5px 5px 5px 8px; border-radius: 28px; background: var(--popover-bg); border: 1px solid var(--item-border); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.cx-inputrow textarea { flex: 1; min-width: 0; max-height: 120px; resize: none; border: none; outline: none; background: transparent; color: var(--text-color); font-family: inherit; font-size: 1rem; line-height: 1.55; padding: 9px 4px; }
.cx-inputrow textarea::placeholder { color: var(--subtext-color); }
.cx-send { width: 42px; height: 42px; min-width: 42px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; background: var(--btn-bg); color: var(--subtext-color); transition: all .25s cubic-bezier(.34, 1.56, .64, 1); }
.cx-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cx-send.ready { background: linear-gradient(135deg, #38bdf8, #2563eb); color: #fff; box-shadow: 0 4px 14px rgba(37, 99, 235, .45); transform: scale(1.05); }
.cx-emoji { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 190px; overflow-y: auto; padding: 8px; border-radius: 18px; background: var(--popover-bg); border: 1px solid var(--item-border); }
.cx-emoji[hidden] { display: none; }
.cx-emoji button { border: none; background: transparent; font-size: 1.45rem; padding: 6px 0; border-radius: 10px; cursor: pointer; }
.cx-emoji button:active { background: var(--btn-bg); transform: scale(1.2); }

/* منوی عملیات پیام */
.cx-ov { position: absolute; inset: 0; z-index: 30; background: rgba(0, 0, 0, .55); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); opacity: 0; transition: opacity .2s ease; }
.cx-ov.show { opacity: 1; }
.cx-ov[hidden], .cx-actions[hidden] { display: none; }
.cx-actions { position: absolute; left: 50%; bottom: 0; z-index: 31; width: min(100%, 460px); transform: translate(-50%, 100%); padding: 10px 10px calc(14px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: var(--popover-bg); border: 1px solid var(--item-border); border-bottom: none; box-shadow: 0 -16px 50px rgba(0, 0, 0, .5); transition: transform .28s cubic-bezier(.22, 1, .36, 1); }
.cx-actions.show { transform: translate(-50%, 0); }
.cx-act-react { display: flex; justify-content: space-around; padding: 4px 4px 10px; }
.cx-act-react button { width: 46px; height: 46px; border-radius: 50%; border: none; background: var(--btn-bg); font-size: 1.5rem; cursor: pointer; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1); }
.cx-act-react button:active { transform: scale(1.25); }
.cx-act-react button.on { background: rgba(192, 132, 252, .28); box-shadow: 0 0 0 2px #c084fc inset; }
.cx-act-prev { margin: 0 4px 8px; padding: 9px 12px; border-radius: 12px; background: var(--btn-bg); color: var(--subtext-color); font-size: .8rem; line-height: 1.7; max-height: 76px; overflow: hidden; }
.cx-actions > button.confirm { background: rgba(239, 68, 68, .15); }


/* ═══ چت: انیمیشن‌ها، متای پایین، هدر شیشه‌ای ═══ */
.cx-row.fx-in .cx-bub { animation: cxSend .32s cubic-bezier(.2,.9,.3,1.2) both; transform-origin: bottom; }
.cx-row.mine.fx-in .cx-bub { transform-origin: bottom right; }
.cx-row.their.fx-in .cx-bub { transform-origin: bottom left; }
@keyframes cxSend { from { opacity: 0; transform: translateY(14px) scale(.9); } to { opacity: 1; transform: none; } }
.cx-row.fx-edit .cx-bub { animation: cxEdit .6s ease both; }
@keyframes cxEdit { 0% { box-shadow: 0 0 0 0 rgba(167,139,250,.7); transform: scale(.97); } 40% { transform: scale(1.025); } 100% { box-shadow: 0 0 0 10px rgba(167,139,250,0); transform: none; } }
.cx-row.dust { pointer-events: none; }
.cx-row.dust .cx-bub { animation: cxDust .42s ease-in forwards; will-change: transform, opacity, filter; }
@keyframes cxDust { 0% { opacity: 1; filter: blur(0); transform: none; } 100% { opacity: 0; filter: blur(7px) saturate(0); transform: translate(var(--dx,14px), -22px) scale(.82) rotate(3deg); } }
.cx-row.their.dust .cx-bub { --dx: -14px; }
.cx-t { display: block; text-align: start; unicode-bidi: plaintext; }
.cx-text { display: flex; flex-direction: column; }
.cx-meta { float: none !important; align-self: flex-end; margin: 3px 0 -2px !important; }
.cx-text::after { display: none; }
.cx-page { position: relative; }
.cx-head { position: absolute !important; top: 0; left: 0; right: 0; z-index: 20 !important; background: linear-gradient(to bottom, rgba(10,10,20,.55), rgba(10,10,20,0)); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); }
[data-theme="light"] .cx-head { background: linear-gradient(to bottom, rgba(255,255,255,.65), rgba(255,255,255,0)); }
.cx-body { padding-top: calc(env(safe-area-inset-top, 0px) + 86px) !important; }
@media (prefers-reduced-motion: reduce) { .cx-row .cx-bub { animation: none !important; } }

/* ═══ اعتبار اجتماعی ═══ */
.viewer-rep-card { display: flex; align-items: center; gap: 12px; margin: 12px 0; padding: 12px 14px; border-radius: 18px; background: var(--popover-bg); border: 1px solid var(--item-border); }
.rep-shield { position: relative; width: 46px; height: 52px; flex: none; display: grid; place-items: center; }
.rep-shield svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: rgba(59,130,246,.18); stroke: #3b82f6; stroke-width: 1.6; stroke-linejoin: round; }
.rep-shield b { position: relative; font-size: .95rem; font-weight: 800; color: #60a5fa; font-variant-numeric: tabular-nums; }
.rep-copy { flex: 1; display: flex; flex-direction: column; gap: 2px; color: var(--text-color); }
.rep-copy small { color: var(--subtext-color); font-size: .72rem; }
.rep-btns { gap: 8px; }
.rep-btns button { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--item-border); background: transparent; display: grid; place-items: center; cursor: pointer; transition: transform .15s, background .15s; }
.rep-btns button:active { transform: scale(.9); }
.rep-btns svg { width: 20px; height: 20px; fill: none; stroke: var(--subtext-color); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rep-btns button.on { background: rgba(59,130,246,.18); border-color: #3b82f6; }
.rep-btns button.on svg { stroke: #60a5fa; }

/* ═══ قیمت‌ها: کارت مدرن ═══ */
.market-widgets { display: grid !important; grid-template-columns: 1fr !important; gap: 14px !important; }
.market-card { position: relative; overflow: hidden; border-radius: 26px !important; padding: 18px 18px 86px !important; background: var(--popover-bg) !important; border: 1px solid var(--item-border) !important; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.market-card-sparkline { position: absolute !important; left: 0; right: 0; bottom: 0; height: 92px !important; pointer-events: none; opacity: .95; }
.market-card-label { font-size: .7rem; letter-spacing: .08em; opacity: .6; margin-top: 10px; }
.market-card-value { font-size: 2rem !important; font-weight: 800 !important; font-variant-numeric: tabular-nums; line-height: 1.2; }
.market-card-change { display: inline-flex; align-items: center; margin-top: 6px; padding: 3px 12px; border-radius: 99px; font-size: .8rem; font-weight: 700; background: rgba(148,163,184,.14); }
.spark-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: sparkDraw 1.1s ease forwards; }
@keyframes sparkDraw { to { stroke-dashoffset: 0; } }
.chart-popup-body svg { width: 100%; height: auto; color: var(--text-color); overflow: visible; }

/* ═══ نظرات (ردیتی) ═══ */
.cm-open { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 14px 7px 12px; border-radius: 99px; border: 1px solid var(--item-border); background: var(--popover-bg); color: var(--text-color); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.cm-open > svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cm-open .cm-n { opacity: .7; font-variant-numeric: tabular-nums; }
.cm-stack { display: inline-flex; direction: ltr; }
.cm-stack .cm-av { width: 20px; height: 20px; margin-left: -7px; border: 2px solid var(--popover-bg); }
.cm-stack .cm-av:first-child { margin-left: 0; }
.cm-av { position: relative; display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, #7c3aed, #3b82f6); color: #fff; font-size: .7rem; font-weight: 800; }
.cm-av.lg { width: 34px; height: 34px; }
.cm-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cm-av i { font-style: normal; }
.cm-ov { position: fixed; inset: 0; z-index: 2147482000; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .25s; }
.cm-ov.on { opacity: 1; pointer-events: auto; }
.cm-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2147482001; max-height: 86vh; height: 86vh; display: flex; flex-direction: column; border-radius: 26px 26px 0 0; background: var(--popover-bg); border: 1px solid var(--item-border); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); transform: translateY(100%); transition: transform .32s cubic-bezier(.2,.9,.3,1); color: var(--text-color); }
.cm-sheet.on { transform: none; }
.cm-grab { width: 40px; height: 4px; border-radius: 9px; background: var(--item-border); margin: 8px auto 0; }
.cm-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 4px; font-size: 1rem; }
.cm-x, .cm-send, .cm-a button, .cm-rep button { background: none; border: 0; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: inherit; }
.cm-sheet svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cm-tabs { display: flex; gap: 6px; padding: 6px 16px 10px; }
.cm-tabs button { padding: 5px 13px; border-radius: 99px; border: 1px solid var(--item-border); background: transparent; color: var(--subtext-color); font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
.cm-tabs button.on { background: rgba(124,58,237,.2); color: var(--text-color); border-color: rgba(167,139,250,.5); }
.cm-list { flex: 1; overflow-y: auto; padding: 4px 16px 12px; overscroll-behavior: contain; }
.cm-c { display: flex; gap: 10px; padding: 9px 0; transition: opacity .3s, transform .3s; animation: cmIn .3s ease both; }
.cm-c.rep { margin-inline-start: 22px; padding-inline-start: 12px; border-inline-start: 2px solid var(--item-border); }
.cm-c.gone { opacity: 0; transform: scale(.94); }
@keyframes cmIn { from { opacity: 0; transform: translateY(8px); } }
.cm-b { flex: 1; min-width: 0; }
.cm-h { display: flex; gap: 8px; align-items: baseline; font-size: .82rem; } .cm-h span { color: var(--subtext-color); font-size: .7rem; }
.cm-t { margin-top: 2px; font-size: .92rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; unicode-bidi: plaintext; text-align: start; }
.cm-a { display: flex; gap: 14px; margin-top: 4px; color: var(--subtext-color); font-size: .74rem; }
.cm-a button.on { color: #f97316; } .cm-a button i { font-style: normal; font-variant-numeric: tabular-nums; }
.cm-empty { text-align: center; padding: 40px 0; color: var(--subtext-color); }
.cm-comp { padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--item-border); }
.cm-rep { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 8px; font-size: .74rem; color: var(--subtext-color); }
.cm-row { display: flex; gap: 8px; align-items: flex-end; }
.cm-row textarea { flex: 1; resize: none; max-height: 110px; padding: 10px 14px; border-radius: 20px; border: 1px solid var(--item-border); background: rgba(148,163,184,.1); color: var(--text-color); font: inherit; font-size: .92rem; outline: none; }
.cm-send { width: 42px; height: 42px; justify-content: center; border-radius: 50%; background: linear-gradient(135deg, #7c3aed, #3b82f6); color: #fff; }

/* ═══ کادر فیلم داخل چت ═══ */
.cm-share { margin-inline-start: 6px; }
.cx-mv { display: flex; align-items: center; gap: 10px; margin: 2px 0 6px; padding: 9px 12px; border-radius: 14px; background: rgba(124,58,237,.16); border: 1px solid rgba(167,139,250,.35); cursor: pointer; min-width: 190px; }
.cx-mv-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, #7c3aed, #3b82f6); flex: none; }
.cx-mv-ic svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cx-mv-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; } .cx-mv-tx b { font-size: .88rem; } .cx-mv-tx small { opacity: .65; font-size: .72rem; }
.cx-mv-go { opacity: .6; font-size: 1.3rem; }
.cx-pick { height: auto !important; max-height: 70vh; }
.cx-pick-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 6px; background: none; border: 0; border-bottom: 1px solid var(--item-border); color: var(--text-color); font: inherit; cursor: pointer; text-align: start; }
.item.mv-flash { animation: mvFlash 1.8s ease; }
@keyframes mvFlash { 0%, 60% { box-shadow: 0 0 0 3px rgba(167,139,250,.9); } 100% { box-shadow: 0 0 0 0 rgba(167,139,250,0); } }

/* ═══ ذخیره‌شده‌ها / ارسال مجدد ═══ */
.cm-save { margin-inline-start: 6px; } .cm-save.on { color: #f59e0b; border-color: rgba(245,158,11,.5); } .cm-save.on svg { fill: currentColor; }
.cx-saved-row { display: flex; align-items: center; gap: 12px; width: calc(100% - 24px); margin: 6px 12px; padding: 11px 14px; border-radius: 16px; border: 1px solid var(--item-border); background: rgba(245,158,11,.1); color: inherit; font: inherit; cursor: pointer; }
.cx-saved-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #f59e0b, #ef4444); }
.cx-fwd { font-size: .7rem; opacity: .7; margin-bottom: 3px; }
.sv-sheet { z-index: 2147482002; }
.sv-filters { flex-wrap: wrap; } .sv-filters button.tag { color: #60a5fa; }
.sv-item { padding: 8px 0; border-bottom: 1px solid var(--item-border); }
.sv-msg { padding: 10px 12px; border-radius: 14px; background: rgba(148,163,184,.12); font-size: .9rem; line-height: 1.7; white-space: pre-wrap; unicode-bidi: plaintext; text-align: start; }
.sv-msg small { display: block; opacity: .6; font-size: .7rem; margin-bottom: 2px; }
.sv-act { display: flex; gap: 8px; margin-top: 6px; }
.sv-act button { padding: 3px 11px; border-radius: 99px; border: 1px solid var(--item-border); background: transparent; color: var(--subtext-color); font: inherit; font-size: .74rem; cursor: pointer; }

/* ═══ عکس و ویس در چت ═══ */
.cx-compose { position: relative; }
.cx-media.img { width: min(260px, 62vw); border-radius: 14px; overflow: hidden; background: rgba(148,163,184,.18); margin: 2px 0 4px; cursor: zoom-in; }
.cx-media.img img { display: block; width: 100%; height: 100%; object-fit: cover; animation: cxSend .3s ease both; }
.cx-media-ph { display: block; width: 100%; height: 100%; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.12) 50%, transparent 70%) 0 0 / 200% 100%; animation: cxShim 1.2s linear infinite; }
@keyframes cxShim { to { background-position: -200% 0; } }
.cx-media.voice { display: flex; align-items: center; gap: 10px; min-width: 200px; padding: 4px 2px; direction: ltr; }
.cx-vplay { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0; background: linear-gradient(135deg, #7c3aed, #3b82f6); color: #fff; font-size: .8rem; cursor: pointer; }
.cx-vbar { flex: 1; height: 4px; border-radius: 9px; background: rgba(148,163,184,.35); overflow: hidden; } .cx-vbar i { display: block; height: 100%; width: 0; background: #a78bfa; }
.cx-media.voice small { opacity: .7; font-size: .72rem; font-variant-numeric: tabular-nums; }
.cx-rec { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--popover-bg); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.cx-rec[hidden] { display: none; }
.cx-rec button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(148,163,184,.2); color: inherit; font-size: 1rem; cursor: pointer; }
.cx-rec .cx-rec-send { margin-inline-start: auto; background: linear-gradient(135deg, #7c3aed, #3b82f6); color: #fff; }
.cx-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; animation: cxPulse 1s ease infinite; }
@keyframes cxPulse { 50% { opacity: .25; transform: scale(.8); } }
.cx-rec-hint { opacity: .6; font-size: .8rem; }
.cx-viewer { position: fixed; inset: 0; z-index: 2147483600; background: rgba(0,0,0,.92); display: grid; place-items: center; }
.cx-viewer img { max-width: 100%; max-height: 82vh; object-fit: contain; }
.cx-viewer-bar { position: absolute; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; gap: 12px; }
.cx-viewer-bar a, .cx-viewer-bar button { padding: 10px 18px; border-radius: 99px; border: 0; background: rgba(255,255,255,.16); color: #fff; font: inherit; text-decoration: none; cursor: pointer; }

.stack-avatar { background: rgba(148,163,184,.25); object-fit: cover; }

/* ═══ اصلاحات: کیبورد تاریخ، بیو، دکمه‌های کادر فیلم، عکس چت، نمره نظر ═══ */
.birth-numpad-overlay, .month-wheel-overlay { z-index: 2147483200 !important; }
.birth-numpad-popup, .month-wheel-popup { z-index: 2147483201 !important; }
.birth-input-popup { z-index: 2147483100 !important; }
.sheet-info-value.bio-val { text-align: start; unicode-bidi: plaintext; white-space: pre-wrap; word-break: break-word; }
#editBio { unicode-bidi: plaintext; text-align: start; }
.cm-open.cm-share, .cm-open.cm-save { padding: 0 !important; width: 38px; height: 38px; justify-content: center; margin-inline: 0 6px; }
.cm-open.cm-share .cm-label, .cm-open.cm-save .cm-label { display: none; }
.cx-media.img { width: min(200px, 52vw) !important; max-height: 240px; cursor: zoom-in; }
.cx-media.img img { width: 100%; height: 100%; object-fit: cover; }
.cm-un { font-style: normal; opacity: .6; font-size: .7rem; }
.cm-rt { padding: 1px 8px; border-radius: 99px; background: rgba(245,158,11,.18); color: #fbbf24; font-size: .7rem; font-weight: 800; }

/* کیبورد تاریخ تولد و چرخ ماه همیشه بالای همه‌ی پنجره‌ها */
.birth-numpad-overlay, .month-wheel-overlay { z-index: 2147483000 !important; }
.birth-numpad-popup, .month-wheel-popup { z-index: 2147483001 !important; }

/* ═══ ویرایش پروفایل: نام و نام خانوادگی داخل کادر بمانند ═══ */
#editFirstName, #editLastName { min-width: 0 !important; width: 100% !important; flex: 1 1 0 !important; box-sizing: border-box !important; }
#editFirstName, #editLastName { text-overflow: ellipsis; }
#editProfileSheet input, #editProfileSheet textarea { max-width: 100%; box-sizing: border-box; }

/* ═══ چت: ساعت و سین همیشه سمت راست زیر پیام ═══ */
.cx-text { direction: ltr; }
.cx-meta { align-self: flex-end !important; }

/* ═══ چت روی تبلت و PC: پنل کناری به‌جای تمام‌صفحه ═══ */
@media (min-width: 700px) {
    #chatPage.cx-page { left: auto !important; right: 0 !important; width: min(620px, 100%); border-left: 1px solid var(--item-border); box-shadow: -24px 0 70px rgba(0,0,0,.45); }
    .cx-bub { max-width: min(78%, 460px); }
}

/* ═══ تم شیشه‌ای چت ═══ */
.cx-row.their .cx-bub { background: rgba(30, 27, 55, .55) !important; -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); border-color: rgba(255,255,255,.1) !important; }
.cx-row.mine .cx-bub { background: linear-gradient(135deg, rgba(99,70,200,.78), rgba(60,42,140,.72)) !important; -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); border-color: rgba(255,255,255,.16) !important; box-shadow: 0 6px 22px rgba(60,42,140,.28); }
[data-theme="light"] .cx-row.their .cx-bub { background: rgba(255,255,255,.62) !important; border-color: rgba(15,23,42,.08) !important; }
[data-theme="light"] .cx-row.mine .cx-bub { background: linear-gradient(135deg, rgba(233,222,253,.9), rgba(221,208,251,.85)) !important; }
.cx-compose { background: rgba(20, 18, 40, .5); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); border-top: 1px solid rgba(255,255,255,.08); }
[data-theme="light"] .cx-compose { background: rgba(255,255,255,.6); border-top-color: rgba(15,23,42,.08); }
.cx-media.img { width: min(210px, 56vw) !important; max-height: 230px; } .cx-media.img img { object-fit: cover; }

/* ═══ دکمه‌های آیکونی سیو/اشتراک زیر کادر فیلم + آیکون‌های یکدست ═══ */
.cm-ic { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin-top: 10px; margin-inline-start: 6px; border-radius: 50%; border: 1px solid var(--item-border); background: var(--popover-bg); color: var(--text-color); cursor: pointer; padding: 0; transition: transform .15s, background .15s; }
.cm-ic:active { transform: scale(.9); }
.cm-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cm-ic .cm-label { display: none; }
.cm-ic.cm-save.on { color: #f59e0b; border-color: rgba(245,158,11,.5); background: rgba(245,158,11,.12); } .cm-ic.cm-save.on svg { fill: currentColor; }
.cx-fwd { display: flex; align-items: center; gap: 5px; } .cx-fwd svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#cxActions button svg, #cxDD button svg, .sv-act svg, .cm-a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sv-act button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 32px; padding: 0; }
.cx-pick-tx { display: flex; flex-direction: column; min-width: 0; text-align: start; } .cx-pick-tx small { opacity: .6; font-size: .72rem; }
.sv-msg small { display: flex; align-items: center; gap: 4px; } .sv-msg small svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ═══ اسپویلر، نقل‌قول، سؤال، کامنت پاک‌شده، نمره ═══ */
.sp { background: rgba(148,163,184,.35); color: transparent; border-radius: 6px; padding: 0 4px; cursor: pointer; filter: blur(5px); transition: filter .2s, color .2s, background .2s; user-select: none; }
.sp.on { filter: none; color: inherit; background: rgba(148,163,184,.18); user-select: text; }
.qt { display: block; margin: 3px 0; padding: 3px 10px; border-inline-start: 3px solid #60a5fa; background: rgba(96,165,250,.1); border-radius: 4px 10px 10px 4px; opacity: .92; }
.cm-h em { font-style: normal; opacity: .6; font-size: .72rem; }
.cm-rt { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 99px; background: rgba(245,158,11,.16); color: #f59e0b; font-size: .72rem; font-weight: 800; }
.cm-rt svg { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.cm-qb { display: inline-flex; align-items: center; gap: 3px; color: #60a5fa; font-size: .72rem; font-weight: 700; } .cm-qb svg { width: 13px; height: 13px; }
.cm-c.q > .cm-b { border-inline-start: 3px solid #3b82f6; padding-inline-start: 10px; }
.cm-delbox { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; border-radius: 12px; background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.4); color: #f87171; font-size: .85rem; }
.cm-delbox svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cm-tools { display: flex; gap: 6px; padding: 2px 6px 8px; overflow-x: auto; }
.cm-tools button { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--item-border); background: transparent; color: var(--subtext-color); font: inherit; font-size: .74rem; cursor: pointer; white-space: nowrap; }
.cm-tools button.on { background: rgba(59,130,246,.18); border-color: #3b82f6; color: #60a5fa; }
.cm-tools svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
