:root {
  --bg: #f7f3ff;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --ink: #2f2a3a;
  --ink-soft: #5b546c;
  --accent: #ffb86b;
  --accent-strong: #ff9f4a;
  --accent-2: #8bd3dd;
  --accent-3: #c3f0ca;
  --danger: #ff7a7a;
  --shadow: 0 18px 40px rgba(80, 58, 140, 0.12);
  --shadow-soft: 0 8px 18px rgba(80, 58, 140, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --transition: 180ms ease;
  --scene-max: 960px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 20%, #ffffff 0%, #f2ebff 48%, #ebe4ff 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--ink);
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: clamp(16px, 3vw, 28px) clamp(12px, 4vw, 40px) 24px;
}

.top-bar {
  width: min(100%, var(--scene-max));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pet-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pet-name {
  border: none;
  background: var(--panel);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: clamp(18px, 2.7vw, 24px);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  outline: 2px solid transparent;
  transition: outline-color var(--transition), transform var(--transition);
  min-width: min(60vw, 280px);
}

.pet-name:focus-visible {
  outline-color: rgba(139, 211, 221, 0.7);
  transform: translateY(-1px);
}

.mood {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--ink-soft);
}

.coin-bank {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel-strong);
  border-radius: 999px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.coin-icon {
  font-size: 18px;
}

.scene {
  width: min(100%, var(--scene-max));
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 28px);
  align-items: stretch;
}

.needs {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.need {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.need-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink-soft);
}

.need-icon {
  font-size: 18px;
}

.need-value {
  margin-left: auto;
  color: var(--ink);
  font-weight: 700;
}

.need-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(99, 87, 126, 0.12);
  overflow: hidden;
}

.need-fill {
  height: 100%;
  width: 80%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8bd3dd, #b0eacd);
  transition: width 350ms ease, filter var(--transition);
}

.need[data-need="hunger"] .need-fill {
  background: linear-gradient(90deg, #ffb86b, #ffd39b);
}

.need[data-need="thirst"] .need-fill {
  background: linear-gradient(90deg, #7cc7ff, #b2e1ff);
}

.need[data-need="energy"] .need-fill {
  background: linear-gradient(90deg, #a18bff, #d2c7ff);
}

.need[data-need="cleanliness"] .need-fill {
  background: linear-gradient(90deg, #8ee6a1, #c7f5d0);
}

.need.low .need-fill {
  filter: saturate(0.7);
}

.need.critical .need-fill {
  filter: saturate(0.55) brightness(0.92);
}

.room {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 238, 255, 0.92));
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: clamp(360px, 56vw, 520px);
  padding: clamp(18px, 3vw, 26px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
}

.room-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 15%, rgba(195, 240, 202, 0.35), transparent 55%);
  z-index: 0;
}

.room-mid {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.poster {
  position: absolute;
  top: clamp(16px, 3vw, 28px);
  right: clamp(24px, 6vw, 60px);
  width: 86px;
  height: 110px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  border: 2px dashed rgba(99, 87, 126, 0.2);
  box-shadow: var(--shadow-soft);
}

.plant {
  position: absolute;
  left: clamp(18px, 3vw, 28px);
  bottom: clamp(84px, 15vw, 120px);
  width: 72px;
  height: 92px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(226, 250, 230, 0.8));
  border: 2px dashed rgba(99, 87, 126, 0.2);
  box-shadow: var(--shadow-soft);
}

.tunnel {
  position: absolute;
  right: clamp(40px, 8vw, 86px);
  bottom: clamp(88px, 16vw, 128px);
  width: 110px;
  height: 70px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.55);
  border: 2px dashed rgba(99, 87, 126, 0.2);
  box-shadow: var(--shadow-soft);
}

.bedding {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -32%;
  height: 58%;
  background: radial-gradient(circle at 50% 20%, #fff6e0 0%, #ffe3b5 55%, #ffd295 100%);
  border-radius: 50%;
  z-index: 1;
  transition: filter 300ms ease;
}

.rug {
  position: absolute;
  left: 50%;
  bottom: clamp(44px, 9vw, 70px);
  width: clamp(160px, 28vw, 240px);
  height: clamp(70px, 12vw, 100px);
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.46);
  border: 2px dashed rgba(99, 87, 126, 0.2);
  z-index: 2;
  box-shadow: inset 0 6px 14px rgba(99, 87, 126, 0.08);
}

