/* Purrlock Holmes v2 — styles */

@font-face {
  font-family: 'Fredoka';
  src: url('assets/fonts/fredoka-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --cream: #fbf3e4;
  --cream-deep: #f3e4c8;
  --brown: #4a2f22;
  --brown-soft: #7a5440;
  --berry: #b8475a;
  --sage: #8fb59a;
  --gold: #d9a441;
  --red: #c0392b;
  --line: #e6d2b0;
  --radius: 18px;
  --shadow: 0 4px 14px rgba(74, 47, 34, 0.14);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--cream);
  color: var(--brown);
  font-family: 'Fredoka', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}

body { touch-action: manipulation; overscroll-behavior: none; }

img { display: block; max-width: 100%; user-select: none; -webkit-user-drag: none; }
a { color: var(--berry); }
h1, h2, h3 { line-height: 1.15; margin: 0.6em 0 0.4em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }

/* ---------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 52px;
  padding: 0 1.4em;
  border: none;
  border-radius: 999px;
  background: var(--berry);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: 0 4px 0 #8c3242, var(--shadow);
  cursor: pointer;
  transition: transform 0.15s var(--bounce);
}
.btn:active { transform: translateY(3px) scale(0.97); box-shadow: 0 1px 0 #8c3242; }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 1em 0 0.2em; }
.btn-small { min-height: 44px; padding: 0 1.1em; font-size: 0.95rem; }
.btn-wide { min-width: 220px; }
.btn-alt { background: var(--sage); box-shadow: 0 4px 0 #5f8a6b, var(--shadow); color: #23402c; }
.btn-alt:active { box-shadow: 0 1px 0 #5f8a6b; }
.btn-ghost { background: transparent; color: var(--brown); box-shadow: inset 0 0 0 2.5px #d6bf9b; }
.btn-ghost:active { box-shadow: inset 0 0 0 2.5px #d6bf9b; }
.btn:disabled { opacity: 0.45; transform: none; cursor: default; }
.btn.pulse { animation: pulse 1.4s ease-in-out infinite; }

.icon-btn {
  flex: none;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--cream-deep);
  color: var(--brown);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s var(--bounce);
}
.icon-btn:active { transform: scale(0.88); }
.icon-btn:disabled { opacity: 0.35; filter: grayscale(1); cursor: default; }
.link-btn { border: 0; background: none; color: var(--brown-soft); font: inherit; font-size: 0.9rem; text-decoration: underline; padding: 12px; cursor: pointer; }

/* ---------------------------------------------------------- placeholders */

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ph);
  color: var(--brown);
}
.ph-emoji { font-size: 2.4em; line-height: 1; }
.ph-label { font-size: 0.75em; font-weight: 600; margin-top: 0.2em; }

.paw-trail { position: relative; aspect-ratio: 1; }
.paw-trail img { position: absolute; }

/* ---------------------------------------------------------- screens */

.screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  overflow: hidden;
}

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 6px;
}
.case-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.case-cake { width: 40px; height: 40px; flex: none; object-fit: contain; }
.case-title .placeholder.case-cake { font-size: 0.6rem; }
.case-title div { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.case-title small { font-size: 0.72rem; color: var(--brown-soft); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case-title b { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hats { flex: none; display: flex; font-size: 1.05rem; line-height: 1; padding: 6px 8px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); }
.hat.gone { opacity: 0.22; filter: grayscale(1); }

.debug-banner {
  flex: none;
  display: block;
  width: calc(100% - 24px);
  margin: 0 12px 4px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: #2b2b2b;
  color: #ffd76a;
  text-align: left;
  font: 11px/1.3 ui-monospace, Consolas, monospace;
}

.center { text-align: center; justify-content: center; }
.small { font-size: 0.85rem; }
.muted { color: var(--brown-soft); margin: 0.2em 0; }
.spacer { flex: 1; }
.icon-gap { flex: none; width: 44px; } /* stands in for a missing icon button, so titles stay centred */
.scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 12px 12px; }
.screen-heading { text-align: center; font-size: 1.45rem; margin: 0.3em 0 0.5em; }
.quote { font-style: italic; margin: 0.6em 0 0; }

.bottombar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px 12px;
}
.bottombar.center { justify-content: center; }
.bottombar.column { flex-direction: column; gap: 4px; }

