/* ============================================================
   КАРТОЧКА ТУРНИРА — tournament-card.css
   ============================================================
   @package Gambling_Theme
   @version 1.6.0 - AUTO-HEIGHT: Выравнивание блоков по высоте
   @updated 2026-04-24

   Контексты:
     .tournament-card--tournament      → Обычный турнир
     .tournament-card--finished        → Завершённый турнир  
     .tournament-card--casino-context  → Контекст страницы казино

   Changelog:
   v1.6.0 - AUTO-HEIGHT SYSTEM:
            - flex-grow: 1 у заголовка для выталкивания блоков вниз
            - min-height: 64px у .tournament-card__prize для выравнивания
            - min-height: 40px у .tournament-card__casino-logo (защита от схлопывания)
            - height: 74px у .tournament-card__status (красная линия на одном уровне)
            - ВСЕ кнопки перенесены в buttons.css (v2.8.0)
            - ВСЕ фильтры перенесены в buttons.css (v2.8.0)
            - Устранено дублирование медиазапросов
            - Идеальная синхронизация с promotion-card.css
   v1.5.1 - CLEANUP: Убрано дублирование медиазапросов
   ============================================================ */

.archive-tournament-cards-wrapper {
    display:               grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap:                   20px;
    margin-bottom:         40px;
    width:                 100%;
}

.archive-content__column--main .archive-tournament-cards-wrapper,
.tournament-casino-section .archive-tournament-cards-wrapper,
.layout-full .archive-tournament-cards-wrapper {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* ── Адаптивные брейкпоинты сетки ──────────────────────────── */
@media (max-width: 1100px) {
    .archive-tournament-cards-wrapper,
    .archive-content__column--main .archive-tournament-cards-wrapper,
    .tournament-casino-section .archive-tournament-cards-wrapper,
    .layout-full .archive-tournament-cards-wrapper {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
    }
}

@media (max-width: 600px) {
    .archive-tournament-cards-wrapper,
    .archive-content__column--main .archive-tournament-cards-wrapper,
    .tournament-casino-section .archive-tournament-cards-wrapper,
    .layout-full .archive-tournament-cards-wrapper {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }
}

/* ══════════════════════════════════════════════════════════════
   CSS ПЕРЕМЕННЫЕ
   ══════════════════════════════════════════════════════════════ */

.tournament-card {
    --tc-bg:           #1e1e2e;
    --tc-bg-hover:     #252538;
    --tc-border:       rgba(255, 255, 255, 0.08);
    --tc-border-hover: rgba(255, 255, 255, 0.14);
    --tc-text:         #b0b0c8;
    --tc-title:        #ffffff;
    --tc-accent:       #d97706;
    --tc-accent-hover: #b45309;
    --tc-shadow:       0 4px 12px rgba(0, 0, 0, 0.15);
    --tc-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.25);
    --tc-radius:       12px;
    --tc-transition:   all 0.3s ease;

    --badge-casino:    #e53e3e;
    --badge-sport:     #10b981;
    --badge-poker:     #3b82f6;
    --badge-live:      #8b5cf6;
    --badge-slots:     #f59e0b;
    --badge-esport:    #06b6d4;
    --badge-lottery:   #ec4899;
    --badge-default:   #6b7280;
}

/* ══════════════════════════════════════════════════════════════
   ОСНОВНАЯ КАРТОЧКА
   ══════════════════════════════════════════════════════════════ */

.tournament-card {
    display:        flex;
    flex-direction: column;
    background:     var(--tc-bg);
    border:         1px solid var(--tc-border);
    border-radius:  var(--tc-radius);
    overflow:       hidden;
    transition:     var(--tc-transition);
    height:         100%;
    box-shadow:     var(--tc-shadow);
    margin-bottom:  0;
}

.tournament-card:hover {
    background:   var(--tc-bg-hover);
    border-color: var(--tc-border-hover);
    transform:    translateY(-4px);
    box-shadow:   var(--tc-shadow-hover);
}

