:root {
    --content-width: min(320px, calc(100vw - 48px));
    --black: #40382F;
    --grey: #e6dcc4;
    --track: #dccfb5;
    --bg: #f2ebdc;
    --pop: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Échelle d'espacement (base 4px) */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;

    /* Rayons */
    --r-sm: 9px;
    --r-md: 12px;
    --r-lg: 16px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--black);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--bg);
}

p {
    margin: 0;
}

a {
    text-decoration: none;
    color: var(--black);
}

/* ---------- STRUCTURE ---------- */

.contain {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

nav {
    height: 10vh;
    height: 10dvh;
    min-height: 64px;
    width: var(--content-width);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
nav i {
    font-size: 14px;
}

.center_page {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.zone_tips {
    width: var(--content-width);
    height: 42vh;
    height: 42dvh;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-direction: column;
}
.zone_tips p {
    font-weight: 500;
    text-align: center;
    line-height: 1.55;
}

.line {
    height: 6px;
    width: 100px;
    border-radius: 3px;
    background-color: var(--black);
    margin: var(--s-4) 0 var(--s-5);
}
.zone_content {
    min-height: 120px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* ---------- NAV GAUCHE ---------- */

.nav_left {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

nav .app {
    font-size: 17px;
    font-weight: 500;
}

/* ---------- STREAK (flamme) ---------- */

.number_heart {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--s-2);
}
.number_heart p {
    font-weight: 500;
    margin: 0;
}

/* ---------- COMPTEUR +1 ---------- */

.plus_one {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: var(--s-1);
    font-size: 13px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}
.plus_one.show {
    animation: plusOne 1.6s ease forwards;
}

#day-icon {
    display: inline-block;
    transform-origin: 50% 85%;
}
#day-icon.show {
    animation: iconPop 0.9s var(--pop);
}

/* ---------- TASSE ---------- */

.mug {
    width: 70px;
    height: 70px;
    color: var(--black);
}
.mug .cup {
    fill: currentColor;
}
.mug .handle {
    fill: none;
    stroke: currentColor;
    stroke-width: 5;
    stroke-linecap: round;
}
.mug .steam {
    fill: none;
    stroke: currentColor;
    stroke-width: 3.5;
    stroke-linecap: round;
    opacity: 0;
    animation: steam 3s ease-in-out infinite;
}
.mug .s2 { animation-delay: 1s; }
.mug .s3 { animation-delay: 2s; }

/* ---------- BARRE + BOUTON ---------- */

.zone_continue {
    width: var(--content-width);
    height: 25vh;
    height: 25dvh;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
}
.loading {
    width: 56px;
    height: 7px;
    border-radius: 6px;
    background-color: var(--track);
    margin-bottom: var(--s-5);
    position: relative;
    overflow: hidden;
}
.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress, 33%);
    border-radius: 6px;
    background-color: var(--black);
    transition: width 0.4s ease;
}

