:root {
  --bg-color: #0d1117;
  --card-bg: rgba(22, 27, 34, 0.75);
  --card-border: rgba(255, 255, 255, 0.1);
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --accent-gold: #ffb703;
  --accent-gold-glow: rgba(255, 183, 3, 0.4);
  --accent-cyan: #00f2fe;
  --primary-btn: linear-gradient(135deg, #4f46e5, #7c3aed);
  --primary-btn-hover: linear-gradient(135deg, #4338ca, #6d28d9);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Noto Sans KR', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-x: hidden;
  position: relative;
}

/* Background Animated Glows */
.background-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.background-glow::before,
.background-glow::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
}

.background-glow::before {
  width: 450px;
  height: 450px;
  background: #7c3aed;
  top: -100px;
  left: -100px;
  animation: float 12s infinite alternate ease-in-out;
}

.background-glow::after {
  width: 400px;
  height: 400px;
  background: #ffb703;
  bottom: -100px;
  right: -100px;
  animation: float 10s infinite alternate-reverse ease-in-out;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 80px) scale(1.2); }
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 8px;
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.logo-icon {
  color: var(--accent-gold);
  font-size: 2.4rem;
  filter: drop-shadow(0 0 10px var(--accent-gold-glow));
}

.logo .highlight {
  background: linear-gradient(135deg, #ffb703, #fb8500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 6px;
}

/* Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

/* Mode Selector */
.mode-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mode-btn:hover {
  color: var(--text-main);
}

.mode-btn.active {
  background: var(--card-border);
  color: var(--accent-gold);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Custom Options Panel */
.custom-options {
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.custom-options.hidden {
  display: none;
}

.option-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.number-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
  padding-right: 4px;
}

.num-tag {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.num-tag:hover {
  border-color: var(--accent-gold);
  color: var(--text-main);
}

.num-tag.selected-inc {
  background: #ffb703;
  color: #000;
  border-color: #ffb703;
  font-weight: 700;
}

.num-tag.selected-exc {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  font-weight: 700;
}

/* Display Section & Lotto Balls */
.display-section {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 24px;
}

.lotto-game-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lotto-game-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  animation: fadeInRow 0.4s ease forwards;
}

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

.game-tag {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--accent-gold);
  min-width: 70px;
}

.balls-container {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ball-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1.1rem;
}

/* Styled Lotto Balls */
.lotto-ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: inset -3px -3px 6px rgba(0, 0, 0, 0.4),
              inset 3px 3px 6px rgba(255, 255, 255, 0.4),
              0 6px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  transform: scale(0);
  animation: popInBall 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popInBall {
  0% { transform: scale(0) rotate(-180deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Standard Ball Color Ranges */
.ball-range-1 {
  background: linear-gradient(135deg, #f7b731, #eb3b5a); /* 1~10 Yellow/Orange */
  background: linear-gradient(135deg, #ffc107, #ff9800);
  color: #111;
  text-shadow: none;
}

.ball-range-2 {
  background: linear-gradient(135deg, #4b6cb7, #182848); /* 11~20 Blue */
  background: linear-gradient(135deg, #2196f3, #0d47a1);
}

.ball-range-3 {
  background: linear-gradient(135deg, #ff416c, #ff4b2b); /* 21~30 Red */
  background: linear-gradient(135deg, #f44336, #b71c1c);
}

.ball-range-4 {
  background: linear-gradient(135deg, #8e44ad, #4a00e0); /* 31~40 Purple */
  background: linear-gradient(135deg, #9c27b0, #4a148c);
}

.ball-range-5 {
  background: linear-gradient(135deg, #11998e, #38ef7d); /* 41~45 Green */
  background: linear-gradient(135deg, #4caf50, #1b5e20);
}

/* Control Panel */
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game-count-group {
  display: flex;
  gap: 8px;
}

.count-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.count-btn.active {
  background: rgba(124, 58, 237, 0.2);
  border-color: #7c3aed;
  color: var(--text-main);
}

.btn {
  border: none;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.btn-primary {
  background: var(--primary-btn);
  color: #fff;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35);
  font-size: 1.1rem;
}

.btn-primary:hover {
  background: var(--primary-btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.5);
}

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

.utility-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  font-size: 0.9rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Luck Banner */
.luck-banner {
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.15), rgba(247, 127, 0, 0.1));
  border: 1px solid rgba(255, 183, 3, 0.3);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  animation: fadeIn 0.4s ease;
}

.luck-banner.hidden {
  display: none;
}

.luck-score-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.score-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #ffb703;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  box-shadow: 0 0 15px var(--accent-gold-glow);
  flex-shrink: 0;
}

.score-circle small {
  font-size: 0.75rem;
  margin-left: 2px;
}

.score-info h4 {
  font-size: 1rem;
  color: var(--accent-gold);
  margin-bottom: 2px;
}

.score-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* History Card */
.history-card {
  padding: 24px;
}

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

.card-header h3 {
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.btn-text:hover {
  color: #ef4444;
}

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

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

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

.history-ball {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.history-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.empty-msg {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 20px 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.9rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 999;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Footer */
.app-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

/* Contact Form Section */
.contact-card {
  padding: 28px;
}

.contact-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

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

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

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

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.25s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
  background: rgba(0, 0, 0, 0.45);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.form-group select option {
  background: #161b22;
  color: var(--text-main);
}

.submit-contact-btn {
  margin-top: 8px;
  width: 100%;
}

.footer-link {
  color: var(--accent-gold);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-link:hover {
  text-decoration: underline;
  color: #ffc107;
}

/* Disqus Comments Section */
.comments-card {
  padding: 28px;
  min-height: 250px;
}

#disqus_thread {
  margin-top: 16px;
}


/* Responsive adjustments */
@media (max-width: 520px) {
  .card {
    padding: 20px 16px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .balls-container {
    gap: 6px;
  }
  .lotto-ball, .ball-placeholder {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }
  .game-tag {
    min-width: 50px;
    font-size: 0.8rem;
  }
}

