:root {
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text: #333333;
  --subtext: #666666;
  --border: #dddddd;
  --btn-bg: #e63946;
  --btn-hover: #c1121f;
  --nav-bg: #ffffff;
  --nav-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --bg: #1a1a2e;
  --card-bg: #16213e;
  --text: #eaeaea;
  --subtext: #aaaaaa;
  --border: #2a2a4a;
  --nav-bg: #16213e;
  --nav-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; }

body {
  font-family: sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ── 네비게이션 ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: var(--nav-bg);
  box-shadow: var(--nav-shadow);
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-btn {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: bold;
  background: transparent;
  color: var(--subtext);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.nav-btn:hover { background: var(--bg); color: var(--text); }
.nav-btn.active { background: var(--btn-bg); color: white; }

#theme-btn {
  padding: 7px 14px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
}

/* ── 페이지 공통 ── */
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 80px;
}

.hidden { display: none !important; }

h1 { margin-bottom: 8px; font-size: 28px; }
.desc { color: var(--subtext); margin-bottom: 28px; }

/* ── 동물상 테스트 ── */
#drop-zone {
  width: 100%;
  max-width: 420px;
  min-height: 220px;
  border: 2px dashed var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

#drop-zone:hover,
#drop-zone.drag-over {
  border-color: var(--btn-bg);
  background: rgba(230, 57, 70, 0.05);
}

#drop-zone input[type="file"] { display: none; }

#drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px;
  pointer-events: none;
}

.drop-icon { font-size: 48px; }

.drop-text {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
  color: var(--text);
}

.drop-sub {
  margin: 0;
  font-size: 13px;
  color: var(--subtext);
}

#preview-img {
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 14px;
}

#result-wrap {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  text-align: center;
}

#result-label {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 20px;
}

.result-dog { color: #f4a623; }
.result-cat { color: #4a90d9; }

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.bar-label {
  width: 110px;
  text-align: left;
  font-size: 14px;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 14px;
  background: var(--border);
  border-radius: 7px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.5s ease;
}

.bar-fill.dog { background: #f4a623; }
.bar-fill.cat { background: #4a90d9; }

.bar-pct {
  width: 44px;
  text-align: right;
  font-size: 13px;
  color: var(--subtext);
}

#model-status {
  margin-top: 16px;
  font-size: 13px;
  color: var(--subtext);
}

/* ── 로또 ── */
#lotto-btn {
  padding: 12px 32px;
  font-size: 18px;
  background: var(--btn-bg);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 32px;
}
#lotto-btn:hover { background: var(--btn-hover); }

#lotto-result {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 480px;
}

.lotto-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.row-label {
  font-size: 13px;
  color: var(--subtext);
  width: 44px;
  flex-shrink: 0;
}

.ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ball.yellow { background: #f4a623; }
.ball.blue   { background: #4a90d9; }
.ball.red    { background: #e63946; }
.ball.gray   { background: #888888; }
.ball.green  { background: #2ecc71; }

/* ── 제휴 문의 ── */
#page-contact { max-width: 520px; margin: 0 auto; width: 100%; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  width: 100%;
  max-width: 480px;
}

.form-group label {
  font-size: 14px;
  font-weight: bold;
  color: var(--subtext);
}

.form-group input,
.form-group textarea {
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus { border-color: var(--btn-bg); }

#contact-form button[type="submit"] {
  width: 100%;
  max-width: 480px;
  padding: 12px;
  font-size: 16px;
  background: var(--btn-bg);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
#contact-form button[type="submit"]:hover { background: var(--btn-hover); }
#contact-form button:disabled { opacity: 0.6; cursor: not-allowed; }

#form-status { margin-top: 12px; font-size: 14px; }
.status-success { color: #2ecc71; }
.status-error   { color: #e63946; }

/* ── 광고 ── */
.ad-wrap {
  width: 100%;
  max-width: 680px;
  margin: 24px 0;
  min-height: 90px;
}

/* ── 콘텐츠 박스 ── */
.info-box {
  width: 100%;
  max-width: 680px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px;
  margin-top: 40px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  text-align: left;
  line-height: 1.8;
}

.info-box h2 {
  font-size: 20px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.info-box h3 {
  font-size: 16px;
  margin: 20px 0 6px;
  color: var(--btn-bg);
}

.info-box p {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 15px;
}

/* ── 푸터 ── */
.site-footer {
  margin-top: 80px;
  padding: 32px 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--subtext);
}

.footer-link {
  background: none;
  border: none;
  color: var(--subtext);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.footer-link:hover { color: var(--text); }

.footer-copy {
  font-size: 13px;
  color: var(--subtext);
  margin: 0;
}
