:root {
  --ink: #0b1526;
  --ink-2: #152238;
  --card: #142035;
  --card-2: #1a2b45;
  --line: #2a3d5c;
  --paper: #f7f4ee;
  --muted: #9fb0c8;
  --red: #e23b4a;
  --red-deep: #a8192a;
  --gold: #f0c46b;
  --green: #4ea87a;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Fraunces', Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 15% -10%, #1d3354 0%, transparent 60%),
    radial-gradient(900px 500px at 90% 0%, #33182b 0%, transparent 55%),
    var(--ink);
  color: var(--paper);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

.snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 8%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.4px 1.4px at 78% 18%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1.8px 1.8px at 44% 32%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.2px 1.2px at 66% 62%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1.6px 1.6px at 22% 74%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.3px 1.3px at 90% 84%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 54% 92%, rgba(255, 255, 255, 0.4), transparent);
  background-size: 100% 100%;
  animation: drift 22s linear infinite;
  opacity: 0.7;
}

@keyframes drift {
  0% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .snow {
    animation: none;
  }
  * {
    transition: none !important;
  }
}

.shell {
  flex: 1;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 24px 18px 40px;
  position: relative;
  z-index: 1;
}

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 0 18px 22px;
  position: relative;
  z-index: 1;
  min-height: 18px;
}

/* ---------- type ---------- */

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.1;
}

h2 {
  font-size: 1.3rem;
}

h3 {
  font-size: 1.05rem;
  font-family: var(--font);
  font-weight: 600;
}

p {
  margin: 0 0 12px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.tiny {
  font-size: 12px;
}

/* ---------- brand ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.brand .mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--red), var(--red-deep));
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 8px 20px rgba(226, 59, 74, 0.35);
}

.brand .word {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.brand .word span {
  color: var(--gold);
}

/* ---------- hero ---------- */

.hero {
  margin-bottom: 22px;
}

.hero .kicker {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.hero p {
  color: var(--muted);
  margin-top: 10px;
}

/* ---------- cards ---------- */

.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card.plain {
  background: rgba(20, 32, 53, 0.7);
  box-shadow: none;
}

.stack > * + * {
  margin-top: 12px;
}

/* ---------- forms ---------- */

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

input,
textarea,
select {
  width: 100%;
  background: #0e1929;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--paper);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: #64758d;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 196, 107, 0.22);
}

textarea {
  resize: vertical;
  min-height: 84px;
}

input.code {
  letter-spacing: 0.5em;
  font-size: 24px;
  text-align: center;
  font-weight: 600;
  padding: 14px;
  font-variant-numeric: tabular-nums;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* ---------- buttons ---------- */

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--paper);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

button:hover,
.btn:hover {
  background: #22354f;
  border-color: #3b5477;
}

button:active,
.btn:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.primary {
  background: linear-gradient(160deg, #e8474f, #b31d2f);
  border-color: #c92436;
  color: #fff;
}

.primary:hover {
  background: linear-gradient(160deg, #f0555d, #c32234);
  border-color: #e04b5a;
}

.gold {
  background: linear-gradient(160deg, #f3cf86, #d8a94a);
  border-color: #e0b95c;
  color: #2a1c00;
}

.gold:hover {
  background: linear-gradient(160deg, #f7d79a, #e2b658);
}

.ghost {
  background: transparent;
}

.danger {
  border-color: #803041;
  color: #ffb3bd;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.row > * {
  flex: 1 1 auto;
}

.wide {
  width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- link box ---------- */

.linkbox {
  background: #0c1626;
  border: 1px dashed #3d5473;
  border-radius: 12px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  word-break: break-all;
  color: var(--gold);
}

/* ---------- list ---------- */

ul.people {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.people li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

ul.people li:last-child {
  border-bottom: 0;
}

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  background: linear-gradient(150deg, #2b4467, #1d3049);
  border: 1px solid #3d5473;
  color: var(--paper);
}

.avatar.red {
  background: linear-gradient(150deg, #e8474f, #a8192a);
  border-color: #c92436;
}

.avatar.gold {
  background: linear-gradient(150deg, #f3cf86, #c99a3a);
  border-color: #e0b95c;
  color: #2a1c00;
}

.who {
  min-width: 0;
  flex: 1;
}

.who .name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.who .sub {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.badge.green {
  color: #b7f0d1;
  border-color: #2f6a4c;
  background: rgba(78, 168, 122, 0.14);
}

.badge.gold {
  color: #ffe6ae;
  border-color: #7a5c1f;
  background: rgba(240, 196, 107, 0.14);
}

.badge.red {
  color: #ffc2c9;
  border-color: #7a2634;
  background: rgba(226, 59, 74, 0.16);
}

/* ---------- target reveal ---------- */

.target {
  text-align: center;
  padding: 26px 18px;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(226, 59, 74, 0.28), transparent 70%),
    linear-gradient(180deg, #1c2c46, #121d30);
  border: 1px solid #3a4763;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.target .label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.target .name {
  font-family: var(--display);
  font-size: 2.3rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.target .big-avatar {
  width: 74px;
  height: 74px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(150deg, #e8474f, #a8192a);
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 30px rgba(226, 59, 74, 0.35);
}

.target .budget {
  margin-top: 12px;
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(240, 196, 107, 0.14);
  border: 1px solid #7a5c1f;
  color: #ffe6ae;
  font-size: 13px;
  font-weight: 600;
}

/* ---------- ideas list ---------- */

.idea {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.idea:last-child {
  border-bottom: 0;
}

.idea .k {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.idea .v {
  white-space: pre-wrap;
}

.empty {
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 20px);
  background: #f7f4ee;
  color: #0b1526;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100% - 36px);
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: #ffd7db;
}

/* ---------- misc ---------- */

.rule {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
  border: 0;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}

.steps li {
  position: relative;
  padding-left: 34px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #22354f;
  border: 1px solid #3d5473;
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
}

.loading {
  color: var(--muted);
  text-align: center;
  padding: 60px 0;
}

.notice {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid #7a5c1f;
  background: rgba(240, 196, 107, 0.1);
  color: #ffe6ae;
  margin-bottom: 14px;
}

.notice.error {
  border-color: #7a2634;
  background: rgba(226, 59, 74, 0.12);
  color: #ffc2c9;
}

@media (min-width: 700px) {
  .shell {
    padding-top: 44px;
  }
  h1 {
    font-size: 2.5rem;
  }
  .target .name {
    font-size: 2.8rem;
  }
}
