@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Inter:wght@400;500;600;700;800&display=swap");
:root {
  font-family: Inter, Arial, sans-serif;
  color: #fff;
  background: #111322;
  font-synthesis: none;
  color-scheme: dark;
  --lime: #d6fb69;
  --muted: #a1a5b6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
}
button,
select,
input {
  font: inherit;
}
button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}
a {
  color: inherit;
}
button {
  border: 0;
  color: inherit;
  background: #292d40;
}
#scene,
.vignette {
  position: absolute;
  inset: 0;
}
.vignette {
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(10, 13, 24, 0.93),
      rgba(10, 13, 24, 0.5) 48%,
      rgba(10, 13, 24, 0.08)
    ),
    linear-gradient(0deg, rgba(10, 13, 24, 0.7), transparent 40%);
  z-index: 401;
}
body.playing .vignette {
  background: linear-gradient(180deg, #0b0e1d99, transparent 25%);
  z-index: 1;
}
header {
  position: absolute;
  z-index: 900;
  top: 0;
  left: 0;
  right: 0;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
header > * {
  pointer-events: auto;
}
.brand {
  text-decoration: none;
  font-family: "Barlow Condensed", sans-serif;
  font-style: italic;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
}
.brand > span:last-child {
  color: var(--lime);
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  background: var(--lime);
  color: #141725;
  font-size: 33px;
  width: 36px;
  height: 40px;
  clip-path: polygon(20% 0, 100% 0, 80% 100%, 0 100%);
  margin-right: 10px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c3c6cd;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.6px;
}
.live-dot {
  width: 6px;
  height: 6px;
  background: var(--lime);
  border-radius: 50%;
}
.icon-button {
  border: 1px solid #ffffff30;
  border-radius: 50%;
  font-size: 22px;
  width: 36px;
  height: 36px;
  margin-left: 20px;
  background: #14172599;
}
.home-card {
  position: absolute;
  top: 50%;
  left: 7%;
  transform: translateY(-46%);
  width: 465px;
  z-index: 500;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--lime);
}
.eyebrow > span {
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--lime);
  vertical-align: middle;
  margin-right: 8px;
}
h1 {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 78px;
  line-height: 0.98;
  letter-spacing: -1.5px;
  margin: 25px 0;
  font-weight: 800;
}
h1 em {
  font-style: normal;
  color: var(--lime);
}
.intro {
  font-size: 14px;
  line-height: 1.9;
  color: #c2c7d2;
}
.game-spec {
  display: flex;
  gap: 35px;
  margin: 28px 0;
  border-top: 1px solid #ffffff20;
  border-bottom: 1px solid #ffffff20;
  padding: 19px 0;
}
.game-spec div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.game-spec b {
  font-size: 23px;
}
.game-spec span,
.field-label {
  font-size: 9px;
  letter-spacing: 1.4px;
  color: var(--muted);
}
.selectors {
  display: flex;
  gap: 8px;
  margin: 9px 0 12px;
}
select {
  background: #1b2030;
  border: 1px solid #ffffff25;
  color: #eee;
  padding: 12px 9px;
  border-radius: 6px;
  min-width: 0;
  flex: 1;
  font-size: 12px;
}
.primary {
  width: 100%;
  border-radius: 5px;
  padding: 17px;
  background: var(--lime);
  color: #18231a;
  font-size: 12px;
  letter-spacing: 1px;
  font-weight: 800;
  box-shadow: 0 5px 22px #0002;
}
.primary:hover:not(:disabled) {
  background: #e3ff97;
}
.primary span {
  float: right;
  font-size: 20px;
  line-height: 14px;
}
.subtle {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.how {
  display: flex;
  gap: 35px;
  font-size: 11px;
  color: #b1b6c5;
  margin-top: 24px;
}
.hero-label {
  position: absolute;
  right: 7%;
  bottom: 17%;
  z-index: 500;
}
.hero-label h2 {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 42px;
  line-height: 1.08;
  text-shadow: 0 2px 25px #000;
}
.hero-label > span:last-child {
  font-size: 9px;
  letter-spacing: 2px;
  color: #d9dde3;
}
footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 20px 40px;
  z-index: 700;
  font-size: 9px;
  color: #959cac;
  letter-spacing: 0.5px;
}
footer a {
  text-decoration: none;
}
.hud-panel {
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #131728ed;
  padding: 15px 25px;
  border: 1px solid #ffffff24;
  border-radius: 10px;
  z-index: 800;
  min-width: 330px;
}
.hud-panel .eyebrow {
  font-size: 8px;
}
.stats {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  gap: 30px;
}
.stats div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.stats small,
.site-hint small {
  font-size: 8px;
  color: #a1a5b6;
  letter-spacing: 1px;
}
.stats b {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.site-hint {
  position: absolute;
  top: 130px;
  left: 25px;
  z-index: 700;
  display: flex;
  gap: 13px;
  background: #151a2cea;
  border: 1px solid #ffffff22;
  padding: 18px;
  border-radius: 9px;
  max-width: 260px;
}
.site-hint > span {
  color: var(--lime);
  font-size: 32px;
}
.site-hint div {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.site-hint b {
  text-transform: capitalize;
  font-size: 15px;
}
.site-hint div > span {
  font-size: 10px;
  color: #bfc5d0;
  line-height: 1.6;
}
.scene-controls {
  position: absolute;
  left: 25px;
  bottom: 55px;
  z-index: 700;
  display: flex;
  gap: 8px;
}
.scene-controls button {
  background: #14192ded;
  border: 1px solid #ffffff25;
  border-radius: 6px;
  padding: 12px;
  font-size: 11px;
}
#guess-panel {
  position: absolute;
  bottom: 45px;
  right: 25px;
  width: 345px;
  z-index: 800;
  background: #171c2b;
  border: 1px solid #ffffff50;
  padding: 6px;
  border-radius: 10px;
  box-shadow: 0 8px 40px #0005;
  transition: width 0.18s;
}
#guess-panel.expanded {
  width: min(650px, 65vw);
}
.map-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 7px 8px;
  font-size: 9px;
  letter-spacing: 1px;
  color: #d1d7df;
}
.map-heading button {
  background: transparent;
  font-size: 19px;
}
#guess-map {
  height: 220px;
  border-radius: 5px;
  background: #a9cddd;
}
#guess-panel.expanded #guess-map {
  height: 370px;
}
#guess-panel .primary {
  margin-top: 6px;
  padding: 14px;
}
.result-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 440px;
  max-height: 85dvh;
  overflow: auto;
  background: #15192bf5;
  border: 1px solid #ffffff2b;
  padding: 30px;
  border-radius: 13px;
  z-index: 900;
  box-shadow: 0 20px 100px #0008;
  text-align: center;
}
.result-card h2 {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 34px;
  margin: 17px 0 9px;
}
.result-card p {
  font-size: 13px;
  color: #c1c7d5;
  line-height: 1.6;
}
.score-big {
  font-size: 42px;
  font-weight: 800;
  color: var(--lime);
  margin-top: 15px;
}
.score-big small {
  font-size: 13px;
  color: #9099ab;
  font-weight: 400;
}
.score-track {
  height: 5px;
  background: #33394d;
  border-radius: 5px;
  margin: 14px 0 20px;
  overflow: hidden;
}
#score-fill {
  height: 100%;
  background: var(--lime);
}
#metadata {
  font-size: 12px;
  color: #c3c9d5;
  line-height: 1.9;
  padding: 12px 0;
  border-top: 1px solid #ffffff15;
}
#infra-link {
  display: inline-block;
  color: var(--lime);
  font-size: 11px;
  margin: 10px 0 25px;
}
#loading {
  position: absolute;
  inset: 0;
  background: #111625ed;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
