* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    overflow: hidden;
    background: #000;
    font-family: 'Arial', sans-serif;
    touch-action: none;
}

#info {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    background: rgba(0, 0, 0, 0.85);
    padding: 15px;
    border-radius: 8px;
    z-index: 100;
    border: 1px solid rgba(0, 168, 255, 0.3);
    max-width: 280px;
    transition: opacity 0.3s;
}

#info h2 {
    margin-bottom: 10px;
    color: #00a8ff;
    font-size: 18px;
}

#info p {
    margin: 5px 0;
    font-size: 13px;
    line-height: 1.4;
}

#system-selector {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.85);
    padding: 10px 15px;
    border-radius: 8px;
    z-index: 100;
    border: 1px solid rgba(0, 168, 255, 0.3);
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: center;
    max-width: 90vw;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

#system-selector::-webkit-scrollbar {
    display: none;
}

.system-btn {
    padding: 10px 16px;
    border: 2px solid #00a8ff;
    background: transparent;
    color: #00a8ff;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    white-space: nowrap;
    font-size: 14px;
    flex-shrink: 0;
}

.system-btn:hover {
    background: rgba(0, 168, 255, 0.3);
}

.system-btn.active {
    background: #00a8ff;
    color: #000;
}

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

#planet-info {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.9);
    padding: 12px 16px;
    border-radius: 8px;
    z-index: 100;
    border: 1px solid rgba(0, 168, 255, 0.4);
    display: none;
    width: 85%;
    max-width: 400px;
    max-height: 35vh;
    overflow-y: auto;
}

#planet-info h3 {
    font-size: 14px;
    margin-bottom: 6px;
    color: #00a8ff;
    text-align: center;
}

#planet-info p {
    font-size: 11px;
    margin: 3px 0;
    line-height: 1.3;
}

#blackhole-info {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.9);
    padding: 12px 16px;
    border-radius: 8px;
    z-index: 100;
    border: 1px solid rgba(138, 43, 226, 0.5);
    display: none;
    width: 85%;
    max-width: 400px;
    max-height: 35vh;
    overflow-y: auto;
}

#blackhole-info h3 {
    font-size: 14px;
    margin-bottom: 6px;
    color: #da70d6;
    text-align: center;
}

#blackhole-info p {
    font-size: 11px;
    margin: 3px 0;
    line-height: 1.3;
}

#blackhole-jump-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #8a2be2 0%, #9932cc 100%);
    color: #fff;
    border: 2px solid rgba(138, 43, 226, 0.5);
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.3s;
}

#blackhole-jump-btn:hover {
    background: linear-gradient(135deg, #9932cc 0%, #8a2be2 100%);
    border-color: rgba(138, 43, 226, 0.8);
    transform: scale(1.02);
}

#blackhole-jump-btn:active {
    transform: scale(0.98);
}

#levski-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%);
    color: #fff;
    border: 2px solid rgba(76, 175, 80, 0.5);
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.3s;
}

#levski-btn:hover {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    border-color: rgba(76, 175, 80, 0.8);
    transform: scale(1.02);
}

#levski-btn:active {
    transform: scale(0.98);
}

#station-jump-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #00aa00 0%, #00ff00 100%);
    color: #fff;
    border: 2px solid rgba(0, 255, 0, 0.5);
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.3s;
}

#station-jump-btn:hover {
    background: linear-gradient(135deg, #00ff00 0%, #00aa00 100%);
    border-color: rgba(0, 255, 0, 0.8);
    transform: scale(1.02);
}

#station-jump-btn:active {
    transform: scale(0.98);
}

#checkmate-jump-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #aa0000 0%, #ff0000 100%);
    color: #fff;
    border: 2px solid rgba(255, 0, 0, 0.5);
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.3s;
}

#checkmate-jump-btn:hover {
    background: linear-gradient(135deg, #ff0000 0%, #aa0000 100%);
    border-color: rgba(255, 0, 0, 0.8);
    transform: scale(1.02);
}

#checkmate-jump-btn:active {
    transform: scale(0.98);
}

#grimhex-jump-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #554433 0%, #887766 100%);
    color: #fff;
    border: 2px solid rgba(136, 119, 102, 0.5);
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.3s;
}

