:root {
  --brown: #683714;
  --brown-soft: #8a5522;
  --cream: #fff6d8;
  --line: #e2bd7f;
  --shadow: 0 16px 35px rgba(108, 58, 22, .22);
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--brown);
  background: #ffe5c6;
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

button {
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  background: transparent;
  cursor: pointer;
}

.viewport {
  position: relative;
  display: block;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #ffe8ca;
}

.scene {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1456px;
  height: 1024px;
  overflow: hidden;
  background-image: url("./assets/backgrounds/menu-room.png");
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: 0 0 55px rgba(106, 62, 20, .18);
  transform: translate(-50%, -50%) scale(var(--scene-scale, 1));
  transform-origin: center center;
}

.scene::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 17% 9%, rgba(255, 255, 255, .7), transparent 17%),
    radial-gradient(circle at 74% 11%, rgba(255, 248, 196, .36), transparent 25%),
    linear-gradient(90deg, rgba(255, 255, 255, .28), transparent 16%, transparent 84%, rgba(255, 255, 255, .25));
}

.panel {
  position: absolute;
}

.asset-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.main-panel {
  top: 162px;
  left: 153px;
  width: 824px;
  height: 560px;
  z-index: 3;
}

.guide-panel {
  top: 743px;
  left: 252px;
  width: 705px;
  height: 278px;
  z-index: 2;
}

.pet-list-panel {
  top: 161px;
  right: 14px;
  width: 440px;
  height: 861px;
  z-index: 4;
}

.ribbon {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  filter: drop-shadow(0 6px 5px rgba(111, 51, 24, .22));
}

.ribbon-label {
  position: absolute;
  z-index: 7;
  margin: 0;
  color: #fff;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-shadow:
    0 3px 0 rgba(122, 42, 42, .28),
    0 0 8px rgba(255, 255, 255, .6);
  pointer-events: none;
}

.ribbon-purple {
  top: 14px;
  left: 125px;
  width: 330px;
}

.top-ribbon-label {
  top: 35px;
  left: 153px;
  width: 276px;
  font-size: 25px;
}

.guide-ribbon {
  top: -22px;
  left: 165px;
  width: 390px;
}

.guide-ribbon-label {
  top: 8px;
  left: 165px;
  width: 390px;
  font-size: 25px;
}

.list-ribbon {
  top: 35px;
  left: 54px;
  width: 352px;
}

.list-ribbon-label {
  top: 63px;
  left: 92px;
  width: 276px;
  font-size: 29px;
}

.hero-pet-card {
  position: absolute;
  top: 82px;
  left: 95px;
  width: 328px;
  height: 456px;
}

.pet-card-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.pet-room {
  position: absolute;
  top: 31px;
  left: 31px;
  width: 266px;
  height: 350px;
  overflow: hidden;
  z-index: 1;
  border-radius: 26px;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 246, 190, .85) 0 5px, transparent 6px),
    radial-gradient(circle at 28% 22%, rgba(255, 246, 190, .85) 0 5px, transparent 6px),
    radial-gradient(circle at 58% 30%, rgba(255, 246, 190, .85) 0 4px, transparent 5px),
    linear-gradient(#86d8e8 0 56%, #f4cf74 56% 100%);
}

.pet-room::before {
  position: absolute;
  right: 14px;
  bottom: 42px;
  width: 105px;
  height: 120px;
  border-radius: 54px 54px 20px 20px;
  content: "";
  background: #dbbc82;
  box-shadow: inset 22px 15px 0 #f4ddac;
}

.wheel {
  position: absolute;
  top: 59px;
  left: -18px;
  width: 112px;
  height: 180px;
  border: 10px solid #69c777;
  border-radius: 50%;
  opacity: .78;
  background: repeating-conic-gradient(from 8deg, transparent 0 18deg, rgba(55, 145, 80, .42) 19deg 23deg);
}

.wheel::after {
  position: absolute;
  top: 72px;
  left: 40px;
  width: 22px;
  height: 22px;
  content: "";
  border-radius: 50%;
  background: #f4bd4b;
  box-shadow: 0 0 0 4px rgba(117, 100, 45, .22);
}

