.spot-scene-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  z-index: 10;
  position: relative;
  background: linear-gradient(90deg, rgba(34,34,34,0.72) 60%, rgba(34,34,34,0.10) 100%);
  border-radius: 14px 14px 0 0;
  padding: 7px 16px 6px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  min-height: 38px;
  backdrop-filter: blur(2px);
}
.spot-scene-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.18), 0 1px 0 #222, 0 0 4px #0004;

/* 景区底部按钮可读性增强 */
.spot-scene-actions {
  display: flex;
  gap: 18px;
  margin-bottom: 8px;
  padding: 4px 12px;
  border-radius: 10px;
  background: rgba(34,34,34,0.32);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  align-items: center;
  justify-content: flex-start;
  width: fit-content;
}
.spot-scene-actions .action-btn, .spot-scene-actions button, .spot-scene-actions a {
  color: #fff !important;
  font-weight: 800;
  text-shadow: 0 2px 8px #000c, 0 1px 0 #222;
  font-size: 16px;
  letter-spacing: 0.5px;
  background: rgba(34,34,34,0.38);
  border-radius: 7px;
  padding: 2px 10px;
  margin: 0 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.13);
  transition: color 0.2s, background 0.2s;
}
.spot-scene-actions .action-btn:hover, .spot-scene-actions button:hover, .spot-scene-actions a:hover {
  color: #ffe066 !important;
  background: rgba(34,34,34,0.60);
}
  padding-right: 10px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-close {
  background: rgba(34,34,34,0.72);
  border: none;
  font-size: 26px;
  color: #fff;
  cursor: pointer;
  padding: 2px 14px 2px 14px;
  border-radius: 12px;
  opacity: 0.92;
  transition: opacity 0.2s, background 0.2s;
  box-shadow: 0 2px 8px #0006;
  margin-left: 8px;
}
.modal-close:hover {
  opacity: 1;
  background: rgba(34,34,34,0.92);
}
@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&family=Nunito:wght@500;700;800&display=swap");

/* ═══════════════════════════════════════════════════
   DIGITAL PET  –  styles.css
   ═══════════════════════════════════════════════════ */

