* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: radial-gradient(50% 50% at 50% 50%, rgba(20, 40, 55, 0.98) 0%, rgba(7, 20, 30, 0.98) 100%);
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* --- Join Screen --- */
#join-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#join-box {
    text-align: center;
    background: rgba(15, 30, 45, 0.9);
    border: 1px solid rgba(100, 180, 255, 0.2);
    border-radius: 12px;
    padding: 50px 60px;
    max-width: 420px;
    width: 90%;
}

#join-box h1 {
    font-size: 32px;
    letter-spacing: 6px;
    color: #5ba8e8;
    margin-bottom: 8px;
    font-weight: 700;
}

#join-box p {
    color: #7899aa;
    font-size: 14px;
    margin-bottom: 30px;
}

#room-input {
    width: 100%;
    padding: 14px 20px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    font-weight: 700;
    font-family: 'Consolas', 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(100, 180, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    outline: none;
    text-transform: uppercase;
    transition: border-color 0.2s;
}

#room-input:focus {
    border-color: rgba(100, 180, 255, 0.7);
}

#room-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 6px;
    font-weight: 400;
}

#join-btn {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 3px;
    background: rgba(40, 130, 200, 0.3);
    color: #5ba8e8;
    border: 1px solid rgba(91, 168, 232, 0.4);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

#join-btn:hover {
    background: rgba(40, 130, 200, 0.5);
    border-color: rgba(91, 168, 232, 0.7);
}

#join-error {
    margin-top: 16px;
    color: #ff5555;
    font-size: 13px;
    min-height: 20px;
}

/* --- Radar Screen --- */
#radar-screen {
    flex-direction: column;
    height: 100vh;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: rgba(10, 25, 40, 0.9);
    border-bottom: 1px solid rgba(100, 180, 255, 0.15);
    font-size: 13px;
    z-index: 10;
}

#status-text {
    color: #ffcc00;
    font-weight: 600;
}

#status-text.connected {
    color: #44ff44;
}

#status-text.disconnected {
    color: #ff4444;
}

#map-name {
    color: #88bbdd;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#room-code {
    color: #5ba8e8;
    font-weight: 700;
    font-family: 'Consolas', monospace;
    letter-spacing: 2px;
}

#rotate-btn, .tb-toggle {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    color: #8899aa;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 2px;
}

#rotate-btn:hover, .tb-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #aabbcc;
}

.tb-toggle.active {
    background: rgba(40, 130, 200, 0.3);
    color: #5ba8e8;
    border-color: rgba(91, 168, 232, 0.5);
}

#toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
}

#follow-info {
    color: #44ff44;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
}

#follow-info:hover {
    text-decoration: underline;
}

.player-card.following {
    background: rgba(68, 255, 68, 0.1);
    border: 1px solid rgba(68, 255, 68, 0.3);
}

#radar-canvas {
    cursor: pointer;
}

#player-count {
    color: #8899aa;
}

#radar-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 0;
}

#radar-canvas {
    border: 1px solid rgba(100, 180, 255, 0.2);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
}

#radar-message {
    position: absolute;
    color: #88bbdd;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    pointer-events: none;
}

#player-panels {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(10, 25, 40, 0.9);
    border-top: 1px solid rgba(100, 180, 255, 0.15);
    max-height: 180px;
    overflow-y: auto;
}

.team-panel {
    flex: 1;
    padding: 0 10px;
}

.team-panel h3 {
    font-size: 11px;
    letter-spacing: 2px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#panel-t h3 { color: #e8c44a; }
#panel-ct h3 { color: #5b9bd5; }

.player-card {
    display: flex;
    align-items: center;
    padding: 3px 6px;
    margin-bottom: 2px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 12px;
}

.player-card.dead {
    opacity: 0.35;
}

.player-card .name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.player-card .health {
    min-width: 40px;
    text-align: right;
    font-weight: 600;
}

.player-card .weapon {
    min-width: 80px;
    text-align: right;
    color: #889;
    font-size: 11px;
}

.health-bar {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 0 8px;
    overflow: hidden;
}

.health-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.15s ease;
}

.t-color { color: #e8c44a; }
.ct-color { color: #5b9bd5; }
