:root {
  --cream: #fff8e8;
  --paper: #fffdf7;
  --yellow: #f6bd45;
  --yellow-dark: #cf8612;
  --peach: #f3a86f;
  --brown: #5b3b2b;
  --brown-soft: #87634e;
  --grass: #6eae4e;
  --grass-dark: #4d8336;
  --sky: #a8dce6;
  --line: rgba(92, 59, 43, 0.18);
  --shadow: 0 12px 28px rgba(79, 50, 31, 0.17);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  color: var(--brown);
  font-family:
    "Pretendard", "Noto Sans KR", system-ui, -apple-system, sans-serif;
  background: #e6c793;
  overflow-x: hidden;
}

button {
  color: inherit;
  font: inherit;
}

.game-shell {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    #f4dfb8;
  background-size: 28px 28px;
}

.top-bar {
  position: relative;
  z-index: 20;
  display: grid;
  min-height: 74px;
  grid-template-columns: minmax(190px, 1fr) auto minmax(80px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  border-bottom: 5px solid #8b572f;
  background: linear-gradient(#fff8df, #edcc91);
  box-shadow: 0 5px 16px rgba(65, 40, 25, 0.25);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-logo {
  display: block;
  width: 124px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 5px 4px rgba(91, 59, 43, 0.2));
}

.brand small,
.panel-heading p,
.click-heading p {
  color: var(--brown-soft);
}

.top-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(116, 73, 42, 0.22);
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.top-stats > div {
  display: flex;
  min-width: 126px;
  align-items: center;
  flex-direction: column;
  gap: 2px;
  padding: 7px 14px 8px;
}

.top-stats > div + div {
  border-left: 1px solid rgba(177, 126, 75, 0.34);
}

.top-stats > div > span {
  color: #795946;
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0;
  white-space: nowrap;
}

.top-stats strong {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  justify-content: center;
  color: #513426;
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.top-stats strong span {
  font-size: inherit;
  line-height: inherit;
  letter-spacing: 0;
}

.stat-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.stat-seed-icon {
  width: 19px;
  height: 19px;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 0 rgba(67, 42, 22, 0.28));
}

.stat-seed-icon.is-golden {
  filter:
    drop-shadow(0 0 5px rgba(255, 218, 62, 0.78))
    drop-shadow(0 1px 0 rgba(67, 42, 22, 0.28));
}

.reset-button {
  padding: 8px 12px;
  color: #7d5140;
  border: 1px solid #bd8f69;
  border-radius: 10px;
  background: rgba(255, 250, 238, 0.76);
  cursor: pointer;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.dex-button {
  padding: 8px 12px;
  color: #65421f;
  border: 1px solid #b87b35;
  border-radius: 10px;
  background: #ffe6a6;
  box-shadow: 0 3px 0 #c78a3f;
  font-weight: 900;
  cursor: pointer;
}

.dex-button:hover {
  background: #fff0bd;
  transform: translateY(-1px);
}

.reset-button:hover {
  color: #9a3d31;
  background: #fff0ec;
}

.game-layout {
  display: grid;
  min-height: calc(100vh - 74px);
  grid-template-columns: minmax(310px, 28%) minmax(450px, 1fr) minmax(350px, 29%);
}

.click-panel,
.kingdom-panel,
.shop-panel {
  position: relative;
  min-width: 0;
}

.click-panel {
  display: flex;
  min-height: 680px;
  align-items: center;
  flex-direction: column;
  padding: 24px 20px 18px;
  border-right: 8px ridge #b17a42;
  background:
    radial-gradient(circle at 50% 52%, rgba(255, 249, 194, 0.7), transparent 32%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.22), transparent),
    repeating-linear-gradient(90deg, #91cfdd 0 22px, #86c4d2 23px 44px);
  overflow: hidden;
}

.click-panel::after {
  content: "";
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  height: 105px;
  background:
    radial-gradient(ellipse at 10% 100%, #7eb95a 0 45%, transparent 47%),
    radial-gradient(ellipse at 55% 100%, #68a84a 0 48%, transparent 50%),
    radial-gradient(ellipse at 90% 100%, #83bf5e 0 45%, transparent 47%);
  pointer-events: none;
}

.click-heading {
  position: relative;
  z-index: 4;
  width: min(100%, 360px);
  padding: 10px 14px;
  border-radius: 15px;
  background: rgba(49, 83, 88, 0.68);
  color: white;
  text-align: center;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
}

.click-heading h1 {
  margin: 0;
}

.click-heading h1 {
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
}

.seed-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.seed-title-icon {
  width: 34px;
  height: 34px;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 1px rgba(42, 25, 14, 0.35));
}

.click-heading > strong {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
}

.hamster-button {
  position: relative;
  z-index: 5;
  display: flex;
  width: min(96%, 390px);
  min-height: 365px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin-top: 18px;
  padding: 14px 8px 20px;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 218, 0.95) 0 34%, rgba(255, 223, 104, 0.46) 35% 53%, transparent 70%);
  cursor: pointer;
  user-select: none;
  transition: transform 90ms ease;
  touch-action: manipulation;
}

.hamster-button::before {
  content: "";
  position: absolute;
  width: 82%;
  height: 22%;
  bottom: 60px;
  border-radius: 50%;
  background: rgba(66, 83, 43, 0.18);
  filter: blur(5px);
}

.hamster-button:hover {
  transform: scale(1.025);
}

.hamster-button:active,
.hamster-button.is-clicked {
  transform: scale(0.96);
}

.hamster-button:focus-visible,
.buy-button:focus-visible,
.reset-button:focus-visible {
  outline: 4px solid #fff5a8;
  outline-offset: 3px;
}

.runner-sprite {
  position: relative;
  display: block;
  flex: 0 0 auto;
}

.hero-runner {
  width: 100%;
  height: 245px;
}

.sprite-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}

.frame-one {
  animation: show-frame-one 0.26s steps(1, end) infinite;
}

.frame-two {
  opacity: 0;
  animation: show-frame-two 0.26s steps(1, end) infinite;
}

@keyframes show-frame-one {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes show-frame-two {
  0%,
  49% {
    opacity: 0;
  }
  50%,
  100% {
    opacity: 1;
  }
}

.button-label,
.hamster-button small {
  position: relative;
  z-index: 3;
}

.button-label {
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.9);
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(77, 56, 38, 0.15);
}

.hamster-button small {
  margin-top: 6px;
  color: #684c3b;
}

.petting-reward {
  position: absolute;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 58px;
  padding: 4px 9px;
  color: #7c4d13;
  border: 2px solid rgba(255, 226, 97, 0.9);
  border-radius: 999px;
  background: rgba(255, 252, 220, 0.94);
  box-shadow:
    0 4px 8px rgba(82, 51, 20, 0.18),
    0 0 12px rgba(255, 221, 67, 0.58);
  font-size: 0.82rem;
  font-weight: 1000;
  pointer-events: none;
  text-shadow: 0 1px white;
  transform: translateX(-50%);
  animation: petting-reward-pop 0.85s ease-out forwards;
}

.petting-reward-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 0 rgba(73, 43, 18, 0.22));
}

@keyframes petting-reward-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.78);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -54px) scale(0.95);
  }
}

.message {
  position: relative;
  z-index: 5;
  min-height: 42px;
  margin: 4px 0 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.82);
  font-size: 0.82rem;
  text-align: center;
}

.fever-status {
  position: relative;
  z-index: 5;
  margin-top: 8px;
  padding: 6px 11px;
  color: #6f5426;
  border: 1px solid rgba(207, 134, 18, 0.35);
  border-radius: 999px;
  background: rgba(255, 246, 193, 0.82);
  font-size: 0.75rem;
}

.seed-pile-depot {
  position: relative;
  z-index: 3;
  width: min(86%, 360px);
  height: clamp(126px, 22vh, 190px);
  margin-top: 14px;
  background: url("assets/seed-pile-smooth.png") center top / contain no-repeat;
  filter: drop-shadow(0 9px 0 rgba(54, 70, 39, 0.1));
  opacity: 0.96;
  pointer-events: none;
}

.fever-status.is-active {
  color: #fff;
  background: #d08b13;
  animation: fever-status-pulse 0.7s ease-in-out infinite alternate;
}

@keyframes fever-status-pulse {
  to {
    box-shadow: 0 0 18px #ffe679;
  }
}

