/* Suspectacle: pastel sky + Cute GUI-Pack-Lite (yellow striped pill, glossy tiles, teal accents). */
:root {
  --ink: #23466b; --ink-soft: #5d7a97; --teal: #2fc0cf; --teal-dark: #13909e;
  --pink: #ff5b8c; --pink-soft: #ffd3e0; --edge: #d3edf5;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: linear-gradient(#9fdcf5, #e9f8fe 72%); }
body {
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
button { font: inherit; cursor: pointer; touch-action: manipulation; }

#app {
  height: 100vh; height: 100dvh; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom);
}

/* HUD */
#hud { display: flex; align-items: center; gap: 8px; padding: 10px 2px 6px; }
.chip {
  background: rgba(255, 255, 255, .9); border-radius: 999px; padding: 3px 12px; font-weight: 800;
  box-shadow: 0 2px 0 rgba(35, 70, 107, .15);
}
#score::before { content: "★ "; color: #f5b400; }
.badges { margin-left: auto; display: flex; gap: 3px; }
.badges svg { width: 26px; height: 28px; transition: opacity .3s, filter .3s; }
.badges svg.lost { opacity: .25; filter: grayscale(1); }

/* Board: the suspect out in the city (look) or your sketch on the police height chart (sketch) */
#stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 2px; }
.board {
  position: relative; flex: 1; min-height: 0; width: 100%; max-width: 330px; border-radius: 22px; overflow: hidden;
  border: 4px solid #fff; box-shadow: 0 4px 0 rgba(35, 70, 107, .18);
}
.board canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mug { background: repeating-linear-gradient(to bottom, #e3edf6 0 26px, #c4d5e6 26px 28px), #e3edf6; }
.city { background: #a8d8f4 url(assets/bg/city.jpg) center bottom / cover no-repeat; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.on { animation: flash .5s ease-out; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

.timer { width: 100%; max-width: 330px; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .75); overflow: hidden; visibility: hidden; }
.timer.on { visibility: visible; }
.timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), #ffb23f); border-radius: 6px; transform-origin: left; }
.prompt { margin: 0; min-height: 1.4em; font-weight: 800; text-align: center; }

/* Sketch tools. Hidden with visibility (not display) so the board is the same size while you look and while you sketch. */
.tools { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px 0 10px; }
.tools.off { visibility: hidden; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; height: 54px; }
.tab {
  position: relative; height: 54px; border: 0; border-radius: 16px; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: 12px; font-weight: 800; color: var(--ink-soft);
  background: linear-gradient(155deg, #fff 0 52%, #e2f5fb 52% 66%, #fff 66%); box-shadow: 0 3px 0 #b7d9e7;
}
.tab img { height: 24px; max-width: 34px; object-fit: contain; pointer-events: none; }
.tab .swatch { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid #3a2a20; }
.tab.active { color: #fff; background: linear-gradient(155deg, #3ccad8 0 52%, #2ebccb 52% 66%, #3ccad8 66%); box-shadow: 0 3px 0 var(--teal-dark); }
.tab .dot { position: absolute; top: 5px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 2px #fff; }
.tab.done .dot { background: #49c25a; }

.strip { display: flex; gap: 8px; height: 100px; flex: none; overflow-x: auto; padding: 6px 6px 8px; scrollbar-width: none; overscroll-behavior-x: contain; }
.strip::-webkit-scrollbar { display: none; }
/* Faded edges hint that the row scrolls; grab cursor for mouse dragging. */
.strip {
  touch-action: pan-x; cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}
.strip.dragging { cursor: grabbing; }
.strip.dragging .tile { pointer-events: none; }
.tile {
  position: relative; flex: 0 0 auto; width: 68px; height: 86px; padding: 0; border: 0; border-radius: 18px;
  background: url(assets/ui/tile.png) center / 100% 100% no-repeat; transition: transform .1s;
}
.tile:first-child { margin-left: auto; }
.tile:last-child { margin-right: auto; }
.tile canvas { position: absolute; left: 6px; top: 6px; width: calc(100% - 14px); height: calc(100% - 15px); pointer-events: none; }
.tile.sel { outline: 3px solid var(--pink); outline-offset: 1px; transform: scale(1.05); }
.tile:active { transform: scale(.95); }

.hand { position: absolute; width: 52px; pointer-events: none; z-index: 3; animation: tap 1s ease-in-out infinite; }
.hand.hidden { display: none; }
@keyframes tap { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-5px, -9px); } }

/* Yellow striped pill (3-slice: the round ends keep their shape at any width). */
.btn {
  height: 52px; min-width: 150px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: solid transparent; border-width: 0 26px; border-image: url(assets/ui/btn-yellow.png) 0 91 fill / 0 26px stretch; background: none;
  font-size: 18px; font-weight: 900; letter-spacing: .3px; color: #fff;
  text-shadow: 0 2px 0 #c77a00, 0 -1px 0 #c77a00, 1px 0 0 #c77a00, -1px 0 0 #c77a00;
}
.btn:active { transform: translateY(2px) scale(.98); }
.btn:disabled { filter: grayscale(1); opacity: .5; cursor: default; transform: none; }
.btn .inl { width: 28px; height: 28px; margin-left: -8px; }
#submit { align-self: center; min-width: 230px; }

/* Overlay cards */
.overlay {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(35, 70, 107, .38);
}
.overlay.hidden { display: none; }
.card {
  position: relative; width: min(370px, 100%); max-height: 100%; overflow: auto; text-align: center;
  padding: 18px 18px 16px; background: #fff; border-radius: 26px; border: 4px solid #e4f5fb;
  box-shadow: 0 6px 0 rgba(35, 70, 107, .25);
}
.card h1 { position: relative; margin: 2px 0 6px; font-size: 28px; font-weight: 900; color: var(--pink); text-shadow: 0 3px 0 var(--pink-soft); }
.card p { margin: 8px 0; }
.card .small { font-size: 13px; color: var(--ink-soft); }
.card .row { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.card .score { font-size: 22px; font-weight: 900; color: #e09a00; margin: 6px 0 0; }
.logo-icon { display: block; width: 66px; margin: -2px auto 0; }
.card h1.logo { font-size: 40px; letter-spacing: .5px; text-shadow: 0 4px 0 #9fe3ea; }
.sub { margin: 0 0 10px !important; font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--teal-dark); }
.best:empty { display: none; }

/* Reveal: stage curtains in the top corners, sketch vs suspect, a mark per part */
.reveal { padding-top: 26px; }
.reveal::before, .reveal::after {
  content: ""; position: absolute; top: 0; width: 64px; height: 88px; pointer-events: none;
  background: url(assets/ui/curtain.png) top left / contain no-repeat;
}
.reveal::before { left: 0; }
.reveal::after { right: 0; transform: scaleX(-1); }
.stars { position: absolute; top: 14px; left: 50%; width: 54px; margin-left: 70px; }
.stars.hidden { display: none; }
.compare { display: flex; gap: 10px; margin: 6px 0 4px; }
.compare figure { flex: 1; margin: 0; }
.compare canvas { display: block; width: 100%; aspect-ratio: 3 / 4; border-radius: 16px; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--edge); }
.compare .mug { background: repeating-linear-gradient(to bottom, #e3edf6 0 14px, #c4d5e6 14px 15px), #e3edf6; }
.compare figcaption { margin-top: 4px; font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.marks { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.marks li { border-radius: 12px; padding: 6px 2px 5px; font-size: 12px; font-weight: 800; }
.marks li .m { display: block; width: 26px; height: 26px; margin: 0 auto 2px; }
.marks li.ok { background: #e7f8ea; color: #2f8a3a; }
.marks li.bad { background: #ffeef3; color: #c43b63; }
/* What you missed: each wrong part close up, yours -> theirs */
.missed { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.missed:empty { display: none; }
.missed .lead { flex-basis: 100%; margin: 0; font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.miss { background: #fff3f7; border-radius: 12px; padding: 3px 6px 6px; }
.miss span { display: block; font-size: 11px; font-weight: 800; color: #c43b63; }
.miss .pair { display: flex; align-items: center; gap: 3px; }
.miss canvas { width: 46px; height: 58px; border-radius: 8px; background: #e3edf6; box-shadow: 0 0 0 2px #ffd0dd; }
.miss canvas.theirs { background: #a8d8f4 url(assets/bg/city.jpg) center / cover no-repeat; box-shadow: 0 0 0 2px #9fdcaa; }
.miss b { color: #c43b63; font-size: 14px; }
