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

@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;
}

/* Local overlay fonts (Filson Soft) */
@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,
.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;
}

/* Subscriber progress styles removed */

/* Ensure workout overlay blocks expand/collapse downward (pure CSS fix) */
#exercises-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* keep blocks anchored to the top */
}

#exercises-container .workout-exercise-block {
    display: block;
    overflow: hidden; /* ensure max-height clipping */
    transform-origin: top center; /* animate from the top so it grows downward */
    will-change: max-height, opacity;
        transition: max-height 350ms ease, opacity 220ms ease, background-color 220ms ease;
}

/* Overlay exercise styles remain above. Drag-drop for overlay removed; admin still supports reorder. */

/* Admin goals list drag handle */
.goal-item-admin .drag-handle {
    display: inline-block;
    width: 20px;
    text-align: center;
    margin-right: 8px;
    cursor: grab;
    color: var(--accent);
    font-weight: 700;
}
.goal-item-admin .drag-handle:active { cursor: grabbing; }
.goal-item-admin.dragging { opacity: 0.65; }
.goal-item-admin.drop-target { outline: 2px dashed var(--range-accent); outline-offset: 6px; }

#exercises-container .workout-exercise-block .workout-exercise-title {
    display: block;
}

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

/* Progress visuals removed */

.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 */


.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);
}

.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;
}

.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);
}

/* removed .goal-sub pill styles */

.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 {
    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;
    }

    /* Removed edit-modal responsive rules */
}

/* 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;
}

/* removed .goal-sub typography styles */

/* Confirm Delete Modal Styles (restored) */
.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);
    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;
}


/* Removed legacy edit-modal specific number input styling */


.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;
}

.unit-label {
    font-size: 12px;
    color: var(--text);
    margin-left: 4px;
}

.input-with-label {
    display: flex;
    align-items: center;
}

/* 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);
}

/* Warning variant for destructive reset option */
.reset-option.warning {
    background: rgba(255, 107, 53, 0.06);
    border-color: rgba(255, 107, 53, 0.15);
}
.reset-option.warning .option-icon {
    color: #ff6b35;
}

.reset-option input[type="checkbox"], .reset-option input[type="radio"] {
    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: transparent; /* track painted in pseudo or via gradient */
    outline: none;
    /* expose thumb sizing for JS and consistent styling */
    --range-thumb-size: 18px;
}

/* WebKit track */
input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 6px;
    /* Draw filled portion via gradient; --pct set by JS (e.g. '40%') */
    background: linear-gradient(to right, var(--fill, var(--range-accent)) 0%, var(--fill, var(--range-accent)) var(--pct, 0%), rgba(255,255,255,0.06) var(--pct, 0%));
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: var(--range-thumb-size);
    height: var(--range-thumb-size);
    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);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

