/* FieldBoop — Soft Paw / BoopBureau PWA scaffold */
:root {
  --forest: #1F6B45;
  --forest-hot: #155A38;
  --forest-soft: #A8D4B0;
  --moss: #6BAA7A;
  --sky: #C8ECFF;
  --sky-deep: #7EC8F5;
  --trail: #C5E017;
  --trail-soft: #E4F56A;
  --trail-wash: #F4F9D0;
  --sand: #FAF8F2;
  --sand-deep: #E8F2EC;
  --ink: #14261C;
  --ink-soft: #3D5346;
  --muted: #6B7D72;
  --white: #FFFFFF;
  --card: rgba(255, 255, 255, 0.94);
  --shadow: rgba(20, 38, 28, 0.12);
  --radius: 28px;
  --radius-sm: 18px;
  --radius-pill: 999px;
  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(180deg, #C8ECFF 0%, #D8F0C8 38%, #E8E0C8 58%, #FAF8F2 78%);
  color: var(--ink);
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: var(--nav-h);
}
.screen.active { display: flex; }
.screen.no-nav { padding-bottom: var(--safe-bottom); }

/* —— Shared bits —— */
.paw-svg { width: 1em; height: 1em; }

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.paw-box {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: transparent;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.paw-box svg { width: 28px; height: 28px; }
.paw-box img.brand-logo { width: 48px; height: 48px; object-fit: contain; }
.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--forest);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.brand-text p {
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--trail-wash);
  border: 2px solid var(--trail);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--forest);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: 0 8px 24px var(--shadow);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  border-radius: var(--radius-pill);
  padding: 1rem 1.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-trail {
  background: var(--trail);
  color: var(--ink);
  box-shadow:
    0 10px 24px rgba(20, 38, 28, 0.22),
    0 3px 0 rgba(31, 107, 69, 0.22),
    inset 0 2px 6px rgba(255, 255, 255, 0.35);
}
.btn-forest {
  background: var(--forest);
  color: var(--white);
  box-shadow:
    0 12px 28px rgba(20, 38, 28, 0.32),
    0 4px 0 rgba(15, 55, 35, 0.35),
    inset 0 2px 6px rgba(255, 255, 255, 0.18);
}
.btn-outline {
  background: var(--sand);
  border: 3px solid var(--forest);
  color: var(--forest);
  box-shadow: 0 8px 20px rgba(20, 38, 28, 0.14);
}
.btn .icon-chip {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 900;
  background: var(--forest);
  color: var(--trail);
  flex-shrink: 0;
}
.btn-outline .icon-chip { color: var(--sand); border-radius: 8px; }

.circle-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2.5px solid var(--forest);
  background: var(--sand);
  color: var(--forest);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* —— Bottom nav —— */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(430px, 100%);
  background: var(--sand);
  border-top: 1px solid #E5EBE4;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 0.45rem 0.5rem max(0.35rem, var(--safe-bottom));
  z-index: 50;
}
.bottom-nav.hidden { display: none; }

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.7rem;
  min-width: 72px;
  padding: 0.2rem;
}
.nav-tab .nav-ico { font-size: 1.35rem; line-height: 1; }
.nav-tab .bar {
  width: 28px; height: 3px;
  background: transparent;
  border-radius: 4px;
  margin-top: 2px;
}
.nav-tab.active { color: var(--forest); }
.nav-tab.active .bar { background: var(--trail); }

/* —— HQ —— */
.hq-scene {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.1rem 0.35rem;
  gap: 0.75rem;
}
.hq-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.hq-badges {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.card-head .ico {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--trail);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.card-head h2 {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--forest);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mission-body {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.mission-body img {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--sand-deep);
}
.mission-copy h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--forest);
  line-height: 1.15;
}
.mission-copy p {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
  font-weight: 600;
}
.mission-foot {
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  border-top: 2px dashed #D5E0D8;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--forest);
  font-weight: 700;
}

.pill-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--trail);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--forest);
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
}
.case-body {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.case-copy { flex: 1; min-width: 0; }
.case-copy h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--forest);
}
.case-copy p {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.35rem;
  font-weight: 600;
}
.case-body img {
  width: 88px; height: 108px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 12px;
}

