/* pay2plot — after unfair.so:
   pale periwinkle ground, photocopied serif display, clean grotesk UI,
   white cards with soft shadows, black pill buttons, one electric blue.
   Single committed light theme; every surface painted explicitly. */

:root {
  --bg-top: #dfe3f8;
  --bg-mid: #edeff9;
  --bg-bottom: #f7f8fc;
  --ink: #101116;
  --gray: #5c5f6e;
  --faint: #9a9dad;
  --card: #ffffff;
  --line: #e4e6f0;
  --chip: #eceef5;
  --blue: #2e41f0;
  --shadow: 0 10px 30px rgba(24, 28, 70, 0.08), 0 2px 8px rgba(24, 28, 70, 0.05);

  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 45%, var(--bg-bottom) 100%);
  background-color: var(--bg-bottom);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; transition: color 0.15s ease; }
a:hover { color: var(--blue); }

button { font-family: var(--sans); transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.xerox { filter: url(#xerox); }
.empty { color: var(--gray); }

/* ---- nav ---- */

.nav {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 24px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.wordmark {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: lowercase;
}
.tagline { color: var(--gray); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) { .tagline { display: none; } }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.watching { color: var(--gray); font-weight: 500; }
.presence { display: inline-flex; align-items: baseline; gap: 5px; margin-left: 2px; }
.presence .p-flag { font-size: 14px; font-weight: 500; color: var(--gray); }
.presence .p-flag b { font-size: 11px; color: var(--gray); font-weight: 600; }
.presence .p-more { font-size: 11px; color: var(--faint); font-weight: 600; }

/* ---- layout ---- */

.layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 352px;
  gap: 22px;
  align-items: start;
}
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }
.stage-column, .side-column { display: grid; gap: 18px; min-width: 0; }

.panel {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.panel-title {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.1;
  width: fit-content; /* keep the photocopy filter tight around the text */
  filter: url(#xerox);
}

/* ---- stage ---- */

.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  overflow: hidden;
  background: #0c0d12;
  box-shadow: var(--shadow);
}
.stage video { width: 100%; height: 100%; object-fit: cover; display: block; }

.card-scene {
  position: absolute;
  inset: 0;
  background: #edeffa;
  color: var(--ink);
  padding: 26px 30px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* The scene's mood layer: in realtime mode each prompt rotates the palette,
   so the picture visibly morphs the instant money lands. */
.card-scene::before {
  content: '';
  position: absolute;
  inset: -25%;
  background: linear-gradient(155deg, #dfe3fa 0%, #eaedfa 45%, #f0eaf7 75%, #e7e9f8 100%);
  filter: hue-rotate(var(--dream-rotate, 0deg)) saturate(1.05);
  transition: filter 1.6s ease;
}
.card-scene > * { position: relative; }
@media (prefers-reduced-motion: reduce) {
  .card-scene::before { transition: none; }
}

#live-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0c0d12;
}
.card-eyebrow { margin: 0; font-size: 13px; font-weight: 600; color: var(--gray); }
.card-eyebrow b { color: var(--ink); }
.card-middle { margin: auto 0; display: grid; gap: 12px; justify-items: center; text-align: center; padding: 0 4vw; }
.card-text {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(19px, 2.6vw, 30px);
  line-height: 1.25;
  max-width: 44ch;
  text-wrap: balance;
}
.card-text.hero { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.08; max-width: 22ch; }
.card-sub { margin: 0; color: var(--gray); font-size: clamp(13px, 1.4vw, 16px); max-width: 52ch; }
.enter { animation: rise 0.45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .enter { animation: none; } }

.card-timer {
  position: absolute;
  right: 16px;
  bottom: 70px; /* clears the lower-third pill */
  background: var(--card);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--gray);
  box-shadow: var(--shadow);
  font-variant-numeric: tabular-nums;
}
.card-timer b { color: var(--ink); font-size: 15px; }

.lower-third {
  position: absolute;
  left: 14px;
  bottom: 16px;
  max-width: calc(100% - 28px);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: 999px;
  padding: 8px 16px 8px 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
}
.lt-now {
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
  flex-shrink: 0;
}
.lt-body { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lt-body .amt { font-weight: 700; }
.lt-body .dim { color: var(--gray); }

.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(120, 126, 165, 0.25); }
.progress-fill { height: 100%; width: 0%; background: var(--blue); }

.stage-meta {
  display: flex;
  align-items: center;
  gap: 8px 18px;
  flex-wrap: wrap;
  padding: 0 6px;
  color: var(--gray);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.badge-chip { background: #e5e9fd; color: var(--blue); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; }
.sound-btn {
  margin-left: auto;
  background: var(--card);
  color: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.sound-btn:hover { background: var(--ink); color: #fff; }

/* ---- sponsors ---- */

.sponsors { display: flex; flex-wrap: wrap; gap: 8px; }
.sponsors a {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  background: #f2f3f8;
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.sponsors a:hover { background: #e6e8f2; color: var(--ink); }
.sponsors a .s-tag { color: var(--gray); font-weight: 400; font-size: 12.5px; }

/* ---- story ---- */

.season { margin: 0 0 10px; padding: 9px 12px; background: #f2f3f8; border-radius: 10px; font-size: 13px; line-height: 1.45; color: var(--gray); }
.share-cta { margin-top: 12px; padding: 10px 12px; background: #f2f3f8; border-radius: 10px; font-size: 13.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ticker { display: flex; gap: 10px; align-items: baseline; margin-top: 10px; padding: 8px 14px; background: var(--card); border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; overflow: hidden; }
.ticker-label { font-weight: 700; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue); flex: none; }
.ticker-text { color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: ticker-in 0.35s ease; }
@keyframes ticker-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chat-log { list-style: none; margin: 0 0 10px; padding: 0; max-height: 220px; overflow-y: auto; }
.chat-log li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; line-height: 1.4; animation: ticker-in 0.25s ease; }
.chat-log li:last-child { border-bottom: none; }
.chat-name { font-weight: 700; margin-right: 6px; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 13.5px; background: var(--card); }
.chat-form input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.chat-send { border: none; background: var(--ink); color: #fff; border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chat-send:hover { opacity: 0.85; }
.chat-send:disabled { opacity: 0.5; cursor: default; }
.share-x { display: inline-block; background: var(--ink); color: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 13px; text-decoration: none; }
.share-x:hover { opacity: 0.85; }
.d-chip { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: var(--blue); color: #fff; border-radius: 999px; padding: 2px 8px; margin-left: 8px; vertical-align: 1px; }
.d-chip.gray { background: var(--chip); color: var(--gray); }
.season b { color: var(--ink); }
.log { list-style: none; margin: 0; padding: 0; max-height: 250px; overflow-y: auto; }
.log li { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.log li:last-child { border-bottom: none; }
.log .log-tc { color: var(--faint); font-size: 12.5px; flex-shrink: 0; padding-top: 1px; font-variant-numeric: tabular-nums; }
.log .empty { border-bottom: none; }

/* ---- donate ---- */

#donate-form { display: grid; gap: 6px; }
#donate-form label { font-size: 13px; font-weight: 600; color: var(--gray); margin-top: 8px; }

input[type='text'], input[type='number'], textarea {
  width: 100%;
  background: #f2f3f8;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 13px;
  font-family: var(--sans);
  font-size: 14.5px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
input:focus, textarea:focus { outline: none; border-color: var(--blue); background: #fff; }
::placeholder { color: var(--faint); }

.char-count { text-align: right; font-size: 12px; color: var(--faint); margin-top: -2px; }

/* amount chips: calendar-day cells */
.amounts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.amounts button {
  border: none;
  background: var(--chip);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 0;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.amounts button:hover { background: #e0e3f2; }
.amounts button.active { background: var(--blue); color: #fff; }

.amount-row { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.amount-input {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #f2f3f8;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 0 0 13px;
  color: var(--gray);
  font-weight: 600;
}
.amount-input:focus-within { border-color: var(--blue); background: #fff; }
.amount-input input { width: 78px; background: none; border: none; padding: 11px 10px 11px 2px; font-weight: 600; }
.amount-input input:focus { background: none; border: none; }

.seconds-badge {
  display: inline-flex;
  align-items: baseline;
  background: var(--card);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--gray);
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.seconds-badge b { color: var(--ink); font-size: 15px; }

.donate-btn {
  margin-top: 14px;
  border: none;
  border-radius: 999px;
  padding: 15px 18px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(16, 17, 22, 0.22);
}
.donate-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(16, 17, 22, 0.28); }
.donate-btn:active { transform: translateY(0); }
.donate-btn:disabled { opacity: 0.55; cursor: wait; transform: none; }
.fine-print { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--faint); }

/* ---- queue ---- */

.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.queue li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.queue li:last-child, .queue .empty { border-bottom: none; }
.q-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--chip);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.q-main { min-width: 0; }
.q-who { font-size: 13.5px; font-weight: 600; }
.q-who .amt { font-weight: 700; }
.q-who .dim { color: var(--gray); font-weight: 500; }
.q-prompt { color: var(--gray); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-side { display: grid; justify-items: end; gap: 3px; }
.q-dur { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.q-boost {
  border: none;
  background: var(--chip);
  color: var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.q-boost:hover { background: var(--blue); color: #fff; }
.q-boost:disabled { opacity: 0.5; cursor: wait; }

.pill { border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.pill.st-pending { background: var(--chip); color: var(--gray); }
.pill.st-generating { background: var(--blue); color: #fff; animation: pulse 1.6s ease-in-out infinite; }
.pill.st-ready { background: var(--ink); color: #fff; }
@media (prefers-reduced-motion: reduce) { .pill.st-generating { animation: none; } }

/* ---- backers ---- */

.donors { list-style: none; margin: 0; padding: 0; }
.donors li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.donors li:last-child, .donors .empty { border-bottom: none; }
.d-index { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.d-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-sum { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- footer, toast ---- */

.footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 6px 24px 34px;
  color: var(--gray);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer a { color: var(--gray); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(16, 17, 22, 0.3);
  z-index: 50;
  max-width: min(560px, 90vw);
}
.toast.error { background: #c0271c; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9ccdd; border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }
