@import url('https://fonts.googleapis.com/css2?family=Teko:wght@500;700&display=swap');

:root {
    --ui-bg: linear-gradient(180deg, #153450 0%, #081526 100%);
    --ui-border: #4A7ABF;
    --text-yellow: #FFD700;
    --text-blue: #8AB4E0;
    --p1-color: #FF3333;
    --p2-color: #3388FF;
}

* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; }

body { 
    background: #000; 
    font-family: 'Teko', sans-serif; 
    color: white; 
    overflow: hidden; 
}

/* SEO Expert Technique: Screen Reader Only */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}

#game-container {
    display: flex; flex-direction: column;
    width: 100vw; height: 100vh; background: #000;
}

.top-bar { 
    flex: 0 0 auto; display: flex; justify-content: space-between; 
    padding: 10px 20px; background: #081526; border-bottom: 2px solid var(--ui-border); 
}

.middle-section {
    flex: 1; display: flex; justify-content: center; align-items: center;
    background: #050a11; overflow: hidden; position: relative;
}

#scale-wrapper {
    width: 1024px; height: 768px; position: relative;
    transform-origin: center center; box-shadow: 0 0 30px #000;
}

#world {
    position: absolute; width: 100%; height: 100%;
    transform-origin: top left; will-change: transform; background: #000;
}

canvas { display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
#bgCanvas { z-index: 1; }
#terrainCanvas { z-index: 2; }
#gameCanvas { z-index: 3; }

/* Cinematic Slow-Mo Vignette */
#vignette-overlay {
    position: absolute; inset: 0; pointer-events: none; z-index: 10;
    box-shadow: inset 0 0 200px rgba(0,0,0,0.95); opacity: 0; transition: opacity 0.5s ease;
}
#vignette-overlay.active { opacity: 1; }

#bot-thinking {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    font-size: 30px; color: var(--text-yellow); background: rgba(0,0,0,0.8);
    padding: 5px 30px; border: 2px solid var(--text-yellow); border-radius: 5px;
    display: none; z-index: 40;
}

.announcement {
    position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%);
    font-size: 100px; color: #FF3333; text-shadow: 4px 4px 0 #000, 0 0 30px #FF0000;
    z-index: 50; display: none; text-align: center; line-height: 1;
    animation: pulse 1s infinite alternate; pointer-events: none;
}
@keyframes pulse { 0% { transform: translate(-50%, -50%) scale(1); } 100% { transform: translate(-50%, -50%) scale(1.1); } }

.bottom-bar { 
    flex: 0 0 auto; height: 120px; background: var(--ui-bg); border-top: 2px solid var(--ui-border);
    display: flex; justify-content: space-between; align-items: center; padding: 0 20px; 
}

.screen {
    position: fixed; inset: 0; z-index: 100;
    display: none; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.9);
}
.screen.active { display: flex; }

