body.migration-tracking-page {
  background-color: rgb(50, 51, 57);
  font-family: "Segoe UI", sans-serif;
  color: white;
  margin: 0;
  padding: 0 20px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

.migration-header {
  width: 100%;
  max-width: 80vw;
  margin-top: 20px;
}


.page-title {
  margin: 0 0 14px 0;
  text-align: center;
  color: rgb(255, 0, 0);
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 800;
}

.migration-note {
  margin-top: 6px;
  margin-bottom: 14px;
  text-align: center;
  color: #cfcfcf;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* =========================
   GLASS CONTAINERS
   ========================= */

.server-glass {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 15px;
  padding: 14px;
  margin: 12px 0;
  backdrop-filter: blur(10px);
  width: 100%;
  max-width: 80vw;
  box-sizing: border-box;
}

/* inner glass used for the filtering blocks */
.inner-glass {
  background: rgba(255, 255, 255, 0.025);
  border-radius: 12px;
  padding: 12px;
  margin: 0 auto;
  max-width: 55vw;
}

.results {
  width: 100%;
  max-width: 80vw;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ensure cards fill the available width */
.player-card,
.alliance-card {
  width: 100%;
  box-sizing: border-box;
}

/* =========================
   CONTROLS (NEW unified glass layout)
   ========================= */

.controls-form {
  width: 100%;
}

/* Use this when you switch to the new single inner-glass layout */
.controls-glass {
  max-width: 70vw; /* adjust if you want it wider/narrower */
  padding: 14px;
}

/* sections inside the single glass */
.controls-section {
  padding: 10px 0;
}

.controls-section + .controls-section {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 10px;
}

/* shared grid for controls */
.controls-grid {
  display: grid;
  gap: 16px;
  justify-content: center;
  align-items: start;
}

.controls-grid-2 {
  grid-template-columns: 1fr 1fr;
  max-width: 58vw; /* keeps rows lined up */
  margin: 0 auto;
}

.controls-grid-3-slim {
  display: grid;
  width: 100%;
  max-width: 58vw;          /* EXACTLY matches controls-grid-2 */
  margin: 0 auto;

  grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1fr);

  gap: 16px;
  align-items: start;
}

.controls-grid-3-slim .time-box select,
.controls-grid-3-slim .time-box input {
  width: auto;         /* stops the full-width stretching */
  min-width: 260px;    /* keep same normal size as other dropdowns */
  max-width: 260px;    /* prevents it from growing wider */
}


.controls-grid-3-slim > .time-box {
  width: 100%;
  min-width: 0;
}

.time-box-slim {
  width: 120px; /* adjust if you want slightly bigger/smaller */
  justify-self: center;
}

.time-box-slim select,
.time-box-slim input {
  width: 100% !important;
  min-width: 0 !important;
}

.row-title {
  text-align: center;
  font-weight: 800;
  color: #ddd;
  margin-bottom: 6px;
  font-size: clamp(16px, 1.4vw, 20px);
}

/* =========================
   TIME BOXES / INPUTS
   ========================= */

.time-box {
  box-sizing: border-box; 
  width: 100%;          
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 8px 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.time-box label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ccc;
  margin-bottom: 4px;
}


/* Force selects + inputs to match size */
.time-box select,
.time-box input {
  min-width: 260px;
  height: 40px;
  padding: 0 12px;
  border-radius: 0.375rem;
  border: none;
  background-color: #f0f0f0;
  color: #333;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
}

/* =========================
   ALLIANCE CARD (SKETCH STYLE)
   ========================= */

.alliance-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.alliance-server-line {
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 950;
  color: rgb(255, 0, 0);
  text-align: center;
}

.alliance-name-line {
  font-size: clamp(14px, 1.2vw, 18px);
  font-weight: 700;
  color: #d6d6d6;
  text-align: center;
}

/* 3 columns: left (IN), middle (NET), right (OUT) */
.alliance-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  column-gap: 40px;
  row-gap: 18px;
  align-items: start;
  margin-top: 6px;
}

/* each stat cell */
.alliance-stats-grid .cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alliance-stats-grid .label {
  font-size: 0.95rem;
  font-weight: 750;
  color: #cfcfcf;
}

.alliance-stats-grid .val {
  font-size: 1.7rem;
  font-weight: 950;
  color: #ffffff;
  line-height: 1.05;
  word-break: break-word;
}

/* align columns (CENTER left + right now) */
.alliance-stats-grid .cell-left,
.alliance-stats-grid .cell-right {
  align-items: center;
  text-align: center;
}

.alliance-stats-grid .cell-mid {
  align-items: center;
  text-align: center;
}

/* =========================
   LORD DETAILS DROPDOWN
   ========================= */

.lord-details-toggle {
  width: 100%;
  margin-top: 18px;
  padding: 12px 14px;
  border: none;
  border-radius: 12px; /* stays rounded when CLOSED */
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  font-weight: 900;
  color: #ddd;
  background: rgba(255, 255, 255, 0.025); /* match inner-glass */
  backdrop-filter: none;
}

.lord-details-toggle.open {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.lord-details-toggle:hover {
  background: rgba(255, 255, 255, 0.3); 
}

.lord-details-toggle .caret {
  font-weight: 900;
}

.lords-panel {
  margin-top: 0;

  /* remove extra top padding that makes first card look spaced */
  padding: 0 8px 8px;

  border-radius: 12px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  background: rgba(255, 255, 255, 0.025);
}

.lords-list {
  display: flex;
  flex-direction: column;
  gap: 2px;                      /* <-- SERVER LORD PAGE GAP NUMBER */
}

.lord-name {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}

.lord-id {
  color: #bbb;
  font-weight: 700;
}
/* =========================
   Red Divider
   ========================= */

.mig-join-divider{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin: 15px 0;
  position: relative;
}

/* shared line style */
.mig-join-divider::before,
.mig-join-divider::after{
  content:"";
  flex:1;
  height:3px;
  border-radius:999px;
}

/* GREEN INCOMING */
.mig-join-divider.incoming::before,
.mig-join-divider.incoming::after{
  background: rgba(40, 255, 120, 0.9);
  box-shadow: 0 0 10px rgba(40, 255, 120, 0.35);
}

.mig-join-divider.incoming span{
  color: #d4ffe8;
  font-weight:900;
  letter-spacing:1px;
  font-size:0.9rem;
  text-transform:uppercase;
  padding:4px 12px;
  border-radius:999px;
  background: rgba(40, 255, 120, 0.18);
  border:1px solid rgba(40, 255, 120, 0.6);
}

/* RED OUTGOING */
.mig-join-divider.outgoing::before,
.mig-join-divider.outgoing::after{
  background: rgba(255, 50, 50, 0.9);
  box-shadow: 0 0 10px rgba(255, 50, 50, 0.35);
}

.mig-join-divider.outgoing span{
  color:#ffe2e2;
  font-weight:900;
  letter-spacing:1px;
  font-size:0.9rem;
  text-transform:uppercase;
  padding:4px 12px;
  border-radius:999px;
  background: rgba(255, 50, 50, 0.18);
  border:1px solid rgba(255, 50, 50, 0.6);
}

/* =========================
   PLAYER CARD (BEFORE / AFTER)
   ========================= */

.player-card {
  padding: 11px;
}

.player-id-top {
  text-align: center;
  font-size: clamp(18px, 1.6vw, 26px);
  font-weight: 950;
  margin-bottom: 8px;
  color: #fff;
}

.player-id-top .sep{
  margin: 0 6px;
  opacity: 0.7;
}

.player-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.player-side {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.side-title {
  text-align: center;
  font-weight: 950;
  letter-spacing: 1px;
  color: #ddd;
  margin-bottom: 12px;
}

.player-side .row {
  display: grid;
  grid-template-columns: 140px 240px; /* label lane, value lane */
  justify-content: center;            /* centers the 2-lane grid */
  align-items: center;
  gap: 16px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.player-side .row:last-child {
  border-bottom: none;
}

.player-side .label {
  font-size: 0.9rem;
  color: #bfbfbf;
  font-weight: 750;
  text-align: right;
  padding-right: 12px;
}

.player-side .val {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 850;
  text-align: center;
  justify-self: center;
}


/* =========================
   SIMPLIFIED (FULL WIDTH + EVEN SPACING)
   ULTRA TIGHT + slightly bigger text
   ========================= */

.simp-card{
  display:flex;
  flex-direction:column;
  gap: 0px;                 /* was 1px */
}

/* PAST / PRESENT row container */
.simp-row{
  display:grid;
  grid-template-columns: 64px 1fr;  /* was 70px (slightly tighter) */
  align-items:center;
  gap: 6px;                         /* was 8px */

  padding: 2px 8px;                 /* was 3px 10px (tighter) */
  border-radius: 8px;               /* was 10px */
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
}

/* PAST / PRESENT tag */
.simp-tag{
  font-weight:950;
  letter-spacing:0.5px;
  color:#dcdcdc;
  text-align:center;

  font-size: 0.82rem;               /* slightly bigger (was 0.78rem) */
}

/* Right side content grid (ID | Server | Name | Alliance | Power) */
.simp-line{
  display:grid;
  width:100%;
  align-items:center;
  column-gap: 18px;
  white-space: nowrap;

  /* Make ID wider -> pushes server/name/alliance to the right */
  grid-template-columns:
    minmax(0, 1.40fr)   /* Lord ID (WIDER) */
    minmax(0, 1.10fr)   /* Server */
    minmax(0, 1.65fr)   /* Name */
    minmax(0, 1.95fr)   /* Alliance */
    minmax(0, 1.15fr);  /* Power */
}

.simp-item.simp-id,
.simp-item.simp-server{
  text-align: left;
}

.simp-item.simp-power{
  text-align: right;
}

/* each cell inside simp-line */
.simp-item{
  overflow:hidden;
  text-overflow:ellipsis;

  font-weight:850;                  /* a touch heavier */
  color:#fff;
  font-size: 0.94rem;               /* slightly bigger (was 0.88rem) */
}

/* label prefix inside each cell */
.simp-k{
  color:#bdbdbd;
  font-weight:850;
  font-size:0.80rem;                /* slightly bigger (was 0.76rem) */
  margin-right:4px;
}

.simp-power{
  text-align:right;
  font-variant-numeric: tabular-nums;
}

/* =========================
   MAKE THE OUTER CARD SUPER TIGHT
   (THIS is what removes the “gap” look)
   ========================= */

.server-glass.player-card.simplified-card{
  margin: 8px 0 !important;      /* <-- NORMAL LORD PAGE GAP NUMBER */
  padding: 2px 6px !important;
  border-radius: 12px;
}

.lords-panel .server-glass.player-card.simplified-card{
  margin: 2px 0 !important;   /* <-- change THIS number to shrink/expand */
}

/* =========================
   DIVIDER SPACING (INCOMING / OUTGOING)
   ========================= */

/* smaller gap around the green/red divider when viewing simplified */
.player-card.simplified-card + .mig-join-divider,
.mig-join-divider + .player-card.simplified-card{
  margin: 6px 0 !important;
}


/* =========================
   TOOLTIP FIXES + DARKER POPUP (SIMPLIFIED ONLY)
   ========================= */

/* allow tooltip to escape the grid cell */
.simp-item.simp-name{
  overflow: visible !important;
}

/* keep tooltip above everything */
.name-tooltip{
  position: relative;
  z-index: 5;
}

/* much darker tooltip background ONLY in simplified view */
.player-card.simplified-card .tooltip-glass{
  z-index: 999;
  background: rgba(0,0,0,0.85) !important;  /* darker */
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 14px 28px rgba(0,0,0,0.65);
}

.player-card.simplified-card .tooltip-glass::after{
  border-color: rgba(0,0,0,0.85) transparent transparent transparent !important;
}


/* =========================
   NAME HOVER TOOLTIP
   ========================= */

.name-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.name-text {
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  text-underline-offset: 3px;
  cursor: default;
}

.tooltip-glass {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 10px);
  min-width: 220px;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 12px;

  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);

  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 50;
}

.tooltip-item {
  padding: 6px 0;
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.tooltip-item + .tooltip-item {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.name-tooltip:hover .tooltip-glass {
  opacity: 1;
}

.tooltip-glass::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.45) transparent transparent transparent;
}

/* =========================
   MIGRANTS TOOLTIP
   ========================= */

.mig-tooltip{
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.mig-trigger{
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.25);
  text-underline-offset: 3px;
  cursor: default;
}

/* tooltip box */
.mig-tooltip-glass{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 28px);

  width: 220px;
  padding: 6px 12px;
  border-radius: 12px;

  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 10px 22px rgba(0,0,0,0.35);

  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 80;

  overflow: visible; /* IMPORTANT: arrow should not be clipped */
}

/* OPEN when hovering the number */
.mig-trigger:hover + .mig-tooltip-glass{
  opacity: 1;
  pointer-events: auto;
}

/* STAY OPEN while the tooltip itself is hovered */
.mig-tooltip-glass:hover{
  opacity: 1;
  pointer-events: auto;
}

/* STAY OPEN when JS marks the wrapper as "open" */
.mig-tooltip.is-open .mig-tooltip-glass{
  opacity: 1;
  pointer-events: auto;
}

/* items */
.mig-tooltip-item{
  padding: 6px 0;
  color: #fff;
  font-weight: 700;
  font-size: 0.90rem;        /* BIGGER (was ~0.80-0.85) */
  text-align: center;
  line-height: 1.15;
}

.mig-tooltip-item + .mig-tooltip-item{
  border-top: 1px solid rgba(255,255,255,0.10);
}

/* optional "+ more..." style */
.mig-tooltip-item.mig-more{
  opacity: 0.75;
  font-weight: 650;
}

.mig-tooltip-scroll{
  display: block;
  max-height: 80px;       /* <— this is the height you control */
  overflow-y: auto;
  overflow-x: hidden;
}

/* arrow */
.mig-tooltip-glass::after{
  content: "";
  position: absolute;
  top: 100%;
  left: calc(50%);  /* <— shift left to account for scrollbar space */
  transform: translateX(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: rgba(0,0,0,0.55) transparent transparent transparent;
  pointer-events: none;
}


/* =========================
   PAGINATION BUTTONS
   ========================= */
.pagination-glass {
  padding: 12px 14px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 12px 18px;
  margin: 18px auto;

  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  backdrop-filter: blur(10px);

  font-weight: 800;
  color: #ddd;
}

/* Page info text */
.pagination-info {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.95rem;
  color: #e6e6e6;
}

/* Highlight current page */
.pagination-info .current-page {
  color: rgb(255, 80, 80);
  font-weight: 950;
}

/* Highlight totals subtly */
.pagination-info .total-count {
  color: #bdbdbd;
  font-weight: 700;
}



.pagination-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 10px;
  padding: 8px 14px;

  font-weight: 900;
  color: #fff;
  cursor: pointer;

  transition:
    background 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(255, 0, 0, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 0, 0, 0.45);
  transform: translateY(-1px);
}

.pagination-btn:active:not(:disabled) {
  transform: translateY(0);
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.03);
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 768px) {
  body.migration-tracking-page {
    padding: 0 12px 16px 12px;
  }

  .migration-header,
  .server-glass,
  .inner-glass,
  .results {
    max-width: 94vw;
  }

  /* controls layout stacks */
  .controls-glass { max-width: 94vw; padding: 12px; }
  .controls-grid-2 { grid-template-columns: 1fr; max-width: 94vw; }
  .controls-grid-3-slim {
    grid-template-columns: 1fr;
    max-width: 94vw;
  }

  .time-box-slim {
    width: 100%;
  }


  /* inputs should fill box nicely */
  .time-box select,
  .time-box input {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  /* player compare collapses */
  .player-compare {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* remove fixed 140/240 columns on mobile */
  .player-side .row {
    grid-template-columns: 1fr;
    gap: 6px;
    text-align: center;
  }

  .player-side .label {
    text-align: center;
    padding-right: 0;
  }

  .player-side .val {
    justify-self: center;
    text-align: center;
  }

  /* alliance stats collapses */
  .alliance-stats-grid {
    grid-template-columns: 1fr;
    row-gap: 14px;
  }

  .alliance-stats-grid .cell-left,
  .alliance-stats-grid .cell-mid,
  .alliance-stats-grid .cell-right {
    align-items: center;
    text-align: center;
  }

  /* tooltip width so it doesn't go off-screen */
  .tooltip-glass {
    min-width: 200px;
    max-width: 86vw;
  }

  .lord-name {
    max-width: 86vw;
  }

  .pagination-bar {
    flex-direction: column;
    gap: 10px;
  }

  .pagination-btn {
    width: 75vw;
    max-width: 360px;
    min-width: 0;
  }

  .pagination-info {
    font-size: 0.95rem;
    padding: 4px 10px;
  }

  .pagination-dot {
    display: none; /* keeps it cleaner on phones */
  }

  .player-card .player-id-top{
    font-size: clamp(12px, 3.2vw, 16px) !important;
    line-height: 1.1 !important;
    padding: 6px 8px !important;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    white-space: nowrap;          /* <- single line */
    overflow: hidden;             /* prevents spill */
    text-overflow: ellipsis;      /* if it STILL can’t fit, it will "..." */
  }

  .player-card .player-id-top .sep{
    opacity: 0.7;
    flex: 0 0 auto;
  }

  .player-card .player-id-top strong{
    font-size: inherit !important;
    flex: 0 1 auto;
    min-width: 0;
  }

  .lords-panel{
    padding: 0 6px 6px;   /* was 0 8px 8px */
  }

  .lords-list{
    gap: 2px;             /* SERVER/LORD DETAILS vertical gap on phone */
  }

  /* simplified rows on phone */
  .simp-row{
    grid-template-columns: 70px 1fr;
    padding: 4px 8px;
  }

  /* stack the fields vertically on phone */
  .simp-line{
    grid-template-columns: 1fr;
    row-gap: 2px;         /* spacing between the stacked lines */
  }

  /* make all stacked items align left on phone */
  .simp-item{
    text-align: left !important;
  }

  .simp-power{
    text-align: left !important;
  }

  /* OPTIONAL: reduce the card margin more on phone */
  .server-glass.player-card.simplified-card{
    margin: 6px 0 !important;   /* NORMAL PAGE gap on phone */
    padding: 2px 6px !important;
  }

  /* OPTIONAL: even tighter inside the lord-details dropdown panel */
  .lords-panel .server-glass.player-card.simplified-card{
    margin: 2px 0 !important;   /* SERVER/LORD DETAILS gap on phone */
  }
}