/* bottom navigation on the investigation screens */
.bottomnav {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 6px 10px 10px;
}
.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-height: 56px;
  padding: 6px 2px;
  border: 0;
  border-radius: 16px;
  background: var(--cream-deep);
  color: var(--brown);
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s var(--bounce);
}
.nav-btn:active { transform: scale(0.94); }
.nav-btn.active { background: #fff; box-shadow: var(--shadow), inset 0 0 0 2px var(--gold); }
.nav-btn.nav-solve { background: var(--berry); color: #fff; box-shadow: 0 3px 0 #8c3242; }
.nav-btn.bump { animation: slot-pop 0.5s var(--bounce); }
.nav-icon { font-size: 1.35rem; line-height: 1.1; }
.nav-label { font-size: 0.78rem; font-weight: 600; }

/* Purrlock's speech bubble */
.narrator {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 80px;
  padding: 6px 12px 4px;
}
.avatar {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 3px #fff, var(--shadow);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); }
.bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 9px 13px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}
.bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  margin-top: -8px;
  border: 8px solid transparent;
  border-left: 0;
  border-right-color: #fff;
}
.bubble-text { margin: 0; font-size: 0.94rem; line-height: 1.3; }
/* picture icons inside text ("[oven]" in data.js) */
.icon-img { display: inline-block; height: 1.25em; width: auto; vertical-align: -0.25em; }
.bubble.pop { animation: bubble-pop 0.35s var(--bounce); }

/* ---------------------------------------------------------- bakery */

.bakery-box {
  position: relative;
  aspect-ratio: 1086 / 1448;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.bakery-img { width: 100%; height: 100%; object-fit: cover; }
.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  container-type: size;
}
.stage .bakery-box { width: min(100cqw, 100cqh * 1086 / 1448); }
.hotspot {
  position: absolute;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.hotspot:focus-visible { outline: 3px solid var(--gold); }
.hotspot::after {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 17px;
  box-shadow: 0 2px 6px rgba(74, 47, 34, 0.3);
  pointer-events: none;
}
.hotspot.searched::after { content: '✓'; background: rgba(255, 255, 255, 0.92); color: #3f7d55; animation: pop-in 0.45s var(--bounce); }
.hotspot.found::after { content: '★'; background: var(--gold); color: #fff; animation: pop-in 0.45s var(--bounce); }
.hotspot.marked::after {
  content: '?';
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  background: var(--berry);
  color: #fff;
  font-size: 21px;
  box-shadow: 0 0 0 3px #fff, 0 3px 10px rgba(74, 47, 34, 0.4);
  animation: marker 1.6s ease-in-out infinite;
}
.hs-label { display: none; }
.debug .hotspot { outline: 2px dashed rgba(184, 71, 90, 0.9); background: rgba(255, 255, 255, 0.18); }
.debug .hs-label {
  display: block;
  position: absolute; left: 2px; top: 2px;
  padding: 0 4px; border-radius: 4px;
  background: rgba(184, 71, 90, 0.9); color: #fff;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.debug .hotspot.crime { outline-color: rgba(60, 120, 80, 0.95); }
.tap-ring {
  position: absolute;
  font-size: 30px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: tap-ring 0.6s ease-out forwards;
}
.flyer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 170, 0.95) 0%, rgba(255, 236, 170, 0.5) 45%, rgba(255, 236, 170, 0) 70%);
}
.flyer-pic { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(74, 47, 34, 0.35)); }

/* the close-up when Purrlock leans in */
.closeup-stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 12px; container-type: size; }
.closeup-scene {
  position: relative;
  width: min(100cqw, 100cqh * 0.75);
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  overflow: clip; /* clip, not a scroll box: the zoomed lens layer must never scroll the scene */
  box-shadow: var(--shadow);
  background: #ead6b4;
}
.closeup-img { width: 100%; height: 100%; object-fit: cover; }
.closeup-scene .placeholder.closeup-img { border-radius: 0; font-size: 2rem; }
.closeup-ev {
  position: absolute;
  width: 34%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: radial-gradient(circle, rgba(255, 246, 200, 0.75) 0%, rgba(255, 246, 200, 0) 65%);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(var(--rot));
  cursor: pointer;
  animation: glint 1.8s ease-in-out infinite;
}
.closeup-ev.trail { width: 58%; }
.closeup-ev.smudged { width: 44%; animation: none; pointer-events: none; }
.closeup-ev.smudged .closeup-ev-pic { filter: blur(3px) drop-shadow(0 3px 5px rgba(60, 30, 10, 0.35)); }
.closeup-ev-pic { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(60, 30, 10, 0.35)); }
.closeup-bagged {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  padding-bottom: 9%;
  pointer-events: none;
}
.closeup-bagged span {
  padding: 6px 18px;
  border: 4px solid #3f7d55;
  border-radius: 12px;
  color: #3f7d55;
  background: rgba(255, 255, 255, 0.88);
  font-weight: 700;
  font-size: 1.6rem;
  transform: rotate(-10deg);
  animation: stamp-in-plain 0.45s var(--bounce) both;
}
.closeup-say { min-height: 76px; }

/* ---------------------------------------------------------- detective tools */

