@font-face {
  font-family: 'Young Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/young-serif-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Young Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/young-serif-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/fonts/bricolage-grotesque-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/fonts/bricolage-grotesque-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --blue: #2430c8;
  --blue-deep: #171f8f;
  --blue-land: #3b4be6;
  --yellow: #ffd23f;
  --ink: #10155c;
  --white: #ffffff;
  --soft: rgba(255, 255, 255, 0.78);
  --line: rgba(255, 255, 255, 0.32);
  --serif: 'Young Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --col: 42rem;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--blue);
  color: var(--white);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 4px;
}
[hidden] {
  display: none !important;
}

/* ---------- Header ---------- */
.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: calc(var(--col) + 3rem);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0;
}
.mark {
  font-family: var(--serif);
  font-size: 1.5rem;
  text-decoration: none;
}
.top nav {
  display: flex;
  gap: 1.25rem;
}
.top nav a {
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.top nav a:hover,
.top nav a[aria-current='page'] {
  border-bottom-color: var(--yellow);
}

/* ---------- Layout ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: calc(var(--col) + 3rem);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}
main:focus {
  outline: none;
}
body.wide main,
body.wide .top,
body.wide footer {
  max-width: 72rem;
}
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 6.2vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  text-wrap: balance;
}
h2 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.125rem;
  margin: 2.75rem 0 0.75rem;
}
p {
  margin: 0 0 1rem;
  max-width: 36rem;
}
.lead {
  color: var(--soft);
  font-size: 1.125rem;
}
.note {
  color: var(--soft);
  font-size: 0.9375rem;
}
.error {
  background: var(--white);
  color: #a3122d;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  margin: 1rem 0;
}

/* ---------- Fields ---------- */
.field {
  position: relative;
  margin-top: 2rem;
}
.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.field .hint {
  font-weight: 400;
  color: var(--soft);
}
input[type='text'] {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--white);
  border-radius: 0;
  color: var(--white);
  font: inherit;
  font-size: 1.375rem;
  padding: 0.5rem 0;
}
input[type='text']::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
input[type='text']:focus {
  outline: none;
  border-bottom-color: var(--yellow);
  box-shadow: 0 2px 0 var(--yellow);
}
input[type='text']:disabled {
  opacity: 0.5;
}

.suggest {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: 100%;
  margin: 0.375rem 0 0;
  padding: 0.375rem;
  list-style: none;
  background: var(--white);
  color: var(--ink);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(8, 12, 70, 0.45);
  max-height: 22rem;
  overflow: auto;
}
.suggest li {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
}
.suggest li[aria-selected='true'],
.suggest li:hover {
  background: var(--yellow);
}
.suggest .n {
  font-weight: 700;
  display: block;
}
.suggest .d {
  font-size: 0.875rem;
  opacity: 0.75;
  display: block;
}
.suggest .empty {
  cursor: default;
  opacity: 0.75;
}
.suggest .empty:hover {
  background: none;
}

/* ---------- The list of names: the one loud thing on the page ---------- */
.names {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
}
.names li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.names .who {
  min-width: 0;
}
.names .name {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  line-height: 1.12;
  display: block;
  overflow-wrap: anywhere;
}
.names .sub {
  display: block;
  color: var(--soft);
  font-size: 0.9375rem;
  margin-top: 0.125rem;
}
.names .sub.rare {
  color: var(--yellow);
  font-weight: 600;
}
.names button.remove {
  flex: none;
  background: none;
  border: 0;
  color: var(--soft);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.25rem;
}
.names button.remove:hover {
  color: var(--white);
}
.count {
  color: var(--soft);
  font-size: 0.9375rem;
  margin-top: 0.75rem;
}

.chosen-city {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1.375rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid var(--white);
}
.chosen-city button {
  background: none;
  border: 0;
  color: var(--soft);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Buttons ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
.btn {
  appearance: none;
  border: 2px solid var(--white);
  background: transparent;
  color: var(--white);
  font: inherit;
  font-weight: 700;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.btn.primary {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--ink);
}
.btn.primary:hover {
  background: #ffe07a;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--soft);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Chips (people you might also like) ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.chips a,
.chips span {
  display: inline-block;
  background: var(--blue-deep);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  text-decoration: none;
}
.chips a:hover {
  background: var(--ink);
}
.chips small {
  color: var(--soft);
  margin-left: 0.35rem;
}

/* ---------- Compare ---------- */
.score {
  font-family: var(--serif);
  font-size: clamp(3rem, 12vw, 5.5rem);
  line-height: 1;
  color: var(--yellow);
  margin: 0.5rem 0 0.25rem;
}
.score span {
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
}
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.plain {
  list-style: none;
  padding: 0;
  margin: 0;
}
.plain li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line);
}
.plain.big li {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.2;
  padding: 0.45rem 0;
}

/* ---------- Map ---------- */
.mapwrap {
  background: var(--blue-deep);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 1.5rem;
  touch-action: none;
}
.mapwrap svg {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
}
.mapwrap .land {
  fill: var(--blue-land);
  stroke: var(--blue-deep);
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
}
.mapwrap .bubble {
  fill: var(--yellow);
  fill-opacity: 0.88;
  stroke: var(--ink);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
}
.mapwrap .bubble:hover,
.mapwrap .bubble.on {
  fill: var(--white);
  fill-opacity: 1;
}
.mapgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-top: 0.5rem;
}
.rank {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: r;
}
.rank li {
  counter-increment: r;
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}
.rank li::before {
  content: counter(r);
  color: var(--yellow);
  font-weight: 700;
  min-width: 1.5rem;
}
.rank .nm {
  flex: 1;
  min-width: 0;
}
.rank .ct {
  color: var(--soft);
  font-size: 0.9375rem;
  white-space: nowrap;
}

/* ---------- Footer ---------- */
footer {
  width: 100%;
  max-width: calc(var(--col) + 3rem);
  margin: 0 auto;
  padding: 1.5rem;
  color: var(--soft);
  font-size: 0.875rem;
  border-top: 1px solid var(--line);
}
footer p {
  max-width: none;
  margin: 0 0 0.5rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(8, 12, 70, 0.45);
  z-index: 20;
}

@media (max-width: 640px) {
  .cols,
  .mapgrid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  main {
    padding-top: 1.75rem;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .names li.new {
    animation: land 0.35s ease-out;
  }
  @keyframes land {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
  }
}
