/* ============================================
   КОНКУРС ПРОГНОЗОВ РПЛ – СТИЛИ (2×2)
   ============================================ */

.rpl-competition-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 15px;
    font-family: 'Open Sans', Arial, sans-serif;
    background: #f5f5f5;
    border-radius: 12px;
}

.rpl-tour-title {
    font-size: 28px;
    font-weight: bold;
    color: #e70000;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Сетка 2 ряда по 2 колонки */
.rpl-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.rpl-grid-row {
    display: contents; /* чтобы внутренние колонки занимали свои ячейки */
}

/* Каждая колонка */
.rpl-col {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.rpl-col-header {
    font-size: 18px;
    font-weight: bold;
    color: #e70000;
    border-bottom: 2px solid #e70000;
    padding-bottom: 10px;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 0.5px;
}

/* --- Колонка 1: Прогноз эксперта --- */
.rpl-expert-predictions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rpl-expert-match {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafafa;
    border-radius: 8px;
    padding: 8px 12px;
    border-left: 3px solid #e70000;
    font-size: 15px;
}

.rpl-expert-teams {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.rpl-team-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 4px;
}

.rpl-team-name {
    font-weight: bold;
    color: #222;
}

.rpl-expert-score {
    font-weight: bold;
    color: #222;
    margin: 0 6px;
}

.rpl-expert-time {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
    margin-left: 10px;
}

/* --- Колонка 2: Ваш прогноз --- */
.rpl-user-prediction {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rpl-user-match {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fafafa;
    border-radius: 8px;
    padding: 8px 12px;
    flex-wrap: wrap;
}

.rpl-user-teams {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    flex: 1 0 160px;
}

.rpl-user-teams .rpl-team-name {
    font-weight: bold;
}

.rpl-user-form {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.rpl-user-form input[type="number"] {
    width: 40px;
    height: 32px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    padding: 0 2px;
}

.rpl-user-form select {
    height: 32px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.rpl-user-form button {
    background: #e70000;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.rpl-user-form button:hover {
    background: #c40000;
}

.rpl-user-prediction-existing {
    font-size: 14px;
    color: #222;
    background: #e8f5e9;
    padding: 4px 10px;
    border-radius: 4px;
}

/* --- Колонка 3: Прогнозы других --- */
.rpl-others-predictions {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.rpl-others-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.rpl-others-table th {
    background: #f0f0f0;
    padding: 6px 8px;
    text-align: left;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.rpl-others-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
}

.rpl-others-table tr:hover {
    background: #f9f9f9;
}

.rpl-others-nick {
    font-weight: bold;
    color: #e70000;
}

/* --- Колонка 4: Чат --- */
.rpl-chat-box {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rpl-chat-message {
    background: #f0f0f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
}

.rpl-chat-message .rpl-chat-nick {
    font-weight: bold;
    color: #e70000;
}

.rpl-chat-message .rpl-chat-time {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
}

.rpl-chat-input {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.rpl-chat-input input {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
}

.rpl-chat-input button {
    background: #e70000;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

/* ===== Адаптивность ===== */
@media (max-width: 992px) {
    .rpl-grid-2x2 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .rpl-expert-match {
        flex-wrap: wrap;
        font-size: 13px;
    }
    .rpl-user-match {
        flex-direction: column;
        align-items: stretch;
    }
    .rpl-user-teams {
        font-size: 13px;
    }
    .rpl-user-form {
        justify-content: center;
    }
    .rpl-others-table {
        font-size: 12px;
    }
    .rpl-col {
        padding: 12px;
    }
}


/* ---- ЗАКРЫВАШКА ДЛЯ "ВАШ ПРОГНОЗ" (правая красная полоса) ---- */
.rpl-user-match {
    border-right: 3px solid #e70000;
    padding-right: 10px;
    margin-right: 0;
}

/* ---- БЛОК ЭКСПЕРТА ---- */
.rpl-expert-intro {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.rpl-expert-intro p {
    font-size: 24px; /* увеличили шрифт */
    margin-bottom: 10px;
}
.rpl-expert-intro strong {
    color: #e70000;
}
.rpl-expert-photo {
    width: 100%;
    max-width: 130px;       /* ограничим максимальную ширину, чтобы не расплывалось */
    height: auto;           /* высота подстраивается под пропорции */
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    margin: 10px auto 0;
    display: block;
}

/* ===== УНИВЕРСАЛЬНЫЕ КНОПКИ (с приоритетом !important) ===== */
.rpl-btn {
    display: inline-block !important;
    padding: 8px 22px !important;
    border-radius: 30px !important;
    font-weight: bold !important;
    font-size: 14px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    border: 2px solid transparent !important;
    cursor: pointer !important;
    text-align: center !important;
    line-height: 1.4 !important;
}

.rpl-btn-red {
    background: #e70000 !important;
    color: #ffffff !important;
    border-color: #e70000 !important;
}
.rpl-btn-red:hover {
    background: #c40000 !important;
    border-color: #c40000 !important;
    color: #ffffff !important;
}

.rpl-btn-white {
    background: #ffffff !important;
    color: #e70000 !important;
    border-color: #e70000 !important;
}
.rpl-btn-white:hover {
    background: #e70000 !important;
    color: #ffffff !important;
}

/* ============================================
   Стили для страницы конкурсов (/competition/)
   ============================================ */

.competition-page {
    padding: 40px 0 60px;
}

.competition-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
}

.competition-card {
    display: block;
    width: 340px; /* Увеличили */
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: 0.3s;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.competition-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border-color: #b0c4de;
}

.competition-card-inner {
    padding: 35px 25px 30px;
    text-align: center;
}

.competition-logo {
    width: 160px; /* Увеличили */
    height: 160px;
    object-fit: contain;
    margin-bottom: 20px;
}

.competition-name {
    display: block;
    font-size: 26px; /* Увеличили */
    font-weight: 700;
    color: #1a3c6e;
    margin-bottom: 8px;
}

.competition-desc {
    display: block;
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 16px;
}

.competition-badge {
    display: inline-block;
    padding: 6px 22px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 500;
}

.competition-badge.active {
    background: #28a745;
    color: #ffffff;
}

/* Адаптив */
@media (max-width: 768px) {
    .competition-page {
        padding: 20px 0;
    }
    .competition-card {
        width: 100%;
        max-width: 360px;
    }
    .competition-logo {
        width: 120px;
        height: 120px;
    }
    .competition-name {
        font-size: 22px;
    }
    .competition-desc {
        font-size: 14px;
    }
}

/* МОДУЛЬ Прогнозы других */

.rpl-others-nicks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.rpl-others-nick-btn {
    margin: 0;
    padding: 6px 12px;
    font-size: 14px;
}
#rpl-modal-overlay {
    display: none;
}
#rpl-modal-overlay.active {
    display: flex !important;
}
#rpl-modal-body table {
    width: 100%;
    border-collapse: collapse;
}
#rpl-modal-body table th,
#rpl-modal-body table td {
    padding: 8px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

/* ============================================
   ПРОГНОЗЫ ДРУГИХ УЧАСТНИКОВ – СТИЛИ
   ============================================ */

.rpl-others-users {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.rpl-other-user-btn {
    background: #e70000 !important;
    color: #fff !important;
    border: none !important;
    padding: 6px 16px !important;
    border-radius: 20px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
}
.rpl-other-user-btn:hover {
    background: #c00000 !important;
}

/* Модальное окно */
.rpl-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}
.rpl-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.rpl-modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}
.rpl-modal-close:hover {
    color: #000;
}
.rpl-modal-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.rpl-modal-table th,
.rpl-modal-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: middle;
}
.rpl-modal-table th {
    background: #f5f5f5;
    font-weight: bold;
}
.rpl-modal-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    margin-right: 6px;
    vertical-align: middle;
}
.rpl-modal-match {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rpl-standings-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 16px;
}
.rpl-standings-table th {
    background: #e70000;
    color: #fff;
    padding: 10px;
    text-align: left;
}
.rpl-standings-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
}
.rpl-standings-table tr:nth-child(even) {
    background: #f9f9f9;
}
.rpl-tour-standings {
    margin-top: 30px;
}
.rpl-col-header {
    background: #e70000;
    color: #fff;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 15px;
}

/* ===== СТИЛИ ДЛЯ ГЛАВНОЙ СТРАНИЦЫ КОНКУРСОВ (карточки) ===== */
.competition-page .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 15px;
}
.competition-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: flex-start;
    align-items: stretch;
}
.competition-card {
    flex: 0 0 calc(50% - 20px);
    max-width: calc(50% - 20px);
    min-width: 280px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}
