@font-face {
  font-family: "Rokkitt";
  src: url("fonts/rokkitt-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/barlow-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/barlow-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/barlow-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/barlow-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --navy: #07092c;
  --navy-2: #0c0f4a;
  --panel: #1437c8;
  --panel-dark: #0e2690;
  --gold: #fcc21b;
  --gold-dark: #b98300;
  --key: #f39a1e;
  --key-hi: #ffc04d;
  --sky: #4a9cc4;
  --white: #f4f6ff;
  --dim: #9aa6d8;
  --red: #ff4a4a;
  --slab: Rockwell, "Rokkitt", "Roboto Slab", Georgia, serif;
  --sans: "Barlow", "DIN Alternate", Bahnschrift, "Segoe UI", Arial, sans-serif;
  --u: clamp(13px, 1.5vmin + 4px, 22px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: var(--white);
  font-family: var(--sans);
  font-size: var(--u);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

button, input, select { font: inherit; color: inherit; }

/* ------------------------------------------------------------ frame */

#screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--navy);
  padding: 0 clamp(10px, 3vw, 48px);
  padding-bottom: env(safe-area-inset-bottom);
}

.hdr {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  height: clamp(54px, 11vh, 110px);
  padding-bottom: .25em;
  flex: none;
}

.badge {
  position: absolute;
  left: .4em;
  top: .5em;
  height: 128%;
  z-index: 3;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6));
}

.hdr-title { text-align: right; line-height: 1.05; }
.t1 {
  font-family: var(--slab);
  font-weight: 700;
  font-size: clamp(18px, 4.6vmin, 50px);
  letter-spacing: .02em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
}
.t2 {
  color: var(--sky);
  font-size: clamp(9px, 1.9vmin, 20px);
  letter-spacing: .08em;
}

.bar {
  flex: none;
  height: clamp(5px, .9vh, 9px);
  background: var(--gold);
  box-shadow: 0 1px 0 var(--gold-dark), 0 0 12px rgba(245, 184, 28, .25);
}

.mid { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }

#view {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1.7em .2em 1em;
  display: flex;
  flex-direction: column;
}

.ftr {
  flex: none;
  display: flex;
  align-items: center;
  gap: 1.2em;
  height: clamp(30px, 5.5vh, 48px);
  font-size: .8em;
  color: var(--dim);
  white-space: nowrap;
}
#hints { display: flex; gap: 1.2em; flex: 1; overflow: hidden; }
#hints kbd {
  font: inherit;
  font-size: .8em;
  border: 1px solid var(--dim);
  border-radius: 3px;
  padding: 0 .35em;
  margin-right: .35em;
  color: var(--white);
}
#whoami { color: var(--white); overflow: hidden; text-overflow: ellipsis; }
#clock { font-family: var(--slab); font-weight: 700; color: var(--gold); min-width: 4.5em; text-align: right; }
#fsbtn {
  background: none;
  border: 1px solid var(--dim);
  border-radius: 3px;
  color: var(--dim);
  font-size: .8em;
  padding: .1em .6em;
  cursor: pointer;
}
#fsbtn:hover { color: var(--white); border-color: var(--white); }

/* ------------------------------------------------------------ shared pieces */

.title {
  font-family: var(--slab);
  font-weight: 700;
  font-size: 1.5em;
  color: var(--gold);
  letter-spacing: .04em;
  margin: 0 0 .1em;
}
.subtitle { color: var(--white); letter-spacing: .12em; font-size: .85em; margin-bottom: .9em; }
.stripes {
  height: .55em;
  width: min(22em, 100%);
  margin: .2em 0 .35em;
  background: repeating-linear-gradient(-55deg, var(--gold) 0 .55em, transparent .55em 1.1em);
}