:root {
  --bg: #fff8f0;
  --bg-a: #ffe9d6;
  --bg-b: #ffe3f3;
  --card: rgba(255,255,255,0.93);
  --ink: #2d1c12;
  --soft: #8a6a56;
  --accent: #ff7043;
  --accent2: #ffb74d;
  --ok: #66bb6a;
  --warn: #ffa726;
  --bad: #ef5350;
  --loyalty-warn: #ff5252;
  --nav-h: 64px;
  --top-h: 54px;
  /* Safe area for notch/home-indicator phones */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Global mobile optimizations ───────────────────── */
/* Disable tap highlight on all interactive elements */
a, button, [role="button"], input, label, select, textarea {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;  /* removes 300ms tap delay */
}
/* Prevent accidental text-selection on buttons */
button, .nav-btn, .action-btn, .icon-btn, .shop-btn, .picker-item {
  user-select: none;
  -webkit-user-select: none;
}
/* Smooth momentum scrolling on iOS */
.modal-sheet, .shop-cat-tabs, .pet-tabs {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

body {
  font-family: "Nunito", "Baloo 2", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, var(--bg-a) 0, transparent 30%),
    radial-gradient(circle at 90% 90%, var(--bg-b) 0, transparent 35%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .5s ease, color .3s ease;
}

body.theme-morning {
  --bg: #fffaf2;
  --bg-a: #ffe7bd;
  --bg-b: #ffd9ef;
  --card: rgba(255, 255, 255, 0.92);
  --accent: #ff8a3d;
  --accent2: #ffc06a;
}

body.theme-noon {
  --bg: #f5fbff;
  --bg-a: #d9f0ff;
  --bg-b: #f5f1ff;
  --card: rgba(255, 255, 255, 0.95);
  --accent: #2f97f2;
  --accent2: #58c0ff;
}

body.theme-afternoon {
  --bg: #fff7ef;
  --bg-a: #ffdcb8;
  --bg-b: #ffe8d1;
  --card: rgba(255, 255, 255, 0.93);
  --accent: #f07a43;
  --accent2: #ffb261;
}

body.theme-night {
  --bg: #141d30;
  --bg-a: #29446f;
  --bg-b: #2b2f5f;
  --card: rgba(23, 33, 54, 0.85);
  --ink: #e8efff;
  --soft: #b6c5e2;
  --accent: #7dc1ff;
  --accent2: #98e0ff;
}

body.theme-night .topbar,
body.theme-night .modal-sheet,
body.theme-night .rename-modal-card,
body.theme-night .confirm-dialog-card,
body.theme-night .spot-scene-card,
body.theme-night .login-card {
  background: rgba(19, 29, 48, 0.9);
}

body.theme-night .auth-input,
body.theme-night .picker-item,
body.theme-night .shop-item,
body.theme-night .task-item,
body.theme-night .card-item,
body.theme-night .icon-btn,
body.theme-night .action-btn,
body.theme-night .pet-tab,
body.theme-night .weather-chip {
  background: rgba(26, 38, 63, 0.9);
  color: var(--ink);
  border-color: rgba(147, 177, 225, 0.25);
}
body.theme-night #adopterChip {
  background: rgba(26, 38, 63, 0.9);
  border-color: rgba(147, 177, 225, 0.25);
}
body.theme-night .adopter-chip-bar { background: rgba(255,255,255,0.12); }

.hidden { display: none !important; }

/* ── Toast ─────────────────────────────────────────── */
.toast-container {
  position: fixed; top: 14px; left: 50%;
  transform: translateX(-50%);
  z-index: 9999; pointer-events: none;
}
.toast {
  background: rgba(38,29,21,0.88); color: #fff;
  padding: 10px 18px; border-radius: 999px;
  margin-top: 8px; font-size: 13px;
  animation: fade-up 0.25s ease;
}

/* ── Particles ──────────────────────────────────────── */
.particles-layer {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 8888; overflow: hidden;
}
.particle {
  position: absolute; font-size: 22px;
  animation: float-up 1s ease-out forwards;
}

/* ═══════════════ KEY-FRAME ANIMATIONS ═════════════════ */

/* Default idle float */
@keyframes pet-bob {
  0%,100% { transform: translateY(0)   scale(1);    filter: drop-shadow(0  8px 5px rgba(0,0,0,.18)); }
  50%      { transform: translateY(-14px) scale(1.04); filter: drop-shadow(0 20px 8px rgba(0,0,0,.09)); }
}
@keyframes pet-shadow-bob {
  0%,100% { transform: scaleX(1);    opacity: .30; }
  50%      { transform: scaleX(.72); opacity: .12; }
}

/* Slow sleeping float */
@keyframes pet-sleep {
  0%,100% { transform: translateY(0) rotate(-4deg) scale(.96); filter: drop-shadow(0 6px 4px rgba(0,0,0,.15)); }
  50%      { transform: translateY(-6px) rotate(2deg) scale(.97); filter: drop-shadow(0 10px 6px rgba(0,0,0,.10)); }
}
@keyframes pet-sprite-sleep-breathe {
  0%,100% { transform: translate(-50%, -50%) translateY(0) scale(0.985); }
  50%      { transform: translate(-50%, -50%) translateY(4px) scale(1.012); }
}
@keyframes pet-shadow-sleep {
  0%,100% { transform: translateX(-50%) scaleX(0.94); opacity: .20; }
  50%      { transform: translateX(-50%) scaleX(0.82); opacity: .12; }
}
/* ZZZ badge pulse */
@keyframes zzz-float {
  0%   { opacity:0; transform:translateY(0) scale(.6); }
  30%  { opacity:1; }
  100% { opacity:0; transform:translateY(-28px) scale(1); }
}

/* Waking-up stretch */
@keyframes pet-wake {
  0%   { transform: scaleX(.85) scaleY(1.1) rotate(-2deg); }
  40%  { transform: scaleX(1.12) scaleY(.9) rotate(3deg); }
  70%  { transform: scaleX(.95) scaleY(1.05) rotate(-1deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Eating chomp */
@keyframes pet-eat {
  0%,100% { transform: translateY(0)    scale(1); }
  20%      { transform: translateY(-8px) scale(1.12); }
  40%      { transform: translateY(2px)  scale(.94); }
  60%      { transform: translateY(-5px) scale(1.08); }
  80%      { transform: translateY(1px)  scale(.97); }
}

/* Playing swing */
@keyframes pet-play {
  0%   { transform: rotate(-12deg) translateX(-6px) scale(1); }
  25%  { transform: rotate( 14deg) translateX( 8px) scale(1.08) translateY(-10px); }
  50%  { transform: rotate(-10deg) translateX(-5px) scale(1); }
  75%  { transform: rotate( 12deg) translateX( 7px) scale(1.06) translateY(-8px); }
  100% { transform: rotate(-12deg) translateX(-6px) scale(1); }
}

/* Cleaning spin */
@keyframes pet-clean {
  0%   { transform: rotate(0)   scale(1); filter: drop-shadow(0 8px 5px rgba(0,0,0,.15)) brightness(1);   }
  25%  { transform: rotate(90deg) scale(1.06) translateY(-4px); filter: brightness(1.15) drop-shadow(0 0 10px #90caf9); }
  50%  { transform: rotate(180deg) scale(1);  filter: brightness(1.2)  drop-shadow(0 0 14px #64b5f6); }
  75%  { transform: rotate(270deg) scale(1.06) translateY(-4px); filter: brightness(1.15) drop-shadow(0 0 10px #90caf9); }
  100% { transform: rotate(360deg) scale(1);  filter: drop-shadow(0 8px 5px rgba(0,0,0,.15)) brightness(1);   }
}

/* Resting gentle sway */
@keyframes pet-rest {
  0%,100% { transform: rotate(-3deg) scale(.97); }
  50%      { transform: rotate( 3deg) scale(.99) translateY(-4px); }
}

/* Happy jump */
@keyframes pet-happy {
  0%,100% { transform: translateY(0) scale(1); }
  20%      { transform: translateY(-22px) scale(1.1) rotate(-5deg); }
  40%      { transform: translateY(-16px) scale(1.06) rotate(4deg); }
  60%      { transform: translateY(-20px) scale(1.08) rotate(-3deg); }
  80%      { transform: translateY(-8px)  scale(1.03) rotate(2deg); }
}

/* Sad drooping */
@keyframes pet-sad {
  0%,100% { transform: translateY(0)   rotate(-2deg) scale(1);    filter: drop-shadow(0 5px 3px rgba(0,0,0,.15)) saturate(.6); }
  50%      { transform: translateY(4px) rotate( 2deg) scale(.96); filter: drop-shadow(0 3px 2px rgba(0,0,0,.1))  saturate(.5); }
}

/* Ill wobble */
@keyframes pet-ill {
  0%,100% { transform: rotate(-2deg) scale(.96); filter: grayscale(.5) drop-shadow(0 4px 3px rgba(0,0,0,.1)); }
  33%      { transform: rotate( 3deg) scale(.97); }
  66%      { transform: rotate(-3deg) scale(.96); }
}

/* Angry vibrate */
@keyframes pet-angry {
  0%,100% { transform: translate(0,0) rotate(0); filter: drop-shadow(0 4px 4px rgba(239,83,80,.4)); }
  20%      { transform: translate(-4px, 0) rotate(-3deg); }
  40%      { transform: translate( 4px, 0) rotate( 3deg); }
  60%      { transform: translate(-3px, 0) rotate(-2deg); }
  80%      { transform: translate( 3px, 0) rotate( 2deg); }
}

/* Excited rapid bounce */
@keyframes pet-excited {
  0%,100% { transform: translateY(0)    scale(1); }
  15%      { transform: translateY(-18px) scale(1.12) rotate(-4deg); }
  30%      { transform: translateY(-4px)  scale(.96); }
  45%      { transform: translateY(-14px) scale(1.08) rotate( 4deg); }
  60%      { transform: translateY(-2px)  scale(.97); }
  75%      { transform: translateY(-10px) scale(1.05) rotate(-3deg); }
  90%      { transform: translateY(-1px)  scale(.99); }
}

/* Loyalty-warn red pulse */
@keyframes loyalty-pulse {
  0%,100% { box-shadow: 0 0 0 0  rgba(239,83,80,.0); }
  50%      { box-shadow: 0 0 0 14px rgba(239,83,80,.35); }
}

/* Egg animations */
@keyframes egg-idle  {
  0%,100% { transform: rotate(-4deg); }
  50%      { transform: rotate( 4deg); }
}
@keyframes egg-shake {
  0%,100% { transform: rotate(-10deg) translateX(-2px); }
  50%      { transform: rotate( 10deg) translateX( 2px); }
}
@keyframes vessel-glow {
  0%, 100% { opacity: .62; transform: scale(.96); }
  50% { opacity: .98; transform: scale(1.05); }
}
@keyframes vessel-ready-glow {
  0%, 100% { opacity: .72; transform: scale(.98); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* UI animations */
@keyframes fade-up   { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
@keyframes float-up  { from { opacity:1; transform:translateY(0);   } to { opacity:0; transform:translateY(-55px) scale(.6); } }
@keyframes scale-in  { from { transform:scale(.8); opacity:0; }         to { transform:scale(1); opacity:1; } }
@keyframes pop-in    { 0% { transform:scale(.5); opacity:0; } 70% { transform:scale(1.12); } 100% { transform:scale(1); opacity:1; } }
@keyframes slide-up  { from { transform:translateY(100%); } to { transform:translateY(0); } }
@keyframes shimmer   { 0%,100% { opacity:.6; } 50% { opacity:1; } }

/* ══════════════ TUTORIAL ═══════════════════════════ */
.tut-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
}
.tut-card {
  width: min(92vw,340px); background:#fff; border-radius:22px;
  padding:24px; text-align:center;
  box-shadow:0 18px 40px rgba(0,0,0,.25);
  animation: scale-in .28s ease;
}
.tut-icon  { font-size:54px; animation: pet-bob 2s ease-in-out infinite; }
.tut-card h3 { margin-top:8px; font-size:20px; }
.tut-card p  { color:var(--soft); line-height:1.5; margin-top:6px; white-space:pre-line; }
.tut-dots { margin-top:14px; display:flex; justify-content:center; gap:7px; }
.tut-dot  { width:8px; height:8px; border-radius:50%; background:#d9d9d9; }
.tut-dot.active { background:var(--accent); }
.tut-btns { margin-top:16px; display:flex; gap:10px; }
.tut-skip { flex:1; border:0; border-radius:12px; padding:10px; background:#f2f2f2; cursor:pointer; }
.tut-next { flex:1.6; border:0; border-radius:12px; padding:10px; color:#fff; font-weight:600; background:linear-gradient(120deg,var(--accent),var(--accent2)); cursor:pointer; }

body.theme-night .tut-card {
  background: linear-gradient(145deg, rgba(22, 33, 55, 0.97), rgba(25, 40, 66, 0.97));
  color: var(--ink);
  border: 1px solid rgba(147, 177, 225, 0.35);
}

body.theme-night .tut-dot {
  background: rgba(147, 177, 225, 0.35);
}

body.theme-night .tut-skip {
  background: rgba(147, 177, 225, 0.2);
  color: var(--ink);
}

/* ══════════════ MODALS ══════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-overlay.center {
  align-items: center;
}

#confirmDialog {
  z-index: 13000;
}

.modal-sheet {
  width: min(98vw,520px); background:#fff; border-radius:22px 22px 0 0;
  padding:18px; max-height:80dvh; overflow-y:auto;
  animation: slide-up .3s ease;
}
.modal-header {
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:12px; font-weight:700; font-size:16px;
}
.modal-close {
  border:0; background:transparent; font-size:20px; cursor:pointer; color:var(--soft);
}
.picker-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap:10px; margin-bottom:12px;
}
.picker-item {
  border:2px solid #eee; border-radius:14px; padding:10px 6px;
  text-align:center; cursor:pointer; transition:border-color .15s, transform .15s;
  background:#fff;
}
/* Only show hover on devices that support it (not touch screens) */
@media (hover: hover) {
  .picker-item:hover { border-color:var(--accent); transform:scale(1.04); }
}
.picker-item:active { border-color:var(--accent); transform:scale(.97); }
.picker-item.empty { opacity:.35; pointer-events:none; }
.picker-icon  { font-size:32px; }
.picker-name  { font-size:11px; font-weight:600; margin-top:4px; }
.picker-count { font-size:11px; color:var(--soft); }
.picker-base-btn {
  width:100%; border:0; border-radius:12px; padding:12px; background:#f4f4f4;
  cursor:pointer; font-size:13px; color:var(--soft);
}

.rename-modal-card {
  width: min(92vw, 360px);
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.25);
  animation: scale-in .22s ease;
}

.confirm-dialog-card {
  width: min(92vw, 340px);
  background: #fff;
  border-radius: 18px;
  padding: 20px 16px 16px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.25);
  animation: scale-in .22s ease;
}

.confirm-dialog-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 16px;
  white-space: pre-line;
}

.confirm-dialog-actions {
  display: flex;
  gap: 10px;
}

.rename-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.rename-modal-btn {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 10px;
  font-size: 14px;
  cursor: pointer;
}

.rename-modal-btn.cancel {
  background: #f3f3f3;
  color: var(--soft);
}

.rename-modal-btn.confirm {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 700;
}

/* ══════════════ BAN / RAN-AWAY OVERLAYS ════════════ */
.ban-overlay, .ran-away-overlay {
  position: fixed; inset: 0; z-index: 9700;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
}
.ban-card, .ran-away-card {
  width: min(90vw,340px); background:#fff; border-radius:22px; padding:28px;
  text-align:center; box-shadow:0 16px 40px rgba(0,0,0,.25);
  animation: scale-in .3s ease;
}
.ban-icon, .ran-away-icon { font-size:58px; }
.ban-card h3, .ran-away-card h3 { margin-top:10px; font-size:20px; }
.ban-card p, .ran-away-card p { color:var(--soft); margin-top:8px; line-height:1.5; }
.ban-countdown { font-size:16px; font-weight:700; color:var(--accent); margin-top:10px; }
.ban-dismiss-btn {
  margin-top:16px; border:0; border-radius:14px; padding:12px 28px;
  background:var(--accent); color:#fff; font-weight:700; cursor:pointer;
}

body.theme-night .ban-card,
body.theme-night .ran-away-card {
  background: linear-gradient(145deg, rgba(22, 33, 55, 0.97), rgba(25, 40, 66, 0.97));
  color: var(--ink);
  border: 1px solid rgba(147, 177, 225, 0.35);
}

/* ══════════════ LOGIN ══════════════════════════════ */
.login-screen {
  min-height:100vh; display:grid; place-items:center;
  position:relative; overflow:hidden;
}
.login-bg-blob {
  position:absolute; border-radius:50%; filter:blur(54px); opacity:.35;
}
.login-bg-blob.a { width:320px; height:320px; background:#ffd180; left:-80px; top:-80px; }
.login-bg-blob.b { width:280px; height:280px; background:#f8a4c8; right:-60px; bottom:-60px; }
.login-card {
  width:min(92vw,360px); background:rgba(255,255,255,.94);
  backdrop-filter:blur(8px); border-radius:24px; padding:24px;
  box-shadow:0 10px 34px rgba(0,0,0,.13); z-index:2;
}
.login-logo { text-align:center; font-size:58px; animation: pet-bob 2.2s ease-in-out infinite; }
.login-title {
  text-align:center; margin:4px 0 14px; font-size:28px;
  background:linear-gradient(120deg,var(--accent),#e91e63);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
}
.login-subtitle {
  margin: 0 0 14px;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}
.login-highlights {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
}
.login-highlight-pill {
  border: 1px solid rgba(255, 112, 67, 0.18);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.auth-tabs { display:flex; border-radius:12px; background:#f4f4f4; padding:3px; margin-bottom:12px; }
.auth-tab { flex:1; border:0; border-radius:10px; padding:9px; background:transparent; cursor:pointer; }
.auth-tab.active { background:#fff; color:var(--accent); font-weight:600; }
.auth-panel { display:grid; gap:8px; }
.auth-input {
  width:100%; border:1.5px solid #e2e2e2; border-radius:12px;
  padding:11px 12px; font-size:16px; background:#fff;  /* 16px prevents iOS zoom */
}
.auth-input:focus { outline:0; border-color:var(--accent); }
.auth-submit {
  border:0; border-radius:12px; padding:12px; color:#fff; font-weight:600;
  background:linear-gradient(120deg,var(--accent),var(--accent2)); cursor:pointer;
}
.auth-status { min-height:18px; margin-top:8px; text-align:center; color:var(--soft); font-size:13px; }

/* Remember checkbox */
.remember-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}

.remember-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.remember-check input[type="checkbox"]:hover {
  opacity: 0.8;
}

#rememberLabel {
  color: var(--soft);
  transition: color 0.2s;
}
.login-lang { margin-top:12px; display:flex; justify-content:center; gap:8px; }
.lang-btn { border:1px solid #ddd; border-radius:8px; padding:4px 10px; background:#fff; cursor:pointer; font-size:12px; }
.lang-btn.active { background:var(--ink); color:#fff; border-color:var(--ink); }
.seo-copy {
  width: min(92vw, 760px);
  margin: 20px auto 0;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 1;
}
.seo-copy h2 {
  margin-bottom: 10px;
  font-size: 22px;
}
.seo-copy p {
  color: var(--soft);
  line-height: 1.7;
}
.seo-copy p + p {
  margin-top: 8px;
}
.noscript-copy {
  margin: 16px auto 0;
}

body.theme-night .login-highlight-pill,
body.theme-night .seo-copy {
  background: rgba(19, 29, 48, 0.82);
  border-color: rgba(147, 177, 225, 0.28);
}

@media (max-width: 640px) {
  .login-screen {
    padding: 20px 0 28px;
  }

  .seo-copy {
    width: min(92vw, 360px);
    padding: 16px;
  }
}

/* ══════════════ MAIN APP ═══════════════════════════ */
.main-app { min-height:100dvh; display:flex; flex-direction:column; position:relative; }
.topbar {
  display: flex; flex-direction: column;
  padding: 0 12px 6px;
  padding-top: var(--safe-top);
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.topbar-row {
  height: var(--top-h);
  display: flex; align-items: center;
  justify-content: space-between; gap: 6px;
}
.topbar-chips {
  display: flex; align-items: center; gap: 6px;
  padding-bottom: 6px;
}
.topbar-chips #adopterChip {
  flex: 1;
  border-radius: 10px;
  padding: 5px 10px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(0,0,0,0.08);
  white-space: nowrap;
  display: flex; flex-direction: column; gap: 3px;
}
.adopter-chip-row { display:flex; align-items:center; justify-content:space-between; }
.adopter-chip-name { font-size:12px; font-weight:700; }
.adopter-chip-pct { font-size:11px; opacity:0.6; }
.adopter-chip-bar {
  height: 4px; border-radius: 99px;
  background: rgba(0,0,0,0.08);
  overflow: hidden;
}
.adopter-chip-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.4s ease;
}
.user-chip { display:flex; align-items:center; gap:6px; }
.user-avatar { font-size:21px; }
.user-nick { max-width:90px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-weight:600; }
.top-right { display:flex; align-items:center; gap:6px; }
.coin-chip { background:linear-gradient(120deg,#fff8d9,#ffe392); padding:5px 10px; border-radius:999px; font-size:12px; font-weight:700; }
.topup-btn {
  border-radius: 999px;
  padding: 5px 12px;
  background: linear-gradient(120deg, #1f2937, #111827);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
body.theme-night .coin-chip {
  background: linear-gradient(120deg, rgba(43, 66, 101, 0.96), rgba(55, 86, 128, 0.96));
  color: #f4f8ff;
  border: 1px solid rgba(147, 177, 225, 0.35);
}
.sched-chip { font-size:18px; }
.weather-chip {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}
.logout-btn {
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
}

/* Pages */
.page-container {
  flex:1; padding:12px;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 14px);
  overflow-y:auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
}
.page { display:none; }
.page.active { display:block; animation:fade-up .2s ease; }
.panel {
  background:var(--card); border:1px solid rgba(255,255,255,.7);
  border-radius:18px; padding:14px;
  box-shadow:0 2px 12px rgba(0,0,0,.06);
  margin-bottom:10px;
}
.page-header { font-weight:700; margin-bottom:10px; }

/* ══════════════ PET SWITCHER ═══════════════════════ */
.pet-switcher { margin-bottom:8px; }
.pet-tabs { display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; }
.pet-tab {
  flex-shrink:0; border:2px solid #eee; border-radius:14px;
  padding:8px 14px; background:#fff; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; gap:2px;
  transition:border-color .15s;
}
.pet-tab.active { border-color:var(--accent); background:rgba(255,112,67,.07); }
.pet-tab-thumb-wrap {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.95);
  box-shadow: 0 4px 10px rgba(0,0,0,.1);
  background: #fff3df;
}
.pet-tab-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pet-thumb-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 24px;
  line-height: 1;
  background: radial-gradient(circle at 50% 28%, #fffaf0, #ffdfbc);
}
.pet-tab-name  { font-size:10px; color:var(--soft); }
.pet-tab-lvl   { font-size:10px; font-weight:700; }

.pet-tab-egg-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: linear-gradient(150deg, #fff7e6, #f8d9a4 55%, #efc57a);
}

.pet-main-btn {
  border: 1px solid rgba(255, 152, 0, .35);
  background: rgba(255, 243, 224, .9);
  color: #8d5c00;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}

.pet-main-btn.is-main {
  background: linear-gradient(145deg, #ffd180, #ffb74d);
  color: #5f3900;
  border-color: rgba(255, 167, 38, .8);
}

.pet-main-btn:disabled {
  opacity: .9;
  cursor: default;
}

/* ══════════════ HATCH ══════════════════════════════ */
.egg-stage { text-align:center; }
.egg {
  position: relative;
  width: 142px;
  height: 150px;
  display: inline-block;
  animation: egg-idle 3.4s ease-in-out infinite;
  transform-origin: center 78%;
}
.egg.hatching { animation: egg-shake .7s ease-in-out infinite; }
.hatch-vessel {
  filter: drop-shadow(0 18px 20px rgba(122, 86, 35, .14));
}
.hatch-vessel > span {
  position: absolute;
  display: block;
}
.hatch-vessel-halo {
  inset: 14px 18px 24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 223, 138, .42) 0%, rgba(255, 223, 138, .18) 48%, rgba(255, 223, 138, 0) 76%);
  filter: blur(8px);
  animation: vessel-glow 3s ease-in-out infinite;
}
.hatch-vessel-shell {
  left: 22px;
  right: 22px;
  top: 18px;
  bottom: 24px;
  border-radius: 42px 42px 34px 34px;
  background: linear-gradient(180deg, #fff8e6 0%, #f6e3bc 44%, #e7bf85 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .86),
    inset 0 -10px 18px rgba(166, 115, 52, .18),
    0 12px 22px rgba(118, 82, 31, .14);
}
.hatch-vessel-window {
  left: 38px;
  right: 38px;
  top: 32px;
  height: 54px;
  border-radius: 28px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.95) 0%, rgba(255,244,220,.95) 42%, rgba(242,213,162,.92) 100%);
  border: 2px solid rgba(255, 255, 255, .72);
  box-shadow: inset 0 -6px 12px rgba(214, 170, 102, .18);
}
.hatch-vessel-glyph {
  left: 0;
  right: 0;
  top: 43px;
  text-align: center;
  font-size: 30px;
  line-height: 1;
  z-index: 2;
}
.hatch-vessel-blanket {
  left: 34px;
  right: 34px;
  bottom: 36px;
  height: 28px;
  border-radius: 18px 18px 22px 22px;
  background: linear-gradient(180deg, #f4c79c 0%, #ebb484 100%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .24);
  z-index: 2;
}
.hatch-vessel-base {
  left: 30px;
  right: 30px;
  bottom: 16px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #e7c98e, #c89659);
  box-shadow: 0 8px 16px rgba(117, 78, 27, .14);
}
.egg[data-state="idle"] .hatch-vessel-halo {
  background: radial-gradient(circle, rgba(176, 224, 164, .34) 0%, rgba(176, 224, 164, .12) 48%, rgba(176, 224, 164, 0) 78%);
}
.egg[data-state="idle"] .hatch-vessel-blanket {
  background: linear-gradient(180deg, #cfe6b8 0%, #a8cb7a 100%);
}
.egg[data-state="incubating"] .hatch-vessel-glyph {
  transform: scale(1.02);
}
.egg[data-state="ready"] .hatch-vessel-halo {
  background: radial-gradient(circle, rgba(255, 214, 110, .52) 0%, rgba(255, 214, 110, .22) 48%, rgba(255, 214, 110, 0) 80%);
  animation: vessel-ready-glow 1.8s ease-in-out infinite;
}
.egg[data-state="ready"] .hatch-vessel-window {
  box-shadow:
    inset 0 -6px 12px rgba(214, 170, 102, .18),
    0 0 0 4px rgba(255, 238, 188, .36);
}
.egg[data-state="ready"] .hatch-vessel-blanket {
  background: linear-gradient(180deg, #ffd59b 0%, #f2ae69 100%);
}
.hatch-msg { color:var(--soft); margin-top:8px; }
.hatch-progress-wrap {
  height:9px; border-radius:999px; background:#eee;
  margin:10px auto 6px; width:min(260px,90%); overflow:hidden;
}
.hatch-bar { height:100%; background:linear-gradient(90deg,var(--accent),var(--accent2)); transition:width .3s; }
.hatch-time { color:var(--soft); font-size:12px; }
.hatch-btns, .explore-actions, .interact-btns { margin-top:10px; display:flex; gap:8px; flex-wrap:wrap; }
.adoption-ban-notice {
  margin: 8px 0 4px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 160, 50, 0.15);
  border: 1px solid rgba(255, 140, 0, 0.35);
  color: #b85c00;
  font-size: 0.82rem;
  line-height: 1.4;
}

.stage-props {
  position: absolute;
  left: 50%;
  width: min(calc(100% - 20px), 380px);
  transform: translateX(-50%);
  bottom: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  z-index: 4;
  box-sizing: border-box;
}

.stage-prop-btn {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(4px);
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .16s ease, background .2s ease;
}

.stage-prop-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(34, 20, 8, 0.2);
}

.stage-prop-btn.stage-prop-active {
  border-color: rgba(255, 112, 67, 0.75);
  background: linear-gradient(180deg, rgba(255, 245, 238, 0.98), rgba(255, 228, 216, 0.96));
  box-shadow: 0 8px 18px rgba(255, 112, 67, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  transform: translateY(-1px) scale(1.02);
}

.stage-prop-btn:active {
  transform: translateY(1px) scale(0.98);
}

.stage-prop-emoji {
  font-size: 18px;
  line-height: 1;
}

.stage-prop-label {
  font-size: 10px;
  font-weight: 700;
  color: #503423;
  text-align: center;
  line-height: 1.1;
}

@media (max-width: 420px) {
  .stage-props {
    width: calc(100% - 14px);
    gap: 6px;
  }

  .stage-prop-btn {
    border-radius: 10px;
    padding: 5px 3px;
  }

  .stage-prop-emoji {
    font-size: 17px;
  }

  .stage-prop-label {
    font-size: 9px;
  }
}

body.theme-night .stage-prop-btn {
  background: rgba(11, 27, 58, 0.78);
  border-color: rgba(169, 202, 244, 0.4);
}

body.theme-night .stage-prop-btn.stage-prop-active {
  background: linear-gradient(180deg, rgba(32, 50, 84, 0.96), rgba(25, 39, 67, 0.96));
  border-color: rgba(125, 193, 255, 0.8);
  box-shadow: 0 8px 18px rgba(14, 26, 47, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

body.theme-night .stage-prop-label {
  color: #e6f0ff;
}

/* ══════════════ 3D PET STAGE ═══════════════════════ */
.pet-stage-3d {
  position:relative; text-align:center;
  padding:24px 0 30px;
  perspective:400px;
  isolation: isolate;
  border-radius: 24px;
  background: #7ec8f0;
  border: none;
  box-shadow: 0 20px 36px rgba(66, 37, 18, .13);
  cursor: pointer;
  touch-action: manipulation;
  overflow: hidden;
  transition: background 1.2s ease;
}
body.theme-night .pet-stage-3d {
  background: #0b1b3a;
  box-shadow: 0 20px 36px rgba(5, 10, 22, .45);
}

.pet-stage-3d::before,
.pet-stage-3d::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.pet-stage-3d::before {
  inset: 0;
  background: transparent;
  transition: background .6s ease;
}

.pet-stage-3d::after {
  display: none;
}

.pet-stage-3d > * {
  position: relative;
  z-index: 1;
}

/* ─── Yard Scene ─────────────────────────────────────────────── */
.yard-scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.yard-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/assets/backgrounds/yard-day.svg");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  z-index: 0;
  filter: saturate(1.02) contrast(1.02);
  transition: opacity .8s ease, filter .8s ease, background-image .8s ease;
}

body.theme-night .yard-scene::before {
  background-image: url("/assets/backgrounds/yard-night.svg");
  filter: saturate(.9) brightness(.92) contrast(1.08);
}

/* Sky */
.yard-sky {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.04) 28%, rgba(255,255,255,0) 58%);
  transition: background 1.2s ease;
}
body.theme-night .yard-sky {
  background:
    linear-gradient(180deg, rgba(125, 151, 226, .08) 0%, rgba(47, 72, 135, .08) 34%, rgba(0,0,0,0) 64%);
}

/* Sun */
.yard-sun {
  position: absolute;
  top: 18px; right: 22px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #fff9c0 0%, #ffe55a 40%, #ffc520 100%);
  box-shadow: 0 0 0 5px rgba(255, 224, 80, .28), 0 0 26px 8px rgba(255, 200, 40, .32);
  animation: sun-pulse 4s ease-in-out infinite;
  opacity: 1;
  transition: opacity .8s ease;
  z-index: 2;
}
body.theme-night .yard-sun { opacity: 0; }

/* Sun rays */
.yard-sun::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(
    rgba(255,220,50,.18) 0deg, transparent 22deg,
    rgba(255,220,50,.18) 45deg, transparent 67deg,
    rgba(255,220,50,.18) 90deg, transparent 112deg,
    rgba(255,220,50,.18) 135deg, transparent 157deg,
    rgba(255,220,50,.18) 180deg, transparent 202deg,
    rgba(255,220,50,.18) 225deg, transparent 247deg,
    rgba(255,220,50,.18) 270deg, transparent 292deg,
    rgba(255,220,50,.18) 315deg, transparent 337deg
  );
  animation: sun-spin 18s linear infinite;
}

/* Moon */
.yard-moon {
  position: absolute;
  top: 16px; right: 22px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, #f2f4ff 0%, #d0d8f8 60%, #a8b4e8 100%);
  box-shadow:
    inset -6px -4px 0 2px rgba(160, 175, 230, .55),
    0 0 18px 4px rgba(180, 200, 255, .30);
  opacity: 0;
  transition: opacity .8s ease;
  z-index: 2;
}
body.theme-night .yard-moon {
  opacity: 1;
  animation: moon-glow 5s ease-in-out infinite;
}

/* Stars */
.yard-stars {
  position: absolute;
  inset: 0 0 42% 0;
  opacity: 0;
  transition: opacity 1s ease;
  z-index: 2;
}
body.theme-night .yard-stars { opacity: 1; }

.yard-stars .star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: star-twinkle 2.5s ease-in-out infinite;
}
.star.s1 { width:3px;height:3px; top:12%; left:10%; animation-delay:0s; }
.star.s2 { width:2px;height:2px; top:18%; left:30%; animation-delay:.5s; }
.star.s3 { width:3px;height:3px; top:8%;  left:50%; animation-delay:1s; }
.star.s4 { width:2px;height:2px; top:22%; left:65%; animation-delay:.3s; }
.star.s5 { width:4px;height:4px; top:10%; left:78%; animation-delay:1.4s; }
.star.s6 { width:2px;height:2px; top:28%; left:20%; animation-delay:.9s; }
.star.s7 { width:3px;height:3px; top:6%;  left:88%; animation-delay:.2s; }
.star.s8 { width:2px;height:2px; top:32%; left:42%; animation-delay:1.7s; }

/* Clouds */
.yard-clouds {
  position: absolute;
  left: 0; right: 0;
  top: 0; height: 58%;
  z-index: 2;
  opacity: 1;
  transition: opacity .8s ease;
}
body.theme-night .yard-clouds { opacity: .15; }
body:not(.theme-night) .yard-clouds { opacity: .38; }

.yard-fence,
.yard-kennel,
.yard-grass,
.yard-flowers {
  opacity: 0;
  pointer-events: none;
}

.yard-clouds .cloud {
  position: absolute;
  border-radius: 50px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 3px 10px rgba(180,220,255,.3);
}
.yard-clouds .cloud::before,
.yard-clouds .cloud::after {
  content: "";
  position: absolute;
  background: rgba(255,255,255,.92);
  border-radius: 50%;
}
.cloud.c1 {
  width: 56px; height: 18px;
  top: 18%; left: 6%;
  animation: cloud-drift 34s linear infinite;
}
.cloud.c1::before { width:22px;height:22px; top:-12px; left:8px; }
.cloud.c1::after  { width:16px;height:16px; top:-8px;  left:28px; }

.cloud.c2 {
  width: 44px; height: 14px;
  top: 26%; left: 42%;
  animation: cloud-drift 46s linear infinite;
  animation-delay: -12s;
  opacity: .78;
}
.cloud.c2::before { width:18px;height:18px; top:-10px; left:6px; }
.cloud.c2::after  { width:13px;height:13px; top:-7px;  left:22px; }

.cloud.c3 {
  width: 36px; height: 12px;
  top: 14%; left: 68%;
  animation: cloud-drift 40s linear infinite;
  animation-delay: -18s;
  opacity: .65;
}
.cloud.c3::before { width:16px;height:16px; top:-9px;  left:5px; }
.cloud.c3::after  { width:12px;height:12px; top:-6px;  left:18px; }

/* Rain (hidden by default, shown via .weather-rain on petStage) */
.yard-rain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
  opacity: 0;
  transition: opacity .6s ease;
}
.yard-rain::before,
.yard-rain::after {
  content: none;
}
.yard-rain::after {
  content: none;
}
.pet-stage-3d.weather-rain .yard-rain { opacity: 0; }

/* Snow */
.yard-snow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
  opacity: 0;
  transition: opacity .6s ease;
}
.yard-snow::before,
.yard-snow::after {
  content: "";
  position: absolute;
  top: -30px; left: 0; right: 0;
  height: calc(100% + 30px);
  background:
    radial-gradient(circle, rgba(255,255,255,.82) 1.5px, transparent 2px) 0 0 / 18px 24px,
    radial-gradient(circle, rgba(255,255,255,.6) 1px, transparent 1.5px) 9px 12px / 18px 24px;
  animation: snow-fall 3s linear infinite;
}
.yard-snow::after {
  background:
    radial-gradient(circle, rgba(255,255,255,.7) 1px, transparent 1.5px) 5px 4px / 22px 30px;
  animation-duration: 4.5s;
  animation-delay: -1.5s;
}
.pet-stage-3d.weather-snow .yard-snow { opacity: 1; }

/* Fence */
.yard-fence {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 94px;
  height: 22px;
  background:
    repeating-linear-gradient(90deg,
      #d4a06a 0 3px,
      #e8ba80 3px 11px,
      #d4a06a 11px 14px,
      #e8ba80 14px 22px
    );
  box-shadow: 0 3px 0 rgba(180,120,60,.35), inset 0 2px 0 rgba(255,255,255,.4);
  opacity: .85;
}
.yard-fence::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 7px;
  height: 3px;
  background: rgba(255,255,255,.38);
}
body.theme-night .yard-fence {
  background: repeating-linear-gradient(90deg, #5a6880 0 3px, #7080a0 3px 22px);
  box-shadow: 0 3px 0 rgba(30,40,65,.45);
  opacity: .7;
}

/* Flowers */
.yard-flowers {
  position: absolute;
  right: 18px;
  bottom: 68px;
}
.yard-flowers .flower {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  animation: flower-bob 3s ease-in-out infinite;
}
.yard-flowers .flower::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  opacity: .45;
  animation: flower-bob 3s ease-in-out infinite reverse;
}
.flower.f1 { background: #ffb3c6; left:0;  top:0;  animation-delay:0s;   }
.flower.f1::before { background: #ff8caa; }
.flower.f2 { background: #ffe066; left:14px; top:4px; animation-delay:.7s; }
.flower.f2::before { background: #ffcc20; }
.flower.f3 { background: #ffb3c6; left:28px; top:-2px; animation-delay:1.3s; }
.flower.f3::before { background: #ff8caa; }
.flower.f4 { background: #c4e87e; left:42px; top:2px; animation-delay:.4s; }
.flower.f4::before { background: #a0cc50; }

/* ─── Animations ───────────────────────────────────────────────── */
@keyframes sun-pulse {
  0%,100% { box-shadow: 0 0 0 5px rgba(255,224,80,.28), 0 0 26px 8px rgba(255, 200, 40, .32); }
  50%     { box-shadow: 0 0 0 9px rgba(255,224,80,.18), 0 0 40px 14px rgba(255, 200, 40, .22); }
}
@keyframes sun-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes moon-glow {
  0%,100% { box-shadow: inset -6px -4px 0 2px rgba(160,175,230,.55), 0 0 18px 4px rgba(180,200,255,.30); }
  50%     { box-shadow: inset -6px -4px 0 2px rgba(160,175,230,.55), 0 0 30px 10px rgba(180,200,255,.45); }
}
@keyframes star-twinkle {
  0%,100% { opacity: .9; transform: scale(1); }
  50%     { opacity: .3; transform: scale(.6); }
}
@keyframes cloud-drift {
  from { transform: translateX(-120px); opacity: 0; }
  5%   { opacity: 1; }
  90%  { opacity: 1; }
  to   { transform: translateX(calc(100% + 180px)); opacity: 0; }
}
@keyframes grass-sway {
  0%,100% { transform: rotate(-4deg); }
  50%     { transform: rotate(6deg); }
}
@keyframes flower-bob {
  0%,100% { transform: translateY(0) scale(1); }
  50%     { transform: translateY(-3px) scale(1.08); }
}
@keyframes rain-fall {
  from { transform: translateY(-20px); }
  to   { transform: translateY(20px); }
}
@keyframes snow-fall {
  from { transform: translateY(-30px) translateX(0); }
  to   { transform: translateY(30px) translateX(8px); }
}
/* Weather fog overlay */
.pet-stage-3d.weather-fog::before {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(200,210,220,.55) 0%, transparent 80%),
    radial-gradient(circle at 20% 55%, rgba(220,230,240,.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 45%, rgba(200,215,225,.4) 0%, transparent 50%);
}
/* Cloudy – sky dims, clouds more visible */
.pet-stage-3d.weather-cloudy .yard-sky {
  background: linear-gradient(180deg, rgba(115, 132, 154, .20) 0%, rgba(163, 180, 196, .16) 52%, rgba(255,255,255,0) 78%);
  filter: brightness(.92);
}
.pet-stage-3d.weather-cloudy .yard-scene::before {
  filter: saturate(.86) brightness(.95) contrast(1.01);
}
.pet-stage-3d.weather-cloudy .yard-sun { opacity: .4 !important; }
.pet-stage-3d.weather-cloudy .yard-clouds .cloud {
  background: rgba(210,220,230,.96);
  box-shadow: 0 3px 12px rgba(100,130,160,.4);
}
/* Rain – sky gets darker */
.pet-stage-3d.weather-rain .yard-sky {
  background: linear-gradient(180deg, rgba(70, 86, 116, .26) 0%, rgba(108, 126, 148, .20) 48%, rgba(255,255,255,0) 78%);
}
.pet-stage-3d.weather-rain .yard-scene::before {
  filter: saturate(.82) brightness(.86) contrast(1.04);
}
/* Storm – darkest sky */
.pet-stage-3d.weather-storm .yard-sky {
  background: linear-gradient(180deg, rgba(31, 38, 54, .38) 0%, rgba(56, 68, 89, .26) 46%, rgba(0,0,0,0) 78%);
  animation: thunder-flicker 6s ease-in-out infinite;
}
.pet-stage-3d.weather-storm .yard-scene::before {
  filter: saturate(.7) brightness(.74) contrast(1.08);
}
/* Snow – cool pale sky */
.pet-stage-3d.weather-snow .yard-sky {
  background: linear-gradient(180deg, rgba(183, 200, 216, .24) 0%, rgba(218, 229, 238, .16) 48%, rgba(255,255,255,0) 78%);
}
.pet-stage-3d.weather-snow .yard-scene::before {
  filter: saturate(.56) brightness(1.02) contrast(.96);
}
/* Thunder flash */
@keyframes thunder-flicker {
  0%,94%,98%,100% { filter: brightness(1); }
  95%             { filter: brightness(2.2); }
  97%             { filter: brightness(1.5); }
}

/* ─── Day theme variants (non-night) ────────────────── */
body:not(.theme-night) .yard-stars { opacity: 0; }
body:not(.theme-night) .yard-moon  { opacity: 0; }

.pet-shadow-floor {
  position:absolute; bottom:12px; left:50%;
  transform:translateX(-50%);
  width:70px; height:18px;
  background:radial-gradient(ellipse, rgba(0,0,0,.22) 0, transparent 70%);
  border-radius:50%;
  animation:pet-shadow-bob 2s ease-in-out infinite;
  z-index: 1;
}
.pet-stage-3d.stage-mood-sleep .pet-shadow-floor {
  animation: pet-shadow-sleep 5.2s ease-in-out infinite;
}
.pet-body-wrap {
  position:relative; display:inline-block;
  width: 212px;
  height: 230px;
  margin-top: 60px;
  z-index: 3;
  overflow: visible;
  transition: transform .8s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform;
}

.pet-body-wrap.pet-walking .pet-photo,
.pet-body-wrap.pet-walking .pet-avatar {
  animation: pet-walk-step .42s ease-in-out infinite;
}

.pet-body-wrap.pet-walking .pet-head,
.pet-body-wrap.pet-walking .pet-body {
  animation: pet-torso-bounce .42s ease-in-out infinite;
}

.pet-body-wrap.pet-walking .pet-paw.left {
  animation: pet-paw-step-left .42s ease-in-out infinite;
}

.pet-body-wrap.pet-walking .pet-paw.right {
  animation: pet-paw-step-right .42s ease-in-out infinite;
}

.pet-body-wrap.pet-sprinting .pet-photo,
.pet-body-wrap.pet-sprinting .pet-avatar {
  animation-duration: .3s;
}

.pet-body-wrap.pet-sprinting .pet-head,
.pet-body-wrap.pet-sprinting .pet-body,
.pet-body-wrap.pet-sprinting .pet-paw.left,
.pet-body-wrap.pet-sprinting .pet-paw.right {
  animation-duration: .3s;
}

.pet-body-wrap.pet-sprinting .pet-tail {
  animation-duration: .26s;
}

.pet-body-wrap.pet-sprinting .pet-ear.left,
.pet-body-wrap.pet-sprinting .pet-ear.right {
  animation-duration: .3s;
}

.pet-body-wrap.pet-sprinting .pet-ear.left {
  animation-name: pet-ear-run-left;
}

.pet-body-wrap.pet-sprinting .pet-ear.right {
  animation-name: pet-ear-run-right;
}

.pet-photo-shell {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 190px;
  height: 216px;
  overflow: visible;
  background: none;
  border: none;
  box-shadow: none;
  z-index: 3;
  transition: transform .3s ease;
  animation: none;
  transform-origin: 50% 58%;
}

.pet-photo-shell::after {
  display: none;
}

.pet-body-wrap.has-photo .pet-photo-shell {
  box-shadow: none;
}

.pet-body-wrap.has-photo .pet-avatar {
  opacity: 0;
  pointer-events: none;
}

.pet-photo-shell.loading {
  animation: shimmer 1.1s ease-in-out infinite;
}

.pet-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  opacity: 0;
  transition: opacity .35s ease, transform .25s ease, filter .25s ease;
}

.pet-body-wrap.has-photo .pet-photo {
  animation: none !important;
  transform: none !important;
}

.pet-photo.ready {
  opacity: 1;
}

.pet-body-wrap.pet-photo-disabled .pet-photo-shell {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.88);
}

.pet-body-wrap.pet-photo-disabled .pet-avatar {
  opacity: 1;
}

/* ── Twemoji emoji-pet display ─────────────────────────────── */
.pet-body-wrap.has-emoji-pet .pet-photo-shell {
  background: none;
  border-color: transparent;
  box-shadow: none;
  animation: none;
  overflow: visible;
}
.pet-body-wrap.has-emoji-pet .pet-photo-shell::after {
  display: none;
}
.pet-body-wrap.has-emoji-pet .pet-photo {
  padding: 0;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.30));
  animation: petBob 3.2s ease-in-out infinite;
  transform-origin: 50% 85%;
}
.pet-body-wrap.has-emoji-pet .pet-avatar {
  opacity: 0;
  pointer-events: none;
}

.pet-body-wrap.has-sprite-pet .pet-photo-shell {
  animation: none;
}

.pet-body-wrap.has-sprite-pet .pet-photo {
  transition: opacity .25s ease;
  transform: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .24)) saturate(1.08) contrast(1.08);
}

@keyframes petBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}
@keyframes petBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-20px) scale(1.08) rotate(-4deg); }
  75% { transform: translateY(-12px) scale(1.05) rotate(4deg); }
}
@keyframes petWiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  20% { transform: rotate(-12deg) scale(1.05); }
  40% { transform: rotate(12deg) scale(1.05); }
  60% { transform: rotate(-8deg) scale(1.03); }
  80% { transform: rotate(8deg) scale(1.03); }
}
@keyframes petDroop {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(6px) rotate(3deg) scale(0.94); }
}
@keyframes petSleep {
  0%, 100% { transform: translateY(0) rotate(-5deg) scale(0.93); }
  50% { transform: translateY(4px) rotate(5deg) scale(0.93); }
}

.pet-body-wrap.has-emoji-pet .pet-photo.pet-state-idle {
  animation: petBob 3.2s ease-in-out infinite;
}
.pet-body-wrap.has-emoji-pet .pet-photo.pet-state-happy,
.pet-body-wrap.has-emoji-pet .pet-photo.pet-state-playing,
.pet-body-wrap.has-emoji-pet .pet-photo.pet-state-excited {
  animation: petBounce 0.9s ease-in-out infinite;
}
.pet-body-wrap.has-emoji-pet .pet-photo.pet-state-eating,
.pet-body-wrap.has-emoji-pet .pet-photo.pet-state-cleaning {
  animation: petWiggle 0.45s ease-in-out infinite;
}
.pet-body-wrap.has-emoji-pet .pet-photo.pet-state-sad,
.pet-body-wrap.has-emoji-pet .pet-photo.pet-state-ill {
  animation: petDroop 2s ease-in-out infinite;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.2)) grayscale(0.4);
}
.pet-body-wrap.has-emoji-pet .pet-photo.pet-state-sleeping,
.pet-body-wrap.has-emoji-pet .pet-photo.pet-state-resting,
.pet-body-wrap.has-emoji-pet .pet-photo.pet-state-waking {
  animation: petSleep 4s ease-in-out infinite;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.2)) brightness(0.80);
}
.pet-emoji {
  font-size:80px; display:inline-block; cursor:default;
  transition:filter .3s;
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pet-avatar {
  --fur-main: #f3c39c;
  --fur-secondary: #ffe0c7;
  --fur-accent: #fff6ef;
  --fur-patch: transparent;
  --fur-ear-inner: #f7b3bd;
  --toon-line: #2a1c14;
  --nose-color: #6c4a3c;
  --paw-color: #efb98c;
  --eye-color: #2a2522;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 148px;
  height: 142px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.2));
  opacity: .9;
  z-index: 2;
  pointer-events: none;
  transition: opacity .4s ease;
}
/* Hide CSS avatar once a real photo has loaded */
.pet-body-wrap.has-photo .pet-avatar {
  opacity: 0;
}

.pet-head,
.pet-body,
.pet-paw,
.pet-ear,
.pet-ear-inner,
.pet-tail,
.pet-body-patch,
.pet-chest,
.pet-face-patch,
.pet-cheek,
.pet-eye,
.pet-eye-shine,
.pet-nose,
.pet-mouth,
.pet-muzzle,
.pet-whisker {
  position: absolute;
}

.pet-body {
  width: 68px;
  height: 65px;
  left: 40px;
  top: 75px;
  border-radius: 40% 40% 48% 48%;
  background: radial-gradient(circle at 38% 24%, rgba(255,255,255,.32), transparent 36%), var(--fur-main);
  border: 3px solid var(--toon-line);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.08);
}

.pet-head {
  width: 94px;
  height: 88px;
  left: 27px;
  top: -2px;
  border-radius: 50% 50% 48% 48%;
  background: radial-gradient(circle at 35% 25%, rgba(255,255,255,.3), transparent 26%), var(--fur-secondary);
  overflow: hidden;
  border: 3px solid var(--toon-line);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.08);
  transition: transform .35s ease;
}

.pet-ear {
  width: 30px;
  height: 38px;
  top: -16px;
  background: var(--fur-secondary);
  border: 3px solid var(--toon-line);
}

.pet-ear.left { left: 20px; transform: rotate(-14deg); border-radius: 80% 35% 58% 30%; }
.pet-ear.right { right: 20px; transform: rotate(14deg); border-radius: 35% 80% 30% 58%; }
.pet-ear.left { animation: pet-ear-idle-left 5.8s ease-in-out infinite; transform-origin: 50% 100%; }
.pet-ear.right { animation: pet-ear-idle-right 6.1s ease-in-out infinite; transform-origin: 50% 100%; }

.pet-ear-inner {
  width: 13px;
  height: 19px;
  top: 7px;
  background: var(--fur-ear-inner);
  opacity: .95;
}

.pet-ear-inner.left { left: 28px; transform: rotate(-14deg); border-radius: 70% 30% 65% 30%; }
.pet-ear-inner.right { right: 28px; transform: rotate(14deg); border-radius: 30% 70% 30% 65%; }

.pet-tail {
  width: 15px;
  height: 44px;
  left: 106px;
  top: 80px;
  border-radius: 999px;
  background: var(--fur-main);
  border: 3px solid var(--toon-line);
  transform-origin: top center;
  animation: pet-tail-wag 2.2s ease-in-out infinite;
}

.pet-body-patch {
  width: 28px;
  height: 22px;
  left: 60px;
  top: 88px;
  border-radius: 55% 45% 45% 55%;
  background: var(--fur-patch);
  opacity: .95;
}

.pet-chest {
  width: 22px;
  height: 18px;
  left: 63px;
  top: 90px;
  border-radius: 50% 50% 45% 45%;
  background: var(--fur-accent);
  border: 2px solid rgba(42, 28, 20, 0.35);
}

.pet-face-patch {
  width: 52px;
  height: 40px;
  left: 20px;
  top: 20px;
  border-radius: 48% 48% 52% 52%;
  background: var(--fur-accent);
  opacity: .78;
  border: 2px solid rgba(42, 28, 20, 0.24);
}

.pet-cheek {
  width: 15px;
  height: 10px;
  top: 54px;
  background: rgba(255, 128, 154, .4);
  border-radius: 50%;
}

.pet-cheek.left { left: 16px; }
.pet-cheek.right { right: 16px; }

.pet-eye {
  width: 17px;
  height: 20px;
  top: 29px;
  border-radius: 45% 45% 44% 44%;
  background: #fff;
  border: 3px solid var(--toon-line);
  transform-origin: 50% 60%;
  animation: pet-eye-blink 4.8s ease-in-out infinite;
  transition: transform .25s ease;
  overflow: hidden;
}

.pet-eye.left { left: 20px; }
.pet-eye.right { right: 20px; animation-delay: .17s; }

.pet-eye::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 12px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  /* always dark centre (pupil) + breed iris ring */
  background: radial-gradient(circle at 38% 32%, #120803 28%, var(--eye-color) 100%);
}

.pet-eye.left::before { left: 4px; }
.pet-eye.right::before { left: 3px; }

.pet-eye-shine {
  width: 4px;
  height: 4px;
  top: 35px;
  border-radius: 50%;
  background: rgba(255,255,255,.98);
  animation: pet-eye-shine-pulse 4.8s ease-in-out infinite;
  transition: transform .25s ease, opacity .25s ease;
  z-index: 2;
}

.pet-eye-shine.left { left: 28px; }
.pet-eye-shine.right { right: 28px; }

.pet-muzzle {
  width: 36px;
  height: 22px;
  left: 29px;
  top: 48px;
  border-radius: 46% 46% 56% 56%;
  background: var(--fur-accent);
  border: 3px solid var(--toon-line);
}

.pet-nose {
  width: 12px;
  height: 9px;
  left: 40px;
  top: 54px;
  border-radius: 50%;
  background: #2f1d16;
  z-index: 2;
  transition: transform .22s ease;
}

.pet-mouth {
  width: 20px;
  height: 10px;
  left: 38px;
  top: 64px;
  border-bottom: 3px solid var(--toon-line);
  border-radius: 0 0 48% 48%;
  z-index: 2;
  transition: transform .22s ease;
}

.pet-mouth::before {
  content: "";
  position: absolute;
  left: 8px;
  top: -6px;
  width: 2px;
  height: 8px;
  border-radius: 2px;
  background: var(--toon-line);
}

.pet-whisker {
  width: 18px;
  height: 8px;
  top: 58px;
  border-top: 2px solid rgba(48, 35, 26, .58);
}

.pet-whisker.left { left: 6px; transform: rotate(-8deg); }
.pet-whisker.right { right: 6px; transform: rotate(8deg); }

.pet-whisker.left::before,
.pet-whisker.left::after,
.pet-whisker.right::before,
.pet-whisker.right::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(90, 78, 70, .45);
}

.pet-whisker.left::before,
.pet-whisker.right::before { top: -4px; }
.pet-whisker.left::after,
.pet-whisker.right::after { top: 4px; }

.species-dog .pet-whisker { display: none; }
.species-dog .pet-muzzle {
  width: 34px;
  height: 22px;
  left: 23px;
  top: 40px;
}

.pet-paw {
  width: 28px;
  height: 20px;
  top: 122px;
  border-radius: 50% 50% 42% 42%;
  background: var(--paw-color);
  border: 3px solid var(--toon-line);
}

.pet-paw.left { left: 24px; }
.pet-paw.right { right: 24px; }

.species-cat .pet-ear {
  height: 44px;
  top: -24px;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  border-radius: 0;
}
.species-cat .pet-tail { left: 118px; width: 13px; height: 50px; }
.species-cat .pet-body-patch { border-radius: 55% 45% 48% 52%; }
.species-dog .pet-ear {
  top: 8px;
  height: 34px;
  border-radius: 45% 45% 72% 72%;
  clip-path: none;
}
.species-dog .pet-ear-inner { top: 12px; }
.species-dog .pet-tail { left: 112px; height: 40px; width: 17px; border-radius: 55% 55% 40% 40%; }
.species-dog .pet-head { border-radius: 50% 50% 44% 44%; }
.species-dog .pet-body { border-radius: 42% 42% 50% 50%; }
.species-dog .pet-muzzle {
  width: 40px;
  height: 24px;
  left: 27px;
  top: 49px;
}

.pet-body-wrap.pet-look-left .pet-photo-shell { transform: translate(-53%, -50%) rotate(-1.6deg) scale(1.008); }
.pet-body-wrap.pet-look-right .pet-photo-shell { transform: translate(-47%, -50%) rotate(1.6deg) scale(1.008); }
.pet-body-wrap.pet-look-left .pet-head { transform: translateX(-2px); }
.pet-body-wrap.pet-look-right .pet-head { transform: translateX(2px); }
.pet-body-wrap.pet-look-left .pet-eye,
.pet-body-wrap.pet-look-left .pet-eye-shine,
.pet-body-wrap.pet-look-left .pet-nose,
.pet-body-wrap.pet-look-left .pet-mouth { transform: translateX(-1.4px); }
.pet-body-wrap.pet-look-right .pet-eye,
.pet-body-wrap.pet-look-right .pet-eye-shine,
.pet-body-wrap.pet-look-right .pet-nose,
.pet-body-wrap.pet-look-right .pet-mouth { transform: translateX(1.4px); }

.pet-body-wrap.pet-state-sleeping .pet-photo-shell { animation-duration: 5.4s; }
.pet-body-wrap.has-sprite-pet.pet-state-sleeping .pet-photo-shell,
.pet-body-wrap.has-sprite-pet.pet-state-resting .pet-photo-shell,
.pet-body-wrap.has-sprite-pet.pet-state-waking .pet-photo-shell {
  animation: pet-sprite-sleep-breathe 5.2s ease-in-out infinite;
}
.pet-body-wrap.has-sprite-pet.pet-state-sleeping .pet-photo,
.pet-body-wrap.has-sprite-pet.pet-state-resting .pet-photo,
.pet-body-wrap.has-sprite-pet.pet-state-waking .pet-photo {
  filter: drop-shadow(0 10px 12px rgba(0,0,0,.18)) brightness(.96);
}
.pet-body-wrap.pet-state-sleeping .pet-eye {
  animation: none;
  height: 4px;
  top: 31px;
  border-radius: 999px;
  opacity: .78;
  border-width: 0;
  background: var(--toon-line);
}
.pet-body-wrap.pet-state-sleeping .pet-eye-shine {
  opacity: 0;
  animation: none;
}

.pet-body-wrap.pet-state-happy .pet-mouth,
.pet-body-wrap.pet-state-playing .pet-mouth,
.pet-body-wrap.pet-state-excited .pet-mouth {
  border-bottom-width: 4px;
  height: 12px;
  top: 54px;
}

.pet-body-wrap.pet-state-sad .pet-mouth,
.pet-body-wrap.pet-state-ill .pet-mouth {
  border-bottom-width: 3px;
  height: 8px;
  top: 57px;
  transform: rotate(180deg);
}

.pet-body-wrap.pet-state-happy .pet-tail,
.pet-body-wrap.pet-state-playing .pet-tail,
.pet-body-wrap.pet-state-excited .pet-tail { animation-duration: .68s; }
.pet-body-wrap.pet-state-resting .pet-tail,
.pet-body-wrap.pet-state-sleeping .pet-tail { animation-duration: 3.2s; }

.pet-body-wrap.pet-micro-ear-flick .pet-ear.left { animation: pet-ear-flick-left .26s ease-in-out 2; }
.pet-body-wrap.pet-micro-ear-flick .pet-ear.right { animation: pet-ear-flick-right .26s ease-in-out 2; }
.pet-body-wrap.pet-micro-sniff .pet-nose,
.pet-body-wrap.pet-micro-sniff .pet-mouth { animation: pet-sniff .24s ease-in-out 3; }
.pet-body-wrap.pet-micro-tail-swish .pet-tail { animation: pet-tail-swish .34s ease-in-out 2; }
.pet-body-wrap.pet-micro-body-shift .pet-photo-shell { animation: pet-body-shift .72s ease-in-out 1; }
.pet-body-wrap.pet-micro-sleep-twitch .pet-photo-shell { animation: pet-sleep-twitch .68s ease-in-out 1; }
.pet-body-wrap.pet-micro-hop .pet-photo,
.pet-body-wrap.pet-micro-hop .pet-avatar { animation: pet-hop .55s cubic-bezier(0.25, 0.9, 0.35, 1) 1; }
.pet-body-wrap.pet-micro-hop .pet-paw.left,
.pet-body-wrap.pet-micro-hop .pet-paw.right { animation: pet-paw-compress .55s cubic-bezier(0.25, 0.9, 0.35, 1) 1; }

.pet-body-wrap.has-sprite-pet.pet-micro-body-shift .pet-photo-shell,
.pet-body-wrap.has-sprite-pet.pet-micro-sleep-twitch .pet-photo-shell,
.pet-body-wrap.has-sprite-pet.pet-micro-hop .pet-photo {
  animation: none;
}

.pet-stage-3d.stage-hit {
  animation: stage-hit-flash .38s ease-out;
}

.pet-stage-3d.stage-hit .pet-photo-shell {
  box-shadow:
    0 22px 46px rgba(55, 34, 21, .28),
    0 0 0 8px rgba(255, 173, 96, .25),
    0 0 30px rgba(255, 173, 96, .35);
}

.pet-stage-3d.stage-mood-happy .pet-cheek {
  opacity: .95;
  animation: pet-cheek-pop .6s ease-in-out infinite;
}

.pet-stage-3d.stage-mood-alert .pet-eye::before {
  transform: scaleY(1.18);
}

.pet-stage-3d.stage-mood-alert .pet-tail {
  animation-duration: .42s;
}

.pet-stage-3d.stage-mood-happy .pet-photo-shell {
  box-shadow: none;
}

.pet-stage-3d.stage-mood-alert {
  box-shadow:
    0 20px 36px rgba(66, 37, 18, .13),
    inset 0 0 0 1px rgba(255,255,255,.55),
    0 0 0 2px rgba(255, 169, 80, .22);
}

.pet-stage-3d.stage-mood-alert .pet-photo-shell {
  animation-duration: 3s;
}

.pet-stage-3d.stage-mood-sick .pet-photo {
  filter: saturate(.78) brightness(.9);
}

.pet-stage-3d.stage-mood-sleep::after {
  opacity: .2;
}

.life-juvenile { transform: translate(-50%, -50%) scale(0.9); }
.life-juvenile .pet-eye { width: 14px; height: 16px; }
.life-adult { transform: translate(-50%, -50%) scale(1); }
.life-senior { transform: translate(-50%, -50%) scale(1.05); }
.life-senior .pet-head,
.life-senior .pet-body { filter: saturate(0.85) brightness(0.95); }
.life-senior .pet-mouth { border-bottom-color: rgba(120, 130, 140, 0.65); }
.life-senior .pet-cheek { opacity: .16; }

.skin-british {
  --fur-main: #c9d0df;
  --fur-secondary: #e4e9f4;
  --fur-accent: #f9fbff;
  --fur-patch: rgba(164, 175, 199, .55);
  --paw-color: #c4cede;
}

.skin-ragdoll {
  --fur-main: #f1e6dc;
  --fur-secondary: #fff8f0;
  --fur-accent: #ffffff;
  --fur-patch: rgba(116, 92, 86, .88);
  --nose-color: #9d6a7a;
}

.skin-siamese {
  --fur-main: #e9d4bb;
  --fur-secondary: #f4e6d6;
  --fur-accent: #fff8ef;
  --fur-patch: rgba(90, 63, 52, .95);
  --eye-color: #4d8ab0;
}

.skin-bengal {
  --fur-main: #dca15c;
  --fur-secondary: #f0bf7a;
  --fur-accent: #fff0d7;
  --fur-patch: rgba(112, 62, 20, .85);
}

.skin-russianblue {
  --fur-main: #97a6bb;
  --fur-secondary: #bcc7d7;
  --fur-accent: #eef4ff;
  --fur-patch: rgba(125, 141, 162, .5);
  --eye-color: #3a8a56;
}

.skin-persian {
  --fur-main: #f4d8cf;
  --fur-secondary: #fff2ea;
  --fur-accent: #ffffff;
  --fur-patch: rgba(232, 191, 185, .45);
}

.skin-sphynx {
  --fur-main: #d8b2a4;
  --fur-secondary: #e6c3b5;
  --fur-accent: #f3ddd2;
  --fur-patch: transparent;
  --fur-ear-inner: #d591a0;
}

.skin-fold {
  --fur-main: #d6c4bd;
  --fur-secondary: #f1e2dc;
  --fur-accent: #fff7f2;
  --fur-patch: rgba(173, 141, 129, .4);
}

.skin-forest,
.skin-generic-cat {
  --fur-main: #c58a57;
  --fur-secondary: #e9b585;
  --fur-accent: #fff0dc;
  --fur-patch: rgba(124, 76, 43, .65);
}

.skin-shiba {
  --fur-main: #e69a58;
  --fur-secondary: #f5bf80;
  --fur-accent: #fff7eb;
  --fur-patch: rgba(255,255,255,.0);
}

.skin-rottweiler {
  --fur-main: #2b2526;
  --fur-secondary: #3a3032;
  --fur-accent: #c88758;
  --fur-patch: rgba(196, 131, 75, .95);
  --nose-color: #1d1718;
  --paw-color: #744c38;
  --eye-color: #6b3820;
  --toon-line: #6a4238;
}

.skin-husky {
  --fur-main: #aab6c7;
  --fur-secondary: #e9f0fa;
  --fur-accent: #ffffff;
  --fur-patch: rgba(66, 79, 103, .7);
  --eye-color: #3a82b8;
}

.skin-corgi {
  --fur-main: #d79452;
  --fur-secondary: #f1c17b;
  --fur-accent: #fff8ef;
  --fur-patch: rgba(255,255,255,.0);
}

.skin-poodle {
  --fur-main: #d6a06b;
  --fur-secondary: #ecc08d;
  --fur-accent: #fff1df;
  --fur-patch: rgba(171, 113, 61, .3);
}

.skin-beagle {
  --fur-main: #c78a52;
  --fur-secondary: #f0d5a0;
  --fur-accent: #fff8ef;
  --fur-patch: rgba(71, 47, 35, .92);
}

.skin-samoyed {
  --fur-main: #f5f7fb;
  --fur-secondary: #ffffff;
  --fur-accent: #ffffff;
  --fur-patch: rgba(220, 229, 239, .55);
  --paw-color: #edf3fb;
}

.skin-golden {
  --fur-main: #dba561;
  --fur-secondary: #f1c37f;
  --fur-accent: #fff4e4;
  --fur-patch: rgba(214, 151, 77, .32);
}

.skin-labrador {
  --fur-main: #d6b37f;
  --fur-secondary: #e9c999;
  --fur-accent: #fff4e8;
  --fur-patch: rgba(195, 151, 91, .4);
}

.skin-bulldog,
.skin-generic-dog {
  --fur-main: #d2b08a;
  --fur-secondary: #ebd3b7;
  --fur-accent: #fff5ea;
  --fur-patch: rgba(121, 86, 61, .55);
}

.skin-rabbit {
  --fur-main: #ebc1b0;
  --fur-secondary: #f7dfd2;
  --fur-accent: #fff7f1;
  --fur-patch: rgba(191, 141, 136, .35);
  --fur-ear-inner: #f2a9b6;
  --paw-color: #e5b4a4;
}

.skin-fox {
  --fur-main: #e68b38;
  --fur-secondary: #f8a24d;
  --fur-accent: #fff4e2;
  --fur-patch: rgba(112, 58, 30, .58);
  --paw-color: #d8802f;
}

.skin-bird {
  --fur-main: #5eaee6;
  --fur-secondary: #8bc7f0;
  --fur-accent: #eaf8ff;
  --fur-patch: rgba(41, 103, 170, .45);
  --paw-color: #79b4e8;
  --nose-color: #f7a323;
}

.skin-capybara {
  --fur-main: #b2835e;
  --fur-secondary: #c99872;
  --fur-accent: #ecdbc8;
  --fur-patch: rgba(84, 56, 38, .44);
  --paw-color: #a77552;
}

.skin-generic-other {
  --fur-main: #91b49b;
  --fur-secondary: #a8c7b1;
  --fur-accent: #e8f4eb;
  --fur-patch: rgba(74, 109, 82, .38);
  --paw-color: #89ab92;
}

.species-other .pet-whisker {
  display: none;
}

.skin-shiba .pet-face-patch,
.skin-corgi .pet-face-patch,
.skin-golden .pet-face-patch,
.skin-labrador .pet-face-patch,
.skin-samoyed .pet-face-patch,
.skin-poodle .pet-face-patch { opacity: 0; }

.skin-ragdoll .pet-face-patch,
.skin-siamese .pet-face-patch,
.skin-husky .pet-face-patch,
.skin-rottweiler .pet-face-patch,
.skin-beagle .pet-face-patch,
.skin-bengal .pet-face-patch { opacity: .98; }

.skin-sphynx .pet-body-patch,
.skin-sphynx .pet-face-patch { opacity: .2; }

.skin-fold .pet-ear,
.skin-fold .pet-ear-inner {
  transform: rotate(0deg);
  top: 8px;
  height: 20px;
}

.skin-poodle .pet-head,
.skin-poodle .pet-body,
.skin-samoyed .pet-head,
.skin-samoyed .pet-body,
.skin-persian .pet-head,
.skin-persian .pet-body {
  box-shadow: inset 0 0 0 6px rgba(255,255,255,.14);
}

.skin-bengal .pet-body-patch,
.skin-bengal .pet-face-patch {
  background-image: radial-gradient(circle at 30% 40%, rgba(93, 53, 17, .92) 0 10%, transparent 12%), radial-gradient(circle at 65% 60%, rgba(93, 53, 17, .82) 0 8%, transparent 10%);
  background-color: transparent;
}

.pet-fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 14;
  isolation: isolate;
}

.pet-fx-layer.fx-active { opacity: 1; }

.fx-feed-scene,
.fx-play-scene,
.fx-clean-scene,
.fx-rest-scene,
.fx-generic {
  position: absolute;
  inset: 0;
}

.fx-feed-scene::before,
.fx-play-scene::before,
.fx-clean-scene::before,
.fx-rest-scene::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: 124px;
  height: 64px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, .78), rgba(255, 255, 255, .18) 60%, transparent 75%);
  filter: blur(.2px);
  opacity: .92;
  z-index: -1;
}