/* ══════════════════════════════════════════════════════════════
   БАННЕР
   ══════════════════════════════════════════════════════════════ */

.tournament-card__banner {
    position:    relative;
    width:       100%;
    height:      170px;
    background:  linear-gradient(135deg, #1e1e2e 0%, #2a2a3d 100%);
    overflow:    hidden;
    flex-shrink: 0;
}

.tournament-card__img {
    width:      100%;
    height:     100%;
    object-fit: cover;
    display:    block;
    transition: transform 0.3s ease;
}

.tournament-card:hover .tournament-card__img {
    transform: scale(1.05);
}

.tournament-card__img-placeholder {
    width:           100%;
    height:          100%;
    background:      linear-gradient(135deg, #1e1e2e 0%, #2a2a3d 50%, #1e1e2e 100%);
    background-size: 200% 200%;
    animation:       shimmer 2s infinite;
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ══════════════════════════════════════════════════════════════
   БЕЙДЖИ ТИПОВ ТУРНИРОВ
   ══════════════════════════════════════════════════════════════ */

.tournament-card__badge {
    position:        absolute;
    top:             10px;
    left:            10px;
    padding:         5px 10px;
    font-size:       10px;
    font-weight:     700;
    text-transform:  uppercase;
    border-radius:   18px;
    letter-spacing:  0.5px;
    z-index:         2;
    box-shadow:      0 2px 8px rgba(0, 0, 0, 0.4);
    color:           #ffffff;
    background:      var(--badge-default);
    line-height:     1.3;
    white-space:     nowrap;
    max-width:       calc(100% - 20px);
    overflow:        hidden;
    text-overflow:   ellipsis;
}

.tournament-card__badge--casino,
.tournament-card__badge--kazino      { background: var(--badge-casino);  }

.tournament-card__badge--sport,
.tournament-card__badge--sports,
.tournament-card__badge--betting     { background: var(--badge-sport);   }

.tournament-card__badge--poker,
.tournament-card__badge--poker-room  { background: var(--badge-poker);   }

.tournament-card__badge--live,
.tournament-card__badge--live-casino,
.tournament-card__badge--live-dealer { background: var(--badge-live);    }

.tournament-card__badge--slots,
.tournament-card__badge--slot        { background: var(--badge-slots);   }

.tournament-card__badge--esport,
.tournament-card__badge--cybersport  { background: var(--badge-esport);  }

.tournament-card__badge--lottery,
.tournament-card__badge--lotto       { background: var(--badge-lottery); }

.tournament-card--finished .tournament-card__badge {
    background: var(--badge-default);
    opacity:    0.7;
}

/* ══════════════════════════════════════════════════════════════
   ТЕЛО КАРТОЧКИ
   ══════════════════════════════════════════════════════════════ */

.tournament-card__body {
    padding:        15px;
    display:        flex;
    flex-direction: column;
    align-items:    center;
    text-align:     center;
    flex-grow:      1;
}

/* ✅ v1.6.0: Заголовок забирает всё свободное место,
   выталкивая блоки приза/лого/статуса вниз */
.tournament-card__title {
    font-size:     16px;
    font-weight:   700;
    color:         var(--tc-title);
    margin-bottom: 12px;
    line-height:   1.3;
    word-wrap:     break-word;
    width:         100%;
    flex-grow:     1;
}

/* ══════════════════════════════════════════════════════════════
   ПРИЗОВОЙ ФОНД
   ══════════════════════════════════════════════════════════════ */

/* ✅ v1.6.0: Фиксированная min-height для выравнивания между карточками */
.tournament-card__prize {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    justify-content: center;
    margin-bottom:   14px;
    width:           100%;
    min-height:      64px;
}

.tournament-card__prize-label {
    font-size:      11px;
    color:          var(--tc-text);
    margin-bottom:  4px;
    letter-spacing: 0.3px;
    font-weight:    500;
    text-transform: uppercase;
}

.tournament-card__prize-value {
    font-size:   26px;
    font-weight: 800;
    color:       var(--tc-title);
    line-height: 1.2;
}

/* ══════════════════════════════════════════════════════════════
   ЛОГОТИП КАЗИНО
   ══════════════════════════════════════════════════════════════ */

/* ✅ v1.6.0: min-height защищает блок от схлопывания */
.tournament-card__casino-logo {
    height:          40px;
    min-height:      40px;
    display:         flex;
    align-items:     center;
    justify-content: center;
    margin-bottom:   14px;
    padding:         0 8px;
    width:           100%;
}

.tournament-card__casino-logo img {
    max-height: 100%;
    max-width:  110px;
    object-fit: contain;
    filter:     drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* ══════════════════════════════════════════════════════════════
   СТАТУС И ТАЙМЕР
   ══════════════════════════════════════════════════════════════ */

/* ✅ v1.6.0: Фиксированная height — красная линия на одном уровне */
.tournament-card__status {
    width:           100%;
    padding:         8px 5px;
    border-top:      1px solid var(--tc-border);
    display:         flex;
    flex-direction:  column;
    justify-content: center;
    align-items:     center;
    height:          74px;
}

.tournament-card__status-label {
    font-size:      11px;
    color:          var(--tc-text);
    margin-bottom:  6px;
    font-weight:    500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tournament-card__status-value {
    font-size:   20px;
    font-weight: 700;
    color:       var(--tc-title);
    line-height: 1.2;
}

.tournament-card__status-value--finished {
    font-size:   14px;
    color:       var(--tc-text);
    font-weight: 500;
}

.tournament-card__status-value--unknown {
    font-size:   13px;
    color:       var(--tc-text);
    font-style:  italic;
    font-weight: 400;
}

.tournament-card__timer {
    display:         flex;
    justify-content: center;
    align-items:     flex-start;
    gap:             3px;
}

.timer-block {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    min-width:      32px;
}

.timer-val {
    font-size:     20px;
    font-weight:   700;
    color:         var(--tc-title);
    line-height:   1;
    margin-bottom: 2px;
    font-family:   var(--font-primary);
}

.timer-lbl {
    font-size:      8px;
    color:          var(--tc-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight:    600;
}

.timer-sep {
    font-size:   18px;
    font-weight: 700;
    color:       rgba(255, 255, 255, 0.3);
    line-height: 1;
    margin-top:  1px;
    font-family: 'Courier New', monospace;
}

.tournament-timer--finished .timer-val {
    color: var(--tc-text);
}


/* ══════════════════════════════════════════════════════════════
   КОНТЕКСТ КАЗИНО
   ══════════════════════════════════════════════════════════════ */

.tournament-card--casino-context .tournament-card__casino-logo,
.tournament-card--casino-context .tournament-card__btn-all {
    display: none;
}

/* ══════════════════════════════════════════════════════════════
   РЕЖИМ ЛОГОТИПА В БАННЕРЕ (fallback когда нет tournament_icon)
   ══════════════════════════════════════════════════════════════ */

.tournament-card__banner--logo {
    background: #13131f;
}

.tournament-card__img--logo {
    object-fit: contain;
    padding:    20px;
}

/* ══════════════════════════════════════════════════════════════
   АДАПТИВНОСТЬ — ВСЕ БРЕЙКПОИНТЫ В ОДНОМ МЕСТЕ
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
    .tournament-card__title       { font-size: 15px; }
    .tournament-card__prize-value { font-size: 20px; }
    .timer-val                    { font-size: 18px; }
}

/* ✅ v1.6.0: Единый блок 600px — без дублирования */
@media (max-width: 600px) {
    .tournament-card__banner      { height: 170px; }
    .tournament-card__title       { font-size: 16px; }
    .tournament-card__prize-value { font-size: 20px; }
    .timer-val                    { font-size: 19px; }

    /* Сбрасываем фиксированные высоты на мобиле */
    .tournament-card__prize  { min-height: auto; }
    .tournament-card__status { height: auto; min-height: 64px; }
    .tournament-card__img--logo { padding: 15px; }

}
