/* Reset and general styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    overflow: hidden;
    background-color: #000;
}

/* UI Fullscreen Containers */
.fullscreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background-color: #000;
}

.hidden {
    display: none !important;
}

/* Videos */
video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Intro UI */
.skip-prompt {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
}

/* Main Menu Overlays */
.menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5); /* slight darkening over video */
}

/* Pulsating Text */
.pulsate {
    animation: pulsate 1.5s infinite alternate;
    font-size: 3rem;
}

@keyframes pulsate {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Menu Options */
.game-title {
    font-size: 5rem;
    margin-bottom: 50px;
    text-transform: uppercase;
    letter-spacing: 5px;
    text-shadow: 0 0 10px rgba(255,0,0,0.8);
    color: white;
}

.menu-list {
    list-style: none;
    padding: 0;
    text-align: center;
}

.menu-list li {
    margin: 20px 0;
}

.menu-btn {
    background: rgba(0,0,0,0.7);
    border: 2px solid #fff;
    color: #fff;
    padding: 15px 40px;
    font-size: 1.5rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s ease;
    width: 300px;
}

.menu-btn:hover {
    background: #fff;
    color: #000;
}

/* Server Browser */
.server-list-container {
    width: 60%;
    height: 400px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #fff;
    overflow-y: auto;
    margin-bottom: 20px;
}

#server-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.server-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #444;
    color: white;
}

.server-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.empty-servers {
    padding: 20px;
    text-align: center;
    color: #888;
}

.server-actions {
    display: flex;
    gap: 20px;
}

.join-btn {
    background: #4caf50;
    border: none;
    color: white;
    padding: 10px 20px;
    cursor: pointer;
}
.join-btn:hover {
    background: #45a049;
}

/* Loading screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.loading-content h1 {
    font-size: 24px;
    margin-bottom: 20px;
}

.progress-bar {
    width: 300px;
    height: 10px;
    background-color: #333;
    border-radius: 5px;
    overflow: hidden;
    margin: 0 auto 10px;
}

.progress {
    height: 100%;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.3s;
}

.loading-text {
    font-size: 14px;
}

/* Settings Menu */
#settings-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
}

.settings-panel {
    background-color: #222;
    color: #fff;
    padding: 30px;
    border-radius: 8px;
    min-width: 400px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    border: 1px solid #444;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.settings-panel h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 28px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

.settings-section {
    margin-bottom: 25px;
}

.settings-section h3 {
    margin-bottom: 15px;
    color: #4CAF50;
    font-size: 18px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.setting-item label {
    flex: 1;
}

.setting-item input[type="range"] {
    flex: 1;
    margin-left: 15px;
}

.btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 20px;
}

.btn:hover {
    background-color: #45a049;
}

/* Game container */
#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Debug overlay */
#debug-overlay {
    position: fixed;
    top: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px;
    min-width: 200px;
    z-index: 100;
    font-size: 12px;
    font-family: monospace;
}

.debug-panel h3 {
    margin-bottom: 10px;
    text-align: center;
}

#debug-stats, #debug-position, #debug-velocity {
    margin-bottom: 10px;
    line-height: 1.4;
    white-space: pre-line;
}

#debug-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#debug-controls button {
    padding: 5px;
    background-color: #444;
    color: #fff;
    border: none;
    cursor: pointer;
}

#debug-controls button:hover {
    background-color: #555;
}

.hidden {
    display: none;
}

/* HUD elements */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 2px #000;
}

.hit-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease-out;
}

.hit-marker.active {
    opacity: 1;
    transition: none; /* Instant show */
}

.hit-marker .line {
    position: absolute;
    width: 2px;
    height: 8px;
    background-color: white;
    box-shadow: 0 0 2px black;
}

.hit-marker .top-left {
    top: 0;
    left: 0;
    transform-origin: top left;
    transform: rotate(45deg);
}

.hit-marker .top-right {
    top: 0;
    right: 0;
    transform-origin: top right;
    transform: rotate(-45deg);
}

.hit-marker .bottom-left {
    bottom: 0;
    left: 0;
    transform-origin: bottom left;
    transform: rotate(-45deg);
}

.hit-marker .bottom-right {
    bottom: 0;
    right: 0;
    transform-origin: bottom right;
    transform: rotate(45deg);
}

.ammo-counter {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 24px;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
}

.fps-counter {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 14px;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 3px 6px;
    border-radius: 3px;
}

.interaction-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-top: 50px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 18px;
    display: none;
}