:root {
  color-scheme: light;
  --ink: #202823;
  --muted: #65706a;
  --paper: #f7f2e8;
  --paper-deep: #e8ddc9;
  --museum-wall: #eef4ef;
  --teal: #23685f;
  --blue: #466fa8;
  --rose: #c95666;
  --gold: #d8a83d;
  --clay: #d9784f;
  --panel: rgba(255, 252, 244, 0.88);
  --border: rgba(32, 40, 35, 0.16);
  --shadow: 0 22px 60px rgba(50, 41, 30, 0.18);
  --pet-hue: 34;
  --pet-accent: 92;
  --pet-shadow: 342;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(32, 40, 35, 0.035) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(180deg, #fbf7ee 0%, #edf5f1 52%, #f6eadf 100%);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  background: #fffaf0;
  box-shadow: 0 8px 18px rgba(32, 40, 35, 0.08);
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(32, 40, 35, 0.32);
  box-shadow: 0 12px 24px rgba(32, 40, 35, 0.12);
}

button:active {
  transform: translateY(0);
}

button:disabled,
input:disabled {
  cursor: wait;
  opacity: 0.72;
}

input {
  min-width: 0;
  min-height: 46px;
  width: 100%;
  border: 1px solid rgba(32, 40, 35, 0.2);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fffdf8;
  outline: none;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(70, 111, 168, 0.34);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 4rem;
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(360px, 0.92fr);
  grid-template-areas:
    "play controls"
    "gallery gallery";
  gap: 22px 28px;
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  align-items: start;
}

.play-panel {
  grid-area: play;
  position: sticky;
  top: 24px;
  align-self: start;
  min-width: 0;
}

.control-panel {
  grid-area: controls;
  display: grid;
  align-content: start;
  gap: 14px;
  max-height: calc(100vh - 56px);
  min-width: 0;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.control-panel::-webkit-scrollbar {
  width: 10px;
}

.control-panel::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
}

.control-panel::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(126, 81, 220, 0.46);
}

.gallery-panel {
  grid-area: gallery;
  min-width: 0;
  padding-bottom: 8px;
}

.masthead {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pages-link,
.met-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 8px;
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.pages-link {
  padding: 0 10px;
  border: 1px solid var(--border);
  background: rgba(255, 252, 244, 0.7);
  color: var(--muted);
}

.pet-device {
  width: min(100%, 540px);
  margin: 0 auto;
  padding: 22px;
  border: 3px solid #232b26;
  border-radius: 8px 8px 24px 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 248, 231, 0.86)),
    hsl(var(--pet-shadow) 55% 86%);
  box-shadow: var(--shadow), inset 0 -10px 0 rgba(32, 40, 35, 0.08);
}

.device-top {
  display: flex;
  justify-content: center;
  gap: 8px;
  height: 22px;
}

.device-top span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #232b26;
  opacity: 0.78;
}

.lcd-screen {
  overflow: hidden;
  border: 3px solid #232b26;
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.18) 50%, transparent 50%) 0 0 / 100% 8px,
    linear-gradient(145deg, var(--museum-wall), hsl(var(--pet-hue) 54% 87%));
  box-shadow: inset 0 0 0 7px rgba(32, 40, 35, 0.06);
}

.screen-status {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 2px solid rgba(32, 40, 35, 0.14);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.screen-status span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 336px;
  padding: 28px;
}

.wall-glow {
  position: absolute;
  inset: 22px 44px 82px;
  overflow: hidden;
  border: 4px solid rgba(32, 40, 35, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), transparent 46%),
    linear-gradient(180deg, rgba(255, 253, 246, 0.88), hsla(var(--pet-accent), 42%, 82%, 0.82));
  box-shadow:
    inset 0 0 0 10px rgba(255, 253, 246, 0.54),
    0 18px 34px rgba(32, 40, 35, 0.12);
}

.wall-glow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
  filter: saturate(1.08) contrast(0.94) brightness(1.06);
}

.wall-glow::before,
.wall-glow::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.wall-glow::before {
  z-index: 2;
  inset: 10px;
  border: 1px solid rgba(32, 40, 35, 0.14);
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 40%),
    linear-gradient(0deg, rgba(255, 253, 246, 0.22), transparent 45%);
}

