:root {
  color-scheme: dark;
  --bg: #0e0f1a;
  --card: #181a2b;
  --text: #f2f3fa;
  --muted: #a3a6c2;
  --accent: #ff6bcb;
  --accent2: #6b8cff;
  --radius: 16px;
  --nav-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
h1, h2, h3, .logo { font-family: "Fredoka", sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  min-height: var(--nav-h); padding: 10px 5%;
  background: rgba(14, 15, 26, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #ffffff12;
}
.logo { font-size: 1.6rem; font-weight: 700; }
.logo span { color: var(--accent); }
.nav nav { display: flex; gap: 20px; }
.nav nav a { color: var(--muted); font-weight: 500; transition: color .2s; }
.nav nav a:hover { color: var(--text); }
.menu-btn { display: none; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 40px;
  padding: 70px calc(max(0px, 50vw - 600px) + 5vw) 60px; /* lines up with .section */
  background:
    radial-gradient(circle at 15% 25%, #ff6bcb33, transparent 45%),
    radial-gradient(circle at 80% 60%, #6b8cff33, transparent 45%);
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.15; }
.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); font-size: 1.15rem; margin: 16px 0 32px; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; }

.phones { display: flex; justify-content: center; align-items: center; }
.phone {
  aspect-ratio: 9 / 16; overflow: hidden; background: #000;
  border: 5px solid #2a2d45; border-radius: 24px; box-shadow: 0 18px 44px #0009;
}
.phone img, .phone video { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone.center { width: 42%; z-index: 2; }
.phone.side { width: 32%; opacity: .9; }
.phone.left { transform: rotate(-6deg) translateX(14%); }
.phone.right { transform: rotate(6deg) translateX(-14%); }

.btn {
  display: inline-block; border: 0; cursor: pointer; text-align: center;
  padding: 12px 28px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 600; font-size: 1rem;
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px #ff6bcb55; }
.btn.small { padding: 10px 18px; font-size: .9rem; }
.btn.ghost { background: #ffffff14; }
.btn.ghost:hover { box-shadow: none; background: #ffffff22; }
.btn.off { background: #ffffff14; color: var(--muted); cursor: default; }
.btn.off:hover { transform: none; box-shadow: none; }

/* Sections */
.section { padding: 70px 5%; max-width: 1200px; margin: 0 auto; }
.section h2 { font-size: 2rem; margin-bottom: 28px; }
.section h2::after {
  content: ""; display: block; width: 60px; height: 4px; margin-top: 6px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tab {
  min-height: 40px; padding: 7px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--card); color: var(--muted); font-weight: 600; font-size: .92rem;
  transition: color .2s, background .2s;
}
.tab:hover { color: var(--text); }
.tab[aria-pressed="true"] { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; }

/* Media boxes (16:9) */
.media { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: #000; }
.media img, .media video, .media iframe { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 10px; }
.ph span { font-family: "Fredoka", sans-serif; font-size: 1.2rem; color: #fff; text-shadow: 0 2px 8px #0005; }

/* Game cards */
.card {
  display: flex; flex-direction: column;
  background: var(--card); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 12px 30px #0008; }
.card .media { border-radius: 0; aspect-ratio: 1024 / 500; }
.card .body { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 18px; }
.card .body .btn { margin-top: auto; }
.card h3 { font-size: 1.35rem; margin: 6px 0; }
.card p { color: var(--muted); font-size: .95rem; margin-bottom: 14px; }
.tag {
  display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .5px;
  padding: 3px 10px; border-radius: 999px; background: #ff6bcb22; color: var(--accent);
}
.tag.soon { background: #6b8cff22; color: #a9bcff; margin-left: 4px; }

/* Download */
.downloads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.dl-card {
  display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0;
  background: var(--card); border-radius: var(--radius); padding: 20px; text-align: center;
}
.dl-head { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 80px; text-align: left; }
.dl-head > div { min-width: 0; }
.dl-head img { width: 56px; height: 56px; border-radius: 12px; flex: none; }
.dl-head h3 { font-size: 1.1rem; line-height: 1.25; margin-top: 4px; }
.dl-qr { width: 100%; max-width: 220px; aspect-ratio: 928 / 1068; border-radius: 12px; overflow: hidden; background: #fff; }
.dl-qr img { width: 100%; height: 100%; object-fit: contain; display: block; }
.dl-qr.empty {
  display: grid; place-items: center; padding: 20px;
  background: none; border: 2px dashed #ffffff26; color: var(--muted); font-size: .92rem;
}
.dl-card .btn { width: 100%; margin-top: auto; }
.dl-url { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.dl-url:hover { color: var(--text); }

/* Video cards */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.video-grid.reel, .video-grid.tall { grid-template-columns: repeat(3, minmax(0, 300px)); justify-content: center; }
.video-grid.reel .media { aspect-ratio: 9 / 16; }
.video-grid.tall .media { aspect-ratio: 1080 / 2340; }
.video-grid.reel video, .video-grid.tall video { object-fit: contain; }
.vcard { background: var(--card); border-radius: var(--radius); padding: 12px; }
.vcard h3 { font-size: 1.05rem; padding: 10px 4px 2px; }

/* Screenshots */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.shot {
  display: block; width: 100%; padding: 0; border: 0; background: var(--card);
  aspect-ratio: 1080 / 2340; border-radius: 12px; overflow: hidden; cursor: zoom-in; transition: transform .2s;
}
.shot:hover { transform: scale(1.03); }
.shot img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Posters: square + story side by side at equal height */
.posters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.poster-pair { display: flex; gap: 10px; align-items: flex-start; }
.poster-pair .shot { height: auto; }
.poster-pair .square { flex: 1 1 0; aspect-ratio: 1; }
.poster-pair .story { flex: .5625 1 0; aspect-ratio: 9 / 16; }

/* Stickers */
.stickers { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
.stickers img { width: 100%; height: auto; display: block; transition: transform .2s; }
.stickers img:hover { transform: scale(1.1) rotate(-4deg); }

/* Footer */
.footer { text-align: center; padding: 50px 16px; border-top: 1px solid #ffffff12; margin-top: 40px; }
.footer p { color: var(--muted); margin-top: 6px; }
.footer .small { font-size: .85rem; }
.store-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 20px 0; }

/* Modal */
.modal, .lightbox {
  position: fixed; inset: 0; z-index: 50; display: none;
  background: #000c; padding: 16px; overflow-y: auto;
}
.lightbox { z-index: 60; background: #000e; }
.modal.open, .lightbox.open { display: flex; align-items: center; justify-content: center; }
.modal-box {
  position: relative; background: var(--card); border-radius: var(--radius);
  max-width: 800px; width: 100%; padding: 24px; margin: auto;
}
.modal-box h2 { font-size: 1.8rem; margin: 6px 0; }
.modal-box p { color: var(--muted); margin-bottom: 18px; }
.modal-box .wide { margin: 28px 0 16px; }
.close {
  position: absolute; top: 2px; right: 8px; z-index: 2;
  width: 44px; height: 44px; line-height: 1;
  background: none; border: 0; color: #fff; font-size: 2rem; cursor: pointer;
}
.modal-title { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.modal-title img { width: 64px; height: 64px; border-radius: 14px; flex: none; }
.mini-shots { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 8px; margin-bottom: 20px; }
.mini-shots .shot { flex: 0 0 120px; scroll-snap-align: start; }
.get-row { display: flex; align-items: center; gap: 20px; }
.qr { width: 110px; border-radius: 8px; background: #fff; }
.lightbox img { max-width: calc(100% - 112px); max-height: 90vh; border-radius: 12px; }
.arrow {
  flex: none; width: 48px; height: 48px; margin: 0 4px; border: 0; border-radius: 50%; cursor: pointer;
  background: #ffffff22; color: #fff; font-size: 1.8rem; line-height: 1;
}

/* Tablet */
@media (max-width: 900px) {
  .nav nav { gap: 11px; font-size: .86rem; }
  .dl-card { padding: 14px; }
  .stickers { grid-template-columns: repeat(6, 1fr); }
  .posters { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
}

/* Phone */
@media (max-width: 760px) {
  .logo { font-size: 1.4rem; }
  .menu-btn {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 10px; border: 0; background: none; cursor: pointer;
  }
  .menu-btn span { display: block; height: 2px; border-radius: 2px; background: var(--text); }
  .nav nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 6px 16px 12px; font-size: 1rem;
    background: #0e0f1af5; border-bottom: 1px solid #ffffff12;
  }
  .nav.open nav { display: flex; }
  .nav nav a { padding: 11px 0; color: var(--text); }

  .hero { grid-template-columns: 1fr; gap: 36px; padding: 44px 16px 30px; text-align: center; }
  .hero p { font-size: 1.05rem; margin: 12px 0 24px; }
  .hero-btns { justify-content: center; }
  .phones { max-width: 340px; margin: 0 auto; width: 100%; }

  .section { padding: 44px 16px; }
  .section h2 { font-size: 1.7rem; margin-bottom: 20px; }

  .grid, .video-grid, .downloads { grid-template-columns: 1fr; gap: 18px; }
  .dl-card { padding: 20px; }

  /* Portrait videos swipe sideways so one video never fills several screens */
  .video-grid.reel, .video-grid.tall {
    display: flex; justify-content: flex-start; gap: 14px;
    margin: 0 -16px; padding: 0 16px 10px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
  }
  .video-grid.reel .vcard, .video-grid.tall .vcard { flex: 0 0 70%; max-width: 280px; scroll-snap-align: start; }

  .shots { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stickers { grid-template-columns: repeat(4, 1fr); gap: 8px; }

  .modal, .lightbox { padding: 8px; }
  .modal-box { padding: 16px; }
  .modal-box h2 { font-size: 1.4rem; }
  .modal-title img { width: 52px; height: 52px; }
  .qr-wrap { display: none; } /* scanning a QR needs a second device */
  .get-row .btn { width: 100%; }

  .lightbox img { max-width: 100%; }
  .arrow { position: absolute; bottom: 16px; margin: 0; background: #000a; }
  .arrow.prev { left: calc(50% - 60px); }
  .arrow.next { right: calc(50% - 60px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
