:root {
  --bg-top: #68a7ff;
  --bg-bottom: #ffd1dd;
  --ink: #2a2340;
  --soft-ink: #5e5879;
  --cream: #fff5ef;
  --panel: #ffe7ef;
  --panel-2: #ffd5e4;
  --panel-3: #fff8fb;
  --line: #584d78;
  --line-soft: #8b81a7;
  --yellow: #ffd85f;
  --orange: #ff9862;
  --blue: #6cb7ff;
  --green: #7fd266;
  --pink: #ff8aba;
  --mint: #9ce7d0;
  --floor: #a4778f;
  --floor-deep: #855a72;
  --shadow: rgba(57, 31, 75, 0.16);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: Verdana, Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at 15% 12%, rgba(255,255,255,0.25) 0 3px, transparent 3px),
    radial-gradient(circle at 82% 22%, rgba(255,255,255,0.17) 0 2px, transparent 2px),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  background-size: 160px 160px, 220px 220px, cover;
}

button { font: inherit; cursor: pointer; }

.app-frame {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 8px;
}

.pet-device {
  width: min(100%, 430px);
  height: min(calc(100svh - 16px), 860px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border-radius: 24px;
  background: linear-gradient(180deg, var(--panel-3), var(--panel));
  border: 3px solid #ffffff;
  box-shadow:
    0 0 0 3px #9f97b7,
    0 18px 45px var(--shadow);
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.brand-block h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1;
}

.mini-label,
.subline {
  margin: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--soft-ink);
  font-weight: 700;
}
.subline {
  margin-top: 4px;
  font-size: 0.65rem;
}

.top-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: end;
}

.tiny-chip {
  padding: 7px 10px;
  min-width: 78px;
  text-align: center;
  border-radius: 999px;
  background: #fff8fc;
  border: 2px solid #ffffff;
  box-shadow: inset 0 -2px 0 #d5bed0, 0 2px 0 #988ea9;
  font-size: 0.72rem;
  font-weight: 700;
  color: #473e65;
}

.button-chip {
  border-radius: 12px;
  background: linear-gradient(180deg, #f4fbff, #d8e7ff);
}

.scene-card {
  min-height: 0;
}

.scene-card-inner {
  position: relative;
  height: 100%;
  min-height: 270px;
  border-radius: 22px;
  overflow: hidden;
  border: 3px solid #ffffff;
  box-shadow: inset 0 -2px 0 #c8a7ba, 0 2px 0 #9d8eaf;
  background: linear-gradient(180deg, #f7dce8 0 62%, var(--floor) 62% 100%);
}

.scene-card-inner.night {
  background: linear-gradient(180deg, #6570b7 0 62%, var(--floor-deep) 62% 100%);
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,0.05) 0 2px, rgba(0,0,0,0.03) 2px 4px);
  mix-blend-mode: soft-light;
  opacity: 0.45;
}

.room-wallpaper {
  position: absolute;
  inset: 0 0 38% 0;
  background:
    radial-gradient(circle at 18px 18px, rgba(255,255,255,0.24) 0 4px, transparent 4px),
    radial-gradient(circle at 58px 52px, rgba(255,255,255,0.18) 0 3px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.06) 0 24px, rgba(255,255,255,0.0) 24px 48px);
  background-size: 120px 120px, 120px 120px, auto;
}