.wall-glow::after {
  z-index: 1;
  inset: 0;
  opacity: 0.32;
  mix-blend-mode: screen;
}

.pedestal {
  position: absolute;
  bottom: 46px;
  z-index: 1;
  width: 230px;
  height: 34px;
  border: 2px solid rgba(32, 40, 35, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255, 253, 246, 0.36), transparent 64%),
    rgba(32, 40, 35, 0.12);
}

.met-pet {
  position: relative;
  z-index: 2;
  width: 242px;
  height: 248px;
  animation: pet-bob 1.9s ease-in-out infinite;
}

.pet-tail {
  position: absolute;
  right: 8px;
  bottom: 54px;
  z-index: 1;
  width: 70px;
  height: 58px;
  border: 4px solid #232b26;
  border-radius: 58% 48% 58% 26%;
  background:
    radial-gradient(circle at 68% 34%, rgba(255, 255, 255, 0.28) 0 18%, transparent 19%),
    linear-gradient(145deg, hsl(var(--pet-accent) 70% 77%), hsl(var(--pet-shadow) 70% 74%));
  box-shadow: inset -10px -12px 0 rgba(32, 40, 35, 0.1);
  transform: rotate(23deg);
  transform-origin: 10% 72%;
}

.pet-body {
  position: absolute;
  inset: 56px 28px 22px;
  z-index: 3;
  overflow: hidden;
  border: 4px solid #232b26;
  border-radius: 48% 48% 42% 42% / 42% 42% 58% 58%;
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.32) 0 17%, transparent 18%),
    linear-gradient(145deg, hsla(var(--pet-hue), 74%, 76%, 0.98), hsla(var(--pet-shadow), 72%, 73%, 0.98));
  box-shadow:
    inset -14px -20px 0 rgba(32, 40, 35, 0.12),
    0 10px 0 rgba(32, 40, 35, 0.04);
}

.pet-body::before {
  content: "";
  position: absolute;
  inset: 20px 34px auto auto;
  width: 38px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  pointer-events: none;
}

.pet-belly {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 1;
  width: 88px;
  height: 58px;
  border-radius: 52% 52% 46% 46%;
  background: rgba(255, 253, 246, 0.36);
  box-shadow: inset -8px -9px 0 rgba(255, 255, 255, 0.14);
  transform: translateX(-50%);
}

[data-pattern="brush"] .wall-glow::after {
  background: repeating-linear-gradient(145deg, transparent 0 16px, rgba(255, 255, 255, 0.55) 16px 22px);
}

[data-pattern="halo"] .wall-glow::after {
  background: repeating-radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.66) 0 8px, transparent 8px 19px);
}

[data-pattern="plume"] .wall-glow::after {
  background: linear-gradient(90deg, transparent 0 44%, rgba(255, 255, 255, 0.7) 44% 56%, transparent 56%);
}

[data-pattern="marble"] .wall-glow::after {
  background: repeating-linear-gradient(35deg, rgba(255, 255, 255, 0.58) 0 5px, transparent 5px 17px);
}

[data-pattern="mosaic"] .wall-glow::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.48) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.48) 1px, transparent 1px) 0 0 / 22px 22px;
}

[data-pattern="stitch"] .wall-glow::after {
  background: repeating-linear-gradient(90deg, transparent 0 14px, rgba(255, 255, 255, 0.64) 14px 18px);
}

.pet-ear {
  position: absolute;
  top: 24px;
  z-index: 2;
  width: 72px;
  height: 78px;
  border: 4px solid #232b26;
  border-radius: 56% 56% 18px 56%;
  background:
    radial-gradient(circle at 50% 52%, hsla(var(--pet-shadow), 74%, 82%, 0.86) 0 34%, transparent 35%),
    linear-gradient(145deg, hsl(var(--pet-hue) 74% 76%), hsl(var(--pet-accent) 72% 74%));
  box-shadow: inset -8px -10px 0 rgba(32, 40, 35, 0.1);
}

.pet-ear-left {
  left: 30px;
  transform: rotate(-21deg);
}

.pet-ear-right {
  right: 30px;
  transform: rotate(21deg) scaleX(-1);
}

.pet-tuft {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 4;
  width: 72px;
  height: 54px;
  transform: translateX(-50%);
}

