:root {
  --paper: #f6f6f9;
  --ink: #0b0b0f;
  --muted: #6c6c78;
  --in: #e6e6ec;
  --blue: #1f7cf6;
  --green: #2aa651;
  --green-ink: #1c7a3a;
  --glass: rgba(255, 255, 255, 0.58);
  --edge: rgba(255, 255, 255, 0.7);
  --line: rgba(0, 0, 0, 0.09);
  --wash-a: #cfe0ff;
  --wash-b: #f1d6ff;
  --mark: rgba(255, 204, 0, 0.5);
  --on-blue: #fff;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d0d11;
    --ink: #f3f3f6;
    --muted: #9a9aa6;
    --in: #26262c;
    --blue: #2b86ff;
    --green: #2fb45a;
    --green-ink: #5fd887;
    --glass: rgba(30, 30, 36, 0.58);
    --edge: rgba(255, 255, 255, 0.12);
    --line: rgba(255, 255, 255, 0.1);
    --wash-a: #14244a;
    --wash-b: #33183f;
    --mark: rgba(255, 204, 0, 0.32);
  }
}
:root[data-theme="dark"] {
  --paper: #0d0d11;
  --ink: #f3f3f6;
  --muted: #9a9aa6;
  --in: #26262c;
  --blue: #2b86ff;
  --green: #2fb45a;
  --green-ink: #5fd887;
  --glass: rgba(30, 30, 36, 0.58);
  --edge: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.1);
  --wash-a: #14244a;
  --wash-b: #33183f;
  --mark: rgba(255, 204, 0, 0.32);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font: 16px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: #050507;
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.stage { min-height: 100dvh; display: grid; place-items: center; background: radial-gradient(70% 60% at 20% 10%, #101a3a, transparent 70%), radial-gradient(60% 50% at 90% 90%, #24103a, transparent 70%), #050507; }
.app {
  position: relative;
  width: min(100vw, 430px);
  height: min(100dvh, 900px);
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(60% 40% at 15% 0%, var(--wash-a), transparent 70%),
    radial-gradient(55% 40% at 100% 100%, var(--wash-b), transparent 70%),
    var(--paper);
}
@media (min-width: 480px) and (min-height: 700px) {
  .app { border-radius: 44px; border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6); }
}
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* glass */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(1.7);
  backdrop-filter: blur(26px) saturate(1.7);
  border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 24px rgba(0, 0, 0, 0.08);
}

/* top bar */
.bar {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 10px 0; padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  border-radius: 26px; z-index: 2;
}

.who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.who strong { font-size: 16px; font-weight: 650; }
.who span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { width: 36px; height: 36px; flex: none; border-radius: 50%; font-size: 20px; line-height: 1; display: grid; place-items: center; transition: background-color 0.15s; }
.icon:hover { background: var(--line); }
#back { font-size: 28px; padding-bottom: 3px; }
#mute[aria-pressed="true"] { text-decoration: line-through; opacity: 0.45; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 650; }
.score {
  flex: none; font-variant-numeric: tabular-nums; font-weight: 650; font-size: 14px;
  padding: 5px 10px; border-radius: 99px; background: var(--line);
}
.score::after { content: " pts"; font-weight: 500; color: var(--muted); }
.score.bump { animation: bump 0.35s ease; }

/* home */
.scroll { flex: 1; overflow-y: auto; padding: 6px 14px calc(18px + env(safe-area-inset-bottom)); }
.lede { margin: 16px 6px 12px; color: var(--muted); }
.modes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mode {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; border-radius: 22px;
  background: var(--glass); border: 1px solid var(--edge);
  transition: transform 0.15s ease;
}
.mode:active { transform: scale(0.98); }
.letter { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: var(--on-blue); font-weight: 700; }
.mtxt { flex: 1; display: flex; flex-direction: column; }
.mtxt em { font-style: normal; font-size: 13px; color: var(--muted); }
.proto { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 8px; }
.switch {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px;
  border-radius: 22px; background: var(--glass); border: 1px solid var(--edge); cursor: pointer;
}
.switch span { flex: 1; display: flex; flex-direction: column; }
.switch em { font-style: normal; font-size: 13px; color: var(--muted); }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 50px; height: 30px; border-radius: 99px; background: var(--in); position: relative; transition: background-color 0.2s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--blue); outline-offset: 2px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tool, .act {
  padding: 8px 14px; border-radius: 99px; font-size: 14px; font-weight: 550;
  background: var(--line);
}
.act.primary, .tool.primary { background: var(--blue); color: var(--on-blue); }
.act:disabled { opacity: 0.45; cursor: default; }
.fine { font-size: 12px; color: var(--muted); margin: 16px 6px 0; }

