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

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --success: #3fb950;
  --border: #30363d;
  --gradient-start: #6366f1;
  --gradient-end: #8b5cf6;
  --gold-start: #fbbf24;
  --gold-end: #f59e0b;
  --gold-dark: #d97706;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

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

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* 입력 섹션 */
.input-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.input-section label {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--text-primary);
}

textarea {
  width: 100%;
  height: 150px;
  padding: 16px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea::placeholder {
  color: var(--text-secondary);
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.primary-btn {
  width: 100%;
  padding: 16px 32px;
  margin-top: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

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

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

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 해몽 결과 섹션 */
.result-section {
  margin-top: 32px;
}

.result-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
}

.result-card h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
}

.result-content {
  font-size: 1.05rem;
  line-height: 2;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.result-content p {
  margin-bottom: 16px;
}

.result-content p:last-child {
  margin-bottom: 0;
}

/* 로또 CTA 버튼 */
.lotto-cta-btn {
  width: 100%;
  padding: 24px 32px;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  color: #1a1a1a;
  background: linear-gradient(135deg, var(--gold-start), var(--gold-end));
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: goldPulse 2s infinite;
  position: relative;
  overflow: hidden;
}

.lotto-cta-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: rotate(45deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

@keyframes goldPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.5);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(251, 191, 36, 0);
  }
}

.lotto-cta-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(251, 191, 36, 0.5);
  animation: none;
}

.lotto-cta-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  animation: none;
}

.btn-icon {
  font-size: 2rem;
}

.btn-text {
  font-size: 1.3rem;
  font-weight: 700;
}

.btn-sub {
  font-size: 0.85rem;
  opacity: 0.8;
  font-weight: 500;
}

.bonus-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.bonus-btn::before {
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
}

@keyframes redPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
  }
}

.bonus-btn {
  animation: redPulse 2s infinite;
}

.bonus-btn:hover {
  box-shadow: 0 12px 35px rgba(239, 68, 68, 0.5);
}

/* 광고 섹션 */
.ad-section {
  margin-top: 28px;
  background: var(--bg-secondary);
  border: 2px solid var(--gold-start);
  border-radius: 20px;
  padding: 40px;
}

.ad-content {
  text-align: center;
}

.ad-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.ad-text {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold-start);
  margin-bottom: 20px;
}

.ad-progress-bar {
  width: 100%;
  height: 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.ad-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-start), var(--gold-end));
  border-radius: 6px;
  transition: width 0.06s linear;
  box-shadow: 0 0 10px var(--gold-start);
}

.ad-subtext {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* 로또 섹션 */
.lotto-section {
  margin-top: 28px;
  animation: fadeInUp 0.5s ease-out;
}

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

.lotto-result {
  text-align: center;
  padding: 32px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid var(--gradient-start);
  border-radius: 20px;
}

.bonus-result {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
  border-color: #ef4444;
}

.lotto-result h3 {
  font-size: 1.4rem;
  margin-bottom: 24px;
  color: var(--accent);
}

.bonus-result h3 {
  color: #ef4444;
}

.lotto-numbers {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lotto-set {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border-radius: 16px;
  animation: fadeInUp 0.5s ease-out both;
}

.set-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 55px;
}

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

/* 로또 공 스타일 - 실제 로또 공처럼 */
.lotto-ball {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  animation: ballBounce 0.5s ease-out both;
  position: relative;
  box-shadow:
    inset -3px -3px 8px rgba(0,0,0,0.3),
    inset 3px 3px 8px rgba(255,255,255,0.2),
    0 4px 12px rgba(0,0,0,0.3);
}

.lotto-ball::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 12px;
  width: 12px;
  height: 8px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  transform: rotate(-30deg);
}

