/* Castla Game Client Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.screen.hidden {
    display: none;
}

/* Loading Screen */
#loading-screen {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    z-index: 1000;
}

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

.loading-content h1 {
    font-size: 6rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

#loading-text {
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Login Screen */
#login-screen {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.login-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    min-width: 400px;
}

.login-content h1 {
    font-size: 5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.login-content p {
    margin-bottom: 2rem;
    opacity: 0.9;
    font-size: 1.1rem;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

/* Custom select dropdown styling */
.input-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 16 16'%3e%3cpath d='m7.247 4.86-4.796 5.481c-.566.647-.106 1.659.753 1.659h9.592a1 1 0 0 0 .753-1.659l-4.796-5.48a1 1 0 0 0-1.506 0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 45px;
    cursor: pointer;
}

.input-group select option {
    background: #1a1a1a;
    color: white;
    padding: 8px 12px;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #ffffff;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Input with button layout */
.input-with-button {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-button input {
    flex: 1;
}

.randomize-btn {
    min-width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
}

.randomize-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.randomize-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
}

/* Toggle Switch Styling */
.checkbox-group {
    margin: 20px 0;
}

.checkbox-group .input-group {
    margin-bottom: 0;
}

.toggle-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.4;
    width: 100%;
    flex-wrap: nowrap;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 13px;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    display: block;
}

.toggle-switch:before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-color: #4CAF50;
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch:before {
    transform: translateX(24px);
    background: white;
}

.toggle-switch:hover {
    background: rgba(0, 0, 0, 0.6);
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
}

.toggle-text {
    flex: 1;
    text-align: left;
    margin: 0;
    display: inline-block;
}

/* Input Validation Styling */
.input-group input.valid,
.input-group input.available {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.input-group input.invalid,
.input-group input.unavailable,
.input-group input.error {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.1);
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2);
}

.input-group input.checking {
    border-color: #FF9800;
    background: rgba(255, 152, 0, 0.1);
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.2);
}

#join-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#join-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#join-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Game Screen */
#game-screen {
    display: block;
    padding: 0;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* Game UI */
#game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#game-ui > * {
    pointer-events: auto;
}

/* Top Bar */
#top-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

#top-bar-left {
    display: flex;
    gap: 12px;
    align-items: center;
    pointer-events: auto;
}

#top-bar-right {
    pointer-events: auto;
}

#player-name-display {
    font-weight: bold;
    font-size: 1.2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Modular Icon Buttons */
.icon-button {
    width: 50px;
    height: 50px;
    border-radius: 20%;
    border: 4px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.icon-button .icon {
    font-size: 1.5rem;
    color: white;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.5));
    position: relative;
    z-index: 1;
}

/* Dynamic hue rotation will be applied via JavaScript */

.icon-button:hover {
    transform: translateY(-3px) scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.icon-button:active {
    transform: translateY(0) scale(0.98);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Player List Panel */
.game-panel {
    position: absolute;
    top: 80px;
    left: 20px;
    width: 320px;
    max-height: 600px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.game-panel.hidden {
    display: none;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.panel-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    max-height: 320px;
}

.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.panel-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.panel-footer {
    padding: 16px 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.server-info-section h4 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.server-info-section .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.server-info-section .info-row:last-child {
    border-bottom: none;
}

.server-info-section .info-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.server-info-section .info-value {
    color: white;
    font-weight: 600;
    text-align: right;
    max-width: 60%;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    margin: 0;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease;
}

.player-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

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

.player-list-item .player-name {
    color: white;
    font-weight: 500;
}

.player-list-item .player-team {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.player-list-item .player-team.red {
    background: rgba(244, 67, 54, 0.3);
    color: #ff5252;
}

.player-list-item .player-team.blue {
    background: rgba(33, 150, 243, 0.3);
    color: #42a5f5;
}

.loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    padding: 20px;
}

/* Chat Panel */
#chat-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 350px;
    height: 250px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

#chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-message {
    margin-bottom: 8px;
    word-wrap: break-word;
}

.chat-message .player-name {
    font-weight: bold;
    color: #4CAF50;
}

.chat-message .timestamp {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-left: 8px;
}

#chat-input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.9rem;
    margin-right: 10px;
}

#chat-input:focus {
    outline: none;
    border-color: #ffffff;
}

#chat-send {
    padding: 8px 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
}

