* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 15px;
    color: #c8d0e0;
    font-size: 13px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
}

/* Header */
.header {
    background: linear-gradient(135deg, #0a0e1a, #1a1f2e);
    padding: 1rem 0;
    border-bottom: 2px solid #5a7a9a;
    margin-bottom: 1.5rem;
}

.header h1 {
    text-align: center;
    font-weight: 500;
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
    color: #c8d0e0;
}

.header h4 {
    text-align: center;
    font-weight: 200;
    opacity: 0.9;
    font-size: 0.9rem;
}

.text-center {
    text-align: center;
}

/* Navigation links */
.nav-links {
    margin-top: 0.75rem;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.nav-links a {
    color: #c8d0e0;
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    display: inline-block;
    font-size: 0.8rem;
}

.nav-links a:hover {
    background-color: rgba(90, 122, 154, 0.3);
    border-color: #5a7a9a;
}

/* Column headers */
.column-headers {
    display: flex;
    background: #2a2a4e;
    padding: 8px 20px;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    color: #ffaa66;
    font-size: 0.9rem;
    border-bottom: 1px solid #ff6b35;
}

.col-server {
    width: 380px;
    flex-shrink: 0;
}

.col-map {
    width: 170px;
    flex-shrink: 0;
}

.col-tickets {
    width: 146px;
    flex-shrink: 0;
}

.col-time {
    width: 96px;
    flex-shrink: 0;
}

.col-players {
    width: 90px;
    flex-shrink: 0;
}

.col-rotation {
    flex: 1;
    text-align: left;
    padding-left: 15px;
}

/* Server section */
.server-section {
    background: rgba(28, 32, 45, 0.95);
    border-radius: 0;
    overflow: hidden;
    border-bottom: 1px solid #3a4055;
}

.server-section:first-child {
    border-radius: 8px 8px 0 0;
}

.server-section:last-child {
    border-radius: 0 0 8px 8px;
}

/* Server row */
.server-row {
    display: flex;
    align-items: center;
    padding: 6px 20px;
    background: rgba(28, 32, 45, 0.95);
    transition: background 0.2s ease;
}

.server-name {
    width: 380px;
    flex-shrink: 0;
    color: #ffaa66;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

.current-map {
    width: 200px;
    flex-shrink: 0;
    font-size: 0.8rem;
    color: #aad0ff;
    white-space: nowrap;
    overflow-x: auto;
}

.tickets-display {
    width: 120px;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.time-display {
    width: 100px;
    flex-shrink: 0;
    font-size: 0.8rem;
    color: #88ccff;
}

.players-display {
    width: 80px;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.players-count {
    font-weight: bold;
}

.players-count.active {
    color: #66aaff;
}

.players-count.full {
    color: #ff6666;
}

/* Buttons container */
.button-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

/* Expand button with indicator */
.expand-with-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.expand-btn {
    background: #3a4055;
    border: 1px solid #5a7a9a;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 0.7rem;
    color: #c8d0e0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.expand-btn:hover {
    background: #5a7a9a;
    color: #fff;
}

.server-indicator {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.8rem;
    color: #8ab3cf;
    cursor: pointer;
}

.server-section.expanded .server-indicator {
    transform: rotate(180deg);
}

/* Stats button - Live Battlezone Telemetry */
.stats-btn {
    background: linear-gradient(135deg, #ff6b35, #ff8844);
    border: none;
    border-radius: 20px;
    padding: 5px 16px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    position: relative;
    margin-left: 15px;
}

.stats-btn:hover {
    background: linear-gradient(135deg, #ff8844, #ffaa66);
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.stats-btn:hover::after {
    content: "Click for detailed server statistics including player stats, graphs, and match history";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    border: 1px solid #ff6b35;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: normal;
    white-space: nowrap;
    color: #ffaa66;
    z-index: 100;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.stats-btn-zero {
    background: linear-gradient(135deg, #555, #666);
    border: none;
    border-radius: 20px;
    padding: 5px 16px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-left: 15px;
}

.stats-btn-zero:hover {
    background: linear-gradient(135deg, #666, #777);
    transform: scale(1.02);
}

.stats-btn-zero:hover::after {
    content: "Click for server statistics (server currently empty)";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    border: 1px solid #ff6b35;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.7rem;
    white-space: nowrap;
    color: #ffaa66;
    z-index: 100;
    margin-bottom: 8px;
}

/* Server content */
.server-content {
    display: none;
    padding: 12px 20px;
    border-top: 1px solid #3a4055;
    background: rgba(0, 0, 0, 0.3);
}

.server-section.expanded .server-content {
    display: block;
}

/* Map table */
.table-wrapper {
    margin-bottom: 12px;
    width: 100%;
    overflow-x: auto;
}

.map-table {
    width: 100%;
    border-collapse: collapse;
    background: #1e2230;
    border-radius: 6px;
}

.map-table tr {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 3px;
}

.map-table td {
    flex: 1 0 auto;
    padding: 4px 8px;
    margin: 1px;
    border: 1px solid #3a4055;
    border-radius: 4px;
    font-size: 0.7rem;
    background: #252a3a;
    text-align: center;
    max-width: 180px;
    white-space: nowrap;
    overflow-x: auto;
}

.map-table td.current-map {
    background: #2a4a6b;
    color: #fff;
    font-weight: bold;
    border-color: #6a9acd;
}

.map-table td.current-map a {
    color: #aad0ff;
    text-decoration: none;
    font-weight: bold;
}

.map-table td.current-map a:hover {
    text-decoration: underline;
}

.map-table td.map-link a {
    color: #ffaa66;
    text-decoration: none;
}

.map-table td.map-link a:hover {
    text-decoration: underline;
}

/* Rotation direction indicator */
.rotation-direction {
    font-size: 0.65rem;
    color: #8ab3cf;
    text-align: center;
    margin-bottom: 8px;
    padding: 2px;
    border-bottom: 1px dotted #3a4055;
}

/* Stats panel */
.stats-panel {
    background: #161a25;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 0.7rem;
}

.stats-line {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 5px;
}

.time-remaining {
    font-weight: bold;
    color: #ffaa66;
}

.time-remaining.urgent {
    color: #ffaa66;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.tickets {
    font-weight: bold;
    color: #ffaa66;
}

.players {
    font-weight: bold;
}

.players.active {
    color: #66aaff;
}

.players.full {
    color: #ff6666;
}

.alert {
    background: #5a3a2a;
    color: #ffe0cc;
    padding: 6px 10px;
    border-radius: 4px;
    margin: 8px 0;
    text-align: center;
    font-weight: bold;
    font-size: 0.7rem;
    animation: pulse 1s infinite;
}

.previous-maps {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #3a4055;
}

.previous-maps .label {
    font-weight: bold;
    color: #8ab3cf;
    font-size: 0.7rem;
}

.previous-map {
    background: #252a3a;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-family: monospace;
    color: #aab8c5;
}

.game-settings-row {
    font-size: 0.65rem;
    color: #aaa;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid #3a4055;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.setting-item {
    margin-right: 3px;
}

.setting-label {
    color: #888;
}

.setting-value {
    color: #ffaa66;
}

.map-warning {
    color: #ffaa66;
    font-size: 0.65rem;
    margin-top: 3px;
    font-style: italic;
}

.time-of-day {
    color: #88ccff;
}

.legend {
    background: rgba(22, 26, 37, 0.9);
    padding: 3px;
    border-radius: 8px;
    margin: 4px auto;           /* center the block horizontally */
    display: grid;
    grid-template-columns: repeat(2, max-content);
	justify-content: center;
	gap: 2px 34px; 
    font-size: 0.75rem;
	width: fit-content; 
	max-width: 100%;
}

.legend h4 {
    grid-column: 1 / -1;
    color: #8ab3cf;
    margin-bottom: 8px;
    font-size: 1.0rem;
	text-align: left;
}

.legend-item {
	text-align: left;
	white-space: nowrap;
    margin: 2px 0;
    line-height: 0.8;
	font-size: 0.9rem;
}

.current-map-badge {
    display: inline-block;
    background: #2a4a6b;
    color: #aad0ff;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    margin-right: 6px;
    font-size: 0.75rem;
}

.badge {
    display: inline-block;
    background: #3a4055;
    color: #aac8e0;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: bold;
    margin-right: 6px;
    font-family: monospace;
    font-size: 0.65rem;
}

.clickable-status {
    cursor: pointer;
    border-bottom: 1px dashed #ff6b35;
}

.commands {
    background: rgba(22, 26, 37, 0.9);
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
}

.commands h4 {
    color: #8ab3cf;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.commands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 3px;
}

.command {
    background: #2a2a4e;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.65rem;
    color: #aad0ff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.command:hover {
    background: #5a7a9a;
    color: #ffffff;
}

.separator {
    margin: 15px 0;
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #5a7a9a, transparent);
}

/* Responsive */
@media (max-width: 1200px) {
    .column-headers {
        display: none;
    }
    .server-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    .server-name, .current-map, .tickets-display, .time-display, .players-display {
        width: auto;
    }
    .stats-btn:hover::after {
        white-space: normal;
        width: 200px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    body {
        padding: 8px;
    }
    .server-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    .button-container {
        flex-wrap: wrap;
    }
    .legend {
        grid-template-columns: 1fr; /* single column */
        width: 100%;
        white-space: normal;
    }
    .legend-item {
        white-space: normal;
    }	
    .commands-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}



/* Center the main server list */
.container {
    max-width: 1400px;
    margin: 0 auto;
}



/* Center the commands */
.commands {
    text-align: center;
}

.commands h4 {
    text-align: center;
}

.commands-grid {
    justify-content: center;
}


/* Tickets column header and values */
.col-tickets {
    text-align: center;
}

.tickets-header-is {
    color: #66aaff;
}

.tickets-header-clan {
    color: #ff6666;
}

.tickets-display {
    text-align: center;
}

.tickets-value-is {
    color: #66aaff;
}

.tickets-value-clan {
    color: #ff6666;
}

.tickets-separator {
    color: #c8d0e0; /* matches default text color */
}