@keyframes ballBounce {
  0% {
    opacity: 0;
    transform: scale(0) translateY(-50px);
  }
  60% {
    transform: scale(1.2) translateY(0);
  }
  80% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 번호별 색상 - 실제 로또 색상 */
.ball-yellow {
  background: linear-gradient(145deg, #fcd34d, #f59e0b);
}
.ball-blue {
  background: linear-gradient(145deg, #60a5fa, #2563eb);
}
.ball-red {
  background: linear-gradient(145deg, #f87171, #dc2626);
}
.ball-gray {
  background: linear-gradient(145deg, #9ca3af, #4b5563);
}
.ball-green {
  background: linear-gradient(145deg, #34d399, #059669);
}

/* 로딩 */
.loading {
  text-align: center;
  padding: 40px;
  margin-top: 24px;
}

.loading p {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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

.hidden {
  display: none !important;
}

/* 자주 찾는 꿈 해몽 섹션 */
.popular-dreams {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.popular-dreams h2 {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.dream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.dream-card {
  display: block;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.dream-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 25px rgba(88, 166, 255, 0.15);
}

.dream-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.dream-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.dream-card .read-more {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

/* 로고 링크 */
.logo-link {
  text-decoration: none;
}

.logo-link h1 {
  transition: opacity 0.2s;
}

.logo-link:hover h1 {
  opacity: 0.8;
}

/* 뒤로가기 링크 */
.back-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 24px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent-hover);
}

/* 꿈 해몽 상세 페이지 */
.dream-article {
  margin-bottom: 40px;
}

.dream-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.dream-summary {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.7;
}

.dream-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.dream-tag {
  background: var(--bg-tertiary);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.interpretation-section {
  margin-bottom: 40px;
}

/* 꿈 해몽 CTA */
.dream-cta {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid var(--gradient-start);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  margin-bottom: 40px;
}

.dream-cta h3 {
  font-size: 1.4rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.dream-cta p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.cta-link {
  display: inline-block;
  width: auto;
  padding: 14px 32px;
  text-decoration: none;
}

/* 관련 꿈 해몽 */
.related-dreams {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.related-dreams h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-primary);
}

/* 서비스 소개 페이지 */
.about-content {
  margin-bottom: 40px;
}

.about-content h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-align: center;
}

.about-tagline {
  text-align: center;
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 48px;
}

.about-section {
  margin-bottom: 48px;
}

.about-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gradient-start);
}

.about-text {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}

.about-text p {
  color: var(--text-primary);
  line-height: 1.9;
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-text blockquote {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border-left: 4px solid var(--gradient-start);
  padding: 20px 24px;
  margin: 24px 0;
  border-radius: 0 12px 12px 0;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--accent);
}

.service-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
}

.service-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
}

.service-card p {
  color: var(--text-primary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.service-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.service-card li {
  color: var(--text-primary);
  line-height: 1.8;
  margin-bottom: 12px;
  padding-left: 24px;
  position: relative;
}

.service-card li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: bold;
}

.process-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: 12px;
}

.step-number {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.step-content strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.6;
}

.tech-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.tech-item {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.2s;
}

.tech-item:hover {
  border-color: var(--accent);
}

.tech-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.tech-text h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.tech-text p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

.responsible-section h2 {
  color: #fbbf24;
  border-bottom-color: #fbbf24;
}

.responsible-box {
  display: flex;
  gap: 24px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.1));
  border: 2px solid #fbbf24;
  border-radius: 20px;
  padding: 32px;
}

.responsible-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.responsible-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 16px;
}

.responsible-content p {
  color: var(--text-primary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.responsible-content ul {
  list-style: disc;
  margin-left: 24px;
  margin-bottom: 16px;
}

.responsible-content li {
  color: var(--text-primary);
  line-height: 1.8;
  margin-bottom: 8px;
}

.helpline {
  background: var(--bg-tertiary);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
}

/* 법적 콘텐츠 페이지 */
.legal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
}

.legal-content h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.legal-content .last-updated {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.legal-content section {
  margin-bottom: 32px;
}

.legal-content section:last-child {
  margin-bottom: 0;
}

.legal-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
}

.legal-content p {
  color: var(--text-primary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.legal-content ul {
  list-style: disc;
  margin-left: 24px;
  margin-bottom: 12px;
}

.legal-content li {
  color: var(--text-primary);
  line-height: 1.8;
  margin-bottom: 8px;
}

.legal-content li strong {
  color: var(--text-primary);
}

/* 푸터 */
footer {
  margin-top: 60px;
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.footer-links {
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover,
.footer-links a.active {
  color: var(--accent);
}

.footer-links .divider {
  color: var(--border);
  margin: 0 12px;
}

footer p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.copyright {
  margin-top: 12px;
  font-size: 0.8rem;
}

/* 반응형 */
@media (max-width: 600px) {
  .container {
    padding: 24px 16px;
  }

  header h1 {
    font-size: 2rem;
  }

  .result-card {
    padding: 20px;
  }

  .result-content {
    font-size: 1rem;
    line-height: 1.9;
  }

  .lotto-cta-btn {
    padding: 20px 24px;
  }

  .btn-text {
    font-size: 1.1rem;
  }

  .lotto-ball {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .lotto-set {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .set-label {
    width: 100%;
    text-align: left;
  }

  .lotto-balls {
    width: 100%;
    justify-content: center;
  }

  .ad-section {
    padding: 30px 20px;
  }

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

  .dream-title {
    font-size: 1.6rem;
  }

  .legal-content {
    padding: 24px;
  }

  .legal-content h1 {
    font-size: 1.6rem;
  }

  .dream-cta {
    padding: 24px;
  }

  .about-content h1 {
    font-size: 1.8rem;
  }

  .about-section h2 {
    font-size: 1.3rem;
  }

  .about-text,
  .service-card {
    padding: 20px;
  }

  .tech-features {
    grid-template-columns: 1fr;
  }

  .responsible-box {
    flex-direction: column;
    text-align: center;
    padding: 24px;
  }

  .responsible-content ul {
    text-align: left;
  }
}