#loading p {
  color: #aeb8ca;
  font-size: 13px;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #ffffff20;
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
#notice {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  background: #31293d;
  padding: 15px 23px;
  border: 1px solid #ae859e;
  border-radius: 8px;
  max-width: 600px;
  font-size: 12px;
  line-height: 1.5;
}
dialog {
  background: #181d2e;
  color: #fff;
  border: 1px solid #ffffff30;
  border-radius: 14px;
  max-width: 450px;
  padding: 30px;
}
dialog::backdrop {
  background: #080b18ba;
  backdrop-filter: blur(5px);
}
dialog h2 {
  font-size: 26px;
}
dialog p {
  font-size: 13px;
  color: #c1c7d4;
  line-height: 1.7;
}
dialog label {
  font-size: 12px;
}
dialog input {
  display: block;
  width: 100%;
  background: #0e1322;
  border: 1px solid #ffffff30;
  padding: 12px;
  margin: 10px 0;
  border-radius: 5px;
}
dialog .close {
  float: right;
  background: transparent;
  font-size: 25px;
}
#clear-key {
  background: transparent;
  text-decoration: underline;
  font-size: 11px;
  padding: 15px;
}
.pin {
  border: 3px solid white;
  border-radius: 50%;
  background: #805bdf;
  width: 20px !important;
  height: 20px !important;
  box-shadow: 0 2px 10px #0007;
}
.pin.actual {
  background: #9bc836;
}
.leaflet-control-attribution {
  font-size: 9px !important;
}
.leaflet-container {
  font-family: Inter, Arial, sans-serif;
}
.leaflet-control-zoom a {
  background: #171c2b !important;
  color: white !important;
  border-color: #ffffff20 !important;
}
body:not(.playing) #scene .leaflet-control-zoom {
  display: none;
}
body.playing footer > span:first-child {
  display: none;
}
body.playing footer {
  padding: 12px 25px;
  pointer-events: none;
}
body.playing footer a {
  pointer-events: auto;
}
[hidden] {
  display: none !important;
}
@media (max-width: 800px) {
  header {
    padding: 18px 20px;
  }
  .header-right {
    font-size: 0;
    gap: 0;
  }
  .brand {
    font-size: 22px;
  }
  .home-card {
    left: 7%;
    width: 86%;
    max-width: 465px;
  }
  .hero-label {
    display: none;
  }
  h1 {
    font-size: 66px;
  }
  .hud-panel {
    top: 82px;
    left: 20px;
    transform: none;
    min-width: 260px;
    padding: 12px 18px;
  }
  .site-hint {
    top: 185px;
    left: 20px;
    padding: 12px;
    max-width: 215px;
  }
  .site-hint div > span {
    display: none;
  }
  #guess-panel {
    right: 15px;
    bottom: 38px;
    width: 280px;
  }
  #guess-map {
    height: 170px;
  }
  #guess-panel.expanded {
    width: calc(100% - 30px);
  }
  #guess-panel.expanded #guess-map {
    height: 320px;
  }
  .scene-controls {
    bottom: 315px;
    left: 20px;
  }
  footer {
    padding: 12px 20px;
    font-size: 8px;
  }
  footer > span:first-child {
    display: none;
  }
  .result-card {
    width: calc(100% - 30px);
    max-width: 420px;
    padding: 22px;
  }
  body.playing .header-right {
    display: none;
  }
}
@media (max-height: 740px) {
  .home-card {
    transform: translateY(-43%);
  }
  h1 {
    font-size: 58px;
    margin: 18px 0;
  }
  .game-spec {
    margin: 17px 0;
    padding: 12px 0;
  }
  .how {
    margin-top: 14px;
  }
  .intro {
    font-size: 12px;
  }
  .hero-label {
    bottom: 12%;
  }
}
/* Keep the providers' bottom-edge attribution unobstructed. */
body.playing footer {
  bottom: 21px;
  left: 260px;
  right: auto;
  padding: 4px 8px;
  background: #15192bcc;
  border-radius: 3px;
}
@media (max-width: 800px) {
  body.playing footer {
    display: none;
  }
}

