:root {
    --color-bg-primary: #85654a;
    --color-bg-secondary: #75593e;
    --color-text: #ffffff;
    --color-link: #ffcc00;
    --color-border: #7f7f7f;
    --color-border-transparent: #FFFFFF30;
    --color-button-bg: #00000040;
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--color-bg-primary);
    color: #ffffff;
    margin: 0;
    margin-left: 7px;
    margin-right: 7px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-left: 0px;
    padding-right: 0px;
    gap: 0px;
    overflow: hidden;
}

#content {
    max-width: calc(320px * 3);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    /* background-color: var(--color-bg-secondary); */
    min-height: 100vh;
}

#pixel-timer-container {
    container-type: size;
    width: 400px;
    height: 150px;

}

#pixel-timer {
    display: flex;
    flex-direction: column;
    position: relative;
    align-items: center;
    width: 100%;
    height: 100%;
    border-radius: 5px;
    border: 1px solid #ffffff30;
    overflow: hidden;
    font-variant-numeric: tabular-nums;

    @container (max-height: 110px) or (max-width: 200px) {
        position: relative;
        top: 0px;
    }

    #timers {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        justify-content: center;
        height: 100%;
        p {
            margin: 0px;
        }
    }

    #click-to-start {
        position: absolute;
        top: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        left: 50%;
        transform: translate(-50%, -50%);
        color: var(--color-text);
        font-size: 20px;
        font-weight: bold;
        z-index: 10;
        width: 100%;
        height: 100%;
        backdrop-filter: blur(5px) brightness(0.8);

        button {
            background-color: rgb(from var(--color-button-bg) r g b / 0.7);
        }
    }

    #alarm-flash {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: var(--color-link);
        opacity: 0;
        animation: alarm-flash 0.5s ease-in-out infinite;
        z-index: -9;

        @container (max-height: 110px) or (max-width: 200px) {
            display: none;
        }
    }

    #timer-adjust {
        position: absolute;
        top: 0px;
        left: 5px;
        width: 0px;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        opacity: 0;
        /* pointer-events: none; */

        transition: opacity 0.2s ease-in-out;

        &.is-hover {
            opacity: 1;
        }
        @container (width < 250px) {
            flex-direction: row;
            top: 5px;
            justify-content: flex-start;
            width: 70px;
            height: unset;
        }
        .hover-rect {
            top: 0; 
            left: 0; 
            width: 50cqw; 
            height: 100%;
            @container (width < 250px) {
                height: 100cqh;
            }
        }

        button {
            width: 27px;
            height: 27px;
            border-radius: 5px;
            border: none;
            background-color: var(--color-button-bg);
            color: var(--color-text);
            margin: 0px;
            margin-right: 5px;
            margin-bottom: 5px;
            padding: 0px;
            user-select: all;
            position: relative;
            font-size: 15px;
            line-height: 0px;
            user-select: none;
        }

    }

    #pixel-counts {
        display: flex;
        flex-direction: row;
        align-items: center;
        /* position: absolute;
        top: 50%;
        left: 50%; */
        /* transform: translate(-50%, -50%); */
        width: 100%;
        justify-content: center;

        * {
            font-size: 34px;
        }

        input {
            width: 100px;
            text-align: center;
            border: none;
            outline: none;
            background-color: var(--color-button-bg);
            color: var(--color-text);
            font-family: 'Kanit', sans-serif;
            border-radius: 5px;
            margin: 3px 10px;
            padding: 0px 0px;
            user-select: all;
        }

        button {
            width: 23px;
            height: 23px;
            border-radius: 5px;
            border: none;
            background-color: var(--color-button-bg);
            color: var(--color-text);
            margin: 0px;
            padding: 0px;
            user-select: all;
            position: relative;
            font-size: 25px;
            line-height: 0px;
            user-select: none;
        }

        .count-container {
            display: flex;
            flex-direction: row;

            &:hover #button-container {
                opacity: 1;
            }
        }

        #button-container {
            width: 0px;
            height: 50px;
            top: 3px;
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            justify-content: space-between;
            opacity: 0;
            transition: opacity 0.2s ease-in-out;
        }

        #current-count-container #button-container {
            left: 5px;
        }

        #full-count-container #button-container {
            left: 18px;
        }
    }

    #top-container {
        height: 27px;
        width: 100%;
        display: flex;
        justify-content: center;

        #reset-btn-container {
            position: relative;
            top: -10px;
            #reset-btn {
                display: none;
                width: 100px;
            }
        }
    }
    #pixel-time-left {
        font-size: 18px;
        height: 27px;
        width: 100%;
        text-align: center;

        @container (max-height: 110px) or (max-width: 200px) {
            position: relative;
            top: -4px;
            font-size: 23px;
            /* letter-spacing: 1.5px; */
        }
    }

    #time-left {
        height: 30px;
        /* width: 100%; */
        font-size: 20px;
        text-align: center;
        cursor: pointer;

        @container (max-height: 110px) or (max-width: 200px) {
            position: relative;
            top: -7px;
            font-size: 26px;
            /* letter-spacing: 1px; */
        }
    }

    #progress {
        /* position: absolute; */
        /* bottom: 0; */
        width: 100%;
        height: 20px;
        margin: 0px;
        padding: 0px;
        background-color: var(--color-button-bg);
        color: white;
        z-index: -10;

        @container (max-height: 110px) or (max-width: 200px) {
            position: fixed;
            top: 0vh;
            height: 100%;
        }
    }

    #progress-fill {
        height: 100%;
        width: 25%;
        background-color: var(--color-link);

        @container (max-height: 110px) or (max-width: 200px) {
            background-color: hsl(from var(--color-link) h s calc(l * 0.9));
        }
    }

    p {
        white-space: nowrap;
    }

    @container (max-height: 110px) or (max-width: 200px) {
        p {
            -webkit-text-stroke: 6px rgba(0, 0, 0, 0.8);
            paint-order: stroke fill;
            font-weight: bold;
            letter-spacing: 0.75px;
        }

        input {
            -webkit-text-stroke: 6px rgba(0, 0, 0, 0.8);
            paint-order: stroke fill;
            background-color: rgb(from var(--color-button-bg) r g b / 0.5) !important;
        }

        button {
            background-color: rgb(from var(--color-button-bg) r g b / 0.5) !important;
        }
    }

    @container (max-height: 130px) or (max-width: 250px) {
        zoom: 0.9;
    }

    @container (max-height: 110px) or (max-width: 200px) {
        zoom: 0.7;

    }

    @container (width > 400px) and (height > 185px) {
        zoom: 1.5;
    }

    @container (width > 600px) and (height > 250px) {
        zoom: 2;
    }

    @container (width > 800px) and (height > 345px) {
        zoom: 2.75;
    }

    @container (width > 1000px) and (height > 480px) {
        zoom: 3.75;
    }
}

button {
    background-color: var(--color-button-bg);
    color: white;
    border: none;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 5px;
    font-family: 'Kanit', sans-serif;
}

.hover-zone {
    position: relative;
    display: inline-block;
}

.hover-rect {
    position: absolute;
    top: -50px;
    left: -50px;
    right: -50px;
    bottom: -50px;
    pointer-events: none;
}



@keyframes alarm-flash {
    0% {
        filter: brightness(1);
    }

    100% {
        filter: brightness(0.4);
    }
}

@keyframes bg-flash {
    0% {
        opacity: 1;
        filter: brightness(1);
    }

    100% {
        opacity: 1;
        filter: brightness(0.4);
    }
}