/* Shared mobile polish for tournament pages (menu / participants / stats / editorial) */

/* —— Same shell width as /tournaments/matches —— */
@media (max-width: 991.98px) {
  body:has(.tmenu) .container-application > .main-content,
  body:has(.tournament-editorial) .container-application > .main-content,
  body:has(.history-page) .container-application > .main-content {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }
}
@media (max-width: 575.98px) {
  body:has(.tmenu) .container-application > .main-content,
  body:has(.tournament-editorial) .container-application > .main-content,
  body:has(.history-page) .container-application > .main-content {
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
  }
}

/* —— Page shell (match-page style: wide + pleasant phone) —— */
@media (max-width: 767.98px) {
  .home-content-wrapper.tournament-editorial,
  .home-content-wrapper.tpart,
  .home-content-wrapper.tstats,
  .home-content-wrapper.ttotw,
  .home-content-wrapper.history-page,
  .home-content-wrapper:has(.tmenu),
  .home-content-wrapper:has(.match-editorial) {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow-x: clip;
  }

  .tournament-editorial {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-radius: 0 !important;
  }

  /* —— Menu —— */
  .tmenu {
    margin-bottom: 0.9rem !important;
  }

  .tmenu-card {
    border-radius: 0 !important;
  }

  .tmenu-top {
    padding: 0.9rem 0.85rem 0.75rem !important;
    gap: 0.75rem !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
  }

  .tmenu-brand {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    gap: 0.7rem !important;
  }

  .tmenu-logo {
    width: 48px !important;
    height: 48px !important;
    border-radius: 0 !important;
  }

  .tmenu-kicker {
    font-size: 0.58rem !important;
    letter-spacing: 0.12em !important;
  }

  .tmenu-title,
  .tmenu h1.tmenu-title {
    font-size: clamp(1.2rem, 5.5vw, 1.45rem) !important;
    line-height: 1 !important;
    word-break: break-word;
  }

  .tmenu-title-row {
    gap: 0.4rem !important;
    margin-bottom: 0.45rem !important;
  }

  .tmenu-badge {
    font-size: 0.55rem !important;
    padding: 0.22rem 0.45rem !important;
    border-radius: 0 !important;
  }

  .tmenu-chips {
    gap: 0.3rem !important;
  }

  .tmenu-chip {
    padding: 0.28rem 0.5rem !important;
    font-size: 0.68rem !important;
    border-radius: 0 !important;
  }

  .tmenu-chip em {
    display: none !important;
  }

  .tmenu-actions {
    gap: 0.3rem !important;
  }

  .tmenu-icon-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 0 !important;
  }

  .tmenu-nav {
    padding: 0 0.35rem !important;
  }

  .tmenu-tabs {
    gap: 0 !important;
    scroll-snap-type: x proximity;
    padding-bottom: 0 !important;
  }

  .tmenu-tabs > li {
    scroll-snap-align: start;
  }

  .tmenu-tab {
    padding: 0.7rem 0.55rem 0.8rem !important;
    gap: 0.3rem !important;
    min-height: 44px;
  }

  .tmenu-tab-label {
    font-size: 0.88rem !important;
    letter-spacing: 0.04em !important;
  }

  .tmenu-tab-icon {
    width: 24px !important;
    height: 24px !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
  }

  .tmenu-tab.is-active::after {
    left: 0.55rem !important;
    right: 0.55rem !important;
  }

  /* —— Participants —— */
  .tpart-board {
    margin-bottom: 0.85rem !important;
    align-items: flex-start !important;
  }

  .tpart-title {
    font-size: clamp(1.35rem, 6vw, 1.75rem) !important;
  }

  .tpart-count {
    padding: 0.32rem 0.55rem !important;
    font-size: 0.65rem !important;
  }

  .tpart-panel {
    border-radius: 10px !important;
  }

  .tpart-row {
    padding: 0.7rem 0.75rem !important;
    gap: 0.65rem !important;
  }

  .tpart-logo {
    width: 36px !important;
    height: 36px !important;
    border-radius: 7px !important;
  }

  .tpart-name {
    font-size: 1.05rem !important;
  }

  .tpart-btn {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
  }

  .tpart-btn-label {
    display: none !important;
  }

  .tpart-chevron {
    display: none !important;
  }

  /* —— Stats —— */
  .tstats-board {
    margin-bottom: 0.75rem !important;
    align-items: flex-start !important;
  }

  .tstats-title {
    font-size: clamp(1.35rem, 6vw, 1.75rem) !important;
  }

  .tstats-filter {
    width: 100%;
  }

  .tstats-filter select {
    width: 100%;
    max-width: 100%;
    font-size: 16px; /* avoid iOS zoom */
  }

  .tstats-tabs {
    margin-bottom: 0.85rem !important;
    border-radius: 10px !important;
    scroll-snap-type: x proximity;
  }

  .tstats-tab {
    padding: 0.65rem 0.75rem !important;
    font-size: 0.95rem !important;
    min-height: 42px;
    scroll-snap-align: start;
  }

  .tstats-tab[data-short] {
    font-size: 0 !important;
  }

  .tstats-tab[data-short]::before {
    content: attr(data-short);
    font-size: 0.95rem;
    font-family: "Bebas Neue", "Oswald", "Arial Narrow", sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .tstats-card {
    border-radius: 10px !important;
  }

  .tstat-hero {
    grid-template-columns: 1.15fr 0.85fr !important;
    min-height: 0 !important;
    padding: 1rem 0.85rem 0.75rem !important;
    gap: 0.25rem !important;
  }

  .tstat-hero-value {
    font-size: clamp(2.8rem, 14vw, 3.8rem) !important;
    margin-bottom: 0.3rem !important;
  }

  .tstat-hero-badge {
    margin-bottom: 0.7rem !important;
    font-size: 0.72rem !important;
  }

  .tstat-hero-name {
    font-size: clamp(1.15rem, 5vw, 1.45rem) !important;
  }

  .tstat-hero-team {
    font-size: 0.68rem !important;
    letter-spacing: 0.04em !important;
  }

  .tstat-hero-photo {
    min-height: 150px !important;
  }

  .tstat-hero-photo-inner {
    max-width: 150px !important;
  }

  .tstat-row {
    padding: 0.7rem 0.85rem !important;
    gap: 0.65rem !important;
  }

  .tstat-avatar {
    width: 38px !important;
    height: 38px !important;
  }

  .tstat-player {
    font-size: 0.88rem !important;
  }

  .tstat-value {
    font-size: 1.05rem !important;
  }

  .tstats-overview {
    grid-template-columns: 1fr !important;
    gap: 0.55rem !important;
  }

  .tstats-chip {
    padding: 0.85rem 0.95rem !important;
    border-radius: 10px !important;
  }

  .tstats-chip-value {
    font-size: 1.7rem !important;
  }

  .tstats-rounds {
    border-radius: 10px !important;
  }

  .tstats-round {
    grid-template-columns: 1fr 1fr 1fr !important;
    padding: 0.75rem 0.85rem !important;
    gap: 0.4rem 0.35rem !important;
  }

  .tstats-round-name {
    grid-column: 1 / -1 !important;
    font-size: 1rem !important;
  }

  .tstats-round-detail-label {
    margin-left: 0.85rem !important;
    margin-right: 0.85rem !important;
  }

  .tstat-list--flush .tstat-row {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  /* —— Editorial tables / cards —— */
  .tournament-editorial .te-board-title,
  .tournament-editorial .te-card-title {
    font-size: clamp(1.25rem, 5.5vw, 1.65rem) !important;
  }

  .tournament-editorial .table-responsive,
  .tournament-editorial .te-card .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .tournament-editorial table {
    font-size: 0.8rem;
  }

  .tournament-editorial .matches-grid {
    grid-template-columns: 1fr !important;
    gap: 0.7rem !important;
  }

  /* —— Team of the Week —— */
  .ttotw-board {
    margin-bottom: 0.85rem !important;
    align-items: flex-start !important;
  }

  .ttotw-card {
    border-radius: 10px !important;
  }

  .ttotw-card-head {
    padding: 0.9rem 0.85rem 0.8rem !important;
  }

  .ttotw-card-body {
    padding: 0.75rem 0.55rem 0.9rem !important;
  }

  .ttotw-chip {
    padding: 0.85rem 0.95rem !important;
    border-radius: 10px !important;
  }

  .ttotw-side-row {
    padding: 0.55rem 0.85rem !important;
  }
}

@media (max-width: 400px) {
  .tmenu-top {
    flex-wrap: wrap !important;
  }

  .tmenu-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .tstat-hero {
    grid-template-columns: 1.2fr 0.8fr !important;
  }

  .tstat-hero-photo-inner {
    max-width: 120px !important;
  }

  .tpart-actions {
    gap: 0.25rem !important;
  }
}

/* —— Laptop / notebook density —— */
@media (min-width: 768px) and (max-width: 1440px) {
  body:has(.tournament-editorial) .main-content.position-relative,
  body:has(.tmenu) .main-content.position-relative {
    padding-left: 1.15rem !important;
    padding-right: 1.15rem !important;
  }

  .home-content-wrapper.tournament-editorial,
  .home-content-wrapper.tpart,
  .home-content-wrapper.tstats,
  .home-content-wrapper.ttotw,
  .home-content-wrapper.history-page {
    max-width: 1600px !important;
  }

  .tmenu {
    margin-bottom: 0.8rem !important;
  }

  .tmenu-top {
    padding: 0.8rem 0.95rem 0.7rem !important;
  }

  .tmenu-logo {
    width: 46px !important;
    height: 46px !important;
  }

  .tmenu h1.tmenu-title,
  .tmenu-title {
    font-size: clamp(1.3rem, 2vw, 1.65rem) !important;
  }

  .tmenu-tab {
    padding: 0.6rem 0.6rem 0.7rem !important;
  }

  .tmenu-tab-label {
    font-size: 0.9rem !important;
  }

  .tournament-editorial .te-card-head {
    padding: 0.7rem 0.9rem 0.65rem !important;
  }

  .tournament-editorial .card-header {
    padding: 0.75rem 0.9rem !important;
  }

  .tournament-editorial .list-group-item {
    padding-top: 0.55rem !important;
    padding-bottom: 0.55rem !important;
  }

  .tstats-title,
  .tpart-title,
  .ttotw-title,
  .tournament-editorial .te-board-title {
    font-size: clamp(1.4rem, 2vw, 1.8rem) !important;
  }

  .tstat-hero {
    min-height: 180px;
    padding: 1rem 1.05rem 0.85rem;
  }

  .tstat-row {
    padding: 0.55rem 0.95rem;
  }

  .tpart-row {
    padding: 0.5rem 0.85rem !important;
  }

  .ttotw-layout {
    gap: 0.75rem !important;
  }
}

/* —— Square editorial containers (match page language) —— */
.tournament-editorial .te-card,
.tournament-editorial .sl-card,
.tournament-editorial .single-league-overview-card,
.tournament-editorial .te-card.sl-card,
.tpart-panel,
.tpart-count,
.tpart-logo,
.tstats-card,
.tstats-tabs,
.tstats-tab,
.tstats-filter select,
.tstats-filter-clear,
.tstats-chip,
.tstats-rounds,
.ttotw-card,
.ttotw-count,
.ttotw-chip,
.ttotw-player,
.ttotw-field-bg,
.history-page .history-hero,
.history-page .champions-section,
.history-page .history-table-card,
.history-page .champion-logo,
.history-page .champion-logo-placeholder,
.history-page .champion-rank,
.history-page .hero-badge {
  border-radius: 0 !important;
}

.tournament-editorial .te-select,
.tournament-editorial .te-chip,
.tournament-editorial .te-badge,
.tournament-editorial select.form-control,
.tournament-editorial .btn {
  border-radius: 0 !important;
}

@media (max-width: 767.98px) {
  .tournament-editorial .te-card,
  .tpart-panel,
  .tstats-card,
  .ttotw-card,
  .history-page .history-hero,
  .history-page .champions-section,
  .history-page .history-table-card {
    border-radius: 0 !important;
  }

  .history-page .history-hero {
    padding: 1.25rem 1rem !important;
    margin-bottom: 1rem !important;
  }

  .history-page .champions-section .section-header,
  .history-page .history-table-card .card-header {
    padding: 0.85rem 1rem !important;
  }

  .history-page .champion-item {
    padding: 0.75rem 1rem !important;
  }
}
