/* ==========================================================================
   جلوه‌های اختیاریِ سایت — روشن/خاموش از پنلِ ادمین (SiteSetting)
   عمداً جدا از season.css نگه داشته شده تا هیچ‌وقت کدِ فصلیِ کارکننده
   دست‌نخورده باقی بماند.
   ========================================================================== */

/* ---------- ۱) رنگی‌کردنِ روزشمار (رنگین‌کمانیِ پاییزی) ---------- */

.countdown.effect-rainbow .cd-num {
    background: linear-gradient(90deg, #ff5e5e, #ffb347, #ffe14d, #7ee081, #59c9ff, #a68bff, #ff6fd8);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: rainbow-shift 4s linear infinite;
}
@keyframes rainbow-shift {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}
@media (prefers-reduced-motion: reduce) {
    .countdown.effect-rainbow .cd-num { animation: none; }
}

/* ---------- ۲) نورپردازیِ «چیزی نزدیک می‌شود» — فقط صفحه‌ی اصلی ---------- */
.approach-glow {
    position: fixed;
    top: -20vh; left: 50%;
    width: 140vw; height: 60vh;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at center,
        color-mix(in srgb, var(--season-accent, var(--accent)) 35%, transparent) 0%,
        transparent 65%);
    opacity: 0.32;
    animation: approach-pulse 6s ease-in-out infinite;
}
@keyframes approach-pulse {
    0%, 100% { opacity: 0.20; transform: translateX(-50%) scale(0.94); }
    50%      { opacity: 0.40; transform: translateX(-50%) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) { .approach-glow { display: none; } }











/* ---------- ۳) تمِ بارانی — پس‌زمینه‌ی ابری + باران + پاشِشِ برخورد ---------- */
.storm-clouds {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: -3;
    overflow: hidden;
    opacity: 0.85;          /* ← شفافیت اضافه شد؛ محتوای زیرش دیده می‌شود */
}
.storm-clouds .cloud-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    animation: cloud-drift-x linear infinite;
}
/* سه تُنِ متفاوت برایِ حسِ عمق و تمایزِ ابرها از هم */
.storm-clouds .cloud-blob.c-dark {
    background: radial-gradient(circle, rgba(30,32,38,0.95), rgba(30,32,38,0) 70%);
}
.storm-clouds .cloud-blob.c-mid {
    background: radial-gradient(circle, rgba(95,100,112,0.9), rgba(95,100,112,0) 70%);
}
.storm-clouds .cloud-blob.c-light {
    background: radial-gradient(circle, rgba(180,185,195,0.75), rgba(180,185,195,0) 70%);
}
@keyframes cloud-drift-x {
    0%   { transform: translate(-15vw, 0) scale(1); }
    50%  { transform: translate(15vw, -3vh) scale(1.12); }
    100% { transform: translate(-15vw, 0) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .storm-clouds .cloud-blob { animation: none; } }

html[data-rain="true"] body::before { display: none; }   /* لایه‌ی قدیمیِ رطوبت را غیرفعال کن — جایش را storm-clouds گرفته */

.p-rain {
    width: 2px !important;
    border-radius: 2px;
    background: linear-gradient(180deg, rgba(200,220,255,0.05), rgba(200,220,255,0.85));
    animation-name: rain-fall;
    animation-timing-function: linear;
}
@keyframes rain-fall {
    0%   { transform: translate3d(0, -10vh, 0); opacity: 0; }
    6%   { opacity: var(--op, 0.6); }
    92%  { opacity: var(--op, 0.6); }
    100% { transform: translate3d(-2vw, 108vh, 0); opacity: 0; }
}

.rain-splash {
    position: absolute;
    bottom: 0;
    width: 14px; height: 5px;
    border-radius: 50%;
    border: 1px solid rgba(210, 230, 255, 0.55);
    transform: translateX(-50%) scale(0.3);
    opacity: 0;
    animation: splash-pop 0.45s ease-out forwards;
}
@keyframes splash-pop {
    0%   { transform: translateX(-50%) scale(0.2); opacity: 0.75; }
    70%  { transform: translateX(-50%) scale(1.3); opacity: 0.35; }
    100% { transform: translateX(-50%) scale(1.8); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .p-rain, .cloud-blob, .rain-splash { display: none; }
}

/* ---------- ۴) رعدِ واقعی — خطِ زیگزاگیِ SVG + فلاشِ صفحه ---------- */
.lightning-layer {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: -1;
}
.lightning-bolt {
    position: absolute;
    top: 0;
    opacity: 0;
    filter: drop-shadow(0 0 6px rgba(220,235,255,0.9)) drop-shadow(0 0 16px rgba(180,210,255,0.6));
}
.lightning-bolt.strike {
    animation: bolt-flicker 0.6s steps(1, end);
}
@keyframes bolt-flicker {
    0%   { opacity: 0; }
    6%   { opacity: 1; }
    14%  { opacity: 0.15; }
    22%  { opacity: 0.9; }
    32%  { opacity: 0.1; }
    42%  { opacity: 0.7; }
    60%  { opacity: 0; }
    100% { opacity: 0; }
}
.lightning-flash {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: -1;
    background: #dbe7ff;
    opacity: 0;
}
.lightning-flash.flash-on {
    animation: screen-flicker 0.6s steps(1, end);
}
@keyframes screen-flicker {
    0%   { opacity: 0; }
    6%   { opacity: 0.28; }
    14%  { opacity: 0.04; }
    22%  { opacity: 0.16; }
    32%  { opacity: 0.02; }
    42%  { opacity: 0.10; }
    60%  { opacity: 0; }
    100% { opacity: 0; }
}

/* فلاشِ کوچیکِ محوِ داخلِ ابرها — جدا از رعدِ اصلی، بدونِ خطِ نمایان */
.cloud-glow {
    position: fixed;
    z-index: -1;
    width: 26vw; height: 16vh;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.9), rgba(230,240,255,0.3) 55%, transparent 75%);
    filter: blur(10px);
    opacity: 0;
}
.cloud-glow.glow-on {
    animation: cloud-flicker 0.9s ease-out;
}
@keyframes cloud-flicker {
    0%, 100% { opacity: 0; }
    15% { opacity: 0.55; }
    30% { opacity: 0.1; }
    45% { opacity: 0.35; }
    100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .lightning-bolt, .lightning-flash, .cloud-glow { display: none; }
}














