@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&display=swap');

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

:root {
    --bg-app: #70d6ff;
    --card-bg: #ffffff;
    --text-color: #4a4e69;
    --text-dark: #2b2d42;
    
    /* Cores Infantis Vibrantes */
    --primary-pink: #ff70a6;
    --primary-pink-dark: #e8528c;
    --primary-yellow: #ffdd53;
    --primary-yellow-dark: #ebc422;
    --primary-green: #70e000;
    --primary-blue: #3a86ff;
    --accent-orange: #ff9770;

    /* Status Bars */
    --bar-fome: #ff595e;
    --bar-feliz: #ffca3a;
    --bar-energia: #8ac926;
    --bar-higiene: #1982c4;
    --bar-saude: #6a4c93;

    --radius-lg: 32px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.08);
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background: var(--bg-app);
    font-family: 'Fredoka', 'Quicksand', 'Nunito', 'Comic Sans MS', sans-serif;
    color: var(--text-color);
}

body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
    background: linear-gradient(180deg, #90e0ef 0%, #70d6ff 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available;
}
/* Escurecimento gradual quando o pet dorme */
body.pet-dormindo::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(2, 4, 25, 0.84);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    animation: escurecer-tela 4s ease-in-out forwards;
}

@keyframes escurecer-tela {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* App Canvas Wrapper (Exclusivo para Mobile Layout) */
.game, .panel {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    padding: 18px 18px calc(24px + env(safe-area-inset-bottom)) 18px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
    position: relative;
}

@media (min-width: 481px) {
    body {
        padding: 20px 0;
    }
    .game, .panel {
        min-height: calc(100vh - 40px);
        border-radius: var(--radius-lg);
        overflow: hidden;
    }
}

/* Painel de Login e Cadastro */
.panel {
    justify-content: center;
    background: #ffffff;
    border-radius: var(--radius-lg);
}

.panel h1 {
    font-size: 28px;
    color: var(--primary-pink);
    text-align: center;
    margin-top: 0;
    text-shadow: 2px 2px 0px #ffe5ec;
}

.panel p {
    text-align: center;
    font-size: 15px;
    color: #6c757d;
}

/* Topbar / Header */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    margin-bottom: 14px;
}

.topbar small {
    font-size: 11px;
    font-weight: 700;
    color: #a0aab2;
    text-transform: uppercase;
    display: block;
}

.topbar strong {
    font-size: 16px;
    color: var(--text-dark);
}

.topbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Screen / Quarto do Pet */
.screen {
    background: linear-gradient(180deg, #ffffff 0%, #f0f3f6 100%);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    box-shadow: var(--shadow-soft);
    border: 4px solid #ffffff;
    position: relative;
}

.screen-title {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #b1b9c1;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Cenário e alinhamento do Tamagotchi */
.pet-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;

    min-height: 320px;
    padding: 24px 16px;

    /* Mantém o cenário dinâmico definido pelo PHP */
    background-color: #d9f3ff;
    background-image: var(--pet-stage-bg) !important;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;

    position: relative;
    overflow: hidden;
    border-radius: 18px;
}

/* Centraliza o bichinho */
.pet-stage .pet-sprite {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 12px 0;
}

.pet-stage .pet-pixel-art {
    display: block;
    margin: 0 auto;
}

/* Centraliza nome, fase e status */
.pet-stage h1,
.pet-stage .stage-label,
.pet-stage .pet-status {
    text-align: center;
}

.pet-stage h1 {
    width: 100%;
    margin: 8px 0;
}

.pet-stage .stage-label {
    display: inline-block;
    margin: 4px auto;
}

.pet-stage .pet-status {
    max-width: 100%;
    margin: 12px auto 0;
}

.pet-sprite {
    font-size: 85px;
    line-height: 1;
    margin: 10px 0;
    animation: bouncePet 2s ease-in-out infinite;
}



.pet-stage h1 {
    font-size: 26px;
    color: var(--text-dark);
    margin: 4px 0 2px 0;
    font-weight: 700;
}

.stage-label {
    background: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin: 4px 0;
}

.pet-status {
    background: #fff3bf;
    color: #856404;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(255, 224, 138, 0.4);
}

/* Barras de Atributos */
.stats {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.stat-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: #6c757d;
    margin-bottom: 2px;
}

.bar {
    height: 16px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    padding: 2px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
}

.bar-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--primary-pink), var(--accent-orange));
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Cores customizadas por tipo de status */
.stat:nth-child(1) .bar-fill { background: var(--bar-fome); }
.stat:nth-child(2) .bar-fill { background: var(--bar-feliz); }
.stat:nth-child(3) .bar-fill { background: var(--bar-energia); }
.stat:nth-child(4) .bar-fill { background: var(--bar-higiene); }
.stat:nth-child(5) .bar-fill { background: var(--bar-saude); }