#grimhex-jump-btn:hover {
    background: linear-gradient(135deg, #887766 0%, #554433 100%);
    border-color: rgba(136, 119, 102, 0.8);
    transform: scale(1.02);
}

#grimhex-jump-btn:active {
    transform: scale(0.98);
}

#time-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #fff;
    background: rgba(0, 0, 0, 0.85);
    padding: 12px;
    border-radius: 8px;
    z-index: 100;
    border: 1px solid rgba(0, 168, 255, 0.3);
    min-width: 180px;
}

#time-controls label {
    display: block;
    margin-bottom: 8px;
    color: #00a8ff;
    font-size: 13px;
}

#time-controls input[type="range"] {
    width: 100%;
    margin: 5px 0;
    height: 6px;
    -webkit-appearance: none;
    background: rgba(0, 168, 255, 0.3);
    border-radius: 3px;
    outline: none;
}

#time-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #00a8ff;
    border-radius: 50%;
    cursor: pointer;
}

#time-controls input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

#time-scale-value {
    font-size: 12px;
    color: #00a8ff;
    margin: 5px 0;
}

#time-display {
    position: absolute;
    top: 100px;
    left: 10px;
    color: #fff;
    background: rgba(0, 0, 0, 0.85);
    padding: 8px 12px;
    border-radius: 8px;
    z-index: 100;
    border: 1px solid rgba(0, 168, 255, 0.3);
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

#asteroid-info {
    position: absolute;
    top: 100px;
    right: 10px;
    color: #fff;
    background: rgba(0, 0, 0, 0.85);
    padding: 8px 12px;
    border-radius: 8px;
    z-index: 100;
    border: 1px solid rgba(0, 168, 255, 0.3);
    font-size: 12px;
}

#center-buttons {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    z-index: 100;
}

#zoom-btn {
    color: #fff;
    background: rgba(0, 168, 255, 0.85);
    padding: 12px 24px;
    border-radius: 8px;
    border: 1px solid rgba(0, 168, 255, 0.3);
    cursor: pointer;
    display: none;
    font-weight: bold;
    font-size: 14px;
    width: auto;
}

#zoom-btn:hover {
    background: rgba(0, 168, 255, 0.95);
}

#zoom-btn:active {
    transform: scale(0.95);
}

#route-btn {
    color: #fff;
    background: linear-gradient(135deg, #0066cc 0%, #0088ff 100%);
    padding: 12px 20px;
    border-radius: 8px;
    border: 2px solid rgba(0, 136, 255, 0.5);
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s;
    width: auto;
}

#route-btn:hover {
    background: linear-gradient(135deg, #0088ff 0%, #0066cc 100%);
    border-color: rgba(0, 136, 255, 0.8);
    transform: scale(1.02);
}

#route-btn:active {
    transform: scale(0.98);
}

#overview-btn {
    color: #fff;
    background: rgba(0, 255, 136, 0.85);
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 136, 0.3);
    cursor: pointer;
    display: none;
    font-weight: bold;
    font-size: 14px;
    width: auto;
}

#overview-btn:hover {
    background: rgba(0, 255, 136, 0.95);
}

#overview-btn:active {
    transform: scale(0.95);
}

.system-label {
    position: absolute;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 168, 255, 0.8);
    pointer-events: none;
    z-index: 50;
}

.blackhole-label {
    position: absolute;
    color: #da70d6;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(218, 112, 214, 0.8);
    pointer-events: none;
    z-index: 50;
    background: rgba(138, 43, 226, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
}

.planet-label {
    position: absolute;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 168, 255, 0.8);
    pointer-events: none;
    z-index: 60;
    white-space: nowrap;
    border: 1px solid rgba(0, 168, 255, 0.3);
}

.jump-label {
    position: absolute;
    color: #00ff88;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.8);
    pointer-events: none;
    z-index: 60;
    white-space: nowrap;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

#jump-notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background: rgba(138, 43, 226, 0.95);
    padding: 25px 40px;
    border-radius: 15px;
    z-index: 200;
    border: 2px solid rgba(138, 43, 226, 0.5);
    font-size: 20px;
    font-weight: bold;
    display: none;
    text-align: center;
    box-shadow: 0 0 50px rgba(138, 43, 226, 0.8);
    max-width: 90vw;
}

