.hidden-tooltip-text {
    filter: blur(4px);
    color: #aaa !important;
    font-style: italic;
    pointer-events: none;
    user-select: none;
    transition: filter 0.3s, color 0.3s;
}

.tooltip-content {
    position: relative;
    z-index: 30; /* ensure tooltip content renders above badge-layer (z-index:22) */
}

.tooltip-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255,255,255,0.85);
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    font-size: 18px;
    z-index: 40;
    pointer-events: none;
}

@keyframes move {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
:root {
    --primary: #f0f0f0;
    --secondary: #0e0e10;
    --accent: #efeff1;
    --text: #f7f7f7;
    --text-primary: #f7f7f7;
    --bg-primary: #16181d;
    --bg-secondary: #1a1a1d;
    --success: #00b359;
    --range-accent: #7c25ff; /* slider accent colour to match toggles */
    --dance-color: #ff3385;
    --gaming-color: #3399ff;
    --gift-card-color: #ffcc00;
    --border-color: rgba(255, 255, 255, 0.1);
    --radius: 6px;
}

/* Load local woff2 fonts for the OBS overlay. If the font is installed
    locally the browser may use it; otherwise it will fall back to the
    bundled woff2 files. font-display: swap keeps text visible while
    the font loads. Put the files in ./fonts/. */
@font-face {
    font-family: 'Filson Soft';
    src: url('./fonts/FilsonSoftBold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Filson Soft';
    src: url('./fonts/FilsonSoftHeavy.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Filson Soft';
    /* map Bold to the 'FilsonSoft Black.woff2' file on disk */
    src: url('./fonts/FilsonSoftBlack.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

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

/* Admin panel: use system UI font for snappy rendering */
.admin-body * {
    font-family: 'Google Sans Code', sans-serif;
}

/* Overlay text uses the Filson Soft family for its look */
.display-container,
.progress-section,
.progress-count,
.tooltip-content,
.tooltip-number {
    font-family: 'Filson Soft', sans-serif;
    font-weight: 900;
}

.tooltip-text {
    font-family: 'Filson Soft', sans-serif;
    font-weight: 700;
}

.progress-title {
    top: 0px;
    color: white;
    text-shadow: .5px .5px 2px black;
    position: relative;
    font-family: 'Filson Soft', sans-serif;
    font-weight: 900 !important;
    font-size: 33px !important;
}

.tooltip-content,
.tooltip-text {
    font-size: 1rem !important;
}

body {
    background-color: transparent;
    color: var(--text);
    line-height: 1.6;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

.display-container {
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    position: fixed;
    top: 20px;
    flex-direction: column;
    justify-content: center;
}

/* Position helpers: add one of these classes to pin the progress section
    near the top or bottom of the screen (useful for OBS). You can also
    control this with ?position=top or ?position=bottom in the URL. */
.position-top .progress-section {
    position: fixed;
    top: 1.5%;
    left: 4.5%;
    right: 18%;
}

.position-bottom .progress-section {
    position: fixed;
    bottom: 1.5%;
    left: 15.5%;
    right: 15%;
}

.position-right .progress-section {
    position: fixed;
    right:0%;
    top: 21%;
    bottom: 12%;
    width: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Styles specific to the left-side (vertical) progress layout */
.position-left .progress-section {
    position: fixed;
    left:0%;
    top: 7%;
    bottom: 18.5%;
    width: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Make the progress section stack vertically so header and bar can be
    reordered easily depending on position */
.progress-section {
    display: flex;
    flex-direction: column;
}

/* When the section is anchored to the bottom, place the header after the
    progress container so it appears below the bar. Tooltip layer gets
    a higher z-index in that case. */
.position-bottom .progress-container {
    order: 1;
}

.position-bottom .progress-tooltip-layer {
    z-index: 50;
}

/* Styles specific to the right-side (vertical) progress layout */
.position-right .progress-bar-container {
    height: 100%;
    width: 30px;
    margin: 0 auto;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.6);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.position-left .progress-bar-container {
    height: 100%;
    width: 30px;
    margin: 0 auto;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.6);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.position-right .progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.position-left .progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.position-right .progress-bar {
    width: 100%;
    height: 0%;
    border-radius: 15px;
    transition: height 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    flex-direction: column;
    position: relative;
}

.position-left .progress-bar {
    overflow: hidden;
    width: 100%;
    height: 0%;
    border-radius: 15px;
    transition: height 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    flex-direction: column;
    position: relative;
}

/* Allow the vertical bar to shrink to fit the narrow container */
.position-right .progress-bar {
    min-width: 0 !important;
    box-sizing: border-box;
    max-width: 30px;
}

.position-left .progress-bar {
    min-width: 0 !important;
    box-sizing: border-box;
    max-width: 30px;
}

.position-right .progress-count {
    position: absolute;
    right: 4px;
    bottom: auto !important;
    top: 0 !important;
    transform: none;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    padding: 12px 0;
}

.position-left .progress-count {
    position: absolute;
    left: 2px;
    bottom: auto !important;
    top: 0 !important;
    transform: none;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    padding: 12px 0;
}

.position-right .progress-count #current-subs {
    display: block;
    line-height: 1;
    text-align: center;
}

.position-left .progress-count #current-subs {
    display: block;
    line-height: 1;
    text-align: center;
    padding-left: 13px;
}

#current-subs {
    font-size: 1.4rem;
    font-weight: 800;
}

/* Use the standard writing-mode for vertical text in right mode */
.position-right .progress-count {
    writing-mode: vertical-rl;
}

.position-left .progress-count {
    writing-mode: vertical-rl;
}

.position-right .tooltip-marker.custom-marker {
    left: 50%;
    top: auto;
    bottom: 0%;
    transform: translate(-50%, 0);
}

.position-left .tooltip-marker.custom-marker {
    left: 50%;
    top: auto;
    bottom: 0%;
    transform: translate(-50%, 0);
}

.position-right .progress-container {
    position: relative;
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.position-left .progress-container {
    position: relative;
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.position-right .progress-tooltip-layer {
    z-index: 50;
}

.position-left .progress-tooltip-layer {
    z-index: 50;
}

.position-right .marker-connector {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 40px;
    height: 2px;
    transform: translate(-100%, -50%);
    z-index: 2;
    pointer-events: none;
}

.position-left .marker-connector {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 40px;
    height: 2px;
    transform: translate(0%, -50%);
    z-index: 2;
    pointer-events: none;
}

.position-right .tooltip-content {
    width: 120px !important;
    max-width: 150px !important;
    min-width: 150px !important;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.position-left .tooltip-content {
    width: 120px !important;
    max-width: 150px !important;
    min-width: 150px !important;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.progress-title {
    font-size: 1.2rem;
    font-weight: bold;
}

.progress-container {
    position: relative;
    margin-top: 20px;
}

.progress-count {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text);
    font-weight: bold;
    font-size: 1.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 2;
}



/* Styles for completed goals */

.progress-bar-container {
    height: 30px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    overflow: visible;
    position: relative;
    margin-bottom: 25px;
    margin-top: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));

}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 15px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 60px;
}

.tooltip-marker.custom-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    background: transparent;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.marker-circle {
    width: 18px;
    height: 18px;
    border: 2px solid var(--accent, #fff);
    border-radius: 50%;
    background: transparent;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.marker-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent, #fff);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.18);
}


.marker-connector {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2px;
    height: 22px;
    background: linear-gradient(to bottom, var(--accent, #fff), transparent);
    transform: translate(-50%, 0);
    z-index: 2;
    pointer-events: none;
}

.tooltip-content {
    border-radius: var(--radius);
    padding: 14px 4px 4px 2px; /* smaller tooltip padding */
    width: 20ch;
    text-transform: uppercase;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    transform: translateX(var(--shift, 0px));
    text-shadow: 1px 1px 2px black;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    transition: all 0.18s ease;
    position: relative;
    background: rgba(30, 30, 35, 0.36);
}

/* Connector line styles for shifted tooltips */


.marker-connector {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2px;
    height: var(--connector-length, 32px);
    background: linear-gradient(to bottom, var(--accent, #fff), transparent);
    transform: translate(-50%, 0);
    transform-origin: top center;
    z-index: 2;
    pointer-events: none;
}

.tooltip-text {
    line-height: 1.2;
}

.tooltip-marker.unlocked .tooltip-content {
    opacity: 0.9;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border-width: 2px;
}

.tooltip-marker.completed .tooltip-content {
    opacity: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border-width: 2px;
}

/* A stronger visual treatment for completed milestones */


.tooltip-number {
    /* Positioned badge in the top-left corner of the tooltip-content */
    position: absolute;
    top: -14px;
    left: -8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    transform: rotate(-4deg);
    height: 26px;
    padding: 0 8px;
    box-sizing: border-box;
    border-radius: 6px;
    text-shadow: 1px 1px 2px black;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    z-index: 30;
}

/* Arrow/pointer on tooltip-number pointing toward the milestone marker */
.tooltip-number::after {
    content: '';
    position: absolute;
    right: 12px;
    bottom: -5px;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: inherit;
    transform: rotate(45deg);
    z-index: -1;
}

.tooltip-text {
    font-size: 0.82rem;
    color: var(--accent);
    margin-top: 4px;
    line-height: 1.05;
}

.completed {
    text-decoration: line-through;
    opacity: 0.7;
}

.empty-state {
    text-align: center;
    padding: 20px;
    color: var(--accent);
    opacity: 0.7;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reward-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: var(--radius);
    color: white;
    font-weight: bold;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.5s ease;
    z-index: 1000;
}

.reward-show {
    opacity: 1;
    transform: translateX(0);
}

/* Compact mode for smaller overlays */
.compact .progress-section {
    padding: 10px;
}

.compact .progress-bar-container {
    height: 20px;
}

.compact .progress-count {
    font-size: 0.9rem;
    right: 10px;
}

.compact .milestones {
    margin-top: 10px;
    height: 40px;
}

/* In compact mode, we scale only the inner wrapper so top/left on the outer container stay effective */
.compact-section .compact-scale {
    display: inline-block; /* ensure scaling affects only content box */
    transform-origin: bottom right;
}

/* Ensure compact section respects top/left/right/bottom offsets set by the user */
.compact-left .compact-section,
.compact-right .compact-section {
    position: fixed; /* make top/left (or bottom/right) take effect */
}

/* Admin Panel Styles */
.admin-body {
    background: #26262c;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
}

.admin-header h1 {
    color: var(--primary);
    text-transform: uppercase;
    font-size: 2rem;
    margin: 0;
}

.admin-links {
    display: flex;
    gap: 15px;
}

.nav-link {
    color: var(--accent);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.nav-link:hover {
    position: relative; /* allow absolutely positioned children */
    color: white;
    transition: background 0.4s ease-in;
}

/* Overlay group: make copy icon attach to OBS Overlay link with no gap */
.overlay-group {
    display: inline-flex;
    align-items: center;
}

.overlay-group .nav-link {
    padding-left: 10px;
    padding-right: 10px;
}

.overlay-group .nav-link:first-child {
    background: #9146ff;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: 0;
    padding-right: 8px;
}

.overlay-group .nav-link:first-child:hover {
    background: #7c25ff
}

.overlay-group .nav-link:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: 0;
    padding-left: 8px;
}

#overlay-position {
    transition: background 0.4s ease-in;
    cursor: pointer;
}

#overlay-position:hover {
    background: #212124 !important;
}

/* Ensure dropdowns in the overlay settings match surrounding font */
#overlay-position,
#overlay-position option {
    font-family: inherit;
    color: var(--accent);
}

/* Keep native select arrow while ensuring consistent font */
#overlay-position {
    -webkit-appearance: menulist-button;
    appearance: menulist;
    background-color: transparent;
}

/* Subscriber Count Display */
.sub-count-display {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
}

.admin-timer-box,
.sub-count-card {
    /* Match visual style of .sub-count-card */
    background: rgba(144, 70, 255, 0.3);
    border-radius: var(--radius);
    padding: 25px 40px;
    margin: auto;
    height: 110px;
    text-align: center;
    backdrop-filter: blur(5px);
    border: 2px solid #9146ff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.admin-timer-box .sub-count-timer {
    font-size: 3rem;
    font-weight: bold;
    color: white;
}

.sub-count-card h3 {
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: 700;
}

.sub-count-number {
    font-size: 3rem;
    font-weight: bold;
    color: white;
}

/* Admin timer next to subscriber count */
.sub-count-row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.sub-count-timer {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
}

.admin-content {
    display: grid;
    gap: 30px;
    padding-bottom: 50px;
}

.admin-section {
    background: #1a1a1d;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}


.admin-section h2 {
    color: var(--primary);
    margin: 0;
    font-size: 1.5rem;
}
#admin-goals-list {
    max-width: 1100px;
}
/* Section header: title left, badge right */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 43px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

#server-status-container {
    display: flex;
    align-items: center;
}

.pickr {
    font-size: 25px;
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    #server-status-container {
        width: 100%;
        display: flex;
        justify-content: flex-start;
    }
}

/* Server status badge shown in admin headers */
#server-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 0.95rem;
    border-radius: var(--radius);
    color: white;
    vertical-align: middle;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(0, 0, 0, 0.25);
}

.server-online {
    background: rgba(0, 0, 0, 0.06);
}

.server-offline {
    background: rgba(0, 0, 0, 0.06);
}

/* status dot */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

/* pulsing animations */
@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.server-online .status-dot {
    background: #10b981;
    /* green */
    animation: pulse-green 1.8s infinite ease-out;
}

.server-offline .status-dot {
    background: #ef4444;
    /* red */
    animation: pulse-red 1.8s infinite ease-out;
}

.status-label {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

.status-text {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}


.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    color: var(--accent);
    font-weight: 500;
}

.input-group input {
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text);
    font-size: 0.9rem;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(145, 70, 255, 0.2);
}

/* Ensure color picker fills its grid column and matches other inputs visually */
.input-group input[type="color"] {
    width: 100%;
    height: 40px;
    padding: 6px 10px;
    box-sizing: border-box;
    border-radius: var(--radius);
    -webkit-appearance: none;
    appearance: none;
    background-color: transparent
}

/* WebKit-specific tweaks to style the swatch wrapper */
.input-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.input-group input[type="color"]::-webkit-color-swatch {
    border-radius: var(--radius);
    border: none
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #00a050;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-2px);
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.btn-info {
    background: #3b82f6;
    color: white;
}

.btn-info:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.copy-tooltip {
    position: fixed;
    background: var(--compact-badge-bg, rgba(0, 0, 0, 0.85));
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 30000;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.copy-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.copy-tooltip:after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(0, 0, 0, 0.85);
    transform: rotate(45deg);
    left: 50%;
    top: -5px;
    margin-left: -5px;
    z-index: -1;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.875rem;
}

.goal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 18px;
}

.goal-bottom-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}
/* Add Goal button */
.goal-add-btn {
    position: absolute;
    right: 12px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.goal-bottom-row .goal-color-group {
    flex: 1 1 auto;
}
.goal-bottom-row .form-actions {
    flex: 0 0 auto;
    margin-left: 12px;
}

@media (max-width: 600px) {
    .goal-bottom-row {
        flex-direction: column;
        align-items: stretch;
    }
    .goal-bottom-row .form-actions {
        margin-left: 0;
    }
}

@media (max-width: 520px) {
    .goal-form-container {
        padding-bottom: 14px; /* remove extra space when button is in flow */
    }
    .goal-add-btn {
        position: static;
        margin-top: 8px;
    }
}

.goals-list-admin {
    max-height: 400px;
    overflow-y: auto;
}

.goals-list-admin h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.goal-item-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px; /* tighter padding */
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 6px; /* smaller gap */
    border-radius: 0 var(--radius) var(--radius) 0;
    border-left: 4px solid var(--success);
    transition: all 0.18s ease;
}

.goal-item-admin:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(4px);
}

