* {
  box-sizing: border-box;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at center, #2e2f42 0%, #15151c 100%);
  touch-action: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#pet-container {
  position: absolute;
  touch-action: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 50;
  cursor: grab;
}

#pet-container:active {
  cursor: grabbing;
}

#pet-canvas {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.speech-bubble {
  position: relative;
  background: #ffffff;
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #222;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  border: 2px solid #ff9800;
  margin-bottom: 8px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  pointer-events: none;
}

.speech-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px 6px 0;
  border-style: solid;
  border-color: #ff9800 transparent;
  display: block;
}

#control-panel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(15px + env(safe-area-inset-bottom, 0px));
  width: min(92vw, 440px);
  background: rgba(30, 30, 40, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.input-row {
  display: flex;
  gap: 6px;
}

#chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 8px 14px;
  border-radius: 16px;
  font-size: 14px;
  outline: none;
}

#chat-input:focus {
  border-color: #ff9800;
}

.quick-actions {
  display: flex;
  gap: 6px;
}

.action-btn {
  background: #ff9800;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s, background 0.15s;
}

.action-btn:active {
  transform: scale(0.95);
  background: #e65100;
}

.quick-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}