#jump-notification span {
    display: block;
    font-size: 13px;
    margin-top: 10px;
    opacity: 0.8;
}

/* === МОБИЛЬНАЯ НАВИГАЦИОННАЯ ПАНЕЛЬ === */
#mobile-nav {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    padding: 10px;
    z-index: 150;
    border-top: 1px solid rgba(0, 168, 255, 0.3);
}

#mobile-nav .nav-buttons {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
}

#mobile-nav .nav-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #00a8ff;
    background: rgba(0, 168, 255, 0.2);
    color: #00a8ff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s;
    text-align: center;
}

#mobile-nav .nav-btn:active {
    background: rgba(0, 168, 255, 0.5);
    transform: scale(0.95);
}

#mobile-nav .nav-btn.active {
    background: #00a8ff;
    color: #000;
}

/* === АДАПТАЦИЯ ДЛЯ ПЛАНШЕТОВ И СМАРТФОНОВ === */
@media (max-width: 768px) {
    #info {
        top: auto;
        bottom: 10px;
        left: 10px;
        max-width: 200px;
        padding: 10px;
    }

    #info h2 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    #info p {
        font-size: 11px;
    }

    #system-selector {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
        padding: 8px 10px;
    }

    .system-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    #time-controls {
        top: 10px;
        right: 10px;
        min-width: 150px;
        padding: 10px;
    }

    #time-controls label {
        font-size: 12px;
    }

    #time-display {
        top: 80px;
        left: 10px;
        font-size: 12px;
    }

    #asteroid-info {
        top: 80px;
        right: 10px;
        font-size: 11px;
        padding: 6px 10px;
    }

    /* Панели информации теперь всегда вверху по центру */
    #planet-info,
    #blackhole-info {
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        max-width: 85%;
        border-radius: 8px;
    }

    #zoom-btn,
    #route-btn,
    #overview-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .blackhole-label {
        font-size: 11px;
        padding: 4px 8px;
    }

    #jump-notification {
        padding: 20px 30px;
        font-size: 18px;
        width: 85vw;
    }

    #jump-notification span {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    #info {
        max-width: 180px;
        font-size: 10px;
    }

    #info h2 {
        font-size: 14px;
    }

    #info p {
        font-size: 10px;
    }

    .system-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    #time-controls {
        min-width: 120px;
        padding: 8px;
    }

    #time-scale-value {
        font-size: 11px;
    }

    #planet-info, #blackhole-info {
        max-width: 90%;
        font-size: 12px;
    }

    .blackhole-label {
        font-size: 10px;
    }
}

/* === 📱 СВАЙП МЕНЮ (IMPROVED WHEEL PICKER) === */
#swipe-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

#swipe-menu.open {
    display: flex;
    opacity: 1;
}

#swipe-menu-content {
    position: relative;
    background: linear-gradient(180deg,
        rgba(0, 20, 40, 0.95) 0%,
        rgba(0, 30, 60, 0.98) 50%,
        rgba(0, 20, 40, 0.95) 100%);
    border: 1px solid rgba(0, 168, 255, 0.4);
    border-radius: 20px;
    box-shadow:
        0 0 40px rgba(0, 168, 255, 0.3),
        inset 0 0 60px rgba(0, 168, 255, 0.1);
    padding: 20px 0;
    max-width: 320px;
    width: 90%;
    max-height: 70vh;
    overflow: hidden;
}

/* Заголовок меню */
#swipe-menu-header {
    text-align: center;
    padding: 0 20px 15px;
    border-bottom: 1px solid rgba(0, 168, 255, 0.2);
    margin-bottom: 10px;
}

#swipe-menu-title {
    color: #00a8ff;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 168, 255, 0.5);
    margin: 0;
}

#swipe-menu-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin-top: 5px;
}

/* Кнопка закрытия */
#swipe-menu-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 168, 255, 0.3);
    border-radius: 50%;
    color: #00a8ff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

#swipe-menu-close:hover,
#swipe-menu-close:active {
    background: rgba(0, 168, 255, 0.3);
    transform: scale(1.1);
}

/* Контейнер пикера */
.swipe-picker-container {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.swipe-picker-track {
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: y mandatory;
}

.swipe-picker-track::-webkit-scrollbar {
    display: none;
}

#swipe-menu-items {
    padding: 110px 0;  /* (280 - 60) / 2 = 110 */
}