#chat-send:hover {
    background: #45a049;
}

/* Controls Info */
#controls-info {
    position: absolute;
    top: 100px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 200px;
}

#controls-info h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #4CAF50;
}

#controls-info ul {
    list-style: none;
}

#controls-info li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.3;
}

#controls-info strong {
    color: #ffffff;
}

/* Player List */
#player-list {
    position: absolute;
    top: 100px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 250px;
    max-height: 400px;
    overflow-y: auto;
}

#player-list h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #4CAF50;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

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

.player-name {
    font-weight: 500;
}

.player-ping {
    opacity: 0.7;
    font-size: 0.8rem;
}

/* Debug Info */
#debug-info {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    min-width: 200px;
}

#debug-info h4 {
    margin-bottom: 10px;
    color: #4CAF50;
}

#debug-content div {
    margin-bottom: 4px;
}

/* Error Handling */
.error-message {
    background: rgba(244, 67, 54, 0.9);
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
}

/* Error Screen */
#error-screen {
    background: linear-gradient(135deg, #c62828 0%, #d32f2f 100%);
}

.error-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    min-width: 400px;
}

.error-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-content p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    opacity: 0.9;
}

#retry-btn {
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

#retry-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Authentication Input Feedback */
.input-feedback {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
}

.input-feedback.checking {
    color: #FFC107;
    background: rgba(255, 193, 7, 0.1);
}

.input-feedback.available {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.input-feedback.unavailable {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.input-feedback.error {
    color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
}

/* Loading Message */
.loading-message {
    margin-top: 1rem;
    padding: 0.8rem;
    background: rgba(33, 150, 243, 0.2);
    border: 1px solid rgba(33, 150, 243, 0.5);
    border-radius: 5px;
    color: #BBDEFB;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-content {
        min-width: 90%;
        padding: 2rem;
    }
    
    #top-bar {
        flex-direction: column;
        gap: 10px;
        padding: 10px 15px;
    }
    
    #chat-panel {
        width: calc(100% - 40px);
        height: 200px;
    }
    
    #controls-info,
    #player-list {
        position: static;
        margin: 10px;
        max-height: none;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Authentication Styles */
#auth-screen {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    z-index: 999;
}

.auth-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 3rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 500px;
}

