/* Mascota personalizable (G9): selector de especie/color/accesorio y botón en Inicio. */

/* Botón sobre la mascota de Inicio: toda la mascota es clicable + insignia de lápiz. */
.pet-edit { position: relative; display: inline-block; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--r-lg); color: inherit; line-height: 0; }
.pet-edit:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.pet-edit-badge { position: absolute; right: 2px; bottom: 18%; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface); color: var(--ink); border: var(--bw) solid var(--border); box-shadow: var(--edge); transition: transform .15s; }
.pet-edit:hover .pet-edit-badge { transform: scale(1.1) rotate(-8deg); }
.pet-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

.pet-dialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.pet-dialog h2 { margin: 0 0 8px; }
.pet-preview { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: var(--r-lg); background: var(--surface-2); }
.pet-preview .mascot-svg { flex: none; }
.pet-hint { margin: 8px 0 0; color: var(--ink-2); font-size: .9rem; }
.pet-h { margin: 16px 0 8px; font: 800 .75rem var(--font-display); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.pet-grid { display: grid; gap: 8px; }
.pet-grid-species { grid-template-columns: repeat(4, 1fr); }
.pet-grid-color { grid-template-columns: repeat(6, 1fr); }
.pet-grid-acc { grid-template-columns: repeat(5, 1fr); }
.pet-opt { display: grid; justify-items: center; align-content: start; gap: 2px; min-width: 0; padding: 6px 2px 5px; cursor: pointer;
  border: var(--bw) solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--ink); box-shadow: var(--edge);
  margin-bottom: var(--lip); font-family: inherit; font-weight: 700; font-size: .72rem; transition: transform .1s; }
.pet-opt span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pet-opt .mascot-svg { pointer-events: none; }
.pet-opt:hover { background: var(--surface-2); }
.pet-opt:active { transform: translateY(var(--lip)); box-shadow: none; }
.pet-opt[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); box-shadow: 0 var(--lip) 0 var(--blue); }
.pet-opt:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.pet-swatch { display: block; width: 30px; height: 30px; margin: 4px 0 2px; border-radius: 50%; background: linear-gradient(135deg, var(--sw) 55%, var(--sw2) 55%); box-shadow: inset 0 0 0 2px rgb(0 0 0 / .08); }
.pet-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.pet-actions .btn { min-width: 140px; }

/* Cola que se mueve (perro, gato, zorro, pez). */
.mascot .m-tail { animation: m-tail 1.6s ease-in-out infinite; }
@keyframes m-tail { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(10deg); } }
.mascot .m-bubbles { animation: m-float 2.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .mascot .m-tail, .mascot .m-bubbles { animation: none; } }

@media (max-width: 480px) {
  .pet-dialog { padding: 6px 14px 16px; }
  .pet-preview .mascot-svg { width: 80px; height: 100px; }
  .pet-grid-color { grid-template-columns: repeat(3, 1fr); }
  .pet-opt { font-size: .68rem; }
  .pet-actions .btn { width: 100%; }
  .pet-edit-badge { width: 26px; height: 26px; }
}

/* Estados vacíos con la mascota elegida (pet-picker.js pone --pet-empty). */
:root[data-pet] .empty-state::before { background-image: var(--pet-empty); }

/* Accesorios bloqueados (se ganan con logros). */
.pet-opt { position: relative; }
.pet-opt.is-locked { cursor: help; }
.pet-opt.is-locked .mascot-svg { filter: grayscale(1); opacity: .45; }
.pet-opt.is-locked span { color: var(--ink-2); }
.pet-lock { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-2); }
.pet-lock-msg { min-height: 1.2em; margin: 4px 0 0; color: var(--ink-2); font-size: .85rem; font-weight: 600; }
.pet-lock-msg:empty { display: none; }

/* Onboarding: fila rápida de especies (opcional, 1 clic). */
.pet-quick { display: grid; gap: 6px; margin: 0 0 var(--sp-3, 12px); }
.pet-quick-label { font: 800 .7rem var(--font-display); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.pet-quick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pet-quick-btn { display: grid; place-items: center; width: 48px; height: 52px; padding: 0; cursor: pointer; line-height: 0;
  border: var(--bw) solid var(--border); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--edge); margin-bottom: var(--lip); }
.pet-quick-btn:hover { background: var(--surface-2); }
.pet-quick-btn:active { transform: translateY(var(--lip)); box-shadow: none; }
.pet-quick-btn[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 var(--lip) 0 var(--blue); }
.pet-quick-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.pet-quick-btn .mascot-svg { pointer-events: none; width: 34px; height: 42px; }
@media (max-width: 480px) { .pet-quick-row { gap: 4px; } .pet-quick-btn { width: 40px; height: 48px; } .pet-quick-btn .mascot-svg { width: 30px; height: 38px; } }