.room-window {
  position: absolute;
  left: 16px;
  top: 16px;
  width: 122px;
  height: 106px;
  border-radius: 18px;
  background: linear-gradient(180deg, #99dfff, #fff0af);
  border: 4px solid #ffffff;
  box-shadow: inset 0 0 0 3px #7393bb;
  overflow: hidden;
}
.scene-card-inner.night .room-window {
  background: linear-gradient(180deg, #203985, #7a87c9);
}
.room-window::before,
.room-window::after {
  content: "";
  position: absolute;
  background: rgba(255,255,255,0.62);
}
.room-window::before { width: 100%; height: 3px; top: 50%; }
.room-window::after { width: 3px; height: 100%; left: 50%; }

.sun-moon {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffe16f;
  box-shadow: 0 0 0 4px rgba(255,225,111,0.18);
}
.scene-card-inner.night .sun-moon {
  background: #f4f7ff;
}
.scene-card-inner.night .sun-moon::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6271ba;
}

.cloud {
  position: absolute;
  width: 42px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  animation: drift 16s linear infinite;
}
.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.cloud::before { width: 16px; height: 16px; left: 5px; top: -6px; }
.cloud::after { width: 20px; height: 20px; right: 5px; top: -10px; }
.cloud-a { left: -46px; top: 42px; }
.cloud-b { left: -92px; top: 64px; transform: scale(0.8); animation-delay: 6s; }
.scene-card-inner.night .cloud { opacity: 0.12; }

.star {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #fff4bf;
  opacity: 0;
}
.scene-card-inner.night .star { opacity: 1; }
.star-a { left: 28px; top: 18px; }
.star-b { left: 84px; top: 32px; }
.star-c { left: 54px; top: 66px; }

@keyframes drift { to { translate: 190px 0; } }

.shelf {
  position: absolute;
  right: 56px;
  top: 20px;
  width: 94px;
  height: 8px;
  border-radius: 999px;
  background: #9d6b7c;
}
.book,
.plant,
.poster,
.floor,
.rug,
.bowl,
.bed,
.toy,
.cat,
.bubble {
  image-rendering: pixelated;
}
.book {
  position: absolute;
  top: 0;
  width: 14px;
  border-radius: 5px 5px 0 0;
}
.book-a {
  right: 124px;
  top: 0;
  height: 22px;
  background: #7bc7ff;
}
.book-b {
  right: 104px;
  top: -3px;
  height: 25px;
  background: #ffd470;
}
.plant {
  position: absolute;
  right: 72px;
  top: -12px;
  width: 18px;
  height: 22px;
  background: #8fdb7f;
  border-radius: 50% 50% 40% 40%;
}
.plant::after {
  content: "";
  position: absolute;
  left: 2px;
  bottom: -8px;
  width: 14px;
  height: 10px;
  background: #c28a5d;
  border-radius: 4px;
}
.poster {
  position: absolute;
  right: 18px;
  top: 26px;
  width: 82px;
  height: 98px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffe890, #ffb777);
  border: 4px solid #ffffff;
  box-shadow: inset 0 0 0 3px #9d7091;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #5b4878;
}

.floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 62%;
  background: linear-gradient(180deg, var(--floor), #8f657d);
}
.rug {
  position: absolute;
  left: 50%;
  bottom: 34px;
  width: 250px;
  height: 46px;
  transform: translateX(-50%);
  border-radius: 22px;
  background: linear-gradient(180deg, #f39bc7, #cf6c96);
  border: 3px solid #ffffff;
  box-shadow: inset 0 0 0 3px #8d5c79;
}
.bowl {
  position: absolute;
  left: 34px;
  bottom: 56px;
  width: 64px;
  height: 24px;
  border-radius: 0 0 16px 16px;
  background: #76b7ff;
  border: 3px solid #ffffff;
  box-shadow: inset 0 0 0 3px #5d7cab;
}
.bowl span {
  position: absolute;
  left: 9px;
  top: -4px;
  width: 40px;
  height: 8px;
  border-radius: 999px;
  background: #7b5536;
}
.bowl.dirty span { background: repeating-linear-gradient(90deg, #7b5536 0 8px, #986b48 8px 12px); }
.bed {
  position: absolute;
  right: 34px;
  bottom: 48px;
  width: 92px;
  height: 42px;
  border-radius: 20px 20px 14px 14px;
  background: linear-gradient(180deg, #ffc2cd, #e58b98);
  border: 3px solid #ffffff;
  box-shadow: inset 0 0 0 3px #91657a;
}
.bed::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  height: 15px;
  border-radius: 999px;
  background: rgba(255,255,255,0.3);
}
.toy {
  position: absolute;
  z-index: 2;
}
.toy-ball {
  left: 106px;
  bottom: 48px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: repeating-linear-gradient(45deg, #ffd85f 0 5px, #ff8a85 5px 10px);
  border: 2px solid #84566a;
}
.toy-star {
  right: 122px;
  bottom: 44px;
  width: 22px;
  height: 22px;
  background: #a6f0d7;
  clip-path: polygon(50% 0%, 61% 34%, 98% 35%, 68% 57%, 79% 91%, 50% 71%, 21% 91%, 32% 57%, 2% 35%, 39% 34%);
  border: 2px solid #5d6a7b;
}

.cat {
  position: absolute;
  left: 50%;
  bottom: 62px;
  width: 170px;
  height: 160px;
  transform: translateX(-50%);
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  z-index: 3;
  transition: left 0.8s ease, bottom 0.6s ease;
  animation: breathe 2.6s ease-in-out infinite;
}
.cat[data-spot="left"] { left: 38%; }
.cat[data-spot="center"] { left: 50%; }
.cat[data-spot="right"] { left: 62%; }
.cat.playing { animation: pounce 0.44s steps(4, end) 4; }
.cat.eating { animation: nibble 0.44s steps(3, end) 4; }
.cat.petting { animation: wiggle 0.5s steps(3, end) 4; }
.cat.sleeping { animation: sleep-breathe 3.4s ease-in-out infinite; bottom: 56px; }
.cat.grooming { animation: groom 0.5s steps(3, end) 4; }
.cat.grumpy .mouth { border-bottom: 0; border-top: 3px solid #22233d; border-radius: 10px 10px 0 0; top: 66px; }
.cat.grumpy .eye { transform: scaleY(0.58); }

@keyframes breathe {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(2px); }
}
@keyframes sleep-breathe {
  0%, 100% { transform: translateX(-50%) translateY(2px); }
  50% { transform: translateX(-50%) translateY(7px); }
}
@keyframes pounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-14px) rotate(-4deg); }
}
@keyframes nibble {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(7px); }
}
@keyframes wiggle {
  0%, 100% { transform: translateX(-50%) rotate(0); }
  50% { transform: translateX(-50%) rotate(3deg); }
}
@keyframes groom {
  0%, 100% { transform: translateX(-50%) rotate(0); }
  50% { transform: translateX(-50%) rotate(-4deg) translateY(2px); }
}

.tail {
  position: absolute;
  right: 6px;
  bottom: 30px;
  width: 60px;
  height: 24px;
  border: 10px solid #fffefc;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 30px;
  box-shadow: inset 0 0 0 2px #9494a2;
  transform: rotate(-20deg);
  animation: tail-swish 2.1s ease-in-out infinite;
}
@keyframes tail-swish {
  0%, 100% { transform: rotate(-20deg); }
  50% { transform: rotate(-7deg); }
}

.body {
  position: absolute;
  left: 34px;
  bottom: 2px;
  width: 104px;
  height: 88px;
  border-radius: 52% 48% 44% 44%;
  background: #fffefc;
  border: 3px solid #9494a2;
  box-shadow: inset -10px -10px 0 rgba(223,223,230,0.95);
}
.belly {
  position: absolute;
  left: 28px;
  top: 24px;
  width: 44px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.76);
}
.paw {
  position: absolute;
  bottom: -10px;
  width: 28px;
  height: 18px;
  border-radius: 999px;
  background: #fffefc;
  border: 3px solid #9494a2;
}
.paw-left { left: 16px; }
.paw-right { right: 14px; }

