:root {
  --bg-color: #f4f6f9;
  --card-bg: #ffffff;
  --primary: #1e293b;
  --heading: #1e293b;
  --accent: #f59e0b;
  --text: #0f172a;
  --text-muted: #64748b;
  --border-soft: #e2e8f0;
  --surface-soft: #f8fafc;
  --divider: #f1f5f9;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --primary: #2563eb;
    --heading: #e2e8f0;
    --accent: #fbbf24;
    --text: #e5e7eb;
    --text-muted: #94a3b8;
    --border-soft: #30363d;
    --surface-soft: #1c2333;
    --divider: #21262d;
  }
}

/* 수동 다크모드 토글 (시스템 설정과 반대로 선택한 경우, 위 미디어쿼리보다 우선 적용) */
:root[data-theme="dark"] {
  --bg-color: #0d1117;
  --card-bg: #161b22;
  --primary: #2563eb;
  --heading: #e2e8f0;
  --accent: #fbbf24;
  --text: #e5e7eb;
  --text-muted: #94a3b8;
  --border-soft: #30363d;
  --surface-soft: #1c2333;
  --divider: #21262d;
}

.theme-toggle-btn {
  position: fixed; top: 14px; right: 14px; z-index: 50;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border-soft); background: var(--card-bg);
  font-size: 1.1rem; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  display: flex; align-items: center; justify-content: center;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
html { overflow-x: hidden; }
body { background-color: var(--bg-color); color: var(--text); padding: 20px 10px; display: flex; justify-content: center; overflow-x: hidden; width: 100%; }
.container { max-width: 600px; width: 100%; display: flex; flex-direction: column; gap: 20px; }

header { text-align: center; margin-bottom: 5px; }
header h1 { font-size: 1.6rem; color: var(--heading); }
header p { font-size: 0.9rem; color: var(--text-muted); margin-top: 4px; }

.card { background: var(--card-bg); border-radius: 16px; padding: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; color: var(--heading); }

.balls-container { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.ball { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; color: #fff; font-size: 1.05rem; box-shadow: inset -2px -2px 4px rgba(0,0,0,0.2); }
.ball.small { width: 30px; height: 30px; font-size: 0.85rem; }
.ball.b-1 { background-color: #fbc02d; }
.ball.b-11 { background-color: #1e88e5; }
.ball.b-21 { background-color: #e53935; }
.ball.b-31 { background-color: #8e24aa; }
.ball.b-41 { background-color: #43a047; }
.plus-sign { font-size: 1.2rem; font-weight: bold; color: var(--text-muted); margin: 0 2px; }

.win-amount { color: var(--accent); font-weight: 700; font-size: 1.1rem; text-align: center; margin-top: 8px; }

.prize-details { margin-top: 16px; border-top: 1px dashed var(--border-soft); padding-top: 12px; }
.prize-toggle-btn {
  background: var(--surface-soft); border: 1px solid var(--border-soft); color: var(--heading);
  font-size: 0.95rem; font-weight: bold; cursor: pointer; display: flex; align-items: center;
  justify-content: center; width: 100%; gap: 6px; padding: 12px; border-radius: 10px;
}
.prize-toggle-btn:hover { background: var(--border-soft); }
.prize-table, .data-table { width: 100%; font-size: 0.85rem; margin-top: 10px; border-collapse: collapse; }
.prize-table { display: none; }
.prize-table th, .prize-table td, .data-table th, .data-table td { padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--divider); }
.prize-table th, .data-table th { background: var(--surface-soft); color: var(--text-muted); }

.scratch-wrapper { position: relative; width: 100%; max-width: 320px; height: 80px; margin: 0 auto; border-radius: 12px; overflow: hidden; background: var(--border-soft); }
.scratch-underlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; z-index: 1; }
#scratchCanvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; cursor: pointer; }

.btn { width: 100%; background: var(--primary); color: #fff; border: none; padding: 14px; border-radius: 10px; font-weight: bold; font-size: 1rem; cursor: pointer; transition: filter 0.2s; }
.btn:hover { filter: brightness(1.15); }
.btn-secondary { background: var(--surface-soft); color: var(--heading); margin-top: 8px; font-size: 0.9rem; padding: 10px; border: 1px solid var(--border-soft); }
.btn-secondary:hover { background: var(--border-soft); }

footer { margin-top: 10px; text-align: center; border-top: 1px solid var(--border-soft); padding-top: 20px; font-size: 0.85rem; color: var(--text-muted); }
.nav-links { display: flex; gap: 10px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.nav-btn { display: inline-block; padding: 8px 16px; background-color: var(--surface-soft); border-radius: 8px; color: var(--heading); text-decoration: none; font-weight: bold; font-size: 0.85rem; border: 1px solid var(--border-soft); }
.nav-btn:hover { background-color: var(--border-soft); }

.info-links { display: flex; flex-direction: column; gap: 6px; }
.info-links a { color: var(--heading); text-decoration: none; font-size: 0.9rem; padding: 8px 4px; border-bottom: 1px solid var(--divider); }
.info-links a:hover { color: var(--accent); }

/* 정보성/분석 글 페이지 공통 */
.article-body h2 { font-size: 1.05rem; color: var(--heading); margin: 18px 0 8px; }
.article-body h2:first-child { margin-top: 0; }
.article-body p { font-size: 0.92rem; line-height: 1.7; color: var(--text); margin-bottom: 10px; }
.article-body ul, .article-body ol { margin: 8px 0 12px 20px; font-size: 0.92rem; line-height: 1.7; color: var(--text); }
.article-body .note { background: var(--surface-soft); border-radius: 10px; padding: 12px 14px; font-size: 0.85rem; color: var(--text-muted); margin-top: 10px; }
.breadcrumb { font-size: 0.8rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--divider); font-size: 0.9rem; }
.stat-row:last-child { border-bottom: none; }

.chip-row { background: var(--surface-soft); border-radius: 10px; padding: 10px 14px; border: 1px solid var(--border-soft); }

/* SNS 공유 아이콘 한 줄 */
.share-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.share-icon {
  flex: 0 0 30px; width: 30px; height: 30px; min-width: 30px; min-height: 30px;
  border-radius: 50%; border: none; cursor: pointer; padding: 0; line-height: 1;
  display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: bold;
  color: #fff; transition: transform 0.15s;
}
.share-icon:hover { transform: translateY(-2px); }
.share-icon.x { background: #000000; }
.share-icon.facebook { background: #1877f2; }
.share-icon.naver { background: #03c75a; }
.share-icon.kakao { background: #fee500; color: #3c1e1e; }
.share-icon.link { background: var(--text-muted); }
.share-icon.image { background: var(--accent); }

/* 카메라 강조 카드 (내 번호 확인 유도) */
.camera-cta { display: block; text-align: center; text-decoration: none; }
.camera-cta .camera-icon { font-size: 2.4rem; display: block; margin-bottom: 6px; }