.toolbar {
  flex: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 0 10px;
  padding: 6px;
  border-radius: 18px;
  background: linear-gradient(#b98a5e, #9c6f47);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 3px 8px rgba(74, 47, 34, 0.3);
}
.tool-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  padding: 4px 2px 3px;
  border: 0;
  border-radius: 13px;
  background: rgba(255, 248, 236, 0.92);
  color: var(--brown);
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s var(--bounce);
}
.tool-btn:active { transform: scale(0.92); }
.tool-btn.active { background: #fff; box-shadow: inset 0 0 0 3px var(--gold), 0 0 12px rgba(255, 214, 110, 0.9); }
.tool-btn.empty .tool-pic { filter: grayscale(1); opacity: 0.45; }
.tool-btn.pulse { animation: marker 1.4s ease-in-out infinite; }
.tool-pic { display: grid; place-items: center; width: 40px; height: 40px; }
.tool-img { width: 100%; height: 100%; object-fit: contain; }
.tool-pic .placeholder { width: 100%; height: 100%; }
.tool-emoji { font-size: 1.7rem; line-height: 1; }
.tool-label { font-size: 0.72rem; font-weight: 700; line-height: 1.1; }
.tool-count {
  position: absolute;
  top: -5px;
  right: -3px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 11px;
  background: var(--berry);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 21px;
  box-shadow: 0 0 0 2px #fff;
}
.tool-btn.empty .tool-count { background: #8b7d72; }
.screen-bakery .toolbar { margin-bottom: 2px; }

.hotspot.marked.measure::after { content: '📏'; font-size: 18px; background: var(--gold); }
.hs-tried {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
  pointer-events: none;
}

.tool-list { list-style: none; margin: 0.4em 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.tool-list li { display: flex; gap: 10px; align-items: center; }
.tool-list .tool-pic { flex: none; width: 46px; height: 46px; }
.tool-list p { margin: 0; font-size: 0.9rem; line-height: 1.25; }

/* the close-up as a crime scene */
.closeup .cu-bottom { flex: none; padding: 2px 0 10px; }
.closeup .cu-bottom .bottombar { padding-top: 2px; padding-bottom: 2px; }
.closeup .cu-tray { margin: 0 12px; }
.closeup-scene { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.cu-world { position: absolute; inset: 0; }
.cu-world .closeup-img, .closeup-scene > .closeup-img { position: absolute; inset: 0; }
.cu-item {
  position: absolute;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  pointer-events: none;
}
.cu-item-pic { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(60, 30, 10, 0.4)); }
.cu-item .paw-trail { width: 100%; height: 100%; }

/* 🔍 lens search */
.cu-blurry { filter: blur(5px) brightness(0.72) saturate(0.8); transform: scale(1.04); }
.cu-sharp { clip-path: circle(0 at 50% 50%); will-change: clip-path, transform; }
.lens-rim {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 5px solid #c79a3b;
  box-shadow: 0 0 0 2px #6f4f1d, inset 0 0 0 2px rgba(255, 255, 255, 0.5), 0 6px 14px rgba(40, 20, 5, 0.45);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.lens-rim::after { /* the handle */
  content: '';
  position: absolute;
  left: 82%;
  top: 82%;
  width: 16%;
  height: 55%;
  border-radius: 6px;
  background: linear-gradient(90deg, #6f4f1d, #a77b35);
  transform: rotate(-45deg);
  transform-origin: top center;
}
.cu-ready {
  pointer-events: auto;
  cursor: pointer;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 246, 200, 0.9) 0%, rgba(255, 246, 200, 0) 68%);
  animation: glint 1.2s ease-in-out infinite;
  z-index: 3;
}

/* progress: how much of the spot has been searched */
.cu-progress {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  pointer-events: none;
  z-index: 4;
}
.cu-progress i { flex: 1; height: 7px; border-radius: 4px; background: rgba(74, 47, 34, 0.15); overflow: hidden; }
.cu-progress span { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--gold); transition: width 0.15s; }
.cu-progress em { min-width: 2.6em; font-style: normal; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.cu-progress.done span { background: #3f7d55; }
.cu-progress.done em { color: #3f7d55; }

/* the "Bagged!" moment: over the scene, then it fades and the search goes on */
.cu-flash { position: absolute; inset: 0; pointer-events: none; z-index: 6; animation: flash-out 2.6s ease-in forwards; }
@keyframes flash-out { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* 🧂 powder */
.cu-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cu-brush {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.85);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.cu-brush.on { opacity: 1; }

/* 🔦 UV lamp: dark scene; the lit photo and the glowing prints show only under the beam */
.uv-dark { filter: brightness(0.16) saturate(0.4); }
.uv-lit, .uv-glow, .uv-beam { opacity: 0; }
.uv-on .uv-lit, .uv-on .uv-glow, .uv-on .uv-beam { opacity: 1; }
.uv-lit { filter: brightness(0.5) saturate(0.5) sepia(0.3) hue-rotate(215deg); }
.uv-lit, .uv-glow {
  -webkit-mask-image: radial-gradient(circle var(--br, 60px) at var(--bx, 50%) var(--by, 50%), #000 55%, transparent 100%);
  mask-image: radial-gradient(circle var(--br, 60px) at var(--bx, 50%) var(--by, 50%), #000 55%, transparent 100%);
}
.uv-glow .cu-item-pic { filter: brightness(1.25) drop-shadow(0 0 10px rgba(140, 230, 255, 0.95)); }
.uv-seen .uv-print { opacity: 0; transition: opacity 0.6s; }
.uv-seen .uv-print.seen { opacity: 0.3; }
.uv-beam {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(170, 110, 255, 0.28) 0%, rgba(140, 80, 240, 0.18) 55%, rgba(140, 80, 240, 0) 72%);
  box-shadow: 0 0 0 2px rgba(190, 150, 255, 0.55);
  transform: translate(-50%, -50%);
  pointer-events: none;
  mix-blend-mode: screen;
}

/* 📏 tape */
.tape-dim { filter: brightness(0.55) saturate(0.6) blur(2px); }
.tape-card {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 14%;
  height: 64%;
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.95);
  box-shadow: 0 6px 18px rgba(40, 20, 5, 0.4);
}
.tape-print { position: absolute; left: 50%; top: 40%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; }
.tape-print-img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 1px rgba(60, 40, 20, 0.9)) drop-shadow(0 2px 4px rgba(60, 40, 20, 0.5)); }
.tape-zero { position: absolute; top: 18%; height: 50%; border-left: 2px dashed rgba(184, 71, 90, 0.7); pointer-events: none; }
.tape-strip {
  position: absolute;
  top: 60%;
  height: 34px;
  margin-top: -17px;
  border-radius: 3px;
  background-color: #f6cf3c;
  background-image: linear-gradient(90deg, #4a2f22 0 1.5px, transparent 1.5px);
  background-repeat: repeat-x;
  background-position: 0 0;
  box-shadow: 0 2px 4px rgba(60, 40, 20, 0.45);
  pointer-events: none;
}
.tape-num {
  position: absolute;
  top: 60%;
  transform: translate(-50%, 0);
  margin-top: 1px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4a2f22;
  pointer-events: none;
  display: none;
}
.tape-num.on { display: block; }
.tape-handle {
  position: absolute;
  top: 60%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -6px;
  pointer-events: none;
  filter: drop-shadow(0 3px 5px rgba(40, 20, 5, 0.45));
}
.tape-reading {
  position: absolute;
  top: 60%;
  margin-top: -66px;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--brown);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  pointer-events: none;
}
.tape-reading.ok { background: #3f7d55; animation: pop-in 0.4s var(--bounce); }

@media (max-height: 700px) {
  .tool-pic { width: 32px; height: 32px; }
  .tool-label { font-size: 0.66rem; }
  .toolbar { padding: 4px; gap: 4px; }
}

/* ---------------------------------------------------------- suspects */

.suspect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.suspect-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px 10px;
  border: 0;
  border-radius: var(--radius);
  background: #fff;
  color: var(--brown);
  font: inherit;
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s var(--bounce);
}
.suspect-card:active { transform: scale(0.96); }
.suspect-card.silent .card-portrait { opacity: 0.45; filter: grayscale(0.8); }
.card-portrait { width: 100%; aspect-ratio: 1; border-radius: 12px; background: var(--cream); }
.card-portrait img, .card-portrait .placeholder { width: 100%; height: 100%; object-fit: contain; }
.card-name { font-weight: 700; font-size: 1.05rem; margin-top: 4px; }
.card-mark { position: absolute; right: 8px; top: 8px; font-size: 1.4rem; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25)); }
.card-stamp {
  position: absolute;
  left: 50%;
  top: 38%;
  padding: 2px 10px;
  border: 3px solid #6f6a66;
  border-radius: 8px;
  color: #6f6a66;
  background: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  transform: translate(-50%, -50%) rotate(-12deg);
  animation: stamp-in 0.45s var(--bounce) both;
  pointer-events: none;
}

.paws { display: inline-flex; gap: 1px; font-size: 0.85rem; line-height: 1; margin-top: 2px; }
.paw { width: 1.05em; text-align: center; color: #c9ad86; }
.paw.on { color: inherit; }

/* ---------------------------------------------------------- conversation */

.talk-title { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.talk-title b { font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.talk-stage {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 56%;
  overflow-y: auto;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 2px 12px 6px;
}
.talk-face {
  position: relative;
  flex: none;
  width: 108px;
  aspect-ratio: 1;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}
.talk-face img, .talk-face .placeholder { width: 100%; height: 100%; object-fit: contain; }
.talk-face .card-stamp { top: 46%; font-size: 0.8rem; }
.talk-face.small { width: 96px; margin: 8px auto 0; }
.profile-btn {
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);
  padding: 3px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--brown);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.exchange { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.you-say {
  align-self: flex-end;
  max-width: 92%;
  padding: 6px 11px;
  border-radius: 14px 14px 4px 14px;
  background: #dcebdf;
  color: #23402c;
  font-size: 0.86rem;
}
.cat-speech {
  position: relative;
  padding: 9px 13px;
  border-radius: 16px;
  background: #fff3d6;
  text-align: left;
  box-shadow: var(--shadow);
}
.exchange .cat-speech { border-top-left-radius: 4px; }
.cat-speech .speaker { font-weight: 700; font-size: 0.82rem; color: var(--berry); }
.cat-speech p { margin: 2px 0 0; font-size: 0.97rem; line-height: 1.32; }
.cat-speech.pop { animation: bubble-pop 0.35s var(--bounce); }
.cat-speech.big p { font-size: 1.06rem; }
.aside {
  padding: 7px 11px;
  border-radius: 12px;
  background: var(--cream-deep);
  font-size: 0.86rem;
  line-height: 1.3;
}
.aside-who { font-weight: 700; color: var(--brown-soft); }

.choices {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 12px 8px;
}
.choice {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 14px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--brown);
  font: inherit;
  font-size: 0.97rem;
  text-align: left;
  box-shadow: 0 2px 0 var(--line), var(--shadow);
  cursor: pointer;
  transition: transform 0.12s var(--bounce);
}
.choice > span:first-child { flex: 1; }
.choice:active { transform: scale(0.98); }
.choice.locked { color: var(--brown-soft); background: #fbf6ec; }
.choice.back, .choice.bye { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.need { flex: none; font-size: 0.76rem; font-weight: 600; color: var(--brown-soft); white-space: nowrap; }
.need.cost { color: var(--berry); }

.actionbar { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 6px 12px 12px; }
.actionbar .btn { padding: 0 0.6em; }
.btn-gotcha { background: var(--brown); box-shadow: 0 4px 0 #2c1a12, var(--shadow); }
.btn-gotcha:active { box-shadow: 0 1px 0 #2c1a12; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 11px; background: rgba(255, 255, 255, 0.65); font-size: 0.8rem; }

/* ---------------------------------------------------------- overlays */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--cream);
  animation: fade-in 0.18s ease;
}
.ov-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.ov-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px 4px; }
.ov-head h2 { flex: 1; margin: 0; font-size: 1.25rem; }
.ov-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 12px 16px; }
.ov-body > .narrator { padding-left: 0; padding-right: 0; }

/* notebook */
.nb-tabs { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 12px 6px; }
.nb-tab { min-height: 42px; border: 0; border-radius: 12px; background: var(--cream-deep); color: var(--brown); font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.nb-tab.active { background: #fff; box-shadow: var(--shadow), inset 0 0 0 2px var(--gold); }
.nb-grid { display: grid; grid-template-columns: 76px repeat(3, minmax(0, 1fr)); gap: 4px; align-items: stretch; }
.nb-head { display: flex; flex-direction: column; align-items: center; font-size: 0.82rem; line-height: 1.1; padding: 2px 0 4px; }
.nb-head span { font-size: 1.1rem; }
.nb-name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 4px 6px;
  border: 0;
  border-radius: 10px;
  background: var(--cream-deep);
  color: var(--brown);
  font: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  text-align: left;
  line-height: 1.15;
  cursor: pointer;
}
.nb-name.cleared span:first-child { text-decoration: line-through; opacity: 0.6; }
.nb-name.theft { background: transparent; font-size: 0.8rem; cursor: default; }
.nb-markicon { font-size: 1rem; min-height: 1em; }
.nb-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-height: 56px;
  padding: 4px 5px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--brown);
  font: inherit;
  text-align: left;
  box-shadow: 0 1px 0 var(--line);
  cursor: pointer;
  overflow: hidden;
}
.nb-cell.empty { background: rgba(255, 255, 255, 0.45); color: #c9ad86; align-items: center; font-size: 1.3rem; box-shadow: inset 0 0 0 1.5px var(--line); }
.nb-cell.caught { background: #fde9e6; box-shadow: inset 0 0 0 2px #e3a69c; }
.nb-place { display: flex; align-items: center; gap: 3px; font-weight: 700; font-size: 0.78rem; line-height: 1.1; }
.place-ic { width: 22px; height: 22px; flex: none; object-fit: contain; }
.nb-place .placeholder.place-ic { font-size: 0.42rem; }
.nb-sub { font-size: 0.7rem; color: var(--brown-soft); line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-eye { position: absolute; right: 3px; top: 2px; font-size: 0.72rem; }
.nb-time {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--brown);
  font: inherit;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--gold);
  cursor: pointer;
}
.nb-time.crossed { text-decoration: line-through; opacity: 0.45; box-shadow: inset 0 0 0 2px var(--line); }
.nb-legend { margin-top: 10px; }
.ev-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px; margin-bottom: 8px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.ev-row p { margin: 2px 0; font-size: 0.9rem; }
.ev-pic { flex: none; width: 64px; height: 64px; padding: 4px; border-radius: 12px; background: #c99c6c; }
.ev-img { width: 100%; height: 100%; object-fit: contain; }
ul.plain { list-style: none; padding: 0; margin: 0.3em 0 0.8em; }
ul.plain li { padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 0.92rem; }
ol.rules { padding-left: 1.2em; margin: 0.4em 0 0.8em; }
ol.rules li { margin-bottom: 0.55em; font-size: 0.92rem; line-height: 1.32; }

/* Gotcha! */
.story-list { display: flex; flex-direction: column; gap: 7px; margin: 8px 0 12px; }
.story-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 13px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--brown);
  font: inherit;
  text-align: left;
  box-shadow: 0 2px 0 var(--line), var(--shadow);
  cursor: pointer;
}
.story-btn:active { transform: scale(0.98); }
.story-btn.clue { background: #f4f9f2; }
.story-who { font-weight: 700; font-size: 0.86rem; color: var(--berry); }
.story-what { font-size: 0.92rem; line-height: 1.3; }
.picked { padding: 8px 12px; margin: 6px 0; border-radius: 12px; background: var(--cream-deep); }
.picked small { display: block; color: var(--brown-soft); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.picked b { font-size: 0.92rem; }
.gotcha-banner { position: relative; display: flex; align-items: center; justify-content: center; margin: 4px 0 2px; }
.gotcha-pose { width: 46%; max-width: 210px; aspect-ratio: 1; animation: pose-in 0.5s var(--bounce) both; }
.gotcha-pose img, .gotcha-pose .placeholder { width: 100%; height: 100%; object-fit: contain; }
.gotcha-word {
  position: absolute;
  right: 4%;
  top: 18%;
  padding: 4px 14px;
  border: 5px solid var(--berry);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--berry);
  font-weight: 700;
  font-size: 2.1rem;
  letter-spacing: 0.04em;
  transform: rotate(-10deg);
  animation: stamp-in-plain 0.5s 0.25s var(--bounce) both;
}

/* gifts */
.gift-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.gift-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--brown);
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.gift-btn:disabled { opacity: 0.4; cursor: default; }
.gift-btn small { font-weight: 400; color: var(--brown-soft); }
.gift-pic { width: 64px; height: 64px; }
.gift-pic img, .gift-pic .placeholder { width: 100%; height: 100%; object-fit: contain; }

/* profile */
.profile { text-align: center; }
.detail-portrait { width: 46%; margin: 0 auto; aspect-ratio: 1; }
.detail-portrait img, .detail-portrait .placeholder { width: 100%; height: 100%; object-fit: contain; }
.profile h2 { margin: 0.1em 0 0; font-size: 1.45rem; }
.profile-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; text-align: left; }
.profile-row { padding: 7px 10px; border-radius: 12px; background: #fff; }
.profile-row small { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brown-soft); }
.profile-row span { font-size: 0.93rem; line-height: 1.3; }
.statement p { margin: 0.35em 0; }

/* ---------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(58, 36, 26, 0.45);
  animation: fade-in 0.2s ease;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 100%;
  overflow-y: auto;
  padding: 20px 20px 22px;
  border-radius: 24px;
  background: var(--cream);
  box-shadow: 0 12px 40px rgba(40, 20, 10, 0.35);
  animation: pop-in 0.4s var(--bounce);
}
.modal-card.modal-wide { max-width: 560px; }
.modal-close { position: absolute; right: 10px; top: 10px; z-index: 5; width: 38px; height: 38px; font-size: 1rem; }
.confirm { text-align: center; }
.confirm h2 { margin-top: 0.2em; }
.confirm-avatar { width: 80px; height: 80px; margin: 0 auto; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 4px #fff, var(--shadow); }
.confirm-avatar img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); }
.rules-card h2 { text-align: center; }
.truth table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.truth th, .truth td { border: 1px solid var(--line); padding: 3px 4px; text-align: left; }
.truth td.lie { background: #fde9e6; }

/* ---------------------------------------------------------- solving */

.solve-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.solve-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px 8px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--brown);
  font: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.solve-pick { display: flex; flex-direction: column; align-items: center; margin-top: 6px; }