.seed-rain {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.click-panel.is-fever .seed-rain {
  z-index: 12;
}

.seed-drop {
  position: absolute;
  top: -30px;
  width: 10px;
  height: 22px;
  border: 2px solid #684626;
  border-radius: 70% 30% 70% 30%;
  background: linear-gradient(90deg, #d5a65b, #fff0b5 50%, #9b682f);
  box-shadow: 0 2px 2px rgba(74, 49, 28, 0.22);
  animation: seed-fall var(--fall-duration) linear forwards;
  color: #6a461d;
  cursor: pointer;
  font-size: 0;
  font-weight: 900;
  pointer-events: auto;
  user-select: none;
}

.seed-drop.is-golden {
  z-index: 2;
  width: 15px;
  height: 30px;
  border: 3px solid #fff7bf;
  background:
    radial-gradient(circle at 48% 34%, #fff 0 3px, transparent 4px),
    linear-gradient(90deg, #f09000, #fffbd1 42%, #ffd033 62%, #d06b00);
  box-shadow:
    0 0 0 2px rgba(52, 28, 4, 0.72),
    0 0 13px #fff7a3,
    0 0 26px rgba(255, 200, 33, 0.96),
    0 0 42px rgba(255, 122, 0, 0.74);
  filter: saturate(1.28) brightness(1.16);
}

.click-panel.is-fever .seed-drop.is-golden {
  z-index: 3;
  cursor: pointer;
  animation:
    seed-fall var(--fall-duration) linear forwards,
    golden-seed-pulse 0.42s ease-in-out infinite alternate;
}

.seed-drop:hover {
  filter: brightness(1.12);
}

.seed-drop.is-collected {
  width: auto;
  min-width: 30px;
  height: auto;
  padding: 3px 7px;
  color: #5c3b17;
  border-color: #fff4b4;
  border-radius: 999px;
  background: rgba(255, 250, 214, 0.96);
  box-shadow:
    0 0 10px rgba(255, 232, 87, 0.95),
    0 3px 7px rgba(78, 47, 20, 0.24);
  font-size: 0.74rem;
  text-align: center;
  animation: seed-collected 0.42s ease-out forwards;
  pointer-events: none;
}

.click-panel.is-fever .seed-drop.is-golden.is-collected {
  width: auto;
  min-width: 44px;
  height: auto;
  border: 2px solid #fff4b4;
  background: rgba(255, 250, 214, 0.98);
  animation: seed-collected 0.42s ease-out forwards;
}

@keyframes golden-seed-pulse {
  to {
    filter: saturate(1.55) brightness(1.45);
    box-shadow:
      0 0 0 2px rgba(0, 0, 0, 0.86),
      0 0 18px #fffbd1,
      0 0 34px rgba(255, 211, 58, 1),
      0 0 58px rgba(255, 126, 0, 0.9);
  }
}

@keyframes seed-fall {
  from {
    transform: translate3d(0, -20px, 0) rotate(0) scale(var(--seed-scale, 1));
  }
  to {
    transform: translate3d(var(--drift), calc(100vh + 80px), 0) rotate(720deg) scale(var(--seed-scale, 1));
  }
}

@keyframes seed-collected {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(0.85);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, -34px, 0) scale(1.15);
  }
}

.kingdom-panel {
  min-height: 680px;
  padding: 18px;
  border-right: 8px ridge #b17a42;
  background:
    linear-gradient(rgba(255, 255, 255, 0.14), transparent),
    repeating-linear-gradient(90deg, #f2d4a2 0 30px, #ebc892 31px 60px);
}

.panel-heading {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 2px solid #a76d39;
  border-radius: 14px;
  background: linear-gradient(#fff9e8, #e8c28b);
  box-shadow: 0 5px 0 #9c6235;
}

.panel-heading p,
.panel-heading h2 {
  margin: 0;
}

.panel-heading p {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.panel-heading h2 {
  font-size: 1.35rem;
}

.hamster-meadow {
  position: relative;
  min-height: 570px;
  margin-top: 0;
  padding: 110px 16px 80px;
  border: 5px solid #7a9d4d;
  border-radius: 22px;
  background:
    radial-gradient(circle at 15% 78%, #fff0a1 0 4px, transparent 5px),
    radial-gradient(circle at 85% 72%, #ffb3b3 0 4px, transparent 5px),
    linear-gradient(to bottom, #a9dce8 0 37%, #8fca69 38% 55%, #62a745 56% 100%);
  box-shadow:
    inset 0 -18px 0 rgba(55, 116, 45, 0.22),
    var(--shadow);
  overflow: hidden;
}

.hamster-meadow::before,
.hamster-meadow::after {
  content: "";
  position: absolute;
  right: -10%;
  left: -10%;
  height: 80px;
  border-radius: 50%;
  background: #7eb95a;
}

.hamster-meadow::before {
  top: 170px;
}

.hamster-meadow::after {
  bottom: -48px;
  background: #4f8f3b;
}

.meadow-sun {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 18px;
  width: 96px;
  height: 96px;
  object-fit: contain;
  image-rendering: auto;
  filter:
    drop-shadow(0 0 10px rgba(255, 241, 116, 0.85))
    drop-shadow(0 4px 2px rgba(106, 123, 55, 0.12));
  pointer-events: none;
}

.meadow-cloud {
  position: absolute;
  width: 76px;
  height: 25px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
}

.meadow-cloud::before,
.meadow-cloud::after {
  content: "";
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: inherit;
}

.meadow-cloud::before {
  left: 12px;
  width: 34px;
  height: 34px;
}

.meadow-cloud::after {
  right: 10px;
  width: 26px;
  height: 26px;
}

.cloud-one {
  top: 35px;
  left: 7%;
}

.cloud-two {
  top: 86px;
  left: 52%;
  transform: scale(0.7);
}

.meadow-residents {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.meadow-hamster {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border: 2px solid rgba(64, 112, 45, 0.36);
  border-radius: 18px;
  background: rgba(255, 250, 217, 0.76);
  box-shadow: 0 6px 0 rgba(63, 108, 42, 0.22);
}

.meadow-runner {
  width: min(62%, 145px);
  height: 100px;
}

.hamster-line-header > span {
  padding: 3px 9px;
  color: white;
  border-radius: 999px;
  background: var(--grass-dark);
  font-weight: 900;
}

.meadow-hamster.is-locked::after {
  content: "🔒";
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

.meadow-hamster.is-locked .runner-sprite {
  opacity: 0.25;
  filter: grayscale(1);
}

/*
 * 네 칸짜리 스프라이트 시트를 차례로 보여주는 진짜 달리기 사이클입니다.
 * 다리를 뻗고, 모으고, 반대로 교차하고, 공중에서 접는 순서로 재생됩니다.
 */
.run-cycle {
  position: relative;
  display: block;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  background-size: 200% 200%;
  image-rendering: pixelated;
  animation: hamster-gallop 0.42s steps(1, end) infinite;
}

.cycle-golden {
  background-image: url("assets/run-cycle-golden.png");
}

.cycle-golden.hero-runner.hero-runner-ribbon {
  background-image: url("assets/run-cycle-golden-ribbon.png");
}

.cycle-golden.hero-runner.hero-runner-ballet {
  background-image: url("assets/run-cycle-golden-ballet.png");
}

.cycle-golden.hero-runner.hero-runner-red-knit {
  background-image: url("assets/run-cycle-golden-red-knit.png");
}

.cycle-golden.hero-runner.hero-runner-flower-crown {
  background-image: url("assets/run-cycle-golden-flower-crown.png");
}

.cycle-golden.hero-runner.hero-runner-wizard-hat {
  background-image: url("assets/run-cycle-golden-wizard-hat.png");
}

.cycle-golden.hero-runner.hero-runner-baseball-cap {
  background-image: url("assets/run-cycle-golden-baseball-cap.png");
}

.cycle-golden.hero-runner.hero-runner-cowboy-hat {
  background-image: url("assets/run-cycle-golden-cowboy-hat.png");
}

.cycle-golden.hero-runner.hero-runner-sunglasses {
  background-image: url("assets/run-cycle-golden-sunglasses.png");
}

.cycle-golden.hero-runner.hero-runner-angel {
  background-image: url("assets/run-cycle-golden-angel.png");
}

.cycle-golden.hero-runner.hero-runner-devil {
  background-image: url("assets/run-cycle-golden-devil.png");
}

.cycle-golden.hero-runner.hero-runner-hamster-question {
  background-image: url("assets/run-cycle-golden-hamster-question.png");
}

.cycle-pudding {
  background-image: url("assets/run-cycle-pudding.png");
}

.cycle-roborovski {
  background-image: url("assets/run-cycle-roborovski.png");
}

.cycle-djungarian {
  background-image: url("assets/run-cycle-djungarian.png");
}

.cycle-black {
  background-image: url("assets/run-cycle-black.png");
}

.cycle-longhair {
  background-image: url("assets/run-cycle-longhair.png");
}

.cycle-gym {
  background-image: url("assets/hamster-dumbbell-lift.gif");
  background-position: center;
  background-size: contain;
  animation: none;
}

.cycle-glutton {
  background-image: url("assets/glutton-hamster-transparent.png");
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  image-rendering: auto;
  animation: none;
}

.cycle-cowboy {
  background-image: url("assets/cowboy-hamster-cycle.png");
  image-rendering: pixelated;
  animation: cowboy-work-cycle 1.4s steps(1, end) infinite;
}

[data-employee-card="gym"] .icon-runner.cycle-gym {
  background-image: url("assets/hamster-dumbbell-lift-static.png");
  width: 86px;
  height: 86px;
  image-rendering: auto;
}

[data-employee-card="glutton"] .icon-runner.cycle-glutton {
  width: 68px;
  height: 68px;
}

[data-employee-card="cowboy"] .icon-runner.cycle-cowboy {
  width: 72px;
  height: 72px;
  animation: none;
  background-position: left top;
}

.hamster-line-track > .mini-runner.cycle-gym {
  width: 49px;
  height: 49px;
  margin: 31px -9px 0 0;
  animation: hamster-idle-bob 1.4s ease-in-out infinite;
}

.hamster-line-track > .mini-runner.cycle-glutton {
  width: 70px;
  height: 70px;
  margin: 12px -9px 0 0;
  animation: glutton-munch 1.8s ease-in-out infinite;
}

.hamster-line-track > .mini-runner.cycle-cowboy {
  width: 48px;
  height: 64px;
  margin: 21px -7px 0 0;
  animation: none;
  filter: drop-shadow(0 2px 1px rgba(79, 54, 31, 0.2));
}

.interaction-sniff .interaction-hamster.cycle-gym:first-child {
  animation: hamster-sniff-left 1.55s ease-in-out infinite;
}

.interaction-sniff .interaction-hamster.cycle-gym:nth-child(2) {
  animation: hamster-sniff-right 1.55s ease-in-out infinite;
}

.interaction-snack .interaction-hamster.cycle-gym:first-child {
  animation: hamster-snack-left 1.1s ease-in-out infinite;
}

.interaction-snack .interaction-hamster.cycle-gym:nth-child(2) {
  animation: hamster-snack-right 1.1s ease-in-out infinite;
}

.interaction-chase .interaction-hamster.cycle-gym:first-child {
  animation: hamster-chase-one 1.05s ease-in-out infinite;
}

.interaction-chase .interaction-hamster.cycle-gym:nth-child(2) {
  animation: hamster-chase-two 1.05s ease-in-out infinite;
}

.hamster-line-track > .play-gym-jump-rope {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin: 35px -6px 0 0;
  background-image: url("assets/hamster-jump-rope.gif");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  image-rendering: auto;
  filter: drop-shadow(0 2px 0 rgba(36, 24, 16, 0.25));
  transform-origin: 50% 88%;
  animation: none;
}

.play-cycle {
  position: relative;
  z-index: 2;
  display: block;
  flex: 0 0 auto;
  background-repeat: no-repeat;
  background-size: 200% 200%;
  image-rendering: pixelated;
  animation: hamster-gallop 0.9s steps(1, end) infinite;
}

.play-golden {
  background-image: url("assets/play-cycle-golden.png");
}

.play-pudding {
  background-image: url("assets/play-cycle-pudding.png");
}

.play-roborovski {
  /* 로보로브스키는 여러 마리가 낑겨 자는 습성을 살린 전용 모션입니다. */
  background-image: url("assets/sleep-cycle-roborovski-clean.png");
  image-rendering: auto;
  transform-origin: 50% 82%;
  animation:
    roborovski-sleep-frame 3.2s steps(1, end) infinite,
    roborovski-sleep-breath 3.2s ease-in-out infinite;
}

.play-roborovski .roborovski-zzz {
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 17px;
  color: #44415c;
  font-family: monospace;
  font-size: 0.48rem;
  font-weight: 1000;
  line-height: 1;
  text-shadow:
    6px -7px 0 #44415c,
    13px -15px 0 #44415c;
  transform-origin: 50% 100%;
  opacity: 0;
  transform: translate(2px, 5px) scale(0.82);
  transition:
    opacity 0.2s linear,
    transform 0.25s ease-out;
}

.play-black {
  background-image: url("assets/play-cycle-black.png");
}

@keyframes hamster-gallop {
  0%,
  24.99% {
    background-position: 0 0;
  }
  25%,
  49.99% {
    background-position: 100% 0;
  }
  50%,
  74.99% {
    background-position: 0 100%;
  }
  75%,
  100% {
    background-position: 100% 100%;
  }
}

@keyframes cowboy-work-cycle {
  0%,
  24.99% {
    background-position: 0 0;
  }
  25%,
  49.99% {
    background-position: 100% 0;
  }
  50%,
  74.99% {
    background-position: 0 100%;
  }
  75%,
  100% {
    background-position: 100% 100%;
  }
}

@keyframes accessory-follow-gallop {
  0%,
  24.99% {
    transform: translateX(-50%) translate(0, 0) rotate(0deg);
  }

  25%,
  49.99% {
    transform: translateX(-50%) translate(8px, -4px) rotate(2deg);
  }

  50%,
  74.99% {
    transform: translateX(-50%) translate(-3px, 2px) rotate(-1deg);
  }

  75%,
  100% {
    transform: translateX(-50%) translate(7px, -2px) rotate(1deg);
  }
}

@keyframes roborovski-sleep-frame {
  0%,
  64.99% {
    background-position: 0 0;
  }
  65%,
  84.99% {
    background-position: 100% 0;
  }
  85%,
  100% {
    background-position: 0 0;
  }
}

@keyframes roborovski-sleep-breath {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  48% {
    transform: translateY(1px) scale(1.005, 0.998);
  }
}

.hero-runner {
  width: 280px;
  height: 280px;
  filter: drop-shadow(0 12px 5px rgba(67, 63, 38, 0.2));
  animation-duration: 0.36s;
}

.accessory-layer {
  display: none;
}

.hero-accessory {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-size: 200% 200%;
  image-rendering: pixelated;
  animation: hamster-gallop 0.36s steps(1, end) infinite;
  filter:
    drop-shadow(0 2px 0 rgba(91, 59, 43, 0.18))
    drop-shadow(0 4px 5px rgba(91, 59, 43, 0.12));
}

.accessory-ribbon {
  background-image: url("assets/accessory-ribbon-sheet.png");
}

.accessory-ballet {
  background-image: url("assets/accessory-ballet-sheet.png");
}

.accessory-red-knit {
  background-image: url("assets/accessory-red-knit-sheet.png");
}

.accessory-flower-crown {
  background-image: url("assets/accessory-flower-crown-sheet.png");
}

.accessory-wizard-hat {
  background-image: url("assets/accessory-wizard-hat-sheet.png");
}

.accessory-shop-icon .hero-accessory {
  position: relative;
  inset: auto;
  margin: auto;
  width: 76px;
  height: 76px;
  transform: scale(1.35);
  transform-origin: center;
  animation: none;
  background-position: 0 0;
}

.icon-runner {
  width: 72px;
  height: 72px;
}

.foreman-hamster-art {
  display: block;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 6px 0 rgba(95, 64, 36, 0.18));
}

.scientist-hamster-art {
  display: block;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 5px 0 rgba(47, 54, 64, 0.18));
}

/* 쿠키클리커의 생산 건물처럼 종류마다 한 줄을 사용합니다. */
.meadow-residents {
  grid-template-columns: 1fr;
  gap: 8px;
}

.meadow-hamster {
  display: block;
  min-height: 84px;
  padding: 6px 10px 8px;
}

.meadow-hamster > .hamster-line-header {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  flex-direction: row;
  gap: 8px;
  text-align: left;
}

.hamster-line-header > strong {
  font-size: 0.78rem;
}

.hamster-line-track {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  min-width: 0;
  height: 98px;
  align-items: center;
  flex-direction: row;
  gap: 0;
  margin-top: 2px;
  padding: 0 6px;
  border: 2px solid rgba(91, 59, 43, 0.28);
  border-radius: 9px;
  /*
   * 생산 줄 뒤쪽의 해바라기 밭입니다.
   * 참고 이미지처럼 작은 픽셀 해바라기 에셋을 반복 배치합니다.
   * 두 줄을 살짝 어긋나게 깔아 밭처럼 보이되, 꽃끼리 겹치지 않게 간격을 둡니다.
  */
  background:
    linear-gradient(to bottom, rgba(255, 248, 210, 0.08), rgba(79, 46, 24, 0.08)),
    url("assets/sunflower-production-background.png") left bottom / auto 100% repeat-x;
  box-shadow:
    inset 0 -14px 0 rgba(104, 65, 40, 0.2),
    inset 0 0 0 2px rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.hamster-line-track::before {
  content: "";
  position: absolute;
  z-index: 0;
  right: 0;
  bottom: 13px;
  left: 0;
  height: 4px;
  background: rgba(39, 100, 33, 0.25);
  opacity: 0.55;
}

[data-meadow-employee="gym"] .hamster-line-track {
  border-color: rgba(54, 45, 39, 0.5);
  background:
    linear-gradient(to bottom, rgba(255, 238, 185, 0.08), rgba(25, 22, 20, 0.08)),
    url("assets/gym-production-background.png") center bottom / cover no-repeat;
  box-shadow:
    inset 0 -12px 0 rgba(42, 28, 20, 0.18),
    inset 0 0 0 2px rgba(255, 232, 183, 0.2),
    0 2px 0 rgba(91, 59, 43, 0.18);
}

[data-meadow-employee="gym"] .hamster-line-track::before {
  bottom: 0;
  height: 25px;
  background:
    linear-gradient(to bottom, rgba(255, 205, 121, 0.12), rgba(70, 42, 24, 0.18));
  opacity: 1;
}

.hamster-line-track > .mini-runner {
  position: relative;
  z-index: 2;
  width: 50px;
  height: 50px;
  margin: 31px -9px 0 0;
  padding: 0;
  border-radius: 0;
  background-color: transparent;
  animation-duration: 0.42s;
  filter: drop-shadow(0 2px 0 rgba(79, 54, 31, 0.22));
}

.hamster-line-track > .mini-runner.run-cycle:not(.cycle-gym):not(.cycle-glutton):not(.cycle-cowboy) {
  animation: none;
}

.hamster-line-track > .hamster-interaction {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 87px;
  height: 78px;
  margin: 15px -5px 0 0;
  filter: drop-shadow(0 2px 0 rgba(79, 54, 31, 0.2));
}

.hamster-interaction .interaction-hamster {
  position: absolute;
  bottom: 8px;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 0;
  background-color: transparent;
  animation:
    hamster-gallop 0.58s steps(1, end) infinite,
    hamster-idle-bob 1.4s ease-in-out infinite;
  animation-delay: var(--interaction-delay, 0s);
}

.hamster-interaction .interaction-hamster:first-child {
  left: 3px;
}

.hamster-interaction .interaction-hamster:nth-child(2) {
  right: 3px;
  animation-delay: calc(var(--interaction-delay, 0s) - 0.22s);
}

.hamster-interaction::before,
.hamster-interaction::after {
  position: absolute;
  z-index: 4;
  pointer-events: none;
}

.interaction-sniff .interaction-hamster:first-child {
  background-position: 0 0;
  animation: hamster-sniff-left 1.55s ease-in-out infinite;
}

.interaction-sniff .interaction-hamster:nth-child(2) {
  background-position: 0 0;
  animation: hamster-sniff-right 1.55s ease-in-out infinite;
}

.interaction-sniff::after {
  content: "♡";
  top: 16px;
  left: 45px;
  color: #f28aa5;
  font-size: 0.84rem;
  text-shadow: 0 1px 0 white;
  animation: tiny-heart-pop 1.55s ease-in-out infinite;
}

.interaction-snack::before {
  content: "";
  right: 39px;
  bottom: 20px;
  width: 20px;
  height: 20px;
  background: url("assets/seed-pixel.svg") center / contain no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 0 rgba(73, 43, 18, 0.28));
  animation: seed-nibble 1.1s ease-in-out infinite;
}

.interaction-snack .interaction-hamster:first-child {
  background-position: 0 0;
  animation: hamster-snack-left 1.1s ease-in-out infinite;
}

.interaction-snack .interaction-hamster:nth-child(2) {
  background-position: 0 0;
  animation: hamster-snack-right 1.1s ease-in-out infinite;
}

.interaction-chase {
  width: 108px;
}

.interaction-chase::after {
  content: "· ·";
  right: 28px;
  bottom: 13px;
  color: rgba(112, 80, 46, 0.55);
  font-weight: 1000;
  letter-spacing: 2px;
  animation: chase-dust 0.62s ease-in-out infinite;
}

.interaction-chase .interaction-hamster:first-child {
  animation:
    hamster-gallop 0.52s steps(1, end) infinite,
    hamster-chase-one 1.05s ease-in-out infinite;
}

.interaction-chase .interaction-hamster:nth-child(2) {
  animation:
    hamster-gallop 0.52s steps(1, end) infinite,
    hamster-chase-two 1.05s ease-in-out infinite;
}

.interaction-nap .interaction-hamster {
  bottom: 3px;
  background-position: 0 0;
  animation: hamster-nap-breathe 2.4s ease-in-out infinite;
}

.interaction-nap .interaction-hamster:first-child {
  left: 8px;
  transform: rotate(-4deg);
}

.interaction-nap .interaction-hamster:nth-child(2) {
  right: 8px;
  transform: rotate(5deg);
  animation:
    hamster-nap-breathe-right 2.4s ease-in-out infinite;
  animation-delay: -1.2s;
}

.interaction-nap::after {
  content: "Z z";
  top: 8px;
  right: 18px;
  color: #6a6f9c;
  font-size: 0.72rem;
  font-weight: 1000;
  text-shadow: 0 1px 0 white;
  animation: sleep-letters 2.4s ease-in-out infinite;
}

.hamster-line-track > .play-pair {
  width: 92px;
  height: 92px;
  margin: 2px -5px 0 0;
  filter: drop-shadow(0 2px 0 rgba(79, 54, 31, 0.22));
}

.hamster-line-track > .play-pair.play-roborovski {
  width: 76px;
  height: 76px;
  margin: 12px 0 0 0;
  filter: drop-shadow(0 1px 1px rgba(61, 59, 72, 0.18));
}

.hamster-line-track > .play-pair--late {
  animation-delay: -0.45s;
}

.hamster-line-track > .play-pair--late.play-roborovski {
  width: 72px;
  height: 72px;
  margin-top: 15px;
}

.hamster-line-track > .play-glutton-food {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  margin: 32px 8px 0 0;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  image-rendering: auto;
  filter: drop-shadow(0 2px 0 rgba(79, 54, 31, 0.22));
}

.hamster-line-track > .play-glutton-food.food-eating {
  width: 50px;
  height: 50px;
  margin-top: 32px;
  margin-right: 8px;
  background-image: url("assets/glutton-eating.gif");
}

.hamster-line-track > .play-glutton-food.food-sleepy {
  width: 50px;
  height: 50px;
  margin-top: 36px;
  margin-right: 8px;
  background-image: url("assets/glutton-sleepy-sheet-v3.png");
  background-size: 550px 50px;
  background-position: 0 0;
  animation: none;
}

.hamster-line-track > .play-glutton-food.food-cheese {
  width: 75px;
  height: 50px;
  margin: 32px -5px 0 -12px;
  background-image: url("assets/glutton-cheese-sheet-v3.png");
  background-size: 375px 50px;
  background-position: 0 0;
  image-rendering: auto;
  animation: none;
}

.glutton-sleep-zzz,
.glutton-cheese-zzz {
  position: absolute;
  z-index: 4;
  top: 5px;
  right: 6px;
  color: #625078;
  font-family: monospace;
  font-size: 0.48rem;
  font-weight: 1000;
  line-height: 1;
  text-shadow:
    6px -7px 0 #625078,
    12px -14px 0 #625078;
  opacity: 0;
  transform: translate(2px, 5px) scale(0.82);
  transition:
    opacity 0.2s linear,
    transform 0.25s ease-out;
}

.glutton-cheese-zzz {
  right: 14px;
}

.hamster-line-track > .mini-runner:nth-child(even) {
  animation-delay: -0.21s;
}

@keyframes glutton-munch {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  45% {
    transform: translateY(1px) scale(1.015, 0.985);
  }
  70% {
    transform: translateY(-1px) scale(0.995, 1.01);
  }
}

@keyframes gym-jump-rope-frames {
  0%,
  24.99% {
    background-position: 0 0;
  }
  25%,
  49.99% {
    background-position: -58px 0;
  }
  50%,
  74.99% {
    background-position: -116px 0;
  }
  75%,
  100% {
    background-position: -174px 0;
  }
}

@keyframes gym-jump-rope-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes hamster-idle-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes hamster-sniff-left {
  0%,
  100% {
    transform: translate(0, 0) rotate(-2deg);
  }
  50% {
    transform: translate(11px, 1px) rotate(3deg);
  }
}

@keyframes hamster-sniff-right {
  0%,
  100% {
    transform: translate(0, 0) scaleX(-1) rotate(-2deg);
  }
  50% {
    transform: translate(-11px, 1px) scaleX(-1) rotate(3deg);
  }
}

@keyframes tiny-heart-pop {
  0%,
  100% {
    opacity: 0;
    transform: translateY(5px) scale(0.7);
  }
  45% {
    opacity: 1;
    transform: translateY(-3px) scale(1.12);
  }
}

@keyframes hamster-snack-left {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(8px, 5px) rotate(7deg);
  }
}

@keyframes hamster-snack-right {
  0%,
  100% {
    transform: translate(0, 0) scaleX(-1) rotate(0deg);
  }
  50% {
    transform: translate(-8px, 5px) scaleX(-1) rotate(7deg);
  }
}

@keyframes seed-nibble {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(2px) scale(0.86);
  }
}

@keyframes hamster-chase-one {
  0%,
  100% {
    transform: translate(0, 0);
  }
  35% {
    transform: translate(28px, -8px) rotate(5deg);
  }
  70% {
    transform: translate(53px, 2px) rotate(-4deg);
  }
}

@keyframes hamster-chase-two {
  0%,
  100% {
    transform: translate(0, 1px) scaleX(-1);
  }
  35% {
    transform: translate(-24px, 3px) scaleX(-1) rotate(-5deg);
  }
  70% {
    transform: translate(-48px, -6px) scaleX(-1) rotate(4deg);
  }
}

@keyframes chase-dust {
  0%,
  100% {
    opacity: 0.25;
    transform: translateX(0);
  }
  50% {
    opacity: 0.85;
    transform: translateX(-7px);
  }
}

@keyframes hamster-nap-breathe {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg) scale(1);
  }
  50% {
    transform: translateY(-2px) rotate(-3deg) scale(1.02);
  }
}

@keyframes hamster-nap-breathe-right {
  0%,
  100% {
    transform: translateY(0) rotate(5deg) scale(1);
  }
  50% {
    transform: translateY(-2px) rotate(4deg) scale(1.02);
  }
}

@keyframes sleep-letters {
  0%,
  100% {
    opacity: 0;
    transform: translate(0, 5px) scale(0.8);
  }
  45% {
    opacity: 1;
    transform: translate(-4px, -4px) scale(1.05);
  }
}

.hamster-line-track > .track-empty,
.hamster-line-track > .track-more {
  flex: 0 0 auto;
  margin-left: 7px;
  padding: 3px 8px;
  color: #50733d;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  font-size: 0.68rem;
  font-weight: 900;
}

.hamster-line-track > .track-more {
  position: absolute;
  z-index: 5;
  top: 5px;
  right: 6px;
  margin-left: 0;
}

.meadow-hamster.is-locked .run-cycle {
  opacity: 1;
  filter:
    brightness(0)
    grayscale(1)
    contrast(1.65)
    drop-shadow(0 2px 0 rgba(255, 255, 255, 0.28));
  animation: none;
  background-position: left top;
}

.meadow-hamster.is-locked {
  border-color: rgba(112, 112, 112, 0.5);
  background: linear-gradient(90deg, rgba(239, 239, 239, 0.86), rgba(201, 201, 201, 0.8));
  box-shadow: 0 6px 0 rgba(106, 106, 106, 0.24);
}

.meadow-hamster.is-locked .hamster-line-header > strong,
.meadow-hamster.is-locked .track-empty {
  color: #3e3e3e;
}

.meadow-hamster.is-locked .hamster-line-header > span {
  background: #777777;
}

.meadow-hamster.is-locked .hamster-line-track {
  border-color: rgba(96, 96, 96, 0.45);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 14px, transparent 15px 31px),
    linear-gradient(to bottom, #d8d8d8 0 34%, #b7b7b7 35% 73%, #8f8f8f 74% 100%);
  box-shadow:
    inset 0 -14px 0 rgba(70, 70, 70, 0.15),
    inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}

.meadow-hamster.is-locked .hamster-line-track::before {
  bottom: 17px;
  height: 7px;
  background:
    repeating-linear-gradient(90deg, rgba(108, 108, 108, 0.9) 0 5px, rgba(140, 140, 140, 0.9) 6px 11px);
  opacity: 0.7;
}

.wheel-display {
  position: absolute;
  z-index: 3;
  right: 16px;
  bottom: 18px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 2px solid rgba(83, 77, 45, 0.3);
  border-radius: 14px;
  background: rgba(255, 249, 218, 0.86);
}

.wheel-display > span {
  font-size: 2.2rem;
  animation: wheel-spin 3s linear infinite;
}

.wheel-display div {
  display: flex;
  flex-direction: column;
}

.wheel-display small {
  color: var(--brown-soft);
}

.living-box-panel {
  position: relative;
  margin-top: 14px;
  padding: 12px;
  border: 4px solid #b97845;
  border-radius: 18px;
  background: linear-gradient(#fff6d9, #f0c98f);
  box-shadow: var(--shadow);
}

.living-box-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.living-box-heading p,
.living-box-heading h3,
.living-box-note {
  margin: 0;
}

.living-box-heading p {
  color: var(--brown-soft);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.living-box-heading h3 {
  font-size: 1.2rem;
}

.rare-badge {
  padding: 5px 9px;
  color: #fffaf0;
  border-radius: 999px;
  background: #8b572f;
  font-size: 0.72rem;
  font-weight: 900;
}

.living-box-scene {
  position: relative;
  min-height: 190px;
  border: 5px solid #d8a76d;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #9ddce9 0 48%, transparent 49%),
    linear-gradient(180deg, transparent 0 46%, #ddbd82 47% 100%);
  overflow: hidden;
}

.living-box-sky {
  position: absolute;
  inset: 0 0 auto;
  height: 46%;
  background:
    radial-gradient(circle at 18% 35%, rgba(255, 255, 255, 0.9) 0 10px, transparent 11px),
    radial-gradient(circle at 28% 30%, rgba(255, 255, 255, 0.85) 0 13px, transparent 14px),
    radial-gradient(circle at 78% 24%, #ffe27a 0 18px, transparent 19px);
}

.living-box-floor {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 54%;
  background:
    repeating-linear-gradient(90deg, rgba(112, 76, 39, 0.16) 0 2px, transparent 3px 24px),
    linear-gradient(#e8c486, #c78f55);
}

.living-foreman {
  position: absolute;
  z-index: 3;
  left: 39%;
  bottom: 12px;
  width: 132px;
  height: 132px;
  animation: foreman-bob 2.5s ease-in-out infinite;
}

.living-friend {
  position: absolute;
  z-index: 2;
  bottom: 20px;
  width: 72px;
  height: 72px;
  animation-duration: 0.8s;
}

.living-friend.friend-one {
  left: 20%;
}

.living-friend.friend-two {
  right: 18%;
}

.living-wheel {
  position: absolute;
  z-index: 2;
  right: 10%;
  bottom: 62px;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 4px solid #8b572f;
  border-radius: 50%;
  background: rgba(255, 248, 218, 0.88);
  font-size: 1.7rem;
  animation: wheel-spin 4s linear infinite;
}

.living-box-note {
  margin-top: 9px;
  color: #7d5a3d;
  font-size: 0.78rem;
  line-height: 1.45;
}

@keyframes foreman-bob {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

@keyframes wheel-spin {
  to {
    transform: rotate(360deg);
  }
}

.fever-layer {
  position: absolute;
  z-index: 8;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
  overflow: hidden;
}

.fever-layer::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 225, 112, 0.24), transparent 28%),
    radial-gradient(circle at 20% 36%, rgba(148, 97, 255, 0.24), transparent 20%),
    radial-gradient(circle at 85% 22%, rgba(255, 91, 174, 0.2), transparent 19%),
    linear-gradient(180deg, rgba(7, 5, 23, 0.92), rgba(17, 8, 38, 0.82) 55%, rgba(4, 3, 13, 0.9));
  animation: fever-night-pulse 0.72s ease-in-out infinite alternate;
}

.fever-layer::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 34% 11%, #fff6ad 0 1px, transparent 2px),
    radial-gradient(circle at 78% 16%, #d7efff 0 1px, transparent 2px),
    radial-gradient(circle at 67% 42%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 24% 55%, #ffe993 0 1px, transparent 2px);
  opacity: 0.92;
  animation: fever-star-twinkle 0.48s steps(2, end) infinite;
}

.fever-layer.is-active {
  visibility: visible;
  opacity: 1;
}

.flying-wizard {
  position: absolute;
  z-index: 5;
  top: 17%;
  left: 8%;
  width: 104px;
  height: 132px;
  animation: wizard-flight 5.2s ease-in-out infinite;
}

.wizard-sprite {
  position: relative;
  display: block;
  width: 104px;
  height: 126px;
  filter:
    drop-shadow(0 8px 7px rgba(24, 12, 37, 0.32))
    drop-shadow(0 0 9px rgba(255, 224, 86, 0.72));
}

.wizard-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  opacity: 0;
}

.wizard-frame-up {
  animation: wizard-frame-up 0.78s steps(1, end) infinite;
}

.wizard-frame-middle {
  animation: wizard-frame-middle 0.78s steps(1, end) infinite;
}

.wizard-frame-down {
  animation: wizard-frame-down 0.78s steps(1, end) infinite;
}

@keyframes wizard-frame-up {
  0%,
  32.99% {
    opacity: 1;
  }
  33%,
  100% {
    opacity: 0;
  }
}

@keyframes wizard-frame-middle {
  0%,
  32.99%,
  66%,
  100% {
    opacity: 0;
  }
  33%,
  65.99% {
    opacity: 1;
  }
}

@keyframes wizard-frame-down {
  0%,
  65.99% {
    opacity: 0;
  }
  66%,
  100% {
    opacity: 1;
  }
}

.fever-banner {
  position: absolute;
  z-index: 6;
  top: 90px;
  left: 50%;
  display: flex;
  min-width: 180px;
  align-items: center;
  flex-direction: column;
  padding: 8px 13px;
  color: white;
  border: 2px solid #ffe471;
  border-radius: 14px;
  background: rgba(75, 43, 91, 0.88);
  box-shadow:
    0 5px 14px rgba(37, 20, 49, 0.28),
    0 0 14px rgba(255, 220, 66, 0.42);
  transform: translateX(-50%);
}

@keyframes fever-night-pulse {
  to {
    filter: brightness(1.18) saturate(1.22);
  }
}

@keyframes fever-star-twinkle {
  50% {
    opacity: 0.42;
    transform: translateY(1px);
  }
}

.fever-banner > strong {
  color: #fff5a8;
  font-size: 0.95rem;
  text-shadow:
    0 2px #8d5a12,
    0 0 10px #ffd94b;
}

.fever-banner > span {
  margin-top: 2px;
  font-size: 0.75rem;
  font-weight: 900;
}

.fever-sparkles {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 1px;
  width: 112px;
  color: #fff5a8;
  font-size: 0.9rem;
  letter-spacing: 0.38em;
  animation: sparkle-pulse 0.7s ease-in-out infinite alternate;
}

@keyframes sparkle-pulse {
  to {
    transform: scale(1.18) rotate(4deg);
    filter: drop-shadow(0 0 9px #fff074);
  }
}

@keyframes wizard-flight {
  0% {
    transform: translate(0, 25px) rotate(-7deg);
  }
  20% {
    transform: translate(105px, -18px) rotate(4deg);
  }
  42% {
    transform: translate(170px, 88px) rotate(8deg);
  }
  65% {
    transform: translate(62px, 185px) rotate(-4deg);
  }
  82% {
    transform: translate(-18px, 105px) rotate(-9deg);
  }
  100% {
    transform: translate(0, 25px) rotate(-7deg);
  }
}

.magic-spark {
  position: absolute;
  z-index: 7;
  width: var(--spark-size);
  height: var(--spark-size);
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 4px #fff,
    0 0 9px #fff8c9;
  animation: magic-spark-flight var(--spark-duration) ease-out forwards;
  pointer-events: none;
}

.fever-firework {
  position: absolute;
  z-index: 2;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.fever-firework-core {
  position: absolute;
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fffdf0;
  box-shadow:
    0 0 12px #fff,
    0 0 26px var(--firework-color);
  opacity: 0;
  will-change: opacity, transform;
}

.fever-firework-launch {
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 54px;
  border-radius: 999px;
  background: linear-gradient(
    to bottom,
    #fff 0 8%,
    var(--firework-color) 22%,
    transparent 100%
  );
  opacity: 0;
  transform: translate(-50%, 78px) scaleY(0.65);
  transform-origin: 50% 0;
  box-shadow: 0 0 9px var(--firework-color);
  will-change: opacity, transform;
}

.fever-firework-fragment {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 999px;
  background: var(--firework-color);
  box-shadow:
    0 0 7px var(--firework-color),
    0 0 16px rgba(255, 255, 255, 0.62);
  opacity: 0;
  will-change: opacity, transform;
}

.fever-firework-fragment:not(.is-dust) {
  width: calc(var(--firework-size) * 2.3);
  height: max(2px, calc(var(--firework-size) * 0.42));
  transform-origin: 0 50%;
}

.fever-firework-fragment.is-dust {
  width: calc(var(--firework-size) * 0.72);
  height: calc(var(--firework-size) * 0.72);
}

.magic-spark::before,
.magic-spark::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  display: none;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.magic-spark.is-bright {
  background: #fff7b2;
  box-shadow:
    0 0 5px #fff,
    0 0 12px #ffe55e,
    0 0 22px rgba(255, 230, 85, 0.72);
}

.magic-spark.is-star {
  color: #fff;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.magic-spark.is-star::before,
.magic-spark.is-star::after {
  display: block;
  width: 140%;
  height: 28%;
  border-radius: 999px;
  box-shadow: 0 0 9px #fff6a9;
}

.magic-spark.is-star::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.magic-spark.is-cross {
  color: #fff7c4;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.magic-spark.is-cross::before,
.magic-spark.is-cross::after {
  display: block;
  width: 150%;
  height: 24%;
  border-radius: 999px;
  box-shadow: 0 0 11px #fff;
}

.magic-spark.is-cross::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.magic-spark.is-cross::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

@keyframes magic-spark-flight {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.35);
  }
  15% {
    opacity: 1;
  }
  55% {
    opacity: 0.95;
    transform: translate(var(--spark-mid-x), var(--spark-mid-y)) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(var(--spark-end-x), var(--spark-end-y)) scale(0.1);
  }
}

.shop-panel {
  display: flex;
  max-height: calc(100vh - 74px);
  min-height: 680px;
  flex-direction: column;
  padding: 14px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 3px 7px),
    #6f472f;
}

.shop-heading {
  flex: 0 0 auto;
}

.shop-heading > span {
  font-size: 1.7rem;
}

.shop-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.shop-tab {
  padding: 9px 8px;
  font-size: 0.75rem;
  color: #f8ead2;
  border: 2px solid rgba(255, 221, 155, 0.45);
  border-radius: 11px;
  background: rgba(43, 27, 18, 0.42);
  font-weight: 900;
  cursor: pointer;
}

.shop-tab.is-active {
  color: #5b3b2b;
  background: linear-gradient(#fff0bd, #eec56f);
  box-shadow: 0 3px 0 #9a6635;
}

.shop-tab:hover {
  filter: brightness(1.08);
}

.shop-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding: 2px 3px 12px;
  overflow-y: auto;
  scrollbar-color: #d6a55c #4f301f;
}

.shop-section[hidden] {
  display: none;
}

.shop-item {
  position: relative;
  display: grid;
  min-height: 102px;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 3px outset #d5b17c;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(246, 234, 205, 0.94)),
    var(--paper);
  box-shadow: 0 5px 8px rgba(33, 18, 10, 0.25);
  overflow: hidden;
}

.shop-icon {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 13px;
  background: #fff0bd;
  overflow: hidden;
}

.icon-runner {
  width: 76px;
  height: 64px;
}

[data-employee-card="pudding"] .icon-runner,
[data-employee-card="roborovski"] .icon-runner,
[data-employee-card="djungarian"] .icon-runner,
[data-employee-card="goldenBrown"] .icon-runner,
[data-employee-card="goldenBlack"] .icon-runner,
[data-employee-card="longhair"] .icon-runner,
[data-employee-card="glutton"] .icon-runner,
[data-employee-card="cowboy"] .icon-runner {
  animation: none;
  background-position: left top;
}

[data-employee-card="glutton"] .icon-runner {
  background-position: center;
}

.simple-icon {
  font-size: 1.7rem;
}

.cursor-shop-icon {
  font-size: 2rem;
  text-shadow:
    0 2px 0 rgba(83, 50, 24, 0.22),
    0 0 8px rgba(255, 245, 168, 0.8);
}

.simple-icon img {
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
}

.shop-seed-icon {
  width: 44px;
  height: 44px;
}

.shop-seed-icon.is-golden {
  filter:
    drop-shadow(0 0 7px rgba(255, 226, 79, 0.9))
    drop-shadow(0 2px 0 rgba(73, 43, 18, 0.26));
}

.exchange-controls {
  display: grid;
  width: 212px;
  gap: 7px;
}

.exchange-amount-picker {
  display: grid;
  grid-template-columns: 42px 46px 52px minmax(0, 1fr);
  border: 1px solid rgba(165, 106, 35, 0.38);
  border-radius: 7px;
  background: rgba(255, 248, 221, 0.78);
  overflow: hidden;
}

.exchange-amount-button,
.exchange-amount-input {
  min-width: 0;
  height: 30px;
  color: #76502f;
  border: 0;
  border-right: 1px solid rgba(165, 106, 35, 0.25);
  border-radius: 0;
  background: transparent;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
}

.exchange-amount-button {
  padding: 0 4px;
  cursor: pointer;
}

.exchange-amount-button:hover,
.exchange-amount-button.is-active {
  color: #4f321d;
  background: #ffd66b;
}

.exchange-amount-button:focus-visible,
.exchange-amount-input:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid #d58c19;
  outline-offset: -2px;
}

.exchange-amount-input {
  width: 100%;
  padding: 0 6px;
  border-right: 0;
  text-align: center;
  appearance: textfield;
}

.exchange-amount-input::-webkit-inner-spin-button,
.exchange-amount-input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.exchange-buy-button {
  width: 100%;
  min-width: 0;
}

.shop-wizard-icon {
  width: 68px;
  height: 68px;
  transform: translateY(1px);
  filter: drop-shadow(0 3px 0 rgba(83, 50, 24, 0.2));
}

.accessory-item {
  border-color: #f1c75f;
  background: linear-gradient(90deg, #fff9dc, #fff0b8);
}

.accessory-item.is-owned {
  border-color: #96cf65;
  background: linear-gradient(90deg, #f5ffdc, #eaffbd);
}

.accessory-item.is-equipped {
  border-color: #6aa74b;
  box-shadow:
    inset 0 0 0 3px rgba(101, 169, 75, 0.22),
    0 5px 8px rgba(33, 18, 10, 0.25);
}

.accessory-shop-icon {
  background:
    radial-gradient(circle at 50% 44%, #fff7d5 0 38%, transparent 39%),
    #ffe7a3;
}

.accessory-hamster-icon {
  display: block;
  width: 68px;
  height: 60px;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  filter: drop-shadow(0 2px 0 rgba(91, 59, 43, 0.18));
}

.brand-card-icon {
  width: 54px;
  height: 54px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 0 rgba(91, 59, 43, 0.16));
}

.shop-info {
  min-width: 0;
}

.shop-info h3,
.shop-info p {
  margin: 0;
}

.shop-info h3 {
  font-size: 0.95rem;
}

.shop-info p {
  margin-top: 5px;
  color: var(--brown-soft);
  font-size: 0.75rem;
}

.buy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 82px;
  padding: 9px 8px;
  color: #53371f;
  border: 0;
  border-radius: 10px;
  background: var(--yellow);
  box-shadow: 0 4px 0 var(--yellow-dark);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.button-seed-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 0 rgba(73, 43, 18, 0.25));
}

.button-seed-icon.is-golden {
  filter:
    drop-shadow(0 0 5px rgba(255, 230, 72, 0.9))
    drop-shadow(0 1px 0 rgba(73, 43, 18, 0.25));
}

.buy-button:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.buy-button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--yellow-dark);
}

.buy-button:disabled {
  color: #817b72;
  background: #cfc8bb;
  box-shadow: 0 4px 0 #9e9688;
  cursor: not-allowed;
}

.lock-badge {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  left: 0;
  padding: 4px 8px;
  color: #6b594c;
  background: rgba(223, 216, 204, 0.95);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
}

.shop-item.is-locked > :not(.lock-badge) {
  opacity: 0.38;
  filter: grayscale(0.75);
}

.shop-item.is-locked[data-employee-card] {
  border-color: #9b9b9b;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.5), rgba(190, 190, 190, 0.55)),
    linear-gradient(#d8d8d8, #b8b8b8);
}

.shop-item.is-locked[data-employee-card] > :not(.lock-badge) {
  opacity: 1;
  filter: none;
}

.shop-item.is-locked[data-employee-card] .shop-icon {
  border-color: #9d9d9d;
  background:
    radial-gradient(circle at 50% 44%, #eeeeee 0 38%, transparent 39%),
    linear-gradient(#d7d7d7, #aaaaaa);
}

.shop-item.is-locked[data-employee-card] .icon-runner {
  opacity: 1;
  filter:
    brightness(0)
    grayscale(1)
    contrast(1.6)
    drop-shadow(0 3px 0 rgba(255, 255, 255, 0.24));
  animation: none;
  background-position: left top;
}

.shop-item.is-locked[data-employee-card] .shop-info h3,
.shop-item.is-locked[data-employee-card] .shop-info p {
  color: #3f3f3f;
}

.shop-item:not(.is-locked) .lock-badge {
  display: none;
}

.accessory-item.is-secret-locked {
  border-color: #9b9188;
  background: linear-gradient(90deg, #eee9df, #d8d2ca);
}

.accessory-item.is-secret-locked > :not(.lock-badge) {
  opacity: 1;
  filter: none;
}

.accessory-item.is-secret-locked .accessory-shop-icon {
  background: #d7d1c8;
}

.accessory-item.is-secret-locked .accessory-hamster-icon {
  opacity: 0.8;
  filter:
    brightness(0)
    grayscale(1)
    contrast(1.5)
    drop-shadow(0 2px 0 rgba(255, 255, 255, 0.26));
}

.accessory-item.is-secret-locked .shop-info h3,
.accessory-item.is-secret-locked .shop-info p {
  color: #5c5650;
}

.special-item {
  border-color: #e8b83e;
  background: linear-gradient(90deg, #fff7ce, #ffe8a2);
}

.rare-item {
  border-color: #d698ff;
  background:
    radial-gradient(circle at 8% 18%, rgba(255, 255, 255, 0.75) 0 5px, transparent 6px),
    linear-gradient(90deg, #fff2c7, #efd6ff);
}

.rare-item.is-owned {
  border-color: #8fcf7a;
  background: linear-gradient(90deg, #f7ffd6, #dcffd2);
}

.rare-shop-icon {
  background:
    radial-gradient(circle at 50% 42%, #fff8d4 0 38%, transparent 39%),
    linear-gradient(#ead5ff, #fff0ae);
}

.shop-foreman-icon {
  width: 74px;
  height: 74px;
}

.foreman-dex-image {
  width: 104px;
  height: 104px;
}

.scientist-rare-item {
  border-color: #78c6c8;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.82) 0 5px, transparent 6px),
    linear-gradient(90deg, #f0fffb, #e5f5ff);
}

.scientist-shop-icon {
  background: #fff0bd;
}

.shop-scientist-icon {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 0;
}

.science-item {
  border-color: #6fc9d0;
  background: linear-gradient(90deg, #ecfffa, #dff5ff);
}

.science-shop-icon {
  color: #276d7d;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.86) 0 36%, transparent 37%),
    linear-gradient(#d9ffff, #b6e8ff);
  font-size: 1.9rem;
}

.shop-list.research-section {
  display: block;
  padding: 2px 1px 18px;
  overflow-x: hidden;
  overflow-y: auto;
}

.shop-list.research-section[hidden] {
  display: none;
}

.research-lab {
  position: relative;
  min-height: 100%;
  padding: 12px 10px 24px;
  color: #3f352a;
  background:
    linear-gradient(rgba(165, 145, 112, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(165, 145, 112, 0.1) 1px, transparent 1px),
    #faf8f1;
  background-size: 18px 18px;
  border: 2px solid #d9cfbd;
  border-radius: 8px;
}

.research-lab-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.research-lab-heading span {
  color: #827360;
  font-size: 0.64rem;
  font-weight: 1000;
}

.research-lab-heading h3 {
  margin: 2px 0 0;
  color: #493a2b;
  font-size: 1.05rem;
}

.research-golden-balance {
  display: inline-flex;
  min-width: 72px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid #d8b248;
  border-radius: 999px;
  background: #fff5c8;
  box-shadow: 0 2px 0 rgba(152, 105, 35, 0.2);
}

.research-golden-balance img,
.research-root-button img,
.research-node-cost img,
.research-singularity-button img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.research-scientist {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(100%, 270px);
  min-height: 58px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0 auto 28px;
  padding: 8px;
  border: 2px solid #aaa59b;
  border-radius: 8px;
  background: #efede7;
  box-shadow: 0 3px 0 rgba(92, 77, 60, 0.14);
}

.research-scientist::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 2px;
  height: 30px;
  background: #c9b78f;
  content: "";
}

.research-scientist.is-owned {
  border-color: #5daf7b;
  background: #e8f8ed;
}

.research-scientist-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.84);
  font-size: 1.12rem;
}

.research-scientist span,
.research-scientist strong {
  display: block;
}

.research-scientist span {
  color: #817568;
  font-size: 0.56rem;
  font-weight: 900;
}

.research-scientist strong {
  margin-top: 2px;
  font-size: 0.74rem;
}

.research-scientist > b {
  padding: 4px 6px;
  border-radius: 999px;
  color: #fff;
  background: #9b968e;
  font-size: 0.56rem;
  white-space: nowrap;
}

.research-scientist.is-owned > b {
  background: #4f9e6d;
}

.research-root {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(100%, 310px);
  min-height: 82px;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0 auto 32px;
  padding: 9px;
  border: 2px solid #e4b646;
  border-radius: 8px;
  background: linear-gradient(135deg, #fffdf3, #fff0b9);
  box-shadow: 0 4px 0 rgba(161, 117, 42, 0.22);
}

.research-root::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 2px;
  height: 34px;
  background: #c9b78f;
  content: "";
}

.research-root.is-locked {
  border-color: #aaa59b;
  background: #efede7;
  filter: grayscale(0.45);
}

.research-root.is-owned {
  border-color: #58ad78;
  background: linear-gradient(135deg, #f8fff8, #dff5e6);
}

.research-root-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  font-size: 1.35rem;
}

.research-root-copy {
  min-width: 0;
}

.research-root-copy > span {
  color: #92762f;
  font-size: 0.62rem;
  font-weight: 1000;
}

.research-root-copy strong,
.research-root-copy p {
  display: block;
  margin: 2px 0 0;
}

.research-root-copy strong {
  font-size: 0.84rem;
}

.research-root-copy p {
  color: #786a58;
  font-size: 0.66rem;
}

.research-root-button {
  display: inline-flex;
  min-width: 54px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 7px;
  border: 1px solid #d6a835;
  border-radius: 8px;
  color: #593b14;
  background: #ffd663;
  box-shadow: 0 3px 0 #b77a23;
  font-weight: 1000;
  cursor: pointer;
}

.research-root-button:disabled {
  border-color: #aaa69e;
  color: #77736c;
  background: #d8d5cf;
  box-shadow: 0 3px 0 #9a9690;
  cursor: not-allowed;
}

.research-lock-banner {
  position: relative;
  z-index: 2;
  margin: -18px auto 16px;
  padding: 8px 10px;
  border: 1px dashed #a49c8f;
  border-radius: 8px;
  color: #665f54;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.7rem;
  font-weight: 900;
  text-align: center;
}

.research-branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 10px;
  margin-bottom: 34px;
}

.research-branches::before {
  position: absolute;
  top: -17px;
  left: 25%;
  width: 50%;
  height: 2px;
  background: #c9b78f;
  content: "";
}

.research-branches.is-locked {
  filter: grayscale(0.55);
}

.research-branch {
  --branch-color: #54ad7b;
  --branch-soft: #e7f8ed;
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
}

.research-branch::before {
  position: absolute;
  z-index: 0;
  top: -17px;
  bottom: 20px;
  left: 50%;
  width: 2px;
  background: color-mix(in srgb, var(--branch-color) 45%, #c9b78f);
  content: "";
}

.research-branch--touch {
  --branch-color: #e6a23d;
  --branch-soft: #fff1dc;
}

.research-branch--magic {
  --branch-color: #9b78d1;
  --branch-soft: #f0eaff;
}

.research-branch--logistics {
  --branch-color: #559bc7;
  --branch-soft: #e5f4fc;
}

.research-branch-heading {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--branch-color) 42%, white);
  border-radius: 8px;
  background: var(--branch-soft);
}

.research-branch-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
}

.research-branch-heading strong,
.research-branch-heading span {
  display: block;
}

.research-branch-heading strong {
  color: color-mix(in srgb, var(--branch-color) 68%, #302a25);
  font-size: 0.72rem;
}

.research-branch-heading div > span {
  margin-top: 2px;
  color: #7c7367;
  font-size: 0.55rem;
}

.research-node {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 104px;
  align-content: start;
  padding: 9px 8px 8px;
  border: 2px solid #d7d2c9;
  border-radius: 8px;
  color: #443b32;
  background: #f4f2ee;
  box-shadow: 0 3px 0 rgba(92, 77, 60, 0.13);
  text-align: left;
  cursor: pointer;
}

.research-node::before {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 2px;
  height: 12px;
  background: var(--branch-color);
  content: "";
}

.research-node-tier {
  color: var(--branch-color);
  font-size: 0.54rem;
  font-weight: 1000;
}

.research-node-status {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #aaa59d;
  font-size: 0.62rem;
  font-weight: 1000;
}

.research-node > strong {
  max-width: calc(100% - 20px);
  margin-top: 7px;
  font-size: 0.72rem;
  line-height: 1.25;
}

.research-node-description {
  margin-top: 4px;
  color: #7b7268;
  font-size: 0.6rem;
}

.research-node-cost {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 3px;
  margin-top: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #705326;
  background: #fff3bf;
  font-size: 0.62rem;
}

.research-node.is-available {
  border-color: var(--branch-color);
  background: color-mix(in srgb, var(--branch-soft) 72%, white);
}

.research-node.is-available .research-node-status {
  color: #5f430f;
  background: #ffd35b;
}

.research-node.is-owned {
  border-color: var(--branch-color);
  background: var(--branch-soft);
}

.research-node.is-owned .research-node-status {
  background: var(--branch-color);
}

.research-node.is-owned .research-node-cost {
  opacity: 0.55;
}

.research-node:disabled {
  cursor: not-allowed;
}

.research-node.is-unavailable {
  opacity: 0.78;
}

.research-node:not(:disabled):hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.research-singularity {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(100%, 320px);
  min-height: 80px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  padding: 9px;
  border: 2px solid #aaa59b;
  border-radius: 8px;
  background: #efede7;
  box-shadow: 0 4px 0 rgba(92, 77, 60, 0.16);
}

.research-singularity::before {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 2px;
  height: 36px;
  background: #c9b78f;
  content: "";
}

.research-singularity.is-available {
  border-color: #b77dd4;
  background: linear-gradient(135deg, #fff9dc, #f0dcff);
  box-shadow: 0 4px 0 rgba(126, 73, 151, 0.22);
}

.research-singularity.is-owned {
  border-color: #d19a30;
  background: linear-gradient(135deg, #fff8d3, #ffe4a3);
}

.research-singularity-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.84);
  font-size: 1.3rem;
}

.research-singularity-copy {
  min-width: 0;
}

.research-singularity-copy span,
.research-singularity-copy strong,
.research-singularity-copy p {
  display: block;
}

.research-singularity-copy span {
  color: #886c9b;
  font-size: 0.56rem;
  font-weight: 1000;
}

.research-singularity-copy strong {
  margin-top: 3px;
  font-size: 0.76rem;
}

.research-singularity-copy p {
  margin: 3px 0 0;
  color: #766d64;
  font-size: 0.56rem;
  line-height: 1.3;
}

.research-singularity-button {
  display: inline-flex;
  min-width: 58px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 7px;
  border: 1px solid #a76cc4;
  border-radius: 8px;
  color: #51315f;
  background: #e9c4fa;
  box-shadow: 0 3px 0 #8c58a5;
  font-weight: 1000;
  cursor: pointer;
}

.research-singularity-button:disabled {
  border-color: #aaa69e;
  color: #77736c;
  background: #d8d5cf;
  box-shadow: 0 3px 0 #9a9690;
  cursor: not-allowed;
}

.scientist-dex-image {
  width: 104px;
  height: 104px;
  border-radius: 15px;
}

.building-item {
  border-color: #90bc77;
  background: linear-gradient(90deg, #eff7df, #d6ebc7);
}

.wheel-icon {
  border: 7px solid #ce8e2c;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px #f6bd45;
  font-size: 1.5rem;
  animation: wheel-spin 3s linear infinite;
}

.save-footer {
  flex: 0 0 auto;
  padding: 8px 4px 1px;
  color: #f9e9cf;
  font-size: 0.75rem;
  text-align: center;
}

.hamster-dex {
  width: min(860px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  color: var(--brown);
  border: 5px solid #9c6235;
  border-radius: 22px;
  background: #fff7dc;
  box-shadow: 0 24px 80px rgba(35, 20, 10, 0.48);
  overflow: hidden;
}

.hamster-dex::backdrop {
  background: rgba(37, 26, 42, 0.66);
  backdrop-filter: blur(4px);
}

.dex-window {
  max-height: calc(100vh - 42px);
  padding: 18px;
  overflow-y: auto;
}

.dex-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px dashed #d5ad70;
}

.dex-heading p,
.dex-heading h2 {
  margin: 0;
}

.dex-heading p {
  color: var(--yellow-dark);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.dex-heading h2 {
  font-size: 1.7rem;
}

.dex-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #704937;
  border: 0;
  border-radius: 50%;
  background: #ecd3a6;
  font-size: 1.6rem;
  cursor: pointer;
}

.dex-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0;
  padding: 9px 12px;
  border-radius: 12px;
  background: #f1d99f;
}

.dex-progress strong {
  color: #8d5a12;
}

.dex-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.dex-card {
  position: relative;
  display: grid;
  min-height: 138px;
  grid-template-columns: 125px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 2px solid #d8b67f;
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: 0 5px 12px rgba(91, 59, 43, 0.1);
  overflow: hidden;
}

.dex-portrait {
  display: grid;
  width: 120px;
  height: 110px;
  place-items: center;
  border-radius: 13px;
  background:
    radial-gradient(circle, #fff8cf, #e9c982);
  transition: filter 180ms ease;
}

.dex-portrait .run-cycle {
  width: 105px;
  height: 105px;
}

.dex-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.dex-card--wizard .dex-portrait {
  overflow: hidden;
}

.dex-card--wizard .dex-portrait img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  object-position: center;
}

.dex-card h3,
.dex-card p {
  margin: 0;
}

.dex-card h3 {
  font-size: 1rem;
}

.dex-card p {
  margin: 5px 0 9px;
  color: var(--brown-soft);
  font-size: 0.75rem;
  line-height: 1.45;
}

.dex-card > div:last-child > span {
  color: #73513e;
  font-size: 0.72rem;
  font-weight: 800;
}

.dex-card.is-undiscovered::after {
  content: "🔒 미발견";
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(82, 72, 67, 0.86);
  color: white;
  font-size: 0.66rem;
  font-weight: 900;
}

.dex-card.is-undiscovered h3 {
  font-size: 0;
}

.dex-card.is-undiscovered h3::after {
  content: "???";
  font-size: 1rem;
}

.dex-card.is-undiscovered .dex-secret {
  font-size: 0;
}

.dex-card.is-undiscovered .dex-secret::after {
  content: "아직 정체를 알 수 없는 햄스터";
  font-size: 0.75rem;
}

.dex-card.is-undiscovered > div:last-child > span {
  display: none;
}

.dex-card.is-undiscovered .dex-portrait {
  filter: grayscale(1) brightness(0.2);
}

.dex-card--scientist.is-undiscovered .dex-portrait {
  background: #151515;
  filter: none;
}

.dex-card--scientist.is-undiscovered .scientist-dex-image {
  opacity: 0;
}

@media (max-width: 1100px) {
  .top-bar {
    grid-template-columns: 1fr auto;
  }

  .top-stats {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .game-layout {
    grid-template-columns: minmax(300px, 40%) minmax(420px, 60%);
  }

  .shop-panel {
    grid-column: 1 / -1;
    max-height: none;
    border-top: 8px ridge #b17a42;
  }

  .shop-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .exchange-item {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .exchange-controls {
    width: 100%;
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .top-bar {
    grid-template-columns: 1fr auto;
  }

  .brand small {
    display: none;
  }

  .top-stats {
    width: 100%;
    overflow-x: auto;
  }

  .top-stats > div {
    min-width: 110px;
  }

  .game-layout {
    display: block;
  }

  .click-panel,
  .kingdom-panel,
  .shop-panel {
    min-height: auto;
    border-right: 0;
    border-bottom: 8px ridge #b17a42;
  }

  .hamster-button {
    min-height: 340px;
  }

  .kingdom-panel {
    padding-bottom: 28px;
  }

  .hamster-meadow {
    min-height: 650px;
  }

  .meadow-residents,
  .shop-list {
    grid-template-columns: 1fr;
  }

  .shop-panel {
    max-height: none;
  }

  .dex-grid {
    grid-template-columns: 1fr;
  }

  .dex-card {
    grid-template-columns: 105px minmax(0, 1fr);
  }

  .dex-portrait {
    width: 100px;
    height: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }

}
