/* =========================================================
   [100단계 두뇌 십자말풀이] PC · 태블릿 · 모바일(/m/) 통합 반응형 스타일 v1
========================================================= */
.cw-sge-wrap, .cw-pro-app {
  width: 100%;
  max-width: 680px;
  margin: 20px auto;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: #1e293b;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: break-word;
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
}
.cw-sge-wrap *, .cw-pro-app * {
  box-sizing: border-box;
}

/* 상·하단 SGE 정의 박스 및 칼럼 영역 */
.cw-sge-wrap h2 {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 22px 0 10px !important;
  line-height: 1.4 !important;
}
.cw-sge-wrap h3 {
  font-size: 16.5px !important;
  font-weight: 800 !important;
  color: #1e40af !important;
  margin: 18px 0 8px !important;
  line-height: 1.4 !important;
}
.cw-def-box {
  background: #eff6ff !important;
  border-left: 4px solid #2563eb !important;
  padding: 14px 16px !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  color: #1e293b !important;
  margin: 12px 0 16px !important;
  line-height: 1.65 !important;
}

/* 애드센스 광고 슬롯 (오클릭 방지 여백 & 모바일 가로 넘침 차단) */
.cw-ad-wrap-top, .cw-ad-wrap-bottom {
  width: 100% !important;
  max-width: 680px !important;
  min-height: 90px;
  margin: 24px auto !important;
  text-align: center !important;
  clear: both !important;
  overflow: hidden !important;
}

.cw-center-wrap {
  width: 100%;
  margin: 0 auto;
}

/* 1. 상단 슬림 상태 바 */
.cw-top-bar {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  background: #0f172a !important;
  color: #ffffff !important;
  padding: 12px 14px !important;
  border-radius: 14px !important;
  margin-bottom: 12px !important;
}
.cw-cat-group, .cw-status-group {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}
.cw-cat-pill {
  background: #1e293b !important;
  color: #93c5fd !important;
  border: 1px solid #334155 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
}
.cw-lv-pill {
  background: #2563eb !important;
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
}
.cw-progress-txt {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #e2e8f0 !important;
}
.cw-progress-txt b {
  color: #38bdf8 !important;
  font-weight: 900 !important;
}
.cw-timer-pill {
  background: #1e293b !important;
  color: #f8fafc !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  font-variant-numeric: tabular-nums !important;
}
.cw-pen-badge {
  display: none;
  background: #dc2626 !important;
  color: #ffffff !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  padding: 3px 8px !important;
  border-radius: 999px !important;
}

/* 2. 문제 + 정답 입력 컨트롤 카드 */
.cw-clue-card {
  background: #f8fafc !important;
  border: 2px solid #cbd5e1 !important;
  border-radius: 16px !important;
  padding: 14px !important;
  margin-bottom: 14px !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04) !important;
}
.cw-num-strip {
  display: grid !important;
  grid-template-columns: repeat(10, 1fr) !important;
  gap: 4px !important;
  margin-bottom: 10px !important;
}
.cw-num-btn {
  -webkit-appearance: none;
  appearance: none;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  padding: 6px 0 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  text-align: center !important;
  touch-action: manipulation;
}
.cw-num-btn.active {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}
.cw-num-btn.solved {
  background: #dcfce7 !important;
  border-color: #10b981 !important;
  color: #047857 !important;
}

.cw-clue-nav {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 8px !important;
}
.cw-arrow-btn {
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0 !important;
  border: none !important;
  color: #1e293b !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}
.cw-clue-meta {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}
.cw-dir-tag {
  font-size: 13.5px !important;
  font-weight: 900 !important;
  color: #1d4ed8 !important;
}
.cw-rec-tag {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
}
.cw-clue-text {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  text-align: center !important;
  margin-bottom: 10px !important;
  min-height: 52px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1.45 !important;
}
.cw-hint-pop {
  display: none !important;
  background: #fffbeb !important;
  border: 1px dashed #f59e0b !important;
  color: #92400e !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  text-align: center !important;
  margin-bottom: 10px !important;
}
.cw-hint-pop.show {
  display: block !important;
}

.cw-input-row {
  display: flex !important;
  gap: 6px !important;
  margin-bottom: 8px !important;
}
.cw-word-input {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  background: #ffffff !important;
  border: 2px solid #93c5fd !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  text-align: center !important;
  outline: none !important;
}
.cw-word-input:focus {
  border-color: #2563eb !important;
}
.cw-submit-btn {
  -webkit-appearance: none;
  appearance: none;
  background: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 10px 18px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}

.cw-tool-row {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 6px !important;
}
.cw-tool-btn {
  -webkit-appearance: none;
  appearance: none;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  padding: 8px 4px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  text-align: center !important;
  white-space: nowrap !important;
}

/* 3. 9x9 십자 퍼즐 보드 (모바일 가로폭 100% 정밀 대응) */
.cw-board-frame {
  background: #0f172a !important;
  padding: 10px !important;
  border-radius: 16px !important;
  max-width: 440px !important;
  margin: 0 auto 16px !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12) !important;
}
.cw-grid {
  display: grid !important;
  grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
  gap: 3px !important;
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
}
.cw-cell {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
}
.cw-cell.blocked {
  background: #1e293b !important;
}
.cw-cell.open {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  cursor: pointer !important;
}
.cw-cell.in-word {
  background: #dbeafe !important;
  border: 1.5px solid #60a5fa !important;
}
.cw-cell.active-focus {
  background: #bfdbfe !important;
  border: 2px solid #2563eb !important;
  box-shadow: inset 0 0 0 1px #2563eb !important;
}
.cw-cell.solved-cell {
  background: #d1fae5 !important;
  border-color: #10b981 !important;
}
.cw-cell-num {
  position: absolute !important;
  top: 2px !important;
  left: 3px !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  color: #475569 !important;
  line-height: 1 !important;
  pointer-events: none !important;
}
.cw-cell-char {
  font-size: 18px !important;
  font-weight: 900 !important;
  color: #0f172a !important;
  line-height: 1 !important;
}

