:root {
  --bg-color: #f4f7f6;
  --text-color: #333;
  --container-bg: #ffffff;
  --primary-color: #3498db;
  --primary-hover: #2980b9;
  --ball-bg: #ecf0f1;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #f4f7f6;
  --container-bg: #2d2d2d;
  --primary-color: #2980b9;
  --primary-hover: #3498db;
  --ball-bg: #3d3d3d;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s, color 0.3s;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  background-color: var(--container-bg);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 500px;
  text-align: center;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 1.5rem;
}

#theme-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  line-height: 1;
}

#theme-toggle:hover {
  background-color: var(--ball-bg);
}

.numbers-container {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.ball {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--ball-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 1.2rem;
  box-shadow: inset 0 -3px 5px rgba(0,0,0,0.1);
  animation: popIn 0.3s ease-out forwards;
}

.ball.placeholder {
  color: #999;
  font-weight: normal;
}

/* Lotto Color Rules */
.ball.color-1 { background-color: #fbc400; color: #fff; } /* 1-10: Yellow */
.ball.color-11 { background-color: #69c8f2; color: #fff; } /* 11-20: Blue */
.ball.color-21 { background-color: #ff7272; color: #fff; } /* 21-30: Red */
.ball.color-31 { background-color: #aaa; color: #fff; }    /* 31-40: Grey */
.ball.color-41 { background-color: #b0d840; color: #fff; } /* 41-45: Green */

#generate-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 0.5rem;
  cursor: pointer;
  width: 100%;
  transition: transform 0.1s, background-color 0.2s;
}

#generate-btn:hover {
  background-color: var(--primary-hover);
}

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

footer {
  margin-top: 2rem;
  font-size: 0.8rem;
  opacity: 0.7;
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  80% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
