/* MyDesk — AI 育成コンパニオン（ポヨ） */

.pet-device-card {
  padding: 1rem 1.05rem 1.1rem;
}

.pet-screen-wrap {
  position: relative;
  margin: 0 auto 0.75rem;
  max-width: 300px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #8ec8f0 0%, #c8e8f8 55%, #a8d898 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.pet-screen-wrap.is-sleeping {
  background: linear-gradient(180deg, #1a2840 0%, #2a3858 100%);
}

.pet-evolution-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.pet-evolution-flash.hidden {
  display: none;
}

.pet-screen-wrap.is-sick {
  box-shadow: inset 0 0 0 2px rgba(255, 120, 120, 0.5);
}

#pet-canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.pet-alert {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: #ff5a5a;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pet-alert-pulse 1.2s ease-in-out infinite;
}

.pet-alert.hidden {
  display: none;
}

@keyframes pet-alert-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.pet-ai-line {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: var(--surface-2, rgba(255, 255, 255, 0.06));
  font-size: 0.875rem;
  line-height: 1.45;
  min-height: 2.6rem;
}

.pet-ai-line.is-loading {
  opacity: 0.65;
}

.pet-stats {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.pet-stat {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  align-items: center;
  gap: 0.45rem;
}

.pet-stat-label {
  font-size: 0.72rem;
  color: var(--muted);
}

.pet-bar {
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.pet-bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
}

.pet-bar-fill.hunger {
  background: linear-gradient(90deg, #f0a040, #ffd060);
}

.pet-bar-fill.happy {
  background: linear-gradient(90deg, #f060a0, #ff90c0);
}

.pet-bar-fill.clean {
  background: linear-gradient(90deg, #50c878, #90f0a8);
}

.pet-bar-fill.health {
  background: linear-gradient(90deg, #5080f0, #80b0ff);
}

.pet-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  margin-bottom: 0.85rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.pet-info-row strong {
  color: var(--text);
}

.pet-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.pet-action-btn {
  padding: 0.55rem 0.25rem;
  border: none;
  border-radius: 12px;
  background: var(--surface-2, rgba(255, 255, 255, 0.08));
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.pet-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.pet-action-btn:active {
  transform: scale(0.96);
}

.pet-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pet-action-btn.primary {
  background: var(--accent, #3b9eff);
  color: #fff;
}

.pet-chat-card .card-subtitle {
  margin-bottom: 0.55rem;
}

.pet-chat-log {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.pet-chat-msg {
  max-width: 88%;
  padding: 0.5rem 0.65rem;
  border-radius: 14px;
  font-size: 0.8125rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.pet-chat-msg.user {
  align-self: flex-end;
  background: var(--accent, #3b9eff);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.pet-chat-msg.assistant {
  align-self: flex-start;
  background: var(--surface-2, rgba(255, 255, 255, 0.08));
  border-bottom-left-radius: 4px;
}

.pet-chat-empty {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.pet-chat-form {
  display: flex;
  gap: 0.45rem;
}

.pet-chat-form input {
  flex: 1;
  min-width: 0;
}

.pet-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

.pet-intro-overlay.hidden {
  display: none;
}

.pet-intro-card {
  width: min(100%, 340px);
  padding: 1.25rem;
  border-radius: 20px;
  background: var(--surface, #0f1820);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.pet-intro-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.pet-intro-card p {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.45;
}

.pet-intro-card label {
  display: block;
  margin-bottom: 0.85rem;
  font-size: 0.8125rem;
}

.pet-intro-card input {
  width: 100%;
  margin-top: 0.35rem;
}

.pet-voice-card.is-session {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.pet-voice-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0 0.75rem;
}

.pet-voice-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pet-voice-orb {
  margin: 0.25rem 0;
}

.pet-voice-live {
  margin: 0;
  max-width: 100%;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  min-height: 1.2rem;
}

.pet-voice-fallback {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pet-voice-settings {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
}

.pet-voice-settings-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.55rem;
}

.pet-voice-settings-body label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pet-voice-auto-label {
  flex-direction: row !important;
  align-items: center;
  gap: 0.45rem !important;
}

.pet-memories-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
}

.pet-memories-list li + li {
  margin-top: 0.35rem;
}

@media (max-width: 480px) {
  .pet-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
