:root {
    --bg-color: #00401e; /* Dark green */
    --text-color: #ffffff;
    --bar-bg: rgba(0, 0, 0, 0.3); /* Slightly darker track for better contrast */
    --bar-color: #b1953a; /* Default Gold */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Google Sans Flex', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.background_container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1.5vh 3vw 3vh 3vw;
}

.title_container {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    margin-bottom: 1vh;
    font-size: 4vmin;
    font-weight: 700;
}

.top-bar-item:nth-child(1) { text-align: left; }
.top-bar-item:nth-child(2) {
    text-align: center;
    font-family: 'Google Sans Flex', sans-serif;
    font-size: 8vmin;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    text-shadow: none !important;
}
.top-bar-item:nth-child(3) { text-align: right; }

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 4vh;
    gap: 6vh;
}

.schedule-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6vh;
}

.tracker-item {
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
}

.text_container {
    padding-left: 2vw;
}

.period {
    font-size: 6vmin;
    font-weight: 700;
}

.progress_container {
    position: relative;
    height: 12vh;
    background: var(--bar-bg);
    border-radius: 6vh;
    overflow: hidden;
}

.progress_bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--bar-color);
    border-radius: 6vh;
    width: 0%;
    overflow: hidden; /* Keep the blurred edges inside the bar */
}

.progress_bar.low-perf {
    background-color: var(--bar-color) !important;
    background-image: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.4) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.2) 100%
    ) !important;
}

.progress_bar.low-perf::before,
.progress_bar.low-perf::after {
    display: none !important;
}

/* Bubbles inside the bar - Dynamic Liquid effect */
.progress_bar::before,
.progress_bar::after {
    content: '';
    position: absolute;
    top: -6vh;
    left: -6vh;
    right: -6vh;
    bottom: -6vh;
    filter: blur(2vh);
    border-radius: 6vh;
}

.progress_bar::before {
    background:
        radial-gradient(circle at 20% 35%, rgba(255, 255, 255, 0.5) 0%, transparent 40%),
        radial-gradient(circle at 70% 65%, rgba(255, 255, 255, 0.4) 0%, transparent 45%);
    background-size: 100vh 100%;
    background-repeat: repeat-x;
    animation: liquidFlow1 20s linear infinite;
    opacity: 0.5;
    z-index: 1;
}

.progress_bar::after {
    background:
        radial-gradient(circle at 40% 70%, rgba(255, 255, 255, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 50%);
    background-size: 85vh 100%;
    background-repeat: repeat-x;
    animation: liquidFlow2 15s linear infinite reverse;
    opacity: 0.4;
    z-index: 2;
}

@keyframes liquidFlow1 {
    from { background-position: 0 0; }
    to { background-position: 100vh 0; }
}

@keyframes liquidFlow2 {
    from { background-position: 0 0; }
    to { background-position: 85vh 0; }
}

.progress_time {
    position: absolute;
    /* Spacing logic: Right margin should be around 1.1vh.
       Container is 12vh. Font is 6.5vmin (6.5vh on 16:9).
       Target gap = 1.1vh. Total pill height = 12 - 2.2 = 9.8vh.
       Vertical padding = (9.8 - 6.5) / 2 = 1.65vh.
    */
    right: 1.1vh;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Azeret Mono', monospace;
    font-size: 6.5vmin;
    line-height: 1;
    font-weight: 500;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.8);
    padding: 1.65vh 2.5vw;
    border-radius: 5vh;
    z-index: 20;
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased;
}

.end-message {
    display: none;
    text-align: center;
    font-size: 15vmin;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    padding: 8vh 5vw;
    border-radius: 10vh;
    box-shadow: 0 2vh 5vh rgba(0,0,0,0.3);
    margin: auto 0; /* Center vertically when it's the only thing */
}

.total-time-left {
    position: fixed;
    bottom: 4vh;
    left: 4vw;
    z-index: 100;
    display: flex;
    align-items: flex-end; /* Align text to bottom of the pill */
    gap: 1.5vw;
}

.total-time-remaining {
    font-size: 4.5vmin;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 1.5vh 2.5vw;
    border-radius: 2.5vh;
    backdrop-filter: blur(10px);
    text-shadow: none !important;
}

.credits {
    position: fixed;
    bottom: 10px;
    right: 10px;
    color: var(--text-color);
    opacity: 0.2;
    font-size: 2vmin;
    font-weight: 400;
    white-space: nowrap;
    z-index: 1000;
}

/* Remote Override Overlay */
.override-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    z-index: 9999;
    display: none; /* Controlled by JS */
    justify-content: center;
    align-items: center;
    padding: 10vw;
    text-align: center;
}

.override-text {
    color: #ffffff;
    font-size: 10vmin;
    font-weight: 700;
    line-height: 1.2;
    word-wrap: break-word;
    max-width: 95vw;
}