.fx-feed-item {
  position: absolute;
  left: 62%;
  top: 16%;
  font-size: 30px;
  opacity: 1;
  -webkit-text-stroke: .6px rgba(0, 0, 0, .38);
  text-shadow: 0 3px 8px rgba(0, 0, 0, .45), 0 0 2px rgba(255, 255, 255, .55);
  transform-origin: center;
  animation: fx-feed-drop 1.05s ease forwards;
}

.fx-feed-bowl {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: 86px;
  height: 36px;
  border-radius: 0 0 30px 30px;
  border: 3px solid rgba(138, 79, 38, 1);
  border-top: none;
  background: linear-gradient(180deg, rgba(255, 231, 198, .65), rgba(222, 166, 105, .92));
  box-shadow: inset 0 -10px 12px rgba(112, 63, 18, .22), 0 4px 12px rgba(0, 0, 0, .25);
  animation: fx-feed-bowl-pop .45s ease;
}

.fx-feed-food {
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translateX(-50%);
  width: 66px;
  height: 16px;
  border-radius: 999px;
  background: radial-gradient(circle at 18% 48%, #9a5b2f 0 14%, transparent 15%),
              radial-gradient(circle at 34% 52%, #c8783b 0 16%, transparent 17%),
              radial-gradient(circle at 56% 42%, #9a5b2f 0 15%, transparent 16%),
              radial-gradient(circle at 74% 56%, #c8783b 0 15%, transparent 16%),
              linear-gradient(180deg, #d39256, #b26a33);
  box-shadow: 0 1px 6px rgba(52, 27, 8, .55);
  animation: fx-food-eat 1.45s ease forwards;
}

.fx-play-toy {
  position: absolute;
  left: 18%;
  top: 42%;
  font-size: 34px;
  opacity: 1;
  -webkit-text-stroke: .6px rgba(0, 0, 0, .35);
  text-shadow: 0 3px 8px rgba(0, 0, 0, .45), 0 0 2px rgba(255, 255, 255, .6);
  animation: fx-toy-zigzag 1.2s ease-in-out infinite;
}

.fx-play-spark {
  position: absolute;
  font-size: 20px;
  opacity: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  animation: fx-play-sparkle .8s ease-in-out infinite;
}

.fx-play-spark.spark-a { left: 70%; top: 26%; }
.fx-play-spark.spark-b { left: 76%; top: 52%; animation-delay: .22s; }

.fx-clean-tub {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  font-size: 40px;
  opacity: 1;
  -webkit-text-stroke: .6px rgba(0, 0, 0, .3);
  text-shadow: 0 3px 10px rgba(0, 0, 0, .45), 0 0 2px rgba(255, 255, 255, .6);
  animation: fx-clean-tub-pop .5s ease;
}

.fx-clean-bubble {
  position: absolute;
  font-size: 24px;
  opacity: 1;
  text-shadow: 0 2px 5px rgba(0, 0, 0, .28), 0 0 2px rgba(255, 255, 255, .55);
  animation: fx-clean-bubble-rise 1.25s ease-in-out infinite;
}

.fx-clean-bubble.bubble-a { left: 28%; bottom: 24px; }
.fx-clean-bubble.bubble-b { left: 52%; bottom: 26px; animation-delay: .25s; }
.fx-clean-bubble.bubble-c { left: 66%; bottom: 22px; animation-delay: .5s; }

.fx-rest-cloud {
  position: absolute;
  left: 52%;
  top: 56%;
  transform: translate(-50%, -50%);
  font-size: 40px;
  opacity: 1;
  -webkit-text-stroke: .5px rgba(0, 0, 0, .24);
  text-shadow: 0 3px 8px rgba(0, 0, 0, .35), 0 0 2px rgba(255, 255, 255, .7);
}

.fx-rest-zzz {
  position: absolute;
  right: 10%;
  top: 10%;
  font-size: 25px;
  opacity: 1;
  -webkit-text-stroke: .6px rgba(0, 0, 0, .32);
  text-shadow: 0 3px 7px rgba(0, 0, 0, .4), 0 0 2px rgba(255, 255, 255, .55);
  animation: fx-rest-zzz-float 1.3s ease-in-out infinite;
}

.fx-rest-zzz.zzz-b {
  right: 4%;
  top: 20%;
  font-size: 21px;
  animation-delay: .35s;
}

.fx-generic {
  display: grid;
  place-items: center;
  font-size: 32px;
  -webkit-text-stroke: .6px rgba(0, 0, 0, .35);
  text-shadow: 0 3px 8px rgba(0, 0, 0, .45), 0 0 2px rgba(255, 255, 255, .6);
  animation: fx-play-sparkle .9s ease-in-out infinite;
}

.cloth-slot-head,
.cloth-slot-neck,
.cloth-slot-body {
  width: 0;
  height: 0;
  position: relative;
}

.cloth-slot-head.cloth-item-hat {
  width: 52px;
  height: 22px;
  border-radius: 12px 12px 7px 7px;
  background: linear-gradient(180deg, #475063, #2f3747);
  box-shadow: 0 7px 0 -2px #1b2130, 0 4px 10px rgba(0, 0, 0, .25);
}

.cloth-slot-head.cloth-item-crown {
  width: 46px;
  height: 20px;
  background: linear-gradient(120deg, #ffd451, #ffb300);
  clip-path: polygon(0 100%, 8% 40%, 24% 70%, 42% 20%, 58% 70%, 76% 35%, 92% 70%, 100% 100%);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3));
}

.cloth-slot-head.cloth-item-ribbon,
.cloth-slot-neck.cloth-item-ribbon {
  width: 34px;
  height: 16px;
  background: linear-gradient(165deg, #ff7ca8, #e74381);
  clip-path: polygon(0 50%, 32% 0, 50% 50%, 32% 100%);
  box-shadow: 17px 0 0 0 #f05590, 0 2px 5px rgba(0, 0, 0, .24);
}

.cloth-slot-neck.cloth-item-bow_tie {
  top: 140px;
  width: 56px;
  height: 24px;
  background: transparent;
  box-shadow: none;
}

.cloth-slot-neck.cloth-item-bow_tie::before,
.cloth-slot-neck.cloth-item-bow_tie::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 24px;
  height: 18px;
  background: linear-gradient(165deg, #ff76a4, #df336f);
  border-radius: 9px;
  transform: translateY(-50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .24), inset 0 1px 3px rgba(255, 255, 255, .3);
}

.cloth-slot-neck.cloth-item-bow_tie::before {
  left: 2px;
  clip-path: polygon(100% 50%, 8% 0, 0 50%, 8% 100%);
}

.cloth-slot-neck.cloth-item-bow_tie::after {
  right: 2px;
  clip-path: polygon(0 50%, 92% 0, 100% 50%, 92% 100%);
}

.cloth-slot-neck.cloth-item-bow_tie {
  background-image:
    radial-gradient(circle at 50% 48%, #ffd9e6 0 18%, #ffb7cd 19% 31%, transparent 32%),
    linear-gradient(180deg, rgba(255, 217, 230, .88), rgba(255, 185, 206, .82));
  background-size: 24px 24px, 12px 20px;
  background-repeat: no-repeat;
  background-position: center, center;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .2));
}

.cloth-slot-body.cloth-item-cape {
  top: 96px;
  width: 186px;
  height: 136px;
  border-radius: 26px 26px 42px 42px;
  background:
    linear-gradient(180deg, rgba(228, 77, 56, .98), rgba(132, 30, 22, .95)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .08) 0 6px, rgba(255, 255, 255, 0) 6px 12px);
  clip-path: polygon(4% 6%, 96% 6%, 100% 29%, 92% 100%, 8% 100%, 0 29%);
  opacity: .98;
  z-index: 2;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .28));
}

.cloth-slot-body.cloth-item-cape::before,
.cloth-slot-body.cloth-item-cape::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 38px;
  height: 92px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(178, 38, 28, .95), rgba(98, 17, 12, .9));
  opacity: .9;
}