.btn {
  background: var(--key);
  color: #1a1000;
  border: 0;
  border-radius: .55em;
  padding: .5em 1.1em;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22), 0 2px 4px rgba(0, 0, 0, .4);
  text-transform: uppercase;
}
.btn:hover, .btn:focus-visible { background: var(--key-hi); outline: 2px solid var(--white); outline-offset: 2px; }
.btn:active { transform: translateY(1px); }
.btn.blue { background: var(--sky); }
.btn.blue:hover, .btn.blue:focus-visible { background: #8cc6ee; }
.btn.ghost { background: transparent; color: var(--white); box-shadow: inset 0 0 0 2px var(--gold); }
.btn.ghost:hover, .btn.ghost:focus-visible { background: rgba(245, 184, 28, .18); }
.btn.danger { background: var(--red); color: #fff; }
.btn.on { background: var(--white); color: #000; }
.btn.small { font-size: .78em; padding: .35em .7em; border-radius: .45em; }
.btn:disabled { opacity: .45; cursor: default; }

.field { display: flex; flex-direction: column; gap: .3em; margin-bottom: .9em; }
.field label { font-size: .78em; letter-spacing: .14em; color: var(--sky); }
.field input, .field select {
  background: var(--navy);
  border: 3px solid var(--gold);
  color: var(--white);
  padding: .45em .6em;
  font-size: 1.05em;
  letter-spacing: .06em;
  outline: none;
  border-radius: 0;
  width: 100%;
}
.field input:focus, .field select:focus { box-shadow: 0 0 0 2px var(--white); }
.field input.upper { text-transform: uppercase; }

.row { display: flex; gap: .6em; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
.muted { color: var(--dim); }
.err { color: var(--red); }

/* blue list panel with gold rules, like the criminal database */
.panel {
  background: linear-gradient(var(--panel), var(--panel-dark));
  border-top: 3px solid var(--gold);
  border-bottom: 3px solid var(--gold);
}
.prow {
  display: flex;
  align-items: center;
  gap: .9em;
  padding: .55em 1em;
  border-bottom: 2px solid var(--gold);
  min-height: 2.9em;
}
.prow:last-child { border-bottom: 0; }
.prow.click { cursor: pointer; }
.prow.click:hover, .prow.click:focus-visible { background: var(--gold); color: #000; outline: none; }
.prow.click:hover .muted, .prow.click:focus-visible .muted { color: #332400; }
.prow .main { font-size: 1.1em; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.prow .sub { font-size: .8em; color: #cfd8ff; }
.prow.click:hover .sub, .prow.click:focus-visible .sub { color: #332400; }
.empty { padding: 1.4em 1em; color: #cfd8ff; }

.dot {
  display: inline-block;
  width: .8em;
  height: .8em;
  border-radius: 50%;
  border: 2px solid #fff;
  flex: none;
  box-shadow: 0 0 6px currentColor;
}
.tag {
  font-size: .72em;
  letter-spacing: .1em;
  padding: .15em .55em;
  border: 1px solid currentColor;
  border-radius: 3px;
  white-space: nowrap;
}

/* ------------------------------------------------------------ login */

.login {
  margin: auto;
  width: min(100%, 24em);
  display: flex;
  flex-direction: column;
}
.login .btn { align-self: flex-start; font-size: 1.1em; padding: .55em 1.6em; }
.login-msg { min-height: 1.5em; margin-top: .9em; font-size: 1.1em; }

/* ------------------------------------------------------------ menu */

.menu-wrap { display: flex; gap: 2em; align-items: flex-start; flex: 1; min-height: 0; }
.menu { flex: 1; min-width: 0; }
.menu-item {
  display: flex;
  align-items: center;
  gap: .8em;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 2px solid var(--gold);
  padding: .5em 1em;
  font-size: 1.25em;
  letter-spacing: .05em;
  cursor: pointer;
  color: var(--white);
}
.menu-item:last-child { border-bottom: 0; }
.menu-item:hover, .menu-item:focus-visible { background: var(--gold); color: #000; outline: none; }
.menu-item .hint { margin-left: auto; font-size: .62em; letter-spacing: .1em; opacity: .8; }

.idcard { flex: none; width: 15em; text-align: center; }
.mug {
  position: relative;
  border: .45em solid var(--gold);
  background:
    repeating-linear-gradient(to bottom, transparent 0 1.05em, rgba(0, 0, 0, .55) 1.05em calc(1.05em + 2px)),
    #dff6f4;
  height: 13em;
  overflow: hidden;
}
.mug svg { position: absolute; left: 50%; bottom: 2.2em; width: 9.5em; transform: translateX(-50%); }
.mug .plate {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 78%;
  background: #15171c;
  border: 2px solid #8b9099;
  border-bottom: 0;
  color: #fff;
  font-size: .72em;
  letter-spacing: .1em;
  padding: .35em .3em .45em;
  line-height: 1.35;
}
.mug .plate b { display: block; font-size: 1.15em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idcard .duty { margin-top: .7em; font-size: 1.05em; }
.idcard .duty small { display: block; color: var(--dim); margin-top: .2em; }

/* ------------------------------------------------------------ forms / sign on */

.split { display: flex; gap: 1.5em; flex: 1; min-height: 0; }
.split > .col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.split > .col.narrow { flex: 0 0 21em; overflow: auto; padding-right: .3em; }


.mapbox {
  flex: 1;
  min-height: 14em;
  border: .35em solid var(--gold);
  background: #0a1030;
  position: relative;
  z-index: 0;
}
.mapbox.picking { cursor: crosshair; border-color: var(--white); }
.mapbox.picking .leaflet-grab { cursor: crosshair; }

.toolbar { display: flex; flex-wrap: wrap; gap: .5em; align-items: center; margin-bottom: .6em; }

.sidelist { overflow: auto; flex: none; }
.sidelist .prow { flex-wrap: wrap; gap: .3em .9em; }
.sidelist .prow .grow { flex-basis: 100%; }

/* ------------------------------------------------------------ map look */

.leaflet-container { background: #0a1030; font-family: var(--sans); }
.leaflet-tile-pane { filter: grayscale(1) invert(1) sepia(1) hue-rotate(185deg) saturate(2.6) brightness(.95) contrast(1.05); }
.leaflet-control-attribution { background: rgba(6, 6, 46, .75) !important; color: var(--dim); font-size: 10px; }
.leaflet-control-attribution a { color: var(--sky); }
.leaflet-bar a { background: var(--key); color: #1a1000; border-bottom-color: var(--gold-dark); }
.leaflet-bar a:hover { background: var(--key-hi); color: #000; }

.umark-wrap { background: none; border: 0; }
.umark {
  position: absolute;
  transform: translate(-.6em, -.6em);
  display: flex;
  align-items: center;
  gap: .3em;
  white-space: nowrap;
  font-size: 14px;
}
.umark .pin {
  width: 1.2em;
  height: 1.2em;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #000;
  background: var(--sky);
  flex: none;
}
.umark .lbl {
  background: var(--navy);
  border: 2px solid var(--gold);
  color: #fff;
  font-weight: 700;
  padding: .05em .4em;
  letter-spacing: .05em;
}
.umark.mine .lbl { background: var(--gold); color: #000; }
.umark.stale { opacity: .5; }

/* ------------------------------------------------------------ crimes on the map */

.cmark {
  position: absolute;
  transform: translate(-.7em, -.7em);
  display: flex;
  align-items: center;
  gap: .3em;
  white-space: nowrap;
  font-size: 14px;
}
.cmark .cpin {
  width: 1.4em;
  height: 1.4em;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #000;
  flex: none;
}
.cmark .lbl {
  background: var(--navy);
  border: 2px solid var(--red);
  color: #fff;
  font-weight: 700;
  padding: .05em .4em;
  letter-spacing: .05em;
  max-width: 14em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmark.backup .cpin { animation: backup 1.2s ease-out infinite; }
@keyframes backup {
  from { box-shadow: 0 0 0 2px #000, 0 0 0 2px rgba(255, 74, 74, .9); }
  to { box-shadow: 0 0 0 2px #000, 0 0 0 1.6em rgba(255, 74, 74, 0); }
}

/* ------------------------------------------------------------ criminal records */

.field textarea {
  background: var(--navy);
  border: 3px solid var(--gold);
  color: var(--white);
  padding: .45em .6em;
  font: inherit;
  letter-spacing: .03em;
  outline: none;
  border-radius: 0;
  width: 100%;
  resize: vertical;
}
.field textarea:focus { box-shadow: 0 0 0 2px var(--white); }

.tabs { display: flex; border-top: 3px solid var(--gold); }
.tab {
  flex: 1;
  background: none;
  border: 0;
  color: var(--white);
  font-weight: 700;
  font-size: 1.25em;
  letter-spacing: .08em;
  padding: .4em 0;
  cursor: pointer;
}
.tab:hover, .tab:focus-visible { background: rgba(252, 194, 27, .2); outline: none; }
.tab.on { background: var(--gold); color: #000; }
.tabs + .panel { border-top: 0; }

.tag.wanted { color: #fff; background: var(--red); border-color: var(--red); font-weight: 700; }

.mugbox { flex: none; width: 15em; }
.mug .mugphoto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.profile { display: flex; gap: 2em; align-items: flex-start; }
.profile .mugbox { width: 17em; }
.profile .mug { height: 20em; }
.wanted-banner {
  margin-top: .6em;
  background: var(--red);
  color: #fff;
  text-align: center;
  font-family: var(--slab);
  font-weight: 700;
  font-size: 1.5em;
  letter-spacing: .25em;
  padding: .15em 0;
}
.pf { display: flex; gap: 1em; padding: .5em 1em; border-bottom: 2px solid var(--gold); }
.pf:last-child { border-bottom: 0; }
.pf-l { flex: 0 0 11em; font-size: .78em; letter-spacing: .14em; color: #cfd8ff; padding-top: .25em; }
.pf-v { flex: 1; min-width: 0; font-size: 1.1em; overflow-wrap: anywhere; }
.cols { display: flex; gap: 1em; }
.cols > .field { flex: 1; min-width: 0; }
.check { display: inline-flex; align-items: center; gap: .5em; letter-spacing: .14em; cursor: pointer; }
.check input { width: 1.3em; height: 1.3em; accent-color: var(--gold); }

.searching { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 1.2em; }
.searching .mugbox { width: 19em; }
.searching .mug { height: 17em; }
.searching-text { font-size: 1.7em; }

/* ------------------------------------------------------------ standby screen */

#idle {
  position: absolute;
  inset: 0;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2em;
  padding: 1.5em 2vw 3em;
  z-index: 2; /* above the page, below the header badge that hangs over the bar */
  cursor: none;
}
#idle[hidden] { display: none; }
.idle-logo { height: min(64%, 24em); flex: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6)); }
.idle-mid { flex: 1; min-width: 0; text-align: center; }
.idle-clock { font-family: var(--slab); font-weight: 700; font-size: clamp(3.5em, 15vmin, 11em); line-height: 1; color: var(--white); }
.idle-date { color: var(--sky); letter-spacing: .2em; margin: .6em 0 1.6em; }
.idle-unit { font-size: 1.5em; letter-spacing: .06em; }
.idle-unit b { color: var(--gold); }
.idle-unit .muted { font-size: .6em; margin-top: .4em; letter-spacing: .12em; }
.idle-card { flex: none; width: 15em; opacity: 0; }
.idle-card.in { opacity: 1; transition: opacity .8s; }
.idle-card:empty { display: none; }
.idle-name { font-size: 1.3em; margin-top: .5em; }
.idle-foot { position: absolute; left: 0; right: 0; bottom: .9em; text-align: center; color: var(--dim); font-size: .8em; letter-spacing: .3em; }

/* ------------------------------------------------------------ dialog + toast */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 20, .78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 1em;
}
.dialog {
  width: min(100%, 26em);
  max-height: 100%;
  overflow: auto;
  background: var(--navy-2);
  border: .35em solid var(--gold);
  padding: 1.2em 1.4em;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .7);
}
.dialog p { margin: 0 0 1em; line-height: 1.4; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 9vh;
  transform: translateX(-50%) translateY(1em);
  background: var(--gold);
  color: #000;
  font-weight: 700;
  padding: .55em 1.2em;
  letter-spacing: .04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 4000;
  max-width: 90vw;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--red); color: #fff; }

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

@media (max-width: 760px) {
  .profile { flex-direction: column; align-items: stretch; }
  .profile .mugbox { width: 100%; max-width: 17em; }
  .cols { flex-direction: column; gap: 0; }
  .pf { flex-direction: column; gap: .1em; }
  .pf-l { flex: none; }
  .idle-logo { display: none; }
  #idle { flex-direction: column; justify-content: center; }
  .badge { height: 100%; top: .2em; left: 0; }
  .t1 { font-size: clamp(14px, 4.6vw, 30px); }
  #view { padding-top: 1.4em; }
  .menu { flex: none; }
  .menu-wrap { flex: none; }
  .menu-wrap { flex-direction: column-reverse; align-items: stretch; gap: 1em; }
  .idcard { width: 100%; display: flex; gap: 1em; align-items: center; text-align: left; }
  .mug { flex: 0 0 8em; height: 7.5em; }
  .mug svg { width: 5.5em; bottom: 1.6em; }
  .mug .plate { font-size: .5em; }
  .split { flex-direction: column; }
  .split > .col.narrow { flex: none; }
  .mapbox { min-height: 46vh; }
  #hints { display: none; }
  #whoami { flex: 1; }
  .prow { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .cmark.backup .cpin { animation: none; }
  #toast { transition: none; }
}
