/* ============================================================
   match_details.css — conversion Tailwind → CSS pur
   ============================================================ */

.md-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.md-header-section {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.md-header-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.md-meta {
  color: #9ca3af;
  font-size: 0.75rem;
  text-align: center;
  margin: 0 0 1rem 0;
}
@media (min-width: 640px) {
  .md-meta { font-size: 0.875rem; }
}
.md-meta__link {
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.md-meta__link:hover { color: #60a5fa; }

.neutral-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.03em;
  padding: 2px 7px 2px 4px; border-radius: 99px;
  background: rgba(100, 180, 255, 0.15); color: #7ec8f7;
  border: 1px solid rgba(100, 180, 255, 0.3);
  vertical-align: middle; margin-left: 6px;
}
.neutral-badge__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: #7ec8f7; color: #0a1628;
  font-size: 0.65rem; font-weight: 700; flex-shrink: 0;
}
.mirror-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.03em;
  padding: 2px 7px 2px 5px; border-radius: 99px;
  background: rgba(255, 190, 100, 0.15); color: #ffc86a;
  border: 1px solid rgba(255, 190, 100, 0.3);
  vertical-align: middle; margin-left: 6px;
}
.mirror-badge__icon { font-size: 0.8rem; }

#header-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}
@media (min-width: 1024px) {
  #header-main-grid {
    grid-template-columns: 60% 40%;
  }
}

/* ── Mode sans panel droit (ex: International Friendlies) ── */
#header-main-grid.no-right-panel {
  display: flex;
  justify-content: center;
}

#header-main-grid.no-right-panel #header-left {
  max-width: 900px;
  width: 100%;
}

#header-main-grid.no-right-panel #header-right {
  display: none;
}

#header-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  min-height: 0;
}

.md-score-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}
.md-score-grid > * { min-width: 0; }
@media (min-width: 640px) {
  .md-score-grid { gap: 1rem; }
}

.md-team-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.md-team-logo {
  width: clamp(3rem, 16vw, 5rem);
  height: clamp(3rem, 16vw, 5rem);
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
@media (min-width: 640px) {
  .md-team-logo { width: 6rem; height: 6rem; }
}
.md-team-link:hover .md-team-logo { transform: scale(1.05); }

.md-team-name {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #60a5fa;
  text-align: center;
  word-break: break-word;
  max-width: 100%;
}
@media (min-width: 640px) {
  .md-team-name { font-size: 0.875rem; }
}

.md-team-elo {
  font-size: 0.75rem;
  color: #9ca3af;
  margin: 0;
}

.md-carousel {
  margin-top: 0.5rem;
  max-width: 100%;
  overflow: hidden;
}

.md-score {
  font-size: 1.875rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  padding: 0 0.5rem;
  flex-shrink: 0;
}
@media (min-width: 640px) {
  .md-score { font-size: 2.25rem; padding: 0 1rem; }
}

.md-bars {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.md-bar-label {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 0.25rem;
  text-align: center;
}

#header-right {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}

.md-full-w        { width: 100%; }
.md-overflow-hidden { overflow: hidden; }

.advanced-tabs.md-tabs-centered {
  justify-content: center;
}

.md-tab-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.md-similar-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: stretch;
}
@media (min-width: 1024px) {
  .md-similar-grid { grid-template-columns: 1fr 1fr; }
}
.md-similar-grid > div {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.md-panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: #93c5fd;
  text-align: center;
  margin-bottom: 0.5rem;
}

.md-prose-wrap {
  padding: 1.5rem 1rem 2rem;
  max-width: 48rem;
  margin: 0 auto;
}

.md-tabs-wrap {
  border-radius: 0.75rem;
  margin-top: 0.5rem;
}

.md-stats-unavailable {
  padding: 5rem 0;
  text-align: center;
  color: #6b7280;
}

.md-betting-stats {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.md-score-tile {
  border-radius: 0.5rem;
  padding: 0.75rem;
  text-align: center;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.md-score-tile__score { font-size: 1.25rem; color: #fff; }
.md-score-tile__pct   { font-size: 0.875rem; color: #e5e7eb; }

.md-score-tile--clickable {
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.md-score-tile--clickable:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.md-score-extra {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 0.5rem;
}

/* ── Score tile : Close variant ── */
.md-score-tile--close {
  background-color: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #9ca3af;
}
.md-score-tile--close .md-score-tile__score {
  font-size: 1.1rem;
  color: #9ca3af;
}
.md-score-tile--close .md-score-tile__pct {
  color: #6b7280;
}
.md-score-tile--close:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #e5e7eb;
}
.md-score-tile--close:hover .md-score-tile__score,
.md-score-tile--close:hover .md-score-tile__pct {
  color: #e5e7eb;
}

.md-stats-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.md-standings-table {
  width: 100%;
  font-size: 0.75rem;
}

/* ============================================================
   Règles originales (inchangées visuellement)
   ============================================================ */

.team-bar, .opp-bar {
  height: var(--bar-h);
  transform: scaleX(0);
  transition: transform 1s ease-in-out, background-color 1s ease-in-out;
}
.team-bar { transform-origin: right center; }
.opp-bar  { transform-origin: left center; }

[id^="pct"][id*="team"],
[id^="pct"][id*="opp"] { color: #fff; font-weight: 600; }

#header-main-grid { align-items: stretch; }

/* ── Shared Panels Styles : Hauteur fixe et contrainte ── */
#neighbors-panel,
#top-scores {
  height: 300px; /* Force la hauteur */
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.02);
  padding: 0.75rem;
  margin: 0;
  overflow: hidden;
}

/* ── Neighbors Panel Spécifique ── */
#neighbors-panel {
  display: flex;
  flex-direction: column;
}

#neighbors-panel .neighbors-row {
  padding: 0.5rem 0.25rem;
}

/* Le panel injecté reste à 300px */
#neighbors-panel.neighbors-panel {
  display: flex;
  flex-direction: column;
  margin-top: 0 !important;
}

/* Le wrapper interne doit s'étendre (écrase le max-height:200px natif) */
#neighbors-panel .neighbors-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none !important;
  display: flex;
  flex-direction: column;
}

