:root {
    --bg: #fafafa;
    --card: #ffffff;
    --text: #2d3748;
    --muted: #718096;
    --primary: #667eea;
    --success: #48bb78;
    --warning: #ed8936;
    --secondary: #e2e8f0;
    --grid-off: #f7fafc;
    --accent-pink: #f687b3;
    --accent-lavender: #a78bfa;
    --accent-mint: #68d391;
    --soft-shadow: rgba(0, 0, 0, 0.08);
    --soft-border: rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background: linear-gradient(135deg, #fdf2f8 0%, #f3e8ff 30%, #ecfdf5 70%, #fef3c7 100%);
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    position: relative;
}

/* Enhanced background with animated gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(246, 135, 179, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(167, 139, 250, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(104, 211, 145, 0.1) 0%, transparent 50%);
    animation: background-shift 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes background-shift {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    33% {
        transform: scale(1.1) rotate(1deg);
    }
    66% {
        transform: scale(1.05) rotate(-1deg);
    }
}

.app {
    height: 100%;
    padding: env(safe-area-inset-top) 14px env(safe-area-inset-bottom);
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
}

.app__header {
    text-align: center;
    padding: 6px 0 4px;
}

h1 {
    font-size: 22px;
    margin: 8px 0 4px;
    color: var(--text);
    font-weight: 700;
}

.subtitle {
    margin: 0;
    color: var(--muted);
    font-weight: 500;
}

.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--soft-border);
    border-radius: 20px;
    padding: 12px;
    box-shadow: 0 4px 20px var(--soft-shadow);
}

.card h2 {
    font-size: 16px;
    margin: 0 0 8px;
    color: var(--text);
    font-weight: 600;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.control {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 6px;
}

.control span {
    color: var(--muted);
    font-size: 12px;
}

input[type="number"] {
    width: 100%;
    background: #f8fafc;
    border: 1px solid var(--soft-border);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 12px;
}

input[type="range"] {
    width: 100%;
}

.buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.buttons .btn:nth-child(3),
.buttons .btn:nth-child(4) {
    grid-column: span 1;
}

.btn {
    appearance: none;
    border: 1px solid var(--soft-border);
    background: #f8fafc;
    color: var(--text);
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--soft-shadow);
}

.btn:disabled {
    opacity: 0.5;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent-lavender));
    color: white;
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--accent-mint));
    color: white;
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #f6ad55);
    color: white;
    border: none;
}

.btn-secondary {
    background: #f8fafc;
    color: var(--text);
}

.stats {
    display: grid;
    /* Changed from repeat(3, 1fr) to repeat(auto-fit, minmax(80px, 1fr)) for better wrapping */
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.stat {
    padding: 10px;
    border: 1px solid var(--soft-border);
    border-radius: 12px;
    background: #f8fafc;
    text-align: center;
}

.stat__label {
    color: var(--muted);
    font-size: 12px;
}

.stat__value {
    font-size: 20px;
    font-weight: 700;
    margin-top: 4px;
    color: var(--text);
}

.progress {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border: 1px solid var(--soft-border);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

.progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-mint));
    transition: width 200ms ease;
}

.card--stage {
    padding: 8px;
    display: grid;
}

.stage-wrap {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

.stage {
    width: 100%;
    max-width: 520px;
    aspect-ratio: 6 / 5;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--soft-border);
    padding: 8px;
    display: grid;
}

/* Painting Display Styles */
.painting-display {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid var(--soft-border);
    box-shadow: 0 8px 24px var(--soft-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.painting-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1.02);
    filter: brightness(1.05) contrast(1.1);
    max-width: 100%;
    max-height: 100%;
}

.painting-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    pointer-events: none;
}

.painting-progress-text {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    color: var(--text);
    font-weight: 700;
    font-size: 18px;
    padding: 12px 20px;
    border-radius: 25px;
    border: 1px solid var(--soft-border);
    box-shadow: 0 6px 20px var(--soft-shadow);
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.2;
}

/* Special styling for cycle information */
.painting-progress-text.cycle-info {
    font-size: 16px;
    padding: 14px 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
    border: 2px solid var(--accent-lavender);
}

.painting-progress-text.complete {
    background: linear-gradient(135deg, var(--accent-mint), var(--success));
    color: white;
    transform: scale(1.1);
    animation: completion-pulse 2s ease-in-out infinite;
}

@keyframes completion-pulse {
    0%, 100% {
        transform: scale(1.1);
        box-shadow: 0 6px 20px var(--soft-shadow);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 8px 25px rgba(104, 211, 145, 0.4);
    }
}

