/* The World of Culprit: one column the width of a phone, dark noir, the palette of Culprit. */
:root {
  --ink: #0a0c12;
  --paper: #f4efe4;
  --night: #0b1220;
  --slate: #131c2e;
  --mist: #cfd6e4;
  --teal: #2fb6a6;
  --amber: #f0a43a;
  --purple: #a56bf0;
  --red: #e2553f;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; background: #05070c; overflow: hidden; }
body { font-family: 'Nunito', sans-serif; color: var(--paper); -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
h2, h3 { font-family: 'Anton', sans-serif; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }
h2 { font-size: 26px; text-shadow: 0 2px 0 var(--ink); }
h3 { margin-top: 10px; font-size: 16px; color: var(--amber); }

.app { position: relative; max-width: 540px; height: 100vh; height: 100dvh; margin: 0 auto; overflow: hidden; background: var(--night); }

/* ---------- the map: it always covers the screen and is dragged along the side that is longer ---------- */
.city { height: 100%; overflow: auto; overscroll-behavior: contain; scrollbar-width: none; }
.city::-webkit-scrollbar { display: none; }
.map { position: relative; width: max(100%, calc(100vh * 9 / 16)); width: max(100%, calc(100dvh * 9 / 16)); aspect-ratio: 9 / 16; }
.map img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.map img.night { opacity: 0; transition: opacity 1.4s ease; }
.map.night img.night { opacity: 1; }

/* a place: a ring on the building and its name under it */
.pin { position: absolute; width: 0; height: 0; padding: 0; background: none; border: 0; }
/* the dark line round the ring keeps it readable on the pale walls of the city by day */
.pin i { position: absolute; left: -19px; top: -19px; width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--amber); outline: 2px solid rgba(10, 12, 18, .8); background: rgba(240, 164, 58, .2); animation: pulse 1.8s ease-in-out infinite; }
.pin span { position: absolute; left: 0; top: 24px; transform: translateX(-50%); padding: 3px 9px 2px; background: rgba(10, 12, 18, .88); border: 2px solid var(--paper); box-shadow: 3px 4px 0 rgba(0, 0, 0, .6); font-family: 'Anton', sans-serif; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.pin.on i { background: var(--amber); animation: none; }
.pin.on span { background: var(--amber); color: var(--ink); border-color: var(--ink); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 164, 58, .6); }
  50% { box-shadow: 0 0 0 12px rgba(240, 164, 58, 0); }
}
/* the place of the crime, once the player has answered the call: a red ring and a red tag over it */
.pin em { display: none; position: absolute; left: 0; bottom: 25px; transform: translateX(-50%); padding: 3px 9px 2px; background: var(--red); border: 2px solid var(--ink); box-shadow: 3px 4px 0 rgba(0, 0, 0, .6); font-family: 'Anton', sans-serif; font-style: normal; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.pin.scene em { display: block; }
.pin.scene i { border-color: var(--red); background: rgba(226, 85, 63, .3); animation-name: alarm; animation-duration: 1.2s; }
.pin.scene.on i { background: var(--red); }
@keyframes alarm {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226, 85, 63, .75); }
  50% { box-shadow: 0 0 0 18px rgba(226, 85, 63, 0); }
}

/* ---------- top bar: the name, the time of day, the language ---------- */
.bar { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px 26px; background: linear-gradient(to bottom, rgba(6, 10, 20, .92), rgba(6, 10, 20, 0)); pointer-events: none; }
.bar > * { pointer-events: auto; }
.brand { text-shadow: 0 2px 0 var(--ink); }
.brand span { display: block; font-family: 'Special Elite', monospace; font-size: 10px; letter-spacing: .3em; color: var(--amber); }
.brand b { display: block; font-family: 'Anton', sans-serif; font-weight: 400; font-size: 30px; line-height: 1; letter-spacing: .04em; }
.when { margin-left: auto; text-align: right; text-shadow: 0 2px 0 var(--ink); }
.when em { display: block; font-family: 'Special Elite', monospace; font-style: normal; font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--amber); }
.when b { display: block; font-family: 'Anton', sans-serif; font-weight: 400; font-size: 18px; letter-spacing: .06em; text-transform: uppercase; }
.when span { font-family: 'Special Elite', monospace; font-size: 13px; color: var(--mist); }
.langs { display: flex; gap: 5px; }
.lang { padding: 4px 8px 3px; background: rgba(10, 12, 18, .7); border: 1px solid rgba(244, 239, 228, .5); font-family: 'Special Elite', monospace; font-size: 12px; }
.lang.on { background: var(--paper); color: var(--ink); }