/* chat */
.chips { display: flex; gap: 6px; padding: 8px 12px 2px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 5px 12px; border-radius: 99px; font-size: 13px; background: var(--line); color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.goal { margin: 8px 12px 0; padding: 9px 14px; border-radius: 18px; font-size: 13.5px; display: flex; align-items: center; gap: 10px; }
.goal b { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.goal span { flex: 1; }
.dots { display: flex; gap: 4px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--muted); transition: background-color 0.3s, transform 0.3s; }
.dots i.on { background: var(--blue); border-color: var(--blue); transform: scale(1.15); }

.thread { flex: 1; overflow-y: auto; padding: 10px 0 14px; scroll-behavior: smooth; overscroll-behavior: contain; }
.sys { text-align: center; font-size: 12.5px; color: var(--muted); margin: 10px 28px; animation: fade 0.3s both; }
.row { display: flex; flex-direction: column; margin: 3px 12px; animation: pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; will-change: transform, opacity; }
.row.me { align-items: flex-end; transform-origin: 100% 100%; }
.row.them { align-items: flex-start; transform-origin: 0 100%; }
.b { max-width: 78%; padding: 8px 13px; border-radius: 20px; overflow-wrap: anywhere; }
.them .b { background: var(--in); border-bottom-left-radius: 6px; }
.me .b { background-color: var(--blue); color: var(--on-blue); border-bottom-right-radius: 6px; transition: background-color 0.45s ease; }
.me.fail .b { background-color: var(--green); color: #fff; }
.me.note .b { background: transparent; color: var(--ink); border: 1.5px dashed var(--muted); }
.me.note::before { content: "Your read"; font-size: 11px; color: var(--muted); margin: 4px 6px 2px; }
.me.note.fail .b { border-color: var(--green); border-style: solid; }
.b.photo { width: 190px; height: 130px; padding: 0; display: flex; align-items: flex-end; background: linear-gradient(160deg, #1b3f8f, #3d7be0 55%, #9cc1ff); color: #fff; font-size: 12px; }
.b.photo span { padding: 6px 10px; opacity: 0.85; }
.st { font-size: 12px; color: var(--muted); margin: 3px 4px 6px; max-width: 82%; text-align: right; animation: fade 0.3s both; }
.st b { font-weight: 650; color: var(--ink); }
.fail .st b { color: var(--green-ink); }
.st small { display: block; font-size: 12px; margin-top: 2px; }

.typing .b { display: flex; gap: 4px; padding: 13px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

mark { background: var(--mark); color: inherit; border-radius: 5px; padding: 0 2px; box-shadow: 0 0 0 1px var(--mark); animation: fade 0.5s both; }
.blank { display: inline-block; min-width: 68px; text-align: center; border-bottom: 2px dashed currentColor; animation: pulse 1.4s infinite ease-in-out; }
.blank.filled, .blank.revealed { animation: none; border-bottom-style: solid; font-weight: 650; }
.blank.revealed { font-style: italic; }
.blank.shake { animation: shake 0.35s; }

.card {
  margin: 12px; padding: 14px 16px 12px; border-radius: 24px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(1.7); backdrop-filter: blur(26px) saturate(1.7);
  border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 30px rgba(0, 0, 0, 0.1);
  animation: pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1) both; font-size: 14.5px;
}
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 6px 0; }
.card .k { display: block; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.card ul { margin: 2px 0 0; padding-left: 18px; }
.card .meta { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; margin-top: 10px; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.acts .also { width: 100%; font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.act.mini { width: 36px; height: 36px; padding: 0; border-radius: 50%; }

/* composer */
.composer { margin: 0 10px max(10px, env(safe-area-inset-bottom)); padding: 10px; border-radius: 26px; z-index: 2; transition: opacity 0.2s; }
.composer.idle { display: none; }
.ask { display: flex; align-items: center; gap: 8px; margin: 0 4px 8px; font-size: 13.5px; font-weight: 600; }
.ask span { flex: 1; }
.seg { display: flex; padding: 2px; border-radius: 99px; background: var(--line); }
.seg button { padding: 4px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.picks { display: grid; gap: 6px; max-height: 42dvh; overflow-y: auto; }
.pickb {
  text-align: left; padding: 10px 14px; border-radius: 18px; font-size: 15px;
  background: var(--paper); border: 1px solid var(--line);
  transition: transform 0.12s ease, border-color 0.12s;
}
.pickb:hover { border-color: var(--blue); }
.pickb:active { transform: scale(0.98); }
.typer { display: flex; gap: 8px; align-items: center; }
.typer input { flex: 1; min-width: 0; padding: 9px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); outline: none; }
.typer input:focus { border-color: var(--blue); }
.send { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--blue); color: var(--on-blue); font-weight: 700; font-size: 18px; transition: transform 0.12s; }
.send:active { transform: scale(0.9); }

/* sheet */
.sheet { position: absolute; inset: 0; z-index: 5; background: rgba(0, 0, 0, 0.35); display: flex; align-items: flex-end; animation: fade 0.2s both; }
.panel { width: 100%; max-height: 88%; overflow-y: auto; border-radius: 30px 30px 0 0; padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); animation: rise 0.32s cubic-bezier(0.2, 0.9, 0.3, 1) both; font-size: 14.5px; }
.panel h2 { margin: 0; font-size: 19px; flex: 1; }
.panel h3 { margin: 18px 0 6px; font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.panel .head { display: flex; align-items: center; }
.panel p { margin: 6px 0; }
.panel .dim { color: var(--muted); font-size: 13px; }
.field { display: grid; grid-template-columns: 1fr 150px 44px; gap: 10px; align-items: center; margin: 8px 0; }
.field output { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.field input[type="range"] { width: 100%; accent-color: var(--blue); }
.check { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }
.panel .note { padding: 10px 0; border-top: 1px solid var(--line); }
.panel .note strong { display: block; }
.panel .note .stat { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }

@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.94); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes bump { 40% { transform: scale(1.18); } }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

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

/* ── playtest layer: landing, side panel, skins, vote, sign-up ── */

a { color: inherit; }
.badge { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; background: var(--blue); color: var(--on-blue); }
.tile { width: 84px; height: 84px; flex: none; display: block; filter: drop-shadow(0 8px 22px rgba(30, 60, 200, 0.35)); }
.tile.small { width: 40px; height: 40px; filter: none; }
.how { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: how; display: grid; gap: 6px; }
.how li { counter-increment: how; display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: baseline; }
.how li::before { content: counter(how); flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--line); }
.how li b { font-weight: 650; }

.hero { margin: 14px 6px 4px; }
.hero h1 { font-size: 27px; line-height: 1.1; margin: 10px 0 6px; letter-spacing: -0.02em; }
.hero .pitch { margin: 0; color: var(--muted); }
.hero .how { font-size: 14.5px; }
.tools.big .tool { padding: 10px 16px; }
.tool span { color: var(--muted); font-weight: 500; }
.fine a { text-decoration: underline; }

.side { display: none; }
@media (min-width: 980px) {
  .stage { grid-template-columns: minmax(340px, 430px) auto; justify-content: center; gap: 56px; padding: 20px 32px; }
  .side {
    display: block; align-self: center; max-height: calc(100dvh - 40px); overflow-y: auto; padding: 8px 6px; scrollbar-width: thin;
    --ink: #f3f3f6; --muted: #a2a2ae; --line: rgba(255, 255, 255, 0.1); --paper: #16161c; --blue: #2b86ff; --on-blue: #fff; --green: #2fb45a;
    color: var(--ink);
  }
  .app { height: min(100dvh - 40px, 900px); }
  .app .hero { display: none; }
  .app .tools.big .tool[data-sheet="vote"], .app .tools.big .tool[data-sheet="vip"] { display: none; }
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand strong { display: block; font-size: 22px; letter-spacing: -0.01em; margin-bottom: 4px; }
.side h1 { font-size: 44px; line-height: 1.02; letter-spacing: -0.03em; margin: 26px 0 12px; }
.side .pitch { color: var(--muted); font-size: 17px; margin: 0; }
.side .how { margin-top: 18px; }
.box { margin-top: 22px; padding: 16px; border-radius: 22px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.box h2 { margin: 0 0 10px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.foot { color: var(--muted); font-size: 12.5px; margin: 18px 4px 0; }

/* vote + sign-up (used in the side panel and in sheets) */
.vote, .vip { display: grid; gap: 10px; font-size: 14.5px; }
.vote .q { font-weight: 600; margin: 0; }
.favs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.fav { padding: 8px 2px 7px; border-radius: 14px; border: 1.5px solid var(--line); display: grid; gap: 2px; justify-items: center; font-weight: 700; font-size: 16px; transition: transform 0.12s, border-color 0.12s; }
.fav small { font-size: 9.5px; font-weight: 500; color: var(--muted); line-height: 1.15; text-align: center; }
.fav[aria-pressed="true"] { background: var(--blue); color: var(--on-blue); border-color: var(--blue); }
.fav[aria-pressed="true"] small { color: inherit; opacity: 0.85; }
.fav:active { transform: scale(0.96); }
.keeps { display: flex; flex-wrap: wrap; gap: 6px; }
.keep { padding: 5px 12px; border-radius: 99px; font-size: 13px; border: 1.5px solid var(--line); }
.keep[aria-pressed="true"] { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 18%, transparent); }
.vote textarea, .vip input[type="email"] { width: 100%; font: inherit; color: inherit; padding: 9px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); outline: none; resize: none; }
.vote textarea:focus, .vip input[type="email"]:focus { border-color: var(--blue); }
.vip .row2 { display: flex; gap: 8px; }
.vip .row2 input { flex: 1; min-width: 0; border-radius: 99px; }
.dim { color: var(--muted); font-size: 12.5px; margin: 0; }
.okmsg { font-weight: 600; margin: 0; }

/* skins */
.skins { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.skin { text-align: left; border-radius: 18px; border: 1.5px solid var(--line); overflow: hidden; display: grid; }
.skin[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
.skin .sw { height: 64px; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 10px; background: var(--sw-bg); }
.skin .sw i { display: block; height: 14px; border-radius: 99px; }
.skin .sw i:first-child { width: 55%; background: var(--sw-in); }
.skin .sw i:last-child { width: 45%; background: var(--sw-out); align-self: flex-end; }
.skin .cap { padding: 7px 10px 9px; font-size: 13px; }
.skin .cap b { display: block; }
.skin .cap span { color: var(--muted); font-size: 12px; }
.skin.locked .sw { filter: grayscale(1) brightness(0.7); }
.skin.locked { cursor: default; }

.toast { position: absolute; left: 50%; top: 76px; transform: translateX(-50%); z-index: 6; padding: 9px 16px; border-radius: 99px; font-size: 13.5px; font-weight: 600; white-space: nowrap; animation: pop 0.3s both; }

/* skins repaint the phone only; the fail colour stays green in all of them */
.app[data-skin="deep"] { --paper: #06141f; --ink: #eaf6ff; --muted: #8fb0c4; --in: #12303f; --blue: #0e97a6; --on-blue: #fff; --glass: rgba(8, 30, 44, 0.6); --edge: rgba(255, 255, 255, 0.12); --line: rgba(255, 255, 255, 0.11); --wash-a: #0b3a5c; --wash-b: #0a5a66; --green-ink: #5fd887; }
.app[data-skin="sonar"] { --paper: #0b0906; --ink: #fff3e0; --muted: #b59d7c; --in: #2a2118; --blue: #c2500c; --on-blue: #fff; --glass: rgba(30, 22, 12, 0.6); --edge: rgba(255, 255, 255, 0.12); --line: rgba(255, 220, 170, 0.13); --wash-a: #4a2a06; --wash-b: #2b1a05; --green-ink: #5fd887; }
.app[data-skin="abyss"] { --paper: #0a0712; --ink: #f1ecff; --muted: #a497c4; --in: #221a38; --blue: #7c3aed; --on-blue: #fff; --glass: rgba(22, 14, 40, 0.6); --edge: rgba(255, 255, 255, 0.12); --line: rgba(220, 200, 255, 0.13); --wash-a: #2a1466; --wash-b: #4a1058; --green-ink: #5fd887; }
.app[data-skin="founder"] { --paper: #fbf6ea; --ink: #1c1608; --muted: #7b6f57; --in: #efe4c8; --blue: #94690a; --on-blue: #fff; --glass: rgba(255, 250, 235, 0.62); --edge: rgba(255, 255, 255, 0.7); --line: rgba(60, 40, 0, 0.12); --wash-a: #ffe2a0; --wash-b: #ffd3b0; --green-ink: #1c7a3a; }
.app[data-skin="vip"] { --paper: #000; --ink: #f6f6f8; --muted: #9a9aa6; --in: #1c1c21; --blue: #f3f3f6; --on-blue: #0b0b0f; --glass: rgba(20, 20, 24, 0.62); --edge: rgba(255, 255, 255, 0.16); --line: rgba(255, 255, 255, 0.13); --wash-a: #1a1a22; --wash-b: #101016; --green-ink: #5fd887; }
