/* ═══════════════════════════════════════════════════════
   HOME / HOME — التنسيقات الأصلية (محسنة)
   ═══════════════════════════════════════════════════════ */

/* ── HERO ── */
.hero {
  margin-bottom: 18px;
}
.h1 {
  font-size: 1.55rem;
  font-weight: 900;
}
.hl {
  color: var(--v);
}
.h2 {
  font-size: .72rem;
  color: var(--sub);
  margin-top: 2px;
}

/* ── STAT4 ── */
.stat4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.sc {
  background: var(--sur);
  border: 1px solid var(--brd);
  border-radius: var(--r);
  padding: 11px;
  text-align: center;
  box-shadow: var(--sh);
  transition: transform var(--t), box-shadow var(--t);
  cursor: default;
}
.sc:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh2);
}
.sv {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
}
.sl {
  font-size: .4rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ── LEVEL CARD ── */
.lvl-card {
  background: linear-gradient(135deg, var(--v-bg) 0%, var(--n-bg) 100%);
  border: 1.5px solid var(--v-brd);
  border-radius: var(--r);
  padding: 14px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--sh);
}
.lvl-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, var(--v-bg) 0%, transparent 70%);
  opacity: .5;
}
.lvl-bar {
  height: 8px;
  background: var(--brd);
  border-radius: 20px;
  overflow: hidden;
  margin: 6px 0 4px;
}
.lvl-fill {
  height: 100%;
  border-radius: 20px;
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

/* ── PROGRESS BAR ── */
.pc {
  background: var(--sur);
  border: 1px solid var(--brd);
  border-radius: var(--r);
  padding: 13px;
  margin-bottom: 12px;
  box-shadow: var(--sh);
}
.pt {
  height: 6px;
  background: var(--brd);
  border-radius: 20px;
  overflow: hidden;
}
.pf {
  height: 100%;
  border-radius: 20px;
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}
.grfill {
  background: linear-gradient(90deg, var(--v), var(--n));
}

/* ── CHART ── */
.chart-wrap {
  background: var(--sur);
  border: 1px solid var(--brd);
  border-radius: var(--r);
  padding: 13px;
  margin-bottom: 12px;
  box-shadow: var(--sh);
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
  margin-top: 8px;
}
.chart-bar-w {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
.chart-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  transition: height .5s cubic-bezier(.4, 0, .2, 1), background .3s;
}
.chart-bar.today {
  background: linear-gradient(180deg, var(--v), var(--n));
}
.chart-bar.past {
  background: var(--v-bg);
  border: 1px solid var(--v-brd);
}
.chart-bar:hover {
  filter: brightness(.9);
}
.chart-lbl {
  font-size: .34rem;
  color: var(--muted);
}
.chart-cnt {
  font-size: .32rem;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
}

/* ── DAILY CHALLENGE ── */
.dcc {
  background: linear-gradient(135deg, var(--v-bg), var(--n-bg));
  border: 1.5px solid var(--v-brd);
  border-radius: var(--r);
  padding: 13px 14px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.dcc::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(9, 105, 218, .08), transparent 70%);
  pointer-events: none;
}
.dcc-title {
  font-size: .62rem;
  font-weight: 700;
  color: var(--v);
  margin-bottom: 6px;
}
.dcc-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.dcc-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .65rem;
}
.dcc-cb {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid var(--brd2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .5rem;
  transition: all var(--t);
}
.dcc-cb.done {
  background: var(--n);
  border-color: var(--n);
  color: #fff;
}
.dcc-label {
  flex: 1;
  color: var(--sub);
}
.dcc-label.done {
  text-decoration: line-through;
  color: var(--muted);
}
.dcc-xp {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .52rem;
  color: var(--gold);
  font-weight: 700;
}
.dcc-bar-wrap {
  margin-top: 8px;
}
.dcc-bar {
  height: 4px;
  background: var(--brd);
  border-radius: 20px;
  overflow: hidden;
}
.dcc-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--v), var(--n));
  border-radius: 20px;
  transition: width .4s;
}

/* ── SEARCH ── */
.sb {
  position: relative;
  margin-bottom: 10px;
}
.sb input {
  width: 100%;
  background: var(--sur);
  border: 1.5px solid var(--brd);
  border-radius: var(--rsm);
  padding: 9px 13px 9px 34px;
  font-family: 'Tajawal', sans-serif;
  font-size: .86rem;
  color: var(--txt);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.sb input:focus {
  border-color: var(--v);
  box-shadow: 0 0 0 3px var(--v-bg);
}
.sb input::placeholder {
  color: var(--muted);
}
.si {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .85rem;
  pointer-events: none;
}

/* ── FILTERS ── */
.fr {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.fb {
  background: var(--sur);
  border: 1.5px solid var(--brd);
  border-radius: 20px;
  padding: 3px 11px;
  font-family: 'Tajawal', sans-serif;
  font-size: .63rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--t);
}
.fb:hover {
  background: var(--sur2);
  border-color: var(--brd2);
  color: var(--txt);
}
.fb.on {
  background: var(--v);
  color: #fff;
  border-color: var(--v);
}

/* ── SECTION HEADER ── */
.sh {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 14px 0 7px;
}
.sbdge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .56rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
}
.st {
  font-size: .82rem;
  font-weight: 900;
}

