:root {
    --bar-color: hsl(28, 88%, 54%);
    --track-color: hsla(28, 25%, 20%, 1);
    --background-color: #000000;
}

@property --fill-progress {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

@property --track-color {
    syntax: '<color>';
    inherits: true;
    initial-value: hsla(28, 25%, 20%, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    overflow: hidden;
    background-color: #000000;
}

#display-root {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--background-color);
}

#display-root:fullscreen {
    width: 100%;
    height: 100%;
}

.bar-track {
    width: 98%;
    max-width: none;
    --bar-height: clamp(2.75rem, 9vh, 5.5rem);
    height: var(--bar-height);
    border-radius: 999px;
    overflow: hidden;
    opacity: 1;
    position: relative;
    transition: opacity 3.5s ease, --track-color 1.5s ease;
}

.bar-track::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--track-color);
}

.bar-track.hidden {
    opacity: 0;
    pointer-events: none;
}

.bar-fill {
    --fill-progress: 0;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: var(--bar-color);
    transform-origin: left center;
    transform: scaleX(var(--fill-progress));
    transition: none;
}

.fullscreen-btn {
    position: absolute;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 3rem;
    height: 3rem;
    border: 1px solid rgba(180, 90, 30, 0.3);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: opacity 0.25s ease;
}

.fullscreen-btn::before,
.fullscreen-btn::after {
    content: "";
    position: absolute;
    inset: 0.85rem;
    border: 2px solid rgba(140, 70, 20, 0.65);
}

.fullscreen-btn::before {
    border-right: 0;
    border-bottom: 0;
    transform: translate(-0.15rem, -0.15rem);
}

.fullscreen-btn::after {
    border-left: 0;
    border-top: 0;
    transform: translate(0.15rem, 0.15rem);
}

.fullscreen-btn:hover,
.fullscreen-btn:focus-visible {
    background: rgba(255, 255, 255, 0.85);
    outline: none;
}

.fullscreen-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .bar-fill,
    .bar-track,
    .fullscreen-btn {
        transition: none !important;
    }
}
