@font-face {
  font-family: Outfit;
  src: url('/fonts/Outfit_300Light.ttf') format('truetype');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: Outfit;
  src: url('/fonts/Outfit_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Outfit;
  src: url('/fonts/Outfit_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

:root {
  --bg: #0b0818;
  --text: #f6f3ff;
  --muted: rgba(246, 243, 255, 0.66);
  --faint: rgba(246, 243, 255, 0.38);
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(255, 255, 255, 0.06);
  --accent: #ffb38a;
  --gold: #ffd27a;
  --cell: clamp(40px, 11vw, 56px);
  --radius: 22px;
  /* Outfit covers Latin; other scripts fall back to the platform's own UI font. */
  --font: Outfit, system-ui, -apple-system, 'Segoe UI', 'Noto Sans', 'Hiragino Sans', 'PingFang SC', 'Apple SD Gothic Neo', 'Noto Sans Arabic', 'Noto Sans Devanagari', sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #2a1540 0%, #1a0f33 38%, var(--bg) 100%) fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--gold);
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 0.5em;
}
h1 {
  font-size: clamp(32px, 6vw, 44px);
}
h2 {
  font-size: clamp(22px, 4vw, 28px);
}
h3 {
  font-size: 19px;
}
p {
  margin: 0 0 1em;
}

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  padding: 8px 14px;
  background: var(--gold);
  color: #1a1030;
  border-radius: 10px;
  z-index: 10;
}
.skip:focus {
  top: 12px;
}

/* Soft glowing lights behind everything, like the in-game backdrop. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.backdrop span {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.22;
  animation: drift 26s ease-in-out infinite alternate;
}
.backdrop span:nth-child(1) {
  background: #ff6b6b;
  top: -18vmax;
  left: -12vmax;
}
.backdrop span:nth-child(2) {
  background: #a78bfa;
  top: 30vh;
  right: -20vmax;
  animation-delay: -9s;
}
.backdrop span:nth-child(3) {
  background: #4cc9f0;
  bottom: -26vmax;
  left: 20vw;
  opacity: 0.14;
  animation-delay: -17s;
}
@keyframes drift {
  to {
    transform: translate(6vmax, 4vmax) scale(1.12);
  }
}

/* ---------- Header ---------- */

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 20px 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.04em;
}
.brand img {
  border-radius: 10px;
}
.nav {
  display: flex;
  gap: 4px;
  margin-inline-start: auto;
  flex-wrap: wrap;
}
.nav a,
.foot nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 15px;
}
.nav a:hover,
.foot nav a:hover {
  color: var(--text);
  background: var(--glass);
}
.nav a[aria-current='page'] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.lang {
  position: relative;
}
.lang summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 15px;
  background: var(--glass);
  white-space: nowrap;
}
.lang summary::-webkit-details-marker {
  display: none;
}
.lang summary svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.lang[open] summary,
.lang summary:hover {
  color: var(--text);
}
.lang ul {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  z-index: 5;
  margin: 0;
  padding: 8px;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 2px;
  background: rgba(22, 14, 44, 0.97);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.lang li a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}
.lang li a:hover {
  background: var(--glass);
  color: var(--text);
}
.lang li a[aria-current='true'] {
  color: var(--gold);
}

@media (max-width: 720px) {
  .top {
    flex-wrap: wrap;
  }
  .nav {
    order: 3;
    width: 100%;
    margin: 0;
    justify-content: space-between;
  }
  .nav a {
    padding: 6px 8px;
  }
  .lang {
    margin-inline-start: auto;
  }
}

/* ---------- Layout ---------- */

main {
  flex: 1;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.block {
  margin-top: 88px;
}
.block > h2 {
  text-align: center;
  margin-bottom: 32px;
}

.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.button {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1030;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(255, 179, 138, 0.35);
  transition: transform 0.15s ease;
}
.button:hover {
  color: #1a1030;
  transform: translateY(-2px);
}

/* ---------- Home ---------- */

.hero {
  text-align: center;
  padding-top: 40px;
}
.hero-icon {
  border-radius: 34px;
  box-shadow: 0 30px 80px rgba(167, 139, 250, 0.35);
}
.wordmark {
  margin: 28px 0 0;
  font-weight: 300;
  font-size: clamp(44px, 11vw, 84px);
  letter-spacing: 0.24em;
  padding-inline-start: 0.24em;
  /* Written in capitals in the markup: CSS uppercasing would dot the I on Turkish pages. */
  text-shadow: 0 0 36px rgba(255, 179, 138, 0.55);
}
.tagline {
  color: var(--muted);
  letter-spacing: 0.18em;
  margin-top: 4px;
}
.lead {
  max-width: 600px;
  margin: 24px auto 0;
  font-size: clamp(18px, 2.6vw, 21px);
  color: var(--text);
}
.soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--muted);
  font-size: 15px;
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ee6a8;
  box-shadow: 0 0 0 0 rgba(62, 230, 168, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(62, 230, 168, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(62, 230, 168, 0);
  }
}

