/* =====================================================================
   HackByte Challenges (워게임)
   Enterprise refresh — flat sections, thin dividers, brand-blue accents.
   Aligned with dashboard.css: no nested colored boxes, modest radii,
   calm interactions. Layout references a wargame board.
   ===================================================================== */

/* Full-width page shell (no learning sidebar — challenges is a top-level tab) */
.ch-page {
  min-height: calc(100vh - 64px);
  background: #f5f6f8;
}

.ch-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 32px 72px;
}

/* ---- Page header --------------------------------------------------- */
.ch-head {
  margin-bottom: 22px;
}

.ch-head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.ch-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.ch-create-btn:hover {
  background: #1d4ed8;
}

@media (max-width: 720px) {
  .ch-head--row {
    flex-direction: column;
    align-items: stretch;
  }

  .ch-create-btn {
    justify-content: center;
  }
}

.ch-head-text h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 6px;
}

.ch-head-text p {
  font-size: 14px;
  color: var(--muted);
}

/* ---- 실시간 해결 알림 티커 (헤더 바로 아래) -------------------- */
.ch-ticker {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 44px;
  margin-bottom: 22px;
  background: #fff;
  border: 1px solid var(--border);
  overflow: hidden;
}

/* 간단한 빨간 확성기 아이콘 (파란 LIVE 칩 대체) */
.ch-ticker-tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  color: #ef4444;
  border-right: 1px solid var(--border);
}

.ch-ticker-tag svg {
  width: 19px;
  height: 19px;
}