.pet-tuft,
.pet-tuft::before,
.pet-tuft::after,
.pet-tuft span {
  border: 4px solid #232b26;
  background: hsl(var(--pet-accent) 72% 74%);
}

.pet-tuft::before,
.pet-tuft::after,
.pet-tuft span {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 26px;
  height: 38px;
  border-radius: 999px 999px 8px 8px;
}

.pet-tuft {
  border: 0;
}

.pet-tuft::before {
  left: 8px;
  transform: rotate(-22deg);
}

.pet-tuft span {
  left: 23px;
  height: 46px;
}

.pet-tuft::after {
  right: 8px;
  transform: rotate(22deg);
}

.pet-face {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.eye {
  position: absolute;
  top: 50px;
  width: 24px;
  height: 34px;
  border-radius: 999px;
  background: #202823;
  box-shadow:
    inset 5px 5px 0 rgba(255, 255, 255, 0.34),
    0 3px 0 rgba(32, 40, 35, 0.08);
}

.eye::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.52);
}

.eye-left {
  left: 48px;
}

.eye-right {
  right: 48px;
}

.cheek {
  position: absolute;
  top: 91px;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: hsla(var(--pet-shadow), 82%, 72%, 0.5);
  filter: saturate(1.15);
}

.cheek-left {
  left: 34px;
  transform: rotate(7deg);
}

.cheek-right {
  right: 34px;
  transform: rotate(-7deg);
}

.nose {
  position: absolute;
  top: 89px;
  left: 50%;
  width: 13px;
  height: 9px;
  border-radius: 56% 56% 62% 62%;
  background: #202823;
  transform: translateX(-50%);
}

.mouth {
  position: absolute;
  left: 50%;
  top: 102px;
  width: 36px;
  height: 18px;
  transform: translateX(-50%);
}

.mouth::before,
.mouth::after {
  content: "";
  position: absolute;
  top: 0;
  width: 18px;
  height: 15px;
  border-bottom: 4px solid #202823;
  border-radius: 0 0 999px 999px;
}

.mouth::before {
  left: 1px;
  transform: rotate(9deg);
}

.mouth::after {
  right: 1px;
  transform: rotate(-9deg);
}

.pet-paw {
  position: absolute;
  top: 136px;
  z-index: 5;
  width: 46px;
  height: 36px;
  border: 4px solid #232b26;
  border-radius: 52% 52% 42% 42%;
  background: hsl(var(--pet-hue) 74% 77%);
  box-shadow: inset -7px -7px 0 rgba(32, 40, 35, 0.08);
}

.pet-paw::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(32, 40, 35, 0.5);
  box-shadow:
    -10px 1px 0 rgba(32, 40, 35, 0.42),
    10px 1px 0 rgba(32, 40, 35, 0.42);
  transform: translateX(-50%);
}

.pet-paw-left {
  left: 9px;
  transform: rotate(11deg);
}

.pet-paw-right {
  right: 9px;
  transform: rotate(-11deg);
}

.pet-feet {
  position: absolute;
  left: 50%;
  bottom: 8px;
  z-index: 4;
  display: flex;
  gap: 54px;
  transform: translateX(-50%);
}

.pet-feet span {
  width: 50px;
  height: 28px;
  border: 4px solid #232b26;
  border-radius: 999px 999px 18px 18px;
  background: hsl(var(--pet-hue) 70% 75%);
  box-shadow: inset -7px -5px 0 rgba(32, 40, 35, 0.08);
}

[data-mood="radiant"] .met-pet {
  animation-duration: 1.35s;
}

[data-mood="radiant"] .wall-glow {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.66), transparent 48%),
    linear-gradient(180deg, rgba(255, 253, 246, 0.94), hsl(var(--pet-accent) 68% 78%));
}

[data-mood="restless"] .met-pet {
  animation-duration: 1.1s;
}

[data-mood="wilting"] .met-pet {
  animation-duration: 2.5s;
  filter: saturate(0.68);
}

[data-mood="wilting"] .eye {
  height: 8px;
  top: 67px;
  border-radius: 8px;
  box-shadow: none;
}

[data-mood="wilting"] .mouth {
  top: 112px;
  width: 36px;
  height: 15px;
  border-top: 4px solid #202823;
  border-radius: 999px 999px 0 0;
}

