/* Predator Eleven — Mobile Infrastructures / Stade */
/* Hero: uses shared .m-page-hero from shell.css */

.m-stade-list.infra-campus {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  border-radius: 0;
  overflow: visible;
}

.m-stade-building.infra-card {
  position: static;
  width: 100%;
  height: auto;
  transform: none;
  top: auto;
  left: auto;
  text-align: left;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  backdrop-filter: blur(10px);
}

.m-stade-building.infra-global-card {
  border-color: #334155;
}

.m-stade-building.infra-global-card.is-premium {
  border-color: rgba(250, 204, 21, 0.38);
  background:
    linear-gradient(145deg, rgba(250, 204, 21, 0.1), rgba(2, 6, 23, 0.96) 42%);
  box-shadow: inset 0 1px 0 rgba(253, 230, 138, 0.14);
}

.m-stade-building.infra-global-card.is-locked {
  border-color: #334155;
}

.m-stade-building.infra-global-card .m-stade-etat-pct {
  color: var(--m-gold);
  max-width: 55%;
  text-align: right;
}

.infra-global-head-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.infra-global-card .spa-filtre-recuperation__badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.35;
  color: #fde68a;
  background:
    linear-gradient(145deg, rgba(250, 204, 21, 0.24), rgba(250, 204, 21, 0.08));
  border: 1px solid rgba(250, 204, 21, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.infra-global-card .spa-filtre-recuperation__hint {
  margin: 8px 0 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

.infra-global-card.is-locked .btn-repair-global {
  opacity: 0.55;
  cursor: not-allowed;
}

.m-stade-building-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.m-stade-building-head h2 {
  margin: 0;
  font-family: var(--m-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.m-stade-building-link {
  color: inherit;
  text-decoration: none;
}

.m-stade-building-link:hover,
.m-stade-building-link:focus-visible {
  text-decoration: underline;
}

.infra-stars {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--m-gold);
  white-space: nowrap;
  line-height: 1.3;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-stade-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.m-stade-state {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 0.72rem;
  letter-spacing: 1px;
}

.carre-green { color: #22c55e; }
.carre-orange { color: #f59e0b; }
.carre-red { color: #ef4444; }
.carre-vide { color: rgba(148, 163, 184, 0.35); }

.m-stade-etat-pct {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--m-muted);
  font-variant-numeric: tabular-nums;
}

.m-stade-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.m-stade-actions form {
  margin: 0;
}

.m-stade-actions .m-btn {
  width: 100%;
  min-height: 44px;
}

.m-stade-actions .m-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.loader {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-top-color: transparent;
  border-radius: 50%;
  display: none;
  animation: m-spin 0.8s linear infinite;
}

@keyframes m-spin {
  to { transform: rotate(360deg); }
}

.popup-vendre-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--m-safe-bottom));
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
}

.popup-vendre-overlay[hidden] {
  display: none !important;
}

.popup-vendre-content {
  width: min(420px, 100%);
  padding: 20px;
  border-radius: 20px 20px 16px 16px;
  background: linear-gradient(180deg, #152033 0%, #0d1524 100%);
  border: 1px solid var(--m-border);
  box-shadow: var(--m-shadow);
  animation: m-fade-up 0.28s ease both;
}

.popup-vendre-content h3 {
  margin: 0 0 10px;
  font-family: var(--m-display);
  font-size: 1.15rem;
}

.popup-vendre-nom,
.popup-vendre-prix {
  margin: 0 0 8px;
  color: #cbd5e1;
  font-weight: 600;
}

.popup-vendre-alerte {
  margin: 0 0 18px;
  color: #fca5a5;
  font-size: 0.88rem;
}

.popup-vendre-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.popup-vendre-actions .m-btn {
  width: 100%;
}

/* ==========================================================================
   Catalogue de gestion — tablette
   Grille 2 cols :
     • portrait dès 820px (iPad Air / Pro 11 ≈ 820–834)
     • paysage dès 900px (comportement actuel inchangé)
   Téléphone portrait & téléphone paysage (<900) : non ciblés.
   ========================================================================== */

@media (min-width: 820px) and (orientation: portrait),
       (min-width: 900px) {
  .m-stade-list.infra-campus {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px 24px;
    align-items: stretch;
  }

  /* Entretien global — pleine largeur, ne casse jamais la grille */
  .m-stade-building.infra-global-card {
    grid-column: 1 / -1;
  }

  .m-stade-building.infra-card {
    width: auto;
    margin-bottom: 0;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  /* Même hauteur de rangée + boutons alignés en bas */
  .m-stade-building.infra-card .m-stade-actions {
    margin-top: auto;
  }
}

/* Portrait tablette (iPad) : hero proche du rendu actuel */
@media (min-width: 820px) and (orientation: portrait) {
  .m-page-hero {
    max-height: 140px;
  }

  .m-page-hero-image {
    height: 140px;
  }
}

/* Paysage : même rendu qu’aujourd’hui (seuil 900 conservé) */
@media (min-width: 900px) and (orientation: landscape) {
  .m-page-hero {
    max-height: 96px;
    margin-bottom: 12px;
  }

  .m-page-hero-image {
    height: 96px;
  }
}

/* ==========================================================================
   Popup info Stade — composant Premium (inspiration rj-overlay)
   ========================================================================== */

.m-stade-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* Titre page Infrastructures + ⓘ (même principe Entraînement / Marketing) */
.m-infra-page-title-row {
  margin: 0 0 4px;
}

.m-infra-page-title-row .m-page-title {
  margin: 0;
}

.pe-stade-info-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(250, 204, 21, 0.35);
  background:
    radial-gradient(circle at 30% 20%, rgba(250, 204, 21, 0.22), transparent 55%),
    rgba(15, 23, 42, 0.85);
  color: #facc15;
  font-size: 0.92rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.12);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pe-stade-info-btn:hover,
.pe-stade-info-btn:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(250, 204, 21, 0.7);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.28);
}

.pe-stade-info-btn:active {
  transform: translateY(0);
}

.pe-stade-info-overlay {
  align-items: flex-end;
  justify-content: center;
  padding: 12px 12px calc(12px + var(--m-safe-bottom, 0px));
  background:
    radial-gradient(120% 80% at 50% 120%, rgba(250, 204, 21, 0.12), transparent 55%),
    rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2110;
}

.pe-stade-info-panel {
  width: min(440px, 100%);
  max-height: min(88dvh, 720px);
  overflow: auto;
  padding: 18px 16px 16px;
  border-radius: 22px 22px 16px 16px;
  color: #e8eef8;
  background:
    radial-gradient(90% 60% at 50% -10%, rgba(250, 204, 21, 0.16), transparent 58%),
    radial-gradient(70% 50% at 100% 0%, rgba(59, 130, 246, 0.18), transparent 50%),
    linear-gradient(180deg, #152033 0%, #0b1220 100%);
  border: 1px solid rgba(250, 204, 21, 0.22);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: pe-stade-info-rise 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pe-stade-info-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pe-stade-info-head {
  text-align: center;
  margin-bottom: 14px;
}

.pe-stade-info-kicker {
  margin: 0 0 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #facc15;
}

.pe-stade-info-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
}

.pe-stade-info-title {
  margin: 0;
  font-family: var(--m-display, "Sora", "Outfit", system-ui, sans-serif);
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f8fafc;
}

.pe-stade-info-close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1;
}

.pe-stade-info-close:hover,
.pe-stade-info-close:focus-visible {
  outline: none;
  border-color: rgba(250, 204, 21, 0.45);
  color: #fde68a;
}

.pe-stade-info-desc {
  margin: 10px 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #cbd5e1;
}

.pe-stade-info-table-wrap {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.55);
  overflow: hidden;
}

.pe-stade-info-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.pe-stade-info-table thead th {
  padding: 8px 5px;
  text-align: left;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  background: rgba(2, 6, 23, 0.45);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.pe-stade-info-table thead th:last-child {
  text-align: right;
}

/* 2 colonnes (Stade, Infrastructure) — place pour badge inline */
.pe-stade-info-table thead th:nth-child(1),
.pe-stade-info-table tbody td:nth-child(1) {
  width: 58%;
}

.pe-stade-info-table thead th:nth-child(2),
.pe-stade-info-table tbody td:nth-child(2) {
  width: 42%;
}

.pe-stade-info-table--marketing thead th:nth-child(1),
.pe-stade-info-table--marketing tbody td:nth-child(1) {
  width: 48%;
}

.pe-stade-info-table--marketing thead th:nth-child(2),
.pe-stade-info-table--marketing tbody td:nth-child(2) {
  width: 34%;
}

.pe-stade-info-table--marketing thead th:nth-child(3),
.pe-stade-info-table--marketing tbody td:nth-child(3) {
  width: 18%;
}

.pe-stade-info-table--marketing thead th:nth-child(2),
.pe-stade-info-table--marketing thead th:nth-child(3) {
  text-align: right;
}

.pe-stade-info-legend {
  margin: 8px 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.pe-stade-info-table--infirmerie thead th:nth-child(1),
.pe-stade-info-table--infirmerie tbody td:nth-child(1) {
  width: 48%;
}

.pe-stade-info-table--infirmerie thead th:nth-child(2),
.pe-stade-info-table--infirmerie tbody td:nth-child(2) {
  width: 11%;
}

.pe-stade-info-table--infirmerie thead th:nth-child(3),
.pe-stade-info-table--infirmerie tbody td:nth-child(3) {
  width: 41%;
}

.pe-stade-info-table--infirmerie thead th:nth-child(2),
.pe-stade-info-table--infirmerie thead th:nth-child(3) {
  text-align: right;
}

.pe-stade-info-table--infirmerie .pe-stade-info-reduction {
  font-size: 0.72rem;
  letter-spacing: -0.02em;
}

.pe-stade-info-table--centre thead th:nth-child(1),
.pe-stade-info-table--centre tbody td:nth-child(1) {
  width: 34%;
}

.pe-stade-info-table--centre thead th:nth-child(2),
.pe-stade-info-table--centre tbody td:nth-child(2) {
  width: 10%;
}

.pe-stade-info-table--centre thead th:nth-child(3),
.pe-stade-info-table--centre tbody td:nth-child(3) {
  width: 28%;
}

.pe-stade-info-table--centre thead th:nth-child(4),
.pe-stade-info-table--centre tbody td:nth-child(4) {
  width: 28%;
}

.pe-stade-info-table--centre thead th:nth-child(2),
.pe-stade-info-table--centre thead th:nth-child(3),
.pe-stade-info-table--centre thead th:nth-child(4) {
  text-align: right;
}

.pe-stade-info-table--centre .pe-stade-info-combo {
  font-size: 0.68rem;
  letter-spacing: -0.03em;
}

/* Académie — 6 colonnes compactes : Niv. | P | Pl. | N | I | E */
.pe-stade-info-table--academie thead th {
  padding: 7px 3px;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
}

.pe-stade-info-table--academie thead th:nth-child(1),
.pe-stade-info-table--academie tbody td:nth-child(1) {
  width: 28%;
}

.pe-stade-info-table--academie thead th:nth-child(2),
.pe-stade-info-table--academie tbody td:nth-child(2) {
  width: 9%;
}

.pe-stade-info-table--academie thead th:nth-child(3),
.pe-stade-info-table--academie tbody td:nth-child(3) {
  width: 9%;
}

.pe-stade-info-table--academie thead th:nth-child(4),
.pe-stade-info-table--academie tbody td:nth-child(4) {
  width: 18%;
}

.pe-stade-info-table--academie thead th:nth-child(5),
.pe-stade-info-table--academie tbody td:nth-child(5) {
  width: 18%;
}

.pe-stade-info-table--academie thead th:nth-child(6),
.pe-stade-info-table--academie tbody td:nth-child(6) {
  width: 18%;
}

.pe-stade-info-table--academie thead th:nth-child(2),
.pe-stade-info-table--academie thead th:nth-child(3),
.pe-stade-info-table--academie thead th:nth-child(4),
.pe-stade-info-table--academie thead th:nth-child(5),
.pe-stade-info-table--academie thead th:nth-child(6) {
  text-align: right;
}

.pe-stade-info-table--academie tbody td {
  padding: 7px 3px;
}

.pe-stade-info-table--academie .pe-stade-info-niveau-num {
  font-size: 0.68rem;
}

.pe-stade-info-table--academie .pe-stade-info-capacite {
  font-size: 0.66rem;
}

.pe-stade-info-table--academie .pe-stade-info-combo {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.pe-stade-info-table--academie .pe-stade-info-badge-actuel {
  padding: 1px 3px;
  font-size: 0.46rem;
}

/* Boutique — 3 colonnes : Niveau | Bénéfice | Caisse */
.pe-stade-info-table--boutique thead th:nth-child(1),
.pe-stade-info-table--boutique tbody td:nth-child(1) {
  width: 40%;
}

.pe-stade-info-table--boutique thead th:nth-child(2),
.pe-stade-info-table--boutique tbody td:nth-child(2) {
  width: 30%;
}

.pe-stade-info-table--boutique thead th:nth-child(3),
.pe-stade-info-table--boutique tbody td:nth-child(3) {
  width: 30%;
}

.pe-stade-info-table--boutique thead th:nth-child(2),
.pe-stade-info-table--boutique thead th:nth-child(3) {
  text-align: right;
}

.pe-stade-info-table--boutique-exemple thead th:nth-child(1),
.pe-stade-info-table--boutique-exemple tbody td:nth-child(1) {
  width: 34%;
}

.pe-stade-info-table--boutique-exemple thead th:nth-child(2),
.pe-stade-info-table--boutique-exemple tbody td:nth-child(2),
.pe-stade-info-table--boutique-exemple thead th:nth-child(3),
.pe-stade-info-table--boutique-exemple tbody td:nth-child(3),
.pe-stade-info-table--boutique-exemple thead th:nth-child(4),
.pe-stade-info-table--boutique-exemple tbody td:nth-child(4) {
  width: 22%;
  text-align: right;
}

.pe-stade-info-exemple {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.pe-stade-info-exemple-titre {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--m-text, #e2e8f0);
}

.pe-stade-info-row td {
  padding: 8px 5px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  vertical-align: middle;
}

.pe-stade-info-row:last-child td {
  border-bottom: none;
}

.pe-stade-info-niveau {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  max-width: none;
}

.pe-stade-info-niveau-num {
  font-size: 0.74rem;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
}

.pe-stade-info-capacite {
  text-align: right;
  font-size: 0.74rem;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
}

.pe-stade-info-badge-actuel,
.pe-stade-info-badge-supreme {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  padding: 2px 4px;
  border-radius: 999px;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.2;
}

.pe-stade-info-badge-actuel {
  color: #0b1220;
  background: linear-gradient(90deg, #facc15, #f59e0b);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.35);
}

.pe-stade-info-badge-supreme {
  color: #fde68a;
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.12);
}

.pe-stade-info-row.is-actuel {
  background:
    linear-gradient(90deg, rgba(250, 204, 21, 0.16), rgba(15, 23, 42, 0.35));
  box-shadow: inset 3px 0 0 #facc15;
  animation: pe-stade-info-pulse 1.8s ease-in-out infinite;
}

.pe-stade-info-row.is-actuel .pe-stade-info-niveau-num,
.pe-stade-info-row.is-actuel .pe-stade-info-capacite {
  color: #fde68a;
}

.pe-stade-info-row.is-final {
  background:
    radial-gradient(80% 120% at 100% 50%, rgba(250, 204, 21, 0.12), transparent 55%),
    rgba(15, 23, 42, 0.35);
  border-top: 1px solid rgba(250, 204, 21, 0.18);
}

.pe-stade-info-row.is-final .pe-stade-info-capacite {
  color: #facc15;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.28);
}

.pe-stade-info-row.is-actuel.is-final {
  background:
    linear-gradient(90deg, rgba(250, 204, 21, 0.22), rgba(15, 23, 42, 0.4)),
    radial-gradient(80% 120% at 100% 50%, rgba(250, 204, 21, 0.14), transparent 55%);
}

@keyframes pe-stade-info-pulse {
  0%, 100% { box-shadow: inset 3px 0 0 #facc15, 0 0 0 rgba(250, 204, 21, 0); }
  50% { box-shadow: inset 3px 0 0 #fde68a, 0 0 14px rgba(250, 204, 21, 0.12); }
}

@media (prefers-reduced-motion: reduce) {
  .pe-stade-info-panel,
  .pe-stade-info-row.is-actuel {
    animation: none;
  }
}

