/* GLOBAL THEME */
body {
    background-color: #121212;
    color: #f1f1f1;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers all top-level children */
    min-height: 100vh;
}

/* NAVIGATION BAR */
nav {
    width: 100%;
    background: #1a1a1a;
    border-bottom: 3px solid #55ff55;
    display: flex;
    justify-content: center;
    padding: 15px 0;
    flex-shrink: 0;
    z-index: 1000;
}

nav a {
    color: #f1f1f1;
    text-decoration: none;
    margin: 0 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

nav a:hover, nav a.active {
    color: #55ff55;
    border-bottom: 2px solid #55ff55;
}

/* CONTAINER FOR PAGE CONTENT */
.container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Forces status area and cards to center */
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

h1 {
    color: #55ff55;
    text-shadow: 2px 2px #000;
    margin-top: 20px;
    text-align: center;
}

/* SERVER STATUS STYLES */
#status-area {
    margin: 10px 0;
    text-align: center;
}

.status-badge {
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    display: inline-block;
    margin: 10px 0;
    letter-spacing: 1px;
}

.online { 
    background: #1b4d1b; 
    color: #55ff55; 
    border: 1px solid #55ff55; 
}

.offline { 
    background: #4d1b1b; 
    color: #ff5555; 
    border: 1px solid #ff5555; 
}

#status-area p {
    font-size: 1.2em;
    margin-top: 5px;
    color: #d1d1d1;
}

/* PLAYER LIST GRID */
#player-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
    margin-top: 30px;
}

.player-card {
    background: #1e1e1e;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
    width: 120px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.player-card:hover {
    transform: translateY(-5px);
    border-color: #55ff55;
}

.player-card img {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.player-name {
    font-weight: bold;
    font-size: 0.9em;
    color: #fff;
}

/* CHAT PAGE STYLES */
#chat-container {
    width: 90%;
    max-width: 850px;
    background-color: #1e1e1e;
    border: 2px solid #333;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#chat-window {
    height: 65vh;
    overflow-y: auto;
    padding: 20px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: #0a0a0a;
    text-align: left;
    line-height: 1.5;
}

.chat-line { 
    margin-bottom: 8px; 
    border-bottom: 1px solid #1a1a1a; 
    padding-bottom: 4px;
    word-wrap: break-word;
}

.player-name-chat { 
    color: #55ff55; 
    font-weight: bold; 
    margin-right: 8px; 
}

/* MAP PAGE STYLES */
#map-frame {
    flex-grow: 1;
    border: none;
    width: 100%;
}

/* UTILITIES & FOOTER */
.footer { 
    padding: 12px; 
    background: #252525; 
    font-size: 11px; 
    color: #666; 
    text-align: center; 
    width: 100%; 
    border-top: 1px solid #333;
}

.system-msg { 
    color: #888; 
    font-style: italic; 
    text-align: center; 
    margin-top: 10px; 
}

/* For Map Page only: ensure no scrollbars on body */
.map-body {
    overflow: hidden;
    height: 100vh;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}
.leaderboard-table th, .leaderboard-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.leaderboard-table th { background: rgba(0, 0, 0, 0.2); }
.leaderboard-table img { vertical-align: middle; margin-right: 8px; border-radius: 2px; }
