:root {
  --bg: #050309;
  --surface: #0e0e1a;
  --surface-2: rgba(255, 255, 255, 0.04);
  --text: #f9f9f9;
  --text-2: #c7c7c7;
  --muted: #9494a8;
  --purple: #7a6bff;
  --purple-16: rgba(122, 107, 255, 0.16);
  --purple-22: rgba(122, 107, 255, 0.22);
  --line: rgba(255, 255, 255, 0.08);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

a {
  color: var(--purple);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.sport-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.sport-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(122, 107, 255, 0.11) 0%,
    rgba(122, 107, 255, 0.05) 40%,
    transparent 72%
  );
}

.header-wash {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 320px;
  background: radial-gradient(ellipse 70% 100% at 50% 0%, rgba(122, 107, 255, 0.22), transparent 70%);
}

.legal-app {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 20px 64px;
  min-height: 100vh;
}

.legal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark-img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.brand-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-title {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.legal-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.legal-nav {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.legal-nav a {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 800;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  letter-spacing: 0.01em;
  flex: 1;
  text-align: center;
  line-height: 1.25;
}

.legal-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.legal-nav a.is-active {
  color: var(--text);
  background: var(--purple-16);
  box-shadow: inset 0 0 0 1px rgba(122, 107, 255, 0.28);
}

/* Language picker */
.lang-picker {
  position: relative;
  z-index: 20;
  width: 100%;
}

.lang-trigger {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 68px;
  padding: 14px 14px 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, #1a1a2c 0%, #12121e 100%);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(122, 107, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.lang-trigger:hover,
.lang-picker.is-open .lang-trigger {
  border-color: rgba(167, 156, 255, 0.55);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(122, 107, 255, 0.28),
    0 0 24px rgba(122, 107, 255, 0.18);
}

.lang-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(122, 107, 255, 0.35);
}

.lang-trigger-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(180deg, #8b7dff 0%, #6a5cff 100%);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(106, 92, 255, 0.35);
}

.lang-trigger-icon svg {
  width: 20px;
  height: 20px;
}

.lang-trigger-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
  flex: 1;
  text-align: left;
}

.lang-name {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.15;
}

.lang-trigger-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.lang-trigger-label {
  font-size: 13px;
  font-weight: 700;
  color: #cfc9e8;
  line-height: 1;
}

.lang-dot {
  color: #7f7a98;
  font-weight: 700;
}

.lang-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.lang-chevron-wrap {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
  margin-left: auto;
}

.lang-chevron {
  width: 16px;
  height: 16px;
  color: #fff;
  transition: transform 0.18s ease;
}

.lang-picker.is-open .lang-chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  width: auto;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, #1c1b2e 0%, #10101a 100%);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(122, 107, 255, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top center;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s ease;
  max-height: min(440px, 55vh);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.lang-picker.is-open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 11px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.lang-option:hover,
.lang-option:focus-visible {
  background: rgba(122, 107, 255, 0.16);
  outline: none;
}

.lang-option.is-active {
  background: rgba(122, 107, 255, 0.24);
}

.lang-option .lang-code {
  background: rgba(122, 107, 255, 0.28);
  color: #efeaff;
}

.lang-option-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.lang-option-name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
}

.lang-option-meta {
  font-size: 12px;
  font-weight: 600;
  color: #a8a3c0;
}

.lang-check {
  width: 18px;
  height: 18px;
  color: #b7aeff;
  opacity: 0;
  flex-shrink: 0;
}

.lang-option.is-active .lang-check {
  opacity: 1;
}

.legal-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 24px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.legal-meta strong {
  color: var(--text-2);
  font-weight: 700;
}

.legal-fallback {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--purple-16);
  border: 1px solid rgba(122, 107, 255, 0.28);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.legal-title {
  margin: 0 0 12px;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.legal-lead {
  margin: 0 0 28px;
  color: var(--text-2);
  font-size: 16px;
  font-weight: 500;
}

.legal-body h2 {
  margin: 28px 0 10px;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.legal-body h3 {
  margin: 18px 0 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.legal-body p,
.legal-body li {
  color: var(--text-2);
  font-size: 15px;
}

.legal-body p {
  margin: 0 0 12px;
}

.legal-body ul {
  margin: 0 0 14px;
  padding-left: 1.2em;
}

.legal-body li {
  margin-bottom: 6px;
}

.legal-body strong {
  color: var(--text);
}

.legal-footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.legal-footer p {
  margin: 0 0 8px;
}

@media (max-width: 720px) {
  .legal-app {
    padding: 20px 16px 48px;
  }

  .legal-card {
    padding: 22px 16px 26px;
    border-radius: 18px;
  }

  .legal-nav a {
    font-size: 11px;
    padding: 11px 8px;
  }

  .lang-trigger {
    min-height: 72px;
  }

  .lang-name {
    font-size: 20px;
  }

  .lang-trigger-label {
    font-size: 14px;
  }
}

@media (min-width: 721px) {
  .legal-toolbar {
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
  }

  .legal-nav {
    flex: 1;
    min-height: 52px;
    align-items: stretch;
  }

  .legal-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    padding: 0 14px;
    white-space: nowrap;
  }

  .lang-picker {
    width: 250px;
    flex-shrink: 0;
  }

  .lang-trigger {
    min-height: 52px;
    height: 100%;
    gap: 10px;
    padding: 8px 10px 8px 10px;
    border-radius: 14px;
  }

  .lang-trigger-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .lang-trigger-icon svg {
    width: 16px;
    height: 16px;
  }

  .lang-trigger-copy {
    gap: 2px;
  }

  .lang-name {
    font-size: 15px;
  }

  .lang-trigger-label {
    font-size: 12px;
  }

  .lang-chevron-wrap {
    width: 30px;
    height: 30px;
  }

  .lang-chevron {
    width: 14px;
    height: 14px;
  }

  .lang-menu {
    left: auto;
    right: 0;
    width: 300px;
  }
}

[dir="rtl"] .legal-body ul {
  padding-left: 0;
  padding-right: 1.2em;
}

[dir="rtl"] .lang-option,
[dir="rtl"] .lang-trigger-copy {
  text-align: right;
  align-items: flex-end;
}

[dir="rtl"] .lang-chevron-wrap {
  margin-left: 0;
  margin-right: auto;
}
