/* Colours and fonts follow the app (app/src/theme.ts, dark theme): Fredoka for headings and
   buttons, the system font for body text. */
:root {
  --bg: #070a16;
  --bg-2: #0b1021;
  --card: #10152a;
  --card-2: #151c38;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #eef0fa;
  --muted: #9aa3c0;
  --link: #8aa6ff;
  --accent: #3866f0;
  --violet: #7c4dff;
  --up: #22c39a;
  --up-deep: #0b7d66;
  --down: #ef5350;
  --down-deep: #c62f45;
  --gold: #ffc93d;
  --grad-accent: linear-gradient(135deg, var(--violet) 0%, var(--accent) 100%);
  --grad-gold: linear-gradient(135deg, #ffcf3f 0%, #f59e00 100%);
  --display: "Fredoka", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --radius: 1.25rem;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(124, 77, 255, .22), transparent 60%),
    radial-gradient(50rem 35rem at -10% 10%, rgba(56, 102, 240, .18), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, .display { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; }
h1, h2, h3 { line-height: 1.1; margin: 0; }
p { margin: 0; }
a { color: var(--link); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: .4rem; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 48rem) { .wrap { padding: 0 2rem; } }

.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 99; background: var(--card); padding: .5rem 1rem; }

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

header.top {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(7, 10, 22, .72);
  border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; gap: 1.5rem; height: 4rem; }
.brand {
  display: flex; align-items: center; gap: .6rem;
  color: var(--text); text-decoration: none;
  font-family: var(--display); font-weight: 700; font-size: 1.15rem;
}
header.top .brand { margin-right: auto; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 4px 14px rgba(56, 102, 240, .35); }
.top nav { display: none; gap: 1.5rem; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; }
.top nav a:hover { color: var(--text); }
.top .lang { color: var(--muted); font-size: .9rem; text-decoration: none; font-weight: 600; }
.top .lang:hover { color: var(--text); }
.top .btn { display: none; }
@media (min-width: 52rem) {
  .top nav { display: flex; }
  .top .btn { display: inline-flex; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  padding: .6rem 1.2rem; border-radius: 999px; border: 0; cursor: pointer;
  color: #fff; background: var(--grad-accent); text-decoration: none;
  box-shadow: 0 4px 0 #2a3fa8, 0 10px 24px rgba(56, 102, 240, .35);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #2a3fa8, 0 4px 12px rgba(56, 102, 240, .3); }
.btn.small { padding: .45rem 1rem; font-size: .92rem; }

.stores { display: flex; flex-wrap: wrap; gap: .75rem; }
.store {
  display: inline-flex; align-items: center; gap: .7rem;
  min-width: 11rem; padding: .6rem 1.15rem .6rem .9rem; border-radius: .9rem;
  background: #fff; color: #0b1021; text-decoration: none; line-height: 1.15;
  box-shadow: 0 4px 0 #b9c0d6, 0 12px 28px rgba(0, 0, 0, .35);
  transition: transform .12s ease, box-shadow .12s ease;
}
.store:hover { transform: translateY(-2px); }
.store:active { transform: translateY(3px); box-shadow: 0 1px 0 #b9c0d6; }
.store svg { width: 26px; height: 26px; flex: none; }
.store span { display: flex; flex-direction: column; }
.store small { font-size: .72rem; color: #4a5370; }
.store strong { font-family: var(--display); font-size: 1.15rem; }
.note { color: var(--muted); font-size: .88rem; margin-top: .9rem; display: flex; align-items: center; gap: .45rem; }
.note::before {
  content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 4px rgba(255, 201, 61, .18);
}

/* ---------- Hero ---------- */

.hero { display: grid; gap: 2.5rem; align-items: center; padding: 3rem 0 2rem; }
@media (min-width: 60rem) { .hero { grid-template-columns: 1fr 1.05fr; padding: 5rem 0 3rem; } }

.pill {
  display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .35rem .85rem; border-radius: 999px;
  background: rgba(124, 77, 255, .14); border: 1px solid rgba(124, 77, 255, .35);
  color: #c9bcff; font-size: .85rem; font-weight: 600; margin-bottom: 1.25rem;
}
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); margin-bottom: 1.25rem; }
.hero h1 .long { color: var(--up); }
.hero h1 .short { color: var(--down); }
.hero h1 .glow {
  background: linear-gradient(90deg, #a98bff, #6f95ff 50%, var(--up));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { color: var(--muted); font-size: 1.15rem; max-width: 34rem; margin-bottom: 2rem; }
.lede strong { color: var(--text); }
.lede .up { color: var(--up); }
.lede .down { color: var(--down); }

.hero-art { position: relative; }
.hero-art .frame {
  position: relative; border-radius: 1.75rem; overflow: hidden;
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 80px rgba(56, 102, 240, .28), 0 0 0 6px rgba(255, 255, 255, .02);
  aspect-ratio: 5 / 4;
}
/* The art's left third is empty sky meant to sit behind text, so crop to the bull and the chart. */
.hero-art .frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 78% center; }
.hero-art::before {
  content: ""; position: absolute; inset: -8%; z-index: -1;
  background: radial-gradient(closest-side, rgba(124, 77, 255, .45), transparent);
  filter: blur(30px);
}
.sticker { position: absolute; width: 22%; max-width: 6.5rem; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .45)); }
.sticker.s1 { left: -5%; bottom: -10%; animation: bob 4s ease-in-out infinite; }
.sticker.s2 { right: -4%; top: -14%; width: 17%; animation: bob 4.6s ease-in-out -1.5s infinite; }
.sticker.s3 { right: 10%; bottom: -14%; width: 19%; animation: bob 5s ease-in-out -.8s infinite; }
@media (max-width: 40rem) { .sticker.s1 { left: -2%; } .sticker.s2 { right: 0; } }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-4deg); } }

