/* Этап 2: мобильная адаптация страниц участников (без пересборки Vite) */

@media (max-width: 767px) {
    /* --- Таблица участников → карточки --- */
    #participants,
    #participants thead,
    #participants tbody,
    #participants tr,
    #participants td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    #participants thead {
        display: none;
    }

    #participants tbody tr {
        margin-bottom: 1rem;
        padding: 0.75rem 1rem;
        border: 1px solid #374151;
        border-radius: 0.375rem;
        background-color: #111827;
    }

    #participants tbody tr:nth-child(2n) {
        background-color: #202325;
    }

    #participants tbody td {
        padding: 0.35rem 0;
        text-align: left !important;
        border: none;
        white-space: normal;
        word-break: break-word;
    }

    #participants tbody td::before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        font-size: 0.75rem;
        color: #9ca3af;
        margin-bottom: 0.15rem;
        text-transform: uppercase;
        letter-spacing: 0.025em;
    }

    #participants tbody td.participant-photo::before,
    #participants tbody td.participant-photo-no-label::before {
        content: none;
    }

    #participants tbody td.participant-photo {
        text-align: center !important;
        padding-bottom: 0.5rem;
    }

    #participants tbody td.participant-photo img,
    #participants tbody td.participant-team img {
        display: inline-block !important;
        width: 4rem;
        height: 4rem;
        object-fit: cover;
        border-radius: 0.25rem;
        margin: 0 auto 0.25rem;
    }

    #participants tbody td.participant-team img {
        width: 2.5rem;
        height: 2.5rem;
        object-fit: contain;
    }

    /* DataTables: панель поиска и пагинации */
    .dt-container {
        overflow-x: hidden;
    }

    .dt-layout-row {
        flex-wrap: wrap !important;
        gap: 0.5rem;
    }

    .dt-layout-row .dt-layout-cell {
        width: 100% !important;
        text-align: center !important;
    }

    .dt-layout-row .dt-search input.dt-input,
    .dt-layout-row select.dt-input {
        width: 100% !important;
        max-width: 100%;
        margin: 0 !important;
        box-sizing: border-box;
    }

    /* --- Rich-text в карточке команды --- */
    .rich-text {
        overflow-x: hidden;
        word-break: break-word;
    }

    .rich-text img,
    .rich-text iframe,
    .rich-text video,
    .rich-text embed {
        max-width: 100% !important;
        height: auto !important;
    }

    .rich-text table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rich-text * {
        max-width: 100%;
    }

    /* --- Список команд: полировка --- */
    .grid.grid-cols-1.gap-6.pt-6.px-6 > div {
        padding: 1rem !important;
    }

    .grid.grid-cols-1.gap-6.pt-6.px-6 > div:hover {
        transform: none !important;
    }

    /* Логотип команды на странице карточки */
    .max-w-2xl.mx-auto {
        max-width: 100%;
        padding: 0 0.5rem;
    }
}