[data-mood="wilting"] .mouth::before,
[data-mood="wilting"] .mouth::after {
  display: none;
}

.pet-message {
  min-height: 48px;
  margin: 0;
  padding: 12px 16px 15px;
  border-top: 2px solid rgba(32, 40, 35, 0.12);
  color: #2d3830;
  font-size: 0.95rem;
  font-weight: 800;
}

.strength-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0;
  border-top: 2px solid rgba(32, 40, 35, 0.12);
  color: #1f6b5f;
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
}

[data-evolution="baby"] .met-pet {
  transform-origin: center bottom;
  scale: 0.9;
}

[data-evolution="bright"] .met-pet {
  transform-origin: center bottom;
  scale: 1;
}

[data-evolution="guardian"] .met-pet {
  transform-origin: center bottom;
  scale: 1.07;
}

[data-evolution="guardian"] .wall-glow {
  box-shadow:
    inset 0 0 0 10px rgba(255, 253, 246, 0.6),
    0 0 0 5px rgba(216, 168, 61, 0.2),
    0 20px 42px rgba(32, 40, 35, 0.18);
}

[data-evolution="guardian"] .pet-tail {
  animation: tail-wag 1.35s ease-in-out infinite;
}

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

.device-controls button {
  min-width: 0;
  padding: 0 8px;
  font-size: 0.88rem;
  font-weight: 900;
}

.device-controls button[data-favorite="true"] {
  border-color: rgba(216, 168, 61, 0.78);
  background: #fff0bf;
}

.hatch-card,
.art-card,
.health-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  box-shadow: 0 12px 34px rgba(32, 40, 35, 0.08);
}

.hatch-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hatch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 94px;
  gap: 10px;
}

.hatch-row button {
  background: #1f6b5f;
  color: #fffdf5;
  font-weight: 900;
}

.status-message {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.status-message[data-tone="error"] {
  color: #a53d47;
}

.status-message[data-tone="success"] {
  color: #1f6b5f;
}

.status-message[data-tone="loading"] {
  color: #5f4c15;
}

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

.sample-row button {
  min-width: 0;
  color: #293d37;
  font-size: 0.88rem;
  font-weight: 900;
  background: #fdf6e3;
}

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

.health-card {
  display: grid;
  gap: 14px;
}

.health-score-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.health-ring {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fffdf8 56%, transparent 57%),
    conic-gradient(var(--teal) calc(var(--score) * 1%), rgba(32, 40, 35, 0.12) 0);
  box-shadow: inset 0 0 0 1px rgba(32, 40, 35, 0.08);
}

.health-ring[data-stage="fragile"],
.health-ring[data-stage="tired"] {
  background:
    radial-gradient(circle, #fffdf8 56%, transparent 57%),
    conic-gradient(var(--rose) calc(var(--score) * 1%), rgba(32, 40, 35, 0.12) 0);
}

.health-ring span {
  font-size: 1.45rem;
  font-weight: 950;
}

.health-nudge {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
}

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

.health-mini-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(32, 40, 35, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.76);
}

.health-mini-card h3 {
  margin-bottom: 3px;
  font-size: 0.86rem;
}

.health-mini-card p {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
}

.health-mini-card strong {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 0.88rem;
}

.health-mini-card.watch strong {
  color: var(--rose);
}

.health-bar {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: rgba(32, 40, 35, 0.1);
}

.health-bar i {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

.health-config-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.health-config-head h3 {
  margin-bottom: 0;
  font-size: 0.96rem;
}

.health-config-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.health-picker,
.health-values {
  display: grid;
  gap: 9px;
}

.health-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 106px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(32, 40, 35, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.68);
}

.health-option-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.health-option-main input {
  min-height: 18px;
  width: 18px;
  accent-color: var(--teal);
}

.health-option-main strong,
.health-option-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-option-main strong {
  font-size: 0.88rem;
}

.health-option-main small,
.goal-field small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.goal-field {
  display: grid;
  gap: 4px;
}

.goal-field input {
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.86rem;
}

.health-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  align-items: center;
  min-width: 0;
}