.auth-content h1 {
    font-size: 5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Splash Text Styling */
.splash-text-container {
    position: relative;
    height: 40px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.splash-text {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 1.2rem;
    margin: 0;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: 500;
    opacity: 1;
    transition: all 0.8s ease-in-out;
    white-space: nowrap;
    text-align: right;
}

.splash-text.fade-out {
    opacity: 0;
    transform: translateY(30px);
}

.splash-text.fade-in {
    opacity: 0;
    transform: translateY(-30px);
}

.splash-text.fade-in.active {
    opacity: 1;
    transform: translateY(0);
}

/* Fallback for old p styling */
.auth-content > p:not(.splash-text) {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.auth-panel {
    width: 100%;
}

.auth-btn {
    width: 100%;
    padding: 12px 20px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-btn.primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-color: #4CAF50;
}

.auth-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.region-footer {
    text-align: center;
    margin: 20px 0;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.terms-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.terms-link:hover {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

.auth-btn.primary:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
}

.auth-panel h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.input-group {
    margin-bottom: 1rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 1rem;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.input-feedback {
    margin-top: 5px;
    font-size: 0.9rem;
    min-height: 20px;
}

.input-feedback.success {
    color: #4CAF50;
}

.input-feedback.error {
    color: #f44336;
}

.loading-message {
    text-align: center;
    padding: 15px;
    background: rgba(33, 150, 243, 0.2);
    border-radius: 8px;
    margin-top: 15px;
}

/* Admin Panel Styles */
#admin-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.admin-toggle-btn {
    padding: 10px 15px;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.admin-toggle-btn:hover {
    background: linear-gradient(135deg, #F57C00 0%, #E65100 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

#admin-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 300px;
    max-height: 70vh;
    background: rgba(33, 33, 33, 0.95);
    border: 1px solid rgba(255, 152, 0, 0.5);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 999;
    overflow-y: auto;
}

#admin-panel h3 {
    color: #FF9800;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3rem;
    border-bottom: 2px solid #FF9800;
    padding-bottom: 10px;
}

.admin-section {
    margin-bottom: 20px;
}

.admin-section h4 {
    color: #FFC107;
    margin-bottom: 10px;
    font-size: 1rem;
}

.admin-section label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 0.9rem;
}

.admin-section input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    margin-bottom: 10px;
}

.admin-section input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: #FF9800;
    border-radius: 50%;
    cursor: pointer;
}

.admin-section select {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.admin-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.admin-btn:hover {
    background: linear-gradient(135deg, #F57C00 0%, #E65100 100%);
    transform: translateY(-1px);
}

.admin-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.admin-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

#speed-value {
    color: #FF9800;
    font-weight: bold;
}

/* Advanced Admin Panel Styles */
#admin-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: rgba(20, 20, 20, 0.98);
    border: 2px solid #FF9800;
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    z-index: 10000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-header h2 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.admin-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.admin-section h3 {
    color: #FFC107;
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    border-bottom: 2px solid rgba(255, 193, 7, 0.3);
    padding-bottom: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #FF9800;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-value {
    color: #4CAF50;
    font-weight: bold;
    font-size: 1rem;
}

.entity-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#entity-search {
    flex: 1;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
}

#entity-search:focus {
    outline: none;
    border-color: #FF9800;
}

#entity-search::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#refresh-entities {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

#refresh-entities:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
}

.entities-list {
    max-height: 400px;
    overflow-y: auto;
}

.entities-list .loading {
    text-align: center;
    padding: 30px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.entity-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.entity-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #FF9800;
    transform: translateX(5px);
}

.entity-card.player {
    border-left: 4px solid #4CAF50;
}

.entity-card.npc {
    border-left: 4px solid #2196F3;
}

.entity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.entity-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
}

.entity-tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.entity-tag.player {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.entity-tag.npc {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
}

.entity-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.entity-detail {
    color: rgba(255, 255, 255, 0.7);
}

.entity-detail strong {
    color: #FFC107;
    font-weight: 600;
}

.entity-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.teleport-btn {
    flex: 1;
    padding: 8px 16px;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.teleport-btn:hover {
    background: linear-gradient(135deg, #F57C00 0%, #E65100 100%);
    transform: scale(1.05);
}

/* Scrollbar Styles */
.admin-content::-webkit-scrollbar,
.entities-list::-webkit-scrollbar {
    width: 8px;
}

.admin-content::-webkit-scrollbar-track,
.entities-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.admin-content::-webkit-scrollbar-thumb,
.entities-list::-webkit-scrollbar-thumb {
    background: rgba(255, 152, 0, 0.5);
    border-radius: 4px;
}

.admin-content::-webkit-scrollbar-thumb:hover,
.entities-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 152, 0, 0.7);
}

/* User Menu Styles */
.user-header {
    position: relative;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#user-display-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #fff;
}

.user-menu-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.user-menu-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px;
    min-width: 200px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: white;
    text-align: left;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.modal-content {
    background: linear-gradient(135deg, rgba(30, 60, 114, 0.95) 0%, rgba(42, 82, 152, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header h2 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

.info-notice {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: #FFC107;
}

.info-notice p {
    margin: 0;
    font-size: 0.9rem;
}

.settings-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.settings-section h3 {
    margin: 0 0 10px 0;
    color: #fff;
    font-size: 1.2rem;
}

.section-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.settings-section.danger-zone {
    border-color: rgba(244, 67, 54, 0.5);
    background: rgba(244, 67, 54, 0.1);
}

.settings-section.danger-zone h3 {
    color: #f44336;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.modal-btn.primary:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-btn.danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.modal-btn.danger:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.modal-actions .modal-btn {
    width: auto;
    flex: 1;
}

.warning-text {
    color: #f44336;
    font-weight: bold;
    padding: 15px;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 8px;
    margin-bottom: 20px;
}

#delete-password-section {
    margin-bottom: 20px;
}

/* Checkbox Group Styles */
.checkbox-group {
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.4;
}

.terms-link {
    color: #4CAF50;
    text-decoration: underline;
    font-weight: bold;
}

.terms-link:hover {
    color: #66BB6A;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-dropdown {
        left: 0;
        right: 0;
        transform: none;
        margin: 10px;
    }
}

/* ==========================================
   CLASS SELECTION PANEL
   ========================================== */

#class-selection-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border-radius: 15px;
    padding: 30px;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 200;
    pointer-events: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.class-panel-header {
    text-align: center;
    margin-bottom: 30px;
}

.class-panel-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #FFD700;
}

#class-timer {
    font-size: 1.2rem;
    color: #4CAF50;
}

