/* PlaybetNow — landing + modal + shared rules styles
   Palette: deep navy (#0b1220) with PlaybetNow blue (#4299e1 / #3182ce). */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  background: #0b1220;
  color: #fff;
}

/* ─── Hero + rotating backgrounds ──────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #0b1220;
}

.bg-container {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.6s ease-in-out, transform 7s ease-out;
  will-change: opacity;
}

.bg-slide.active {
  opacity: 1;
  transform: scale(1);
}

/* Darkening + blue gradient scrim so foreground stays legible over any photo */
.bg-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 10%, rgba(11, 18, 32, 0.25) 0%, rgba(11, 18, 32, 0.72) 70%, rgba(11, 18, 32, 0.9) 100%),
    linear-gradient(180deg, rgba(11, 18, 32, 0.55) 0%, rgba(11, 18, 32, 0.35) 45%, rgba(11, 18, 32, 0.85) 100%);
}

.overlay {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 96px 20px calc(96px + env(safe-area-inset-bottom));
  gap: 36px;
}

/* ─── Brand ────────────────────────────────────────────────────── */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.logo {
  margin: 0;
  font-size: clamp(2.6rem, 9vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.55);
}

.logo .blue {
  color: #4299e1;
}

.tagline {
  margin: 0;
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(226, 232, 240, 0.82);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* ─── Top bar / language toggle ────────────────────────────────── */
.top-bar {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top));
  right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(11, 18, 32, 0.55);
  border: 1px solid rgba(66, 153, 225, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lang-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgba(226, 232, 240, 0.55);
  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(66, 153, 225, 0.28);
  color: #e8f3ff;
}

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

/* ─── Buttons ──────────────────────────────────────────────────── */
.buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 300px;
}

.btn {
  width: 100%;
  min-width: 240px;
  padding: 15px 22px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e8f3ff;
  background: rgba(20, 30, 48, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 6px 20px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(66, 153, 225, 0.5);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
}

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

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.45);
}

.btn.primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #4299e1, #3182ce);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 8px 24px rgba(49, 130, 206, 0.4);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #4aa5ef, #3a8fdc);
  box-shadow: 0 12px 30px rgba(49, 130, 206, 0.5);
}

/* ─── Modal ────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 9, 18, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 16px;
}

.modal.open {
  display: flex;
}

.modal-card {
  position: relative;
  width: min(400px, 100%);
  border-radius: 16px;
  padding: 28px 24px 24px;
  background: rgba(20, 25, 35, 0.97);
  border: 1px solid rgba(66, 153, 225, 0.22);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: modal-pop 0.25s ease-out;
}

@keyframes modal-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: rgba(144, 205, 244, 0.75);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
}

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

.modal-title {
  margin: 0;
  padding-right: 40px;
  font-size: 1.7rem;
  font-weight: 800;
  color: #f8fafc;
}

.modal-text {
  margin: 8px 0 20px;
  color: rgba(203, 213, 225, 0.72);
  font-size: 0.95rem;
  line-height: 1.55;
}

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

.field label {
  color: #e2e8f0;
  font-weight: 500;
  font-size: 0.88rem;
}

.field input {
  width: 100%;
  border-radius: 8px;
  border: 2px solid #374151;
  background: #1f2937;
  color: #ffffff;
  padding: 12px 14px;
  outline: none;
  font-size: 16px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.field input::placeholder {
  color: #9ca3af;
}

.field input:focus {
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.22);
}

.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(144, 205, 244, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s;
}

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

.modal-actions {
  margin-top: 6px;
}

.modal-actions .btn {
  min-width: 0;
}

.login-error {
  color: #fca5a5;
  margin-top: 12px;
  min-height: 20px;
  font-size: 0.9rem;
  display: none;
}

.login-error.show {
  display: block;
}

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

.animate-fade-in-up {
  animation: fade-in-up 0.7s ease-out both;
}

.delay-200 { animation-delay: 0.18s; }

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

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

@media (prefers-reduced-motion: reduce) {
  .bg-slide,
  .animate-fade-in-down,
  .animate-fade-in-up,
  .modal-card {
    animation: none;
    transition: opacity 0.4s ease;
    transform: none;
  }
}

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 520px) {
  .btn { min-width: 0; }
  .overlay { gap: 28px; padding: 84px 20px calc(72px + env(safe-area-inset-bottom)); }
}

@media (max-width: 768px) {
  .top-bar {
    top: calc(14px + env(safe-area-inset-top));
    right: 14px;
  }
  .modal {
    align-items: flex-start;
    padding: calc(env(safe-area-inset-top) + 16px) 14px 14px;
    overflow-y: auto;
  }
  .modal-card {
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
  }
  .modal-title { font-size: 1.5rem; }
}

/* ─── 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;
  }
}
