/* Parta web — hand-written CSS, no build step.
 *
 * Everything themeable is a custom property on :root. The palette is the only
 * place to touch when the brand assets land; nothing below hard-codes a colour.
 *
 * Written mobile-first: the base rules target a 375px phone, and the media
 * queries only ever add. Roughly all of this audience is on a phone.
 */

:root {
  /* Surfaces, darkest to lightest. */
  --bg:            #0a0a0c;
  --surface:       #131317;
  --surface-2:     #1b1b21;
  --surface-3:     #24242c;
  --line:          #2a2a33;
  --line-strong:   #3a3a46;

  /* Text. */
  --text:          #f2f2f5;
  --text-muted:    #a1a1ad;
  --text-faint:    #6e6e7c;

  /* Accent. Swap these two for the brand colours. */
  --accent:        #7c5cff;
  --accent-2:      #ff4d94;
  --accent-ink:    #ffffff;

  --ok:            #35c67a;
  --danger:        #ff5b5b;

  --radius:        14px;
  --radius-lg:     20px;
  --radius-pill:   999px;

  --shadow:        0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .35);
  --shadow-lift:   0 2px 4px rgb(0 0 0 / .45), 0 16px 40px rgb(0 0 0 / .5);

  --wrap:          1240px;
  --wrap-narrow:   720px;

  --header-h:      56px;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchors land below the sticky header instead of underneath it. */
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

/* The age gate is a real barrier, not decoration: while it is up the page
 * behind it does not scroll. */
body.is-gated { overflow: hidden; }

h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 650; letter-spacing: -0.02em; }
p  { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img, video { max-width: 100%; display: block; }

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

/* Any author `display` beats the UA stylesheet's rule for [hidden], so an
 * element with display:flex stays visible while the markup says it is hidden.
 * This makes the attribute mean what it says, everywhere. */
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ── Layout ──────────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 16px;
}
.wrap-narrow { max-width: var(--wrap-narrow); }

.section { padding-block: 40px; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }

.section-head { margin-bottom: 20px; }
.section-title { font-size: 24px; }
.section-sub { color: var(--text-muted); margin-top: 6px; font-size: 15px; }

.page-title { font-size: 26px; margin-bottom: 10px; }
.lede { color: var(--text-muted); font-size: 16px; }
.lede-note { color: var(--text-faint); font-size: 14px; margin-top: 8px; }

/* ── Header ──────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex; align-items: center; gap: 12px;
}

.brand { display: flex; align-items: center; gap: 9px; margin-right: auto; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 1px rgb(255 255 255 / .08) inset;
  flex: none;
}
.brand-name { font-weight: 700; letter-spacing: -0.02em; font-size: 17px; }

/* Nav links are noise on a phone — the same two anchors sit in the page. */
.header-nav { display: none; gap: 20px; font-size: 15px; color: var(--text-muted); }
.header-actions { display: flex; align-items: center; gap: 8px; }

.lang-form { display: flex; gap: 6px; }
.lang-select {
  appearance: none;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font: inherit; font-size: 14px;
  cursor: pointer;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  font: inherit; font-weight: 600; font-size: 15px;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease, background-color .15s ease;
  /* Comfortably above the 44px touch target minimum. */
  min-height: 46px;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: var(--shadow);
}
.btn-primary:hover { filter: brightness(1.08); color: var(--accent-ink); }

.btn-ghost {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-3); }

.btn-sm { padding: 8px 16px; min-height: 38px; font-size: 14px; }
.btn-block { width: 100%; }

.btn.is-disabled,
.btn[disabled] { opacity: .55; cursor: not-allowed; pointer-events: none; }

.backlink {
  display: inline-block; color: var(--text-muted);
  font-size: 14px; margin-bottom: 16px;
}
.backlink::before { content: "← "; }

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  padding-block: 44px 36px;
  background:
    radial-gradient(90% 120% at 50% -20%,
      color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}
.hero-inner { text-align: center; }

.hero-badge {
  display: inline-block;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  margin-bottom: 16px;
}
.hero-title { font-size: 32px; letter-spacing: -0.03em; }
.hero-sub {
  color: var(--text-muted); margin-top: 12px; font-size: 16px;
  max-width: 46ch; margin-inline: auto;
}
.hero-actions {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 22px;
}
.hero-note { color: var(--text-faint); font-size: 13px; margin-top: 12px; }

/* ── Chips ───────────────────────────────────────────────────────────────── */