.goal-item-admin.completed {
    opacity: 0.6;
}

.goal-content {
    flex: 1;
}

.goal-details {
    display: flex;
    gap: 10px; /* smaller gap between details */
    font-size: 0.85rem;
    color: var(--accent);
}

.goal-sub {
  background: var(--primary);
  padding: 2px 8px;
  border-radius: var(--radius);
  margin-left: 6px;
  font-size: 0.75rem;
  color: white;
  font-weight: 500;
}

.goal-actions {
    display: flex;
    gap: 8px;
}

/* Hidden goal styling */
.goal-item-admin.hidden-goal {
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.02);
}

.goal-item-admin.hidden-goal .goal-text {
    text-decoration: line-through;
    opacity: 0.7;
}

.goal-item-admin.hidden-goal .goal-sub {
    opacity: 0.6;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: var(--radius);
    color: white;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.5s ease;
    z-index: 1000;
    max-width: 300px;
    background: rgba(55, 65, 81, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.notification-show {
    opacity: 1;
    transform: translateX(0);
}

/* Notification variants */
.notification-info {
    background: rgba(59, 130, 246, 0.95);
}

.notification-success {
    background: rgba(16, 185, 129, 0.95);
    /* green */
}

.notification-error {
    background: rgba(239, 68, 68, 0.95);
    /* red */
}

/* Pickr styling applied via appClass: 'custom-class' */
/* Targets the Pickr root/panel to match the admin theme */
.pcr-app {
    background: #26262c !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--radius) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
    color: var(--text) !important;
}

/* Make the main color result area rounded */
.custom-class .pcr-selection,
.custom-class .pcr-result,
.custom-class .pcr-swatches {
    font-family: 'Google Sans Code', sans-serif !important;
    border-radius: var(--radius) !important;
}

/* Style the hex input inside Pickr */
.custom-class .pcr-button-group .pcr-input,
.custom-class .pcr-button-group input.pcr-input {
    background: #151619 !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    color: var(--text) !important;
    border-radius: var(--radius) !important;
}

/* Action buttons (save/clear) */
.custom-class .pcr-save,
.custom-class .pcr-clear {
    border-radius: var(--radius) !important;
    padding: 6px 10px !important;
}

/* Hide the default Pickr type selector */
.custom-class .pcr-type {
    display: none !important;
}

/* Ensure picker appears above overlays */
.custom-class.pcr-popup,
.custom-class.pcr-app {
    z-index: 20000 !important;
}

/* Tooltip layer above progress bar */
.progress-tooltip-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 0;
    pointer-events: none;
    z-index: 100;
}

.progress-container {
    position: relative;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-container {
        padding: 15px;
    }

    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .goal-form {
        gap: 12px;
    }

    .goal-item-admin {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .goal-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .edit-modal {
        margin: 20px;
        min-width: auto;
        max-width: calc(100vw - 40px);
    }

    .edit-modal-actions {
        flex-direction: column;
    }

    .edit-modal-actions .btn {
        width: 100%;
    }
}

/* Landing Page Styles */

/* Responsive Design for Landing Page */

/* Goal color styles */
.goal-content {
    display: flex;
    align-items: center;
    flex-grow: 1;
    margin-right: 15px;
}

.goal-text {
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 500;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.goal-sub {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Edit Modal Styles */
.edit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.edit-modal {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 32px 28px;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    min-width: 320px;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: resetModalSlideIn 0.3s ease-out;
}

.edit-modal h3 {
    color: var(--primary);
    margin: 0 0 8px 0;
    font-size: 1.4rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.edit-modal label {
    color: var(--accent);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 4px;
    display: block;
}

.edit-modal label[for="edit-goal-color"] {
    margin-bottom: -22px;
    margin-top: 0px;
}

.edit-modal .edit-color-picker {
    margin-top: 16px !important;
    margin-bottom: -10px !important;
}

.edit-modal input[type="text"],
.edit-modal input[type="number"] {
    width: 100%;
    padding: 10px 15px;
    margin-top: 4px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

.edit-modal input[type="text"]:focus,
.edit-modal input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(145, 70, 255, 0.2);
}

.edit-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

/* Confirm Delete Modal Styles */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10050;
    backdrop-filter: blur(2px);
}

.confirm-modal {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 24px 22px;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    min-width: 320px;
    max-width: 90vw;
}

.confirm-modal h3 {
    margin: 0 0 8px 0;
    color: var(--primary);
}

.confirm-modal .confirm-text {
    color: var(--accent);
    margin-bottom: 10px;
}

.confirm-modal .confirm-goal-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: var(--radius);
    margin-bottom: 14px;
}

.confirm-modal .goal-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--radius);
    font-size: 0.8rem;
}

.confirm-modal .goal-chip-text {
    color: var(--text);
}

.confirm-modal .confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}