#build-time-remaining {
    font-weight: bold;
    color: #FFD700;
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.class-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.class-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-5px);
}

.class-card.active {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.class-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.class-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #FFD700;
}

.class-stats {
    margin: 15px 0;
    text-align: left;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    margin: 5px 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.class-description {
    text-align: left;
    font-size: 0.9rem;
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.8);
}

.class-description p {
    margin: 5px 0;
}

.class-description strong {
    color: #FFD700;
}

.select-class-btn {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-class-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

.select-class-btn.selected {
    background: #FFD700;
    color: #000;
}

.select-class-btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

.class-panel-footer {
    text-align: center;
    padding: 15px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 5px;
    color: #FFD700;
    font-weight: bold;
}

/* ==========================================
   TEAM HUD
   ========================================== */

#team-hud {
    position: absolute;
    top: 90px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 15px;
    min-width: 200px;
    pointer-events: auto;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.team-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.team-badge {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.2rem;
}

.team-badge.red {
    background: rgba(255, 68, 68, 0.3);
    border: 2px solid #FF4444;
    color: #FF4444;
}

.team-badge.blue {
    background: rgba(68, 68, 255, 0.3);
    border: 2px solid #4444FF;
    color: #4444FF;
}

.team-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-stats .stat-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    font-size: 0.9rem;
}

/* ==========================================
   GAME PHASE DISPLAY
   ========================================== */

#game-phase-display {
    font-weight: bold;
    text-transform: uppercase;
}

#game-phase-display.build {
    color: #FFD700;
}

#game-phase-display.battle {
    color: #FF4444;
}

/* ==========================================
   RESPONSIVE CLASS SELECTION
   ========================================== */

@media (max-width: 1024px) {
    .class-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #class-selection-panel {
        padding: 20px;
        max-width: 95%;
    }
    
    .class-panel-header h2 {
        font-size: 1.5rem;
    }
    
    .class-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .class-card {
        padding: 15px;
    }
    
    .class-icon {
        font-size: 3rem;
    }
}

/* ==========================================
   GAME MODALS
   ========================================== */

/* Game Modals */
.game-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 400;
    pointer-events: auto;
}

.game-modal.hidden {
    display: none;
}

.game-modal .modal-content {
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.7);
}

.game-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.game-modal .modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.game-modal .modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.3s ease;
}

.game-modal .modal-close:hover {
    color: #ff4444;
}

.game-modal .modal-body {
    padding: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.info-label {
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
}

.info-value {
    color: #4CAF50;
    font-weight: 600;
}

/* Admin server header styling */
.admin-server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    gap: 20px;
}

/* Content Moderation Styling */
.moderation-tools {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-group label {
    color: #fff;
    font-weight: 500;
    min-width: 120px;
}

#test-username {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    font-size: 14px;
}

#test-username:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.moderation-result {
    min-height: 24px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border-left: 4px solid transparent;
    font-size: 14px;
    line-height: 1.4;
}