/* ---------- Facts strip ---------- */

.facts {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  margin: 2rem 0 0;
}
@media (min-width: 48rem) { .facts { grid-template-columns: repeat(4, 1fr); } }
.facts div { background: var(--bg-2); padding: 1.1rem 1.25rem; }
.facts b { display: block; font-family: var(--display); font-size: 1.6rem; line-height: 1.1; }
.facts span { color: var(--muted); font-size: .9rem; }

/* ---------- Sections ---------- */

section.block { padding: 5rem 0 0; }
.kicker {
  font-family: var(--display); font-weight: 600; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .75rem;
}
.block > h2, .block .head h2 { font-size: clamp(2rem, 4.5vw, 2.9rem); margin-bottom: 1rem; max-width: 40rem; }
.block .sub { color: var(--muted); font-size: 1.1rem; max-width: 40rem; }

/* How a round works: steps beside the playable demo */
.how { display: grid; gap: 2rem; margin-top: 2.5rem; align-items: start; }
@media (min-width: 60rem) { .how { grid-template-columns: .85fr 1.15fr; gap: 3rem; } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; counter-reset: step; }
.steps li {
  counter-increment: step; position: relative;
  padding: 1.1rem 1.25rem 1.1rem 4.2rem; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
}
.steps li::before {
  content: counter(step); position: absolute; left: 1.1rem; top: 1.1rem;
  width: 2.2rem; height: 2.2rem; border-radius: .7rem; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; color: #fff; background: var(--grad-accent);
}
.steps h3 { font-size: 1.15rem; margin-bottom: .25rem; }
.steps p { color: var(--muted); }

.demo {
  background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line-2);
  border-radius: 1.5rem; padding: 1.1rem; box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
}
.demo-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; margin-bottom: .75rem; }
.demo-head .display { font-size: 1.05rem; }
.demo-head .tag { font-size: .8rem; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); padding: .2rem .6rem; border-radius: 999px; }
.chart { position: relative; border-radius: 1rem; background: #0b1021; overflow: hidden; aspect-ratio: 2 / 1; }
.chart svg { display: block; width: 100%; height: 100%; }
.chart .grid line { stroke: #161d36; stroke-width: 1; }
.chart .c { transition: opacity .25s ease; }
.chart .entry { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 5 5; opacity: 0; }
.chart.played .entry { opacity: .9; }
.chart .curtain {
  position: absolute; top: 0; bottom: 0; right: 0; width: 30%;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .03) 0 10px, transparent 10px 20px), rgba(16, 21, 42, .92);
  border-left: 2px dashed rgba(255, 255, 255, .18);
  display: grid; place-items: center; font-family: var(--display); font-size: 2.6rem; color: rgba(255, 255, 255, .35);
  transition: opacity .4s ease, transform .6s cubic-bezier(.2, .8, .2, 1);
}
.chart.played .curtain { opacity: 0; transform: translateX(30%); pointer-events: none; }
.result {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.6); opacity: 0;
  padding: .55rem 1.1rem; border-radius: 999px; font-family: var(--display); font-weight: 700; font-size: 1.3rem;
  background: rgba(7, 10, 22, .85); border: 2px solid var(--line-2); white-space: nowrap;
  transition: transform .35s cubic-bezier(.2, 1.6, .4, 1), opacity .2s ease;
}
.result.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.result.win { color: var(--up); border-color: var(--up); box-shadow: 0 0 30px rgba(34, 195, 154, .35); }
.result.loss { color: var(--down); border-color: var(--down); box-shadow: 0 0 30px rgba(239, 83, 80, .3); }
.result.skip { color: var(--gold); border-color: var(--gold); }

