
  :root {
    --red:       #e50914;
    --red-dark:  #b00710;
    --red-glow:  rgba(229,9,20,0.35);
    --bg:        #0a0a0a;
    --bg2:       #111111;
    --bg3:       #1a1a1a;
    --card:      #161616;
    --border:    rgba(255,255,255,0.07);
    --text:      #f0f0f0;
    --muted:     #888;
    --gold:      #f5c518;
    --silver:    #c0c0c0;
    --bronze:    #cd7f32;
    --success:   #22c55e;
    --font:      Tahoma, Arial, sans-serif;
    --radius:    16px;
    --shadow:    0 8px 32px rgba(0,0,0,0.6);
  }

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

  html {
    overflow-x: hidden;
    width: 100%;
  }

/* ── ADMIN NOTIF POPUP ── */
.admin-notif-popup {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border: 1px solid rgba(167,139,250,0.3);
  border-radius: 18px;
  padding: 14px 18px;
  max-width: 340px;
  width: 90%;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1), opacity 0.4s;
  opacity: 0;
}
.admin-notif-popup.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.admin-notif-popup .anp-icon { font-size: 24px; float: right; margin-left: 10px; }
.admin-notif-popup .anp-title { font-size: 13px; font-weight: 800; color: #c4b5fd; margin-bottom: 4px; }
.admin-notif-popup .anp-body { font-size: 12px; color: rgba(255,255,255,0.85); line-height: 1.7; }
.admin-notif-popup .anp-close { position: absolute; top: 10px; left: 12px; background: none; border: none; color: rgba(255,255,255,0.4); font-size: 16px; cursor: pointer; padding: 0; }
.admin-notif-popup .anp-bar { height: 3px; background: rgba(167,139,250,0.2); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.admin-notif-popup .anp-bar-inner { height: 100%; background: #a78bfa; border-radius: 2px; width: 100%; transition: width 10s linear; }

body {
    font-family: var(--font);
    background: #EEF2FF;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    -webkit-text-size-adjust: 100%;
  }

  /* ── NOISE TEXTURE OVERLAY ── */
  body::before {
    content:"";
    position:fixed; inset:0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events:none; z-index:0; opacity:.4;
  }

  /* ── AUTH SCREEN ── */
  #auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
  }

  .auth-bg {
    position: fixed; inset: 0;
    background:
      radial-gradient(ellipse 80% 60% at 50% -10%, rgba(229,9,20,0.25) 0%, transparent 70%),
      radial-gradient(ellipse 50% 40% at 80% 80%, rgba(180,0,10,0.12) 0%, transparent 60%),
      var(--bg);
    z-index: -1;
  }

  .auth-card {
    background: rgba(22,22,22,0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(229,9,20,0.2);
    border-radius: 24px;
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 0 60px rgba(229,9,20,0.1), var(--shadow);
    animation: slideUp .5s ease;
  }

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

  .logo {
    text-align: center;
    margin-bottom: 32px;
  }

  .logo-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 20px var(--red));
    animation: pulse 2s ease-in-out infinite;
  }

  @keyframes pulse {
    0%,100% { filter: drop-shadow(0 0 20px var(--red)); }
    50%      { filter: drop-shadow(0 0 35px var(--red)); }
  }

  .logo h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0;
    font-family: "Noto Naskh Arabic", "Tahoma", serif;
    color: #f0f0f0;
  }

  .logo h1 span { color: var(--red); font-family: "Noto Naskh Arabic", "Tahoma", serif; }

  .logo p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
  }

  .tabs {
    display: flex;
    background: var(--bg3);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 28px;
    gap: 4px;
  }

  .tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s;
  }

  .tab-btn.active {
    background: var(--red);
    color: #fff;
    box-shadow: 0 4px 16px var(--red-glow);
  }

  .form-group {
    margin-bottom: 16px;
  }

  .form-group label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 7px;
    font-weight: 500;
  }

  .form-group input,
  .form-group select {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
  }

  .form-group input:focus,
  .form-group select:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-glow);
  }

  .form-group select option { background: var(--bg3); }

  .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

  .btn-main {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: all .2s;
    box-shadow: 0 4px 20px var(--red-glow);
    position: relative;
    overflow: hidden;
  }

  .btn-main::after {
    content:"";
    position:absolute; inset:0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity:0; transition: opacity .2s;
  }

  .btn-main:hover { transform:translateY(-2px); box-shadow: 0 8px 28px var(--red-glow); }
  .btn-main:hover::after { opacity:1; }
  .btn-main:active { transform:translateY(0); }

  .error-msg {
    background: rgba(229,9,20,0.1);
    border: 1px solid rgba(229,9,20,0.3);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    color: #ff6b6b;
    margin-top: 12px;
    display: none;
  }

  /* ── MAIN APP ── */
  #app { display: none; min-height: 100vh; padding-top: 57px; padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); overflow-x: hidden; background: #EEF2FF; }
  /* chat page is position:fixed so must cancel the app padding */

  /* ── TOP BAR ── */
  .topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99,102,241,0.12);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  }

  .topbar::after {
    display: none;
  }

  .topbar-logo {
    font-size: 18px;
    font-weight: 700;
    color: #6366F1;
    font-family: "Noto Naskh Arabic", "Tahoma", serif;
    letter-spacing: 0;
    line-height: 1.2;
  }
  .topbar-logo span { color: #4F46E5; font-family: "Noto Naskh Arabic", "Tahoma", serif; }

  .topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .user-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    box-shadow: 0 0 12px rgba(99,102,241,0.35);
    overflow: hidden;
  }

  .user-info { text-align: right; }
  .user-info .name { font-size: 12px; font-weight: 700; color: #1E293B; }
  .user-info .pts {
    font-size: 10px;
    font-weight: 800;
    color: #6366F1;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 8px;
    padding: 2px 7px;
    margin-top: 3px;
    display: inline-block;
    letter-spacing: 0.3px;
  }

  * { -webkit-tap-highlight-color: transparent; }
  *:focus { outline: none; }
  *:focus-visible { outline: 2px solid rgba(99,102,241,.5); border-radius: 6px; }
  /* ── PAGES ── */
  .page { display: none; padding: 16px; box-sizing: border-box; width: 100%; overflow-x: hidden; }
  .page.active { display: block; animation: pageIn .2s cubic-bezier(.25,.46,.45,.94) both; }
  .page.page-exit { display: none; }
  @media (prefers-reduced-motion: reduce) { .page.active { animation: none !important; } }
  .no-anim .page.active { animation: none !important; }

  @keyframes pageIn {
    from { opacity:0; transform:translateY(12px) scale(.985); }
    to   { opacity:1; transform:translateY(0)    scale(1);    }
  }
  @keyframes pageOut {
    from { opacity:1; transform:translateY(0)    scale(1);    }
    to   { opacity:0; transform:translateY(-8px) scale(.985); }
  }

  /* app fade-in هنگام لود اول */
  #app { transition: opacity .32s cubic-bezier(.22,.68,0,1.15), transform .32s cubic-bezier(.22,.68,0,1.15); }
  #app.app-hidden { opacity: 0; transform: translateY(8px); }

  /* ── HOME PAGE LIGHT THEME ── */
  #page-home {
    background: #EEF2FF;
    min-height: 100vh;
    margin-top: 0;
    margin-right: -16px;
    margin-left: -16px;
    margin-bottom: 0;
    padding: 16px 28px;
    width: calc(100% + 32px);
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* ── HERO SECTION ── */
  .hero {
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 16px;
    padding: 12px 12px 10px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(59,130,246,0.10);
    width: 100%;
    box-sizing: border-box;
  }

  .hero::before {
    content:"";
    position:absolute; top:-60%; right:-15%;
    width:280px; height:280px;
    background: radial-gradient(circle, rgba(59,130,246,0.10), transparent 65%);
    pointer-events:none;
  }

  .hero::after {
    content:"";
    position:absolute; bottom:-40%; left:-10%;
    width:200px; height:200px;
    background: radial-gradient(circle, rgba(139,92,246,0.07), transparent 65%);
    pointer-events:none;
  }

  .hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 6px;
  }

  .hero-greeting { font-size: 11px; color: #64748B; margin-bottom: 1px; }
  .hero-name { font-size: clamp(14px, 4vw, 16px); font-weight: 900; color: #0F172A; }
  .hero-name span { color: #3B82F6; }

  .hero-badge {
    background: linear-gradient(135deg, rgba(99,102,241,0.14), rgba(139,92,246,0.10));
    border: 1px solid rgba(99,102,241,0.28);
    border-radius: 20px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    color: #4F46E5;
    white-space: normal;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 10px rgba(99,102,241,0.15);
    flex-shrink: 0;
  }
  .hero-badge svg { stroke: #6366F1; width: 14px; height: 14px; }

  .stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 10px;
    width: 100%;
  }

  .stat-box {
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.95);
    border-radius: 14px;
    padding: 12px 8px 10px;
    text-align: center;
    transition: transform .2s;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .stat-box:hover { transform: translateY(-3px); }
  .stat-box .val { font-size: clamp(16px, 4.5vw, 22px); font-weight: 900; line-height: 1.2; }
  .stat-box .lbl { font-size: 10px; color: #64748B; margin-top: 2px; margin-bottom: 8px; }

  /* progress bar پایین stat-box — از راست به چپ */
  .stat-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(0,0,0,0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-top: auto;
    direction: rtl;
  }
  .stat-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(.4,0,.2,1);
    float: right;
  }

  /* ── آیکون بالای stat-box ── */
  .stat-box .stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 9px;
    margin: 0 auto 6px;
  }
  .stat-box .stat-icon svg { display: block; width: 16px; height: 16px; }
  .streak-box .stat-icon  { background: rgba(251,146,60,0.15); stroke: #EA580C; color: #EA580C; }
  .streak-box .stat-icon svg { stroke: #EA580C; }
  .points-box .stat-icon  { background: rgba(139,92,246,0.15); }
  .points-box .stat-icon svg { stroke: #7C3AED; }
  .rank-box .stat-icon    { background: rgba(16,185,129,0.15); }
  .rank-box .stat-icon svg { stroke: #059669; }

  /* کارت اول: روزخوانی — نارنجی/قرمز */
  .stat-box.streak-box {
    background: linear-gradient(145deg, rgba(255,237,213,0.9), rgba(254,215,170,0.7));
    border-color: rgba(251,146,60,0.4);
    box-shadow: 0 4px 16px rgba(251,146,60,0.15);
  }
  .stat-box.streak-box:hover { border-color: rgba(251,146,60,0.7); box-shadow: 0 6px 20px rgba(251,146,60,0.25); }
  .stat-box.streak-box .val { color: #EA580C; }
  .stat-box.streak-box .lbl { color: #C2410C; opacity: 0.8; }
  .stat-box.streak-box .stat-progress-fill { background: linear-gradient(to left, #FB923C, #EF4444); width: 75%; }

  /* کارت دوم: امتیاز امروز — بنفش/طلایی */
  .stat-box.points-box {
    background: linear-gradient(145deg, rgba(237,233,254,0.9), rgba(221,214,254,0.7));
    border-color: rgba(139,92,246,0.4);
    box-shadow: 0 4px 16px rgba(139,92,246,0.15);
  }
  .stat-box.points-box:hover { border-color: rgba(139,92,246,0.7); box-shadow: 0 6px 20px rgba(139,92,246,0.25); }
  .stat-box.points-box .val { color: #7C3AED; }
  .stat-box.points-box .lbl { color: #6D28D9; opacity: 0.8; }
  .points-box .stat-icon  { background: rgba(139,92,246,0.15); }
  .points-box .stat-icon svg { stroke: #7C3AED; }
  .stat-box.points-box .stat-progress-fill { background: linear-gradient(to left, #A78BFA, #7C3AED); width: 60%; }

  /* کارت سوم: رتبه — سبز/فیروزه‌ای */
  .stat-box.rank-box {
    background: linear-gradient(145deg, rgba(209,250,229,0.9), rgba(167,243,208,0.7));
    border-color: rgba(16,185,129,0.4);
    box-shadow: 0 4px 16px rgba(16,185,129,0.15);
  }
  .stat-box.rank-box:hover { border-color: rgba(16,185,129,0.7); box-shadow: 0 6px 20px rgba(16,185,129,0.25); }
  .stat-box.rank-box .val { color: #059669; }
  .stat-box.rank-box .lbl { color: #047857; opacity: 0.8; }
  .stat-box.rank-box .stat-progress-fill { background: linear-gradient(to left, #34D399, #06B6D4); width: 40%; }

  /* progress bar هدف روزانه */
  .hero-goal {
    background: rgba(255,255,255,0.45);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 12px;
    padding: 8px 12px;
    backdrop-filter: blur(8px);
    transition: background .3s, border-color .3s, padding .3s;
  }
  /* وقتی picker فعاله، کارت بی‌رنگ بشه */
  .hero-goal.picker-mode {
    background: transparent;
    border-color: transparent;
    backdrop-filter: none;
    padding: 0;
  }

  .hero-goal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
  }

  .hero-goal-label {
    font-size: 11px;
    color: #4F46E5;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .hero-goal-label svg { stroke: #4F46E5; width: 13px; height: 13px; }

  .hero-goal-val {
    font-size: 11px;
    font-weight: 800;
    color: #3B82F6;
  }

  .hero-progress-track {
    height: 6px;
    background: rgba(59,130,246,0.12);
    border-radius: 6px;
    overflow: hidden;
  }

  .hero-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #8B5CF6);
    border-radius: 8px;
    transition: width 1s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 0 8px rgba(59,130,246,0.4);
    min-width: 4px;
  }

  /* ── MOTIVATION CARD ── */
  /* ── MOTIVATION CARD ── */
  .motivation-card {
    border-radius: 16px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    direction: rtl;
    min-height: 120px;
    box-shadow: 0 4px 20px rgba(139,92,246,0.2);
  }
  .motivation-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    z-index: 0;
  }
  .motivation-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to left,
      rgba(60, 20, 120, 0.88) 0%,
      rgba(80, 30, 150, 0.72) 45%,
      rgba(40, 10, 100, 0.35) 75%,
      transparent 100%
    );
    z-index: 1;
  }
  .motivation-card-content {
    position: relative;
    z-index: 2;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 120px;
    max-width: 75%;
  }
  .motivation-label {
    font-size: 11px;
    color: rgba(255,200,255,0.9);
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .motivation-quote {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    line-height: 1.7;
    text-shadow: 0 1px 8px rgba(0,0,0,0.3);
  }
  .motivation-icon { display: none; }
  .motivation-text { display: none; }

  /* ── CHECKIN CARD ── */
  .checkin-wrap { margin-bottom: 10px; }

  .checkin-card {
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    min-height: 130px;
    background-size: cover;
    background-position: center 40%;
    box-shadow: 0 6px 24px rgba(99,102,241,0.25);
    direction: rtl;
    cursor: pointer;
  }
  .checkin-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      135deg,
      rgba(10, 5, 40, 0.72) 0%,
      rgba(30, 10, 80, 0.55) 50%,
      rgba(10, 5, 40, 0.3) 100%
    );
    z-index: 1;
  }
  .checkin-card-content {
    position: relative;
    z-index: 2;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-height: 130px;
    justify-content: center;
  }
  .checkin-card-label {
    font-size: 15px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  }
  .checkin-card-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    text-shadow: 0 1px 6px rgba(0,0,0,0.4);
    margin-bottom: 8px;
  }

  .btn-checkin {
    padding: 11px 22px;
    border: none;
    border-radius: 30px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all .3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    backdrop-filter: blur(8px);
  }
  .btn-checkin svg { width: 18px; height: 18px; stroke: currentColor; flex-shrink: 0; }

    .btn-checkin.not-done {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.45);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  }
  .btn-checkin.not-done:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.04);
  }

  /* شیمر روی دکمه */
  .btn-checkin.not-done::after {
    content: "";
    position: absolute;
    top: 0; left: -75%;
    width: 50%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.18), transparent);
    animation: shimmer 2.5s ease-in-out infinite;
  }
  @keyframes shimmer {
    0%   { left: -75%; }
    100% { left: 125%; }
  }

  @keyframes glow-pulse {
    0%,100% { box-shadow: 0 6px 30px rgba(59,130,246,0.35); }
    50%      { box-shadow: 0 6px 50px rgba(59,130,246,0.55); }
  }

  .btn-checkin.done {
    background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(34,197,94,0.08));
    border: 1.5px solid rgba(34,197,94,0.4);
    color: #16A34A;
    cursor: default;
    box-shadow: 0 4px 20px rgba(34,197,94,0.15);
    animation: none;
  }

  .btn-checkin.done::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: radial-gradient(circle at 50% 50%, rgba(34,197,94,0.08), transparent 70%);
  }

  /* انیمیشن تیک */
  @keyframes popIn {
    0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
    60%  { transform: scale(1.3) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
  }
  .checkin-tick {
    display: inline-block;
    animation: popIn .5s cubic-bezier(.34,1.56,.64,1) forwards;
    font-size: 22px;
  }

  /* امتیاز برجسته */
  .checkin-pts {
    background: rgba(34,197,94,0.2);
    border: 1px solid rgba(34,197,94,0.35);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 13px;
    font-weight: 800;
    color: #4ade80;
    margin-right: 4px;
  }

  /* ── SECTION TITLE ── */
  .section-title {
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1E293B;
  }
  .section-title svg { stroke: #6366F1; width: 15px; height: 15px; flex-shrink: 0; }
  .section-title::after {
    content:"";
    flex:1;
    height:1.5px;
    background: linear-gradient(90deg, rgba(99,102,241,0.3), transparent);
  }

  /* ── TIMER ── */
  /* ── NEON TIMER ── */
  .timer-display {
    background: linear-gradient(145deg, #ffffff, #f0f4ff);
    border: 1.5px solid rgba(99,102,241,0.18);
    border-radius: 18px;
    padding: 16px 14px 14px;
    text-align: center;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(99,102,241,0.12);
  }
  .timer-display::before {
    content:"";
    position:absolute;top:-40%;right:-10%;
    width:200px;height:200px;
    background:radial-gradient(circle,rgba(99,102,241,0.08),transparent 65%);
    pointer-events:none;
  }
  .timer-display::after {
    content:"";
    position:absolute;bottom:-30%;left:-5%;
    width:150px;height:150px;
    background:radial-gradient(circle,rgba(139,92,246,0.07),transparent 65%);
    pointer-events:none;
  }

  .timer-subject {
    font-size: 11px;
    color: #6366F1;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
  }

  /* دایره SVG */
  .timer-ring-wrap {
    position: relative;
    width: min(150px, 50vw);
    height: min(150px, 50vw);
    margin: 0 auto 8px;
  }

  .timer-ring-svg {
    width: 100%; height: 100%;
    transform: rotate(-90deg);
    position: absolute; inset: 0;
  }

  .timer-ring-bg {
    fill: none;
    stroke: #E0E7FF;
    stroke-width: 10;
  }

  .timer-ring-fill {
    fill: none;
    stroke: url(#timerGrad);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 565;
    stroke-dashoffset: 0;
    filter: drop-shadow(0 0 6px rgba(99,102,241,0.5));
    transition: stroke-dashoffset .6s ease;
  }

  /* اعداد وسط دایره */
  .timer-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .timer-icon {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    background: rgba(99,102,241,0.12);
    border-radius: 50%;
    margin: 0 auto 2px;
  }
  .timer-icon svg { stroke: #6366F1; width: 15px; height: 15px; }

  .timer-digits {
    display: flex;
    align-items: center;
    gap: 1px;
  }

  .timer-seg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
  }

  .timer-seg-val {
    font-size: clamp(14px, 4.5vw, 20px);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: #3730A3;
    text-shadow: none;
    min-width: clamp(20px, 6vw, 28px);
    text-align: center;
  }

  .timer-seg-val.center-seg { color: #4F46E5; font-size: clamp(15px, 5vw, 22px); }

  .timer-seg-lbl {
    font-size: 7px;
    color: #94A3B8;
    letter-spacing: .5px;
  }

  .timer-colon {
    font-size: 18px;
    font-weight: 900;
    color: #6366F1;
    line-height: 1;
    margin-bottom: 10px;
    animation: colonBlink 1s step-end infinite;
  }

  @keyframes colonBlink {
    0%,100% { opacity:1; }
    50%      { opacity:.2; }
  }

  /* نقاط نئون روی دایره */
  @keyframes ringGlow {
    0%,100% { filter: drop-shadow(0 0 6px rgba(99,102,241,0.5)); }
    50%      { filter: drop-shadow(0 0 14px rgba(139,92,246,0.7)); }
  }
  .timer-ring-fill { animation: ringGlow 2s ease-in-out infinite; }

  /* hidden اصلی */
  #timer-display { display: none; }

  .timer-pts {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #D97706;
    background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(251,191,36,0.08));
    border: 1.5px solid rgba(245,158,11,0.3);
    border-radius: 20px;
    padding: 6px 12px;
    margin-top: 6px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(245,158,11,0.15);
  }
  .timer-pts svg { stroke: #F59E0B; width: 12px; height: 12px; }

  .subjects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }

  .subject-btn {
    padding: 14px 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
  }

  .subject-btn:hover,
  .subject-btn.selected {
    border-color: var(--red);
    background: rgba(229,9,20,0.1);
    color: #fff;
    box-shadow: 0 4px 16px var(--red-glow);
  }

  .timer-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .timer-btns.has-pause { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
  .btn-pause {
    grid-column: 1 / -1; grid-column: 1 / -1; display: none; }
  .timer-btns.has-pause .btn-pause {
    grid-column: 1 / -1; display: block; width: 100%; }

  .btn-start {
    padding: 14px;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    border: none; border-radius: 16px;
    color: #fff; font-family: var(--font);
    font-size: 14px; font-weight: 900;
    cursor: pointer; transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 6px 24px rgba(99,102,241,0.45), inset 0 1px 0 rgba(255,255,255,0.2);
    letter-spacing: 0.3px; position: relative; overflow: hidden;
  }
  .btn-start::after { content:""; position:absolute; inset:0; background:linear-gradient(135deg,rgba(255,255,255,0.15),transparent); border-radius:inherit; }

  .btn-stop {
    padding: 14px;
    background: rgba(239,68,68,0.08);
    border: 1.5px solid rgba(239,68,68,0.35); border-radius: 16px;
    color: #DC2626; font-family: var(--font);
    font-size: 14px; font-weight: 900;
    cursor: pointer; transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    letter-spacing: 0.3px;
  }

  .btn-pause {
    grid-column: 1 / -1; padding: 14px;
    background: rgba(245,158,11,0.1);
    border: 1.5px solid rgba(245,158,11,0.4); border-radius: 16px;
    color: #F59E0B; font-family: var(--font);
    font-size: 14px; font-weight: 900;
    cursor: pointer; transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    display: none; width: 100%; letter-spacing: 0.3px;
  }
  .btn-pause.paused {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: transparent; color: #fff;
    box-shadow: 0 6px 24px rgba(34,197,94,0.45), inset 0 1px 0 rgba(255,255,255,0.2);
  }
  .btn-pause:hover { opacity: .88; transform: translateY(-2px); }

  /* وقتی pause هست، حلقه تایمر کمرنگ بشه */
  .timer-ring-fill.paused-ring {
    stroke: #F59E0B !important;
    opacity: 0.5;
    animation: none !important;
  }
  .timer-digits.paused-digits { opacity: 0.55; }

  .btn-start:hover { transform:translateY(-2px); box-shadow: 0 8px 28px rgba(99,102,241,0.5); }
  .btn-stop:hover  { border-color: rgba(239,68,68,0.6); background: rgba(239,68,68,0.14); }

  /* ── TODAY STATS ── */
  .subject-stat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform .2s;
  }

  .subject-stat:hover { transform: translateX(-3px); }

  .subject-stat .name { font-size: 14px; font-weight: 600; }
  .subject-stat .time { font-size: 13px; color: var(--red); font-weight: 700; }

  .progress-bar {
    height: 4px;
    background: var(--bg3);
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
  }

  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--red), #ff4444);
    border-radius: 4px;
    transition: width .5s ease;
  }

  /* ── LEADERBOARD ── */
  .lb-filters-wrap {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    padding: 10px 10px 0;
    margin-bottom: 14px;
    border: 1px solid rgba(99,102,241,0.14);
    box-shadow: 0 4px 20px rgba(99,102,241,0.1);
    overflow: hidden;
  }

  .lb-filter-row {
    display: flex;
    gap: 6px;
    padding-bottom: 12px;
    overflow-x: auto;

    scrollbar-width: none;
  }
  .lb-filter-row::-webkit-scrollbar { display: none; }

  .lb-filter-row + .lb-filter-row {
    border-top: 1px solid transparent;
  }

  .lb-filter-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #6366F1, #A78BFA, transparent);
    margin: 0 -14px;
    box-shadow: 0 0 10px rgba(99,102,241,0.25);
  }

  .lb-filters {
    display: flex;
    gap: 6px;
    padding-bottom: 12px;
    overflow-x: auto;

    scrollbar-width: none;
  }

  .lb-filters::-webkit-scrollbar { display:none; }

  .filter-btn {
    padding: 5px 12px;
    background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.14);
    border-radius: 30px;
    color: #64748B;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
    flex-shrink: 0;
  }

  .filter-btn:hover {
    background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.3);
    color: #4F46E5;
  }

  .filter-btn.active {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 14px rgba(99,102,241,0.35);
  }

  .lb-item {
    background: linear-gradient(135deg, rgba(26,26,26,0.95) 0%, rgba(18,18,18,0.98) 100%);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 13px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all .25s cubic-bezier(.22,1,.36,1);
    animation: slideIn .35s ease both;
    position: relative;
    overflow: hidden;
  }

  .lb-item::after {
    content: "";
    position: absolute;
    top: 0; right: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(229,9,20,0.5), transparent);
    opacity: 0;
    transition: opacity .2s;
    border-radius: 0 14px 14px 0;
  }

  .lb-item:hover::after { opacity: 1; }

  @keyframes slideIn {
    from { opacity:0; transform:translateX(16px); }
    to   { opacity:1; transform:translateX(0); }
  }

  .lb-item.me {
    border-color: rgba(229,9,20,0.35);
    background: linear-gradient(135deg, rgba(229,9,20,0.08) 0%, rgba(26,26,26,0.95) 100%);
    box-shadow: 0 0 24px rgba(229,9,20,0.12), inset 0 0 20px rgba(229,9,20,0.04);
  }

  .lb-item.me::after { opacity: 1; background: linear-gradient(to bottom, transparent, var(--red), transparent); }

  .lb-item:hover { transform: translateX(-3px); box-shadow: 0 4px 20px rgba(0,0,0,0.4); }

  /* ══════════════════════════════
     PODIUM — CINEMATIC REDESIGN
  ══════════════════════════════ */

  /* پس‌زمینه کل پودیوم */
  .lb-podium {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
    padding: 20px 4px 0;
  }

  /* هاله محیطی قرمز پس‌زمینه */
  .lb-podium::before {
    content: "";
    position: absolute;
    bottom: 0; left: 50%; transform: translateX(-50%);
    width: 300px; height: 140px;
    background: radial-gradient(ellipse at center bottom, rgba(229,9,20,0.3) 0%, rgba(229,9,20,0.08) 40%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
  }

  /* ── کارت هر نفر ── */
  .pod-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    animation: podIn .7s cubic-bezier(.22,1,.36,1) both;
  }
  .pod-card:nth-child(1) { animation-delay: .15s; }
  .pod-card:nth-child(2) { animation-delay: 0s;   }
  .pod-card:nth-child(3) { animation-delay: .3s;  }

  @keyframes podIn {
    from { opacity:0; transform:translateY(40px) scale(.9); }
    to   { opacity:1; transform:translateY(0)    scale(1);  }
  }

  /* تاج */
  .pod-crown {
    font-size: 20px; line-height: 1;
    filter: drop-shadow(0 0 8px currentColor);
  }
  .pod-card.rank-1 .pod-crown { font-size: 30px; animation: crownBob 2.4s ease-in-out infinite; }
  .pod-card.rank-2 .pod-crown { filter: drop-shadow(0 0 6px #c0c0c0); }
  .pod-card.rank-3 .pod-crown { filter: drop-shadow(0 0 6px #cd7f32); }

  @keyframes crownBob {
    0%,100% { transform: translateY(0);    }
    50%      { transform: translateY(-5px); }
  }

  /* ── لایه آواتار + هاله چرخان ── */
  .pod-avatar-wrap {
    position: relative;
    width: 72px; height: 72px;
  }
  .pod-card.rank-1 .pod-avatar-wrap { width: 92px; height: 92px; }

  /* هاله چرخان SVG */
  .pod-halo-svg {
    position: absolute; inset: -6px;
    width: calc(100% + 12px); height: calc(100% + 12px);
    animation: haloSpin 4s linear infinite;
    pointer-events: none;
  }
  .pod-card.rank-1 .pod-halo-svg { animation-duration: 3s; }
  .pod-card.rank-2 .pod-halo-svg { animation-direction: reverse; animation-duration: 5s; }
  .pod-card.rank-3 .pod-halo-svg { animation-duration: 6s; }

  @keyframes haloSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
  }

  /* عکس / حرف آواتار */
  .pod-avatar-img {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #1e1e1e;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 800; color: #ccc;
    overflow: hidden;
  }
  .pod-avatar-img img { width:100%; height:100%; object-fit:cover; border-radius:50%; }

  /* درخشش روی آواتار رتبه ۱ */
  .pod-card.rank-1 .pod-avatar-img::after {
    content: "";
    position: absolute; inset: 0; border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,215,0,0.15) 0%, transparent 60%);
    pointer-events: none;
  }

  /* ── کارت شیشه‌ای زیر آواتار ── */
  .pod-glass {
    background: rgba(8,8,8,0.92);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 18px;
    padding: 10px 12px 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-width: 82px;
  }
  .pod-card.rank-1 .pod-glass {
    min-width: 100px;
    background: rgba(10,8,0,0.93);
    border-color: rgba(255,215,0,0.2);
    box-shadow: 0 0 30px rgba(255,215,0,0.1), 0 8px 32px rgba(0,0,0,0.7);
  }
  .pod-card.rank-2 .pod-glass {
    background: rgba(8,8,8,0.93);
    border-color: rgba(192,192,192,0.15);
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  }
  .pod-card.rank-3 .pod-glass {
    background: rgba(8,5,0,0.93);
    border-color: rgba(205,127,50,0.15);
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  }

  /* رفلکت بالای کارت */
  .pod-glass::before {
    content: "";
    position: absolute; top:0; left:10%; right:10%; height:1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  }

  .pod-name {
    font-size: 12px; font-weight: 800; color: #fff;
    white-space: normal; overflow: hidden; text-overflow: ellipsis;
    max-width: 95px;
    margin-bottom: 5px;
  }
  .pod-card.rank-1 .pod-name { font-size: 14px; }

  .pod-score {
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; gap: 3px;
    line-height: 1.3;
  }
  .pod-card.rank-1 .pod-score { font-size: 12px; }

  /* رنگ امتیاز */
  .pod-card.rank-1 .pod-score { color: #ffd700; }
  .pod-card.rank-2 .pod-score { color: #c0c0c0; }
  .pod-card.rank-3 .pod-score { color: #cd7f32; }

  /* سکو */
  .pod-base {
    width: 82px;
    border-radius: 10px 10px 0 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 900;
    padding: 10px 0;
  }
  .pod-card.rank-1 .pod-base { width: 100px; height: 56px; font-size: 28px; background: linear-gradient(135deg,#92680a,#ffd700); color:#000; box-shadow: 0 -4px 20px rgba(255,215,0,.35); }
  .pod-card.rank-2 .pod-base { height: 44px; background: linear-gradient(135deg,#555,#b0b0b0); color:#000; box-shadow: 0 -4px 14px rgba(192,192,192,.2); }
  .pod-card.rank-3 .pod-base { height: 34px; background: linear-gradient(135deg,#7a3d10,#cd7f32); color:#000; box-shadow: 0 -4px 14px rgba(205,127,50,.2); }

  /* پالس روی رتبه ۱ */
  .pod-card.rank-1 .pod-base {
    animation: basePulse 2.5s ease-in-out infinite;
  }
  @keyframes basePulse {
    0%,100% { box-shadow: 0 -4px 20px rgba(255,215,0,.35); }
    50%      { box-shadow: 0 -4px 36px rgba(255,215,0,.6);  }
  }

  .lb-rank {
    font-size: 13px;
    font-weight: 900;
    width: 32px;
    height: 32px;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: var(--muted);
    letter-spacing: -0.5px;
  }

  .lb-avatar { position: relative;
    width: 44px; height: 44px;
    background: var(--bg3);
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.07);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: visible;
    transition: border-color .2s;
  }
  .lb-avatar img { border-radius: 50%; overflow: hidden; }
  .lb-item:hover .lb-avatar { border-color: rgba(229,9,20,0.4); }
  .lb-item.me .lb-avatar { border-color: rgba(229,9,20,0.5); }

  .lb-info { flex: 1; min-width: 0; }
  .lb-info .lb-name { font-size: 14px; font-weight: 700; color: #eee; }
  .lb-info .lb-field { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 4px; }

  .lb-time {
    text-align: left;
    flex-shrink: 0;
  }

  .lb-time .t {
    font-size: 13px; font-weight: 800; color: #ff3a3a;
    background: rgba(229,9,20,0.12);
    padding: 3px 8px; border-radius: 8px;
    margin-bottom: 4px;
    display: inline-block;
  }
  .lb-time .p { font-size: 11px; color: var(--gold); text-align: center; }

  /* ══════════════════════════════════════════
     💎 CHAT — طراحی مدرن پریمیوم
  ══════════════════════════════════════════ */

  :root {
    --chat-bg-from: #0f0f1a;
    --chat-bg-to:   #1a1030;
    --chat-glass:   rgba(255,255,255,0.045);
    --chat-border:  rgba(255,255,255,0.08);
    --chat-accent:  #a78bfa;
    --chat-accent2: #6d28d9;
    --chat-me-from: #7c3aed;
    --chat-me-to:   #4f46e5;
    --chat-them:    rgba(255,255,255,0.06);
    --chat-text:    #e9e4ff;
    --chat-muted:   rgba(255,255,255,0.38);
    --chat-radius:  20px;
    --chat-bar-h:   62px;
  }

  /* بکگراند اورا */

  /* نویز دارک مود */

  /* ── پیام پین‌شده ── */

  #dashboard-announcement {
    margin: 10px 0 8px;
    background: linear-gradient(135deg,#6366f1 0%,#8b5cf6 50%,#a78bfa 100%);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 24px rgba(99,102,241,0.30);
  }
  .dashboard-announcement-icon { font-size: 18px; flex-shrink: 0; }
  .dashboard-announcement-text { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.5; }

  /* ── باکس پیام‌ها ── */

  /* جداکننده تاریخ */

  @keyframes msgIn {
    from { opacity:0; transform:translateY(10px) scale(.97); }
    to   { opacity:1; transform:translateY(0) scale(1); }
  }

  /* آواتار */

  /* حباب پیام */

  /* حباب دیگران */

  /* حباب خودم */

  /* اسم طلایی */

  .pod-name.red-tier, .lb-name.red-tier { color:#ff2a2a !important; -webkit-text-fill-color:#ff2a2a !important; background:none !important; text-shadow:0 0 8px rgba(255,42,42,.45); font-weight:900; }
  .pod-name.gold-tier, .lb-name.gold-tier {
    background: linear-gradient(90deg, #f5c518, #ffe066, #f5c518, #ffd700, #f5c518);
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldShimmer 2.5s linear infinite;
    font-weight: 900;
  }
  @keyframes goldShimmer {
    0%   { background-position: 0% center; }
    100% { background-position: 250% center; }
  }
  .pod-name.gold-tier::after, .lb-name.gold-tier::after {
    content: "";
    -webkit-text-fill-color: #f5c518;
    font-size: 10px;
  }

  /* ── ردیف ورودی پیام ── */

  /* دکمه ارسال */
  .btn-send {
    width: 46px; height: 46px;
    background: linear-gradient(145deg, #7c3aed, #5b21b6);
    border: 1px solid rgba(167,139,250,0.25); border-radius: 50%;
    color: #fff; font-size: 19px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s cubic-bezier(.34,1.56,.64,1);
    box-shadow: 0 4px 16px rgba(124,58,237,0.5), inset 0 1px 0 rgba(255,255,255,0.12);
    flex-shrink: 0;
    position: relative; overflow: hidden;
  }
  .btn-send::before {
    content: "";
    position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 65%);
    opacity: 0; transition: opacity .2s;
  }
  .btn-send:hover  {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 6px 24px rgba(124,58,237,0.65);
  }
  .btn-send:hover::before { opacity: 1; }
  .btn-send:active { transform: scale(0.92); }

  /* ── CHALLENGE ── */
  .challenge-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
    transition: transform .2s;
  }

  .challenge-card::before {
    content:"";
    position:absolute; top:0; right:0;
    width:80px; height:80px;
    background: radial-gradient(circle, rgba(229,9,20,0.12), transparent 70%);
    pointer-events:none;
  }

  .challenge-card:hover { transform: translateY(-3px); }

  .ch-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
  }

  .ch-title { font-size: 16px; font-weight: 800; }
  .ch-badge { font-size: 28px; }

  .ch-desc { font-size: 13px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }

  .ch-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;

  }

  .ch-tag {
    padding: 5px 12px;
    background: rgba(229,9,20,0.1);
    border: 1px solid rgba(229,9,20,0.2);
    border-radius: 20px;
    font-size: 12px;
    color: var(--red);
    font-weight: 600;
  }

  .ch-progress {
    margin-bottom: 14px;
  }

  .ch-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
  }

  .ch-bar {
    height: 8px;
    background: var(--bg3);
    border-radius: 8px;
    overflow: hidden;
  }

  .ch-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--red), #ff4444);
    border-radius: 8px;
    transition: width .6s ease;
  }

  .btn-join {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    border: none; border-radius: 12px;
    color: #fff; font-family: var(--font);
    font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all .2s;
    box-shadow: 0 4px 16px var(--red-glow);
  }
  .btn-join.not-started {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #aaa;
    box-shadow: none;
  }

  .btn-join.joined {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3);
    color: var(--success);
    box-shadow: none;
    cursor: default;
  }

  /* ── BOTTOM NAV ── */
  .bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.07);
    display: flex;
    z-index: 200;
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    height: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    cursor: pointer;
    transition: all .2s;
    border: none;
    background: transparent;
    color: #94A3B8;
    font-family: var(--font);
  }

  .nav-item.active { color: #3B82F6; }
  .nav-item .icon  { font-size: 22px; transition: transform .2s; }
  .nav-item svg { width: 24px; height: 24px; transition: transform .2s; }
  .nav-item .label { font-size: 10px; font-weight: 600; }
  .nav-item.active .icon { transform: translateY(-2px); }
  .nav-item.active svg { transform: translateY(-2px); stroke: #3B82F6; }

  .nav-item .icon-wrap {
    position: relative;
    display: inline-block;
    line-height: 1;
  }
  
  @keyframes dotPulse {
    0%,100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.25); opacity: 0.8; }
  }

  /* ── TOOLS SHEET ── */
  #tools-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    z-index: 9998;
    align-items: flex-end;
    justify-content: center;
  }
  #tools-overlay.open { display: flex; }

  #tools-sheet {
    background: #fff;
    border-radius: 28px 28px 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform .38s cubic-bezier(.22,1,.36,1);
    box-shadow: 0 -8px 40px rgba(99,102,241,0.18);
  }
  #tools-overlay.open #tools-sheet { transform: translateY(0); }

  .tools-handle {
    width: 40px; height: 4px;
    background: #E2E8F0;
    border-radius: 4px;
    margin: 14px auto 0;
    flex-shrink: 0;
  }

  .tools-header {
    padding: 14px 22px 10px;
    flex-shrink: 0;
  }

  .tools-title {
    font-size: 18px;
    font-weight: 900;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .tools-title-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    box-shadow: 0 3px 10px rgba(99,102,241,0.35);
  }
  .tools-subtitle {
    font-size: 12px;
    color: #64748B;
    margin-top: 3px;
  }

  /* search */
  .tools-search-wrap {
    padding: 0 22px 12px;
    flex-shrink: 0;
  }
  .tools-search {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: #F1F5F9;
    border: 1.5px solid transparent;
    border-radius: 14px;
    font-family: var(--font);
    font-size: 13px;
    color: #1E293B;
    outline: none;
    transition: border-color .2s, background .2s;
    box-sizing: border-box;
    direction: rtl;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 14px) center;
    padding-right: 40px;
    padding-left: 16px;
  }
  .tools-search:focus { border-color: #6366F1; background-color: #fff; }

  /* category tabs */
  .tools-cats {
    display: flex;
    gap: 6px;
    padding: 0 22px 14px;
    overflow-x: auto;

    scrollbar-width: none;
    flex-shrink: 0;
  }
  .tools-cats::-webkit-scrollbar { display: none; }

  .tool-cat-btn {
    padding: 5px 13px;
    border-radius: 30px;
    border: 1.5px solid rgba(99,102,241,0.18);
    background: rgba(99,102,241,0.05);
    color: #64748B;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: normal;
    flex-shrink: 0;
    transition: all .2s;
  }
  .tool-cat-btn.active {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 12px rgba(99,102,241,0.35);
  }

  /* grid */
  .tools-grid-wrap {
    overflow-y: auto;
    padding: 0 16px calc(env(safe-area-inset-bottom,0px) + 20px);
    scrollbar-width: thin;
    scrollbar-color: #E2E8F0 transparent;
  }

  .tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 6px 12px;
    background: #F8FAFF;
    border: 1.5px solid rgba(99,102,241,0.1);
    border-radius: 18px;
    cursor: pointer;
    transition: all .22s cubic-bezier(.22,1,.36,1);
    position: relative;
    overflow: hidden;
    text-align: center;
  }
  .tool-card::before {
    content: "";
    position: absolute; inset: 0;
    border-radius: 18px;
    opacity: 0;
    transition: opacity .2s;
  }
  .tool-card:active { transform: scale(.95); }
  .tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.3);
  }

  .tool-icon-wrap {
    width: 46px; height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    transition: transform .2s;
  }
  .tool-card:hover .tool-icon-wrap { transform: scale(1.1) rotate(-4deg); }

  .tool-name {
    font-size: 10px;
    font-weight: 700;
    color: #334155;
    line-height: 1.3;
    word-break: keep-all;
  }

  /* soon badge */
  .tool-soon {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 8px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    border-radius: 6px;
    padding: 2px 5px;
    line-height: 1.4;
  }

  /* coming soon toast for tools */
  #tools-soon-toast {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 6px 24px rgba(99,102,241,0.45);
    opacity: 0;
    transition: all .3s cubic-bezier(.22,1,.36,1);
    white-space: normal;
    pointer-events: none;
    z-index: 10;
  }
  #tools-soon-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  .toast {
    position: fixed; top: 20px; left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    z-index: 9999;
    transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
    white-space: nowrap;
    box-shadow: var(--shadow);
    max-width: 85vw;
    text-align: center;
    opacity: 0;
    pointer-events: none;
  }
  .toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
  .toast.success { border-color: rgba(34,197,94,0.4); color: var(--success); }
  .toast.error   { border-color: rgba(229,9,20,0.4);  color: #ff6b6b; }

  /* ── LOADING ── */
  .spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 40px auto;
  }

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

  .empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
  }

  .empty .icon { font-size: 48px; margin-bottom: 12px; }
  .empty p { font-size: 14px; }

  /* ══════════════════════════════
     NEWS BANNER — اسلایدر خبری ادمین
  ══════════════════════════════ */

  .news-banner-wrap {
    padding: 10px 16px 12px;
    display: none;
  }

  .news-banner-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: var(--red);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
  }
  .news-live-dot {
    width: 7px; height: 7px;
    background: var(--red);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--red);
    animation: liveDot 1.4s ease-in-out infinite;
    flex-shrink: 0;
  }
  @keyframes liveDot {
    0%,100% { opacity:1; transform:scale(1); }
    50%      { opacity:.35; transform:scale(.65); }
  }

  /* ── wrapper با کادر چشمک‌زن ── */
  .news-halo-wrap {
    position: relative;
    border-radius: 20px;
    padding: 3px;
    background: #111;
    overflow: hidden;
    border: 2px solid rgba(229,9,20,0.55);
    animation: bannerPulse 2s ease-in-out infinite;
  }
  @keyframes bannerPulse {
    0%,100% { border-color: rgba(229,9,20,0.55); box-shadow: 0 0 10px rgba(229,9,20,0.2); }
    50%      { border-color: rgba(229,9,20,0.9);  box-shadow: 0 0 22px rgba(229,9,20,0.45); }
  }

  /* ── اسلایدر ── */
  .news-slider {
    position: relative;
    border-radius: 17px;
    overflow: hidden;
    z-index: 1;
    background: #0a0a0a;
  }

  .news-slider-track {
    display: flex;
    transition: transform .48s cubic-bezier(.4,0,.2,1);
    will-change: transform;
  }

  /* ── هر کارت ── */
  .news-card {
    flex-shrink: 0;
    width: 100%;
    position: relative;
    aspect-ratio: 16/7;
    background: #111;
    overflow: hidden;
  }

  .news-card img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
  }

  .news-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.1) 50%, transparent 100%);
    display: flex;
    align-items: flex-end;
    padding: 10px 14px;
    gap: 8px;
    justify-content: space-between;
  }

  .news-card-title {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
  }

  .news-card-badge {
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 20px;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(229,9,20,.5);
  }

  /* ── دات‌های ناوبری ── */
  .news-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 9px;
  }
  .news-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #333;
    cursor: pointer;
    transition: all .3s;
  }
  .news-dot.active {
    background: var(--red);
    width: 16px;
    border-radius: 3px;
    box-shadow: 0 0 6px rgba(229,9,20,.6);
  }

  /* ── WELCOME BANNER ── */
  .welcome-banner {
    border-radius: 20px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(99,102,241,0.45);
    direction: rtl;
    min-height: 130px;
  }
  .welcome-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to left,
      rgba(80, 40, 160, 0.82) 0%,
      rgba(90, 50, 170, 0.65) 40%,
      rgba(60, 30, 130, 0.25) 70%,
      transparent 100%
    );
    pointer-events: none;
    z-index: 1;
  }
  .welcome-banner-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 130px;
    padding: 0 20px;
  }
  .welcome-banner-text {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .welcome-banner-title {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
  }
  .welcome-banner-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.92);
    font-weight: 600;
    line-height: 1.6;
    text-shadow: 0 1px 6px rgba(0,0,0,0.25);
  }

    /* ── STORIES ── */
  .stories-wrap {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(99,102,241,0.1);
    margin: -16px -16px 14px;
    padding: 10px 0 6px;
    width: calc(100% + 32px);
  }

  .stories-row {
    display: flex;
    gap: 14px;
    padding: 6px 16px 10px;
    overflow-x: auto;

    scrollbar-width: none;
    direction: rtl;
  }
  .stories-row::-webkit-scrollbar { display:none; }

  .story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .25s;
    min-width: 64px;
  }
  .story-item:hover { transform: scale(1.08); }
  .story-item:active { transform: scale(0.96); }

  /* ── چراغ وضعیت لیدربورد: سبز=مطالعه، زرد=استراحت، خاکستری=خاموش ── */
  .online-dot {
    position: absolute;
    bottom: 1px;
    left: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg2, #1a1a2e);
    z-index: 2;
    background: #9ca3af;
  }
  .online-dot.studying {
    background: #22c55e;
    animation: onlinePulse 1.8s ease-in-out infinite;
  }
  .online-dot.break {
    background: #eab308;
    animation: onlinePulse 1.8s ease-in-out infinite;
  }
  .online-dot.offline {
    background: #9ca3af;
    animation: none;
  }
  @keyframes onlinePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.7); }
    50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
  }

  .story-ring {
    width: 64px; height: 64px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #8B5CF6, #6366F1, #3B82F6);
    background-size: 300% 300%;
    animation: storyGradient 3s ease infinite;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(99,102,241,0.35);
  }

  @keyframes storyGradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }

  .story-ring.seen {
    background: #cdd5e0;
    padding: 3px;
    box-shadow: none;
    animation: none;
  }
  .story-ring.add-ring {
    background: none;
    border: 2.5px dashed rgba(99,102,241,0.5);
    display: flex; align-items: center; justify-content: center;
    box-shadow: none;
    animation: none;
    width: 64px; height: 64px;
    padding: 0;
  }
  .story-ring.ad-ring {
    background: linear-gradient(135deg, #1a78f2, #42a5f5, #00c6ff);
    background-size: 300% 300%;
    animation: storyGradient 3s ease infinite;
    box-shadow: 0 4px 18px rgba(26,120,242,0.35);
    padding: 3px;
  }

  .story-inner {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    border: 2.5px solid #fff;
    overflow: hidden;
  }
  .story-inner img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
  }

  .story-name {
    font-size: 11px;
    color: #334155;
    max-width: 68px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    font-weight: 600;
  }

  .story-view-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: #aaa;
    margin-top: 2px;
    font-weight: 600;
  }

  /* ── POLL CARD ── */
  .poll-card {
    margin-bottom: 14px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center 30%;
    background-color: #1a0f2e;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 32px rgba(99,102,241,0.45);
    aspect-ratio: 16 / 9;
  }
  .poll-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.5) 65%, rgba(0,0,0,0.8) 100%);
    z-index: 1;
  }
  .poll-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 10px 12px 12px; }
  .poll-question {
    font-size: 15px; font-weight: 700;
    color: #fff; margin-bottom: 4px;
  }
  .poll-hint {
    font-size: 11px; color: #f59e0b;
    margin-bottom: 12px;
  }
  .poll-options-row {
    display: flex;
    flex-direction: row;
    gap: 6px;
  }
  .poll-option {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 1.5px solid rgba(139,92,246,0.5);
    transition: border-color 0.2s;
    position: relative;
    background: rgba(88,28,135,0.55);
    backdrop-filter: blur(2px);
  }
  .poll-option:active { opacity: 0.8; }
  .poll-option.selected { border-color: #fff; }
  .poll-option.voted { cursor: default; }
  .poll-option-fill {
    position: absolute; top:0; left:0; bottom:0;
    background: rgba(139,92,246,0.85);
    transition: width 0.6s ease;
    border-radius: 8px;
  }
  .poll-option.selected .poll-option-fill { background: rgba(139,92,246,0.95); }
  .poll-option-inner {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    text-align: center;
    min-height: 38px;
    box-sizing: border-box;
  }
  .poll-option-text { font-size: 11px; color: #eee; font-weight: 600; line-height: 1.3; }
  .poll-option-pct { font-size: 11px; color: #a78bfa; font-weight: 700; }
  .poll-voters-btn {
    font-size: 9px; color: #a78bfa;
    background: none; border: none;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    display: block;
    margin: 0 auto 4px;
  }
  .poll-total { font-size: 11px; color: #666; margin-top: 10px; text-align: center; }
  .poll-voters-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999; display: none;
    align-items: center; justify-content: center;
    padding: 16px;
  }
  .poll-voters-modal.open { display: flex; }
  .poll-voters-inner {
    background: #1a1a2e; border-radius: 16px;
    width: 100%; max-width: 480px;
    padding: 16px 16px 24px;
    max-height: 75vh; overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .poll-voters-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 12px; text-align: center; }
  .poll-voter-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.07); }
  .poll-voter-row:last-child { border-bottom: none; }
  .poll-voter-avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-size: 16px; overflow: hidden; flex-shrink: 0; }
  .poll-voter-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
  .poll-voter-name { font-size: 13px; color: #eee; }
  .poll-voters-group-title {
    font-size: 12px; font-weight: 700; color: #a78bfa;
    margin: 14px 0 6px; padding-bottom: 4px;
    border-bottom: 1px solid rgba(167,139,250,0.25);
  }
  .poll-voters-group-title:first-child { margin-top: 0; }

  /* ── STORY REACTIONS ── */
  .story-reactions {
    position: absolute;
    bottom: 50px; left: 0; right: 0;
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
    z-index: 20;
    flex-wrap: nowrap;
  }
  .story-reaction-btn {
    font-size: 28px;
    background: none;
    border: none;
    width: 40px; height: 40px;
    cursor: pointer;
    transition: transform 0.15s;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    -webkit-appearance: none;
    padding: 0;
  }
  .story-reaction-btn:active { transform: scale(1.5); }
  .story-reaction-btn.selected { transform: scale(1.3); filter: drop-shadow(0 0 8px #fff); }
  .story-swipe-panel {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(20,10,40,0.97);
    border-radius: 20px 20px 0 0;
    padding: 16px;
    z-index: 30;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(.4,0,.2,1);
    max-height: 60%;
    overflow-y: auto;
  }
  .story-swipe-panel.open { transform: translateY(0); }
  .story-swipe-handle {
    width: 40px; height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin: 0 auto 14px;
  }
  .story-reaction-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  .story-reaction-row:last-child { border-bottom: none; }
  .story-reaction-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; overflow: hidden; flex-shrink: 0;
  }
  .story-reaction-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
  .story-reaction-name { flex: 1; font-size: 13px; color: #eee; }
  .story-reaction-emoji { font-size: 22px; }

  /* ── STORY MODAL ── */
  .story-modal {
    position: fixed; inset: 0;
    background: #000;
    z-index: 9999;
    display: none;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
  }
  .story-modal.open { display: flex; }
  .story-modal-inner {
    width: 100%;
    max-width: 480px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #000;
    touch-action: pan-y;
  }
  @media (min-width: 481px) {
    .story-modal-inner {
      max-width: 400px;
      width: 400px;
      height: 100dvh;
      max-height: 700px;
      border-radius: 16px;
    }
  }

  .story-progress-bar {
    height: 3px;
    background: rgba(255,255,255,0.2);
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 10;
  }
  .story-progress-fill {
    height: 100%;
    background: #fff;
    width: 0%;
    transition: width linear;
  }

  .story-modal-header {
    position: absolute;
    top: 10px; left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
  }
  .story-modal-user { display: flex; align-items: center; gap: 10px; }
  .story-modal-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bg3);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    overflow: hidden;
  }
  .story-modal-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
  .story-modal-name { font-size: 13px; font-weight: 700; color: #fff; }
  .story-modal-time { font-size: 11px; color: rgba(255,255,255,0.6); }
  .story-close-btn {
    background: rgba(255,255,255,0.15);
    border: none; border-radius: 50%;
    width: 32px; height: 32px;
    color: #fff; font-size: 16px;
    cursor: pointer; display: flex;
    align-items: center; justify-content: center;
  }

  .story-modal-img {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
  }

  .story-nav-btn {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none; border-radius: 50%;
    width: 40px; height: 40px;
    color: #fff; font-size: 24px;
    cursor: pointer; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
  }
  .story-nav-btn:hover { background: rgba(255,255,255,0.3); }
  .story-nav-btn.prev { right: 10px; }
  .story-nav-btn.next { left: 10px; }

  /* upload overlay on my story */
  .story-upload-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(229,9,20,0.8), transparent);
    border-radius: 0 0 50% 50%;
    height: 40%;
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 4px;
    font-size: 10px; color: #fff; font-weight: 700;
  }

  /* ── TODAY SUBJECT CARDS ── */
  #today-subjects { direction: rtl; }