/* Orbs share the in-game palette. */
.orb {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, var(--l) 0%, var(--b) 45%, var(--d) 100%);
  box-shadow: 0 0 18px color-mix(in srgb, var(--b) 60%, transparent);
}
.orb-0 {
  --b: #ff6b6b;
  --l: #ffd1c7;
  --d: #c2344a;
}
.orb-1 {
  --b: #ffc24b;
  --l: #fff1c4;
  --d: #d1801b;
}
.orb-2 {
  --b: #3ee6a8;
  --l: #d2ffec;
  --d: #119a71;
}
.orb-3 {
  --b: #4cc9f0;
  --l: #d6f6ff;
  --d: #1f7fb8;
}
.orb-4 {
  --b: #a78bfa;
  --l: #ede5ff;
  --d: #6b46e0;
}
.orb-5 {
  --b: #ff7ac6;
  --l: #ffe0f2;
  --d: #c93c8e;
}

/* Demo board: 5 × 3 cells. Always laid out left-to-right, like the game itself. */
.board {
  direction: ltr;
  position: relative;
  width: calc(var(--cell) * 5 + 24px);
  height: calc(var(--cell) * 3 + 24px);
  margin: 64px auto 0;
  padding: 12px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35), 0 30px 80px rgba(0, 0, 0, 0.35);
}
.cells {
  display: grid;
  grid-template-columns: repeat(5, var(--cell));
  grid-auto-rows: var(--cell);
}
.cells i {
  margin: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}
.board .orb,
.board .slot {
  position: absolute;
  width: calc(var(--cell) * 0.66);
  height: calc(var(--cell) * 0.66);
  margin: calc(var(--cell) * 0.17);
}
.slot {
  border-radius: 50%;
  border: 2px dashed var(--c);
  opacity: 0.8;
}
.slot-a {
  --c: #ff6b6b;
  left: calc(12px + var(--cell) * 4);
  top: 12px;
}
.slot-b {
  --c: #4cc9f0;
  left: 12px;
  top: calc(12px + var(--cell) * 2);
}
.ringed::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
}
.mover-a {
  left: 12px;
  top: 12px;
  animation: slide-right 4.2s cubic-bezier(0.6, 0, 0.2, 1) infinite;
}
.mover-b {
  left: calc(12px + var(--cell) * 4);
  top: calc(12px + var(--cell) * 2);
  animation: slide-left 4.2s cubic-bezier(0.6, 0, 0.2, 1) infinite;
}
.swipe {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: -17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 22px #fff;
  animation: finger 4.2s ease-in-out infinite;
}
@keyframes slide-right {
  0%,
  22% {
    transform: none;
  }
  40%,
  88% {
    transform: translateX(calc(var(--cell) * 4));
  }
  100% {
    transform: none;
    opacity: 0;
  }
}
@keyframes slide-left {
  0%,
  22% {
    transform: none;
  }
  40%,
  88% {
    transform: translateX(calc(var(--cell) * -4));
  }
  100% {
    transform: none;
    opacity: 0;
  }
}
@keyframes finger {
  0%,
  4% {
    opacity: 0;
    transform: translateX(-40px);
  }
  10% {
    opacity: 0.9;
  }
  24% {
    opacity: 0.9;
    transform: translateX(40px) scale(0.85);
  }
  32%,
  100% {
    opacity: 0;
    transform: translateX(40px) scale(0.85);
  }
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.steps li {
  text-align: center;
  padding: 8px 12px;
}
.num {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--gold);
  font-weight: 600;
}
.steps p,
.features p {
  color: var(--muted);
  margin: 0;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.features .orb {
  margin-bottom: 16px;
}

.help {
  text-align: center;
}
.help p {
  color: var(--muted);
}

/* ---------- Documents ---------- */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding-top: 24px;
}
.doc h2 {
  margin-top: 40px;
}
.doc p,
.doc li,
.doc dd {
  color: var(--muted);
}
.doc ul {
  padding-inline-start: 1.3em;
  margin: 0 0 1em;
}
.doc li {
  margin-bottom: 0.5em;
}
.intro {
  font-size: 19px;
  color: var(--text) !important;
}
.updated {
  color: var(--faint) !important;
  font-size: 15px;
}
.legal section {
  scroll-margin-top: 20px;
}

.faq {
  margin-top: 28px;
  display: grid;
  gap: 12px;
}
.faq details {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 22px;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}
.faq details p {
  margin: 0 0 18px;
}

.contact {
  margin: 28px 0 8px;
  text-align: center;
}
.contact h2 {
  margin-top: 0;
}
.fixes {
  margin: 0;
  display: grid;
  gap: 12px;
}
.fixes div {
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: 16px;
}
.fixes dt {
  font-weight: 600;
}
.fixes dd {
  margin: 2px 0 0;
}
.note {
  margin-top: 36px;
}

.lost {
  padding-top: 80px;
}
.lost .code {
  font-size: 96px;
  font-weight: 300;
  letter-spacing: 0.2em;
  margin: 0;
  color: var(--accent);
}
.lost .lead {
  margin-bottom: 32px;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.foot {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 28px 20px max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--faint);
  font-size: 14px;
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-bottom: 12px;
}
.foot p {
  margin: 4px 0;
}
.fine {
  font-size: 13px;
}

/* Letter spacing breaks joined and stacked scripts. */
:lang(ar) *,
:lang(hi) * {
  letter-spacing: 0 !important;
}
:lang(ar) .wordmark,
:lang(hi) .wordmark {
  letter-spacing: 0.24em !important;
}
:lang(ar) body {
  line-height: 1.8;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}
