/* =========================
   PRE GAME – BAKGRUND
========================= */
/* Bakgrundsbild */
.pre-game-page::before{
  content: "";
  position: fixed;
  inset: 0;
  background: url("/static/img/live_thl-bg.png") center / cover no-repeat;
  opacity: 0.75;
  z-index: -2;
  pointer-events: none;
}

/* Vit overlay för läsbarhet */
.pre-game-page::after{
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.50);
  z-index: -1;
  pointer-events: none;
}

/* Allt innehåll ovanpå */
.pre-game-page > *{
  position: relative;
  z-index: 2;
}

/* =========================
   PRE GAME – LAYOUT
========================= */
/* Säkerställ inga default-marginaler */
html, body{
  height: 100%;
  margin: 0;
}

.pre-game-page{
  position: relative;
  min-height: 100%;
  padding: 40px 20px;
  box-sizing: border-box;
}


/* TOP CARD */
.pm-card{
  background: rgba(255,255,255,0.92);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.12);
  padding: 18px 20px;
  box-sizing: border-box;
}

/* =========================
   CENTER RUBRIKER & TEXT
========================= */

.pm-card h3 {
  text-align: center;
}

.pm-title,
.pm-title--small {
  text-align: center;
}

.pm-topcard{
  max-width: 1300px;
  margin: 0 auto 18px auto;
}

.pm-title {
  margin-bottom: 10px;
}

.pm-title--small {
  margin-top: 16px;
  margin-bottom: 8px;
}

.pm-topgrid{
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  align-items: center;
  gap: 18px;
}

.pm-team{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.pm-logo{
  width: 200px;
  height: 120px;
  object-fit: contain;
}

.pm-teamname{
  font-weight: 700;
  font-size: 24px;
}

.pm-center{
  text-align: center;
}

.pm-title{
  font-size: 34px;
  font-weight: 800;
}

.pm-title--small{
  font-size: 24px;
  font-weight: 800;
}

.pm-sub{
  margin-top: 6px;
}

.pm-pill{
  display: inline-block;
  padding: 6px 10px;
  margin: 0 6px 6px 0;
  border-radius: 999px;
  background: #f1f1f1;
  font-size: 12px;
  font-weight: 600;
}

#headToHeadGrid {
  text-align: center;
}

/* =========================
   THREE CARDS ROW
========================= */
.pm-three{
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}

/* =========================
  TABLES - LINEUP 
=========================  */
.pm-table thead th{
  text-align: left;
  font-weight: 800;
  padding: 8px 6px;
  border-bottom: 1px solid #e6e6e6;
}

.pm-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 18px;
}

.pm-table tbody td{
  padding: 8px 6px;
  border-bottom: 1px solid #efefef;
  text-align: left;
}

.pm-muted{
  opacity: 0.75;
  font-weight: 100;
  font-size: 12px;
  text-align: center;
}

/* =========================
   KEY STATS BOX
========================= */
.ps-grid{
  display: grid;
  grid-template-columns: 1fr; /* en box per lag, staplade */
  gap: 12px;
}

.ps-box{
  background: #f5f5f5;
  border: 1px solid #e9e9e9;
  border-radius: 12px;
  padding: 14px 14px;
  font-size: 16px;
  line-height: 1.45;
}

.ps-box strong{
  font-weight: 800;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1100px){
  .pm-topgrid{
    grid-template-columns: 1fr;
  }
  .pm-three{
    grid-template-columns: 1fr;
  }
  .pm-logo{
    width: 80px;
    height: 80px;
  }
  .pm-title{
    font-size: 30px;
  }
}
/* =========================
   HEAD TO HEAD – MINI STAPLAR
========================= */
.h2h-bars-box{
  text-align: left;
}

.h2h-total{
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}
.h2h-total span{
  font-size: 16px;
  font-weight: 600;
  opacity: .7;
}

/* Legend */
.h2h-legend{
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 400;
  color: #444;
}
.h2h-legend span{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.h2h-legend i{
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
}

/* En lagrad: namn / stapel / V-O-F */
.h2h-row{
  display: grid;
  grid-template-columns: 1fr 2.5fr 1fr;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}

.h2h-row-name{
  font-weight: 400;
  font-size: 16px;
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.h2h-bar{
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: #eeeeee;
}

.h2h-seg{
  display: block;
  height: 100%;
}

.h2h-row-rec{
  font-weight: 400;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

/* Nyckeltal */
.h2h-statrow{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  font-size: 16px;
  padding: 2px 0;
}
.h2h-stat-left{ text-align: left; font-weight: 400; }
.h2h-stat-right{ text-align: right; font-weight: 400; }
.h2h-stat-label{
  opacity: .7;
  font-weight: 700;
  font-size: 14px;
}

/* Senaste 5 möten */
.h2h-last-title{
  text-align: center;
  font-weight: 800;
  margin-bottom: 8px;
}
.h2h-last-row{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.h2h-pill{
  padding: 6px 12px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}