:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --brand: #6366f1;
  --brand-dark: #4f46e5;
  --brand-light: #818cf8;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --success: #10b981;
  --gradient-start: #667eea;
  --gradient-end: #764ba2;
  --max: 1080px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3), transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(255, 135, 135, 0.2), transparent 50%),
              radial-gradient(circle at 40% 90%, rgba(99, 102, 241, 0.2), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.site-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.site-header-inner {
  min-height: 64px;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
  background: linear-gradient(135deg, var(--brand) 0%, var(--gradient-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.3s ease;
}

.brand:hover {
  transform: scale(1.05);
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav a {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.nav a:hover {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.hero {
  padding: 4rem 0 3rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  margin-top: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
}

.hero h1 {
  margin: 0;
  line-height: 1.3;
  font-size: clamp(1.8rem, 2.5vw + 1rem, 3rem);
  background: linear-gradient(135deg, var(--brand) 0%, var(--gradient-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--muted);
  max-width: 760px;
  line-height: 1.8;
  margin: 1.5rem auto;
  font-size: 1.05rem;
}

.badges {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  justify-content: center;
}

.badge {
  border: 2px solid transparent;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: white;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  transition: all 0.4s ease;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--gradient-end) 100%);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(99, 102, 241, 0.25);
}

.card:hover::before {
  transform: scaleX(1);
}

.card h2,
.card h3 {
  margin-top: 0;
}

.card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.section {
  padding: 1.25rem 0 2.25rem;
}

.section h2 {
  margin: 0 0 0.85rem;
  font-size: 1.35rem;
}

.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.article {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.article h1 {
  margin-top: 0;
  line-height: 1.35;
  font-size: clamp(1.5rem, 1.8vw + 0.9rem, 2.2rem);
}

.article h2 {
  margin-top: 1.8rem;
  margin-bottom: 0.55rem;
  font-size: 1.2rem;
}

.article p,
.article li {
  line-height: 1.75;
  color: #1f2937;
}

.article .meta {
  color: var(--muted);
  font-size: 0.93rem;
  margin-bottom: 1rem;
}

.cta {
  display: inline-block;
  margin-top: 1rem;
  border-radius: 12px;
  padding: 0.9rem 1.8rem;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.5);
  text-decoration: none;
}

.cta:hover::before {
  left: 100%;
}

.notice {
  border-left: 5px solid var(--accent);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
  padding: 1.2rem 1.5rem;
  border-radius: 12px;
  color: #78350f;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
  font-weight: 500;
}

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

.hero,
.section,
.card,
.article {
  animation: fadeInUp 0.8s ease-out;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

.lotto-numbers {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.lotto-ball {
  aspect-ratio: 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, #ffffff, var(--brand-light));
  border: 3px solid var(--brand);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--brand-dark);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
  transition: all 0.3s ease;
}

.lotto-ball:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.5);
}

.lotto-controls {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.lotto-controls button {
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: #ffffff;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.lotto-controls button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.lotto-controls button:active {
  transform: translateY(0);
}

.lotto-controls .secondary-btn {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  color: var(--text);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.lotto-controls .secondary-btn:hover {
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.lotto-meta {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.lotto-log {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.55rem;
}

.lotto-log-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  color: #1f2937;
  background: #f8fafc;
}

footer {
  margin-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
}

.footer-inner {
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.9rem;
  display: grid;
  gap: 0.8rem;
  text-align: center;
}

.footer-inner a {
  transition: color 0.3s ease;
}

.footer-inner a:hover {
  color: var(--brand);
}

@media (max-width: 980px) {
  .grid.cards {
    grid-template-columns: 1fr 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .site-header-inner {
    padding: 0.45rem 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .grid.cards {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 2rem;
  }

  .lotto-numbers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
