:root {
  --ink: #1d2b45;
  --halo: #fffdf6;
  --panel: rgba(255, 253, 246, 0.94);
  --accent: #e2574c;
  --sea: #04c5be;
}
html, body { margin: 0; height: 100%; background: var(--sea); overflow: hidden; }
#map { position: fixed; inset: 0; }
#labels, #life, #life-shadow, #veil { position: fixed; inset: 0; pointer-events: none; }
#life-shadow { mix-blend-mode: multiply; }  /* cloud shadows darken the map's own colours */

/* The title card, up in the clouds above the map (viewer/sky.js flies it past the camera). */
#sky-card {
  position: fixed; left: 50%; top: 48%; transform: translate(-50%, -50%); transform-origin: 50% 35%;
  width: min(820px, calc(100vw - 32px)); text-align: center; pointer-events: none;
  font-family: "Fredoka", system-ui, sans-serif; color: var(--ink); visibility: hidden; opacity: 0;
}
.sky-kicker {
  margin: 0; font-weight: 600; font-size: clamp(15px, 2.4vw, 24px); letter-spacing: 0.1em; text-transform: uppercase;
  text-shadow: 0 0 8px #fff, 0 0 3px #fff;
}
.sky-title {
  margin: 0.04em 0 0.32em; font-weight: 700; font-size: clamp(50px, 11vw, 136px); line-height: 0.95;
  color: #ffd83b; -webkit-text-stroke: 0.075em var(--ink); paint-order: stroke fill;
  text-shadow: 0 0.075em 0 var(--ink), 0 0.13em 0.2em rgba(29, 43, 69, 0.35);
  transform: rotate(-3deg);
}
.sky-title .amp { color: #ff8a5c; }
.sky-how {
  display: inline-block; margin: 0; padding: 12px 22px; list-style: none; text-align: left;
  font-weight: 500; font-size: clamp(14px, 1.8vw, 18px); line-height: 1.6;
  background: var(--panel); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 3px 0 var(--ink);
}
.sky-how b { font-weight: 700; }
#fly-in {
  display: block; margin: 18px auto 0; pointer-events: auto; cursor: pointer;
  font: 700 19px "Fredoka", system-ui, sans-serif; color: var(--ink); background: #ffd83b;
  border: 3px solid var(--ink); border-radius: 14px; padding: 10px 30px; box-shadow: 0 4px 0 var(--ink);
}
#fly-in:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.sky-credits {
  margin: 22px auto 0; max-width: 560px; font-weight: 500; font-size: 12px; line-height: 1.55; opacity: 0.85;
  text-shadow: 0 0 6px #fff, 0 0 2px #fff;
}

#search { position: fixed; left: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px)); }
#q {
  box-sizing: border-box; width: 100%; padding: 12px 16px; border: 3px solid var(--ink); border-radius: 14px;
  font: 600 16px "Fredoka", system-ui, sans-serif; color: var(--ink); background: var(--panel);
  box-shadow: 0 3px 0 var(--ink);
}
#q:focus { outline: none; border-color: var(--accent); }
#results {
  list-style: none; margin: 0 0 8px; padding: 6px; position: absolute; bottom: 100%; left: 0; right: 0;
  max-height: 50vh; overflow: auto; background: var(--panel); border: 3px solid var(--ink); border-radius: 14px;
  font: 500 15px "Fredoka", system-ui, sans-serif; color: var(--ink);
}
#results li { padding: 8px 10px; border-radius: 9px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
#results li:hover, #results li.active { background: #ffe9a8; }
#results small { opacity: 0.6; text-transform: capitalize; }

#controls { position: fixed; right: 16px; bottom: 16px; display: flex; gap: 8px; }
#controls button {
  font: 700 15px "Fredoka", system-ui, sans-serif; color: var(--ink); background: var(--panel);
  border: 3px solid var(--ink); border-radius: 12px; padding: 9px 14px; box-shadow: 0 3px 0 var(--ink); cursor: pointer;
}
#controls button[aria-pressed="false"] { opacity: 0.55; }
#controls button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

#attribution {
  position: fixed; right: 16px; top: 10px; font: 500 11px "Fredoka", system-ui, sans-serif; color: var(--ink);
  background: var(--panel); padding: 3px 8px; border-radius: 8px; opacity: 0.85;
}
.sky-psst { opacity: 0.8; font-style: italic; }

