* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: "Segoe UI", "Inter", sans-serif;
  background: #000;
}

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

#particleCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  color: #fff;
  text-align: center;
  padding: 28px 20px 140px;
  pointer-events: none;
}

.overlay > * {
  pointer-events: auto;
}

/* ─── Top Bar ──────────────────────────────────────────────────── */
.top-bar {
  position: absolute;
  top: 28px;
  right: 20px;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.38);
  color: #fee2e2;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

/* ─── Language Toggle ──────────────────────────────────────────── */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.lang-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgba(254, 226, 226, 0.5);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-btn.active {
  background: rgba(239, 68, 68, 0.22);
  color: #fee2e2;
}

.lang-btn:hover:not(.active) {
  color: #fca5a5;
}

/* ─── Buttons ──────────────────────────────────────────────────── */
.buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: transparent;
}

.btn {
  min-width: 240px;
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(220, 248, 255, 0.90);
  background: linear-gradient(135deg, rgba(0, 220, 255, 0.07) 0%, rgba(0, 140, 200, 0.03) 100%);
  -webkit-backdrop-filter: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 2px 12px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn::before {
  display: none;
}

.btn:hover {
  transform: translateY(-1px) scale(1.02);
  background: linear-gradient(135deg, rgba(0, 220, 255, 0.12) 0%, rgba(0, 140, 200, 0.06) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 2px 16px rgba(0, 0, 0, 0.10);
}

.btn:active {
  transform: translateY(0) scale(0.99);
}

.btn.primary {
  border-color: rgba(0, 210, 255, 0.32);
  color: #e8f9ff;
  background: linear-gradient(135deg, rgba(0, 220, 255, 0.12) 0%, rgba(0, 150, 220, 0.05) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 2px 12px rgba(0, 0, 0, 0.10);
}

.btn.primary:hover {
  background: linear-gradient(135deg, rgba(0, 220, 255, 0.18) 0%, rgba(0, 160, 220, 0.09) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 2px 16px rgba(0, 0, 0, 0.10);
}

.btn.secondary {
  color: rgba(200, 242, 255, 0.80);
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(0, 200, 255, 0.04) 0%, rgba(0, 120, 200, 0.02) 100%);
}

.btn.secondary:hover {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.09) 0%, rgba(0, 140, 220, 0.04) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 2px 12px rgba(0, 0, 0, 0.10);
}

/* ─── Modal ────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  padding: 16px;
}

.modal.open {
  display: flex;
}

.modal-card {
  position: relative;
  width: min(380px, 100%);
  border-radius: 16px;
  padding: 20px;
  background: linear-gradient(160deg, rgba(0, 30, 35, 0.92) 0%, rgba(0, 20, 28, 0.96) 100%);
  border: 1px solid rgba(0, 200, 180, 0.22);
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(0, 220, 200, 0.12);
}

.modal-close {
  position: absolute;
  top: 4px;
  right: 8px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 0;
  background: transparent;
  color: rgba(0, 220, 200, 0.7);
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  z-index: 20;
  pointer-events: auto;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #ffffff;
}

.modal-title {
  margin: 0;
  padding-right: 56px;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #f8fafc;
}

.modal-text {
  margin: 10px 0 0;
  color: rgba(200, 242, 240, 0.6);
  font-size: 0.97rem;
  line-height: 1.7;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.field label {
  color: rgba(100, 240, 255, 0.92);
  font-size: 0.88rem;
}

.field input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(0, 180, 160, 0.30);
  background: rgba(0, 20, 25, 0.80);
  color: #e0faf8;
  padding: 10px 12px;
  outline: none;
  font-size: 16px;
}

.field input:focus {
  border-color: rgba(0, 200, 180, 0.80);
  box-shadow: 0 0 0 3px rgba(0, 200, 180, 0.18);
}

.field-password {
  position: relative;
}

.field-password .input-wrap {
  position: relative;
}

.field-password input {
  padding-right: 44px;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: rgba(0, 210, 190, 0.70);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.toggle-password:hover {
  opacity: 1;
}

.modal-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

/* ─── Animations ───────────────────────────────────────────────── */
.animate-fade-in-down {
  animation: fade-in-down 0.8s ease-out forwards;
}

.animate-fade-in-up {
  opacity: 0;
  animation: fade-in-up 0.8s ease-out forwards;
}

.delay-200 { animation-delay: 0.2s; }
.delay-400 { animation-delay: 0.4s; }
.delay-600 { animation-delay: 0.6s; }
.delay-800 { animation-delay: 0.8s; }

@keyframes fade-in-down {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 520px) {
  .btn {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .overlay {
    padding: 28px 20px 120px;
  }

  .top-bar {
    position: absolute;
    top: 16px;
    right: 16px;
    width: auto;
  }

  .buttons {
    width: 100%;
    padding: 0 12px;
  }

  .modal {
    align-items: flex-start;
    justify-content: center;
    padding: calc(env(safe-area-inset-top) + 14px) 14px 14px;
    overflow-y: auto;
  }

  .modal-card {
    margin: 0 auto;
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
  }

  .modal-title {
    font-size: 1.55rem;
  }

  .btn {
    font-size: 1.1rem;
    padding: 14px 20px;
  }
}

/* ─── Rules pages (shared) ─────────────────────────────────────── */
.rules-page {
  max-width: 720px;
  margin: 0 auto;
}

.rules-accordion {
  display: grid;
  gap: 12px;
}

.rules-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: #0f1726;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.rules-item:hover {
  border-color: rgba(148, 163, 184, 0.22);
}

.rules-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 20px 22px;
  border: 0;
  background: transparent;
  color: #e6edf6;
  text-align: left;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: background 0.2s ease;
}

.rules-trigger:hover,
.rules-trigger:focus-visible {
  background: rgba(148, 163, 184, 0.06);
  outline: none;
}

.rules-trigger-text {
  display: block;
  flex: 1;
  font-size: 1.03rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.rules-trigger-chevron {
  flex-shrink: 0;
  margin-left: 12px;
  color: #9fb1c7;
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.rules-trigger[aria-expanded="true"] .rules-trigger-chevron {
  transform: rotate(180deg);
}

.rules-panel {
  display: none;
  position: relative;
  z-index: 1;
  padding: 0 18px 18px 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}

.rules-panel-inner {
  margin: 0 4px 4px;
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: #10192a;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.rules-panel-title {
  margin: 0 0 10px;
  color: #f8fafc;
  font-size: 1.02rem;
  font-weight: 700;
}

.rules-panel-note {
  margin: 0 0 12px;
  color: #b4c0d1;
  font-size: 0.92rem;
  line-height: 1.6;
}

.rules-accent {
  color: #9fb7d2;
}

.rules-accent-letter {
  color: #9fb7d2;
  font-weight: 800;
}

.rules-subsection {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.rules-subsection-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.rules-subsection-title {
  margin: 0;
  color: #d7e1ee;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rules-subsection-toggle::after {
  content: "+";
  color: #c7d3e3;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.rules-subsection.open .rules-subsection-toggle::after {
  content: "-";
}

.rules-subsection-content {
  display: none;
  padding-top: 12px;
}

.rules-subsection.open .rules-subsection-content {
  display: block;
}

.rules-list {
  margin: 0;
  padding-left: 20px;
  color: #e2e8f0;
  font-size: 0.93rem;
  line-height: 1.7;
}

.rules-list li + li {
  margin-top: 8px;
}

.rules-list.columns-2 {
  column-count: 2;
  column-gap: 28px;
  padding-left: 18px;
}

.rules-list.columns-2 li {
  break-inside: avoid;
  page-break-inside: avoid;
}

.rules-content p {
  margin: 0 0 12px;
  color: #c8d4e2;
  font-size: 0.93rem;
  line-height: 1.7;
}

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

.rules-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.88rem;
  color: #c8d4e2;
}

.rules-content th {
  text-align: left;
  padding: 8px 12px;
  background: rgba(148, 163, 184, 0.1);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  font-weight: 700;
  color: #e2e8f0;
}

.rules-content td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.rules-content ul,
.rules-content ol {
  margin: 8px 0;
  padding-left: 20px;
  color: #c8d4e2;
  font-size: 0.93rem;
  line-height: 1.7;
}

.rules-content em {
  color: #94a3b8;
  font-style: italic;
}

@media (max-width: 768px) {
  .rules-list.columns-2 {
    column-count: 1;
    column-gap: 0;
  }
}
