:root {
  --bg: #fbf7f0;
  --card: #ffffff;
  --ink: #221f3d;
  --muted: #6b6782;
  --line: #e9e3d8;
  --brand: #4b3fb5;
  --brand-ink: #ffffff;
  --brand-soft: #efecfd;
  --gold: #e3a83a;
  --gold-soft: #fdf3de;
  --ok: #1f8a5b;
  --ok-soft: #e3f5ec;
  --bad: #b8364a;
  --bad-soft: #fbe9ec;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(34, 31, 61, .05), 0 8px 24px rgba(34, 31, 61, .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 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 560px; margin: 0 auto; padding: 0 16px; }

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

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin: 0 0 16px; }
.card.tint { background: var(--brand-soft); border-color: #dcd6fb; box-shadow: none; }
.card.gold { background: var(--gold-soft); border-color: #f4dfae; box-shadow: none; }
.card h2 { margin-bottom: .35rem; }

/* Forms */
label { display: block; font-weight: 650; font-size: .95rem; margin: 14px 0 6px; }
label .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=date], textarea, select {
  width: 100%; font: inherit; color: inherit; background: #fff;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 48px;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(75, 63, 181, .15); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.err { color: var(--bad); font-size: .92rem; min-height: 1.3em; margin: 8px 0 0; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 12px 20px; min-height: 48px;
  background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none;
  transition: transform .06s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid #d4cef7; }
.btn.light { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn.gold { background: var(--gold); color: #2b1d00; }
.btn.danger { background: transparent; color: var(--bad); border: 1.5px solid #f0c7ce; }
.btn.small { min-height: 38px; padding: 8px 14px; font-size: .9rem; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }

/* Choice chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: .92rem; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 8px 14px; min-height: 40px; cursor: pointer;
}
.chip[aria-pressed=true] { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.15); }

/* Segmented pack picker */
.packs { display: grid; gap: 8px; }
.pack { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; cursor: pointer; font-weight: 400; margin: 0; }
.pack input { margin-top: 4px; accent-color: var(--brand); width: 18px; height: 18px; }
.pack b { display: block; }
.pack:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* Hero (landing) */
.hero { display: grid; gap: 28px; padding: 18px 0 40px; align-items: start; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.05fr 1fr; gap: 48px; padding-top: 36px; } }
.hero .lead { font-size: 1.12rem; color: #3f3b5c; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.badge { font-size: .82rem; font-weight: 650; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; color: #4a4566; }
.section { padding: 34px 0; }
.steps { display: grid; gap: 14px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step .n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold-soft); color: #8a5a00; font-weight: 800; margin-bottom: 8px; }
.names { display: flex; flex-wrap: wrap; gap: 8px; }
.names span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: .9rem; }
.shots { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.shots figure { margin: 0; }
.shots img { width: 100%; border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow); display: block; background: #fff; }
.shots figcaption { font-size: .9rem; color: var(--muted); margin-top: 8px; text-align: center; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: 10px 0 0; color: #3f3b5c; }
footer { border-top: 1px solid var(--line); padding: 26px 0 40px; margin-top: 30px; color: var(--muted); font-size: .9rem; }
footer a { color: var(--muted); }

/* Game page */
.gamehead { padding: 6px 0 14px; }
.gamehead h1 { font-size: 1.7rem; margin-bottom: 4px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px; text-align: center; }
.stat b { display: block; font-size: 1.35rem; line-height: 1.1; }
.stat span { font-size: .78rem; color: var(--muted); }
.people { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.people li { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px 6px 12px; font-size: .92rem; }
.people li.me { border-color: var(--brand); background: var(--brand-soft); }
.people li .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 2px 6px; border-radius: 50%; }
.people li .x:hover { background: var(--bad-soft); color: var(--bad); }
.tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #8a5a00; background: var(--gold-soft); border-radius: 999px; padding: 2px 8px; }
.sharebox { display: flex; gap: 8px; align-items: center; background: #fff; border: 1.5px dashed #cfc7f5; border-radius: 12px; padding: 10px 12px; font-size: .92rem; word-break: break-all; margin: 10px 0; }

.mortal { display: flex; gap: 14px; align-items: center; }
.avatar { flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; color: #fff; background: var(--brand); }
.avatar.q { background: var(--gold); color: #2b1d00; }
.likes { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 12px 0 0; font-size: .95rem; }
.likes dt { color: var(--muted); }
.likes dd { margin: 0; font-weight: 600; }

.theme { display: flex; gap: 12px; align-items: flex-start; }
.theme .ico { flex: none; font-size: 1.6rem; line-height: 1; }
.theme .kicker { font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: #8a5a00; }

.tabs { display: flex; gap: 6px; background: #ece7dd; padding: 4px; border-radius: 999px; margin: 0 0 12px; }
.tabs button { flex: 1; font: inherit; font-weight: 700; font-size: .92rem; border: 0; background: transparent; padding: 10px 8px; border-radius: 999px; cursor: pointer; color: #4a4566; min-height: 42px; }
.tabs button[aria-selected=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .75rem; line-height: 20px; }

.thread { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 4px 2px 8px; }
.bubble { max-width: 84%; padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; position: relative; }
.bubble.them { background: #f3f0ea; align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.mine { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.bubble .meta { display: flex; gap: 10px; justify-content: space-between; font-size: .72rem; opacity: .7; margin-top: 4px; }
.bubble .meta button { font: inherit; background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.empty { text-align: center; color: var(--muted); padding: 18px 8px; font-size: .95rem; }
.compose { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.compose textarea { min-height: 48px; height: 48px; flex: 1; resize: none; line-height: 1.4; }
.compose .btn { flex: none; }

.guess select { margin-top: 6px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: .92rem; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(20, 18, 40, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal .box { background: #fff; border-radius: 20px; padding: 22px; max-width: 420px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal .box p { color: #3f3b5c; }

/* Reveal */
.reveal-stage { text-align: center; padding: 26px 18px; }
.reveal-stage .who { font-size: 1.05rem; color: var(--muted); }
.reveal-stage .angel { font-size: 2.2rem; font-weight: 850; margin: 8px 0; color: var(--brand); }
.reveal-stage .verdict { display: inline-block; font-weight: 700; border-radius: 999px; padding: 6px 14px; margin-top: 6px; }
.verdict.yes { background: var(--ok-soft); color: var(--ok); }
.verdict.no { background: var(--bad-soft); color: var(--bad); }
.verdict.none { background: #f1efe9; color: var(--muted); }
.progress { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.ringwrap { display: flex; justify-content: center; }
.ringwrap svg { width: 100%; max-width: 440px; height: auto; }
.chain { list-style: none; padding: 0; margin: 10px 0 0; }
.chain li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.chain li:last-child { border-bottom: 0; }
.chain .ok { color: var(--ok); font-weight: 700; white-space: nowrap; }
.chain .miss { color: var(--muted); white-space: nowrap; }
.awards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 6px; }
.award { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.award b { display: block; font-size: 1.05rem; }
.award span { font-size: .82rem; color: var(--muted); }

.center { text-align: center; }
.hidden { display: none !important; }
.spinner { width: 28px; height: 28px; border: 3px solid #ddd6fb; border-top-color: var(--brand); border-radius: 50%; animation: spin 0.9s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } .btn { transition: none; } }

.hero-shot { display: none; }
@media (min-width: 900px) { .hero-shot { display: block; margin-top: 22px; max-width: 300px; border-radius: 24px; border: 1px solid var(--line); box-shadow: var(--shadow); } }
