@font-face { font-family: "Lab Grotesque"; src: url("/assets/LabGrotesque-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lab Grotesque"; src: url("/assets/LabGrotesque-Medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Lab Grotesque"; src: url("/assets/LabGrotesque-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }

:root {
  --accent: #2291FF;
  --accent-strong: #1a7ae0;
  --accent-soft: #e8f3ff;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1f2329;
  --muted: #6b7280;
  --border: #dfe3e8;
  --danger: #d63b3b;
  --ok: #1a9e5a;
  --fire: #ff6a1a;
  --fire-soft: #fff1e8;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #3a9dff;
    --accent-strong: #64b2ff;
    --accent-soft: #15283d;
    --bg: #121418;
    --surface: #1c1f25;
    --text: #e8eaed;
    --muted: #9aa1ab;
    --border: #2e333b;
    --fire-soft: #3a2416;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Lab Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.45;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.brand img { border-radius: 7px; }

main { max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; }
.screen { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h1 { font-size: 26px; line-height: 1.2; margin: 8px 0 12px; font-weight: 700; }
h2 { font-size: 22px; line-height: 1.25; margin: 10px 0 14px; font-weight: 700; }
.lead { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 15px; }
.hint { color: var(--muted); font-size: 13px; text-align: center; margin-top: 16px; }

.legend { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.legend li { display: flex; align-items: center; gap: 6px; }
.emoji { font-size: 22px; line-height: 1; }

form { margin-top: 20px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 15px; color: var(--muted); margin-bottom: 6px; }
input, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
}
textarea { resize: vertical; min-height: 120px; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.form-error { color: var(--danger); font-size: 15px; margin: 0 0 12px; }

.btn {
  font: inherit; font-weight: 500; border: 0; border-radius: 10px; padding: 13px 22px; cursor: pointer;
  min-height: 48px;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); }
.btn:disabled { opacity: .55; cursor: default; }
form .btn { width: 100%; }
.link-btn {
  font: inherit; font-size: 15px; background: none; border: 0; color: var(--accent); cursor: pointer;
  padding: 10px 4px; min-height: 44px;
}
.link-btn:disabled { color: var(--muted); opacity: .5; cursor: default; }
.topbar .link-btn { font-size: 14px; text-align: right; }

.progress { margin-bottom: 14px; }
.progress-text { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
#progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }
.save-status.error { color: var(--danger); }
.save-status.ok { color: var(--ok); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; box-shadow: var(--shadow); min-height: 260px;
}
.card.leave { animation: leave .18s ease forwards; }
@keyframes leave { to { opacity: 0; transform: translateX(-16px); } }
.chip {
  display: inline-block; font-size: 13px; color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 4px 10px;
}
.bubble { display: flex; gap: 10px; align-items: flex-start; }
.bubble img { border-radius: 50%; flex: none; }
.bubble > div { background: var(--bg); border-radius: 4px 14px 14px 14px; padding: 10px 14px; }
.bubble-author { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.bubble p { margin: 0; }

.votes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.vote {
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface);
  border: 2px solid var(--border); border-radius: 14px; padding: 12px 6px; min-height: 84px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: transform .1s ease, border-color .15s ease, background .15s ease;
}
.vote .emoji { font-size: 30px; }
.vote:active { transform: scale(.96); }
.vote[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.vote[data-vote="fire"][aria-pressed="true"] { border-color: var(--fire); background: var(--fire-soft); }
@media (hover: hover) { .vote:hover { border-color: var(--accent); } }

.nav-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }

.pick-list { display: grid; gap: 8px; margin: 12px 0; }
.pick {
  display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 2px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer;
}
.pick .box {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border);
  display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #fff;
}
.pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.pick[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); }
.pick:disabled { opacity: .5; cursor: default; }
.pick small { display: block; color: var(--muted); font-size: 13px; }

.done-icon {
  width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 34px; margin: 24px 0 8px;
}

dialog {
  border: 0; border-radius: 16px; padding: 20px; max-width: min(480px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}
dialog::backdrop { background: rgba(0, 0, 0, .4); }
dialog h2 { margin-top: 0; font-size: 20px; }
dialog form { margin: 0; }

@media (max-width: 420px) {
  body { font-size: 16px; }
  h1 { font-size: 23px; }
  h2 { font-size: 20px; }
  .card { padding: 16px; min-height: 230px; }
  .vote { min-height: 78px; font-size: 13px; }
  .topbar .link-btn { max-width: 150px; line-height: 1.2; }
}
@media (hover: none) { .desktop-only { display: none; } }
