:root {
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:#173242;
  background:#f6f4ec;
  font-synthesis:none;
  --blue:#163f59;
  --line:#d7d9cc;
  --green:#345e46;
  --page-gutter:24px;
  --page-max-width:1112px;
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
}
button,input {
  font:inherit;
}
a {
  color:inherit;
  text-underline-offset:4px;
}
button {
  cursor:pointer;
  min-height:46px;
  padding:10px 18px;
  border:1px solid #9baaa9;
  border-radius:5px;
  background:transparent;
  color:var(--blue);
  font-weight:650;
}
button:hover:not(:disabled) {
  background:#e5eade;
}
button:disabled {
  cursor:default;
  opacity:.45;
}
button:focus-visible,a:focus-visible,input:focus-visible {
  outline:3px solid #d27a24;
  outline-offset:4px;
}
[hidden] {
  display:none!important;
}
.page-width {
  width:min(var(--page-max-width),calc(100% - 2 * var(--page-gutter)));
  margin-inline:auto;
}
.app-header {
  position:sticky;
  top:0;
  z-index:5;
  min-height:68px;
  padding:8px 0;
  background:var(--blue);
  color:#fff;
  font-size:13px;
}
.header-inner {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}
.app-header a {
  text-decoration:none;
}
.header-nav {
  display:flex;
  align-items:center;
  gap:20px;
  white-space:nowrap;
}
.brand {
  display:flex;
  align-items:center;
  gap:18px;
  font-weight:700;
  letter-spacing:.03em;
}
.brand-logo {
  display:block;
  width:88px;
  height:auto;
  flex:none;
}
.brand-wordmark {
  display:flex;
  flex-direction:row;
  align-items:baseline;
  min-height:44px;
  padding:8px 0 8px 18px;
  border-left:1px solid #adc5cf;
  gap:14px;
  font-size:24px;
  line-height:1.1;
  letter-spacing:-.025em;
}
.brand-caption {
  font:inherit;
  font-weight:700;
  color:#fff;
}