.bedding {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 142px;
  background:
    radial-gradient(circle at 20% 40%, #f7df95 0 3px, transparent 4px),
    radial-gradient(circle at 56% 30%, #f7df95 0 3px, transparent 4px),
    radial-gradient(circle at 78% 70%, #f7df95 0 3px, transparent 4px),
    #ecc46d;
}

.selected-pet {
  position: absolute;
  left: 42px;
  bottom: 54px;
  z-index: 2;
  width: 190px;
  height: 230px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 7px 6px rgba(116, 65, 25, .22));
}

.food-bowl {
  position: absolute;
  right: 8px;
  bottom: 13px;
  z-index: 2;
  width: 108px;
  height: 50px;
  border-radius: 50%;
  background: #f59aa0;
  box-shadow: inset 0 -11px 0 #d86d77, 0 5px 8px rgba(96, 45, 25, .18);
}

.food-bowl::after {
  position: absolute;
  top: 10px;
  left: 23px;
  width: 60px;
  height: 22px;
  content: "";
  border-radius: 50%;
  background:
    radial-gradient(circle at 15px 10px, #9a7034 0 7px, transparent 8px),
    radial-gradient(circle at 31px 8px, #9a7034 0 7px, transparent 8px),
    radial-gradient(circle at 45px 12px, #9a7034 0 7px, transparent 8px);
}

.pet-card-name {
  position: absolute;
  right: 45px;
  bottom: 16px;
  left: 45px;
  z-index: 4;
  margin: 0;
  overflow: hidden;
  color: #7c3d14;
  font-size: 33px;
  font-weight: 900;
  line-height: 54px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carousel-arrow {
  position: absolute;
  z-index: 8;
  width: 92px;
  height: 110px;
  transition: transform .16s ease;
}

.carousel-arrow:hover {
  transform: translateY(-2px) scale(1.04);
}

.carousel-arrow:active {
  transform: scale(.96);
}

.carousel-arrow.left {
  top: 255px;
  left: 42px;
}

.carousel-arrow.right {
  top: 255px;
  left: 395px;
}

.carousel-arrow img {
  width: 100%;
  height: 100%;
}

.pet-detail {
  position: absolute;
  top: 68px;
  right: 42px;
  width: 320px;
}

.field {
  position: relative;
  min-height: 82px;
  padding: 0 62px 8px 3px;
  border-bottom: 2px dashed rgba(190, 147, 86, .38);
}

.field + .field {
  padding-top: 8px;
}

.label {
  display: block;
  margin-bottom: 2px;
  font-size: 22px;
  font-weight: 900;
}

.name-field strong {
  display: block;
  font-size: 35px;
  line-height: 1.15;
}

.metric-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-row img {
  width: 38px;
  height: 38px;
}

.metric-row strong {
  font-size: 36px;
  line-height: 1;
}

.metric-row small {
  margin-left: 6px;
  color: #5f391c;
  font-size: 24px;
  font-weight: 900;
}

.info-button {
  position: absolute;
  right: 3px;
  bottom: 17px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  filter: drop-shadow(0 3px 3px rgba(102, 60, 21, .2));
  transition: transform .16s ease;
}

.info-button:hover,
.info-button:focus-visible {
  outline: none;
  transform: scale(1.07);
}

.info-button img {
  width: 100%;
  height: 100%;
}

.description {
  min-height: 122px;
  margin: 14px 0 12px;
  padding: 15px 17px;
  color: #673714;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.42;
  background: rgba(255, 244, 207, .73);
  border: 2px solid rgba(219, 163, 83, .46);
  border-radius: 18px;
}

.raise-button {
  display: flex;
  width: 310px;
  height: 78px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  font-size: 35px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 4px 0 rgba(39, 105, 16, .28);
  background-image: url("./assets/ui/primary-button-green.svg");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  filter: drop-shadow(0 8px 5px rgba(76, 98, 28, .2));
  transition: transform .16s ease, filter .16s ease;
}

.raise-button:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 11px 6px rgba(76, 98, 28, .22));
}

.raise-button:active {
  transform: translateY(2px) scale(.98);
}

.raise-button img {
  width: 42px;
  height: 42px;
}

.nav-menu {
  position: absolute;
  top: 666px;
  left: 18px;
  z-index: 7;
  display: grid;
  width: 200px;
  gap: 10px;
}

.nav-button {
  display: flex;
  width: 200px;
  height: 80px;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 24px;
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 3px 0 rgba(83, 41, 22, .23);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  transition: transform .16s ease, filter .16s ease;
}

.nav-button[data-skin="pink"] {
  background-image: url("./assets/ui/nav-button-pink.svg");
}

.nav-button[data-skin="yellow"] {
  background-image: url("./assets/ui/nav-button-yellow.svg");
}

.nav-button[data-skin="blue"] {
  background-image: url("./assets/ui/nav-button-blue.svg");
}

.nav-button[data-skin="purple"] {
  background-image: url("./assets/ui/nav-button-purple.svg");
}

.nav-button:hover,
.nav-button.active {
  transform: translateX(3px) scale(1.03);
  filter: brightness(1.04) drop-shadow(0 6px 4px rgba(94, 50, 21, .16));
}

.nav-button img {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}

.guide-panel .asset-panel {
  filter: drop-shadow(0 12px 12px rgba(91, 52, 22, .16));
}

.thought {
  position: absolute;
  top: 42px;
  left: 70px;
  width: 162px;
  height: 104px;
}

.thought::before {
  position: absolute;
  inset: 4px 0 0;
  content: "";
  border: 4px solid #edc38e;
  border-radius: 55% 42% 50% 46%;
  background: #fff7de;
}

.thought::after {
  position: absolute;
  right: 8px;
  bottom: 6px;
  width: 17px;
  height: 17px;
  content: "";
  border-radius: 50%;
  background: #fff7de;
  box-shadow: 24px 13px 0 -3px #fff7de;
}

.thought > img {
  position: absolute;
  right: 35px;
  bottom: 18px;
  z-index: 2;
  width: 76px;
  height: 76px;
  border-radius: 50%;
}

.heart-bubble {
  display: none;
}

.heart-bubble img {
  width: 100%;
  height: 100%;
}

.guide-copy {
  position: absolute;
  top: 56px;
  left: 260px;
  width: 390px;
}

.guide-copy p {
  margin: 0;
  font-size: 23px;
  font-weight: 900;
  line-height: 1.42;
}

.tip-grid {
  position: absolute;
  right: 36px;
  bottom: 13px;
  left: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: 112px;
  overflow: hidden;
  border-top: 2px dashed rgba(205, 158, 92, .38);
}

.tip-grid article {
  position: relative;
  min-width: 0;
  padding: 16px 10px 0 49px;
  border-right: 2px solid rgba(205, 158, 92, .27);
}

.tip-grid article:last-child {
  border-right: 0;
  padding-right: 4px;
}

.tip-grid img {
  position: absolute;
  top: 17px;
  left: 9px;
  width: 36px;
  height: 36px;
}

.tip-grid h3 {
  margin: 3px 0 9px;
  color: #984b27;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.tip-grid p {
  margin: 0;
  color: #6d3d1a;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.36;
  word-break: keep-all;
  overflow-wrap: normal;
}

.pet-list {
  position: absolute;
  top: 132px;
  right: 28px;
  left: 28px;
  display: grid;
  max-height: 704px;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 4px 8px 0;
  scrollbar-color: #d99a3e rgba(255, 244, 207, .5);
  scrollbar-width: thin;
}

.pet-list::-webkit-scrollbar {
  width: 10px;
}

.pet-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 244, 207, .55);
}

.pet-list::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 244, 207, .8);
  border-radius: 999px;
  background: #d99a3e;
}

