/* ===== Mascota virtual: widget ===== */
:root {
    --nc-pet-w: 88px;
    --nc-pet-primary: #d46040;
    --nc-pet-primary-light: #f2a68f;
    --nc-pet-bg: #fff;
    --nc-pet-border: #e6e3df;
    --nc-pet-text: #2a2725;
    --nc-pet-muted: #8a8380;
    --nc-pet-radius: 16px;
}

.nc-pet-widget {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
    line-height: 1.35;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.nc-pet-widget.nc-pet--raised { bottom: 112px; }
@media (max-width: 720px) {
    .nc-pet-widget { right: 10px; bottom: 10px; }
    .nc-pet-widget.nc-pet--raised { bottom: 132px; }
}

/* ---------- Burbuja de diálogo ---------- */
.nc-pet-bubble {
    max-width: 230px;
    background: var(--nc-pet-bg);
    border: 1px solid var(--nc-pet-border);
    border-radius: 14px 14px 4px 14px;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--nc-pet-text);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
    position: relative;
    display: none;
    animation: ncPetPop .25s ease;
}
.nc-pet-widget.nc-pet--bubble-on .nc-pet-bubble { display: block; }

/* ---------- Escena (la mascota) ---------- */
.nc-pet-scene {
    width: var(--nc-pet-w);
    height: var(--nc-pet-w);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    filter: drop-shadow(0 4px 8px rgba(212, 96, 64, .30));
}
.nc-pet-svg { width: 100%; height: 100%; display: block; }

/* Accesorios encima de la mascota */
.nc-pet-acc {
    position: absolute;
    z-index: 3;
    pointer-events: none;
    display: none;
    font-size: 22px;
    line-height: 1;
}
.nc-pet-widget.nc-pet--acc-lazo .nc-pet-acc-lazo,
.nc-pet-widget.nc-pet--acc-sombrero .nc-pet-acc-sombrero,
.nc-pet-widget.nc-pet--acc-monyo .nc-pet-acc-monyo,
.nc-pet-widget.nc-pet--acc-gafas .nc-pet-acc-gafas,
.nc-pet-widget.nc-pet--acc-bufanda .nc-pet-acc-bufanda,
.nc-pet-widget.nc-pet--acc-corona .nc-pet-acc-corona,
.nc-pet-widget.nc-pet--acc-trenzas .nc-pet-acc-trenzas { display: block; }

