:root {
    --glovo-yellow:   #FFC244;
    --glovo-yellow-2: #FFD86B;
    --glovo-teal:     #00A082;
    --glovo-teal-glow:#00e5ba;
    --glovo-orange:   #FF6600;
    --glovo-dark:     #1A1D21;
    --glovo-grey:     #8B929E;
    --glovo-light:    #F4F5F7;
    --glovo-white:    #FFFFFF;
    --glovo-danger:   #E74C3C;
    --speedo-grad-a:  #555df0;
    --speedo-grad-b:  #6df7f2;
}

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

html, body {
    width: 100%; height: 100%; overflow: hidden;
    background: transparent !important;
    font-family: 'Segoe UI', 'Proxima Nova', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    user-select: none;
}

#cef-app {
    position: fixed; inset: 0; z-index: 2147483000;
    color: var(--glovo-dark); pointer-events: none;
}

.widget {
    position: fixed;
    right: 28px;
    top: 50%;
    transform: translateY(-50%) translateX(120%);
    width: 300px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.45) inset,
        0 0 40px rgba(255, 194, 68, 0.08);
    pointer-events: none;
    opacity: 0;
    transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.widget.visible {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
}

.widget__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--glovo-yellow), var(--glovo-yellow-2));
    box-shadow: 0 4px 18px rgba(255, 194, 68, 0.22);
    position: relative;
    z-index: 101;
}

.widget__logo {
    font-size: 22px;
    font-weight: 900;
    color: var(--glovo-dark);
    letter-spacing: -0.5px;
    line-height: 1;
    flex: 1 1 auto;
    min-width: 0;
}

.widget__online {
    display: flex; align-items: center; gap: 6px;
    font-size: 10px; font-weight: 800; color: rgba(26, 29, 33, 0.82);
    background: rgba(255,255,255,0.48);
    padding: 5px 11px; border-radius: 20px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    flex: 0 0 auto;
    white-space: nowrap;
}
.widget__online i {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--glovo-teal);
    box-shadow: 0 0 8px var(--glovo-teal-glow);
    animation: blinkOnline 2s ease-in-out infinite;
}
@keyframes blinkOnline {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--glovo-teal-glow); }
    50% { opacity: 0.5; box-shadow: 0 0 2px var(--glovo-teal); }
}

.widget__body { padding: 18px; position: relative; }

.widget__success-screen {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, var(--glovo-teal), #00856c);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10%);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-align: center;
}
.widget__success-screen.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.success-icon-wrap {
    width: 64px; height: 64px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.widget__success-screen.show .success-icon-wrap {
    animation: successPulse 2s infinite;
}
.success-title { font-size: 20px; font-weight: 900; margin-bottom: 8px; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.success-subtitle { font-size: 13px; font-weight: 700; opacity: 0.9; }

@keyframes successPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); transform: scale(0.95); }
    70% { box-shadow: 0 0 0 15px rgba(255, 255, 255, 0); transform: scale(1.05); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); transform: scale(0.95); }
}

