* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00ff00;
    --primary-dark: #00aa00;
    --primary-light: #00ff88;
    --bg-dark: #0a0a0a;
    --bg-medium: #1a1a1a;
    --bg-light: #2a2a2a;
    --border: #00ff00;
    --text: #00ff00;
    --text-dim: #00aa00;
    --warning: #ffff00;
    --error: #ff0000;
    --info: #00aaff;
}

body {
    font-family: 'Courier New', monospace;
    background: var(--bg-dark);
    color: #34ab00;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===== АНИМИРОВАННЫЙ ФОН ===== */
.circuit-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(0, 50, 0, 0.1) 1px, transparent 1px),
        linear-gradient(rgba(0, 50, 0, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
}

.pulse-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: pulseMove 4s linear infinite;
    opacity: 0.6;
}

.pulse-1 { top: 15%; width: 150px; animation-duration: 3.5s; animation-delay: 0s; }
.pulse-2 { top: 35%; width: 200px; animation-duration: 4.5s; animation-delay: 1s; }
.pulse-3 { top: 55%; width: 180px; animation-duration: 3.8s; animation-delay: 2s; }
.pulse-4 { top: 75%; width: 160px; animation-duration: 4.2s; animation-delay: 0.5s; }
.pulse-5 { top: 90%; width: 140px; animation-duration: 3.6s; animation-delay: 1.5s; }

@keyframes pulseMove {
    0% { transform: translateX(-200px); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(calc(100vw + 200px)); opacity: 0; }
}

/* ===== ВЕРХНЯЯ ПАНЕЛЬ ===== */
#top-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 30, 5, 0);
    border-bottom: 3px solid #32ae00;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.84);
    backdrop-filter: blur(10px);
}

.header-left h1 {
    font-size: 1.8em;
    margin-bottom: 5px;
    text-shadow: 0 0 15px var(--primary);
    letter-spacing: 2px;
}

.header-left .subtitle {
    font-size: 0.85em;
    opacity: 0.7;
}

.stats-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(0, 255, 0, 0.05);
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.stat-icon {
    font-size: 1.2em;
}

.stat-value {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    font-size: 0.7em;
    opacity: 0.7;
    text-transform: uppercase;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
    opacity: 0.3;
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--border);
    border-radius: 5px;
}

.username {
    font-weight: bold;
}

.icon-btn {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--border);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s;
}

.icon-btn:hover {
    background: rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 10px var(--primary);
}

.logout-btn:hover {
    background: rgba(255, 0, 0, 0.3);
    border-color: var(--error);
    box-shadow: 0 0 10px var(--error);
}

/* ===== ОСНОВНОЙ КОНТЕНТ ===== */
#main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

.section {
    margin-bottom: 40px;
    background: linear-gradient(135deg, rgb(0, 85, 0) 0%, rgb(0, 85, 0) 100%);
    border: 3px solid #34ab00;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0), inset 0 0 5px rgb(0, 0, 0);
    padding: 20px;
    border-radius: 10px;
}

.section-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

/* ===== УЛУЧШЕНИЯ ===== */
.upgrades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.upgrade-card {
    background: rgba(0, 255, 0, 0.05);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.upgrade-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 255, 0, 0.3);
}

.upgrade-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.upgrade-card h3 {
    margin-bottom: 10px;
    font-size: 1.1em;
}

.upgrade-level, .upgrade-cost {
    margin: 8px 0;
    font-size: 0.9em;
}

.upgrade-cost {
    color: var(--warning);
}

.upgrade-btn {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: #000;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.upgrade-btn:hover:not(:disabled) {
    box-shadow: 0 0 15px var(--primary);
    transform: scale(1.05);
}

.upgrade-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

/* ===== РЕЖИМЫ ИГРЫ ===== */
.modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.mode-card {
    background: rgba(0, 255, 0, 0.05);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s;
}

.mode-card:hover {
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.3);
    transform: translateY(-3px);
}

.mode-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.mode-card h3 {
    margin-bottom: 10px;
    font-size: 1.3em;
}

.mode-desc {
    opacity: 0.8;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.mode-stats {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 255, 0, 0.1);
    border-radius: 5px;
}

.mode-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mode-stat-label {
    font-size: 0.8em;
    opacity: 0.7;
}