.head {
  position: absolute;
  left: 34px;
  top: 16px;
  width: 108px;
  height: 82px;
  border-radius: 46% 46% 44% 44%;
  background: #fffefc;
  border: 3px solid #9494a2;
  box-shadow: inset -8px -8px 0 rgba(223,223,230,0.86);
  z-index: 2;
}
.ear {
  position: absolute;
  top: -22px;
  width: 34px;
  height: 36px;
  background: #fffefc;
  border: 3px solid #9494a2;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.ear-left { left: 9px; transform: rotate(-12deg); }
.ear-right { right: 9px; transform: rotate(12deg); }
.ear span {
  position: absolute;
  left: 8px;
  top: 12px;
  width: 16px;
  height: 16px;
  background: #f4bcc7;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.patch {
  position: absolute;
  left: 43px;
  top: -1px;
  width: 30px;
  height: 22px;
  border-radius: 48% 42% 48% 42%;
  background: #9ca1aa;
  transform: rotate(5deg);
}
.eye {
  position: absolute;
  top: 34px;
  width: 16px;
  height: 20px;
  border-radius: 50%;
  background: #22243b;
  box-shadow: inset 0 0 0 5px currentColor;
  animation: blink 6s infinite;
}
.eye::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: white;
}
.eye-blue { left: 28px; color: var(--blue); }
.eye-green { right: 28px; color: var(--green); }
@keyframes blink {
  0%, 46%, 50%, 100% { scale: 1 1; }
  48% { scale: 1 0.08; }
}
.nose {
  position: absolute;
  left: 48px;
  top: 50px;
  width: 10px;
  height: 8px;
  border-radius: 50% 50% 60% 60%;
  background: #f09da6;
}
.mouth {
  position: absolute;
  left: 43px;
  top: 57px;
  width: 20px;
  height: 10px;
  border-bottom: 3px solid #22233d;
  border-radius: 0 0 999px 999px;
}
.whiskers {
  position: absolute;
  top: 50px;
  width: 36px;
  height: 25px;
}
.whiskers i {
  position: absolute;
  width: 34px;
  height: 2px;
  background: #858697;
}
.left-whiskers { left: -28px; }
.right-whiskers { right: -28px; }
.left-whiskers i:nth-child(1) { top: 2px; transform: rotate(10deg); }
.left-whiskers i:nth-child(2) { top: 10px; }
.left-whiskers i:nth-child(3) { top: 18px; transform: rotate(-10deg); }
.right-whiskers i:nth-child(1) { top: 2px; transform: rotate(-10deg); }
.right-whiskers i:nth-child(2) { top: 10px; }
.right-whiskers i:nth-child(3) { top: 18px; transform: rotate(10deg); }