.wheel {
  position: absolute;
  right: clamp(18px, 4vw, 32px);
  bottom: clamp(84px, 14vw, 120px);
  width: clamp(120px, 22vw, 170px);
  height: clamp(120px, 22vw, 170px);
  border-radius: 50%;
  border: 8px solid rgba(161, 139, 255, 0.45);
  background: rgba(255, 255, 255, 0.3);
  z-index: 2;
  display: grid;
  place-items: center;
  transform-origin: 50% 60%;
  transition: transform 600ms ease;
}

.wheel-inner {
  width: 56%;
  height: 56%;
  border-radius: 50%;
  border: 6px solid rgba(139, 211, 221, 0.55);
}

.wheel-stand {
  position: absolute;
  bottom: -26px;
  left: 50%;
  width: 46px;
  height: 36px;
  background: rgba(161, 139, 255, 0.55);
  border-radius: 16px;
  transform: translateX(-50%);
  box-shadow: 0 8px 12px rgba(65, 45, 120, 0.14);
}

.bowl {
  position: absolute;
  left: clamp(34px, 6vw, 70px);
  bottom: clamp(46px, 9vw, 74px);
  width: clamp(80px, 15vw, 110px);
  height: clamp(44px, 8vw, 60px);
  border-radius: 0 0 40px 40px;
  background: linear-gradient(180deg, #ffd39b, #ffb86b);
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 6px;
  box-shadow: var(--shadow-soft);
}

.bowl-fill {
  width: 70%;
  height: 40%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
}

.water-bottle {
  position: absolute;
  right: clamp(150px, 22vw, 220px);
  bottom: clamp(72px, 13vw, 112px);
  width: 60px;
  height: 130px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(124, 199, 255, 0.5), rgba(139, 211, 221, 0.65));
  border: 4px solid rgba(255, 255, 255, 0.7);
  z-index: 2;
  box-shadow: var(--shadow-soft);
}

.water-drop {
  position: absolute;
  bottom: -10px;
  left: 50%;
  width: 18px;
  height: 18px;
  background: rgba(124, 199, 255, 0.75);
  border-radius: 0 50% 50% 50%;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: 0 6px 10px rgba(70, 120, 200, 0.2);
}

.hamster {
  position: relative;
  width: clamp(170px, 30vw, 230px);
  height: clamp(170px, 30vw, 230px);
  margin: 0 auto clamp(66px, 12vw, 96px);
  z-index: 5;
  transform-origin: 50% 85%;
  animation: hamster-idle 3.8s ease-in-out infinite;
  will-change: transform;
}

.hamster-shadow {
  position: absolute;
  bottom: 10px;
  left: 50%;
  width: 62%;
  height: 18%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(66, 52, 100, 0.16);
  filter: blur(1px);
  z-index: 0;
}

.hamster-body {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 50% 50% 46% 46%;
  background:
    radial-gradient(circle at 50% 78%, rgba(255, 243, 226, 0.95) 0%, rgba(255, 222, 190, 0.92) 45%, rgba(255, 198, 140, 0.6) 70%, rgba(255, 184, 107, 0) 72%),
    radial-gradient(circle at 42% 30%, #ffecc8 0%, #ffd8a5 52%, #ffbf73 100%);
  box-shadow:
    inset 0 -10px 22px rgba(153, 92, 33, 0.18),
    inset 0 10px 18px rgba(255, 255, 255, 0.18),
    0 22px 26px rgba(99, 72, 35, 0.18);
  z-index: 2;
}

.hamster-body::before {
  content: "";
  position: absolute;
  inset: 8% 10% 18%;
  border-radius: 48% 48% 52% 52%;
  background: radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 241, 223, 0.96) 60%, rgba(255, 223, 195, 0.9) 100%);
  box-shadow: inset 0 -8px 12px rgba(212, 145, 86, 0.18);
  opacity: 0.95;
  z-index: 1;
}

.hamster-body::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 6%;
  width: 34%;
  height: 48%;
  transform: translateX(-50%);
  border-radius: 48% 48% 60% 60%;
  background: linear-gradient(180deg, rgba(176, 109, 44, 0.92) 0%, rgba(145, 86, 32, 0.88) 70%, rgba(145, 86, 32, 0) 100%);
  filter: blur(0.4px);
  opacity: 0.75;
  z-index: 1;
}

