@font-face { font-family: "Fredoka"; src: url("fonts/Fredoka-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito-Black.ttf") format("truetype"); font-weight: 900; font-display: swap; }

/* Candy Orbit tokens, the same as in the game (Assets/Scripts/Visual/Palette.cs). */
:root {
  --sky-top: #5a3fe0;
  --sky-mid: #3b2bb8;
  --sky-low: #261a86;
  --sky-deep: #1c1266;
  --gold: #ffc531;
  --gold-edge: #e89a12;
  --mint: #7ff0e4;
  --pink: #ff8fb8;
  --sand: #fff3dc;
  --ink: #2d2366;
  --ink-muted: #6b6396;
  --card: #ffffff;
  --white-soft: rgba(255, 255, 255, 0.8);
  --white-faint: rgba(255, 255, 255, 0.1);
  --radius-l: 28px;
  --radius-m: 20px;
}

* { box-sizing: border-box; }
html { background: var(--sky-deep); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  color: #fff;
  font: 700 17px/1.55 "Nunito", system-ui, sans-serif;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 38%, var(--sky-low) 72%, var(--sky-deep) 100%);
  overflow-x: hidden;
}

/* Starfield: two layers of tiny dots, like the in-game sky. */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.75) 1.4px, transparent 1.6px),
    radial-gradient(circle, rgba(255,255,255,.45) 1px, transparent 1.2px);
  background-size: 140px 160px, 90px 110px;
  background-position: 12px 30px, 60px 80px;
}

a { color: inherit; }
img, video { display: block; max-width: 100%; height: auto; }
.wrap { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  background: rgba(58, 43, 184, .55);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand span { font: 700 21px "Fredoka", "Nunito", sans-serif; }

.langs { display: flex; gap: 4px; background: rgba(0,0,0,.18); border-radius: 999px; padding: 4px; }
.langs button {
  font: 900 13px "Nunito", sans-serif; letter-spacing: .05em;
  color: #fff; background: transparent; border: 0; border-radius: 999px;
  padding: 6px 12px; cursor: pointer;
}
.langs button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.langs button:focus-visible, .cta:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }

/* Hero */
.hero { position: relative; padding: 56px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px; }
.planet { position: absolute; border-radius: 50%; z-index: 0; }
.planet.pink { width: 220px; height: 220px; right: -70px; top: 70px; background: var(--pink); }
.planet.mint { width: 120px; height: 120px; left: -40px; bottom: 40px; background: var(--mint); }

.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font: 900 13px "Nunito", sans-serif; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); background: var(--mint); border-radius: 999px; padding: 6px 14px;
}
.hero h1 {
  margin: 18px 0 0;
  font: 700 clamp(56px, 9vw, 104px)/.95 "Fredoka", "Nunito", sans-serif;
  letter-spacing: -.01em;
  text-shadow: 0 8px 0 var(--sky-deep);
}
.hero h1 .t { color: var(--gold); }
.hero h1 .m { color: var(--mint); }
.tagline { margin: 22px 0 0; font: 900 clamp(22px, 3vw, 30px)/1.2 "Nunito", sans-serif; }
.lead { margin: 14px 0 0; max-width: 520px; color: var(--white-soft); font-size: 18px; }