.chips {
  display: flex; gap: 8px;
  margin-bottom: 18px;
  /* Wide filter rows scroll inside themselves; the page never scrolls
   * sideways. */
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 14px; font-weight: 550;
  white-space: nowrap;
}
.chip:hover { background: var(--surface-3); color: var(--text); }
.chip-on {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.chip-on:hover { background: var(--text); color: var(--bg); }

/* ── Catalogue grid ──────────────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}
.card-free { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* No height:100% here. In the catalogue the whole body sits inside this link,
 * so it fills the card on its own; in the gallery the caption and download
 * link sit OUTSIDE it, and a stretched link covered them both. */
.card-link { display: block; }

.card-media {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--surface-2);
  overflow: hidden;
}
.card-video, .card-img {
  width: 100%; height: 100%; object-fit: cover;
}

/* The clip sits on top of the still and is invisible until it is really
 * playing. Nothing here depends on autoplay being permitted. */
.card-clip {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity .25s ease;
}
.card-clip.is-playing { opacity: 1; }
.card-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: var(--text-faint); font-size: 13px;
  background: repeating-linear-gradient(
    45deg, var(--surface-2), var(--surface-2) 10px, var(--surface) 10px, var(--surface) 20px);
}

/* The source photo, small, over the result. It is the whole pitch: this went
 * in, that came out. Bottom-left so it never fights the price badge. */
.card-source {
  position: absolute; left: 8px; bottom: 8px;
  margin: 0;
  width: 38%; max-width: 104px;
  border-radius: 9px;
  overflow: hidden;
  border: 2px solid rgb(255 255 255 / .85);
  box-shadow: 0 4px 14px rgb(0 0 0 / .55);
  background: var(--surface-2);
}
.card-source-img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block;
}
.card-source-tag {
  position: absolute; inset: auto 0 0 0;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  color: var(--text);
  font-size: 9px; font-weight: 700;
  text-align: center;
  padding: 2px 2px 3px;
  /* Long translations must not wrap this into two lines and cover the face. */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.card-badges {
  position: absolute; left: 8px; top: 8px;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.badge {
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(6px);
  color: var(--text);
  border: 1px solid rgb(255 255 255 / .1);
}
.badge-free {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); border-color: transparent;
}
.badge-muted { color: var(--text-muted); }

.card-body { padding: 10px 12px 14px; }
.card-title { font-size: 15px; }
.card-desc {
  color: var(--text-muted); font-size: 13px; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-cta {
  display: inline-block; margin-top: 10px;
  font-size: 13px; font-weight: 650;
  color: var(--accent);
}
.card-cta::after { content: " →"; }

/* ── Empty state ─────────────────────────────────────────────────────────── */

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
}
.empty-title { font-weight: 600; }
.empty-sub { color: var(--text-muted); font-size: 14px; margin: 6px 0 16px; }

/* ── Mode detail ─────────────────────────────────────────────────────────── */

.detail { display: grid; gap: 20px; }

/* ── Before → after pair ─────────────────────────────────────────────────── */

.pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.pair-side { margin: 0; min-width: 0; }

.pair-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
}
.pair-media {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block;
}
.pair-clip {
  position: absolute; inset: 0;
  height: 100%;
  opacity: 0;
  transition: opacity .25s ease;
}
.pair-clip.is-playing { opacity: 1; }
.pair-in .pair-frame  { border-style: dashed; }
.pair-out .pair-frame { border-color: color-mix(in srgb, var(--accent) 55%, var(--line-strong)); }

.pair-label {
  position: absolute; left: 8px; top: 8px;
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid rgb(255 255 255 / .1);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
}
.pair-label-out {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  border-color: transparent;
}

.pair-arrow {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-muted);
  flex: none;
}

.pair-note { margin-top: 10px; color: var(--text-faint); font-size: 13px; }

.detail-title { font-size: 26px; }
.detail-desc { color: var(--text-muted); margin-top: 8px; }

.bullets { margin-top: 16px; display: grid; gap: 8px; }
.bullets li {
  color: var(--text-muted); font-size: 14px;
  padding-left: 18px; position: relative;
}
.bullets li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