/* Carteira / Moedas e XP */
/* Organização limpa da carteira / status */
.wallet {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #ffffff;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-top: 12px;
    box-shadow: var(--shadow-soft);
}

.wallet-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}

.wallet-row.secondary-stats {
    font-size: 11px;
    color: #6c757d;
    border-top: 2px dashed #f1f3f5;
    padding-top: 6px;
}

/* animações */

/* Definição das animações para os diferentes estados do pet */
@keyframes anim-happy {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05, 0.95); }
}

@keyframes anim-hungry {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px) rotate(-3deg); }
    75% { transform: translateX(3px) rotate(3deg); }
}

@keyframes anim-sleeping {
    0%, 100% { transform: scale(1) translateY(0); opacity: 0.85; }
    50% { transform: scale(0.96) translateY(3px); opacity: 0.7; }
}

@keyframes anim-sick {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-4deg); }
    75% { transform: rotate(4deg); }
}

@keyframes anim-egg {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-8deg); }
    40% { transform: rotate(8deg); }
    60% { transform: rotate(-4deg); }
    80% { transform: rotate(4deg); }
}

/* Estilo base e transições da imagem Pixel Art */
.pet-pixel-art {
    width: 120px;
    height: 120px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: inline-block;
    transition: transform 0.2s ease;
}

/* Atribuição automática das animações baseadas nas classes dinâmicas */
.pet-pixel-art.is-happy { animation: anim-happy 1.5s ease-in-out infinite; }
.pet-pixel-art.is-hungry { animation: anim-hungry 0.6s ease-in-out infinite; }
.pet-pixel-art.is-sleeping { animation: anim-sleeping 3s ease-in-out infinite; }
.pet-pixel-art.is-sick { animation: anim-sick 1s ease-in-out infinite; }
.pet-pixel-art.is-egg { animation: anim-egg 1.2s ease-in-out infinite; }
.pet-pixel-art.is-super { animation: anim-happy 0.8s ease-in-out infinite; }
.pet-pixel-art.is-dirty { animation: anim-sick 1.4s ease-in-out infinite; }
.pet-pixel-art.is-dead { animation: none; border-radius: 12px; }
.pet-sprite-missing { font-size: 64px; }

/* Inventário e Mochila */
.inventory {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 14px;
    margin: 14px 0;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: #495057;
}

.inventory h2 {
    width: 100%;
    margin: 0 0 6px 0;
    font-size: 14px;
    color: var(--primary-blue);
}

.inventory span {
    background: #f1f3f5;
    padding: 6px 12px;
    border-radius: 12px;
    font-weight: 600;
}

/* Grid de Ações / Botões Grandes e Infantis */
.actions h2 {
    font-size: 15px;
    color: var(--text-dark);
    margin-bottom: 10px;
    text-align: center;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* Estilo 3D Chubby Button */
button, .shop-link {
    width: 100%;
    min-height: 52px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary-pink);
    color: #ffffff;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 6px 0 var(--primary-pink-dark), 0 8px 15px rgba(0,0,0,0.1);
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
}

button:active, .shop-link:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--primary-pink-dark), 0 3px 6px rgba(0,0,0,0.1);
}

button span {
    font-size: 22px;
    line-height: 1;
    margin-bottom: 2px;
}

