* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    color: white;
    overflow: hidden;
}

/* Menu Screen */
#menu-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.menu-container {
    text-align: center;
    padding: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    border: 2px solid #e94560;
    box-shadow: 0 0 50px rgba(233, 69, 96, 0.3);
}

.menu-container h1 {
    font-size: 3em;
    margin-bottom: 30px;
    color: #e94560;
    text-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
}

#player-name {
    width: 300px;
    padding: 15px 20px;
    font-size: 1.2em;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    margin-bottom: 20px;
    outline: none;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

#player-name:focus {
    border-color: #e94560;
}

#play-btn {
    display: block;
    width: 300px;
    padding: 15px;
    font-size: 1.5em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #e94560, #0f3460);
    color: white;
    cursor: pointer;
    margin: 0 auto 30px;
    transition: transform 0.2s, box-shadow 0.2s;
}

#play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.5);
}

.controls-info {
    text-align: left;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.controls-info h3 {
    color: #e94560;
    margin-bottom: 10px;
}

.controls-info p {
    margin: 5px 0;
    color: #ccc;
}

/* Game Screen */
#game-screen {
    width: 100vw;
    height: 100vh;
}

canvas {
    display: block;
}

/* Crosshair */
#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 100;
}

.crosshair-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
}

.crosshair-line.top {
    width: 2px;
    height: 10px;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
}

.crosshair-line.bottom {
    width: 2px;
    height: 10px;
    left: 50%;
    top: 8px;
    transform: translateX(-50%);
}

.crosshair-line.left {
    width: 10px;
    height: 2px;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
}

.crosshair-line.right {
    width: 10px;
    height: 2px;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
}

.crosshair-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ff4444;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Hit Marker */
#hit-marker {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 101;
}

#hit-marker .hit-line {
    position: absolute;
    width: 15px;
    height: 3px;
    background: #ff4444;
}

#hit-marker .hit-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#hit-marker .hit-line:nth-child(2) {
    transform: rotate(-45deg) translate(-5px, 5px);
}

#hit-marker .hit-line:nth-child(3) {
    transform: rotate(45deg) translate(-20px, -20px);
}

#hit-marker .hit-line:nth-child(4) {
    transform: rotate(-45deg) translate(20px, -20px);
}

#hit-marker.headshot .hit-line {
    background: #ffff00;
}

/* HUD */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

#hud > * {
    pointer-events: auto;
}

/* Health Bar */
#health-bar {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 200px;
    height: 30px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #333;
    border-radius: 5px;
    overflow: hidden;
}

#health-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #00ff00, #88ff00);
    transition: width 0.2s, background 0.2s;
}

#health-fill.low {
    background: linear-gradient(90deg, #ff0000, #ff4400);
}

#health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

/* Ammo Display */
#ammo-display {
    position: absolute;
    bottom: 30px;
    right: 30px;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px black;
}

#ammo-current {
    color: white;
}

.ammo-separator {
    color: #888;
    margin: 0 5px;
}

#ammo-reserve {
    color: #888;
    font-size: 0.7em;
}

#ammo-current.low {
    color: #ff4444;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#weapon-name {
    position: absolute;
    bottom: 70px;
    right: 30px;
    font-size: 1em;
    color: #888;
    text-shadow: 1px 1px 2px black;
}

/* Minimap */
#minimap {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 180px;
    height: 180px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #444;
    border-radius: 10px;
    overflow: hidden;
}

#minimap-canvas {
    width: 100%;
    height: 100%;
}

/* Scoreboard */
#scoreboard {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 2px 2px 4px black;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 30px;
    border-radius: 10px;
}

.team-red {
    color: #ff4444;
    margin-right: 30px;
}

.team-blue {
    color: #4444ff;
}

/* Kill Feed */
#kill-feed {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 300px;
}

.kill-entry {
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    margin-bottom: 5px;
    border-radius: 5px;
    font-size: 0.9em;
    animation: fadeIn 0.3s;
}

.kill-entry .killer {
    color: #4CAF50;
}

.kill-entry .victim {
    color: #ff4444;
}

.kill-entry .weapon {
    color: #888;
    font-size: 0.8em;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Chat */
#chat-container {
    position: absolute;
    bottom: 100px;
    left: 20px;
    width: 350px;
}

#chat-messages {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.chat-message {
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    margin-bottom: 3px;
    border-radius: 5px;
    font-size: 0.9em;
    word-wrap: break-word;
}

.chat-message.system {
    color: #ffff00;
    font-style: italic;
}

.chat-message .player-name {
    font-weight: bold;
}

.chat-message .player-name.red {
    color: #ff4444;
}

.chat-message .player-name.blue {
    color: #4444ff;
}

#chat-input {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #444;
    border-radius: 5px;
    color: white;
    outline: none;
}

/* Damage Overlay */
#damage-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(255, 0, 0, 0) 50%, rgba(255, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.1s;
}

/* Reload Indicator */
#reload-indicator {
    position: absolute;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 30px;
    border-radius: 5px;
    text-align: center;
}

#reload-bar {
    width: 150px;
    height: 5px;
    background: #333;
    border-radius: 3px;
    margin-bottom: 5px;
    overflow: hidden;
}

#reload-bar::after {
    content: '';
    display: block;
    height: 100%;
    background: #4CAF50;
    animation: reloadProgress 2s linear;
}

@keyframes reloadProgress {
    from { width: 0%; }
    to { width: 100%; }
}

/* Weapon Wheel */
#weapon-wheel {
    position: absolute;
    bottom: 150px;
    left: 30px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 10px;
}

.weapon-slot {
    padding: 8px 15px;
    margin: 5px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.weapon-slot:hover {
    background: rgba(255, 255, 255, 0.1);
}

.weapon-slot.active {
    background: rgba(233, 69, 96, 0.5);
}

/* Death Screen */
#death-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(139, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

#death-screen h2 {
    font-size: 4em;
    color: #ff0000;
    text-shadow: 0 0 20px black;
    margin-bottom: 20px;
}

#death-screen p {
    font-size: 1.5em;
    margin: 10px 0;
}

/* Full Scoreboard */
#full-scoreboard {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 15px;
    min-width: 600px;
    z-index: 150;
}

#full-scoreboard h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #e94560;
}

.teams-container {
    display: flex;
    gap: 30px;
}

.team-list {
    flex: 1;
    padding: 15px;
    border-radius: 10px;
}

.team-list.red {
    background: rgba(255, 0, 0, 0.2);
}

.team-list.blue {
    background: rgba(0, 0, 255, 0.2);
}

.team-list h3 {
    margin-bottom: 15px;
    text-align: center;
}

.player-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    margin: 5px 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.player-row .name {
    flex: 2;
}

.player-row .kills,
.player-row .deaths {
    flex: 1;
    text-align: center;
}

/* Utility Classes */
.hidden {
    display: none !important;
}