/* Animation for painting progress */
.painting-image.progressing {
    animation: painting-progress 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes painting-progress {
    0% {
        transform: scale(1.02) rotate(0deg);
    }
    50% {
        transform: scale(1.05) rotate(1deg);
    }
    100% {
        transform: scale(1.02) rotate(0deg);
    }
}

/* Remove old coloring grid styles */
.coloring-grid,
.tile,
.tile__fill,
.tile--on {
    display: none;
}

.tips {
    margin: 8px 0 0 18px;
}

/* Fullscreen tap overlay to request motion */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: grid;
    place-items: center;
    z-index: 20;
}

.overlay__content {
    background: white;
    border: 1px solid var(--soft-border);
    border-radius: 20px;
    padding: 18px 20px;
    text-align: center;
    box-shadow: 0 8px 32px var(--soft-shadow);
}

@media (min-width: 560px) {
    .buttons {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Exercise Selection Styles - Feminine Apple Style */
.selection-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--soft-border);
    border-radius: 24px;
    padding: 32px 24px;
    margin: 20px 0;
    box-shadow: 0 8px 32px var(--soft-shadow);
}

.selection-group {
    margin-bottom: 24px;
}

.selection-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-container {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-select {
    width: 100%;
    background: #f8fafc;
    border: 1px solid var(--soft-border);
    border-radius: 16px;
    padding: 16px 48px 16px 16px;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-select:focus {
    outline: none;
    border-color: var(--accent-lavender);
    background: white;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

.dropdown-select:hover {
    background: white;
    border-color: var(--accent-lavender);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--soft-shadow);
}

.dropdown-select option {
    background: white;
    color: var(--text);
    padding: 8px;
}

.dropdown-select optgroup {
    background: white;
    color: var(--muted);
    font-weight: 600;
    padding: 8px;
}

.dropdown-arrow {
    position: absolute;
    right: 16px;
    color: var(--accent-lavender);
    font-size: 18px;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.dropdown-select:focus+.dropdown-arrow {
    transform: rotate(180deg);
    color: var(--accent-lavender);
}

.start-button {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-lavender));
    border: none;
    border-radius: 20px;
    padding: 20px 24px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(246, 135, 179, 0.3);
    margin-top: 32px;
}

.start-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(246, 135, 179, 0.4);
    background: linear-gradient(135deg, #f472b6, #a78bfa);
}

.start-button:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(246, 135, 179, 0.3);
}

.start-button:disabled {
    background: #f1f5f9;
    color: var(--muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.start-text {
    font-size: 18px;
    font-weight: 700;
}

.start-icon {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.start-button:hover:not(:disabled) .start-icon {
    transform: translateX(4px);
}

/* Remove old exercise selection styles */
.exercise-categories,
.category h3,
.exercise-options,
.exercise-option,
.option-content,
.option-number,
.option-text,
.intensity-options,
.intensity-option,
.intensity-content,
.intensity-level,
.intensity-reps {
    display: none;
}

/* Selection page specific button styling */
#selection-page .buttons {
    grid-template-columns: 1fr;
    margin-top: 16px;
}

#selection-page .btn {
    padding: 14px 20px;
    font-size: 16px;
}

/* Exercise page back button */
#btn-back-to-selection {
    grid-column: span 2;
    margin-top: 8px;
}

/* Floating background elements */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-lavender));
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.circle-1 {
    width: 120px;
    height: 120px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.circle-2 {
    width: 80px;
    height: 80px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.circle-3 {
    width: 60px;
    height: 60px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

.floating-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent-mint);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 4s ease-in-out infinite;
}

.dot-1 {
    top: 30%;
    right: 25%;
    animation-delay: 1s;
}

.dot-2 {
    top: 70%;
    left: 30%;
    animation-delay: 3s;
}

.dot-3 {
    bottom: 40%;
    right: 40%;
    animation-delay: 5s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Header logo animation */
.header-logo {
    margin-bottom: 12px;
    animation: logo-float 4s ease-in-out infinite;
    position: relative;
}

.header-logo svg {
    filter: drop-shadow(0 6px 16px rgba(102, 126, 234, 0.4));
    transition: all 0.3s ease;
}

.header-logo:hover svg {
    filter: drop-shadow(0 8px 24px rgba(102, 126, 234, 0.6));
    transform: scale(1.05);
}

@keyframes logo-float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) scale(1);
    }
    25% {
        transform: translateY(-3px) rotate(1deg) scale(1.02);
    }
    50% {
        transform: translateY(-6px) rotate(0deg) scale(1.05);
    }
    75% {
        transform: translateY(-3px) rotate(-1deg) scale(1.02);
    }
}