.mode-stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary);
}

.coop-options {
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 255, 0, 0.1);
    border-radius: 5px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.mode-btn {
    width: 100%;
    padding: 15px;
    margin-top: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: #000;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.mode-btn:hover {
    box-shadow: 0 0 20px var(--primary);
    transform: scale(1.02);
}

/* ===== СПИСОК КОМНАТ ===== */
.rooms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.create-room-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: #000;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.create-room-btn:hover {
    box-shadow: 0 0 15px var(--primary);
}

.rooms-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.search-input, .filter-select {
    width: 100%;
    padding: 10px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'Courier New', monospace;
    border-radius: 5px;
}

.search-input:focus, .filter-select:focus {
    outline: none;
    box-shadow: 0 0 10px var(--primary);
}

.rooms-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.room-empty {
    text-align: center;
    padding: 40px;
    opacity: 0.5;
    font-size: 1.1em;
}

.room-card {
    background: rgba(0, 255, 0, 0.05);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}

.room-card:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.room-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.room-creator {
    font-weight: bold;
    min-width: 120px;
}

.room-level {
    color: var(--warning);
    font-weight: bold;
}

.room-players {
    color: var(--info);
}

.join-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: #000;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.join-btn:hover:not(:disabled) {
    box-shadow: 0 0 15px var(--primary);
}

.join-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

/* ===== ФУТЕР ===== */
#footer {
    text-align: center;
    padding: 20px;
    opacity: 0.6;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /*background: rgba(0, 0, 0, 0.95);*/
    background: url('/images/pcb-background.png') no-repeat center center fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
  background: linear-gradient(135deg, #050 0%, #050 100%);
  border: 3px solid #32ae00;
  border-radius: 15px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  /*box-shadow: 0 0 50px rgba(0, 255, 0, 0.5);*/
}

.auth-modal h2 {
  text-align: center;
  margin-bottom: 30px;
  text-shadow: 0 0 2px #000;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 12px;
  background: rgb(0, 85, 0);
  border: 2px solid #34ab00;
  color: #34ab00;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  border-radius: 5px;
  transition: all 0.3s;
    text-shadow: 0 0 2px #000;
}

.tab-btn.active {
  background: rgb(50, 175, 0);
  box-shadow: 0 0 15px #050;
  color: #050;
    text-shadow: 0 0 2px #0000;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #34ab00;
    color: #41ff00;
    font-family: 'Courier New', monospace;
    border-radius: 5px;
    box-shadow: inset 0px 0px 9px #00000094;
}

