:root {
  --bg: #f7f4ee;
  --card: #ffffff;
  --ink: #1d1a2e;
  --muted: #6b6779;
  --line: #e7e2d8;
  --brand: #5b3df5;
  --brand-ink: #ffffff;
  --brand-soft: #ece8ff;
  --amber: #ffb43c;
  --good: #1f9d63;
  --good-soft: #e3f6ec;
  --bad: #d64545;
  --bad-soft: #fdeaea;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(29, 26, 46, .06), 0 8px 24px rgba(29, 26, 46, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: 1.35rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 18px; }
.wide { max-width: 1040px; }

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.logo img { width: 30px; height: 30px; border-radius: 8px; }

/* Cards and controls */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 0 0 16px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
label { display: block; font-weight: 650; font-size: .92rem; margin: 0 0 6px; }
input[type=text], textarea {
  width: 100%; font: inherit; color: inherit; background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 96px; }
input[type=text]:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.field { margin: 0 0 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700;
  border: 0; border-radius: 999px; padding: 13px 22px; cursor: pointer; text-decoration: none;
  background: var(--brand); color: var(--brand-ink); transition: transform .06s, filter .15s, opacity .15s; min-height: 48px;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.quiet { background: transparent; color: var(--muted); padding: 8px 10px; min-height: 0; font-weight: 600; }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1.5px #f1c4c4; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 auto; }
.error { color: var(--bad); font-size: .92rem; min-height: 1.4em; margin: 6px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 11px; font-size: .82rem; font-weight: 700; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.pill.amber { background: #fff1d6; color: #9a5b00; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.grey { background: #efece6; color: var(--muted); }

/* Landing */
.hero { padding: 36px 0 18px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero-grid { display: grid; gap: 28px; align-items: start; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 48px; } .hero { padding-top: 56px; } }
.steps { display: grid; gap: 14px; margin: 28px 0; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.step b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; margin-bottom: 10px; }
.demo { position: relative; }
.demo .q { font-size: 1.2rem; font-weight: 750; margin: 6px 0 14px; }
.ans { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 0 0 10px; background: #fff; }
.ans .who { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  font: inherit; font-size: .9rem; font-weight: 650; border-radius: 999px; padding: 7px 13px; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); min-height: 38px;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.used { opacity: .4; }
.chip:disabled { cursor: default; }
.faq details { background: var(--card); border-radius: 14px; padding: 14px 16px; margin: 0 0 10px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
footer { padding: 32px 0 48px; color: var(--muted); font-size: .9rem; }
footer a { color: var(--muted); }

/* Game */
.gh { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.gh h1 { font-size: 1.6rem; margin: 0; word-break: break-word; }
.prompt-card { background: var(--ink); color: #fff; }
.prompt-card .kicker { color: #bdb7ff; font-size: .8rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.prompt-card .q { font-size: 1.45rem; font-weight: 780; line-height: 1.25; margin: 8px 0 16px; letter-spacing: -.01em; }
.prompt-card textarea { background: #fff; color: var(--ink); border-color: transparent; }
.prompt-card .muted { color: #c9c5d8; }
.prompt-card .btn.ghost { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5); }
.mine { background: rgba(255,255,255,.1); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; }
.people { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.people li { display: inline-flex; align-items: center; gap: 6px; background: #f2efe9; border-radius: 999px; padding: 5px 11px 5px 5px; font-size: .9rem; font-weight: 600; }
.people li.done { background: var(--good-soft); color: #136b43; }
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .78rem; font-weight: 800; color: #fff; flex: none; }
.progress { height: 8px; background: #ece8e0; border-radius: 99px; overflow: hidden; margin: 12px 0 6px; }
.progress i { display: block; height: 100%; background: var(--good); border-radius: 99px; transition: width .3s; }
.guess .ans.mine-ans { background: #faf8f4; color: var(--muted); }
.guess .ans.set { border-color: var(--brand); }
.reveal .ans { padding: 14px; }
.reveal .author { display: flex; align-items: center; gap: 8px; font-weight: 750; margin-top: 10px; }
.reveal .verdicts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.v { font-size: .8rem; font-weight: 650; border-radius: 999px; padding: 3px 9px; }
.v.right { background: var(--good-soft); color: #136b43; }
.v.wrong { background: var(--bad-soft); color: #a33030; }
.board { width: 100%; border-collapse: collapse; }
.board td { padding: 9px 4px; border-top: 1px solid var(--line); }
.board tr:first-child td { border-top: 0; }
.board .num { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.award { background: #faf8f4; border-radius: 14px; padding: 12px; }
.award .big { font-size: 1.5rem; }
.award b { display: block; }
.invite { background: linear-gradient(135deg, #5b3df5, #8a5cf6); color: #fff; }
.invite .muted { color: #e4dcff; }
.invite .btn { background: #fff; color: var(--brand); }
.invite .btn.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.6); }
.linkbox { display: flex; gap: 8px; align-items: center; background: rgba(255,255,255,.14); border-radius: 12px; padding: 8px 8px 8px 12px; margin: 10px 0; font-size: .9rem; word-break: break-all; }
.hist button { all: unset; display: block; width: 100%; cursor: pointer; padding: 10px 0; border-top: 1px solid var(--line); }
.hist button:first-child { border-top: 0; }
.hist .d { font-size: .8rem; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 18px; font-weight: 650; opacity: 0; transition: .2s; pointer-events: none; z-index: 10; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.skeleton { height: 140px; border-radius: var(--radius); background: linear-gradient(90deg, #efebe4, #f7f4ee, #efebe4); background-size: 200% 100%; animation: sk 1.2s infinite; margin-bottom: 16px; }
@keyframes sk { to { background-position: -200% 0; } }
.legal { max-width: 720px; }
.legal h2 { margin-top: 1.6em; }