/* 완주 축하 카드 (기본 숨김 필수!) */
.cw-win-card {
  display: none !important;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
  border: 2px solid #10b981 !important;
  border-radius: 16px !important;
  padding: 20px 16px !important;
  text-align: center !important;
  margin-bottom: 16px !important;
}
.cw-win-card.show {
  display: block !important;
}
.cw-win-title {
  font-size: 19px !important;
  font-weight: 900 !important;
  color: #065f46 !important;
  margin-bottom: 6px !important;
}
.cw-win-sub {
  font-size: 14px !important;
  font-weight: 800 !important;
  color: #047857 !important;
  margin-bottom: 14px !important;
}
.cw-rank-form {
  display: flex !important;
  gap: 6px !important;
  margin-bottom: 10px !important;
}
.cw-rank-input {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  background: #ffffff !important;
  border: 1px solid #10b981 !important;
  border-radius: 8px !important;
  padding: 9px 12px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}
.cw-rank-save-btn {
  background: #059669 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 9px 16px !important;
  font-size: 13.5px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}
.cw-share-btn, .cw-next-lv-btn {
  display: block !important;
  width: 100% !important;
  padding: 12px !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  border: none !important;
  margin-top: 8px !important;
}
.cw-share-btn {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}
.cw-next-lv-btn {
  background: #2563eb !important;
  color: #ffffff !important;
}

/* 4. 카테고리 난이도 승급 코스 */
.cw-level-box {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 14px !important;
  padding: 14px !important;
  margin-bottom: 14px !important;
}
.cw-level-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-size: 13.5px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin-bottom: 10px !important;
}
.cw-level-list {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 6px !important;
}
.cw-level-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  padding: 8px 4px !important;
  text-decoration: none !important;
  color: #334155 !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  gap: 3px !important;
}
.cw-level-item.active {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}
.cw-level-tag {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  color: #64748b !important;
}
.cw-level-item.active .cw-level-tag {
  color: #dbeafe !important;
}

/* 5. 하단 접이식 폴더 (아코디언 4종) */
.cw-folders-wrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  margin-bottom: 24px !important;
}
.cw-fold-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}
.cw-fold-btn {
  width: 100% !important;
  background: #f8fafc !important;
  border: none !important;
  padding: 13px 16px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  cursor: pointer !important;
  text-align: left !important;
}
.cw-fold-pill {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #2563eb !important;
  background: #eff6ff !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
}
.cw-fold-body {
  display: none !important;
  padding: 14px 16px !important;
  border-top: 1px solid #e2e8f0 !important;
  font-size: 13.5px !important;
  color: #334155 !important;
  line-height: 1.6 !important;
}
.cw-fold-card.open .cw-fold-body {
  display: block !important;
}

.cw-clues-2col {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 14px !important;
}
.cw-clue-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 10px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  margin-bottom: 6px !important;
  cursor: pointer !important;
  font-size: 13px !important;
}
.cw-clue-row.solved {
  background: #f0fdf4 !important;
  border-color: #bbf7d0 !important;
  color: #065f46 !important;
}

.cw-stat-strip {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px !important;
  margin-bottom: 12px !important;
  text-align: center !important;
}
.cw-stat-item {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 8px !important;
}
.cw-stat-lbl {
  font-size: 11.5px !important;
  color: #64748b !important;
  font-weight: 700 !important;
}
.cw-stat-num {
  font-size: 16px !important;
  font-weight: 900 !important;
  color: #0f172a !important;
}