.calls { display: grid; grid-template-columns: 1fr 1fr .7fr; gap: .6rem; margin-top: .9rem; }
.calls button {
  font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: #fff;
  border: 0; border-radius: 1rem; padding: .8rem .5rem; cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease, filter .12s ease;
}
.calls button:hover { filter: brightness(1.1); }
.calls button:active { transform: translateY(3px); }
.calls button:disabled { filter: grayscale(.6) brightness(.7); cursor: default; transform: none; }
.calls .long { background: linear-gradient(180deg, #17a585, var(--up-deep)); box-shadow: 0 4px 0 #075646; }
.calls .short { background: linear-gradient(180deg, var(--down), var(--down-deep)); box-shadow: 0 4px 0 #8e1f30; }
.calls .skip { background: var(--card-2); box-shadow: 0 4px 0 #0a0e1e; border: 1px solid var(--line-2); color: var(--muted); }
.demo-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .9rem; min-height: 2.4rem; }
.demo-foot p { color: var(--muted); font-size: .9rem; }
.again { display: none; }
.demo.done .again { display: inline-flex; }
.no-js .demo { display: none; }

/* Bento grid of modes and features */
.bento { display: grid; gap: 1rem; margin-top: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) {
  .bento { grid-template-columns: repeat(4, 1fr); }
  .tile.wide { grid-column: span 2; }
  .tile.tall { grid-row: span 2; }
}
.tile {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem 1.4rem 1.5rem; min-height: 12rem;
  transition: transform .2s ease, border-color .2s ease;
}
.tile:hover { transform: translateY(-3px); border-color: var(--line-2); }
.tile h3 { font-size: 1.35rem; margin-bottom: .5rem; }
.tile p { color: var(--muted); max-width: 26rem; }
.tile ul { margin: .75rem 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.tile li { font-size: .85rem; font-weight: 600; padding: .25rem .65rem; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.tile .art { position: absolute; right: -.25rem; bottom: -.5rem; width: 5rem; z-index: -1; opacity: .95; transform: rotate(-8deg); filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .4)); }
.tile.has-art { padding-bottom: 4.5rem; }
.tile.wide.has-art { padding-bottom: 1.5rem; padding-right: 8rem; }
.tile.wide .art { width: 7rem; right: .5rem; top: 50%; bottom: auto; transform: translateY(-50%) rotate(-8deg); }
.tile.daily { background: radial-gradient(28rem 16rem at 100% 100%, rgba(255, 140, 50, .25), transparent 70%), linear-gradient(180deg, var(--card-2), var(--card)); }
.tile.compete { background: radial-gradient(28rem 16rem at 100% 100%, rgba(255, 201, 61, .22), transparent 70%), linear-gradient(180deg, var(--card-2), var(--card)); }
.tile.learn { background: radial-gradient(24rem 16rem at 100% 100%, rgba(56, 102, 240, .3), transparent 70%), linear-gradient(180deg, var(--card-2), var(--card)); }
.tile.yours { background: radial-gradient(24rem 16rem at 100% 100%, rgba(124, 77, 255, .3), transparent 70%), linear-gradient(180deg, var(--card-2), var(--card)); }
.tile .faces { display: flex; align-items: flex-end; gap: .4rem; margin-top: 1rem; }
.tile .faces img { width: auto; height: 5.5rem; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .4)); }
.tile .faces img:nth-child(2) { height: 6.25rem; }
.tile .faces img:nth-child(3) { height: 4rem; }
.mini { display: flex; gap: .3rem; margin-top: 1rem; }
.mini i { width: 1.6rem; height: 1.6rem; border-radius: .4rem; display: block; }
.mini .w { background: var(--up); }
.mini .l { background: var(--down); }
.mini .s { background: #3a4466; }

/* Long vs short explainer */
.versus { display: grid; gap: 1rem; margin-top: 2.5rem; }
@media (min-width: 48rem) { .versus { grid-template-columns: 1fr 1fr; } }
.side {
  display: flex; gap: 1.25rem; align-items: flex-start;
  border-radius: var(--radius); padding: 1.5rem; border: 1px solid var(--line);
}
.side img { width: 5rem; flex: none; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .4)); }
.side h3 { font-size: 1.5rem; margin-bottom: .4rem; }
.side p { color: var(--muted); }
.side.bull { background: linear-gradient(135deg, rgba(34, 195, 154, .16), rgba(34, 195, 154, .03)); border-color: rgba(34, 195, 154, .3); }
.side.bull h3 { color: var(--up); }
.side.bear { background: linear-gradient(135deg, rgba(239, 83, 80, .16), rgba(239, 83, 80, .03)); border-color: rgba(239, 83, 80, .3); }
.side.bear h3 { color: var(--down); }
.versus + p { color: var(--muted); margin-top: 1.25rem; max-width: 46rem; }

