/* ═══════════════════════════════════════
   ОСНОВА
═══════════════════════════════════════ */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {

    min-height: 100vh;

    overflow-x: hidden;

    font-family:
        "Trebuchet MS",
        Arial,
        sans-serif;

    color: white;

    background:

        radial-gradient(
            circle at 15% 10%,
            rgba(255, 76, 194, .30),
            transparent 28%
        ),

        radial-gradient(
            circle at 90% 30%,
            rgba(73, 155, 255, .28),
            transparent 30%
        ),

        radial-gradient(
            circle at 45% 90%,
            rgba(153, 75, 255, .30),
            transparent 35%
        ),

        linear-gradient(
            160deg,
            #10081f,
            #21103f 40%,
            #171a48 70%,
            #0b1831
        );
}


/* ═══════════════════════════════════════
   ЗВЁЗДЫ НА ФОНЕ
═══════════════════════════════════════ */

.background-stars {

    position: fixed;

    inset: 0;

    z-index: 0;

    pointer-events: none;

    opacity: .65;

    background-image:

        radial-gradient(
            circle,
            rgba(255,255,255,.9) 1px,
            transparent 1.5px
        ),

        radial-gradient(
            circle,
            rgba(255,170,235,.8) 1px,
            transparent 1.5px
        ),

        radial-gradient(
            circle,
            rgba(150,210,255,.8) 1px,
            transparent 1.5px
        );

    background-size:

        43px 43px,
        67px 67px,
        89px 89px;

    background-position:

        0 0,
        15px 25px,
        35px 10px;

    animation:

        starsMove
        20s
        linear
        infinite;
}


@keyframes starsMove {

    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-43px);
    }
}


/* ═══════════════════════════════════════
   ИГРА
═══════════════════════════════════════ */

#game {

    position: relative;

    z-index: 2;

    width: 100%;

    max-width: 430px;

    min-height: 100vh;

    margin: auto;

    padding:
        24px
        17px
        35px;

    display: flex;

    flex-direction: column;

    align-items: center;
}


/* ═══════════════════════════════════════
   ЗАГОЛОВОК
═══════════════════════════════════════ */

.title-area {

    text-align: center;

    margin-bottom: 22px;
}


.title-decoration {

    margin-bottom: 3px;

    font-size: 11px;

    letter-spacing: 5px;

    color: #f4b8ff;

    text-shadow:
        0 0 6px white,
        0 0 12px #cf7cff;

    animation:
        twinkle
        2.5s
        ease-in-out
        infinite alternate;
}


h1 {

    margin: 0;

    font-size: 29px;

    letter-spacing: 4px;

    color: #fffaff;

    text-shadow:
        0 0 5px white,
        0 0 13px #ff79d5,
        0 0 25px #a875ff,
        0 0 38px #65bfff;
}


@keyframes twinkle {

    from {

        opacity: .45;

        transform: scale(.97);
    }

    to {

        opacity: 1;

        transform: scale(1.03);
    }
}


/* ═══════════════════════════════════════
   РАМКА КОТИКА
═══════════════════════════════════════ */

.cat-frame {

    position: relative;

    width: calc(100% - 10px);

    padding: 8px;

    border-radius: 42px;

    background:

        linear-gradient(
            135deg,
            #ff89d8,
            #c17cff,
            #72c9ff,
            #f38bdd
        );

    box-shadow:

        0 0 0 2px
        rgba(255,255,255,.8),

        0 0 0 5px
        rgba(191,116,255,.22),

        0 0 20px
        rgba(255,91,207,.48),

        0 0 38px
        rgba(118,111,255,.35),

        0 15px 35px
        rgba(0,0,25,.5);
}


.cat-frame::before {

    content: "";

    position: absolute;

    inset: 4px;

    border:
        1px solid
        rgba(255,255,255,.75);

    border-radius: 38px;

    pointer-events: none;
}