.pet-row {
  position: relative;
  display: grid;
  width: 384px;
  height: 122px;
  grid-template-columns: 112px 1fr 30px;
  align-items: center;
  padding: 14px 20px;
  text-align: left;
  background-image: url("./assets/ui/list-item-frame.svg");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  transition: transform .14s ease, filter .14s ease;
}

.pet-row:hover,
.pet-row.selected {
  transform: translateX(-4px);
  filter: brightness(1.04) drop-shadow(0 7px 5px rgba(95, 53, 23, .14));
}

.pet-row.locked {
  cursor: default;
  filter: saturate(.45);
}

.pet-row img.portrait {
  width: 88px;
  height: 82px;
  margin-left: -4px;
  border-radius: 14px;
  object-fit: cover;
  justify-self: center;
}

.pet-row-body {
  min-width: 0;
}

.pet-row-name {
  margin: 0 0 8px;
  overflow: hidden;
  color: #71370f;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-row-name.long-name {
  font-size: 19px;
}

.pet-row-level {
  margin: 0 0 7px;
  color: #603417;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
}

.mini-meter {
  display: grid;
  grid-template-columns: 25px 1fr;
  align-items: center;
  gap: 6px;
}

.mini-meter img {
  width: 25px;
  height: 25px;
}

.meter-track {
  position: relative;
  height: 19px;
  overflow: hidden;
  border: 2px solid #d6a969;
  border-radius: 999px;
  background: #fff1ce;
  box-shadow: inset 0 2px 3px rgba(111, 61, 22, .13);
}

