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

input, select, button, textarea {
  font-family: 'Malgun Gothic', '맑은 고딕', sans-serif;
}

body {
  font-family: 'Malgun Gothic', '맑은 고딕', sans-serif;
  font-size: 14px;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

.page-wrapper {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
  max-width: 1280px;
}

.ad-slot {
  width: 300px;
  min-width: 300px;
  height: 600px;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 13px;
  position: sticky;
  top: 32px;
  margin-top: 45px;
}

@media (max-width: 1000px) { .ad-slot.ad-left  { display: none; } }
@media (max-width: 1280px) { .ad-slot.ad-right { display: none; } }

.container {
  width: 100%;
  max-width: 640px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1 {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
}
h1 span { color: #0078d4; }

.subtitle { display: none; }

.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
}

.control-box {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.control-box label {
  color: #555;
  font-size: 14px;
  white-space: nowrap;
}

.count-select {
  appearance: none;
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px 32px 8px 12px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s;
}
.count-select:hover { border-color: #0078d4; }

.btn-generate {
  background: #0078d4;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-generate:hover { background: #005fa3; }
.btn-generate:disabled { background: #aaa; cursor: not-allowed; }

.results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lotto-row {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(16px);
  animation: rowFadeIn 0.35s forwards;
}

@keyframes rowFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

.row-label {
  color: #999;
  font-size: 12px;
  min-width: 32px;
  font-weight: 600;
}

.balls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.btn-copy {
  margin-left: auto;
  background: transparent;
  color: #888;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-copy:hover { color: #0078d4; border-color: #0078d4; }
.btn-copy.copied { color: #107c10; border-color: #107c10; }

.ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.2), 0 3px 8px rgba(0,0,0,0.15);
  opacity: 0;
  transform: scale(0.3) rotate(-180deg);
  animation: ballPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ballPop {
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

.ball.c1 { background: radial-gradient(circle at 35% 35%, #ffe066, #f9a825); }
.ball.c2 { background: radial-gradient(circle at 35% 35%, #81d4fa, #1565c0); }
.ball.c3 { background: radial-gradient(circle at 35% 35%, #ef9a9a, #c62828); }
.ball.c4 { background: radial-gradient(circle at 35% 35%, #a5d6a7, #2e7d32); }
.ball.c5 { background: radial-gradient(circle at 35% 35%, #ce93d8, #6a1b9a); }

.btn-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-copy-all {
  background: #0078d4;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-copy-all:hover { background: #005fa3; }
.btn-copy-all.copied { background: #107c10; }

.btn-reset {
  background: #fff;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 9px 20px;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.btn-reset:hover { color: #0078d4; border-color: #0078d4; }

@media (max-width: 480px) {
  h1 { font-size: 18px; }
  .ball { width: 38px; height: 38px; font-size: 13px; }
}
