body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
}

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
}

#crosshair::before, #crosshair::after {
    content: '';
    position: absolute;
    background-color: #0f0;
}

#crosshair::before {
    top: 9px;
    left: 0;
    width: 20px;
    height: 2px;
}

#crosshair::after {
    top: 0;
    left: 9px;
    width: 2px;
    height: 20px;
}

#hud {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 24px;
    font-weight: bold;
    pointer-events: none;
    text-shadow: 2px 2px 0 #000;
}

#hud div {
    margin-top: 5px;
}

#health {
    color: #ff3333;
}

#ammo {
    color: #ffff33;
}

#stamina-container {
    width: 200px;
    height: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid #333;
    margin-top: 10px;
    border-radius: 5px;
    overflow: hidden;
}

#stamina-bar {
    width: 100%;
    height: 100%;
    background-color: #00ff00;
    transition: width 0.1s linear, background-color 0.2s;
}

#respawn-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(50, 0, 0, 0.7);
    color: red;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: Arial, sans-serif;
    font-size: 48px;
    font-weight: bold;
    z-index: 20;
}

#buy-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #555;
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-family: Arial, sans-serif;
    z-index: 100;
    display: flex;
    flex-direction: row;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

#inventory-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 520px;
    max-height: 70vh;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #555;
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-family: Arial, sans-serif;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

#inventory-menu h2 {
    width: 100%;
    text-align: center;
    margin-top: 0;
    color: #ffaa00;
}

#inventory-list {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 10px;
    overflow: auto;
    padding-right: 6px;
}


.inventory-slot-tile {
    position: relative;
    height: 64px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    border-radius: 6px;
    color: white;
    font-family: Arial, sans-serif;
    cursor: pointer;
    text-align: left;
}

.inventory-slot-tile:hover {
    border-color: #777;
    background: rgba(255, 255, 255, 0.07);
}

.inventory-slot-tile.selected {
    border-color: #00ff00;
    background: rgba(255, 255, 255, 0.08);
}

.inventory-slot-tile.empty {
    background: rgba(255, 255, 255, 0.02);
    border-style: dashed;
    cursor: default;
}

.inventory-slot {
    position: absolute;
    top: 6px;
    left: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid #666;
    background: #222;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

.inventory-name {
    font-size: 13px;
    line-height: 1.2;
    margin-top: 18px;
}

.inventory-count {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 14px;
    color: #bbb;
}

#buy-menu h2 {
    width: 100%;
    text-align: center;
    margin-top: 0;
    color: #ffaa00;
}

.buy-section {
    flex: 1;
    min-width: 150px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 5px;
}

.buy-section h3 {
    margin-top: 0;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
    color: #ddd;
    font-size: 16px;
}

.buy-item {
    display: block;
    width: 100%;
    padding: 8px;
    margin-bottom: 5px;
    background: #333;
    border: 1px solid #444;
    color: white;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.buy-item:hover {
    background: #555;
    border-color: #777;
}

.buy-item.active {
    background: #444;
    border-color: #00ff00;
}

#main-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: Arial, sans-serif;
    z-index: 30;
}

#main-menu input {
    padding: 10px;
    font-size: 18px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: none;
}

#main-menu button {
    padding: 10px 30px;
    font-size: 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#main-menu button:hover {
    background-color: #45a049;
}

/* Scoreboard Styles */
#scoreboard {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-family: Arial, sans-serif;
    border: 2px solid #555;
    border-radius: 10px;
    padding: 20px;
    z-index: 50;
    display: none;
}

#scoreboard h2 {
    text-align: center;
    margin-top: 0;
    color: #fff;
    border-bottom: 2px solid #444;
    padding-bottom: 10px;
}

#scoreboard table {
    width: 100%;
    border-collapse: collapse;
}

#scoreboard th, #scoreboard td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #333;
}

#scoreboard th {
    color: #aaa;
    font-size: 14px;
    text-transform: uppercase;
}

#scoreboard td {
    font-size: 16px;
}

#scoreboard .team-red {
    color: #ff5555;
}

#scoreboard .team-blue {
    color: #5555ff;
}

#scoreboard .me {
    background: rgba(255, 255, 255, 0.1);
}

#scope-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
    display: none;
    z-index: 5;
}

#scope-overlay .scope-crosshair {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: black;
    transform: translateY(-50%);
}

#scope-overlay .scope-crosshair::after {
    content: '';
    position: absolute;
    top: -50vh;
    left: 50%;
    width: 2px;
    height: 100vh;
    background: black;
    transform: translateX(-50%);
}

#scope-overlay .scope-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vh; /* Make it large enough */
    height: 100vh;
    border: 400px solid black; /* Create the vignette */
    border-radius: 50%;
}
