:root {
  --bg: #000000;
  --surface: #101116;
  --surface-2: #191c22;
  --surface-3: #242832;
  --text: #ffffff;
  --muted: #c4c8d1;
  --dim: #8f96a3;
  --accent: #00d4ff;
  --accent-2: #24f28c;
  --danger: #ff5470;
  --focus: rgba(0, 212, 255, 0.55);
  --sprite-w: 192px;
  --sprite-h: 208px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 600px;
  height: 600px;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

#app {
  position: relative;
  width: 600px;
  height: 600px;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}

.hidden {
  display: none;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--surface);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.status {
  min-width: 96px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.status.ok {
  color: var(--accent-2);
}

.status.error {
  color: var(--danger);
}

.pet-stage {
  height: 232px;
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: center;
  overflow: hidden;
}

.pet-sprite {
  width: var(--sprite-w);
  height: var(--sprite-h);
  margin-left: 36px;
  background-image: url("assets/carrot/spritesheet.webp");
  background-repeat: no-repeat;
  background-size: 1536px 1872px;
  background-position: 0 0;
  image-rendering: auto;
  transform: scale(1.08);
  transform-origin: center;
  animation: pet-idle 1.15s steps(8) infinite;
  will-change: background-position;
}

@keyframes pet-idle {
  from {
    background-position-x: 0;
  }
  to {
    background-position-x: -1536px;
  }
}

.pet-copy {
  min-width: 0;
  padding-right: 18px;
}

.pet-copy p {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

#pet-description {
  color: var(--text);
}

#last-command {
  margin-top: 12px;
  color: var(--muted);
}

.command-panel {
  flex: 1;
  min-height: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title span {
  font-size: 20px;
  font-weight: 900;
}

.section-title small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.preset-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.preset-button,
.action-button {
  min-height: 62px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  opacity: 0.86;
  transition:
    transform 475ms cubic-bezier(0.6, 0, 0.4, 1),
    opacity 300ms cubic-bezier(0.4, 0.04, 0.5, 1),
    background 300ms cubic-bezier(0.4, 0.04, 0.5, 1);
}

.preset-button strong {
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: 0;
  text-align: left;
}

.preset-button span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.focusable {
  cursor: pointer;
}

.focusable:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--focus);
  opacity: 1;
  transform: scale(0.94);
}

.preset-button:active,
.action-button:active {
  transform: scale(0.9);
}

.sent-card {
  flex: 1;
  margin: 84px 30px;
  padding: 34px;
  border-radius: 8px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
}

.sent-mark {
  width: 74px;
  height: 74px;
  margin: 0;
  border-radius: 50%;
  background: var(--accent-2);
  color: #04130a;
  display: grid;
  place-items: center;
  font-size: 48px;
  font-weight: 900;
}

#sent-summary {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
}

.action-button.primary {
  width: 100%;
  justify-content: center;
  background: var(--accent);
  color: #061015;
  font-size: 22px;
  font-weight: 900;
}

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  max-width: 536px;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  border: 2px solid var(--accent);
  font-size: 16px;
  font-weight: 800;
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .pet-sprite {
    animation: none;
  }

  .preset-button,
  .action-button,
  .toast {
    transition: none;
  }
}
