/* ============================================================
   Weekly Hardware Design Challenge — demo styles
   Built on the Rising Edge design tokens (tokens.css / themes.css).
   ============================================================ */

.demo-ribbon {
  background: repeating-linear-gradient(
    45deg,
    rgba(245, 158, 11, 0.14),
    rgba(245, 158, 11, 0.14) 12px,
    rgba(245, 158, 11, 0.06) 12px,
    rgba(245, 158, 11, 0.06) 24px
  );
  border-bottom: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--warning, #f59e0b);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
  padding: 7px 14px;
}
.demo-ribbon span {
  color: var(--text-sub);
  font-weight: 500;
}

.wc-hero {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-alt) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl, 16px);
  padding: 2.25rem 2rem;
}
.wc-text-gradient {
  background: linear-gradient(90deg, var(--cyan, #22d3ee), #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* countdown */
.wc-countdown {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.wc-count-box {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 66px;
  text-align: center;
}
.wc-count-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--cyan, #22d3ee);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.wc-count-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 5px;
}

/* stat tiles */
.wc-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.wc-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 1rem 1.2rem;
}
.wc-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-base);
  line-height: 1;
}
.wc-stat-val.accent {
  color: var(--cyan, #22d3ee);
}
.wc-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-top: 8px;
}

/* generic panel */
.wc-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem 1.4rem;
}
.wc-panel-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-base);
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* leaderboard */
.wc-lb {
  width: 100%;
  border-collapse: collapse;
}
.wc-lb th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.wc-lb td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-sub);
}
.wc-lb tr:last-child td {
  border-bottom: none;
}
.wc-lb tr.you {
  background: rgba(34, 211, 238, 0.08);
}
.wc-lb tr.you td {
  color: var(--text-base);
  font-weight: 600;
}
.wc-rank {
  font-weight: 800;
  color: var(--text-base);
  font-variant-numeric: tabular-nums;
  width: 44px;
}
.wc-rank.r1 {
  color: #fbbf24;
}
.wc-rank.r2 {
  color: #cbd5e1;
}
.wc-rank.r3 {
  color: #f59e0b;
}
.wc-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wc-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22d3ee, #818cf8);
  color: #06222a;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wc-score {
  font-weight: 700;
  color: var(--text-base);
  font-variant-numeric: tabular-nums;
}

/* podium */
.wc-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 1.4rem;
}
.wc-podium-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 1rem;
  text-align: center;
}
.wc-podium-card.p1 {
  border-color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}
.wc-podium-medal {
  font-size: 1.5rem;
}
.wc-podium-av {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 6px auto 8px;
  background: linear-gradient(135deg, #22d3ee, #818cf8);
  color: #06222a;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wc-podium-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-base);
}
.wc-podium-role {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin: 2px 0 8px;
}
.wc-podium-score {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cyan, #22d3ee);
}

/* tabs */
.wc-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.wc-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}
/* colored status dot — gives every tab a distinct identity even at rest */
.wc-tab::before {
  content: '';
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.18s ease;
}
.wc-tab:hover {
  color: var(--text-base);
  border-color: var(--cyan, #22d3ee);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -8px rgba(34, 211, 238, 0.4);
}
.wc-tab.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--cyan, #22d3ee), var(--primary-500, #3b82f6));
  box-shadow: 0 8px 20px -6px rgba(34, 211, 238, 0.5);
  transform: translateY(-1px);
}
.wc-tab.active::before {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
  animation: pulse 1.8s ease infinite;
}

/* Per-track accent colors (Weekly Challenge track selector) — keeps the
   three tracks visually distinct at a glance, not just via active state. */