.hamster-ear {
  position: absolute;
  top: -10px;
  width: 52px;
  height: 56px;
  border-radius: 52% 52% 48% 48%;
  background: radial-gradient(circle at 50% 38%, #ffe7cc 0%, #ffd19d 78%, #f2b370 100%);
  border: 3px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 -6px 10px rgba(161, 96, 32, 0.18);
  z-index: 1;
}

.hamster-ear::after {
  content: "";
  position: absolute;
  inset: 13px 12px 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(255, 191, 191, 0.7) 0%, rgba(255, 160, 160, 0.55) 70%);
}

.ear-left {
  left: 18px;
  transform: rotate(-12deg);
}

.ear-right {
  right: 18px;
  transform: rotate(12deg);
}

.hamster-face {
  position: absolute;
  left: 50%;
  top: 34%;
  width: 72%;
  height: 48%;
  transform: translateX(-50%);
  z-index: 3;
}

.hamster-eye {
  position: absolute;
  top: 24%;
  width: 24px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 60% 35%, #3a3448 0%, #2b2736 68%, #1f1b27 100%);
  box-shadow:
    inset 0 -5px 0 rgba(0, 0, 0, 0.18),
    0 2px 0 rgba(255, 255, 255, 0.2);
  animation: hamster-blink 5.5s infinite;
  transform-origin: center 75%;
}

.hamster-eye::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 8px 6px 0 -2px rgba(255, 255, 255, 0.65);
}

.eye-left {
  left: 20%;
}

.eye-right {
  right: 20%;
}

.hamster-cheek {
  position: absolute;
  bottom: 16%;
  width: 46px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 188, 188, 0.75) 0%, rgba(255, 153, 153, 0.55) 72%, rgba(255, 153, 153, 0.2) 100%);
  filter: blur(0.3px);
  opacity: 0.9;
  z-index: 3;
}

.cheek-left {
  left: 2%;
}

.cheek-right {
  right: 2%;
}

.hamster-muzzle {
  position: absolute;
  left: 50%;
  bottom: 12%;
  width: 60%;
  height: 44%;
  transform: translateX(-50%);
  border-radius: 55% 55% 60% 60%;
  background: radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.96) 0%, rgba(255, 241, 223, 0.95) 62%, rgba(255, 223, 195, 0.9) 100%);
  box-shadow: inset 0 -8px 10px rgba(204, 134, 78, 0.18);
  z-index: 2;
}

.hamster-nose {
  position: absolute;
  left: 50%;
  bottom: 36%;
  width: 20px;
  height: 14px;
  transform: translateX(-50%);
  border-radius: 60% 60% 70% 70%;
  background: radial-gradient(circle at 50% 35%, #ffb1b1 0%, #f28f8f 70%, #d26c6c 100%);
  box-shadow: 0 2px 0 rgba(130, 66, 66, 0.2);
  z-index: 4;
}

.hamster-mouth {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 38px;
  height: 22px;
  border-radius: 0 0 22px 22px;
  border: 4px solid rgba(74, 55, 40, 0.78);
  border-top: none;
  transform: translateX(-50%);
  transition: transform var(--transition), border-color var(--transition);
  z-index: 4;
}

.hamster-mouth::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 4px;
  height: 12px;
  border-radius: 999px;
  background: rgba(74, 55, 40, 0.7);
  transform: translateX(-50%);
}

.hamster-whiskers {
  position: absolute;
  bottom: 30%;
  width: 38px;
  height: 14px;
  border-top: 3px solid rgba(88, 66, 48, 0.45);
  border-radius: 50%;
  opacity: 0.8;
  z-index: 3;
}

.hamster-whiskers::before,
.hamster-whiskers::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px solid rgba(88, 66, 48, 0.35);
  border-radius: 50%;
}

.hamster-whiskers::before {
  top: -6px;
}

.hamster-whiskers::after {
  top: 6px;
}

.whiskers-left {
  left: 6%;
  transform: rotate(8deg);
}

.whiskers-right {
  right: 6%;
  transform: scaleX(-1) rotate(8deg);
}