/* ---- the labels menu (Aa) ---- */
.menu {
  position: fixed; right: 16px; bottom: 74px; z-index: 15; width: min(300px, calc(100vw - 32px));
  box-sizing: border-box; padding: 12px 14px; background: var(--panel); border: 3px solid var(--ink);
  border-radius: 14px; box-shadow: 0 3px 0 var(--ink); font: 500 15px "Fredoka", system-ui, sans-serif; color: var(--ink);
}
.menu h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.menu label { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.menu input { width: 17px; height: 17px; accent-color: #e2574c; margin: 0; }
.menu-all { font-weight: 700; border-bottom: 2px solid rgba(29, 43, 69, 0.15); padding-bottom: 8px !important; margin-bottom: 4px; }
.menu-groups.off { opacity: 0.45; }

/* ---- find the squad: sticker book and the "you found" card ---- */
#squad-btn span { font-variant-numeric: tabular-nums; }
#squad-btn:not(.has-found) { opacity: 0.7; }
.sheet {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px;
  background: rgba(20, 30, 50, 0.45); font-family: "Fredoka", system-ui, sans-serif; color: var(--ink);
}
.sheet[hidden] { display: none; }
.album-card, .found-card {
  position: relative; box-sizing: border-box; background: #fffaf0; border: 3px solid var(--ink); border-radius: 22px;
  box-shadow: 0 5px 0 var(--ink); text-align: center;
}
.album-card { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px 20px 16px; }
.album-card h2, .found-card h2 { margin: 0; font-weight: 700; }
.album-card h2 { font-size: clamp(22px, 4vw, 30px); }
.album-how { margin: 6px auto 14px; max-width: 520px; font-weight: 500; font-size: 15px; line-height: 1.45; }
.album-grid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}
.sticker {
  position: relative; aspect-ratio: 3 / 4; border-radius: 14px; border: 2px dashed rgba(29, 43, 69, 0.35);
  background: #f1ead8; display: grid; place-items: center; overflow: hidden;
}
.sticker img { max-width: 82%; max-height: 74%; object-fit: contain; opacity: 0.2; }
.sticker-q {
  position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 6%;
  font-weight: 700; font-size: 38px; color: rgba(29, 43, 69, 0.55);
}
.sticker.found {
  border: 2px solid var(--ink); background: linear-gradient(#bfe6f5, #fff3cf); cursor: pointer;
  box-shadow: 0 3px 0 var(--ink); transform: rotate(-1.5deg);
}
.sticker.found:nth-child(even) { transform: rotate(1.5deg); }
.sticker.found img { opacity: 1; max-height: 72%; margin-bottom: 18%; }
.sticker-name {
  position: absolute; left: 4px; right: 4px; bottom: 6px; font-weight: 700; font-size: 12.5px; line-height: 1.15;
}
.album-count { margin: 14px 0 2px; font-weight: 700; font-size: 16px; }
.album-small { margin: 4px 0 0; font-size: 11.5px; opacity: 0.65; }
.sheet-x {
  position: absolute; top: 8px; right: 10px; width: 34px; height: 34px; border: 0; background: none; cursor: pointer;
  font: 700 26px/1 "Fredoka", system-ui, sans-serif; color: var(--ink);
}
.found-card { width: min(360px, 100%); padding: 18px 20px 18px; }
#found.pop .found-card { animation: sticker-pop 0.42s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes sticker-pop { from { transform: scale(0.6) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.found-kicker { margin: 0; font-weight: 600; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; }
.found-img {
  display: block; height: 190px; margin: 8px auto 6px; padding: 10px; border-radius: 18px;
  background: linear-gradient(#bfe6f5, #fff3cf); border: 2px solid var(--ink);
}
.found-card h2 { font-size: 26px; }
.found-role { margin: 0; font-weight: 600; opacity: 0.7; }
.found-caption { margin: 10px 0 8px; font-weight: 500; font-size: 15px; line-height: 1.45; }
.found-count { margin: 0 0 12px; font-size: 13px; font-weight: 600; opacity: 0.75; }
.found-album {
  font: 700 16px "Fredoka", system-ui, sans-serif; color: var(--ink); background: #ffd83b; cursor: pointer;
  border: 3px solid var(--ink); border-radius: 12px; padding: 8px 20px; box-shadow: 0 3px 0 var(--ink);
}

@media (max-width: 600px) {
  #controls { bottom: 78px; }
  .menu { bottom: 136px; }
  #attribution { left: 16px; right: auto; }
}
