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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  color: #fff;
  padding: 0 0 24px;
}

/* Nav */
.site-nav {
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: #a0aec0;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active { color: #fff; }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.97);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 999;
  flex-wrap: wrap;
  text-align: center;
}

.cookie-banner p {
  font-size: 0.85rem;
  color: #a0aec0;
  margin: 0;
}

.cookie-banner a { color: #667eea; }

.cookie-accept-btn {
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* How-to section */
.how-to {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 24px;
}

.how-to h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #cbd5e0;
  margin-bottom: 12px;
}

.how-to-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: steps;
  padding: 0;
}

.how-to-list li {
  counter-increment: steps;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: #a0aec0;
  line-height: 1.5;
}

.how-to-list li::before {
  content: counter(steps);
  background: rgba(102,126,234,0.25);
  color: #667eea;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.how-to-list li strong { color: #e2e8f0; }

/* Section desc */
.section-desc {
  font-size: 0.84rem;
  color: #718096;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* Site description */
.site-desc {
  font-size: 0.9rem;
  color: #718096;
  margin-top: 10px;
  line-height: 1.6;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 40px;
  padding: 28px 16px;
}

.footer-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer-copy {
  font-size: 0.8rem;
  color: #4a5568;
}

.footer-nav {
  display: flex;
  gap: 20px;
}

.footer-nav a {
  font-size: 0.82rem;
  color: #718096;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav a:hover { color: #a0aec0; }

.footer-disclaimer {
  font-size: 0.75rem;
  color: #4a5568;
  max-width: 480px;
  line-height: 1.5;
}

/* Static pages (about, privacy) */
.page-container {
  padding: 32px 16px;
}

.page-content {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 32px;
  line-height: 1.8;
}

.page-content h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.page-date {
  font-size: 0.82rem;
  color: #4a5568;
  margin-bottom: 24px;
}

.page-content h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e2e8f0;
  margin: 28px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.page-content h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #cbd5e0;
  margin: 18px 0 8px;
}

.page-content p {
  color: #a0aec0;
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.page-content ul, .page-content ol {
  color: #a0aec0;
  padding-left: 20px;
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.page-content li { margin-bottom: 6px; }

.page-content a {
  color: #667eea;
  text-decoration: none;
}

.page-content a:hover { text-decoration: underline; }

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

header h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.subtitle {
  color: #a0aec0;
  margin-top: 6px;
  font-size: 1rem;
}

/* Controls */
.controls {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  margin-bottom: 28px;
}

.controls label {
  font-size: 0.9rem;
  color: #a0aec0;
  letter-spacing: 0.4px;
}

.count-selector {
  display: flex;
  align-items: center;
  gap: 20px;
}

.count-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  transition: background 0.2s;
  line-height: 1;
}

.count-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

#set-count {
  font-size: 1.8rem;
  font-weight: 700;
  min-width: 32px;
  text-align: center;
}

.generate-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 40px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  width: 100%;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(102, 126, 234, 0.55);
}

.generate-btn:active {
  transform: translateY(0);
}

/* Results */
.results {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.game-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: slideIn 0.35s ease forwards;
  opacity: 0;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.game-label {
  font-size: 0.78rem;
  color: #a0aec0;
  font-weight: 600;
  min-width: 36px;
}

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

.ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.92rem;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  animation: popIn 0.3s ease backwards;
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Korean Lotto color rules */
.ball.y  { background: linear-gradient(135deg, #f6c90e, #e8b200); }
.ball.b  { background: linear-gradient(135deg, #4f8ef7, #2563eb); }
.ball.r  { background: linear-gradient(135deg, #f87171, #dc2626); }
.ball.g  { background: linear-gradient(135deg, #6b7280, #4b5563); }
.ball.gr { background: linear-gradient(135deg, #34d399, #059669); }

/* History */
.history-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.history-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #cbd5e0;
}

.clear-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #a0aec0;
  padding: 4px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.clear-btn:hover {
  border-color: #f87171;
  color: #f87171;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.empty-msg {
  color: #4a5568;
  font-size: 0.9rem;
  text-align: center;
  padding: 16px 0;
}

.history-item {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-time {
  font-size: 0.72rem;
  color: #4a5568;
}

.history-balls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.history-balls .ball {
  width: 34px;
  height: 34px;
  font-size: 0.78rem;
}

/* Lookup Section */
.lookup-section {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.section-title {
  margin-bottom: 14px;
}

.section-title h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #cbd5e0;
}

.lookup-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.latest-btn {
  background: linear-gradient(135deg, #f6ad55, #ed8936);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 15px rgba(237, 137, 54, 0.35);
  width: 100%;
}

.latest-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(237, 137, 54, 0.5);
}

.latest-btn:active { transform: translateY(0); }

.round-row {
  display: flex;
  gap: 8px;
}

.round-row input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.round-row input::placeholder { color: #4a5568; }
.round-row input:focus { border-color: rgba(255, 255, 255, 0.4); }
.round-row input::-webkit-inner-spin-button,
.round-row input::-webkit-outer-spin-button { -webkit-appearance: none; }

.lookup-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fff;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.lookup-btn:hover { background: rgba(255, 255, 255, 0.18); }

.lookup-result { min-height: 0; }

.win-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  animation: slideIn 0.3s ease forwards;
}

.win-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.win-round { font-size: 1.1rem; font-weight: 700; }
.win-date  { font-size: 0.8rem; color: #a0aec0; }

.win-balls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.bonus-sep {
  color: #a0aec0;
  font-size: 1.2rem;
  font-weight: 300;
  margin: 0 2px;
}

.ball.bonus {
  outline: 2.5px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.win-prize {
  display: flex;
  gap: 20px;
  font-size: 0.82rem;
  color: #a0aec0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 12px;
  flex-wrap: wrap;
}

.win-prize span { color: #f6c90e; font-weight: 700; }

.lookup-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #a0aec0;
  font-size: 0.9rem;
  padding: 14px 0;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.lookup-error {
  color: #f87171;
  font-size: 0.88rem;
  padding: 12px 0;
  text-align: center;
}

/* Contact / Partnership Form */
.contact-section {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  color: #a0aec0;
  font-weight: 500;
}

.required {
  color: #f87171;
}

.form-group input,
.form-group textarea {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 0.93rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: #4a5568; }

.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(102, 126, 234, 0.6);
  background: rgba(255, 255, 255, 0.1);
}

.submit-btn {
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(72, 187, 120, 0.35);
  margin-top: 2px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(72, 187, 120, 0.5);
}

.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.form-status {
  font-size: 0.88rem;
  text-align: center;
  min-height: 0;
}

.form-status.success {
  color: #68d391;
  padding: 8px 0;
}

.form-status.error {
  color: #f87171;
  padding: 8px 0;
}

/* Disqus */
.disqus-section {
  max-width: 640px;
  margin: 0 auto 40px;
  padding: 0 16px;
}

.disqus-section .section-title {
  margin-bottom: 16px;
}

#disqus_thread {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  min-height: 120px;
}

@media (max-width: 480px) {
  header h1 { font-size: 1.8rem; }
  .ball { width: 38px; height: 38px; font-size: 0.82rem; }
  .form-row { grid-template-columns: 1fr; }
}