.zone_arrow {
    width: 220px;
    height: 56px;
    border-radius: var(--r-md);
    background-color: var(--black);
    display: flex;
    justify-content: space-between;
    padding: var(--s-1);
}
.zone_arrow .left,
.zone_arrow .center,
.zone_arrow .right {
    height: 100%;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.zone_arrow .left {
    width: 48px;
    color: white;
}
.zone_arrow .center {
    flex: 1;
    color: white;
    font-weight: 500;
    font-size: 15px;
    white-space: nowrap;
}
.zone_arrow .right {
    width: 48px;
    background-color: var(--bg);
    color: var(--black);
}

/* ---------- HOVERS ---------- */

.zone_arrow .left,
.zone_arrow .right {
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}
.zone_arrow .left:hover {
    background-color: rgba(255, 255, 255, 0.15);
}
.zone_arrow .right:hover {
    background-color: var(--grey);
    transform: scale(1.06);
}
.zone_arrow .left:active,
.zone_arrow .right:active {
    transform: scale(0.94);
}
.zone_arrow .left.disabled {
    opacity: 0;
    pointer-events: none;
}
.zone_arrow .right.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ---------- KO-FI (carte) ---------- */

.kofi {
    width: var(--content-width);
    margin-top: var(--s-4);
    padding: var(--s-4);
    display: flex;
    align-items: center;
    gap: var(--s-4);
    background-color: #e6dcc4;                 /* valeur de secours */
    background-color: var(--grey, #e6dcc4);    /* variable si elle existe */
    border: 1.5px solid var(--track, #dccfb5);
    border-radius: var(--r-lg, 16px);
    box-shadow: 0 1px 2px rgba(64, 56, 47, 0.06);
    transition: transform 0.25s var(--pop), box-shadow 0.25s ease,
                border-color 0.25s ease;
}
.kofi:hover {
    transform: translateY(-2px);
    border-color: var(--black);
    box-shadow: 0 8px 20px rgba(64, 56, 47, 0.14);
}
.kofi:active {
    transform: scale(0.98);
}

.kofi .zone_image {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: var(--r-md);
    background-color: var(--bg);
    border: 1.5px solid var(--track);
    display: flex;
    align-items: center;
    justify-content: center;
}
.kofi .zone_image img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.kofi .text_kofi {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
}
.kofi .text_kofi h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}
.kofi .text_kofi p {
    font-size: 13px;
    line-height: 1.45;
    opacity: 0.75;
    text-align: left;
}

.kofi .kofi_arrow {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--black);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s var(--pop);
}
.kofi .kofi_arrow i {
    font-size: 12px;
}
.kofi:hover .kofi_arrow {
    transform: translateX(3px);
}

/* ---------- FOOTER ---------- */

footer {
    width: 100%;
    padding: var(--s-6) 0 var(--s-7);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--s-5);
}
footer a {
    font-size: 13px;
    font-weight: 500;
    color: var(--black);
    opacity: 0.5;
    transition: opacity 0.2s ease;
}
footer a:hover {
    opacity: 1;
}

/* ---------- ANIMATIONS ---------- */

@keyframes steam {
    0% {
        opacity: 0;
        transform: translate(0, 6px);
    }
    35% {
        opacity: 0.8;
        transform: translate(-1px, 0);
    }
    70% {
        opacity: 0.4;
        transform: translate(1px, -4px);
    }
    100% {
        opacity: 0;
        transform: translate(0, -8px);
    }
}

@keyframes iconPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    100% { transform: scale(1); }
}

@keyframes plusOne {
    0%   { opacity: 0; transform: translateY(6px) scale(0.8); }
    20%  { opacity: 1; transform: translateY(0) scale(1); }
    65%  { opacity: 1; transform: translateY(-2px) scale(1); }
    100% { opacity: 0; transform: translateY(-12px) scale(1); }
}

/* ---------- DESKTOP ---------- */

@media (min-width: 768px) {
    :root {
        --content-width: 440px;
    }

    nav {
        min-height: 88px;
    }
    nav .app {
        font-size: 22px;
    }

    .mug {
        width: 90px;
        height: 90px;
    }
    .line {
        width: 120px;
        margin: var(--s-5) 0 var(--s-6);
    }
    .zone_content {
        min-height: 140px;
    }
    .zone_tips p {
        font-size: 19px;
        line-height: 1.6;
    }

    .loading {
        width: 70px;
        margin-bottom: var(--s-6);
    }
    .zone_arrow {
        width: 260px;
        height: 62px;
    }
    .zone_arrow .left,
    .zone_arrow .right {
        width: 54px;
    }
    .zone_arrow .center {
        font-size: 16px;
    }

    .kofi {
        margin-top: var(--s-5);
        padding: var(--s-5);
        gap: var(--s-5);
    }
    .kofi .zone_image {
        width: 64px;
        height: 64px;
    }
    .kofi .zone_image img {
        width: 32px;
        height: 32px;
    }
    .kofi .text_kofi h2 {
        font-size: 16px;
    }

    .kofi .text_kofi p {
        font-size: 14px;
    }

    footer a {
        font-size: 14px;
    }
}