/* ── WORD CARD ── */
.wc {
  background: var(--sur);
  border: 1px solid var(--brd);
  border-radius: var(--r);
  padding: 10px 11px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  box-shadow: var(--sh);
  align-items: center;
}
.wc::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3px;
  background: var(--wc, var(--v));
  opacity: .4;
  transition: opacity var(--t);
}
.wc:hover {
  transform: translateY(-3px) !important;
  box-shadow: var(--sh2);
  border-color: var(--brd2);
}
.wc:hover::after {
  opacity: 1;
}
.wc:active {
  transform: scale(.97) !important;
}
.wc.dn {
  border-color: var(--n-brd);
}
.wc.dn::after {
  background: var(--n);
  opacity: 1;
}
.wc.hd::after {
  background: var(--gold);
  opacity: 1;
}
.wi {
  width: 34px;
  height: 34px;
  border-radius: var(--rsm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  background: var(--sur2);
  border: 1px solid var(--brd);
}
.wb {
  flex: 1;
  min-width: 0;
}
.wen {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .8rem;
  font-weight: 700;
  color: var(--txt);
  direction: ltr;
}
.war {
  font-size: .66rem;
  color: var(--sub);
  margin-top: 1px;
}
.wtg {
  display: flex;
  gap: 3px;
  margin-top: 3px;
  flex-wrap: wrap;
}
.wtg span {
  font-size: .37rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 9px;
  background: var(--sur2);
  color: var(--muted);
}
.wr2 {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}
.wlv {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .48rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}
.wpc {
  font-size: .48rem;
  color: var(--muted);
}
.cpb {
  height: 2px;
  background: var(--brd);
  border-radius: 20px;
  margin-top: 4px;
  overflow: hidden;
}
.cpbf {
  height: 100%;
  border-radius: 20px;
}

/* ── FILTER CONTAINER ── */
.filter-container {
  background: var(--sur);
  border: 1px solid var(--brd);
  border-radius: var(--r);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--sh);
}
.filter-container .filter-title {
  font-size: .55rem;
  font-weight: 700;
  color: var(--sub);
  margin-bottom: 8px;
}
.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.filter-group label {
  font-size: .4rem;
  font-weight: 700;
  color: var(--muted);
}
.filter-group select {
  width: 100%;
  padding: 6px 8px;
  background: var(--sur2);
  border: 1.5px solid var(--brd);
  border-radius: var(--rsm);
  font-size: .55rem;
  color: var(--txt);
  outline: none;
  font-family: 'Tajawal', sans-serif;
}
.filter-group select:focus {
  border-color: var(--v);
  box-shadow: 0 0 0 2px var(--v-bg);
}
.filter-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.filter-btn-action {
  flex: 1;
  padding: 5px;
  background: var(--sur2);
  border: 1px solid var(--brd);
  border-radius: var(--rsm);
  cursor: pointer;
  font-size: .45rem;
  color: var(--sub);
  font-weight: 700;
  transition: all var(--t);
}
.filter-btn-action:hover {
  background: var(--brd);
  color: var(--txt);
}
.filter-btn-action.reset {
  background: var(--gold-bg);
  border-color: var(--d-brd);
  color: var(--gold);
}
.filter-btn-action.reset:hover {
  background: var(--gold);
  color: #fff;
}
.filter-btn-action.clear {
  background: var(--p-bg);
  border-color: var(--p-brd);
  color: var(--p);
}
.filter-btn-action.clear:hover {
  background: var(--p);
  color: #fff;
}

/* ── EMPTY SEARCH STATE ── */
.empty-search {
  text-align: center;
  padding: 30px 20px;
  background: var(--sur);
  border: 1px solid var(--brd);
  border-radius: var(--r);
  margin-bottom: 12px;
}
.empty-search .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.empty-search .empty-title {
  font-size: .7rem;
  color: var(--muted);
}
.empty-search .empty-sub {
  font-size: .45rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .stat4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .filter-row {
    grid-template-columns: 1fr 1fr;
  }
  .filter-row .filter-group:last-child {
    grid-column: span 2;
  }
  .wc {
    flex-wrap: wrap;
  }
  .wr2 {
    flex-direction: row;
    width: 100%;
    justify-content: flex-end;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .filter-row {
    grid-template-columns: 1fr;
  }
  .filter-row .filter-group:last-child {
    grid-column: span 1;
  }
  .h1 {
    font-size: 1.2rem;
  }
  .stat4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }
  .sc {
    padding: 8px 6px;
  }
  .sv {
    font-size: 1rem;
  }
}