/***************
 файл style.css
***************/

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100vw;
    height: 100vh;
    background: #1a1a2e;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}


#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #000;
}

#gameCanvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
    background: #333;
}

#nickname-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none; 
}

#hud-layer {
    position: absolute;
    left: 4px;
    top: 4px;
    z-index: 10;
    color: #ccc;
    font: normal 13px Arial, Helvetica, sans-serif;
    contain: content;
    padding: 11px 11px 12px 12px;
    border-radius: 2px;
    border: 1px solid #727272;
    background: rgba(0, 0, 0, 0.3);
    width: 248px;
    cursor: pointer;
    user-select: none;
}

#hud-layer > div > div { margin: 4px 0; }

.fps-good { color: #4ecdc4; }
.fps-warn { color: #ffb703; }
.fps-crit { color: #f72585; }

.tank-nickname {
    position: absolute;
    color: #ffffff;
    font: normal 12px Arial, Helvetica, sans-serif;
    
    width: 120px;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    will-change: left, top;
}

#hud-build-row { display: none; }
#hud-status-row { color: #aaa;  padding: 0 0 3px 0; }


/* Общие стили для кнопок Звука и Справочника */
#hud-sound-toggle,
#hud-help-link { 
    pointer-events: auto; 
    cursor: pointer; 
    text-decoration: none;  
    display: block; 
    margin-top: 5px; 
    color: #ccc; 
}

#hud-sound-toggle span, 
#hud-help-link span { text-decoration: underline; }

#hud-sound-toggle:hover span, 
#hud-help-link:hover span { text-decoration: none; }


/* =========================================
   СТИЛИ ДЛЯ СПРАВОЧНИКА (HELP MODAL)
   ========================================= */
#help-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px); 
}

#help-modal {
    background: #1e1e24;
    border: 2px solid #d4af37;
    border-radius: 8px;
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    color: #bbb;
    font-family: Arial, sans-serif;
    padding: 20px 30px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    position: relative;
}

#help-modal h2 {
    color: #f1c40f;
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    border-bottom: 1px dashed #7f8c8d;
    padding-bottom: 10px;
}

#help-modal h3 {
    color: #e67e22;
    margin: 15px 0 10px 0;
    font-size: 18px;
}

#help-modal ul {
    list-style: none;
    padding-left: 10px;
}

#help-modal li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

#help-modal .key {
    display: inline-block;
    background: #34495e;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    border-bottom: 2px solid #2c3e50;
    font-weight: bold;
    margin-right: 5px;
}

#help-modal .highlight { color: #2ecc71; font-weight: bold; }
#help-modal .gold { color: #f1c40f; font-weight: bold; }
#help-modal .alert { color: #e74c3c; font-weight: bold; }

#close-help {
    position: absolute;
    top: 15px; right: 20px;
    background: #c0392b;
    color: #ddd;
    border: none;
    font-size: 16px;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

#close-help:hover { background: #e74c3c; }

#help-modal p.hint { font-size: 12px; color: #aaa; margin-top: 5px; }

#hud-toggle-expand,
#hud-toggle-collapse { cursor: pointer; color: #aaa; text-align: right; text-decoration: underline; }

#hud-toggle-expand:hover,
#hud-toggle-collapse:hover { text-decoration: none !important; }

#hud-toggle-expand { display: none; }
#hud-body { display: none; overflow: hidden; transition: max-height 0.3s ease-out; max-height: 500px; }
#hud-header { display: flex; justify-content: space-between; }

