* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(145deg, #0a1a1f 0%, #0c1e24 100%);
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, 'Roboto', sans-serif;
    padding: 2rem 1.5rem;
    color: #eef4ff;
}

.dashboard {
    max-width: 1600px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #FFFFFF 0%, #b9e2f0 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 0.35rem;
}

.sub {
    color: #8aaec0;
    border-left: 4px solid #2f8b9e;
    padding-left: 1rem;
    font-weight: 400;
    font-size: 0.9rem;
}

.teams-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.team-card {
    background: rgba(18, 30, 35, 0.75);
    backdrop-filter: blur(4px);
    border-radius: 1.8rem;
    border: 1px solid rgba(72, 187, 204, 0.25);
    overflow: hidden;
    box-shadow: 0 20px 35px -12px rgba(0,0,0,0.4);
    transition: transform 0.2s ease, box-shadow 0.2s;
}

.team-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 40px -14px rgba(0,0,0,0.5);
    border-color: rgba(72, 187, 204, 0.5);
}

.team-header {
    padding: 1.25rem 1.8rem;
    background: rgba(10, 25, 30, 0.8);
    border-bottom: 2px solid #2f8b9e;
}

.team-name {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.team-name-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-flag {
    height: 30px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    border-radius: 4px;
}

.team-faction-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #c3e4f0;
}

.specialization-badge {
    background: #1f5e6b;
    padding: 4px 12px;
    border-radius: 60px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #bbdef0;
}

.member-count {
    font-size: 0.8rem;
    background: #0f2c33;
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    margin-top: 8px;
    font-weight: 400;
    color: #bbdef0;
}

.squads-container {
    padding: 1.2rem 1rem 1.8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.squad-group {
    background: rgba(12, 22, 28, 0.65);
    border-radius: 1.2rem;
    border-left: 5px solid #3fafc2;
    overflow: hidden;
    transition: all 0.2s;
}

.squad-group.command-squad {
    border-left: 5px solid #f5a623;
    box-shadow: 0 0 8px rgba(245, 166, 35, 0.3);
}

.squad-group.command-squad .squad-header {
    background: linear-gradient(135deg, rgba(245, 166, 35, 0.25) 0%, rgba(245, 166, 35, 0.1) 100%);
    border-bottom: 1px dashed #f5a623;
}

.squad-group.command-squad .squad-num {
    background: #b87c1a;
    color: #1e1a0c;
    font-weight: 700;
}

.squad-header {
    background: rgba(0, 0, 0, 0.35);
    padding: 0.65rem 1.2rem;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px dashed #2f7a8c;
}

.squad-num {
    background: #266b7c;
    padding: 0.2rem 0.8rem;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 600;
}

.squad-leader-badge {
    font-size: 0.7rem;
    background: #d97706;
    color: #1e1a0c;
    padding: 0.2rem 0.7rem;
    border-radius: 24px;
    font-weight: 600;
}

.players-list {
    list-style: none;
    padding: 0.3rem 0;
}

.player-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 0.5rem 1.2rem;
    border-bottom: 1px solid rgba(72, 187, 204, 0.08);
    font-size: 0.92rem;
    transition: background 0.1s;
}

.player-item:hover {
    background: rgba(60, 150, 170, 0.12);
}

.player-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3));
}

.player-name {
    flex: 1;
    font-weight: 500;
    word-break: break-word;
    text-align: left;
}

.leader-label {
    font-size: 0.7rem;
    background: #b45309;
    padding: 2px 8px;
    border-radius: 30px;
    font-weight: 600;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.leader-label.cmd {
    background: #f5a623;
    color: #1e1a0c;
    box-shadow: 0 0 4px rgba(245, 166, 35, 0.5);
}

.status-overlay {
    background: rgba(0, 0, 0, 0.65);
    border-radius: 2rem;
    padding: 2rem;
    text-align: center;
    grid-column: span 2;
}

.loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #2f8b9e;
    border-top: 4px solid #c3f0ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-box {
    background: #451e1ecc;
    border-left: 8px solid #f97373;
    padding: 1.2rem;
    border-radius: 1.2rem;
    color: #ffcdcd;
}

.refresh-btn {
    background: #226c7c;
    border: none;
    color: white;
    padding: 6px 20px;
    border-radius: 60px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.8rem;
}

.refresh-btn:hover {
    background: #2f8b9e;
    transform: scale(0.97);
}

.refresh-btn:active {
    transform: scale(0.95);
}

.footer-info {
    margin-top: 2.5rem;
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Анимация обновления */
@keyframes subtle-pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; background: rgba(72, 187, 204, 0.05); }
    100% { opacity: 0.7; }
}

.updating {
    animation: subtle-pulse 0.3s ease;
}

@media (max-width: 780px) {
    body { padding: 1rem; }
    .teams-grid { gap: 1rem; grid-template-columns: 1fr; }
    .team-name { font-size: 1.2rem; flex-direction: column; align-items: flex-start; }
    .dashboard-header { flex-direction: column; align-items: stretch; }
    .refresh-btn { align-self: flex-start; }
    .team-flag { height: 24px; }
}