.variants { margin-top: 22px; display: grid; gap: 10px; }
.variants-head {
  font-size: 12px; font-weight: 650; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-faint);
}
.variant {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
}
.variant-info { display: flex; align-items: baseline; gap: 8px; }
.variant-label { font-weight: 600; }
.variant-dur { color: var(--text-faint); font-size: 13px; }
.variant-meta { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.variant-price { font-weight: 650; font-size: 14px; color: var(--text-muted); white-space: nowrap; }

.hint { margin-top: 16px; color: var(--text-faint); font-size: 13px; }

/* ── Pricing ─────────────────────────────────────────────────────────────── */

.packs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.pack {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  text-align: center;
}
.pack-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.pack-flag {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 10px; border-radius: var(--radius-pill);
  white-space: nowrap;
}
.pack-credits { font-size: 19px; font-weight: 700; }
.pack-cost { color: var(--text-muted); font-size: 14px; margin-top: 2px; }
.pack-save { color: var(--ok); font-size: 12px; font-weight: 650; margin-top: 6px; }

.costs {
  margin-top: 24px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.costs-title { font-size: 15px; }
.costs-list { margin-top: 10px; display: grid; gap: 6px; color: var(--text-muted); font-size: 14px; }
.costs-note { margin-top: 14px; color: var(--text-faint); font-size: 13px; }
.costs-cta { margin-top: 16px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */

.form { margin-top: 24px; display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.label { font-size: 14px; font-weight: 600; }

.input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  /* 16px keeps iOS Safari from zooming the viewport on focus. */
  font: inherit; font-size: 16px;
  padding: 12px 14px;
}
.input::placeholder { color: var(--text-faint); }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.textarea { resize: vertical; min-height: 130px; }

.field-invalid .input { border-color: var(--danger); }
.field-hint  { color: var(--text-faint); font-size: 13px; }
.field-hint a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.field-error { color: var(--danger); font-size: 13px; }

.alert {
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  margin-top: 20px;
}
.alert-error {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
}

.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  display: grid; gap: 10px; justify-items: center;
}
.notice .btn { margin-top: 8px; }
.notice-ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }

.error-code {
  font-size: 44px; font-weight: 750; letter-spacing: -0.04em;
  color: var(--text-faint);
}

/* ── Prose (legal pages) ─────────────────────────────────────────────────── */

.prose h1 { font-size: 28px; margin-bottom: 6px; }
.prose h2 { font-size: 18px; margin-top: 30px; margin-bottom: 8px; }
.prose p, .prose li { color: var(--text-muted); font-size: 15px; }
.prose p + p { margin-top: 10px; }
.prose ul { margin: 10px 0; display: grid; gap: 8px; }
.prose ul li { padding-left: 18px; position: relative; }
.prose ul li::before {
  content: ""; position: absolute; left: 2px; top: 10px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint);
}
.prose strong { color: var(--text); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose-meta { color: var(--text-faint); font-size: 13px; margin-bottom: 18px; }

/* ── Footer ──────────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 28px 40px;
  background: var(--surface);
}
.footer-links {
  display: flex; flex-wrap: wrap; gap: 10px 20px;
  font-size: 14px; color: var(--text-muted);
}
.footer-note { color: var(--text-faint); font-size: 13px; margin-top: 16px; }

/* ── Age gate ────────────────────────────────────────────────────────────── */

.gate {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  overflow-y: auto;
}
.gate-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow-lift);
  text-align: center;
}
.gate-kicker {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-faint);
}
.gate-title { font-size: 21px; margin-top: 6px; }
.gate-list { margin: 18px 0; display: grid; gap: 8px; text-align: left; }
.gate-list li {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 11px 13px;
  font-size: 14px; color: var(--text-muted);
}
.gate-icon {
  flex: none; min-width: 26px; height: 22px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text); font-size: 11px; font-weight: 700;
}
.gate-note { color: var(--text-faint); font-size: 12px; margin-bottom: 16px; }
.gate-leave {
  display: inline-block; margin-top: 12px;
  color: var(--text-faint); font-size: 13px; text-decoration: underline;
}

/* ── Upload slot ─────────────────────────────────────────────────────────── */

.pair-drop { display: block; cursor: pointer; }
.pair-drop .pair-media { transition: opacity .2s ease, filter .2s ease; }
.pair-drop:hover .pair-media { opacity: .55; }

/* The example photo is dimmed under the call to action, so the panel reads as
 * "put yours here" rather than as a picture that happens to be clickable. */
.drop-cta {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--text);
  text-align: center;
  padding: 10px;
}
.drop-plus {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-size: 22px; font-weight: 600; line-height: 1;
}
.drop-text { font-size: 12px; font-weight: 650; }

.pair-drop.has-file .drop-cta { background: color-mix(in srgb, var(--bg) 20%, transparent); }
.pair-drop.has-file .drop-text { font-size: 11px; }
.pair-drop.has-file .drop-plus { display: none; }

