.skin-default { filter: hue-rotate(0deg); }
.skin-red { filter: hue-rotate(320deg) saturate(1.5); }
.skin-blue { filter: hue-rotate(180deg); }
.skin-green { filter: hue-rotate(100deg); }
.skin-pink { filter: hue-rotate(280deg); }

.tamagotchi {
    width: 256px; height: 310px;
    background: #fdd432;
    text-align: center;
    position: relative;
    border-radius: 54% / 65% 65% 47% 47%;
    user-select: none;
    box-shadow: 10px 10px 40px -20px rgba(0, 0, 0, 0.4);
    margin: 0 auto;
}
.tamagotchi__inner {
    width: 256px; height: 310px;
    position: absolute; top: 0; left: 0;
    border-radius: 54% / 65% 65% 47% 47%;
    overflow: hidden;
}
.tamagotchi__shadow {
    position: absolute;
    border-radius: 54% / 65% 65% 47% 47%;
    top: 6%; left: 6%; width: 82%; height: 82%;
    box-shadow: 10px 15px 10px 10px rgba(220, 178, 2, 0.9);
    filter: blur(5px);
}
.tamagotchi__highlight {
    position: absolute;
    width: 25px; height: 75px;
    border-radius: 90% 10% 10% 90%;
    background-color: #fee88b;
    transform: rotate(40deg);
    left: 35px; top: 5px;
}
.loop {
    width: 30px; height: 30px;
    background-color: #fdd432;
    border-radius: 50%;
    position: absolute;
    left: 50%; margin-left: -15px; top: -12px;
}
.loop:before {
    content: ''; position: absolute;
    width: 14px; height: 14px;
    background-color: #dd963b;
    border-radius: 50%;
    left: 50%; top: 50%;
    margin-left: -9px; margin-top: -9px;
    border: 2px solid #fcd120;
    box-shadow: -1px -1px 2px 2px #fde176;
}
.screen {
    position: absolute;
    top: 50%; left: 50%;
    margin-left: -63px; margin-top: -60px;
}
.screen__inner {
    background: #e3e6c9;
    width: 126px; height: 126px;
    border-radius: 13px;
    position: relative; z-index: 1;
    overflow: hidden;
    border-bottom: 2px solid rgba(15, 15, 15, 0.3);
    border-top: 2px solid rgba(15, 15, 15, 0.3);
    box-shadow: 0 1px 1px 1px rgba(253, 253, 253, 0.3);
}
.screen__inner:before, .screen__inner:after {
    content: ''; position: absolute;
    left: 0; width: 100%; height: 26px;
    background-color: rgba(108, 108, 78, 0.3);
}
.screen__inner:before { top: 0; border-radius: 13px 13px 0 0; }
.screen__inner:after { bottom: 0; border-radius: 0 0 13px 13px; }
.crack { position: absolute; background-color: #e84b30; border-radius: 3px; }
.crack:before, .crack:after { content: ''; position: absolute; background-color: #e84b30; border-radius: 3px; }
.crack__line { width: 100px; height: 2px; background-color: #9d7e01; opacity: 0.3; position: absolute; }
.crack--top { width: 70px; height: 50px; top: -13px; left: 20px; transform: rotate(14deg); }
.crack--top:before { width: 50px; height: 50px; left: -24px; bottom: -15px; transform: rotate(-10deg); }
.crack--top:after { width: 60px; height: 60px; right: -40px; top: -9px; transform: rotate(20deg); }
.crack--right { width: 60px; height: 60px; right: -13px; bottom: 30px; transform: rotate(50deg); }
.crack--right:before { width: 40px; height: 50px; top: -25px; left: -16px; transform: rotate(-36deg); }
.crack--right:after { width: 70px; height: 70px; left: 15px; bottom: -35px; transform: rotate(-40deg); }
.crack--right .crack__line { right: -99px; top: 0; transform-origin: left; transform: rotate(-40deg); }
.crack--bottom { width: 50px; height: 50px; bottom: -12px; right: 38px; transform: rotate(50deg); }
.crack--bottom:before { width: 50px; height: 50px; left: 0px; bottom: 1px; transform: rotate(-24deg); transform-origin: bottom right; }
.crack--left { width: 80px; height: 80px; left: -10px; top: 10px; transform: rotate(20deg); }
.crack--left:before { width: 50px; height: 50px; transform-origin: bottom left; bottom: 1px; left: 0; transform: rotate(30deg); }
.crack--left:after { width: 50px; height: 50px; bottom: -47px; left: 20px; transform: rotate(-15deg); }
.crack--left .crack__line { bottom: 0; left: -99px; transform-origin: right; transform: rotate(-30deg); }

.Margo {
    position: absolute; bottom: 30px; left: 23px;
    height: 56px; width: 56px;
    animation: margo-walk 6000ms steps(4) infinite;
}
.Margo:before {
    content: ''; display: block; width: 4px; height: 4px;
    box-shadow: 20px 0 #6c6c4e, 24px 0 #6c6c4e, 28px 0 #6c6c4e, 32px 0 #6c6c4e, 36px 0 #6c6c4e, 16px 4px #6c6c4e, 40px 4px #6c6c4e, 4px 8px #6c6c4e, 8px 8px #6c6c4e, 12px 8px #6c6c4e, 20px 8px #6c6c4e, 36px 8px #6c6c4e, 44px 8px #6c6c4e, 0px 12px #6c6c4e, 48px 12px #6c6c4e, 4px 16px #6c6c4e, 8px 16px #6c6c4e, 12px 16px #6c6c4e, 48px 16px #6c6c4e, 0px 20px #6c6c4e, 48px 20px #6c6c4e, 4px 24px #6c6c4e, 8px 24px #6c6c4e, 12px 24px #6c6c4e, 48px 24px #6c6c4e, 12px 28px #6c6c4e, 32px 28px #6c6c4e, 40px 28px #6c6c4e, 52px 28px #6c6c4e, 12px 32px #6c6c4e, 32px 32px #6c6c4e, 40px 32px #6c6c4e, 52px 32px #6c6c4e, 12px 36px #6c6c4e, 36px 36px #6c6c4e, 52px 36px #6c6c4e, 16px 40px #6c6c4e, 48px 40px #6c6c4e, 20px 44px #6c6c4e, 28px 44px #6c6c4e, 32px 44px #6c6c4e, 36px 44px #6c6c4e, 44px 44px #6c6c4e, 20px 48px #6c6c4e, 28px 48px #6c6c4e, 36px 48px #6c6c4e, 44px 48px #6c6c4e, 24px 52px #6c6c4e, 40px 52px #6c6c4e;
}
.Margo:after {
    content: ''; display: block; width: 4px; height: 4px;
    box-shadow: 20px 0 #6c6c4e, 24px 0 #6c6c4e, 28px 0 #6c6c4e, 32px 0 #6c6c4e, 36px 0 #6c6c4e, 16px 4px #6c6c4e, 40px 4px #6c6c4e, 4px 8px #6c6c4e, 8px 8px #6c6c4e, 12px 8px #6c6c4e, 20px 8px #6c6c4e, 36px 8px #6c6c4e, 44px 8px #6c6c4e, 0px 12px #6c6c4e, 48px 12px #6c6c4e, 4px 16px #6c6c4e, 8px 16px #6c6c4e, 12px 16px #6c6c4e, 48px 16px #6c6c4e, 0px 20px #6c6c4e, 48px 20px #6c6c4e, 4px 24px #6c6c4e, 8px 24px #6c6c4e, 12px 24px #6c6c4e, 48px 24px #6c6c4e, 12px 28px #6c6c4e, 32px 28px #6c6c4e, 40px 28px #6c6c4e, 52px 28px #6c6c4e, 12px 32px #6c6c4e, 32px 32px #6c6c4e, 40px 32px #6c6c4e, 52px 32px #6c6c4e, 12px 36px #6c6c4e, 36px 36px #6c6c4e, 52px 36px #6c6c4e, 16px 40px #6c6c4e, 48px 40px #6c6c4e, 20px 44px #6c6c4e, 28px 44px #6c6c4e, 32px 44px #6c6c4e, 36px 44px #6c6c4e, 44px 44px #6c6c4e, 20px 48px #6c6c4e, 28px 48px #6c6c4e, 36px 48px #6c6c4e, 44px 48px #6c6c4e, 24px 52px #6c6c4e, 40px 52px #6c6c4e;
    opacity: 0.2; transform: translateY(-2px);
}
@keyframes margo-walk {
    0% { transform: translateX(0); }
    50% { transform: translateX(-16px) scale(1, 1); }
    50.0001% { transform: translateX(-16px) scale(-1, 1); }
    99.9999% { transform: translateX(0) scale(-1, 1); }
    100% { transform: translateX(0) scale(1, 1); }
}
.buttons { position: absolute; bottom: 15px; width: 100%; text-align: center; }
.button {
    display: inline-block; position: relative; overflow: hidden; cursor: pointer;
    width: 20px; height: 20px; border-radius: 50%; background-color: #e84b30;
    margin: 8px 10px; border: 2px solid #e53e21; box-shadow: 1px 1px 3px 2px #d2a901;
    transition: background-color 200ms ease, box-shadow 200ms ease;
}
.button:active { background-color: #df391d; box-shadow: 1px 1px 6px 2px #d6ac01; }
.button:before {
    content: ''; position: absolute; width: 100%; height: 100%;
    left: -10px; top: -15px; border-radius: 50%; background-color: #f39b8c;
    box-shadow: 0 0 15px 2px #f8c3ba; opacity: 0.4;
}
.button--b { margin-bottom: 0; }
.speech-bubble {
    position: absolute;
    top: 20px; left: 10px; right: 10px;
    background: white;
    color: #333;
    padding: 8px;
    border-radius: 10px;
    font-size: 12px;
    font-family: 'VT323', sans-serif;
    border: 2px solid #6c6c4e;
    z-index: 10;
    text-align: center;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
}
.chore-score {
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
    min-height: 1.2em;
}
.pet-control-wrapper{
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.btn-pet{
    color: #007bff;
    background-color: rgba(0,123,255, 10%);
    border: 1px solid #007bff;
    cursor: pointer;
    font-weight: bold;
    padding: 12px;
    border-radius: 8px;
    transition: 0.3s;
}
.btn-pet:hover{
    transform: scale(1.1);
}
.tamagotchi__title{
    margin-bottom: 15px;
}