/* Add a subtle glow effect */
.header-logo::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: glow-pulse 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes glow-pulse {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Label icons - now SVG-based with animations */
.label-icon {
    margin-right: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-lavender);
    animation: icon-bounce 3s ease-in-out infinite;
    position: relative;
}

.label-icon svg {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 2px 4px rgba(167, 139, 250, 0.3));
    transition: all 0.3s ease;
}

.label-icon:hover svg {
    transform: scale(1.2);
    filter: drop-shadow(0 4px 8px rgba(167, 139, 250, 0.5));
}

/* Dumbbell icon animations */
.dumbbell-bar {
    animation: dumbbell-lift 2s ease-in-out infinite;
}

.dumbbell-weight {
    animation: weight-bounce 2s ease-in-out infinite;
}

.dumbbell-weight:first-of-type {
    animation-delay: 0s;
}

.dumbbell-weight:last-of-type {
    animation-delay: 0.5s;
}

/* Lightning bolt animations */
.lightning-bolt {
    animation: lightning-flash 3s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(167, 139, 250, 0.6));
}

@keyframes icon-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-2px) scale(1.05);
    }
}

@keyframes dumbbell-lift {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-1px);
    }
}

@keyframes weight-bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes lightning-flash {
    0%, 100% {
        opacity: 0.8;
        filter: drop-shadow(0 0 4px rgba(167, 139, 250, 0.6));
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.8));
    }
}

/* Button particles */
.button-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: particle-float 3s ease-in-out infinite;
}

.particle:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    top: 60%;
    right: 20%;
    animation-delay: 1s;
}

.particle:nth-child(3) {
    bottom: 20%;
    left: 50%;
    animation-delay: 2s;
}

@keyframes particle-float {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0);
    }
}

/* Enhanced dropdown animations */
.dropdown-select:focus {
    outline: none;
    border-color: var(--accent-lavender);
    background: white;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
    transform: translateY(-2px);
}

.dropdown-select:hover {
    background: white;
    border-color: var(--accent-lavender);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--soft-shadow);
}

/* Enhanced start button */
.start-button {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-lavender));
    border: none;
    border-radius: 20px;
    padding: 20px 24px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(246, 135, 179, 0.3);
    margin-top: 32px;
    position: relative;
    overflow: hidden;
}

.start-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.start-button:hover::before {
    left: 100%;
}

.start-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(246, 135, 179, 0.4);
    background: linear-gradient(135deg, #f472b6, #a78bfa);
}

.start-button:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(246, 135, 179, 0.3);
}

.start-button:disabled {
    background: #f1f5f9;
    color: var(--muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.start-text {
    font-size: 18px;
    font-weight: 700;
}

.start-icon {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.start-button:hover:not(:disabled) .start-icon {
    transform: translateX(4px);
}

/* Selection card enhancement */
.selection-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--soft-border);
    border-radius: 24px;
    padding: 32px 24px;
    margin: 20px 0;
    box-shadow: 0 8px 32px var(--soft-shadow);
    position: relative;
    z-index: 2;
}

.selection-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-lavender), var(--accent-mint));
    border-radius: 26px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.selection-card:hover::before {
    opacity: 0.3;
}

/* Professional Typography Enhancements */
.app__header h1 {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text), var(--accent-lavender));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 12px 0 6px;
    letter-spacing: -0.5px;
}

.subtitle {
    margin: 0;
    color: var(--muted);
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 0.2px;
}

/* Enhanced Card Design */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--soft-border);
    border-radius: 24px;
    padding: 20px;
    box-shadow:
        0 4px 20px var(--soft-shadow),
        0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-lavender), transparent);
    opacity: 0.3;
}

.card h2 {
    font-size: 18px;
    margin: 0 0 16px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card h2::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-lavender));
    border-radius: 2px;
}

/* Professional Stats Design */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.stat {
    padding: 16px 12px;
    border: 1px solid var(--soft-border);
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-lavender));
}

.stat__label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat__value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

/* Enhanced Progress Bar */
.progress {
    width: 100%;
    height: 12px;
    background: #f1f5f9;
    border: 1px solid var(--soft-border);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 16px;
    position: relative;
}

.progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-lavender), var(--accent-mint));
    transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress__bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Professional Button Design */
