@font-face {
  font-family: Nunito;
  src: url(assets/nunito.ttf);
  font-weight: 200 1000;
}
@font-face {
  font-family: Pixel;
  src: url(assets/pixelify.ttf);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f9f4df;
  color: #263d35;
  font:
    650 16px/1.4 Nunito,
    system-ui,
    sans-serif;
}
header {
  background: #254b3f;
  color: #fff5d5;
  border-bottom: 3px solid #d2ad62;
}
header > div,
main,
footer {
  max-width: 1270px;
  margin: auto;
  padding: 0 clamp(12px, 3vw, 32px);
}
header > div,
header nav,
.heading,
.street-sky,
.door-card,
.travel,
.atlas-head,
.rank-tabs,
footer,
.landmarks nav {
  display: flex;
  align-items: center;
  gap: 14px;
}
header > div {
  min-height: 56px;
  justify-content: space-between;
}
header a,
header button {
  color: inherit;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font:
    bold 27px Pixel,
    monospace;
}
.brand img {
  width: 33px;
  height: 33px;
}
.heading {
  justify-content: space-between;
  margin: 18px 0 10px;
}
.heading p,
.door-card p {
  margin: 0;
}
.heading h1 {
  font:
    800 clamp(32px, 4.6vw, 57px)/1.02 Georgia,
    serif;
  margin: 2px 0;
  letter-spacing: -0.05em;
}
.heading p,
.door-card #door-place {
  font-size: 0.9rem;
  color: #5b6543;
  font-weight: 900;
}
a {
  color: #28584c;
}
button,
a.primary {
  font:
    850 0.97rem/1.25 Nunito,
    sans-serif;
  border: 1px solid #918e6e;
  border-radius: 8px;
  padding: 9px 13px;
  background: #fff7d9;
  color: #28483b;
  cursor: pointer;
  min-height: 40px;
}
header nav a,
header nav button {
  font-size: 0.94rem;
  font-weight: 850;
  text-decoration: none;
}
header nav button {
  border: 0;
  background: transparent;
  padding: 0;
  color: #fff3cc;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #e18c23;
  outline-offset: 3px;
}
.street-frame {
  position: relative;
  aspect-ratio: 2.22;
  min-height: 300px;
  max-height: 545px;
  border: 3px solid #456347;
  overflow: hidden;
  border-radius: 17px;
  background: #b4cf98;
  box-shadow: 0 4px #b9b59a;
  isolation: isolate;
  touch-action: manipulation;
}
.street-frame > img {
  position: absolute;
  top: 61%;
  transform: translateY(-61%);
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.5;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}
.street-sky {
  position: absolute;
  top: 11px;
  left: 11px;
  right: 11px;
  justify-content: space-between;
  pointer-events: none;
}
.street-sky span,
.street-sky button {
  background: #fff3cfed;
  border: 1px solid #8d7954;
  color: #3d4734;
  border-radius: 14px;
  padding: 6px 11px;
  font-size: 0.88rem;
  font-weight: 900;
  box-shadow: 0 2px #59483466;
}
.street-sky button {
  pointer-events: auto;
  min-height: 32px;
}
.house-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  z-index: 3;
  text-align: center;
  min-height: 37px;
  min-width: 105px;
  max-width: 29%;
  text-wrap: balance;
  background: #fff1cdef;
  box-shadow: 0 3px 0 #705b40;
  border: 2px solid #826a43;
  font-size: 0.94rem;
  line-height: 1.1;
}
.house-pin::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: calc(50% - 6px);
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background: #ffefc8;
  border-bottom: 2px solid #826a43;
  border-right: 2px solid #826a43;
}
.house-pin[aria-pressed='true'] {
  background: #ffe39a;
  border-color: #6c512b;
}
.house-pin small {
  display: block;
  font: 800 0.75rem Nunito;
  color: #695836;
  margin-top: 2px;
}
.walk-sides {
  position: absolute;
  top: 72%;
  width: 100%;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  padding: 0 5px;
}
.walk-sides button {
  pointer-events: auto;
  background: #294c3de8;
  color: #fff4d3;
  font: bold 29px/1 Georgia;
  padding: 0;
  width: 37px;
  min-height: 38px;
  border: 1px solid #e5cc8d;
}
.walk-sides button:disabled {
  visibility: hidden;
}
.cat {
  position: absolute;
  z-index: 2;
  width: clamp(61px, 8.4vw, 113px);
  aspect-ratio: 1;
  background: url(assets/michi-idle.webp) 0 0/400% 100%;
  transform: translate(-50%, -94%) scaleX(var(--face, 1));
  pointer-events: none;
  filter: drop-shadow(0 3px 2px #37271366);
}
.cat.buddy {
  background-image: url(assets/koko-idle.webp);
  width: clamp(54px, 7.6vw, 100px);
  z-index: 1;
}
.cat.moving {
  background-image: url(assets/michi-walk.webp);
  background-size: 300% 200%;
  aspect-ratio: 24 / 19;
  animation: stride 0.54s step-end infinite;
}
.cat.buddy.moving {
  background-image: url(assets/koko-walk.webp);
}
@keyframes stride {
  0%,100% { background-position: 0 0; }
  16.666% { background-position: 50% 0; }
  33.333% { background-position: 100% 0; }
  50% { background-position: 0 100%; }
  66.666% { background-position: 50% 100%; }
  83.333% { background-position: 100% 100%; }
}
.under-street {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 13px;
  margin: 13px 0 23px;
}
.door-card,
.travel {
  background: #fffaf0;
  border: 1px solid #b9b194;
  border-radius: 10px;
  padding: 12px 15px;
  box-shadow: 0 2px #c8bea1;
}
.door-card h2,
.fieldboard h2,
.landmarks h2 {
  font: 800 1.38rem Georgia;
  margin: 0;
}
.door-icon {
  font-size: 26px;
  color: #a87229;
}
.door-card a.primary {
  margin-left: auto;
  text-decoration: none;
  background: #285a47;
  color: #fff0cb;
  white-space: nowrap;
  box-shadow: 0 3px #173e30;
}
.travel p {
  margin: 0 0 4px;
  font-size: 0.92rem;
}
.travel #bridge-road {
  padding: 1px 0;
  min-height: 24px;
  background: transparent;
  border: 0;
  text-decoration: underline;
}
.pad {
  display: grid;
  grid-template-columns: repeat(3, 34px);
  gap: 2px;
  flex: none;
}
.pad button {
  padding: 0;
  min-height: 31px;
  font-size: 18px;
}
.pad [data-walk='up'] {
  grid-column: 2;
}
.pad [data-walk='left'] {
  grid-column: 1;
}
.fieldboard > div:first-child {
  display: flex;
  gap: 16px;
  align-items: baseline;
  flex-wrap: wrap;
}
.fieldboard p {
  margin: 0;
}
.field-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 24px;
}
.field-cards a {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fffaf0;
  border: 1px solid #bcb398;
  border-radius: 9px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  min-height: 72px;
}
.field-cards img {
  width: 31%;
  align-self: stretch;
  object-fit: cover;
}
.field-cards b,
.field-cards small {
  display: block;
}
.landmarks nav,
footer {
  flex-wrap: wrap;
  gap: 5px 17px;
  font-size: 0.92rem;
}
.landmarks nav {
  margin: 9px 0 22px;
}
.landmarks a {
  padding: 2px 0;
}
footer {
  border-top: 1px solid #b5b097;
  padding-block: 17px;
}
dialog {
  width: min(760px, 94vw);
  max-height: 85dvh;
  border: 2px solid #567254;
  border-radius: 14px;
  background: #fff9e8;
  color: #283d35;
  padding: clamp(15px, 3vw, 26px);
}
dialog::backdrop {
  background: #172c23a8;
}
.atlas-head {
  justify-content: space-between;
}
.atlas-head h2 {
  font: 800 2rem Georgia;
  margin: 0;
}
.rank-tabs {
  flex-wrap: wrap;
  gap: 5px;
}
.rank-tabs button[aria-pressed='true'] {
  background: #305e4b;
  color: #fff1ce;
}
.search {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  font-weight: 800;
}
.search input {
  background: #fffdf4;
  border: 1px solid #9c9e82;
  padding: 10px;
  color: #263d35;
  border-radius: 5px;
  font: inherit;
}
.atlas-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.atlas-list button {
  text-align: left;
  min-width: 0;
}
.atlas-list small,
.atlas-list strong {
  display: block;
}
.atlas-list small {
  font-weight: 650;
}
.skip {
  position: absolute;
  left: -1000px;
}
.skip:focus {
  left: 10px;
  top: 10px;
  z-index: 9;
  background: white;
}
@media (max-width: 750px) {
  .under-street {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .street-frame {
    min-height: 285px;
  }
  .field-cards {
    grid-template-columns: 1fr 1fr;
  }
  .field-cards img {
    max-height: 85px;
  }
}
@media (max-width: 530px) {
  header > div {
    flex-wrap: wrap;
    gap: 3px;
    padding-block: 5px;
  }
  header nav {
    gap: 15px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 23px;
  }
  header nav button,
  header nav a {
    font-size: 0.87rem;
  }
  .street-frame {
    min-height: 0;
    aspect-ratio: 1.55;
  }
  .house-pin {
    min-width: 0;
    max-width: 28%;
    padding: 6px 5px;
    font-size: 0.84rem;
  }
  .house-pin small {
    font-size: 0.67rem;
  }
  .street-sky {
    top: 6px;
    left: 5px;
    right: 5px;
  }
  .street-sky span,
  .street-sky button {
    font-size: 0.74rem;
  }
  .heading {
    margin-top: 12px;
  }
  .heading h1 {
    font-size: 34px;
  }
  .field-cards {
    grid-template-columns: 1fr;
  }
  .atlas-list {
    grid-template-columns: 1fr;
  }
  .door-card,
  .travel {
    padding: 9px;
    gap: 9px;
  }
  .door-icon {
    display: none;
  }
  .door-card h2 {
    font-size: 1.18rem;
  }
  .door-card a.primary {
    white-space: normal;
    max-width: 110px;
    text-align: center;
  }
  .fieldboard > div:first-child {
    gap: 4px;
  }
  .walk-sides button {
    width: 31px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cat.moving {
    animation: none;
  }
}

.house-pin {
  width: clamp(107px, 21%, 200px);
}
@media (max-width: 530px) {
  .house-pin {
    min-height: 31px;
    width: 26%;
    max-width: 26%;
    font-size: 0.82rem;
    line-height: 1.1;
  }
  .house-pin small {
    display: none;
  }
}
