/* Light theme only: it's read outdoors in daylight. */
:root {
  --bg: #fdf6ec;
  --card: #fffdf8;
  --ink: #3b2f2a;
  --muted: #7a6a60;
  --rust: #b5532f;
  --mustard: #e8b33c;
  --sage: #8fae7e;
  --teal: #3aa6a0;
  --pink: #f27a8a;
  --line: #eadfce;
  --good: #3f7f4f;
  --bad: #b23a3a;
  --radius: 18px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.15rem/1.5 var(--font);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.wrap { max-width: 34rem; margin: 0 auto; padding: 16px 16px 48px; }

h1 { font-size: 1.9rem; line-height: 1.2; margin: .4em 0 .3em; }
h2 { font-size: 1.3rem; margin: 0 0 .5em; }
p { margin: .4em 0; }
a { color: var(--rust); }

.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--muted); margin: .8em 0 .2em; }
.muted { color: var(--muted); }

.screen { text-align: center; animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.mascot { width: min(60vw, 220px); height: auto; margin: 8px auto 0; display: block; }
.scene { width: 100%; height: auto; border-radius: var(--radius); margin: 12px 0; display: block; }

/* ---------- buttons & forms ---------- */

.btn {
  display: block; width: 100%;
  min-height: 56px; padding: 12px 20px; margin: 12px 0 0;
  font: 700 1.2rem var(--font);
  color: var(--ink); background: var(--card);
  border: 3px solid var(--ink); border-radius: 999px;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer; touch-action: manipulation;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .55; }
.btn.primary { background: var(--mustard); }
.btn.gps { background: var(--teal); color: #fff; }
.btn.small { min-height: 44px; font-size: 1rem; display: inline-block; width: auto; margin: 6px 6px 0 0; }
.btn.danger { background: #f6d5d5; }

.row { text-align: left; margin-top: 8px; }
label { display: block; font-weight: 700; margin: 8px 0 6px; }
input, select, textarea {
  width: 100%; min-height: 56px; padding: 10px 14px;
  font: 600 1.3rem var(--font); color: var(--ink);
  background: #fff; border: 3px solid var(--line); border-radius: 14px;
}
textarea { min-height: 80px; font-size: 1rem; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); }

.msg { min-height: 1.5em; font-weight: 700; margin-top: 12px; }
.msg.bad { color: var(--bad); }
.msg.good { color: var(--good); }

.card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 16px 0; text-align: left;
}

/* ---------- progress trail ---------- */

.trail { list-style: none; display: flex; justify-content: center; gap: 6px; padding: 0; margin: 4px 0 8px; flex-wrap: wrap; }
.trail li {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: .9rem;
  border: 2.5px solid var(--line); color: var(--muted); background: var(--card);
}
.trail li.done { background: var(--sage); border-color: var(--sage); color: #fff; }
.trail li.current { border-color: var(--rust); color: var(--rust); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }

/* ---------- riddle ---------- */

.speech { display: flex; align-items: flex-start; gap: 8px; text-align: left; margin-top: 8px; }
.mascot-sm { width: 72px; flex: none; margin-top: 8px; }
.riddle {
  position: relative; flex: 1; margin: 0;
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 14px 16px; font-size: 1.2rem; line-height: 1.55; font-weight: 600;
}
.riddle::before {
  content: ""; position: absolute; left: -14px; top: 28px;
  border: 8px solid transparent; border-right: 12px solid var(--ink);
}

.mission { padding-left: 1.2em; margin: .3em 0 .6em; }
.mission li { margin: .3em 0; }

.grownup { text-align: left; margin-top: 8px; }
.grownup summary { cursor: pointer; color: var(--muted); font-weight: 700; padding: 10px 0; }

.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- fact & finale ---------- */

.stamp {
  width: 96px; height: 96px; margin: 8px auto 0; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 3.2rem; font-weight: 900; color: var(--rust);
  border: 5px solid var(--rust); transform: rotate(-12deg);
  animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes stamp { from { transform: scale(2.2) rotate(-12deg); opacity: 0; } }
.place { color: var(--rust); }
.didyouknow p:last-child { margin-bottom: 0; }

.password {
  font-size: 1.6rem; font-weight: 800; color: var(--rust);
  background: var(--card); border: 3px dashed var(--rust); border-radius: var(--radius);
  padding: 14px; margin: 14px 0;
}
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px;
  animation: fall linear infinite;
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

.footer { text-align: center; padding: 8px 0 24px; opacity: .35; }
.footer a { text-decoration: none; font-size: 1.1rem; }

/* ---------- parent & scout tools ---------- */

body.tool { font-size: 1rem; }
body.tool h1 { font-size: 1.5rem; }
.banner { background: #fde7b0; border: 2px solid var(--mustard); border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-weight: 700; }
.codes { width: 100%; border-collapse: collapse; }
.codes td, .codes th { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.codes .code { font: 800 1.6rem ui-monospace, Menlo, monospace; letter-spacing: .08em; text-align: right; }
.codes tr.here { background: #fff1d6; }
.log { font-size: .9rem; color: var(--muted); padding-left: 1.2em; }
.device { list-style: none; padding: 0; margin: 0; }
.device li { margin: .5em 0; }

.live { font-variant-numeric: tabular-nums; }
.live .big { font: 800 2.2rem ui-monospace, Menlo, monospace; margin: 4px 0; }
.acc-good { color: var(--good); }
.acc-ok { color: #a87800; }
.acc-poor { color: var(--bad); }
.coords { font: 600 1rem ui-monospace, Menlo, monospace; word-break: break-all; }
.rec { border-top: 1px solid var(--line); padding: 12px 0; }
.rec:first-child { border-top: 0; }
.rec h3 { margin: 0 0 4px; font-size: 1.1rem; }
.rec textarea { margin-top: 6px; }
.links a { margin-right: 14px; }
pre.export { white-space: pre-wrap; word-break: break-all; font-size: .8rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; max-height: 240px; overflow: auto; }
