:root {
  --bg: #070707;
  --bg-deep: #050505;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #ffffff;
  --muted: #9d9d9d;
  --muted-dim: #7a7a7a;
  --invert: #070707;
  --danger: #ff6b76;
  --ok: #8fdfb0;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --play-radius: 10px;
  --gutter: clamp(18px, 3.4vw, 56px);
  --max: 1200px;
  --header-h: 68px;
  --section-gap: clamp(52px, 6vw, 120px);
  --card-pad: clamp(22px, 1.9vw, 34px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --shadow-card: 0 22px 60px rgba(0, 0, 0, 0.45);
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

html {
  background: var(--bg-deep);
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(15px, 0.55vw + 12px, 17px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background: transparent;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(255, 255, 255, 0.86);
  color: var(--invert);
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
  border-radius: 6px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
  background-color: rgba(255, 255, 255, 0.18);
}

*::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.32);
}

/* Decorative background */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}

.bg__grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.085) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.085) 1px, transparent 1px);
  background-size: clamp(48px, 5vw, 82px) clamp(48px, 5vw, 82px);
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 10%, transparent 74%);
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 10%, transparent 74%);
  opacity: 0.9;
}

.bg__horizon {
  position: absolute;
  inset: auto 0 0;
  height: 46vh;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.05) 62%, rgba(255, 255, 255, 0.11) 100%);
}

.bg__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(clamp(60px, 7vw, 130px));
  will-change: transform;
}

.bg__glow--a {
  top: -30vh;
  left: 50%;
  width: min(150vw, 1700px);
  height: min(95vh, 1000px);
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
  animation: drift-a 26s var(--ease-soft) infinite alternate;
}

.bg__glow--b {
  right: -16vw;
  bottom: -22vh;
  width: min(84vw, 1000px);
  height: min(74vh, 820px);
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0));
  animation: drift-b 32s var(--ease-soft) infinite alternate;
}

.bg__glow--c {
  left: -16vw;
  top: 30vh;
  width: min(66vw, 820px);
  height: min(64vh, 700px);
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  animation: drift-c 38s var(--ease-soft) infinite alternate;
}

.bg__beam {
  position: absolute;
  top: -10%;
  left: 50%;
  width: min(70vw, 760px);
  height: 120%;
  transform: translateX(-50%) rotate(14deg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 62%);
  mask-image: linear-gradient(180deg, #000, transparent 78%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 78%);
  filter: blur(46px);
  opacity: 0.75;
  animation: sway 22s var(--ease-soft) infinite alternate;
}

@keyframes sway {
  from {
    transform: translateX(-50%) rotate(14deg);
  }
  to {
    transform: translateX(-42%) rotate(9deg);
  }
}

.bg__noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bg__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 108% at 50% 4%, rgba(7, 7, 7, 0) 46%, rgba(4, 4, 4, 0.78) 100%);
}

@keyframes drift-a {
  from {
    transform: translate(-50%, 0) scale(1);
  }
  to {
    transform: translate(-46%, 4vh) scale(1.12);
  }
}

@keyframes drift-b {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-6vw, -6vh) scale(1.14);
  }
}

@keyframes drift-c {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(5vw, 5vh) scale(1.1);
  }
}

/* Layout */

.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

.header__inner,
.footer__inner,
.main {
  width: min(100% - var(--gutter) * 2, var(--max));
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s var(--ease), background-color 0.35s var(--ease), backdrop-filter 0.35s var(--ease);
}

.header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(7, 7, 7, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.header__progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.15), #fff);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.header.is-scrolled .header__progress {
  opacity: 1;
}

.header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 40px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55);
  animation: pulse 3.2s var(--ease-soft) infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(255, 255, 255, 0);
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
}

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.6);
  transform: translateX(-50%);
  transition: width 0.3s var(--ease);
}

.nav__link:hover {
  color: var(--text);
  background: var(--surface);
}

.nav__link:hover::after {
  width: 18px;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.menu-toggle:hover {
  border-color: var(--line-strong);
}

.menu-toggle__bars {
  position: relative;
  width: 14px;
  height: 8px;
}

.menu-toggle__bars::before,
.menu-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.3s var(--ease);
}

.menu-toggle__bars::before {
  top: 0;
}

.menu-toggle__bars::after {
  bottom: 0;
}

.nav-toggle:checked ~ .header .menu-toggle__bars::before {
  transform: translateY(3px) rotate(45deg);
}