.hq-cta { margin-top: auto; padding-top: 0.5rem; }

/* —— Capture —— */
.capture-screen {
  background: #1a2a20;
  position: relative;
  overflow: hidden;
}
.capture-bg {
  position: absolute;
  inset: 0;
  background: center/cover no-repeat;
  filter: blur(2px);
  transform: scale(1.05);
}
.capture-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(250, 248, 242, 0.18);
}
.capture-ui {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.75rem 1.5rem 2.5rem;
}
.capture-close {
  position: absolute;
  top: 1.5rem;
  left: 1.25rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--sand);
  color: var(--forest);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(20, 38, 28, 0.22);
}
.capture-logo {
  margin-top: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.capture-logo svg,
.capture-logo img.brand-logo {
  width: 64px; height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(250, 248, 242, 0.9));
}
.capture-logo span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--forest);
  text-shadow: 0 0 12px rgba(250, 248, 242, 0.95), 0 1px 0 #FAF8F2;
}
.capture-spacer { flex: 1; }
.capture-video, .capture-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.capture-hint {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 1rem;
  text-shadow: 0 0 10px rgba(250, 248, 242, 0.95), 0 1px 0 #FAF8F2;
}
.shutter {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--trail);
  display: grid;
  place-items: center;
  box-shadow:
    0 14px 36px rgba(20, 38, 28, 0.42),
    0 4px 0 rgba(31, 107, 69, 0.25),
    inset 0 3px 8px rgba(255, 255, 255, 0.35);
  border: 5px solid rgba(250, 248, 242, 0.4);
}
.shutter svg,
.shutter img.brand-logo { width: 44px; height: 44px; object-fit: contain; border-radius: 50%; }
.shutter:active { transform: scale(0.94); }
.capture-fallback {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--forest);
  text-shadow: 0 0 8px rgba(250, 248, 242, 0.95);
  text-decoration: underline;
  text-underline-offset: 3px;
}
#file-input { display: none; }

/* —— Got the boop —— */
.got-screen {
  background: linear-gradient(180deg, #C8ECFF 0%, #E8F4FA 28%, #FAF8F2 62%, #FAF8F2 100%);
  align-items: center;
  padding: 2rem 1.5rem 1.5rem;
}
.got-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
}
.got-logo svg,
.got-logo img.brand-logo { width: 36px; height: 36px; object-fit: contain; }
.got-logo span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--forest);
}
.art-wrap {
  position: relative;
  width: min(280px, 72vw);
  margin: 0 auto 1.25rem;
}
.frame {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 28px;
  border: 14px solid var(--trail);
  background: linear-gradient(180deg, #C8ECFF 0%, #FAF8F2 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 14px 36px rgba(20, 38, 28, 0.16),
    inset 0 0 0 3px rgba(31, 107, 69, 0.12);
  outline: 2px solid rgba(197, 224, 23, 0.55);
  outline-offset: 5px;
}
.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stamp {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--trail);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(-14deg);
  border: 4px solid var(--trail);
  box-shadow: 0 6px 16px rgba(20, 38, 28, 0.25);
  z-index: 2;
}
.stamp .star { font-size: 0.85rem; line-height: 1; }
.stamp .word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  line-height: 1;
}
.stamp .heart { font-size: 0.75rem; line-height: 1; margin-top: 2px; }

.got-screen h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--forest);
  text-align: center;
  letter-spacing: -0.02em;
}
.got-sub {
  font-size: 1rem;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 0.4rem;
  font-weight: 600;
}
.got-btns {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1.5rem;
}