/* FAQ */
.faq { margin-top: 2rem; display: grid; gap: .75rem; max-width: 50rem; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 1rem; }
.faq details[open] { border-color: var(--line-2); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.1rem 3rem 1.1rem 1.25rem; position: relative;
  font-family: var(--display); font-weight: 600; font-size: 1.12rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%);
  width: 1.7rem; height: 1.7rem; border-radius: .5rem; display: grid; place-items: center;
  background: var(--card-2); color: var(--link); font-size: 1.2rem; transition: transform .2s ease;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 1.25rem 1.2rem; color: var(--muted); }

/* Closing call to action */
.cta {
  position: relative; overflow: hidden; margin: 6rem 0 0; padding: 3rem 1.5rem;
  border-radius: 2rem; text-align: center;
  background: radial-gradient(40rem 20rem at 50% 120%, rgba(255, 201, 61, .25), transparent 70%), var(--grad-accent);
  box-shadow: 0 30px 80px rgba(56, 102, 240, .35);
}
.cta h2 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: .75rem; }
.cta p { color: rgba(255, 255, 255, .85); font-size: 1.1rem; max-width: 32rem; margin: 0 auto 1.75rem; }
.cta .stores { justify-content: center; }
.cta .note { justify-content: center; color: rgba(255, 255, 255, .8); }
.cta .gems { position: absolute; width: 9rem; left: -1.5rem; bottom: -1.5rem; opacity: .9; transform: rotate(10deg); }
.cta .coin { position: absolute; width: 4.5rem; right: 1.5rem; top: 1.25rem; transform: rotate(-12deg); animation: bob 4s ease-in-out infinite; }
@media (max-width: 40rem) { .cta .gems { width: 6rem; } .cta .coin { width: 3rem; } }

/* ---------- Text pages (support, 404) ---------- */

.page { padding-top: 3rem; padding-bottom: 4rem; }
.page > * { max-width: 46rem; }
.page h1 { font-size: clamp(2.2rem, 5vw, 3rem); margin-bottom: 1.25rem; }
.page > p { color: var(--muted); font-size: 1.05rem; margin-bottom: 1rem; }
.page > p strong { color: var(--text); }
.page h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; }
.page .faq { margin-top: 0; }
.contact {
  display: grid; gap: 1rem; margin: 2rem 0;
}
@media (min-width: 40rem) { .contact { grid-template-columns: 1fr 1fr; } }
.contact div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.contact h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.contact p { color: var(--muted); }

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

footer { margin-top: 5rem; border-top: 1px solid var(--line); background: rgba(0, 0, 0, .2); color: var(--muted); font-size: .9rem; }
footer .wrap { padding-top: 2.5rem; padding-bottom: 3rem; display: grid; gap: 1.5rem; }
@media (min-width: 48rem) { footer .wrap { grid-template-columns: 1fr 1.6fr; } }
footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-content: start; }
footer nav a { color: var(--text); text-decoration: none; font-weight: 600; }
footer nav a:hover { color: var(--link); }
footer .fine { grid-column: 1 / -1; display: grid; gap: .5rem; font-size: .82rem; }

/* ---------- Scroll reveal (only with JS, see site.js) ---------- */

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
