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

:root {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --surface-2: #22223a;
  --border: #2d2d4a;
  --primary: #7c3aed;
  --primary-light: #a78bfa;
  --primary-glow: rgba(124, 58, 237, 0.4);
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.3);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --success: #10b981;
  --radius: 16px;
  --radius-sm: 10px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.bg-pattern {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-size: 1.05rem;
}

.privacy-notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.privacy-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--primary-light);
}

.privacy-list {
  margin: 0 0 1rem 1.1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.privacy-list li {
  margin-bottom: 0.4rem;
}

.privacy-list strong {
  color: var(--text);
  font-weight: 600;
}

.privacy-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}

.privacy-consent input {
  margin-top: 0.2rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.upload-area--disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  max-width: min(90vw, 420px);
  text-align: center;
  font-size: 0.95rem;
  z-index: 200;
  animation: toastIn 0.25s ease-out;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 3.5rem 2rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.upload-icon {
  color: var(--primary-light);
  margin-bottom: 0.5rem;
}

.upload-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.upload-hint {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.upload-formats {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0.35rem 1rem;
  border-radius: 999px;
}

.template-download {
  margin-top: 1.5rem;
  text-align: center;
}

.template-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.btn-template {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.btn-template:hover {
  border-color: var(--primary);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.btn-template svg {
  color: var(--primary-light);
}

.hidden {
  display: none !important;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-light);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 420px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
}

.table-wrapper::-webkit-scrollbar {
  width: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: var(--bg);
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(124, 58, 237, 0.05);
}

.data-table .num-col {
  font-weight: 600;
  color: var(--primary-light);
  width: 80px;
}

.data-table .empty-row td {
  color: var(--text-muted);
  font-style: italic;
}

.actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #6d28d9 100%);
  color: white;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 28px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border);
}

.draw-section {
  text-align: center;
}

.draw-animation {
  padding: 3rem 1rem;
}

.slot-machine {
  display: inline-block;
}

.slot-window {
  background: var(--surface);
  border: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 2rem 3rem;
  box-shadow: 0 0 40px var(--primary-glow), inset 0 0 30px rgba(0, 0, 0, 0.3);
  min-width: 200px;
}

.slot-number {
  font-size: 5rem;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent-glow);
  transition: transform 0.05s;
}

.slot-number.shake {
  animation: shake 0.1s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px) rotate(-1deg); }
  75% { transform: translateX(4px) rotate(1deg); }
}

.slot-label {
  margin-top: 1.25rem;
  font-size: 1.1rem;
  color: var(--text-muted);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.winner-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  animation: revealWinner 0.6s ease-out;
}

.winner-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.winner-close:hover {
  color: var(--text);
  border-color: var(--primary);
  background: var(--border);
}

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

.winner-badge {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
}

.winner-number {
  font-size: 4.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent) 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2rem;
  line-height: 1;
}

.winner-details {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 2rem;
  text-align: left;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.winner-field {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
}

.field-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.field-value {
  font-size: 1.15rem;
  font-weight: 600;
}

.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  to {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .header h1 {
    font-size: 1.75rem;
  }

  .stats-bar {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .slot-number {
    font-size: 3.5rem;
  }

  .winner-number {
    font-size: 3rem;
  }
}

.seo-content {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.seo-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-light);
  margin: 1.5rem 0 0.75rem;
}

.seo-content h2:first-child {
  margin-top: 0;
}

.seo-content p,
.seo-content li {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.seo-content ul {
  margin-left: 1.25rem;
}

.seo-content li {
  margin-bottom: 0.4rem;
}

.seo-content strong {
  color: var(--text);
  font-weight: 600;
}

.faq-item {
  border-top: 1px solid var(--border);
  padding: 0.85rem 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: '+ ';
  color: var(--primary-light);
}

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

.faq-item p {
  margin-top: 0.5rem;
  padding-left: 1rem;
}