.title-box { text-align: center; margin-bottom: 40px; }
.title-main { font-size: 90px; color: var(--text-yellow); text-shadow: 4px 4px 0 #8B4513, 0 0 20px #FFD700; line-height: 1; letter-spacing: 2px; }
.title-sub { font-size: 30px; letter-spacing: 8px; color: #fff; }

.btn {
    background: linear-gradient(180deg, #3A6AA0, #153450);
    border: 2px solid var(--ui-border); color: var(--text-yellow);
    font-family: 'Teko', sans-serif; font-size: 28px; padding: 10px 40px; margin: 10px;
    cursor: pointer; transition: all 0.1s; letter-spacing: 2px;
    text-shadow: 2px 2px 0px #000; min-width: 300px;
}
.btn:hover:not(:disabled) { background: linear-gradient(180deg, #4A7ABF, #2A5A9A); border-color: #fff; transform: scale(1.05); }
.btn:disabled { filter: grayscale(1); opacity: 0.5; cursor: not-allowed; }

.btn-small {
    background: #FF3333; border: 1px solid #FFF; color: #FFF;
    font-family: 'Teko'; font-size: 18px; padding: 2px 15px; cursor: pointer;
    transition: 0.1s; border-radius: 4px;
}
.btn-small:hover { background: #ff6666; transform: scale(1.05); }

.settings-grid { 
    display: grid; grid-template-columns: 1fr 1fr; gap: 30px; 
    background: rgba(10,20,34,0.9); padding: 40px; 
    border: 2px solid var(--ui-border); border-radius: 10px; margin-bottom: 30px;
}
.set-group { display: flex; flex-direction: column; text-align: left; }
.set-label { color: var(--text-blue); font-size: 26px; margin-bottom: 5px; }
.set-select { 
    background: #0A1422; color: #FFF; border: 2px solid var(--text-yellow); 
    padding: 10px; font-family: 'Teko'; font-size: 24px; cursor: pointer; outline: none;
}
.set-select:hover { border-color: #FFF; }

.info-box {
    background: rgba(10,20,34,0.9); border: 2px solid var(--ui-border);
    padding: 30px; border-radius: 10px; max-width: 600px; margin-bottom: 20px;
}
.info-box h3 { color: var(--text-yellow); font-size: 30px; margin-bottom: 10px; border-bottom: 1px solid var(--ui-border); }
.info-box p { font-size: 22px; color: #EEE; line-height: 1.4; margin-bottom: 15px; }

/* Interactive Weapon Tooltip */
.wep-tooltip {
    position: absolute; background: rgba(10,20,34,0.95);
    border: 2px solid var(--text-yellow); border-radius: 8px;
    padding: 15px; width: 280px; color: #fff; z-index: 200;
    pointer-events: none; display: none; box-shadow: 0 0 15px #000;
}
.tt-title { font-size: 28px; color: var(--text-yellow); border-bottom: 1px solid var(--ui-border); margin-bottom: 5px; }
.tt-type { font-size: 18px; color: var(--text-blue); margin-bottom: 10px; }
.tt-desc { font-size: 20px; line-height: 1.2; margin-bottom: 15px; }
.tt-bar-wrap { background: #111; border: 1px solid #444; height: 10px; width: 100%; margin-bottom: 5px; }
.tt-bar { height: 100%; background: #FF3333; }

.shop-layout { display: flex; width: 95%; height: 80%; border: 2px solid var(--ui-border); background: #0A1422; }
.shop-col { flex: 1; border-right: 2px solid var(--ui-border); display: flex; flex-direction: column; }
.shop-col:last-child { border-right: none; }
.shop-header { background: #153450; padding: 10px; text-align: center; font-size: 24px; color: var(--text-yellow); border-bottom: 2px solid var(--ui-border); }
.weapon-list { flex: 1; overflow-y: auto; padding: 5px; list-style: none; }
.w-item { 
    padding: 8px 10px; margin: 2px 0; background: #112233; border: 1px solid #224466; 
    cursor: pointer; display: flex; justify-content: space-between; font-size: 20px; color: #fff; 
}
.w-item:hover { background: #1A3C6B; border-color: var(--text-yellow); }
.w-item.selected { opacity: 0.3; pointer-events: none; }
.shop-bottom { position: absolute; bottom: 20px; width: 100%; text-align: center; }

.player-info { display: flex; align-items: center; gap: 15px; }
.score-box { font-size: 40px; font-weight: bold; line-height: 1; text-shadow: 2px 2px 0 #000; }
.p1-text { color: var(--p1-color); }
.p2-text { color: var(--p2-color); text-align: right; }
.center-info { text-align: center; color: var(--text-yellow); font-size: 24px; letter-spacing: 1px; }

.control-group { display: flex; align-items: center; gap: 15px; }
.wep-box { background: #000; border: 2px solid var(--ui-border); width: 200px; padding: 5px 10px; text-align: center; }
.wep-name { color: var(--text-yellow); font-size: 22px; margin-bottom: 5px; white-space: nowrap; overflow: hidden; }
.wep-nav { display: flex; justify-content: space-between; }
.wep-nav button { background: #153450; border: 1px solid var(--text-blue); color: #fff; cursor: pointer; padding: 2px 15px; font-weight: bold; }

.sliders { display: flex; gap: 15px; }
.slider-box { text-align: center; }
.slider-label { color: var(--text-blue); font-size: 18px; margin-bottom: -5px; }
.slider-val { color: var(--text-yellow); font-size: 32px; font-weight: bold; line-height: 1; }
input[type=range] { width: 120px; accent-color: var(--text-yellow); cursor: pointer; }

.fire-btn { 
    background: linear-gradient(180deg, #FF3300, #991100); border: 2px solid #FFCC00;
    color: #FFF; font-family: 'Teko'; font-size: 40px; font-weight: bold; padding: 5px 30px;
    cursor: pointer; text-shadow: 2px 2px #000; border-radius: 5px;
}
.fire-btn:active:not(:disabled) { transform: scale(0.95); }
.fire-btn:disabled { filter: grayscale(1); cursor: not-allowed; opacity: 0.5; }

.move-btn { background: #153450; border: 1px solid #4A7ABF; color: #FFF; padding: 2px 10px; font-family: 'Teko'; font-size: 18px; cursor: pointer; }
.move-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.float-score {
    position: absolute; font-family: 'Teko', sans-serif; font-size: 40px; font-weight: bold;
    text-shadow: 3px 3px 0 #000, 0 0 15px currentColor; z-index: 50; pointer-events: none;
    animation: floatUp 1.5s ease-out forwards;
}
@keyframes floatUp { 0% { opacity: 1; transform: translateY(0) scale(0.5); } 20% { transform: translateY(-20px) scale(1.2); } 100% { opacity: 0; transform: translateY(-80px) scale(1); } }

::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-track { background: #0A1422; } ::-webkit-scrollbar-thumb { background: #4A7ABF; }