:root {
  --page-bg: #bdbdbd;
  --panel-bg: #d8d8d8;
  --panel-light: #ffffff;
  --panel-shadow: #7a7a7a;
  --ink: #101010;
  --muted: #555555;
  --line: #444444;
  --danger: #111111;
  --title-red: #d71920;
  --title-blue: #2457d6;
  --title-green: #138a2e;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
}

body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    var(--page-bg);
  background-size: 16px 16px;
  color: var(--ink);
  font-family: Arial, Verdana, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: #111111;
}

button,
input,
select,
textarea {
  font: inherit;
}

.scanline {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.08) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.4;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 8px;
  align-items: center;
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 14px 10px 10px;
  text-align: left;
}

.header-alien {
  display: block;
  width: 78px;
  max-width: 100%;
  image-rendering: pixelated;
}

.title-wrap {
  min-width: 0;
}

.site-header h1 {
  margin: 0;
  color: var(--title-red);
  font-family: "Times New Roman", Times, serif;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  text-shadow: 1px 1px 0 #ffffff, 2px 2px 0 var(--title-blue);
}

.subtitle {
  margin: 5px 0 0;
  color: var(--title-green);
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

@media (min-width: 560px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) 84px;
  }

  .header-alien {
    width: 84px;
  }

  .site-header h1 {
    font-size: 32px;
  }

  .subtitle {
    font-size: 19px;
  }
}

@media (max-width: 370px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) 70px;
    gap: 6px;
  }

  .header-alien {
    width: 70px;
  }

  .site-header h1 {
    font-size: 28px;
  }

  .subtitle {
    font-size: 17px;
  }
}

@media (max-width: 330px) {
  .site-header h1 {
    font-size: 25px;
  }

  .subtitle {
    font-size: 16px;
  }
}

.blink {
  animation: blink 1.1s steps(2, end) infinite;
}

@keyframes blink {
  50% {
    opacity: 0.2;
  }
}

.page-shell {
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 0 8px 20px;
}

.page-panel {
  background: var(--panel-bg);
  border-top: 2px solid var(--panel-light);
  border-left: 2px solid var(--panel-light);
  border-right: 2px solid #222222;
  border-bottom: 2px solid #222222;
  box-shadow: 1px 1px 0 var(--panel-shadow);
}

.page-panel {
  min-height: 360px;
}

.hidden {
  display: none !important;
}

.online-strip,
.current-place-box,
.pickup-box,
.map-tools,
.instruction-box,
.page-copy {
  margin: 10px;
  padding: 9px;
  border: 1px dashed var(--line);
  background: #e7e7e7;
}

.online-strip {
  display: flex;
  justify-content: center;
  font-family: "Courier New", monospace;
  font-size: 12px;
  font-weight: bold;
}

.page-copy h2,
.current-place-box h2 {
  margin: 0 0 7px;
  font-size: 20px;
}

.current-place-box h2 {
  font-size: 24px;
  line-height: 1.12;
}

.current-place-box p {
  margin: 7px 0 0;
}

.current-city-line {
  font-weight: bold;
}

.current-copy-button {
  width: 100%;
  min-height: 38px;
  margin-top: 9px;
}

.pickup-box {
  display: grid;
  gap: 6px;
}

.pickup-button {
  width: 100%;
  min-height: 44px;
  font-size: 20px;
  font-weight: bold;
}

.pickup-agreement {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
}

.retro-button:disabled {
  color: #555555;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.site-blocked-copy {
  min-height: 260px;
  display: grid;
  align-content: center;
  text-align: center;
}

.terms-copy h3 {
  margin: 14px 0 5px;
  font-size: 16px;
}

.status-kicker {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: bold;
}

.mono-line {
  font-family: "Courier New", monospace;
  font-size: 13px;
}

.retro-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #222222;
  border-bottom: 2px solid #222222;
  background: #d0d0d0;
  color: #000000;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border-radius: 0;
}

.retro-button:active {
  border-top-color: #222222;
  border-left-color: #222222;
  border-right-color: #ffffff;
  border-bottom-color: #ffffff;
}

.activity-coords {
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.map-box {
  width: calc(100% - 20px);
  min-width: 0;
  height: 310px;
  margin: 10px;
  border-top: 2px solid #777777;
  border-left: 2px solid #777777;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  background: #c7c7c7;
}

.map-box.tall {
  height: 370px;
}

.leaflet-container {
  font-family: Arial, Verdana, sans-serif;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.12) 1px, transparent 1px),
    #c7c7c7;
  background-size: 32px 32px;
}