button.secondary {
    min-height: 38px;
    padding: 6px 12px;
    background: #e9ecef;
    color: #495057;
    box-shadow: 0 4px 0 #ced4da;
    font-size: 12px;
}

button.secondary:active {
    box-shadow: 0 1px 0 #ced4da;
}

.shop-link {
    text-decoration: none;
    background: var(--primary-yellow);
    color: #5c4800;
    box-shadow: 0 5px 0 var(--primary-yellow-dark);
    min-height: 38px;
    padding: 6px 12px;
}

/* Formulários */
form label {
    display: block;
    margin: 12px 0 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}

input, select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #dee2e6;
    border-radius: var(--radius-sm);
    background: #f8f9fa;
    color: var(--text-dark);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: var(--primary-blue);
    background: #ffffff;
}

/* Avisos e Notificações */
.notice {
    background: #e7f5ff;
    color: #1864ab;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    margin: 12px 0;
    text-align: center;
}

.attention {
    background: var(--primary-yellow);
    color: #5c4800;
    padding: 10px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    margin-top: 10px;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(0.98); }
    100% { transform: scale(1.02); }
}

/* Vitrine da Lojinha */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.shop-item {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.shop-item-icon {
    font-size: 42px;
    text-align: center;
}

.shop-item h2 {
    font-size: 15px;
    color: var(--text-dark);
    text-align: center;
    margin: 6px 0;
}

.shop-item p {
    font-size: 11px;
    color: #6c757d;
    text-align: center;
    margin: 0 0 8px 0;
}

footer {
    margin-top: auto;
    padding-top: 16px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #a0aab2;
    letter-spacing: 1px;
}

@media (max-width: 360px) {
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.pet-pixel-art {
    width: 110px;
    height: 110px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    animation: bouncePet 2s ease-in-out infinite;
}


/* =========================================
   MINIGAMES — TAMAGOTCHI
   ========================================= */

#mg-panel {
    width: 100%;
    box-sizing: border-box;
}

#mg-body {
    width: 100%;
    min-width: 0;
    text-align: center;
    box-sizing: border-box;
}

#mg-body h2 {
    margin: 12px 0;
    font-size: clamp(18px, 4vw, 25px);
    line-height: 1.35;
}

#mg-body p {
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.mg-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 20px auto;
    width: 100%;
}

.mg-menu button,
.mg-nums button,
.mg-pet-options button,
.mg-chest,
.mg-card {
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mg-menu button {
    display: flex;
    min-height: 100px;
    padding: 12px 8px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    border: 2px solid #7c65bc;
    border-radius: 14px;
    background: #29213f;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    overflow-wrap: anywhere;
    transition: transform .15s ease, background .15s ease;
}

.mg-menu button span {
    font-size: 30px;
}

.mg-menu button:active,
.mg-nums button:active,
.mg-pet-options button:active,
.mg-chest:active {
    transform: scale(.94);
}

.mg-menu button:disabled,
.mg-nums button:disabled,
.mg-pet-options button:disabled,
.mg-chest:disabled {
    cursor: not-allowed;
    opacity: .65;
}

.mg-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 22px 0 8px;
}

.mg-row button {
    min-height: 44px;
    padding: 12px 18px;
    border: 0;
    border-radius: 10px;
    background: #a855f7;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.mg-row button.secondary {
    background: #39324e;
    border: 1px solid #8d7eaf;
}

.mg-row.one button {
    width: 100%;
}

.mg-big {
    margin: 18px 0;
    font-size: clamp(48px, 14vw, 76px);
    line-height: 1.2;
    animation: mg-pop .4s ease both;
}

.mg-reward {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0;
}

.mg-reward span {
    padding: 10px 14px;
    border: 1px solid #b68bff;
    border-radius: 12px;
    background: #302044;
    color: #ffe58a;
    font-weight: 900;
}

/* Copos */

.cups {
    position: relative;
    width: 100%;
    height: 145px;
    margin: 24px auto;
    overflow: hidden;
}

