/* ==========================================================================
   RuangSNBT v15 — Core Pages Hub
   (Result, Leaderboard, Bookmarks, Profile, FAQ)
   Editorial Blue–White · Zero AI Slop · Responsive Mobile / Tablet / Laptop
   ========================================================================== */

.cp-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1160px;
  margin: 0 auto;
}

/* Header */
.cp-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid #E6E8EC;
}
@media (min-width: 820px) {
  .cp-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
  }
}

.cp-title {
  font-family: var(--font-heading);
  font-size: clamp(22px, 3vw, 27px);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #17191D;
  margin: 0 0 4px;
  line-height: 1.2;
}
.cp-sub {
  font-size: 14px;
  color: #52637E;
  margin: 0;
}

.cp-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */
.cp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid #D7E1F0;
  background: #FFFFFF;
  color: #1E293B;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.cp-btn:hover { background: #F6F6F7; border-color: #B8CAE6; color: #17191D; }
.cp-btn.is-active { background: #EDF3FF; border-color: #F58A1F; color: #F58A1F; }
.cp-btn-primary {
  background: #F58A1F;
  border-color: #F58A1F;
  color: #FFFFFF;
}
.cp-btn-primary:hover { background: #0E34A3; border-color: #0E34A3; color: #FFFFFF; }

/* 4-Metric Strip */
.cp-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 820px) {
  .cp-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
}
.cp-metric {
  background: #FFFFFF;
  border: 1px solid #E4ECF7;
  border-radius: 14px;
  padding: 15px 16px;
}
.cp-metric.is-accent {
  border-color: #BFD4FA;
  background: #FFF6EB;
}
.cp-metric-label { font-size: 12px; font-weight: 600; color: #5B6C86; margin-bottom: 6px; }
.cp-metric-val {
  font-family: var(--font-heading);
  font-size: clamp(24px, 2.8vw, 30px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #17191D;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.cp-metric-note { font-size: 12px; color: #64748B; margin-top: 6px; }

/* Panels & Grids */
.cp-panel {
  background: #FFFFFF;
  border: 1px solid #E4ECF7;
  border-radius: 16px;
  padding: 18px 20px;
}
@media (max-width: 480px) {
  .cp-panel { padding: 16px; }
}
.cp-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cp-panel-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  color: #17191D;
  margin: 0;
}
.cp-panel-sub {
  font-size: 12.5px;
  color: #64748B;
  margin: 3px 0 0;
}

.cp-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (min-width: 860px) {
  .cp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Filter Toolbar */
.cp-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 760px) {
  .cp-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }
}

.cp-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.cp-pills::-webkit-scrollbar { display: none; }

.cp-pill {
  border: 1px solid #E6E8EC;
  background: #FFFFFF;
  color: #475569;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}
.cp-pill:hover { border-color: #BDD0F0; color: #17191D; }
.cp-pill.is-active {
  background: #F58A1F;
  border-color: #F58A1F;
  color: #FFFFFF;
}

.cp-search {
  width: 100%;
  height: 38px;
  padding: 0 13px;
  border: 1px solid #D7E1F0;
  border-radius: 10px;
  background: #FFFFFF;
  font-size: 13.5px;
  color: #17191D;
  outline: none;
}
.cp-search:focus { border-color: #F58A1F; box-shadow: 0 0 0 3px rgba(245, 138, 31, 0.1); }
@media (min-width: 760px) {
  .cp-search { width: 260px; flex-shrink: 0; }
}

/* Leaderboard Podium (Top 3) */
.cp-podium {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
@media (min-width: 700px) {
  .cp-podium { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.cp-pod-card {
  background: #FFFFFF;
  border: 1px solid #E4ECF7;
  border-radius: 15px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.cp-pod-card.is-first {
  border-color: #93B4F5;
  background: #F4F8FF;
}
.cp-pod-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 800;
  background: #EDF3FF;
  color: #F58A1F;
}
.cp-pod-card.is-first .cp-pod-rank { background: #F58A1F; color: #FFFFFF; }
.cp-pod-score {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: #17191D;
  font-variant-numeric: tabular-nums;
}

/* Profile Heatmap & Badges */
.cp-hm-grid {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 10px;
}
@media (min-width: 760px) {
  .cp-hm-grid { grid-template-columns: repeat(28, minmax(0, 1fr)); }
}
.cp-hm-cell {
  aspect-ratio: 1 / 1;
  border-radius: 3px;
  background: #E6F1F5;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.cp-hm-cell.l1 { background: #FFD5A8; }
.cp-hm-cell.l2 { background: #60A5FA; }
.cp-hm-cell.l3 { background: #F58A1F; }
.cp-hm-cell.l4 { background: #18181C; }

.cp-badges-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 760px) {
  .cp-badges-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}
.cp-badge-card {
  border: 1px solid #E4ECF7;
  border-radius: 13px;
  padding: 14px;
  background: #FAFDFE;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cp-badge-card.is-unlocked {
  border-color: #A7F3D0;
  background: #F6FEF9;
}

/* FAQ Accordion */
.cp-faq-item {
  border: 1px solid #E4ECF7;
  border-radius: 13px;
  background: #FFFFFF;
  overflow: hidden;
  transition: border-color 0.14s ease;
}
.cp-faq-item[open] { border-color: #BFD2F5; }
.cp-faq-q {
  padding: 15px 18px;
  font-family: var(--font-heading);
  font-size: 14.5px;
  font-weight: 700;
  color: #17191D;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cp-faq-q::-webkit-details-marker { display: none; }
.cp-faq-a {
  padding: 0 18px 16px;
  font-size: 13.5px;
  line-height: 1.68;
  color: #475569;
  border-top: 1px solid #F1F5FA;
  padding-top: 12px;
}

/* Password Eye Wrapper */
.cp-pass-wrap { position: relative; }
.cp-pass-wrap input { padding-right: 42px; }
.cp-eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #64748B;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
}
.cp-eye-btn:hover { color: #F58A1F; }

.cp-empty {
  padding: 28px 16px;
  text-align: center;
  border: 1px dashed #CBD8EE;
  border-radius: 14px;
  background: #FAFDFE;
  font-size: 13.5px;
  color: #5B6C86;
}