/* 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: var(--range-thumb-size);
    height: var(--range-thumb-size);
    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);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

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

/* 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);
    border: 1px solid rgba(255,255,255,0.9);
}

/* Thumb-only hover styles (vendor-prefixed) */
input[type="range"]::-webkit-slider-thumb:hover,
input[type="range"].thumb-hover::-webkit-slider-thumb {
    transform: scale(1.12);
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    /* stronger accent on hover */
    background: radial-gradient(circle at 50% 50%, var(--fill, var(--range-accent)) 68%, #ffffff 69%);
}

input[type="range"]::-moz-range-thumb:hover,
input[type="range"].thumb-hover::-moz-range-thumb {
    transform: scale(1.12);
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    background: radial-gradient(circle at 50% 50%, var(--fill, var(--range-accent)) 68%, #ffffff 69%);
}

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


/* 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;
    /* allow wider labels (demo video names) while keeping a sane max */
    min-width: 180px;
    max-width: 320px;
    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;
}

/* Make overlay/settings panels responsive on narrow viewports (mobile) */
@media (max-width: 600px) {
    /* ensure panels never exceed the viewport width when opened inline */
    .overlay-settings-column {
        flex: 1 1 100%;
        min-width: 0;
    }
    .overlay-settings-container,
    #wo-panel,
    .overlay-settings-column .overlay-settings-container {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        padding-left: 12px;
        padding-right: 12px;
        margin-left: 0;
        margin-right: 0;
    }
    /* Make sets list collapse to a single column on small screens to avoid overflow */
    .wo-sets-list {
        grid-template-columns: 1fr;
        gap: 8px 6px;
    }
    .wo-set-row { display: block; }
}

.overlay-actions {
    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 removed (cleaned up). Reintroduce scoped compact styles
   only if you re-enable compact/display-mode behavior. */

.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/progress related styles removed. */
/* If you want to preserve some compact-badge visuals in the future,
   reintroduce a small scoped block rather than the global compact feature. */
.workout-overlay {
    position: fixed;
    left: 10%;
    top: 25%;
    /* Only center horizontally; don't translate vertically so the box
       is anchored from the top (prevents it growing beyond the viewport) */
    transform: translateX(-50%) scale(var(--wo-scale, 1));
    border-radius: 14px;
    padding: 18px 22px;
    min-width: 380px;
    max-width: 500px;
    color: #fff;
    font-family: 'Filson Soft', sans-serif;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.workout-exercises-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 350px;
    min-width: 350px;
    filter: blur(0);
    transition: transform 700ms cubic-bezier(.2,.9,.25,1), filter 900ms cubic-bezier(.22,.85,.28,1), opacity 420ms ease;
}

/* Generic rule to blur exercises container when summary is open (both sides) */
.workout-exercises-container.summary-open {
    filter: blur(5px);
}

/* Align inner exercise blocks to the overlay edge depending on overlay position */
.workout-overlay.wo-pos-left .workout-exercises-container { align-items: flex-start; }
.workout-overlay.wo-pos-right .workout-exercises-container { align-items: flex-end; }

.workout-exercise-block {
    position: relative; /* allow absolutely-positioned badges inside the block */
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    animation: box-ani 3s infinite;
    background: linear-gradient(135deg, rgba(20,20,26,0.9), rgba(35,35,44,0.9));
    border-radius: 16px 8px;
    border: 3px solid var(--wo-accent, rgba(255,255,255,0.06))
}

@keyframes box-ani {
    0% {
        box-shadow: inset 0 0 26px -8px var(--wo-accent);
    }
    50% {
        box-shadow: inset 0 0 32px -4px var(--wo-accent);
    }
    100% {
        box-shadow: inset 0 0 26px -8px var(--wo-accent);
    }
}

.workout-exercise-title {
    font-weight: 700;
    font-size: 1.4rem;
    text-transform: capitalize;
    line-height: 1.1;
    color: var(--wo-accent, #4ECDC4);
    margin-bottom: 4px;
    position: relative; /* allow pseudo-element strike-through */
}

/* Badge shown in the top-left of pinned exercise blocks to indicate the current set */
.workout-current-badge {
    position: absolute;
    /* user requested negative offset so the badge overlaps the block border */
    top: -15px;
    right: -15px;
    background: var(--wo-accent, #4ECDC4);
    color: #fff;
    padding: 6px 8px;
    border-radius: 8px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.45);
    transform: rotate(-4deg);
    font-weight: 800;
    font-size: 0.75rem;
    line-height: 1;
    pointer-events: none; /* decorative only */
}

.workout-current-badge .badge-label {
        text-transform: uppercase;
        font-size: 1rem;
        opacity: 0.95;
        letter-spacing: 0.6px;
}

/* Badge animation (used for 'finished' and 'in progress' badges) */
@keyframes badge-wiggle {
    from {
        transform: scale3d(1, 1, 1);
    }

    10%, 20% {
        transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg);
    }

    30%, 50%, 70%, 90% {
        transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
    }

    40%, 60%, 80% {
        transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
    }

    to {
        transform: scale3d(1, 1, 1);
    }
}

/* Entry animation (short, runs once) */
.workout-current-badge.wiggle-enter {
    animation: badge-wiggle 640ms cubic-bezier(.2,.9,.2,1) both;
}

/* Occasional wiggle applied when the .wiggle-active class is toggled */
.workout-current-badge.wiggle-active {
    animation: badge-wiggle 640ms cubic-bezier(.2,.9,.2,1) both;
}

/* Apply the same badge animation to finished badges so they use the new sequence */
.workout-current-badge.finished-badge {
    animation: badge-wiggle 900ms cubic-bezier(.2,.9,.2,1) both;
}

.workout-current-badge .badge-number {
    font-size: 0.95rem;
    margin-top: 2px;
    font-weight: 900;
}

/* Demo video attached to a newly-pinned exercise */
.pin-demo-video {
    position: sticky;
    top: 0;
    right: -20%;
    width: 260px;
    height: auto;
    border-radius: 8px;
    border-color: var(--wo-accent, #4ECDC4);
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    z-index: 8;
    pointer-events: none;
    background: black;
}

/* Allow the badge to sit outside the block (negative offsets) without
   being clipped. The global rule that sets overflow:hidden on exercise
   blocks would otherwise clip the badge; only enable overflow:visible
   for blocks that actually have the badge to avoid affecting animations. */
#exercises-container .workout-exercise-block.has-current-badge {
    overflow: visible;
}

/* When the overlay is anchored to the right, flip the current-badge so it
   overlaps the block toward the outside (left side) instead of the right. */
.workout-overlay.wo-pos-right .workout-current-badge {
    right: auto;
    left: -15px;
    transform: rotate(4deg);
}

/* Ensure left-anchored overlay keeps the badge on the right as before */
.workout-overlay.wo-pos-left .workout-current-badge {
    left: auto;
    right: -15px;
    transform: rotate(-4deg);
}

/* Mirror internal layout when overlay is anchored to the right */
.workout-overlay.wo-pos-right .workout-exercises-container,
.workout-overlay.wo-pos-right .workout-exercise-block {
    align-items: flex-end;
}
.workout-overlay.wo-pos-right .workout-exercises-container {
    /* allow the container to shrink to its content so align-items:flex-end
       actually moves children to the overlay's right edge instead of
       leaving them at a fixed 350px width */
    min-width: 0;
    width: auto;
}
.workout-overlay.wo-pos-right .workout-exercise-block {
    /* let blocks size to contents and align to the right edge */
    width: auto;
    max-width: 350px;
    align-self: flex-end;
}
.workout-overlay.wo-pos-right .workout-exercise-block {
    text-align: right;
}
.workout-overlay.wo-pos-right .workout-exercise-title {
    text-align: right;
}
.workout-overlay.wo-pos-right .workout-sets-indicators {
    justify-content: flex-end;
}
.workout-overlay.wo-pos-right .workout-set-detail-row {
    flex-direction: row-reverse;
}
.workout-overlay.wo-pos-right .set-actions {
    right: auto;
    left: -10px;
}
.workout-overlay.wo-pos-right .workout-sets-details {
    align-items: flex-end;
}

/* Demo host overlay badge (matches workout-current-badge visuals but
   positioned relative to the demo video host so it sits over the video) */
.overlay-pin-video-host {
    position: fixed; /* host is positioned/ sized inline by JS, keep baseline here */
    pointer-events: none;
    z-index: 9999;
}

.overlay-pin-badge {
    position: absolute;
    /* Slightly smaller negative offsets so badge sits closer to the video corner */
    top: -10px;
    right: -10px;
    background: var(--wo-accent, #4ECDC4);
    color: #fff;
    padding: 6px 8px;
    border-radius: 8px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.45);
    /* gentler rotation to reduce visual tilt */
    transform: rotate(-2deg);
    font-weight: 800;
    font-size: 0.75rem;
    /* Ensure the badge uses the overlay's Filson Soft family */
    font-family: 'Filson Soft', sans-serif;
    line-height: 1;
    pointer-events: none;
}

.overlay-pin-badge {
    text-transform: uppercase;
    font-size: 1rem;
    opacity: 0.95;
    letter-spacing: 0.6px;
}

/* Upcoming badge variant: different accent color and slightly different tilt/offset */
.overlay-pin-badge.upcoming-badge {
    /* Upcoming badge: prefer --wo-upcoming-color, fallback to an explicit orange */
    background: var(--wo-upcoming-color, #FF8C00);
    transform: rotate(-2deg);
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    top: -8px;
    right: -8px;
    z-index: 9999;
    font-family: 'Filson Soft', sans-serif;
    font-weight: 800;
}

.overlay-pin-badge.wiggle-enter { animation: badge-wiggle 640ms cubic-bezier(.2,.9,.2,1) both; }
.overlay-pin-badge.wiggle-active { animation: badge-wiggle 640ms cubic-bezier(.2,.9,.2,1) both; }
.overlay-pin-badge.finished-badge { animation: badge-wiggle 900ms cubic-bezier(.2,.9,.2,1) both; }

/* Persisted finished badge (shown after unpin) should be slightly smaller and faded */
.workout-current-badge.persisted-badge {
    transform: scale(0.82);
    pointer-events: none;
    filter: grayscale(28%);
    transform: rotate(-2deg) !important;
}

.workout-progress-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative; /* container now hosts absolute boat so it won't be clipped */
}

.workout-progress-bar {
    width: 100%;
    height: 24px;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden; /* keep fill clipped */
}

.workout-progress-fill {
    height: 100%;
    background: var(--wo-accent, #4ECDC4);
    border-radius: 12px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(var(--wo-accent-rgb, 78,205,196), var(--wo-accent-alpha, 0.4));
}

.workout-progress-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.9);
    text-align: center;
}

/* Boat (moving mascot) shown on progress bar start and moves with progress */
.workout-boat {
        position: absolute;
        top: 50%;
        left: 0%;
        transform: translate(-100%, -50%);
        width: 48px;
        height: auto;
        pointer-events: none;
        transition: left 0.45s cubic-bezier(0.4,0,0.2,1), transform 0.45s ease;
        z-index: 8;
        filter: drop-shadow(0 4px 6px rgba(0,0,0,0.45));
        will-change: left, transform;
}

/* subtle bobbing animation to give life to the boat */
@keyframes boat-bob {
    0% { transform: translate(-100%, -52%); }
    50% { transform: translate(-100%, -48%); }
    100% { transform: translate(-100%, -52%); }
}
.workout-boat.bobbing { animation: boat-bob 2.6s ease-in-out infinite; }

/* keep boat visible when progress is near 0 or 100 by clamping position visually */
.workout-progress-bar { position: relative; }

.workout-sets-indicators {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* In overlay, set indicators are not interactive; disable pointer events */
.workout-sets-indicators { pointer-events: none; }
.workout-set-indicator { pointer-events: none; cursor: default; }

.workout-set-indicator {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255,255,255,0.6);
}

.workout-set-indicator:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.workout-set-indicator.completed {
    background: var(--wo-accent, #4ECDC4);
    border-color: var(--wo-accent, #4ECDC4);
    color: #fff;
    /* Use the per-block RGB parts plus an adjustable alpha variable
       (--wo-accent-rgb and --wo-accent-alpha) so scripts can control
       the translucent glow independently of the main accent color. */
    box-shadow: 0 0 8px rgba(var(--wo-accent-rgb, 78,205,196), var(--wo-accent-alpha, 0.5));
    /* Ensure the completed state shows a visible strike-through on the number */
    text-decoration: line-through;
    text-decoration-color: rgba(255,255,255,0.95);
    text-decoration-thickness: 2px;
}

.workout-set-indicator.completed:hover {
    background: color-mix(in oklab, var(--wo-accent, #4ECDC4), #fff 20%);
}

.workout-sets-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.workout-set-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(var(--wo-accent-rgb, 255,255,255 ), 0.5);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    transition: all 0.2s ease;
}

.workout-set-detail-row.completed {
    /* Use the per-block --wo-accent color converted to a translucent
       background. Fallback to a soft accent tint if color-mix isn't supported. */
    background: rgba(78, 205, 196, 0.1);
    background: color-mix(in srgb, var(--wo-accent) 30%, rgba(0 0 0 / 0));
    border-color: color-mix(in srgb, var(--wo-accent) 60%, rgba(0 0 0 / 0));
}

.set-detail-number {
    font-weight: 800;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
}

.workout-set-detail-row.completed .set-detail-number {
    color: var(--wo-accent, #4ECDC4);
}

.set-detail-info {
    font-weight: 700;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.9);
}

/* Make FA icons inside workout blocks pick up the block's accent color */
.workout-exercise-block .weight-icon,
.workout-exercise-block .reps-icon {
    margin-right: 6px;
    color: var(--wo-accent, #4ECDC4);
}

.set-times {
    opacity: 0.85;
    margin: 0 6px;
}

/* Make the multiplication '×' more prominent between reps and weight */
.workout-exercise-block .set-times {
    font-size: 1.25rem; /* larger than surrounding text */
    font-weight: 700;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    margin: 0 8px;
    color: rgba(255,255,255,0.9);
}

.workout-exercise {
    font-weight: 900;
    font-size: 2rem;
    line-height: 1.1;
    margin-bottom: 12px;
}

.workout-sets-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workout-set-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
}

/* allow absolute-positioned actions inside each set */
.workout-set-item {
    position: relative;
}

.workout-set-number {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent);
    min-width: 60px;
}

.workout-set-details {
    font-weight: 700;
    font-size: 1rem;
    text-align: right;
    flex: 1;
}

/* Circle badge for first set */
.set-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--wo-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    margin-right: 12px;
    min-width: 36px;
}

/* Icon styles */
.workout-exercise i {
    color: var(--accent);
    font-size: 1.1rem;
}
.weight-icon {
    margin: 0 6px;
    color: var(--accent);
}

/* Reps (dumbbell) icon styling */
.reps-icon {
    margin-right: 8px;
    color: var(--accent);
}

/* Top-right action buttons (check / reject) */
.set-actions {
    position: absolute;
    top: -10px;
    right: -10px;
    display: flex;
    gap: 6px;
    z-index: 5;
}
.set-action {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    transition: transform 120ms ease, opacity 120ms ease;
}
.overlay-pin-video-host {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    display: block;
}
.set-action:active { transform: scale(0.95); }
.set-action.check { background: #16a34a; /* green */ }
.set-action.reject { background: #dc2626; /* red */ }
.set-action i { font-size: 14px; }

/* Visual states when toggled */
.workout-set-item.set-state-checked {
    border-color: rgba(22,163,74,0.7);
    background: rgba(22,163,74,0.08);
}
.workout-set-item.set-state-rejected {
    border-color: rgba(220,38,38,0.7);
    background: rgba(220,38,38,0.06);
}

/* Single toggle button styles */
.set-action.toggle {
    width: 25px;
    height: 25px;
    padding: 0;
    background: rgba(255,255,255,0.06);
}
.set-action.toggle.checked { background: #16a34a; }
.set-action.toggle.rejected { background: #dc2626; }
.set-action.toggle i { font-size: 16px; color: #fff; }

/* Admin per-set toggle button */
.wo-set-toggle {
    margin-right: 8px;
    background: transparent;
    color: var(--text);
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 8px;
    transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease, background 120ms ease;
    cursor: pointer;
}
.wo-set-toggle i { font-size: 14px; line-height: 1; }

/* Visual cues for admin toggle */
.wo-set-toggle.done { background: #31b387; color: #fff; }
.wo-set-toggle.done:hover { filter: brightness(0.92); transform: scale(1.06); box-shadow: 0 6px 14px rgba(49,179,135,0.18); }
.wo-set-toggle:not(.done) { background: #f25d49; color: #fff; }
.wo-set-toggle:not(.done):hover { filter: brightness(1.03); transform: scale(1.08); box-shadow: 0 8px 18px rgba(242,93,73,0.18); }

/* Make the X (icon) slightly larger and bolder for better readability */
.wo-set-toggle:not(.done) i { font-size: 16px; font-weight: 700; }
.wo-set-toggle.done i { font-size: 14px; font-weight: 700; }

/* Accent ring (optional) via CSS variable --wo-accent */
.workout-overlay {
    --wo-accent: #7c25ff;
}
.workout-overlay::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: radial-gradient(120% 120% at 0% 0%, color-mix(in oklab, var(--wo-accent), transparent 70%), transparent 60%),
                radial-gradient(120% 120% at 100% 100%, color-mix(in oklab, var(--wo-accent), transparent 70%), transparent 60%);
    filter: blur(16px);
    opacity: 0.25;
    z-index: -1;
}

/* Position helpers for the workout box */
.wo-top-left    { left: 2%;  top: 3%;  transform: translate(0,0); }
.wo-top-right   { right: 2%; top: 3%;  left: auto; transform: translate(0,0); }
.wo-bottom-left { left: 2%;  bottom: 3%; top: auto; transform: translate(0,0); }
.wo-bottom-right{ right: 2%; bottom: 3%; left: auto; top: auto; transform: translate(0,0); }

/* Simple left/right position helpers controlled by classes (preferred over JS inline styles) */
.workout-overlay.wo-pos-left {
    left: 12px !important;
    right: auto !important;
    transform: none !important; /* remove centering translate so left anchor works */
}
.workout-overlay.wo-pos-right {
    right: 12px !important;
    left: auto !important;
    transform: none !important;
}

/* Admin: Sets Plan lightweight layout */
.wo-sets-list {
    display: grid;
    grid-template-columns: minmax(64px, 90px) 1fr 1fr auto;
    gap: 8px 10px;
    align-items: center;
}
.wo-set-row {
    display: contents; /* let children align to grid columns */
}
.wo-set-label {
    color: var(--accent);
    opacity: 0.9;
}
.wo-row-controls {
    display: flex;
    gap: 6px;
}
.wo-row-controls .btn {
    padding: 8px;
    font-size: 0.85rem;
}

/* Collapsible workout panel slide animation */
.wo-collapsible {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    transition: max-height 260ms cubic-bezier(.2,.9,.2,1), opacity 180ms ease, transform 180ms ease;
}
.wo-collapsible.open {
    opacity: 1;
    transform: translateY(0);
}

/* Note shown on overlay when a goal is pinned; appears briefly then fades to details */
.workout-note {
    padding: 10px 14px;
    background: rgba(0,0,0,0.5);
    border-radius: 8px;
    font-size: 18px;
    line-height: 1.3;
    color: #fff;
    margin-top: 8px;
    max-width: 720px;
    opacity: 1;
    transition: opacity 300ms ease;
}

/* Cleanup override: hide legacy subscriber-progress UI elements. Note: workout
   progress elements are intentionally preserved so in-workout progress bars
   continue to function. */
.progress-section,
.progress-bar-container,
.progress-bar,
.compact,
.compact .progress-section,
.compact .progress-bar-container,
.compact .progress-count {
    display: none !important;
}

/* Visual treatment for fully-completed exercise blocks shown on overlay */
.workout-exercise-block.completed .workout-exercise-title {
    /* keep the original accent color for the title but make it slightly dimmer
       so it matches the rest of the completed state's muted appearance */
    color: var(--wo-accent, #4ECDC4);
    text-decoration: none; /* strike drawn via ::after */
    opacity: 0.7; /* slightly dimmer than full-bright title */
}
.workout-exercise-block.completed .workout-sets-indicators,
.workout-exercise-block.completed .workout-sets-details,
.workout-exercise-block.completed .workout-note {
    opacity: 0.7;
    color: rgba(255,255,255,0.78);
}
.workout-exercise-block.completed .workout-sets-indicators .workout-set-indicator {
    opacity: 0.7;
}
.workout-exercise-block.completed .workout-exercise-title::after {
    /* custom colored strike line that spans the full title width */
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 3px;
    background: rgba(255,255,255,0.95);
    transform: translateY(-50%);
    pointer-events: none;
}
.workout-exercise-block.completed .workout-sets-indicators .workout-set-indicator {
    opacity: 0.7;
}

/* Faded state for pinned-but-finished exercises: visually muted but
   do NOT strike through title or note. Use alongside finished badge. */
.workout-exercise-block.faded {
    opacity: 0.72;
    filter: grayscale(28%);
}
.workout-exercise-block.faded .workout-exercise-title {
    text-decoration: none;
    opacity: 0.9;
    color: var(--wo-accent, rgba(255,255,255,0.9));
}
.workout-exercise-block.faded .workout-sets-indicators .workout-set-indicator {
    opacity: 0.85;
}

/* Workout History Styles */
#workout-history-container {
    max-height: 600px;
    overflow-y: auto;
}

.history-summary-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--accent);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-badge i {
    color: var(--primary);
    font-size: 0.85rem;
}

.history-date-section {
    margin-bottom: 30px;
}

.history-date-header {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background 0.2s ease;
}

.history-date-header:hover {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    /* Don't change layout on hover: use transform + box-shadow instead */
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.history-date-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.history-date-header h3 {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.collapse-icon {
    color: var(--primary);
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.history-date-header i {
    color: var(--range-accent);
}

.history-date-stats {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.history-date-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-date-stats i {
    color: var(--primary);
    font-size: 0.85rem;
}

.history-workouts-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.history-workouts-list.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

@media (max-width: 1400px) {
    .history-workouts-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .history-workouts-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .history-workouts-list {
        grid-template-columns: 1fr;
    }
}

.history-workout-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 6px 6px 0;
    padding: 15px;
    border-left: 4px solid var(--range-accent);
    transition: all 0.2s ease;
}

.history-workout-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.history-workout-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 12px;
}

.history-workout-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.history-workout-title strong {
    color: var(--accent);
    font-size: 1.05rem;
}

.history-set-count {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-weight: normal;
}

.history-workout-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.history-workout-time {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.history-workout-duration {
    color: var(--primary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.history-workout-duration i {
    font-size: 0.8rem;
}

.history-workout-note {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.history-workout-sets {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-set {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    font-size: 0.95rem;
}

.history-set-label {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    min-width: 60px;
}

.history-set-data {
    color: var(--accent);
    font-weight: 500;
}

.history-kg-value {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Scrollbar styling for history container */
#workout-history-container::-webkit-scrollbar {
    width: 8px;
}

#workout-history-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

#workout-history-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#workout-history-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Workout Summary Overlay */
.workout-summary-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    /* allow a subtle backdrop that we animate via backdrop-filter */
    background: rgba(0,0,0,0.0);
    backdrop-filter: blur(0px) saturate(1);
    display: none;
    align-items: flex-end; /* stick to bottom */
    justify-content: center; /* centered horizontally */
    padding: 16px 16px 24px; /* breathing room at bottom */
    z-index: 10000;
    opacity: 0;
    pointer-events: none; /* let clicks pass through backdrop until shown */
    transition: opacity 300ms ease, backdrop-filter 900ms cubic-bezier(.22,.85,.28,1), background 300ms ease;
    perspective: 900px; /* enable 3D perspective for child transforms */
}

.workout-summary-overlay.show {
    opacity: 1;
    background: rgba(0,0,0,0.18);
    backdrop-filter: blur(3px) saturate(1.02);
    pointer-events: auto; /* allow interactions on the summary */
}

/* When summary is displayed, rotate the workout box slightly in 3D
   and slide the summary card so it appears to come from behind it */
/* Summary open 3D treatment. We need position-specific rules because
   `.wo-pos-left` / `.wo-pos-right` set `transform: none !important` elsewhere. */
.workout-overlay .workout-exercises-container.summary-open {
    filter: saturate(1.02);
}

/* Left-positioned overlay: tilt the exercises container so summary can appear to the right */
.workout-overlay.wo-pos-left .workout-exercises-container.summary-open {
    transform-origin: left center !important;
    transform: perspective(900px) rotateY(50deg) scale(0.98) !important;
    opacity: 0.9;
    filter: blur(5px);
}

/* Right-positioned overlay: tilt the exercises container so summary can appear to the left */
.workout-overlay.wo-pos-right .workout-exercises-container.summary-open {
    transform-origin: right center !important;
    transform: perspective(900px) rotateY(22deg) translateX(80px) scale(0.98) !important;
}

/* Summary content starts offset depending on overlay side so it looks like
   it slides out from behind the workout box toward the visible area. */
.workout-overlay.wo-pos-left .summary-content,
.workout-overlay.wo-pos-right .summary-content {
    transform: translateY(60px) translateX(0) translateZ(-50px) scale(0.98);
    opacity: 0;
    /* start slightly blurred; we'll animate to 0 when shown */
    filter: blur(5px);
    transition: transform 700ms cubic-bezier(.2,.9,.25,1), opacity 420ms ease, filter 900ms cubic-bezier(.22,.85,.28,1);
}

/* Final visible state: summary content animates into place when its overlay is shown */
.workout-summary-overlay.show .summary-content {
    transform: translateY(0) translateX(0) translateZ(0) scale(1) !important;
    opacity: 1 !important;
    filter: blur(0px) !important;
}

.summary-content {
    --summary-z: -80px;
    --summary-prefer-left: 150px; /* preferred left position when showing summary */
    transform-style: preserve-3d;
    max-width: 360px;
    width: min(340px, 95%);
    padding: 10px 12px;
    background: linear-gradient(0deg,rgba(26, 26, 29, 0.92) 0%, rgba(26, 26, 29, 0) 85%);
    border-radius: 12px;
    animation: summarySlideUp 0.45s ease-out;
    pointer-events: auto; /* allow interactions on the card */
}

@keyframes summarySlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.summary-header {
    text-align: center;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.summary-header .boat-icon {
    width: 90px;
    font-weight: 800 !important;
    height: auto;
    animation: trophyBounce 1s ease-in-out infinite alternate; /* reuse bounce */
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35));
}

@keyframes trophyBounce {
    from { transform: translateY(0px); }
    to { transform: translateY(-10px); }
}

/* Pulsing scale used while animating numbers */
@keyframes pulseScale {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.pulse-anim {
    animation: pulseScale 600ms ease-in-out infinite;
}

.summary-header h2 {
    font-size: 1.6rem;
    line-height: 1.05;
    background: linear-gradient(90deg, #9146FF, #4ECDC4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    font-weight: 800;
}

.summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    justify-content: center; /* center the stats row */
    align-items: stretch; /* make child stats match height if needed */
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 8px;
    background: rgba(15, 13, 19, 0.516);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    transition: all 0.25s ease;
    width: 120px; /* fixed width so each stat block is same size */
    flex: 0 0 120px;
}

.summary-stat i {
    display: inline-block;
    font-size: 1.4rem;
    color: var(--primary);
     text-shadow: 1px 1px 2px black;
    margin-right: 8px;
}

.summary-stat .stat-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.summary-stat .stat-label {
    width: 100%;
    text-align: center;
    margin-top: 6px;
}

.summary-stat.pr-stat i {
    color: #FFD700;
}

.pr-gain {
    color: #FFD700;
}

/* Boat stat color coding */
.summary-stat.boat-stat.low .stat-value {
    color: var(--success);
}
.summary-stat.boat-stat.mid .stat-value {
    color: #FFD700;
}
.summary-stat.boat-stat.high .stat-value {
    color: #FF4D4D; /* red */
}

/* Funny small label above the boat label */
.summary-stat .stat-label { display: flex; flex-direction: column; gap: 2px; }
.summary-stat .funny-label { font-size: 0.75rem; color: rgba(255,255,255,0.75); font-weight: 700; }
.summary-stat .boat-label { font-size: 0.8rem; color: rgba(255,255,255,0.6); }

.stat-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Ensure the icon vertically centers with the value+label column */
.summary-stat .stat-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-stat .stat-label {
    margin-top: 2px; /* tighten spacing so value and label are compact */
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
     text-shadow: 1px 1px 2px black;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
     text-shadow: 1px 1px 2px black;
}

.summary-muscles {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: 0;
}

/* Center the muscles section horizontally and center its child chips */
.summary-muscles {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.muscles-list {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.muscles-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
}

.muscles-header i {
    color: #FF6B35;
    font-size: 1.5rem;
}

.muscles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.muscle-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px; /* chip */
}

.muscle-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
}

.muscle-bar { display: none; }

.muscle-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 6px;
    transition: width 1s ease-out;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.muscle-bonus {
    font-size: 0.85rem;
    color: #FF6B35;
    font-weight: 700;
    text-shadow: 1px 1px 2px black;
}

@media (max-width: 768px) {
    .summary-content { padding: 14px 16px; }
    .summary-header h2 { font-size: 1.2rem; }
    .stat-value { font-size: 1.05rem; }
}