.competition-card:hover {
    transform: translateY(-5px);
}
.competition-card .card-inner {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    padding: 30px 25px 40px;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border: 1px solid #f0f0f0;
    min-height: 450px;
}
.competition-card .card-inner .card-image-wrap {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 100%;
}
.competition-card .card-inner img {
    max-width: 90%;
    max-height: 200px;
    height: auto;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}
.competition-card .card-inner .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin-top: 15px;
}
.competition-card .card-inner .title {
    font-size: 26px;
    font-weight: 700;
    color: #e70000;
    margin-bottom: 10px;
    line-height: 1.2;
}
.competition-card .card-inner .subtitle {
    font-size: 16px;
    color: #666;
    margin-top: 5px;
    line-height: 1.4;
}
.competition-card .card-inner .btn {
    display: inline-block;
    padding: 12px 40px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 20px;
    flex-shrink: 0;
}
.competition-card .card-inner .btn-red {
    background: #e31e24;
    color: #fff;
}
.competition-card .card-inner .btn-red:hover {
    background: #c41a1e;
}
.competition-card .card-inner .btn-white-outline {
    background: #fff;
    color: #999;
    border: 2px solid #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}
.competition-card .card-inner .btn-white-outline:hover {
    background: #f5f5f5;
}
.competition-card .card-inner .footnote {
    margin-top: 20px;
    font-style: italic;
    font-size: 14px;
    color: #888;
    flex-shrink: 0;
}
@media (max-width: 767px) {
    .competition-grid {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    .competition-card {
        flex: 0 0 100%;
        max-width: 100%;
        min-width: unset;
        width: 100%;
    }
    .competition-card .card-inner {
        min-height: 400px;
    }
    .competition-card .card-inner .card-image-wrap {
        height: 160px;
    }
    .competition-card .card-inner img {
        max-height: 160px;
    }
}