/* Cat Fighting — адаптация маркета для планшетов и VK Mini App на ПК.
   Только стили страницы и её окон; логика маркета не меняется. */
@media (min-width: 601px) and (min-height: 600px) {
    body.catfight-tablet-layout #content .market-page {
        box-sizing: border-box; width: 100%; min-width: 0; min-height: 0;
        padding: clamp(6px, 1.5cqw, 12px); border-radius: clamp(12px, 3cqw, 24px);
    }
    body.catfight-tablet-layout #content .market-main-title {
        gap: clamp(8px, 2cqw, 16px); padding: clamp(8px, 2cqw, 16px) 0 clamp(4px, 1cqw, 8px);
        font-size: clamp(18px, 4.5cqw, 30px); line-height: 1.2; flex-shrink: 0;
    }
    body.catfight-tablet-layout #content .market-tabs {
        min-width: 0; gap: clamp(6px, 1.5cqw, 12px) !important;
        margin: 0 0 clamp(8px, 2cqw, 16px) !important; flex-shrink: 0;
    }
    body.catfight-tablet-layout #content .market-tabs .market-tab-btn {
        box-sizing: border-box; min-width: 0; padding: clamp(9px, 2.25cqw, 17px) clamp(8px, 2cqw, 16px);
        font-size: clamp(14px, 3.5cqw, 23px); line-height: 1.2; white-space: normal;
    }
    body.catfight-tablet-layout #content .market-filters-panel {
        box-sizing: border-box; min-width: 0; padding: clamp(6px, 1.5cqw, 12px) 0; flex-shrink: 0;
    }
    body.catfight-tablet-layout #content .market-page .filters-row {
        min-width: 0; gap: clamp(6px, 1.5cqw, 12px); margin: 0;
    }
    body.catfight-tablet-layout #content .market-page .filter-group { flex: 1 1 0; min-width: 0; position: static; }
    body.catfight-tablet-layout #content .market-page .filter-button {
        box-sizing: border-box; min-width: 0; min-height: clamp(40px, 10cqw, 68px);
        padding: clamp(7px, 1.75cqw, 13px); gap: clamp(4px, 1cqw, 8px);
        border-radius: clamp(9px, 2.25cqw, 16px); font-size: clamp(12px, 3cqw, 20px); line-height: 1.2;
    }
    body.catfight-tablet-layout #content .market-page .filter-button span {
        flex: 1 1 auto; min-width: 0; text-align: left; overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout #content .market-page .filter-button i { flex: 0 0 auto; font-size: clamp(11px, 2.75cqw, 18px); }
    /* Выпадающие списки поверх страницы, но в границах игрового окна. */
    body.catfight-tablet-layout .market-page .filter-panel {
        box-sizing: border-box; left: calc(50% - 49cqw); right: calc(50% - 49cqw); width: auto;
        max-width: none; max-height: min(48dvh, 440px); padding: clamp(3px, .75cqw, 6px);
        border-radius: clamp(10px, 2.5cqw, 18px); z-index: 1100; -webkit-overflow-scrolling: touch;
    }
    body.catfight-tablet-layout .market-page .filter-option {
        box-sizing: border-box; min-width: 0; padding: clamp(9px, 2.25cqw, 16px) clamp(10px, 2.5cqw, 18px);
        gap: clamp(7px, 1.75cqw, 13px); font-size: clamp(13px, 3.25cqw, 21px);
        line-height: 1.3; white-space: normal; overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout .market-page .market-filter-option-with-icon { display: flex; align-items: center; }
    body.catfight-tablet-layout .market-page .market-filter-option-with-icon img {
        width: clamp(22px, 5.5cqw, 38px); height: clamp(22px, 5.5cqw, 38px);
        flex: 0 0 clamp(22px, 5.5cqw, 38px); object-fit: contain;
    }
    body.catfight-tablet-layout .market-page .market-filter-option-with-icon i {
        width: clamp(22px, 5.5cqw, 38px); flex: 0 0 clamp(22px, 5.5cqw, 38px);
        font-size: clamp(18px, 4.5cqw, 30px); text-align: center;
    }

    /* История и кнопки управления фильтрами. */
    body.catfight-tablet-layout #content .market-page .apply-button-container {
        box-sizing: border-box; width: calc(100% - clamp(12px, 3cqw, 24px));
        margin: clamp(4px, 1cqw, 8px) auto clamp(6px, 1.5cqw, 12px);
        gap: clamp(6px, 1.5cqw, 12px); flex-shrink: 0;
    }
    body.catfight-tablet-layout #content .market-page .apply-button-container .history-btn,
    body.catfight-tablet-layout #content .market-page .apply-button-container .reset-filters-btn,
    body.catfight-tablet-layout #content .market-page .apply-button-container .apply-filters-btn {
        box-sizing: border-box; min-width: 0; height: clamp(42px, 10.5cqw, 70px);
        padding: clamp(7px, 1.75cqw, 13px) clamp(5px, 1.25cqw, 10px);
        border-radius: clamp(8px, 2cqw, 14px); font-size: clamp(13px, 3.25cqw, 21px);
        line-height: 1.2; white-space: normal;
    }
    body.catfight-tablet-layout #content .market-page .apply-button-container .history-btn {
        flex: 0 0 clamp(48px, 12cqw, 78px); font-size: clamp(17px, 4.25cqw, 28px);
    }
    body.catfight-tablet-layout #content .market-page .apply-button-container .reset-filters-btn,
    body.catfight-tablet-layout #content .market-page .apply-button-container .apply-filters-btn { flex: 1 1 0; }

    /* Список предложений: прокрутка внутри страницы. */
    body.catfight-tablet-layout #content .market-items-header {
        min-width: 0; gap: clamp(8px, 2cqw, 16px); padding: clamp(7px, 1.75cqw, 14px) 0;
        font-size: clamp(15px, 3.75cqw, 25px); line-height: 1.2; flex-shrink: 0;
    }
    body.catfight-tablet-layout #content .market-items-container {
        box-sizing: border-box; min-width: 0; min-height: 0; flex: 1 1 auto;
        overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    }
    body.catfight-tablet-layout #content .market-items-list { box-sizing: border-box; min-width: 0; width: 100%; }
    body.catfight-tablet-layout #content .market-item-row {
        box-sizing: border-box; min-width: 0; min-height: clamp(76px, 19cqw, 136px);
        gap: clamp(8px, 2cqw, 16px); padding: clamp(8px, 2cqw, 16px);
    }
    body.catfight-tablet-layout #content .market-item-icon {
        box-sizing: border-box; width: clamp(56px, 14cqw, 100px); height: clamp(56px, 14cqw, 100px);
        flex: 0 0 clamp(56px, 14cqw, 100px); border-radius: clamp(8px, 2cqw, 15px);
    }
    body.catfight-tablet-layout #content .market-item-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
    body.catfight-tablet-layout #content .market-item-info { flex: 1 1 auto; min-width: 0; }
    body.catfight-tablet-layout #content .market-item-name {
        margin-bottom: clamp(2px, .5cqw, 4px); font-size: clamp(14px, 3.5cqw, 23px);
        line-height: 1.25; overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout #content .market-item-name .item-class,
    body.catfight-tablet-layout #content .market-item-stats {
        font-size: clamp(11px, 2.75cqw, 18px); line-height: 1.35;
    }
    body.catfight-tablet-layout #content .market-item-stats { overflow-wrap: anywhere; }
    body.catfight-tablet-layout #content .market-item-price {
        flex: 0 0 auto; margin: 0; font-size: clamp(13px, 3.25cqw, 21px); white-space: nowrap;
    }
    body.catfight-tablet-layout #content .market-item-price i { margin-left: clamp(2px, .5cqw, 4px); }
    body.catfight-tablet-layout #content .market-item-actions { flex: 0 0 auto; gap: clamp(5px, 1.25cqw, 10px); }
    body.catfight-tablet-layout #content .market-action-btn {
        box-sizing: border-box; width: clamp(40px, 10cqw, 70px); height: clamp(40px, 10cqw, 70px);
        border-width: 1px; border-radius: clamp(7px, 1.75cqw, 12px); font-size: clamp(15px, 3.75cqw, 25px);
    }
    body.catfight-tablet-layout #content .market-action-btn.view-btn { width: clamp(64px, 16cqw, 108px); }

    /* Пустые списки и уведомления. */
    body.catfight-tablet-layout #content #marketItemsList > p,
    body.catfight-tablet-layout #content #marketItemsList > div:not(.market-item-row) {
        font-size: clamp(13px, 3.25cqw, 21px) !important; line-height: 1.4;
        padding: clamp(14px, 3.5cqw, 26px) !important;
    }
    body.catfight-tablet-layout .market-toast {
        box-sizing: border-box; left: calc(50% - 48cqw); right: calc(50% - 48cqw);
        top: clamp(60px, 15cqw, 110px); padding: clamp(10px, 2.5cqw, 18px);
        border-radius: clamp(9px, 2.25cqw, 16px); font-size: clamp(13px, 3.25cqw, 21px);
    }

    /* Просмотр предмета, изменение цены и история. */
    body.catfight-tablet-layout #roleModal .item-modal-content {
        box-sizing: border-box; min-width: 0; padding: clamp(4px, 1vw, 8px);
    }
    body.catfight-tablet-layout #roleModal .item-modal-icon {
        width: clamp(84px, 13vw, 116px); height: clamp(84px, 13vw, 116px);
        border-radius: clamp(12px, 2vw, 18px);
    }
    body.catfight-tablet-layout #roleModal .item-modal-icon .item-slot-lg {
        width: clamp(72px, 11vw, 98px); height: clamp(72px, 11vw, 98px);
    }
    body.catfight-tablet-layout #roleModal .item-modal-name {
        font-size: clamp(20px, 3.2vw, 28px); line-height: 1.25; overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout #roleModal .item-modal-class,
    body.catfight-tablet-layout #roleModal .item-modal-stats {
        font-size: clamp(14px, 2.3vw, 20px); line-height: 1.4;
    }
    body.catfight-tablet-layout #roleModal .item-modal-price { font-size: clamp(20px, 3.2vw, 28px); }
    body.catfight-tablet-layout #roleModal .item-modal-buttons,
    body.catfight-tablet-layout #roleModal .edit-price-modal .modal-buttons {
        flex-wrap: wrap; gap: clamp(8px, 1.5vw, 14px) !important;
    }
    body.catfight-tablet-layout #roleModal .item-modal-buttons .btn-glass,
    body.catfight-tablet-layout #roleModal .edit-price-modal .btn-glass {
        min-width: 0; flex: 1 1 40%; white-space: normal; overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout #roleModal .edit-price-modal .item-name {
        font-size: clamp(19px, 3vw, 26px); line-height: 1.3; overflow-wrap: anywhere;
    }
    body.catfight-tablet-layout #roleModal .edit-price-modal .current-price { font-size: clamp(14px, 2.3vw, 20px); }
    body.catfight-tablet-layout #roleModal .price-input {
        box-sizing: border-box; max-width: 100%; min-height: clamp(44px, 7vw, 58px);
        font-size: clamp(17px, 2.7vw, 23px);
    }
    body.catfight-tablet-layout #roleModal #modalBody table.stats-table {
        width: 100%; table-layout: auto; font-size: clamp(12px, 2vw, 17px) !important;
    }
    body.catfight-tablet-layout #roleModal #modalBody table.stats-table th,
    body.catfight-tablet-layout #roleModal #modalBody table.stats-table td {
        padding: clamp(6px, 1vw, 10px) clamp(4px, .8vw, 8px); vertical-align: middle;
    }
    body.catfight-tablet-layout #roleModal #modalBody table.stats-table td:nth-child(2),
    body.catfight-tablet-layout #roleModal #modalBody table.stats-table td:nth-child(3),
    body.catfight-tablet-layout #roleModal #modalBody table.stats-table td:nth-child(4) { white-space: nowrap; }
}