:root {
  --pink: #ff2f7d;
  --cyan: #35e6f2;
  --gold: #ffc83d;
  --ink: #07070d;
  --paper: #f7f1e6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #07070d;
  color: var(--paper);
  font-family: "Helvetica Neue", "Arial", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* in game the pointer belongs to the camera, not to the page; the pause screen
   drops this class again so the menu is clickable. !important because the
   canvas carries its own cursor rule and no stray rule may bring the arrow back */
body.playing,
body.playing *,
body.look,
body.look * {
  cursor: none !important;
}

.hidden { display: none !important; }

/* ---------- HUD ---------- */
/* The HUD's scale: full size on a desktop screen, smaller step by step on a
   narrow or short one (a laptop window, a tablet, a phone), so the minimap,
   the bars and the objective never crowd the view. The corner blocks zoom as
   a whole; the centred messages scale their type. */
:root { --hud: 1; }
@media (max-width: 1180px), (max-height: 740px) { :root { --hud: 0.86; } }
@media (max-width: 900px), (max-height: 600px) { :root { --hud: 0.72; } }
@media (max-width: 640px), (max-height: 460px) { :root { --hud: 0.58; } }
@media (max-width: 440px), (max-height: 360px) { :root { --hud: 0.48; } }
.hud-tl, .hud-tr, .hud-bl, #objective { zoom: var(--hud); }

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.hud-tl {
  position: absolute;
  top: 22px;
  left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-frame {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18), 0 0 0 5px rgba(0, 0, 0, 0.55),
    0 14px 40px rgba(0, 0, 0, 0.6);
}

#minimap { width: 200px; height: 200px; display: block; }

.map-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: inset 0 0 26px 10px rgba(0, 0, 0, 0.55);
}

