/* Missing Cat: one game map, a HUD, a poster on a pole. */
@font-face { font-family: "DotGothic16"; src: url("/font/dotgothic16-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/font/nunito-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/font/nunito-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/font/jetbrains-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --press: 35ms;
  --release: 600ms cubic-bezier(.2, .8, .2, 1);
  --hover: 250ms cubic-bezier(.34, 1.56, .64, 1);
  --plate: url("/img/button.webp") 40 fill / 14px stretch;
  --chalk-shadow: 0 2px 0 rgba(40, 34, 60, .45);
}
html, body { background: var(--bg); }
body { overflow-x: hidden; }

/* ---------- the world ---------- */
.game { position: relative; height: 100svh; min-height: 600px; overflow: hidden; }
.map { position: absolute; inset: 0; }
.map__still, .map__gl { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.map__still { max-width: none; }
.map__gl { opacity: 0; transition: opacity .6s steps(4); touch-action: pan-y; }
.game.is-live .map__gl { opacity: 1; }

/* ---------- title (chalk on the sky) ---------- */
.title { position: absolute; left: clamp(24px, 4vw, 80px); top: clamp(16px, 3.5vh, 48px); width: clamp(320px, 32vw, 600px); z-index: 2; }
.title__mark { width: 100%; height: auto; margin-left: -4%; }
.title__line, .title__lore { margin: 0; text-shadow: var(--chalk-shadow); }
.title__line { font: 400 clamp(18px, 1.35vw, 24px)/1.3 var(--font-display); margin-top: calc(var(--s1) * -1); }
.title__line [data-ticker] { color: var(--lamp); margin-right: .35em; }
.title__lore { margin-top: var(--s2); font: 800 clamp(17px, 1.15vw, 20px)/1.4 var(--font-body); color: #ece7f6; }

/* ---------- game notice ---------- */
.notice {
  position: absolute; z-index: 3; top: clamp(16px, 3vh, 36px); left: 50%; margin: 0;
  width: clamp(300px, 26vw, 460px); min-height: 52px; padding: 10px 24px;
  display: grid; place-items: center;
  border-image: url("/img/plate.webp") 24 fill / 10px stretch;
  font: 400 clamp(16px, 1.1vw, 20px)/1 var(--font-display); letter-spacing: .12em; color: #ece7f6;
  transform: translate(-50%, -160%); opacity: 0;
  transition: transform .18s steps(3), opacity .18s steps(3);
  pointer-events: none;
}
.notice.is-on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- HUD buttons ---------- */
.hud {
  position: absolute; z-index: 3; left: min(50%, (100% - var(--poster-w) - var(--s5)) / 2); bottom: clamp(18px, 5vh, 56px); transform: translateX(-50%);
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); width: min(600px, 100% - var(--poster-w) - 2 * var(--s5));
}
.hud__btn {
  border: 0; background: none; padding: 0; cursor: pointer; color: #f4f0e8;
  height: clamp(60px, 7vh, 76px); border-image: var(--plate);
  font: 400 clamp(20px, 1.6vw, 28px)/1 var(--font-display); letter-spacing: .08em; text-shadow: 0 2px 0 #12101a;
  transition: transform var(--release);
}
.hud__btn { display: flex; align-items: center; justify-content: center; gap: .45em; }
.hud__btn img { width: auto; height: 1.25em; flex: none; image-rendering: pixelated; }
.hud__btn span { display: block; }
@media (hover: hover) { .hud__btn:hover { transform: translateY(-3px); transition: transform var(--hover); } }
.hud__btn:active { transform: translateY(2px) scale(.97); transition: transform var(--press); }

/* ---------- the game's waypoint, on an empty spot (far view) ---------- */
.waypoint { position: absolute; z-index: 2; display: grid; justify-items: center; gap: 4px; transform: translate(-50%, -100%); pointer-events: none; animation: bob 1.2s steps(4) infinite; }
.waypoint[hidden] { display: none; }
.waypoint img { width: 30px; height: auto; image-rendering: pixelated; }
.waypoint span { font: 400 18px/1 var(--font-display); letter-spacing: .1em; color: var(--lamp); text-shadow: 0 2px 0 #1f1c26; }
@keyframes bob { 50% { transform: translate(-50%, calc(-100% - 6px)); } }

/* ---------- meow ---------- */
.meow { position: absolute; z-index: 2; width: clamp(130px, 12vw, 220px); height: auto; pointer-events: none; transform: translate(-10%, -100%); }
.meow.is-on { animation: meow 1.5s steps(1) forwards; }
@keyframes meow {
  0% { opacity: 1; transform: translate(-10%, -100%) scale(.8); }
  8% { transform: translate(-10%, -100%) scale(1.05); }
  16% { transform: translate(-10%, -100%) scale(1); }
  80% { opacity: 1; transform: translate(-10%, -112%) scale(1); }
  100% { opacity: 0; transform: translate(-10%, -120%) scale(1); }
}

/* ---------- the poster on the pole ---------- */
.poster {
  position: absolute; z-index: 2; top: 50%; left: var(--pole-x, 80%);
  width: var(--poster-w); max-height: 96svh;
  transform: translate(-50%, -50%) rotate(1.4deg);
  transition: opacity .3s steps(3), transform .3s steps(3);
}
:root { --poster-w: clamp(330px, 24vw, 480px); }
.game[data-view="far"] .poster { opacity: 0; transform: translate(-50%, -46%) rotate(1.4deg); pointer-events: none; }
.poster__paper { position: relative; width: 100%; container-type: inline-size; display: flex; flex-direction: column; }
.poster__top, .poster__bot { width: 100%; height: auto; }
.poster__body {
  margin-block: -1px; padding: 0 12% 3cqw;
  background: url("/img/poster-mid.webp") center / 100% 100% no-repeat;
  display: flex; flex-direction: column; gap: 3cqw;
  color: var(--paper-ink);
}
.poster__seen { margin: 0; padding-block: .65em .5em; font: 400 clamp(16px, 6cqw, 26px)/1.2 var(--font-display); letter-spacing: .06em; text-align: center; }
.ca { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2.4cqw; }
.ca__addr { font: 500 clamp(16px, 4cqw, 18px)/1.35 var(--font-mono); color: var(--paper-ink); padding: .5em 0 .5em 1em; border-left: 3px solid rgba(31, 28, 38, .5); }
.ca__copy {
  border: 0; background: none; padding: 0 1em; cursor: pointer; min-height: 48px; color: #f4f0e8;
  border-image: var(--plate); font: 400 16px/1 var(--font-display); letter-spacing: .08em;
  transition: transform var(--release);
}
.ca__copy:active { transform: translateY(2px) scale(.96); transition: transform var(--press); }
.pbtn {
  display: flex; align-items: center; justify-content: center; gap: .55em; min-height: 52px; padding: .5em 1em;
  text-decoration: none; color: #f4f0e8; border-image: var(--plate);
  font: 800 clamp(16px, 4.4cqw, 20px)/1.15 var(--font-body); text-shadow: 0 1px 0 #12101a; text-align: center;
  transition: transform var(--release);
}
.pbtn img { flex: none; }
.pbtn--buy { min-height: clamp(62px, 18cqw, 80px); padding: .6em 1em; border-image: url("/img/buy.webp") 44 fill / 16px stretch; font-size: clamp(17px, 5cqw, 23px); text-shadow: 0 2px 0 #1d4419; }
.pbtn--buy img { width: 30px; height: 30px; }
@media (hover: hover) { .pbtn:not(.is-off):hover { transform: translateY(-3px); transition: transform var(--hover); } }
.pbtn:not(.is-off):active { transform: translateY(2px) scale(.97); transition: transform var(--press); }
.pbtn.is-off { filter: grayscale(.85); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4cqw; }
.pair .pbtn { font-size: clamp(16px, 4.6cqw, 20px); white-space: nowrap; }
.poster__risk { margin: 0; font: 400 16px/1.3 var(--font-body); color: rgba(31, 28, 38, .72); text-align: center; }

.lore-phone { display: none; }

/* ---------- phone and tall screens: map on top, poster below on the same ground ---------- */
@media (max-aspect-ratio: 11/10), (max-width: 860px) {
  html, body { background: var(--ground-dk) url("/img/tex/ground.webp") 0 0 / 192px repeat; }
  .game { height: auto; min-height: 0; overflow: visible; }
  .map { position: relative; height: clamp(600px, 88svh, 820px); overflow: hidden; }
  .map::after { content: ""; position: absolute; inset: auto 0 0; height: 40px; background: linear-gradient(transparent, rgba(63, 58, 68, .55)); pointer-events: none; }
  .title { left: 50%; transform: translateX(-50%); width: min(420px, 100% - 2 * var(--s2)); text-align: center; top: var(--s2); }
  .title__mark { margin: 0 auto; width: 88%; }
  .title__line { margin-top: 0; }
  .title__lore { display: none; }
  .title__line { font-size: 17px; }
  .title__line [data-ticker] { display: block; margin: 0 0 2px; }
  .lore-phone { display: block; margin: var(--s4) auto 0; width: min(440px, 100% - 2 * var(--s2)); text-align: center; font: 800 19px/1.45 var(--font-body); color: #ece7f6; text-shadow: var(--chalk-shadow); }
  .poster { margin-top: var(--s3); }
  .notice { top: auto; bottom: calc(clamp(60px, 7vh, 76px) + var(--s5)); width: min(340px, 100% - 2 * var(--s3)); transform: translate(-50%, 30px); }
  .notice.is-on { transform: translate(-50%, 0); }
  .hud { left: 50%; width: min(480px, 100% - 2 * var(--s2)); gap: var(--s1); bottom: var(--s3); }
  .hud__btn { height: 64px; font-size: clamp(19px, 5.6vw, 24px); }
  .hud__btn img { height: .95em; }
  .hud__btn { letter-spacing: .03em; gap: .3em; font-size: clamp(18px, 5vw, 22px); }
  .poster { position: relative; top: auto; left: auto; max-height: none; width: min(440px, 100% - 2 * var(--s2)); margin: var(--s4) auto var(--s6); transform: rotate(-1deg); }
  .game[data-view="far"] .poster { opacity: 1; transform: rotate(-1deg); pointer-events: auto; }
}
@media (max-width: 360px) {
  .hud__btn img { display: none; }
  .poster { width: calc(100% - var(--s2)); }
  .poster__body { left: 10%; right: 10%; }
}
@media (prefers-reduced-motion: reduce) { .map__gl { transition: none; } }

/* ---------- 404: same map, nobody here ---------- */
.lost { overflow: hidden; }
.lost__map { position: relative; height: 100svh; min-height: 480px; display: grid; place-items: center; }
.lost__bg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 55% 50%; }
.lost__box { position: relative; display: grid; justify-items: center; gap: var(--s3); padding: 0 var(--s2); text-align: center; }
.lost__notice { position: static; transform: none; opacity: 1; }
.lost__line { margin: 0; font: 400 clamp(28px, 4vw, 56px)/1.2 var(--font-display); color: #f4f0e8; text-shadow: 0 3px 0 rgba(31, 28, 38, .55); }
.lost__btn { display: grid; place-items: center; width: min(360px, 100%); text-decoration: none; }
@container (max-width: 400px) {
  .ca { grid-template-columns: 1fr; }
  .ca__copy { justify-self: center; min-width: 50%; }
}