.hamster-paw {
  position: absolute;
  bottom: 14px;
  width: 60px;
  height: 48px;
  border-radius: 32px;
  background: radial-gradient(circle at 50% 22%, #fff0d8 0%, #ffd9a8 62%, #f3b66f 100%);
  box-shadow:
    inset 0 -6px 12px rgba(132, 77, 26, 0.18),
    0 4px 6px rgba(99, 72, 35, 0.12);
  z-index: 3;
}

.paw-left {
  left: 14px;
  transform: rotate(8deg);
}

.paw-right {
  right: 14px;
  transform: rotate(-8deg);
}

.hamster-tail {
  position: absolute;
  right: -6px;
  bottom: 60px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #ffe3c4 0%, #ffc27c 80%);
  box-shadow: inset -4px -4px 8px rgba(168, 94, 22, 0.2);
  opacity: 0.9;
}

.cosmetic-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

.hamster-bubble {
  position: absolute;
  top: -10px;
  right: -6px;
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition);
}

.hamster-bubble.show {
  opacity: 1;
  transform: translateY(0);
}

.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 8;
}

.float-text {
  position: absolute;
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 6px 10px rgba(99, 87, 126, 0.22);
  animation: float-up 1.2s ease forwards;
}

.sparkle,
.crumb,
.droplet,
.zzz {
  position: absolute;
  animation: float-up 1.1s ease forwards;
  opacity: 0.9;
}

.sparkle {
  width: 16px;
  height: 16px;
  border-radius: 6px;
  background: linear-gradient(180deg, #fff4a8, #ffd86b);
  box-shadow: 0 0 12px rgba(255, 216, 107, 0.55);
}

.crumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffd39b;
}

.droplet {
  width: 12px;
  height: 16px;
  border-radius: 0 60% 60% 60%;
  background: rgba(124, 199, 255, 0.8);
  transform: rotate(45deg);
}

.zzz {
  font-weight: 800;
  color: #8b7bff;
  text-transform: uppercase;
}

.action-bar {
  width: min(100%, var(--scene-max));
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.action-btn {
  position: relative;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--panel-strong);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
  min-height: 72px;
}

.action-btn.secondary {
  background: rgba(255, 255, 255, 0.78);
  font-weight: 600;
}

.action-btn:hover,
.action-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(80, 58, 140, 0.14);
}

.action-btn:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.action-btn:focus-visible {
  outline: 3px solid rgba(139, 211, 221, 0.7);
  outline-offset: 2px;
}

.action-emoji {
  font-size: 22px;
}

.action-text {
  font-size: 14px;
}

.action-hint {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  background: rgba(139, 211, 221, 0.2);
  padding: 2px 6px;
  border-radius: 999px;
}

.cooldown {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 40;
}

.toast {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(47, 42, 58, 0.88);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  animation: toast-in 300ms ease;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(35, 24, 70, 0.28);
  backdrop-filter: blur(6px);
  padding: 18px;
  z-index: 60;
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(820px, 96vw);
  background: var(--panel-strong);
  border-radius: 26px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-card.settings {
  width: min(520px, 94vw);
}

.modal-card.play {
  width: min(460px, 94vw);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h2 {
  margin: 0 0 4px;
}

.modal-sub {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 500;
}

.icon-btn {
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(139, 211, 221, 0.18);
  font-size: 18px;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition);
}

.icon-btn:hover,
.icon-btn:focus-visible {
  background: rgba(139, 211, 221, 0.35);
  transform: translateY(-1px);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tab {
  border: none;
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  cursor: pointer;
  color: var(--ink-soft);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.tab.active {
  background: linear-gradient(180deg, rgba(255, 184, 107, 0.32), rgba(255, 159, 74, 0.28));
  color: var(--ink);
}

.tab:hover,
.tab:focus-visible {
  transform: translateY(-1px);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.shop-card {
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 150px;
  position: relative;
}

.shop-card h3 {
  margin: 0;
  font-size: 16px;
}

.shop-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.shop-card .price {
  font-weight: 800;
  margin-top: auto;
  color: var(--ink);
}

.shop-card button {
  margin-top: 6px;
  border: none;
  border-radius: 12px;
  padding: 8px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(139, 211, 221, 0.26);
  transition: background var(--transition), transform var(--transition);
}

.shop-card button:hover,
.shop-card button:focus-visible {
  background: rgba(139, 211, 221, 0.42);
  transform: translateY(-1px);
}

.shop-card button[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.shop-card.owned::after {
  content: "Owned";
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(195, 240, 202, 0.7);
  color: var(--ink);
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft);
}

.setting-item.danger {
  border: 2px solid rgba(255, 122, 122, 0.3);
}

.setting-label {
  font-weight: 700;
}

.setting-note {
  color: var(--ink-soft);
  font-size: 13px;
}

.toggle {
  min-width: 74px;
  padding: 8px 12px;
  border-radius: 999px;
  border: none;
  font-weight: 800;
  cursor: pointer;
  background: rgba(139, 211, 221, 0.26);
  color: var(--ink);
  transition: background var(--transition), transform var(--transition);
}

.toggle[aria-pressed="true"] {
  background: rgba(195, 240, 202, 0.8);
}

.toggle:hover,
.toggle:focus-visible {
  transform: translateY(-1px);
}

.soft-btn,
.danger-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--transition), filter var(--transition);
}

.soft-btn {
  background: rgba(139, 211, 221, 0.28);
  color: var(--ink);
}

.danger-btn {
  background: rgba(255, 122, 122, 0.25);
  color: #a53b3b;
}

.soft-btn:hover,
.soft-btn:focus-visible,
.danger-btn:hover,
.danger-btn:focus-visible {
  transform: translateY(-1px);
}

.wheel-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.wheel-track {
  position: relative;
  width: min(320px, 80vw);
  height: 64px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(139, 211, 221, 0.3), rgba(255, 184, 107, 0.38));
  box-shadow: inset 0 8px 14px rgba(80, 58, 140, 0.08);
  overflow: hidden;
}

.wheel-track::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 64px;
  height: 100%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.55);
  border-left: 2px dashed rgba(47, 42, 58, 0.22);
  border-right: 2px dashed rgba(47, 42, 58, 0.22);
}