.moderation-result .success {
    color: #4CAF50;
}

.moderation-result .error {
    color: #f44336;
}

.moderation-result:has(.success) {
    border-left-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.moderation-result:has(.error) {
    border-left-color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.filter-stats {
    color: #fff;
}

.filter-stats h4 {
    margin-bottom: 10px;
    color: #667eea;
}

.filter-stats ul {
    list-style: none;
    padding: 0;
}

.filter-stats li {
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
}

.filter-stats li:before {
    content: "•";
    color: #667eea;
    margin-right: 8px;
}

.server-info-display {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.current-server-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    white-space: nowrap;
}

.current-server-id {
    color: #4CAF50;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 14px;
    background: rgba(76, 175, 80, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    word-break: break-all;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.admin-select {
    min-width: 160px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 14px;
}

.admin-select option {
    background: #2a2a2a;
    color: white;
}

.admin-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.admin-btn.primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.admin-btn.secondary {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.admin-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.admin-btn.primary:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
}

.admin-btn.secondary:hover {
    background: linear-gradient(135deg, #1976D2, #2196F3);
}

/* Entity card styling */
.entity-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.entity-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.entity-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.entity-name-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.entity-name {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.entity-type {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.player-type {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.npc-type {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

.entity-actions {
    display: flex;
    gap: 6px;
}

.entity-action-btn {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.teleport-btn {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

.speed-btn {
    background: linear-gradient(135deg, #FF5722, #D84315);
}

.entity-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.entity-card-body {
    padding: 12px 16px;
}

.entity-detail {
    margin-bottom: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.entity-detail strong {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.entity-detail code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.entity-detail.sensitive {
    background: rgba(255, 193, 7, 0.1);
    padding: 6px 8px;
    border-radius: 4px;
    border-left: 3px solid #FFC107;
}

.entity-detail-toggle {
    cursor: pointer;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.entity-detail-toggle:hover {
    color: white;
}

.toggle-arrow {
    float: right;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.entity-detail-content {
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.7);
}

.entity-detail-content.hidden {
    display: none;
}

/* ==========================================
   BUILDING UI STYLES
   ========================================== */

#building-selector {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    z-index: 150;
}

.building-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 15px 20px;
}

.rotation-btn {
    width: 40px; /* Further reduced for compact layout */
    height: 40px;
    background: #333; /* Match wooden gate key background */
    border: 1px solid #666; /* Match wooden gate key border */
    outline: 2px solid rgba(255, 255, 255, 0.3); /* Add outline stroke */
    border-radius: 8px; /* Slightly rounded like gate key */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    font-weight: bold;
}

.rotation-btn:hover {
    background: #444; /* Lighter version of gate key background */
    border-color: #777; /* Lighter border on hover */
    outline-color: rgba(255, 255, 255, 0.5); /* Brighter outline on hover */
    transform: translateY(-2px);
}

.rotation-btn:active {
    transform: translateY(0);
}

.rotation-arrow {
    font-size: 1.4rem;
    line-height: 1;
}

.rotation-key {
    font-size: 12px; /* Match wooden gate key font size */
    margin-top: 2px;
    opacity: 0.9; /* Slightly more visible */
    font-family: 'Courier New', monospace; /* Match gate key font */
}

.selected-building {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    min-width: 120px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.selected-building:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.building-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.building-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
}

.building-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 15px; /* Space above hammer button */
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    min-width: 350px;
    max-width: 450px;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.building-menu.hidden {
    display: none;
}

.building-center-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hammer-btn {
    width: 40px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
}

.hammer-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.hammer-icon {
    font-size: 1.2rem;
}

.selected-building.building-mode-active {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.2);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* Building Menu Category and Item Styles */
.building-category {
    margin-bottom: 15px;
}

.category-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.building-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.building-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.building-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.building-item.affordable {
    border-color: rgba(76, 175, 80, 0.6);
}

.building-item.expensive {
    opacity: 0.6;
    border-color: rgba(244, 67, 54, 0.6);
}

.building-item-name {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: white;
}

.building-item-cost {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}