.nav-toggle:checked ~ .header .menu-toggle__bars::after {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* Buttons */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
    border-color 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -140%;
  width: 60%;
  height: 100%;
  transform: skewX(-18deg);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
  transition: left 0.6s var(--ease);
}

.btn:hover::after {
  left: 140%;
}

.btn--solid {
  background: linear-gradient(180deg, #ffffff, #dedede);
  color: var(--invert);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.08);
}

.btn--solid::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0));
}

.btn--ghost {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn--lg {
  min-height: 50px;
  padding: 0 26px;
  font-size: 0.9375rem;
}

.btn--block {
  width: 100%;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--solid:hover {
  box-shadow: 0 16px 40px rgba(255, 255, 255, 0.14);
}

.btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: var(--surface-strong);
}

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

/* Mobile menu */

.mobile-menu,
.mobile-menu__backdrop {
  display: none;
}

/* Sections */

.main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 48px) 0 var(--section-gap);
}

.page-auth .main {
  justify-content: center;
  padding-top: clamp(20px, 4vh, 56px);
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(28px, 7vh, 88px) 0 0;
}

.hero::before {
  content: "";
  position: absolute;
  top: -8%;
  left: 50%;
  z-index: -1;
  width: min(960px, 92vw);
  height: clamp(280px, 40vh, 460px);
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 74%);
  pointer-events: none;
}

.hero__chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hero__chip b {
  color: var(--text);
  font-weight: 600;
}

.chip__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 2.6s var(--ease-soft) infinite;
}

.hero__title {
  margin-top: clamp(20px, 2.4vw, 34px);
  font-size: clamp(42px, 7.4vw, 104px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.98;
  background: linear-gradient(174deg, #ffffff 24%, #b7b7b7 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  margin-top: clamp(16px, 1.6vw, 26px);
  max-width: 34ch;
  color: var(--muted);
  font-size: clamp(15px, 0.75vw + 10px, 20px);
  line-height: 1.5;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(26px, 2.6vw, 40px);
}

.hero__note {
  margin-top: 16px;
  color: var(--muted-dim);
  font-size: 0.8125rem;
}

.highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1vw, 18px);
  margin-top: var(--section-gap);
}

