:root{
  --twof-blue: #0081C5;
  --twof-black: #010101;
  --twof-white: #FFFFFF;

  --twof-line: rgba(0,129,197,.25);
  --twof-soft: rgba(0,129,197,.06);
}

/* Wrapper */
.twof-standings{
  margin: 20px 0;
  font-family: inherit;
}

/* Table shell */
.twof-standings-table{
  width: 100%;
  border-collapse: collapse;
  background: var(--twof-white);
  border: 1px solid var(--twof-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(1,1,1,.05);
}

/* Header */
.twof-standings-table thead th{
  background: var(--twof-blue);
  color: var(--twof-white);
  text-align: left;
  padding: 14px 16px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 13px;
}

/* Body cells */
.twof-standings-table td{
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,129,197,.15);
  color: var(--twof-black);
  vertical-align: middle;
}

/* Zebra rows */
.twof-standings-table tbody tr:nth-child(even){
  background: rgba(0,129,197,.03);
}

/* Hover */
.twof-standings-table tbody tr:hover{
  background: rgba(0,129,197,.08);
}

/* Position column */
.twof-standings-table th:nth-child(1),
.twof-standings-table td:nth-child(1){
  width: 70px;
  font-weight: 900;
  color: var(--twof-blue);
}

/* Points column */
.twof-standings-table th:nth-child(4),
.twof-standings-table td:nth-child(4){
  width: 90px;
  text-align: right;
  font-weight: 900;
}

/* Links */
.twof-standings-table a{
  color: var(--twof-blue);
  font-weight: 800;
  text-decoration: none;
}
.twof-standings-table a:hover{
  text-decoration: underline;
}

/* Updated timestamp */
.twof-standings-meta{
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: rgba(1,1,1,.6);
}

/* -------------------- */
/* MOBILE CARD LAYOUT   */
/* -------------------- */
@media (max-width: 680px){

  .twof-standings-table thead{
    display: none;
  }

  .twof-standings-table,
  .twof-standings-table tbody,
  .twof-standings-table tr,
  .twof-standings-table td{
    display: block;
    width: 100%;
  }

  .twof-standings-table tr{
    border-bottom: 1px solid var(--twof-line);
    padding: 16px 14px;
    background: var(--twof-white);
    text-align: center;           /* centres everything in the card */
  }

  .twof-standings-table tr:not(:last-child){
    margin-bottom: 8px;
  }

  .twof-standings-table td{
    padding: 10px 0;
    border: none;
  }

  /* Label above value, centred */
  .twof-standings-table td::before{
    display: block;
    margin-bottom: 6px;
    font-weight: 800;
    color: rgba(1,1,1,.55);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .04em;
  }

  .twof-standings-table td:nth-child(1)::before{ content: "Pos"; }
  .twof-standings-table td:nth-child(2)::before{ content: "Driver"; }
  .twof-standings-table td:nth-child(3)::before{ content: "Team"; }
  .twof-standings-table td:nth-child(4)::before{ content: "Pts"; }

  /* Values */
  .twof-standings-table td:nth-child(1){
    font-size: 22px;
    font-weight: 900;
    color: var(--twof-blue);
  }

  .twof-standings-table td:nth-child(4){
    font-size: 20px;
    font-weight: 900;
  }

  /* Make links look good centred */
  .twof-standings-table a{
    display: inline-block;
  }

  /* Ensure podium icon alignment stays nice on mobile */
  .twof-standings-table tbody tr:nth-child(-n+3) td:nth-child(1){
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
}



/* -------------------- */
/* PODIUM HIGHLIGHTING  */
/* -------------------- */

/* Gold – 1st */
.twof-standings-table tbody tr:nth-child(1){
  background: linear-gradient(
    90deg,
    rgba(212,175,55,.18),
    rgba(212,175,55,.05)
  );
}
.twof-standings-table tbody tr:nth-child(1) td:nth-child(1){
  color: #D4AF37; /* Gold */
}

/* Silver – 2nd */
.twof-standings-table tbody tr:nth-child(2){
  background: linear-gradient(
    90deg,
    rgba(192,192,192,.20),
    rgba(192,192,192,.06)
  );
}
.twof-standings-table tbody tr:nth-child(2) td:nth-child(1){
  color: #C0C0C0; /* Silver */
}

/* Bronze – 3rd */
.twof-standings-table tbody tr:nth-child(3){
  background: linear-gradient(
    90deg,
    rgba(205,127,50,.22),
    rgba(205,127,50,.07)
  );
}
.twof-standings-table tbody tr:nth-child(3) td:nth-child(1){
  color: #CD7F32; /* Bronze */
}


/* -------------------- */
/* PODIUM ICONS         */
/* -------------------- */

/* Make the Pos cell able to align icon neatly */
.twof-standings-table tbody td:nth-child(1){
  position: relative;
  white-space: nowrap;
}

/* Add space for icon and keep it consistent */
.twof-standings-table tbody tr:nth-child(-n+3) td:nth-child(1){
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Individual icons */
.twof-standings-table tbody tr:nth-child(1) td:nth-child(1)::after{ content: "🥇"; }
.twof-standings-table tbody tr:nth-child(2) td:nth-child(1)::after{ content: "🥈"; }
.twof-standings-table tbody tr:nth-child(3) td:nth-child(1)::after{ content: "🥉"; }

/* Icon sizing */
.twof-standings-table tbody tr:nth-child(-n+3) td:nth-child(1)::after{
  font-size: 16px;
  line-height: 1;
}
