:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #1d1b19;
  --muted: #6f6a63;
  --line: #e4ded5;
  --accent: #c2412d;
  --accent-ink: #ffffff;
  --ok: #2f7d55;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }

.wrap { max-width: 520px; margin: 0 auto; padding: 24px 16px 64px; }

.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

h1 { font-size: 1.6rem; margin: 0 0 4px; line-height: 1.2; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
.card > h2:not(:first-child) { margin-top: 20px; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }

.form { display: grid; gap: 14px; margin-top: 16px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
label small { font-weight: 400; color: var(--muted); }

input {
  font: inherit;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  width: 100%;
}
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.btn {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.btn:hover { filter: brightness(1.06); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: #efe9e1; color: var(--ink); }
.btn.big { font-size: 1.15rem; padding: 16px 28px; }

.link { font: inherit; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; text-decoration: underline; }
.link.danger { color: var(--accent); }

.flash { padding: 12px 14px; border-radius: 10px; margin: 0 0 16px; }
.flash.error { background: #fbe7e3; color: #8a2a1b; }
.flash.success { background: #e3f3ea; color: #1f5a3c; }

.share { margin-bottom: 16px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; font-size: .9rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }

.tag { font-size: .8rem; padding: 2px 10px; border-radius: 99px; background: #efe9e1; color: var(--muted); }
.tag.done { background: #e3f3ea; color: var(--ok); }

.reveal { text-align: center; padding: 16px 0 4px; }
.result { font-size: 2.4rem; font-weight: 800; margin: 4px 0; color: var(--accent); min-height: 1.3em; word-break: break-word; }
.result.spinning { color: var(--muted); }
.result.landed { animation: pop .45s ease-out; }

@keyframes pop {
  0% { transform: scale(.85); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

textarea, select {
  font: inherit;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  width: 100%;
}
textarea { resize: vertical; }
textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.actions { display: flex; align-items: center; gap: 8px; }
.card > .list { margin-top: 8px; }
.btn.armed { background: var(--ink); }
.link.armed { color: var(--accent); font-weight: 600; }