.edit-modal .number-input-wrapper {
    height: 40px;
    display: inline-block;
}

.edit-modal .number-input-wrapper input[type="number"] {
    height: 40px;
    padding: 10px 15px;
    padding-right: 28px;
    box-sizing: border-box;
}

.edit-modal .quantity-nav {
    position: absolute;
    right: 0;
    top: 4px;
    height: 40px;
    width: 22px;
}

/* Overlay timer shown in bottom-left corner */
.mini-clock {
    position: absolute;
    left: 4.5%;
    bottom: calc(9.5% + 4px + 1rem);
        font-size: 1rem; /* Adjusted for better visibility */
    color: #fff;
    /* Apply SVG as full background with a dark overlay for contrast */
    background: linear-gradient(rgba(23, 7, 102, 0.9), rgba(26, 115, 243, 0.9));
    background-size: 100% 100%, cover;
    text-shadow: 0 1px 1px rgba(0,0,0,0.6);
    padding: 6px 18px 6px 56px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    z-index: 1201;
    font-family: 'Filson Soft';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Decorative moon (left) and stars (small dots) inside mini-clock */
.mini-clock::before {
    content: '🌙';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.65rem; /* slightly larger emoji */
    line-height: 1;
    filter: drop-shadow(0 1px 0 rgba(0,0,0,0.6));
    z-index: 1202;
}

/* Slight twinkle animation for stars (subtle) */
@keyframes twinkle {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50% { opacity: 0.7; transform: translateY(-1px); }
}
.mini-clock::after {
    /* Full-size star layer using the provided SVG so we can animate it (twinkle) */
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: url('stares.svg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    border-radius: inherit;
    z-index: 1200; /* below moon (1202) and text (1201) */
    opacity: 0.95;
    transform-origin: center center;
    /* subtle twinkle + gentle scale for life */
    animation: twinkle 2.2s ease-in-out infinite, mini-scale 6s ease-in-out infinite;
}

@keyframes mini-scale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.overlay-timer {
    position: absolute;
    left: 3.7%;
    bottom: 5.5%;
    font-size: 2.7rem;
    width: 135px;
    color: #d7ffd7;
    text-shadow: 0 1.5px 1.5px rgba(53, 91, 53, 0.4);
    padding: 8px 12px;
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    z-index: 1200;
    font-family: 'Filson Soft', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Decorative timer overlay image for OBS */
#timer-overlay-img {
    position: absolute;
    left: 0;
    bottom: 1.8%;
    width: 612px;
    pointer-events: none;
    user-select: none;
    z-index: 1199;
    image-rendering: optimizeQuality;
}

@media (max-width: 800px) {
    #timer-overlay-img {
        max-width: 28vw;
        max-height: 18vh;
        left: 6px;
    }

    /* Adjust mini clock placement on narrower viewports so it doesn't overlap the decorative image */
    .mini-clock {
        left: 6px;
        bottom: calc(5.5% + 32px);
        font-size: 0.95rem;
    }
}

/* Timer admin layout */
.timer-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.timer-input-group {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 44px;
}

.timer-input-group .timer-label {
    position: absolute;
    left: 0;
    bottom: 100%;
    transform: translateY(-6px);
    color: var(--accent);
    font-weight: 500;
}

.timer-input {
    height: 34px;
    align-self: flex-start;
}

.timer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    align-self: center;
}