.cat-frame::after {

    content:
        "✦　　　　　　　　　✦";

    position: absolute;

    top: -12px;

    left: 14px;

    right: 14px;

    text-align: center;

    font-size: 17px;

    color: white;

    text-shadow:
        0 0 6px white,
        0 0 12px #ff88dc,
        0 0 18px #8fcfff;

    pointer-events: none;

    animation:
        twinkle
        1.8s
        ease-in-out
        infinite alternate;
}


/* ═══════════════════════════════════════
   ЗВЁЗДЫ В РАМКЕ
═══════════════════════════════════════ */

.frame-stars {

    position: absolute;

    z-index: 10;

    left: 0;

    right: 0;

    text-align: center;

    pointer-events: none;

    font-size: 12px;

    letter-spacing: 6px;

    text-shadow:
        0 0 5px white,
        0 0 10px currentColor;
}


.frame-stars.top {

    top: 15px;

    color: #cf93ff;
}


.frame-stars.bottom {

    bottom: 15px;

    color: #86cfff;
}


/* ═══════════════════════════════════════
   БЕЛОЕ ОКНО
═══════════════════════════════════════ */

#cat {

    position: relative;

    width: 100%;

    height: 375px;

    display: flex;

    justify-content: center;

    align-items: center;

    overflow: hidden;

    border-radius: 34px;

    background: white;

    box-shadow:

        inset
        0 0 0 2px
        white,

        inset
        0 0 20px
        rgba(189,141,255,.10);
}


/* ═══════════════════════════════════════
   КОТИК
═══════════════════════════════════════ */

#cat-image {

    position: relative;

    z-index: 3;

    width: 300px;

    height: 300px;

    object-fit: contain;

    transform:
        translateZ(0);

    will-change:
        transform;
}


#cat-image.pop {

    animation:
        catPop
        .35s
        ease-out;
}


@keyframes catPop {

    0% {
        transform: scale(.96);
    }

    55% {
        transform: scale(1.035);
    }

    100% {
        transform: scale(1);
    }
}


/* ═══════════════════════════════════════
   СООБЩЕНИЕ
═══════════════════════════════════════ */

#message {

    position: relative;

    z-index: 20;

    min-width: 165px;

    max-width: 85%;

    margin:
        -22px
        0
        27px;

    padding:
        12px
        24px;

    border-radius: 24px;

    border:
        1px solid
        rgba(255,218,250,.75);

    background:

        linear-gradient(
            135deg,
            #32174f,
            #3c246e,
            #273d78
        );

    color: white;

    text-align: center;

    font-size: 14px;

    font-weight: bold;

    box-shadow:

        inset
        0 1px 2px
        rgba(255,255,255,.25),

        0 0 0 2px
        rgba(255,112,218,.17),

        0 7px 18px
        rgba(0,0,30,.35);

    text-shadow:
        0 0 6px
        rgba(255,190,240,.7);
}


#message::before {

    content: "✦";

    position: absolute;

    left: -12px;

    top: -7px;

    color: #ff9be1;

    text-shadow:
        0 0 8px white;
}


#message::after {

    content: "✧";

    position: absolute;

    right: -12px;

    bottom: -5px;

    color: #9edaff;

    text-shadow:
        0 0 8px white;
}


/* ═══════════════════════════════════════
   ПАНЕЛЬ КНОПОК
═══════════════════════════════════════ */

.actions {

    position: relative;

    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 9px;

    padding: 10px;

    border-radius: 31px;

    border:
        1px solid
        rgba(220,190,255,.40);

    background:

        linear-gradient(
            145deg,
            rgba(39,18,70,.96),
            rgba(28,28,78,.96)
        );

    box-shadow:

        inset
        0 1px 3px
        rgba(255,255,255,.15),

        0 0 0 2px
        rgba(186,102,255,.10),

        0 0 22px
        rgba(155,77,255,.22),

        0 12px 30px
        rgba(0,0,25,.45);
}


