/* Vibe Coder player pages: the whole look, for every page the server renders (vibe_server/pages/render.py).

   How it is organised:
   - body classes: t-<template> (weekend_saas, guru_course, token, notice, static), c-<color> (the player's pick,
     ids from vibe_server/pages/content_en.json; tests check each color id has a rule here with the same hex),
     state-<listed|acquired|between>.
   - No scripts on these pages (CSP script-src none). Every gag that moves is a CSS animation.
   - The base rules draw the finished picture. Animations only add motion on top, so prefers-reduced-motion just
     turns them off, and an old browser shows a still page.
   - The counters (countdown, ticking token bill) need @property, which @supports cannot test for. They run
     only inside @supports (transition-behavior: allow-discrete), a newer feature that, as far as we know, every
     engine shipped after @property. Not checked against a compatibility table. A browser without it shows a
     static 14:59 and no tick. Checked in WebKit only (Quick Look snapshots, 26.11.2026).
   Colors match the app (Uspeh/UI/Shared/Theme.swift). */

@property --cd-t { syntax: "<integer>"; inherits: false; initial-value: 899; }
@property --cd-m { syntax: "<integer>"; inherits: false; initial-value: 14; }
@property --cd-s { syntax: "<integer>"; inherits: false; initial-value: 59; }
@property --bill-tick { syntax: "<integer>"; inherits: false; initial-value: 0; }
@property --bill-n { syntax: "<integer>"; inherits: false; initial-value: 0; }