.admin-section>.goal-form {
    margin-top: 24px !important;
}

.number-input-wrapper {
    position: relative;
    display: inline-block;
    width: 80px;
}

.number-input-wrapper input[type="number"] {
    width: 80px;
    padding-right: 28px;
    box-sizing: border-box;
}

.quantity-nav {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 22px;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 var(--radius) var(--radius) 0;
    overflow: hidden;
    z-index: 1;
}

.quantity-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text);
    border-radius: 0;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 10px;
    transition: background 0.2s;
}

.quantity-button:hover {
    background: rgba(255, 255, 255, 0.04);
}

.quantity-button.quantity-up {
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Reset Confirmation Modal Styles */
.reset-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.reset-modal {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 0;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: resetModalSlideIn 0.3s ease-out;
}

@keyframes resetModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.reset-modal-content {
    padding: 24px;
    text-align: center;
}

.reset-warning-icon {
    font-size: 48px;
    color: #ff6b35;
    margin-bottom: 16px;
    animation: resetWarningPulse 2s infinite;
}

@keyframes resetWarningPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.reset-modal h3 {
    color: var(--text);
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
}

/* Selective Reset Modal Styles */
.reset-header {
    text-align: center;
    margin-bottom: 24px;
}

.reset-icon {
    font-size: 32px;
    color: #3b82f6;
    margin-bottom: 12px;
}

.reset-subtitle {
    color: var(--accent);
    margin: 8px 0 0 0;
    font-size: 14px;
}

.reset-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.reset-option {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
}

.reset-option input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

.option-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.option-icon {
    color: var(--accent);
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.option-text strong {
    color: var(--text);
    font-size: 14px;
}

.option-text span {
    color: var(--accent);
    font-size: 12px;
    opacity: 0.8;
}

.reset-warning-text {
    color: var(--accent);
    text-align: left;
    margin-bottom: 24px;
    background: rgba(255, 107, 53, 0.1);
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #ff6b35;
}

.reset-warning-text p {
    margin-bottom: 12px;
}

.reset-warning-text ul {
    margin: 12px 0;
    padding-left: 20px;
}

.reset-warning-text li {
    margin-bottom: 8px;
    color: var(--text);
}

.reset-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.reset-modal-actions .btn {
    min-width: 140px;
    padding: 12px 20px;
    font-weight: 600;
    transition: all 0.2s ease;
}

#reset-confirm-btn {
    position: relative;
    overflow: hidden;
    background: #6c757d;
    border-color: #6c757d;
    transition: all 0.1s ease;
    cursor: pointer;
}

#reset-confirm-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

#reset-confirm-btn:not(.long-press-active):hover {
    background: #5a6268;
    border-color: #5a6268;
}