.consent-check { margin-top: 20px; }
.btn-generate { margin-top: 16px; }
.upload-hint { margin-top: 8px; text-align: center; }

.variant-pick { cursor: pointer; }
.variant-pick input {
  flex: none; width: 18px; height: 18px; accent-color: var(--accent);
}
.variant-pick:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

/* ── Job ─────────────────────────────────────────────────────────────────── */

.job { display: grid; gap: 20px; }
.job-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.job-media { width: 100%; display: block; }
.job-pending {
  aspect-ratio: 3 / 4;
  display: grid; place-content: center; justify-items: center; gap: 12px;
  padding: 20px; text-align: center;
}
.job-state { font-weight: 650; }
.job-sub { color: var(--text-muted); font-size: 14px; }

.spinner {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  animation: spin 900ms linear infinite;
}
.spinner-sm { width: 18px; height: 18px; border-width: 2px; }
.job-dead {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--danger);
  font-size: 18px; line-height: 1;
}
@keyframes spin { to { transform: rotate(360deg); } }

.job-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.running-list { display: grid; gap: 8px; margin-bottom: 28px; }
.running-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
  font-size: 14px;
}
.running-mode { font-weight: 600; }
.running-state { margin-left: auto; color: var(--text-muted); }

.card-body-tight { padding: 8px 10px 12px; }
.card-expiry { color: var(--text-faint); font-size: 11px; }
.grid-gallery .card-media { aspect-ratio: 3 / 4; }

/* ── Daily wheel ─────────────────────────────────────────────────────────── */

.wheel-wrap { margin-top: 24px; }
.wheel-stage {
  position: relative;
  display: grid; place-items: center;
  padding-top: 16px;   /* room for the pointer above the rim */
}
.wheel { width: 100%; max-width: 320px; height: auto; display: block; }

/* Rotating the <svg> itself: an HTML-level element has an unambiguous centre,
 * so 50% 50% means the middle of the wheel on every engine. */
.wheel-rotor {
  transform-origin: 50% 50%;
  transition: transform 4.2s cubic-bezier(.16, .84, .27, 1);
  will-change: transform;
}

.wheel-seg { stroke: var(--bg); stroke-width: 1.5; }
.wheel-seg-0 { fill: var(--surface-3); }
.wheel-seg-1 { fill: color-mix(in srgb, var(--accent) 40%, var(--surface-2)); }
.wheel-rim { fill: none; stroke: var(--line-strong); stroke-width: 3; }

.wheel-label {
  fill: var(--text);
  font-size: 17px; font-weight: 700;
  font-family: var(--font);
  /* Labels ride inside the rotating group, so they must not intercept taps. */
  pointer-events: none;
}
.wheel-hub { fill: var(--bg); stroke: var(--line-strong); stroke-width: 2; }

/* Sits above the wheel and does not turn with it. */
.wheel-pointer {
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 20px solid var(--accent-2);
  filter: drop-shadow(0 2px 4px rgb(0 0 0 / .5));
}

.wheel-go { margin-top: 22px; }
.wheel-status {
  margin-top: 12px; text-align: center;
  color: var(--text-muted); font-size: 14px; min-height: 1.4em;
}
.wheel-status.is-win { color: var(--ok); font-weight: 650; font-size: 16px; }
.wheel-status.is-error { color: var(--danger); }
.wheel-countdown {
  text-align: center; color: var(--text-faint); font-size: 13px;
  min-height: 1.3em; margin-top: 4px;
}

@media (prefers-reduced-motion: reduce) {
  /* The result still has to arrive; it just stops being a four-second ride. */
  .wheel-rotor { transition-duration: .2s; }
}

/* ── Buying credits ──────────────────────────────────────────────────────── */