:root {
  --bg: #07070D;
  --bg-elevated: #0E0E18;
  --text: #FFFFFF;
  --text-2: rgba(255, 255, 255, 0.64);
  --muted: rgba(255, 255, 255, 0.52);
  --faint: rgba(255, 255, 255, 0.40);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --hairline: rgba(255, 255, 255, 0.10);
  --purple: #7C5CFF;
  --cyan: #2FD6E8;
  --red: #FF4D6D;
  --green: #3DDC97;
  --gold: #FFC857;
  --pink: #FF5CC8;
  --accent: var(--purple);
  --accent-2: var(--cyan);
  --on-accent: #07070D;
  --radius-l: 24px;
  --radius: 18px;
  --radius-s: 12px;
  --gutter: 16px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

/* The player's color: --accent and --accent-2 (gradient end). Keep in step with "colors" in content_en.json. */
.c-purple { --accent: #7C5CFF; --accent-2: #2FD6E8; }
.c-cyan { --accent: #2FD6E8; --accent-2: #3DDC97; }
.c-red { --accent: #FF4D6D; --accent-2: #FFC857; }
.c-green { --accent: #3DDC97; --accent-2: #2FD6E8; }
.c-gold { --accent: #FFC857; --accent-2: #FF4D6D; }
.c-pink { --accent: #FF5CC8; --accent-2: #7C5CFF; }

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
  position: relative;
}

/* A soft glow of the player's color behind the top of the page. */
body::before {
  content: "";
  position: absolute;
  top: -180px;
  left: 0;
  right: 0;
  height: 520px;
  background: radial-gradient(closest-side, var(--accent), transparent);
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
}

h1, h2, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
h2 { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
a { color: inherit; }

.page {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 12px var(--gutter) 32px;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  display: grid;
  gap: 14px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
}

.label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.grad {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.btn-small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-fake {
  background: var(--surface-strong);
  color: var(--muted);
  cursor: not-allowed;
  text-decoration: line-through;
  text-decoration-color: var(--red);
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-strong);
  font-size: 13px;
  font-weight: 700;
}

/* ---------- top bar and footer ---------- */

.top { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.wordmark {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.parody {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 2px 8px;
}
.top .btn { margin-left: auto; }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 0 8px; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 12px; }
.foot a { color: var(--text-2); text-underline-offset: 3px; padding: 6px 0; }

.cta { text-align: center; display: grid; gap: 12px; justify-items: center; scroll-margin-top: 16px; }
.cta h2 { font-size: 22px; letter-spacing: -0.01em; text-transform: none; color: var(--text); margin: 0; }
.cta p { color: var(--text-2); }

/* ---------- hero ---------- */

/* overflow: hidden keeps the stamp and the chart from ever widening the page (a sideways scroll on phones). */
.hero { padding: 22px 18px 18px; overflow: hidden; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.name {
  margin: 8px 0 10px;
  font-size: clamp(30px, 9vw, 46px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ticker { color: var(--accent); font-variant-numeric: tabular-nums; }
.tier-flop, .tier-weak { color: var(--muted); }
.tier-solid { color: var(--green); }
.tier-fire { color: var(--gold); }
.tier-unicorn { background: linear-gradient(135deg, var(--purple), var(--cyan)); color: var(--on-accent); }
.tagline { font-size: 18px; color: var(--text-2); margin-bottom: 18px; }

.big {
  margin: 4px 0 8px;
  font-size: clamp(52px, 17vw, 96px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.big .star { color: var(--gold); font-size: 0.45em; vertical-align: super; margin-left: 2px; }
.big-line { font-size: clamp(36px, 11vw, 64px); line-height: 1.05; }
.footnote { margin-top: 14px; font-size: 13px; color: var(--muted); }
.claimed { font-size: 12px; font-style: italic; color: var(--muted); margin: 2px 0 10px; }
.bill .claimed, .tokenomics .claimed { margin: 10px 0 0; }

.growth {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(61, 220, 151, 0.12);
  color: var(--green);
  font-weight: 800;
}

/* ACQUIRED: a rubber stamp slammed across the hero. */
.stamp {
  position: absolute;
  z-index: 3;
  top: 46%;
  left: 50%;
  width: max-content;
  max-width: 88%;
  padding: 8px 14px;
  border: 4px solid var(--red);
  border-radius: 12px;
  background: rgba(7, 7, 13, 0.72);
  color: var(--red);
  text-align: center;
  transform: translate(-50%, -50%) rotate(-12deg);
  pointer-events: none;
  animation: stamp-in 0.5s 0.4s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.stamp-word { display: block; font-size: clamp(28px, 10vw, 52px); font-weight: 900; letter-spacing: 0.08em; line-height: 1.05; }
.stamp-sub { display: block; font-size: 13px; font-weight: 800; letter-spacing: 0.02em; }
.stamp-still {
  position: static;
  display: inline-block;
  margin: 8px 0 18px;
  transform: rotate(-6deg);
  font-size: 20px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  animation: none;
}
@keyframes stamp-in {
  from { opacity: 0; transform: translate(-50%, -50%) rotate(-12deg) scale(2.6); }
}

/* ---------- weekend_saas: the hockey stick that breaks out of its chart ---------- */

.chart-box { margin: 26px 0 4px; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--hairline); stroke-width: 1; }
.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 0;
  animation: chart-draw 2.8s 0.3s cubic-bezier(0.7, 0, 0.3, 1) both;
}
.chart-tag { fill: var(--muted); font-family: var(--font); font-size: 13px; font-weight: 700; }
.chart-tag-excel { fill: var(--gold); animation: fade-in 0.4s 2.9s both; }
.chart-box figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
@keyframes chart-draw { from { stroke-dashoffset: 1; } }
@keyframes fade-in { from { opacity: 0; } }

.bill-value { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; margin-top: 4px; }
.tick-wrap { display: none; margin-top: 4px; color: var(--red); font-weight: 700; font-variant-numeric: tabular-nums; }
.tick::after { content: counter(bill); }

.trusted { text-align: center; padding: 4px 0; }
.logos { list-style: none; padding: 0; margin-top: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.logos li {
  padding: 6px 12px;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-s);
  color: var(--text-2);
  font-weight: 700;
  filter: grayscale(1);
}

/* ---------- guru_course: the last-chance timer that never runs out ---------- */

.offer { text-align: center; border-color: rgba(255, 77, 109, 0.45); }
.countdown {
  margin: 4px 0 10px;
  font-size: clamp(56px, 19vw, 88px);
  font-weight: 900;
  line-height: 1;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.countdown-live { display: none; }
.price { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 8px; margin-bottom: 14px; }
.price-label { font-size: 13px; color: var(--muted); }
.price-was { color: var(--text-2); font-size: 22px; font-weight: 800; text-decoration-color: var(--red); text-decoration-thickness: 3px; }
.price-now { color: var(--gold); font-size: 36px; font-weight: 900; }
.refunds { margin-top: 10px; font-size: 13px; color: var(--muted); }

.reviews { display: grid; gap: 10px; }
.reviews h2 { margin: 6px 0 0; }
.review blockquote { font-size: 17px; font-weight: 600; }
.review figcaption { margin-top: 10px; display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
.avatar-sm { font-size: 22px; }
.stars { margin-left: auto; color: var(--gold); letter-spacing: 1px; }

/* ---------- token: the tokenomics pie that never stops spinning ---------- */

.pie-row { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 16px; align-items: center; }
.pie-wrap { position: relative; width: 148px; height: 148px; }
.pie { display: block; width: 100%; height: 100%; transform-origin: 50% 50%; animation: spin 14s linear infinite; }
.pie circle { fill: none; stroke-width: 8; }
.pie-track { stroke: var(--surface-strong); }
.pie-bots { stroke: var(--accent); }
.pie-team { stroke: var(--accent-2); }
.pie-mom { stroke: var(--gold); }
.pie-center { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: grid; place-items: center; font-weight: 900; font-size: 15px; }
.legend { list-style: none; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend li::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--surface-strong); }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.legend .lg-bots::before { background: var(--accent); }
.legend .lg-team::before { background: var(--accent-2); }
.legend .lg-mom::before { background: var(--gold); }
.lg-community { color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

.road { list-style: none; margin: 0 0 14px 6px; padding: 0 0 0 18px; border-left: 2px solid var(--hairline); display: grid; gap: 12px; }
.road li { position: relative; }
.road li::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 0.3em;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--bg);
  background: var(--surface-strong);
}
.road .done::before { background: var(--green); }
.road .doing::before { background: var(--gold); }
.road .moon { font-size: 22px; font-weight: 900; }
.road .moon::before { background: var(--accent); top: 0.45em; }
.road .moon::after { content: " \1F319"; }
.audit, .treasury { font-weight: 700; }
.treasury { color: var(--gold); }

/* ---------- shared blocks ---------- */

.checks { list-style: none; padding: 0; display: grid; gap: 12px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 17px; font-weight: 600; }
.checks li::before {
  content: "\2713";
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 900;
}
.t-guru_course .checks li::before { content: "\2605"; }
.t-token .checks li::before { content: "\25C6"; }

/* Bot buzz: six lines stacked in one grid cell, each on screen for 5 of every 30 seconds. */
.buzz-lines { list-style: none; padding: 0; display: grid; }
.buzz-line { grid-area: 1 / 1; opacity: 0; font-size: 18px; font-weight: 700; animation: buzz 30s infinite both; }
.buzz-line:first-child { opacity: 1; }
.buzz-line:nth-child(2) { animation-delay: 5s; }
.buzz-line:nth-child(3) { animation-delay: 10s; }
.buzz-line:nth-child(4) { animation-delay: 15s; }
.buzz-line:nth-child(5) { animation-delay: 20s; }
.buzz-line:nth-child(6) { animation-delay: 25s; }
@keyframes buzz {
  0% { opacity: 0; transform: translateY(10px); }
  2%, 15% { opacity: 1; transform: none; }
  17%, 100% { opacity: 0; transform: translateY(-10px); }
}

.founder { display: flex; gap: 14px; align-items: center; }
.avatar {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: var(--surface-strong);
  border: 2px solid var(--accent);
}
.handle { font-size: 22px; font-weight: 900; overflow-wrap: anywhere; }
.serial { color: var(--gold); font-weight: 700; }
.past-label { margin-top: 8px; }
.past { padding-left: 18px; color: var(--text-2); }

.stats h2 { margin-bottom: 2px; }
.updated { font-size: 12px; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.stat { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-s); padding: 10px 12px; min-width: 0; }
.stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
.stat dt { font-size: 12px; color: var(--muted); }
.stat dd { margin-top: 2px; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- notices, report form, static pages ---------- */

.notice { text-align: center; padding: 28px 18px; }
.notice h1, .report-form h1, .prose h1 { font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 10px; }
.notice p { color: var(--text-2); }

.report-form { display: grid; gap: 12px; }
.report-form > p { color: var(--text-2); }
.report-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.report-form legend { font-weight: 800; margin-bottom: 8px; padding: 0; }
.reason { display: flex; gap: 12px; align-items: center; min-height: 46px; padding: 8px 12px; border: 1px solid var(--hairline); border-radius: var(--radius-s); background: var(--surface); }
.reason input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.note-label { font-size: 14px; color: var(--text-2); }
.form-error { padding: 10px 12px; border: 1px solid var(--red); border-radius: var(--radius-s); color: var(--red); font-weight: 700; }
.report-form textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-s);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  resize: vertical;
}
.report-form textarea:focus-visible, .reason:focus-within, .btn:focus-visible, .foot a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.prose { display: grid; gap: 12px; }
.prose h2 { margin: 10px 0 0; }
.prose ul { padding-left: 20px; display: grid; gap: 6px; }
.prose p, .prose li { color: var(--text-2); }
.draft { justify-self: start; padding: 4px 10px; border: 1px dashed var(--gold); border-radius: var(--radius-s); color: var(--gold); font-size: 13px; font-weight: 700; }

/* ---------- editor preview (POST /api/v1/page/preview, shown only inside the app) ----------
   render.py wraps each editable region as <a class="vc-edit vc-block|vc-inline|vc-avatar" href="vibeedit:slot">
   and puts a .vc-note line above the top bar; the body gets .vc-preview. Public pages never have these classes.
   The marks move nothing: the outline and the pencil badge sit outside the layout (outline, absolute
   pseudo-elements), and a block <a> has no padding or border, so the wrapped element's margins pass through it.
   The only layout change is a little more room between regions that sit close (kicker, name, tagline, avatar
   and handle), so that two dashed boxes never touch. */

.vc-note {
  padding: 8px 12px;
  border: 1px dashed rgba(255, 200, 87, 0.6);
  border-radius: var(--radius-s);
  background: rgba(255, 200, 87, 0.08);
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.vc-note-blocked { border-color: rgba(255, 77, 109, 0.7); background: rgba(255, 77, 109, 0.1); color: var(--red); }

.vc-edit {
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-s);
  outline: 2px dashed rgba(255, 255, 255, 0.45);
  outline-offset: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
/* A bigger tap area than the text itself, invisible. */
.vc-edit::before { content: ""; position: absolute; top: -10px; right: -10px; bottom: -10px; left: -10px; border-radius: inherit; }
/* The pencil badge, centred on the top-right corner of the outline (offset 4 + width 2). */
.vc-edit::after {
  content: "\270E";
  position: absolute;
  top: -16px;
  right: -16px;
  z-index: 2;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg);
  color: var(--on-accent);
  -webkit-text-fill-color: var(--on-accent);
  font-family: var(--font);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
  pointer-events: none;
}
.vc-edit:active { outline-color: var(--accent); background: var(--surface-strong); }
.vc-inline { display: inline-block; }
.vc-avatar { flex: none; border-radius: 50%; }
.vc-avatar::after { top: -8px; right: -8px; }
.vc-preview .name { margin: 22px 0 18px; }
.vc-preview.state-between .name { margin-bottom: 26px; }   /* no pills between the name and the tagline */
.vc-preview .pills { margin-bottom: 16px; }
.vc-preview .founder { gap: 24px; }
.vc-preview .founder .vc-block { margin-top: 12px; }

/* ---------- wider screens ---------- */

@media (min-width: 720px) {
  .page { max-width: 680px; padding-top: 24px; gap: 18px; }
  .card { padding: 24px; }
  .hero { padding: 32px 28px 26px; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chart-box { max-width: 520px; }
  .stat:last-child:nth-child(odd) { grid-column: auto; }
  .pie-row { grid-template-columns: 180px minmax(0, 1fr); gap: 24px; }
  .pie-wrap { width: 180px; height: 180px; }
}

@media (max-width: 359px) {
  .pie-row { grid-template-columns: minmax(0, 1fr); justify-items: center; }
}

/* ---------- counters: only where @property works (see the note at the top) ---------- */

@supports (transition-behavior: allow-discrete) {
  .tick-wrap { display: block; }
  /* counter-reset reads a second registered property: WebKit did not update it from the animated one directly. */
  .tick { --bill-n: calc(var(--bill-tick) * 1); counter-reset: bill var(--bill-n); animation: bill-tick 6000s linear both; }

  .countdown-static { display: none; }
  .countdown-live {
    display: inline;
    --cd-m: calc((var(--cd-t) - 30) / 60);
    --cd-s: calc(var(--cd-t) - var(--cd-m) * 60);
    counter-reset: cd-m var(--cd-m) cd-s var(--cd-s);
    animation: countdown 900s steps(900, end) infinite;
  }
  .countdown-live::after { content: counter(cd-m, decimal-leading-zero) ":" counter(cd-s, decimal-leading-zero); }
}
@keyframes bill-tick { from { --bill-tick: 0; } to { --bill-tick: 99999; } }
@keyframes countdown { from { --cd-t: 899; } to { --cd-t: -1; } }

/* ---------- reduced motion: the still picture ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tick-wrap { display: none !important; }
  .countdown-static { display: inline !important; }
  .countdown-live { display: none !important; }
}
