body {
    font-family: Arial, sans-serif;
    max-width: 1050px;
    margin: 0 auto;
    padding: 20px;
}

#servers {
    width: 100%;
    border: 1px solid #ccc;
    padding: 10px;
    margin: 20px 0;
    background-color: #f9f9f9;
}

#servers tr {
    margin: 5px 0;
    padding: 5px;
    border-left: 3px solid #007bff;
    background-color: white;
}

#servers td {
    text-align: center;
}

#servers td.location {
    text-align: left;
    white-space: nowrap;
}

#servers td.stat-num {
    text-align: right;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

.timestamp {
    color: #666;
    font-size: 0.8em;
}

#hostInput {
    width: 200px;
    padding: 10px;
    margin-right: 5px;
}

#portSelect {
    padding: 10px;
    margin-right: 5px;
}

#customPort {
    width: 70px;
    padding: 10px;
    margin-right: 10px;
}

.input-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.status {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.connected {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.disconnected {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#map-container {
    overflow-x: scroll;
    width: 100%;
    margin-top: 15px;
}

#map {
    position: relative;
    overflow: hidden;
    background: url('https://pinger.netquirk.com/static/map.jpg') no-repeat;
    /* Original map: 90°N to 90°S (180°). We want 72°N to -55°S (127°) */
    /* Scale: 525px * 1.2 = 630px tall for better visibility */
    /* Top crop: (90-72)/180 * 630 = 63px */
    /* Visible height: (90+55)/180 * 630 - 63 = 507 - 63 = 444px */
    background-size: 1050px 630px;
    background-position: 0 -63px;
    width: 100%;
    height: 444px;
    min-width: 1050px;
}

#map > .marker {
    display: inline-block;
    position: absolute;
    width: 5px;
    height: 5px;
    background: yellow;
    border-radius: 3px;
    border: 1px solid #000;
}

#map > .radius {
    display: inline-block;
    position: absolute;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 999px;
    border: 1px solid;
    transform: translate(-50%, -50%);
    margin-left: 3px;
    margin-top: 3px;
}

#map > .ping-label {
    position: absolute;
    font-size: 10px;
    font-weight: bold;
    color: #000;
    background: rgba(255, 255, 255, 0.85);
    padding: 1px 3px;
    border-radius: 2px;
    white-space: nowrap;
    pointer-events: none;
    margin-left: 8px;
    margin-top: -4px;
}

#map > .marker {
    cursor: pointer;
    z-index: 10;
}

#mapTooltip {
    position: absolute;
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 100;
    pointer-events: none;
    min-width: 140px;
}

#mapTooltip .tooltip-header {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 6px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
}

#mapTooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
}

#mapTooltip .tooltip-label {
    color: #666;
    margin-right: 12px;
}

#mapTooltip .tooltip-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
}
