/* ============================================================
   ARIO — 05 CONTEST
   Contest · Levels · Solve · Admin Cards
   + White background for start/solve pages
   + Single-line pill stats · right-aligned hero text
   + Lesson selector · scrollbar right
   + Leaderboard section removed
   + ✅ CTA: single signature style (before & after login)
   + ✅ Stat pills: uniform width · numbers same color as labels
   + ✅ Level cards: pill / elliptical shape (border-radius: 60px)
   + ✅ Why-section stickers: no animation · smaller
   ============================================================ */

/* ============================================================
   FORCE WHITE — contest page
   ============================================================ */

.contest-hero,
.contest-why {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
}

body.contest-page,
body.contest-page main {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  background-attachment: scroll !important;
}

body.contest-page::before,
body.contest-page::after {
  display: none !important;
  content: none !important;
}

body.contest-page .site-footer {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-top-color: rgba(15, 23, 42, .06) !important;
}

body:has(.contest-hero) {
  background: #ffffff !important;
  background-image: none !important;
  background-attachment: scroll !important;
}
body:has(.contest-hero) main {
  background: #ffffff !important;
  background-image: none !important;
}
body:has(.contest-hero)::before {
  display: none !important;
  content: none !important;
}
body:has(.contest-hero)::after {
  display: none !important;
  content: none !important;
}
body:has(.contest-hero) .site-footer {
  background: #ffffff !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ✅ White background for Contest Start / Solve / Lesson selector */
body:has(.contest-start-page),
body:has(.solve-page),
body:has(.lesson-select-page) {
  background: #ffffff !important;
  background-image: none !important;
  background-attachment: initial !important;
}
body:has(.contest-start-page)::before,
body:has(.contest-start-page)::after,
body:has(.solve-page)::before,
body:has(.solve-page)::after,
body:has(.lesson-select-page)::before,
body:has(.lesson-select-page)::after {
  display: none !important;
  content: none !important;
}

/* ============================================================
   Contest Hero
   ============================================================ */
.contest-hero {
  position: relative;
  padding: 1rem 0.75rem 3rem;
  background: #ffffff !important;
  background-image: none !important;
}

.contest-hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1320px;
  margin-inline: auto;
}

.contest-hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 2rem;
}

.contest-hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  gap: .35rem;
  min-width: 0;
  padding-top: 7.8rem;
}

.contest-hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  margin-top: 0;
}

.contest-hero-img {
  display: block;
  width: 100%;
  max-width: 800px;
  margin-inline: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 24px 48px rgba(15, 23, 42, .12));
  transition: transform .55s cubic-bezier(.4, 0, .2, 1);
}

.contest-hero-visual:hover .contest-hero-img {
  transform: translateY(-6px) scale(1.02);
}

/* ============================================================
   Slogan
   ============================================================ */
.contest-slogan {
  position: relative;
  display: inline-block;
  font-family: var(--font-fa);
  font-size: clamp(.95rem, 1.35vw, 1.1rem);
  font-weight: 800;
  line-height: 1.9;
  color: var(--blue-700);
  margin: 0 0 1.2rem;
  padding-inline-start: .95rem;
  border-inline-start: 3px solid var(--yellow-500);
  text-align: right;
}

/* ============================================================
   Sub text
   ============================================================ */
.contest-sub {
  font-family: var(--font-fa);
  font-size: .95rem;
  line-height: 2.05;
  color: var(--text-soft);
  font-weight: 500;
  margin: 0;
  max-width: 62ch;
  text-align: right;
}

/* ============================================================
   CTA wrapper — right-aligned with controllable right offset
   ============================================================ */
.contest-hero-actions {
  display: flex;
  justify-content: flex-start;
  padding-inline-start: 7rem;
  align-items: center;
  width: 100%;
  margin: 1.6rem 0 0;
  position: relative;
  z-index: 4;
}

.contest-hero-actions form {
  margin: 0;
  display: inline-block;
}

/* ============================================================
   ✅ SIGNATURE CTA — same theme for ALL states
   ============================================================ */
.contest-cta-btn-signature {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  font-family: var(--font-fa);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
  margin: 0;
  padding: 1rem 1.5rem;
  border-radius: 100px;
  border: 1.5px dashed rgba(59, 130, 246, .3);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
  background-color: #ffffff;
  background-image:
    linear-gradient(120deg,
      #1d4ed8 0%,
      #2563eb 18%,
      #0891b2 38%,
      #06b6d4 50%,
      #0891b2 62%,
      #2563eb 82%,
      #1d4ed8 100%),
    linear-gradient(135deg, rgba(59, 130, 246, .08), rgba(245, 158, 11, .06));
  background-size: 240% auto, auto;
  background-position: 0% center, 0 0;
  -webkit-background-clip: text, padding-box;
          background-clip: text, padding-box;
  color: transparent;
  -webkit-text-fill-color: transparent;
  box-shadow: none;
  animation: contestSignShine 8s linear infinite;
  transition: transform .22s cubic-bezier(.4, 0, .2, 1),
              border-color .22s ease;
}

.contest-cta-btn-signature:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, .6);
}

