/* TreeWatch: bright, chunky, kid-friendly. Mobile first. */

:root {
  --navy: #17324d;
  --navy-2: #24496d;
  --ink: #1d2b3a;
  --muted: #5d6b7a;
  --sky: #2f8fe0;
  --sky-light: #6cc4f7;
  --leaf: #4cc93a;
  --leaf-dark: #2f9a26;
  --berry: #ff7a1a;
  --berry-dark: #c95500;
  --sun: #ffd23f;
  --sun-dark: #d9a800;
  --sky-btn: #2aa7f5;
  --sky-btn-dark: #1677b8;
  --card: #ffffff;
  --line: #e3e9f0;
  --radius: 22px;
  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: #a8e27a; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.22) 0 70px, transparent 71px),
    radial-gradient(circle at 88% 22%, rgba(255, 255, 255, 0.16) 0 50px, transparent 51px),
    linear-gradient(180deg, var(--sky) 0, var(--sky-light) 600px, #a8e27a 1400px);
  background-repeat: no-repeat;
  background-color: #a8e27a;
}

a { color: var(--sky-btn-dark); font-weight: 800; }

img.pixel { image-rendering: pixelated; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--navy);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.brand img { width: 38px; height: 38px; }
.brand span b { color: var(--leaf); }

.me {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.95rem;
}
.me img { width: 36px; height: 36px; border-radius: 10px; border: 3px solid #fff; }

/* ---------- Layout ---------- */

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 14px 48px;
}
main.wide { max-width: 860px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 6px 0 rgba(23, 50, 77, 0.18);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.3rem;
  font-weight: 900;
}

h1 {
  margin: 0 0 6px;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.lead { margin: 0; color: var(--muted); font-size: 1.05rem; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.center { text-align: center; }

.page-title {
  color: #fff;
  text-shadow: 0 3px 0 rgba(23, 50, 77, 0.35);
  margin: 6px 4px 16px;
}
.page-title .lead { color: rgba(255, 255, 255, 0.92); }

/* ---------- Buttons ---------- */

.btn {
  --bg: var(--leaf);
  --edge: var(--leaf-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 18px;
  border: 0;
  border-radius: 16px;
  background: var(--bg);
  box-shadow: 0 6px 0 var(--edge);
  color: #fff;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 900;
  text-decoration: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.06s, box-shadow 0.06s, filter 0.1s;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 6px;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--edge); }
.btn:disabled { filter: grayscale(0.8) brightness(1.1); cursor: not-allowed; }
.btn.orange { --bg: var(--berry); --edge: var(--berry-dark); }
.btn.blue { --bg: var(--sky-btn); --edge: var(--sky-btn-dark); }
.btn.yellow { --bg: var(--sun); --edge: var(--sun-dark); color: var(--ink); text-shadow: none; }
.btn.white { --bg: #fff; --edge: #c9d6e3; color: var(--ink); text-shadow: none; }
.btn.small { width: auto; padding: 9px 14px; font-size: 1rem; border-radius: 12px; box-shadow: 0 4px 0 var(--edge); }
.btn.small:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }

.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }

.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- Forms ---------- */

label.field { display: block; font-weight: 900; margin-bottom: 14px; }
label.field span.hint { display: block; font-weight: 700; color: var(--muted); font-size: 0.9rem; }

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 13px 14px;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #f7fafc;
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  outline: none;
}
input:focus { border-color: var(--sky-btn); background: #fff; }

/* ---------- Flash messages ---------- */

.flash {
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 14px;
  font-weight: 800;
  box-shadow: 0 4px 0 rgba(23, 50, 77, 0.15);
}
.flash.success { background: #e3fbd9; color: #1f6a17; }
.flash.error { background: #ffe3d6; color: #9a3a00; }
.flash.info { background: #fff6cc; color: #6b5300; }

/* ---------- Hero / landing ---------- */

.hero { text-align: center; padding: 26px 20px 22px; }
.hero img.logo { width: 120px; height: 120px; }
.hero h1 { font-size: 2.4rem; }

.speech {
  position: relative;
  display: inline-block;
  margin: 8px 0 16px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #fff6cc;
  font-weight: 800;
}

/* ---------- Avatars and chips ---------- */

.avatar { border-radius: 14px; flex: none; image-rendering: pixelated; }
.avatar.xl { width: 132px; height: 132px; border-radius: 28px; box-shadow: 0 6px 0 rgba(23, 50, 77, 0.2); }
.avatar.lg { width: 64px; height: 64px; }
.avatar.md { width: 48px; height: 48px; }
.avatar.sm { width: 32px; height: 32px; border-radius: 9px; }

.chip {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: #e6f3ff;
  color: var(--sky-btn-dark);
  font-weight: 900;
  font-size: 0.9rem;
}
.chip.green { background: #e3fbd9; color: var(--leaf-dark); }
.chip.orange { background: #ffe8d6; color: var(--berry-dark); }

.stats { display: flex; gap: 12px; }
.stat {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  border-radius: 16px;
  background: #f2f7fc;
}
.stat b { display: block; font-size: 1.8rem; font-weight: 900; line-height: 1; }
.stat span { font-weight: 800; color: var(--muted); font-size: 0.85rem; }

/* ---------- Tag (scan) page ---------- */

.tag-hero { text-align: center; padding-top: 24px; }
.tag-hero h1 { margin-top: 14px; }

.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.step-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 4px 0 var(--sun-dark);
  font-weight: 900;
  font-size: 1.2rem;
}
.step-num.done { background: var(--leaf); box-shadow: 0 4px 0 var(--leaf-dark); color: #fff; }
.step-body { flex: 1; min-width: 0; }
.step-body h2 { margin-bottom: 6px; }

.status {
  margin: 0 0 12px;
  font-weight: 800;
  color: var(--muted);
}
.status.ok { color: var(--leaf-dark); }
.status.bad { color: var(--berry-dark); }

.photo-drop {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 4px dashed #bcd3e6;
  border-radius: 18px;
  background: #f4f9fd;
  color: var(--muted);
  font-weight: 900;
  font-size: 1.1rem;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}
.photo-drop.has-photo { border-style: solid; border-color: var(--leaf); padding: 0; }
.photo-drop img { display: block; width: 100%; max-height: 340px; object-fit: cover; }
.photo-drop .big { font-size: 2.6rem; display: block; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-grid figure { margin: 0; position: relative; }
.photo-grid img.shot {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  background: #eef3f8;
}
.photo-grid figcaption {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-grid figcaption img { width: 18px; height: 18px; border-radius: 5px; image-rendering: pixelated; }

.celebrate {
  text-align: center;
  background: var(--sun);
  box-shadow: 0 6px 0 var(--sun-dark);
}
.celebrate h2 { font-size: 1.6rem; margin: 0; }

/* ---------- Lists ---------- */

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 2px solid var(--line);
}
.list li:first-child { border-top: 0; padding-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 900; font-size: 1.05rem; }
.list a.rowlink { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }

.thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; }

/* ---------- Admin ---------- */

.url-box {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.url-box code {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: #f2f7fc;
  border: 2px solid var(--line);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
.new-tag { background: #f3fde9; border-radius: 14px; padding-left: 10px !important; padding-right: 10px; }

ol.howto { padding-left: 1.3rem; margin: 0; }
ol.howto li { margin-bottom: 6px; font-weight: 700; }

.coords { font-variant-numeric: tabular-nums; }

.checkin-photo { width: 100%; border-radius: 16px; display: block; margin-top: 10px; }

footer.foot {
  text-align: center;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0 14px 30px;
}
