* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

canvas {
    display: block;
}

/* HUD Styles */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
}

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
}

#crosshair::before,
#crosshair::after {
    content: '';
    position: absolute;
    background-color: rgba(255, 255, 255, 0.8);
}

#crosshair::before {
    width: 2px;
    height: 20px;
    left: 50%;
    transform: translateX(-50%);
}

#crosshair::after {
    width: 20px;
    height: 2px;
    top: 50%;
    transform: translateY(-50%);
}

/* Health Bar */
#health-container {
    position: absolute;
    bottom: 30px;
    left: 30px;
    color: white;
    font-size: 18px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#health-bar {
    width: 200px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid #fff;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}

#health-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff0000, #ff4444);
    transition: width 0.3s ease;
}

#health-text {
    margin-top: 5px;
    font-weight: bold;
}

/* Cash Display */
#cash-display {
    position: absolute;
    top: 30px;
    right: 30px;
    color: #00ff00;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#cash-display::before {
    content: '$';
}

#weapon-info {
    position: absolute;
    bottom: 30px;
    right: 30px;
    color: white;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#weapon-name {
    font-weight: bold;
    color: #00ff00;
}

#ammo-count {
    font-size: 32px;
    color: #ffff00;
}

/* Shop Styles */
#shop-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.9);
    border: 3px solid #e94560;
    border-radius: 10px;
    padding: 30px;
    display: none;
    z-index: 70;
    min-width: 400px;
}

#shop-menu h2 {
    color: #e94560;
    font-size: 36px;
    text-align: center;
    margin-bottom: 20px;
}

#shop-cash {
    color: #00ff00;
    font-size: 24px;
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}

#shop-cash::before {
    content: 'Cash: $';
}

.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    pointer-events: auto;
}

.shop-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.shop-item-name {
    color: white;
    font-size: 18px;
}

.shop-item-price {
    color: #ffff00;
    font-size: 18px;
    margin-right: 20px;
}

.shop-item-price::before {
    content: '$';
}

.shop-buy-btn {
    padding: 10px 20px;
    background-color: #e94560;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.shop-buy-btn:hover {
    background-color: #ff6b6b;
    transform: scale(1.05);
}

.shop-buy-btn:disabled {
    background-color: #666;
    cursor: not-allowed;
    transform: none;
}

#shop-close {
    margin-top: 20px;
    width: 100%;
    padding: 15px;
    background-color: #666;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    pointer-events: auto;
}

#shop-close:hover {
    background-color: #888;
}

/* Start Screen */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#start-screen h1 {
    font-size: 64px;
    color: #e94560;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    letter-spacing: 4px;
}

#start-screen p {
    color: #fff;
    font-size: 18px;
    margin-bottom: 40px;
}

#start-button {
    padding: 20px 60px;
    font-size: 24px;
    background-color: #e94560;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
}

#start-button:hover {
    background-color: #ff6b6b;
    transform: scale(1.05);
}

#controls-info {
    margin-top: 40px;
    color: #aaa;
    text-align: center;
    line-height: 1.8;
}

#controls-info span {
    color: #00ff00;
    font-weight: bold;
}

/* Pause Menu */
#pause-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

#pause-menu h2 {
    color: #e94560;
    font-size: 48px;
    margin-bottom: 40px;
}

.pause-button {
    padding: 15px 40px;
    font-size: 20px;
    background-color: #1a1a2e;
    color: white;
    border: 2px solid #e94560;
    border-radius: 8px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.pause-button:hover {
    background-color: #e94560;
}

/* Death Screen */
#death-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(139, 0, 0, 0.9);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 80;
}

#death-screen h2 {
    color: #ff0000;
    font-size: 64px;
    margin-bottom: 20px;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.8);
}

#death-timer {
    color: #ffffff;
    font-size: 32px;
    font-weight: bold;
}

/* Console */
#console-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    z-index: 60;
}

#console-input {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: calc(100% - 40px);
    padding: 15px;
    font-size: 18px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #00ff00;
    border: 2px solid #00ff00;
    border-radius: 5px;
    outline: none;
}

#console-output {
    position: absolute;
    top: 20px;
    left: 20px;
    width: calc(100% - 40px);
    height: calc(100% - 80px);
    overflow-y: auto;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.console-line {
    margin: 5px 0;
}

.console-line.error {
    color: #ff0000;
}

.console-line.success {
    color: #00ffff;
}

/* Lobby Styles */
#lobby-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.lobby-button {
    padding: 15px 40px;
    font-size: 20px;
    background-color: #e94560;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    min-width: 200px;
}

.lobby-button:hover {
    background-color: #ff6b6b;
    transform: scale(1.05);
}

.lobby-button:disabled {
    background-color: #666;
    cursor: not-allowed;
    transform: none;
}

#room-code-display {
    font-size: 48px;
    color: #00ff00;
    font-weight: bold;
    letter-spacing: 8px;
    margin: 20px 0;
}

#join-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

#room-code-input {
    padding: 15px;
    font-size: 24px;
    width: 150px;
    text-align: center;
    text-transform: uppercase;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid #e94560;
    border-radius: 8px;
    color: white;
    outline: none;
}

#room-code-input::placeholder {
    color: #888;
    text-transform: none;
}

#lobby-status {
    color: #aaa;
    font-size: 16px;
    margin-top: 10px;
}

#player-list {
    margin-top: 20px;
    color: white;
    font-size: 18px;
}

.player-item {
    padding: 10px 20px;
    margin: 5px 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.player-item.host {
    border-left: 4px solid #e94560;
}

/* Name Tag Styles */
#name-tags-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 40;
}

.player-name-tag {
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    white-space: nowrap;
    transform: translate(-50%, -100%);
    display: none; /* Hidden by default */
}

.player-name-tag.visible {
    display: block;
}
