:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --primary: #3b5bfd;
  --primary-dark: #2540c9;
  --border: #e5e7eb;
  --radius: 14px;
}

html[data-theme="dark"] {
  --bg: #12141c;
  --card: #1b1e29;
  --text: #e8eaf0;
  --muted: #9aa1b2;
  --primary: #6c8cff;
  --primary-dark: #8fa6ff;
  --border: #2a2e3d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background .2s ease, color .2s ease;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

header.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-weight: 800;
  font-size: 19px;
  color: var(--text);
}
.logo span { color: var(--primary); }

nav.site-nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

nav.site-nav a { color: var(--muted); font-weight: 600; }
nav.site-nav a:hover { color: var(--primary); text-decoration: none; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { border-color: var(--primary); }

main { padding: 32px 0 60px; }

.hero {
  text-align: center;
  padding: 36px 0 24px;
}
.hero h1 { font-size: 28px; margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 15px; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: block;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(20,30,60,.08);
  text-decoration: none;
}
.tool-card .emoji { font-size: 28px; }
.tool-card h3 { margin: 10px 0 4px; font-size: 17px; color: var(--text); }
.tool-card p { margin: 0; font-size: 13px; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 24px;
}

.page-title { font-size: 24px; margin: 0 0 6px; }
.page-sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

.breadcrumb {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 12px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 5px; }
.breadcrumb .current { color: var(--text); font-weight: 600; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #fbfbfd;
}
.field input:focus, .field select:focus { outline: 2px solid var(--primary); background: #fff; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

.date-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.date-group input {
  padding: 12px 8px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #fbfbfd;
}
.date-group input:focus { outline: 2px solid var(--primary); background: #fff; }
.date-group input.year-input { width: 78px; }
.date-group input.month-input,
.date-group input.day-input { width: 56px; }
.date-group span.unit {
  font-size: 13px;
  color: var(--muted);
  margin-right: 2px;
}

button.btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
button.btn:hover { background: var(--primary-dark); }

.result {
  margin-top: 20px;
  padding: 20px;
  border-radius: 12px;
  background: #eef1ff;
  border: 1px solid #d6ddff;
  display: none;
}
.result.show { display: block; }
.result .big { font-size: 26px; font-weight: 800; color: var(--primary-dark); }
.result .detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 1px dashed #d6ddff;
  color: var(--text);
}
.result .detail-row:last-child { border-bottom: none; }

.lotto-balls { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.ball {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 15px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.15);
}

article.content { font-size: 15px; }
article.content h2 { font-size: 18px; margin: 28px 0 10px; }
article.content h3 { font-size: 15px; margin: 18px 0 8px; }
article.content p { margin: 0 0 12px; color: #374151; }
article.content ul { margin: 0 0 12px; padding-left: 20px; color: #374151; }
article.content li { margin-bottom: 6px; }
article.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 13.5px;
}
article.content th, article.content td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}
article.content th:first-child, article.content td:first-child {
  text-align: left;
}
article.content th {
  color: var(--muted);
  font-weight: 700;
  font-size: 12.5px;
}

.faq-item { border-top: 1px solid var(--border); padding: 14px 0; }
.faq-item:first-child { border-top: none; }
.faq-item .q { font-weight: 700; margin-bottom: 6px; }
.faq-item .a { color: var(--muted); font-size: 14px; }

.disclaimer {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--muted);
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.ad-slot {
  margin: 26px 0;
  padding: 14px;
  border: 1px dashed #c7cbe0;
  border-radius: 10px;
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  background: #fafafe;
}

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0 40px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
footer.site-footer a { color: var(--muted); margin: 0 8px; }

.wheel-outer {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 10px auto;
}
.wheel-pointer {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 22px solid var(--primary-dark);
  z-index: 5;
}
.wheel-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  border: 4px solid #fff;
  box-shadow: 0 0 0 3px #d6ddff, 0 10px 24px rgba(20,30,60,.15);
}
.wheel-labels {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.wheel-label {
  position: absolute;
  top: 0; left: 50%;
  width: 0; height: 50%;
  transform-origin: bottom center;
}
.wheel-label span {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
  white-space: nowrap;
}
.wheel-center-dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px var(--primary);
  z-index: 4;
}

.consent-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #1f2430;
  color: #fff;
  z-index: 1000;
  box-shadow: 0 -4px 16px rgba(0,0,0,.2);
}
.consent-banner-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
}
.consent-text { margin: 0; font-size: 13px; color: #e5e7eb; flex: 1 1 320px; }
.consent-text a { color: #93a5ff; text-decoration: underline; }
.consent-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.consent-btn {
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.consent-btn-accept { background: var(--primary); color: #fff; }
.consent-btn-accept:hover { background: var(--primary-dark); }
.consent-btn-reject { background: transparent; color: #e5e7eb; border: 1px solid rgba(255,255,255,.3); }
.consent-btn-manage { background: transparent; color: #93a5ff; text-decoration: underline; padding: 9px 4px; }
@media (max-width: 520px) {
  .consent-buttons { width: 100%; justify-content: flex-start; }
}

.site-search {
  margin: 20px 0 4px;
}
.site-search input {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  background: var(--card);
  color: var(--text);
}
.site-search input:focus { outline: 2px solid var(--primary); }
.site-search-empty {
  display: none;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 30px 0;
}
.tool-card.hidden { display: none; }
