:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --border: #dee2e6;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f4ff;
  color: var(--dark);
  line-height: 1.6;
}

/* ---- NAVBAR ---- */
.navbar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(26,115,232,0.3);
  position: sticky; top: 0; z-index: 100;
}
.navbar-brand { font-size: 1.3rem; font-weight: 700; text-decoration: none; color: white; }
.navbar-links a { color: rgba(255,255,255,0.9); text-decoration: none; margin-left: 1.5rem; font-weight: 500; }
.navbar-links a:hover { color: white; }

/* ---- HERO ---- */
.hero {
  background: linear-gradient(135deg, var(--primary), #7b2ff7);
  color: white;
  padding: 3rem 1.5rem;
  text-align: center;
}
.hero h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 0.5rem; }
.hero p { font-size: 1.1rem; opacity: 0.9; max-width: 600px; margin: 0 auto; }

/* ---- CARDS ---- */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card:hover { box-shadow: var(--shadow-hover); }

/* ---- CONTAINER ---- */
.container { max-width: 960px; margin: 0 auto; padding: 1.5rem; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border: none; border-radius: 8px;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #218838; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.4rem; color: #444; }
.form-control {
  width: 100%; padding: 0.7rem 1rem;
  border: 2px solid var(--border); border-radius: 8px;
  font-size: 0.95rem; transition: border-color 0.2s;
  background: white;
}
.form-control:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(26,115,232,0.1); }

/* ---- BADGES ---- */
.badge {
  display: inline-block; padding: 0.25rem 0.65rem;
  border-radius: 20px; font-size: 0.8rem; font-weight: 600;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-primary { background: #cce5ff; color: #004085; }

/* ---- PRIZE CARD ---- */
.prize-card {
  background: linear-gradient(135deg, #fff9e6, #fff3cc);
  border: 2px solid #ffd700;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
  display: flex; align-items: center; gap: 1rem;
}
.prize-position {
  background: #ffd700;
  color: #333;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; flex-shrink: 0;
}

/* ---- PIX BOX ---- */
.pix-box {
  background: #f0f8ff;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}
.pix-qr { max-width: 220px; margin: 1rem auto; border-radius: 10px; border: 4px solid white; box-shadow: var(--shadow); }
.pix-code {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 0.75rem;
  font-family: monospace;
  font-size: 0.8rem;
  word-break: break-all;
  margin: 1rem 0;
  text-align: left;
}

/* ---- NUMBER DISPLAY ---- */
.number-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 1rem; }
.number-chip {
  background: linear-gradient(135deg, #e8f0fe, #c7d2fe);
  border: 2px solid var(--primary);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-weight: 700; font-size: 1rem;
  color: var(--primary-dark);
}

/* ---- AUTOCOMPLETE ---- */
.autocomplete-wrapper { position: relative; }
.autocomplete-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  background: white; border: 2px solid var(--primary); border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 200px; overflow-y: auto;
  z-index: 1000; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.autocomplete-item {
  padding: 0.65rem 1rem; cursor: pointer; border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.autocomplete-item:hover, .autocomplete-item.selected { background: #e8f0fe; }
.autocomplete-item:last-child { border-bottom: none; }

/* ---- PROGRESS BAR ---- */
.progress { height: 12px; background: #e9ecef; border-radius: 6px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), #7b2ff7); border-radius: 6px; transition: width 0.5s; }

/* ---- RANKING ---- */
.ranking-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.ranking-item:last-child { border-bottom: none; }
.rank-position {
  font-size: 1.3rem; font-weight: 800; min-width: 36px;
  color: var(--primary);
}
.rank-position.gold { color: #ffd700; }
.rank-position.silver { color: #c0c0c0; }
.rank-position.bronze { color: #cd7f32; }
.rank-info { flex: 1; }
.rank-name { font-weight: 700; }
.rank-class { font-size: 0.85rem; color: var(--gray); }
.rank-count { font-size: 1.1rem; font-weight: 700; color: var(--primary); white-space: nowrap; }

/* ---- STATUS INDICATOR ---- */
.status-indicator {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.9rem;
}
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.status-dot.green { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.yellow { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.status-dot.red { background: var(--danger); box-shadow: 0 0 6px var(--danger); }

/* ---- ALERTS ---- */
.alert {
  padding: 1rem 1.2rem; border-radius: 8px;
  margin-bottom: 1rem; font-weight: 500;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* ---- TABS ---- */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab-btn {
  padding: 0.75rem 1.2rem; cursor: pointer;
  border: none; background: none;
  font-weight: 600; color: var(--gray);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: all 0.2s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---- LOADING ---- */
.spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.6rem; }
  .container { padding: 1rem; }
  .navbar { padding: 0.8rem 1rem; }
  .navbar-links { display: none; }
  .pix-qr { max-width: 180px; }
  .btn-lg { font-size: 1rem; padding: 0.75rem 1.5rem; }
}

/* ---- COPY BUTTON ---- */
.copy-btn {
  cursor: pointer; background: var(--primary); color: white;
  border: none; border-radius: 6px; padding: 0.4rem 0.8rem;
  font-size: 0.85rem; font-weight: 600;
  transition: all 0.2s;
}
.copy-btn:hover { background: var(--primary-dark); }
.copy-btn.copied { background: var(--success); }

/* ---- SECTION TITLE ---- */
.section-title {
  font-size: 1.4rem; font-weight: 700;
  color: var(--dark); margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--primary);
  display: inline-block;
}

/* ---- SHARE BUTTON ---- */
.share-btn {
  background: #25d366; color: white;
  border: none; border-radius: 8px;
  padding: 0.65rem 1.2rem;
  font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none;
}
.share-btn:hover { background: #128c7e; }