/* Градиентные маски сверху и снизу */
.swipe-picker-container::before,
.swipe-picker-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 80px;
    pointer-events: none;
    z-index: 5;
}

.swipe-picker-container::before {
    top: 0;
    background: linear-gradient(180deg,
        rgba(0, 30, 60, 1) 0%,
        rgba(0, 30, 60, 0.8) 40%,
        rgba(0, 30, 60, 0) 100%);
}

.swipe-picker-container::after {
    bottom: 0;
    background: linear-gradient(0deg,
        rgba(0, 30, 60, 1) 0%,
        rgba(0, 30, 60, 0.8) 40%,
        rgba(0, 30, 60, 0) 100%);
}

.swipe-picker-highlight {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 50px;
    width: calc(100% - 40px);
    background: linear-gradient(90deg,
        rgba(0, 168, 255, 0) 0%,
        rgba(0, 168, 255, 0.2) 15%,
        rgba(0, 168, 255, 0.25) 50%,
        rgba(0, 168, 255, 0.2) 85%,
        rgba(0, 168, 255, 0) 100%);
    border-top: 2px solid rgba(0, 168, 255, 0.5);
    border-bottom: 2px solid rgba(0, 168, 255, 0.5);
    pointer-events: none;
    box-shadow:
        0 0 30px rgba(0, 168, 255, 0.3),
        inset 0 0 20px rgba(0, 168, 255, 0.1);
    z-index: 6;
    border-radius: 8px;
}

/* Индикатор выбора */
.swipe-picker-indicator {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 30px;
    background: #00a8ff;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(0, 168, 255, 0.8);
    z-index: 7;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.swipe-picker-indicator.active {
    opacity: 1;
}

.swipe-menu-btn {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    padding: 0 20px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    text-shadow: 0 0 5px rgba(0, 168, 255, 0.2);
    position: relative;
}

.swipe-menu-btn.picker-centered {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-shadow:
        0 0 15px rgba(0, 168, 255, 1),
        0 0 30px rgba(0, 168, 255, 0.6),
        0 0 45px rgba(0, 168, 255, 0.3);
    transform: scale(1.08);
}

.swipe-menu-btn.picker-adjacent {
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    text-shadow: 0 0 8px rgba(0, 168, 255, 0.4);
}

.swipe-menu-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

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

.swipe-menu-btn.jump-point {
    color: rgba(218, 112, 214, 0.4);
    text-shadow: 0 0 5px rgba(218, 112, 214, 0.2);
}

.swipe-menu-btn.jump-point.picker-centered {
    color: #da70d6;
    text-shadow:
        0 0 15px rgba(218, 112, 214, 1),
        0 0 30px rgba(218, 112, 214, 0.6),
        0 0 45px rgba(218, 112, 214, 0.3);
}

.swipe-menu-btn.moon {
    color: rgba(0, 255, 136, 0.4);
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.2);
}

.swipe-menu-btn.moon.picker-centered {
    color: #00ff88;
    text-shadow:
        0 0 15px rgba(0, 255, 136, 1),
        0 0 30px rgba(0, 255, 136, 0.6),
        0 0 45px rgba(0, 255, 136, 0.3);
}

/* Кнопка подтверждения выбора */
#swipe-menu-confirm {
    margin: 15px 20px 0;
    padding: 14px 24px;
    background: linear-gradient(135deg, #00a8ff 0%, #0066cc 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px rgba(0, 168, 255, 0.4);
    width: calc(100% - 40px);
}

#swipe-menu-confirm:hover,
#swipe-menu-confirm:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 168, 255, 0.5);
}

#swipe-menu-confirm:disabled {
    background: linear-gradient(135deg, #444 0%, #333 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Подсказка свайпа - скрыта */
#swipe-hint {
    display: none;
}

/* Закрытие по клику на оверлей */
#swipe-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

#swipe-menu-content {
    z-index: 2;
    pointer-events: auto;
}

/* Элементы меню должны быть кликабельными */
.swipe-picker-container,
.swipe-picker-track,
#swipe-menu-items,
.swipe-menu-btn {
    pointer-events: auto;
}
