.mi5ph-wrap{
  font-family: "Rajdhani", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:#fff;
}

/* ================= HEADER ================= */

.mi5ph-header-card{
  background:
    radial-gradient(1200px 400px at 10% 10%, rgba(255,255,255,.06), transparent),
    linear-gradient(180deg, #0b1217, #05090c);
  border-radius:22px;
  padding:22px 24px;
  border:1px solid rgba(255,255,255,.10);
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  margin-bottom:20px;
}

.mi5ph-header-left{
  max-width:60%;
}

.mi5ph-title{
  font-size:36px;
  font-weight:800;
  letter-spacing:.6px;
  margin-bottom:8px;
  color:#ffffff;
}

.mi5ph-subtitle{
  color:rgba(255,255,255,.70);
  font-size:15px;
  line-height:1.4;
}

/* RIGHT SIDE – user + player */

.mi5ph-header-right{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:12px;
}

.mi5ph-pill{
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.15);
  border-radius:999px;
  padding:12px 18px;
  font-size:14px;
  white-space:nowrap;
}

/* ✅ FIX: make label green, keep name white (no PHP edits) */
.mi5ph-pill{
  position: relative;
  color: rgba(255,255,255,.65);
}

/* Hide the original label text but keep <strong> visible */
.mi5ph-pill{
  font-size: 0; /* hides raw text nodes */
}
.mi5ph-pill strong{
  font-size:14px; /* restore name size */
  color:#ffffff;
  font-weight:800;
}

/* Re-inject labels in brand colour based on pill order */
.mi5ph-header-right .mi5ph-pill:nth-of-type(1)::before{
  content: "Logged in as ";
  color: var(--mi5ph-brand, #a8ff3e);
  font-size:14px;
  font-weight:800;
}
.mi5ph-header-right .mi5ph-pill:nth-of-type(2)::before{
  content: "Player ";
  color: var(--mi5ph-brand, #a8ff3e);
  font-size:14px;
  font-weight:800;
}

/* ================= TABS ================= */

.mi5ph-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  margin-bottom:22px;
}

.mi5ph-tab{
  padding:14px 22px;
  border-radius:999px;
  background:#0e1419;
  border:1px solid rgba(255,255,255,.12);
  color:#ffffff;
  text-decoration:none;
  font-weight:800;
  font-size:15px;
  letter-spacing:.4px;
  white-space:nowrap;
  transition:all .2s ease;
}

.mi5ph-tab:hover{
  background:#131b22;
}

.mi5ph-tab.is-active{
  color:var(--mi5ph-brand, #a8ff3e);
  border-color:rgba(168,255,62,.6);
  box-shadow:0 0 0 2px rgba(168,255,62,.15) inset;
}

/* ================= GRID ================= */

.mi5ph-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:18px;
}

@media (max-width: 980px){
  .mi5ph-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}

@media (max-width: 600px){
  .mi5ph-grid{ grid-template-columns:1fr; }
  .mi5ph-header-card{
    flex-direction:column;
    align-items:flex-start;
  }
  .mi5ph-header-left{ max-width:100%; }
  .mi5ph-header-right{
    align-items:flex-start;
  }
}

/* ================= BOXES ================= */

.mi5ph-box{
  border-radius:22px;
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 14px 40px rgba(0,0,0,.45);
  overflow:hidden;
}

.mi5ph-box-title{
  color:#ffffff !important;
  font-size:22px;
  font-weight:800;
  margin-bottom:14px;
}

.mi5ph-box-body{
  font-size:15px;
  color:rgba(255,255,255,.9);
}

/* Tables scroll on mobile */
.mi5ph-table-scroll{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.mi5ph-table-scroll table{
  min-width:720px;
}

/* =========================================================
   Mi5 Player Hub – Force single-column rows
   Applies ONLY to specific tabs (not Dashboard)
   ========================================================= */

/* Tabs that must be ROW layout only */
.mi5ph-wrap[data-active-tab="upcoming"] .mi5ph-grid,
.mi5ph-wrap[data-active-tab="leaderboards"] .mi5ph-grid,
.mi5ph-wrap[data-active-tab="race_picker"] .mi5ph-grid,
.mi5ph-wrap[data-active-tab="forms"] .mi5ph-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Ensure boxes span full width */
.mi5ph-wrap[data-active-tab="upcoming"] .mi5ph-box,
.mi5ph-wrap[data-active-tab="leaderboards"] .mi5ph-box,
.mi5ph-wrap[data-active-tab="race_picker"] .mi5ph-box,
.mi5ph-wrap[data-active-tab="forms"] .mi5ph-box {
    width: 100%;
    max-width: 100%;
}

/* Allow wide shortcodes but keep inside box */
.mi5ph-wrap[data-active-tab="upcoming"] .mi5ph-table-scroll,
.mi5ph-wrap[data-active-tab="leaderboards"] .mi5ph-table-scroll,
.mi5ph-wrap[data-active-tab="race_picker"] .mi5ph-table-scroll,
.mi5ph-wrap[data-active-tab="forms"] .mi5ph-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Let tables size naturally */
.mi5ph-table-scroll table {
    width: max-content;
    min-width: 100%;
    max-width: 100%;
    border-collapse: collapse;
}

.mi5ph-table-scroll th,
.mi5ph-table-scroll td {
    white-space: nowrap;
}

/* === Single-column layout for data-heavy tabs === */
.mi5ph-wrap[data-tab="upcoming"],
.mi5ph-wrap[data-tab="leaderboards"],
.mi5ph-wrap[data-tab="race_picker"],
.mi5ph-wrap[data-tab="forms"] {
    display: block;
}

.mi5ph-wrap[data-tab="upcoming"] .mi5ph-grid,
.mi5ph-wrap[data-tab="leaderboards"] .mi5ph-grid,
.mi5ph-wrap[data-tab="race_picker"] .mi5ph-grid,
.mi5ph-wrap[data-tab="forms"] .mi5ph-grid {
    display: grid;
    grid-template-columns: 1fr;
}

/* Allow wide content but keep it inside box */
.mi5ph-box-body {
    overflow-x: auto;
    max-width: 100%;
}

/* === FIX SportPress selects & inputs inside Player Hub === */
.mi5ph-wrap select,
.mi5ph-wrap input,
.mi5ph-wrap textarea {
    color: #000 !important;
    background-color: #fff !important;
}

/* Player Hub table safety wrapper */
.mi5-player-hub {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

/* Horizontal scroll for tables only */
.mi5-table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

/* SportPress tables behave */
.mi5-table-scroll table {
  width: max-content;
  min-width: 100%;
}

/* Fix dropdown clipping */
.mi5-table-scroll,
.mi5ph-box {
  overflow: visible !important;
}