.btn {
    appearance: none;
    border: 1px solid var(--soft-border);
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    color: var(--text);
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.3s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--soft-shadow);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent-lavender));
    color: white;
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--accent-mint));
    color: white;
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #f6ad55);
    color: white;
    border: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    color: var(--text);
}

/* Enhanced Input Design */
input[type="number"] {
    width: 100%;
    background: #f8fafc;
    border: 1px solid var(--soft-border);
    color: var(--text);
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-lavender);
    background: white;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
    transform: translateY(-1px);
}

/* Professional Selection Card */
.selection-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--soft-border);
    border-radius: 28px;
    padding: 40px 32px;
    margin: 24px 0;
    box-shadow:
        0 8px 32px var(--soft-shadow),
        0 2px 8px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
    animation: card-float 6s ease-in-out infinite;
}

.selection-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-lavender), var(--accent-mint));
    border-radius: 30px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: border-glow 4s ease-in-out infinite;
}

.selection-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 28px;
    pointer-events: none;
}

.selection-card:hover::before {
    opacity: 0.3;
}

@keyframes card-float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-4px) rotate(0.5deg);
    }
}

@keyframes border-glow {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 0.2;
    }
}

.selection-group {
    margin-bottom: 28px;
}

.selection-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    gap: 8px;
}

.label-icon {
    margin-right: 10px;
    font-size: 18px;
    animation: bounce 2s ease-in-out infinite;
}

/* Enhanced Dropdown Design */
.dropdown-container {
    position: relative;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.dropdown-container:hover {
    transform: translateY(-2px);
}

.dropdown-select {
    width: 100%;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid var(--soft-border);
    border-radius: 18px;
    padding: 18px 56px 18px 20px;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dropdown-select:focus {
    outline: none;
    border-color: var(--accent-lavender);
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    box-shadow: 
        0 0 0 3px rgba(167, 139, 250, 0.1),
        0 4px 16px rgba(167, 139, 250, 0.2);
    transform: translateY(-2px);
}

.dropdown-select:hover {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-color: var(--accent-lavender);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--soft-shadow);
}

.dropdown-arrow {
    position: absolute;
    right: 20px;
    color: var(--accent-lavender);
    font-size: 20px;
    pointer-events: none;
    transition: all 0.3s ease;
    animation: arrow-bounce 2s ease-in-out infinite;
}

.dropdown-select:focus + .dropdown-arrow {
    transform: rotate(180deg) scale(1.1);
    color: var(--accent-lavender);
}

@keyframes arrow-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

/* Professional Start Button */
.start-button {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-lavender));
    border: none;
    border-radius: 24px;
    padding: 24px 32px;
    color: white;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 8px 24px rgba(246, 135, 179, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    margin-top: 40px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    animation: button-pulse 4s ease-in-out infinite;
}

.start-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.start-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 24px;
    pointer-events: none;
}

.start-button:hover::before {
    left: 100%;
}

.start-button:hover:not(:disabled) {
    transform: translateY(-6px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(246, 135, 179, 0.4),
        0 8px 16px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #f472b6, #a78bfa);
}

.start-button:active:not(:disabled) {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 8px 24px rgba(246, 135, 179, 0.3);
}

.start-button:disabled {
    background: #f1f5f9;
    color: var(--muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    animation: none;
}

.start-text {
    font-size: 20px;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

.start-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.start-button:hover:not(:disabled) .start-icon {
    transform: translateX(8px) scale(1.1);
}

@keyframes button-pulse {
    0%, 100% {
        box-shadow:
            0 8px 24px rgba(246, 135, 179, 0.3),
            0 2px 8px rgba(0, 0, 0, 0.1),
            0 0 0 1px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow:
            0 12px 32px rgba(246, 135, 179, 0.4),
            0 4px 12px rgba(0, 0, 0, 0.12),
            0 0 0 1px rgba(255, 255, 255, 0.15);
    }
}

/* Motion Status Indicator */
.motion-status {
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 16px;
    border: 1px solid var(--soft-border);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 2px solid #cbd5e0;
    transition: all 0.3s ease;
}

.status-indicator.active .status-dot {
    background: var(--accent-mint);
    border-color: var(--success);
    box-shadow: 0 0 0 4px rgba(104, 211, 145, 0.2);
    animation: pulse 2s infinite;
}

.status-indicator.inactive .status-dot {
    background: #fed7d7;
    border-color: #f56565;
    box-shadow: 0 0 0 4px rgba(245, 101, 101, 0.2);
}

.status-text {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Tiny compact variant for motion status */
.motion-status--tiny {
    padding: 4px;
    margin: 0;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
}

.motion-status--tiny .status-indicator {
    gap: 0;
}

.motion-status--tiny .status-dot {
    width: 10px;
    height: 10px;
    border-width: 1px;
}

.motion-status--tiny .status-text {
    display: none;
}

.card-wrapper {
    display: flex;
    gap: 12px;

    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    width: 100%;
}

.session {
    flex: 1;
    height: 100%;
    align-items: center;
    display: flex;
}

/* Ensure no extra bottom margin on the inline header */
.card-wrapper h2 {
    margin: 0;
}

/* Header logo animation */
.header-logo {
    margin-bottom: 8px;
    animation: logo-pulse 3s ease-in-out infinite;
}

.header-logo svg {
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.3));
}

@keyframes logo-pulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.05) rotate(2deg);
    }
}

