* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    background: linear-gradient(135deg, #000000 0%, #1a0b2e 100%);
    min-height: 100vh;
    padding: 20px;
    color: #e0e0e0;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: #0a0a0a;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    overflow: hidden;
    padding: 30px;
    border: 1px solid #4a1d8c;
}

/* Заголовок */
h1 {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    font-size: 2.5em;
    text-align: center;
    font-weight: 800;
}

/* Навигация */
.nav {
    margin-bottom: 30px;
    border-bottom: 2px solid #2d1b4a;
    padding-bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.nav a {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    color: #b0b0b0;
    border-radius: 25px;
    transition: all 0.3s;
    font-weight: 500;
    background: #1a1a1a;
}

.nav a:hover {
    background: #2d1b4a;
    color: white;
    transform: translateY(-2px);
}

.nav a.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(109, 40, 217, 0.4);
}

/* Форма добавления */
.add-form {
    background: #111111;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid #2d1b4a;
}

.add-form h2 {
    color: #c084fc;
    margin-bottom: 20px;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.add-form form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.add-form .form-group {
    flex: 1;
    min-width: 180px;
}

.add-form label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: #a0a0a0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-form input, .add-form select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #2d1b4a;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    background: #1a1a1a;
    color: white;
}

.add-form input:focus, .add-form select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 12px 0;
    color: #c084fc;
}

.checkbox-label input {
    width: auto;
    margin: 0;
    transform: scale(1.2);
    accent-color: #8b5cf6;
}

.add-form button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    min-width: 120px;
}

.add-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(109, 40, 217, 0.4);
}

/* Сетка отрядов - 6 колонок */
.squads-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-top: 30px;
}

/* Карточка отряда - убираем фиксированную высоту */
.squad-card {
    background: #0f0f0f;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    transition: all 0.3s;
    border: 1px solid #2d1b4a;
    display: flex;
    flex-direction: column;
    height: auto;
}

.squad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(109, 40, 217, 0.3);
    border-color: #8b5cf6;
}

/* Заголовок отряда */
.squad-header {
    background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.squad-header h2 {
    color: white;
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
}

.member-count {
    background: rgba(0,0,0,0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

/* Контент отряда - убираем прокрутку и фиксированную высоту */
.squad-content {
    padding: 15px;
    background: #0a0a0a;
    flex: 1;
    overflow: visible;
    height: auto;
}

/* Лидер */
.leader-section {
    margin-bottom: 15px;
    border-bottom: 2px solid #2d1b4a;
    padding-bottom: 10px;
}

.leader-badge {
    display: inline-block;
    background: #8b5cf6;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin: 6px 0;
    background: #111111;
    border-radius: 10px;
    transition: all 0.2s;
    border: 1px solid #2d1b4a;
    gap: 8px;
    min-width: 0;
}

.member-item:hover {
    background: #1a1a1a;
    border-color: #8b5cf6;
    transform: translateX(3px);
}

.member-item.leader {
    background: #1a0b2e;
    border-left: 3px solid #8b5cf6;
}

/* Обертка для имени с обрезкой текста */
.member-name-wrapper {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.member-name {
    font-weight: 500;
    color: #e0e0e0;
    font-size: 13px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.member-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

/* Кнопки-иконки */
.icon-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.icon-btn i {
    pointer-events: none;
}

.icon-btn.remove {
    background: #991b1b;
    color: white;
}

.icon-btn.remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.icon-btn.make-leader {
    background: #6d28d9;
    color: white;
}

.icon-btn.make-leader:hover {
    background: #8b5cf6;
    transform: scale(1.1);
}

.remove-leader {
    background: #b45309;
    color: white;
}

.remove-leader:hover {
    background: #ea580c;
    transform: scale(1.1);
}

.members-title {
    font-size: 11px;
    color: #8b5cf6;
    margin-bottom: 8px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.empty-squad {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 13px;
}

.empty-squad p {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Уведомления */
.success, .error, .warning {
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.success {
    background: #064e3b;
    color: #a7f3d0;
    border-left: 4px solid #10b981;
}

.error {
    background: #7f1a1a;
    color: #fecaca;
    border-left: 4px solid #ef4444;
}

.warning {
    background: #713f12;
    color: #fde047;
    border-left: 4px solid #eab308;
}

/* Стили для страницы игроков */
.players-list {
    background: #0f0f0f;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid #2d1b4a;
}

.players-list h2 {
    padding: 20px;
    background: #111111;
    margin: 0;
    border-bottom: 2px solid #2d1b4a;
    color: #c084fc;
}

/* Стили для множественного удаления */
.delete-actions {
    margin-bottom: 20px;
    padding: 15px;
    background: #111111;
    border-radius: 10px;
    display: flex;
    gap: 15px;
    align-items: center;
    border: 1px solid #2d1b4a;
}

.delete-selected {
    padding: 8px 20px;
    background: #991b1b;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.delete-selected:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.select-actions {
    font-size: 13px;
}

.select-actions a {
    color: #8b5cf6;
    text-decoration: none;
    cursor: pointer;
}

.select-actions a:hover {
    color: #c084fc;
    text-decoration: underline;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #2d1b4a;
}

th:first-child, td:first-child {
    width: 40px;
    text-align: center;
}

th input[type="checkbox"],
td input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #8b5cf6;
    margin: 0;
}

th {
    background: #0a0a0a;
    font-weight: 600;
    color: #c084fc;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

tr:hover {
    background: #111111;
}

td {
    color: #e0e0e0;
}

td form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

td input[type="text"] {
    flex: 1;
    min-width: 150px;
    padding: 6px 10px;
    border: 1px solid #2d1b4a;
    border-radius: 6px;
    background: #1a1a1a;
    color: white;
    font-size: 13px;
}

td input[type="text"]:focus {
    outline: none;
    border-color: #8b5cf6;
}

button.edit {
    padding: 4px 12px;
    background: #6d28d9;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

button.edit:hover {
    background: #8b5cf6;
}

a.delete {
    display: inline-block;
    padding: 4px 12px;
    background: #991b1b;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.2s;
    margin-left: 5px;
}

a.delete:hover {
    background: #dc2626;
}

.squads-list {
    font-size: 12px;
    color: #c084fc;
    background: #1a1a1a;
    padding: 4px 8px;
    border-radius: 5px;
    display: inline-block;
}

.free-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #2d1b4a;
    color: #c084fc;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* Адаптивность */
@media (max-width: 1400px) {
    .squads-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
}

@media (max-width: 1000px) {
    .squads-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .container {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .squads-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .add-form form {
        flex-direction: column;
    }
    
    .add-form .form-group {
        width: 100%;
    }
    
    .nav {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav a {
        text-align: center;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 10px;
    }
    
    .delete-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    td form {
        flex-direction: column;
        gap: 5px;
    }
    
    td input[type="text"] {
        width: 100%;
    }
    
    button.edit, a.delete {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .squads-container {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.8em;
    }
}