/* psyopvan — neutral surfaces, hairline rules, one accent, monospace for every number.
   Light by default, dark when the system asks for it. The admin page reuses these tokens. */

:root {
  --bg: #f5f5f3;
  --surface: #ffffff;
  --surface-2: #f0f0ed;
  --text: #121315;
  --text-2: #484b51;
  --text-3: #7c8087;
  --line: #e2e2de;
  --line-strong: #cbcbc5;
  --accent: #0b6b4f;
  --accent-ink: #ffffff;
  --accent-soft: #e2f0ea;
  --danger: #b42318;
  --danger-soft: #fbeae8;
  --warn: #8a5300;
  --warn-soft: #fbf1df;
  --scrim: rgba(12, 13, 14, .78);

  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 8px;
  --radius-sm: 6px;

  /* names the admin stylesheet still uses */
  --paper: var(--bg);
  --card: var(--surface);
  --ink: var(--text);
  --ink-2: var(--text-2);
  --ink-3: var(--text-3);
  --dots: var(--line);
  --hl: var(--accent-soft);
  --hl-soft: var(--surface-2);
  --mint: var(--accent-soft);
  --pink: var(--danger-soft);
  --red: var(--danger);
  --hand: var(--mono);
  --r-sketch: var(--radius);
  --r-sketch-2: var(--radius);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-sm: none;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e10;
    --surface: #15171a;
    --surface-2: #1c1f23;
    --text: #eceef0;
    --text-2: #a7abb1;
    --text-3: #767b82;
    --line: #25282d;
    --line-strong: #353940;
    --accent: #3fb68b;
    --accent-ink: #06140f;
    --accent-soft: rgba(63, 182, 139, .13);
    --danger: #f0735f;
    --danger-soft: rgba(240, 115, 95, .12);
    --warn: #e0a64a;
    --warn-soft: rgba(224, 166, 74, .12);
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--bg);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.015em; }
h1 { font-size: clamp(30px, 4.6vw, 44px); letter-spacing: -.025em; }
h2 { font-size: clamp(22px, 3vw, 28px); }
h3 { font-size: 17px; letter-spacing: -.005em; }
p { margin: 0; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }

/* icons ------------------------------------------------------------------ */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -3px;
}
.ic-lg { width: 22px; height: 22px; }
.ic-xl { width: 22px; height: 22px; }
.ic-huge { width: 40px; height: 40px; stroke-width: 1.5; }

/* surfaces --------------------------------------------------------------- */
.sketch {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hl { color: var(--accent); }

/* buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  font-weight: 500; font-size: 14px; white-space: nowrap;
  color: var(--accent-ink); background: var(--accent);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none;
  transition: filter .12s, background .12s, border-color .12s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { filter: brightness(.95); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn:focus-visible, .icon-btn:focus-visible, .chip-btn:focus-visible, .star:focus-visible, .name:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn-big { height: 44px; padding: 0 22px; font-size: 15px; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-ghost, .btn-wallet { color: var(--text); background: var(--surface); border-color: var(--line-strong); }
.btn-ghost:hover, .btn-wallet:hover { filter: none; background: var(--surface-2); }
.btn-wallet.on { font-family: var(--mono); font-size: 13px; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  color: inherit; background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer;
}
.icon-btn:hover { background: rgba(127, 127, 127, .14); }

/* header ----------------------------------------------------------------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 14px max(24px, calc((100% - 1132px) / 2));
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark { width: 22px; height: 22px; flex: none; color: var(--text); }
#site { font: 600 14px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.top-right { display: flex; align-items: center; gap: 16px; position: relative; }
.online { font-size: 13px; color: var(--text-3); display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.online b { font-family: var(--mono); font-weight: 500; color: var(--text-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; padding: 12px; display: grid; gap: 10px; min-width: 280px; }
.menu-addr { word-break: break-all; color: var(--text-2); }

/* layout ----------------------------------------------------------------- */
main { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 36px 24px 56px; }
main:has(.view-wide:not([hidden])) { max-width: 1180px; }
.view { animation: rise .25s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
.foot {
  display: flex; justify-content: center; gap: 18px; flex-wrap: wrap;
  padding: 18px 24px 26px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--line);
}
.kicker {
  font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 12px;
}
.lead { font-size: 17px; color: var(--text-2); max-width: 40em; }
.title { word-break: break-word; }

/* idle ------------------------------------------------------------------- */
.hero { display: grid; gap: 18px; padding: 24px 0 40px; }
.hero h1 { max-width: 16em; }
.hero-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.ready-note {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--accent);
  padding: 8px 12px; border-radius: var(--radius-sm); background: var(--accent-soft);
}
.steps {
  list-style: none; padding: 0; margin: 0 0 20px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden;
}
.card { padding: 20px; display: grid; gap: 8px; align-content: start; }
.steps .card { border: 0; border-radius: 0; box-shadow: none; }
.steps .card + .card { border-left: 1px solid var(--line); }
.step-n { font: 500 12px/1 var(--mono); color: var(--text-3); }
.card p { color: var(--text-2); font-size: 14px; }
.fine { display: flex; gap: 8px; align-items: flex-start; color: var(--text-3); font-size: 13px; }

