/*
 * The legal pages: privacy, terms, account deletion.
 *
 * Plain static pages beside the site (Play links to them by these exact
 * URLs), dressed as the site is — deep space ground, Sora headings, Inter
 * text, the D mark — but built for one job: long reading in three
 * languages. A calm column, generous line height, tables that scroll on
 * their own on a phone. Every font is self-hosted (the site's CSP allows no
 * other origin); Cyrillic comes from its own subset for the Russian text.
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('./fonts/sora-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('./fonts/sora-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --space: #03050b;
  --panel: #0a1020;
  --line: rgba(244, 247, 253, 0.1);
  --line-strong: rgba(244, 247, 253, 0.18);
  --text: #f4f7fd;
  --text-2: rgba(244, 247, 253, 0.78);
  --text-3: rgba(244, 247, 253, 0.6);
  --sky: #9fd0ff;
  --blue: #2563eb;
  color-scheme: dark;
}

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

html {
  background: var(--space);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-2);
  /* A faint glow at the top, as if the site's sky were just above. */
  background:
    radial-gradient(1200px 520px at 70% -180px, rgba(59, 130, 246, 0.16), transparent 70%),
    radial-gradient(900px 420px at 10% -200px, rgba(139, 92, 246, 0.12), transparent 70%),
    var(--space);
  background-repeat: no-repeat;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.75;
  /* cv08: a capital I with serifs, so "AI" never reads "Al". */
  font-feature-settings: 'cv05' 1, 'cv08' 1, 'ss03' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--sky);
}

:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.skip:focus {
  top: 12px;
}

/* ── Bar ─────────────────────────────────────────────────────────────── */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 5, 11, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.bar__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: 'Sora', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
}
.brand img {
  /* On white, as on the app's icon: the D was drawn for a white tile. */
  box-sizing: border-box;
  width: 34px;
  height: 34px;
  padding: 4px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 18px -8px rgba(37, 99, 235, 0.7);
}
.langs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}
.langs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font: 600 12.5px/1 'Inter', sans-serif;
  letter-spacing: 0.06em;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}
.langs button:hover {
  color: var(--text);
}
.langs button[aria-pressed='true'] {
  color: var(--text);
  background: rgba(244, 247, 253, 0.1);
}

/* ── The text ────────────────────────────────────────────────────────── */

.legal {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 20px 88px;
}
.legal article[hidden] {
  display: none;
}
.legal h1,
.legal .h1 {
  margin: 0;
  color: var(--text);
  font-family: 'Sora', 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 5.2vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.legal__meta {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-3);
}
.legal__intro {
  margin-top: 22px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
}
.legal h2 {
  margin: 52px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-family: 'Sora', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.legal h3 {
  margin: 30px 0 0;
  color: var(--text);
  font-size: 1.06rem;
  font-weight: 650;
}
.legal p {
  margin: 14px 0 0;
}
.legal strong {
  color: var(--text);
  font-weight: 600;
}
.legal ul {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.legal li {
  position: relative;
  padding-left: 24px;
}
.legal li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--sky);
  box-shadow: 0 0 10px rgba(159, 208, 255, 0.6);
}
.legal a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(159, 208, 255, 0.4);
  overflow-wrap: anywhere;
}
.legal a:hover {
  text-decoration-color: var(--sky);
}

.legal__scroll {
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.legal table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
}
.legal th,
.legal td {
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.legal tr:last-child th,
.legal tr:last-child td {
  border-bottom: 0;
}
.legal thead th {
  color: var(--text);
  font-weight: 600;
  background: rgba(159, 208, 255, 0.07);
  border-bottom-color: var(--line-strong);
}
.legal tbody th {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.legal__note {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid rgba(159, 208, 255, 0.22);
  border-radius: 14px;
  background: rgba(159, 208, 255, 0.06);
}
.legal__note p:first-child {
  margin-top: 0;
}

/* ── Foot ────────────────────────────────────────────────────────────── */

.foot {
  border-top: 1px solid var(--line);
}
.foot__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 20px 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  font-size: 14px;
  color: var(--text-3);
}
.foot__links,
.foot__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.foot a {
  color: var(--text-2);
  text-decoration: none;
}
.foot a:hover,
.foot a[aria-current='page'] {
  color: var(--text);
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }
  .legal {
    padding-top: 40px;
  }
  .legal h2 {
    margin-top: 40px;
    padding-top: 22px;
  }
  /* Finger-sized: the language switch and the footer links. The footer's
     padding is taken back by its margin, so the type does not move. */
  .langs button {
    padding: 11px 13px;
  }
  .foot a {
    display: inline-block;
    padding-block: 7px;
    margin-block: -7px;
  }
  .foot__links,
  .foot__meta {
    row-gap: 14px;
  }
  /* The tables have two columns, what and how long: both fit a phone when
     the first may wrap, so the reader never scrolls sideways to find the
     answer to the row they are reading. */
  .legal table {
    min-width: 0;
    font-size: 14.5px;
  }
  .legal th,
  .legal td {
    padding: 12px 14px;
  }
  .legal tbody th {
    width: 44%;
    white-space: normal;
  }
}

/* Uzbek runs long ("almashtirmaguningizcha"): on the narrowest phones a word
   that cannot fit its column breaks rather than widen the table. Not wider
   up, where every word fits whole. */
@media (max-width: 359px) {
  .legal th,
  .legal td {
    overflow-wrap: anywhere;
  }
}

@media print {
  html,
  body {
    background: #fff;
    color: #111;
  }
  .bar,
  .foot,
  .skip {
    display: none;
  }
  .legal h1,
  .legal .h1,
  .legal h2,
  .legal h3,
  .legal strong,
  .legal__intro {
    color: #000;
  }
  .legal a {
    color: #000;
  }
  .legal__scroll,
  .legal__note {
    background: none;
    border-color: #ccc;
  }
}