.solve-pick .card-portrait { width: 120px; }
.solve-times { display: flex; flex-direction: column; gap: 12px; align-items: stretch; max-width: 320px; margin: 0 auto; }
.solve-time { flex-direction: column; gap: 0; min-height: 66px; }
.solve-time .big { font-size: 1.3rem; font-weight: 700; }
.solve-time small { font-weight: 500; opacity: 0.9; }
.solve-time.crossed { opacity: 0.6; }
.screen-solve .link-btn { display: block; margin: 8px auto; }

/* accusation */
.accuse-stage { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 16px; }
.accuse-heading { margin: 0; font-weight: 700; font-size: 1.4rem; text-align: center; }
.accused { position: relative; width: min(64vw, 280px, 34vh); aspect-ratio: 1; margin: 6px auto 0; }
.accused img, .accused .placeholder { width: 100%; height: 100%; object-fit: contain; }
.is-correct .accused { animation: float 3s ease-in-out infinite; }
.is-wrong .accused { animation: wiggle 0.5s ease 2; }
.verdict-stamp {
  position: absolute;
  left: 50%;
  top: 62%;
  padding: 4px 16px;
  border: 5px solid;
  border-radius: 12px;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.82);
  transform: translate(-50%, -50%) rotate(-12deg) scale(2.2);
  opacity: 0;
}
.verdict-stamp.guilty { color: var(--red); border-color: var(--red); }
.verdict-stamp.innocent { color: #3f7d55; border-color: #3f7d55; font-size: 1.6rem; }
.verdict-stamp.show { transition: transform 0.35s var(--bounce), opacity 0.2s; transform: translate(-50%, -50%) rotate(-12deg) scale(1); opacity: 1; }
.verdict-stamp.small { font-size: 1.05rem; border-width: 3px; padding: 1px 8px; top: 74%; }
.accuse-stage .cat-speech { width: 100%; max-width: 440px; margin-top: 10px; }
.confetti {
  position: fixed;
  top: -40px;
  z-index: 40;
  pointer-events: none;
  animation-name: confetti-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

/* case closed / unsolved */
.closed-body { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 4px 12px; }
.card-box { height: 100%; display: flex; align-items: center; justify-content: center; }
.card-box.small { height: auto; margin: 12px auto 4px; max-width: 300px; }
.card-img { max-width: 100%; max-height: 100%; border-radius: 14px; box-shadow: 0 8px 26px rgba(74, 47, 34, 0.25); animation: pop-in 0.5s var(--bounce); }
.card-loading { color: var(--brown-soft); font-weight: 600; }
.reveal { display: flex; gap: 12px; align-items: center; padding: 10px; margin-top: 4px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.reveal h2 { margin: 0 0 4px; }
.reveal .quote { font-size: 0.92rem; margin: 0; }
.reveal-face { position: relative; flex: none; width: 104px; aspect-ratio: 1; }
.reveal-face img, .reveal-face .placeholder { width: 100%; height: 100%; object-fit: contain; }
.missed { margin-top: 12px; padding: 4px 14px 10px; border-radius: 18px; background: var(--cream-deep); }
.missed ul { padding-left: 1.1em; margin: 0.2em 0 0.6em; }
.missed li { margin-bottom: 0.35em; font-size: 0.92rem; line-height: 1.32; }
.missed p { margin: 0.5em 0 0.2em; font-size: 0.93rem; }

/* ---------------------------------------------------------- title, badge, intro */

.screen-title { overflow-y: auto; }
.title-top { flex: none; display: flex; justify-content: flex-end; padding: 10px 12px 0; }
.title-inner { margin: auto; padding: 0 16px 20px; width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; }
.title-logo { width: 100%; max-width: 440px; }
.subtitle { margin: 0; font-weight: 600; color: var(--brown-soft); font-size: 1.15rem; }
.title-purrlock { width: 56%; max-width: 280px; max-height: 40vh; object-fit: contain; margin: 6px auto 14px; animation: float 4s ease-in-out infinite; }
.title-stats { margin: 10px 0 0; font-size: 0.88rem; font-weight: 600; color: var(--brown-soft); }
.badge-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 14px 6px 6px;
  border: 0;
  border-radius: 999px;
  background: var(--cream-deep);
  color: var(--brown);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}
.badge-link img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

.badge { display: flex; flex-direction: column; align-items: center; }
.badge-photo { width: 150px; height: 150px; border-radius: 50%; overflow: hidden; background: var(--cream-deep); box-shadow: 0 0 0 7px var(--gold), 0 0 0 10px #fff, var(--shadow); }
.badge-photo img { width: 100%; height: 100%; object-fit: cover; }
.badge-ribbon {
  position: relative;
  margin-top: -14px;
  padding: 4px 26px;
  background: var(--berry);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.9rem;
  clip-path: polygon(0 0, 100% 0, 92% 50%, 100% 100%, 0 100%, 8% 50%);
}
.badge-name { margin-top: 6px; font-weight: 700; font-size: 1.35rem; min-height: 1.4em; }
.badge-preview { margin: 8px 0 14px; }
.field-label { display: block; font-weight: 600; margin: 6px 0 4px; }
#badge-name {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 2.5px solid #d6bf9b;
  border-radius: 16px;
  background: #fff;
  color: var(--brown);
  font: inherit;
  font-size: 1.15rem;
}
#badge-name:focus { outline: none; border-color: var(--gold); }
.badge-body { max-width: 440px; margin: 0 auto; width: 100%; }
.status:empty { display: none; }

ul.plain.morning { margin: 0; }
ul.plain.morning li { display: flex; gap: 8px; align-items: baseline; line-height: 1.3; }
ul.plain.morning li:last-child { border-bottom: 0; }
.m-time { flex: none; min-width: 4.1em; white-space: nowrap; }
.m-found { justify-content: center; font-weight: 700; color: var(--berry); }

/* the intro film: dark and cinematic, one slide per tap */
.screen-intro { background: radial-gradient(ellipse at 50% 35%, #3a2619 0%, #1b120c 70%); color: #fbf3e4; }
.screen-intro.shake { animation: shake 0.55s; }
.intro-top { flex: none; display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 4px; }
.intro-top .mute-btn { background: rgba(251, 243, 228, 0.14); color: #fbf3e4; }
.skip-btn {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(251, 243, 228, 0.16);
  color: #fbf3e4;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}
.intro-film {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 18px 6px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.slide { width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 14px; animation: fade-in 0.6s ease-out both; }
.slide-pic { width: 100%; border-radius: 16px; overflow: hidden; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55); }
.slide-pic img { display: block; width: 100%; height: auto; max-height: 46vh; object-fit: cover; animation: ken-burns 10s ease-out both; }
.slide-pic.cutout { width: auto; overflow: visible; box-shadow: none; border-radius: 0; background: radial-gradient(ellipse closest-side, rgba(255, 214, 140, 0.34), transparent); }
.slide-pic.cutout img { width: auto; max-width: 78vw; max-height: 44vh; object-fit: contain; animation: rise-in 0.9s var(--bounce) both; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.5)); }
.slide-text { margin: 0; text-align: center; font-size: 1.14rem; line-height: 1.42; animation: text-in 0.7s 0.3s ease-out both; }
.slide-sub { margin: -6px 0 0; text-align: center; font-size: 0.98rem; font-style: italic; color: #f0cfa0; animation: text-in 0.7s 0.9s ease-out both; }
.slide-dark .slide-text { font-size: 1.35rem; font-style: italic; animation-duration: 1.4s; }
.slide-dark .slide-sub { font-size: 1.1rem; animation-delay: 1.6s; animation-duration: 1.2s; }
.slide-big .slide-text { font-size: 1.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #ff9d8c; text-shadow: 0 3px 0 #5a1c18; animation: slam-in 0.5s 0.45s var(--bounce) both; }
.slide-big .slide-sub { animation-delay: 1.1s; }
.slide-cake { width: min(56vw, 250px, 32vh); }
.slide-cake .stolen-cake { animation: none; }
.slide-cake .stolen-tag { animation: tag-in 0.45s 0.45s var(--bounce) both; background: rgba(251, 243, 228, 0.92); }
.slide-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 8px; }
.slide-cat { width: 22%; max-width: 104px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 0.8rem; font-weight: 600; animation: pop-in 0.5s var(--bounce) both; }
.slide-cat-pic { width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #fbf3e4; box-shadow: 0 0 0 3px #d9a441, 0 6px 14px rgba(0, 0, 0, 0.45); }
.slide-cat-pic img, .slide-cat-pic .placeholder { width: 100%; height: 100%; object-fit: contain; }
.slide-hint { margin: 14px 0 0; font-size: 0.8rem; color: rgba(251, 243, 228, 0.6); animation: hint-in 0.6s 2s both; }
.intro-dots { flex: none; display: flex; justify-content: center; gap: 7px; padding: 4px 0 16px; }
.intro-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(251, 243, 228, 0.22); transition: background 0.3s, transform 0.3s; }
.intro-dots span.done { background: rgba(217, 164, 65, 0.55); }
.intro-dots span.on { background: var(--gold); transform: scale(1.3); }
@keyframes ken-burns { from { transform: scale(1.14) translate(1.5%, 1%); } to { transform: scale(1) translate(0, 0); } }
@keyframes rise-in { from { transform: translateY(24px) scale(0.92); opacity: 0; } }
@keyframes text-in { from { transform: translateY(10px); opacity: 0; } }
@keyframes slam-in { from { transform: scale(2.4); opacity: 0; } }
@keyframes hint-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-9px, 4px); }
  30% { transform: translate(8px, -5px); }
  45% { transform: translate(-6px, 3px); }
  60% { transform: translate(5px, -2px); }
  80% { transform: translate(-2px, 1px); }
}

/* Ling: her conversation, and her link on the suspects screen */
.screen-ling .talk-face img { object-fit: cover; border-radius: 18px; }
.choice.asked { background: #fbf6ec; }
.ling-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 12px;
  padding: 8px 14px 8px 8px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: var(--brown);
  font: inherit;
  text-align: left;
  box-shadow: 0 2px 0 var(--line), var(--shadow);
  cursor: pointer;
}
.ling-link b { display: block; font-size: 1rem; }
.ling-link small { display: block; color: var(--brown-soft); font-size: 0.82rem; }
.ling-pic { flex: none; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: #f3d9c4; }
.ling-pic img { width: 100%; height: 100%; object-fit: cover; }
.stolen { position: relative; width: min(70vw, 300px, 36vh); }
.stolen-cake { width: 100%; animation: float 4s ease-in-out infinite; }
.stolen-tag {
  position: absolute;
  right: -8%;
  top: 4%;
  padding: 4px 14px;
  border: 4px solid var(--berry);
  border-radius: 10px;
  color: var(--berry);
  background: rgba(251, 243, 228, 0.85);
  font-weight: 700;
  font-size: 1.4rem;
  transform: rotate(12deg);
  animation: tag-in 0.5s 0.3s var(--bounce) both;
}
.stolen-name { margin: 6px 0 0; font-weight: 700; font-size: 1.2rem; text-align: center; }

/* ---------------------------------------------------------- animations */

@keyframes pop-in { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bubble-pop { 0% { transform: scale(0.94); } 100% { transform: scale(1); } }
@keyframes slot-pop { 0% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes marker { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@keyframes glint { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18) drop-shadow(0 0 10px rgba(255, 240, 170, 0.95)); } }
@keyframes stamp-in { from { transform: translate(-50%, -50%) rotate(-12deg) scale(2); opacity: 0; } }
@keyframes stamp-in-plain { from { transform: rotate(-10deg) scale(2.2); opacity: 0; } }
@keyframes pose-in { from { transform: translateY(30px) scale(0.6); opacity: 0; } }
@keyframes tag-in { from { transform: rotate(12deg) scale(2); opacity: 0; } }
@keyframes confetti-fall { to { transform: translateY(110vh) rotate(540deg); } }
@keyframes tap-ring {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.3); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-height: 700px) {
  .screen-heading { font-size: 1.2rem; margin: 0.2em 0 0.35em; }
  .narrator { min-height: 66px; }
  .avatar { width: 46px; height: 46px; }
  .bubble-text { font-size: 0.86rem; }
  .nav-btn { min-height: 48px; padding: 4px 2px; }
  .nav-label { font-size: 0.72rem; }
  .talk-face { width: 84px; }
  .choice { min-height: 42px; padding: 6px 12px; font-size: 0.92rem; }
  .cat-speech p { font-size: 0.92rem; }
  .actionbar .btn { min-height: 46px; }
  .slide { gap: 10px; }
  .slide-text { font-size: 1.04rem; }
  .slide-pic img { max-height: 40vh; }
  .slide-pic.cutout img { max-height: 38vh; }
}

/* ---------------------------------------------------------- dev pages */

.dev-page #app { max-width: 820px; margin: 0 auto; padding: 8px 16px 48px; }
.big { font-size: 1.3rem; font-weight: 600; }
.good { color: #2f7a46; }
.bad { color: #b0273a; }
.log { background: #fff8ec; border: 1px solid var(--cream-deep); border-radius: 12px; padding: 12px; overflow-x: auto; font-size: 13px; white-space: pre-wrap; }
.gal-section { margin: 28px 0; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.gal-tile { margin: 0; padding: 10px; background: var(--cream-deep); border-radius: 14px; text-align: center; }
.gal-tile figcaption { font-weight: 600; font-size: 0.9rem; margin-top: 6px; }
.gal-tile small { display: block; font-weight: 400; color: var(--brown-soft); }
.gal-clue, .gal-cake, .gal-portrait, .gal-closeup { width: 100%; }
.gal-clue.paw-trail { background: #c99c6c; border-radius: 10px; }
