:root {
  --nav-bg: rgba(255, 255, 255, 0.85);
  --nav-border: rgba(148, 163, 184, 0.1);
  --bg-gradient: radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 32rem),
                 linear-gradient(135deg, #f7f8fb 0%, #edf1f7 100%);
  --text-primary: #1f2937;
  --text-secondary: #667085;
  --text-header: #111827;
  --container-bg: rgba(255, 255, 255, 0.92);
  --container-border: rgba(148, 163, 184, 0.24);
  --container-shadow: 0 22px 60px rgba(15, 23, 42, 0.13);
  --set-bg: #f8fafc;
  --set-border: #e5e7eb;
  --set-title: #344054;
  --note-color: #7b8494;
  --button-bg: #2563eb;
  --button-hover: #1d4ed8;
  --button-shadow: rgba(37, 99, 235, 0.25);
  --button-hover-shadow: rgba(37, 99, 235, 0.3);
}

.dark-mode {
  --nav-bg: rgba(15, 23, 42, 0.85);
  --nav-border: rgba(51, 65, 85, 0.3);
  --bg-gradient: radial-gradient(circle at top left, rgba(37, 99, 235, 0.1), transparent 32rem),
                 linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-header: #f8fafc;
  --container-bg: rgba(30, 41, 59, 0.92);
  --container-border: rgba(51, 65, 85, 0.4);
  --container-shadow: 0 22px 60px rgba(0, 0, 0, 0.3);
  --set-bg: #1e293b;
  --set-border: #334155;
  --set-title: #cbd5e1;
  --note-color: #64748b;
  --button-bg: #3b82f6;
  --button-hover: #2563eb;
  --button-shadow: rgba(59, 130, 246, 0.2);
  --button-hover-shadow: rgba(59, 130, 246, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 64px;
  transition: background 0.3s ease, color 0.3s ease;
  scroll-behavior: smooth;
}

/* Navbar Styles */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--nav-border);
  margin-bottom: 32px;
}

.nav-container {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

.nav-logo {
  font-size: 20px;
  font-weight: 900;
  color: #2563eb;
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: #2563eb;
}

.container {
  position: relative;
  width: min(100%, 760px);
  background: var(--container-bg);
  border: 1px solid var(--container-border);
  border-radius: 24px;
  box-shadow: var(--container-shadow);
  padding: 40px;
  transition: background 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.mode-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.2s ease;
}

.mode-toggle:hover {
  background: rgba(148, 163, 184, 0.1);
}

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

h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 6vw, 42px);
  letter-spacing: 0;
  color: var(--text-header);
}

p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.55;
}

.lotto-list {
  display: grid;
  gap: 12px;
  margin: 0 0 26px;
}

.lotto-set {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--set-bg);
  border: 1px solid var(--set-border);
  border-radius: 14px;
  transition: background 0.3s ease, border 0.3s ease;
}

.set-title {
  font-weight: 800;
  color: var(--set-title);
  text-align: center;
  white-space: nowrap;
}

.numbers {
  display: grid;
  grid-template-columns: repeat(6, minmax(42px, 1fr));
  gap: 10px;
  justify-items: center;
}

.ball {
  width: clamp(42px, 9vw, 56px);
  aspect-ratio: 1;
  border-radius: 50%;
  color: white;
  font-weight: 800;
  font-size: clamp(16px, 4vw, 20px);
  display: grid;
  place-items: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
  box-shadow:
    inset -8px -10px 14px rgba(0, 0, 0, 0.18),
    inset 8px 10px 14px rgba(255, 255, 255, 0.2),
    0 7px 14px rgba(15, 23, 42, 0.16);
}

.ball.placeholder {
  background: linear-gradient(145deg, #cbd5e1, #94a3b8);
}

.range-1 {
  background: linear-gradient(145deg, #ffd84d, #f59e0b);
}

.range-2 {
  background: linear-gradient(145deg, #60a5fa, #2563eb);
}

.range-3 {
  background: linear-gradient(145deg, #fb7185, #dc2626);
}

.range-4 {
  background: linear-gradient(145deg, #a3aab8, #64748b);
}

.range-5 {
  background: linear-gradient(145deg, #5eead4, #059669);
}

button {
  width: 100%;
  min-height: 54px;
  border: none;
  border-radius: 14px;
  background: var(--button-bg);
  color: white;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 12px 24px var(--button-shadow);
}

button:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
  box-shadow: 0 15px 28px var(--button-hover-shadow);
}

button:active {
  transform: translateY(0);
}

.note {
  margin-top: 18px;
  color: var(--note-color);
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}

/* Info Section Styles */
.info-section {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px dashed var(--container-border);
}

.info-section h2 {
  font-size: 24px;
  margin-bottom: 20px;
  color: var(--text-header);
}

.info-section p {
  margin-bottom: 16px;
  line-height: 1.7;
}

.info-section ul {
  padding-left: 20px;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.info-section li {
  margin-bottom: 8px;
}

.tip-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.tip-card {
  padding: 20px;
  background: var(--set-bg);
  border: 1px solid var(--set-border);
  border-radius: 16px;
}

.tip-card h3 {
  font-size: 17px;
  margin-bottom: 10px;
  color: #2563eb;
}

.tip-card p {
  font-size: 14px;
  margin: 0;
  color: var(--text-secondary);
}

.contact-section {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px dashed var(--container-border);
}

.contact-section h2 {
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--text-header);
  text-align: center;
}

.contact-form {
  display: grid;
  gap: 16px;
}

.form-group {
  display: grid;
  gap: 6px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--set-border);
  background: var(--set-bg);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--button-bg);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.submit-btn {
  background: var(--button-bg);
  margin-top: 8px;
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }
  
  .container {
    padding: 32px 20px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .lotto-set {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .set-title {
    text-align: left;
  }

  .numbers {
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
  }
}

@media (max-width: 380px) {
  .numbers {
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
  }
}