.cloth-slot-body.cloth-item-cape::before {
  left: -18px;
  transform: rotate(6deg);
}

.cloth-slot-body.cloth-item-cape::after {
  right: -18px;
  transform: rotate(-6deg);
}

.cloth-slot-body.cloth-item-armor {
  top: 122px;
  width: 72px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(180deg, #c6d5e5, #879cb4 62%, #7389a1);
  border: 2px solid rgba(33, 52, 73, 0.58);
  box-shadow: inset 0 7px 10px rgba(255, 255, 255, .35), inset 0 -7px 10px rgba(48, 72, 98, .26), 0 4px 10px rgba(0, 0, 0, .2);
  z-index: 8;
}

@keyframes pet-tail-wag {
  0%,100% { transform: rotate(8deg); }
  50% { transform: rotate(-13deg); }
}

@keyframes stage-light-drift {
  0%, 100% { transform: translate3d(-2%, -1%, 0) scale(1); }
  50% { transform: translate3d(2%, 1.5%, 0) scale(1.04); }
}

@keyframes stage-scan {
  0% { transform: translateX(-28%); }
  100% { transform: translateX(24%); }
}

@keyframes stage-hit-flash {
  0% { filter: brightness(1); }
  38% { filter: brightness(1.14); }
  100% { filter: brightness(1); }
}

@keyframes pet-shell-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.015); }
}