.brand-wordmark h1 {
  font:inherit;
  font-size:.92em;
  font-weight:400;
  letter-spacing:inherit;
  margin:0;
  white-space:nowrap;
}
main {
  padding:16px 0 0;
}
.eyebrow {
  text-transform:uppercase;
  font-size:11px;
  font-weight:750;
  letter-spacing:.16em;
  margin:0 0 12px;
  color:#547065;
}
.toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:0 0 12px;
  border-bottom:1px solid var(--line);
}
label {
  display:block;
  font-size:12px;
  font-weight:700;
  margin-bottom:8px;
}
.city-controls {
  display:flex;
  gap:10px;
}
.picker {
  position:relative;
  width:270px;
}
input {
  width:100%;
  height:46px;
  padding:10px 14px;
  color:var(--blue);
  background:#fffef9;
  border:1px solid #9baaa9;
  border-radius:5px;
}
.primary {
  color:white;
  background:var(--blue);
  border-color:var(--blue);
  white-space:nowrap;
}
.primary:hover:not(:disabled) {
  background:#275671;
}
.help {
  font-size:11px;
  color:#566967;
  margin:8px 0 0;
}
#cityOptions {
  position:absolute;
  top:100%;
  left:0;
  right:0;
  background:#fffef9;
  z-index:6;
  box-shadow:0 6px 24px #17324226;
  max-height:260px;
  overflow-y:auto;
  padding:6px;
  margin:5px 0 0;
  list-style:none;
  border:1px solid var(--line);
  border-radius:5px;
}
#cityOptions li {
  padding:12px;
  border-radius:3px;
  cursor:pointer;
}
#cityOptions li[aria-selected=true] {
  background:var(--blue);
  color:white;
}
.game-actions {
  display:flex;
  gap:10px;
}
.play-area {
  padding-top:12px;
}
.board-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
}
h2 {
  font:26px/1.2 Georgia,serif;
  margin:0;
}
.stats {
  display:flex;
  gap:36px;
  margin:0;
}
.stats div {
  min-width:62px;
}
.stats dt {
  font-size:11px;
  color:#566967;
  margin-bottom:5px;
}
.stats dd {
  font-size:22px;
  font-variant-numeric:tabular-nums;
  margin:0;
}
.stat-total {
  font-size:17px;
  color:#66796d;
}
.status {
  font-size:12px;
  color:#52685c;
  min-height:18px;
  margin:8px 0 10px;
}
.board {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  width:100%;
}
.card {
  position:relative;
  display:grid;
  place-items:center;
  width:100%;
  height:var(--card-height,120px);
  min-height:0;
  padding:8px;
  border:1px solid #d0d5c5;
  border-radius:6px;
  overflow:hidden;
  box-shadow:0 2px 2px #20352206;
  background:#e7ebdf;
  transition:background .18s,box-shadow .18s;
}
.card:hover:not([aria-disabled=true]) {
  background:#dce3d2;
  box-shadow:0 3px 8px #20352215;
}
.card .card-back {
  position:absolute;
  inset:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid #b8c4b399;
  background:repeating-linear-gradient(35deg,transparent 0 28px,#bdcbb333 29px 30px,transparent 31px 56px),repeating-linear-gradient(125deg,transparent 0 38px,#bdcbb333 39px 40px,transparent 41px 76px);
  color:#829779;
}
.card .compass {
  display:grid;
  place-items:center;
  width:48px;
  height:48px;
  border:1px solid #9fb294;
  border-radius:50%;
  font:28px Georgia,serif;
  background:#e7ebdf;
}
.card img {
  width:100%;
  height:100%;
  min-height:0;
  position:absolute;
  inset:0;
  object-fit:contain;
  padding:6px;
  visibility:hidden;
}
.card.revealed {
  background:#fffdf4;
}
.card.revealed img {
  visibility:visible;
}
.card.revealed .card-back {
  display:none;
}
.card.matched {
  border:2px solid #658268;
  background:#f4f5e9;
}
.card.matched:after {
  content:'✓';
  position:absolute;
  right:5px;
  bottom:5px;
  display:grid;
  place-items:center;
  width:21px;
  height:21px;
  border-radius:50%;
  background:var(--green);
  color:white;
  font-size:12px;
}
.instructions {
  text-align:center;
  font-size:12px;
  color:#536962;
  margin:22px 0 30px;
}
.instructions span {
  color:#657669;
}
.completion {
  margin-top:22px;
  padding:32px 24px;
  border:1px solid #c7b880;
  background:radial-gradient(ellipse at top, #fff5cf, #e8eedd 75%);
  text-align:center;
}
.completion h2 {
  font-size:28px;
}
.completion p:last-child {
  margin-bottom:0;
}
.collection {
  padding:30px 0;
  border-top:1px solid var(--line);
}
.collection>p {
  font-size:13px;
  color:#526266;
}
.collection ul {
  list-style:none;
  padding:0;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px;
}
.collection li {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf4;
}
.collection-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 180px;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: #eeeee2;
}
.collection-preview:focus-visible {
  outline-offset: -4px;
}
.collection-preview img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 200px);
  max-height: 156px;
  object-fit: contain;
}
.collection-zoom {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: #fffef5ee;
  color: var(--blue);
  border: 1px solid #b8c4b3;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 11px;
}
.collection-detail {
  padding: 12px 14px 16px;
}
.collection a {
  font-size:14px;
  line-height:1.5;
  font-weight:600;
}
.collection small {
  display:block;
  color:#526266;
  margin-top:6px;
  line-height:1.5;
}
footer {
  margin-top:10px;
  padding:24px 0;
  display:flex;
  justify-content:space-between;
  gap:15px;
  border-top:1px solid var(--line);
  font-size:11px;
  color:#53665f;
}
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
@media(max-width:700px) {
  :root {
    --page-gutter:12px;
  }
  main {
    padding:12px 0 0;
  }
  .app-header {
    min-height:56px;
    padding:8px 0;
  }
  .header-inner {
    flex-wrap:wrap;
    gap:4px;
  }
  .header-nav {
    width:100%;
    justify-content:flex-end;
    gap:16px;
    font-size:11px;
  }
  .header-nav a {
    display:flex;
    align-items:center;
    min-height:24px;
  }
  .toolbar {
    align-items:stretch;
    flex-direction:column;
    gap:10px;
  }
  .city-controls {
    gap:8px;
  }
  .picker {
    width:auto;
    flex:1;
    min-width:0;
  }
  .city-controls button {
    padding:10px 12px;
  }
  .game-actions button {
    flex:1;
  }
  .stats {
    gap:18px;
  }
  .board {
    gap:6px;
  }
  .card {
    padding:4px;
  }
  .card .card-back {
    inset:4px;
  }
  .card .compass {
    width:34px;
    height:34px;
    font-size:23px;
  }
  .collection ul {
    grid-template-columns:1fr;
  }
  .instructions {
    line-height:1.8;
  }
  .instructions span {
    display:block;
  }
  footer {
    flex-direction:column;
  }
  .brand {
    gap:10px;
  }
  .brand-logo {
    width:52px;
  }
  .brand-wordmark {
    min-height:32px;
    padding:6px 0 6px 10px;
    gap:10px;
    font-size:17px;
  }
  h2 {
    font-size:22px;
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    transition:none!important;
    animation:none!important;
    scroll-behavior:auto!important;
  }
}
/* A shared city basemap sits beneath the original compass and line work. */
.basemap-renderer {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 384px;
  height: 288px;
  pointer-events: none;
}
.card-slot {
  position: relative;
  min-width: 0;
}
.card .card-back {
  isolation: isolate;
}
.city-basemap {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--city-basemap);
  background-size: cover;
  background-position: center;
  filter: grayscale(1);
  opacity: .43;
}
.card .card-back::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(35deg, transparent 0 28px, #8b9b7c55 29px 30px, transparent 31px 56px), repeating-linear-gradient(125deg, transparent 0 38px, #8b9b7c55 39px 40px, transparent 41px 76px);
}
.card .compass {
  background: #e7ebdfe8;
  color: #4f6948;
  box-shadow: 0 0 0 6px #e7ebdf70;
}
.explore-map {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 4px;
  font-size: 26px;
  line-height: 1;
  color: var(--blue);
  background: #fffef5ed;
  border-color: #a3b297;
  box-shadow: 0 1px 4px #17324220;
}
.basemap-credit {
  text-align: center;
  font-size: 10px;
  color: #526266;
  line-height: 1.8;
  margin: -12px 0 24px;
}
#mapDialog {
  width: min(1200px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  border: 1px solid #b8c4b3;
  border-radius: 10px;
  background: #f6f4ec;
  color: #173242;
  padding: 24px;
  box-shadow: 0 16px 80px #10202bb3;
}
#mapDialog::backdrop {
  background: #102b3bcc;
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.dialog-header .eyebrow {
  margin: 0;
}
#mapDialogTitle {
  margin: 12px 0 22px;
  font-size: 26px;
}
.dialog-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(230px, 1fr);
  gap: 24px;
}
#mapViewer {
  display: block;
  width: 100%;
  height: 600px;
  background: #e7ebdf;
  border: 1px solid #bbc8b4;
  border-radius: 5px;
}
.full-map > p {
  font-size: 12px;
  line-height: 1.6;
  color: #526266;
}
.map-metadata {
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.map-metadata dl {
  margin-top: 0;
}
.map-metadata dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 750;
  color: #547065;
  margin-top: 14px;
}
.map-metadata dd {
  margin: 3px 0 0;
}
.map-metadata dt:first-child {
  margin-top: 0;
}
.record-action {
  display: inline-block;
  background: var(--blue);
  color: white;
  padding: 12px 16px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 650;
}
@media (max-width: 700px) {
  #mapDialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 16px;
  }
  .dialog-layout {
    grid-template-columns: 1fr;
  }
  .dialog-header {
    position: sticky;
    top: -16px;
    padding: 10px 0;
    background: #f6f4ec;
    z-index: 1;
  }
  #mapViewer {
    height: 600px;
  }
}