.contest-cta-btn-signature:active {
  transform: translateY(0) scale(.99);
}

.contest-cta-btn-signature > span {
  display: inline-block;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.contest-cta-btn-signature > .contest-cta-btn-signature-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #f59e0b;
  -webkit-text-fill-color: #f59e0b;
  filter:
    drop-shadow(0 0 4px rgba(245, 158, 11, .55))
    drop-shadow(0 0 10px rgba(245, 158, 11, .3));
  position: relative;
  z-index: 2;
}

.contest-cta-btn-signature > .contest-cta-btn-signature-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  stroke: currentColor;
  fill: none;
}

.contest-cta-btn-signature:hover > .contest-cta-btn-signature-icon {
  animation: ctaStickerPulse 1.2s ease-in-out infinite;
}

@keyframes ctaStickerPulse {
  0%, 100% { transform: scale(1);    opacity: 1;   }
  50%      { transform: scale(1.08); opacity: .92; }
}

@keyframes contestSignShine {
  0%   { background-position:   0% center, 0 0; }
  100% { background-position: 240% center, 0 0; }
}

/* ============================================================
   BOTTOM — stat pills
   ✅ همگی هم‌عرض · اعداد هم‌رنگ متن لیبل
   ============================================================ */
.contest-hero-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.contest-hero-stats-inline {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0;
}

.contest-hero-stat {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-width: 150px;
  padding: 1rem 1.5rem !important;
  border-radius: 100px !important;
  background: #ffffff;
  border: 1px solid rgba(59, 130, 246, .18);
  text-align: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, .06);
  transition: transform .25s, border-color .25s, box-shadow .25s;
  line-height: 1.2;
  white-space: nowrap;
}

.contest-hero-stat:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, .45);
  box-shadow: 0 8px 18px rgba(59, 130, 246, .15);
}

.contest-hero-stat-num {
  font-family: var(--font-fa);
  font-size: 1rem !important;
  font-weight: 900;
  line-height: 1.2;
  margin: 0 !important;
  color: var(--text-soft);
  -webkit-text-fill-color: var(--text-soft);
  background: none;
}

.contest-hero-stat-lbl {
  font-family: var(--font-fa);
  font-size: 1rem !important;
  font-weight: 700;
  color: var(--text-soft);
  line-height: 1.2;
  margin: 0;
}

.contest-hero-stat-personal {
  background: linear-gradient(135deg, rgba(16, 185, 129, .1), rgba(6, 182, 212, .06)) !important;
  border-color: rgba(16, 185, 129, .35) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, .12);
}

.contest-hero-stat-personal:hover {
  border-color: rgba(16, 185, 129, .65) !important;
  box-shadow: 0 8px 18px rgba(16, 185, 129, .22);
}

.contest-hero-stat-personal .contest-hero-stat-num {
  color: var(--text-soft);
  -webkit-text-fill-color: var(--text-soft);
  background: none;
}

/* Legacy (backward compat) */
.contest-my-stats { display: flex; justify-content: center; gap: 1rem; margin: 0 0 2rem; flex-wrap: wrap; }
.contest-my-stat {
  min-width: 140px;
  padding: 1rem 1.4rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, .08), rgba(124, 58, 237, .06));
  border: 1.5px solid rgba(59, 130, 246, .3);
  text-align: center;
  backdrop-filter: blur(10px);
}
.contest-my-stat-num {
  font-family: var(--font-fa);
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.2;
}
.contest-my-stat-lbl { font-size: .78rem; font-weight: 700; color: var(--text-soft); margin-top: .25rem; }

.contest-hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; max-width: 420px; margin-inline: auto; }
.contest-mini-stat {
  padding: 1.1rem .8rem;
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(59, 130, 246, .18);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}
.contest-mini-num {
  font-family: var(--font-fa);
  font-size: 1.4rem;
  font-weight: 900;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed 50%, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.2;
  margin-bottom: .25rem;
}
.contest-mini-lbl { font-size: .74rem; font-weight: 700; color: var(--text-soft); }

/* ============================================================
   Contest Why Section
   ============================================================ */
.contest-why {
  padding: 3.5rem 2rem 3rem;
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
}
.contest-why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.3rem;
  max-width: 1180px;
  margin-inline: auto;
}
.contest-why-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.8rem 1.4rem 1.6rem;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1.5px solid rgba(15, 23, 42, .08);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
  isolation: isolate;
}

.contest-why-card:hover {
  transform: scale(1.03);
}

.contest-why-card h3 {
  font-family: var(--font-fa);
  font-size: 1rem;
  font-weight: 900;
  color: var(--ink-900);
  margin: 0 0 .5rem;
  letter-spacing: -.01em;
}
.contest-why-card p {
  font-size: .84rem;
  color: #64748b;
  line-height: 1.9;
  margin: 0;
}

