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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #111;
    color: #fff;
}

#map {
    width: 100vw;
    height: 100vh;
}

/* Заставка */
#splashScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--tg-theme-bg-color, #ffffff);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.splash-content {
    text-align: center;
}

.splash-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    animation: float 2s ease-in-out infinite;
}

.splash-text {
    color: var(--tg-theme-text-color, #000000);
    font-size: 16px;
    margin-bottom: 15px;
}

.splash-loader {
    width: 30px;
    height: 30px;
    border: 3px solid var(--tg-theme-button-color, #40a7e3);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Нижняя панель */
#panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 10px;
    border-top: 2px solid #333;
    font-size: 13px;
    z-index: 100;
}

#panel h3 {
    margin-bottom: 8px;
    color: #aaa;
    font-size: 14px;
}

.msg-header {
    font-weight: bold;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
    margin-bottom: 5px;
    color: #aaa;
    display: grid;
    grid-template-columns: 80px 1fr 60px 40px 60px;
    gap: 5px;
}

.msg-row {
    padding: 3px 0;
    border-bottom: 1px solid #222;
    display: grid;
    grid-template-columns: 80px 1fr 60px 40px 60px;
    gap: 5px;
    font-family: monospace;
    font-size: 12px;
}

/* Кнопка ДПС */
#dpsBtn {
    position: absolute;
    left: 10px;
    bottom: 220px;
    padding: 12px 20px;
    background: #d00;
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    font-size: 16px;
}

#dpsList {
    position: absolute;
    left: 10px;
    bottom: 280px;
    background: rgba(0,0,0,0.95);
    color: white;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #444;
    border-radius: 10px;
    z-index: 1000;
    min-width: 280px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.7);
}

#dpsList h4 {
    margin-bottom: 10px;
    color: #d00;
}

.dps-item {
    padding: 8px;
    border-bottom: 1px solid #333;
    font-size: 13px;
}

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

.hidden {
    display: none !important;
}

/* Адаптация под Telegram */
body.dark {
    background: #1f1f1f;
    color: #fff;
}