.cup {
    position: absolute;
    top: 35px;
    width: 30%;
    height: 95px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: left .3s ease, transform .3s ease;
}

.cup b {
    display: block;
    font-size: 53px;
    position: relative;
    z-index: 2;
}

.cup .ball {
    position: absolute;
    top: 38px;
    left: 50%;
    font-size: 24px;
    transform: translateX(-50%);
}

.cup.lift {
    transform: translateY(-25px);
}

.cup.right {
    filter: drop-shadow(0 0 8px #40ff9a);
}

.cup.wrong {
    filter: drop-shadow(0 0 8px #ff5a72);
}

/* Pedra, papel e tesoura */

.mg-menu.rps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mg-menu.rps button {
    min-width: 0;
    min-height: 105px;
}

.mg-versus {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 6vw, 32px);
    margin: 28px 0;
}

.mg-versus span {
    font-size: clamp(48px, 13vw, 72px);
    animation: mg-pop .35s ease both;
}

.mg-versus em {
    font-size: 18px;
    font-style: normal;
    font-weight: 900;
}

/* Adivinhe o número */

.mg-nums {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 20px auto;
}

.mg-nums button {
    aspect-ratio: 1;
    min-width: 0;
    border: 2px solid #8062bc;
    border-radius: 12px;
    background: #29213f;
    color: #fff;
    font-size: 19px;
    font-weight: 900;
}

.mg-nums button:hover:not(:disabled) {
    background: #8050c9;
}

.mg-hint {
    color: #ffe58a;
    font-weight: 800;
}

/* Jogo da memória */

.mg-memory {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 390px;
    margin: 20px auto;
}

.mg-card {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    min-width: 0;
    padding: 0;
    border: 2px solid #8c6bcb;
    border-radius: 12px;
    background: #35254f;
    color: white;
    overflow: hidden;
    transition: transform .15s ease, background .15s ease;
}

.mg-card-back,
.mg-card-front {
    display: flex;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-size: clamp(21px, 7vw, 36px);
}

.mg-card-front {
    opacity: 0;
    transform: scale(.7);
}

.mg-card.is-open,
.mg-card.is-matched {
    background: #f6e9ff;
    border-color: #d8b5ff;
    color: #261b39;
}

.mg-card.is-open .mg-card-back,
.mg-card.is-matched .mg-card-back {
    display: none;
}

.mg-card.is-open .mg-card-front,
.mg-card.is-matched .mg-card-front {
    opacity: 1;
    transform: scale(1);
}

.mg-card.is-matched {
    background: #c9ffdf;
    border-color: #4ee38a;
}

.mg-card:disabled {
    cursor: default;
}

/* Acerte o pet */

.mg-pet-target {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    margin: 20px auto;
    border: 3px solid #b18bff;
    border-radius: 22px;
    background: #302044;
    font-size: 55px;
    animation: mg-pop .3s ease both;
}

.mg-pet-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 20px auto;
}

.mg-pet-options button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 78px;
    border: 2px solid #8062bc;
    border-radius: 14px;
    background: #29213f;
    color: #fff;
    font-size: clamp(30px, 9vw, 44px);
}

/* Baú da sorte */

.mg-chests {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 25px auto;
}

.mg-chest {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    min-height: 110px;
    padding: 8px 3px;
    border: 2px solid #b18bff;
    border-radius: 14px;
    background: #302044;
    color: white;
}

.mg-chest span {
    font-size: clamp(35px, 10vw, 52px);
}

.mg-chest small {
    font-size: 10px;
    font-weight: 900;
}

.mg-chest.is-opening {
    animation: mg-chest-open .5s ease;
}

/* Animações e telas pequenas */

