*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0d1117;
  --card-bg: #161b27;
  --game-bg: #1c2333;
  --game-border: #2a3347;
  --text: #e6edf3;
  --text-sub: #8b949e;
  --btn-copy-bg: #2a3347;
  --btn-copy-hover: #374153;
  --theme-btn-bg: #2a3347;
}

[data-theme="light"] {
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --game-bg: #f6f8fa;
  --game-border: #d0d7de;
  --text: #1f2328;
  --text-sub: #656d76;
  --btn-copy-bg: #e6edf3;
  --btn-copy-hover: #d0d7de;
  --theme-btn-bg: #e6edf3;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  transition: background 0.2s, color 0.2s;
}

.container {
  width: 100%;
  max-width: 640px;
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: background 0.2s;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.title-wrap h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.subtitle {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.5;
}

.theme-btn {
  flex-shrink: 0;
  background: var(--theme-btn-bg);
  color: var(--text);
  border: none;
  border-radius: 20px;
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.theme-btn:hover {
  filter: brightness(1.1);
}

.action-row {
  display: flex;
  gap: 0.75rem;
}

.generate-btn {
  flex: 1;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.generate-btn:hover {
  opacity: 0.9;
}

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

.copy-btn {
  background: var(--btn-copy-bg);
  color: var(--text);
  border: none;
  border-radius: 10px;
  padding: 0.85rem 1.2rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

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

.bonus-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-sub);
  cursor: pointer;
}

.bonus-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #3b82f6;
}

.games-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-sub);
  font-size: 0.88rem;
  padding: 2rem 0;
}

.game-card {
  background: var(--game-bg);
  border: 1px solid var(--game-border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}

.game-card.full-width {
  grid-column: 1 / 2;
}

.game-label {
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-bottom: 0.75rem;
}

.balls {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.ball {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* 번호 색상 (한국 로또 기준) */
.ball.y  { background: #f5b920; } /* 1-10  노랑 */
.ball.b  { background: #69c8f2; } /* 11-20 파랑 */
.ball.r  { background: #ff7272; } /* 21-30 빨강 */
.ball.g  { background: #aab8c2; } /* 31-40 회색 */
.ball.gr { background: #93c840; } /* 41-45 초록 */
.ball.bonus {
  outline: 3px solid #f59e0b;
  outline-offset: 1px;
}

.status {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-sub);
  min-height: 1.2em;
}
