@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Fjalla+One&display=swap");

/* Palette from agents/colorscheme.png */
:root {
  --saffron: #f6bd60;
  --cream: #f7ede2;
  --pink: #f5cac3;
  --sage: #84a59d;
  --coral: #f28482;
  --ink: #2a2523;
  --paper: #fffaf5;
  --grid: #f3d2cc;
  --sage-light: #cfe4d9;
  --saffron-light: #fbe2b5;
  --coral-light: #f9cfcd;
  --true: #5f9e78;
  --false: #e0605e;
  --font-head: "Fjalla One", "Barlow Condensed", system-ui, sans-serif;
  --font-body: "Barlow Condensed", system-ui, sans-serif;
  --shadow: 10px 10px 0 var(--ink);
  --bounce: cubic-bezier(.2, 1.4, .4, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
  background: var(--cream);
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
.head { font-family: var(--font-head); font-weight: 400; letter-spacing: .01em; }

/* ---- retro window ------------------------------------------------------------
   <div class="win" style="--bar: var(--sage)">
     <div class="win-bar"><span class="win-title">…</span><span class="win-btns">…</span></div>
     <div class="win-body grid-paper">…</div>
   </div>                                                                        */
.win { position: relative; display: flex; flex-direction: column; gap: 8px; }
.win-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--bar, var(--pink));
  border: 4px solid var(--ink); border-radius: 16px;
  box-shadow: 7px 7px 0 var(--ink);
  padding: 6px 12px 6px 22px;
  font-family: var(--font-head); font-size: 30px; line-height: 1.2;
  position: relative; z-index: 2;
}
.win-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-btns { display: flex; gap: 8px; flex: none; }
.win-btns i {
  width: 38px; height: 38px; border: 4px solid var(--ink); border-radius: 50%;
  background: var(--paper); display: grid; place-items: center;
  font-style: normal; font-family: var(--font-body); font-weight: 700; font-size: 28px; line-height: 1;
}
.win-body {
  position: relative; flex: 1; min-height: 0;
  background: var(--paper);
  border: 4px solid var(--ink); border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.grid-paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1.5px, transparent 1.5px),
    linear-gradient(90deg, var(--grid) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  background-position: -1px -1px;
}
/* decorative scrollbar on the right of a window body */
.win-scroll {
  position: absolute; right: 14px; top: 18px; bottom: 18px; width: 16px;
  border: 3px solid var(--ink); border-radius: 10px; background: var(--paper);
}
.win-scroll::after {
  content: ""; position: absolute; left: 2px; right: 2px; top: 30%; bottom: 8%;
  background: var(--coral); border-radius: 6px;
}

/* chips / buttons in the retro style */
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  background: var(--chip, var(--sage-light));
  border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: .15em .7em;
}

.team-icon {
  --tcol: var(--coral);
  display: inline-grid; place-items: center;
  width: 1em; height: 1em; border-radius: 50%;
  background: var(--paper);
  border: 0.06em solid var(--ink);
  box-shadow: 0 0 0 0.05em var(--tcol) inset, 0.05em 0.05em 0 var(--ink);
  overflow: hidden; flex: none;
}
.team-icon img { width: 100%; height: 100%; object-fit: cover; }
.team-icon .ph { font-family: var(--font-head); font-size: 0.5em; color: var(--ink); }

.figure { display: block; overflow: visible; }

/* ---- entrance animations (from the design videos) ------------------------ */
@keyframes bar-in {            /* title bar flies in diagonally from the top right */
  0% { transform: translate(55%, -160%) rotate(-24deg); opacity: 0; }
  12% { opacity: .75; }
  70% { transform: translate(-1%, 6%) rotate(1.5deg); opacity: 1; }
  100% { transform: none; }
}
@keyframes body-in {           /* window pops up and flashes a thick dark frame */
  0% { transform: scale(.55) translateY(30px); opacity: 0; box-shadow: 0 0 0 0 var(--ink); }
  45% { transform: scale(1.03); opacity: 1; box-shadow: 0 0 0 26px var(--ink); }
  75% { transform: scale(.995); box-shadow: 0 0 0 10px var(--ink); }
  100% { transform: none; box-shadow: var(--shadow); }
}
@keyframes pop-in {
  0% { transform: scale(0) rotate(-35deg); opacity: 0; }
  70% { transform: scale(1.12) rotate(4deg); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes fly-in {            /* chips land tilted and half transparent first */
  0% { transform: translate(var(--fx, 260px), var(--fy, 140px)) rotate(var(--fr, 28deg)); opacity: 0; }
  15% { opacity: .45; }
  65% { transform: translate(-3px, -2px) rotate(-2deg); opacity: .85; }
  100% { transform: none; opacity: 1; }
}
@keyframes zoom-bg { from { transform: scale(.02); } to { transform: scale(1); } }
@keyframes bump { 0%, 100% { transform: none; } 40% { transform: scale(1.35) rotate(-4deg); } }
@keyframes rise-in { from { transform: translateY(50px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes char-in { from { transform: translateY(.15em) scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(3deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-12px); } 40%, 80% { transform: translateX(12px); } }

.anim-bar { animation: bar-in .55s var(--bounce) both; }
.anim-body { animation: body-in .7s ease-out both; animation-delay: .22s; }
.anim-pop { animation: pop-in .55s var(--bounce) both; }
.anim-fly { animation: fly-in .6s var(--bounce) both; }
.anim-rise { animation: rise-in .5s var(--bounce) both; }
.bob { animation: bob 3.4s ease-in-out infinite; }
.spin-slow { animation: spin 24s linear infinite; }
.wiggle { animation: wiggle 1s ease-in-out infinite; }

/* typewriter: every char is a span that grows in when it gets .on */
.tw-word { display: inline-block; white-space: nowrap; }
.tw-c { display: inline-block; opacity: 0; }
.tw-c.on { animation: char-in .22s var(--bounce) forwards; }

.conn-banner {
  position: fixed; left: 50%; top: 10px; transform: translateX(-50%);
  background: var(--ink); color: var(--cream);
  padding: 6px 16px; border-radius: 999px; font-size: 15px; z-index: 100; display: none;
}
.conn-banner.show { display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .tw-c { opacity: 1; }
}

/* ---- maps ------------------------------------------------------------------ */
.map-pin { background: none; border: 0; }
.map-pin .pin {
  width: 44px; height: 44px; border-radius: 50%; background: var(--paper); overflow: hidden;
  border: 4px solid var(--pc, var(--coral)); box-shadow: 0 0 0 3px var(--ink), 4px 4px 0 3px var(--ink);
  display: grid; place-items: center; font-family: var(--font-head); font-size: 20px;
}
.map-pin .pin img { width: 100%; height: 100%; object-fit: cover; }
.map-pin .target { filter: drop-shadow(3px 3px 0 var(--ink)); animation: pop-in .5s var(--bounce) both; }
.leaflet-container { font-family: var(--font-body); background: #e9e4dc; }
.leaflet-tooltip.km {
  background: var(--paper); border: 3px solid var(--ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--font-head); font-size: 18px; color: var(--ink); padding: 2px 8px;
}
.leaflet-tooltip.km::before { display: none; }

/* question pictures */
.pic { background: #fff; border: 4px solid var(--ink); border-radius: 14px; padding: 10px; box-shadow: 8px 8px 0 var(--ink); }
.pic img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.warm-tiles { filter: sepia(.2) saturate(1.15) brightness(1.03); }
