/* Cat Fighting — Почта на планшетах и в VK Mini App на компьютере.
   Размеры cqw относительно центрального #content.
   Только стили: получение, прочтение, удаление и награды не изменяем. */
@media (min-width: 601px) and (min-height: 600px) {
    /* Входящие: заголовок, меню массовых действий и прокрутка писем. */
    body.catfight-tablet-layout #content .messages-container {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        min-height: 0;
        padding: clamp(5px, 1.25cqw, 10px);
        border-radius: clamp(12px, 3cqw, 24px);
    }
    body.catfight-tablet-layout #content .messages-container .messages-header-top {
        box-sizing: border-box;
        min-width: 0;
        gap: clamp(8px, 2cqw, 16px);
        padding: clamp(12px, 3cqw, 23px) clamp(10px, 2.5cqw, 19px);
        flex-shrink: 0;
        flex-wrap: wrap;
    }
    body.catfight-tablet-layout #content .messages-container .header-title {
        min-width: 0;
        flex: 1 1 auto;
        font-size: clamp(18px, 4.5cqw, 32px);
        line-height: 1.2;
        white-space: nowrap;
    }
    body.catfight-tablet-layout #content .messages-container .header-title i {
        margin-right: clamp(6px, 1.5cqw, 12px);
    }
    body.catfight-tablet-layout #content .messages-container .header-counter {
        flex: 0 0 auto;
        min-width: 0;
        gap: clamp(8px, 2cqw, 15px) !important;
        font-size: clamp(12px, 3cqw, 20px);
        white-space: nowrap;
        line-height: 1.2;
    }
    body.catfight-tablet-layout #content .messages-container #messagesMenuBtn {
        box-sizing: border-box;
        flex: 0 0 clamp(40px, 10cqw, 68px);
        width: clamp(40px, 10cqw, 68px) !important;
        height: clamp(40px, 10cqw, 68px) !important;
        font-size: clamp(14px, 3.5cqw, 24px);
        padding: 0 !important;
    }
    body.catfight-tablet-layout #content .messages-container #messagesMenu {
        box-sizing: border-box;
        min-width: clamp(188px, 47cqw, 305px) !important;
        width: max-content;
        max-width: calc(100vw - 40px);
        padding: clamp(4px, 1cqw, 8px) 0 !important;
        border-radius: clamp(9px, 2.25cqw, 16px) !important;
        overflow-x: hidden;
        /* display управляется JS: не переопределять. */
    }
    body.catfight-tablet-layout #content .messages-container .messages-menu-item {
        box-sizing: border-box;
        min-width: 0;
        gap: clamp(10px, 2.5cqw, 19px) !important;
        padding: clamp(11px, 2.75cqw, 20px) clamp(12px, 3cqw, 23px) !important;
        font-size: clamp(13px, 3.25cqw, 22px);
        line-height: 1.25;
        white-space: nowrap;
    }
    body.catfight-tablet-layout #content .messages-container .messages-menu-item i {
        flex: 0 0 clamp(22px, 5.5cqw, 38px);
        width: clamp(22px, 5.5cqw, 38px) !important;
        text-align: center;
        font-size: clamp(15px, 3.75cqw, 25px);
    }
    body.catfight-tablet-layout #content .messages-container .messages-list {
        box-sizing: border-box;
        flex: 1 1 auto;
        min-width: 0;
        min-height: 0;
        padding: clamp(8px, 2cqw, 15px);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Карточка входящего письма: значок, текст, справа дата и статус. */
    body.catfight-tablet-layout #content .messages-container .message-row {
        box-sizing: border-box;
        min-width: 0;
        gap: clamp(9px, 2.25cqw, 17px);
        padding: clamp(11px, 2.75cqw, 21px) clamp(10px, 2.5cqw, 19px);
        margin-bottom: clamp(8px, 2cqw, 15px);
        border-radius: clamp(9px, 2.25cqw, 16px);
    }
    body.catfight-tablet-layout #content .messages-container .message-icon-wrapper {
        box-sizing: border-box;
        width: clamp(56px, 14cqw, 98px);
        height: clamp(56px, 14cqw, 98px);
        flex: 0 0 clamp(56px, 14cqw, 98px);
    }
    body.catfight-tablet-layout #content .messages-container .msg-list-icon {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    body.catfight-tablet-layout #content .messages-container .message-info {
        flex: 1 1 0;
        min-width: 0;
        gap: clamp(4px, 1cqw, 8px);
    }
    body.catfight-tablet-layout #content .messages-container .message-sender {
        min-width: 0;
        font-size: clamp(12px, 3cqw, 21px);
        line-height: 1.25;
        overflow-wrap: break-word;
    }
    body.catfight-tablet-layout #content .messages-container .message-subject {
        min-width: 0;
        font-size: clamp(15px, 3.75cqw, 26px);
        line-height: 1.3;
        overflow-wrap: break-word;
        word-break: normal;
    }
    body.catfight-tablet-layout #content .messages-container .reward-preview {
        min-width: 0;
        font-size: clamp(12px, 3cqw, 21px);
        line-height: 1.35;
        overflow-wrap: break-word;
    }
    body.catfight-tablet-layout #content .messages-container .reward-preview img {
        width: clamp(20px, 5cqw, 34px) !important;
        height: clamp(20px, 5cqw, 34px) !important;
        object-fit: contain;
    }
    body.catfight-tablet-layout #content .messages-container .reward-preview > span[style*="font-size:24px"] {
        min-width: 0 !important;
        max-width: 100%;
        gap: clamp(4px, 1cqw, 8px) !important;
        font-size: clamp(14px, 3.5cqw, 23px) !important;
    }
    body.catfight-tablet-layout #content .messages-container .message-meta {
        flex: 0 0 clamp(75px, 18.75cqw, 130px);
        min-width: 0;
        gap: clamp(9px, 2.25cqw, 17px);
    }
    body.catfight-tablet-layout #content .messages-container .message-time {
        font-size: clamp(11px, 2.75cqw, 19px);
        line-height: 1.3;
        text-align: right;
        white-space: normal;
        word-break: normal;
    }
    body.catfight-tablet-layout #content .messages-container .paw-icon {
        font-size: clamp(20px, 5cqw, 35px);
    }

    /* Пагинация списка: доступна и на компактном планшете. */
    body.catfight-tablet-layout #content .messages-container .rating-pagination {
        box-sizing: border-box;
        min-width: 0;
        flex-shrink: 0;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: clamp(5px, 1.25cqw, 10px);
        padding: clamp(10px, 2.5cqw, 19px) clamp(5px, 1.25cqw, 10px);
        margin: 0;
    }
    body.catfight-tablet-layout #content .messages-container .rating-pagination .pagination-btn {
        box-sizing: border-box;
        min-width: clamp(30px, 7.5cqw, 54px);
        min-height: clamp(36px, 9cqw, 62px);
        padding: clamp(6px, 1.5cqw, 11px);
        font-size: clamp(14px, 3.5cqw, 24px);
    }

    /* Открытое письмо: системная шапка, текст, награды и действия. */
    body.catfight-tablet-layout #content .message-detail-fantasy {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        min-height: 0;
        flex: 1 1 auto;
        padding: clamp(14px, 3.5cqw, 26px);
        border-radius: clamp(12px, 3cqw, 24px);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .fantasy-top-bar {
        min-width: 0;
        flex-shrink: 0;
        gap: clamp(10px, 2.5cqw, 19px);
        margin-bottom: clamp(20px, 5cqw, 37px);
    }
    body.catfight-tablet-layout #content .message-detail-fantasy :is(.minimal-back-btn, .minimal-delete-btn) {
        box-sizing: border-box;
        min-width: 0;
        min-height: clamp(42px, 10.5cqw, 75px);
        gap: clamp(7px, 1.75cqw, 13px);
        padding: clamp(8px, 2cqw, 15px) clamp(12px, 3cqw, 22px);
        border-radius: clamp(8px, 2cqw, 15px);
        font-size: clamp(14px, 3.5cqw, 25px);
        line-height: 1.3;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .minimal-back-btn {
        flex: 0 1 auto;
        white-space: normal;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .minimal-delete-btn {
        flex: 0 0 clamp(42px, 10.5cqw, 75px);
        width: clamp(42px, 10.5cqw, 75px);
        padding: 0;
        justify-content: center;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .fantasy-system-header {
        box-sizing: border-box;
        min-width: 0;
        gap: clamp(10px, 2.5cqw, 19px);
        padding-bottom: clamp(16px, 4cqw, 30px);
        margin-bottom: clamp(20px, 5cqw, 37px);
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .system-title-box {
        flex: 1 1 0;
        min-width: 0;
        gap: clamp(12px, 3cqw, 22px);
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .system-title-box > div {
        flex: 1 1 0;
        min-width: 0;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .big-msg-icon {
        flex: 0 0 clamp(64px, 16cqw, 115px);
        width: clamp(64px, 16cqw, 115px);
        height: clamp(64px, 16cqw, 115px);
        object-fit: contain;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .system-sender {
        font-size: clamp(13px, 3.25cqw, 23px);
        margin-bottom: clamp(4px, 1cqw, 8px);
        line-height: 1.3;
        overflow-wrap: break-word;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .system-subject {
        font-size: clamp(16px, 4cqw, 27px);
        line-height: 1.3;
        overflow-wrap: break-word;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .system-date-box {
        flex: 0 0 clamp(92px, 23cqw, 160px);
        min-width: 0;
        font-size: clamp(11px, 2.75cqw, 19px);
        line-height: 1.4;
        word-break: normal;
    }

    body.catfight-tablet-layout #content .message-detail-fantasy .fantasy-content-body {
        box-sizing: border-box;
        flex: 1 0 auto;
        min-width: 0;
        padding: clamp(10px, 2.5cqw, 19px) 0 clamp(12px, 3cqw, 23px);
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .big-achievement-icon {
        margin-bottom: clamp(16px, 4cqw, 30px);
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .big-achievement-icon img {
        width: clamp(105px, 26.25cqw, 185px) !important;
        height: clamp(105px, 26.25cqw, 185px) !important;
        max-width: 100%;
        object-fit: contain;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .big-achievement-icon i {
        font-size: clamp(105px, 26.25cqw, 185px) !important;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .fantasy-title {
        max-width: 100%;
        font-size: clamp(24px, 6cqw, 42px);
        line-height: 1.25;
        overflow-wrap: break-word;
        word-break: normal;
        text-align: center;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .fantasy-description {
        box-sizing: border-box;
        max-width: 100%;
        font-size: clamp(15px, 3.75cqw, 26px);
        line-height: 1.5;
        white-space: pre-line;
        overflow-wrap: break-word;
        word-break: normal;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .fancy-divider-small {
        width: clamp(60px, 15cqw, 105px);
        margin: clamp(16px, 4cqw, 30px) auto;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .fancy-reward-block {
        box-sizing: border-box;
        max-width: 100%;
        min-width: 0;
        margin-top: clamp(20px, 5cqw, 37px);
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .fancy-divider {
        box-sizing: border-box;
        max-width: 100%;
        gap: clamp(9px, 2.25cqw, 17px);
        margin-bottom: clamp(16px, 4cqw, 30px);
        font-size: clamp(16px, 4cqw, 29px);
        line-height: 1.3;
        flex-wrap: wrap;
        text-align: center;
        overflow-wrap: break-word;
        word-break: normal;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .fancy-divider::before,
    body.catfight-tablet-layout #content .message-detail-fantasy .fancy-divider::after {
        flex: 1 1 0;
        width: auto;
        min-width: 12px;
        max-width: clamp(55px, 13.75cqw, 95px);
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .reward-value {
        box-sizing: border-box;
        min-width: 0;
        max-width: 100%;
        gap: clamp(10px, 2.5cqw, 19px);
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .reward-value > div {
        min-width: 0;
        max-width: 100%;
        font-size: clamp(18px, 4.5cqw, 30px) !important;
        line-height: 1.35;
        overflow-wrap: break-word;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .reward-value img {
        width: clamp(24px, 6cqw, 42px) !important;
        height: clamp(24px, 6cqw, 42px) !important;
        object-fit: contain;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .reward-value span {
        font-size: inherit;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .fantasy-actions {
        box-sizing: border-box;
        max-width: 100%;
        min-width: 0;
        gap: clamp(12px, 3cqw, 23px);
        flex-wrap: wrap;
        margin-top: clamp(24px, 6cqw, 44px);
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .fancy-btn-wrapper {
        box-sizing: border-box;
        max-width: 100%;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .fancy-claim-btn {
        box-sizing: border-box;
        display: inline-block;
        width: auto;
        max-width: 100%;
        min-width: clamp(155px, 38.75cqw, 270px);
        padding: clamp(12px, 3cqw, 22px) clamp(18px, 4.5cqw, 32px);
        border-radius: clamp(9px, 2.25cqw, 16px);
        font-size: clamp(16px, 4cqw, 27px);
        line-height: 1.3;
        white-space: normal;
        word-break: normal;
        overflow-wrap: break-word;
        text-align: center;
    }
    body.catfight-tablet-layout #content .message-detail-fantasy .fantasy-actions > span {
        font-size: clamp(15px, 3.75cqw, 26px);
        line-height: 1.35;
        overflow-wrap: break-word;
    }
}
