/* ========================================
   Match Detail Page — Full match information
   ======================================== */

.match-detail {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ========================================
   Match Card Detail — Main header section
   ======================================== */
.match-card-detail {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Header: Teams + Score/Time */
.match-card-detail > .match-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  border-bottom: 1px solid var(--border);
}

.match-card-detail > .match-header > .team {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.match-card-detail > .match-header > .team.away-team {
  flex-direction: row;
  justify-content: flex-end;
  text-align: right;
  gap: 1rem;
}

.match-card-detail > .match-header > .team > .flag-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.match-card-detail > .match-header > .team > .team-info {
  flex: 1;
  min-width: 0;
}

.match-card-detail > .match-header > .team > .team-info > .team-name {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--text-1);
}

.match-card-detail > .match-header > .team > .team-info > .team-code {
  font-size: 0.875rem;
  color: var(--text-3);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Match status section */
.match-card-detail > .match-header > .match-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.match-card-detail > .match-header > .match-status > .result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.match-card-detail > .match-header > .match-status > .result > .score {
  font-family: var(--font-scoreboard);
  font-size: 4.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.9;
  min-width: 1.5em;
  text-align: center;
  color: var(--fg);
}

.match-card-detail > .match-header > .match-status > .result > .separator {
  font-family: var(--font-scoreboard);
  font-size: 3rem;
  color: var(--fg-3);
}

.match-card-detail > .match-header > .match-status > .time-info {
  text-align: center;
}

.match-card-detail > .match-header > .match-status > .time-info > .scheduled {
  font-size: 0.9375rem;
  color: var(--text-3);
  margin: 0;
}

.match-card-detail > .match-header > .match-status > .time-info > .hour {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-1);
}

/* Status badges */
.match-card-detail > .match-header > .match-status > .state {
  display: inline-block;
  padding: 0.375rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.match-card-detail > .match-header > .match-status > .state.-finished {
  background: var(--green-dim);
  color: var(--green);
}

.match-card-detail > .match-header > .match-status > .state.-scheduled {
  background: var(--blue-dim);
  color: var(--blue);
}

.match-card-detail > .match-header > .match-status > .state.-live {
  background: var(--red-dim);
  color: var(--red);
}

/* ========================================
   Match Info Grid — Details section
   ======================================== */
.match-card-detail > .match-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 2rem;
  background: var(--bg-raised);
}

.match-card-detail > .match-info-grid > .info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.match-card-detail > .match-info-grid > .info-item > label {
  font-size: 0.8125rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.match-card-detail > .match-info-grid > .info-item > p {
  font-size: 1rem;
  color: var(--text-1);
  margin: 0;
  font-weight: 500;
}

/* ========================================
   Predictions Summary — Community stats
   ======================================== */
.predictions-summary {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.predictions-summary > h2 {
  font-size: 1.25rem;
  margin: 0 0 1.5rem 0;
  color: var(--text-1);
  font-weight: 700;
}

.predictions-summary > .predictions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.predictions-summary > .predictions-grid > .prediction-item {
  background: var(--bg-raised);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.predictions-summary > .predictions-grid > .prediction-item > .prediction-bar {
  height: 10px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.predictions-summary > .predictions-grid > .prediction-item > .prediction-bar > .bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.predictions-summary > .predictions-grid > .prediction-item > .prediction-bar > .bar-fill.home-win {
  background: var(--green);
}

.predictions-summary > .predictions-grid > .prediction-item > .prediction-bar > .bar-fill.draw {
  background: var(--gold);
}

.predictions-summary > .predictions-grid > .prediction-item > .prediction-bar > .bar-fill.away-win {
  background: var(--red);
}

.predictions-summary > .predictions-grid > .prediction-item > .prediction-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-size: 0.9375rem;
}

.predictions-summary > .predictions-grid > .prediction-item > .prediction-label > .flag-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.predictions-summary > .predictions-grid > .prediction-item > .prediction-label > .marker {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gold-dim);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.predictions-summary > .predictions-grid > .prediction-item > .prediction-label > .team {
  flex: 1;
  color: var(--text-1);
  font-weight: 600;
}

.predictions-summary > .predictions-grid > .prediction-item > .prediction-label > .count {
  color: var(--text-3);
  font-size: 0.8125rem;
}

.predictions-summary > .predictions-info {
  text-align: center;
  color: var(--text-3);
  margin: 0;
  font-size: 0.8125rem;
}

/* ========================================
   Actions Section — CTA buttons
   ======================================== */
.match-detail > .actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.match-detail > .actions > a {
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 150ms ease;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.match-detail > .actions > a.btn-primary {
  background: var(--blue);
  color: white;
}

.match-detail > .actions > a.btn-primary:hover {
  background: var(--green);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
  .match-detail {
    gap: 1.5rem;
  }

  .match-card-detail > .match-header {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.5rem;
  }

  .match-card-detail > .match-header > .team {
    flex-direction: column;
    text-align: center;
  }

  .match-card-detail > .match-header > .team.away-team {
    flex-direction: column;
    text-align: center;
  }

  .match-card-detail > .match-header > .team > .flag {
    font-size: 2.5rem;
  }

  .match-card-detail > .match-header > .team > .team-info > .team-name {
    font-size: 1.125rem;
  }

  .match-card-detail > .match-header > .match-status > .result > .score {
    font-size: 2rem;
  }

  .match-card-detail > .match-info-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 1.5rem;
  }

  .predictions-summary > .predictions-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .match-card-detail > .match-info-grid {
    grid-template-columns: 1fr;
  }

  .match-card-detail > .match-header > .team > .team-info > .team-name {
    font-size: 1rem;
  }

  .predictions-summary {
    padding: 1.5rem;
  }

  .match-detail > .actions {
    flex-direction: column;
  }

  .match-detail > .actions > a {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   My Pick — user's prediction section
   ======================================== */
.my-pick {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--green);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 0 0 1px var(--green-dim);
}

.my-pick > .pick-result {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
}

.my-pick > .pick-result > .pick-label {
  font-size: 0.8125rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.my-pick > .pick-result > .pick-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
}

.my-pick > .pick-result > .pick-score {
  font-size: 0.875rem;
  color: var(--text-2);
  background: var(--bg-raised);
  padding: 0.125rem 0.625rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

.my-pick > .pick-change {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 150ms, color 150ms;
  flex-shrink: 0;
}

.my-pick > .pick-change:hover {
  border-color: var(--green);
  color: var(--green);
}

.my-pick > .pick-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--green);
  color: var(--text-inv);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 150ms;
}

.my-pick > .pick-cta:hover {
  background: var(--green-hover);
}

@media (max-width: 480px) {
  .my-pick {
    flex-direction: column;
    align-items: stretch;
    gap: 0.875rem;
  }

  .my-pick > .pick-change,
  .my-pick > .pick-cta {
    justify-content: center;
  }
}
