:root {
  --deep: #030604;
  --water: #0b1f12;
  --pump: #7cff6b;
  --pump-dim: #3e8f35;
  --white: #f3f7f2;
  --muted: #7f8c82;
  --red: #ff6464;
  --font: "Bricolage Grotesque", ui-rounded, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--white);
  background: var(--deep);
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  -webkit-font-smoothing: antialiased;
}

/* De zee: foto vast achter alles, daarover het levende deel */
#seabg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #030604 url("assets/sea.jpg") center 45% / cover no-repeat;
  pointer-events: none;
}
#sea {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}
.top, main, .legal { position: relative; z-index: 1; }

.top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 1rem 1rem 0;
}
.title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.6rem;
}
.mark {
  font-weight: 800;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  letter-spacing: -0.03em;
  font-variation-settings: "opsz" 96;
}
.ticker {
  font-weight: 700;
  color: var(--pump);
  font-size: 1rem;
}

main {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 0 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stage-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.6s ease, transform 0.9s cubic-bezier(0.2, 1.4, 0.4, 1);
}
body.ready .stage-wrap { opacity: 1; transform: none; }
#stage { width: 100%; height: 100%; display: block; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

.chip {
  position: absolute;
  left: 50%;
  pointer-events: none;
  font-weight: 800;
  opacity: 0;
  transform: translate(-50%, 0);
}
.chip.combo {
  top: 6%;
  font-size: clamp(2rem, 8vw, 3.2rem);
  color: var(--pump);
  text-shadow: 0 0 24px rgba(124, 255, 107, 0.45);
}
.chip.ring {
  top: 14%;
  white-space: nowrap;
  font-size: 1.05rem;
  color: var(--deep);
  background: var(--pump);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
}
.chip.poke {
  top: 2%;
  font-size: 1rem;
  color: var(--white);
  background: #1b2a1e;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
}
.chip.ring.low { top: auto; bottom: 6%; }
/* Tekstballonnetjes */
.bubble {
  position: absolute;
  z-index: 3;
  max-width: min(48%, 240px);
  padding: 0.5rem 0.8rem;
  background: #f4fbf2;
  color: #07140c;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.25;
  border-radius: 16px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.9);
  transform-origin: 12% 100%;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.bubble.show { opacity: 1; transform: none; }
/* praatballon: puntje naar zijn hoofd */
.bubble::after {
  content: "";
  position: absolute;
  left: 14px;
  bottom: -8px;
  border-style: solid;
  border-width: 9px 9px 0 3px;
  border-color: #f4fbf2 transparent transparent transparent;
}
/* denkwolkje: twee bolletjes */
.bubble.thought {
  background: rgba(244, 251, 242, 0.93);
  font-weight: 600;
  font-style: italic;
  border-radius: 20px;
}
.bubble.thought::after {
  left: 10px;
  bottom: -12px;
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 50%;
  background: rgba(244, 251, 242, 0.93);
}
.bubble.thought::before {
  content: "";
  position: absolute;
  left: 3px;
  bottom: -21px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(244, 251, 242, 0.93);
}
@media (prefers-reduced-motion: reduce) {
  .bubble { transition: opacity 0.2s ease; transform: none; }
}

.chip.show { animation: chip 1.4s cubic-bezier(0.2, 1.3, 0.4, 1) forwards; }
@keyframes chip {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(0.6); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  70% { opacity: 1; transform: translate(-50%, -4px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -14px) scale(0.96); }
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.2rem;
}
.hero-label { color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.hero-value {
  font-size: clamp(2.3rem, 9vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.chart {
  width: min(420px, 100%);
  margin-top: 1.1rem;
}
.chart[hidden] { display: none; }
.chart canvas { display: block; width: 100%; height: 72px; }
.chart-foot {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.chart-key { display: inline-flex; align-items: center; gap: 0.3rem; }
.chart-key i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pump); }
.chart-key .dot-ring { box-shadow: 0 0 0 2px var(--deep); }
.chart-key .dot-reclaim { box-shadow: 0 0 0 2px var(--white); margin-left: 0.4rem; }
#full-chart { margin-left: auto; color: var(--pump); font-weight: 700; text-decoration: none; }
#full-chart[hidden] { display: none; }
#full-chart:hover { text-decoration: underline; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(420px, 100%);
  margin: 0.7rem 0 0;
}
.stats div { text-align: center; }
.stats dt { color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.stats dd {
  margin: 0.1rem 0 0;
  font-size: clamp(1.5rem, 5vw, 1.9rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stats dd.up { color: var(--pump); }
.stats dd.down { color: var(--red); }
.stats div + div { border-left: 1px solid rgba(243, 247, 242, 0.08); }

.timeline {
  width: min(420px, 100%);
  margin-top: 1.2rem;
}
.timeline[hidden] { display: none; }
.timeline ol { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.55rem 0.2rem;
  border-top: 1px solid rgba(243, 247, 242, 0.07);
  font-variant-numeric: tabular-nums;
}
.timeline li:first-child { border-top: 0; }
.timeline .n { font-weight: 800; }
.timeline .badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--deep);
  background: var(--pump);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
}
.timeline .t { color: var(--muted); grid-column: 3; }
.timeline .m { font-weight: 700; color: var(--white); }
.timeline li.newest .n,
.timeline li.newest .m { color: var(--pump); }
.more[hidden] { display: none; }
.more {
  display: block;
  margin: 0.4rem auto 0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pump);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
}

.line {
  margin: 1.4rem 0 1.1rem;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--white);
  text-align: center;
}