#reset-confirm-btn.long-press-active {
    transform: scale(0.98);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}



.reset-btn-text {
    position: relative;
    z-index: 1;
    color: white;
    font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .reset-modal {
        margin: 20px;
        max-width: none;
        width: calc(100% - 40px);
    }

    .reset-modal-content {
        padding: 20px;
    }

    .reset-modal-actions {
        flex-direction: column;
    }

    .reset-modal-actions .btn {
        width: 100%;
    }
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    --toggle-color: #555;
    position: relative;
    width: 40px;
    height: 22px;
    background-color: var(--toggle-color);
    border-radius: 11px;
    transition: background-color 0.3s;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: left 0.24s cubic-bezier(.4,0,.2,1);
    will-change: left;
}

.toggle-switch input:checked+.toggle-slider {
    --toggle-color: #7c25ff; /* on color */
    background-color: var(--toggle-color);
}

.toggle-switch input:checked+.toggle-slider:before {
    left: calc(100% - 20px);
}

/* Iconified toggle variant */
.toggle-slider--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}
.toggle-slider--icon .toggle-icon {
    position: absolute;
    top: 50%;
    left: 11px;
    transform: translate(-50%, -50%);
    font-size: 11px;
    color: var(--toggle-color);
    opacity: 0.85;
    transition: opacity 0.2s ease, left 0.24s cubic-bezier(.4,0,.2,1);
    z-index: 2; /* ensure above knob */
}
.toggle-slider--icon .toggle-icon--off { opacity: 1; }
.toggle-slider--icon .toggle-icon--on { opacity: 0; }
.toggle-switch input:checked + .toggle-slider--icon .toggle-icon--off { opacity: 0; }
.toggle-switch input:checked + .toggle-slider--icon .toggle-icon--on { opacity: 1; }
.toggle-switch input:checked + .toggle-slider--icon .toggle-icon { left: calc(100% - 11px); }