/* Resize the actual Leaflet viewport so pins remain aligned during expansion. */
#guess-panel { transition: width 220ms ease, box-shadow 220ms ease; }
#guess-map { transition: height 220ms ease; }
#guess-panel.hover-expanded { width: min(560px, 55vw); }
#guess-panel.hover-expanded #guess-map { height: min(330px, 48dvh); }
#guess-panel.expanded #guess-map { height: min(370px, 55dvh); }
.map-heading button { min-width: 44px; min-height: 44px; }
@media (prefers-reduced-motion: reduce) {
  #guess-panel, #guess-map { transition: none; }
}
@media (pointer: coarse) {
  button, .icon-button { min-height: 44px; }
  .leaflet-control-zoom a { width: 44px !important; height: 44px !important; line-height: 44px !important; }
}
@media (max-width: 800px), (max-height: 500px) and (orientation: landscape) {
  body:not(.playing) { overflow-y: auto; }
  .home-card { position: relative; top: auto; left: auto; transform: none; width: auto; max-width: 465px; margin: 100px auto 85px; padding: 0 24px; }
  h1 { font-size: clamp(42px, 11vw, 66px); }
  header { padding-top: max(16px, env(safe-area-inset-top)); }
  footer { position: fixed; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  footer > span:first-child { display: inline; }
  body.playing header, body.playing footer { display: none; }
  .hud-panel { transform: none; top: max(8px, env(safe-area-inset-top)); left: 10px; right: 10px; min-width: 0; padding: 10px 14px; }
  .stats { margin-top: 0; justify-content: space-between; gap: 12px; }
  .stats b { font-size: 18px; }
  .site-hint { top: calc(76px + env(safe-area-inset-top)); left: 10px; padding: 8px 12px; max-width: calc(100% - 20px); }
  .site-hint small, .site-hint > span { display: none; }
  .site-hint div > span { display: block; line-height: 1.3; }
  .site-hint div { gap: 3px; }
  #guess-panel { right: 10px; bottom: calc(28px + env(safe-area-inset-bottom)); width: min(310px, calc(100vw - 20px)); }
  #guess-map { height: clamp(100px, 22dvh, 170px); }
  #guess-panel.expanded, #guess-panel.hover-expanded { width: calc(100vw - 20px); }
  #guess-panel.expanded #guess-map, #guess-panel.hover-expanded #guess-map { height: min(45dvh, 360px); }
  .scene-controls { left: 10px; bottom: calc(clamp(100px, 22dvh, 170px) + 150px + env(safe-area-inset-bottom)); }
  .scene-controls button { min-height: 44px; }
  .result-card { max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 20px; }
  dialog { max-width: calc(100vw - 24px); max-height: calc(100dvh - 32px); overflow-y: auto; }
  #loading { padding: 24px; text-align: center; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .home-card { position: relative; top: auto; left: auto; transform: none; margin: 85px auto 65px; }
  body:not(.playing) { overflow-y: auto; }
  .hud-panel { right: auto; width: 44vw; }
  .site-hint { max-width: 43vw; }
  .scene-controls { bottom: calc(28px + env(safe-area-inset-bottom)); }
  #guess-panel { width: 44vw; }
  #guess-map { height: 26dvh; }
  #guess-panel.expanded, #guess-panel.hover-expanded { width: 65vw; }
  #guess-panel.expanded #guess-map, #guess-panel.hover-expanded #guess-map { height: 50dvh; }
}
