:root {
  --sea: #123049;
  --sea-2: #1b4466;
  --parch: #fbf3e2;
  --parch-2: #f1e3c4;
  --ink: #2a2118;
  --muted: #7a6a55;
  --gold: #d79b25;
  --gold-dark: #9a6b0f;
  --coral: #e2574c;
  --radius: 16px;
  font-family: Nunito, system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--sea); }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  background:
    radial-gradient(ellipse at 50% -10%, #2a6d96 0%, transparent 60%),
    repeating-linear-gradient(170deg, transparent 0 38px, rgba(255,255,255,.035) 38px 40px),
    var(--sea);
}
main { max-width: 760px; margin: 0 auto; padding: 24px 16px 40px; }
h1, h2 { font-family: Cinzel, Georgia, serif; margin: 0; line-height: 1.1; }
button, input, textarea { font: inherit; color: inherit; }

.scroll {
  background: var(--parch); border-radius: var(--radius); padding: 24px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 0 0 3px var(--parch-2);
}
.kicker { font-weight: 800; color: var(--gold-dark); text-transform: uppercase; letter-spacing: .1em; font-size: 13px; }
.hero-title { font-size: clamp(30px, 8vw, 50px); color: var(--sea); margin: 6px 0 12px; }
.lead { font-size: 18px; line-height: 1.5; margin: 0 0 14px; }
.fine { color: var(--muted); font-size: 15px; }

.progress { display: flex; gap: 6px; margin-bottom: 14px; }
.progress i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); }
.progress i.on { background: var(--gold); }

.step-title { font-size: clamp(24px, 6vw, 34px); color: var(--sea); margin-bottom: 6px; }
.step-help { margin: 0 0 16px; font-size: 17px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.pick {
  text-align: left; background: #fff; border: 3px solid var(--parch-2); border-radius: 14px;
  padding: 12px; cursor: pointer; transition: transform .12s, border-color .12s;
  display: flex; flex-direction: column; gap: 4px; min-height: 112px;
}
.pick:hover { transform: translateY(-2px); border-color: var(--gold); }
.pick.off { opacity: .45; cursor: default; background: var(--parch); }
.pick.off:hover { transform: none; border-color: var(--parch-2); }
.pick.on { border-color: var(--gold); background: #fff8e6; box-shadow: 0 0 0 3px rgba(215,155,37,.35); }
.pick .icon { font-size: 34px; line-height: 1; }
.pick .name { font-family: Cinzel, serif; font-weight: 900; font-size: clamp(15px, 4.4vw, 19px); overflow-wrap: anywhere; }
.pick .tag { font-size: 14px; color: var(--muted); line-height: 1.3; }

.detail { margin-top: 14px; background: #fff; border-radius: 14px; padding: 14px 16px; border: 2px dashed var(--gold); }
.detail h3 { font-family: Cinzel, serif; margin: 0 0 8px; font-size: 22px; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; margin-bottom: 10px; font-weight: 700; }
.meter { display: flex; gap: 4px; }
.meter i { width: 22px; height: 12px; border-radius: 3px; background: var(--parch-2); }
.meter i.on { background: var(--gold); }
.detail p { margin: 6px 0; line-height: 1.45; }
.detail b { color: var(--sea); }

label.field { display: block; font-weight: 800; margin: 14px 0 6px; font-size: 17px; }
input[type=text], textarea {
  width: 100%; border: 2px solid var(--parch-2); border-radius: 12px; padding: 12px 14px;
  background: #fff; font-size: 18px;
}
input[type=text]:focus, textarea:focus { outline: none; border-color: var(--gold); }
textarea { min-height: 90px; resize: vertical; }
.with-dice { display: flex; gap: 8px; }
.with-dice input { flex: 1; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 54px; height: 54px; border-radius: 50%; border: 4px solid #fff; cursor: pointer;
  box-shadow: 0 0 0 2px var(--parch-2); position: relative;
}
.swatch.on { box-shadow: 0 0 0 4px var(--gold); transform: scale(1.08); }
.swatch-label { font-weight: 800; margin-top: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--parch-2); background: #fff; border-radius: 999px; padding: 7px 12px; cursor: pointer; font-size: 15px; }
.chip.on { border-color: var(--gold); background: #fff8e6; font-weight: 800; }

.nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.btn {
  border: none; border-radius: 999px; padding: 13px 24px; font-weight: 800; font-size: 18px; cursor: pointer;
  background: var(--parch-2); color: var(--ink);
}
.btn.go { background: var(--gold); color: #2a1a00; box-shadow: 0 4px 0 var(--gold-dark); }
.btn.go:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--gold-dark); }
.btn:disabled { opacity: .45; cursor: default; }
.dice-btn { border: 2px solid var(--gold); background: #fff8e6; border-radius: 12px; padding: 0 14px; font-size: 22px; cursor: pointer; }
.error { color: var(--coral); font-weight: 800; margin-top: 10px; }

.card {
  background: #fff; border-radius: 18px; padding: 18px; border: 4px solid var(--hero, var(--gold));
  display: grid; gap: 6px;
}
.card .big { font-family: Cinzel, serif; font-size: clamp(26px, 7vw, 38px); font-weight: 900; color: var(--sea); }
.card .sub { font-size: 18px; font-weight: 800; }
.card .row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { background: var(--parch); border-radius: 999px; padding: 4px 10px; font-size: 14px; font-weight: 700; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; border: 2px solid #fff; box-shadow: 0 0 0 1px #ccc; }

.privacy { max-width: 760px; margin: 0 auto; padding: 0 16px 28px; color: rgba(255,255,255,.65); font-size: 13px; text-align: center; }

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

.upload { display: block; text-align: center; margin: 10px auto; max-width: 360px; }
.big-drawing { display: block; width: 100%; max-width: 420px; margin: 0 auto 6px; border-radius: 12px; border: 3px solid var(--parch-2); }
.tools { display: flex; justify-content: center; margin-top: 8px; }
.card img.drawing { width: 100%; max-width: 260px; border-radius: 10px; border: 2px solid var(--parch-2); justify-self: center; }

/* Species cards carry a picture of the species above the name. */
.grid.species { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.pick .art { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--parch); display: block; margin-bottom: 4px; }

.edit-link { margin-top: 14px; }
.edit-link input { font-size: 14px; color: var(--muted); }
.grid.species .name { font-size: clamp(14px, 4vw, 19px); overflow-wrap: normal; }