.wheel-pointer {
  position: absolute;
  top: 50%;
  left: 8%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: white;
  border: 4px solid rgba(161, 139, 255, 0.6);
  transform: translate(-50%, -50%);
  box-shadow: var(--shadow-soft);
}

.wheel-status {
  font-weight: 700;
  color: var(--ink-soft);
}

.wheel-actions {
  display: flex;
  gap: 8px;
}

.room.sleeping .hamster {
  animation-duration: 5.8s;
  filter: saturate(0.92);
}

.room.grumpy .hamster-mouth {
  border-color: rgba(70, 55, 55, 0.82);
  transform: translateX(-50%) rotate(180deg);
  border-top: none;
}

.room.sleepy .hamster-eye {
  animation-duration: 7.6s;
}

.room.happy .hamster {
  animation-duration: 3.1s;
}

.room.happy .bedding {
  filter: saturate(1.05);
}

.room.playing .hamster {
  animation: hamster-play 900ms ease-in-out 3;
}

.room.feeding .hamster {
  animation: hamster-feed 850ms ease-in-out 2;
}

.room.drinking .hamster {
  animation: hamster-drink 850ms ease-in-out 2;
}

.room.cleaning .hamster {
  animation: hamster-happy-hop 900ms ease-in-out 2;
}

.room.sparkle .sparkle {
  animation-duration: 1.3s;
}

.room.reduced-motion .hamster,
.room.reduced-motion .hamster-eye,
.room.reduced-motion .room.playing .hamster,
.room.reduced-motion .room.feeding .hamster,
.room.reduced-motion .room.drinking .hamster,
.room.reduced-motion .room.cleaning .hamster {
  animation: none !important;
}

.decor-item,
.toy-item,
.outfit-item {
  position: absolute;
  pointer-events: none;
  z-index: 4;
}

.decor-item.poster-daisies {
  top: clamp(20px, 4vw, 32px);
  right: clamp(26px, 6vw, 64px);
  width: 86px;
  height: 110px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff 0%, #f7ffe9 100%);
  border: 4px solid rgba(255, 184, 107, 0.36);
  display: grid;
  place-items: center;
  font-size: 28px;
}