.bubble {
  position: absolute;
  right: -20px;
  top: -4px;
  max-width: 98px;
  padding: 8px 9px;
  border-radius: 12px 12px 12px 4px;
  background: #fff9d6;
  border: 3px solid #ffffff;
  box-shadow: inset 0 0 0 2px #9b8caf;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4e4973;
  text-align: left;
}
.heart-pop {
  position: absolute;
  left: 114px;
  top: 2px;
  opacity: 0;
  color: #ff5e97;
  font-size: 22px;
}
.heart-pop.show { animation: heart-float 1.15s ease-out; }
@keyframes heart-float {
  0% { opacity: 0; transform: translateY(8px) scale(0.4); }
  35% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-22px) scale(0.9); }
}

.scene-hud {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 6px;
  display: flex;
  gap: 8px;
}
.status-pill {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  border: 2px solid #ffffff;
  box-shadow: inset 0 -2px 0 #d7bfcb;
  font-size: 0.72rem;
  font-weight: 700;
  color: #564f76;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.control-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.stat-box,
.message-panel {
  background: rgba(255,255,255,0.78);
  border: 2px solid #ffffff;
  box-shadow: inset 0 -2px 0 #d2becd, 0 2px 0 #9b8fab;
  border-radius: 16px;
}
.stat-box {
  padding: 7px;
}
.stat-box span {
  display: block;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--soft-ink);
  font-weight: 700;
}
.stat-box strong {
  display: block;
  margin: 4px 0 5px;
  font-size: 0.88rem;
}
.meter {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: #d8d6e2;
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  width: 50%;
  border-radius: inherit;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.2) 0 8px, rgba(0,0,0,0) 8px 10px),
    linear-gradient(90deg, var(--yellow), var(--orange));
  transition: width 0.3s ease;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.action-button {
  min-height: 42px;
  border: 2px solid #ffffff;
  box-shadow: inset 0 -2px 0 #b86786, 0 2px 0 #9a89ac;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffdfe9, #ffb9cd);
  color: #4e3659;
  font-weight: 700;
  font-size: 0.84rem;
}
.action-button:nth-child(2) { background: linear-gradient(180deg, #d9f3ff, #9fd8ff); }
.action-button:nth-child(3) { background: linear-gradient(180deg, #fff0c4, #ffd76e); }
.action-button:nth-child(4) { background: linear-gradient(180deg, #defae7, #aee9ca); }
.action-button:active,
.button-chip:active {
  transform: translateY(1px);
}

.message-panel {
  padding: 9px 10px;
}
.message {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.3;
  font-weight: 700;
  color: #544d74;
}
.logline {
  margin-top: 6px;
  font-size: 0.72rem;
  line-height: 1.25;
  color: #736d91;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 390px) {
  .pet-device { width: 100%; padding: 8px; }
  .brand-block h1 { font-size: 1.55rem; }
  .tiny-chip { min-width: 70px; padding: 6px 8px; font-size: 0.68rem; }
  .scene-card-inner { min-height: 248px; }
  .stats-panel { gap: 5px; }
  .stat-box { padding: 6px; }
  .stat-box strong { font-size: 0.8rem; }
  .button-grid { gap: 5px; }
  .action-button { font-size: 0.76rem; min-height: 38px; }
  .room-window { width: 110px; height: 96px; }
  .poster { width: 72px; height: 86px; font-size: 0.72rem; }
  .cat { scale: 0.92; }
}

@media (min-width: 700px) {
  .pet-device { width: 470px; }
}

/* v4.2.3 speech bubble clearance fix */
.bubble {
  top: -30px;
  right: 0;
  z-index: 20;
}
@media (max-height: 720px) {
  .bubble { top: -26px; right: 2px; }
}
@media (max-height: 620px) {
  .bubble { top: -22px; right: 4px; }
}

/* v4.3.0 polish pass: tighter fit, update toast, retro animation states */
:root {
  --bg-top: #8fbf3a;
  --bg-bottom: #234d24;
  --ink: #153015;
  --soft-ink: #2b4f20;
  --panel: #cce65c;
  --panel-2: #b6d94b;
  --panel-3: #e7f77a;
  --line: #173915;
  --line-soft: #4a7025;
  --yellow: #e7f77a;
  --orange: #8fbf3a;
  --blue: #2ea7e0;
  --green: #31944c;
  --pink: #ff8aa5;
  --mint: #c8f06a;
  --floor: #5e8d28;
  --floor-deep: #2f5c23;
  --shadow: rgba(0, 32, 0, 0.26);
}

html,
body {
  min-height: 100%;
  overflow: hidden;
  touch-action: manipulation;
}

body {
  background:
    repeating-linear-gradient(45deg, rgba(21,48,21,0.16) 0 10px, rgba(231,247,122,0.08) 10px 20px),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.app-frame {
  min-height: 100dvh;
  min-height: 100svh;
  padding: max(6px, env(safe-area-inset-top)) 6px max(6px, env(safe-area-inset-bottom));
}

.pet-device {
  position: relative;
  height: calc(100dvh - 12px);
  height: calc(100svh - 12px);
  max-height: 840px;
  border-radius: 18px;
  background: linear-gradient(180deg, #e1f66d, #b2d641);
  border-color: #dfff84;
  box-shadow: 0 0 0 4px #173915, 0 12px 0 rgba(23,57,21,0.18);
}

.brand-block h1 {
  letter-spacing: 0.02em;
  text-shadow: 2px 2px 0 rgba(21,48,21,0.12);
}

.version-line {
  margin: 2px 0 0;
  color: var(--soft-ink);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tiny-chip,
.stat-box,
.message-panel,
.action-button,
.status-pill,
.bubble,
.update-toast,
.update-button {
  border-radius: 5px;
  border-color: #173915;
  box-shadow: inset 0 -3px 0 rgba(23,57,21,0.14), 2px 2px 0 rgba(23,57,21,0.24);
}

.scene-card-inner {
  border-color: #173915;
  border-radius: 7px;
  background:
    repeating-linear-gradient(45deg, rgba(23,57,21,0.05) 0 8px, rgba(23,57,21,0.12) 8px 16px),
    linear-gradient(180deg, #cce65c 0 62%, var(--floor) 62% 100%);
}

.scene-card-inner.night {
  background:
    repeating-linear-gradient(45deg, rgba(7,24,22,0.12) 0 8px, rgba(136,181,58,0.06) 8px 16px),
    linear-gradient(180deg, #507a38 0 62%, var(--floor-deep) 62% 100%);
}

.scanlines {
  background: repeating-linear-gradient(180deg, rgba(255,255,255,0.08) 0 1px, rgba(21,48,21,0.08) 1px 3px);
  opacity: 0.55;
}

.room-window,
.poster,
.bowl,
.bed,
.rug {
  border-color: #173915;
  border-radius: 5px;
  box-shadow: inset 0 0 0 3px rgba(23,57,21,0.18), 3px 3px 0 rgba(23,57,21,0.22);
}

.poster {
  background: #e7f77a;
  transition: transform 0.18s steps(2, end);
}

.scene-card-inner.mischief .poster {
  transform: rotate(-4deg) translateY(2px);
}

.scene-card-inner.sparkle .room-window,
.scene-card-inner.sparkle .bowl {
  animation: lcd-flash 0.42s steps(2, end) 2;
}

@keyframes lcd-flash {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

.pet-fx {
  position: absolute;
  z-index: 5;
  width: 8px;
  height: 8px;
  opacity: 0;
  background: #e7f77a;
  box-shadow: 10px 0 0 #173915, 20px 0 0 #e7f77a;
  pointer-events: none;
}
.fx-a { left: 38%; top: 42%; }
.fx-b { right: 26%; top: 50%; }
.scene-card-inner.sparkle .pet-fx,
.scene-card-inner.mischief .pet-fx {
  animation: pixel-pop 0.7s steps(4, end) 2;
}
.fx-b { animation-delay: 0.08s; }
@keyframes pixel-pop {
  0%, 100% { opacity: 0; transform: translateY(8px) scale(0.6); }
  30%, 70% { opacity: 1; transform: translateY(0) scale(1); }
}

.cat {
  filter: drop-shadow(5px 5px 0 rgba(23,57,21,0.28));
  animation: gb-idle 2.2s steps(2, end) infinite;
}

.cat.playing { animation: pounce 0.42s steps(3, end) 4; }
.cat.eating { animation: nibble 0.38s steps(2, end) 4; }
.cat.petting { animation: wiggle 0.45s steps(2, end) 4; }
.cat.grooming { animation: groom 0.5s steps(3, end) 4; }
.cat.sneaking { animation: sneak-step 0.74s steps(4, end) 2; }
.cat.smug { animation: smug-sit 0.9s steps(3, end) 2; }
.cat.bonk { animation: bonk-pop 0.5s steps(4, end) 3; }
.cat.sleeping { animation: sleep-breathe 3.4s steps(2, end) infinite; }

@keyframes gb-idle {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(2px); }
}

@keyframes sneak-step {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  25% { transform: translateX(calc(-50% - 8px)) translateY(1px); }
  50% { transform: translateX(calc(-50% + 6px)) translateY(0); }
  75% { transform: translateX(calc(-50% + 12px)) translateY(1px); }
}

@keyframes smug-sit {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1); }
  50% { transform: translateX(-50%) translateY(3px) scale(1.03, 0.98); }
}

@keyframes bonk-pop {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(0); }
  35% { transform: translateX(-50%) translateY(-12px) rotate(-7deg); }
  65% { transform: translateX(-50%) translateY(4px) rotate(5deg); }
}

.tail {
  animation: tail-swish 1.6s steps(3, end) infinite;
}

.eye {
  animation: blink 5.8s steps(1, end) infinite;
}

.bubble {
  top: -32px;
  right: -2px;
  min-width: 72px;
  max-width: 112px;
  z-index: 20;
  background: #e7f77a;
  border-color: #173915;
  color: #173915;
}

.cat[data-spot="right"] .bubble {
  right: 68px;
}
.cat[data-spot="left"] .bubble {
  right: -8px;
}
.cat.sleeping .bubble {
  top: -24px;
}

.message,
.logline {
  color: #173915;
}

.message-panel {
  min-height: 48px;
}

.update-toast {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #e7f77a;
  color: #173915;
}

.update-toast[hidden] {
  display: none;
}

.update-toast strong,
.update-toast span {
  display: block;
  font-size: 0.72rem;
  line-height: 1.2;
}
.update-toast span {
  margin-top: 2px;
  opacity: 0.82;
}
.update-button {
  min-height: 34px;
  padding: 6px 10px;
  background: #cce65c;
  color: #173915;
  font-weight: 700;
}

@media (max-height: 740px) {
  .pet-device {
    gap: 6px;
    padding: 8px;
  }
  .scene-card-inner { min-height: 230px; }
  .brand-block h1 { font-size: 1.5rem; }
  .mini-label, .subline, .version-line { font-size: 0.58rem; }
  .tiny-chip { padding: 5px 7px; min-width: 68px; }
  .action-button { min-height: 36px; }
  .message-panel { padding: 7px 8px; min-height: 42px; }
  .message { font-size: 0.76rem; }
  .logline { display: none; }
  .cat { scale: 0.9; bottom: 58px; }
}

@media (max-height: 650px) {
  .scene-card-inner { min-height: 210px; }
  .stats-panel { display: none; }
  .cat { scale: 0.82; bottom: 52px; }
  .button-grid { gap: 5px; }
  .action-button { min-height: 34px; }
}

@media (max-width: 390px) {
  .bubble { top: -30px; right: 2px; }
  .cat[data-spot="right"] .bubble { right: 64px; }
}