/* Label icons - now text-based */
.label-icon {
    margin-right: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-lavender);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: label-fade 2s ease-in-out infinite;
}

@keyframes label-fade {
    0%, 100% {
        opacity: 0.8;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-1px);
    }
}

/* Mobile-specific painting display improvements */
@media (max-width: 768px) {
    .painting-display {
        min-height: 300px;
        max-height: 60vh;
    }
    
    .painting-image {
        object-fit: contain;
        max-height: 100%;
        width: auto;
        height: auto;
    }
    
    .stage {
        aspect-ratio: auto;
        min-height: 300px;
    }
}

/* Ensure painting container works well on all devices */
.stage {
    width: 100%;
    max-width: 520px;
    aspect-ratio: 6 / 5;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--soft-border);
    padding: 8px;
    display: grid;
    min-height: 300px;
}

/* Enhanced Floating background elements */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-lavender));
    opacity: 0.1;
    animation: float 8s ease-in-out infinite;
    filter: blur(1px);
}

.circle-1 {
    width: 120px;
    height: 120px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
    background: linear-gradient(135deg, rgba(246, 135, 179, 0.2), rgba(167, 139, 250, 0.2));
}

.circle-2 {
    width: 80px;
    height: 80px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(104, 211, 145, 0.2));
}

.circle-3 {
    width: 60px;
    height: 60px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
    background: linear-gradient(135deg, rgba(104, 211, 145, 0.2), rgba(246, 135, 179, 0.2));
}

.floating-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent-mint);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(104, 211, 145, 0.4);
}

.dot-1 {
    top: 30%;
    right: 25%;
    animation-delay: 1s;
    background: var(--accent-pink);
    box-shadow: 0 0 8px rgba(246, 135, 179, 0.4);
}

.dot-2 {
    top: 70%;
    left: 30%;
    animation-delay: 3s;
    background: var(--accent-lavender);
    box-shadow: 0 0 8px rgba(167, 139, 250, 0.4);
}

.dot-3 {
    bottom: 40%;
    right: 40%;
    animation-delay: 5s;
    background: var(--accent-mint);
    box-shadow: 0 0 8px rgba(104, 211, 145, 0.4);
}

/* Additional floating particles */
.floating-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    opacity: 0.6;
    animation: particle-float 10s linear infinite;
}

.particle-1 {
    top: 20%;
    left: 15%;
    animation-delay: 0s;
    background: var(--accent-pink);
}

.particle-2 {
    top: 80%;
    right: 20%;
    animation-delay: 3s;
    background: var(--accent-lavender);
}

.particle-3 {
    bottom: 30%;
    left: 40%;
    animation-delay: 6s;
    background: var(--accent-mint);
}

.particle-4 {
    top: 50%;
    right: 35%;
    animation-delay: 2s;
    background: var(--accent-pink);
}

.particle-5 {
    bottom: 60%;
    left: 60%;
    animation-delay: 4s;
    background: var(--accent-lavender);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) scale(1);
    }
    25% {
        transform: translateY(-15px) rotate(90deg) scale(1.05);
    }
    50% {
        transform: translateY(-30px) rotate(180deg) scale(1.1);
    }
    75% {
        transform: translateY(-15px) rotate(270deg) scale(1.05);
    }
}

@keyframes particle-float {
    0% {
        transform: translateY(0px) translateX(0px) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
        transform: translateY(-10px) translateX(5px) scale(1);
    }
    90% {
        opacity: 0.6;
        transform: translateY(-100px) translateX(20px) scale(1);
    }
    100% {
        transform: translateY(-120px) translateX(25px) scale(0);
        opacity: 0;
    }
}