.decor-item.poster-night {
  top: clamp(20px, 4vw, 32px);
  right: clamp(26px, 6vw, 64px);
  width: 86px;
  height: 110px;
  border-radius: 20px;
  background: linear-gradient(180deg, #1d1b40 0%, #3c2f88 100%);
  border: 4px solid rgba(161, 139, 255, 0.45);
  display: grid;
  place-items: center;
  font-size: 24px;
  color: #fff8d6;
}

.decor-item.plant-sprout {
  left: clamp(26px, 4vw, 34px);
  bottom: clamp(94px, 16vw, 130px);
  width: 64px;
  height: 90px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff 0%, #dcffe3 100%);
  border: 3px solid rgba(139, 211, 221, 0.4);
}

.decor-item.plant-sprout::before {
  content: "🌱";
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translateX(-50%);
  font-size: 30px;
}

.decor-item.rug-peach {
  left: 50%;
  bottom: clamp(46px, 9vw, 72px);
  width: clamp(170px, 30vw, 250px);
  height: clamp(78px, 13vw, 110px);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #ffe9d1 0%, #ffcf9f 70%, #ffb86b 100%);
  box-shadow: inset 0 8px 18px rgba(153, 92, 33, 0.14);
}

.decor-item.rug-moss {
  left: 50%;
  bottom: clamp(46px, 9vw, 72px);
  width: clamp(170px, 30vw, 250px);
  height: clamp(78px, 13vw, 110px);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #eafff0 0%, #bff1c9 70%, #8ee6a1 100%);
  box-shadow: inset 0 8px 18px rgba(70, 145, 94, 0.14);
}

.toy-item.ball {
  left: clamp(86px, 14vw, 130px);
  bottom: clamp(62px, 11vw, 90px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #ffb3b3 55%, #ff8d8d 100%);
  border: 4px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft);
}

.toy-item.chew {
  right: clamp(110px, 18vw, 180px);
  bottom: clamp(62px, 11vw, 94px);
  width: 90px;
  height: 26px;
  border-radius: 18px;
  background: linear-gradient(90deg, #ffd39b, #ffb86b);
  border: 3px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft);
}

.toy-item.tunnel {
  right: clamp(46px, 9vw, 92px);
  bottom: clamp(94px, 16vw, 134px);
  width: 110px;
  height: 70px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(195, 240, 202, 0.6));
  border: 4px solid rgba(139, 211, 221, 0.42);
}

.outfit-item {
  inset: 0;
}

.outfit-item.hat::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  width: 120px;
  height: 60px;
  border-radius: 60px 60px 24px 24px;
  background: linear-gradient(180deg, #ffb86b, #ff9f4a);
  transform: translateX(-50%);
  box-shadow: var(--shadow-soft);
}

.outfit-item.hat::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 62px;
  width: 136px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  transform: translateX(-50%);
}

.outfit-item.bow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 58px;
  width: 84px;
  height: 46px;
  border-radius: 24px;
  transform: translateX(-50%);
  background: radial-gradient(circle at 30% 40%, #ffd9f2 0%, #ff9fda 70%, #ff7ec8 100%);
  box-shadow: var(--shadow-soft);
}

.outfit-item.bow::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 70px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: white;
  transform: translateX(-50%);
}

.outfit-item.hoodie::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 38px;
  width: 176px;
  height: 122px;
  border-radius: 60px;
  background: linear-gradient(180deg, rgba(161, 139, 255, 0.82), rgba(124, 199, 255, 0.7));
  transform: translateX(-50%);
  box-shadow: inset 0 -10px 16px rgba(70, 90, 180, 0.18);
}

.outfit-item.hoodie::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 132px;
  width: 132px;
  height: 74px;
  border-radius: 70px 70px 40px 40px;
  background: rgba(161, 139, 255, 0.9);
  transform: translateX(-50%);
}

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

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

@keyframes hamster-blink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }
  94% {
    transform: scaleY(0.2);
  }
  96% {
    transform: scaleY(1);
  }
}

@keyframes hamster-play {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  30% {
    transform: translateY(-10px) rotate(-4deg);
  }
  60% {
    transform: translateY(-4px) rotate(4deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes hamster-feed {
  0%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-4px) scale(1.02);
  }
  70% {
    transform: translateY(-2px) scale(1.01);
  }
}

@keyframes hamster-drink {
  0%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-3px) rotate(-3deg);
  }
  70% {
    transform: translateY(-2px) rotate(2deg);
  }
}

@keyframes hamster-happy-hop {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

@keyframes float-up {
  0% {
    transform: translateY(0) scale(0.9);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(-42px) scale(1.05);
    opacity: 0;
  }
}

@keyframes toast-in {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .scene {
    grid-template-columns: 1fr;
  }

  .needs {
    order: 2;
  }

  .room {
    order: 1;
    min-height: clamp(380px, 76vw, 520px);
  }

  .action-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .coin-bank {
    align-self: flex-start;
  }

  .action-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toast-stack {
    right: 12px;
    bottom: 12px;
  }
}
