/* Cat Fighting — адаптация страниц событий для планшетов и VK Mini App на ПК.
   Каталог, Путь Основателя, Halloween: миссии, магазин, рейтинг.
   Только catfight-tablet-layout; cqw измеряется от центрального #content.
   Не затрагиваем условия участия, лимиты, покупки, награды и обработчики. */
@media (min-width: 601px) and (min-height: 600px) {
    /* Каталог с баннерами: 3.5:1 сохраняет исходные пропорции 350×100. */
    body.catfight-tablet-layout #content.events-catalog-content {
        box-sizing: border-box;
        min-width: 0;
        min-height: 0;
        padding: clamp(8px, 2cqw, 16px);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    body.catfight-tablet-layout #content .events-catalog-page {
        box-sizing: border-box;
        min-width: 0;
        padding: clamp(14px, 3.5cqw, 28px) clamp(10px, 2.5cqw, 20px);
        border-radius: clamp(12px, 3cqw, 24px);
    }
    body.catfight-tablet-layout #content .events-catalog-title {
        min-width: 0;
        gap: clamp(9px, 2.25cqw, 18px);
        margin: clamp(6px, 1.5cqw, 12px) 0 clamp(16px, 4cqw, 32px);
        font-size: clamp(19px, 4.75cqw, 35px);
        line-height: 1.2;
    }
    body.catfight-tablet-layout #content .events-catalog-deco {
        min-width: 0;
        width: clamp(38px, 9.5cqw, 74px);
        height: clamp(2px, .5cqw, 4px);
    }
    body.catfight-tablet-layout #content .events-catalog-list {
        min-width: 0;
        gap: clamp(14px, 3.5cqw, 28px);
    }
    body.catfight-tablet-layout #content .event-banner-button {
        box-sizing: border-box;
        width: clamp(350px, 87.5cqw, 540px);
        height: auto;
        aspect-ratio: 7 / 2;
        max-width: 100%;
        flex-shrink: 0;
        border-radius: clamp(12px, 3cqw, 22px);
    }
    body.catfight-tablet-layout #content .event-banner-button > img {
        width: 100%;
        height: 100%;
        max-width: 100%;
        object-fit: contain;
    }
    body.catfight-tablet-layout #content .event-banner-state {
        font-size: clamp(20px, 5cqw, 35px);
        line-height: 1.2;
    }
    body.catfight-tablet-layout #content .event-banner-countdown {
        font-size: clamp(18px, 4.5cqw, 32px);
    }
    body.catfight-tablet-layout #content :is(.events-catalog-loading, .events-catalog-empty) {
        font-size: clamp(15px, 3.75cqw, 27px);
        padding: clamp(20px, 5cqw, 38px) clamp(10px, 2.5cqw, 20px);
        line-height: 1.35;
    }

    /* Путь Основателя: семь карточек, статусы, награды и получение. */
    body.catfight-tablet-layout #content .events-page {
        box-sizing: border-box;
        min-width: 0;
        min-height: 0;
        padding: clamp(10px, 2.5cqw, 20px);
        border-radius: clamp(12px, 3cqw, 24px);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    body.catfight-tablet-layout #content .events-title-wrapper {
        min-width: 0;
        gap: clamp(8px, 2cqw, 16px);
        padding: clamp(10px, 2.5cqw, 20px) 0 clamp(6px, 1.5cqw, 12px);
    }
    body.catfight-tablet-layout #content .events-title-text {
        font-size: clamp(18px, 4.5cqw, 32px);
        line-height: 1.25;
    }
    body.catfight-tablet-layout #content :is(.events-deco-left, .events-deco-right) {
        min-width: 0;
        height: clamp(2px, .5cqw, 4px);
    }
    body.catfight-tablet-layout #content .events-description {
        font-size: clamp(13px, 3.25cqw, 24px);
        line-height: 1.45;
        padding: clamp(10px, 2.5cqw, 20px) 0;
    }
    body.catfight-tablet-layout #content .events-counter {
        font-size: clamp(16px, 4cqw, 28px);
        padding: clamp(12px, 3cqw, 24px);
        margin: clamp(8px, 2cqw, 16px) 0 clamp(14px, 3.5cqw, 27px);
        border-radius: clamp(9px, 2.25cqw, 17px);
    }
    body.catfight-tablet-layout #content .events-days-list {
        min-width: 0;
        min-height: 0;
        gap: clamp(10px, 2.5cqw, 20px);
        padding: clamp(6px, 1.5cqw, 12px) 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    body.catfight-tablet-layout #content .event-day-card {
        box-sizing: border-box;
        min-width: 0;
        flex-shrink: 0;
        padding: clamp(12px, 3cqw, 24px);
        border-radius: clamp(10px, 2.5cqw, 20px);
    }
    body.catfight-tablet-layout #content .event-day-header {
        min-width: 0;
        flex-wrap: wrap;
        gap: clamp(6px, 1.5cqw, 12px);
        font-size: clamp(12px, 3cqw, 22px);
        margin-bottom: clamp(6px, 1.5cqw, 12px);
    }
    body.catfight-tablet-layout #content .event-day-content {
        min-width: 0;
        gap: clamp(10px, 2.5cqw, 20px);
    }
    body.catfight-tablet-layout #content .event-day-content .day-icon {
        flex: 0 0 clamp(42px, 10.5cqw, 78px);
        font-size: clamp(28px, 7cqw, 52px);
    }
    body.catfight-tablet-layout #content .event-day-content .day-icon > i {
        font-size: inherit !important;
    }
    body.catfight-tablet-layout #content .event-day-content .day-info {
        flex: 1 1 0;
        min-width: 0;
    }
    body.catfight-tablet-layout #content .event-day-content .day-title {
        font-size: clamp(15px, 3.75cqw, 28px);
        line-height: 1.3;
        overflow-wrap: break-word;
    }
    body.catfight-tablet-layout #content .event-day-content :is(.day-desc, .day-reward) {
        font-size: clamp(12px, 3cqw, 22px);
        line-height: 1.4;
        overflow-wrap: break-word;
    }
    body.catfight-tablet-layout #content .event-day-content .day-action {
        flex: 0 0 auto;
        min-width: 0;
    }
    body.catfight-tablet-layout #content .event-day-content .day-action .btn-fancy {
        box-sizing: border-box;
        min-width: clamp(88px, 22cqw, 152px);
        max-width: 100%;
        padding: clamp(8px, 2cqw, 16px) clamp(8px, 2cqw, 16px);
        font-size: clamp(13px, 3.25cqw, 23px);
        white-space: normal;
    }
    body.catfight-tablet-layout #content .event-day-card :is(.claimed-label, .pending-label, .locked-label) {
        font-size: clamp(12px, 3cqw, 22px);
        line-height: 1.3;
        overflow-wrap: break-word;
    }

    /* Halloween: шапка, возвращение к списку и основные вкладки. */
    body.catfight-tablet-layout #content .seasonal-event-page.halloween-event-page {
        box-sizing: border-box;
        min-width: 0;
        padding: clamp(10px, 2.5cqw, 20px);
        border-radius: clamp(12px, 3cqw, 24px);
        overflow: hidden;
    }
    body.catfight-tablet-layout #content .seasonal-event-header {
        min-width: 0;
        gap: clamp(8px, 2cqw, 16px);
        margin-bottom: clamp(12px, 3cqw, 24px);
    }
    body.catfight-tablet-layout #content .seasonal-event-header .events-catalog-title {
        min-width: 0;
        flex: 1 1 auto;
        font-size: clamp(17px, 4.25cqw, 32px);
        margin: 0;
        gap: clamp(6px, 1.5cqw, 12px);
        white-space: nowrap;
    }
    body.catfight-tablet-layout #content .seasonal-event-back {
        box-sizing: border-box;
        width: clamp(40px, 10cqw, 68px);
        height: clamp(40px, 10cqw, 68px);
        font-size: clamp(20px, 5cqw, 35px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-tabs {
        box-sizing: border-box;
        min-width: 0;
        gap: 0;
        margin-bottom: clamp(14px, 3.5cqw, 27px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-tab {
        box-sizing: border-box;
        min-width: 0;
        padding: clamp(10px, 2.5cqw, 20px) clamp(5px, 1.25cqw, 10px);
        font-size: clamp(13px, 3.25cqw, 24px);
        line-height: 1.25;
        white-space: nowrap;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-tab-content {
        min-width: 0;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Миссии: 7 дней в строке, без переноса номеров или букв. */
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-day-tabs {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: clamp(3px, .75cqw, 7px);
        margin-bottom: clamp(12px, 3cqw, 24px);
        min-width: 0;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-day-tab {
        box-sizing: border-box;
        min-width: 0;
        min-height: clamp(58px, 14.5cqw, 102px);
        gap: clamp(3px, .75cqw, 6px);
        padding: clamp(5px, 1.25cqw, 10px) 1px;
        border-radius: clamp(9px, 2.25cqw, 16px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-day-number {
        font-size: clamp(20px, 5cqw, 36px);
        white-space: nowrap;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-day-label {
        font-size: clamp(10px, 2.4cqw, 17px);
        white-space: nowrap;
        word-break: normal;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-missions-scroll {
        min-height: 0;
        height: min(50dvh, 530px);
        max-height: 65dvh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-missions-list {
        gap: clamp(10px, 2.5cqw, 20px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-task {
        box-sizing: border-box;
        min-width: 0;
        padding: clamp(10px, 2.5cqw, 20px);
        border-radius: clamp(10px, 2.5cqw, 20px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-task .task-content {
        min-width: 0;
        gap: clamp(10px, 2.5cqw, 20px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-task .task-info {
        flex: 1 1 0;
        min-width: 0;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-task .task-title {
        font-size: clamp(15px, 3.75cqw, 27px);
        line-height: 1.25;
        overflow-wrap: break-word;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-task .task-desc {
        font-size: clamp(12px, 3cqw, 21px);
        line-height: 1.35;
        overflow-wrap: break-word;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-task .task-progress {
        gap: clamp(7px, 1.75cqw, 13px);
        margin-top: clamp(6px, 1.5cqw, 12px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-task .task-progress-bar {
        min-width: 0;
        height: clamp(6px, 1.5cqw, 11px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-task .task-progress-text {
        font-size: clamp(11px, 2.75cqw, 19px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-task .task-reward {
        box-sizing: border-box;
        flex: 0 0 clamp(55px, 13.75cqw, 105px);
        min-width: 0;
        gap: clamp(4px, 1cqw, 8px);
        font-size: clamp(13px, 3.25cqw, 23px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-task .task-reward img {
        width: clamp(24px, 6cqw, 44px) !important;
        height: clamp(24px, 6cqw, 44px) !important;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-task .task-action {
        flex: 0 0 auto;
        min-width: 0;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-task .task-claim-btn {
        box-sizing: border-box;
        min-width: clamp(40px, 10cqw, 76px);
        min-height: clamp(40px, 10cqw, 76px);
        padding: clamp(7px, 1.75cqw, 13px) !important;
        font-size: clamp(17px, 4.25cqw, 29px);
    }

    /* Halloween shop: иллюстрация и описание в первой строке, действия во второй.
       Действия не могут вылезти за края карточки при ширине VK iframe 630px. */
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop {
        min-width: 0;
        width: 100%;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-balance {
        gap: clamp(8px, 2cqw, 16px);
        margin: clamp(6px, 1.5cqw, 12px) 0 clamp(14px, 3.5cqw, 28px);
        font-size: clamp(16px, 4cqw, 28px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-balance img {
        width: clamp(28px, 7cqw, 52px);
        height: clamp(28px, 7cqw, 52px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-list {
        gap: clamp(10px, 2.5cqw, 20px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-row {
        box-sizing: border-box;
        display: grid;
        grid-template-columns: clamp(58px, 14.5cqw, 104px) minmax(0, 1fr);
        gap: clamp(8px, 2cqw, 16px);
        padding: clamp(10px, 2.5cqw, 20px);
        border-radius: clamp(11px, 2.75cqw, 20px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-visual {
        width: clamp(58px, 14.5cqw, 104px);
        height: clamp(58px, 14.5cqw, 104px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-item-image {
        width: clamp(50px, 12.5cqw, 90px);
        height: clamp(50px, 12.5cqw, 90px);
        max-width: 100%;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-info {
        min-width: 0;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-name {
        font-size: clamp(15px, 3.75cqw, 26px);
        line-height: 1.3;
        word-break: normal;
        overflow-wrap: break-word;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-meta {
        font-size: clamp(12px, 3cqw, 21px);
        line-height: 1.3;
        margin-top: clamp(4px, 1cqw, 8px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-price {
        font-size: clamp(13px, 3.25cqw, 22px);
        gap: clamp(5px, 1.25cqw, 10px);
        margin-top: clamp(6px, 1.5cqw, 12px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-price img {
        width: clamp(20px, 5cqw, 36px);
        height: clamp(20px, 5cqw, 36px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-actions {
        grid-column: 2;
        min-width: 0;
        justify-content: flex-end;
        gap: clamp(5px, 1.25cqw, 9px);
        flex-wrap: wrap;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-preview {
        width: clamp(36px, 9cqw, 60px);
        height: clamp(36px, 9cqw, 60px);
        flex-shrink: 0;
        font-size: clamp(15px, 3.75cqw, 24px);
        border-radius: clamp(8px, 2cqw, 14px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-quantity {
        gap: clamp(5px, 1.25cqw, 9px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-qty {
        width: clamp(34px, 8.5cqw, 57px);
        height: clamp(36px, 9cqw, 60px);
        font-size: clamp(18px, 4.5cqw, 29px);
        border-radius: clamp(8px, 2cqw, 14px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-qty-value {
        min-width: clamp(22px, 5.5cqw, 38px);
        font-size: clamp(13px, 3.25cqw, 22px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-shop-buy {
        box-sizing: border-box;
        min-width: clamp(80px, 20cqw, 135px);
        height: clamp(36px, 9cqw, 60px);
        padding: 0 clamp(8px, 2cqw, 15px);
        border-radius: clamp(8px, 2cqw, 14px);
        font-size: clamp(13px, 3.25cqw, 23px);
        white-space: nowrap;
    }

    /* Рейтинг события: три колонки, как в исправленном общем рейтинге. */
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-rating {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        overflow-x: auto;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-rating .stats-table {
        width: 100%;
        table-layout: fixed;
        font-size: clamp(12px, 3cqw, 21px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-rating .stats-table :is(th, td) {
        box-sizing: border-box;
        padding: clamp(9px, 2.25cqw, 16px) clamp(4px, 1cqw, 8px);
        height: auto;
        vertical-align: middle;
        word-break: normal;
        overflow-wrap: normal;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-rating .stats-table :is(th, td):first-child {
        width: 19%;
        text-align: center;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-rating .stats-table :is(th, td):nth-child(2) {
        width: 53%;
        padding-left: clamp(8px, 2cqw, 16px);
        text-align: left;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-rating .stats-table :is(th, td):nth-child(3) {
        width: 28%;
        text-align: center;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-rating .stats-table thead th {
        font-size: clamp(12px, 2.75cqw, 18px);
        white-space: nowrap;
        letter-spacing: 0;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-rating .stats-table td:nth-child(2) {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-rating .stats-table td:nth-child(3) {
        white-space: nowrap;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-rating-sweet {
        width: clamp(18px, 4.5cqw, 31px) !important;
        height: clamp(18px, 4.5cqw, 31px) !important;
        max-width: 100%;
        vertical-align: middle;
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-rating-pagination {
        gap: clamp(8px, 2cqw, 15px);
        margin-top: clamp(14px, 3.5cqw, 26px);
        font-size: clamp(13px, 3.25cqw, 22px);
    }
    body.catfight-tablet-layout #content .halloween-event-page .seasonal-event-rating-pagination .btn-glass {
        box-sizing: border-box;
        width: clamp(40px, 10cqw, 68px);
        min-width: clamp(40px, 10cqw, 68px);
        height: clamp(40px, 10cqw, 68px);
        padding: 0;
        font-size: clamp(16px, 4cqw, 28px);
    }

    /* Текст особых окон «Пути Основателя» (общая ширина — modal-tablet.css). */
    body.catfight-tablet-layout #roleModal:has(#welcomeStartBtn) #modalBody {
        font-size: clamp(14px, 2.5vw, 21px);
        line-height: 1.45;
        overflow-x: hidden;
    }
    body.catfight-tablet-layout #roleModal:has(#welcomeStartBtn) #modalBody img[src*="banner_event"] {
        max-width: min(100%, 440px) !important;
        height: auto;
    }
    body.catfight-tablet-layout #roleModal:has(#welcomeStartBtn) #welcomeStartBtn {
        font-size: clamp(15px, 2.7vw, 22px);
        padding: clamp(10px, 1.8vw, 18px);
    }
}
