/* PlayDSA website — "night arena" style, matching the app. No external assets, no tracking. */
:root {
  --bg: #070b18;
  --sky: #111a3a;
  --panel: rgba(21, 29, 61, 0.72);
  --rim: rgba(255, 255, 255, 0.12);
  --text: #eaf2ff;
  --muted: #8a94b8;
  --cyan: #39f3ff;
  --magenta: #ff4fd0;
  --lime: #9dff4a;
  --amber: #ffc23d;
  --violet: #8b6cff;
  --radius: 20px;
  --font: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --display: "Fredoka", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body { overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 70%, rgba(139, 108, 255, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--sky) 55%, var(--bg) 100%) fixed;
  line-height: 1.6;
  min-height: 100vh;
}

/* A neon floor grid fixed to the bottom of the viewport. */
body::before {
  content: "";
  position: fixed;
  inset: auto -50% 0 -50%;
  height: 45vh;
  background-image:
    linear-gradient(rgba(57, 243, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 243, 255, 0.18) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(420px) rotateX(62deg);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(to top, black, transparent 90%);
  -webkit-mask-image: linear-gradient(to top, black, transparent 90%);
  pointer-events: none;
  z-index: -1;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(1080px, 92vw); margin: 0 auto; }

/* ── Navigation ── */
nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 11, 24, 0.7);
  border-bottom: 1px solid var(--rim);
}
nav .wrap { display: flex; align-items: center; gap: 18px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--text); }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand:hover { text-decoration: none; }
nav .links { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
nav .links a { color: var(--muted); font-weight: 800; font-size: 0.95rem; }
nav .links a:hover, nav .links a.active { color: var(--text); text-decoration: none; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 18px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  border: 1.6px solid var(--cyan);
  color: var(--text);
  background: linear-gradient(180deg, rgba(57, 243, 255, 0.22), rgba(57, 243, 255, 0.08));
  box-shadow: 0 0 18px rgba(57, 243, 255, 0.28);
  transition: transform 0.12s, box-shadow 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 0 28px rgba(57, 243, 255, 0.5); }
.btn.primary { background: linear-gradient(180deg, #ffd25e, #e0a21f); border-color: var(--amber); color: #0a0f22; box-shadow: 0 0 22px rgba(255, 194, 61, 0.45); }

/* ── Hero ── */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 70px 0 40px; }
.kicker { font-family: var(--display); color: var(--cyan); letter-spacing: 5px; font-weight: 700; font-size: 0.85rem; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0.3em 0; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); text-shadow: 0 0 30px rgba(57, 243, 255, 0.35); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
.lead { color: var(--muted); font-size: 1.15rem; font-weight: 700; max-width: 36em; }
.cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.note { color: var(--muted); font-size: 0.9rem; font-weight: 700; margin-top: 12px; }

/* CSS-only 3D crates, like the in-game arena. */
.stage { height: 340px; perspective: 900px; display: flex; align-items: flex-end; justify-content: center; }
.row { display: flex; gap: 18px; align-items: flex-end; transform: rotateX(-14deg) rotateY(-26deg); transform-style: preserve-3d; animation: sway 7s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotateX(-14deg) rotateY(-26deg); } 50% { transform: rotateX(-12deg) rotateY(-14deg); } }
.crate { --h: 120px; --w: 52px; --c: #39436b; --g: transparent; position: relative; width: var(--w); height: var(--h); transform-style: preserve-3d; animation: bob 3.2s ease-in-out infinite; }
.crate:nth-child(2n) { animation-delay: -1.2s; }
.crate:nth-child(3n) { animation-delay: -2.1s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.crate .f, .crate .t, .crate .s { position: absolute; border: 1.6px solid color-mix(in srgb, var(--c) 55%, white); }
/* A real cube: front pushed forward, top laid flat on the top edge, side standing at the right edge. */
.crate .f { inset: 0; transform: translateZ(calc(var(--w) / 2)); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 92%, white), var(--c)); display: flex; justify-content: center; padding-top: 8px; font-family: var(--display); font-weight: 700; color: white; box-shadow: 0 0 24px var(--g); }
.crate .t { left: 0; top: calc(var(--w) / -2); width: var(--w); height: var(--w); transform: rotateX(90deg); background: color-mix(in srgb, var(--c) 75%, white); }
.crate .s { left: calc(var(--w) / 2); top: 0; width: var(--w); height: var(--h); transform: rotateY(90deg); background: color-mix(in srgb, var(--c) 65%, black); }
.tag { position: absolute; top: -48px; left: 50%; transform: translateX(-50%); background: var(--cyan); color: #0a0f22; font-family: var(--display); font-weight: 700; font-size: 0.75rem; letter-spacing: 1.4px; padding: 3px 9px; border-radius: 8px; box-shadow: 0 0 14px var(--cyan); white-space: nowrap; }
.crate .tag { transform: translateX(-50%) translateZ(calc(var(--w) / 2)); }

/* ── Phone mockups ── */
.phone { position: relative; border-radius: 34px; padding: 9px; background: linear-gradient(160deg, #2a3463, #0d1430); border: 1.5px solid rgba(255, 255, 255, 0.16); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(57, 243, 255, 0.18); }
.phone img { display: block; width: 100%; border-radius: 26px; }
.phones { position: relative; height: 560px; perspective: 1400px; }
.phones .phone { position: absolute; width: 250px; }
.phones .front { right: 70px; top: 10px; transform: rotateY(-18deg) rotateX(6deg) rotateZ(2deg); animation: float 6s ease-in-out infinite; z-index: 2; }
.phones .back { right: 250px; top: 70px; width: 215px; transform: rotateY(22deg) rotateX(4deg) rotateZ(-4deg); opacity: 0.8; animation: float 7s ease-in-out -2s infinite; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }
.chip { position: absolute; z-index: 3; font-family: var(--display); font-weight: 700; letter-spacing: 2px; padding: 8px 14px; border-radius: 12px; font-size: 0.9rem; }
.chip.c1 { right: 20px; top: 120px; background: var(--amber); color: #0a0f22; box-shadow: 0 0 24px rgba(255, 194, 61, 0.6); animation: float 4s ease-in-out -1s infinite; }
.chip.c2 { right: 290px; bottom: -6px; background: rgba(157, 255, 74, 0.14); color: var(--lime); border: 1.5px solid var(--lime); box-shadow: 0 0 24px rgba(157, 255, 74, 0.35); animation: float 5s ease-in-out -3s infinite; }

/* ── Mission walkthrough ── */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 28px; }
.step { margin: 0; text-align: center; }
.step .phone { width: min(240px, 100%); margin: 0 auto 16px; }
.step:nth-child(2) .phone { transform: translateY(-14px); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), 0 0 50px rgba(57, 243, 255, 0.35); }
.step b { display: block; font-family: var(--display); font-size: 1.2rem; }
.step span { color: var(--muted); font-weight: 700; }

/* ── Gallery ── */
.gallery { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 26px max(4vw, calc((100vw - 1080px) / 2)) 30px; scrollbar-width: thin; scrollbar-color: rgba(57, 243, 255, 0.4) transparent; }
.gallery figure { margin: 0; flex: 0 0 auto; width: 230px; scroll-snap-align: center; text-align: center; }
.gallery figcaption { margin-top: 12px; color: var(--muted); font-weight: 800; }
.gallery .phone { transition: transform 0.25s, box-shadow 0.25s; }
.gallery .phone:hover { transform: translateY(-8px) rotateZ(-1deg); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), 0 0 50px rgba(57, 243, 255, 0.4); }

/* ── Sections & cards ── */
section { padding: 50px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.card {
  background: var(--panel);
  border: 1.4px solid var(--rim);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card h3 { font-size: 1.25rem; }
.card p { color: var(--muted); font-weight: 700; margin: 0.4em 0 0; }
.icon { font-size: 1.7rem; }
.worlds { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.world { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 1.4px solid var(--rim); border-left: 4px solid var(--c, var(--cyan)); }
.world b { font-family: var(--display); font-size: 1.05rem; }
.world span { display: block; color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.num { font-family: var(--display); color: var(--c, var(--cyan)); font-weight: 700; min-width: 2ch; }
.stats { display: flex; gap: 30px; flex-wrap: wrap; justify-content: center; text-align: center; }
.stat b { display: block; font-family: var(--display); font-size: 2.6rem; color: var(--amber); text-shadow: 0 0 20px rgba(255, 194, 61, 0.4); }
.stat span { color: var(--muted); font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; font-size: 0.8rem; }
.promise { text-align: center; }
.promise ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.promise li { padding: 8px 16px; border-radius: 30px; border: 1.4px solid var(--lime); color: var(--lime); font-weight: 800; background: rgba(157, 255, 74, 0.08); }

/* ── Long-form pages (privacy, how to use) ── */
.doc { padding: 50px 0 80px; }
.doc .card { padding: 30px clamp(20px, 4vw, 44px); }
.doc h1 { font-size: clamp(2rem, 5vw, 3rem); }
.doc h2 { font-size: 1.5rem; margin-top: 1.6em; color: var(--cyan); }
.doc h3 { font-size: 1.15rem; margin-top: 1.2em; }
.doc p, .doc li { color: #cfd7f2; font-weight: 600; }
.doc li { margin: 0.35em 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rim); vertical-align: top; }
.doc th { font-family: var(--display); color: var(--amber); font-weight: 700; }
.updated { color: var(--muted); font-weight: 800; }
.callout { border-left: 4px solid var(--lime); background: rgba(157, 255, 74, 0.08); padding: 14px 18px; border-radius: 12px; margin: 1.2em 0; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 52px; margin: 18px 0; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: rgba(57, 243, 255, 0.15); border: 1.4px solid var(--cyan); color: var(--cyan); font-family: var(--display); font-weight: 700; }
kbd, code { font-family: ui-monospace, Menlo, Consolas, monospace; background: rgba(255, 255, 255, 0.08); padding: 1px 6px; border-radius: 6px; font-size: 0.92em; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 1em 0 0.5em; }
.toc a { padding: 6px 12px; border-radius: 20px; border: 1px solid var(--rim); color: var(--text); font-weight: 800; font-size: 0.9rem; }

/* ── Footer ── */
footer { border-top: 1px solid var(--rim); padding: 28px 0 40px; color: var(--muted); font-weight: 700; font-size: 0.92rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 24px; justify-content: space-between; }
footer a { color: var(--muted); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; text-align: center; }
  .hero .lead { margin: 0 auto; }
  .cta { justify-content: center; }
  .stage { height: 280px; }
  .phones { height: 470px; margin-top: 10px; }
  .phones .front { right: 50%; transform: translateX(50%) rotateY(-12deg) rotateX(4deg); width: 220px; top: 0; }
  .phones .back { right: 50%; transform: translateX(-5%) rotateY(18deg) rotateX(4deg) rotateZ(-4deg); width: 180px; top: 50px; }
  .chip.c1 { right: 6%; top: 60px; }
  .chip.c2 { right: auto; left: 4%; bottom: -14px; }
  .trio { grid-template-columns: 1fr; }
  .step:nth-child(2) .phone { transform: none; }
  .crate { --w: 40px; }
  nav .links { gap: 12px; }
  nav .links a { font-size: 0.85rem; }
  nav .links a.wide { display: none; }
  .brand span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .row, .crate, .phone, .chip { animation: none !important; }
  html { scroll-behavior: auto; }
}