.actions::before {

    content:
        "✦　♡　⋆　✧　♡　✦";

    position: absolute;

    top: -21px;

    left: 0;

    right: 0;

    text-align: center;

    font-size: 10px;

    color: #d8b0ff;

    letter-spacing: 5px;

    text-shadow:
        0 0 7px #d09cff;
}


/* ═══════════════════════════════════════
   КНОПКИ
═══════════════════════════════════════ */

.action-button {

    position: relative;

    height: 82px;

    min-width: 0;

    overflow: hidden;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    gap: 5px;

    padding: 8px;

    border-radius: 22px;

    border:
        1px solid
        rgba(255,255,255,.55);

    color: white;

    font-family: inherit;

    font-size: 11px;

    font-weight: bold;

    cursor: pointer;

    -webkit-tap-highlight-color:
        transparent;

    transition:
        transform .12s ease,
        opacity .12s ease;
}


.action-button::before {

    content: "";

    position: absolute;

    top: -60%;

    left: -80%;

    width: 45%;

    height: 220%;

    transform:
        rotate(25deg);

    background:

        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,.45),
            transparent
        );

    animation:
        buttonShine
        6s
        linear
        infinite;

    pointer-events: none;
}


@keyframes buttonShine {

    0%,
    70% {

        left: -80%;
    }

    88%,
    100% {

        left: 150%;
    }
}


.action-button:active {

    transform:
        scale(.93);

    opacity: .88;
}


/* ЕДА */

.feed {

    background:

        linear-gradient(
            145deg,
            #aa397d,
            #77377e,
            #553b89
        );
}


/* ПОГЛАДИТЬ */

.pet {

    background:

        linear-gradient(
            145deg,
            #b947aa,
            #8148b7,
            #515ab5
        );
}


/* СОН */

.sleep {

    background:

        linear-gradient(
            145deg,
            #51479f,
            #3e50a2,
            #2c649c
        );
}


/* ИГРА */

.play {

    background:

        linear-gradient(
            145deg,
            #7049ad,
            #5367bd,
            #3585b4
        );
}


.feed,
.pet,
.sleep,
.play {

    box-shadow:

        inset
        0 2px 4px
        rgba(255,255,255,.23),

        0 5px 14px
        rgba(105,70,210,.22);
}


/* ═══════════════════════════════════════
   ИКОНКИ
═══════════════════════════════════════ */

.button-icon {

    position: relative;

    z-index: 2;

    font-size: 26px;

    line-height: 1;

    text-shadow:
        0 0 5px
        rgba(255,255,255,.8);
}


.button-text {

    position: relative;

    z-index: 2;

    text-shadow:
        0 1px 5px
        rgba(0,0,30,.6);
}


.button-sparkle {

    position: absolute;

    top: 7px;

    right: 9px;

    font-size: 8px;

    color: white;

    animation:
        tinyStar
        2s
        ease-in-out
        infinite alternate;
}


@keyframes tinyStar {

    from {

        opacity: .25;

        transform: scale(.7);
    }

    to {

        opacity: 1;

        transform: scale(1.3);
    }
}


/* ═══════════════════════════════════════
   НИЖНИЙ ДЕКОР
═══════════════════════════════════════ */

.bottom-decoration {

    margin-top: 22px;

    font-size: 10px;

    letter-spacing: 3px;

    color: #bdadff;

    text-shadow:
        0 0 7px
        rgba(181,142,255,.8);
}


/* ═══════════════════════════════════════
   ЧАСТИЦЫ
═══════════════════════════════════════ */

.burst-particle {

    position: absolute;

    z-index: 30;

    pointer-events: none;

    font-size: 18px;

    will-change:
        transform,
        opacity;

    animation:
        burst
        .8s
        ease-out
        forwards;
}


.burst-particle.love {

    color: #ff79d5;

    text-shadow:
        0 0 5px white;
}