.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.cta {
  display: inline-flex; align-items: center; gap: 12px;
  font: 900 18px "Nunito", sans-serif; color: var(--ink); text-decoration: none;
  background: var(--gold); border-radius: 22px; padding: 15px 24px;
  box-shadow: 0 7px 0 var(--gold-edge);
  transition: transform .12s, box-shadow .12s;
}
.cta:hover { transform: translateY(2px); box-shadow: 0 5px 0 var(--gold-edge); }
.cta:active { transform: translateY(7px); box-shadow: 0 0 0 var(--gold-edge); }
.cta small { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.cta .gp { width: 26px; height: 26px; flex: none; }
.cta.ghost { background: rgba(255,255,255,.14); color: #fff; box-shadow: 0 7px 0 rgba(28,18,102,.6); }
.cta.ghost:hover { box-shadow: 0 5px 0 rgba(28,18,102,.6); }
.cta.ghost .ico { background: #fff; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 26px 0 0; padding: 0; list-style: none; color: var(--white-soft); font-size: 15px; }
.facts li { display: flex; align-items: center; gap: 8px; }

/* Icons are the game's white UI sprites, coloured through a mask. */
.ico { width: 22px; height: 22px; flex: none; background: var(--gold); -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }

/* Phone with gameplay */
.phone-wrap { position: relative; justify-self: center; }
.phone {
  position: relative; width: min(330px, 78vw); aspect-ratio: 9 / 16;
  border: 10px solid #fff; border-radius: 44px; overflow: hidden;
  background: var(--sky-mid);
  box-shadow: 0 16px 0 var(--sky-deep), 0 40px 80px rgba(10, 4, 60, .45);
  transform: rotate(3deg);
}
.phone video, .phone img { width: 100%; height: 100%; object-fit: cover; }
.mascot {
  position: absolute; width: 132px; left: -64px; bottom: 54px; z-index: 2;
  filter: drop-shadow(0 8px 0 rgba(28,18,102,.7));
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-10px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .mascot { animation: none; } }
/* Sections */
section { position: relative; padding: 64px 0; }
.eyebrow { font: 900 13px "Nunito", sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--mint); margin: 0; }
h2 { font: 700 clamp(34px, 5vw, 52px)/1.05 "Fredoka", "Nunito", sans-serif; margin: 10px 0 0; text-shadow: 0 5px 0 var(--sky-deep); }
.sub { color: var(--white-soft); max-width: 600px; margin: 12px 0 0; font-size: 18px; }
.center { text-align: center; }
.center .sub { margin-left: auto; margin-right: auto; }

/* How it plays */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.step {
  background: var(--card); color: var(--ink); border-radius: var(--radius-l);
  padding: 16px 16px 22px; box-shadow: 0 10px 0 rgba(28,18,102,.65);
  display: flex; flex-direction: column;
}
.step .pic { position: relative; border-radius: var(--radius-m); overflow: hidden; background: var(--sky-mid); aspect-ratio: 1 / 1; }
.step .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.step .pic.win img { object-fit: contain; padding: 6px; }
.step .n {
  display: inline-grid; place-items: center; width: 34px; height: 34px; margin-top: 18px;
  border-radius: 50%; background: var(--gold); color: var(--ink); font: 900 17px "Nunito", sans-serif;
  box-shadow: 0 3px 0 var(--gold-edge);
}
.step h3 { font: 900 22px/1.2 "Nunito", sans-serif; margin: 12px 0 6px; }
.step p { margin: 0; color: #4a4280; }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.feature {
  background: var(--white-faint); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-l); padding: 22px;
}
.feature .badge {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: var(--sky-deep); box-shadow: inset 0 -4px 0 rgba(0,0,0,.25);
}
.feature .badge .ico { width: 28px; height: 28px; }
.feature:nth-child(3n+2) .badge .ico { background: var(--mint); }
.feature:nth-child(3n+3) .badge .ico { background: var(--pink); }
.feature h3 { font: 900 20px/1.25 "Nunito", sans-serif; margin: 16px 0 6px; }
.feature p { margin: 0; color: var(--white-soft); font-size: 16px; }

/* Screenshots */
.shots {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 40px;
}
.shots img {
  width: 100%; height: auto; border-radius: 22px; border: 5px solid #fff;
  box-shadow: 0 10px 0 rgba(28, 18, 102, .7);
}
.shots img:nth-child(odd) { transform: rotate(-1.5deg); }
.shots img:nth-child(even) { transform: rotate(1.5deg) translateY(16px); }

/* Final call */
.final {
  margin: 24px 0 0; padding: 44px clamp(20px, 5vw, 56px);
  border-radius: 36px; background: var(--gold); color: var(--ink);
  box-shadow: 0 12px 0 var(--gold-edge);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px;
}
.final img { width: 120px; }
.final h2 { color: var(--ink); text-shadow: none; margin: 0; font-size: clamp(30px, 4vw, 44px); }
.final p { margin: 8px 0 0; color: #5a4a20; }
.final .cta { background: var(--ink); color: #fff; box-shadow: 0 7px 0 #150e45; }
.final .cta:hover { box-shadow: 0 5px 0 #150e45; }

footer { position: relative; z-index: 1; padding: 40px 0 44px; color: var(--white-soft); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: space-between; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* Responsive */
@media (max-width: 900px) {
  .hero { padding: 32px 0 56px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 48px; }
  .hero .copy { text-align: center; }
  .lead { margin-left: auto; margin-right: auto; }
  .actions, .facts { justify-content: center; }
  .steps, .features { grid-template-columns: 1fr; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .final { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .planet.pink { width: 140px; height: 140px; right: -60px; top: 20px; }
}
@media (max-width: 600px) {
  section { padding: 48px 0; }
  .features { grid-template-columns: 1fr; }
  .shots { grid-template-columns: repeat(4, 70%); overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 28px; margin-left: -16px; margin-right: -16px; padding-left: 16px; }
  .shots img { scroll-snap-align: center; transform: none !important; }
  .mascot { width: 96px; left: -30px; }
  .brand span { display: none; }
}

/* Policy page */
.doc {
  position: relative; z-index: 1;
  background: var(--card); color: var(--ink);
  border-radius: 28px; padding: 28px clamp(18px, 4vw, 44px) 36px; margin: 28px 0 0;
  box-shadow: 0 10px 0 rgba(28, 18, 102, .6);
}
.doc h1 { font: 900 clamp(28px, 5vw, 38px)/1.15 "Nunito", sans-serif; margin: 0 0 6px; }
.doc h2 { font: 900 21px/1.3 "Nunito", sans-serif; margin: 28px 0 8px; text-shadow: none; }
.doc p, .doc li { color: #3d3570; }
.doc .meta { color: var(--ink-muted); font-size: 14px; margin: 0 0 18px; }
.doc a { color: var(--sky-mid); }
.doc ul { padding-left: 22px; }

[data-lang]:not(.on) { display: none !important; }

/* Fredoka has no Cyrillic and no Uzbek ʻ: like the game, RU and UZ headings use Nunito Black. */
html:lang(ru) h2, html:lang(uz) h2, html:lang(ru) .tagline, html:lang(uz) .tagline { font-family: "Nunito", sans-serif; font-weight: 900; }