.cw-rank-board {
  margin-bottom: 12px !important;
}
.cw-rank-empty {
  padding: 14px !important;
  background: #f8fafc !important;
  border: 1px dashed #cbd5e1 !important;
  border-radius: 10px !important;
  text-align: center !important;
  font-size: 13px !important;
  color: #64748b !important;
}
.cw-rank-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 9px 12px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  margin-bottom: 6px !important;
  font-size: 13px !important;
}
.cw-rank-item.me {
  background: #eff6ff !important;
  border-color: #60a5fa !important;
  font-weight: 800 !important;
}
.cw-rank-left, .cw-rank-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.cw-rank-pos {
  font-weight: 800 !important;
  color: #1d4ed8 !important;
}
.cw-rank-time {
  font-weight: 800 !important;
  color: #0f172a !important;
}
.cw-rank-pct {
  font-size: 11.5px !important;
  background: #dcfce7 !important;
  color: #047857 !important;
  padding: 2px 7px !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
}
.cw-rank-actions {
  display: flex !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}
.cw-giveup-btn, .cw-clear-rank-btn {
  flex: 1 1 140px !important;
  padding: 9px 12px !important;
  border-radius: 8px !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

.cw-seo-item {
  border-bottom: 1px dashed #e2e8f0 !important;
  padding: 10px 0 !important;
}
.cw-seo-item:last-child {
  border-bottom: none !important;
}
.cw-seo-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin-bottom: 4px !important;
}
.cw-masked {
  font-size: 11px !important;
  color: #94a3b8 !important;
  background: #f1f5f9 !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
}

/* 하단 비교표 · 현장 Insight · FAQ · 연속 도전 네비게이션 */
.cw-table-scroll {
  width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  margin: 14px 0 20px !important;
}
.cw-sge-table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 13px !important;
}
.cw-sge-table th {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  font-weight: 800 !important;
  padding: 10px 8px !important;
  border: 1px solid #cbd5e1 !important;
  text-align: center !important;
}
.cw-sge-table td {
  padding: 10px 8px !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  vertical-align: middle !important;
}
.cw-num-hi {
  font-weight: 800 !important;
  color: #1d4ed8 !important;
  text-align: center !important;
}
.cw-insight-box {
  background: #fffbeb !important;
  border: 1px solid #fcd34d !important;
  border-left: 4px solid #f59e0b !important;
  border-radius: 10px !important;
  padding: 14px 16px !important;
  font-size: 13.5px !important;
  color: #78350f !important;
  margin: 18px 0 !important;
  line-height: 1.65 !important;
}
.cw-insight-title {
  display: block !important;
  font-weight: 800 !important;
  color: #b45309 !important;
  margin-bottom: 6px !important;
}
.cw-faq-item {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  margin-bottom: 10px !important;
}
.cw-faq-item summary {
  cursor: pointer !important;
  font-size: 14px !important;
  color: #0f172a !important;
  list-style: none !important;
}
.cw-faq-item summary::-webkit-details-marker {
  display: none !important;
}
.cw-faq-ans {
  margin-top: 8px !important;
  padding-top: 8px !important;
  border-top: 1px dashed #cbd5e1 !important;
  font-size: 13.5px !important;
  color: #334155 !important;
  line-height: 1.6 !important;
}
.cw-roadmap-nav {
  background: #0f172a !important;
  color: #ffffff !important;
  padding: 18px 16px !important;
  border-radius: 14px !important;
  margin-top: 24px !important;
  text-align: center !important;
}
.cw-roadmap-links {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px !important;
  margin-top: 12px !important;
}
.cw-roadmap-links a {
  display: block !important;
  background: #1e293b !important;
  color: #93c5fd !important;
  border: 1px solid #334155 !important;
  padding: 10px 8px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}

/* 📱 스마트폰 (600px 이하) 전용 정밀 보정 */
@media screen and (max-width: 600px) {
  .cw-num-strip {
    grid-template-columns: repeat(5, 1fr) !important;
  }
  .cw-board-frame {
    padding: 6px !important;
    border-radius: 12px !important;
  }
  .cw-grid {
    gap: 2px !important;
  }
  .cw-cell-num {
    font-size: 7.5px !important;
    top: 1px !important;
    left: 2px !important;
  }
  .cw-cell-char {
    font-size: 15px !important;
  }
  .cw-level-list {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .cw-level-list .cw-level-item:last-child {
    grid-column: span 2 !important;
  }
  .cw-clues-2col {
    grid-template-columns: 1fr !important;
  }
  .cw-roadmap-links {
    grid-template-columns: 1fr !important;
  }
  .cw-sge-table, .cw-sge-table tbody, .cw-sge-table tr, .cw-sge-table td {
    display: block !important;
    width: 100% !important;
  }
  .cw-sge-table thead {
    display: none !important;
  }
  .cw-sge-table tr {
    margin-bottom: 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #ffffff !important;
  }
  .cw-sge-table td {
    border: none !important;
    border-bottom: 1px dashed #e2e8f0 !important;
    padding: 8px 12px !important;
    text-align: left !important;
  }
  .cw-sge-table td:first-child {
    background: #f8fafc !important;
    color: #0f172a !important;
  }
  .cw-sge-table td:last-child {
    border-bottom: none !important;
  }
}
