:root {
  --night: #071226;
  --panel: #0d1d3a;
  --line: #24406f;
  --blue: #1f4fa8;
  --sky: #6fa4ff;
  --amber: #ffb020;
  --sand: #ffd68c;
  --text: #eaf0fc;
  --muted: #a3b5d6;
  --up: #2fc99a;
  --down: #f0626b;
}

* { box-sizing: border-box; }

html { background: var(--night); }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font: 500 1rem/1.5 Manrope, system-ui, sans-serif;
}

[hidden] { display: none !important; }

h1, h2, p, dl, dd { margin: 0; }

h1:focus, h2:focus { outline: none; }

button { font: inherit; cursor: pointer; }

button:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

/* Challenge: has to pass for a real trading product until the click */
.challenge {
  min-height: 100dvh;
  padding: 1.25rem 1rem 2rem;
  background: radial-gradient(60rem 36rem at 75% 20%, #123a86 0%, transparent 70%), var(--night);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 62rem;
  margin: 0 auto 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: flex-end;
  gap: .5rem;
  font-size: 1.25rem;
  font-weight: 800;
}

.brand-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 1.1rem; }
.brand-bars i { width: 5px; background: var(--amber); }
.brand-bars i:nth-child(1) { height: 40%; }
.brand-bars i:nth-child(2) { height: 70%; }
.brand-bars i:nth-child(3) { height: 100%; }

.online { color: var(--muted); font-size: .875rem; }
.online::before {
  content: "";
  display: inline-block;
  width: .5rem;
  height: .5rem;
  margin-right: .4rem;
  border-radius: 50%;
  background: var(--up);
}

.offer {
  display: grid;
  gap: 2rem;
  max-width: 62rem;
  margin: 0 auto;
}

.avatar {
  display: block;
  width: 6.25rem;
  height: 7.5rem;
  margin-bottom: 1rem;
  border-radius: 1rem;
  outline: 1px solid var(--sky);
  image-rendering: pixelated;
}

h1 {
  font-size: clamp(2.25rem, 8vw, 3.75rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.pitch p {
  max-width: 28rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.125rem;
}

.ticket {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--panel);
}

.signal {
  padding: 1rem;
  border-radius: .75rem;
  background: var(--night);
}

.signal-head { display: flex; justify-content: space-between; align-items: baseline; }
.tf { color: var(--sand); font-size: .875rem; }

.chart { display: block; width: 100%; margin: .75rem 0; }
.chart .tp { fill: var(--up); opacity: .18; }
.chart .sl { fill: var(--down); opacity: .18; }
.chart polyline { fill: none; stroke: var(--sky); stroke-width: 2.5; }

.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.levels dt { color: var(--muted); font-size: .8125rem; }
.levels dd { font-weight: 700; font-variant-numeric: tabular-nums; }

.terms { margin: .75rem .25rem 1rem; }

.terms div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .625rem 0;
  border-bottom: 1px solid var(--line);
}

.terms dt { color: var(--muted); }
.terms dd { font-weight: 700; text-align: right; }
.terms s { margin-right: .375rem; color: var(--muted); font-weight: 500; }

.discount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin: 0 .25rem 1rem;
  color: var(--sand);
  font-size: .9375rem;
  line-height: 1.35;
}

.story-done {
  flex: none;
  min-height: 2.75rem;
  padding: 0 .875rem;
  border: 1px solid var(--sand);
  border-radius: .625rem;
  background: transparent;
  color: var(--sand);
  font-weight: 700;
}

.story-done:hover:not(:disabled) { background: var(--night); }
.story-done:disabled { cursor: progress; opacity: .7; }

.accept {
  width: 100%;
  min-height: 3.25rem;
  border: 0;
  border-radius: .75rem;
  background: var(--amber);
  color: var(--night);
  font-size: 1.125rem;
  font-weight: 800;
}

.accept:hover { background: var(--sand); }

/* Everything after the click is bitmap: hard edges, no radius, no gradients */
.crash {
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.bitmap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  min-height: 100dvh;
  padding: 1.25rem 1rem;
  background: var(--night);
  font-family: "Pixelify Sans", monospace;
  text-align: center;
}

.meme {
  color: var(--amber);
  font-size: clamp(2rem, 9vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  text-wrap: balance;
}

/* Frames are 80 columns by 36 lines: fit whichever side runs out first */
.rick-frames {
  margin: 0;
  overflow: hidden;
  color: var(--sand);
  font: 400 min(calc((100vw - 2rem) / 49), calc(62dvh / 36)) / 1 "Courier New", monospace;
  text-align: left;
}

.controls { display: flex; gap: .75rem; }

.pixel-btn {
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 3px solid var(--sky);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 1.125rem;
}

.pixel-btn:hover { background: var(--blue); }

.frame {
  width: min(100%, 24rem);
  padding: .875rem;
  background: #000;
  box-shadow: 0 0 0 4px var(--line), 8px 8px 0 4px var(--blue);
}

.cert {
  padding: 1.5rem 1.25rem;
  background: var(--blue);
  text-align: left;
}

.cert-kind { color: var(--sand); font-size: 1.25rem; }
.cert-title { font-size: 2.25rem; font-weight: 700; line-height: 1.05; }
/* Pixelify's 5 reads as an S, so the figure uses a font with unambiguous digits */
.cert-amount { margin-top: .75rem; color: var(--amber); font: 700 clamp(2.5rem, 13vw, 3.25rem) / 1 Silkscreen, monospace; }
.cert-name { margin-top: .5rem; font-size: 1.5rem; }
.cert-sign { margin-top: 1rem; color: var(--sand); }

.final h2 {
  margin-top: 1rem;
  color: var(--amber);
  font-size: clamp(2.25rem, 9vw, 3.5rem);
  font-weight: 700;
  line-height: 1.05;
}

.love { max-width: 26rem; font-size: 1.375rem; line-height: 1.3; }

@media (min-width: 52rem) {
  .topbar { margin-bottom: 4rem; }
  .offer { grid-template-columns: 1fr 24rem; align-items: center; gap: 4rem; }
  .avatar { width: 10rem; height: 12rem; }
}