@keyframes pet-eye-blink {
  0%, 88%, 100% { transform: scaleY(1); }
  90%, 92% { transform: scaleY(0.1); }
  94% { transform: scaleY(0.55); }
}

@keyframes pet-eye-shine-pulse {
  0%, 88%, 100% { opacity: .95; transform: scale(1); }
  90%, 94% { opacity: 0; transform: scale(0.1); }
}

@keyframes pet-ear-idle-left {
  0%, 88%, 100% { transform: rotate(-18deg); }
  92% { transform: rotate(-26deg); }
  96% { transform: rotate(-14deg); }
}

@keyframes pet-ear-idle-right {
  0%, 84%, 100% { transform: rotate(18deg); }
  89% { transform: rotate(27deg); }
  94% { transform: rotate(13deg); }
}

@keyframes pet-ear-flick-left {
  0%, 100% { transform: rotate(-18deg); }
  45% { transform: rotate(-34deg); }
}

@keyframes pet-ear-flick-right {
  0%, 100% { transform: rotate(18deg); }
  45% { transform: rotate(34deg); }
}

@keyframes pet-sniff {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-1px) scale(1.12); }
}

@keyframes pet-tail-swish {
  0%, 100% { transform: rotate(10deg); }
  50% { transform: rotate(-26deg); }
}