.meter-fill {
  position: absolute;
  inset: 2px auto 2px 2px;
  min-width: 10px;
  border-radius: 999px;
  background: linear-gradient(#a8f736, #49bd17);
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, .42);
}

.favorite-star {
  align-self: start;
  width: 32px;
  height: 32px;
}

.locked-label {
  color: #6d645c;
  font-size: 25px;
  font-weight: 900;
  line-height: 1.45;
}

.popover {
  position: absolute;
  z-index: 20;
  top: 360px;
  left: 602px;
  max-width: 295px;
  padding: 14px 18px;
  color: #673714;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.45;
  background: rgba(255, 247, 219, .97);
  border: 3px solid #d79b4d;
  border-radius: 18px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease;
}

.popover.visible {
  opacity: 1;
  transform: translateY(0);
}

.viewport.room-mode .scene {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(var(--scene-scale, 1.02));
}

.care-room-view {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  background-color: #f6c9a3;
  background-image: url("./assets/backgrounds/pet-room.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
}

.viewport.room-mode .care-room-view {
  opacity: 1;
  pointer-events: auto;
}

.care-room-topbar {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  z-index: 1000;
  display: flex;
  align-items: center;
}

.care-room-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.room-pet {
  position: absolute;
  width: clamp(150px, 19vw, 260px);
  aspect-ratio: 1;
  pointer-events: none;
  transform: translate(-50%, -100%);
  will-change: left, top;
}

.room-pet-shadow {
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 3%;
  height: 12%;
  border-radius: 50%;
  background: rgba(94, 56, 32, .2);
  filter: blur(2px);
  transform: scaleX(1.08);
}

.room-pet-sprite {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 1000% 100%;
  filter: drop-shadow(0 12px 9px rgba(86, 45, 25, .2));
  transform: scaleX(var(--pet-facing, 1));
  transform-origin: center bottom;
  animation: roomPetWalkFrames .82s steps(9) infinite;
  will-change: background-position, transform;
}

.room-pet-sprite.sprite-sheet-mode {
  background-size: calc(var(--room-sprite-columns, 8) * 100%) calc(var(--room-sprite-rows, 9) * 100%);
  animation: none;
}

@keyframes roomPetWalkFrames {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 100% 0;
  }
}

.room-icon-button {
  filter: drop-shadow(0 9px 9px rgba(101, 52, 24, .22));
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 24px;
  background: rgba(255, 246, 216, .94);
  border: 3px solid rgba(202, 137, 63, .76);
  transition: transform .16s ease, filter .16s ease;
}

.room-icon-button:hover,
.room-icon-button:focus-visible {
  outline: none;
  transform: translateY(-2px);
  filter: drop-shadow(0 12px 10px rgba(101, 52, 24, .24));
}

.room-icon-button:active {
  transform: translateY(1px) scale(.98);
}

.room-icon-button img {
  width: 56px;
  height: 56px;
}

@media (max-width: 720px) {
  .room-pet {
    width: clamp(126px, 34vw, 174px);
  }

  .room-icon-button {
    width: 60px;
    height: 60px;
    border-radius: 18px;
  }

  .room-icon-button img {
    width: 44px;
    height: 44px;
  }
}