@keyframes mg-pop {
    from {
        opacity: 0;
        transform: scale(.7);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes mg-chest-open {
    0%, 100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(-8deg) scale(1.05);
    }

    75% {
        transform: rotate(8deg) scale(1.05);
    }
}

@media (max-width: 360px) {
    .mg-menu {
        gap: 7px;
    }

    .mg-menu button {
        padding: 8px 5px;
        font-size: 10px;
    }

    .mg-memory {
        gap: 5px;
    }

    .mg-card {
        border-radius: 8px;
    }

    .mg-row button {
        padding: 11px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mg-big,
    .mg-card,
    .mg-chest,
    .mg-pet-target {
        animation: none !important;
        transition: none !important;
    }
}

/* Cabeçalho Base - Tudo em uma linha */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #1e1938;
    border-bottom: 2px solid #3d325c;
    flex-wrap: nowrap; /* Força tudo a ficar na mesma linha */
    overflow-x: auto; /* Permite deslizar horizontalmente em telas minúsculas caso necessário */
    gap: 8px;
}

.topbar-user {
    white-space: nowrap;
    line-height: 1.2;
}

.topbar-user small {
    display: block;
    font-size: 10px;
    color: #a098c0;
}

.topbar-user strong {
    font-size: 14px;
    color: #ffffff;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 5px; /* Espaço reduzido entre os botões */
}

.shop-link, .btn-logout {
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap; /* Impede a quebra de texto dentro do botão */
    border: none;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.shop-link:active, .btn-logout:active {
    transform: scale(0.95);
}

.btn-colecao { background: #ff4081; color: #fff; }
.btn-amigos  { background: #4cc9f0; color: #fff; }
.btn-lojinha { background: #ffd166; color: #2a2242; }

.logout-form {
    margin: 0;
    display: flex;
}

/* Ajustes Extremos para Celular (telas menores que 480px) */
@media (max-width: 480px) {
    .topbar {
        padding: 6px 8px;
        gap: 6px;
    }

    .hide-mobile {
        display: none; /* Esconde a palavra JOGADOR para ganhar espaço */
    }

    .topbar-user strong {
        font-size: 12px; /* Reduz o nome do usuário */
    }

    .shop-link, .btn-logout {
        padding: 5px 6px;
        font-size: 9px; /* Texto dos botões menor */
        border-radius: 6px;
    }
}

/* Efeito de brilho verde quando a poção de energia está ativa */
.pet-sprite.energia-ativa {
    filter: drop-shadow(0 0 12px #2ec4b6) brightness(1.15);
    animation: pulso-brilho 1.5s infinite alternate;
}

@keyframes pulso-brilho {
    0% {
        filter: drop-shadow(0 0 8px #2ec4b6) brightness(1.1);
    }
    100% {
        filter: drop-shadow(0 0 18px #2ec4b6) brightness(1.25);
    }
}

/* Posicionamento dos cocôs no cenário */
.poop-sprite {
    position: absolute;
    font-size: 35px; /* Se usar imagem, troque para width/height */
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.3));
    animation: drop-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    z-index: 10;
}

/* Espalha os cocôs aleatoriamente pelo chão do cenário */
.poop-pos-1 { left: 15%; bottom: 15%; }
.poop-pos-2 { right: 18%; bottom: 10%; }
.poop-pos-3 { left: 30%; bottom: 8%; }
.poop-pos-4 { right: 35%; bottom: 18%; }

/* Efeito do cocô caindo no chão */
@keyframes drop-in {
    0% { transform: translateY(-50px) scale(0); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Fumaça verde de fedor saindo do cocô */
.stink-fumes {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    color: #8db12e;
    opacity: 0;
    animation: float-fumes 2s infinite ease-in;
}

/* Atrasa a animação de cada fumaça para não ficarem sincronizadas */
.poop-pos-2 .stink-fumes { animation-delay: 0.5s; }
.poop-pos-3 .stink-fumes { animation-delay: 1.2s; }
.poop-pos-4 .stink-fumes { animation-delay: 0.8s; }

@keyframes float-fumes {
    0% { transform: translate(-50%, 0) scale(0.8); opacity: 0; }
    30% { opacity: 0.8; }
    100% { transform: translate(-50%, -30px) scale(1.5); opacity: 0; }
}

/* Opcional: Filtro verde no cenário quando há lotação de sujeira (4 cocôs) */
.stage-infestado::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(141, 177, 46, 0.2);
    pointer-events: none;
    z-index: 5;
}