/* Scoped styling - påvirker kun .rt-stilling */
.rt-stilling{
  --rt-gold:#9a7e10;
  --rt-gold-2:rgba(154,126,16,.55);
  --rt-bg:#070708;
  --rt-card:#0f0f12;
  --rt-card2:#0b0b0e;
  --rt-text:#ffffff;
  --rt-muted:rgba(255,255,255,.70);
  --rt-muted2:rgba(255,255,255,.55);
  color:var(--rt-text);
  font-family:inherit;
}

.rt-stilling *{box-sizing:border-box;}

.rt-stilling__head{margin:8px 0 14px; text-align:center;}
.rt-stilling__title{margin:0; color:var(--rt-gold); font-weight:900; letter-spacing:.6px;}
.rt-stilling__subtitle{margin:6px 0 0; color:var(--rt-muted); font-size:14px;}

.rt-stilling__controls{
  background:linear-gradient(180deg, rgba(154,126,16,.15), rgba(0,0,0,0));
  border:1px solid rgba(154,126,16,.35);
  border-radius:14px;
  padding:14px;
  display:flex;
  gap:12px;
  align-items:flex-end;
  flex-wrap:nowrap;
  margin-bottom:18px;
}

.rt-stilling__control{min-width:0; flex:1; display:flex; flex-direction:column; gap:6px;}
.rt-stilling__control--grow{flex:2; min-width:0;}

.rt-stilling__label{color:var(--rt-gold); font-weight:700; font-size:13px;}

.rt-stilling__select,
.rt-stilling__input{
  width:100%;
  background:#000 !important;
  color:var(--rt-text) !important;
  border:1px solid rgba(154,126,16,.5) !important;
  border-radius:10px;
  padding:10px 12px;
  outline:none;
}

.rt-stilling__select{color:var(--rt-gold) !important;}
.rt-stilling__select option{background:#000; color:var(--rt-gold);} 
.rt-stilling__input::placeholder{color:rgba(255,255,255,.5);}

.rt-stilling__content{
  display:grid;
  grid-template-columns:1fr;
  gap:16px;
}

.rt-stilling__division{min-width:0;}

.rt-stilling__card{
  background:radial-gradient(120% 120% at 50% 20%, rgba(154,126,16,.14), rgba(0,0,0,0)) ,
             linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,0));
  border:1px solid rgba(154,126,16,.35);
  border-radius:18px;
  padding:14px;
  box-shadow:0 12px 35px rgba(0,0,0,.45);
}

.rt-stilling__cardhead{display:flex; gap:10px; align-items:flex-start; padding-bottom:10px; border-bottom:1px solid rgba(154,126,16,.25); margin-bottom:12px;}
.rt-stilling__badge{width:34px; height:34px; border-radius:10px; display:grid; place-items:center; border:1px solid rgba(154,126,16,.55); color:var(--rt-gold); font-weight:900;}
.rt-stilling__divisiontitle{color:var(--rt-gold); font-weight:900; line-height:1.1;}
.rt-stilling__divisionmeta{color:var(--rt-muted2); font-size:12px; margin-top:2px;}

.rt-stilling__tablewrap{
  border-radius:12px;
  overflow:auto;
  border:1px solid rgba(154,126,16,.22);
  -webkit-overflow-scrolling:touch;
}

.rt-stilling__table{width:100%; border-collapse:separate; border-spacing:0; min-width:660px;}

.rt-stilling__th,
.rt-stilling__td{padding:10px 10px; font-size:13px; white-space:nowrap;}

.rt-stilling__th{color:var(--rt-gold); font-weight:800; font-size:12px; text-align:left; background:rgba(154,126,16,.10); position:sticky; top:0; z-index:1;}

.rt-stilling__th--pos,
.rt-stilling__td--pos{width:48px; text-align:right;}
.rt-stilling__th--team,
.rt-stilling__td--team{min-width:230px;}
.rt-stilling__th--legs,
.rt-stilling__td--legs{min-width:90px; text-align:right;}
.rt-stilling__th--diff,
.rt-stilling__td--diff{min-width:70px; text-align:right;}
.rt-stilling__th--pts,
.rt-stilling__td--pts{min-width:70px; text-align:right; font-weight:900; color:var(--rt-gold);}

.rt-stilling__tr{background:rgba(0,0,0,.0);}
.rt-stilling__tr:nth-child(odd){background:rgba(255,255,255,.03);} 
.rt-stilling__tr:nth-child(even){background:rgba(0,0,0,.18);} 

.rt-stilling__td{color:var(--rt-text); border-top:1px solid rgba(154,126,16,.14);}
.rt-stilling__tr:first-child .rt-stilling__td{border-top:none;}

.rt-stilling__teamname{font-weight:700;}

.rt-stilling__flag{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  margin-right:8px;
  border-radius:7px;
  border:1px solid rgba(154,126,16,.55);
  color:var(--rt-gold);
  font-weight:900;
  font-size:12px;
  line-height:1;
}
.rt-stilling__flag--down{
  border-color:rgba(255,255,255,.25);
  color:rgba(255,255,255,.85);
}

.rt-stilling__tr--promoted .rt-stilling__teamname{color:var(--rt-gold);}
.rt-stilling__tr--relegated .rt-stilling__teamname{color:rgba(255,255,255,.90);}

.rt-stilling__tr--highlight{
  background:rgba(154,126,16,.12) !important;
}
.rt-stilling__tr--highlight .rt-stilling__teamname{color:var(--rt-gold);}

.rt-stilling__td--empty{color:var(--rt-muted); text-align:center; padding:14px 10px;}

.rt-stilling__muted{color:var(--rt-muted); padding:10px 2px;}

.rt-stilling__footnote{margin-top:14px; color:var(--rt-muted2); font-size:12px;}

/* Keyboard focus */
.rt-stilling__select:focus,
.rt-stilling__input:focus,
.rt-stilling__tablewrap:focus{box-shadow:0 0 0 3px rgba(154,126,16,.20);}


/* Når kun én række/division vises, så skal kortet fylde hele bredden og sidde centreret */
.rt-stilling--single .rt-stilling__division{
  grid-column: 1 / -1;
  width: 100%;
  max-width: 1100px;
  justify-self: center;
}

/* Responsive */
@media (max-width: 980px){
  .rt-stilling__controls{flex-wrap:wrap;}
  .rt-stilling__content{grid-template-columns:1fr;}
}

@media (max-width: 520px){
  .rt-stilling__title{font-size:28px;}
  .rt-stilling__subtitle{font-size:13px;}
}

/*
 * Hard override (best practice)
 *
 * Nogle temaer/Elementor tilføjer "responsive table"-styles (fx table-layout:fixed,
 * word-break/overflow-wrap) som kan få "Hold"-kolonnen til at kollapse og bryde
 * navne bogstav-for-bogstav.
 *
 * Vi tvinger derfor et stabilt tabel-layout inde i .rt-stilling – uden at påvirke
 * andre tabeller på sitet.
 */
.rt-stilling .rt-stilling__tablewrap{
  overflow-x:auto !important;
  overflow-y:auto !important;
  max-width:100%;
}

.rt-stilling .rt-stilling__table{
  min-width:660px !important;
  width:100% !important;
  table-layout:auto !important;
}

.rt-stilling .rt-stilling__table th,
.rt-stilling .rt-stilling__table td{
  white-space:nowrap !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  writing-mode:horizontal-tb !important;
  text-orientation:mixed !important;
}

.rt-stilling .rt-stilling__td--team,
.rt-stilling .rt-stilling__th--team{
  min-width:230px !important;
}