#zone {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.32em;
  padding: 5px 10px 4px;
  border-radius: 3px;
  color: #0a0a12;
  background: linear-gradient(100deg, var(--gold), #ffe9a8);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.hud-tr {
  position: absolute;
  top: 22px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.stars { display: flex; gap: 3px; height: 26px; }
.stars i {
  width: 22px;
  height: 22px;
  display: block;
  background: rgba(255, 255, 255, 0.16);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  transition: background 0.2s ease;
}
.stars i.on { background: var(--gold); filter: drop-shadow(0 0 8px rgba(255, 200, 61, 0.8)); }
/* out of the police's sight: the stars flash while the heat cools */
.stars.cooling i.on { animation: star-cool 0.8s steps(2, jump-none) infinite; }
@keyframes star-cool { 50% { opacity: 0.25; } }

#money {
  font-family: "Courier New", monospace;
  font-size: 30px;
  font-weight: 700;
  color: #eafff4;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}

.bar {
  position: relative;
  width: 210px;
  height: 14px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  overflow: hidden;
  margin-top: 2px;
}
.bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #37f2a2, #b6ff6d);
  transition: width 0.15s linear, background 0.3s ease;
}
.bar.armour i {
  background: linear-gradient(90deg, #3f8cff, #9fd2ff);
}
/* the ride's own condition, set apart under the player's bars */
.bar.vehicle {
  margin-top: 8px;
  width: 170px;
  margin-left: auto;
}
.bar.vehicle i {
  background: linear-gradient(90deg, #ff9a3d, #ffd36b);
}
.bar.vehicle.smoking i {
  background: linear-gradient(90deg, #8a8f99, #c9ced6);
}
.bar.vehicle.burning i {
  background: linear-gradient(90deg, #ff2f2f, #ff8a3d);
  animation: burn 0.5s steps(2) infinite;
}
@keyframes burn {
  50% {
    opacity: 0.45;
  }
}
.bar span {
  position: absolute;
  right: 6px;
  top: 0;
  line-height: 14px;
  font-size: 8px;
  letter-spacing: 0.24em;
  font-weight: 800;
  color: rgba(0, 0, 0, 0.6);
}

.hud-bl {
  position: absolute;
  left: 26px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.weapon-name {
  font-size: 10px;
  letter-spacing: 0.3em;
  font-weight: 800;
  color: rgba(247, 241, 230, 0.65);
}
.ammo { font-family: "Courier New", monospace; font-size: 26px; font-weight: 700; }
.speedo { font-family: "Courier New", monospace; margin-bottom: 6px; color: #9fe8ff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }
.speedo b { font-size: 30px; font-weight: 700; }
.speedo span { font-size: 11px; letter-spacing: 0.2em; margin-left: 6px; }
.speedo i { display: block; font-style: normal; font-size: 11px; letter-spacing: 0.18em; opacity: 0.85; }
.ammo b { color: var(--cyan); }
.ammo span { font-size: 16px; opacity: 0.5; }

#objective {
  position: absolute;
  right: 26px;
  bottom: 112px;
  width: 320px;
  text-align: right;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(8, 8, 16, 0), rgba(8, 8, 16, 0.82));
  border-right: 3px solid var(--gold);
  border-radius: 3px;
}
.obj-label {
  font-size: 9px;
  letter-spacing: 0.34em;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 4px;
}
.obj-text { font-size: 15px; line-height: 1.35; font-weight: 600; }
.obj-timer {
  font-family: "Courier New", monospace;
  font-size: 18px;
  font-weight: 700;
  color: #ff6f8d;
  margin-top: 4px;
}

/* Above and right of the screen centre, which the camera keeps on the player;
   shots follow the camera ray through wherever this lands (player.js). */
#crosshair {
  position: absolute;
  left: 53%;
  top: 41%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  opacity: 0.9;
}
#crosshair span {
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
}
/* four ticks around an open centre, so the target under it stays visible */
#crosshair .l, #crosshair .r { top: 12px; width: 8px; height: 2px; }
#crosshair .t, #crosshair .b { left: 12px; width: 2px; height: 8px; }
#crosshair .l { left: 0; }
#crosshair .r { right: 0; }
#crosshair .t { top: 0; }
#crosshair .b { bottom: 0; }

#prompt {
  position: absolute;
  left: 50%;
  bottom: 22%;
  transform: translateX(-50%);
  padding: 9px 18px;
  font-size: calc(13px * max(var(--hud), 0.75));
  letter-spacing: 0.08em;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(6, 6, 14, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}
#prompt b {
  display: inline-block;
  padding: 1px 7px;
  margin-right: 7px;
  border-radius: 4px;
  background: var(--paper);
  color: #0b0b14;
  font-family: "Courier New", monospace;
}

#banner {
  position: absolute;
  left: 50%;
  top: 26%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: calc(46px * var(--hud));
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 0 26px rgba(255, 47, 125, 0.75), 0 6px 30px rgba(0, 0, 0, 0.9);
  animation: pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1);
}
#banner.gold { color: var(--gold); text-shadow: 0 0 30px rgba(255, 200, 61, 0.8), 0 6px 30px rgba(0, 0, 0, 0.9); }
#banner.small { font-size: calc(24px * var(--hud)); letter-spacing: 0.2em; }
@keyframes pop {
  from { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

#subtitle {
  position: absolute;
  left: 50%;
  bottom: 9%;
  transform: translateX(-50%);
  text-align: center;
  font-size: calc(14px * max(var(--hud), 0.8));
  letter-spacing: 0.04em;
  max-width: min(86vw, 640px);
  color: rgba(247, 241, 230, 0.92);
  text-shadow: 0 2px 12px #000;
}

/* ---------- Screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 100% at 50% 0%, rgba(255, 47, 125, 0.28), transparent 55%),
    radial-gradient(90% 80% at 20% 100%, rgba(53, 230, 242, 0.22), transparent 60%),
    rgba(4, 4, 10, 0.86);
  backdrop-filter: blur(10px);
}

#screen-title {
  background: radial-gradient(120% 110% at 50% -10%, rgba(255, 90, 160, 0.42), transparent 55%),
    radial-gradient(100% 90% at 12% 100%, rgba(53, 230, 242, 0.3), transparent 62%),
    linear-gradient(180deg, #100a1c 0%, #06121a 100%);
  /* A short window cannot show the whole card; scroll the overlay instead of
     clipping the controls and Play button below the viewport. */
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 24px 0;
}

