@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&display=swap');

/* ══════════════════════════════════════════════
   انتقال الصفحات — Page Transitions
══════════════════════════════════════════════ */

/* دخول الصفحة — يظهر المحتوى بنعومة (بدون blur لتجنب ثقل الـ GPU) */
body {
    animation: bnwPageEnter 0.4s ease both;
}

@keyframes bnwPageEnter {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* طبقة التلاشي عند الخروج */
#bnw-page-veil {
    position: fixed;
    inset: 0;
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
    background: #efe6d6;
    transition: opacity 0.28s cubic-bezier(0.4, 0, 1, 1);
}
[data-theme="dark"] #bnw-page-veil { background: #0e0818; }
.profile-page ~ #bnw-page-veil,
#bnw-page-veil.from-profile { background: #fef6ff; }
[data-theme="dark"] .profile-page ~ #bnw-page-veil,
[data-theme="dark"] #bnw-page-veil.from-profile { background: #0e0818; }

#bnw-page-veil.bnw-exiting {
    opacity: 1;
    pointer-events: all;
}

body {
    background-color: #efe6d6;
    background-image:
            radial-gradient(circle at 20% 20%, rgba(196,151,58,0.06) 0%, transparent 50%),
            radial-gradient(circle at 80% 80%, rgba(139,38,53,0.05) 0%, transparent 50%);
}


.hero-logo {
    width: 300px;
    max-width: 80%;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.3));
    display: block;
    margin: 0 auto;
}
/* --- زر اللغة المخصص --- */
.lang-switcher {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 1100;
    direction: ltr;
    unicode-bidi: isolate;
}
.lang-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 999px;
    border: none;
    background: white;
    color: #5a1a60;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
    transition: box-shadow 0.2s, transform 0.15s;
    letter-spacing: 0.5px;
}
.lang-btn:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.22); transform: translateY(-1px); }
.lang-arrow { font-size: 9px; opacity: 0.5; margin-left: 2px; }

/* القائمة المنسدلة */
.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.14);
    padding: 6px;
    min-width: 145px;
    z-index: 1200;
    border: 1px solid #f0e0f0;
}
.lang-menu.open { display: block; animation: fadeDown 0.15s ease; }
@keyframes fadeDown { from { opacity:0; transform:translateY(-6px) } to { opacity:1; transform:translateY(0) } }
.lang-opt {
    display: block;
    width: 100%;
    padding: 9px 14px;
    border: none;
    background: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #3a1a40;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s;
}
.lang-opt:hover, .lang-opt.active { background: #fde8f3; color: #b05080; }

.hero {
    position: relative;
    min-height: 380px;              /* يتمدّد للمحتوى بدل ما يقصّه */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px 16px 84px;        /* حشو سفلي يكفي فوق الموجة */
    box-sizing: border-box;
}
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.4s ease;
}
.hero-slide.active { opacity: 1; }

.hero-overlay {
    position: absolute;
    inset: 0;
    /* تعتيم أعلى ليبرز العنوان والأزرار (~65-80%) */
    background: linear-gradient(to bottom, rgba(44,18,10,0.62) 0%, rgba(44,18,10,0.80) 100%);
    z-index: 1;
}
/* اللوگو يطفو بنفس روح الكرة الأرضية سابقاً */
.hero-logo-float {
    animation: float 3.4s ease-in-out infinite;
    margin-bottom: 14px;
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 0 20px;
}
.hero-emoji {
    font-size: 3.2rem;
    margin-bottom: 10px;
    display: block;
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}
.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.2rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
    margin-bottom: 10px;
    color: #fff8e7;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,245,210,0.90);
    text-shadow: 0 1px 8px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}
.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    z-index: 3;
    line-height: 0;
}
.hero-wave svg { width: 100%; height: 80px; display: block; }