/* ---------- the sheet of a place ---------- */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 8px; padding: 16px 18px 20px; background: rgba(10, 12, 18, .95); border-top: 3px solid var(--amber); transform: translateY(105%); transition: transform .28s ease-out; }
.sheet.open { transform: translateY(0); }
.sheet b { font-family: 'Anton', sans-serif; font-weight: 400; font-size: 26px; letter-spacing: .05em; text-transform: uppercase; }
.sheet p { font-family: 'Special Elite', monospace; font-size: 15px; line-height: 1.4; color: var(--mist); }
.sheet .crime { padding-left: 10px; border-left: 4px solid var(--red); color: var(--paper); }
.sheet .heard { padding-left: 10px; border-left: 4px solid var(--amber); color: var(--paper); }
.sheet p:empty { display: none; }
.sheet.busy .btn { opacity: .5; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.here { padding: 4px 9px 3px; border: 1px solid var(--teal); color: var(--teal); font-family: 'Special Elite', monospace; font-size: 12px; }
.btn { justify-self: start; margin-top: 4px; padding: 9px 16px 8px; background: var(--slate); border: 2px solid var(--paper); box-shadow: 4px 5px 0 rgba(0, 0, 0, .6); font-family: 'Anton', sans-serif; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
.btn.main { background: var(--amber); color: var(--ink); border-color: var(--ink); }
.btn.danger { background: var(--red); border-color: var(--ink); }

/* ---------- the case on the map: the detective's pawn, the hours left, the places already seen ---------- */
/* the pawn stands beside the ring of its place, so the ring and its tags stay in sight */
.pawn { position: absolute; z-index: 2; display: none; width: 46px; height: 46px; margin: -23px 0 0 -74px; border-radius: 50%; border: 3px solid var(--paper); outline: 2px solid var(--ink); box-shadow: 0 6px 0 rgba(0, 0, 0, .45); overflow: hidden; pointer-events: none; transition: left .9s ease-in-out, top .9s ease-in-out; }
.pawn.on { display: block; }
.pawn.right { margin-left: 28px; }
.pawn img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pin.been i { border-style: dashed; animation: none; }
.hud { position: absolute; left: 14px; right: 14px; bottom: 14px; display: none; justify-content: space-between; align-items: center; pointer-events: none; }
.hud.on { display: flex; }
.hud > * { pointer-events: auto; }
.hud .hours { padding: 8px 14px 6px; background: rgba(10, 12, 18, .92); border: 2px solid var(--paper); box-shadow: 4px 5px 0 rgba(0, 0, 0, .6); font-family: 'Anton', sans-serif; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; }
.hud.low .hours { color: var(--red); border-color: var(--red); }
.hud .btn { margin-top: 0; }
.sheet { z-index: 3; }

/* ---------- a place seen from inside: its picture to search, what was found, what to do ---------- */
.room { position: absolute; inset: 0; z-index: 3; display: none; flex-direction: column; overflow-y: auto; background: var(--night); }
.room.open { display: flex; }
.shot { position: relative; flex: none; cursor: crosshair; }
.shot img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.marks { position: absolute; inset: 0; pointer-events: none; }
.marks i { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); }
.marks .found { border: 3px solid var(--teal); background: rgba(47, 182, 166, .22); }
.marks .hint { border: 3px solid var(--amber); background: rgba(240, 164, 58, .15); animation: pulse 1.6s ease-in-out infinite; }
.marks .aim { width: 34px; height: 34px; border: 3px solid var(--paper); outline: 2px solid var(--ink); background: rgba(244, 239, 228, .18); }
.panel { display: grid; gap: 8px; padding: 14px 18px 18px; border-top: 3px solid var(--amber); }
.panel b { font-family: 'Anton', sans-serif; font-weight: 400; font-size: 24px; letter-spacing: .05em; text-transform: uppercase; }
.panel p { font-family: 'Special Elite', monospace; font-size: 15px; line-height: 1.4; }
.panel .lead { color: var(--paper); padding-left: 10px; border-left: 4px solid var(--amber); }
.panel .said { color: var(--mist); }
.panel p:empty { display: none; }
.panel .btn { margin-top: 0; }
.panel .btn:disabled { opacity: .45; }
.panel .clock { font-family: 'Anton', sans-serif; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); }