/* Dwell before showing a title; keyboard focus shows it immediately. */
.card-slot:hover, .card-slot:focus-within {
  z-index: 2;
}
.card-title {
  position: absolute;
  z-index: 3;
  left: 0;
  width: max(100%, 220px);
  top: calc(100% - 8px);
  padding: 12px 14px;
  background: #163f59;
  color: #fffef5;
  box-shadow: 0 5px 16px #17324233;
  border-radius: 5px;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  visibility: hidden;
  opacity: 0;
  transition: opacity .12s, visibility 0s;
}
.card-slot:nth-child(4n) .card-title {
  left:auto;
  right:0;
}
.card-slot:nth-last-child(-n+4) .card-title {
  top:auto;
  bottom:calc(100% - 8px);
}
@media(max-width:700px) {
  .card-title {
    width:calc(200% + 6px);
    padding:9px 10px;
  }
  .card-slot:nth-child(4n+3) .card-title {
    left:auto;
    right:0;
  }
  .explore-map, .explore-map:hover:not(:disabled) {
    top:auto;
    bottom:0;
    left:0;
    right:auto;
    border:0;
    box-shadow:none;
    font-size:22px;
    background:radial-gradient(circle, #fffef5 15px, transparent 16px);
  }
}
.card-slot[data-revealed="true"]:hover:not(.title-dismissed) .card-title {
  visibility: visible;
  opacity: 1;
  transition-delay: .45s;
}
.card-slot[data-revealed="true"]:has(:focus-visible):not(.title-dismissed) .card-title {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}
#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}
.victory-stars {
  font-size: 32px;
  letter-spacing: .2em;
  color: #b77b20;
  margin-bottom: 12px;
}
@media (prefers-reduced-motion: reduce) {
  .card-title {
    transition: visibility 0s !important;
  }
  .card-slot[data-revealed="true"]:hover:not(.title-dismissed) .card-title {
    transition-delay: .45s !important;
  }
  .card-slot[data-revealed="true"]:has(:focus-visible):not(.title-dismissed) .card-title {
    transition-delay: 0s !important;
  }
}

#cityOptions [role="option"] { display: flex; flex-direction: column; gap: .2rem; }
#cityOptions [aria-selected="true"] small { color: inherit; }
#cityOptions small { font-size: .76rem; font-weight: 400; color: var(--muted, #5c625e); }
.unavailable { padding: 1.4rem; margin: 1rem 0; border: 1px solid #d8c8aa; border-radius: 12px; background: #f7f0df; }
.unavailable h3 { margin: 0 0 .6rem; }
.unavailable p { max-width: 62ch; line-height: 1.6; }
.suggestions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