.toggle-label {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.toggle-help {
    color: rgba(255,255,255,0.6);
    font-size: 0.95rem;
    margin-left: 6px;
    position: relative;
    z-index: 3;
    cursor: help;
    pointer-events: auto;
}

/* Range slider styling: use --fill to tint the filled portion, default to --range-accent */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 6px;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    outline: none;
}

/* WebKit track */
input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 6px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    /* two-tone thumb: accent center with a thinner outer ring to mimic native look */
    background: radial-gradient(circle at 50% 50%, var(--fill, var(--range-accent)) 60%, #ffffff 61%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    margin-top: -6px; /* center thumb relative to track */
    border: 1px solid rgba(255,255,255,0.9);
}

/* Firefox track */
input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
}

input[type="range"]::-moz-range-progress {
    height: 6px;
    border-radius: 6px;
    background: var(--fill, var(--range-accent));
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, var(--fill, var(--range-accent)) 60%, #ffffff 61%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.9);
}

/* Focus state */
input[type="range"]:focus::-webkit-slider-thumb,
input[type="range"]:focus::-moz-range-thumb {
    box-shadow: 0 2px 10px rgba(124,37,255,0.28);
}

.overlay-settings-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 30px; /* overlay settings compact padding */
    margin: 8px 0 4px 0;
}

/* Timers row layout to match Goals/Overlay grouping */
.timers-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 8px;
}
.timer-card {
    flex: 1 1 320px;
}
.timer-row-inner {
    display: flex;
    padding: 20px 0px;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.overlay-settings-container .timer-row-inner {
    display: flex;
    padding: 40px 0px 0px 0px;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
/* Admin mini clock display reuse of existing timer style */
#admin-mini-clock-display {
    font-family: 'Filson Soft', sans-serif;
    font-weight: 800;
    color: white;
    background: rgba(0,0,0,0.18);
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
    margin-left: 6px;
}

@media (max-width: 900px) {
    .timers-row { flex-direction: column; }
}

/* Sleep timer specific padding (tighter than default overlay-settings) */
.overlay-settings-container.sleep-timer {
    padding: 34px 16px;
}

/* Custom select styling for overlay-position replacement */
.custom-select {
    position: relative;
    display: inline-block;
    max-width: 160px;
    font-family: inherit;
    font-size: 0.9rem;
}
.custom-select__trigger {
    background: var(--bg-primary);
    color: var(--accent);
    padding: 8px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.custom-select__trigger:after {
    content: none; /* hide default arrow */
}

.custom-select__chev {
    margin-left: 8px;
    font-size: 0.9rem;
    opacity: 0.9;
    transition: transform 160ms ease;
}
.custom-select.open .custom-select__chev {
    transform: rotate(180deg);
}
.custom-select__options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    background: #0e0f12;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.6);
    z-index: 60;
    max-height: 220px;
    overflow: auto;
    padding: 6px 6px;
}
.custom-select__option {
    padding: 8px 10px;
    color: var(--accent);
    cursor: pointer;
    border-radius: 4px;
}
.custom-select__option:hover,
.custom-select__option[aria-selected="true"] {
    background: rgba(255,255,255,0.02);
}
.custom-select__option[aria-selected="true"] {
    font-weight: 700;
}
.custom-select__option:focus {
    outline: 2px solid rgba(145,70,255,0.15);
}

.overlay-settings-container label {
    padding-top: 6px;
}

.overlay-settings-container h4 {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}


.overlay-settings-container .input-group {
    gap: 6px;
    margin-bottom: 5.6px;
}

.overlay-settings-container label {
    font-size: 0.92rem;
}

/* Two-column layout for goals management */
.goals-management-row {
    display: flex;
    gap: 24px;
    align-items: stretch; /* make columns equal height */
}

.goal-form-column {
    flex: 1;
    min-width: 0;
}

.goal-form-column, .overlay-settings-column {
    display: flex;
    flex-direction: column;
}

.overlay-settings-column {
    flex: 0 0 320px;
}

.overlay-actions {
    margin-top: 12px;
    margin-bottom: 4px;
    display: flex;
    justify-content: flex-start;
    margin-top: auto;
}

.overlay-actions .btn-block {
    width: 100%;
    max-width: none;
}

/* Goal form container styling */
.goal-form-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 12px; /* goals settings compact padding */
    margin: 8px 0 4px 0;
    position: relative; /* anchor absolutely-positioned */
}