/* ---------- the notebook and the verdict: sheets of paper over the map ---------- */
.book, .verdict { position: absolute; inset: 0; z-index: 4; display: none; flex-direction: column; gap: 10px; padding: 22px 18px; overflow-y: auto; background: rgba(6, 10, 20, .97); }
.book.open, .verdict.open { display: flex; }
.book .btn, .verdict .btn { align-self: flex-start; margin-top: 8px; }
.note { padding: 9px 12px 8px; background: rgba(19, 28, 46, .9); border-left: 4px solid var(--amber); }
.note b { display: block; font-family: 'Anton', sans-serif; font-weight: 400; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); }
.note p, .empty, .ask p { font-family: 'Special Elite', monospace; font-size: 14px; line-height: 1.4; color: var(--mist); }
.note p { margin-top: 3px; color: var(--paper); }
.people { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.face { display: grid; gap: 5px; padding: 0 0 6px; background: var(--slate); border: 2px solid var(--paper); box-shadow: 3px 4px 0 rgba(0, 0, 0, .6); text-align: center; }
.face img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.face span { padding: 0 4px; font-size: 12px; font-weight: 800; line-height: 1.2; }
.face.out { opacity: .38; border-color: var(--red); }
.face.out img { filter: grayscale(1); }
.ask { display: grid; gap: 8px; padding: 12px; background: var(--paper); border: 3px solid var(--ink); }
.ask p { color: var(--ink); font-size: 15px; }
.ask .btn { margin-top: 0; }
.ask .btn:not(.danger) { color: var(--paper); }
.verdict { align-items: center; justify-content: center; text-align: center; }
.verdict > b { font-family: 'Anton', sans-serif; font-weight: 400; font-size: 36px; letter-spacing: .05em; text-transform: uppercase; }
.verdict > b.ok { color: var(--amber); }
.verdict > b.ko { color: var(--red); }
.verdict img { width: 150px; height: 150px; object-fit: cover; border: 5px solid var(--paper); outline: 3px solid var(--ink); box-shadow: 8px 10px 0 rgba(0, 0, 0, .55); transform: rotate(-2.5deg); }
.verdict p { max-width: 400px; font-size: 16px; font-weight: 600; line-height: 1.4; }
.verdict .trail, .verdict .next { font-family: 'Special Elite', monospace; font-size: 13px; font-weight: 400; color: var(--mist); }
.verdict .trail i { display: block; font-style: normal; color: var(--amber); }
.verdict .btn { align-self: center; }
.stars { font-size: 38px; letter-spacing: 6px; color: rgba(244, 239, 228, .22); }
.stars .on { color: var(--amber); text-shadow: 0 2px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 3px 0 rgba(0, 0, 0, .6); }

/* ---------- the telephone: the call from the police headquarters covers the map ---------- */
.phone { position: absolute; inset: 0; z-index: 5; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: rgba(4, 6, 12, .9); }
.phone.open { display: flex; }
.caller { width: 150px; height: 150px; border-radius: 50%; border: 4px solid var(--paper); outline: 3px solid var(--ink); background-color: var(--slate); background-repeat: no-repeat; }
.phone.ringing.live .caller { animation: ring 1.1s ease-in-out infinite; }
@keyframes ring {
  0%, 40%, 100% { transform: rotate(0); }
  10% { transform: rotate(-5deg); }
  20% { transform: rotate(5deg); }
  30% { transform: rotate(-3deg); }
  0% { box-shadow: 0 0 0 0 rgba(47, 182, 166, .75); }
  60%, 100% { box-shadow: 0 0 0 28px rgba(47, 182, 166, 0); }
}
.phone > b { margin-top: 8px; font-family: 'Anton', sans-serif; font-weight: 400; font-size: 32px; letter-spacing: .05em; text-transform: uppercase; text-shadow: 0 2px 0 var(--ink); }
.phone .status { font-family: 'Special Elite', monospace; font-size: 15px; color: var(--amber); }
.phone .btn { justify-self: auto; margin-top: 14px; padding: 13px 28px 12px; font-size: 19px; }
.phone .balloon, .phone [data-act="hangup"] { display: none; }
.phone.talking .balloon, .phone.talking [data-act="hangup"] { display: block; }
.phone.talking .status, .phone.talking [data-act="answer"] { display: none; }
/* the words of the police, in the lettering of the comic, with the tail towards the caller */
.balloon { position: relative; max-width: 400px; margin-top: 14px; padding: 14px 16px 15px; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 5px 6px 0 rgba(0, 0, 0, .5); font-family: 'Balsamiq Sans', cursive; font-weight: 700; font-style: italic; font-size: 16px; line-height: 1.25; text-transform: uppercase; }
.balloon::before, .balloon::after { content: ""; position: absolute; left: 50%; border-style: solid; }
.balloon::before { top: -22px; margin-left: -10px; border-width: 0 10px 22px 10px; border-color: transparent transparent var(--ink) transparent; }
.balloon::after { top: -16px; margin-left: -7px; border-width: 0 7px 17px 7px; border-color: transparent transparent #fff transparent; }

@media (prefers-reduced-motion: reduce) {
  .pin i, .phone.ringing.live .caller { animation: none; }
  .map img.night, .sheet { transition: none; }
}