.action-btn {
  width: 100%;
  padding: 15px;
  margin: 10px 0;
  background: linear-gradient(135deg, #32ae00 0%, #34ab00 100%);
  border: none;
  color: #050;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s;
}

.action-btn.secondary {
    background: linear-gradient(135deg, #666 0%, #444 100%);
    color: #fff;
}

.action-btn:hover {
    box-shadow: 0 0 20px var(--primary);
    transform: scale(1.02);
}

.error-msg {
    color: var(--error);
    text-align: center;
    margin-top: 10px;
    min-height: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid var(--border);
    color: var(--text);
    font-family: 'Courier New', monospace;
    border-radius: 5px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.modal-buttons .action-btn {
    flex: 1;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
    #top-header {
        flex-direction: column;
        gap: 15px;
    }

    .stats-bar {
        flex-wrap: wrap;
        justify-content: center;
    }

    .upgrades-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .modes-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-left h1 {
        font-size: 1.3em;
    }

    .stat-value {
        font-size: 1.1em;
    }

    .rooms-filters {
        flex-direction: column;
    }

    .room-card {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .room-info {
        flex-direction: column;
        gap: 10px;
    }
}
.level-bars {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.level-bar {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.level-label {
    font-size: 0.75em;
    opacity: 0.8;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    transition: width 0.5s;
}

.waiting-info {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.waiting-info p {
    margin: 8px 0;
}

.waiting-players-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.waiting-player {
    padding: 10px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--border);
    border-radius: 5px;
    margin: 5px 0;
}

.settings-stats {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 15px;
}

.settings-stats div {
    margin: 8px 0;
}

.game-history {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 10px;
}

.history-item {
    padding: 8px;
    margin: 5px 0;
    background: rgba(0, 255, 0, 0.1);
    border-radius: 3px;
    font-size: 0.9em;
}

.user-info {
    cursor: pointer;
    transition: all 0.3s;
}

.user-info:hover {
    background: rgba(0, 255, 0, 0.2);
}




.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.level-bars {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 400px;
}

.level-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.level-label {
    font-size: 0.75em;
    opacity: 0.8;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    transition: width 0.5s;
}

.user-info {
    cursor: pointer;
    transition: all 0.3s;
    padding: 8px 15px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px var(--primary);
}

.waiting-info {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.waiting-info p {
    margin: 8px 0;
}

.waiting-players-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.waiting-player {
    padding: 10px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--border);
    border-radius: 5px;
    margin: 5px 0;
}

.settings-stats {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 15px;
}

.settings-stats div {
    margin: 8px 0;
}

.game-history {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 10px;
}

.history-item {
    padding: 8px;
    margin: 5px 0;
    background: rgba(0, 255, 0, 0.1);
    border-radius: 3px;
    font-size: 0.9em;
}

/* Компактная статистика в шапке */
.compact-stats {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 5px 12px;
    background: rgba(0, 50, 0, 0.6);
    border: 2px solid #32ae00;
    border-radius: 5px;
    min-width: 55px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.mini-icon {
    font-size: 1.1em;
}

.mini-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 5px #32ae00;
}

/* Прогресс-бары в настройках */
.settings-levels {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.settings-levels .level-bar {
    margin-bottom: 12px;
}

.settings-levels .level-bar:last-child {
    margin-bottom: 0;
}

.xp-text {
    font-size: 0.75em;
    opacity: 0.7;
    margin-top: 3px;
    display: block;
}




/* ===== НОВЫЙ СТИЛЬ ПОД АВТОРИЗАЦИЮ ===== */

/* Основной фон страницы - плата */
body {
    background:
        url('/images/pcb-background.png') no-repeat center center fixed,
        linear-gradient(135deg, #050 0%, #030 100%);
    background-size: cover;
    color: #34ab00;
}

/* Шапка в новом стиле */
#top-header {
    background: rgba(5, 30, 5, 0.95);
    border-bottom: 3px solid #32ae00;
    box-shadow: 0 2px 20px rgba(50, 174, 0, 0.5);
}

.header-left h1 {
    color: #00ff00;
    text-shadow: 0 0 15px #32ae00, 0 0 2px #000;
    letter-spacing: 3px;
}

.header-left .subtitle {
    color: #34ab00;
    text-shadow: 0 0 2px #000;
}

/* Компактная статистика */
.compact-stats {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 5px 12px;
    background: rgba(0, 50, 0, 0.6);
    border: 2px solid #32ae00;
    border-radius: 5px;
    min-width: 55px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.mini-icon {
    font-size: 1.1em;
}

.mini-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 5px #32ae00;
}

/* Панель пользователя */
.user-info {
    background: rgba(0, 80, 0, 0.6);
    border: 2px solid #32ae00;
    color: #00ff00;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    text-shadow: 0 0 2px #000;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.user-info:hover {
    background: rgba(0, 120, 0, 0.6);
    box-shadow: 0 0 15px #32ae00, inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.icon-btn {
    background: rgba(0, 80, 0, 0.6);
    border: 2px solid #32ae00;
    color: #00ff00;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.icon-btn:hover {
    background: rgba(0, 120, 0, 0.6);
    box-shadow: 0 0 15px #32ae00, inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.logout-btn:hover {
    background: rgba(150, 0, 0, 0.6);
    border-color: #ff0000;
    box-shadow: 0 0 15px #ff0000, inset 0 0 10px rgba(0, 0, 0, 0.5);
    color: #ff4444;
}

/* Заголовки секций */
.section-title {
    color: #34ab00;
    border-bottom: 3px solid #32ae00;
    letter-spacing: 1px;
}

/* Карточки улучшений */
.upgrade-card {
    background: rgba(0, 30, 0, 0.85);
    border: 2px solid #32ae00;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7), 0 0 10px rgba(50, 174, 0, 0.3);
}

.upgrade-card h3 {
    color: #00ff00;
    text-shadow: 0 0 5px #32ae00;
}

.upgrade-level {
    color: #34ab00;
}

.upgrade-cost {
    color: #ffff00;
    text-shadow: 0 0 2px #000;
}

.upgrade-btn {
    background: linear-gradient(135deg, #32ae00 0%, #34ab00 100%);
    color: #050;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff00;
}

.upgrade-btn:hover:not(:disabled) {
    box-shadow: 0 0 20px #32ae00;
    background: linear-gradient(135deg, #40cc00 0%, #40cc00 100%);
}

.upgrade-btn:disabled {
    background: #1a1a1a;
    color: #555;
    border: 1px solid #333;
}

/* Карточки режимов */
.mode-card {
background: linear-gradient(135deg, rgb(0, 85, 0) 0%, rgb(0, 85, 0) 100%);
  border: 3px solid #34ab00;
  box-shadow: 0 0 50px rgba(50, 174, 0, 0), inset 0 0 30px rgba(0, 0, 0, 0.7);
}

.mode-card h3 {
    color: #00ff00;
    text-shadow: 0 0 10px #32ae00;
}

.mode-desc {
    color: #34ab00;
}

.mode-stats {
    background: rgba(0, 50, 0, 0.6);
    border: 1px solid #32ae00;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.mode-stat-label {
    color: #34ab00;
}

.mode-stat-value {
    color: #00ff00;
    text-shadow: 0 0 5px #32ae00;
}

.coop-options {
    background: rgba(0, 50, 0, 0.6);
    border: 1px solid #32ae00;
}

.checkbox-label {
    color: #34ab00;
}

.checkbox-label input[type="checkbox"] {
    accent-color: #32ae00;
}

.mode-btn {
    background: linear-gradient(135deg, #32ae00 0%, #34ab00 100%);
    color: #050;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    border: 2px solid #00ff00;
    font-weight: bold;
}

.mode-btn:hover {
    box-shadow: 0 0 25px #32ae00;
    background: linear-gradient(135deg, #40cc00 0%, #40cc00 100%);
}

/* Фильтры комнат */
.search-input, .filter-select {
    background: rgba(0, 50, 0, 0.6);
    border: 2px solid #32ae00;
    color: #34ab00;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.search-input::placeholder {
    color: #fff;
}

.search-input:focus, .filter-select:focus {
    box-shadow: 0 0 15px #32ae00, inset 0 0 10px rgba(0, 0, 0, 0.5);
    border-color: #00ff00;
}

.checkbox-group .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    padding: 10px;
}

/* Карточки комнат */
.room-card {
    background: rgba(0, 30, 0, 0.85);
    border: 2px solid #32ae00;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.7);
}

.room-card:hover {
    background: rgba(0, 50, 0, 0.85);
    box-shadow: 0 0 20px rgba(50, 174, 0, 0.5), inset 0 0 15px rgba(0, 0, 0, 0.7);
}

.room-creator {
    color: #00ff00;
    text-shadow: 0 0 5px #32ae00;
}

.room-name {
    color: #34ab00;
}

.room-level {
    color: #ffff00;
    text-shadow: 0 0 2px #000;
}

.room-players {
    color: #00aaff;
}

.join-btn {
    background: linear-gradient(135deg, #32ae00 0%, #34ab00 100%);
    color: #050;
    border: 1px solid #00ff00;
}

.join-btn:hover:not(:disabled) {
    box-shadow: 0 0 20px #32ae00;
}

.join-btn:disabled {
    background: #1a1a1a;
    color: #555;
    border: 1px solid #333;
}

.room-empty {
    color: #34ab00;
    text-shadow: 0 0 5px rgba(50, 174, 0, 0.5);
}

/* Футер */
#footer {
    border-top: 2px solid #32ae00;
    color: #34ab00;
    text-shadow: 0 0 2px #000;
}

/* Модальные окна - фон платы */
.modal {
    background: url('/images/pcb-background.png') no-repeat center center fixed;
    background-size: cover;
}

.modal-content {
  background: linear-gradient(135deg, rgb(0, 85, 0) 0%, rgb(0, 85, 0) 100%);
  border: 3px solid #34ab00;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0), inset 0 0 5px rgb(0, 0, 0);
}

.modal-content h2 {
    color: #34ab00;
}

/* Кнопки в модалках */
.action-btn {
    background: linear-gradient(135deg, #32ae00 0%, #34ab00 100%);
    color: #050;
    border: 2px solid #33ad00;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.action-btn:hover {
    box-shadow: 0 0 25px #32ae00;
    background: linear-gradient(135deg, #40cc00 0%, #40cc00 100%);
}

.action-btn.secondary {
    background: linear-gradient(135deg, #444 0%, #222 100%);
    color: #ccc;
    border: 2px solid #666;
}

.action-btn.secondary:hover {
    box-shadow: 0 0 15px #888;
}

/* Формы в модалках */
.form-group label {
    color: #00ff00;
    text-shadow: 0 0 2px #000;
}

.form-group input, .form-group select {
    background: rgba(0, 50, 0, 0.6);
    border: 2px solid #32ae00;
    color: #34ab00;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.form-group input:focus, .form-group select:focus {
    border-color: #00ff00;
    box-shadow: 0 0 10px #32ae00, inset 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Статистика в настройках */
.settings-stats {
    background: rgba(0, 50, 0, 0.6);
    border: 2px solid #32ae00;
    color: #34ab00;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.settings-stats div {
    color: #34ab00;
}

.settings-stats span {
    color: #00ff00;
    font-weight: bold;
}

/* История игр */
.game-history {
    background: rgba(0, 30, 0, 0.6);
    border: 2px solid #32ae00;
}

.history-item {
    background: rgba(0, 50, 0, 0.6);
    border: 1px solid #32ae00;
    color: #34ab00;
}

/* Прогресс-бары в настройках */
.settings-levels {
    background: rgba(0, 50, 0, 0.6);
    border: 2px solid #32ae00;
}

.level-label {
    color: #00ff00;
    text-shadow: 0 0 2px #000;
}

.progress-bar {
    background: rgba(0, 30, 0, 0.8);
    border: 1px solid #32ae00;
}

.progress-fill {
    background: linear-gradient(90deg, #32ae00 0%, #00ff00 100%);
    box-shadow: 0 0 10px #32ae00;
}

.xp-text {
    color: #34ab00;
}

/* Ожидание комнаты */
.waiting-info {
    background: rgba(0, 50, 0, 0.6);
    border: 2px solid #32ae00;
    color: #34ab00;
}

.waiting-info p {
    color: #34ab00;
}

.waiting-info span {
    color: #00ff00;
    font-weight: bold;
}

.waiting-player {
    background: rgba(0, 50, 0, 0.6);
    border: 2px solid #32ae00;
    color: #00ff00;
}

/* Адаптивность */
@media (max-width: 1024px) {
    #top-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .compact-stats {
        flex-wrap: wrap;
    }

    .upgrades-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .modes-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-left h1 {
        font-size: 1.3em;
    }

    .mini-value {
        font-size: 1em;
    }

    .rooms-filters {
        flex-direction: column;
    }

    .room-card {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .room-info {
        flex-direction: column;
        gap: 10px;
    }
}


.rooms-filters {
    background: linear-gradient(135deg, rgb(52, 171, 0) 0%, rgb(52, 171, 0) 100%);
    border: 3px solid #34ab00;
    padding: 0px;
    border-radius: 5px;
}

/* ===== ДВУХКОЛОНОЧНЫЙ ГРИД ===== */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.modes-column, .upgrades-column {
    background: rgba(0, 30, 0, 0.85);
    border: 2px solid #32ae00;
    border-radius: 10px;
    padding: 20px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7), 0 0 10px rgba(50, 174, 0, 0.3);
}

.modes-column .section-title, .upgrades-column .section-title {
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Список навыков */
.upgrades-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}





.upgrade-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: rgba(0, 50, 0, 0.6);
    border: 2px solid #32ae00;
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
    margin-bottom: 8px;
}

.upgrade-item:hover {
    background: rgba(0, 80, 0, 0.6);
    box-shadow: 0 0 15px rgba(50, 174, 0, 0.5), inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.upgrade-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.upgrade-item .upgrade-icon {
    font-size: 1.8em;
    min-width: 40px;
    text-align: center;
}

.upgrade-item .upgrade-info {
    flex: 1;
    min-width: 250px;
}

.upgrade-item .upgrade-name {
    color: #00ff00;
    font-weight: bold;
    font-size: 1em;
    text-shadow: 0 0 5px #32ae00;
    margin-bottom: 3px;
}

.upgrade-item .upgrade-level,
.upgrade-item .upgrade-cost {
    color: #34ab00;
    font-size: 0.85em;
    margin: 2px 0;
}

.upgrade-item .upgrade-cost {
    color: #ffff00;
    text-shadow: 0 0 2px #000;
}

.upgrade-item .upgrade-btn {
    min-width: 90px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #32ae00 0%, #34ab00 100%);
    border: 1px solid #00ff00;
    color: #050;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 0.9em;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.upgrade-item .upgrade-btn:hover:not(:disabled) {
    box-shadow: 0 0 15px #32ae00;
    background: linear-gradient(135deg, #40cc00 0%, #40cc00 100%);
}

.upgrade-item .upgrade-btn:disabled {
    background: #1a1a1a;
    color: #555;
    border: 1px solid #333;
    cursor: not-allowed;
}




/* Выбор уровня в coop */
.level-select-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.level-select-group label {
    color: #34ab00;
    font-weight: bold;
}

.level-select {
    flex: 1;
    padding: 8px;
    background: rgba(0, 50, 0, 0.6);
    border: 2px solid #32ae00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    border-radius: 5px;
    cursor: pointer;
}

.level-select:focus {
    outline: none;
    border-color: #00ff00;
    box-shadow: 0 0 10px #32ae00;
}

.level-select option {
    background: #050;
    color: #00ff00;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}



/* Компактные карточки режимов */
.mode-card.compact {
    padding: 15px;
    margin-bottom: 12px;
}

.mode-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.mode-icon-small {
    font-size: 1.5em;
}

.mode-card.compact h3 {
    font-size: 1.1em;
    margin: 0;
}

.mode-desc-small {
    font-size: 0.85em;
    opacity: 0.8;
    margin: 5px 0 10px 0;
}

.mode-stats-compact {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    margin: 10px 0;
    padding: 8px;
    background: rgba(0, 50, 0, 0.4);
    border-radius: 5px;
}

.mode-stats-compact strong {
    color: #00ff00;
}

.mode-btn-small {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: linear-gradient(135deg, #32ae00 0%, #34ab00 100%);
    border: 2px solid #00ff00;
    color: #050;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.mode-btn-small:hover {
    box-shadow: 0 0 15px #32ae00;
}

.coop-options-compact {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 10px 0;
}

.level-select-small {
    flex: 1;
    padding: 6px;
    background: rgba(0, 50, 0, 0.6);
    border: 2px solid #32ae00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    border-radius: 5px;
    cursor: pointer;
}

.checkbox-label-small {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
    cursor: pointer;
}

.checkbox-label-small input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}








/* Стили для модального окна кастомной комнаты */
.custom-modal {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.custom-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.custom-form-grid .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.custom-form-grid label {
    color: #00ff00;
    font-size: 14px;
    font-weight: bold;
}

.custom-form-grid input,
.custom-form-grid select {
    background: #0a0a0a;
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.custom-form-grid input:focus,
.custom-form-grid select:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 10px #00ffff;
}

.enemy-types-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid #00ff00;
    border-radius: 8px;
}

.enemy-types-section h3 {
    color: #00ff00;
    margin-bottom: 10px;
    font-size: 16px;
}

.enemy-checkboxes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.enemy-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #00ff00;
    cursor: pointer;
    font-size: 13px;
}

.enemy-checkboxes input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00ff00;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #00ff00;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #00ff00;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

.action-btn.secondary {
    background: rgba(255, 0, 0, 0.2);
    border-color: #ff0000;
    color: #ff0000;
}

.action-btn.secondary:hover {
    background: rgba(255, 0, 0, 0.3);
}









/* Стили для секции активных комнат */
.rooms-section {
    background: rgba(0, 30, 0, 0.85);
    border: 2px solid #32ae00;
    border-radius: 10px;
    padding: 20px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7), 0 0 10px rgba(50, 174, 0, 0.3);
    margin-top: 20px;
}

.rooms-section .section-title {
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Информация о дорогах в карточках режимов */
.mode-info-row {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    margin: 10px 0;
    padding: 8px;
    background: rgba(0, 50, 0, 0.4);
    border-radius: 5px;
    font-size: 0.9em;
}

.mode-info-row span {
    color: #34ab00;
}

.mode-info-row strong {
    color: #00ff00;
    text-shadow: 0 0 5px #32ae00;
}

/* Стили для модального окна кастомной комнаты */
.custom-modal {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.custom-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.custom-form-grid .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.custom-form-grid label {
    color: #00ff00;
    font-size: 14px;
    font-weight: bold;
}

.custom-form-grid input,
.custom-form-grid select {
    background: #0a0a0a;
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.custom-form-grid input:focus,
.custom-form-grid select:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 10px #00ffff;
}

.enemy-types-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid #00ff00;
    border-radius: 8px;
}

.enemy-types-section h3 {
    color: #00ff00;
    margin-bottom: 10px;
    font-size: 16px;
}

.enemy-checkboxes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.enemy-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #00ff00;
    cursor: pointer;
    font-size: 13px;
}

.enemy-checkboxes input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00ff00;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #00ff00;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #00ff00;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

.action-btn.secondary {
    background: rgba(255, 0, 0, 0.2);
    border-color: #ff0000;
    color: #ff0000;
}

.action-btn.secondary:hover {
    background: rgba(255, 0, 0, 0.3);
}





/* ===== АДМИН ПАНЕЛЬ ===== */
.admin-btn {
    animation: adminPulse 2s infinite;
}

@keyframes adminPulse {
    0%, 100% { box-shadow: 0 0 5px #ffd700; }
    50% { box-shadow: 0 0 20px #ffd700; }
}

.admin-modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #32ae00;
    padding-bottom: 10px;
}

.admin-tab-btn {
    flex: 1;
    padding: 10px;
    background: rgba(0, 50, 0, 0.6);
    border: 2px solid #32ae00;
    color: #34ab00;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    border-radius: 5px 5px 0 0;
    transition: all 0.3s;
}

.admin-tab-btn.active {
    background: rgba(0, 100, 0, 0.8);
    color: #00ff00;
    border-color: #00ff00;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

.admin-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 15px 0;
}

.admin-user-row, .admin-room-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    margin: 5px 0;
    background: rgba(0, 50, 0, 0.4);
    border: 1px solid #32ae00;
    border-radius: 5px;
    font-size: 0.9em;
    flex-wrap: wrap;
}

.admin-user-row span, .admin-room-row span {
    color: #34ab00;
}

.admin-empty {
    text-align: center;
    padding: 30px;
    color: #34ab00;
    opacity: 0.7;
}

.admin-config-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 50, 0, 0.4);
    border: 2px solid #32ae00;
    border-radius: 8px;
}

.admin-config-section h3 {
    color: #00ff00;
    margin-bottom: 15px;
}

.config-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-action-btn {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    background: linear-gradient(135deg, #32ae00 0%, #34ab00 100%);
    border: 2px solid #00ff00;
    color: #050;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.admin-action-btn:hover {
    box-shadow: 0 0 15px #32ae00;
    background: linear-gradient(135deg, #40cc00 0%, #40cc00 100%);
}

.config-help {
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    font-size: 0.85em;
}

.config-help p {
    margin: 5px 0;
    color: #34ab00;
}

.config-help strong {
    color: #00ff00;
}

.config-modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.config-textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    background: #0a0a0a;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    border-radius: 5px;
    resize: vertical;
    margin: 15px 0;
}

.config-textarea:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 10px #00ffff;
}

.config-save-options {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 50, 0, 0.4);
    border: 2px solid #32ae00;
    border-radius: 8px;
}

.config-save-options label {
    display: block;
    color: #00ff00;
    margin-bottom: 10px;
    font-weight: bold;
}

.config-save-options input[type="number"] {
    width: 100px;
    padding: 8px;
    background: #0a0a0a;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    border-radius: 5px;
    margin-bottom: 15px;
}

.save-mode-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.save-mode-buttons .action-btn {
    flex: 1;
}

.config-actions {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}