.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0 !important;
}
.ui-icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  vertical-align: middle;
  flex: none;
}
.key-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 23px;
  margin: 0 2px;
  padding: 1px 5px;
  border: 1px solid #c6bca6;
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fffaf0;
  color: #69634e;
  font: 11px/1 var(--ui-font);
  box-shadow: 0 1px 0 #fff inset;
}
.ui-pet-card.pet-card {
  width: 286px;
  bottom: 24px;
  left: 24px;
  padding: 16px 18px 13px;
  display: block;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-cream);
  color: var(--ui-ink);
  box-shadow: var(--ui-panel-shadow);
  font-family: var(--ui-font);
}
.ui-pet-card[hidden] {
  display: none;
}
.pet-card-caption {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--ui-secondary);
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.pet-card-caption .ui-icon {
  width: 13px;
  height: 13px;
  color: #ae8456;
}
[data-pet-badge] {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0;
  padding: 4px 8px;
  border-radius: 20px;
  background: #e9efd9;
  color: #516a40;
}
[data-pet-badge][data-tone="apricot"] {
  background: #f8e7d6;
  color: #936238;
}
[data-pet-badge][data-tone="blue"] {
  background: #e2eff0;
  color: #4b7379;
}
.pet-card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ui-pet-card #petPortrait {
  width: 57px;
  height: 57px;
  flex: none;
  background: #f2e7d4;
  border-radius: 19px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.ui-pet-card #petPortrait svg {
  width: 57px;
  height: 55px;
}
.pet-name-line {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ui-pet-card .pet-detail strong {
  font: 700 19px/1.3 var(--ui-display-font);
  letter-spacing: 1px;
}
.ui-pet-card #rename {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 9px;
  color: #92816b;
  font-size: 14px;
}
.ui-pet-card #petBreed {
  color: var(--ui-secondary);
  font-size: 11px;
  margin-top: 4px;
}
.ui-pet-card #petMood {
  color: var(--ui-secondary);
  font-size: 11px;
  line-height: 1.7;
  margin: 10px 0;
  min-height: 19px;
}
.pet-stats {
  display: grid;
  gap: 8px;
}
.stat-row {
  display: grid;
  grid-template-columns: 28px 1fr 34px;
  align-items: center;
  gap: 9px;
  font-size: 11px;
}
.stat-row label {
  color: var(--ui-secondary);
}
.stat-row output {
  color: #72634f;
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 10px;
}
.stat-track {
  height: 6px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--ui-track);
}
.stat-track i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transform-origin: left;
  background: #d6ac72;
}
[data-stat-fill="happy"] {
  background: #dfa4b6 !important;
}
[data-stat-fill="energy"] {
  background: #a2b983 !important;
}
.pet-card-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px dashed #dfd5bf;
  color: #93816a;
  font-size: 9px;
}
.pet-card-foot .ui-icon {
  height: 12px;
  width: 12px;
}
.pet-card-foot > :last-child {
  margin-left: auto;
  color: #a0927f;
  font-size: 9px;
}
.game-hud-footer {
  bottom: 20px;
  z-index: 5;
}
.ui-action-toolbar.actions {
  gap: 5px;
  padding: 11px 13px 9px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-cream);
  box-shadow: var(--ui-panel-shadow);
  backdrop-filter: none;
}
.ui-action-toolbar button {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  position: relative;
  width: 64px;
  height: 70px;
  border-radius: 17px;
  font: 11px/1.2 var(--ui-font);
  color: #75654f;
}
.ui-action-toolbar button .action-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 39px;
  margin: 0;
  background: #f1e8d8;
  border: 1px solid #e9dcc7;
  border-radius: 14px;
  color: #9a7a52;
}
.ui-action-toolbar .action-icon .ui-icon {
  width: 23px;
  height: 23px;
}
.ui-action-toolbar button[data-action="pet"] .action-icon {
  color: #bd8194;
  background: #f8e9e9;
  border-color: #eed8dd;
}
.ui-action-toolbar button[data-action="feed"] .action-icon {
  color: #b4824a;
  background: #f6ead7;
}
.ui-action-toolbar button[data-action="rest"] .action-icon {
  color: #6e9ea0;
  background: #e8f0ee;
  border-color: #d9e6df;
}
.ui-action-toolbar button.active {
  background: #e8eedc;
  color: var(--ui-forest);
}
.ui-action-toolbar button.active .action-icon {
  background: #dce6c9;
  border-color: #cad8b5;
  color: #657e49;
}
.ui-action-toolbar.actions kbd {
  position: absolute;
  top: -3px;
  right: 3px;
  height: 18px;
  min-width: 18px;
  padding: 1px 3px;
  font-size: 9px;
  margin: 0;
  border-radius: 5px;
  background: #fffaf0;
  z-index: 1;
}
.ui-action-toolbar button .action-label {
  display: block;
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}
.ui-action-toolbar #stopPlay {
  width: 74px;
}
.ui-action-toolbar #stopPlay[hidden],
.ui-action-toolbar #speciesPlay[hidden] {
  display: none;
}
.game-hud-footer .controls {
  margin-top: 11px;
  gap: 14px;
  color: #5e6e50;
  font-size: 10px;
  text-shadow: 0 1px 2px #fff9;
}
.game-hud-footer .controls kbd {
  background: #f9f5e8d9;
}
.ui-interaction-bubble.interaction-hint {
  z-index: 7;
  bottom: auto;
  left: 0;
  top: 0;
  transform: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 7px 13px 7px 7px;
  border: 1px solid #dacdb4;
  border-radius: 15px;
  background: var(--ui-cream);
  color: var(--ui-ink);
  box-shadow:
    0 7px 18px #463a2524,
    inset 0 1px 0 #fff;
  font: 12px/1.4 var(--ui-font);
  max-width: min(280px, calc(100vw - 40px));
}
.ui-interaction-bubble[hidden] {
  display: none;
}
.ui-interaction-bubble::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  left: calc(50% - 4px);
  bottom: -5px;
  transform: rotate(45deg);
  background: var(--ui-cream);
  border-right: 1px solid #dacdb4;
  border-bottom: 1px solid #dacdb4;
}
.ui-interaction-bubble[data-placement^="bottom"]::after {
  top: -5px;
  bottom: auto;
  transform: rotate(225deg);
}
.ui-interaction-bubble .key-hint {
  height: 27px;
  width: 27px;
  background: #e7edd9;
  border-color: #b8c69e;
  color: #5a7243;
  font-size: 12px;
  margin: 0;
  flex: none;
}
.place-label {
  bottom: 141px;
  font-family: var(--ui-font);
  font-size: 10px;
  padding: 8px 15px;
  color: #667151;
}
header .badge,
header .icon-btn,
.side-nav button {
  backdrop-filter: none;
}
.ui-modal {
  border: 1px solid var(--ui-border);
  background: var(--ui-cream);
  box-shadow:
    0 24px 70px #332b2333,
    inset 0 1px #fffdf7;
  color: var(--ui-ink);
}
.ui-modal::backdrop {
  background: #333b3029;
  backdrop-filter: none;
}
.ui-modal :focus-visible,
.ui-pet-card :focus-visible,
.ui-action-toolbar :focus-visible,
.ui-interaction-bubble:focus-visible {
  outline: 3px solid #6e8b50;
  outline-offset: 4px;
}
.ui-dialogue-panel#rangerDialog {
  position: fixed;
  inset: auto 0 157px;
  margin: 0 auto;
  width: min(690px, calc(100vw - 48px));
  padding: 22px 25px 20px;
  overflow: visible;
  border-radius: 26px;
  gap: 22px;
}
.ui-dialogue-panel[open] {
  display: flex;
}
.ui-dialogue-panel::backdrop {
  background: linear-gradient(transparent 35%, #343c2924);
}
.dialogue-portrait {
  width: 77px;
  height: 83px;
  flex: none;
  align-self: center;
  position: relative;
  background: #f3e1c6;
  border-radius: 25px;
  display: grid;
  place-items: center;
}
.fox-ears::before,
.fox-ears::after {
  content: "";
  width: 20px;
  height: 29px;
  border-radius: 10px 10px 2px 2px;
  position: absolute;
  background: #ce8d54;
  top: 12px;
  left: 13px;
  transform: rotate(-20deg);
  border: 5px solid #e9b17b;
}
.fox-ears::after {
  left: auto;
  right: 13px;
  transform: rotate(20deg);
}
.fox-ears::before,
.fox-ears::after {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  border-radius: 0;
  border: 0;
  width: 24px;
  height: 30px;
  background: #d59455;
}
.fox-face {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 43px;
  margin-top: 13px;
  border-radius: 45% 45% 50% 50%;
  background: #fff1da;
  border-top: 12px solid #e9b17b;
  text-align: center;
  color: #76543a;
  font-size: 28px;
  line-height: 22px;
}
.dialogue-content {
  flex: 1;
  min-width: 0;
}
.dialogue-speaker {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 10px var(--ui-font);
  color: #99876f;
}
.dialogue-name {
  font: 700 16px var(--ui-display-font);
  color: #70553b;
}
[data-dialogue-page] {
  margin-left: auto;
  padding-right: 28px;
  font-variant-numeric: tabular-nums;
}
[data-dialogue-text] {
  min-height: 52px;
  margin: 12px 0;
  font: 14px/1.85 var(--ui-font);
  color: #655842;
}
.dialogue-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dialogue-footer > span {
  color: #9d8d75;
  font-size: 10px;
}
.dialogue-footer .primary {
  border-radius: 14px;
  background: #7c9362;
  padding: 10px 20px;
  font-size: 12px;
  letter-spacing: 0;
  box-shadow: 0 3px 0 #637b4f;
}
.ui-dialogue-panel .close {
  top: 10px;
  right: 11px;
  width: 28px;
  height: 28px;
  font-size: 23px;
}
#uiFeedback {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  overflow: hidden;
}
.feedback-mark {
  position: absolute;
  width: 19px;
  height: 19px;
  color: #c88c9f;
  fill: #f4c8d1;
  stroke-width: 1.5;
}
body.photo-mode #uiFeedback {
  visibility: hidden;
}
#firstGuide {
  bottom: auto;
  top: 95px;
  font-size: 11px;
  padding: 8px 12px;
  background: var(--ui-cream);
  border: 1px solid var(--ui-border);
}
@media (max-width: 1100px) {
  .ui-pet-card.pet-card {
    width: 250px;
    left: 18px;
    bottom: 155px;
    padding: 14px 15px 11px;
  }
  .pet-card-foot > :last-child {
    display: none;
  }
}
@media (max-width: 700px) {
  .ui-pet-card.pet-card {
    top: 96px;
    bottom: auto;
    left: 12px;
    width: 212px;
    padding: 11px 13px;
    border-radius: 21px;
  }
  .pet-card-caption {
    margin-bottom: 6px;
    font-size: 9px;
  }
  .ui-pet-card #petPortrait {
    height: 41px;
    width: 41px;
    border-radius: 13px;
  }
  .ui-pet-card #petPortrait svg {
    width: 41px;
    height: 40px;
  }
  .ui-pet-card .pet-detail strong {
    font-size: 16px;
  }
  .ui-pet-card #petBreed {
    font-size: 10px;
  }
  .ui-pet-card #petMood {
    margin: 6px 0;
    font-size: 10px;
    min-height: 0;
  }
  .pet-stats {
    gap: 6px;
  }
  .stat-row {
    grid-template-columns: 25px 1fr 29px;
    gap: 7px;
    font-size: 10px;
  }
  .pet-card-foot {
    display: none;
  }
  [data-pet-badge] {
    font-size: 9px;
    padding: 3px 6px;
  }
  .game-hud-footer {
    bottom: max(12px, env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
  }
  .ui-action-toolbar.actions {
    justify-content: space-between;
    gap: 0;
    padding: 8px 5px 7px;
    border-radius: 22px;
  }
  .ui-action-toolbar button {
    width: calc((100vw - 46px) / 6);
    max-width: 64px;
    height: 62px;
    gap: 5px;
  }
  .ui-action-toolbar button .action-icon {
    width: 35px;
    height: 34px;
    border-radius: 12px;
  }
  .ui-action-toolbar button .action-label {
    font-size: 9px;
  }
  .ui-action-toolbar .action-icon .ui-icon {
    width: 20px;
    height: 20px;
  }
  .ui-action-toolbar.actions kbd {
    font-size: 8px;
    height: 16px;
    min-width: 16px;
    right: 0;
  }
  .ui-action-toolbar #stopPlay {
    width: calc((100vw - 46px) / 6);
  }
  .place-label {
    bottom: 106px;
    font-size: 9px;
  }
  .ui-dialogue-panel#rangerDialog {
    bottom: 118px;
    width: calc(100vw - 24px);
    padding: 18px 15px;
    gap: 12px;
  }
  .dialogue-portrait {
    width: 52px;
    height: 65px;
    border-radius: 19px;
  }
  .fox-face {
    width: 44px;
    font-size: 24px;
  }
  .fox-ears::before {
    left: 4px;
  }
  .fox-ears::after {
    right: 4px;
  }
  .dialogue-speaker {
    flex-wrap: wrap;
    gap: 4px;
  }
  .dialogue-speaker > :nth-child(2) {
    display: none;
  }
  .dialogue-name {
    font-size: 14px;
  }
  [data-dialogue-text] {
    font-size: 12px;
    min-height: 68px;
  }
  .dialogue-footer > span {
    font-size: 9px;
  }
  .dialogue-footer .primary {
    padding: 9px 12px;
    font-size: 11px;
  }
  .touch-pad {
    bottom: 142px;
  }
  #firstGuide {
    top: 67px;
  }
}
@media (max-height: 650px) and (min-width: 701px) {
  .ui-pet-card.pet-card {
    bottom: 21px;
    width: 242px;
    padding: 12px;
  }
  .pet-card-foot {
    display: none;
  }
  .ui-action-toolbar button {
    width: 54px;
    height: 62px;
  }
  .ui-action-toolbar.actions {
    padding: 8px;
  }
  .ui-dialogue-panel#rangerDialog {
    bottom: 135px;
  }
}
@media (max-height: 650px) and (min-width: 701px) and (max-width: 1100px) {
  .ui-pet-card.pet-card {
    bottom: 145px;
  }
}