@keyframes pet-body-shift {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  35% { transform: translate(-52%, -50%) rotate(-2deg) scale(1.012); }
  70% { transform: translate(-49%, -50%) rotate(1.3deg) scale(1.006); }
  100% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
}

@keyframes pet-sleep-twitch {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  30% { transform: translate(-50%, -50%) rotate(-1.8deg) scale(0.996); }
  60% { transform: translate(-50%, -50%) rotate(1.8deg) scale(1.004); }
}

@keyframes pet-hop {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-16px) scale(1.04); }
  65% { transform: translateY(-6px) scale(.99); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes pet-ear-run-left {
  0%, 100% { transform: rotate(-18deg); }
  50% { transform: rotate(-28deg); }
}

@keyframes pet-ear-run-right {
  0%, 100% { transform: rotate(18deg); }
  50% { transform: rotate(28deg); }
}

@keyframes pet-cheek-pop {
  0%, 100% { transform: scale(1); opacity: .8; }
  50% { transform: scale(1.1); opacity: 1; }
}

@keyframes pet-torso-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(-1deg); }
}

@keyframes pet-paw-step-left {
  0%, 100% { transform: translateY(0) scale(1); }
  25% { transform: translate(-2px, -4px) scale(1.04); }
  50% { transform: translateY(1px) scale(.97); }
  75% { transform: translate(1px, -2px) scale(1.01); }
}

@keyframes pet-paw-step-right {
  0%, 100% { transform: translateY(1px) scale(.97); }
  25% { transform: translate(1px, -2px) scale(1.01); }
  50% { transform: translateY(0) scale(1); }
  75% { transform: translate(-2px, -4px) scale(1.04); }
}

@keyframes pet-paw-compress {
  0%, 100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(2px) scaleY(.82) scaleX(1.08); }
  60% { transform: translateY(-1px) scaleY(1.04); }
}

@keyframes fx-drop {
  0% { transform: translateY(-8px) scale(.8); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(46px) scale(1); opacity: 0; }
}

@keyframes fx-feed-drop {
  0% { transform: translate(8px, -14px) rotate(-14deg) scale(.72); opacity: .5; }
  35% { opacity: 1; }
  100% { transform: translate(-6px, 92px) rotate(10deg) scale(1); opacity: 1; }
}