/* warmup ----------------------------------------------------------------- */
#v-warmup { display: grid; justify-items: start; gap: 22px; }
.countdown-wrap { display: flex; align-items: baseline; gap: 14px; }
.countdown-wrap p { margin: 0; }
.countdown {
  font: 500 clamp(64px, 11vw, 104px)/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.04em;
}
.countdown.soon { color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px; font-size: 13px; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.chip b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.chip .ic { width: 15px; height: 15px; color: var(--text-3); }
.warm-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rules {
  list-style: none; padding: 16px 18px; margin: 0; display: grid; gap: 10px;
  color: var(--text-2); font-size: 14px; width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.rules li { display: flex; gap: 10px; align-items: flex-start; }
.rules .ic { color: var(--text-3); margin-top: 2px; }

/* playing ---------------------------------------------------------------- */
.play-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.chip-live b { font-variant-numeric: tabular-nums; }
.chip-live .dot { background: var(--danger); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }

.frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); border: 1px solid var(--line); }
.frame video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; display: block; }
.frame:fullscreen { border: 0; border-radius: 0; aspect-ratio: auto; }

.ov {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center;
  padding: 24px; color: #f2f3f4; background: var(--scrim);
  animation: fade .2s ease both;
}
@keyframes fade { from { opacity: 0; } }
.ov p { color: #b9bdc2; font-size: 14px; max-width: 34em; }
.ov-big { font: 600 22px/1.25 var(--sans) !important; color: #f7f8f8 !important; letter-spacing: -.01em; }
.ov .ic-huge { color: #d7dadd; }
.ov-away { background: rgba(12, 13, 14, .86); }

.buffering { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; display: flex; gap: 6px; }
.buffering span { width: 7px; height: 7px; border-radius: 50%; background: #fff; opacity: .8; animation: pulse 1s ease-in-out infinite; }
.buffering span:nth-child(2) { animation-delay: .15s; }
.buffering span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 50% { opacity: .2; } }

.controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  display: flex; align-items: center; gap: 10px; padding: 26px 12px 10px; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
  opacity: 0; transition: opacity .2s;
}
.frame:hover .controls, .frame:focus-within .controls, .frame.show-controls .controls { opacity: 1; }
.controls .icon-btn:hover { background: rgba(255, 255, 255, .14); }
.controls input[type=range] { width: 90px; accent-color: #fff; }
.progress { flex: 1; height: 3px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, .25); }
.progress i { display: block; height: 100%; width: 0; background: #fff; transition: width .5s linear; }

.tiles {
  display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden;
}
.tile { padding: 14px 16px; display: grid; gap: 2px; position: relative; border: 0; border-radius: 0; box-shadow: none; }
.tile + .tile { border-left: 1px solid var(--line); }
.tile .ic { display: none; }
.tile-hl { background: var(--accent-soft); }
.tile-label { font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.tile-num { font: 500 28px/1.2 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tile-sub { font-size: 12px; color: var(--text-3); }

/* results ---------------------------------------------------------------- */
#v-results { display: grid; gap: 16px; }
.result { width: 100%; padding: 22px; display: grid; gap: 18px; }
.result-lead { font-size: 15px; color: var(--text-2); }
.result-lead .hl { display: block; margin-top: 4px; font: 500 40px/1.1 var(--mono); color: var(--text); letter-spacing: -.02em; }
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.result-grid > div { display: grid; gap: 2px; padding: 12px 14px; }
.result-grid > div + div { border-left: 1px solid var(--line); }
.result-grid b { font: 500 18px/1.3 var(--mono); word-break: break-word; }
.result-extra { color: var(--text-2); font-size: 14px; }
.status {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-self: start;
  padding: 8px 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  background: var(--surface-2); color: var(--text-2);
}
.status.paid { background: var(--accent-soft); color: var(--accent); }
.status.wait { background: var(--warn-soft); color: var(--warn); }
.status.bad { background: var(--danger-soft); color: var(--danger); }
.status a { font-weight: 500; }
.phase-note { color: var(--text-3); font-size: 13px; }

/* cards on the page: feedback, multipliers -------------------------------- */
.slot:empty { display: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.fb-card, .boost { width: 100%; padding: 20px 22px; }
.stars { display: flex; gap: 2px; margin: 6px 0 18px; }
.star { background: none; border: 0; padding: 4px; cursor: pointer; border-radius: var(--radius-sm); color: var(--line-strong); }
.star .ic { width: 26px; height: 26px; stroke-width: 1.5; }
.star:hover { color: var(--text-3); }
.star.on { color: var(--accent); }
.star.on .ic { fill: var(--accent); }
.q { margin-bottom: 16px; }
.q-label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 8px; }
.q-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  height: 32px; padding: 0 12px; font-size: 13px; cursor: pointer;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.chip-btn:hover { background: var(--surface-2); }
.chip-btn.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
textarea, .boost-form input, .chat-form input {
  width: 100%; font: inherit; font-size: 14px; color: var(--text);
  padding: 9px 11px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
textarea { resize: vertical; min-height: 84px; }
textarea:focus, .boost-form input:focus, .chat-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.thanks { display: flex; gap: 12px; align-items: flex-start; padding: 4px 0; }
.thanks .ic { color: var(--accent); flex: none; }
.thanks p { margin-bottom: 10px; color: var(--text-2); }

.boost { display: grid; gap: 14px; }
.boost-how { color: var(--text-2); font-size: 14px; }
.boost-how b { color: var(--text); font-weight: 600; }
.boost-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.code {
  font: 500 20px/1 var(--mono) !important; letter-spacing: .2em;
  padding: 8px 12px; border-radius: var(--radius-sm); border: 1px dashed var(--line-strong); background: var(--surface-2);
}
.boost-form { display: flex; gap: 8px; }
.boost-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; font-family: var(--mono); }
.boost-list .ok { color: var(--accent); }
.boost-list .no { color: var(--text-3); }
.chip-mult { font-family: var(--mono); color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* token gate --------------------------------------------------------------- */
.gate-note {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 14px;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--line);
}
.gate-note.ok { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.gate-note.short { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.frame.gated video { filter: blur(24px) saturate(.4) brightness(.8); transform: scale(1.08); }
.gated-note {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 3;
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 24px);
  padding: 8px 12px; font-size: 13px; font-weight: 500; text-align: center;
  color: #f2f3f4; background: rgba(12, 13, 14, .82); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius-sm);
}

/* layout with chat ------------------------------------------------------- */
main.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
main.layout.has-chat { max-width: 1180px; grid-template-columns: minmax(0, 1fr) 320px; }
.content { min-width: 0; }

.chat {
  position: sticky; top: 16px;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 10px;
  height: min(76vh, 720px); padding: 14px;
}
.chat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.chat-head h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.chat-list { list-style: none; margin: 0; padding: 0 2px 0 0; overflow-y: auto; display: grid; align-content: start; gap: 10px; overscroll-behavior: contain; }
.chat-list:empty::before { content: "No messages yet."; color: var(--text-3); font-size: 13px; }
.msg { display: grid; grid-template-columns: 24px 1fr; gap: 1px 10px; font-size: 14px; line-height: 1.4; }
.msg .av { grid-row: span 2; cursor: pointer; }
.msg .who { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.msg .name { font: 500 12px/1.4 var(--mono); cursor: pointer; background: none; border: 0; padding: 0; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg .name:hover { color: var(--text); text-decoration: underline; }
.msg .name.x { color: var(--accent); }
.msg time { color: var(--text-3); font: 11px var(--mono); }
.msg .txt { word-break: break-word; color: var(--text); }
.msg.me .name { color: var(--text); }
.chat-form { display: flex; gap: 6px; }
.chat-note { font-size: 13px; color: var(--text-3); }
.av svg { width: 24px; height: 24px; display: block; border-radius: 4px; }

.profile { position: fixed; z-index: 55; width: min(320px, calc(100vw - 32px)); padding: 16px; display: grid; gap: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
.profile-x { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; }
.profile-top { display: flex; gap: 12px; align-items: center; padding-right: 26px; }
.profile-top .av svg { width: 44px; height: 44px; border-radius: 6px; }
#profile-name { font-family: var(--mono); font-weight: 500; }
#profile-wallet { word-break: break-all; color: var(--text-3); font-size: 11px; }
.profile-body { display: grid; gap: 6px; font-size: 13px; }
.profile-body .kv { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.profile-body .kv span:first-child { color: var(--text-3); }
.profile-body .kv span:last-child { font-family: var(--mono); }

/* toasts ----------------------------------------------------------------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); }
.toast {
  padding: 10px 14px; font-size: 14px;
  color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-left-width: 3px;
  border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  animation: rise .2s ease both;
}
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--accent); }

/* small screens ---------------------------------------------------------- */
@media (max-width: 1000px) {
  main.layout.has-chat { grid-template-columns: minmax(0, 1fr); max-width: 880px; }
  .chat { position: static; height: 420px; }
}
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .steps .card + .card { border-left: 0; border-top: 1px solid var(--line); }
  .tiles, .result-grid { grid-template-columns: repeat(2, 1fr); }
  .tile:nth-child(3), .result-grid > div:nth-child(3) { border-left: 0; }
  .tile:nth-child(n+3), .result-grid > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tile-num { font-size: 22px; }
  .online { display: none; }
  .top { padding: 12px 16px; }
  main { padding: 24px 16px 40px; }
  .controls { opacity: 1; }
  .controls input[type=range] { display: none; }
  .boost-form { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
