
/* Cat Fighting — кланы на планшетах и в VK Mini App desktop.
   Ширина контента и общий режим определяются существующей адаптацией.
   1cqw = 1% ширины #content. Механики кланов и JS не меняются. */
@media (min-width: 601px) and (min-height: 600px) {
    /* Общий контейнер: список и вкладки могут прокручиваться. */
    body.catfight-tablet-layout #content .clans-container {
        box-sizing: border-box;
        min-width: 0;
        min-height: 0;
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: clamp(5px, 1.25cqw, 10px);
        border-radius: clamp(12px, 3cqw, 24px);
        font-size: clamp(13px, 3.25cqw, 24px);
    }
    body.catfight-tablet-layout #content .clans-title-wrapper {
        gap: clamp(12px, 3cqw, 24px);
        padding: clamp(10px, 2.5cqw, 20px) 0 clamp(4px, 1cqw, 8px);
        flex-shrink: 0;
    }
    body.catfight-tablet-layout #content .clans-title-text {
        font-size: clamp(18px, 4.5cqw, 36px);
    }
    body.catfight-tablet-layout #content :is(.clans-deco-left,.clans-deco-right) {
        height: clamp(2px, .5cqw, 4px);
    }
    body.catfight-tablet-layout #content .clans-container .btn-glass {
        font-size: clamp(13px, 3.25cqw, 25px) !important;
        padding: clamp(7px, 1.75cqw, 14px) clamp(10px, 2.5cqw, 20px) !important;
        white-space: normal;
        min-width: 0;
    }

    /* Каталог кланов: поиск, фильтр, кнопки и таблица. */
    body.catfight-tablet-layout #content .clans-filters-panel {
        gap: clamp(10px, 2.5cqw, 20px);
        padding: clamp(12px, 3cqw, 24px);
        flex-shrink: 0;
    }
    body.catfight-tablet-layout #content :is(.clans-filters-group,.clans-filters-actions) {
        gap: clamp(8px, 2cqw, 16px);
        min-width: 0;
    }
    body.catfight-tablet-layout #content :is(.clans-filter-input,.clans-filter-select,.clans-type-filter-btn) {
        min-width: 0;
        box-sizing: border-box;
        padding: clamp(8px, 2cqw, 16px) clamp(10px, 2.5cqw, 20px);
        font-size: clamp(13px, 3.25cqw, 25px);
    }
    body.catfight-tablet-layout #content .clans-type-filter {
        min-width: 0;
        flex: 1 1 0;
    }
    body.catfight-tablet-layout #content .clans-type-filter-menu {
        max-width: min(80vw, 100%);
        max-height: 48dvh;
        overflow-y: auto;
    }
    body.catfight-tablet-layout #content .clans-type-filter-option {
        font-size: clamp(13px, 3.25cqw, 25px);
        padding: clamp(8px, 2cqw, 16px) clamp(10px, 2.5cqw, 20px);
    }
    body.catfight-tablet-layout #content :is(.clans-reset-btn,.clans-apply-btn) {
        font-size: clamp(13px, 3.25cqw, 25px);
        padding: clamp(8px, 2cqw, 16px) clamp(12px, 3cqw, 24px);
    }

    /* Пять колонок списка, четыре у участников; заголовки остаются sticky. */
    body.catfight-tablet-layout #content :is(.clans-table,.clans-members-table) {
        box-sizing: border-box;
        min-width: 0;
        width: 100%;
        font-size: clamp(12px, 2.9cqw, 22px) !important;
    }
    body.catfight-tablet-layout #content :is(.clans-table,.clans-members-table) thead th {
        font-size: clamp(10px, 2.4cqw, 18px);
        padding: clamp(8px, 2cqw, 16px) clamp(2px, .5cqw, 5px) !important;
        letter-spacing: 0;
        overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout #content :is(.clans-table,.clans-members-table) tbody td {
        padding: clamp(7px, 1.75cqw, 14px) clamp(2px, .5cqw, 5px) !important;
        overflow-wrap: anywhere;
        min-width: 0;
    }
    body.catfight-tablet-layout #content .clans-container > .clans-table {
        table-layout: fixed;
        flex-shrink: 0;
    }
    body.catfight-tablet-layout #content .clans-container > .clans-table thead th:nth-child(1) {
        width: 9% !important;
    }
    body.catfight-tablet-layout #content .clans-container > .clans-table thead th:nth-child(2) {
        width: 14% !important;
    }
    body.catfight-tablet-layout #content .clans-container > .clans-table thead th:nth-child(3) {
        width: 29% !important;
    }
    body.catfight-tablet-layout #content .clans-container > .clans-table thead th:nth-child(4) {
        width: 19% !important;
    }
    body.catfight-tablet-layout #content .clans-container > .clans-table thead th:nth-child(5) {
        width: 29% !important;
    }
    body.catfight-tablet-layout #content .clans-name-cell .clan-name {
        overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout #content .clans-name-cell .clan-level {
        font-size: clamp(10px, 2.5cqw, 19px);
    }
    body.catfight-tablet-layout #content .clan-icon-small {
        width: clamp(38px, 9.5cqw, 74px);
        height: clamp(38px, 9.5cqw, 74px);
        max-width: 100%;
        border-radius: clamp(10px, 2.5cqw, 18px);
    }
    body.catfight-tablet-layout #content .clan-icon-small > i {
        font-size: clamp(17px, 4.25cqw, 32px) !important;
    }
    body.catfight-tablet-layout #content .clans-view-btn {
        max-width: 100%;
        padding: clamp(5px, 1.25cqw, 10px) clamp(3px, .75cqw, 7px) !important;
        font-size: clamp(11px, 2.75cqw, 20px) !important;
    }

    /* Шапка собственного клана и опыт. */
    body.catfight-tablet-layout #content .clan-header {
        min-width: 0;
        padding: clamp(14px, 3.5cqw, 28px) clamp(12px, 3cqw, 24px);
        padding-left: clamp(67px, 16.75cqw, 130px);
        padding-right: clamp(67px, 16.75cqw, 130px);
        flex-shrink: 0;
    }
    body.catfight-tablet-layout #content .clan-header-icon {
        width: clamp(48px, 12cqw, 94px);
        height: clamp(48px, 12cqw, 94px);
        left: clamp(12px, 3cqw, 24px);
        border-radius: clamp(12px, 3cqw, 24px);
    }
    body.catfight-tablet-layout #content .clan-header-icon > i {
        font-size: clamp(28px, 7cqw, 52px) !important;
    }
    body.catfight-tablet-layout #content .clan-header-title {
        min-width: 0;
        overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout #content .clan-header-title h2 {
        font-size: clamp(18px, 4.5cqw, 34px);
        line-height: 1.2;
    }
    body.catfight-tablet-layout #content .clan-header-level {
        font-size: clamp(12px, 3cqw, 22px);
    }
    body.catfight-tablet-layout #content .clan-header-exp {
        margin-top: clamp(6px, 1.5cqw, 12px);
    }
    body.catfight-tablet-layout #content .clan-header-exp :is(.exp-label,.exp-value) {
        font-size: clamp(10px, 2.5cqw, 18px);
    }
    body.catfight-tablet-layout #content .clan-header-exp .exp-bar-bg {
        height: clamp(6px, 1.5cqw, 12px);
        margin-top: clamp(4px, 1cqw, 8px);
    }

    /* Кнопки вкладок со значками в два ряда. */
    body.catfight-tablet-layout #content .clans-tab-grid {
        gap: clamp(2px, .5cqw, 4px);
        margin-bottom: clamp(8px, 2cqw, 16px);
        flex-shrink: 0;
    }
    body.catfight-tablet-layout #content .clans-tab-row {
        gap: clamp(2px, .5cqw, 4px);
        min-width: 0;
    }
    body.catfight-tablet-layout #content .clans-tab-btn {
        min-width: 0;
        gap: clamp(4px, 1cqw, 8px);
        padding: clamp(8px, 2cqw, 16px) clamp(2px, .5cqw, 5px);
    }
    body.catfight-tablet-layout #content .clans-tab-btn i {
        font-size: clamp(18px, 4.5cqw, 34px);
    }
    body.catfight-tablet-layout #content .clans-tab-btn span {
        font-size: clamp(10px, 2.5cqw, 19px);
        text-align: center;
        overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout #content :is(.clan-checkin-tab-badge,.clan-checkin-button-badge) {
        width: clamp(20px, 5cqw, 38px) !important;
        height: clamp(20px, 5cqw, 38px) !important;
    }
    body.catfight-tablet-layout #content .clans-tab-content {
        min-width: 0;
        min-height: 0;
        flex: 1 1 auto;
        padding: clamp(12px, 3cqw, 24px);
        overflow-y: auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Соратники, заявки — таблицы со своими действиями. */
    body.catfight-tablet-layout #content .clans-members-table {
        table-layout: fixed;
    }
    body.catfight-tablet-layout #content .clans-members-table .clans-role-badge {
        font-size: clamp(10px, 2.5cqw, 19px);
        white-space: normal;
        overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout #content .clan-menu-trigger {
        font-size: clamp(13px, 3.25cqw, 25px);
    }
    body.catfight-tablet-layout #content .clans-tab-content .accept-app,
    body.catfight-tablet-layout #content .clans-tab-content .reject-app {
        padding: clamp(5px, 1.25cqw, 10px) clamp(6px, 1.5cqw, 12px) !important;
        margin: clamp(2px, .5cqw, 4px);
    }

    /* Казна: пожертвование, баланс и покупка навыков. */
    body.catfight-tablet-layout #content .clans-treasury-balance {
        font-size: clamp(20px, 5cqw, 38px);
        padding: clamp(12px, 3cqw, 24px);
        border-radius: clamp(12px, 3cqw, 24px);
        margin-bottom: clamp(16px, 4cqw, 30px);
        overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout #content .clans-donate-form {
        gap: clamp(8px, 2cqw, 16px);
        margin-bottom: clamp(16px, 4cqw, 30px);
        min-width: 0;
    }
    body.catfight-tablet-layout #content .clans-donate-form input {
        min-width: 0;
        padding: clamp(10px, 2.5cqw, 20px);
        font-size: clamp(14px, 3.5cqw, 26px);
    }
    body.catfight-tablet-layout #content .clans-donate-form button {
        max-width: 55%;
        padding: clamp(8px, 2cqw, 16px) clamp(8px, 2cqw, 16px);
        font-size: clamp(13px, 3.25cqw, 24px);
        overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout #content .clans-tab-content [style*="font-size:12px"],
    body.catfight-tablet-layout #content .clans-tab-content [style*="font-size:11px"] {
        font-size: clamp(12px, 3cqw, 22px) !important;
        line-height: 1.35;
    }

    /* Таланты: название / уровень / минус-плюс. */
    body.catfight-tablet-layout #content .clans-talents-list {
        gap: clamp(10px, 2.5cqw, 20px);
    }
    body.catfight-tablet-layout #content .clans-talent-row {
        min-width: 0;
        gap: clamp(6px, 1.5cqw, 12px);
        padding: clamp(8px, 2cqw, 16px) clamp(12px, 3cqw, 24px);
        border-radius: clamp(12px, 3cqw, 24px);
    }
    body.catfight-tablet-layout #content .clans-talent-name {
        width: auto;
        flex: 1 1 0;
        min-width: 0;
        overflow-wrap: anywhere;
        font-size: clamp(13px, 3.25cqw, 25px);
    }
    body.catfight-tablet-layout #content .clans-talent-value {
        min-width: clamp(48px, 12cqw, 92px);
        font-size: clamp(16px, 4cqw, 30px);
    }
    body.catfight-tablet-layout #content .clans-talent-controls-group {
        flex-shrink: 0;
        border-radius: clamp(8px, 2cqw, 16px);
    }
    body.catfight-tablet-layout #content .clans-talent-controls-group .talent-btn {
        min-width: clamp(34px, 8.5cqw, 66px);
        font-size: clamp(16px, 4cqw, 30px);
        padding: clamp(6px, 1.5cqw, 12px);
    }
    body.catfight-tablet-layout #content .clans-talent-controls-group .talent-btn i {
        font-size: clamp(14px, 3.5cqw, 27px);
    }

    /* Управление: формы и редактор иконки с палитрой. */
    body.catfight-tablet-layout :is(#content .clans-form-group,#roleModal .clans-form-group) {
        margin-bottom: clamp(16px, 4cqw, 30px);
    }
    body.catfight-tablet-layout :is(#content .clans-form-group,#roleModal .clans-form-group) label {
        margin-bottom: clamp(6px, 1.5cqw, 12px);
        font-size: clamp(14px, 3.5cqw, 26px);
    }
    body.catfight-tablet-layout :is(#content .clans-form-group,#roleModal .clans-form-group) :is(input,select,textarea) {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        padding: clamp(10px, 2.5cqw, 20px);
        font-size: clamp(14px, 3.5cqw, 26px);
        border-radius: clamp(8px, 2cqw, 16px);
    }
    body.catfight-tablet-layout :is(#content .clans-icon-preview,#roleModal .clans-icon-preview) {
        gap: clamp(14px, 3.5cqw, 28px);
        margin-bottom: clamp(16px, 4cqw, 30px);
        min-width: 0;
    }
    body.catfight-tablet-layout :is(#content .clans-icon-preview,#roleModal .clans-icon-preview) > div:last-child {
        min-width: 0;
        flex: 1 1 auto;
    }
    body.catfight-tablet-layout :is(#content .clans-icon-box,#roleModal .clans-icon-box) {
        width: clamp(64px, 16cqw, 122px);
        height: clamp(64px, 16cqw, 122px);
        font-size: clamp(32px, 8cqw, 60px);
        flex-shrink: 0;
    }
    body.catfight-tablet-layout :is(#content .clans-icon-box,#roleModal .clans-icon-box) i {
        font-size: inherit !important;
    }
    body.catfight-tablet-layout :is(#content .clans-color-palette,#roleModal .clans-color-palette) {
        gap: clamp(8px, 2cqw, 16px);
        margin: clamp(8px, 2cqw, 16px) 0;
    }
    body.catfight-tablet-layout :is(#content .clans-color-option,#roleModal .clans-color-option) {
        width: clamp(32px, 8cqw, 60px);
        height: clamp(32px, 8cqw, 60px);
    }
    body.catfight-tablet-layout #roleModal .clans-create-form {
        padding: clamp(14px, 3.5cqw, 28px);
        min-width: 0;
    }
    body.catfight-tablet-layout #roleModal .clans-payment-method {
        gap: clamp(12px, 3cqw, 24px);
        flex-wrap: wrap;
    }
    body.catfight-tablet-layout #roleModal .clans-payment-method label {
        font-size: clamp(13px, 3.25cqw, 24px);
    }
    body.catfight-tablet-layout #roleModal .clans-create-form #confirmCreateClan {
        font-size: clamp(15px, 3.75cqw, 28px);
        padding: clamp(10px, 2.5cqw, 20px);
    }

    /* Окно просмотра чужого клана и заявка. Ширина задаётся modal-tablet.css. */
    body.catfight-tablet-layout #roleModal .clan-details {
        min-width: 0;
        overflow-wrap: anywhere;
        font-size: clamp(13px, 3.25cqw, 24px);
    }
    body.catfight-tablet-layout #roleModal .clan-details-header {
        gap: clamp(12px, 3cqw, 24px) !important;
        margin-bottom: clamp(16px, 4cqw, 30px) !important;
        min-width: 0;
    }
    body.catfight-tablet-layout #roleModal .clan-details-icon {
        width: clamp(64px, 16cqw, 122px) !important;
        height: clamp(64px, 16cqw, 122px) !important;
        flex: 0 0 clamp(64px, 16cqw, 122px);
        border-radius: clamp(12px, 3cqw, 24px) !important;
    }
    body.catfight-tablet-layout #roleModal .clan-details-icon i {
        font-size: clamp(32px, 8cqw, 60px) !important;
    }
    body.catfight-tablet-layout #roleModal .clan-details-info {
        min-width: 0;
    }
    body.catfight-tablet-layout #roleModal .clan-details-info h2 {
        font-size: clamp(20px, 5cqw, 36px) !important;
        overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout #roleModal .clan-details-info > div {
        font-size: clamp(12px, 3cqw, 22px) !important;
    }
    body.catfight-tablet-layout #roleModal .clan-details-actions {
        gap: clamp(10px, 2.5cqw, 20px) !important;
        flex-wrap: wrap;
    }

    /* Чат: рамки аватаров привязаны к размеру, симметрия сообщений сохранена. */
    body.catfight-tablet-layout #content .clans-chat {
        min-width: 0;
        min-height: 0;
        overflow: hidden;
    }
    body.catfight-tablet-layout #content .clans-chat-messages {
        min-height: 0;
        padding: clamp(12px, 3cqw, 24px) clamp(8px, 2cqw, 16px);
        margin-bottom: clamp(8px, 2cqw, 16px);
        border-radius: clamp(8px, 2cqw, 16px);
        overflow-y: auto;
    }
    body.catfight-tablet-layout #content .chat-message {
        min-width: 0;
        gap: clamp(8px, 2cqw, 16px);
        margin-bottom: clamp(12px, 3cqw, 24px);
    }
    body.catfight-tablet-layout #content :is(.chat-message.mine::before,.chat-message.other::after) {
        flex: 0 0 clamp(64px, 16cqw, 122px);
    }
    body.catfight-tablet-layout #content .chat-message .chat-avatar,
    body.catfight-tablet-layout #content .chat-message .avatar-frame-wrapper {
        width: clamp(48px, 12cqw, 92px) !important;
        height: clamp(48px, 12cqw, 92px) !important;
    }
    body.catfight-tablet-layout #content .chat-bubble {
        min-width: 0;
        max-width: calc(100% - clamp(75px, 18.75cqw, 144px));
        padding: clamp(9px, 2.25cqw, 18px) clamp(12px, 3cqw, 24px);
        border-radius: clamp(12px, 3cqw, 24px);
    }
    body.catfight-tablet-layout #content .chat-username,
    body.catfight-tablet-layout #content .chat-text {
        font-size: clamp(14px, 3.5cqw, 26px);
        overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout #content .chat-role,
    body.catfight-tablet-layout #content .chat-time {
        font-size: clamp(11px, 2.75cqw, 20px);
    }
    body.catfight-tablet-layout #content .chat-actions {
        gap: clamp(6px, 1.5cqw, 12px);
    }
    body.catfight-tablet-layout #content .chat-action-btn {
        width: clamp(28px, 7cqw, 54px);
        height: clamp(28px, 7cqw, 54px);
        font-size: clamp(13px, 3.25cqw, 25px);
    }
    body.catfight-tablet-layout #content .clan-system-message {
        font-size: clamp(12px, 3cqw, 22px);
        padding: clamp(4px, 1cqw, 8px) clamp(6px, 1.5cqw, 12px);
        gap: clamp(6px, 1.5cqw, 12px);
    }
    body.catfight-tablet-layout #content .clan-system-message .system-icon {
        font-size: clamp(10px, 2.5cqw, 18px);
    }
    body.catfight-tablet-layout #content .clan-system-message .system-time {
        font-size: clamp(9px, 2.25cqw, 17px);
    }
    body.catfight-tablet-layout #content .chat-date-divider {
        font-size: clamp(11px, 2.75cqw, 20px);
        gap: clamp(10px, 2.5cqw, 20px);
        margin: clamp(14px, 3.5cqw, 28px) clamp(5px, 1.25cqw, 10px);
    }
    body.catfight-tablet-layout #content .clans-chat-input {
        min-width: 0;
        gap: clamp(8px, 2cqw, 16px);
    }
    body.catfight-tablet-layout #content .clans-chat-input input {
        min-width: 0;
        min-height: clamp(44px, 11cqw, 84px);
        padding: clamp(10px, 2.5cqw, 20px) clamp(14px, 3.5cqw, 28px);
        font-size: clamp(14px, 3.5cqw, 26px);
    }
    body.catfight-tablet-layout #content .clans-chat-send-btn {
        min-width: clamp(80px, 20cqw, 152px);
        min-height: clamp(44px, 11cqw, 84px);
        padding: clamp(10px, 2.5cqw, 20px) clamp(10px, 2.5cqw, 20px);
        font-size: clamp(13px, 3.25cqw, 25px);
    }

    /* Выпадающее меню участника находится вне #content. */
    body.catfight-tablet-layout .clan-member-menu {
        min-width: clamp(180px, 36vw, 280px) !important;
        max-width: calc(100vw - 20px);
        box-sizing: border-box;
        overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout .clan-member-menu .menu-item-action {
        font-size: clamp(14px, 2.7vw, 22px) !important;
        padding: clamp(10px, 2vw, 17px) clamp(16px, 3vw, 26px) !important;
    }
}