.ch-ticker-viewport {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.ch-ticker-track {
  list-style: none;
  margin: 0;
  padding: 0;
  /* 멈췄다 → 스르륵 → 멈췄다 (단계 스크롤, 8개 항목 기준 -50%) */
  animation: chTickerStep 28s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.ch-ticker:hover .ch-ticker-track {
  animation-play-state: paused;
}

@keyframes chTickerStep {
  0%,    8%    { transform: translateY(0); }
  12.5%, 20.5% { transform: translateY(-6.25%); }
  25%,   33%   { transform: translateY(-12.5%); }
  37.5%, 45.5% { transform: translateY(-18.75%); }
  50%,   58%   { transform: translateY(-25%); }
  62.5%, 70.5% { transform: translateY(-31.25%); }
  75%,   83%   { transform: translateY(-37.5%); }
  87.5%, 95.5% { transform: translateY(-43.75%); }
  100%         { transform: translateY(-50%); }
}

.ch-ticker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: 44px;
  padding: 0 16px;
}

.ch-ticker-msg {
  min-width: 0;
  font-size: 13px;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-ticker-msg b {
  color: var(--text);
  font-weight: 700;
}

.ch-ticker-pt {
  color: var(--primary);
  font-weight: 700;
}

.ch-ticker-item.is-fb .ch-ticker-pt { color: #dc2626; }

.ch-ticker-fb {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: #ef4444;
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 7px;
  vertical-align: middle;
}

.ch-ticker-time {
  flex-shrink: 0;
  font-size: 12px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

/* ---- 지금 도전 중 (aside 패널) -------------------------------- */
.ch-now-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ch-now-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: chLivePulse 1.8s ease-out infinite;
}

.ch-now-count { font-size: 12px; color: var(--muted); }
.ch-now-count strong { color: #16a34a; font-weight: 700; }

.ch-now-list {
  display: flex;
  flex-direction: column;
}

.ch-now-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 6px;
}

.ch-now-row:hover { background: #f8fafc; }

.ch-now-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.ch-avatar--web       { background: #2563eb; }
.ch-avatar--pwn       { background: #e11d48; }
.ch-avatar--reversing { background: #d97706; }
.ch-avatar--crypto    { background: #7c3aed; }
.ch-avatar--forensics { background: #db2777; }
.ch-avatar--misc      { background: #0d9488; }

.ch-now-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ch-now-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-now-target {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-now-pulse {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: chNowBlink 1.6s ease-in-out infinite;
}

@keyframes chNowBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
  .ch-ticker-track,
  .ch-now-led,
  .ch-now-pulse { animation: none; }
}

/* ---- First Blood (아직 아무도 풀지 못한 문제) — 어둡고 강렬한 피처 밴드 --- */
.ch-fb {
  margin-bottom: 26px;
  padding: 22px 24px 24px;
  border-radius: 8px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(239, 68, 68, 0.18), transparent 55%),
    linear-gradient(120deg, #0b1120 0%, #131b2e 55%, #1b2438 100%);
  border: 1px solid #1e2940;
}

.ch-fb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.ch-fb-title {
  display: flex;
  align-items: center;
  gap: 13px;
}

.ch-fb-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ch-fb-icon svg {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 3px 8px rgba(239, 68, 68, 0.45));
}

.ch-fb-title h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1.25;
}

.ch-fb-title p {
  margin-top: 4px;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.45;
}

.ch-fb-count {
  flex-shrink: 0;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fecaca;
  padding: 5px 11px;
  border-radius: 4px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
}

.ch-fb-count strong {
  color: #fff;
  font-weight: 800;
}

.ch-fb-list {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ch-fb-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.16);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.ch-fb-card:hover {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.06);
  transform: translateY(-2px);
}

.ch-fb-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ch-fb-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fca5a5;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.ch-fb-card h3 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: #f1f5f9;
}

.ch-fb-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.ch-fb-tier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.ch-fb-tier i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ch-fb-points {
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
}

.ch-fb-cta {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  color: #fca5a5;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.ch-fb-card:hover .ch-fb-cta {
  opacity: 1;
  transform: translateX(0);
}

/* ---- Content layout ------------------------------------------------ */
.ch-layout {
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

.ch-main {
  flex: 1;
  min-width: 0;
}

.ch-aside {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 84px;
}

/* ---- Toolbar (분야 탭 + 검색/필터) --------------------------------- */
.ch-toolbar {
  margin-bottom: 18px;
}

/* Category tabs — primary filter, underline style */
.ch-cats {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ch-cats::-webkit-scrollbar { display: none; }

.ch-cat {
  position: relative;
  appearance: none;
  border: none;
  background: none;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s ease;
}

.ch-cat::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.18s ease;
}

.ch-cat:hover { color: var(--text); }

.ch-cat.is-active { color: var(--primary); }

.ch-cat.is-active::after { transform: scaleX(1); }

/* Search + dropdown filters on one clean row */
.ch-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ch-search {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ch-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ch-search svg {
  width: 17px;
  height: 17px;
  color: #94a3b8;
  flex-shrink: 0;
}

.ch-search input {
  border: none;
  outline: none;
  background: none;
  width: 100%;
  font-size: 14px;
  color: var(--text);
}

.ch-selects {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.ch-field {
  position: relative;
  display: flex;
  flex-direction: column;
}

.ch-field label {
  position: absolute;
  top: 6px;
  left: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #94a3b8;
  pointer-events: none;
}

.ch-field select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 19px 34px 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E")
    no-repeat right 12px center;
  cursor: pointer;
  min-width: 124px;
  transition: border-color 0.16s ease;
}

.ch-field select:focus {
  outline: none;
  border-color: var(--primary);
}

/* 난이도 — 중복 선택(토글 칩) */
.ch-difficulty {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.ch-difficulty-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  flex-shrink: 0;
}

.ch-diff-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ch-diff-chip {
  display: inline-flex;
  align-items: center;
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.ch-diff-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.ch-diff-chip.is-active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(37, 99, 235, 0.06);
}

/* ---- Result bar ---------------------------------------------------- */
.ch-resultbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ch-result-count {
  font-size: 13px;
  color: var(--muted);
}

.ch-result-count strong {
  color: var(--text);
  font-weight: 700;
}

.ch-result-reset {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.ch-result-reset:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* ---- Grid ---------------------------------------------------------- */
.ch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.ch-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.ch-card[data-status="solved"] {
  border-color: var(--primary);
}
.ch-card:hover {
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.08);
  transform: translateY(-2px);
}

/* 풀이 완료 문제 — 파란 테두리 */
.ch-card[data-status="solved"] {
  border-color: var(--primary);
}

.ch-card[hidden] { display: none; }

.ch-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ch-card-flags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ch-flag-new {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #b45309;
  background: #fef3c7;
  padding: 2px 6px;
  border-radius: 4px;
}

.ch-flag-fb {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #dc2626;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
}

.ch-flag-solved {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.14);
  color: #16a34a;
}

.ch-flag-solved svg { width: 12px; height: 12px; }

/* 내 문제 / 상태 배지 (출제자 본인에게만 표시) */
.ch-flag-mine {
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
  color: #0550ae; background: #ddf4ff; border: 1px solid #54aeff;
  padding: 1px 6px; border-radius: 4px;
}
.ch-flag-status {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  color: #57606a; background: #eef1f4; border: 1px solid #d0d7de;
}
.ch-flag-status--draft { color: #57606a; }
.ch-flag-status--pending { color: #9a6700; background: #fff8c5; border-color: #eac54f; }
.ch-flag-status--rejected { color: #cf222e; background: #ffebe9; border-color: #ffc1bc; }

.ch-card-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.ch-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid #f1f3f6;
}

.ch-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.ch-meta-points {
  font-weight: 700;
  color: var(--primary);
}

.ch-meta-solves {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ch-meta-solves svg { width: 13px; height: 13px; }

/* ---- Category tags ------------------------------------------------- */
.ch-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
}

.ch-tag--web       { color: #1d4ed8; background: rgba(37, 99, 235, 0.1); }
.ch-tag--pwn       { color: #be123c; background: rgba(244, 63, 94, 0.1); }
.ch-tag--reversing { color: #b45309; background: rgba(245, 158, 11, 0.12); }
.ch-tag--crypto    { color: #6d28d9; background: rgba(139, 92, 246, 0.12); }
.ch-tag--forensics { color: #be185d; background: rgba(236, 72, 153, 0.1); }
.ch-tag--misc      { color: #0f766e; background: rgba(20, 184, 166, 0.12); }

/* ---- Tier label (dot + text) -------------------------------------- */
.ch-tier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.ch-tier i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ch-tier--intro i  { background: #94a3b8; }
.ch-tier--easy i   { background: #22c55e; }
.ch-tier--normal i { background: #2563eb; }
.ch-tier--hard i   { background: #f59e0b; }
.ch-tier--insane i { background: #ef4444; }

/* ---- Empty state --------------------------------------------------- */
.ch-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 20px;
  text-align: center;
}

/* hidden 속성이 확실히 우선하도록 (검색·필터 결과 없을 때만 노출) */
.ch-empty[hidden] {
  display: none;
}

.ch-empty-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f1f5f9;
  color: #94a3b8;
}

.ch-empty-icon svg { width: 22px; height: 22px; }

.ch-empty p {
  font-size: 14px;
  color: var(--muted);
}

.ch-empty-reset {
  appearance: none;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.18s ease;
}

.ch-empty-reset:hover { background: #1d4ed8; }

/* ---- Pagination ---------------------------------------------------- */
.ch-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 26px;
}

.ch-pagination:empty { display: none; }

.ch-page-btn {
  appearance: none;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.ch-page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.ch-page-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.ch-page-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.ch-page-ellipsis {
  padding: 0 4px;
  color: #94a3b8;
  font-size: 13px;
}

/* ---- Aside panels -------------------------------------------------- */
.ch-panel {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.ch-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: #fbfbfc;
}

.ch-panel-head h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.ch-panel-head h3::before {
  content: '';
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--primary);
}

.ch-panel-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.16s ease;
}

.ch-panel-link:hover { color: var(--primary); }

.ch-panel-body { padding: 16px 18px; }
.ch-panel-body--flush { padding: 8px; }

/* Progress stats */
.ch-stats {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.ch-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ch-stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

/* 해결 수는 브랜드 컬러로 강조 */
.ch-stat:first-child .ch-stat-num { color: var(--primary); }

.ch-stat-label {
  font-size: 12px;
  color: var(--muted);
}

/* 내 포인트 — 진행 현황 상단 강조 */
.ch-points {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.ch-points-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
}

.ch-points-icon svg { width: 24px; height: 24px; }

.ch-points-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ch-points-num {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.ch-points-label {
  font-size: 12px;
  color: var(--muted);
}

/* 실시간 LED 펄스 (티커 · 라이브 피드 공용) */
@keyframes chLivePulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Weekly rankers — 1·2·3위 + 구분점 + 내 주변 순위 */
.ch-rankers {
  display: flex;
  flex-direction: column;
}

.ch-ranker {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.ch-ranker:hover { background: #f8fafc; }

.ch-ranker-rank {
  position: relative;
  width: 26px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.ch-ranker-rank .ch-medal {
  position: absolute;
  width: 26px;
  height: 26px;
}

.ch-ranker-rank b { position: relative; z-index: 1; }

/* 메달 색 (상위 3) — 숫자는 흰색으로 또렷하게 */
.ch-ranker-rank.rank-1 { color: #f59e0b; }
.ch-ranker-rank.rank-2 { color: #94a3b8; }
.ch-ranker-rank.rank-3 { color: #c2784a; }
.ch-ranker-rank.rank-1 b,
.ch-ranker-rank.rank-2 b,
.ch-ranker-rank.rank-3 b { color: #fff; }

.ch-ranker-name {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-ranker-name em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.ch-ranker-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.ch-ranker.is-me {
  background: rgba(37, 99, 235, 0.07);
  border-color: rgba(37, 99, 235, 0.22);
}

.ch-ranker.is-me .ch-ranker-rank { color: var(--primary); }

/* 1·2·3위와 내 순위 사이 세로 구분점 */
.ch-ranker-gap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 0;
}

.ch-ranker-gap span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #cbd5e1;
}

/* ---- Responsive ---------------------------------------------------- */
@media (max-width: 1320px) {
  .ch-fb-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .ch-layout { flex-direction: column; }
  .ch-aside {
    width: 100%;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .ch-aside .ch-panel { flex: 1 1 280px; }
}

@media (max-width: 1024px) {
  .ch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .ch-shell { padding: 24px 16px 64px; }
  .ch-fb { padding: 20px; }
  .ch-fb-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .ch-controls { align-items: stretch; }
  .ch-search { flex-basis: 100%; }
  .ch-selects { flex-wrap: wrap; }
  .ch-field { flex: 1 1 140px; }
  .ch-field select { width: 100%; min-width: 0; }
}

@media (max-width: 560px) {
  .ch-grid { grid-template-columns: 1fr; }
  .ch-fb-list { grid-template-columns: 1fr; }
}

/* =====================================================================
   비동기 로딩 스켈레톤
   - 실제 카드(.ch-card/.ch-fb-card)와 '동일한 클래스 구조'를 재사용 → 높이 픽셀 일치.
     로딩 완료 시 같은 자리에 그대로 들어와 레이아웃이 밀리지 않는다.
   - 로딩 애니메이션은 텍스트별이 아니라 '카드 전체'에 시머 스윕으로 적용.
   - First Blood 섹션은 어두운 배경이므로 바/스윕 색을 어둡게 분기.
   ===================================================================== */
/* 자리표시 바 — 정적 색(애니메이션은 카드 단위에만). 치수는 실제 요소에 맞춰 라인박스 유지 */
.chs { display: inline-block; vertical-align: middle; border-radius: 4px; background: #e7eaef; }
.chs-chip { width: 54px; height: 20px; border-radius: 5px; }
.chs-badge { width: 58px; height: 18px; border-radius: 4px; }
.chs-text { width: 76%; height: 13px; }
.chs-tier { width: 66px; height: 13px; }
.chs-pts  { width: 40px; height: 13px; }
.chs-tick { width: 280px; max-width: 70%; height: 12px; }

/* 카드 단위 시머 스윕 — 카드 표면 전체를 한 번에 훑는다(텍스트별 X) */
.ch-card--skel, .ch-fb-card--skel {
  position: relative;
  overflow: hidden;
  cursor: default;
  pointer-events: none;
}
.ch-card--skel:hover, .ch-fb-card--skel:hover { box-shadow: none; transform: none; }
.ch-card--skel::after, .ch-fb-card--skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: chSkelSweep 1.5s ease-in-out infinite;
}
@keyframes chSkelSweep { 100% { transform: translateX(100%); } }

/* First Blood — 어두운 배경 대응 */
.ch-fb-card--skel .chs { background: rgba(148, 163, 184, 0.22); }
.ch-fb-card--skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent); }

/* 티커 스켈레톤 — 마퀴 정지 + 은은한 펄스 */
.ch-ticker.is-skeleton .ch-ticker-track { animation: none; transform: none; }
.ch-ticker-item.is-skel { cursor: default; }
.ch-ticker-item.is-skel .chs { animation: chSkelPulse 1.3s ease-in-out infinite; }
@keyframes chSkelPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

@media (prefers-reduced-motion: reduce) {
  .ch-card--skel::after, .ch-fb-card--skel::after, .ch-ticker-item.is-skel .chs { animation: none; }
}