#update-banner {
  display: none;
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #6366f1;
  color: #fff;
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  cursor: pointer;
  text-align: center;
  direction: rtl;
  animation: pulse 1.5s infinite;
}

.scs-break-sep {
  font-size: 11px;
  color: #ef4444;
  text-align: center;
  padding: 2px 0 4px;
  opacity: 0.7;
  letter-spacing: 0.2px;
}

  .subject-card-stat {
    background: #fff;
    border: 1px solid rgba(99,102,241,0.1);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 2px 10px rgba(99,102,241,0.07);
    display: flex;
    align-items: center;
    gap: 14px;
    direction: rtl;
  }
  .subject-card-stat:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,0.14); }

  .scs-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, #7C3AED, #6366F1);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 24px;
    box-shadow: 0 4px 14px rgba(99,102,241,0.3);
  }
  .scs-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
  }
  .scs-row1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .scs-name {
    font-size: 15px;
    font-weight: 800;
    color: #1E293B;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
  }
  .scs-pct {
    font-size: 15px;
    font-weight: 900;
    color: #7C3AED;
    flex-shrink: 0;
  }
  .scs-tags {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    direction: rtl;
  }
  .scs-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: normal;
  }
  .scs-tag-time    { background: rgba(239,68,68,0.1);   color: #DC2626; border: 1px solid rgba(239,68,68,0.18); }
  .scs-tag-pts     { background: rgba(245,158,11,0.1);  color: #D97706; border: 1px solid rgba(245,158,11,0.18); }
  .scs-tag-sessions{ background: rgba(99,102,241,0.08); color: #4F46E5; border: 1px solid rgba(99,102,241,0.15); }
  /* مقایسه با دیروز */
  .scs-yest-row { display:flex; align-items:center; gap:6px; margin-top:2px; font-size:11px; }
  .scs-yest-label { color:#94A3B8; }
  .scs-yest-val   { font-weight:800; }
  .scs-yest-more  .scs-yest-val { color:#16a34a; }
  .scs-yest-less  .scs-yest-val { color:#7C3AED; }
  .scs-yest-new   .scs-yest-val { color:#0EA5E9; }
  .subject-card-stat.vs-more { border-color: rgba(34,197,94,0.35); box-shadow:0 2px 10px rgba(34,197,94,0.1); }
  .subject-card-stat.vs-less { border-color: rgba(124,58,237,0.35); box-shadow:0 2px 10px rgba(124,58,237,0.1); }
  .scs-break-row { display:flex; align-items:center; gap:4px; font-size:11px; color:#F59E0B; font-weight:700; margin-top:1px; }

  /* ── کارت mini هر session ── */
  .scs-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 6px;
    border-right: 3px solid #7C3AED;
    box-shadow: 0 1px 4px rgba(99,102,241,0.07);
    direction: rtl;
    gap: 8px;
  }
  .scs-mini-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
  }
  .scs-mini-icon { font-size: 18px; flex-shrink: 0; }
  .scs-mini-info { min-width: 0; }
  .scs-mini-name {
    font-size: 13px;
    font-weight: 800;
    color: #1E293B;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
  }
  .scs-mini-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
  }
  .scs-mini-left {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    gap: 1px;
  }
  .scs-mini-time {
    font-size: 13px;
    font-weight: 900;
  }
  .scs-mini-pts {
    font-size: 10px;
    color: #D97706;
    font-weight: 700;
  }

  .scs-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .scs-bar {
    flex: 1;
    height: 6px;
    background: rgba(99,102,241,0.1);
    border-radius: 20px;
    overflow: hidden;
    direction: rtl;
  }
  .scs-fill {
    height: 100%;
    border-radius: 20px;
    float: right;
    transition: width 1s cubic-bezier(.4,0,.2,1);
  }
  .fill-purple { background: linear-gradient(to left, #8B5CF6, #6366F1); }
  .fill-green  { background: linear-gradient(to left, #22c55e, #16a34a); }
  .fill-gold   { background: linear-gradient(to left, #f59e0b, #d97706); }
  .fill-red    { background: linear-gradient(to left, #ef4444, #dc2626); }

  .scs-caption {
    font-size: 11px;
    color: #94A3B8;
    white-space: normal;
    flex-shrink: 0;
  }
  .scs-info, .scs-meta, .scs-top, .scs-pts-old, .scs-sessions-old,
  .scs-time-old, .scs-bar-wrap, .scs-pct-old { display: none; }

  /* ── تاریخ شمسی ── */
  .shamsi-bar {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 16px rgba(99,102,241,0.28);
  }
  .shamsi-date { color:#fff; font-size:14px; font-weight:800; }
  .shamsi-day  { color:rgba(255,255,255,0.75); font-size:12px; font-weight:600; }

  /* ── کارت درس جدید ── */
  .study-card-new {
    background: #fff;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 14px rgba(99,102,241,0.10);
    border: 1.5px solid rgba(99,102,241,0.08);
    direction: rtl;
  }
  .sc-top-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
  }
  .sc-icon-box {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
  }
  .sc-info { flex: 1; min-width: 0; }
  .sc-name {
    font-size: 15px; font-weight: 800; color: #1E293B;
    overflow: hidden; text-overflow: ellipsis; white-space: normal;
  }
  .sc-meta { font-size: 11px; color: #64748B; margin-top: 3px; }
  .sc-time-big { font-size: 20px; font-weight: 900; flex-shrink: 0; }
  .sc-time-unit { font-size: 10px; color: #94A3B8; font-weight: 600; }
  .sc-bar-label {
    display: flex; justify-content: space-between;
    font-size: 10px; color: #94A3B8; margin-bottom: 4px;
  }
  .sc-bar-track {
    background: #F1F5F9; border-radius: 99px;
    height: 8px; overflow: hidden; margin-bottom: 8px;
  }
  .sc-bar-fill {
    height: 100%; border-radius: 99px;
    transition: width .7s cubic-bezier(.4,0,.2,1);
  }
  .sc-bar-track.yest { height: 5px; }
  .sc-diff {
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; gap: 4px;
    margin-top: 2px;
  }

  /* ── EMOJI BAR ── */

  .emoji-btn {
    font-size: 22px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 40px; height: 40px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .15s;
    display: flex; align-items: center; justify-content: center;
  }
  .emoji-btn:hover {
    transform: scale(1.2);
    border-color: var(--red);
    background: rgba(229,9,20,0.1);
  }

  .rules-title {
    font-size: 11px;
    font-weight: 800;
    color: #a78bfa;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 0.5px;
  }
  .rules-list {
    list-style: none;
    counter-reset: rule-counter;
    padding: 0;
  }
  .rules-list li {
    counter-increment: rule-counter;
    font-size: 11px;
    color: rgba(196,181,253,0.75);
    line-height: 1.6;
    padding: 4px 0;
    border-bottom: 1px solid rgba(167,139,250,0.08);
    display: flex;
    gap: 8px;
    align-items: flex-start;
  }
  .rules-list li:last-child { border-bottom: none; }
  .rules-list li::before {
    content: counter(rule-counter);
    background: rgba(124,58,237,0.25);
    color: #a78bfa;
    font-size: 9px;
    font-weight: 800;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    border: 1px solid rgba(167,139,250,0.2);
  }

  /* ── OFFLINE REPORT ── */
  .history-header-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
  }
  .btn-offline-report {
    padding: 7px 14px;
    background: linear-gradient(135deg,rgba(99,102,241,.18),rgba(99,102,241,.1));
    border: 1.5px solid rgba(99,102,241,.4);
    border-radius: 10px;
    color: #818cf8;
    font-family: var(--font); font-size: 12px; font-weight: 800;
    cursor: pointer; transition: all .2s;
  }
  .btn-offline-report:hover { background: rgba(99,102,241,.28); transform: translateY(-1px); }

  /* مودال گزارش */
  .offline-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 500;
    background: rgba(0,0,0,.75); backdrop-filter: blur(8px);
    align-items: flex-end; justify-content: center;
  }
  .offline-modal-overlay.open { display: flex; }
  .offline-modal-box {
    background: #12121e;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 24px 24px 0 0;
    width: 100%; max-width: 520px;
    max-height: 88vh; overflow-y: auto;
    padding: 24px 20px 32px;
    animation: slideUp .3s ease;
  }
  @keyframes slideUp { from{transform:translateY(60px);opacity:0} to{transform:translateY(0);opacity:1} }
  .offline-modal-title {
    font-size: 16px; font-weight: 900; margin-bottom: 18px;
    display: flex; align-items: center; gap: 8px;
  }
  .offline-item-row {
    display: grid; grid-template-columns: 1fr 90px 32px; gap: 8px;
    align-items: center; margin-bottom: 8px;
  }
  .offline-inp {
    padding: 8px 12px;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 10px;
    color: #ffffff; font-family: var(--font); font-size: 13px;
    outline: none; width: 100%;
    transition: border-color .2s, background .2s;
  }
  .offline-inp:focus { border-color: #6366f1; background: rgba(0,0,0,.55); }
  .offline-inp::placeholder { color: rgba(255,255,255,.35); }
  .btn-del-row {
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3);
    color: #f87171; font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: .2s; flex-shrink: 0;
  }
  .btn-del-row:hover { background: rgba(239,68,68,.3); }
  .btn-add-row {
    width: 100%; padding: 9px;
    background: rgba(99,102,241,.12); border: 1.5px dashed rgba(99,102,241,.4);
    border-radius: 10px; color: #818cf8;
    font-family: var(--font); font-size: 13px; font-weight: 800;
    cursor: pointer; transition: .2s; margin-bottom: 14px;
  }
  .btn-add-row:hover { background: rgba(99,102,241,.22); }
  .offline-submit-btn {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none; border-radius: 12px;
    color: #fff; font-family: var(--font); font-size: 15px; font-weight: 800;
    cursor: pointer; transition: .2s;
    box-shadow: 0 6px 20px rgba(99,102,241,.4);
    margin-top: 6px;
  }
  .offline-submit-btn:hover { opacity: .9; }
  .offline-submit-btn:disabled { opacity: .55; cursor: not-allowed; }

  /* کارت گزارش‌های قبلی */
  .offline-note-box {
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height .3s ease, opacity .25s ease, margin-top .3s ease;
  }
  .offline-note-box.open {
    max-height: 200px; opacity: 1; margin-top: 4px;
  }
  .offline-report-card {
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
    color: #ffffff;
  }
  .offline-report-card.status-approved { border-color: rgba(34,197,94,.3); }
  .offline-report-card.status-rejected { border-color: rgba(239,68,68,.3); }
  .offline-report-card.status-pending  { border-color: rgba(245,158,11,.25); }
  .offline-status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 800;
  }
  .badge-pending  { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.3); }
  .badge-approved { background: rgba(34,197,94,.15);  color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
  .badge-rejected { background: rgba(239,68,68,.15);  color: #f87171; border: 1px solid rgba(239,68,68,.3); }

  /* ── STUDY HISTORY ── */
  .history-section-title {
    font-size: 13px;
    font-weight: 800;
    margin: 20px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1E293B;
  }
  .history-section-title::after {
    content:"";
    flex:1;
    height:1px;
    background: rgba(99,102,241,0.2);
  }
  .history-day-block { margin-bottom: 8px; }
  .history-day-header {
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    padding: 10px 14px;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: opacity .15s;
    box-shadow: 0 2px 10px rgba(99,102,241,0.25);
  }
  .history-day-header:active { opacity: .85; }
  .history-day-header .day-total {
    color: rgba(255,255,255,0.85);
    font-weight: 700;
    font-size: 11px;
  }
  .history-day-header .day-arrow {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    transition: transform .25s;
    margin-right: 6px;
  }
  .history-day-header.open .day-arrow { transform: rotate(180deg); }
  .history-subjects-wrap {
    display: none;
    padding: 6px 0 4px;
  }
  .history-subjects-wrap.open { display: block; }
  .history-month-block { margin-bottom: 8px; }
  .history-month-header {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    padding: 12px 14px;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: opacity .15s;
    box-shadow: 0 2px 10px rgba(245,158,11,0.3);
  }
  .history-month-header:active { opacity: .85; }
  .history-month-header .month-total {
    color: rgba(255,255,255,0.9);
    font-weight: 700;
    font-size: 11px;
  }
  .history-month-header .month-arrow {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    transition: transform .25s;
    margin-right: 6px;
  }
  .history-month-header.open .month-arrow { transform: rotate(180deg); }
  .history-month-days-wrap {
    display: none;
    padding: 8px 0 4px;
  }
  .history-month-days-wrap.open { display: block; }
  .history-subj-row {
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(99,102,241,0.12);
    border-right: 3px solid #6366F1;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(99,102,241,0.06);
  }
  .history-subj-row .hs-name {
    font-size: 13px;
    font-weight: 700;
    color: #1E293B;
  }
  .history-subj-row .hs-meta {
    font-size: 11px;
    color: #64748B;
    margin-top: 3px;
  }
  .history-subj-row .hs-time {
    font-size: 13px;
    font-weight: 800;
    color: #4F46E5;
    text-align: left;
  }
  .history-subj-row .hs-pts {
    font-size: 11px;
    color: #F59E0B;
    margin-top: 2px;
    text-align: left;
  }

  /* ── MOBILE RESPONSIVE ── */
  @media (max-width: 380px) {
    .stat-box { padding: 10px 4px; }
    .stat-box .val { font-size: 14px; }
    .stat-box .lbl { font-size: 9px; }
    .stat-box .stat-icon { width: 32px; height: 32px; }
    .stat-box .stat-icon svg { width: 16px; height: 16px; }
    .hero-name { font-size: 16px; }
    .hero-greeting { font-size: 11px; }
    .section-title { font-size: 14px; }
    .timer-colon { font-size: clamp(18px, 5vw, 28px); }
    .motivation-card { padding: 12px 14px; gap: 10px; }
    .motivation-quote { font-size: 12px; }
    .btn-checkin { font-size: 14px; padding: 15px 16px; }
    .filter-btn { flex-shrink: 0; padding: 6px 12px; font-size: 11px; }
    .topbar-logo { font-size: 15px; }
    .nav-item .label { font-size: 9px; }
    .nav-item svg { width: 20px; height: 20px; }
  }

  @media (max-width: 320px) {
    .stats-row { gap: 5px; }
    .stat-box { padding: 8px 3px; }
    .hero { padding: 12px 12px 10px; }
  }

  /* ── Remember Me Popup ── */
  #remember-popup {
    display: none;
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.7);
    align-items: center; justify-content: center;
  }
  #remember-popup.show { display: flex; }
  .rm-card {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 340px; width: 90%;
    text-align: center;
    animation: rmSlideUp 0.3s ease;
  }
  @keyframes rmSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  .rm-avatar { font-size: 52px; margin-bottom: 12px; }
  .rm-title  { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 6px; }
  .rm-sub    { font-size: 13px; color: #aaa; margin-bottom: 24px; }
  .rm-btn-yes {
    width: 100%; padding: 13px;
    background: linear-gradient(135deg, #e50914, #b00710);
    border: none; border-radius: 12px;
    color: #fff; font-family: inherit; font-size: 15px; font-weight: 700;
    cursor: pointer; margin-bottom: 10px;
  }
  .rm-btn-no {
    width: 100%; padding: 11px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    color: #aaa; font-family: inherit; font-size: 14px;
    cursor: pointer;
  }
  .rm-btn-yes:hover { opacity: 0.9; }
  .rm-btn-no:hover  { border-color: rgba(255,255,255,0.3); color: #fff; }

/* ===== IDEAS CAROUSEL ===== */
.ideas-carousel-wrap {
  margin: 16px 16px 0;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(99,102,241,.13), 0 1px 4px rgba(0,0,0,.06);
  overflow: hidden;
  position: relative;
}
.ideas-carousel-header {
  padding: 14px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
}
.ideas-carousel-title {
  font-size: 13px;
  font-weight: 800;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ideas-carousel-counter {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}
.ideas-carousel-body {
  position: relative;
  min-height: 90px;
  overflow: hidden;
}
.ideas-slide {
  position: absolute;
  inset: 0;
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity .45s cubic-bezier(.4,0,.2,1), transform .45s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.ideas-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.ideas-slide.exit {
  opacity: 0;
  transform: translateX(30px);
}
.ideas-slide-name {
  font-size: 12px;
  font-weight: 700;
  color: #6366F1;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ideas-slide-done .ideas-slide-name { color: #22c55e; }
.ideas-slide-text {
  font-size: 13px;
  color: #334155;
  line-height: 1.65;
  font-weight: 500;
}
.ideas-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #22c55e;
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.25);
  border-radius: 20px;
  padding: 2px 8px;
  margin-top: 2px;
  width: fit-content;
}
.ideas-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 8px 0 12px;
}
.ideas-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: all .3s;
  cursor: pointer;
}
.ideas-dot.active {
  width: 16px;
  border-radius: 3px;
  background: linear-gradient(90deg,#6366F1,#8b5cf6);
}
/* ===== END IDEAS CAROUSEL ===== */

  img {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    pointer-events: none !important;
  }
  /* استثنا: دکمه‌هایی که عکس دارن باید کلیک‌پذیر بمونن */
  button img, a img, .story-item img, .lb-avatar img, #story-modal-img {
    pointer-events: auto !important;
  }
  #story-modal-img {
    -webkit-touch-callout: none !important;
  }
@media (max-width: 768px) {
  * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  * { scroll-behavior: auto !important; }
  .page { will-change: auto !important; }
}
