@font-face {
    font-family: 'PaperMono';
    src: url('PaperMono-Regular.woff2') format('woff2');
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { overflow: hidden; background: #000; font-family: 'PaperMono', monospace; }
#container { position: relative; width: 100vw; height: 100vh; }
#videoElement {
    position: absolute; 
    top: 10px; 
    right: 10px;
    width: 420px; 
    height: 236px;
    z-index: 100; 
    transform: scaleX(-1); 
    opacity: 0.95;
}

/* Mobile video styling */
@media (max-width: 780px) {
    #videoElement {
        top: 0;
        right: 0;
        width: 90px;
        height: 160px;
    }
}
#sceneCanvas { position: absolute; top: 0; left: 0; width: 100vw; height: 100dvh; z-index: 1; image-rendering: pixelated; image-rendering: crisp-edges; }
#crosshair { 
    position: absolute; 
    top: 50vw; 
    left: 50dvh; 
    z-index: 50; 
    pointer-events: none; 
    transition: transform 0.05s ease-out, filter 0.2s ease-out;
}
#crosshair.targeting { 
    /* filter: drop-shadow(0 0 10px rgba(50, 255, 193, 1)) drop-shadow(0 0 20px rgba(50, 255, 193, 0.8)) drop-shadow(0 0 45px rgba(50, 255, 193, 0.6)); */
    filter: drop-shadow(0 0 5px rgba(50, 255, 193, 1)) drop-shadow(0 0 20px rgb(255, 255, 255));
    animation: crosshairRotate 3s linear infinite;
}
@keyframes crosshairRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
#crosshair::before, #crosshair::after { 
    content: ''; 
    position: absolute; 
    background: rgb(223, 223, 223);
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.6);
    transition: background 0.2s ease-out;
}
#crosshair.targeting::before, #crosshair.targeting::after {
    background: rgb(255, 250, 93);
    transform: scale(1.5);
    /* box-shadow: 0 0 20px rgba(50, 255, 193, 1); */
}
#crosshair::before { 
    width: 50px; 
    height: 4px; 
    left: -25px; 
    top: -2px; 
}
#crosshair::after { 
    width: 4px; 
    height: 50px; 
    left: -2px; 
    top: -25px; 
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
@keyframes pulseFast {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}
.overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 200; padding: 30px; border: 3px solid; text-align: center; color: white; background: rgba(0, 0, 0, 0.9); }
#startOverlay { border-color: #ffffff; }
#gameOver { border-color: #ff3232; }
#gameOver h2 { font-size: 48px; margin-bottom: 20px; color: #ff3232; }
button { margin-top: 20px; padding: 15px 30px; font-size: 18px; background: rgba(0, 0, 255, 0.8); color: white; border: none; cursor: pointer; font-weight: bold; font-family: 'PaperMono', monospace; }
button:hover { background: rgb(5, 138, 200); }
button:disabled { background: #555; color: #888; cursor: not-allowed; }
#hud { position: absolute; top: 10px; left: 10px; z-index: 100; color: #0f0; font-size: 18px; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8); font-weight: bold; }
.status { margin-bottom: 10px; color: #ffffff; font-size: max(16px, 2vw);}
#fpsCounter { position: fixed; bottom: 10px; left: 10px; z-index: 100; color: #ffffff; font-size: 18px; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8); font-weight: bold; }
#healthBar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: min(300px, 50vw); height: 30px; background: rgba(50, 50, 50, 0.8); border: 2px solid #ffffff; z-index: 100; }
#healthFill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff3232, #ff8888); transition: width 0.3s; }
#healthText { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-weight: bold; font-size: max(12px, 1vw);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8); z-index: 101; padding: 0; margin: 0; }
#damageOverlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 0, 0, 0.5); z-index: 40; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
#damageOverlay.active { opacity: 1; }
#waveIndicator { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 150; font-size: 8vw; font-weight: bold; color: #83ffe2; text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.8); opacity: 0; pointer-events: none; transition: opacity 0.5s; }
#waveIndicator.active { opacity: 1; }
.hidden { display: none; }

/* Settings Button */
.settings-btn {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 150;
    width: 50px;
    height: 50px;
    padding: 0;
    margin: 0;
    font-size: 24px;
    /* border-radius: 50%; */
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border: 2px solid #ffffff;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 0 10px rgba(0, 0, 255, 0.5);
}

.settings-btn:hover {
    background: rgb(5, 138, 200);
    transform: rotate(90deg);
}

/* Settings Menu */
.settings-overlay {
    border-color: #ffffff;
    max-width: 600px;
    width: 90vw;
    max-height: 80dvh;
    overflow-y: auto;
}

.settings-overlay h2 {
    font-size: 36px;
    margin-bottom: 30px;
    color: #00aaff;
}

.settings-section {
    /* margin-bottom: 10px; */
    text-align: left;
}

.settings-section label {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
    color: #ffffff;
    font-weight: bold;
}

.volume-slider {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    border-radius: 4px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #0000ff;
    border: 2px solid #ffffff;
    /* border-radius: 50%; */
    cursor: pointer;
    transition: background 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    background: #0000FF;
}

.volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #0000ff;
    border: 2px solid #ffffff;
    /* border-radius: 50%; */
    cursor: pointer;
    transition: background 0.2s;
}

.volume-slider::-moz-range-thumb:hover {
    background: #0088cc;
}

.volume-value {
    display: inline-block;
    margin-top: 5px;
    font-size: 14px;
    color: #00aaff;
    font-weight: bold;
}

.credits-section {
    border-top: 2px solid rgba(255, 255, 255, 1.0);
    padding-top: 20px;
    margin-top: 20px;
}

.credits-section h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #00aaff;
}

.credits-content {
    text-align: left;
    line-height: 1.5;
}

.credits-content p {
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

#closeSettingsButton {
    background: rgba(0, 0, 255, 0.8);
}

#closeSettingsButton:hover {
    background: rgb(5, 138, 200);
}

a {
    color: rgb(0, 234, 255) !important;
}