@keyframes fx-feed-bowl-pop {
  0% { transform: translateX(-50%) scale(.7); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

@keyframes fx-food-eat {
  0% { transform: translateX(-50%) scaleX(1); opacity: 1; }
  65% { transform: translateX(-50%) scaleX(.55); opacity: .98; }
  100% { transform: translateX(-50%) scaleX(.18); opacity: 1; }
}

@keyframes fx-bounce {
  0%,100% { transform: translate(0, 0); }
  30% { transform: translate(18px, -26px); }
  60% { transform: translate(36px, 0); }
}

@keyframes fx-toy-zigzag {
  0% { transform: translate(0, 0) rotate(0deg); }
  22% { transform: translate(24px, -22px) rotate(10deg); }
  48% { transform: translate(52px, -3px) rotate(-8deg); }
  72% { transform: translate(78px, -20px) rotate(8deg); }
  100% { transform: translate(104px, 0) rotate(0deg); }
}

@keyframes fx-play-sparkle {
  0%, 100% { transform: scale(.7); opacity: .78; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes fx-bubble {
  0% { transform: translateY(8px) scale(.75); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translateY(-20px) scale(1.1); opacity: 0; }
}

@keyframes fx-clean-tub-pop {
  0% { transform: translateX(-50%) translateY(12px) scale(.8); opacity: 0; }
  100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}

@keyframes fx-clean-bubble-rise {
  0% { transform: translateY(0) scale(.55); opacity: .65; }
  25% { opacity: 1; }
  100% { transform: translateY(-74px) scale(1.15); opacity: .9; }
}

@keyframes fx-twinkle {
  0%,100% { transform: scale(.6) rotate(0deg); opacity: .3; }
  50% { transform: scale(1.05) rotate(12deg); opacity: 1; }
}

@keyframes fx-rest-zzz-float {
  0% { transform: translateY(6px) scale(.8); opacity: .6; }
  30% { opacity: 1; }
  100% { transform: translateY(-22px) scale(1.06); opacity: .95; }
}

@keyframes fx-zzz {
  0% { transform: translateY(4px) scale(.8); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(-18px) scale(1); opacity: 0; }
}

@keyframes pet-walk-step {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  25% { transform: translateY(-4px) rotate(-1deg) scale(1.01); }
  50% { transform: translateY(0) rotate(1deg) scale(0.995); }
  75% { transform: translateY(-3px) rotate(-0.8deg) scale(1.005); }
}

/* State classes on pet-emoji */
#petEmoji.pet-state-idle     { animation:pet-bob     2.2s ease-in-out infinite; }
#petEmoji.pet-state-sleeping { animation:pet-sleep   3.5s ease-in-out infinite; filter:drop-shadow(0 4px 4px rgba(0,0,0,.15)); }
#petEmoji.pet-state-waking   { animation:pet-wake    1.4s ease both; }
#petEmoji.pet-state-eating   { animation:pet-eat     .6s ease infinite; }
#petEmoji.pet-state-playing  { animation:pet-play    .7s ease-in-out infinite; }
#petEmoji.pet-state-cleaning { animation:pet-clean   1.2s linear infinite; }
#petEmoji.pet-state-resting  { animation:pet-rest    2.8s ease-in-out infinite; }
#petEmoji.pet-state-happy    { animation:pet-happy   1s ease-in-out; }
#petEmoji.pet-state-sad      { animation:pet-sad     2.5s ease-in-out infinite; }
#petEmoji.pet-state-ill      { animation:pet-ill     1.8s ease-in-out infinite; }
#petEmoji.pet-state-angry    { animation:pet-angry   .3s ease-in-out infinite; }
#petEmoji.pet-state-excited  { animation:pet-excited .6s ease-in-out infinite; }
#petEmoji.pet-state-loyalty-warn {
  animation:pet-bob 2s ease-in-out infinite;
  border-radius:50%;
  animation:pet-bob 2s ease-in-out infinite, loyalty-pulse 1.5s ease infinite;
}
/* pet-body-wrap hosts animations when a photo is present */
.pet-body-wrap.pet-state-sleeping { filter:drop-shadow(0 6px 6px rgba(0,0,0,.18)); }
.pet-body-wrap.pet-state-loyalty-warn { border-radius: 0; }
.react { animation:pop-in .4s ease both !important; }

/* ZZZ element */
.zzz-badge {
  position:absolute; top:-10px; right:-14px;
  font-size:18px; pointer-events:none;
  animation:zzz-float 2s ease-out infinite;
}
.zzz-badge.zzz-2 { animation-delay:.7s; font-size:13px; right:-4px; }
.zzz-badge.zzz-3 { animation-delay:1.4s; font-size:10px; right:6px; }

/* Sleeping/resting: pet is lying down, body in lower portion → position Zs closer to body */
.pet-body-wrap.pet-state-sleeping .zzz-badge,
.pet-body-wrap.pet-state-resting .zzz-badge { top:48px; right:2px; }
.pet-body-wrap.pet-state-sleeping .zzz-badge.zzz-2,
.pet-body-wrap.pet-state-resting .zzz-badge.zzz-2 { top:34px; right:12px; }
.pet-body-wrap.pet-state-sleeping .zzz-badge.zzz-3,
.pet-body-wrap.pet-state-resting .zzz-badge.zzz-3 { top:22px; right:21px; }

/* Clothing overlays */
.cloth-slot-head {
  position:absolute; top:16px; left:50%;
  transform:translateX(-50%);
  font-size:28px; text-align:center; pointer-events:none;
  z-index: 7;
}
.cloth-slot-neck {
  position:absolute; top:130px; left:50%;
  transform:translateX(-50%);
  font-size:20px; text-align:center; pointer-events:none;
  z-index: 7;
}
.cloth-slot-body {
  position:absolute; top:124px; left:50%;
  transform:translateX(-50%);
  font-size:28px; text-align:center; pointer-events:none;
  opacity:.92;
  z-index: 6;
}

.pet-body-wrap.has-sprite-pet .cloth-slot-head { top: 20px; }
.pet-body-wrap.has-sprite-pet .cloth-slot-neck { top: 134px; }
.pet-body-wrap.has-sprite-pet .cloth-slot-body { top: 126px; }

/* Mood bubble */
.mood-bubble {
  position:absolute; top:6px; right:8px;
  font-size:26px; animation:shimmer 2.5s ease-in-out infinite;
  z-index: 7;
}
.sched-bubble {
  position:absolute; top:6px; left:8px;
  font-size:13px; background:rgba(0,0,0,.55); color:#fff;
  padding:3px 7px; border-radius:999px;
  z-index: 7;
}
.action-anim-label {
  position:absolute; bottom:-2px; left:50%;
  transform:translateX(-50%);
  font-size:12px; font-weight:700; color:var(--accent);
  animation:fade-up .25s ease;
  z-index: 8;
}

/* ══════════════ PET INFO ═══════════════════════════ */
.pet-info-bar { margin-top:8px; }
.pet-name-row { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.pet-breed  { font-weight:800; font-size:18px; line-height:1.1; }
.pet-breed-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--soft);
  letter-spacing: .02em;
}
.pet-rename-btn {
  border:none;
  background:transparent;
  font-size:14px;
  cursor:pointer;
  line-height:1;
  padding:0;
}
.pet-life-info { font-size:11px; color:var(--soft); margin-top:2px; }
.badge { font-size:11px; padding:2px 8px; border-radius:999px; font-weight:700; }
.badge.level { background:#e3f2fd; color:#1565c0; }
.badge.rarity.common { background:#e8f5e9; color:#2e7d32; }
.badge.rarity.rare   { background:#e3f2fd; color:#0277bd; }
.badge.rarity.epic   { background:#f3e5f5; color:#6a1b9a; }
.exp-track { height:6px; border-radius:999px; background:#eee; margin:6px 0 2px; overflow:hidden; }
.exp-fill  { height:100%; background:linear-gradient(90deg,#42a5f5,#ab47bc); transition:width .4s; }
.exp-label { font-size:11px; color:var(--soft); }

/* Intimacy bar */
.intimacy-row { display:flex; align-items:center; gap:8px; margin:6px 0; }
.intimacy-label { font-size:12px; white-space:nowrap; }
.intimacy-track { flex:1; height:6px; border-radius:999px; background:#fce4ec; overflow:hidden; }
.intimacy-fill  { height:100%; background:linear-gradient(90deg,#f48fb1,#e91e63); transition:width .4s; }
.intimacy-fill.warn { background:linear-gradient(90deg,#ef5350,#b71c1c); animation:shimmer .8s ease infinite; }
.intimacy-val   { font-size:11px; font-weight:700; color:#e91e63; min-width:26px; text-align:right; }

/* Stats */
.stat-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin:8px 0; }
.stat-item {}
.stat-header { display:flex; align-items:center; gap:4px; font-size:12px; }
.stat-name { flex:1; }
.stat-val { font-weight:700; font-size:12px; }
.stat-bar-track { height:5px; background:#eee; border-radius:999px; margin-top:3px; overflow:hidden; }
.stat-bar-fill  { height:100%; border-radius:999px; transition:width .4s; }

/* Clothing display row */
.clothing-display {
  display:flex; align-items:center; gap:6px; margin:4px 0;
  flex-wrap:wrap;
}
.clothing-display-label { font-size:12px; color:var(--soft); }
.clothing-slots { display:flex; gap:6px; }
.clothing-slot-badge {
  background:#fff3e0; border:1px solid #ffe0b2; border-radius:8px;
  padding:3px 8px; font-size:12px; cursor:pointer;
  display:flex; align-items:center; gap:3px;
}
.clothing-slot-badge:hover { background:#ffe0b2; }

/* Action row */
.action-row { display:flex; gap:6px; margin-top:10px; flex-wrap:wrap; }
.action-btn {
  flex:1; min-width:56px; border:0; border-radius:14px; padding:12px 4px;
  background:#fff; box-shadow:0 2px 8px rgba(0,0,0,.06);
  cursor:pointer; text-align:center; transition:transform .1s, box-shadow .1s;
  display:flex; flex-direction:column; align-items:center; gap:2px;
  min-height: 60px;  /* adequate tap target */
}
.action-btn:active { transform:scale(.94); box-shadow:none; }
.a-icon  { font-size:22px; }
.a-label { font-size:11px; color:var(--soft); }
.friendship-bar-wrap { font-size:12px; color:var(--soft); margin-top:6px; text-align:right; }

/* ══════════════ ICON BUTTONS ════════════════════════ */
.icon-btn {
  border:0; border-radius:14px; padding:10px 14px; min-width:90px;
  background:#fff; box-shadow:0 2px 8px rgba(0,0,0,.06); cursor:pointer;
  display:flex; flex-direction:column; align-items:center; gap:3px;
  transition:transform .1s;
}
.icon-btn:active { transform:scale(.94); }
.icon-btn.accent { background:linear-gradient(120deg,var(--accent),var(--accent2)); color:#fff; }
.icon-btn-icon  { font-size:22px; }
.icon-btn-label { font-size:12px; font-weight:600; }

/* ══════════════ EXPLORE MAP ═══════════════════════ */
.explore-map-shell {
  margin-top: 10px;
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(255,255,255,.96), rgba(255,247,238,.9));
  border: 1px solid rgba(255,255,255,.88);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  padding: 10px;
}

.explore-map-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.explore-loc-text,
.explore-radar-hint {
  font-size: 11px;
  color: var(--soft);
  font-weight: 700;
}

.explore-map-mode {
  margin-left: auto;
  font-size: 10px;
  color: #fff;
  background: rgba(36, 71, 99, .72);
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
}

.map-provider-admin-panel {
  margin-bottom: 8px;
}

.map-ak-row {
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.map-ak-row .auth-input {
  min-height: 36px;
}

.sdk-diag-toggle-btn {
  min-width: 36px;
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1;
  border-radius: 8px;
}

/* SDK Diagnostic Panel */
.sdk-diag-panel {
  margin-bottom: 10px;
  background: rgba(0, 0, 0, .04);
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: 10px;
  padding: 10px 12px 8px;
  font-size: 12px;
}

.sdk-diag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.sdk-diag-label {
  width: 44px;
  font-weight: 700;
  color: var(--soft);
  flex-shrink: 0;
}

.sdk-diag-status {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sdk-diag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background .3s;
}

.sdk-diag-dot.ok      { background: #4caf50; }
.sdk-diag-dot.warn    { background: #ff9800; }
.sdk-diag-dot.err     { background: #f44336; }
.sdk-diag-dot.unknown { background: #bdbdbd; }

.sdk-diag-text {
  color: var(--fg);
}

.sdk-diag-tip {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  background: rgba(255, 152, 0, .10);
  border: 1px solid rgba(255, 152, 0, .22);
  color: #b34a00;
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-line;
  display: none;
}

.sdk-diag-tip:not(:empty) {
  display: block;
}

.sdk-diag-run-btn {
  margin-top: 8px;
  font-size: 12px;
  padding: 5px 14px;
}



.explore-map-canvas {
  position: relative;
  height: 360px;
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(0deg, rgba(146, 220, 165, .34), rgba(146, 220, 165, .34)) 0 0 / 100% 100%,
    repeating-linear-gradient(0deg, rgba(255,255,255,.26) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.26) 0 1px, transparent 1px 24px),
    radial-gradient(circle at 25% 22%, rgba(255,239,197,.44), transparent 42%),
    linear-gradient(150deg, #86d1ff, #a8e6cf 48%, #c6f3d4);
}

.explore-enter-spot-btn {
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 12px;
  padding: 8px 12px;
  background: linear-gradient(120deg, rgba(255,112,67,.18), rgba(255,183,77,.28));
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(0,0,0,.12);
}

.spot-scene-card {
  width: min(96vw, 860px);
  height: min(88vh, 700px);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}



.spot-scene-card.full-stage-mode .spot-scene-content {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 0;
  pointer-events: auto;
}

.spot-scene-card.full-stage-mode .spot-stage-wrap {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
  overflow: visible;
  pointer-events: auto;
}

.spot-scene-card.full-stage-mode .spot-scene-stage {
  position: absolute;
  inset: 0;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  pointer-events: auto;
}

.spot-scene-card.full-stage-mode .spot-scene-sidebar {
  position: absolute;
  top: 84px;
  right: 18px;
  width: min(280px, 34vw);
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
  z-index: 3;
  pointer-events: auto;
}

.spot-scene-card.full-stage-mode .spot-selected-card {
  background: rgba(255,255,255,.96);
  border-radius: 14px;
  padding: 12px;
}

.spot-scene-card.full-stage-mode .spot-actor,
.spot-scene-card.full-stage-mode .spot-actor-bubble {
  pointer-events: auto;
}

.spot-scene-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 0;
  transition: background 0.4s ease;
}

.spot-scene-card.has-bg::before {
  background: none;
}

  .spot-scene-card {
    position: relative;
    width: 860px;
    height: 700px;
    background: #222;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 32px #0002;
    /* 恢复背景图片为 cover 模式 */
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
  }
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}

.spot-scene-online {
  margin-top: 2px;
  font-size: 12px;
  color: #ffffff !important;
  font-weight: 800;
  text-shadow: 0 1px 4px rgba(0,0,0,.75);
  background: rgba(0,0,0,.36);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 3px 10px;
  line-height: 1;
}

.spot-scene-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 10px;
  min-height: 0;
}

.spot-scene-content.is-compact {
  grid-template-columns: 1fr;
}

.spot-market-card {
  width: min(960px, 95vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(165deg, rgba(14,22,38,.94), rgba(17,33,58,.92));
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.14);
}

.spot-market-create {
  display: grid;
  grid-template-columns: 2fr .8fr .9fr auto auto;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0,0,0,.18);
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.spot-market-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spot-market-field label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  padding-left: 2px;
}

.spot-market-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 14px 14px;
  min-height: 0;
  overflow: hidden;
}

.spot-market-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spot-market-list {
  overflow: auto;
  min-height: 200px;
  max-height: 52vh;
  padding: 2px;
}

.spot-market-item {
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 8px;
  background: rgba(255,255,255,.08);
  color: #fff;
}

.spot-market-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}

.spot-market-item-sub {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,.86);
}

.spot-market-item-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.spot-market-item-actions .auth-input {
  max-width: 88px;
  color: #fff;
  background: rgba(0,0,0,.25);
}

.spot-market-buy-label {
  font-size: 12px;
  color: rgba(255,255,255,.86);
}

.spot-market-empty {
  border: 1px dashed rgba(255,255,255,.3);
  border-radius: 12px;
  padding: 12px;
  color: rgba(255,255,255,.82);
  text-align: center;
}

@media (max-width: 900px) {
  .spot-market-create {
    grid-template-columns: 1fr;
  }

  .spot-market-columns {
    grid-template-columns: 1fr;
    max-height: 56vh;
  }

  .spot-market-list {
    max-height: 26vh;
  }
}

.spot-stage-wrap,
.spot-scene-players,
.spot-selected-card,
.dm-message-list {
  border-radius: 12px;
  padding: 10px;
  background: transparent;
  overflow: auto;
}

.spot-stage-wrap {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  min-height: 0;
  background: transparent;
  backdrop-filter: none;
}

.spot-stage-wrap.is-compact {
  grid-template-rows: 1fr;
}

.spot-scene-sidebar.is-hidden,
.spot-scene-ticker.is-hidden,
.spot-scene-players.is-hidden {
  display: none !important;
}

  .spot-scene-card {
    position: relative;
    width: 860px;
    height: 700px;
    background: #222;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 32px #0002;
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
  }
  height: 22%;
  background: transparent;
}

.spot-scene-ticker {
  min-height: 68px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.spot-feed-item {
  border-radius: 10px;
  padding: 8px 10px;
  background: transparent;
  font-size: 12px;
  line-height: 1.45;
  color: #ffffff;
}

.spot-feed-meta {
  font-size: 11px;
  color: #607089;
}

.spot-scene-sidebar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  min-height: 0;
}

.spot-scene-side-title {
  margin-bottom: 6px;
  font-size: 12px;
  color: rgba(255,255,255,.95);
  font-weight: 700;
}

.spot-scene-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  position: relative;
  z-index: 2;
}

.spot-scene-chat-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.spot-msg-item {
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.spot-msg-meta {
  color: #6e6e6e;
  font-size: 11px;
}

.spot-msg-body {
  color: #222;
}

.spot-player-btn {
  width: 100%;
  margin-bottom: 6px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  padding: 7px 8px;
  text-align: left;
  background: transparent;
  font-size: 12px;
}

.spot-player-btn.active {
  border-color: rgba(255,112,67,.55);
  box-shadow: 0 0 0 2px rgba(255,112,67,.18);
}

.spot-player-name {
  font-weight: 700;
  color: #243041;
}

.spot-player-pet {
  margin-top: 2px;
  color: #4f5c6f;
  font-size: 11px;
}

.spot-selected-card {
  display: grid;
  gap: 6px;
}

.spot-selected-avatar {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff8e6, #ffd8a8);
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
  font-size: 34px;
}

.spot-selected-avatar .spot-actor-thumb,
.spot-selected-avatar .pet-thumb-emoji {
  width: 68px;
  height: 68px;
  border-radius: 18px;
}

.recharge-sheet {
  width: min(92vw, 460px);
}

.recharge-order-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(0,0,0,.06);
}

.recharge-qr-image {
  display: block;
  width: 240px;
  height: 240px;
  margin: 12px auto;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}

.recharge-order-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}

.recharge-confirm-btn {
  width: auto;
  min-width: 180px;
}

.recharge-package-card {
  cursor: default;
}

.recharge-package-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.spot-selected-name {
  font-size: 15px;
  font-weight: 800;
  color: #223146;
}

.spot-selected-meta,
.spot-selected-status {
  font-size: 12px;
  color: #5e6c80;
  line-height: 1.5;
}

.spot-selected-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.spot-actor {
  --pos-x: 50%;
  --pos-y: 60%;
  --dir: 1;
  position: absolute;
  left: var(--pos-x);
  top: var(--pos-y);
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 4px;
  cursor: pointer;
  animation: spot-actor-float 2.6s ease-in-out infinite;
  transition: transform .18s ease;
  z-index: 2;
  border: 0;
  background: transparent;
  padding: 0;
  appearance: none;
}

.spot-actor.self {
  z-index: 3;
}

.spot-actor-pet {
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  position: relative;
}

.spot-actor-pet::after {
  content: none;
}

.spot-actor-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  transform: scaleX(var(--dir));
  transition: transform .35s ease;
}

.spot-actor-thumb {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}

.spot-actor-thumb.pet-thumb-emoji {
  font-size: 32px;
  line-height: 1;
}

.spot-actor-level {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255,255,255,.95);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

.spot-actor-name {
  max-width: 120px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--name-color, #ffffff);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-shadow:
    0 1px 2px rgba(0,0,0,.9),
    0 0 8px rgba(0,0,0,.55);
}

.spot-actor-badge,
.spot-actor-bubble {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.spot-actor-badge {
  top: -12px;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  z-index: 4;
}

.spot-actor-badge.stall-mark {
  top: -38px;
  min-width: 40px;
  height: 40px;
  background: rgba(20,20,20,.65);
  border: 1px solid rgba(255,255,255,.58);
  box-shadow: 0 8px 18px rgba(0,0,0,.38);
  font-size: 20px;
  z-index: 5;
}

.spot-actor-bubble {
  top: -48px;
  max-width: 180px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.52);
  color: #fff;
  font-size: 11px;
  box-shadow: 0 8px 16px rgba(0,0,0,.22);
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  z-index: 3;
}

.spot-actor-bubble.stall {
  background: transparent;
}

.spot-empty-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.92);
  font-weight: 700;
}

.dm-card {
  width: min(92vw, 560px);
  max-height: min(86vh, 720px);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 10px;
  background: linear-gradient(180deg, #fffdf9, #ffeedd);
  box-shadow: 0 22px 44px rgba(0,0,0,.24);
}

.dm-message-list {
  min-height: 320px;
  max-height: 56vh;
  display: grid;
  gap: 8px;
}

.dm-item {
  max-width: 82%;
  padding: 8px 10px;
  border-radius: 14px;
  background: #fff;
  color: #203040;
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
}

.dm-item.self {
  margin-left: auto;
  background: #ffe0cf;
}

.dm-meta {
  font-size: 11px;
  color: #6b7689;
  margin-bottom: 4px;
}

.friend-card {
  display: grid;
  gap: 8px;
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 22px rgba(0,0,0,.07);
}

.friend-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.friend-status {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.friend-status.online {
  background: rgba(102,187,106,.16);
  color: #2e7d32;
}

.friend-status.offline {
  background: rgba(120,132,158,.14);
  color: #58657b;
}

.friend-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.friend-request-actions {
  justify-content: flex-start;
}

.friend-admin-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg,#ffe79a 0%,#ffca5f 100%);
  color: #5f3900;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
  box-shadow: 0 4px 10px rgba(126,84,0,.18);
}

.friend-unread-chip,
.friend-inline-count,
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(120,132,158,.14);
  color: #58657b;
}

.friend-unread-chip.has-unread,
.friend-inline-count.has-unread,
.nav-badge {
  background: linear-gradient(135deg, #ff9a62 0%, #ff5f6d 100%);
  color: #fff;
}

.nav-btn-friends {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: 6px;
  right: 12px;
  min-width: 22px;
  padding: 2px 6px;
  line-height: 1.2;
  box-shadow: 0 6px 14px rgba(255,95,109,.24);
}

@keyframes spot-actor-float {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -5px; }
}

@media (max-width: 768px) {
  .spot-scene-content {
    grid-template-columns: 1fr;
  }

  .spot-scene-card {
    width: 98vw;
    height: 92vh;
    padding: 10px;
  }
}

.explore-map-zoom-controls {
  margin-top: 8px;
  display: none;
  gap: 6px;
}

.map-zoom-btn {
  min-width: 34px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.95);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.map-zoom-btn.reset {
  min-width: 42px;
  font-size: 13px;
}

.map-zoom-btn:active {
  transform: translateY(1px);
}

@media (max-width: 768px) {
  .explore-map-canvas {
    height: 320px;
  }
}

.explore-map-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.06), rgba(0,0,0,.06));
}

.explore-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 6px 12px rgba(0,0,0,.22);
}

.explore-marker.self {
  width: 0;
  height: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, calc(-50% - 26px));
  z-index: 6;
}

.explore-marker.self.raised {
  transform: translate(-50%, calc(-50% - 32px));
}

.explore-self-pin {
  position: relative;
  width: 24px;
  height: 30px;
  filter: drop-shadow(0 5px 10px rgba(14,86,170,.34));
  pointer-events: none;
}

.explore-self-pin-head {
  position: absolute;
  left: 50%;
  top: 0;
  width: 24px;
  height: 24px;
  transform: translateX(-50%) rotate(-45deg);
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(145deg, #4aa7ff 0%, #1677ff 100%);
  border: 2px solid rgba(255,255,255,.95);
  box-shadow: 0 6px 12px rgba(14,86,170,.34);
}

.explore-self-pin-core {
  position: absolute;
  left: 50%;
  top: 50%;
  min-width: 13px;
  height: 13px;
  padding: 0 3px;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 999px;
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(46,131,228,.42);
  color: #1261c6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .2px;
  white-space: nowrap;
}

.explore-self-pin-core.is-en {
  font-size: 8px;
  letter-spacing: 0;
}

.explore-self-pin-tip {
  position: absolute;
  left: 50%;
  bottom: 0;
  min-width: 15px;
  height: 15px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: rgba(22, 100, 192, .46);
}

.explore-marker.self .explore-marker-label {
  top: -20px;
  background: rgba(47, 151, 242, .9);
  font-weight: 700;
  font-size: 12px;

.explore-marker.player { background: #26c281; }
.explore-marker.poi {
  width: 16px;
  height: 16px;
  background: radial-gradient(circle at 35% 30%, #fff8cf 0%, #ffd84d 46%, #f0b200 100%);
  border: 2px solid rgba(255,255,255,.96);
  font-size: 9px;
}
.explore-marker.npc { background: #5f6b7a; }
  background: rgba(22, 31, 45, .72);
  color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  white-space: nowrap;
}

.explore-marker-label.station {
  background: linear-gradient(135deg, #fff2b0 0%, #ffe07a 52%, #ffd55c 100%);
  color: #5e3f00;
  border: 1px solid rgba(169, 113, 0, .38);
  box-shadow: 0 4px 10px rgba(127, 96, 0, .22);
  font-weight: 700;
}

.explore-marker-label.station.npc {
  background: linear-gradient(135deg, #f0e8ff 0%, #d7c4ff 100%);
  color: #3c2a70;
  border-color: rgba(104, 77, 168, .35);
}

.explore-marker-label.player {
  background: linear-gradient(135deg, #b9f6cf 0%, #7be6a6 52%, #52cb87 100%);
  color: #0d4b2a;
  border: 1px solid rgba(30, 116, 71, .34);
  box-shadow: 0 4px 10px rgba(18, 98, 56, .24);
  font-weight: 700;
}

/* Remove default AMap label chrome to keep marker labels color-consistent. */
.amap-marker-label {
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}

.amap-marker-label:focus,
.amap-marker-label *:focus {
  outline: none !important;
}

.explore-route-line {
  position: absolute;
  height: 2px;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, rgba(47,151,242,.65), rgba(255,167,38,.72));
  box-shadow: 0 0 0 1px rgba(255,255,255,.2);
  opacity: .9;
}

.explore-travel-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #ff9f1c;
  border: 2px solid rgba(255,255,255,.92);
  box-shadow: 0 0 0 6px rgba(255,159,28,0), 0 6px 12px rgba(0,0,0,.25);
  animation: travel-dot-pulse 1.6s ease-in-out infinite;
}

.explore-travel-label {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,159,28,.9);
  color: #fff;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.explore-map-legend {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--soft);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  border: 1px solid rgba(0,0,0,.08);
}

.legend-dot.self { background: #2f97f2; }
.legend-dot.player { background: #26c281; }
.legend-dot.poi { background: #f2994a; }
.legend-dot.npc { background: #5f6b7a; }

.travel-tools {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.poi-search-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.poi-search-btn {
  min-width: 72px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.travel-tool-btn {
  border: 1px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.92);
  border-radius: 12px;
  padding: 10px 8px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.travel-tool-btn.active {
  background: linear-gradient(135deg, rgba(255,112,67,.24), rgba(255,183,77,.34));
  border-color: rgba(255,112,67,.78);
  box-shadow: 0 0 0 2px rgba(255,112,67,.24), 0 8px 20px rgba(255,112,67,.2);
  transform: translateY(-1px);
}

.travel-tool-btn:hover {
  transform: translateY(-1px);
}

.travel-tool-btn:active {
  transform: translateY(0);
}

.travel-tool-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}

.travel-tool-meta {
  margin-top: 4px;
  font-size: 10px;
  color: var(--soft);
  line-height: 1.35;
}

.travel-tool-selected-tag {
  margin-top: 6px;
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: #8a2e00;
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(255,112,67,.45);
  border-radius: 999px;
  padding: 2px 8px;
}

.travel-status-card {
  margin-top: 10px;
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,.84);
  border: 1px solid rgba(255,255,255,.88);
}

.travel-status-title {
  font-size: 12px;
  font-weight: 800;
}

.travel-status-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--soft);
}

.travel-progress {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  overflow: hidden;
}

.travel-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .4s ease;
}

.explore-tip {
  margin-top: 6px;
  font-size: 11px;
  color: var(--soft);
}

@keyframes explore-pulse {
  0%, 100% { box-shadow: 0 6px 12px rgba(47,151,242,.28), 0 0 0 0 rgba(47,151,242,.25); }
  50% { box-shadow: 0 8px 16px rgba(47,151,242,.35), 0 0 0 10px rgba(47,151,242,0); }
}

@keyframes travel-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,159,28,.32), 0 6px 12px rgba(0,0,0,.25); }
  50% { box-shadow: 0 0 0 9px rgba(255,159,28,0), 0 8px 14px rgba(0,0,0,.3); }
}

body.theme-night .explore-map-shell,
body.theme-night .travel-status-card,
body.theme-night .travel-tool-btn,
body.theme-night .poi-search-btn {
  background: rgba(26, 38, 63, .88);
  border-color: rgba(147, 177, 225, .28);
}

body.theme-night .explore-map-mode {
  background: rgba(90, 130, 189, .65);
}

body.theme-night .sdk-diag-panel {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .09);
}

body.theme-night .sdk-diag-tip {
  background: rgba(255, 152, 0, .08);
  border-color: rgba(255, 152, 0, .18);
  color: #ffb74d;
}

body.theme-night .explore-map-canvas {
  background:
    linear-gradient(0deg, rgba(78, 129, 113, .30), rgba(78, 129, 113, .30)) 0 0 / 100% 100%,
    repeating-linear-gradient(0deg, rgba(255,255,255,.08) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 1px, transparent 1px 24px),
    linear-gradient(150deg, #1d3b62, #244a70 55%, #29535f);
}

/* ══════════════ SHOP ════════════════════════════════ */
.shop-cat-tabs {
  display:flex; gap:6px; overflow-x:auto; margin-bottom:10px; padding-bottom:2px;
}
.shop-cat-btn {
  flex-shrink:0; border:0; border-radius:12px; padding:7px 12px; background:#eee;
  cursor:pointer; font-size:12px; font-weight:600; white-space:nowrap;
}
.shop-cat-btn.active { background:linear-gradient(120deg,var(--accent),var(--accent2)); color:#fff; }

.food-sub-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 10px;
  padding-bottom: 2px;
}

.food-sub-btn {
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255,255,255,.92);
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.food-sub-btn.active {
  border-color: rgba(255,112,67,.5);
  background: linear-gradient(130deg, rgba(255,112,67,.16), rgba(255,183,77,.24));
  color: #8d3f00;
}

.shop-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.shop-item {
  background:var(--card); border-radius:16px; padding:12px;
  box-shadow:0 2px 8px rgba(0,0,0,.06); text-align:center;
  border:1px solid rgba(255,255,255,.7);
}
.shop-item-icon  { font-size:38px; }
.shop-item-name  { font-weight:700; font-size:13px; margin-top:4px; }
.shop-item-price { color:var(--accent); font-weight:700; font-size:12px; }
.shop-item-effect {
  margin-top: 4px;
  font-size: 11px;
  color: #355070;
  line-height: 1.3;
}
.shop-item-desc {
  margin-top: 4px;
  font-size: 11px;
  color: #5f6f52;
  line-height: 1.3;
}
.shop-item-reason {
  margin-top: 4px;
  padding: 5px 6px;
  border-radius: 8px;
  background: rgba(255, 183, 3, 0.18);
  color: #7a4e00;
  font-size: 10px;
  line-height: 1.35;
}
.shop-item-bag   { color:var(--soft); font-size:11px; margin-bottom:6px; }
.shop-btns { display:flex; gap:6px; }
.shop-btn {
  flex:1; border:0; border-radius:10px; padding:7px 4px;
  font-size:12px; font-weight:600; cursor:pointer; transition:opacity .15s;
}
.shop-btn.buy { background:linear-gradient(120deg,var(--accent),var(--accent2)); color:#fff; }
.shop-btn.use { background:#e8f5e9; color:#2e7d32; }
.shop-btn.wear { background:#e3f2fd; color:#1565c0; }
.shop-btn:disabled { opacity:.4; pointer-events:none; }

/* ══════════════ TASKS ═══════════════════════════════ */
.task-list { display:grid; gap:8px; margin-bottom:12px; }
.task-item {
  background:var(--card); border-radius:14px; padding:12px;
  display:flex; align-items:center; gap:10px;
  box-shadow:0 1px 6px rgba(0,0,0,.05);
}
.task-check {
  width:22px; height:22px; border-radius:50%;
  border:2px solid #ddd;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; flex-shrink:0;
}
.task-check.done { background:var(--ok); border-color:var(--ok); color:#fff; }
.task-name { font-weight:600; font-size:13px; }
.task-desc { color:var(--soft); font-size:12px; }
.big-btn {
  width:100%; border:0; border-radius:14px; padding:14px;
  background:linear-gradient(120deg,var(--accent),var(--accent2));
  color:#fff; font-weight:700; font-size:15px; cursor:pointer;
}

/* ══════════════ ADOPTION GUIDE CARD ═══════════════════════ */
.adoption-guide-card {
  background: linear-gradient(135deg, rgba(255, 183, 77, 0.12), rgba(255, 112, 67, 0.08));
  border: 1.5px solid rgba(255, 183, 77, 0.3);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 8px;
}

.adoption-guide-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.adoption-guide-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.adoption-guide-arrow {
  font-size: 14px;
  color: var(--accent);
  line-height: 1;
}

.adoption-guide-content {
  margin-top: 10px;
}

.adoption-guide-card.is-collapsed .adoption-guide-content {
  display: none;
}

.adoption-guide-unlock {
  text-align: center;
  padding: 10px;
  background: linear-gradient(120deg, #81c784, #66bb6a);
  color: #fff;
  border-radius: 12px;
}

.adoption-guide-unlock-title {
  font-weight: 700;
  font-size: 13px;
}

.adoption-guide-unlock-sub {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.95;
}

.adoption-guide-action-btn {
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #2f6a33;
  border: 0;
  font-weight: 700;
}

.adoption-guide-action-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.priv-panel {
  margin-top: 10px;
  background: rgba(255, 238, 214, 0.75);
  border: 1px dashed rgba(240, 122, 67, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
}

.priv-title {
  font-size: 12px;
  font-weight: 700;
  color: #9a4c1f;
  margin-bottom: 8px;
}

.priv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.priv-actions .text-btn {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.9);
}

.priv-edit-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.priv-level-input {
  width: 130px;
  padding: 6px 10px;
}

body.theme-night .priv-panel {
  background: rgba(26, 38, 63, 0.88);
  border-color: rgba(147, 177, 225, 0.35);
}

body.theme-night .priv-title {
  color: #d9e8ff;
}

body.theme-night .priv-actions .text-btn {
  background: rgba(17, 28, 47, 0.9);
  border-color: rgba(147, 177, 225, 0.3);
  color: var(--ink);
}

body.theme-night .priv-level-input {
  background: rgba(17, 28, 47, 0.9);
  border-color: rgba(147, 177, 225, 0.3);
}

.adoption-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.2s;
}

.adoption-row:last-child {
  margin-bottom: 0;
}

.adoption-row:hover {
  background: rgba(255, 112, 67, 0.05);
}

.adoption-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  min-width: 50px;
}

.adoption-stat {
  font-size: 12px;
  color: var(--soft);
  font-weight: 600;
  text-align: right;
  min-width: 50px;
}

.adoption-bar-fill {
  box-shadow: 0 0 6px rgba(255, 112, 67, 0.3);
}

/* ══════════════ TIER MODAL ════════════════════════ */
.tier-modal-card {
  width: min(92vw, 380px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 241, 0.98));
  border: 1.5px solid rgba(255, 183, 77, 0.45);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  animation: scale-in 0.3s ease;
}

body.theme-night .tier-modal-card {
  background: linear-gradient(145deg, rgba(22, 33, 55, 0.97), rgba(25, 40, 66, 0.97));
  border-color: rgba(147, 177, 225, 0.35);
}

/* ══════════════ CARDS / LISTS ═══════════════════════ */
.card-list { display:grid; gap:8px; margin-top:8px; }
.card-item {
  background:var(--card); border-radius:14px; padding:12px;
  box-shadow:0 1px 6px rgba(0,0,0,.05); cursor:pointer;
  transition:transform .12s, box-shadow .2s;
}
.card-item:hover { transform: translateY(-2px); box-shadow:0 10px 18px rgba(0,0,0,.08); }
.card-item:active { transform:scale(.98); }
.card-item-title { font-weight:600; }
.visited-count-badge { display:inline-block; background:#f2994a; color:#fff; border-radius:999px; font-size:0.7em; padding:1px 7px; margin-left:5px; font-weight:700; vertical-align:middle; }
.card-item-sub   { color:var(--soft); font-size:12px; margin-top:2px; }

.card-item-media {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
}

.card-item-thumb {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: contain;
  padding: 3px;
  border: 2.5px solid rgba(255,255,255,.96);
  box-shadow: 0 8px 16px rgba(0,0,0,.16);
  background: radial-gradient(ellipse at 50% 30%, #fffaf0, #ffecd5);
  flex-shrink: 0;
}

.card-item-thumb-wrap {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.card-item-thumb-wrap .pet-thumb-emoji {
  border-radius: 18px;
  font-size: 40px;
  border: 2.5px solid rgba(255,255,255,.96);
  box-shadow: 0 8px 16px rgba(0,0,0,.16);
  background: radial-gradient(ellipse at 50% 30%, #fffaf0, #ffecd5);
}

.card-item-body {
  min-width: 0;
}

.nearby-player-card {
  cursor: default;
}

.nearby-player-actions {
  margin-top: 8px;
}
.text-btn {
  background:transparent; border:0; color:var(--accent);
  font-weight:600; cursor:pointer; padding:8px 0;
}

.nearby-npc-toggle-btn {
  width: 100%;
  text-align: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(242, 153, 74, 0.08);
}

/* ══════════════ BOTTOM NAV ══════════════════════════ */
.bottom-nav {
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  position:fixed; bottom:0; left:0; right:0;
  background:rgba(255,255,255,.95);
  backdrop-filter:blur(10px);
  border-top:1px solid rgba(0,0,0,.06);
  display:flex; align-items:stretch; z-index:1000;
}

.site-footer {
  position: absolute;
  right: 12px;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 11px;
  color: var(--soft);
  line-height: 1.4;
  z-index: 900;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}
.nav-btn {
  flex:1; border:0; background:transparent; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:2px; color:var(--soft); transition:color .2s;
}
.nav-btn.active { color:var(--accent); }
.nav-icon  { font-size:22px; }
.nav-label { font-size:10px; font-weight:600; }

.explore-map-no-loc-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .52);
  color: #fff;
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}