.widget__profile-row {
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.widget__player {
    display: flex; align-items: center; gap: 10px;
    min-width: 0;
}
.widget__player-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.widget__player-meta > span:first-child {
    font-size: 14px;
    font-weight: 800;
    color: var(--glovo-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.widget__avatar {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 12px;
    background: linear-gradient(145deg, rgba(0, 160, 130, 0.12), rgba(0, 160, 130, 0.04));
    color: var(--glovo-teal);
    font-size: 15px; font-weight: 900;
    border: 1px solid rgba(0, 160, 130, 0.14);
    flex-shrink: 0;
}
.widget__city {
    font-size: 10px; font-weight: 700; color: var(--glovo-grey);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.widget__stage-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--glovo-teal);
    background: rgba(0, 160, 130, 0.1);
    border: 1px solid rgba(0, 160, 130, 0.18);
    padding: 5px 9px;
    border-radius: 999px;
}

.widget__route-card {
    background: linear-gradient(180deg, #f7f8fa 0%, var(--glovo-light) 100%);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 14px;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
}
.route-item { display: flex; align-items: flex-start; gap: 12px; position: relative; }
.route-item:first-child { margin-bottom: 14px; }
.route-item:first-child::after {
    content: ''; position: absolute; left: 5px; top: 16px;
    width: 2px; height: 22px;
    background: linear-gradient(180deg, rgba(0,0,0,0.12), rgba(0, 160, 130, 0.25));
    border-radius: 2px;
}
.route-dot {
    width: 12px; height: 12px; border-radius: 50%; background: var(--glovo-grey); margin-top: 2px;
    position: relative; z-index: 2; border: 2px solid var(--glovo-light); transition: all 0.3s ease;
}
.route-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.route-label { font-size: 10px; font-weight: 700; color: var(--glovo-grey); text-transform: uppercase; letter-spacing: 0.04em; }
.route-value {
    font-size: 13px; font-weight: 800; color: var(--glovo-dark);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.route-item.active .route-dot {
    background: var(--glovo-teal); box-shadow: 0 0 0 3px rgba(0, 160, 130, 0.2); animation: pulseDot 1.5s infinite;
}
.route-item.active .route-value { color: var(--glovo-teal); }
@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(0, 160, 130, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(0, 160, 130, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 160, 130, 0); }
}

.widget__stats {
    display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 10px; margin-bottom: 14px;
}
.widget__stat-box {
    background: var(--glovo-light);
    padding: 12px;
    border-radius: 14px;
    display: flex; align-items: center; gap: 12px;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.stat-bag-icon {
    width: 34px; height: 34px; border-radius: 11px;
    background: linear-gradient(145deg, rgba(255, 194, 68, 0.28), rgba(255, 102, 0, 0.12));
    color: var(--glovo-orange);
    display: flex; align-items: center; justify-content: center;
}
.stat-content { display: flex; flex-direction: column; }
.widget__stat-label {
    font-size: 10px; font-weight: 800; text-transform: uppercase;
    color: var(--glovo-grey); margin-bottom: 2px; letter-spacing: 0.04em;
}
.widget__stat-value {
    font-size: 24px; font-weight: 900; color: var(--glovo-dark);
    display: flex; align-items: baseline; gap: 2px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-variant-numeric: tabular-nums;
}
.widget__stat-value.pop { transform: scale(1.15) translateX(2px); color: var(--glovo-teal); }
.widget__stat-sub { font-size: 14px; color: var(--glovo-grey); font-weight: 800; }
.stat-pay-box { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; }
.widget__stat-pay { font-size: 22px; color: var(--glovo-teal); }

.widget__progress { margin-bottom: 14px; }
.widget__progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--glovo-grey);
}
.widget__progress-track {
    height: 9px;
    border-radius: 999px;
    background: rgba(0,0,0,0.05);
    overflow: hidden;
}
.widget__progress-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--glovo-teal), var(--glovo-teal-glow));
    box-shadow: 0 0 12px rgba(0, 160, 130, 0.35);
    transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.widget__timer {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px;
    padding: 11px 14px; border-radius: 14px; margin-bottom: 14px;
    background: rgba(255, 102, 0, 0.08); border: 1px solid rgba(255, 102, 0, 0.2);
    font-size: 12px; font-weight: 700; color: var(--glovo-orange);
}
.widget__timer-label {
    flex: 1 1 auto;
    min-width: 0;
}
.widget__timer b {
    flex: 0 0 52px;
    width: 52px;
    text-align: right;
    font: 800 16px/1 Consolas, 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
.widget__timer.hidden { display: none; }
.widget__timer.danger {
    background: rgba(231, 76, 60, 0.1); border-color: rgba(231, 76, 60, 0.3); color: var(--glovo-danger);
    animation: timerPulse 1s ease-in-out infinite;
}
@keyframes timerPulse { 50% { opacity: 0.65; } }

.widget__hint {
    font-size: 12px; font-weight: 800; line-height: 1.45; color: var(--glovo-dark);
    padding: 13px 14px; border-radius: 14px;
    background: linear-gradient(135deg, var(--glovo-yellow), var(--glovo-yellow-2));
    box-shadow: 0 6px 14px rgba(255, 194, 68, 0.28);
    transition: all 0.3s ease;
    text-align: center;
}
.widget__hint.pulse { animation: hintPulseAction 1.5s infinite; }
.widget__hint.rent-welcome {
    border: 2px solid rgba(0, 160, 130, 0.28);
    font-size: 11px; line-height: 1.5;
}
@keyframes hintPulseAction {
    0% { box-shadow: 0 0 0 0 rgba(255, 194, 68, 0.5); transform: scale(1); }
    50% { box-shadow: 0 0 0 10px rgba(255, 194, 68, 0); transform: scale(1.02); }
    100% { box-shadow: 0 0 0 0 rgba(255, 194, 68, 0); transform: scale(1); }
}