.filter-panel {
    background: #f8f1e3;
    border-radius: 16px;
    padding: 24px 28px;
    box-shadow: 0 4px 20px rgba(139,38,53,0.08), 0 1px 4px rgba(0,0,0,0.05);
    border: 1px solid #e8d5a3;
    direction: ltr;
}
.search-input {
    width: 100%;
    border: 2px solid #d4b483;
    border-radius: 999px;
    padding: 12px 24px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 20px;
    box-sizing: border-box;
    background: #efe6d6;
    color: #2c1810;
}
.search-input::placeholder { color: #b89a6a; }
.search-input:focus {
    border-color: #8B2635;
    box-shadow: 0 0 0 3px rgba(139,38,53,0.10);
}
.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    justify-content: center;
    direction: ltr;
}
.filter-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.filter-label {
    font-size: 10px;
    font-weight: 800;
    color: #b89a6a;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.gender-btn {
    padding: 8px 18px;
    border-radius: 999px;
    border: 2px solid #d4b483;
    color: #6b4c3b;
    background: #efe6d6;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.gender-btn:hover { border-color: #8B2635; color: #8B2635; }
.gender-btn.active { border-color: #8B2635; background: #8B2635; color: #fff8e7; }

.region-select {
    border: 2px solid #d4b483;
    border-radius: 999px;
    padding: 8px 20px;
    font-weight: 700;
    color: #6b4c3b;
    background: #efe6d6;
    cursor: pointer;
    transition: border-color 0.2s;
    outline: none;
}
.region-select:focus { border-color: #8B2635; }

.random-btn {
    padding: 9px 24px;
    background: linear-gradient(135deg, #C4973A, #d4a843);
    color: white;
    font-weight: 800;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 4px 14px rgba(196,151,58,0.40);
    letter-spacing: 0.3px;
}
.random-btn:hover  { opacity: 0.88; }
.random-btn:active { transform: scale(0.97); }

#names-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 18px;
}
@media (min-width: 640px)  { #names-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { #names-grid { grid-template-columns: repeat(3, 1fr); } }

.name-card {
    background: #f8f1e3;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e0c98a;
    border-left: 4px solid #d4b483;
    box-shadow: 0 2px 10px rgba(139,38,53,0.07), 0 1px 3px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}
.name-card::before {
    content: '✦';
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 10px;
    color: #d4b483;
    opacity: 0.6;
}
.name-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(139,38,53,0.12);
}
.card-male   { border-left-color: #4A7EA5; }
.card-female { border-left-color: #B85C7A; }

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.card-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #8B2635;
    line-height: 1.2;
}
.badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.badge-male   { background: #dbeafe; color: #1e4e8c; }
.badge-female { background: #fce7f3; color: #9d174d; }

.card-meaning {
    font-size: 13px;
    color: #6b4c3b;
    line-height: 1.5;
    border-left: 2px solid #e0c98a;
    padding-left: 8px;
}
.meaning-label { font-weight: 700; color: #2c1810; }

.pop-section { display: flex; flex-direction: column; gap: 5px; }
.pop-header  { display: flex; justify-content: space-between; align-items: center; }
.pop-label   { font-size: 12px; font-weight: 600; color: #8a6a4a; }
.pop-percent { font-size: 12px; font-weight: 800; color: #2c1810; }
.pop-bar-bg {
    height: 6px;
    background: #ede0c4;
    border-radius: 999px;
    overflow: hidden;
}
.pop-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.7s ease;
}
.bar-red    { background: linear-gradient(90deg, #c0392b, #8B2635); }
.bar-yellow { background: linear-gradient(90deg, #d4a843, #C4973A); }
.bar-green  { background: linear-gradient(90deg, #6b8f5e, #4A5240); }
.bar-purple { background: linear-gradient(90deg, #8a6a4a, #6b4c3b); }
.bar-gray   { background: #c8b89a; }

.card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #b89a6a;
    padding-top: 8px;
    border-top: 1px dashed #e0c98a;
}
.origin      { font-weight: 700; color: #8a6a4a; }
.region-name { font-style: italic; }

/* ── Pagination — تصميم جديد ── */
#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin: 32px auto 48px;
    width: fit-content;
    background: #fff;
    border: 1.5px solid #f0d8e8;
    border-radius: 999px;
    padding: 5px 6px;
    box-shadow: 0 4px 18px rgba(176,80,128,0.1);
}
.page-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b05080;
    font-weight: 700;
    transition: background 0.18s, transform 0.18s;
    padding: 0;
}
.page-arrow:hover:not(:disabled) {
    background: rgba(176,80,128,0.1);
    transform: scale(1.1);
}
.page-arrow:disabled {
    color: #ddd;
    cursor: not-allowed;
}
.page-counter {
    min-width: 72px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #9a7a8a;
    user-select: none;
}
.page-current {
    font-size: 17px;
    font-weight: 800;
    color: #b05080;
}
.page-sep { color: #d0a8b8; margin: 0 2px; }
.page-total { color: #9a7a8a; }

.loading-spinner {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 60px 0;
}
.spinner {
    width: 38px;
    height: 38px;
    border: 4px solid #e0c98a;
    border-top-color: #8B2635;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
}
.empty-icon { font-size: 3.5rem; margin-bottom: 12px; }
.empty-text { color: #b89a6a; font-size: 1.1rem; }

[dir="rtl"] .card-top     { flex-direction: row-reverse; }
[dir="rtl"] .card-footer  { flex-direction: row-reverse; }
[dir="rtl"] .card-meaning { border-left: none; border-right: 2px solid #e0c98a; padding-left: 0; padding-right: 8px; }
[dir="rtl"] .name-card    { border-left: 1px solid #e0c98a; border-right: 4px solid #d4b483; }
[dir="rtl"] .card-male    { border-right-color: #4A7EA5; }
[dir="rtl"] .card-female  { border-right-color: #B85C7A; }

.advanced-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #e0c98a;
    justify-content: center;
}
.adv-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}
.adv-field-wide { flex: 1; min-width: 200px; }
.adv-input {
    border: 2px solid #d4b483;
    border-radius: 10px;
    padding: 7px 14px;
    font-size: 14px;
    outline: none;
    background: #efe6d6;
    color: #2c1810;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.adv-input:focus { border-color: #8B2635; }
.adv-input::placeholder { color: #b89a6a; font-style: italic; }

/* ثابت في كل الصفحات الأخرى */
.session-btn-wrap {
    position: fixed;
    top: 8px;
    left: 16px;
    z-index: 1101;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: visible;
    direction: ltr;
    unicode-bidi: isolate;
}
/* داخل الشريط الموحّد يصبح عنصر flex عادي */
.main-topbar .session-btn-wrap {
    position: static;
    top: auto;
    left: auto;
    z-index: auto;
}
.session-welcome {
    font-size: 13px;
    font-weight: 700;
    color: white;
    background: rgba(255,255,255,0.15);
    padding: 6px 12px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}
.session-btn {
    font-size: 13px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}
.session-btn-in  { background: white; color: #8B2635; border: 2px solid white; }
.session-btn-out { background: rgba(255,255,255,0.15); color: white; border: 2px solid rgba(255,255,255,0.4); }
.session-btn:hover { opacity: 0.85; }

/* ── Footer ── */
.site-footer {
    background: #2c1810;
    color: #c8a882;
    padding: 40px 20px 20px;
    margin-top: 60px;
}
.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: #f5e6d0;
}
/* ── شارة +0 للعلامة التجارية ── */
.brand-plus {
    display: inline-block;
    font-weight: 800;
    color: #ffb3c8;
    background: rgba(176,80,128,0.18);
    border-radius: 8px;
    padding: 0 6px;
    margin-inline-start: 2px;
    font-size: 0.7em;
    vertical-align: super;
    letter-spacing: 0.5px;
}
/* التاگلاين تحت اللوگو بالفوتر */
.footer-tagline {
    text-align: center;
    color: #c8a882;
    font-size: 12px;
    font-style: italic;
    letter-spacing: 0.4px;
    margin: 2px 0 0;
    opacity: 0.85;
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}
.footer-links a {
    color: #c8a882;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.footer-links a:hover { color: #f5e6d0; }
.footer-copy {
    font-size: 12px;
    color: #8a6a4a;
    margin: 0;
}

/* ── Language Dropdown ── */
.lang-dropdown-wrap { position: relative; }
.lang-dropdown-btn {
    background: white;
    border: 1px solid #e8d5b7;
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    color: #5a3e2b;
}
.lang-dropdown-btn-dark {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    color: white;
}
.lang-dropdown-menu {
    position: absolute;
    top: 110%;
    left: 0;
    background: white;
    border: 1px solid #e8d5b7;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    overflow: hidden;
    min-width: 160px;
    z-index: 1000;
}
.lang-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: #5a3e2b;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
}
.lang-dropdown-menu a:hover { background: #fdf6ee; }

/* ── User Menu ── */
.user-menu-wrap {
    position: relative;
    display: inline-block;
    width: fit-content;
}
.user-menu-btn {
    background: white;
    border: 1px solid #e8d5b7;
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    color: #5a3e2b;
}
.user-menu-btn-dark {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    color: white;
}
.user-dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    background: white;
    border: 1px solid #e8d5b7;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    overflow: hidden;
    min-width: 180px;
    z-index: 1000;
}
.user-dropdown-header {
    padding: 12px 16px;
    background: #fdf6ee;
    border-bottom: 1px solid #e8d5b7;
    font-size: 13px;
    color: #5a3e2b;
}
.user-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #5a3e2b;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
}
.user-dropdown a:hover { background: #fdf6ee; }

/* ── Name Header ── */
.name-header {
    position: sticky;
    top: 0;
    z-index: 999;
}
.name-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}


/* ── News Ticker ── */
/* --- الشريط الثابت الموحّد --- */
.main-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 42px;
    background: linear-gradient(90deg, #2d0a2e, #5a1a4a);
    display: flex;
    align-items: center;
    z-index: 1100;
    direction: ltr;
    color: white;
    transition: box-shadow 0.3s;
}
.main-topbar.navbar-scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.topbar-left  { flex-shrink: 0; padding: 0 10px; }
.topbar-right { flex-shrink: 0; padding: 0 10px; position: relative; }
.topbar-ticker        { flex: 1; overflow: hidden; height: 100%; display: flex; align-items: center; }
.topbar-ticker-empty  { flex: 1; }

/* داخل الشريط: lang-switcher يصبح عنصر flex عادي بدل fixed */
.main-topbar .lang-switcher {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
}

/* تعديل زر اللغة ليتلاءم مع الشريط الداكن */
.main-topbar .lang-btn {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: none;
    font-size: 12px;
    padding: 5px 12px;
}
.main-topbar .lang-btn:hover { background: rgba(255,255,255,0.28); transform: none; box-shadow: none; }
.main-topbar .lang-menu { top: calc(100% + 6px); }

/* تعديل قائمة المستخدم داخل الشريط */
.main-topbar .session-btn { color: white; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); }

/* إزاحة الصفحة — الشريط الرئيسي (42px) + الشريط الثانوي (36px) */
body.home-page,
body.has-topbar,
body.profile-page { padding-top: 78px; }

/* ── الشريط الثانوي للتنقل بين الأقسام ── */
.subnav-bar {
    position: fixed;
    top: 42px;
    left: 0;
    right: 0;
    height: 36px;
    background: linear-gradient(90deg, #3a0d3e, #621e6e);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    z-index: 1098;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    direction: ltr;
    /* safe center: يتوسّط لما يكفي، ويبدأ من أول قسم عند الفيض (يمنع قص Names) */
    justify-content: safe center;
    -webkit-overflow-scrolling: touch;
    padding: 0 8px;
}
.subnav-bar::-webkit-scrollbar { display: none; }
.subnav-bar a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 13px;
    height: 100%;
    color: rgba(255,255,255,0.68);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.18s, border-color 0.18s, background 0.18s;
    letter-spacing: 0.2px;
    flex-shrink: 0;
}
.subnav-bar a:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}
.subnav-bar a.snav-active {
    color: #fff;
    border-bottom-color: #c084fc;
}
.subnav-bar .snav-divider {
    width: 1px;
    height: 16px;
    background: rgba(255,255,255,0.15);
    flex-shrink: 0;
    margin: 0 2px;
}

.news-ticker {
    flex: 1;
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 100%;
    color: #fff;
    direction: ltr;
}
.ticker-label {
    background: #b05080;
    padding: 0 14px;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    flex-shrink: 0;
    white-space: nowrap;
}
.ticker-track {
    flex: 1;
    overflow: hidden;
    height: 100%;
    position: relative;
}
.ticker-inner {
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    animation: ticker-scroll 30s linear infinite;
}
.ticker-item {
    padding: 0 40px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0.95;
}
.ticker-item span { margin-right: 6px; }
@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}


/* ── Community Card ── */
.community-card {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    background: rgba(255,255,255,0.95);
    border-radius: 16px 0 0 16px;
    box-shadow: -4px 0 20px rgba(176,80,128,0.15);
    padding: 16px 14px;
    z-index: 900;
    transition: transform 0.3s ease;
    direction: ltr;
}
.community-card.hidden {
    transform: translateY(-50%) translateX(190px);
}
.cc-toggle {
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    background: #b05080;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 700;
    line-height: 1;
}
.community-card.hidden .cc-toggle { content: '›'; }
.cc-section {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px dashed #ffd6e8;
}
.cc-section:last-child { border-bottom: none; margin-bottom: 0; }
.cc-title {
    font-size: 12px;
    font-weight: 800;
    color: #b05080;
    margin-bottom: 8px;
}
.cc-online-list { display: flex; flex-direction: column; gap: 5px; }
.cc-user {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #2c1810;
}
.cc-dot {
    width: 7px; height: 7px;
    background: #4caf50;
    border-radius: 50%;
    flex-shrink: 0;
}
.cc-stat-row {
    font-size: 12px;
    color: #6a4a5a;
    margin-bottom: 4px;
}
.cc-stat-row strong { color: #b05080; }
.cc-topname-val {
    font-size: 1.2rem;
    font-weight: 900;
    color: #b05080;
    font-family: Georgia, serif;
    text-align: center;
}

/* ── RTL para árabe — solo texto, los layouts no se invierten ── */
body.lang-rtl p,
body.lang-rtl h1,
body.lang-rtl h2,
body.lang-rtl h3,
body.lang-rtl h4,
body.lang-rtl [data-i18n],
body.lang-rtl .profile-bio,
body.lang-rtl .profile-bio-empty,
body.lang-rtl .profile-since,
body.lang-rtl .profile-empty,
body.lang-rtl .comment-text,
body.lang-rtl .wall-post-content,
body.lang-rtl .profile-section-title {
    direction: rtl;
    text-align: right;
}
body.lang-rtl input[type="text"],
body.lang-rtl input[type="search"],
body.lang-rtl input[type="email"],
body.lang-rtl input[type="password"],
body.lang-rtl textarea {
    direction: rtl;
    text-align: right;
}
/* El lang-switcher siempre LTR sin importar el idioma */
.lang-switcher,
.lang-switcher * {
    direction: ltr !important;
}

/* ══════════════════════════════════════════════
   DARK MODE — متغيرات الألوان
══════════════════════════════════════════════ */
:root {
    --bg:         #efe6d6;
    --bg-card:    #f8f1e3;
    --text:       #2c1810;
    --text-muted: #6b4c3b;
    --border:     #e0c98a;
    --input-bg:   #efe6d6;
}
[data-theme="dark"] {
    --bg:         #120a18;
    --bg-card:    #1e1025;
    --text:       #f0d8f0;
    --text-muted: #b890c8;
    --border:     #4a2a5a;
    --input-bg:   #120a18;
}
[data-theme="dark"] body {
    background-color: #120a18;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(139,38,53,0.10) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(90,26,100,0.08) 0%, transparent 50%);
    color: var(--text);
}
[data-theme="dark"] .filter-panel   { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .search-input,
[data-theme="dark"] .adv-input,
[data-theme="dark"] .region-select  { background: var(--input-bg); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .search-input::placeholder,
[data-theme="dark"] .adv-input::placeholder { color: var(--text-muted); }
[data-theme="dark"] .gender-btn     { background: var(--input-bg); border-color: var(--border); color: var(--text-muted); }
[data-theme="dark"] .gender-btn.active { background: #8B2635; border-color: #8B2635; color: white; }
[data-theme="dark"] .name-card      { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .card-name      { color: #e090c0; }
[data-theme="dark"] .card-meaning   { color: var(--text-muted); border-color: var(--border); }
[data-theme="dark"] .card-footer,
[data-theme="dark"] .card-front-bottom { color: var(--text-muted); border-color: var(--border); }
[data-theme="dark"] .pop-bar-bg     { background: #3a2040; }
[data-theme="dark"] .pop-label      { color: var(--text-muted); }
[data-theme="dark"] .pop-percent    { color: var(--text); }
[data-theme="dark"] #counter        { color: var(--text-muted); }
[data-theme="dark"] #pagination      { background: #1a0a2a; border-color: rgba(180,100,220,0.2); box-shadow: 0 4px 18px rgba(0,0,0,0.4); }
[data-theme="dark"] .page-arrow     { color: #c080e0; }
[data-theme="dark"] .page-arrow:hover:not(:disabled) { background: rgba(180,100,220,0.15); }
[data-theme="dark"] .page-arrow:disabled { color: #3a2a4a; }
[data-theme="dark"] .page-current   { color: #d090e0; }
[data-theme="dark"] .page-counter   { color: #7a6088; }
[data-theme="dark"] .page-sep       { color: #4a3058; }
[data-theme="dark"] .flip-hint      { color: #7050a0; }
[data-theme="dark"] .card-name-en   { color: var(--text-muted); }
[data-theme="dark"] .origin         { color: var(--text-muted); }
[data-theme="dark"] .hero-wave svg path { fill: #120a18; }

/* ── زر Night Mode ── */
.darkmode-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 999px;
    padding: 4px 11px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
    line-height: 1.4;
    margin: 0 4px;
}
.darkmode-btn:hover { background: rgba(255,255,255,0.28); }

/* زر المصعد في الوضع الليلي */
[data-theme="dark"] #lift-btn {
    background: linear-gradient(135deg, #5b21b6, #be185d);
    box-shadow: 0 6px 24px rgba(91,33,182,0.5);
}
[data-theme="dark"] #lift-btn.going-down {
    background: linear-gradient(135deg, #065f46, #0369a1);
    box-shadow: 0 6px 24px rgba(6,95,70,0.45);
}

/* ══════════════════════════════════════════════
   FLIP CARDS — بطاقات ثلاثية الأبعاد
══════════════════════════════════════════════ */
.name-card {
    perspective: 1000px;
    min-height: 210px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.name-card:hover { transform: none !important; }

.card-inner {
    position: relative;
    width: 100%;
    min-height: 210px;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4,0,0.2,1);
    cursor: pointer;
}
.name-card.flipped .card-inner { transform: rotateY(180deg); }

.card-front, .card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 16px;
    padding: 18px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(139,38,53,0.10);
}
.card-front {
    background: var(--bg-card, #f8f1e3);
    border: 1px solid var(--border, #e0c98a);
}
.card-male   .card-front { border-left: 4px solid #4A7EA5; }
.card-female .card-front { border-left: 4px solid #B85C7A; }
[data-theme="dark"] .card-male   .card-front { border-left: 4px solid #2a5070; }
[data-theme="dark"] .card-female .card-front { border-left: 4px solid #703050; }

.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #3d0a20 0%, #1a0810 100%);
    border: 1px solid #5a1a30;
    color: white;
}

/* داخل card-front */
.card-front-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-name-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 0;
}
.card-name { text-align: center; }
.card-name-en {
    font-size: 12px;
    color: #8a6a4a;
    font-style: italic;
    margin-top: 2px;
}
.card-front-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #8a6a4a;
    padding-top: 8px;
    border-top: 1px dashed #e0c98a;
    margin-top: auto;
}
.flip-hint {
    font-size: 10px;
    color: #b89a6a;
    text-align: center;
    opacity: 0.65;
    font-style: italic;
    padding-top: 4px;
}

/* داخل card-back */
.back-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.back-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #f0c0d0;
}
.back-label {
    font-size: 10px;
    background: rgba(255,255,255,0.12);
    padding: 3px 9px;
    border-radius: 999px;
    color: #d0c0e0;
}
.back-meaning {
    font-size: 13px;
    color: #e8c8d8;
    line-height: 1.65;
    flex: 1;
    overflow: hidden;
}
.view-btn {
    display: block;
    background: rgba(255,255,255,0.15);
    color: white !important;
    text-decoration: none;
    border-radius: 999px;
    padding: 7px 0;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    transition: background 0.2s;
    margin-top: auto;
}
.view-btn:hover { background: rgba(255,255,255,0.28); }

/* ── زر القلب ── */
.fav-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #ddd;
    transition: transform 0.2s, color 0.2s;
    line-height: 1;
    padding: 2px 4px;
}
.fav-btn:hover  { transform: scale(1.25); color: #e05080; }
.fav-btn.fav-active { color: #e05080; }

/* ── زر النطق ── */
.speak-btn {
    background: rgba(176,80,128,0.12);
    border: none;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.speak-btn:hover { background: rgba(176,80,128,0.25); }

/* ══════════════════════════════════════════════
   شريط المفضلة
══════════════════════════════════════════════ */
#favorites-bar {
    display: none;
    background: white;
    border-radius: 16px;
    padding: 16px 22px;
    border: 1px solid #fde8f3;
    box-shadow: 0 2px 16px rgba(180,100,140,0.10);
    margin-top: 12px;
}
[data-theme="dark"] #favorites-bar { background: var(--bg-card); border-color: var(--border); }
#favorites-bar h3 {
    font-size: 13px;
    font-weight: 800;
    color: #b05080;
    margin: 0 0 10px;
}
[data-theme="dark"] #favorites-bar h3 { color: #e090c0; }
#favorites-list { display: flex; flex-wrap: wrap; gap: 8px; }
.fav-chip {
    background: #fde8f3;
    color: #9d174d;
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #fcd0e8;
}
[data-theme="dark"] .fav-chip { background: #3a1a30; color: #f0a0c0; border-color: #5a2a4a; }
.fav-chip-remove {
    cursor: pointer;
    opacity: 0.55;
    font-size: 11px;
    transition: opacity 0.2s;
}
.fav-chip-remove:hover { opacity: 1; }

/* ══════════════════════════════════════════════
   حاسبة كيمياء الأسماء
══════════════════════════════════════════════ */
.chemistry-section {
    background: white;
    border-radius: 20px;
    padding: 28px 32px;
    box-shadow: 0 4px 24px rgba(180,100,140,0.12);
    border: 1px solid #fde8f3;
    max-width: 64rem;
    margin: 24px auto;
}
[data-theme="dark"] .chemistry-section { background: var(--bg-card); border-color: var(--border); }
.chemistry-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: #8B2635;
    margin: 0 0 6px;
}
[data-theme="dark"] .chemistry-section h2 { color: #e090c0; }
.chem-desc {
    font-size: 13px;
    color: #8a6a4a;
    margin: 0 0 20px;
}
[data-theme="dark"] .chem-desc { color: var(--text-muted); }
.chemistry-inputs {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.chemistry-inputs input {
    flex: 1;
    min-width: 140px;
    border: 2px solid #d4b483;
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 14px;
    outline: none;
    background: #efe6d6;
    color: #2c1810;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
[data-theme="dark"] .chemistry-inputs input {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}
.chemistry-inputs input:focus { border-color: #8B2635; }
.chemistry-inputs input::placeholder { color: #b89a6a; }
.chemistry-calc-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #b05080, #8B2635);
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    letter-spacing: 0.3px;
}
.chemistry-calc-btn:hover  { opacity: 0.9; }
.chemistry-calc-btn:active { transform: scale(0.98); }
.chemistry-result {
    display: none;
    margin-top: 20px;
    background: linear-gradient(135deg, #3d0a20, #1a0810);
    border-radius: 16px;
    padding: 24px;
    color: white;
    text-align: center;
    animation: fadeInUp 0.4s ease;
}
@keyframes fadeInUp {
    from { opacity:0; transform:translateY(10px) }
    to   { opacity:1; transform:translateY(0) }
}
.chem-score {
    font-size: 3rem;
    font-weight: 900;
    color: #f0b0c8;
    line-height: 1;
}
.chem-score-label { font-size: 12px; color: #c0a0b8; margin: 4px 0 16px; }
.chem-suggested-label { font-size: 11px; color: #c0a0b8; margin-bottom: 4px; }
.chem-suggested-name {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: #f5c0d0;
    line-height: 1.1;
}
.chem-meaning {
    font-size: 13px;
    color: #e0c0d0;
    line-height: 1.6;
    margin-top: 10px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}
/* ── تفضيلات الكيمياء: اختيار الجنس والأصل ── */
.chemistry-prefs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.chem-select {
    flex: 1;
    min-width: 140px;
    border: 2px solid #d4b483;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    background: #efe6d6;
    color: #2c1810;
    cursor: pointer;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.chem-select:focus { border-color: #8B2635; }
[data-theme="dark"] .chem-select {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}
/* ── قائمة الأسماء المقترحة (3 بطاقات) ── */
.chem-suggested-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 6px;
}
.chem-pick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(245,192,208,0.25);
    border-radius: 14px;
    padding: 12px 18px;
    min-width: 96px;
    transition: transform 0.15s, background 0.2s;
}
.chem-pick:hover { transform: translateY(-2px); background: rgba(255,255,255,0.14); }
.chem-pick-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: #f5c0d0;
    line-height: 1.1;
}
.chem-pick-ar { font-size: 13px; color: #e0c0d0; }
.chem-none { font-size: 13px; color: #e0c0d0; margin-top: 12px; }

/* ══════════════════════════════════════════════
   قسم الأسماء الشائعة — Popular Names
══════════════════════════════════════════════ */
#popular-section {
    padding-bottom: 4px;
}
.popular-section-title {
    font-size: 13px;
    font-weight: 800;
    color: #8B2635;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 10px;
}
[data-theme="dark"] .popular-section-title { color: #e090c0; }

.popular-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.popular-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.popular-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    opacity: 0.9;
}
.pop-male {
    background: #dbeafe;
    color: #1e4e8c;
    border-color: #bcd7f8;
}
.pop-female {
    background: #fce7f3;
    color: #9d174d;
    border-color: #f8c8e8;
}
[data-theme="dark"] .pop-male {
    background: #1a2a40;
    color: #90bff0;
    border-color: #2a4060;
}
[data-theme="dark"] .pop-female {
    background: #3a1a30;
    color: #f0a0c0;
    border-color: #5a2a4a;
}
.pop-chip-icon { font-size: 11px; opacity: 0.7; }
.pop-chip-name { font-family: 'Playfair Display', serif; }

/* ══════════════════════════════════════════════
   فلتر الأوسمة التعبيرية — Tag Pills
══════════════════════════════════════════════ */
.filter-section-label {
    font-size: 10px;
    font-weight: 800;
    color: #b89a6a;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 18px 0 8px;
}
[data-theme="dark"] .filter-section-label { color: #a08060; }

.tag-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 4px;
}
.tag-pill {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1.5px solid #d4b483;
    background: #efe6d6;
    color: #6b4c3b;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}
.tag-pill:hover {
    border-color: #8B2635;
    color: #8B2635;
    background: #fff0f4;
}
.tag-pill.tag-active {
    background: linear-gradient(135deg, #8B2635, #b05080);
    color: white;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(139,38,53,0.30);
}
[data-theme="dark"] .tag-pill {
    background: #1e1228;
    border-color: #3a2040;
    color: #c0a0b0;
}
[data-theme="dark"] .tag-pill:hover {
    border-color: #9060a0;
    color: #e0b0d0;
}
[data-theme="dark"] .tag-pill.tag-active {
    background: linear-gradient(135deg, #6b1a2a, #8b3060);
    color: white;
    border-color: transparent;
}

/* شارة عدد التاكات المختارة */
.tag-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: #8B2635;
    font-size: 10px;
    font-weight: 900;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1;
}

/* زر إعادة التعيين */
.tag-reset-pill {
    background: rgba(139,38,53,0.08) !important;
    border-color: #c04060 !important;
    color: #c04060 !important;
    font-weight: 700 !important;
}
.tag-reset-pill:hover {
    background: #c04060 !important;
    color: white !important;
}
[data-theme="dark"] .tag-reset-pill {
    background: rgba(180,60,80,0.15) !important;
    border-color: #d06080 !important;
    color: #d06080 !important;
}

/* ══════════════════════════════════════════════
   فلتر الحروف — Letter Picker
══════════════════════════════════════════════ */
.letter-picker-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 4px;
    direction: ltr;
}
[dir="rtl"] .letter-picker-row { direction: rtl; }

.letter-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid #d4b483;
    background: #efe6d6;
    color: #6b4c3b;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}
.letter-btn:hover {
    border-color: #8B2635;
    color: #8B2635;
    background: #fff0f4;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(139,38,53,0.15);
}
.letter-btn.letter-active {
    background: linear-gradient(135deg, #8B2635, #b05080);
    color: white;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(139,38,53,0.30);
}
[data-theme="dark"] .letter-btn {
    background: #1e1228;
    border-color: #3a2040;
    color: #c0a0b0;
}
[data-theme="dark"] .letter-btn:hover {
    border-color: #9060a0;
    color: #e0b0d0;
    background: #2a1838;
}
[data-theme="dark"] .letter-btn.letter-active {
    background: linear-gradient(135deg, #6b1a2a, #8b3060);
    color: white;
    border-color: transparent;
}

/* ══════════════════════════════════════════════
   أوسمة الكارت الخلفي — Card Back Tags
══════════════════════════════════════════════ */
.card-back-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.10);
}
.card-tag-chip {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    color: rgba(255,220,230,0.90);
    border: 1px solid rgba(255,255,255,0.18);
    white-space: nowrap;
    letter-spacing: 0.3px;
}


/* ── Filtro de origen: pastillas de regiones y países ── */
.origin-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 14px;
}
.origin-pill {
    padding: 8px 16px;
    border-radius: 999px;
    border: 2px solid #e8d9c0;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    color: #5a4632;
    cursor: pointer;
    transition: all 0.2s;
}
.origin-pill:hover { border-color: #b05080; transform: translateY(-1px); }
.origin-pill.active {
    background: linear-gradient(135deg, #b05080, #8B2635);
    border-color: #8B2635;
    color: #fff;
}
/* fila de países: fondo suave para distinguirla como subnivel */
.origin-countries-row {
    padding: 10px 12px;
    background: rgba(176, 80, 128, 0.06);
    border-radius: 14px;
}
.origin-pill.origin-country { font-size: 12.5px; padding: 6px 14px; }
[data-theme="dark"] .origin-pill {
    background: #241030;
    border-color: #4a2a5a;
    color: #e0cfe8;
}
[data-theme="dark"] .origin-pill.active {
    background: linear-gradient(135deg, #b05080, #8B2635);
    border-color: #b05080;
    color: #fff;
}
[data-theme="dark"] .origin-countries-row { background: rgba(176, 80, 128, 0.12); }


/* ── Secciones plegables del panel de filtros ── */
.filter-collapse { margin-top: 4px; }
.filter-collapse summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    padding: 6px 0;
}
.filter-collapse summary::-webkit-details-marker { display: none; }
.filter-collapse summary .filter-section-label { margin: 0; }
.filter-collapse summary::after {
    content: '▾';
    font-size: 12px;
    color: #b89a6a;
    transition: transform 0.2s;
}
.filter-collapse[open] summary::after { transform: rotate(180deg); }
.filter-collapse summary:hover .filter-section-label { color: #8B2635; }
[data-theme="dark"] .filter-collapse summary:hover .filter-section-label { color: #e090c0; }

/* ── Destello dorado sobre la tarjeta del nombre aleatorio ── */
.name-flash {
    animation: nameFlash 0.9s ease 2;
}
@keyframes nameFlash {
    0%, 100% { box-shadow: 0 2px 10px rgba(139,38,53,0.07); }
    50%      { box-shadow: 0 0 0 5px rgba(212,168,67,0.65), 0 6px 24px rgba(196,151,58,0.35); }
}


/* ═══════════════════════════════════════════════
   إصلاحات الموبايل + الصفر الواضح (2026-07)
═══════════════════════════════════════════════ */

/* الصفر واضح إنه رقم مو حرف O — خط هندسي بصفر مشطوب */
.pz {
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    font-weight: 800;
    font-variant-numeric: slashed-zero;
    letter-spacing: 0.5px;
}

@media (max-width: 820px) {
    /* عنوان الهيرو أصغر حتى ما ينكسر بشكل سيّئ */
    .hero-title { font-size: 2rem; letter-spacing: 0.3px; }
    .hero       { min-height: 300px; padding: 22px 12px 66px; }
    .hero-logo  { width: 220px; }
    .hero-emoji { font-size: 2.4rem; }

    /* الكارت العائم يمين-الوسط كان يغطي نص الشاشة — نخفيه بالموبايل
       (المحتوى متاح من قسم Community بالقائمة) */
    .community-card { display: none !important; }

    /* لوحة الفلاتر: حشو أقل حتى تتنفّس */
    .filter-panel { padding: 18px 14px; }

    /* زر المصعد أصغر شوي حتى ما يزاحم المحتوى */
    #lift-btn { width: 44px; height: 44px; bottom: 20px; right: 16px; }
}


/* زر المستخدم داخل الشريط يصبح عنصر flex عادي — كان fixed يطفو فوق التيكر ويخفي بدايته */
.main-topbar .session-btn-wrap {
    position: static;
    top: auto;
    left: auto;
}
.main-topbar .topbar-left { min-width: 0; }


/* ── دعوة الفعل بالهيرو ── */
.hero-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 22px;
}
.hero-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s;
    letter-spacing: 0.3px;
}
.hero-cta-btn:hover  { transform: translateY(-2px); }
.hero-cta-btn:active { transform: scale(0.97); }
.hero-cta-primary {
    background: linear-gradient(135deg, #C4973A, #d4a843);
    color: #fff;
    border: none;
    box-shadow: 0 6px 20px rgba(196,151,58,0.5);
    padding-left: 40px;
    padding-right: 40px;   /* زر "استكشف" أعرض */
}
.hero-cta-primary:hover { box-shadow: 0 10px 28px rgba(196,151,58,0.6); }
.hero-cta-ghost {
    background: rgba(255,255,255,0.14);
    color: #fff8e7;
    border: 2px solid rgba(255,255,255,0.55);
    backdrop-filter: blur(2px);
}
/* حركة hover لطيفة لزر "فاجئني" — النرد يلتفّ */
.hero-cta-ghost:hover {
    background: rgba(255,255,255,0.26);
    border-color: #fff;
}
.hero-cta-ghost:hover span:first-child,
.hero-cta-ghost:hover { }
.hero-cta .cta-ico { display: inline-block; transition: transform 0.5s ease; }
.hero-cta-ghost:hover .cta-ico { transform: rotate(360deg); }
@media (max-width: 820px) {
    .hero-cta-btn { padding: 10px 20px; font-size: 14px; }
}

/* ══ Firma del creador en el pie de página ══ */
.footer-sig {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.72;
    font-style: italic;
}
.footer-sig .sig-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #C4973A;
}

/* ══ Barra Beta (versión de prueba) — en flujo normal, bajo la navbar fija ══ */
.beta-bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px 12px;
    padding: 8px 46px;
    background: linear-gradient(90deg, #241016, #2d0a2e);
    border-bottom: 1px solid rgba(234, 192, 126, 0.28);
    color: #e8dcc8;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}
.beta-tag {
    background: linear-gradient(135deg, #eac07e, #C4973A);
    color: #2a1608;
    font-weight: 800;
    font-size: 10px;
    letter-spacing: 1.5px;
    padding: 2px 9px;
    border-radius: 5px;
    flex-shrink: 0;
}
.beta-msg { color: #e8dcc8; }
.beta-link {
    color: #f3d27a;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed rgba(243, 210, 122, 0.5);
    white-space: nowrap;
}
.beta-link:hover { color: #fff; border-bottom-color: #fff; }
.beta-close {
    position: absolute;
    inset-inline-end: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.10);
    border: none;
    color: #d8c8a8;
    width: 24px; height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, opacity 0.3s;
}
.beta-close:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }
.beta-bar.beta-closing { opacity: 0; }
@media (max-width: 600px) {
    .beta-bar { font-size: 12px; padding: 8px 40px; }
    .beta-tag { font-size: 9px; }
}
