:root {
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --card-shadow: rgba(0, 0, 0, 0.1);
  --title-color: #1a73e8;
  --row-bg: #f8f9fa;
  --label-color: #888;
  --plus-color: #bbb;
  --placeholder-color: #999;
  --btn-bg: #1a73e8;
  --btn-hover: #1557b0;
  --theme-btn-bg: #e8e8e8;
  --theme-btn-color: #555;
  --theme-btn-hover: #d0d0d0;
  --input-bg: #ffffff;
  --input-border: #ddd;
  --input-color: #333;
}

body.dark {
  --bg: #121212;
  --card-bg: #1e1e1e;
  --card-shadow: rgba(0, 0, 0, 0.4);
  --title-color: #90caf9;
  --row-bg: #2a2a2a;
  --label-color: #aaa;
  --plus-color: #555;
  --placeholder-color: #666;
  --btn-bg: #1565c0;
  --btn-hover: #0d47a1;
  --theme-btn-bg: #333;
  --theme-btn-color: #ddd;
  --theme-btn-hover: #444;
  --input-bg: #2a2a2a;
  --input-border: #444;
  --input-color: #eee;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  background-color: var(--bg);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s;
  color: var(--input-color);
}

/* ── Header ── */
.site-header {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--input-border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.3s, border-color 0.3s;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--title-color);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s;
}

.header-nav {
  display: flex;
  gap: 1.2rem;
  flex: 1;
}

.header-nav a {
  font-size: 0.88rem;
  color: var(--label-color);
  text-decoration: none;
  transition: color 0.2s;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--title-color);
  font-weight: 600;
}

/* ── Main ── */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem 2rem;
}

.container {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 10px 25px var(--card-shadow);
  text-align: center;
  width: 100%;
  max-width: 600px;
  position: relative;
  transition: background-color 0.3s, box-shadow 0.3s;
}

/* ── Info sections ── */
.info-section {
  width: 100%;
  max-width: 760px;
  margin-top: 3rem;
}

.info-inner {
  background-color: var(--card-bg);
  border-radius: 20px;
  padding: 2rem 2.4rem;
  box-shadow: 0 4px 16px var(--card-shadow);
  transition: background-color 0.3s;
}

.info-inner h2 {
  color: var(--title-color);
  font-size: 1.1rem;
  margin: 1.8rem 0 0.6rem;
  transition: color 0.3s;
}

.info-inner h2:first-of-type {
  margin-top: 0.4rem;
}

.info-inner p {
  line-height: 1.8;
  font-size: 0.95rem;
  color: var(--input-color);
  transition: color 0.3s;
}

.how-to, .feature-list {
  padding-left: 1.4rem;
  line-height: 2;
  font-size: 0.95rem;
}

.color-guide {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0.8rem 0;
}

.ball.small {
  width: 56px;
  height: 36px;
  border-radius: 8px;
  font-size: 0.75rem;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--placeholder-color);
  margin-bottom: 1.6rem;
  transition: color 0.3s;
}

.disclaimer {
  font-size: 0.82rem;
  color: var(--placeholder-color);
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--input-border);
  line-height: 1.7;
  transition: color 0.3s;
}

/* ── Contact form ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--label-color);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--input-border);
  border-radius: 10px;
  background-color: var(--input-bg);
  color: var(--input-color);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, background-color 0.3s, color 0.3s;
  outline: none;
}

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

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group select {
  appearance: none;
  cursor: pointer;
}

.submit-btn {
  background-color: var(--btn-bg);
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s;
  width: 100%;
  margin-top: 4px;
}

.submit-btn:hover { background-color: var(--btn-hover); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.success-msg {
  display: none;
  background-color: #e8f5e9;
  color: #2e7d32;
  border-radius: 10px;
  padding: 14px;
  margin-top: 16px;
  font-size: 0.9rem;
}

body.dark .success-msg {
  background-color: #1b5e20;
  color: #a5d6a7;
}

/* ── Footer ── */
.site-footer {
  background-color: var(--card-bg);
  border-top: 1px solid var(--input-border);
  margin-top: auto;
  transition: background-color 0.3s, border-color 0.3s;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.4rem 1.5rem;
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.footer-nav a {
  font-size: 0.82rem;
  color: var(--label-color);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav a:hover { color: var(--title-color); }

.footer-copy {
  font-size: 0.78rem;
  color: var(--placeholder-color);
  margin: 0;
  transition: color 0.3s;
}

.theme-btn {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background-color: var(--theme-btn-bg);
  color: var(--theme-btn-color);
  border: none;
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  margin: 0;
}

.theme-btn:hover {
  background-color: var(--theme-btn-hover);
}

h1 {
  color: var(--title-color);
  margin-bottom: 2rem;
  transition: color 0.3s;
}

#results-container {
  margin-bottom: 20px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--row-bg);
  border-radius: 12px;
  padding: 10px 14px;
  transition: background-color 0.3s;
}

.game-label {
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--label-color);
  width: 40px;
  flex-shrink: 0;
  text-align: left;
  transition: color 0.3s;
}

.win-balls, .bonus-ball {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 44px;
}

.plus-sign {
  color: var(--plus-color);
  font-weight: bold;
  font-size: 1rem;
  flex-shrink: 0;
  transition: color 0.3s;
}

.placeholder {
  color: var(--placeholder-color);
  font-style: italic;
  transition: color 0.3s;
}

.ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: bounce 0.5s ease;
  flex-shrink: 0;
}

button#draw-btn {
  background-color: var(--btn-bg);
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-top: 10px;
}

button#draw-btn:hover {
  background-color: var(--btn-hover);
}

button#draw-btn:active {
  transform: scale(0.98);
}

@keyframes bounce {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.ball.range-1 { background: radial-gradient(circle at 30% 30%, #fbc02d, #f9a825); }
.ball.range-2 { background: radial-gradient(circle at 30% 30%, #1e88e5, #1565c0); }
.ball.range-3 { background: radial-gradient(circle at 30% 30%, #e53935, #c62828); }
.ball.range-4 { background: radial-gradient(circle at 30% 30%, #757575, #424242); }
.ball.range-5 { background: radial-gradient(circle at 30% 30%, #43a047, #2e7d32); }