.leaflet-tile {
  filter: grayscale(1) contrast(0.95);
}

.leaflet-control-attribution {
  font-size: 10px;
}

.activity-pin-icon {
  border: 0;
  background: transparent;
}

.activity-map-pin {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid #222222;
  border-radius: 50% 50% 50% 0;
  background-color: var(--activity-pin-color, #006dff);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
  transform: rotate(-45deg);
}

.activity-map-pin.first {
  background-color: #d71920 !important;
}

.activity-map-pin.visited {
  background-color: #006dff !important;
}

.route-arrow-icon {
  border: 0;
  background: transparent;
}

.route-arrow {
  display: block;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 14px solid #006dff;
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.35));
  transform-origin: 50% 50%;
}

.activity-popup,
.suggestion-popup {
  min-width: 220px;
  color: #000000;
}

.activity-popup h3,
.suggestion-popup h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.activity-popup p,
.suggestion-popup p {
  margin: 6px 0;
}

.activity-popup-meta,
.suggestion-popup-place {
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.popup-coordinates {
  margin-bottom: 0;
}

.pickup-code {
  margin: 10px 0;
  padding: 8px;
  border: 1px dashed #444444;
  background: #ffffff;
  font-family: "Courier New", monospace;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  letter-spacing: 0;
}

.retro-dialog {
  width: min(calc(100% - 20px), 380px);
  max-width: 380px;
  max-height: calc(100vh - 24px);
  padding: 10px;
  overflow: auto;
  color: #000000;
  background: var(--panel-bg);
  border-top: 2px solid var(--panel-light);
  border-left: 2px solid var(--panel-light);
  border-right: 2px solid #222222;
  border-bottom: 2px solid #222222;
  box-shadow: 1px 1px 0 var(--panel-shadow);
}

.retro-dialog::backdrop {
  background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.35) 0 4px, rgba(0, 0, 0, 0.5) 4px 8px);
}

.map-popup-content {
  width: 100%;
}

.map-popup-copy,
.map-popup-close,
.map-suggestion-form .retro-button {
  width: 100%;
  min-height: 42px;
  font-size: 18px;
}

.map-popup-copy {
  margin-top: 10px;
}

.map-popup-close {
  margin-top: 8px;
  font-size: 18px;
}

.tile-warning {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 26px;
  z-index: 500;
  padding: 6px;
  border: 1px dashed #444444;
  background: rgba(231, 231, 231, 0.94);
  font-family: "Courier New", monospace;
  font-size: 12px;
  text-align: center;
}

.plain-map-error {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 18px;
  text-align: center;
  font-family: "Courier New", monospace;
}

.plain-map-error span {
  max-width: 28em;
  font-size: 13px;
}

.map-tools label,
.map-suggestion-form label {
  display: grid;
  gap: 4px;
  font-weight: bold;
}

.map-tools select,
.map-suggestion-form input,
.map-suggestion-form select,
.map-suggestion-form textarea {
  width: 100%;
  min-height: 32px;
  padding: 5px;
  border-top: 2px solid #777777;
  border-left: 2px solid #777777;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  background: #ffffff;
  color: #000000;
  border-radius: 0;
}

.map-suggestion-form textarea {
  min-height: 72px;
  resize: vertical;
}

.map-suggestion-form {
  display: grid;
  gap: 8px;
}

.map-suggestion-form .retro-button {
  width: 100%;
}

.map-suggestion-form .form-message {
  min-height: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-suggestion-form .form-message:empty {
  display: none;
}

.instruction-box p {
  margin: 0 0 5px;
}

.instruction-box p:last-child {
  margin-bottom: 0;
}

.form-message {
  min-height: 20px;
  margin: 0;
  font-family: "Courier New", monospace;
}

#map-activity-status:empty {
  display: none;
}

.site-footer {
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 10px 8px 20px;
  color: #222222;
  font-size: 12px;
  text-align: center;
}

@media (min-width: 620px) {
  .site-header {
    grid-template-columns: max-content 112px;
    width: min(100%, 620px);
    gap: 8px;
    justify-content: center;
    padding-top: 22px;
  }

  .header-alien {
    width: 112px;
  }

  .site-header h1 {
    font-size: 48px;
  }

  .subtitle {
    font-size: 20px;
  }
}
