* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --green: #5AE5BE;
    --grey: #7B9794;
    --orange: #EA8B37;
    --white: #F4F2F2;
    color-scheme: light only;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #303734;
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.map-container {
    background-color: var(--white);
    width: 100%;
    height: 65vh;
    overflow: hidden;
    position: relative;
    cursor: grab;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-container.grabbing { cursor: grabbing; }

.map-widget {
    height: 100%;
    aspect-ratio: 1/1;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.top-panel {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px;
    background: #303734;
    transition: all 0.3s ease;
}

.route-points {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.point {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #e0e0e0;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    transition: color 0.2s;
}

.star {
    width: 40px;
    height: 40px;
    display: inline-block;
    -webkit-mask-image: url('img/star.svg');
    mask-image: url('img/star.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.star.green  { background-color: var(--green); }
.star.orange { background-color: var(--orange); }

.top-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.promo-badge {
    text-align: center;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2d3439;
    border: 1px solid #3d4449;
    border-radius: 12px;
    padding: 8px 12px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.promo-badge.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.promo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.promo-title {
    font-size: 15px;
    font-weight: 700;
    color: #4ade80;
    letter-spacing: 0.5px;
    text-align: center;
}

.top-icons {
    display: flex;
    gap: 8px;
}

.icon-btn {
    border-radius: 3px;
    border: 1px solid #3d4449;
    background: #2d3439;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    transition: background 0.2s;
}

.icon-btn > img {
    width: 20px;
    height: 20px;
}

.expanded-view {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

.top-panel.expanded .expanded-view {
    max-height: 500px;
    opacity: 1;
}

.route-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0;
}

.route-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #e0e0e0;
    margin-left: 20px;
}

.route-list-star {
    width: 20px;
    height: 20px;
    color: var(--grey);
}

.route-list-text { flex: 1; }

.route-card {
    margin: 0 16px;
    background: #3d4449;
    border-radius: 16px;
    padding: 16px 20px 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.time-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.time-big {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.time-arrow {
    font-size: 18px;
    color: #888;
}

.distance {
    font-size: 13px;
    color: #9aa3ab;
    margin-top: 4px;
}

.start-btn {
    background: #f97316;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.chart {
    width: 100%;
    margin-bottom: 14px;
}

.legend {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #9aa3ab;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.green  { background: #4ade80; }
.legend-dot.orange { background: #f97316; }

.transport-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    margin-top: auto;
    background-color: #303734;
}

.transport-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: none;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #303734;
    transition: all 0.2s;
}

.transport-btn > img {
    width: 30px;
    height: 30px;
}

.transport-btn.active {
    background: #414E4D;
    border: 1px solid var(--green);
}

@media (max-width: 480px) {
    .top-right {
        flex-direction: column;
        align-items: flex-end;
    }

    .top-icons { order: 1; }

    .promo-badge {
        order: 2;
        margin-top: 10px;
        width: 90%;
        justify-content: center;
    }

    .promo-title {
        font-size: 10px;
        font-weight: 600;
    }

    .time-big { font-size: 18px; }

    .start-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .map-container {
        width: 100%;
        aspect-ratio: 1/1;
        height: auto;
    }
}

.scooter-animation {
    position: absolute;
    bottom: -13px;
    left: -120px;
    width: 120px;
    height: auto;
    z-index: 10;
    animation: moveScooter 12s linear infinite;
    pointer-events: none;
}

.scooter-animation img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

@keyframes moveScooter {
    0%   { left: -120px;              transform: scaleX(1); }
    45%  { left: calc(100% + 20px);   transform: scaleX(1); }
    50%  { left: calc(100% + 20px);   transform: scaleX(-1); }
    95%  { left: -120px;              transform: scaleX(-1); }
    100% { left: -120px;              transform: scaleX(1); }
}

.map-container.zoomed .scooter-animation {
    display: none;
}

/* Hover только там, где есть мышь */
@media (hover: hover) {
    .point:hover        { color: var(--green); }
    .icon-btn:hover     { background: #3d4449; }
    .start-btn:hover    { background: #ea6a10; }
    .transport-btn:hover { background: #414E4D; }
}

/* Отклик на нажатие на тач-устройствах */
.point:active         { color: var(--green); }
.icon-btn:active      { background: #3d4449; }
.start-btn:active     { background: #ea6a10; }
.transport-btn:active { background: #414E4D; }