/* —— File Case —— */
.file-screen {
  background: var(--sand);
  padding: 1.25rem 1rem 1rem;
}
.file-card {
  background: var(--white);
  border-radius: 28px;
  box-shadow: 0 10px 36px rgba(20, 38, 28, 0.10);
  padding: 1.15rem 1.15rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.file-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.photo-wrap {
  position: relative;
  width: 120px;
  margin: 0 auto 1.15rem;
}
.photo {
  width: 120px; height: 120px;
  border-radius: 16px;
  border: 4px solid var(--forest);
  overflow: hidden;
  background: #eee;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.paw-badge {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(20, 38, 28, 0.18);
}
.paw-badge svg,
.paw-badge img.brand-logo { width: 28px; height: 28px; object-fit: contain; }

.file-section { margin-bottom: 1.15rem; }
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.file-label {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--forest);
}
.file-note {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.35;
}
.field-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--forest);
  margin-bottom: 0.5rem;
}
.field-label svg { width: 20px; height: 20px; }
.input {
  width: 100%;
  border: 2px solid #C5D0C8;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  color: var(--ink);
  background: var(--sand);
  outline: none;
}
.input:focus { border-color: var(--forest); }
.input::placeholder { color: #8A9A90; }

.toggle {
  width: 56px; height: 32px;
  border-radius: var(--radius-pill);
  background: #C5D0C8;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s ease;
  border: none;
  padding: 0;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}
.toggle.on { background: var(--trail); }
.toggle.on::after { transform: translateX(24px); }

.chips { display: flex; gap: 0.65rem; margin-top: 0.65rem; }
.chip {
  flex: 1;
  border-radius: 14px;
  padding: 0.85rem 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--forest);
  position: relative;
  border: 2.5px solid #C5D0C8;
  background: var(--white);
}
.chip.selected {
  border-color: var(--trail);
  background: #FBFFE8;
}
.chip .check {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--trail);
  color: var(--forest);
  font-size: 0.7rem;
  font-weight: 900;
  display: none;
  place-items: center;
}
.chip.selected .check { display: grid; }

.file-cta { margin-top: auto; align-self: center; width: auto; min-width: 70%; }
.file-brand {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 1rem;
  padding-right: 0.35rem;
}
.file-brand span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--forest);
}
.file-brand svg,
.file-brand img.brand-logo { width: 28px; height: 28px; object-fit: contain; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 1rem + var(--safe-bottom));
  transform: translateX(-50%) translateY(calc(100% + 2rem));
  background: var(--forest);
  color: var(--trail);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(20, 38, 28, 0.28);
  z-index: 100;
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
  white-space: nowrap;
  max-width: 90vw;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.toast.no-nav { bottom: calc(1.5rem + var(--safe-bottom)); }

/* —— Field Guide —— */
.guide-scene {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.1rem 1rem;
  gap: 0.85rem;
}
.guide-header h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--forest);
}
.guide-header p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-weight: 600;
  margin-top: 0.2rem;
}
.collage {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.collage-tile {
  aspect-ratio: 1;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 6px 18px var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem;
  border: 2px dashed #C5D0C8;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8rem;
  text-align: center;
}
.collage-tile .emoji { font-size: 2rem; }
.collage-tile.filled {
  border-style: solid;
  border-color: var(--trail);
  background: #FBFFE8;
  color: var(--forest);
  overflow: hidden;
  padding: 0;
}
.collage-tile.filled img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rank-strip {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.25rem 0;
  -webkit-overflow-scrolling: touch;
}
.rank-chip {
  flex-shrink: 0;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--white);
  border: 2px solid #C5D0C8;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--muted);
}
.rank-chip.current {
  border-color: var(--trail);
  background: var(--trail-wash);
  color: var(--forest);
}

/* —— Profile (minimal stub) —— */
.profile-scene {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.1rem 1rem;
  gap: 0.85rem;
}
.profile-scene h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--forest);
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.stat {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 1rem;
  box-shadow: 0 6px 18px var(--shadow);
  text-align: center;
}
.stat .num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--forest);
}
.stat .lbl {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

.help-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 38, 28, 0.45);
  align-items: flex-end;
  justify-content: center;
}
.help-sheet.open { display: flex; }
.help-panel {
  width: min(430px, 100%);
  background: var(--sand);
  border-radius: 24px 24px 0 0;
  padding: 1.25rem 1.25rem calc(1.5rem + var(--safe-bottom));
  box-shadow: 0 -8px 32px rgba(20, 38, 28, 0.2);
}
.help-panel h3 {
  font-family: var(--font-display);
  color: var(--forest);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.help-panel p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.45;
}

@media (min-width: 480px) {
  body {
    background: #E8F0EA;
  }
  .app {
    box-shadow: 0 0 0 1px rgba(20, 38, 28, 0.06), 0 24px 64px rgba(20, 38, 28, 0.12);
    min-height: 100dvh;
  }
}