.goal-form-container h4 {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

/* Reset Data button styling when placed under Goals Settings */
.goal-reset-row {
    margin-top: 12px;
    display: flex;
    justify-content: flex-start; /* keep left alignment within the container */
}

.goal-reset-row .btn-block {
    width: 100%;
    max-width: none;
}

/* goals settings spacing */
.goal-form-container .input-group {
    gap: 6px;
    margin-bottom: 8px;
}

.goal-form-container label {
    font-size: 0.92rem;
}

/* Responsive layout for smaller screens */
@media (max-width: 768px) {
    .goals-management-row {
        flex-direction: column;
        gap: 16px;
    }

    .overlay-settings-column {
        flex: 1;
    }
}

/* Compact Mode Styles */
.compact-section {
    position: fixed;
    z-index: 1000;
}

.display-container.compact-left .compact-section {
    position: fixed;
    left: 0.5%;
    top: 2%;
    bottom: 10% !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 8px;
    max-height: 800px;
}

.display-container.compact-right .compact-section {
    position: fixed;
    right: 0;
    top: 15vh;
    bottom: 0vh;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-right: 8px;
    max-height: calc(100vh - 4vh - 18.5vh);
}

.compact-goals {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}

.compact-goals-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: linear-gradient(0deg, #9146FF 0%, #FF3385 50%, #4ECDC4 100%);
}

.compact-subcount {
    font-family: 'Filson Soft', sans-serif;
    font-weight: 900;
    color: white;
    border-radius: var(--radius);
    font-variant-numeric: tabular-nums;
    font-size: 2rem;
    text-shadow: 1px 1px 2px black;
}

.compact-goal-item {
    border-radius: var(--radius);
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-shadow: 1px 1px 2px black;
    backdrop-filter: blur(10px);
    box-shadow: 0 3px 10px inherit;
    transition: all 0.3s ease;
    font-family: 'Filson Soft', sans-serif;
    container-type: size;
    container-name: goal-item;
}

.compact-goal-item.completed {
    opacity: 0.6;
}

.compact-goal-item.completed .compact-goal-text {
    text-decoration: line-through;
}

.compact-goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compact-goal-number {
    font-size: 1rem;
    font-weight: 900;
    top: -8px;
    left: -8px;
    rotate: calc(-4deg);
    color: white;
    position: absolute;
    text-shadow: 1px 1px 2px black;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 10px;
    border-radius: var(--radius);
}

.compact-goal-status {
    /* Compact-list status (default): size to content, minimal padding, no rotation */
    display: inline-flex;
    align-items: center;
    color: white;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
    position: static; /* default in-flow; absolute only in compact mode */
}

/* When the overlay is in compact mode, position the status badge top-right of each compact item */
.compact-section .compact-goal-status {
    /* Only position badges absolutely when they live inside the compact goals list */
    position: absolute;
    right: 2px;
    top: 2px;
}

.compact-goal-item.completed .compact-goal-status {
    color: #10b981;
}

.compact-goal-text {
    font-size: clamp(0.5rem, 12cqh, 0.95rem);
    font-weight: 700;
    text-align: center;
    padding-top: 2px;
    color: var(--accent);
    text-transform: uppercase;
    line-height: 1.2;
}

/* Shared styles for compact-goal-status in progress bar (both inside tooltip-content and as sibling)
   - Use the --compact-badge-bg variable (set from JS) as the background and also set as background property
*/
.progress-bar-container .tooltip-content .compact-goal-status,
.progress-bar-container > .compact-goal-status,
.progress-bar-container .badge-layer > .compact-goal-status {
    position: absolute;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2px; /* minimal padding so size matches content closely */
    text-transform: lowercase;
    width: auto; /* content-driven width */
    height: auto;
    min-width: 24px;
    min-height: 24px;
    border-radius: 6px; /* small rounding only */
    background: var(--compact-badge-bg, rgba(0, 0, 0, 0.85));
    box-shadow: 0 2px 6px rgba(0,0,0,0.24);
    border: 1px solid rgba(255,255,255,0.05);
    transform: rotate(4deg);
    box-sizing: border-box;
    overflow: visible;
    /* badge size variable for clamp() fallback */
    --badge-size: 34px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

/* Position-specific overrides */
.progress-bar-container .tooltip-content .compact-goal-status {
    /* place top-right inside the tooltip */
    top: calc(var(--badge-size) * -0.7);
    right: 6px;
    z-index: -30;
    /* enable container queries */
    container-type: size;
}

.progress-bar-container > .compact-goal-status {
    /* When appended as a direct child (sibling to tooltip-content) keep simple small rounding */
    border-radius: 6px;
    z-index: 15;
    transform: none;
    min-width: 0; /* allow to shrink to content size */
    height: auto;
    background-clip: padding-box;
}

/* Shared styles for status number and label */
/* Stronger selectors to ensure independent sizing for number and label */
.progress-bar-container .tooltip-content .compact-goal-status .tooltip-status-number,
.progress-bar-container > .compact-goal-status .tooltip-status-number,
.progress-bar-container .badge-layer > .compact-goal-status .tooltip-status-number {
    /* Larger number than label - keep scaling but prefer larger baseline */
    --d: max(1, min(3, var(--digits, 1)));
    font-size: clamp(12px, calc((var(--badge-size) / var(--d)) * 1.2), 24px);
    font-weight: 900;
    line-height: 1;
    color: white;
    text-align: center;
    width: 100%;
    white-space: nowrap;
}

/* Ensure per-digit slots are visible and inherit overlay typography */
.progress-bar-container .tooltip-status-number,
.progress-bar-container .tooltip-status-number * {
    color: inherit;
    font-family: inherit;
    font-weight: inherit;
}

.tooltip-status-number {
    display: inline-block;
    position: relative;
    line-height: 1;
    min-height: 1em;
    vertical-align: middle;
}

.tooltip-status-number .digit-slot {
    display: inline-block;
    position: relative;
    overflow: hidden;
    height: 1em;
    line-height: 1;
    min-width: 0.6em;
    vertical-align: middle;
}

.tooltip-status-number .status-digit {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    text-align: center;
    color: white;
    font-weight: 900;
}

.progress-bar-container .tooltip-content .compact-goal-status .tooltip-status-label,
.progress-bar-container > .compact-goal-status .tooltip-status-label,
.progress-bar-container .badge-layer > .compact-goal-status .tooltip-status-label {
    font-size: clamp(8px, calc(var(--badge-size) * 0.55), 10px);
    color: rgba(255,255,255,0.95);
    text-transform: lowercase;
    text-align: center;
    margin-top: -2px;
    width: 100%;
}

@container (max-width: 20px) {
    .progress-bar-container .tooltip-content .compact-goal-status .tooltip-status-number,
    .progress-bar-container > .compact-goal-status .tooltip-status-number,
    .progress-bar-container .badge-layer > .compact-goal-status .tooltip-status-number {
        font-size: 12px;
    }
    .progress-bar-container .tooltip-content .compact-goal-status .tooltip-status-label,
    .progress-bar-container > .compact-goal-status .tooltip-status-label,
    .progress-bar-container .badge-layer > .compact-goal-status .tooltip-status-label {
        font-size: 8px;
    }
}

@container (min-width: 21px) and (max-width: 30px) {
    .progress-bar-container .tooltip-content .compact-goal-status .tooltip-status-number,
    .progress-bar-container > .compact-goal-status .tooltip-status-number,
    .progress-bar-container .badge-layer > .compact-goal-status .tooltip-status-number {
        font-size: 16px;
    }
    .progress-bar-container .tooltip-content .compact-goal-status .tooltip-status-label,
    .progress-bar-container > .compact-goal-status .tooltip-status-label,
    .progress-bar-container .badge-layer > .compact-goal-status .tooltip-status-label {
        font-size: 9px;
    }
}

.compact-goal-item.locked .compact-goal-text {
    filter: blur(4px);
    color: #aaa;
    user-select: none;
}

/* Completed tooltip content: cross text and fade */
.tooltip-content.completed {
    opacity: 0.75;
    transition: opacity 420ms ease, color 420ms ease;
}
.tooltip-content.completed .tooltip-text {
    text-decoration: line-through;
    opacity: 0.6;
    transition: opacity 420ms ease;
}

.compact-goal-item.locked .compact-goal-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
    z-index: 30;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    opacity: 0.85;
}

.compact-goal-item {
    position: relative;
}

/* Hide progress section in compact mode */
.display-container.compact-left .progress-section,
.display-container.compact-right .progress-section {
    display: none;
}

/* Admin Panel Styles */
#progress-visibility {
    padding-top: 10px;
}