.buy-list { display: grid; gap: 10px; margin-top: 24px; }
.buy-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.buy-row-featured {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.buy-amount { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.buy-credits { font-weight: 700; font-size: 17px; }
.buy-save { color: var(--ok); font-size: 12px; font-weight: 650; }
.buy-flag {
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  padding: 2px 8px; border-radius: var(--radius-pill);
}
.buy-note { margin-top: 18px; }

.notice-flat { text-align: left; justify-items: start; margin-top: 20px; }
.notice-title { font-weight: 650; }

.steps {
  list-style: decimal; padding-left: 20px;
  margin: 22px 0; display: grid; gap: 10px;
  color: var(--text-muted); font-size: 15px;
}
.steps strong { color: var(--text); }

.pay-state {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  margin-top: 20px;
  color: var(--text-muted); font-size: 14px;
}
.pay-state.is-done { color: var(--ok); font-weight: 650; }
.pay-done { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.pay-stuck { margin-top: 22px; text-align: center; }

/* ── Auth ────────────────────────────────────────────────────────────────── */

.wrap-form { max-width: 420px; }

.providers { display: grid; gap: 10px; margin-top: 24px; }

.btn-provider { justify-content: center; font-weight: 600; }
.btn-google   { background: #ffffff; color: #1f1f1f; }
.btn-google:hover  { background: #ececec; color: #1f1f1f; }
.btn-discord  { background: #5865f2; color: #ffffff; }
.btn-discord:hover { background: #4954e8; color: #ffffff; }
/* Telegram's own brand blue. This is our button now, not the Login Widget's
   iframe — see oauth.telegram_auth_url. */
.btn-telegram { background: #2aabee; color: #ffffff; }
.btn-telegram:hover { background: #1d9bd8; color: #ffffff; }
.btn-telegram { background: #2aabee; color: #ffffff; }
.btn-telegram:hover { background: #1e97d6; color: #ffffff; }

/* No min-height: the widget brings its own iframe and its own size, and a
 * reserved box would be a permanent hole whenever the script is blocked. */
.tg-widget { display: flex; justify-content: center; }

/* Rule with the label sitting in the gap. */
.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 4px;
  color: var(--text-faint); font-size: 13px;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

.check {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; color: var(--text-muted);
  cursor: pointer;
}
.check input {
  /* Big enough to hit with a thumb, and it must not shrink next to a long
   * label — a checkbox squeezed to 4px is a checkbox nobody ticks. */
  flex: none; width: 20px; height: 20px; margin-top: 1px;
  accent-color: var(--accent);
}
.check a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.captcha { display: grid; gap: 10px; }
.captcha-img {
  width: 240px; max-width: 100%; height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
}
.captcha-input {
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: 18px;
}

.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
}
.code-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 20px; letter-spacing: .08em;
  /* Long enough to wrap on a narrow phone — never let it push the page wide. */
  word-break: break-all;
}
.code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .12em; text-transform: uppercase;
}

.alert-warn {
  background: color-mix(in srgb, #e6a23c 14%, var(--surface));
  border: 1px solid color-mix(in srgb, #e6a23c 45%, transparent);
}

.form-foot {
  margin-top: 18px; text-align: center;
  font-size: 14px; color: var(--text-muted);
}
.form-foot a { color: var(--accent); }

/* ── Account ─────────────────────────────────────────────────────────────── */

.balance-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 6px 13px;
  font-weight: 650; font-size: 14px;
}
.balance-chip-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.balance-card {
  margin: 20px 0 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: grid; gap: 6px; justify-items: start;
}
.balance-label {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-faint);
}
.balance-value { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; }
.balance-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.section-title-sm { font-size: 18px; margin-bottom: 12px; }

.ledger { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line);
          border-radius: var(--radius); overflow: hidden; }
.ledger-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  background: var(--surface);
  padding: 12px 14px;
  font-size: 14px;
}
.ledger-reason { font-weight: 600; }
.ledger-delta { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.ledger-delta.is-plus  { color: var(--ok); }
.ledger-delta.is-minus { color: var(--text-muted); }
.ledger-time {
  grid-column: 1 / -1;
  color: var(--text-faint); font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.logout-form { margin-top: 32px; }

.hide-narrow { display: none; }

/* ── Larger screens ──────────────────────────────────────────────────────── */

@media (min-width: 480px) {
  .hide-narrow { display: inline-flex; }
}

@media (min-width: 600px) {
  .hero { padding-block: 72px 56px; }
  .hero-title { font-size: 44px; }
  .hero-sub { font-size: 18px; }
  .hero-actions { flex-direction: row; justify-content: center; }
  .section { padding-block: 56px; }
  .section-title { font-size: 28px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .packs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .page-title { font-size: 32px; }
}

@media (min-width: 900px) {
  .header-nav { display: flex; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .packs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .detail { grid-template-columns: 5fr 6fr; gap: 32px; align-items: start; }
  .hero-title { font-size: 54px; }
}

@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* Two payment methods per pack: the row keeps one label and stacks its buttons
 * rather than becoming two rows that repeat the same amount. */
.buy-methods { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.buy-methods form { display: contents; }
/* "5 credits" must not wrap to two lines when the row carries two buttons. */
.buy-credits { white-space: nowrap; }
