/* === ОСНОВНОЙ СТИЛЬ === */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    max-width: none;
    margin: 0;
    padding: 10px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

h1 {
    text-align: center;
    margin: 10px 0;
    font-size: 20px;
}

.header-with-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header-with-button h1 {
    margin: 10px 0;
}

/* === ЗАГРУЗКА ФАЙЛА === */
#file-controls {
    text-align: center;
    margin-bottom: 10px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

#file-controls input, #file-controls button {
    margin: 0 5px;
}

/* Стилизация кнопки выбора файла */
#xlsxFileInput {
    display: none;
}

.file-input-label {
    display: inline-block;
    background: #1890ff;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.file-input-label:hover {
    background: #096dd9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* === КНОПКА ЧАЕВЫХ === */
.tips-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: #333;
    text-decoration: none;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-left: 10px;
}

.tips-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #fda085 0%, #f6d365 100%);
}

.tips-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* === РАЗДЕЛЕНИЕ ЭКРАНА: ДАННЫЕ СЛЕВА, ТАБЛИЦЫ СПРАВА (одна под другой) === */
.main-layout {
    display: flex;
    flex: 1;
    gap: 10px;
    height: calc(100vh - 100px);
    overflow: hidden;
}

/* === ЛЕВАЯ ЧАСТЬ — СПИСОК ИГРОКОВ === */
#dataDisplay {
    width: 400px; /* Больше места слева */
    background: white;
    border-radius: 8px;
    padding: 10px;
    overflow-y: auto;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.player-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-column {
    margin-bottom: 15px;
}

.column-header {
    font-weight: bold;
    text-align: center;
    background-color: #e9e9e9;
    padding: 6px;
    border-radius: 4px;
    font-size: 12px;
}



.player-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 6px;
    font-size: 11px;
    cursor: move;
    position: relative;
    user-select: none;
}

.player-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.player-card-title {
    font-weight: bold;
    font-size: 12px;
}

.player-card-info {
    color: #666;
    font-size: 10px;
}

.captain-highlight {
    background-color: #fffbe6 !important;
    border-color: #ffd591 !important;
}

.tooltip {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 11px;
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.player-card:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* === ПРАВАЯ ЧАСТЬ — ТАБЛИЦЫ (одна под другой) === */
.tables-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    overflow-y: auto;
}

.table-section {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    padding: 10px 5px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    min-height: 200px;
}

/* Для 3 и 4 таблиц - расширяемый вариант */
.table-section.expandable {
    min-height: auto;
    height: auto;
}

.table-section h2 {
    text-align: center;
    font-size: 14px;
    margin: 0 0 8px 0;
}

.assignment-table {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    overflow-y: auto;
    flex: 1;
    min-height: 100px;
}

/* Для 3 и 4 таблиц - расширяемый вариант */
.assignment-table.expandable {
    overflow-y: visible;
    min-height: auto;
    height: auto;
}

.region-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
}

.region-header {
    font-weight: bold;
    text-align: center;
    background: #444;
    color: white;
    padding: 4px;
    border-radius: 3px;
    font-size: 10px;
}

.region-slot {
    min-height: 20px;
    padding: 4px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 10px;
    position: relative;
}

.captain-attack {
    font-size: 9px;
    color: #1890ff;
    text-align: center;
    font-weight: bold;
}

.region-slot:first-child {
    background: #e6f7ff;
    border-color: #91d5ff;
    font-weight: bold;
}

.region-slot .remove-btn {
    position: absolute;
    top: 1px;
    right: 1px;
    background: #ff4d4f;
    color: white;
    border: none;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    font-size: 8px;
    cursor: pointer;
    opacity: 0.7;
}

.region-slot:hover .remove-btn {
    opacity: 1;
}

.region-empty {
    color: #aaa;
    font-style: italic;
}

/* === СЧЁТЧИКИ ПО СТОЛБЦАМ === */
.column-count {
    font-size: 9px;
    color: #666;
    text-align: center;
}

.captain-attack,
.captain-type {
    font-size: 0.8em;
    color: #0066cc;
    text-align: center;
    margin-top: 2px;
}

.region-slot.dragging {
    opacity: 0.5;
    transform: scale(1.05);
    z-index: 1000;
}

.region-column.highlighted {
    border: 2px dashed #007cba;
    background-color: #f0f8ff;
}

.player-card.dragging,
.region-slot.dragging {
    opacity: 0.6;
    transform: scale(1.05);
    z-index: 1000;
}

