:root {
  --bg-color: #f7f9fc;
  --container-bg: #ffffff;
  --text-color: #333333;
  --ball-placeholder: #eeeeee;
  --ball-placeholder-text: #aaaaaa;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --btn-bg: #3f51b5;
  --btn-hover: #303f9f;
  --input-bg: #ffffff;
  --input-border: #dddddd;
  --divider-color: #eeeeee;
  --accent-color: #3f51b5;
}

body.dark-mode {
  --bg-color: #1a1a1a;
  --container-bg: #2d2d2d;
  --text-color: #f0f0f0;
  --ball-placeholder: #444444;
  --ball-placeholder-text: #888888;
  --shadow-color: rgba(0, 0, 0, 0.4);
  --btn-bg: #5c6bc0;
  --btn-hover: #7986cb;
  --input-bg: #3d3d3d;
  --input-border: #444444;
  --divider-color: #444444;
  --accent-color: #7986cb;
}

body {
  font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  transition: all 0.3s;
  line-height: 1.6;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

#theme-btn {
  background: var(--container-bg);
  border: 1px solid var(--shadow-color);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 2px 5px var(--shadow-color);
}

.container {
  width: 100%;
  max-width: 600px;
  background: var(--container-bg);
  padding: 2.5rem;
  border-radius: 24px;
  box-shadow: 0 10px 40px var(--shadow-color);
  margin-top: 20px;
}

/* Navigation */
.main-nav {
  margin-bottom: 2.5rem;
}

.main-nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 15px;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 12px;
  background: var(--bg-color);
  transition: all 0.2s;
  font-size: 0.95rem;
}

.main-nav a.active {
  background: var(--accent-color);
  color: white;
}

.main-nav a:hover:not(.active) {
  background: var(--input-border);
}

header h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  word-break: keep-all;
}

.subtitle {
  color: var(--ball-placeholder-text);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* Rich Content */
.content-rich-text {
  text-align: left;
  background: var(--bg-color);
  padding: 1.5rem;
  border-radius: 16px;
  margin: 2rem 0;
}

.content-rich-text h3, .content-rich-text h4 {
  color: var(--accent-color);
  margin-top: 0;
  margin-bottom: 10px;
}

.content-rich-text p {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.content-rich-text ul {
  padding-left: 20px;
  font-size: 0.95rem;
}

.color-guide {
  list-style: none;
  padding: 0 !important;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 15px;
}

.color-guide li {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  display: inline-block;
}

.mt-2 { margin-top: 2rem; }

/* Lotto Balls */
.ball-container {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.ball {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: inset -3px -3px 5px rgba(0,0,0,0.1), 2px 2px 5px rgba(0,0,0,0.1);
}

.placeholder { background-color: var(--ball-placeholder); color: var(--ball-placeholder-text); }
.color-1 { background-color: #fbc02d; }
.color-2 { background-color: #1976d2; }
.color-3 { background-color: #e53935; }
.color-4 { background-color: #757575; }
.color-5 { background-color: #43a047; }

/* Upload Area */
.upload-box {
  border: 2px dashed var(--input-border);
  border-radius: 20px;
  padding: 50px 20px;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: background 0.2s;
}

.upload-box:hover { background: var(--bg-color); }

.upload-icon { font-size: 3.5rem; margin-bottom: 10px; }
.upload-hint { font-size: 0.85rem; color: var(--ball-placeholder-text); }

#face-image {
  width: 100%;
  max-width: 350px;
  border-radius: 20px;
  margin-bottom: 1.5rem;
}

/* Buttons */
.main-btn {
  background-color: var(--btn-bg);
  color: white;
  border: none;
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 14px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}

.main-btn:hover { background-color: var(--btn-hover); }
.main-btn:active { transform: scale(0.98); }

.sub-btn {
  background: none;
  border: 1px solid var(--input-border);
  color: var(--text-color);
  padding: 12px;
  border-radius: 12px;
  width: 100%;
  margin-top: 10px;
  cursor: pointer;
}

/* Forms */
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 14px;
  margin-bottom: 12px;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--text-color);
  box-sizing: border-box;
}

.submit-btn {
  background-color: #2e7d32;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 10px;
  width: 100%;
  cursor: pointer;
  font-weight: bold;
}

/* Sections */
.about-section, .contact-section, .comment-section {
  text-align: left;
}

.section-desc {
  font-size: 0.9rem;
  color: var(--ball-placeholder-text);
  margin-bottom: 1.5rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--divider-color);
  margin: 3rem 0;
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding-bottom: 2rem;
  font-size: 0.85rem;
  color: var(--ball-placeholder-text);
}

.footer-links { margin-bottom: 10px; }
.footer-links a { color: var(--ball-placeholder-text); text-decoration: none; margin: 0 5px; }