.perk {
  margin: 0 0 1.1rem;
  padding: 0.4rem 0.95rem;
  border: 1px solid rgba(124, 255, 107, 0.35);
  border-radius: 999px;
  color: var(--white);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
}
.perk b { color: var(--pump); font-weight: 800; }

.buy {
  display: inline-block;
  padding: 0.95rem 2rem;
  border-radius: 999px;
  background: var(--pump);
  color: var(--deep);
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  box-shadow: 0 0 0 0 rgba(124, 255, 107, 0.5);
  transition: transform 0.15s ease, box-shadow 0.25s ease;
}
.buy:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -8px rgba(124, 255, 107, 0.55); }
.buy:active { transform: translateY(0); }
.buy[aria-disabled="true"] { background: #1a2a1d; color: var(--muted); pointer-events: none; }

.ca {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.35rem 0.3rem 0.9rem;
  background: rgba(3, 6, 4, 0.55);
  font-size: 0.9rem;
  border: 1px solid rgba(124, 255, 107, 0.22);
  border-radius: 999px;
}
.ca[hidden] { display: none; }
.ca-label { color: var(--muted); font-size: 0.85rem; }
.ca code { font-family: var(--font); font-weight: 700; }
.ca button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  background: rgba(124, 255, 107, 0.12);
  color: var(--pump);
  cursor: pointer;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status[data-kind="live"] .dot { background: var(--pump); box-shadow: 0 0 10px var(--pump); }
.status[data-kind="demo"] .dot { background: var(--pump-dim); }

.links { display: flex; gap: 0.6rem; margin-top: 1rem; }
.links[hidden] { display: none; }
.links a {
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.45rem 1rem;
  border: 1px solid rgba(243, 247, 242, 0.18);
  border-radius: 999px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.links a:hover { border-color: var(--pump); color: var(--pump); }

.legal {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 0 1.2rem 2rem;
}
.legal p {
  margin: 0;
  color: #5d6960;
  font-size: 0.72rem;
  line-height: 1.55;
  text-align: center;
}

.dev {
  width: 100%;
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px dashed rgba(243, 247, 242, 0.2);
  border-radius: 14px;
}
.dev[hidden] { display: none; }
.dev label { display: block; color: var(--muted); font-size: 0.85rem; }
.dev input { width: 100%; accent-color: var(--pump); }
.dev-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.dev-btns button {
  font: inherit; font-weight: 700; cursor: pointer;
  border: 0; border-radius: 999px; padding: 0.5rem 0.9rem;
  background: #16261a; color: var(--white);
}

/* Telefoon: alles onder elkaar (de .side-groep telt niet mee).
   Volgorde: kopen eerst, chart en tijdlijn daaronder. */
.side { display: contents; }
.stage-wrap { order: 0; }
.hero { order: 1; }
.stats { order: 2; }
.line { order: 3; }
.perk { order: 4; }
.buy { order: 5; }
.chart { order: 6; }
.status { order: 7; }
.links { order: 8; }
.timeline { order: 9; }
.dev { order: 10; }

/* Laptop / desktop: Squeeze links, info rechts. Buy-knop altijd in beeld. */
@media (min-width: 900px) and (orientation: landscape) {
  .top { padding-top: 1rem; }
  main {
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    column-gap: 2.5rem;
    align-items: center;
    min-height: calc(100vh - 5rem);
    min-height: calc(100dvh - 5rem);
    padding-bottom: 1.5rem;
  }
  .stage-wrap {
    width: 100%;
    height: calc(100vh - 7rem);
    height: calc(100dvh - 7rem);
    max-height: 760px;
    aspect-ratio: auto;
  }
  .side {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .side .hero { order: 0; }
  .side .stats { order: 1; width: 100%; margin-top: 0.4rem; }
  .side .chart { order: 2; width: 100%; margin-top: 0.8rem; }
  .side .chart canvas { height: 70px; }
  .side .line { order: 3; margin: 0.9rem 0 0.6rem; }
  .side .perk { order: 3; margin-bottom: 0.9rem; }
  .side .buy { order: 4; }
  .side .links { order: 6; }
  .side .timeline { order: 7; width: 100%; max-height: 8.5rem; overflow-y: auto; scrollbar-width: thin; }
  .side .status { order: 8; margin-top: 0.8rem; }
  .side .dev { order: 9; }
}

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--pump);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .stage-wrap { transition: none; transform: none; }
  .chip.show { animation-duration: 2s; }
  .buy { transition: none; }
}

/* Link naar het spel */
.play-link {
  display: inline-block;
  align-self: center;
  margin-top: 0.6rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(124, 255, 107, 0.45);
  color: #7cff6b;
  font-weight: 700;
  text-decoration: none;
  background: rgba(3, 12, 8, 0.55);
  order: 5;
}
.play-link:hover { background: rgba(124, 255, 107, 0.12); }