.region-column.highlighted {
    border: 2px dashed #007cba;
}

.captain-btn {
    background: none;
    border: none;
    font-size: 0.9em;
    cursor: pointer;
    opacity: 0.6;
    margin-left: 5px;
    transition: opacity 0.2s;
}

.captain-btn:hover {
    opacity: 1;
}

/* Можно скрывать кнопку у капитана, если нужно */
.region-column .region-slot:first-child .captain-btn {
    opacity: 0.3;
    cursor: default;
}

.region-slot.captain {
    background-color: #e3f2fd;
    border: 2px solid #2196f3;
    font-weight: bold;
    border-radius: 4px;
}

.clickable-header {
    cursor: pointer;
    user-select: none;
}

.clickable-header:hover {
    background-color: #f0f0f0;
    border-radius: 4px;
}

.clickable-header.collapsed::after {
    content: ' ▶';
    font-size: 0.8em;
    color: #666;
}

.clickable-header:not(.collapsed)::after {
    content: ' ▼';
    font-size: 0.8em;
    color: #666;
}

.counter {
    font-size: 0.9em;
    color: #666;
    margin-left: 8px;
}

.time-subheader {
    font-weight: bold;
    background-color: #f9f9f9;
    padding: 4px 8px;
    margin: 6px 0 4px 15px;
    border-left: 3px solid #1890ff;
    font-size: 0.9em;
    cursor: pointer;
    user-select: none;
}

.time-subheader.collapsed::after {
    content: ' ▶';
    color: #666;
    margin-left: 4px;
}

.time-subheader:not(.collapsed)::after {
    content: ' ▼';
    color: #666;
    margin-left: 4px;
}
.players-panel {
    width: 400px;
    background: white;
    border-radius: 8px;
    padding: 10px;
    overflow: hidden;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: bold;
    color: #333;
}

.panel-header h3 {
    margin: 0;
    font-size: 14px;
}

.collapse-all-btn {
    background: none;
    border: 1px solid #ccc;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.collapse-all-btn:hover {
    background-color: #f0f0f0;
    border-color: #999;
}

.add-player-btn {
    background: #52c41a;
    color: white;
    border: none;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.add-player-btn:hover {
    background: #389e0d;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-display-content {
    overflow-y: auto;
    flex: 1;
}

.search-sort-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
    padding: 8px;
    background-color: #f7f7f7;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid #e0e0e0;
}

.search-sort-panel input {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
}

.sort-buttons {
    display: flex;
    gap: 4px;
}

.sort-buttons button {
    flex: 1;
    padding: 4px 6px;
    font-size: 11px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
}

.sort-buttons button:hover {
    background-color: #e0e0e0;
}

.sort-buttons button:active {
    background-color: #d0d0d0;
}

.capacity-display {
    font-size: 0.8em;
    text-align: center;
    font-weight: bold;
    color: #1890ff;
    margin-top: 2px;
}

.editable-march {
    font-weight: bold;
    color: #1890ff;
    cursor: pointer;
    user-select: none;
}

.editable-march:hover {
    color: #0066cc;
    text-decoration: underline;
}

/* === СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА РАСЧЁТА ЛИМИТОВ === */
.capacity-btn {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.capacity-btn:hover {
    background-color: #f0f0f0;
    border-color: #999;
}

.limit-input {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
}

.limit-input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 4px rgba(24, 144, 255, 0.3);
}

#capacitySumDisplay {
    font-size: 20px;
    font-weight: bold;
    color: #1890ff;
    text-align: center;
    padding: 10px;
}

/* === СТИЛИ ДЛЯ ЗАБЛОКИРОВАННОГО СЛОТА === */
.locked-slot {
    background-color: #fff1f0 !important;
    border-color: #ffccc7 !important;
    opacity: 0.8;
}

.locked-slot:hover {
    opacity: 0.9;
}

 .player-card.top4-global-highlight {
        border: 2px solid gold !important;
        background: linear-gradient(135deg, #fffde7, #ffeb3b) !important;
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.7) !important;
        font-weight: bold;
    }
    .player-card.top4-global-highlight .player-card-title {
        color: #d4af37 !important;
}

/* === СТИЛИ ДЛЯ РЕКЛАМНОГО БЛОКА YANDEX === */
.yandex-ad-container {
    margin-top: 20px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
    overflow: hidden;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

#yandex_rtb_R-A-2131173-1 {
    width: 100%;
    overflow: hidden;
}
    