﻿:root {
    --bg-color: #0c1117;
    --card-bg: rgba(17, 24, 39, 0.85);
    --primary: #22c55e;
    --primary-dark: #16a34a;
    --secondary: #f97316;
    --danger: #ef4444;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --gold: #f59e0b;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Safe areas for iOS */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-bottom: calc(70px + var(--safe-bottom)); /* Space for bottom nav */
}

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 700; }
.text-green { color: var(--primary); }
.text-orange { color: var(--secondary); }
.text-red { color: var(--danger); }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }

/* Layout Helpers */
.safe-top { padding-top: calc(var(--safe-top) + 12px); }
.safe-bottom { padding-bottom: calc(var(--safe-bottom) + 12px); }
.safe-content {
    padding-left: calc(var(--safe-left) + 16px);
    padding-right: calc(var(--safe-right) + 16px);
}
.w-full { width: 100%; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    border: none;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    touch-action: manipulation;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}
.btn-danger {
    background-color: var(--danger);
    color: #fff;
}
.btn-secondary {
    background-color: #334155;
    color: #fff;
}
.btn-sm {
    padding: 8px 12px;
    font-size: 14px;
}
.icon-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
    touch-action: manipulation;
}

/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    margin-bottom: 16px;
}

/* Header */
.main-header {
    background: var(--bg-color);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-content h1 {
    font-size: 20px;
    margin: 0;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Status Dot */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-muted);
}
.status-dot.connected {
    background-color: var(--primary);
    animation: pulse 2s infinite;
}
.status-dot.live {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    animation: pulse 2s infinite;
}
.status-dot.reconnecting {
    background: var(--secondary);
    box-shadow: 0 0 8px var(--secondary);
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Dashboard Connection */
.connection-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.input-group input {
    width: 100%;
    padding: 14px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.3);
    color: var(--text-main);
    font-size: 16px; /* Prevent iOS Zoom */
    font-family: inherit;
}
.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}
.btn-group {
    display: flex;
    gap: 12px;
}
.btn-group .btn { flex: 1; }

/* Dashboard Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.05);
}
.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.stat-value {
    font-size: 24px;
    font-weight: 700;
}

/* Feed */
.section-title {
    font-size: 18px;
    margin-bottom: 12px;
}
.mission-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.feed-item {
    background: rgba(255,255,255,0.05);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
}
.feed-icon { font-size: 24px; }
.feed-content { flex: 1; }
.feed-title { font-weight: 600; font-size: 14px; }
.feed-desc { font-size: 12px; color: var(--text-muted); }
.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
    border-radius: var(--border-radius-md);
    font-style: italic;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Tracker Header */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--bg-color);
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.mini-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    font-weight: 600;
    font-size: 15px;
}
.progress-bar-container {
    height: 16px;
    background: rgba(255,255,255,0.1);
    margin: 8px 16px 0;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width 0.5s ease;
}
.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Phone Simulator */
.tracker-main {
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.phone-simulator {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    background: #000;
    border-radius: 40px;
    padding: 12px;
    box-shadow: 0 0 0 3px #333, 0 0 0 6px #1a1a1a;
    position: relative;
}
.phone-notch {
    width: 120px;
    height: 28px;
    background: #000;
    border-radius: 0 0 16px 16px;
    margin: 0 auto;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}
.phone-screen {
    background: var(--bg-color);
    border-radius: 30px;
    min-height: 460px;
    padding: 40px 20px 20px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Mission Display inside Phone */
.waiting-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
}
.breathing-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: breathe 3s infinite ease-in-out;
}
@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
}

.active-mission {
    flex: 1;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease;
}
.mission-header {
    text-align: center;
    margin-bottom: 24px;
}
.mission-id {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 1px;
}
.gift-info {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}
.gifter {
    color: var(--text-muted);
    font-size: 14px;
}

.mission-action {
    text-align: left;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(249, 115, 22, 0.1);
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(249, 115, 22, 0.3);
}
.m-action-name {
    font-size: 28px;
    color: var(--secondary);
    margin-bottom: 8px;
    line-height: 1.2;
}
.m-action-desc {
    font-size: 16px;
    color: var(--text-main);
    text-align: left;
}