.wc-tab[data-cat='BASIC_HW']::before {
  background: #10b981;
}
.wc-tab[data-cat='BASIC_HW']:hover {
  border-color: #10b981;
  box-shadow: 0 6px 16px -8px rgba(16, 185, 129, 0.4);
}
.wc-tab[data-cat='BASIC_HW'].active {
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 8px 20px -6px rgba(16, 185, 129, 0.5);
}
.wc-tab[data-cat='ADVANCED_HW']::before {
  background: #a855f7;
}
.wc-tab[data-cat='ADVANCED_HW']:hover {
  border-color: #a855f7;
  box-shadow: 0 6px 16px -8px rgba(168, 85, 247, 0.4);
}
.wc-tab[data-cat='ADVANCED_HW'].active {
  background: linear-gradient(135deg, #c084fc, #a855f7);
  box-shadow: 0 8px 20px -6px rgba(168, 85, 247, 0.5);
}
.wc-tab[data-cat='PCB_DESIGN']::before {
  background: #06b6d4;
}
.wc-tab[data-cat='PCB_DESIGN']:hover {
  border-color: #06b6d4;
  box-shadow: 0 6px 16px -8px rgba(6, 182, 212, 0.4);
}
.wc-tab[data-cat='PCB_DESIGN'].active {
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
  box-shadow: 0 8px 20px -6px rgba(6, 182, 212, 0.5);
}

/* difficulty pills */
.wc-diff {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wc-diff.beg {
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
}
.wc-diff.int {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
}
.wc-diff.adv {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
}
.wc-diff.mix {
  background: rgba(129, 140, 248, 0.16);
  color: #a5b4fc;
}

/* tier chip */
.wc-tier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
}
.wc-tier.bronze {
  background: rgba(180, 83, 9, 0.16);
  color: #d97706;
}
.wc-tier.silver {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}
.wc-tier.gold {
  background: rgba(251, 191, 36, 0.16);
  color: #fbbf24;
}
.wc-tier.platinum {
  background: rgba(34, 211, 238, 0.16);
  color: #22d3ee;
}

/* badges / trophy case */
.wc-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.wc-badge {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 1rem 0.85rem;
  text-align: center;
}
.wc-badge.locked {
  opacity: 0.4;
  filter: grayscale(0.7);
}
.wc-badge-ico {
  font-size: 1.9rem;
  line-height: 1;
}
.wc-badge-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-base);
  margin-top: 8px;
}
.wc-badge-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

/* attempt runner */
.wc-runner-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.wc-timer {
  font-size: 1.3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--cyan, #22d3ee);
}
.wc-timer.warn {
  color: var(--warning, #f59e0b);
}
.wc-timer.crit {
  color: var(--danger, #ef4444);
}
.wc-qnav {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.wc-qdot {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-sub);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wc-qdot.answered {
  border-color: var(--cyan, #22d3ee);
  color: var(--cyan, #22d3ee);
  background: rgba(34, 211, 238, 0.08);
}
.wc-qdot.current {
  background: var(--cyan, #22d3ee);
  color: #06222a;
  border-color: var(--cyan, #22d3ee);
}
.wc-question {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 1.5rem 1.6rem;
}
.wc-q-prompt {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-base);
  line-height: 1.6;
  margin-bottom: 1.1rem;
}
.wc-opt {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 9px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-sub);
  transition:
    border-color 0.15s,
    background 0.15s;
}
.wc-opt:hover {
  border-color: var(--cyan, #22d3ee);
}
.wc-opt.selected {
  border-color: var(--cyan, #22d3ee);
  background: rgba(34, 211, 238, 0.08);
  color: var(--text-base);
}
.wc-opt-key {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.wc-opt.selected .wc-opt-key {
  background: var(--cyan, #22d3ee);
  color: #06222a;
  border-color: var(--cyan, #22d3ee);
}
.wc-opt.multi .wc-opt-key {
  border-radius: 50%;
}
.wc-num-input {
  width: 200px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-base);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
}

/* results */
.wc-scorewheel {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.wc-scorewheel .big {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-base);
  line-height: 1;
}
.wc-scorewheel .sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.wc-review {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--bg-alt);
}
.wc-review.correct {
  border-left: 3px solid var(--success, #10b981);
}
.wc-review.wrong {
  border-left: 3px solid var(--danger, #ef4444);
}
.wc-review-q {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-base);
  margin-bottom: 6px;
}
.wc-review-exp {
  font-size: 0.78rem;
  color: var(--text-sub);
  line-height: 1.6;
  margin-top: 6px;
  border-top: 1px dashed var(--border);
  padding-top: 6px;
}

/* topic bars */
.wc-topic-row {
  margin-bottom: 12px;
}
.wc-topic-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-bottom: 5px;
}
.wc-topic-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
}
.wc-topic-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee, #818cf8);
}
.wc-topic-fill.weak {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

/* upsell */
.wc-upsell {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(129, 140, 248, 0.08));
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem 1.4rem;
}

/* how it works steps */
.wc-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.wc-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 1.2rem;
}
.wc-step-num {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--cyan, #22d3ee);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.wc-step h4 {
  font-size: 0.9rem;
  color: var(--text-base);
  margin-bottom: 6px;
}
.wc-step p {
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.6;
  margin: 0;
}