.place-label {
  bottom: max(16px, env(safe-area-inset-bottom));
  pointer-events: none;
}
.resident-legend {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
  margin: 12px 0;
  gap: 6px;
  font-size: 12px;
}
.resident-legend li {
  display: grid;
  gap: 3px;
  border-radius: 10px;
  background: #eeefdf;
  padding: 8px 10px;
}
.resident-legend li span { color: #52634c; }
@media (max-width: 490px) {
  .resident-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.header-right {
  gap: 8px;
}
.header-right .icon-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 48px;
  height: 48px;
  padding: 2px 0 0;
  border-radius: 14px;
  font-size: 10px;
  line-height: 1.1;
}
.header-right .icon-btn .icon-glyph {
  display: grid;
  place-items: center;
  height: 20px;
  font-size: 18px;
  line-height: 1;
}
.header-right .icon-btn .icon-label {
  display: block;
  font-size: 10px;
  line-height: 1.15;
  white-space: nowrap;
}
.header-right #cameraMode[aria-pressed="true"] {
  background: #e8eedc;
  border-color: #c7d5b2;
  color: var(--ui-forest);
}
@media (max-width: 700px) {
  .header-right {
    gap: 5px;
  }
  .header-right .icon-btn {
    width: 38px;
    height: 40px;
    padding: 1px 0 0;
    border-radius: 11px;
    gap: 1px;
  }
  .header-right .icon-btn .icon-glyph {
    height: 17px;
    font-size: 15px;
  }
  .header-right .icon-btn .icon-label {
    font-size: 9px;
  }
}
@media (max-width: 520px) {
  header {
    align-items: flex-start;
    gap: 6px;
  }
  .header-right {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: calc(4 * 36px + 3 * 4px);
    gap: 4px;
  }
  .header-right #connection {
    order: 2;
    padding: 5px 9px;
  }
  .header-right .icon-btn {
    width: 36px;
    height: 38px;
    border-radius: 10px;
  }
  .header-right .icon-btn .icon-glyph {
    height: 16px;
    font-size: 14px;
  }
  .header-right .icon-btn .icon-label {
    font-size: 9px;
  }
}
@media (min-width: 701px) and (pointer: fine) {
  .side-nav { top: 94px; right: 34px; display: flex; gap: 8px; }
  .side-nav button { width: 48px; height: 48px; border-radius: 14px; }
  .side-nav button span { font-size: 18px; margin-bottom: 1px; }
}
@media (pointer: coarse) {
  .place-label { left: auto; right: 10px; transform: none; }
}