.mission-countdown {
    text-align: center;
    font-size: 48px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    margin-bottom: auto; /* pushes everything else up, check btn down */
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.mission-actions {
    margin-top: 24px;
    margin-bottom: 16px;
}
.check-btn {
    width: 100%;
    height: 64px;
    border-radius: 16px;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
    transition: var(--transition);
    touch-action: manipulation;
}
.check-btn:active {
    transform: scale(0.95);
    background: var(--primary-dark);
}
.next-preview {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}



/* Mission Queue */
.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.mission-queue {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.queue-item {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    padding: 12px;
    border-radius: var(--border-radius-md);
    gap: 12px;
}
.queue-status {
    width: 24px;
    text-align: center;
    font-size: 18px;
}
.queue-info {
    flex: 1;
    overflow: hidden;
}
.queue-title {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.queue-desc {
    font-size: 12px;
    color: var(--text-muted);
}
.queue-item.status-done { opacity: 0.6; }
.queue-item.status-cancelled { opacity: 0.6; }
.queue-item.status-done .queue-title { text-decoration: line-through; }

/* Toggle Switch (iOS style) */
.toggle-switch {
    width: 51px;
    height: 31px;
    border-radius: 31px;
    background: #4a4a4a;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}
.toggle-switch.active {
    background: var(--primary);
}
.toggle-switch::after {
    content: '';
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: white;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-switch.active::after {
    transform: translateX(20px);
}

/* Gift Editor */
.gate-status-bar {
    background: rgba(255,255,255,0.05);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.gift-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}
.gift-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-md);
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}
.gift-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 8px;
}
.gift-name {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.gift-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 12px;
    font-size: 14px;
    align-items: center;
}
.gift-details label {
    color: var(--text-muted);
}
.inline-input {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    width: 100%;
}
.inline-input:focus {
    outline: none;
    border-color: var(--primary);
}
.verify-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.random-items-btn {
    margin-top: 12px;
    width: 100%;
    background: rgba(255,255,255,0.1);
}

/* Modals & Panels */
.settings-panel-overlay, .modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.settings-panel-overlay.active, .modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.settings-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: var(--bg-color);
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 20px rgba(0,0,0,0.5);
}
.settings-panel.active {
    right: 0;
}
.settings-header {
    padding: calc(var(--safe-top) + 16px) 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.settings-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.setting-item.vertical {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}
.setting-info {
    display: flex;
    flex-direction: column;
}
.setting-name { font-weight: 600; font-size: 16px; }
.setting-desc { font-size: 12px; color: var(--text-muted); }
.setting-select {
    background: rgba(0,0,0,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
}
input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.random-items-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 16px 0;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--border-radius-sm);
}
.random-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.random-item:last-child { border-bottom: none; }
.add-random-item {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.add-random-item input {
    flex: 1;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.3);
    color: white;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(56px + var(--safe-bottom));
    background: rgba(12, 17, 23, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    flex: 1;
    height: 56px;
    transition: color 0.2s;
}
.nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
}
.nav-label {
    font-size: 11px;
    font-weight: 500;
}
.nav-item.active {
    color: var(--primary);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: calc(70px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: 90%;
    max-width: 400px;
}
.toast {
    background: rgba(51, 65, 85, 0.95);
    color: white;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    font-size: 14px;
    text-align: center;
    animation: slideInFromBottom 0.3s ease-out forwards;
}

@keyframes slideInFromBottom {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Toggle Switch */
.toggle-btn {
    width: 40px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}
.toggle-btn::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: left 0.3s;
}
.toggle-btn.active {
    background: var(--primary);
}
.toggle-btn.active::after {
    left: 19px;
}

/* Camera Background Mode */
.camera-widget {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: #000;
}
.camera-widget video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cam-switch-btn {
    position: fixed;
    bottom: 15vh;
    right: 16px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    color: white;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    z-index: 51;
}
/* Camera Background Mode Overrides */
body.camera-active {
    background-color: transparent !important;
}
body.camera-active .phone-simulator {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
body.camera-active .phone-notch {
    display: none; /* Hide notch in full AR mode */
}
body.camera-active .phone-screen {
    background: rgba(0, 0, 0, 0.2) !important; 
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
body.camera-active .sticky-header {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
}
body.camera-active .bottom-nav {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
}
body.camera-active .mission-queue-section {
    background: rgba(0, 0, 0, 0.5) !important;
    border-radius: 16px;
    margin: 0 16px;
}
body.camera-active .queue-header h3 {
    text-shadow: 1px 1px 4px black;
}
body.camera-active .empty-state, body.camera-active .breathing-icon {
    text-shadow: 1px 1px 4px black;
}


/* V6.0: Queue Slide-out Drawer */
.queue-drawer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.queue-drawer-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.queue-drawer {
    position: fixed;
    top: 0; right: -360px;
    width: 320px;
    height: 100vh;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    z-index: 1001;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255,255,255,0.1);
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
}
.queue-drawer.active {
    right: 0;
}
.queue-drawer .queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.queue-drawer .queue-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--primary);
}
.queue-drawer .queue-global-actions {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.queue-drawer .mission-queue {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
/* Enhanced Queue Item for Drawer */
.queue-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 12px;
    border-radius: 8px;
    padding: 12px;
}
.queue-item .q-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.queue-item .q-actions button {
    flex: 1;
    padding: 6px 4px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    color: white;
}
.queue-item .q-actions button.btn-prioritize { background: var(--primary); }
.queue-item .q-actions button.btn-pause { background: var(--gold); color: black; }
.queue-item .q-actions button.btn-delete { background: var(--danger); }

/* V6.0: Global Pause State */
body.queue-paused .queue-global-actions button {
    background: var(--danger) !important;
    color: white;
}
body.queue-paused .queue-global-actions button::after {
    content: " (Đang Tạm Dừng)";
}

/* V6.0: Task Bar Overlay (Replaces Phone Simulator) */
.task-bar-container {
    position: fixed;
    bottom: 15vh;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    pointer-events: none;
}
#mission-display {
    width: 100%;
    max-width: 360px;
    pointer-events: auto;
}
.waiting-state-bar {
    background: rgba(0,0,0,0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.pulse-dot {
    width: 10px; height: 10px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
    animation: pulseDot 1.5s infinite alternate;
}
@keyframes pulseDot {
    from { opacity: 0.5; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1.2); }
}
.task-bar {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    animation: slideUp 0.3s ease-out;
    width: max-content;
    margin: 0 auto;
    min-width: 220px;
}
.task-current {
    display: flex;
    align-items: center;
    gap: 10px;
}
.task-icon {
    font-size: 20px;
    background: transparent;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
}
.task-info {
    flex: 1;
    overflow: hidden;
}
.task-name {
    font-weight: 600;
    font-size: 14px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.task-desc {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
}
.task-timer {
    background: transparent;
    color: #ef4444;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.task-next {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    padding-top: 4px;
    border-top: 1px dashed rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
}

/* V6.0: Awesome Slot Machine */
.slot-machine-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.slot-machine {
    background: linear-gradient(145deg, #1f2937, #111827);
    border: 2px solid var(--gold);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 0 40px rgba(234, 179, 8, 0.4), inset 0 0 20px rgba(0,0,0,0.8);
    width: 80%;
    max-width: 400px;
    text-align: center;
}
.slot-machine h3 {
    color: var(--gold);
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.slot-window {
    background: #000;
    height: 100px;
    border-radius: 12px;
    border: 3px solid #333;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 10px 15px rgba(0,0,0,0.8);
}
.slot-window::after, .slot-window::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 30px;
    z-index: 2;
    pointer-events: none;
}
.slot-window::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent);
}
.slot-window::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
}
.slot-items {
    list-style: none;
    margin: 0; padding: 0;
    position: absolute;
    width: 100%;
    top: 0; left: 0;
    transition: transform 3s cubic-bezier(0.1, 1, 0.2, 1);
}
.slot-items li {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
/* Winning state */
.slot-machine.winner {
    animation: slotWin 0.5s infinite alternate;
}
@keyframes slotWin {
    from { box-shadow: 0 0 20px var(--gold); border-color: white; }
    to { box-shadow: 0 0 60px var(--gold); border-color: var(--gold); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
/* V6.0 Distance Popup */
.distance-popup {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    background: linear-gradient(135deg, rgba(34,197,94,0.9), rgba(21,128,61,0.9));
    backdrop-filter: blur(8px);
    border: 2px solid #fff;
    border-radius: 24px;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(34,197,94,0.5);
    animation: popupAnim 3.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: none;
}
.distance-popup .value {
    font-size: 32px;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    margin-right: 8px;
}
.distance-popup .from {
    font-size: 14px;
    opacity: 0.9;
}
@keyframes popupAnim {
    0% { opacity: 0; transform: translate(-50%, 50px) scale(0.5); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    25% { transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -100px) scale(0.8); }
}

/* V6.0 Mini Done Button */
.btn-done-mini {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s;
    text-transform: uppercase;
}
.btn-done-mini:hover, .btn-done-mini:active {
    background: rgba(34, 197, 94, 0.5);
    transform: scale(0.95);
}.sticky-header {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding-top: 50px !important; 
}
.top-stats-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 10px;
    width: 100%;
}
.stat-bubble {
    backdrop-filter: blur(5px);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    min-width: 70px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.stat-target {
    background: linear-gradient(135deg, rgba(59,130,246,0.8), rgba(168,85,247,0.8));
    border: 1px solid #60a5fa;
}
.stat-completed {
    background: linear-gradient(135deg, rgba(234,179,8,0.8), rgba(249,115,22,0.8));
    border: 1px solid #fde047;
}
.stat-remaining {
    background: linear-gradient(135deg, rgba(239,68,68,0.8), rgba(217,70,239,0.8));
    border: 1px solid #fca5a5;
}
.stat-val {
    font-size: 13px;
    margin-top: 2px;
}


/* OVERRIDES FOR DESIGN UI 'TRANSPARENT') */
.sticky-header {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding-top: 60px !important; 
}
.top-stats-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 10px;
    width: 100%;
}
.stat-bubble {
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    min-width: 70px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.stat-val {
    font-size: 14px;
    margin-top: 4px;
    color: #fff !important;
}

.task-bar {
    background: rgba(0, 0, 0, 0.6) !important; 
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 40px !important;
    padding: 8px 16px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
    margin: 0 auto !important;
    width: max-content !important;
    min-width: 250px !important;
}

.task-current {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    width: 100% !important;
}

.task-icon {
    font-size: 24px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: white !important;
}

.task-info {
    text-align: left !important;
    flex: 1 !important;
}

.task-name {
    font-size: 16px !important;
    font-weight: bold !important;
    color: #fff !important;
}

.task-timer {
    font-size: 16px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    color: #fff !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
    font-weight: bold !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.task-next {
    background: rgba(0, 0, 0, 0.4) !important;
    color: #fff !important;
    font-weight: normal !important;
    border-radius: 20px !important;
    padding: 4px 12px !important;
    margin-top: 8px !important;
    text-align: center !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-size: 13px !important;
}

/* Slot Machine Overrides */
.slot-machine {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 16px !important;
    color: #fff !important;
    position: relative !important;
    margin-top: 30px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
}
.slot-machine::before {
    display: none !important;
}
.slot-machine h3 {
    color: #fff !important;
    margin-bottom: 10px !important;
    text-shadow: 0 0 5px rgba(255,255,255,0.5) !important;
}
.slot-items li {
    color: #fff !important;
    font-weight: bold !important;
}

/* OVERRIDES FOR CAM SWITCH BTN */
.cam-switch-btn {
    background: rgba(0,0,0,0.4) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3) !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.cam-switch-btn svg {
    width: 20px !important;
    height: 20px !important;
    stroke: #fff !important;
}
