/* 养成小猫14 —— 横屏放置养成 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #2A1B12;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: #3A2418;
  user-select: none;
  -webkit-user-select: none;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #FFE8CF;
}

.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* ---------- 背景 ---------- */
.sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 78% 6%, #FFD9A8 0%, rgba(255,217,168,0) 55%),
    linear-gradient(180deg, #FFE3C2 0%, #FFD3A6 42%, #FFC08A 100%);
}

.sun {
  position: absolute;
  top: 6%;
  right: 9%;
  width: 15vh;
  height: 15vh;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #FFF6DC 0%, #FFD86B 55%, #FFB53D 100%);
  box-shadow: 0 0 6vh rgba(255, 190, 90, 0.55);
}

.hill {
  position: absolute;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.hill-a {
  left: -12%;
  bottom: 26%;
  width: 78%;
  height: 34%;
  background: linear-gradient(180deg, #A8D98A 0%, #86C46B 100%);
  opacity: 0.92;
}
.hill-b {
  right: -16%;
  bottom: 24%;
  width: 82%;
  height: 40%;
  background: linear-gradient(180deg, #B7E39A 0%, #8FCB72 100%);
  opacity: 0.85;
}

.floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.10) 0 2px, rgba(255,255,255,0) 2px 26px),
    linear-gradient(180deg, #9BD47C 0%, #7CBE5F 60%, #6BAF52 100%);
  border-top: 3px solid rgba(255,255,255,0.35);
}

/* ---------- 玩家资料 ---------- */
.player {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 14px rgba(160, 96, 40, 0.18);
  backdrop-filter: blur(6px);
  z-index: 6;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #FFB067, #FF8A3D);
  color: #fff;
  overflow: hidden;
  flex: 0 0 auto;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar .mp-icon { width: 20px; height: 20px; }
.player-meta { display: flex; flex-direction: column; line-height: 1.15; }
.player-name {
  font-size: 13px;
  font-weight: 700;
  color: #4A2C18;
  max-width: 30vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-sub { font-size: 10px; color: #A87A54; margin-top: 2px; }

/* ---------- 资源条 ---------- */
.hud {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  display: flex;
  gap: 8px;
  z-index: 6;
}
.chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 14px rgba(160, 96, 40, 0.16);
  font-size: 13px;
  font-weight: 700;
  color: #5A3A22;
  font-variant-numeric: tabular-nums;
}
.chip .mp-icon { width: 16px; height: 16px; color: #FF8A3D; }
.chip:nth-child(2) .mp-icon { color: #FF5C8A; }
.chip:nth-child(3) .mp-icon { color: #4FA8FF; }

/* ---------- 小猫 ---------- */
.cat-wrap {
  position: absolute;
  left: 50%;
  bottom: 27%;
  transform: translateX(-50%);
  width: 30vh;
  height: 30vh;
  z-index: 4;
  cursor: pointer;
}
.cat-shadow {
  position: absolute;
  left: 50%;
  bottom: 2%;
  transform: translateX(-50%);
  width: 62%;
  height: 9%;
  border-radius: 50%;
  background: rgba(70, 110, 50, 0.28);
  filter: blur(3px);
}
.cat {
  position: absolute;
  inset: 0;
  animation: catIdle 2.6s ease-in-out infinite;
  transform-origin: 50% 92%;
}
@keyframes catIdle {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  50% { transform: translateY(-2%) scale(1.02, 0.98); }
}
.cat.happy { animation: catHappy 0.5s ease-in-out 2; }
@keyframes catHappy {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-14%) rotate(-5deg); }
  70% { transform: translateY(-8%) rotate(5deg); }
}

.cat-ear {
  position: absolute;
  top: 6%;
  width: 26%;
  height: 26%;
  background: linear-gradient(160deg, #FFC98A, #F5A85C);
  border-radius: 50% 50% 12% 50%;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.05);
}
.cat-ear.left { left: 12%; transform: rotate(-16deg); }
.cat-ear.right { right: 12%; transform: rotate(16deg) scaleX(-1); }
.cat-ear::after {
  content: "";
  position: absolute;
  inset: 26% 24% 30% 24%;
  background: #FFB3B3;
  border-radius: 50% 50% 20% 50%;
}

.cat-body {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 16%;
  bottom: 4%;
  border-radius: 46% 46% 40% 40% / 40% 40% 46% 46%;
  background: linear-gradient(165deg, #FFD9A8 0%, #FFC07A 55%, #F7A95E 100%);
  box-shadow: inset -6px -8px 14px rgba(214, 130, 60, 0.28), inset 6px 6px 12px rgba(255, 255, 255, 0.55);
}

.cat-face {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 16%;
  height: 46%;
}
.cat-eye {
  position: absolute;
  top: 18%;
  width: 20%;
  height: 26%;
  border-radius: 50%;
  background: #3A2418;
  box-shadow: inset 0 -2px 0 rgba(255,255,255,0.25);
  animation: blink 4.2s infinite;
}
.cat-eye.left { left: 16%; }
.cat-eye.right { right: 16%; }
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.12); }
}
.cat-nose {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translateX(-50%);
  width: 12%;
  height: 9%;
  background: #FF8FA3;
  border-radius: 50% 50% 60% 60%;
}
.cat-mouth {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translateX(-50%);
  width: 22%;
  height: 12%;
  border-bottom: 2px solid rgba(90, 55, 30, 0.55);
  border-radius: 0 0 50% 50%;
}
.cat-cheek {
  position: absolute;
  top: 46%;
  width: 18%;
  height: 12%;
  border-radius: 50%;
  background: rgba(255, 140, 150, 0.35);
}
.cat-cheek.left { left: 2%; }
.cat-cheek.right { right: 2%; }

.cat-paw {
  position: absolute;
  bottom: 4%;
  width: 26%;
  height: 16%;
  border-radius: 50%;
  background: linear-gradient(180deg, #FFE0B8, #FFC98A);
  box-shadow: 0 2px 4px rgba(190, 120, 60, 0.25);
}
.cat-paw.left { left: 12%; }
.cat-paw.right { right: 12%; }

.cat-tail {
  position: absolute;
  right: -14%;
  bottom: 18%;
  width: 34%;
  height: 16%;
  border-radius: 999px;
  background: linear-gradient(90deg, #F7A95E, #FFC98A);
  transform-origin: 0 50%;
  animation: tailWave 2.2s ease-in-out infinite;
}
@keyframes tailWave {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(14deg); }
}

.cat-bubble {
  position: absolute;
  left: 50%;
  top: -6%;
  transform: translate(-50%, -100%) scale(0.9);
  padding: 6px 12px;
  border-radius: 14px;
  background: #fff;
  color: #6B4227;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(150, 90, 40, 0.22);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.cat-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 2px;
}
.cat-bubble.show { opacity: 1; transform: translate(-50%, -100%) scale(1); }

/* ---------- 飘字 ---------- */
.floaters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.floater {
  position: absolute;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 6px rgba(190, 100, 30, 0.55);
  animation: floatUp 1s ease-out forwards;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.8); }
  25% { opacity: 1; transform: translate(-50%, -14px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(1); }
}

/* ---------- 成长条 ---------- */
.growth {
  position: absolute;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(46vw, 420px);
  padding: 8px 14px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(160, 96, 40, 0.18);
  backdrop-filter: blur(6px);
  z-index: 6;
}
.growth-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.growth-title { font-size: 12px; font-weight: 800; color: #5A3A22; }
.growth-num { font-size: 11px; color: #A87A54; font-variant-numeric: tabular-nums; }
.growth-bar {
  height: 8px;
  border-radius: 999px;
  background: #F0E1D0;
  overflow: hidden;
}
.growth-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FFB067, #FF8A3D);
  transition: width 0.35s ease;
}

/* ---------- 操作区 ---------- */
.actions {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
  z-index: 7;
}
.act {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 62px;
  height: 62px;
  padding: 0;
  border: none;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  color: #5A3A22;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  box-shadow: 0 6px 16px rgba(160, 96, 40, 0.2), inset 0 -3px 0 rgba(0, 0, 0, 0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  cursor: pointer;
}
.act .mp-icon { width: 22px; height: 22px; color: #FF8A3D; }
.act:active { transform: translateY(2px) scale(0.96); box-shadow: 0 2px 8px rgba(160, 96, 40, 0.2); }
.act-main {
  background: linear-gradient(160deg, #FFA95C, #FF8A3D);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 138, 61, 0.45), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}
.act-main .mp-icon { color: #fff; }
.act-ad { background: linear-gradient(160deg, #FFE7A8, #FFD166); }
.act-ad .mp-icon { color: #E08A00; }
.act-cost {
  position: absolute;
  top: -6px;
  right: -4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff;
  color: #FF8A3D;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(160, 96, 40, 0.2);
}
.act-ad .act-cost { color: #E08A00; }
.act.disabled { opacity: 0.55; }

/* ---------- 提示 ---------- */
.toast {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(58, 36, 24, 0.88);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9;
  max-width: 70vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* 竖屏兜底：仍铺满，不出现挡板 */
@media (orientation: portrait) {
  .cat-wrap { width: 34vw; height: 34vw; bottom: 30%; }
  .actions { gap: 6px; }
  .act { width: 56px; height: 56px; }
  .growth { width: 52vw; }
}