.nc-pet-acc-lazo { top: -4px; left: 28px; }
.nc-pet-acc-sombrero { top: -16px; left: 24px; font-size: 26px; }
.nc-pet-acc-monyo { top: -14px; left: 52px; }
.nc-pet-acc-monyo::before { content: ''; width: 16px; height: 16px; border-radius: 50%; background: var(--nc-pet-primary); display: block; border: 2px solid #c24f32; }
.nc-pet-acc-gafas { top: 32px; left: 4px; font-size: 24px; }
.nc-pet-acc-bufanda { bottom: 32px; left: 16px; font-size: 18px; }
.nc-pet-acc-corona { top: -14px; left: 24px; font-size: 26px; }
.nc-pet-acc-trenzas::before, .nc-pet-acc-trenzas::after {
    content: ''; position: absolute; top: 10px; width: 8px; height: 26px;
    border-radius: 4px; background: var(--nc-pet-primary);
}
.nc-pet-acc-trenzas::before { left: 56px; }
.nc-pet-acc-trenzas::after { right: 28px; }

/* Fondo del panel según accesorio de fondo */
.nc-pet-panel.nc-pet-bg-fiesta { background: linear-gradient(180deg, #ffe3d6, #fff) !important; }
.nc-pet-panel.nc-pet-bg-estrellas { background: linear-gradient(180deg, #2c2c54, #1a1a2e) !important; color: #fff; }
.nc-pet-bg-estrellas .nc-pet-tab-btn, .nc-pet-bg-estrellas .nc-pet-item-btn,
.nc-pet-bg-estrellas .nc-pet-buy-btn { background: rgba(255, 255, 255, .14); color: #fff; }

/* ---------- Animaciones de la mascota ---------- */
.nc-pet-eyes, .nc-pet-eyes * { transform-box: fill-box; transform-origin: center; }
.nc-pet-widget.nc-pet--blink .nc-pet-eyes { animation: ncPetBlink .18s ease 1; }
.nc-pet-widget.nc-pet--sleep .nc-pet-eyes { animation: none; }
.nc-pet-widget.nc-pet--sleep .nc-pet-eyes { opacity: 0; }
.nc-pet-widget.nc-pet--sleep .nc-pet-closed-eyes { opacity: 1; }
.nc-pet-closed-eyes { opacity: 0; }

.nc-pet-widget.nc-pet--walk .nc-pet-scene { animation: ncPetWalk 1.1s ease-in-out infinite; }
.nc-pet-widget.nc-pet--walk .nc-pet-tail { animation: ncPetTailWag .6s ease-in-out infinite; }

.nc-pet-widget.nc-pet--jump .nc-pet-scene { animation: ncPetJump .5s ease; }
.nc-pet-widget.nc-pet--jump .nc-pet-tail { animation: ncPetTailWag .3s ease infinite; }

.nc-pet-widget.nc-pet--dance .nc-pet-scene { animation: ncPetDance .4s ease-in-out infinite; }
.nc-pet-widget.nc-pet--dance .nc-pet-tail { animation: ncPetTailWag .3s ease infinite; }

.nc-pet-widget.nc-pet--eat .nc-pet-scene { animation: ncPetEat .5s ease-in-out 2; }
.nc-pet-widget.nc-pet--eat .nc-pet-mouth-open { opacity: 1; }
.nc-pet-mouth-open { opacity: 0; }

.nc-pet-widget.nc-pet--celebrate .nc-pet-scene { animation: ncPetJump .4s ease 2; }
.nc-pet-widget.nc-pet--celebrate .nc-pet-confetti { display: block; }

.nc-pet-zzz { position: absolute; top: 4px; right: -6px; font-weight: 700; color: #b9b2ae; opacity: 0; }
.nc-pet-widget.nc-pet--sleep .nc-pet-zzz { display: block; animation: ncPetZzz 1.6s ease infinite; }

.nc-pet-confetti { display: none; position: absolute; inset: -12px; pointer-events: none; }
.nc-pet-confetti i {
    position: absolute; width: 7px; height: 7px; border-radius: 2px; opacity: 0;
    animation: ncPetConfetti 1s ease forwards;
}
.nc-pet-confetti i:nth-child(1) { left: 10%; top: 20%; background: #f6a5b0; animation-delay: 0s; }
.nc-pet-confetti i:nth-child(2) { left: 40%; top: 5%; background: #f2c14e; animation-delay: .08s; }
.nc-pet-confetti i:nth-child(3) { left: 70%; top: 18%; background: #7fd1ae; animation-delay: .16s; }
.nc-pet-confetti i:nth-child(4) { left: 85%; top: 55%; background: #8fb8f2; animation-delay: .24s; }
.nc-pet-confetti i:nth-child(5) { left: 20%; top: 70%; background: #f2a68f; animation-delay: .32s; }

.nc-pet-pupil { transition: transform .18s ease-out; }

@keyframes ncPetBlink { 0% { transform: scaleY(1); } 50% { transform: scaleY(.08); } 100% { transform: scaleY(1); } }
@keyframes ncPetPop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ncPetWalk { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-5px) rotate(1.5deg); } }
@keyframes ncPetTailWag { 0%, 100% { transform: rotate(4deg); } 50% { transform: rotate(-10deg); } }
@keyframes ncPetJump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-22px) scale(.98, 1.05); } 60% { transform: translateY(0) scale(1.04, .96); } }
@keyframes ncPetDance { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes ncPetEat { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-4px) rotate(-6deg); } 75% { transform: translateY(-4px) rotate(6deg); } }
@keyframes ncPetZzz { 0% { opacity: 0; transform: translateY(0) scale(.7); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-16px) scale(1.3); } }
@keyframes ncPetConfetti { 0% { opacity: 0; transform: translateY(0) rotate(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(46px) rotate(240deg); } }

/* ---------- Cabecera compacta (mini panel) ---------- */
.nc-pet-mini-panel {
    background: var(--nc-pet-bg);
    border: 1px solid var(--nc-pet-border);
    border-radius: var(--nc-pet-radius);
    padding: 6px 10px;
    display: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
    min-width: 140px;
    text-align: center;
}
.nc-pet-widget.nc-pet--panel .nc-pet-mini-panel { display: block; }
.nc-pet-name { font-weight: 700; font-size: .8rem; color: var(--nc-pet-text); }
.nc-pet-sub { font-size: .66rem; color: var(--nc-pet-muted); }
.nc-pet-xpbar { height: 6px; background: #efe9e5; border-radius: 3px; margin-top: 4px; overflow: hidden; }
.nc-pet-xpbar i { display: block; height: 100%; background: var(--nc-pet-primary); border-radius: 3px; transition: width .5s ease; }

/* ---------- Panel expandido ---------- */
.nc-pet-panel {
    position: absolute;
    bottom: calc(var(--nc-pet-w) + 84px);
    right: 0;
    width: 320px;
    max-width: calc(100vw - 24px);
    max-height: 60vh;
    background: var(--nc-pet-bg);
    border: 1px solid var(--nc-pet-border);
    border-radius: var(--nc-pet-radius);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-size: .8rem;
    color: var(--nc-pet-text);
}
.nc-pet-widget.nc-pet--expanded .nc-pet-panel { display: flex; }

.nc-pet-panel-head {
    padding: 12px 14px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--nc-pet-border);
}
.nc-pet-panel-head .nc-pet-avatar { width: 44px; height: 44px; flex: 0 0 44px; }
.nc-pet-panel-head h4 { margin: 0; font-size: .95rem; }
.nc-pet-panel-head .nc-pet-meta { flex: 1; min-width: 0; }
.nc-pet-badges { display: flex; gap: 4px; margin-top: 2px; }
.nc-pet-badge {
    font-size: .58rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    padding: 2px 6px; border-radius: 20px; background: #f3ece8; color: #9c6450;
}
.nc-pet-badge.nc-pet-badge-demo { background: #f2e3c0; color: #a06a12; }

.nc-pet-page-link {
    display: inline-block; margin-top: 4px; font-size: .62rem; font-weight: 600;
    color: var(--nc-pet-primary); text-decoration: none; opacity: .85;
    transition: opacity .15s ease;
}
.nc-pet-page-link:hover { opacity: 1; text-decoration: underline; }

.nc-pet-tabs { display: flex; border-bottom: 1px solid var(--nc-pet-border); background: #fbf9f7; }
.nc-pet-tab-btn {
    flex: 1; border: 0; background: transparent; padding: 9px 4px;
    font-family: inherit; font-size: .72rem; font-weight: 600; cursor: pointer;
    color: var(--nc-pet-muted); border-bottom: 2px solid transparent;
}
.nc-pet-tab-btn.nc-pet-tab-active { color: var(--nc-pet-primary); border-bottom-color: var(--nc-pet-primary); }

.nc-pet-tab-body { overflow-y: auto; padding: 12px 14px; min-height: 180px; max-height: 36vh; }

.nc-pet-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.nc-pet-stat { display: flex; flex-direction: column; gap: 2px; }
.nc-pet-stat-label { font-size: .64rem; color: var(--nc-pet-muted); text-transform: uppercase; letter-spacing: .03em; }
.nc-pet-stat-bar { height: 8px; background: #efe9e5; border-radius: 4px; overflow: hidden; }
.nc-pet-stat-bar i { display: block; height: 100%; border-radius: 4px; transition: width .5s ease; }
.nc-pet-stat-bar.nc-pet-bar-good i { background: linear-gradient(90deg, #f2a68f, #d46040); }
.nc-pet-stat-bar.nc-pet-bar-warn i { background: #f2c14e; }
.nc-pet-stat-bar.nc-pet-bar-bad i { background: #e06a6a; }
.nc-pet-stat-num { font-size: .68rem; color: var(--nc-pet-text); }
.nc-pet-counts { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: .68rem; color: var(--nc-pet-muted); }
.nc-pet-counts b { color: var(--nc-pet-text); font-weight: 600; }

.nc-pet-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }
.nc-pet-act-btn {
    width: 48px; height: 48px; border: 1px solid var(--nc-pet-border);
    background: #fff; border-radius: 12px; cursor: pointer;
    font-family: inherit; font-size: .68rem; font-weight: 600; color: var(--nc-pet-text);
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform .12s ease, background .12s ease;
}
.nc-pet-act-btn:hover { background: #fbf2ec; }
.nc-pet-act-btn:active { transform: scale(.95); }
.nc-pet-act-btn:disabled { opacity: .45; cursor: not-allowed; }
.nc-pet-act-btn .nc-pet-act-icon { font-size: 1.2rem; }

.nc-pet-mission { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f3eeea; }
.nc-pet-mission:last-child { border-bottom: 0; }
.nc-pet-mission .nc-pet-micon { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: #fbe9e1; display: flex; align-items: center; justify-content: center; font-size: .95rem; }
.nc-pet-mission.nc-pet-mission-done .nc-pet-micon { background: #e5f4ea; }
.nc-pet-mission .nc-pet-mtext { flex: 1; min-width: 0; }
.nc-pet-mission .nc-pet-mtitle { font-weight: 600; font-size: .72rem; }
.nc-pet-mission.nc-pet-mission-done .nc-pet-mtitle { text-decoration: line-through; color: var(--nc-pet-muted); }
.nc-pet-mission .nc-pet-mprogress { font-size: .64rem; color: var(--nc-pet-muted); }
.nc-pet-mission .nc-pet-meta { font-size: .62rem; color: var(--nc-pet-primary); }

.nc-pet-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f3eeea; }
.nc-pet-item:last-child { border-bottom: 0; }
.nc-pet-item-icon { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; background: #fbf9f7; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.nc-pet-item-info { flex: 1; min-width: 0; }
.nc-pet-item-name { font-weight: 600; font-size: .72rem; }
.nc-pet-item-desc { font-size: .62rem; color: var(--nc-pet-muted); }
.nc-pet-item-price { font-size: .66rem; font-weight: 700; color: #b8860b; }
.nc-pet-item-btn {
    border: 1px solid var(--nc-pet-border); background: #fff; border-radius: 8px;
    padding: 5px 10px; font-family: inherit; font-size: .64rem; font-weight: 600; cursor: pointer; color: var(--nc-pet-text);
}
.nc-pet-item-btn:hover { background: #fbf2ec; }
.nc-pet-item-btn.nc-pet-btn-own { color: #fff; background: var(--nc-pet-primary); border-color: var(--nc-pet-primary); }
.nc-pet-item-btn.nc-pet-btn-equipped { background: #e5f4ea; color: #2d7d4a; border-color: #bfe3cd; cursor: default; }

.nc-pet-logro { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f3eeea; }
.nc-pet-logro:last-child { border-bottom: 0; }
.nc-pet-logro .nc-pet-licon { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; background: #f3f0ed; display: flex; align-items: center; justify-content: center; font-size: .85rem; filter: grayscale(1); opacity: .55; }
.nc-pet-logro.nc-pet-logro-done .nc-pet-licon { filter: none; opacity: 1; background: #fdf1d8; }
.nc-pet-logro .nc-pet-ltext { flex: 1; min-width: 0; }
.nc-pet-logro .nc-pet-ltitle { font-weight: 600; font-size: .7rem; }
.nc-pet-logro.nc-pet-logro-done .nc-pet-ltitle { color: var(--nc-pet-text); }
.nc-pet-logro .nc-pet-ldesc { font-size: .6rem; color: var(--nc-pet-muted); }
.nc-pet-logro.nc-pet-logro-locked .nc-pet-ltitle { color: var(--nc-pet-muted); }

.nc-pet-demo-cta {
    margin-top: 10px; padding: 10px 12px; border-radius: 12px;
    background: linear-gradient(90deg, #fdf1e8, #fbe4da); border: 1px solid #f3cfc0;
    text-align: center;
}
.nc-pet-demo-cta p { margin: 0 0 8px; font-size: .68rem; color: #7a4a38; }
.nc-pet-demo-cta .nc-pet-btn { height: 42px; }

.nc-pet-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 48px; padding: 0 16px; border: 0; border-radius: 12px; cursor: pointer;
    font-family: inherit; font-weight: 700; font-size: .78rem;
    background: var(--nc-pet-primary); color: #fff; text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease;
}
.nc-pet-btn:hover { box-shadow: 0 6px 16px rgba(212, 96, 64, .35); }
.nc-pet-btn:active { transform: scale(.97); }
.nc-pet-btn-ghost { background: #fff; color: var(--nc-pet-primary); border: 1px solid var(--nc-pet-primary); }

.nc-pet-name-form { padding: 10px 0; text-align: center; }
.nc-pet-name-form input {
    width: 100%; height: 48px; padding: 0 12px; border: 1px solid var(--nc-pet-border);
    border-radius: 12px; font-family: inherit; font-size: .8rem; margin-bottom: 8px; box-sizing: border-box;
}
.nc-pet-name-form .nc-pet-btn { width: 100%; }

/* ---------- Toasts ---------- */
.nc-pet-toast-wrap {
    position: fixed; right: 16px; bottom: 118px; z-index: 90;
    display: flex; flex-direction: column; gap: 6px; pointer-events: none;
}
.nc-pet-toast {
    background: #2a2725; color: #fff; border-radius: 10px; padding: 8px 12px;
    font-size: .72rem; font-weight: 600; box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
    animation: ncPetToastIn .25s ease, ncPetToastOut .3s ease 2.3s forwards;
}
.nc-pet-toast.nc-pet-toast-good { background: #2d7d4a; }
@keyframes ncPetToastIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes ncPetToastOut { to { transform: translateY(8px); opacity: 0; } }

/* ---------- Botón expandir ---------- */
.nc-pet-expand {
    position: absolute; bottom: 0; right: 0; width: 26px; height: 26px; border-radius: 50%;
    border: 1px solid var(--nc-pet-border); background: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: var(--nc-pet-muted); box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
    z-index: 4;
}
.nc-pet-widget.nc-pet--expanded .nc-pet-expand { transform: rotate(180deg); }

.nc-pet-hide { display: none !important; }
@media (prefers-reduced-motion: reduce) {
    .nc-pet-widget *, .nc-pet-widget *::before, .nc-pet-widget *::after { animation: none !important; transition: none !important; }
}

/* ---------- Bloque de adopción en el registro ---------- */
.auth-pet-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(90deg, #fdf1e8, #fbe4da);
    border: 1px solid #f3cfc0;
}
.auth-pet-scene { width: 58px; height: 58px; flex: 0 0 58px; filter: drop-shadow(0 4px 6px rgba(212, 96, 64, .3)); }
.auth-pet-scene svg { width: 100%; height: 100%; display: block; }
.auth-pet-msg { margin: 0; font-size: .78rem; line-height: 1.4; color: #7a4a38; font-family: 'Poppins', sans-serif; }
