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

:root {
  --bg: #0f0f1a;
  --bg-card: rgba(255,255,255,0.05);
  --text: #e0e0e0;
  --text-secondary: #aaa;
  --heading: #fff;
  --border: rgba(255,255,255,0.1);
  --header-bg: rgba(15,15,26,0.95);
  --input-bg: rgba(255,255,255,0.08);
  --input-border: rgba(255,255,255,0.15);
  --placeholder: rgba(255,255,255,0.4);
}

body.light {
  --bg: #f5f5fa;
  --bg-card: #fff;
  --text: #333;
  --text-secondary: #666;
  --heading: #1a1a2e;
  --border: rgba(0,0,0,0.1);
  --header-bg: rgba(245,245,250,0.95);
  --input-bg: #fff;
  --input-border: #ccc;
  --placeholder: #999;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: #e84118;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--heading);
  background: var(--bg-card);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 1.1rem;
  cursor: pointer;
  background: transparent;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

/* Main */
.main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero h1 {
  color: var(--heading);
  font-size: 2.2rem;
  margin-bottom: 12px;
  transition: color 0.3s;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Sections */
.section {
  margin-bottom: 48px;
}

.content-section h2 {
  color: var(--heading);
  font-size: 1.5rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  transition: color 0.3s;
}

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

/* Draw Section */
.draw-section {
  text-align: center;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 40px 20px;
  border: 1px solid var(--border);
}

.balls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
  min-height: 70px;
}

.ball {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: inset 0 -3px 5px rgba(0,0,0,0.2), 0 3px 10px rgba(0,0,0,0.3);
  animation: pop 0.4s ease;
}

.ball.bonus {
  margin-left: 18px;
  position: relative;
}

.ball.bonus::before {
  content: '+';
  position: absolute;
  left: -18px;
  color: var(--text-secondary);
  font-size: 1.3rem;
}

.range-1  { background: #fbc531; }
.range-10 { background: #4cd137; }
.range-20 { background: #e84118; }
.range-30 { background: #9c88ff; }
.range-40 { background: #00a8ff; }

button#drawBtn {
  padding: 14px 48px;
  font-size: 1.15rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #e84118, #c23616);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(232,65,24,0.4);
}

button#drawBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232,65,24,0.5);
}

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

/* History */
.history {
  margin-top: 24px;
  text-align: left;
}

.history-title {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 8px;
  text-align: center;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  margin-bottom: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

body.light .history-item {
  background: rgba(0,0,0,0.03);
}

.history-ball {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.history-ball.bonus {
  margin-left: 10px;
  position: relative;
}

.history-ball.bonus::before {
  content: '+';
  position: absolute;
  left: -10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-4px);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e84118, #c23616);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 14px;
}

.card h3 {
  color: var(--heading);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

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

/* Article */
.article h2 {
  color: var(--heading);
  font-size: 1.4rem;
  margin-top: 32px;
  margin-bottom: 12px;
}

.article h3 {
  color: var(--heading);
  font-size: 1.15rem;
  margin-top: 24px;
  margin-bottom: 8px;
}

.article p {
  margin-bottom: 14px;
  line-height: 1.8;
}

.article ul, .article ol {
  margin: 12px 0 16px 24px;
}

.article li {
  margin-bottom: 6px;
  line-height: 1.7;
}

.article a {
  color: #e84118;
  text-decoration: none;
}

.article a:hover {
  text-decoration: underline;
}

/* Table */
.info-table-wrap {
  overflow-x: auto;
  margin: 16px 0 20px;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.info-table th,
.info-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.info-table th {
  color: var(--heading);
  font-weight: 600;
  background: var(--bg-card);
}

.info-table td {
  color: var(--text);
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--heading);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.faq-item summary::before {
  content: '+';
  font-size: 1.2rem;
  color: #e84118;
  font-weight: 700;
  flex-shrink: 0;
}

.faq-item[open] summary::before {
  content: '-';
}

.faq-item p {
  padding: 0 20px 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 500px;
  margin: 0 auto;
}

.form-label {
  color: var(--heading);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 10px;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  padding: 12px 16px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--placeholder);
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  border-color: #e84118;
}

.submit-btn {
  margin-top: 12px;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #9c88ff, #6c5ce7);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(108,92,231,0.4);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108,92,231,0.5);
}

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

/* Ad Banner */
.ad-banner {
  margin: 32px 0;
  padding: 10px 0;
  text-align: center;
}

/* Disqus */
#disqus_thread {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

/* Footer */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 40px 20px;
  text-align: center;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

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

.footer-links a:hover {
  color: var(--heading);
}

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

.footer-disclaimer {
  color: var(--text-secondary);
  font-size: 0.8rem;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.7;
}

/* Legal pages */
.legal h2 {
  font-size: 1.25rem;
}

/* Responsive */
@media (max-width: 640px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
  }

  .nav-link {
    font-size: 0.82rem;
    padding: 5px 10px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero-desc {
    font-size: 0.95rem;
  }

  .ball {
    width: 52px;
    height: 52px;
    font-size: 1.15rem;
  }

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

@keyframes pop {
  0%   { transform: scale(0); opacity: 0; }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