.contest-why-card .acad-why-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.contest-why-card .acad-why-sticker {
  display: block !important;
  width: 40px !important;
  height: 40px !important;
  margin-bottom: .8rem !important;
  animation: none !important;
  transform: none !important;
  transition: none !important;
  transform-origin: center !important;
}

.contest-why-card:hover .acad-why-sticker {
  animation: none !important;
  transform: none !important;
}

@media (max-width: 1024px) { .contest-why-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .contest-why { padding: 2.5rem 1rem 2rem; }
  .contest-why-grid { grid-template-columns: 1fr; gap: 1rem; }
  .contest-why-card { padding: 1.6rem 1.3rem 1.4rem; }

  .contest-why-card .acad-why-sticker {
    width: 32px !important;
    height: 32px !important;
    margin-bottom: .6rem !important;
  }
}

/* ============================================================
   Contest Levels
   ============================================================ */
.contest-levels { padding: 5rem 0 3rem; }
.level-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.3rem; }
.level-grid-3 { grid-template-columns: repeat(3, 1fr); }
.level-card {
  position: relative;
  padding: 1.7rem 1.3rem 1.5rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: transform .35s cubic-bezier(.4,0,.2,1), box-shadow .35s, border-color .35s;
  overflow: hidden;
}
.level-card:hover { transform: translateY(-8px); box-shadow: 0 24px 60px rgba(15,23,42,.15); }
.level-easy   { border-color: rgba(16,185,129,.35); }
.level-easy:hover   { border-color: #10b981; box-shadow: 0 24px 60px rgba(16,185,129,.25); }
.level-medium { border-color: rgba(245,158,11,.35); }
.level-medium:hover { border-color: #f59e0b; box-shadow: 0 24px 60px rgba(245,158,11,.25); }
.level-hard   { border-color: rgba(239,68,68,.35); }
.level-hard:hover   { border-color: #ef4444; box-shadow: 0 24px 60px rgba(239,68,68,.25); }
.level-insane {
  border-color: rgba(139,92,246,.5);
  background: linear-gradient(160deg, #1a0d2e 0%, #0d0518 100%);
  color: #fff;
}
.level-insane:hover { border-color: #a855f7; box-shadow: 0 24px 60px rgba(168,85,247,.4); }
.level-badge {
  position: absolute;
  top: .9rem; right: .9rem;
  padding: .25rem .7rem;
  border-radius: 100px;
  font-family: var(--font-fa);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 0;
  background: rgba(59, 130, 246,.12);
  color: var(--blue-700);
}
.level-badge-dark { background: rgba(255,215,0,.15); color: #FFD700; }
.level-icon { font-size: 2.4rem; margin: .6rem 0 .8rem; }
.level-card h3 { font-family: var(--font-fa); font-size: 1.15rem; font-weight: 900; color: var(--ink-900); margin-bottom: .5rem; }
.level-insane h3 { color: #fff; }
.level-desc { font-size: .84rem; color: #64748b; line-height: 1.85; margin-bottom: 1rem; }
.level-insane .level-desc { color: #cbd5e1; }
.level-meta {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-soft);
  padding-top: .9rem;
  border-top: 1px dashed var(--border);
}
.level-insane .level-meta { border-top-color: rgba(255,255,255,.12); color: #cbd5e1; }

.level-grid-clickable { gap: 1.5rem; }
.level-card-link { display: flex; flex-direction: column; cursor: pointer; text-decoration: none; color: inherit; }
.level-card-link:hover { transform: translateY(-8px); }
.level-start-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  padding: .55rem 1rem;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
  transition: transform .25s;
}
.level-card-link:hover .level-start-cta { transform: scale(1.05); box-shadow: 0 10px 24px rgba(59,130,246,.4); }
.level-easy   .level-start-cta { background: linear-gradient(135deg, #10b981, #059669); }
.level-medium .level-start-cta { background: linear-gradient(135deg, #f59e0b, #d97706); }
.level-insane .level-start-cta { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.contest-start-page { padding: 3rem 0 4rem; scroll-margin-top: 100px; }
.contest-start-back { text-align: center; margin-top: 2rem; }

/* ============================================================
   ✅ CHOOSE YOUR LEVEL — cards now PILL / ELLIPSE shaped
   (border-radius: 60px + extra padding + repositioned badge)
   ============================================================ */
.level-grid-clickable {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
  max-width: 1180px;
  margin-inline: auto;
}
@media (max-width: 900px) {
  .level-grid-clickable { grid-template-columns: 1fr; }
}

.level-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  padding: 2.4rem 2.2rem 2.2rem;   /* ✅ padding بیشتر — سازگار با انحنا */
  border-radius: 60px;              /* ✅ بیضی/پیل‌مانند */
  background: #ffffff !important;
  border: 1.5px solid rgba(15, 23, 42, .08) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05) !important;
  transition: transform .35s cubic-bezier(.4, 0, .2, 1),
              box-shadow .35s,
              border-color .35s;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  isolation: isolate;
}
.level-card:hover {
  transform: translateY(-6px);
  border-color: rgba(59, 130, 246, .35) !important;
  box-shadow: 0 22px 55px rgba(96, 165, 250, .15) !important;
}

.level-insane {
  background: #ffffff !important;
  color: inherit !important;
  border-radius: 60px;
}

.level-card .level-badge {
  position: absolute;
  top: 1.4rem;                      /* ✅ badge کمی داخل‌تر — از انحنا فاصله بگیرد */
  right: 1.8rem;
  padding: .28rem .75rem;
  border-radius: 100px;
  font-family: var(--font-fa);
  font-size: .7rem;
  font-weight: 800;
  background: rgba(59, 130, 246, .08);
  color: var(--blue-700);
  border: 1px solid rgba(59, 130, 246, .2);
  letter-spacing: 0;
}
.level-card .level-badge-dark {
  background: rgba(139, 92, 246, .1);
  color: #6d28d9;
  border-color: rgba(139, 92, 246, .25);
}

.level-grid-clickable .level-card h3 {
  font-family: var(--font-fa);
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--ink-900) !important;
  margin: 2.8rem 0 .5rem;            /* ✅ فاصله از انحنای بالا */
  letter-spacing: -.01em;
  line-height: 1.5;
}

.level-card .level-desc {
  font-family: var(--font-fa);
  font-size: .87rem;
  line-height: 1.9;
  color: #475569 !important;
  font-weight: 500;
  margin: 0 0 1.2rem;
  flex-grow: 1;
  text-align: right;
}

.level-card .level-meta {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding-top: .9rem;
  width: 100%;
  border-top: 1px dashed rgba(59, 130, 246, .18) !important;
  margin-bottom: 1rem;
  color: var(--text-soft) !important;
}
.level-card .level-meta span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--font-fa);
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-soft);
}

.level-card .level-start-cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: auto;
  padding: .8rem 1rem;
  border-radius: 100px;             /* ✅ دکمه‌ی CTA هم پیل‌مانند */
  font-family: var(--font-fa);
  font-size: .85rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 6px 18px rgba(59, 130, 246, .3);
  transition: transform .25s, box-shadow .25s;
  overflow: hidden;
  isolation: isolate;
}
.level-card .level-start-cta::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 55%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg);
  animation: levelCtaShine 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes levelCtaShine {
  0%        { left: -100%; }
  55%, 100% { left: 160%;  }
}
.level-card .level-start-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(59, 130, 246, .45);
}
.level-easy   .level-start-cta { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 6px 18px rgba(16, 185, 129, .3); }
.level-easy   .level-start-cta:hover { box-shadow: 0 10px 24px rgba(16, 185, 129, .45); }
.level-medium .level-start-cta { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 6px 18px rgba(245, 158, 11, .3); }
.level-medium .level-start-cta:hover { box-shadow: 0 10px 24px rgba(245, 158, 11, .45); }
.level-insane .level-start-cta { background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 6px 18px rgba(139, 92, 246, .3); }
.level-insane .level-start-cta:hover { box-shadow: 0 10px 24px rgba(139, 92, 246, .45); }

/* FORCE CENTER — two level cards */
.contest-start-page .level-grid.level-grid-2.level-grid-clickable {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 1.6rem !important;
  width: 100% !important;
  max-width: 900px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-inline: auto !important;
  padding: 0 !important;
  place-items: stretch !important;
  box-sizing: border-box !important;
}

@media (max-width: 900px) {
  .contest-start-page .level-grid.level-grid-2.level-grid-clickable {
    grid-template-columns: 1fr !important;
    max-width: 500px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media (max-width: 640px) {
  .contest-start-page .level-grid.level-grid-2.level-grid-clickable {
    grid-template-columns: 1fr !important;
    max-width: 100% !important;
  }

  /* ✅ روی موبایل: بیضی کمی ملایم‌تر تا متن راحت‌تر جا بشه */
  .level-card {
    border-radius: 45px;
    padding: 2.2rem 1.6rem 1.9rem;
  }
  .level-card .level-badge {
    top: 1.2rem;
    right: 1.4rem;
  }
  .level-grid-clickable .level-card h3 {
    margin-top: 2.4rem;
  }
}

/* ============================================================
   Contest Rules
   ============================================================ */
.contest-rules { padding: 4rem 0 3rem; }
.rules-list { max-width: 780px; margin-inline: auto; display: flex; flex-direction: column; gap: 1rem; }
.rule-item {
  display: flex;
  gap: 1.2rem;
  padding: 1.3rem 1.4rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.rule-item:hover { transform: translateX(-4px); border-color: rgba(59, 130, 246,.35); box-shadow: 0 12px 32px rgba(59, 130, 246,.1); }
.rule-num {
  flex-shrink: 0;
  font-family: var(--font-en);
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  padding-top: .2rem;
}
.rule-body h4 { font-family: var(--font-fa); font-size: 1rem; font-weight: 800; color: var(--ink-900); margin-bottom: .35rem; }
.rule-body p { font-size: .87rem; color: #64748b; line-height: 1.9; }

/* ============================================================
   Contest Prizes
   ============================================================ */
.contest-prizes { padding: 4rem 0 3rem; }
.prize-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; max-width: 900px; margin-inline: auto; }
.prize-card { position: relative; padding: 2rem 1.4rem; border-radius: var(--radius-lg); text-align: center; overflow: hidden; transition: transform .35s, box-shadow .35s; }
.prize-card:hover { transform: translateY(-8px); }
.prize-gold   { background: linear-gradient(160deg, #2a1d05 0%, #1a1002 100%); border: 1.5px solid rgba(255,215,0,.5); box-shadow: 0 20px 50px rgba(255,215,0,.25); }
.prize-gold:hover { box-shadow: 0 24px 60px rgba(255,215,0,.45); }
.prize-silver { background: linear-gradient(160deg, #1a1f2e 0%, #0a0f1a 100%); border: 1.5px solid rgba(203,213,225,.4); box-shadow: 0 20px 50px rgba(203,213,225,.2); }
.prize-silver:hover { box-shadow: 0 24px 60px rgba(203,213,225,.35); }
.prize-bronze { background: linear-gradient(160deg, #241405 0%, #150a02 100%); border: 1.5px solid rgba(217,119,6,.5); box-shadow: 0 20px 50px rgba(217,119,6,.25); }
.prize-bronze:hover { box-shadow: 0 24px 60px rgba(217,119,6,.45); }
.prize-medal { font-size: 3rem; margin-bottom: .6rem; line-height: 1; animation: trophyBounce 3s ease-in-out infinite; }
@keyframes trophyBounce {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-12px) rotate(3deg); }
}
.prize-rank {
  font-family: var(--font-en);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: .7rem;
}
.prize-amount {
  font-family: var(--font-fa);
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff, #FFD700);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: .35rem;
}
.prize-silver .prize-amount { background: linear-gradient(135deg, #ffffff, #cbd5e1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.prize-bronze .prize-amount { background: linear-gradient(135deg, #ffffff, #fbbf24); -webkit-background-clip: text; background-clip: text; color: transparent; }
.prize-unit { font-size: .8rem; color: #94a3b8; font-weight: 600; }

.contest-cta { padding: 4rem 0 6rem; }
.contest-cta-card {
  position: relative;
  padding: 4rem 2rem;
  border-radius: var(--radius-xl);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 20% 20%, rgba(124,58,237,.4), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(236,72,153,.35), transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(6,182,212,.25), transparent 60%),
    linear-gradient(160deg, #06040f 0%, #0a0618 100%);
  box-shadow: 0 40px 100px rgba(0,0,0,.5), 0 0 0 1.5px rgba(34,211,238,.25);
}
.contest-cta-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34,211,238,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,211,238,.06) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  pointer-events: none;
}
.contest-cta-card h2 {
  position: relative;
  z-index: 2;
  font-family: var(--font-fa);
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 900;
  margin-bottom: .9rem;
  background: linear-gradient(135deg, #ffffff, #67e8f9 40%, #fbbf24 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleShine 5s linear infinite;
  letter-spacing: -.02em;
}
.contest-cta-card p {
  position: relative;
  z-index: 2;
  color: #cbd5e1;
  font-size: 1rem;
  line-height: 1.95;
  margin-bottom: 2rem;
  max-width: 520px;
  margin-inline: auto;
}

/* ============================================================
   Solve Page
   ============================================================ */
.solve-page { padding: 2rem 0 4rem; max-width: 1300px; margin-inline: auto; }
.solve-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.solve-title h2 {
  font-family: var(--font-fa);
  font-size: 1.25rem;
  font-weight: 900;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.solve-sub { font-size: .82rem; color: var(--text-soft); font-weight: 600; }
.solve-counter {
  font-size: .9rem;
  font-weight: 800;
  color: var(--blue-700);
  padding: .45rem .9rem;
  background: rgba(59,130,246,.1);
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 100px;
}
.solve-progress-bar { height: 6px; background: var(--ink-100); border-radius: 100px; overflow: hidden; margin-bottom: 1rem; }
.solve-progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, #3b82f6, #7c3aed, #ec4899);
  background-size: 200% auto;
  animation: titleShine 4s linear infinite;
  transition: width .4s ease;
}
.solve-nav { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1.4rem; justify-content: center; }
.solve-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-soft);
  font-family: var(--font-fa);
  font-weight: 800;
  font-size: .82rem;
  cursor: pointer;
  transition: all .25s;
  display: grid; place-items: center;
}
.solve-dot:hover { border-color: var(--blue-400); color: var(--blue-600); }
.solve-dot.active { background: linear-gradient(135deg, #3b82f6, #7c3aed); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(59,130,246,.4); }
.solve-dot.status-pending  { background: #fef3c7; color: #92400e; border-color: #fbbf24; }
.solve-dot.status-approved { background: #d1fae5; color: #065f46; border-color: #34d399; }
.solve-dot.status-rejected { background: #fee2e2; color: #991b1b; border-color: #f87171; }
.solve-pane { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; animation: fadeIn .3s ease; }
.solve-pane.hidden { display: none; }
.solve-question { padding: 1.4rem; background: var(--surface); border: 1.5px solid var(--border); border-radius: 18px; position: relative; }
.solve-q-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; padding-bottom: .7rem; border-bottom: 1px dashed var(--border); }
.solve-q-badge {
  font-size: .78rem;
  font-weight: 900;
  padding: .3rem .8rem;
  border-radius: 100px;
  background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(124,58,237,.1));
  color: var(--blue-700);
  border: 1px solid rgba(59,130,246,.25);
}
.solve-q-xp {
  font-size: .82rem;
  font-weight: 900;
  color: #b45309;
  padding: .3rem .8rem;
  border-radius: 100px;
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.3);
}
.solve-q-text { font-size: 1rem; line-height: 2; color: var(--ink-800); font-weight: 600; white-space: pre-wrap; }
.solve-q-status { margin-top: 1rem; padding: .75rem 1rem; border-radius: 12px; font-size: .86rem; font-weight: 700; }
.status-pending  { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24; }
.status-approved { background: #d1fae5; color: #065f46; border: 1px solid #34d399; }
.status-rejected { background: #fee2e2; color: #991b1b; border: 1px solid #f87171; }

.solve-editor {
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #16122e 0%, #0a0718 100%);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(15,23,42,.3);
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
}
.solve-editor::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  padding: 2px;
  background: linear-gradient(135deg, #3b82f6, #7c3aed, #ec4899, #f59e0b, #3b82f6);
  background-size: 300% 300%;
  animation: gradientShift 6s ease infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 0;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.editor-header, .code-input, .editor-footer { position: relative; z-index: 1; }
.editor-header {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem 1rem;
  background: linear-gradient(180deg, rgba(38,26,68,.95), rgba(20,14,42,.95));
  border-bottom: 1px solid rgba(120,115,245,.2);
}
.editor-dots { display: flex; gap: .4rem; }
.editor-dots .dot { width: 11px; height: 11px; border-radius: 50%; }
.editor-title {
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 700;
  background: linear-gradient(90deg, #7dd3fc, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-inline-start: .4rem;
}
.editor-lang { margin-inline-start: auto; font-family: var(--font-mono); font-size: .7rem; color: #a5b4fc; opacity: .8; }

.code-input,
.solve-page .solve-editor .code-input,
.solve-page .solve-editor .code-input:focus,
.solve-page .solve-editor .code-input:focus-visible,
.solve-page .solve-editor .code-input:active,
.solve-page .solve-editor textarea.code-input,
.solve-page .solve-editor textarea.code-input:focus,
.solve-page .solve-editor textarea.code-input:focus-visible,
.solve-page .solve-editor textarea.code-input:active {
  flex: 1;
  min-height: 320px;
  padding: 1.1rem 1.2rem;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  color: #e8e3ff !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-family: var(--font-mono);
  font-size: .92rem;
  line-height: 1.9;
  resize: vertical;
  direction: ltr;
  text-align: left;
  tab-size: 4;
  caret-color: #c4b5fd;
}
.code-input::placeholder { color: rgba(148,163,184,.45); }
.code-input:read-only { opacity: .7; }
.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .8rem 1rem;
  background: rgba(20,14,42,.9);
  border-top: 1px solid rgba(120,115,245,.2);
  flex-wrap: wrap;
}
.editor-hint { font-size: .72rem; color: rgba(148,163,184,.7); font-family: var(--font-fa); }
.submit-answer { background: linear-gradient(135deg, #10b981, #059669) !important; box-shadow: 0 10px 22px rgba(16,185,129,.35) !important; }
.submit-answer:hover { box-shadow: 0 14px 30px rgba(16,185,129,.5) !important; transform: translateY(-2px); }
.submit-answer:disabled { opacity: .65; cursor: not-allowed; transform: none !important; }
.solve-nav-buttons { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: .8rem; margin-top: .8rem; }
@media (max-width: 860px) {
  .solve-pane { grid-template-columns: 1fr; }
  .code-input { min-height: 240px; }
  .solve-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Admin contest cards
   ============================================================ */
.contest-sub-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem 1.3rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.contest-sub-card.contest-sub-approved { border-color: rgba(16,185,129,.4); background: linear-gradient(180deg, #fff 70%, #f0fdf4 100%); }
.contest-sub-card.contest-sub-rejected { border-color: rgba(239,68,68,.3); background: linear-gradient(180deg, #fff 70%, #fef2f2 100%); opacity: .9; }
.contest-sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .9rem;
  padding-bottom: .7rem;
  border-bottom: 1px dashed var(--border);
}
.contest-sub-head > div:first-child { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.contest-sub-meta { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.contest-level-chip { font-size: .72rem; font-weight: 800; padding: .22rem .65rem; border-radius: 100px; border: 1px solid; }
.contest-level-chip.level-beginner     { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.35); color: #047857; }
.contest-level-chip.level-intermediate { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.35); color: #b45309; }
.contest-level-chip.level-mixed        { background: rgba(139,92,246,.1); border-color: rgba(139,92,246,.35); color: #6d28d9; }
.contest-xp-chip {
  font-size: .74rem;
  font-weight: 900;
  padding: .22rem .65rem;
  border-radius: 100px;
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.35);
  color: #b45309;
}
.contest-sub-question { font-size: .92rem; line-height: 1.9; color: var(--ink-800); font-weight: 600; margin-bottom: .9rem; white-space: pre-wrap; }
.contest-sub-code { border-radius: 12px; overflow: hidden; background: #0a0718; border: 1px solid rgba(120,115,245,.25); margin-bottom: .9rem; }
.contest-code-head {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .9rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: #a5b4fc;
  background: linear-gradient(180deg, #1a1230, #130b28);
  border-bottom: 1px solid rgba(120,115,245,.2);
}
.code-dot { width: 9px; height: 9px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399; }
.contest-code-body {
  margin: 0;
  padding: 1rem 1.1rem;
  font-family: var(--font-mono);
  font-size: .85rem;
  line-height: 1.85;
  color: #e8e3ff;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
  white-space: pre;
}
.contest-code-body code { background: transparent; color: inherit; padding: 0; border: none; font-size: inherit; }
.contest-sub-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.contest-sub-details { cursor: pointer; }
.contest-sub-details summary {
  font-size: .82rem;
  font-weight: 800;
  color: var(--blue-700);
  padding: .35rem .6rem;
  border-radius: 8px;
  display: inline-block;
  user-select: none;
}
.contest-sub-details summary:hover { background: rgba(59,130,246,.08); }
.contest-sub-details[open] summary { margin-bottom: .6rem; }

/* ============================================================
   LESSON SELECTOR
   ============================================================ */
.lesson-select-page {
  position: relative;
  padding: 2.5rem 0 4rem;
  padding-left: 1rem;
  max-width: 100%;
}

.lesson-select-layout {
  display: grid;
  grid-template-columns: 650px 1fr 400px 1fr;
  align-items: start;
  direction: ltr;
  gap: 0;
  width: 100%;
}

.lesson-select-visual {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 100px;
  min-width: 0;
}

.lesson-select-img {
  display: block;
  width: 100%;
  max-width: 650px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(15, 23, 42, 0.1));
  animation: lessonImgFloat 6s ease-in-out infinite;
}

@keyframes lessonImgFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.lesson-select-main {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
}

.lesson-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  max-height: 405px;
  overflow-y: auto;
  padding-left: .8rem;
  padding-right: .5rem;
  direction: ltr;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, .35) transparent;
}

.lesson-list > .lesson-item {
  direction: rtl;
}

.lesson-list::-webkit-scrollbar { width: 6px; }
.lesson-list::-webkit-scrollbar-track { background: transparent; }
.lesson-list::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, .28);
  border-radius: 100px;
}
.lesson-list::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, .55);
}

.lesson-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.15rem;
  border-radius: 16px;
  background: #ffffff;
  border: 1.5px solid rgba(59, 130, 246, .12);
  box-shadow: 0 4px 14px rgba(59, 130, 246, .05);
  text-decoration: none;
  color: inherit;
  transition:
    transform .28s cubic-bezier(.4, 0, .2, 1),
    border-color .28s,
    box-shadow .28s;
  isolation: isolate;
  overflow: hidden;
  flex-shrink: 0;
}

.lesson-item::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 100px;
  background: linear-gradient(180deg, #3b82f6, #7c3aed);
  opacity: 0;
  transition: opacity .3s;
}

.lesson-item:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, .4);
  box-shadow: 0 8px 20px rgba(59, 130, 246, .12);
}
.lesson-item:hover::before { opacity: 1; }

.lesson-item-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #1976D2;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1.5px solid rgba(59, 130, 246, .2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1);
  transition: transform .35s cubic-bezier(.34, 1.3, .5, 1);
}
.lesson-item-icon svg { width: 20px; height: 20px; display: block; }
.lesson-item:hover .lesson-item-icon { transform: scale(1.08) rotate(-6deg); }

.lesson-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.lesson-item-title {
  font-family: var(--font-fa);
  font-size: .96rem;
  font-weight: 900;
  color: var(--ink-900);
  line-height: 1.4;
  letter-spacing: -.01em;
}
.lesson-item-meta {
  font-family: var(--font-fa);
  font-size: .74rem;
  font-weight: 700;
  color: var(--text-soft);
  line-height: 1.4;
}

.lesson-item-arrow {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(59, 130, 246, .08);
  color: #1976D2;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity .25s, transform .3s cubic-bezier(.34, 1.3, .5, 1), background .25s;
}
.lesson-item-arrow svg { width: 13px; height: 13px; display: block; }
.lesson-item:hover .lesson-item-arrow {
  opacity: 1;
  transform: translateX(0);
  background: rgba(59, 130, 246, .16);
}

.lesson-select-page .solve-header-back {
  text-align: center;
  margin-top: 2.4rem;
  margin-bottom: 1rem;
}
.lesson-select-page .solve-header-back .btn {
  padding: .6rem 1.4rem;
  border-radius: 100px;
  font-weight: 800;
}

@media (max-width: 1200px) {
  .lesson-select-layout {
    grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
    direction: rtl;
    gap: 2rem;
    padding-inline-end: 1rem;
  }
  .lesson-select-main { grid-column: 1; grid-row: 1; }
  .lesson-select-visual { grid-column: 2; grid-row: 1; position: static; }
  .lesson-select-img { max-width: 100%; }
}

@media (max-width: 900px) {
  .lesson-select-page { padding: 2.5rem 0.5rem 3rem; }
  .lesson-select-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-inline-end: 0;
  }
  .lesson-select-main { grid-column: 1; grid-row: 2; }
  .lesson-select-visual { grid-column: 1; grid-row: 1; }
  .lesson-select-img { max-width: 480px; margin-inline: auto; }
  .lesson-list {
    max-height: none;
    overflow-y: visible;
    padding-left: 0;
    padding-right: 0;
    direction: rtl;
  }
  .lesson-list > .lesson-item { direction: rtl; }
}

@media (max-width: 640px) {
  .lesson-select-page { padding: 2rem .4rem 3rem; }
  .lesson-select-img { max-width: 300px; }
  .lesson-item { padding: .8rem .9rem; gap: .75rem; }
  .lesson-item-icon { width: 38px; height: 38px; border-radius: 10px; }
  .lesson-item-icon svg { width: 17px; height: 17px; }
  .lesson-item-title { font-size: .88rem; }
  .lesson-item-meta { font-size: .68rem; }

  .lesson-select-page .solve-header-back .btn {
    padding: .55rem 1.2rem;
    font-size: .78rem;
  }
}

body:has(.lesson-select-page) {
  background: #ffffff !important;
  background-image: none !important;
  background-attachment: initial !important;
}
body:has(.lesson-select-page)::before,
body:has(.lesson-select-page)::after {
  display: none !important;
  content: none !important;
}

/* ---------- Solve title separator ---------- */
.solve-title-sep {
  color: var(--text-soft);
  margin-inline: .2rem;
  font-weight: 500;
}

/* ---------- level-grid-2 (legacy) ---------- */
.level-grid-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 900px;
  margin-inline: auto;
}
@media (max-width: 640px) {
  .level-grid-2 { grid-template-columns: 1fr; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .contest-hero-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
  }
  .contest-hero-img { max-width: 640px; }

  .level-grid { grid-template-columns: repeat(2, 1fr); }
  .contest-why-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .contest-hero-inner { gap: 1.5rem; }
  .contest-hero-top {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }
  .contest-hero-text {
    order: 1;
    padding-top: 1rem;
    align-items: center;
    text-align: center;
  }
  .contest-slogan {
    display: block;
    text-align: center;
    padding-inline-start: 0;
    border-inline-start: none;
    border-top: 2px solid var(--yellow-500);
    border-bottom: 2px solid var(--yellow-500);
    padding-block: .55rem;
    max-width: 460px;
    margin-inline: auto;
    margin-bottom: 1rem;
  }
  .contest-sub { text-align: center; margin-inline: auto; }
  .contest-hero-actions {
    justify-content: center;
    padding-inline-start: 0;
  }
  .contest-hero-visual { order: 2; margin-top: 0; }
  .contest-hero-img { max-width: 600px; }
}

@media (max-width: 860px) {
  .prize-grid { grid-template-columns: 1fr; max-width: 420px; }
}

@media (max-width: 640px) {
  .contest-hero { padding: 1rem 0.5rem 2rem; }

  .contest-slogan { font-size: .88rem; }
  .contest-sub { font-size: .88rem; line-height: 1.95; }
  .contest-hero-img { max-width: 380px; }

  .contest-cta-btn-signature {
    padding: .8rem 1.25rem;
    font-size: .92rem;
    gap: .45rem;
  }
  .contest-cta-btn-signature > .contest-cta-btn-signature-icon {
    width: 18px;
    height: 18px;
  }

  .contest-hero-stats-inline { gap: .4rem; }
  .contest-hero-stat { min-width: 130px; padding: .8rem 1.25rem !important; }
  .contest-hero-stat-num { font-size: .92rem !important; }
  .contest-hero-stat-lbl { font-size: .92rem !important; }

  .rule-item { flex-direction: column; gap: .6rem; padding: 1.1rem; }
  .rule-num { font-size: 1.25rem; }
  .prize-amount { font-size: 1.5rem; }
  .contest-cta-card { padding: 2.8rem 1.4rem; }
  .level-grid { grid-template-columns: 1fr; }
  .contest-why-grid { grid-template-columns: 1fr; gap: 1rem; }
}

/* ============================================================
   prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .contest-cta-btn-signature,
  .contest-cta-btn-signature:hover > .contest-cta-btn-signature-icon {
    animation: none !important;
  }
  .contest-why-card .acad-why-sticker { animation: none !important; }
}