:root {
  --bg: #08080f;
  --panel: #141423;
  --accent: #ffcf5a;
  --text: #f7f5f2;
  --subtext: #b9b5c7;
  --button: #2e2a48;
  --button-hover: #413a63;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: "Courier New", monospace;
  background:
    radial-gradient(circle at 20% 20%, #131326, transparent 45%),
    radial-gradient(circle at 80% 15%, #10142d, transparent 42%),
    var(--bg);
  color: var(--text);
}

.app {
  width: min(960px, 94vw);
  background: linear-gradient(180deg, #191934, #10101f);
  border: 4px solid #2f2d47;
  box-shadow: 0 0 0 4px #0c0c14, 0 14px 40px rgba(0, 0, 0, 0.55);
  padding: 1.25rem;
}

.hud h1 {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0.12em;
  color: var(--accent);
}

.status-text {
  margin: 0.65rem 0 0.9rem;
  color: var(--subtext);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 0.8rem;
}

.stat {
  background: #222038;
  border: 2px solid #343153;
  padding: 0.55rem 0.65rem;
  display: grid;
  gap: 0.2rem;
}

.label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9e99b4;
}

.playfield.hungry-cursor {
  cursor: url("assets/kibble.png") 12 12, pointer;
}

.playfield {
  position: relative;
  margin-top: 1rem;
  width: 100%;
  height: 55vh;
  min-height: 320px;
  max-height: 520px;
  border: 3px solid #333052;
  background:
    linear-gradient(180deg, #090913 0%, #0d0d1c 100%);
  overflow: hidden;
  cursor: url("assets/hand-cursor.png") 20 20, pointer;
}



.playfield::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 88px;
  background:
    repeating-linear-gradient(
      -45deg,
      #1e2033 0 12px,
      #20233a 12px 24px
    );
  border-top: 3px solid #343053;
  pointer-events: none;
}

.pet {
  position: absolute;
  width: min(250px, 34vw);
  max-width: 250px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  bottom: 58px;
  left: 0;
  user-select: none;
  pointer-events: auto;
  transform-origin: center;
  z-index: 2;
}

.pet.running {
  animation: runBob 0.35s steps(2, end) infinite;
}

.pet.sleeping {
  animation: none;
  filter: brightness(0.94);
}

.kibble-draggable {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 86px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: grab;
  z-index: 3;
  user-select: none;
}

.kibble-draggable.dragging {
  cursor: grabbing;
  opacity: 0.65;
}

.controls {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

button {
  appearance: none;
  border: 2px solid #5a5283;
  background: var(--button);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.62rem 1.1rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: transform 0.08s linear, background-color 0.14s ease;
}

button:hover {
  background: var(--button-hover);
}

button:active {
  transform: translateY(2px);
}

@keyframes runBob {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-4px);
  }
}

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

  .playfield {
    height: 50vh;
  }

  .pet {
    width: min(210px, 56vw);
  }
}