.burst-particle.food {

    color: #ff9acb;

    text-shadow:
        0 0 5px white;
}


.burst-particle.dream {

    color: #9fcaff;

    text-shadow:
        0 0 5px white;
}


@keyframes burst {

    0% {

        transform:
            translate3d(0,0,0)
            scale(.4);

        opacity: 0;
    }

    18% {

        opacity: 1;
    }

    100% {

        transform:

            translate3d(
                var(--x),
                var(--y),
                0
            )

            rotate(
                var(--r)
            )

            scale(.7);

        opacity: 0;
    }
}


/* ═══════════════════════════════════════
   ТЕЛЕФОН
═══════════════════════════════════════ */

@media (max-width: 380px) {

    #game {

        padding-left: 12px;

        padding-right: 12px;
    }


    h1 {

        font-size: 25px;
    }


    #cat {

        height: 345px;
    }


    #cat-image {

        width: 270px;

        height: 270px;
    }


    .actions {

        gap: 7px;

        padding: 8px;
    }


    .action-button {

        height: 78px;

        font-size: 10px;
    }


    .button-icon {

        font-size: 24px;
    }
}
/* ═══════════════════════════════════════
   ШКАЛЫ СОСТОЯНИЯ
═══════════════════════════════════════ */

.stats {

    width: 100%;

    margin-bottom: 25px;

    padding:
        16px
        18px;

    border-radius: 25px;

    border:
        1px solid
        rgba(225,195,255,.45);

    background:

        linear-gradient(
            145deg,
            rgba(49,23,82,.95),
            rgba(30,31,83,.95)
        );

    box-shadow:

        inset
        0 1px 3px
        rgba(255,255,255,.16),

        0 0 0 2px
        rgba(191,116,255,.08),

        0 0 20px
        rgba(160,80,255,.18),

        0 10px 25px
        rgba(0,0,25,.35);
}


.stat {

    margin-bottom: 13px;
}


.stat:last-child {

    margin-bottom: 0;
}


.stat-info {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 6px;

    font-size: 11px;

    font-weight: bold;

    letter-spacing: .5px;

    color: #fff5ff;

    text-shadow:
        0 0 6px
        rgba(220,180,255,.6);
}


/* ФОН ПОЛОСЫ */

.stat-bar {

    position: relative;

    width: 100%;

    height: 12px;

    padding: 2px;

    overflow: hidden;

    border-radius: 20px;

    border:
        1px solid
        rgba(255,255,255,.28);

    background:
        rgba(8,5,30,.65);

    box-shadow:

        inset
        0 2px 5px
        rgba(0,0,20,.55),

        0 0 5px
        rgba(170,120,255,.16);
}


/* ЗАПОЛНЕНИЕ */

.stat-fill {

    position: relative;

    width: 80%;

    height: 100%;

    border-radius: 20px;

    transition:
        width
        .5s
        ease;
}


/* БЛИК ВНУТРИ */

.stat-fill::after {

    content: "";

    position: absolute;

    top: 1px;

    left: 5%;

    width: 70%;

    height: 2px;

    border-radius: 10px;

    background:
        rgba(255,255,255,.55);
}


/* НАСТРОЕНИЕ */

.mood-fill {

    background:

        linear-gradient(
            90deg,
            #d64fae,
            #ff81d7,
            #c184ff
        );

    box-shadow:
        0 0 8px
        rgba(255,100,210,.6);
}


/* СЫТОСТЬ */

.hunger-fill {

    background:

        linear-gradient(
            90deg,
            #bd568f,
            #ed7bb7,
            #e89bd4
        );

    box-shadow:
        0 0 8px
        rgba(255,110,185,.5);
}


/* ЭНЕРГИЯ */

.energy-fill {

    background:

        linear-gradient(
            90deg,
            #6267d5,
            #7c9cff,
            #72caff
        );

    box-shadow:
        0 0 8px
        rgba(100,170,255,.55);
}