:root{
  --bg:#0b0f14;
  --panel:#111824;
  --panel2:#0f1620;
  --line:#1c2a3b;
  --text:#e8eef6;
  --muted:#9fb0c3;

  --wec-red:#e10600;
  --hc:#d6b55b;     /* Hypercar */
  --gt3:#32d583;    /* GT3 */
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius:16px;
  --max:1100px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(1200px 700px at 20% -10%, rgba(225,6,0,.18), transparent 55%),
              radial-gradient(900px 600px at 100% 0%, rgba(214,181,91,.12), transparent 55%),
              var(--bg);
  color:var(--text);
}

a{color:inherit;text-decoration:none}
.container{max-width:var(--max); margin:0 auto; padding:24px}
.topbar{
  position:sticky; top:0; z-index:50;
  background: rgba(11,15,20,.78);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.nav{
  display:flex; align-items:center; justify-content:space-between;
  gap:16px;
  padding:14px 24px;
  max-width:var(--max);
  margin:0 auto;
}
.brand{
  display:flex; align-items:center; gap:10px;
  letter-spacing:.4px;
}
.brand-badge{
  width:12px; height:12px; border-radius:999px;
  background: linear-gradient(135deg, var(--wec-red), #ff4d4d);
  box-shadow: 0 0 0 6px rgba(225,6,0,.12);
}
.brand strong{font-weight:800}
.navlinks{display:flex; gap:14px; flex-wrap:wrap; justify-content:flex-end}
.navlinks a{
  padding:8px 10px;
  border-radius:10px;
  color:var(--muted);
  border:1px solid transparent;
}
.navlinks a.active, .navlinks a:hover{
  color:var(--text);
  border-color:rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}

.hero{
  padding:28px 24px 18px;
  max-width:var(--max);
  margin:0 auto;
}
.hero h1{margin:0 0 8px; font-size:34px; letter-spacing:.2px}
.hero p{margin:0; color:var(--muted); line-height:1.4}

.grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:18px;
}
@media (max-width: 940px){
  .grid{grid-template-columns:1fr}
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 35%), var(--panel);
  border:1px solid rgba(255,255,255,.07);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card-header{
  padding:16px 16px 10px;
  border-bottom:1px solid rgba(255,255,255,.06);
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.card-title{font-weight:800; letter-spacing:.2px}
.card-sub{color:var(--muted); font-size:13px}
.card-body{padding:16px}

.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color:var(--muted);
  font-size:12px;
}
.dot{width:8px;height:8px;border-radius:999px;background:var(--muted)}
.badge.hc .dot{background:var(--hc)}
.badge.gt3 .dot{background:var(--gt3)}

.toolbar{
  display:flex; flex-wrap:wrap; gap:10px; align-items:center;
}
.select, .input{
  background: var(--panel2);
  color:var(--text);
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  padding:10px 12px;
  outline:none;
}
.select{appearance:none}
.btn{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
}
.btn:hover{background: rgba(255,255,255,.07)}
.btn.primary{
  border-color: rgba(225,6,0,.35);
  background: rgba(225,6,0,.15);
}
.btn.primary:hover{background: rgba(225,6,0,.22)}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.07);
  border-radius:14px;
}
.table th, .table td{
  padding:10px 10px;
  border-bottom:1px solid rgba(255,255,255,.06);
  font-size:14px;
}
.table th{
  text-align:left;
  color:var(--muted);
  font-weight:700;
  background: rgba(255,255,255,.03);
}
.table tr:last-child td{border-bottom:none}
.table .pos{
  width:52px; text-align:center; font-weight:900;
}
.table .muted{color:var(--muted)}
.kpi{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:12px;
}
@media (max-width: 640px){
  .kpi{grid-template-columns:1fr}
}
.kpi .item{
  padding:14px;
  border-radius:14px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06);
}
.kpi .item .label{color:var(--muted); font-size:12px}
.kpi .item .value{font-size:20px; font-weight:900; margin-top:6px}

.team-row{
  display:flex; align-items:center; gap:12px;
}
.logo{
  width:34px; height:34px;
  border-radius:10px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
  object-fit:cover;
}
.footer{
  color:var(--muted);
  font-size:12px;
  padding:24px;
  max-width:var(--max);
  margin:0 auto;
  opacity:.9;
}

.next-run{
  display:grid;
  gap:14px;
}

.next-run-meta{
  display:grid;
  gap:4px;
}

.next-run-date{
  font-weight:900;
  font-size:18px;
  letter-spacing:.2px;
}

.next-run-track{
  color: var(--muted);
  font-size:14px;
}

.next-run-layout{
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.4);
  border-radius:16px;
  padding:12px;
  overflow:hidden;
  min-height:160px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.next-run-layout img{
  width:100%;
  max-width:520px;
  height:auto;
  opacity:.95;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.35));
}

.next-run-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* ==== LineUp Team Cards ==== */

.team-card{
  display:grid;
  grid-template-columns: 1fr 220px;
  gap:16px;
  padding:18px;
  margin-bottom:16px;            /* mehr Abstand zwischen Teams */
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  background: rgba(255,255,255,.03);
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
}

.team-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between; /* Badge rechts */
  gap:12px;
  margin-bottom:10px;
}

.team-name{
  font-weight:900;
  font-size:16px;
  letter-spacing:.2px;
}

.team-car{
  margin-top:6px;
  color: var(--muted);
  font-size:13px;
}

.team-drivers{
  display:grid;
  gap:6px;
  padding-top:10px;
  border-top:1px solid rgba(255,255,255,.06);
  max-width: 520px;
}

.driver{
  font-weight:700;
}

.team-media{
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:flex-end;
}

.team-logo{
  width:64px;
  height:64px;
  object-fit:contain;
  border-radius:14px;
  background: rgba(0,0,0,.25);
  border:1px solid rgba(255,255,255,.08);
  padding:8px;
}

.team-livery{
  width:100%;
  height:120px;
  object-fit:cover;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.25);
}

.team-livery.placeholder{
  width:100%;
  height:120px;
  border-radius:14px;
  border:1px dashed rgba(255,255,255,.12);
  display:flex;
  align-items:center;
  justify-content:center;
  color: rgba(255,255,255,.35);
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.6px;
}

/* ==== Reservefahrer Block ==== */
.reserve-card{
  padding:18px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  background: rgba(255,255,255,.03);
}

.reserve-title{
  font-weight:900;
  margin-bottom:10px;
}

.reserve-list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.reserve-pill{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  font-weight:800;
  font-size:12px;
}

/* Responsive */
@media (max-width: 920px){
  .team-card{ grid-template-columns: 1fr; }
  .team-media{ align-items:flex-start; }
  .team-livery{ height:140px; }
}

/* Results row composition */
.cell-main{ display:flex; flex-direction:column; gap:2px; }
.driverline{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.driver{ font-weight:900; letter-spacing:.2px; }
.classbadge .badge{ transform: translateY(-1px); }
td.pos{ font-weight:900; width:60px; }