.highlight {
  padding: clamp(18px, 1.5vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  text-align: left;
}

.highlight__value {
  font-size: clamp(22px, 1.5vw + 12px, 34px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.highlight__label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: var(--section-gap);
}

.section-head__label {
  color: var(--muted-dim);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-head__title {
  margin-top: 10px;
  font-size: clamp(26px, 1.9vw + 14px, 46px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.section-head__desc {
  max-width: 42ch;
  color: var(--muted);
  font-size: 0.9375rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.2vw, 22px);
  margin-top: clamp(24px, 2vw, 36px);
}

.card,
.platform,
.highlight,
.cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.card::before,
.platform::before,
.highlight::before,
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.09), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.card:hover::before,
.platform:hover::before,
.highlight:hover::before,
.cta:hover::before {
  opacity: 1;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: clamp(220px, 17vw, 280px);
  padding: var(--card-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}

.card__label {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.card__title {
  margin-top: clamp(16px, 1.2vw, 22px);
  font-size: clamp(20px, 0.9vw + 14px, 27px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.card__desc {
  margin-top: 12px;
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.card .btn {
  margin-top: clamp(20px, 1.6vw, 28px);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(20px, 2vw, 40px);
  margin-top: var(--section-gap);
  padding: clamp(28px, 3vw, 56px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02) 52%, rgba(255, 255, 255, 0.05));
  box-shadow: var(--shadow-card);
}

.cta__title {
  font-size: clamp(24px, 1.7vw + 12px, 42px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.cta__desc {
  margin-top: 10px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.9375rem;
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Footer */

.footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 76px;
  padding: 18px 0;
}

.footer__copy {
  color: var(--muted-dim);
  font-size: 0.8125rem;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer__links a,
.footer__links button {
  color: var(--muted);
  font-size: 0.8125rem;
  transition: color 0.25s var(--ease);
}

.footer__links a:hover,
.footer__links button:hover {
  color: var(--text);
}

/* Auth */

.auth {
  width: min(100%, 430px);
  margin: 0 auto;
  padding: clamp(24px, 2.4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.auth__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(18px, 1.6vw, 26px);
  color: var(--muted);
  font-size: 0.8125rem;
  transition: color 0.25s var(--ease), gap 0.25s var(--ease);
}

.auth__back:hover {
  color: var(--text);
  gap: 12px;
}

.auth__title {
  font-size: clamp(24px, 1.2vw + 16px, 32px);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.auth__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: clamp(18px, 1.6vw, 26px) 0 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
}

.auth__tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.auth__tabs a:hover {
  color: var(--text);
}

.auth__tabs a.is-active {
  background: #fff;
  color: var(--invert);
}

.auth label {
  display: block;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.auth input[type="text"],
.auth input[type="email"],
.auth input[type="password"] {
  width: 100%;
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.auth input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.auth input:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.auth input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(0, 0, 0, 0.5);
}

.auth .btn {
  margin-top: clamp(20px, 1.8vw, 28px);
}

.auth__hint {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.auth__hint a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.alert {
  margin-top: 16px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  animation: rise 0.4s var(--ease) both;
}

.alert--error {
  border: 1px solid rgba(255, 107, 118, 0.32);
  background: rgba(255, 107, 118, 0.06);
  color: var(--danger);
}

.alert--ok {
  border: 1px solid rgba(143, 223, 176, 0.32);
  background: rgba(143, 223, 176, 0.06);
  color: var(--ok);
}

/* Modals */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 2.4vw, 40px);
  visibility: hidden;
  pointer-events: none;
}

.modal-layer.is-open {
  visibility: visible;
  pointer-events: auto;
}

.modal-layer[hidden] {
  display: none;
}

.modal-layer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 4, 0.72);
  opacity: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.32s var(--ease);
}

.modal-layer.is-open .modal-layer__backdrop {
  opacity: 1;
}

.modal {
  position: relative;
  z-index: 1;
  width: min(820px, 100%);
  max-height: calc(100dvh - clamp(28px, 4.8vw, 80px));
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 2.2vw, 38px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #171717, #101010);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition: transform 0.38s var(--ease), opacity 0.3s var(--ease);
}

.modal-layer.is-open .modal {
  opacity: 1;
  transform: none;
}

.modal--narrow {
  width: min(500px, 100%);
}

.modal--narrow .modal__footer {
  flex-direction: column;
  align-items: stretch;
}

.modal--narrow .modal__footer p {
  max-width: none;
}

.modal__close {
  position: absolute;
  top: clamp(16px, 1.6vw, 26px);
  right: clamp(16px, 1.6vw, 26px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background-color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.modal__close:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-strong);
  transform: rotate(90deg);
}

.modal__title {
  padding-right: 48px;
  font-size: clamp(22px, 1.3vw + 14px, 34px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.modal__lead {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.rules-body {
  min-height: 0;
  flex: 1 1 auto;
  margin-top: clamp(18px, 1.8vw, 28px);
  overflow: hidden;
}

.rules-scroll {
  max-height: min(46vh, 430px);
  overflow: auto;
  padding-right: 10px;
  mask-image: linear-gradient(180deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.rule {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.022);
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.rule:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.rule h3 {
  font-size: 0.9375rem;
  font-weight: 600;
}

.rule p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.rule__tag {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 6px 10px;
  border-radius: 999px;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
}

.rule__tag--ban {
  color: var(--danger);
  border: 1px solid rgba(255, 107, 118, 0.28);
  background: rgba(255, 107, 118, 0.06);
}

.rule__tag--mute {
  color: #d7c38a;
  border: 1px solid rgba(215, 195, 138, 0.28);
  background: rgba(215, 195, 138, 0.06);
}

.rule__tag--mixed {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.modal__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  margin-top: clamp(18px, 1.6vw, 26px);
  padding-top: clamp(18px, 1.6vw, 26px);
  border-top: 1px solid var(--line);
}

.modal__footer p {
  max-width: 42ch;
  color: var(--muted);
  font-size: 0.8125rem;
}

.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 1.2vw, 18px);
  margin-top: clamp(22px, 2vw, 32px);
}

.platform {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(20px, 1.8vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.28s var(--ease), transform 0.28s var(--ease);
}

.platform:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.platform h3 {
  font-size: 1.0625rem;
  font-weight: 600;
}

.platform p {
  margin: 10px 0 clamp(18px, 1.6vw, 26px);
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.platform .btn {
  margin-top: auto;
}

/* Play screen */

.page-play .footer,
.page-play .mobile-menu,
.page-play .mobile-menu__backdrop,
.page-play .nav,
.page-play .menu-toggle {
  display: none;
}

.page-play .header {
  border-bottom-color: var(--line);
  background: rgba(7, 7, 7, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.page-play .bg__glow {
  animation: none;
  opacity: 0.5;
}

.page-play .bg__grid,
.page-play .bg__beam,
.page-play .bg__horizon {
  opacity: 0.3;
}

.page-play .main {
  width: 100%;
  max-width: none;
  padding: clamp(12px, 1.6vw, 28px);
  justify-content: center;
  align-items: center;
}

.play-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(10, 10, 10, 0.6);
  /* the frame is drawn as a ring so it costs no layout width: the header and
     the game canvas below it have to line up pixel for pixel */
  box-shadow: 0 0 0 1px var(--line), 0 30px 90px rgba(0, 0, 0, 0.6);
}

/* Strip above the game with the player's name and the admin button */

.play-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, rgba(24, 24, 24, 0.95), rgba(12, 12, 12, 0.95));
  font-size: 13px;
  color: var(--text);
  user-select: none;
}

.play-head[hidden] {
  display: none;
}

.play-who {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.play-nick {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-uid,
.play-online {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.play-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.play-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.play-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5ad46a;
  box-shadow: 0 0 8px rgba(90, 212, 106, 0.7);
}

.play-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.play-admin-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.play-admin-btn .admin-tab-star {
  fill: #0b0b0b;
}

.play-admin-btn:hover,
.play-admin-btn.is-open {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}

.admin-panel {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 41;
  display: flex;
  flex-direction: column;
  width: 336px;
  max-height: calc(100% - 120px);
  border: 1px solid var(--line);
  border-right: none;
  border-radius: 16px 0 0 16px;
  background: rgba(9, 9, 9, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: -18px 0 60px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
}

.admin-panel[hidden] {
  display: none;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.admin-close {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.admin-close:hover {
  color: #fff;
}

.admin-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 8px 0;
}

.admin-tabs button,
.admin-log-kinds button {
  flex: 1;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.admin-tabs button.is-active,
.admin-log-kinds button.is-active {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.admin-body {
  padding: 10px 12px;
  overflow-y: auto;
}

.admin-view {
  display: none;
}

.admin-view.is-active {
  display: block;
}

.admin-search,
.admin-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.admin-panel input[type="text"],
.admin-panel textarea {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.admin-panel textarea {
  width: 100%;
  margin-bottom: 8px;
  resize: vertical;
}

.admin-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-search button,
.admin-row button,
.admin-wide,
.admin-actions button,
.admin-list button,
.admin-picker button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.admin-wide,
.admin-list button {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  text-align: left;
}

.admin-actions button:hover,
.admin-list button:hover,
.admin-search button:hover,
.admin-row button:hover,
.admin-picker button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.admin-actions button.is-bad {
  border-color: rgba(255, 120, 120, 0.4);
  color: #ffb4b4;
}

.admin-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.admin-uid,
.admin-meta {
  color: var(--muted);
  font-size: 12px;
}

.admin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5ad46a;
}

.admin-warn {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 120, 120, 0.12);
  color: #ffb4b4;
  font-size: 12px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.admin-static {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.admin-static input[type="text"] {
  flex: 1 1 100%;
  width: 100%;
}

.admin-log p {
  margin: 0 0 6px;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.admin-log p[data-uid] {
  cursor: pointer;
}

.admin-log p[data-uid]:hover {
  background: rgba(255, 255, 255, 0.07);
}

.admin-when {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.admin-log .admin-uid {
  font-size: 11px;
  opacity: 0.75;
}

.admin-log-tools {
  align-items: center;
}

.admin-select {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.admin-select[hidden] {
  display: none;
}

.admin-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.admin-note {
  margin: 0;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  min-height: 33px;
}

.admin-note.is-bad {
  color: #ffb4b4;
}

.admin-picker {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 6px;
  padding: 14px;
  background: rgba(6, 6, 6, 0.97);
  overflow-y: auto;
}

.admin-picker p {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  font-weight: 600;
}

.admin-picker-cancel {
  grid-column: 1 / -1;
  color: var(--muted) !important;
}

.admin-picker button {
  padding: 5px 8px;
  font-size: 11px;
}

@media (max-width: 720px) {
  .admin-panel {
    width: min(336px, 92vw);
  }
}

.play-frame {
  position: relative;
  width: 1280px;
  height: 720px;
  overflow: hidden;
  border-radius: 0 0 5px 5px;
  background: #0d0d0d;
}

/* Loading screen over the game */

.play-loader {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
    #070707;
  opacity: 1;
  transition: opacity 0.6s var(--ease);
}

.play-loader.is-done {
  opacity: 0;
  pointer-events: none;
}

.play-loader[hidden] {
  display: none;
}

.play-loader-inner {
  width: min(320px, 60%);
  text-align: center;
}

.play-loader-mark {
  margin-bottom: 18px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  animation: loader-breathe 2.6s var(--ease) infinite;
}

.play-loader-mark span {
  color: var(--muted);
}

.play-loader-bar {
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.play-loader-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), #fff);
}

.play-loader-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.play-loader-meta #playLoaderPct {
  font-variant-numeric: tabular-nums;
}

@keyframes loader-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.play-stage,
.play-stage ruffle-player,
#flashContentPlayer {
  display: block;
  width: 1280px !important;
  height: 720px !important;
}

.play-shell:fullscreen,
.play-shell:-webkit-full-screen {
  width: 100%;
  height: 100%;
  background: #000;
}

.play-shell:fullscreen,
.play-shell:-webkit-full-screen {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.play-shell:fullscreen .play-frame,
.play-shell:-webkit-full-screen .play-frame {
  border-radius: 0;
  box-shadow: none;
}

body.is-modal-open {
  overflow: hidden;
}

/* Motion */

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

.no-js [data-reveal] {
  opacity: 1;
  transform: none;
}

.hero > *,
.auth {
  animation: rise 0.7s var(--ease) both;
}

.hero__chip {
  animation-delay: 0.02s;
}

.hero__title {
  animation-delay: 0.08s;
}

.hero__subtitle {
  animation-delay: 0.14s;
}

.hero__actions {
  animation-delay: 0.2s;
}

.hero__note {
  animation-delay: 0.26s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (hover: none) {
  .btn:hover,
  .card:hover,
  .platform:hover {
    transform: none;
  }

  .btn:hover::after {
    left: -140%;
  }
}

/* Wide screens */

@media (min-width: 1500px) {
  :root {
    --max: 1340px;
    --header-h: 74px;
  }
}

@media (min-width: 1800px) {
  :root {
    --max: 1500px;
    --header-h: 78px;
  }
}

@media (min-width: 2200px) {
  :root {
    --max: 1680px;
    --radius-lg: 26px;
  }
}

@media (min-width: 2800px) {
  :root {
    --max: 1880px;
  }

  html,
  body {
    font-size: 19px;
  }
}

/* Tablets */

@media (max-width: 1080px) {
  .highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .nav,
  .header__cta {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .mobile-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: calc(var(--header-h) + 10px);
    right: var(--gutter);
    left: var(--gutter);
    z-index: 45;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(14, 14, 14, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow-card);
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    transform-origin: top center;
    visibility: hidden;
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0.28s;
  }

  .mobile-menu__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
  }

  .mobile-menu__link {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    text-align: left;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
    transition: background-color 0.25s var(--ease);
  }

  .mobile-menu__link:hover {
    background: var(--surface);
  }

  .mobile-menu__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 38;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s var(--ease), visibility 0.28s;
  }

  .nav-toggle:checked ~ .mobile-menu,
  .nav-toggle:checked ~ .mobile-menu__backdrop {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .page-play .mobile-menu,
  .page-play .mobile-menu__backdrop {
    display: none;
  }

  .page-play .header__cta {
    display: inline-flex;
  }

  .highlights,
  .cards,
  .platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .cards > :last-child {
    grid-column: auto;
  }

  .card {
    min-height: 0;
  }

  .section-head {
    align-items: flex-start;
  }

  .cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .cta__actions {
    width: 100%;
  }

  .cta__actions .btn {
    flex: 1 1 180px;
  }
}

@media (max-width: 640px) {
  :root {
    --section-gap: 48px;
  }

  .hero {
    padding-top: clamp(20px, 4vh, 40px);
  }

  .hero__actions {
    width: 100%;
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .highlights,
  .platform-grid {
    grid-template-columns: 1fr;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .modal__footer .btn {
    width: 100%;
  }

  .rule {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .rules-scroll {
    max-height: min(52vh, 420px);
  }
}

@media (max-width: 400px) {
  .brand {
    font-size: 0.9375rem;
  }

  .btn {
    padding: 0 16px;
  }
}

/* Short viewports (landscape phones) */

@media (max-height: 620px) and (min-width: 641px) {
  .hero {
    padding-top: 24px;
  }

  .modal {
    max-height: calc(100dvh - 24px);
  }

  .rules-scroll {
    max-height: 34vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
