:root {
    --bg-primary: #110917;
    --bg-secondary: #1e1228;
    --card-bg: linear-gradient(165deg, #241632 0%, #1a1024 100%);
    --card-border: rgba(255, 64, 138, 0.22);
    --card-border-focus: rgba(255, 64, 138, 0.65);
    
    --text-primary: #ffffff;
    --text-secondary: #e2d9eb;
    --text-muted: #9f8aa9;
    
    /* 3D Hot Pink Accent */
    --pink-primary: #ff2a7a;
    --pink-light: #ff66a5;
    --pink-dark: #d40e55;
    --pink-gradient: linear-gradient(135deg, #ff2a7a 0%, #d80b55 100%);
    --pink-glow: rgba(255, 42, 122, 0.55);
    --pink-clay-shadow: 0 8px 25px rgba(255, 42, 122, 0.45), inset 0 2px 3px rgba(255, 255, 255, 0.45), inset 0 -2px 3px rgba(0, 0, 0, 0.3);
    
    /* 3D Mint Green Badges & Buttons */
    --success-color: #10b981;
    --success-gradient: linear-gradient(180deg, #10b981 0%, #059669 100%);
    --success-glow: rgba(16, 185, 129, 0.45);
    
    --danger-color: #ff3366;
    --danger-gradient: linear-gradient(180deg, #ff3366 0%, #d91448 100%);
    --danger-glow: rgba(255, 51, 102, 0.5);
    
    --border-radius: 22px;
    --input-radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Ambient 3D Neon Aura (Більш яскрава та соковита рожева) */
.background-glow {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 85% 10%, rgba(255, 42, 122, 0.28) 0%, transparent 50%),
        radial-gradient(circle at 10% 40%, rgba(255, 42, 122, 0.22) 0%, transparent 55%),
        radial-gradient(circle at 75% 85%, rgba(255, 42, 122, 0.26) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    padding: 20px 16px;
    max-width: 500px;
    margin: 0 auto;
    padding-bottom: 110px;
}

/* Header Profile Badge */
.header {
    margin-bottom: 20px;
}

.profile-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 14px 18px;
    border-radius: var(--border-radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 20px rgba(255, 42, 122, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.avatar-glow {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    background: var(--pink-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: var(--pink-clay-shadow);
    flex-shrink: 0;
}

.brand-title {
    font-size: 17px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.2px;
    background: linear-gradient(135deg, #ffffff 10%, #ff529a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    line-height: 1.2;
}

/* Tactile 3D Cards (Світліші та соковиті плашечки) */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 42, 122, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    border-color: rgba(255, 42, 122, 0.4);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6), 0 0 22px rgba(255, 42, 122, 0.16);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.card-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-header h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.subtitle {
    font-size: 12.5px;
    color: #d1c4e9;
    margin: 0 0 14px 0;
    line-height: 1.45;
}

/* 3D Pill Limit Badges (Всі єдиного соковитого зеленого кольору) */
.limit-badge, .limit-badge.info {
    display: inline-flex;
    align-items: center;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #34d399;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

/* Status Card */
.status-card {
    padding: 14px 18px;
    background: var(--card-bg);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 0 0 6px rgba(100, 116, 139, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.dot.running {
    background: #10b981;
    box-shadow: 0 0 12px #10b981;
}

.dot.running::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 2px solid #10b981;
    animation: pulse 1.8s infinite;
}

.dot.stopped {
    background: var(--pink-primary);
    box-shadow: 0 0 10px var(--pink-primary);
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    70% { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(1.6); opacity: 0; }
}

#status-text {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.global-status {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.warning-text {
    color: #fbbf24;
    font-size: 12px;
    font-weight: 600;
}

/* Form Controls & Sunken 3D Inputs */
.form-group {
    display: flex;
    gap: 10px;
}

.select-wrapper {
    position: relative;
    flex: 1;
}

select {
    width: 100%;
    background: #080a0f;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 13px 16px;
    border-radius: var(--input-radius);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.75), inset -1px -1px 2px rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.2s ease;
}

select:focus {
    border-color: var(--pink-primary);
    box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.75), 0 0 14px var(--pink-glow);
}

.select-wrapper::after {
    content: '▼';
    font-size: 10px;
    color: var(--pink-primary);
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Tactile 3D Icon Button (Без сторонніх емодзі, чистий SVG) */
.icon-btn {
    background: var(--pink-gradient);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: var(--input-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--pink-clay-shadow);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.icon-btn .refresh-svg {
    stroke: #ffffff;
    transition: transform 0.4s ease;
}

.icon-btn:hover .refresh-svg {
    transform: rotate(180deg);
}

.icon-btn:active {
    transform: translateY(2px) scale(0.95);
    box-shadow: 0 4px 14px rgba(255, 42, 122, 0.45);
}

/* Sunken 3D Numeric Inputs */
.slider-group {
    display: flex;
    flex-direction: column;
}

.inputs-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-box label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="number"] {
    width: 100%;
    background: #140c1a;
    color: #ffffff;
    border: 1px solid rgba(255, 64, 138, 0.2);
    padding: 13px 14px;
    border-radius: var(--input-radius);
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 700;
    outline: none;
    box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.75), inset -1px -1px 2px rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
}

input[type="number"]:focus {
    border-color: var(--pink-primary);
    box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.75), 0 0 16px var(--pink-glow);
}

.separator {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: bold;
    margin-top: 18px;
}

/* Floating Action Container & 3D Pill Button */
.action-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: linear-gradient(180deg, transparent 0%, rgba(17, 9, 23, 0.92) 40%, #110917 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 10;
    display: flex;
    justify-content: center;
}

.btn {
    width: 100%;
    max-width: 500px;
    padding: 17px 24px;
    border-radius: 999px;
    border: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ffffff;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.primary-btn {
    background: var(--pink-gradient);
    box-shadow: 0 12px 30px rgba(255, 42, 122, 0.45), inset 0 2px 3px rgba(255, 255, 255, 0.4), inset 0 -3px 4px rgba(0, 0, 0, 0.25);
}

.btn:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 6px 16px rgba(255, 42, 122, 0.35);
}

.btn.stop {
    background: var(--danger-gradient);
    box-shadow: 0 12px 30px rgba(255, 51, 102, 0.5), inset 0 2px 3px rgba(255, 255, 255, 0.4), inset 0 -3px 4px rgba(0, 0, 0, 0.25);
}

.btn.start {
    background: var(--success-gradient);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.5), inset 0 2px 3px rgba(255, 255, 255, 0.45), inset 0 -3px 4px rgba(0, 0, 0, 0.25);
}

.btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    display: none;
}

.btn.loading .btn-spinner {
    display: block;
}

.btn.loading .btn-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Floating Keyboard Dismiss Button (iOS & Mobile UX) */
.keyboard-done-btn {
    position: fixed;
    right: 20px;
    bottom: 95px;
    z-index: 100;
    background: var(--pink-gradient);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 10px 20px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.3px;
    box-shadow: 0 10px 26px rgba(255, 42, 122, 0.55), inset 0 1.5px 2px rgba(255, 255, 255, 0.45);
    cursor: pointer;
    opacity: 0;
    transform: translateY(16px) scale(0.92);
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), bottom 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.keyboard-done-btn.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.keyboard-done-btn:active {
    transform: scale(0.94);
    box-shadow: 0 4px 14px rgba(255, 42, 122, 0.45);
}