/* ---------- آیکونِ جامِ مسابقه — نورِ طلاییِ چشمک‌زن ---------- */
.nav-trophy {
    position: relative;
    color: #f5c518 !important;
    box-shadow: 0 0 0 rgba(245,197,24,0);
    animation: trophy-box-glow 2.4s ease-in-out infinite;
}
.nav-trophy::after {
    content: '';
    position: absolute;
    top: -3px; left: -3px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #f5c518;
    box-shadow: 0 0 10px 3px #f5c518;
    animation: trophy-dot-pulse 1.6s ease-in-out infinite;
}
@keyframes trophy-box-glow {
    0%, 100% { box-shadow: 0 0 6px 0 rgba(245,197,24,0.25); }
    50%      { box-shadow: 0 0 14px 3px rgba(245,197,24,0.55); }
}
@keyframes trophy-dot-pulse {
    0%, 100% { opacity: 0.5; transform: scale(0.85); }
    50%      { opacity: 1;   transform: scale(1.25); }
}

/* ---------- بنرِ معرفیِ مسابقه رویِ صفحه‌ی اصلی — جلبِ توجه ---------- */
.contest-teaser {
    position: relative;
    text-align: center;
    padding: 12px 20px;
    margin: 0 auto 18px;
    max-width: 990px;
    border-radius: 12px;
    font-weight: 700;
    color: #ffe9a8;
    background: linear-gradient(90deg, rgba(245,197,24,0.08), rgba(245,197,24,0.18), rgba(245,197,24,0.08));
    background-size: 200% auto;
    border: 1px solid rgba(245,197,24,0.4);
    box-shadow: 0 0 0 rgba(245,197,24,0);
    animation: teaser-shine 3.5s linear infinite, teaser-glow 2.2s ease-in-out infinite;
    overflow: hidden;
}
.contest-teaser a {
    color: #fff;
    text-decoration: underline;
    font-weight: 800;
    margin-right: 6px;
}
@keyframes teaser-shine {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}
@keyframes teaser-glow {
    0%, 100% { box-shadow: 0 0 8px 0 rgba(245,197,24,0.15); border-color: rgba(245,197,24,0.35); }
    50%      { box-shadow: 0 0 20px 4px rgba(245,197,24,0.4); border-color: rgba(245,197,24,0.7); }
}





/* ==========================================================================
   تمِ روشن — اصلاحِ کنتراستِ بخش‌هایِ مسابقه
   ========================================================================== */
html[data-theme="light"] .contest-teaser {
    color: #6b4700;
    background: linear-gradient(90deg, rgba(245,197,24,0.20), rgba(245,197,24,0.38), rgba(245,197,24,0.20));
    border-color: rgba(190,130,0,0.6);
}
html[data-theme="light"] .contest-teaser a { color: #4a3000; }
html[data-theme="light"] .nav-trophy { color: #c98a00 !important; }

html[data-theme="light"] .invite-widget {
    background: linear-gradient(135deg, rgba(59,130,246,0.10), rgba(139,92,246,0.10));
    border-color: rgba(124,58,237,0.4);
}
html[data-theme="light"] .invite-widget-form input {
    background: #fff;
    color: #1e293b;
    border-color: rgba(0,0,0,0.2);
}

html[data-theme="light"] .contest-block {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.12);
}
html[data-theme="light"] .contest-table thead { background: rgba(0,0,0,0.07); }
html[data-theme="light"] .contest-table tbody tr:nth-child(odd) { background: rgba(0,0,0,0.03); }
html[data-theme="light"] .cc-box {
    background: rgba(124,58,237,0.08);
    border-color: rgba(124,58,237,0.35);
}
html[data-theme="light"] .contest-ended-banner {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.45);
    color: #b91c1c;
}
html[data-theme="light"] .contest-ended-banner a { color: #b91c1c; }








/* نورِ طلاییِ چشمک‌زن پشتِ جدولِ نفراتِ برتر */
.leaderboard-wrap {
    margin-bottom: 25px;
    position: relative;
    isolation: isolate;   /* نور همیشه پشتِ محتوایِ همین بخش می‌ماند، نه پشتِ کلِ صفحه */
}
.leaderboard-wrap::before {
    content: '';
    position: absolute;
    top: -20px; left: 50%;
    width: 92%; height: 170px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse at center,
        rgba(245,197,24,0.55) 0%, rgba(245,197,24,0.18) 45%, transparent 72%);
    filter: blur(22px);
    z-index: -1;
    pointer-events: none;
    animation: leaderboard-glow 3.2s ease-in-out infinite;
}
@keyframes leaderboard-glow {
    0%, 100% { opacity: 0.25; transform: translateX(-50%) scale(0.95); }
    50%      { opacity: 0.60; transform: translateX(-50%) scale(1.06); }
}
html[data-theme="light"] .leaderboard-wrap::before {
    background: radial-gradient(ellipse at center,
        rgba(230,160,0,0.5) 0%, rgba(230,160,0,0.16) 45%, transparent 72%);
}
@media (prefers-reduced-motion: reduce) {
    .leaderboard-wrap::before { animation: none; opacity: 0.5; }
}