* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: #1a1a1a;
}

#map {
    height: 100%;
    width: 100%;
}

.geo-error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.geo-error-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.error-content {
    text-align: center;
    padding: 30px;
    max-width: 320px;
    animation: fadeInUp 0.5s ease;
}

.error-icon {
    width: 100px;
    height: 100px;
    background: #f03a3a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 60px;
    font-weight: bold;
    color: white;
    box-shadow: 0 10px 30px rgba(240, 58, 58, 0.3);
}

.error-title {
    color: white;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.error-message {
    color: #888;
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.error-refresh-btn {
    background: #f03a3a;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(240, 58, 58, 0.3);
    width: 100%;
}

.error-refresh-btn:hover {
    background: #d02a2a;
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(240, 58, 58, 0.4);
}

.error-refresh-btn:active {
    transform: scale(0.95);
}

.telegram-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    background: #f03a3a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(240, 58, 58, 0.3);
    z-index: 1500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.telegram-btn:hover {
    transform: scale(1.1);
    background: #d02a2a;
}

.telegram-btn svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.telegram-btn.hidden,
.distance-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.distance-panel {
    position: fixed;
    bottom: 20px;
    left: 10px;
    right: 10px;
    background: #2d2d2d;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s ease;
}

.panel-header {
    background: #f03a3a;
    color: white;
    padding: 4px 16px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.refresh-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.refresh-btn:hover {
    background: rgba(255,255,255,0.2);
}

.refresh-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.refresh-btn.rotating svg {
    animation: rotate 1s linear infinite;
}

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

.dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    display: inline-block;
}

.distances {
    padding: 4px 16px;
    max-height: 200px;
    overflow-y: auto;
    background: #2d2d2d;
}

.distance-item {
    padding: 10px 0;
    color: white;
    border-bottom: 1px solid #404040;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.distance-item:hover {
    background: #3d3d3d;
}

.distance-item:last-child {
    border-bottom: none;
}

.distance-name {
    font-weight: 500;
    color: #f03a3a;
    display: block;
    margin-bottom: 4px;
}

.distance-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #888;
    font-size: 12px;
    width: 100%;
}

.distance-route {
    color: white;
    flex: 1;
    margin-right: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.distance-value {
    color: #f03a3a;
    font-weight: 600;
    flex-shrink: 0;
}

.modal {
    position: fixed;
    top: 20px;
    left: 10px;
    right: 10px;
    background: #2d2d2d;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    max-width: 400px;
    margin: 0 auto;
    z-index: 2000;
    display: none;
}

.modal-header {
    background: #f03a3a;
    color: white;
    padding: 6px 16px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.modal-content {
    padding: 20px;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid #404040;
    border-radius: 8px;
    font-size: 14px;
    background: #3d3d3d;
    color: white;
}

.modal-content input::placeholder,
.modal-content textarea::placeholder {
    color: #888;
}

.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #f03a3a;
}

.save-btn {
    width: 100%;
    padding: 12px;
    background: #f03a3a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.save-btn:hover {
    background: #d02a2a;
}

.toast-container {
    position: fixed;
    top: 80px;
    left: 10px;
    right: 10px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.toast {
    background: #2d2d2d;
    border-left: 4px solid #f03a3a;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
    width: 100%;
    max-width: 400px;
    color: white;
    pointer-events: auto;
}

.toast.success {
    border-left-color: #4caf50;
}

.toast.error {
    border-left-color: #f44336;
}

.toast.info {
    border-left-color: #f03a3a;
}

@keyframes slideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ymaps-2-1-79-map {
    filter: none !important;
}

.ymaps-2-1-79-copyrights-pane {
    display: none !important;
}

.top-buttons {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 1500;
}

.account-btn {
    width: 48px;
    height: 48px;
    background: #f03a3a;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(240, 58, 58, 0.3);
    transition: all 0.3s ease;
    padding: 0;
}

.account-btn:hover {
    transform: scale(1.1);
    background: #d02a2a;
}

.account-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.profile-panel {
    position: fixed;
    top: 80px;
    left: 20px;
    right: 20px;
    max-width: 400px;
    background: #2d2d2d;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 2000;
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

.profile-panel.hidden {
    display: none;
}

.profile-header {
    background: #f03a3a;
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.close-profile-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-profile-btn:hover {
    background: rgba(255,255,255,0.2);
}

.profile-content {
    padding: 20px;
    color: white;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.profile-label {
    color: #888;
    font-size: 14px;
}

.profile-value {
    font-size: 16px;
    word-break: break-all;
}

.collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.collapse-btn:hover {
    background: rgba(255,255,255,0.2);
}

.collapse-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
    transition: transform 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.points-counter {
    position: fixed;
    top: 45px;
    right: 10px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1500;
}

.points-counter .dot {
    width: 10px;
    height: 10px;
    background: #f03a3a;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(240, 58, 58, 0.5);
}

.points-counter .count {
    color: #f03a3a;
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 0 8px rgba(240, 58, 58, 0.3);
}

.points-counter.hidden {
    display: none;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.profile-panel.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    border-radius: 0;
    background: #1a1a1a;
    z-index: 10000;
}

.profile-panel.fullscreen .profile-header {
    border-radius: 0;
    padding: 12px 16px;
}

.profile-panel.fullscreen .profile-content {
    padding: 16px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.back-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.back-btn:hover {
    background: rgba(255,255,255,0.2);
}

.back-btn svg {
    width: 22px;
    height: 22px;
    fill: white;
}

.profile-id-card {
    background: #2A2A2A;
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.id-icon {
    width: 22px;
    height: 22px;
    fill: #F03A3A;
    flex-shrink: 0;
}

.id-content {
    flex: 1;
}

.id-label {
    color: #888;
    font-size: 12px;
    margin-bottom: 2px;
}

.id-value {
    color: white;
    font-size: 15px;
    font-weight: 500;
    font-family: 'SF Mono', 'Courier New', monospace;
}

.profile-subscription-card {
    background: #2A2A2A;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid #333;
}

.subscription-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.subscription-icon {
    width: 22px;
    height: 22px;
    fill: #F03A3A;
}

.subscription-label {
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.subscription-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subscription-text {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.subscription-days {
    background: #F03A3A;
    border-radius: 30px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    white-space: nowrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.stat-card {
    background: #2A2A2A;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid #333;
}

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

.stat-icon {
    width: 22px;
    height: 22px;
    fill: #F03A3A;
}

.stat-label {
    color: #888;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
}

.stat-value {
    color: white;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    margin-left: 30px;
}

.profile-section {
    background: #2A2A2A;
    border-radius: 14px;
    padding: 12px 16px;
    border: 1px solid #333;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.section-icon {
    width: 22px;
    height: 22px;
    fill: #F03A3A;
}

.toggle-container {
    background: #1F1F1F;
    border-radius: 30px;
    padding: 2px;
    display: flex;
}

.toggle-option {
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #888;
}

.toggle-option.active {
    background: #F03A3A;
    color: white;
}

.point-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.point-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.point-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.point-modal-content {
    position: fixed;
    background: #1A1A1A;
    left: 10px;
    right: 10px;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
}

.point-modal.active .point-modal-content {
    transform: translateY(0);
}

.point-modal-header {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #2A2A2A;
}

.point-modal-title {
    font-size: 16px;
    font-weight: 500;
    color: #F03A3A;
    line-height: 1.4;
    word-break: break-word;
    flex: 1;
}

.point-modal-close {
    background: #2A2A2A;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.point-modal-close:hover {
    background: #333;
}

.point-modal-close:active {
    transform: scale(0.96);
}

.point-modal-body {
    padding: 20px;
}

.point-modal-route {
    background: #2A2A2A;
    padding: 12px 16px;
    border-radius: 14px;
    margin-bottom: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    word-break: break-word;
}

.point-modal-comment {
    background: #2A2A2A;
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 8px;
    color: white;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.point-modal-time {
    color: #888;
    font-size: 12px;
    margin-bottom: 20px;
}

.point-modal-actions {
    display: flex;
    gap: 8px;
}

.point-modal-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: none;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: #2A2A2A;
    color: white;
}

.point-modal-btn:active {
    transform: scale(0.96);
}

.like-btn {
    background: #2A2A2A;
}

.report-btn, .delete-btn {
    background: #2A2A2A;
}

.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11000;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.confirm-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.confirm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.confirm-modal-content {
    position: relative;
    background: #1A1A1A;
    border-radius: 24px;
    width: 280px;
    padding: 24px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.confirm-modal.active .confirm-modal-content {
    transform: scale(1);
}

.confirm-modal-content svg {
    margin-bottom: 12px;
}

.confirm-modal-content p {
    color: white;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
}

.confirm-modal-actions {
    display: flex;
    gap: 8px;
}

.confirm-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: #2A2A2A;
    color: white;
}

.confirm-btn:active {
    transform: scale(0.96);
}

.confirm-yes {
    background: #F03A3A;
}

.report-count {
    background: #f03a3a;
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}

.report-btn {
    position: relative;
}

.report-btn .report-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f03a3a;
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
}