/* La liste scrolle dans l'espace restant */
#neighbors-panel .neighbors-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* ── Top Scores Spécifique ── */
#top-scores {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 1rem;
}

#match-standings-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.standings-scroll {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  border-radius: 1rem;
}

.analysis-prose {
  color: #d1d5db;
  font-size: 0.95rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
  text-align: justify;
}
.analysis-prose p              { margin-block-end: 1.25rem; }
.analysis-prose p:last-of-type { margin-block-end: 0; }
.analysis-prose p:first-child  { text-align: center; font-size: 1.15rem; }
.analysis-disclaimer {
  margin-block-start: 2rem;
  font-size: 0.72rem;
  color: #4b5563;
  text-align: end;
  letter-spacing: 0.03em;
  font-style: italic;
}
@media (min-width: 640px) { .analysis-prose { font-size: 1rem; } }

.tabs {
  display: flex;
  justify-content: flex-start;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs > * { flex: 0 0 auto; }
@media (min-width: 640px) { .tabs { justify-content: center; } }

.tabs-wrap {
  top: calc(var(--header-h) + var(--pagenav-h));
  background:none;
  border: none;
}

/* ── Shared pill style with .radar-chip (feature-radar.css) ─────── */
.tab-btn {
  white-space:    nowrap;
  padding:        0.35rem 0.75rem;
  border-radius:  999px;
  border:         1px solid rgba(255, 255, 255, 0.15);
  background:     rgba(255, 255, 255, 0.05);
  color:          rgba(255, 255, 255, 0.55);
  font-size:      0.82rem;
  font-weight:    500;
  letter-spacing: 0.03em;
  cursor:         pointer;
  font-family:    inherit;
  transition:     background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.tab-btn:hover {
  background:   rgba(255, 255, 255, 0.1);
  color:        rgba(255, 255, 255, 0.85);
}

.tab-btn[aria-selected="true"] {
  background:   rgba(144, 255, 0, 0.12);
  border-color: rgba(144, 255, 0, 0.5);
  color:        rgba(144, 255, 0, 0.9);
  box-shadow:   0 0 8px rgba(144, 255, 0, 0.2);
}

.swiper {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 0.25rem;
}
.slide {
  scroll-snap-align: start;
  flex: 0 0 100%;
  max-width: 100%;
}

.advanced-tabs {
  display: flex;
  justify-content: flex-start;
  border-block-end: 1px solid rgb(255 255 255 / 0.1);
  margin-block-start: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.advanced-tabs::-webkit-scrollbar { display: none; }

.tab-item {
  padding: 1rem;
  flex: 0 0 auto;
  scroll-snap-align: start;
  white-space: nowrap;
  color: #9ca3af;
  cursor: pointer;
  font-weight: 600;
  border: none;
  border-block-end: 3px solid transparent;
  background: transparent;
  transition: color 0.2s, border-color 0.2s;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: inherit;
}
.tab-item:hover { color: #fff; }
.tab-item:focus-visible {
  outline: 2px solid #34d399;
  outline-offset: -2px;
  border-radius: 4px;
}
.tab-item.active {
  color: #34d399;
  border-block-end-color: #34d399;
}
.tab-content.hidden { display: none; }

@media (max-width: 1023px) {
  .md-similar-grid > div { height: auto; flex: none; }
  
  /* Top Scores s'adapte, mais Neighbors Panel reste scotché à 300px */
  #top-scores { height: auto; min-height: unset; max-height: none; }
  
  #header-right, #match-standings-container, .standings-scroll {
    flex: none; height: auto; min-height: 150px;
  }
  .md-similar-grid { row-gap: 2rem; }
}

@media (max-width: 640px) {
  .tab-item { font-size: 0.8rem; padding: 0.75rem; }
}

#match-standings-container[hidden],
#mini-knockout-container[hidden] { display: none !important; }

/* ============================================================
   LIGHT THEME OVERRIDES — match_details.css
   ============================================================ */

/* ── Meta ── */
[data-theme="light"] .md-meta { color: var(--lt-text-2); }
[data-theme="light"] .md-meta__link:hover { color: var(--color-blue); }

/* ── Team name & elo ── */
[data-theme="light"] .md-team-name { color: var(--lt-text); }
[data-theme="light"] .md-team-elo  { color: var(--lt-text-2); }

/* ── Score ── */
[data-theme="light"] .md-score { color: var(--lt-text); }

/* ── Bar label ── */
[data-theme="light"] .md-bar-label { color: var(--lt-text-2); }

/* ── Panel title ── */
[data-theme="light"] .md-panel-title { color: var(--lt-text); }

/* ── Neighbors / top-scores panels ── */
[data-theme="light"] #neighbors-panel,
[data-theme="light"] #top-scores {
  background: rgba(255, 255, 255, 0.35);
}

/* ── Analysis prose ── */
[data-theme="light"] .analysis-prose {
  color: var(--lt-text-soft);
}
[data-theme="light"] .analysis-disclaimer {
  color: var(--lt-text-3);
}

/* ── Tabs ── */
[data-theme="light"] .tabs-wrap {
  background: rgba(255, 255, 255, 0.25);
}
[data-theme="light"] .tab-btn {
  background:   rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.18);
  color:        rgba(0, 0, 0, 0.55);
}

[data-theme="light"] .tab-btn:hover {
  background:   rgba(0, 0, 0, 0.08);
  color:        rgba(0, 0, 0, 0.85);
}

[data-theme="light"] .tab-btn[aria-selected="true"] {
  background:   rgba(22, 101, 52, 0.12);
  border-color: rgba(22, 101, 52, 0.5);
  color:        rgba(22, 101, 52, 0.9);
  box-shadow:   0 0 8px rgba(22, 101, 52, 0.15);
}
[data-theme="light"] .advanced-tabs {
  border-bottom-color: var(--lt-border);
}
[data-theme="light"] .tab-item {
  color: var(--lt-text-2);
}
[data-theme="light"] .tab-item:hover { color: var(--lt-text); }
[data-theme="light"] .tab-item.active {
  color: var(--color-blue);
  border-block-end-color: var(--color-blue);
}
[data-theme="light"] .tab-item:focus-visible {
  outline-color: var(--color-blue);
}

/* ── Stats unavailable ── */
[data-theme="light"] .md-stats-unavailable { color: var(--lt-text-3); }

/* ── Score tile ── */
[data-theme="light"] .md-score-tile__score { color: var(--lt-text); }
[data-theme="light"] .md-score-tile__pct   { color: var(--lt-text-2); }

[data-theme="light"] .md-score-tile--close {
  background-color: rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(0, 0, 0, 0.15);
}
[data-theme="light"] .md-score-tile--close .md-score-tile__score,
[data-theme="light"] .md-score-tile--close .md-score-tile__pct {
  color: var(--lt-text-2);
}