.health-control-row label {
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-control-row output {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.health-control-row input[type="range"] {
  grid-column: 1 / -1;
  min-height: 28px;
  padding: 0;
  accent-color: var(--blue);
}

.candidate-card,
.gallery-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 70px;
  padding: 8px;
  text-align: left;
}

.candidate-card img,
.gallery-card img,
.thumb-placeholder {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(32, 40, 35, 0.16);
  border-radius: 6px;
  object-fit: cover;
  background:
    linear-gradient(135deg, hsl(var(--pet-hue) 55% 78%), hsl(var(--pet-accent) 54% 84%));
}

.thumb-placeholder {
  display: block;
}

.candidate-card strong,
.gallery-card strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-card small,
.gallery-card small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.art-card {
  display: grid;
  gap: 10px;
}

.art-card h2 {
  margin-bottom: 4px;
}

.art-meta,
.pet-lore {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.pet-lore {
  color: #3c4942;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(32, 40, 35, 0.14);
  border-radius: 999px;
  background: #fff8e8;
  color: #4b4f34;
  font-size: 0.78rem;
  font-weight: 850;
}

.meter-list {
  display: grid;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 252, 244, 0.72);
}

.meter {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
  min-height: 28px;
  font-size: 0.86rem;
  font-weight: 900;
}

.meter-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(32, 40, 35, 0.12);
}

.meter-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--clay), var(--gold), var(--teal));
  transition: width 180ms ease;
}

.meter output {
  color: var(--muted);
  text-align: right;
}

.gallery-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.gallery-heading h2,
.gallery-heading .eyebrow {
  margin-bottom: 0;
}

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

.gallery-card[aria-pressed="true"] {
  border-color: rgba(31, 107, 95, 0.72);
  background: #e7f5ed;
}

.empty-gallery {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

@keyframes pet-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-0.5deg);
  }
  50% {
    transform: translateY(-8px) rotate(0.5deg);
  }
}

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

@media (max-width: 920px) {
  h1 {
    font-size: 3.2rem;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "play"
      "controls"
      "gallery";
    min-height: auto;
    align-items: stretch;
  }

  .play-panel {
    position: sticky;
    top: 0;
    z-index: 10;
    padding-top: 10px;
    background:
      linear-gradient(180deg, rgba(255, 247, 229, 0.96), rgba(255, 247, 229, 0.78) 72%, transparent);
  }

  .control-panel {
    align-content: start;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .gallery-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  h1 {
    font-size: 2.35rem;
  }

  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  .masthead {
    display: grid;
  }

  .pet-device {
    padding: 14px;
  }

  .pet-stage {
    min-height: 282px;
    padding: 20px 12px;
  }

  .wall-glow {
    inset: 18px 22px 74px;
  }

  .pedestal {
    bottom: 38px;
    width: 204px;
  }

  .met-pet {
    width: 204px;
    height: 216px;
  }

  .pet-tail {
    right: 2px;
    bottom: 50px;
    width: 60px;
    height: 50px;
  }

  .pet-body {
    inset: 52px 24px 20px;
  }

  .pet-ear {
    top: 22px;
    width: 62px;
    height: 68px;
  }

  .pet-ear-left {
    left: 22px;
  }

  .pet-ear-right {
    right: 22px;
  }

  .pet-tuft {
    top: 5px;
    transform: translateX(-50%) scale(0.88);
  }

  .eye {
    top: 47px;
    width: 22px;
    height: 30px;
  }

  .eye-left {
    left: 39px;
  }

  .eye-right {
    right: 39px;
  }

  .cheek {
    top: 86px;
    width: 30px;
    height: 16px;
  }

  .cheek-left {
    left: 27px;
  }

  .cheek-right {
    right: 27px;
  }

  .nose {
    top: 84px;
  }

  .mouth {
    top: 96px;
  }

  .pet-paw {
    top: 126px;
    width: 42px;
    height: 34px;
  }

  .pet-paw-left {
    left: 4px;
  }

  .pet-paw-right {
    right: 4px;
  }

  .pet-feet {
    gap: 42px;
  }

  .pet-feet span {
    width: 46px;
    height: 26px;
  }

  [data-mood="wilting"] .eye {
    top: 61px;
  }

  [data-mood="wilting"] .mouth {
    top: 106px;
  }

  .device-controls,
  .sample-row,
  .candidate-list,
  .gallery-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hatch-row {
    grid-template-columns: 1fr;
  }

  .meter {
    grid-template-columns: 64px minmax(0, 1fr) 30px;
  }
}