#screen-title .title-wrap {
  /* auto margins centre the card while it fits and collapse to zero when it
     does not, so flex centring cannot hide the top of an oversized card */
  margin: auto;
  flex-shrink: 0;
}

.title-wrap {
  width: min(760px, 88vw);
  text-align: center;
  padding: 34px 30px 30px;
  border-radius: 10px;
  background: rgba(6, 7, 16, 0.55);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.kicker {
  font-size: 10px;
  letter-spacing: 0.42em;
  font-weight: 800;
  color: var(--cyan);
  margin-bottom: 10px;
}

.title-wrap h1 {
  margin: 0;
  font-size: clamp(52px, 11vw, 104px);
  line-height: 0.88;
  letter-spacing: 0.08em;
  font-weight: 900;
  background: linear-gradient(180deg, #fff7e8 20%, #ffc5dd 55%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 18px 60px rgba(255, 47, 125, 0.35);
}

.title-wrap h2 {
  margin: 2px 0 14px;
  font-size: clamp(18px, 3.4vw, 28px);
  letter-spacing: 0.62em;
  font-weight: 800;
  color: #eafcff;
  text-shadow: 0 0 22px rgba(53, 230, 242, 0.65);
}

.tagline {
  margin: 0 auto 20px;
  max-width: 460px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(247, 241, 230, 0.7);
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 7px 18px;
  margin: 0 auto 24px;
  max-width: 620px;
  text-align: left;
}
.controls div {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: rgba(247, 241, 230, 0.76);
}
kbd {
  font-family: "Courier New", monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  min-width: 20px;
  text-align: center;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  color: #fff;
}
.controls span { margin-left: 2px; }

button {
  pointer-events: auto;
  cursor: pointer;
  border: 0;
  padding: 15px 42px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.28em;
  color: #10030a;
  background: linear-gradient(100deg, var(--pink), #ff8ab6 55%, var(--cyan));
  box-shadow: 0 16px 42px rgba(255, 47, 125, 0.38);
  transition: transform 0.12s ease, filter 0.12s ease;
}
button:hover { transform: translateY(-2px); filter: brightness(1.08); }
button:active { transform: translateY(0); }

.hint {
  margin: 16px 0 0;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: rgba(247, 241, 230, 0.44);
}

.hint.save-hint {
  color: var(--cyan);
  opacity: 0.82;
  margin-bottom: 0;
}

.panel {
  text-align: center;
  padding: 36px 44px;
  border-radius: 10px;
  background: rgba(8, 8, 18, 0.8);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.panel h3 {
  margin: 0 0 8px;
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #ff5277;
  text-shadow: 0 0 34px rgba(255, 82, 119, 0.6);
}
.panel p { margin: 0 0 22px; font-size: 13px; color: rgba(247, 241, 230, 0.7); }

/* ---------- touch controls (phones / tablets) ---------- */
#touch { display: none; }
body.touch #touch { display: block; }
body.touch #scene { touch-action: none; }
#stick {
  position: fixed;
  left: 22px;
  bottom: 26px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: rgba(10, 14, 22, 0.34);
  border: 2px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(2px);
  touch-action: none;
  z-index: 20;
}
#stickKnob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(255, 214, 170, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
}
#touchBtns {
  position: fixed;
  right: 18px;
  bottom: 22px;
  display: grid;
  grid-template-columns: repeat(2, 62px);
  gap: 10px;
  z-index: 20;
  touch-action: none;
}
.tbtn {
  width: 62px;
  height: 62px;
  /* the buttons' own size, not the menus' padding (it made them ovals that overlapped) */
  padding: 0;
  min-width: 0;
  box-sizing: border-box;
  border-radius: 50%;
  background: rgba(12, 16, 26, 0.42);
  color: #ffe9c9;
  font: 600 11px/1 system-ui, sans-serif;
  letter-spacing: 0.06em;
  border: 2px solid rgba(255, 255, 255, 0.3);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.tbtn:active { background: rgba(255, 160, 120, 0.55); }
body.touch .hud-bl { bottom: calc(160px / var(--hud)); }
/* on a touch screen the objective sits above the buttons and the subtitle above the stick */
body.touch #objective { bottom: calc(330px / var(--hud)); max-width: calc(70vw / var(--hud)); }
body.touch #subtitle { bottom: 190px; max-width: min(64vw, 520px); }

/* credits and licences */
#screen-credits { z-index: 40; }
.credits { max-width: 640px; max-height: 86vh; overflow-y: auto; text-align: left; }
.credits ul { margin: 0 0 18px; padding-left: 18px; font-size: 12.5px; line-height: 1.6; color: rgba(247, 241, 230, 0.85); }
.credits li span { color: rgba(247, 241, 230, 0.5); }
.credits a, .credits-link { color: #7fe7f2; }

/* ---------- pause menu extras ---------- */
button.ghost {
  padding: 11px 22px;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.pause-row { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.pause-controls { margin-top: 20px; max-height: 46vh; overflow-y: auto; }
.pause-stats {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 18px;
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.06em;
  opacity: 0.85;
}
.pause-stats b { text-align: right; font-weight: 800; }
.pause-controls .controls { margin-bottom: 0; }

/* ---------- full-screen map ---------- */
#screen-map { z-index: 30; padding: 16px; }
.map-wrap {
  display: flex;
  gap: 16px;
  width: 100%;
  height: 100%;
  max-width: 1400px;
}
.map-view {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
}
#bigmap {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 10px;
  background: #4d97c6;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  cursor: crosshair;
  touch-action: none;
}
.map-zoom {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-zoom button {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  border-radius: 8px;
  color: #f7f1e6;
  background: rgba(10, 10, 18, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.map-zoom button:hover { background: rgba(10, 10, 18, 0.92); transform: none; }
.map-group {
  margin: 10px 0 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  color: rgba(247, 241, 230, 0.45);
}
.map-group:first-child { margin-top: 0; }
.map-icon { width: 18px; height: 18px; flex: none; }
.map-side {
  width: 250px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: 10px;
  background: rgba(8, 8, 18, 0.8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.map-side h3 { margin: 0 0 4px; font-size: 26px; letter-spacing: 0.14em; color: var(--cyan); }
.map-side p { margin: 0 0 12px; font-size: 11.5px; color: rgba(247, 241, 230, 0.6); }
.map-legend { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.map-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
  color: var(--paper);
  background: transparent;
  box-shadow: none;
}
.map-item:hover { background: rgba(255, 255, 255, 0.08); transform: none; }
.map-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.map-buttons button { padding: 11px 14px; }
@media (max-width: 760px) {
  .map-wrap { flex-direction: column; }
  .map-view { flex: 1 1 60%; }
  .map-side { width: auto; flex: 1 1 40%; min-height: 0; padding: 12px; }
}

/* ---------- a store's counter menu (gunshop.js) ---------- */
body.shopping #crosshair,
body.shopping #prompt,
body.shopping .hud-tl,
body.shopping .hud-bl,
body.shopping #objective,
body.shopping #touch { display: none !important; }
#shop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  zoom: var(--hud);
}
.shop-panel {
  position: absolute;
  left: 36px;
  top: 40px;
  width: 360px;
  pointer-events: auto;
  background: rgba(8, 9, 14, 0.82);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  animation: shop-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes shop-in {
  from { transform: translateX(-40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.shop-head {
  padding: 26px 20px 20px;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(120deg, #b3121f, #ff3b3b 60%, #ff8a3d);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}
.shop-sub {
  display: flex;
  justify-content: space-between;
  padding: 9px 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #ffc83d;
  background: #000;
}
.shop-list { display: flex; flex-direction: column; }
.shop-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: left;
  color: #f7f1e6;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.shop-row:hover { background: rgba(255, 255, 255, 0.08); transform: none; }
.shop-row b { font-family: 'Courier New', monospace; font-size: 14px; color: #7dff9c; }
.shop-row.owned b { color: rgba(247, 241, 230, 0.45); }
.shop-row.on { background: #f7f1e6; color: #0b0b14; }
.shop-row.on b { color: #1a7a3a; }
.shop-row.on.owned b { color: rgba(11, 11, 20, 0.5); }
.shop-info { padding: 14px 16px 6px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
#shop.flick .shop-info { animation: shop-flick 0.25s ease-out; }
@keyframes shop-flick {
  from { opacity: 0.2; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.shop-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.shop-title b { font-size: 17px; letter-spacing: 0.08em; }
.shop-title span { font-family: 'Courier New', monospace; font-weight: 700; color: #7dff9c; }
.shop-title span.cant { color: #ff6f6f; }
.shop-info p { margin: 8px 0 10px; font-size: 12.5px; line-height: 1.45; color: rgba(247, 241, 230, 0.75); }
.shop-stat { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; margin: 5px 0; font-size: 10px; font-weight: 800; letter-spacing: 0.16em; color: rgba(247, 241, 230, 0.7); }
.shop-stat i { display: block; height: 7px; background: rgba(255, 255, 255, 0.12); }
.shop-stat em { display: block; height: 100%; background: linear-gradient(90deg, #ffc83d, #ff8a3d); transition: width 0.3s ease; }
.shop-buttons { display: flex; gap: 8px; padding: 10px 16px 16px; }
.shop-buttons button { flex: 1; padding: 10px 12px; font-size: 13px; }
.shop-buttons kbd { margin-left: 6px; }
.shop-keys {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 999px;
  background: rgba(6, 6, 14, 0.78);
}
body.touch .shop-keys { display: none; }

/* ---------- exporting and importing a sealed save (saveexport.js) ---------- */
.save-row { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.save-row button { padding: 7px 14px; font-size: 11px; letter-spacing: 0.14em; }
.hint.save-note { margin-top: 8px; min-height: 1em; color: var(--cyan); }
.hint.save-note.bad { color: #ff8a8a; }

/* ---------- small screens: the pause card and the map scroll instead of clipping ---------- */
#screen-pause,
#screen-over,
#screen-map {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
#screen-pause,
#screen-over { padding: 24px 12px; }
/* auto margins centre a card that fits and let one that doesn't scroll from its top */
#screen-pause .panel,
#screen-over .panel,
.map-wrap {
  margin: auto;
  flex-shrink: 0;
  max-width: 100%;
}
.map-side { min-height: 0; overflow-y: auto; }
@media (max-width: 760px) {
  .map-wrap { height: auto; min-height: 100%; }
  .map-view { flex: none; height: 62vh; min-height: 240px; }
  .map-side { flex: none; overflow: visible; }
  .map-legend { flex: none; overflow: visible; }
  /* close and clear right under the map, not after the whole list of places */
  .map-buttons { order: -1; flex-direction: row; margin: 0 0 12px; }
  .map-buttons button { flex: 1; }
}
/* a short, wide window keeps the map full height and scrolls the side panel */
@media (max-height: 560px) and (min-width: 761px) {
  .map-side { padding: 12px; }
  .map-side p { display: none; }
  .map-side h3 { font-size: 20px; }
}
@media (max-width: 480px), (max-height: 520px) {
  .panel { padding: 24px 18px; }
  .panel h3 { font-size: 32px; }
}

/* ---------- the phone (P): Stocks, News, Wallet (market.js) ---------- */
.phone {
  position: fixed; right: 4vw; bottom: 4vh; z-index: 30;
  width: min(300px, 86vw); height: min(560px, 88vh);
  background: #0c0d14; border: 10px solid #1d1f27; border-radius: 34px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 0 0 1px #2a2d38;
  display: flex; flex-direction: column; overflow: hidden; user-select: none;
}
.phone-notch { width: 90px; height: 16px; margin: 0 auto; background: #1d1f27; border-radius: 0 0 12px 12px; }
.phone-bar { display: flex; justify-content: space-between; padding: 4px 16px 8px; font: 700 12px "Courier New", monospace; color: #9fe8ff; }
.phone-cash { color: #7dff9c; }
.phone-body { flex: 1; overflow-y: auto; padding: 4px 12px 12px; background: linear-gradient(180deg, #151826, #0c0d14); }
.phone-body h4 { margin: 6px 0 10px; font-size: 13px; letter-spacing: .12em; color: var(--cyan); }
.phone-body h4 small { display: block; letter-spacing: 0; color: rgba(247,241,230,.6); font-weight: 400; }
.phone-apps { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px 6px; }
.phone-apps button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px; background: rgba(255,255,255,.05); border: 0; border-radius: 18px; color: var(--paper); font-size: 12px; box-shadow: none; }
.phone-apps .ico { width: 44px; height: 44px; border-radius: 12px; display: block; }
.ico-stocks { background: linear-gradient(135deg, #1fd27a, #0c7a52); }
.ico-news { background: linear-gradient(135deg, #f7f1e6, #b8b0a0); }
.ico-bank { background: linear-gradient(135deg, #ffc83d, #d88a1d); }
.ico-close { background: linear-gradient(135deg, #ff5d7a, #9a2040); }
.phone-hint, .phone-note { font-size: 11px; color: rgba(247,241,230,.6); text-align: center; }
.phone-note { color: #ffe08a; min-height: 14px; }
.phone-home { align-self: center; margin: 6px; width: 40px; height: 40px; border-radius: 50%; padding: 0; background: #1d1f27; color: #aaa; box-shadow: none; }
.ticker { display: flex; flex-direction: column; gap: 4px; }
.tick-row { display: grid; grid-template-columns: 48px 70px 1fr 54px; align-items: center; gap: 4px; padding: 6px 8px; background: rgba(255,255,255,.04); border: 0; border-radius: 10px; color: var(--paper); font: 12px "Courier New", monospace; text-align: right; box-shadow: none; position: relative; }
.tick-row b { text-align: left; color: #fff; }
.tick-row em { position: absolute; left: 8px; bottom: 1px; font-size: 9px; font-style: normal; color: #ffe08a; }
.up { color: #4dff9a; }
.down { color: #ff5d6e; }
.big-chart { width: 100%; height: auto; background: rgba(255,255,255,.03); border-radius: 10px; }
.quote { display: flex; align-items: baseline; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.quote b { font: 700 20px "Courier New", monospace; color: #fff; }
.quote span { font-size: 11px; color: rgba(247,241,230,.7); }
.trade-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 4px 0; }
.trade-row button, .phone .back { padding: 7px 2px; font-size: 11px; border-radius: 8px; background: #1fd27a; color: #06150d; box-shadow: none; }
.trade-row button.sell { background: #ff5d6e; color: #1a0508; }
.phone .back { width: 100%; margin-top: 6px; background: rgba(255,255,255,.08); color: var(--paper); }
.news p { font-size: 12px; line-height: 1.4; margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.06); }

/* ---------- the web, on the Byte Club's computers (web.js) ---------- */
.web { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(4,5,10,.82); }
.web-monitor { width: min(1100px, 96vw); height: min(720px, 92vh); display: flex; flex-direction: column; background: #f4f5f7; color: #1b1d24; border: 14px solid #15161c; border-radius: 12px; box-shadow: 0 30px 90px rgba(0,0,0,.7); overflow: hidden; }
.web-chrome { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #dfe2e8; }
.web-dots i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; background: #ff5f57; }
.web-dots i:nth-child(2) { background: #febc2e; }
.web-dots i:nth-child(3) { background: #28c840; }
.web-url { flex: 1; padding: 6px 12px; background: #fff; border-radius: 16px; font: 13px "Courier New", monospace; color: #444; }
.web-cash { font: 700 13px "Courier New", monospace; color: #0c7a52; }
.web-chrome button { padding: 4px 10px; background: #fff; color: #333; border-radius: 6px; box-shadow: none; font-size: 14px; }
.web-tabs { display: flex; gap: 2px; padding: 0 8px; background: #dfe2e8; overflow-x: auto; }
.web-tabs button { padding: 7px 14px; border-radius: 8px 8px 0 0; background: #c9cdd6; color: #333; font-size: 12px; box-shadow: none; white-space: nowrap; }
.web-tabs button.on { background: #f4f5f7; }
.web-page { flex: 1; overflow-y: auto; padding: 22px 28px; }
.web-page header { margin: -22px -28px 18px; padding: 26px 28px; background: linear-gradient(120deg, #ff8a3d, #ff2f7d); color: #fff; }
.web-page header h1 { margin: 0; font-size: 30px; letter-spacing: .06em; }
.web-page header p { margin: 4px 0 0; opacity: .9; }
.site-bikes header { background: linear-gradient(120deg, #2fd0c0, #1f6f8f); }
.site-rides header { background: linear-gradient(120deg, #4f8dff, #1d2a5a); }
.site-homes header { background: linear-gradient(120deg, #3d8a4e, #9be36b); }
.site-stocks header { background: linear-gradient(120deg, #0c7a52, #12131a); }
.web-page header.paper { background: #f7f1e6; color: #1b1d24; border-bottom: 3px double #1b1d24; text-align: center; }
.web-page header.paper h1 { font-family: Georgia, serif; font-size: 42px; letter-spacing: 0; }
.web-page header.love { background: linear-gradient(120deg, #ff5d9e, #c56bff); }
.web-note { margin: 0 0 14px; padding: 10px 14px; background: #fff6d6; border-left: 4px solid #ffc83d; border-radius: 6px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.card { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 6px; }
.card h3 { margin: 4px 0 0; font-size: 16px; }
.card p { margin: 0; font-size: 12px; color: #555; flex: 1; }
.card b { font: 700 18px "Courier New", monospace; color: #0c7a52; }
.card button { padding: 8px; font-size: 13px; border-radius: 8px; background: #1b1d24; color: #fff; box-shadow: none; }
.card button[disabled] { background: #c9cdd6; color: #666; }
.card.soon { opacity: .6; }
.car-pic, .bike-pic, .ride-pic, .home-pic, .avatar { height: 96px; border-radius: 8px; background: linear-gradient(180deg, #bfe3ff 0 55%, #c9bfa6 55%); position: relative; overflow: hidden; }
.car-pic::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: 22%; height: 32%; border-radius: 30px 40px 8px 8px; background: hsl(var(--h) 70% 50%); }
.car-pic::before { content: ""; position: absolute; left: 22%; right: 22%; bottom: 12%; height: 22%; background: radial-gradient(circle at 15% 50%, #222 0 40%, transparent 42%), radial-gradient(circle at 85% 50%, #222 0 40%, transparent 42%); z-index: 1; }
.bike-pic::after, .ride-pic::after, .home-pic::after { position: absolute; inset: 0; display: grid; place-items: center; font-size: 54px; }
.bike-pic::after { content: "\1F6B2"; }
.bike-pic.moto::after { content: "\1F3CD"; }
.ride-pic.boat { background: linear-gradient(180deg, #bfe3ff 0 50%, #2f86c8 50%); }
.ride-pic.boat::after { content: "\1F6E5"; }
.ride-pic.plane::after { content: "\2708"; color: #1d2a5a; }
.home-pic::after { content: "\1F3E0"; }
.avatar { background: linear-gradient(160deg, hsl(var(--h) 80% 70%), hsl(var(--h) 60% 40%)); }
.avatar::after { content: ""; position: absolute; left: 50%; top: 22%; width: 34px; height: 34px; margin-left: -17px; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 46px 0 14px rgba(255,255,255,.85); }
.chat { display: flex; flex-direction: column; }
.chat p { margin: 4px 0; padding: 6px 10px; border-radius: 12px; font-size: 12px; max-width: 90%; flex: none; }
.chat p.me { align-self: flex-end; background: #4f8dff; color: #fff; }
.chat p.them { align-self: flex-start; background: #eceef2; color: #222; }
.stock-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stock-table th, .stock-table td { padding: 8px 6px; border-bottom: 1px solid #e3e5ea; text-align: left; }
.stock-table button { padding: 5px 8px; margin: 1px; font-size: 11px; border-radius: 6px; background: #0c7a52; color: #fff; box-shadow: none; }
.stock-table button.sell { background: #c8423c; }
.search-logo { margin: 60px 0 20px; text-align: center; font: 700 64px Georgia, serif; color: #4f8dff; }
.search-logo span { color: #ff8a3d; }
.search-box { max-width: 520px; margin: 0 auto 30px; padding: 12px 18px; border: 1px solid #ccc; border-radius: 24px; color: #999; }
.search-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; max-width: 820px; margin: 0 auto; }
.search-links button { display: flex; flex-direction: column; align-items: flex-start; padding: 14px; background: #fff; color: #1b1d24; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.search-links span { font: 11px "Courier New", monospace; color: #0c7a52; }
.paper-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; font-family: Georgia, serif; }
.paper-cols h2 { margin: 0 0 8px; font-size: 20px; border-bottom: 1px solid #1b1d24; }
.paper-cols p { font-size: 13px; line-height: 1.5; }
.bike-pic.scoot::after { content: "\1F6F5"; }

/* ---------- the loading screen (loading.js) ---------- */
#screen-loading {
  z-index: 40;
  background: radial-gradient(120% 110% at 50% -10%, rgba(255, 90, 160, 0.5), transparent 55%),
    radial-gradient(90% 80% at 15% 105%, rgba(53, 230, 242, 0.3), transparent 60%),
    #07070d;
  backdrop-filter: none;
}
.load-wrap { width: min(460px, 86vw); text-align: center; }
.load-logo { font: 900 clamp(40px, 9vw, 72px)/0.9 "Helvetica Neue", Arial, sans-serif; letter-spacing: 0.04em; color: var(--pink); text-shadow: 0 0 24px rgba(255, 47, 125, 0.65); font-style: italic; }
.load-logo span { display: block; font-size: 0.42em; letter-spacing: 0.5em; color: var(--cyan); text-shadow: 0 0 18px rgba(53, 230, 242, 0.7); margin-top: 10px; }
.load-bar { margin: 34px 0 14px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.load-fill { width: 0; height: 100%; background: linear-gradient(90deg, var(--pink), var(--gold), var(--cyan)); box-shadow: 0 0 14px rgba(255, 200, 61, 0.7); transition: width 0.15s ease-out; }
.load-line { margin: 0; font: 700 12px "Courier New", monospace; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(247, 241, 230, 0.75); }
/* at boot the bar has no measure: it sweeps */
#screen-loading.boot .load-fill { width: 35%; animation: load-sweep 1.2s ease-in-out infinite; }
@keyframes load-sweep { 0% { transform: translateX(-110%); } 100% { transform: translateX(310%); } }