#position-group {
    transition: opacity 0.3s ease;
}

#progress-opacity-value, #progress-scale-value {
    background-color: var(--range-accent);
    padding: 4px;
    border-radius: 4px;
}

/* Pop animation for status number when it changes */
@keyframes status-pop {
    0% { transform: scale(1); }
    30% { transform: scale(1.35); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.tooltip-status-number.status-pop {
    animation: status-pop 480ms cubic-bezier(.2,.8,.2,1) both;
    will-change: transform;
}

/* Vertical roll animation: old digit moves up, new digit comes from bottom */
.tooltip-status-number {
    position: relative;
    overflow: hidden;
    line-height: 1;
}
.tooltip-status-number .status-digit {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    transform: translateY(0);
    transition: transform 420ms cubic-bezier(.2,.8,.2,1), opacity 260ms ease;
}
.tooltip-status-number .roll-enter {
    transform: translateY(100%);
    opacity: 0.01;
}
.tooltip-status-number .roll-enter.roll-enter-active {
    transform: translateY(0);
    opacity: 1;
}
.tooltip-status-number .roll-exit {
    transform: translateY(0);
    opacity: 1;
}
.tooltip-status-number .roll-exit.roll-exit-active {
    transform: translateY(-100%);
    opacity: 0.01;
}

/* Zero exit: small bounce then slide down and fade out */
@keyframes badge-exit-bounce {
    0% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
    60% { transform: translateY(3px); }
    100% { transform: translateY(100%); opacity: 0; }
}

.compact-goal-status.exit-zero {
    animation: badge-exit-bounce 560ms cubic-bezier(.2,.8,.2,1) forwards;
}

/* Animated show/hide for mini-clock */
.mini-clock {
    transition: opacity 220ms cubic-bezier(.2,.9,.2,1), transform 220ms cubic-bezier(.2,.9,.2,1);
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    visibility: hidden;
    pointer-events: none;
}
.mini-clock.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    pointer-events: auto;
}