body.server-alliance-rankings-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
   ========================================================= */

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

  position: relative;
  z-index: 50;
}

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

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

/* ==========================================
   SCAN BAR CONTAINER
========================================== */

.scan-bar-glass {
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 12px;

  position: relative;
  z-index: 1;
}

.scan-bar {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 8px;
  align-items: stretch;
}

/* Sticky Scan All button */
.scan-all.sticky-left {
  position: sticky;
  left: 0;
  z-index: 5;
}


/* ==========================================
   BASE SCAN CHIP (matches server button colors)
========================================== */

.scan-chip {
  min-width: 240px;
  height: 100px;

  border: none;
  border-radius: 14px;
  cursor: pointer;

  /* Match your server page /server button */
  background-color: #5e60ce;
  color: white;

  box-shadow: 0 4px 15px rgba(0,0,0,0.2);

  display: flex;
  flex-direction: column;
  justify-content: center;   /* center content vertically */
  align-items: center;

  padding: 12px 14px;
  text-align: center;
  white-space: nowrap;

  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  transform-origin: center;  /* IMPORTANT: scale from center */
  will-change: transform;
}

.scan-chip:hover {
  background-color: #4a4cd0; /* exact hover from your server page */
  transform: scale(1.04);    /* no translateY => expands in place */
  box-shadow: 0 6px 18px rgba(0,0,0,0.28);
}

.scan-chip:active {
  transform: scale(0.99);
}


/* ==========================================
   CHIP TEXT STYLING (tighter + clean)
========================================== */

.scan-chip-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.scan-chip-meta {
  font-size: 0.8rem;
  opacity: 0.9;
  line-height: 1.15;
  margin: 1px 0;
}

.scan-chip-price {
  font-weight: 800;
  font-size: 0.9rem;
  margin-top: 6px;
}

.date-arrow{
  display: inline-block;
  position: relative;
  top: -2px;       
}

/* ==========================================
   SCAN ALL – SHINY GREEN (no red)
========================================== */

.scan-chip-all {
  background: linear-gradient(180deg, #19b54a 0%, #0c7f2f 100%);
  box-shadow: 0 4px 15px rgba(0,0,0,0.22);
}

.scan-all .scan-chip-all {
  border-radius: 0;
}

.scan-chip-all:hover {
  background: linear-gradient(180deg, #22c456 0%, #0a6b28 100%);
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}


/* ==========================================
   PURCHASED – GOLD (same as your site)
   (NO scaling on hover, like your purchased server button)
========================================== */

.scan-chip-purchased {
  background-color: #d4af37;
  color: #2b1900;

  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;

  /* Keep identical layout to base chip */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  padding: 12px 14px;
  text-align: center;

  transform-origin: center;
}

/* Scale on hover like blue buttons */
.scan-chip-purchased:hover {
  background-color: #e3c557;
  transform: scale(1.04);
  box-shadow: 0 8px 22px rgba(0,0,0,0.32);
}

/* Slightly tighter meta text */
.scan-chip-purchased .scan-chip-meta {
  font-size: 0.78rem;
  opacity: 0.95;
  line-height: 1.15;
  margin: 1px 0;
}

/* Long purchased line adjusted so button doesn't FEEL bigger */
.scan-chip-purchased .scan-chip-price {
  font-size: 0.8rem;   /* slightly smaller than blue */
  font-weight: 700;    /* less heavy */
  line-height: 1.15;
  margin-top: 6px;
  white-space: normal; /* allows wrap cleanly */
}
/* =========================================================
   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 {
  background: rgba(255, 255, 255, 0.025);
  border-radius: 12px;
  padding: 12px;
  margin: 0 auto;
  max-width: 55vw;
}

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

/* =========================================================
   CONTROLS (keep your existing look)
   ========================================================= */

.controls-form { width: 100%; }

.controls-glass {
  max-width: 70vw;
  padding: 14px;
}

.controls-section {
  padding: 10px 0;
}

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

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

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

.controls-grid-1 {
  grid-template-columns: 1fr;
  max-width: 58vw;
  margin: 0 auto;
}

.controls-grid-2 {
  grid-template-columns: 1fr 1fr;
  max-width: 58vw;
  margin: 0 auto;
}

.controls-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
  max-width: 74vw;
  margin: 0 auto;
}

.controls-grid-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
  max-width: 80vw;
  margin: 0 auto;
}

/* input boxes */
.time-box {
  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;
}

.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;
}

#minPowerDisplay { cursor: text; }

.server-filter-box { position: relative; }

/* this matches your other controls, but allows absolute dropdown positioning */
.server-filter-box .input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Make it match the same size as the other controls */
.server-input-container{
  width: 260px;
  height: 40px;
  background: #f0f0f0;
  border-radius: 0.375rem;
  display: flex;
  align-items: stretch;          /* full height */
  box-sizing: border-box;
  overflow: visible;

  padding: 0;
  gap: 0;

  /* key: prevent flexbox from "sharing" space dynamically */
  justify-content: space-between;
}

/* LEFT half (tags) */
.server-tags-container{
  width: 50%;
  flex: 0 0 50%;
  min-width: 50%;
  max-width: 50%;

  height: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;

  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  padding: 0 8px;

  /* don’t let clicks here behave like input clicks */
  cursor: default;
}


/* each tag */
.server-tag{
  background-color: #1976d2;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

/* RIGHT half (input) */
#server-input{
  width: 100%;
  flex: 1 1 auto;
  min-width: 0 !important;   /* overrides .time-box input min-width:260px */
  max-width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  background: transparent;
  text-align: center;
}
#server-input:focus {
  outline: none;
  box-shadow: none;
}


/* dropdown list (GLOBAL LEADERBOARD STYLE) */
.server-filter-box .dropdown-list{
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  max-height: 150px;
  overflow-y: auto;
  background: white;
  color: #333;
  border: 1px solid #ccc;
  border-top: none;             /* smooth connection */
  border-radius: 0 0 8px 8px;
  display: none;
  z-index: 9999;
  box-sizing: border-box;
  margin-top: -1px;             /* overlaps seam */
  padding: 0;
}

.server-filter-box .dropdown-list.show{ display: block; }

/* IMPORTANT: not bold */
.server-filter-box .dropdown-list .server-option{
  padding: 8px 10px;
  cursor: pointer;
  text-align: center;
  font-weight: normal;
  font-weight: 500;
}

.server-filter-box .dropdown-list .server-option:hover{
  background: #f0f0f0;
}

/* placeholder */
.server-input-wrapper{
  width: 50%;
  flex: 0 0 50%;
  min-width: 0;              /* critical for flex children */
  max-width: 50%;
  height: 100%;
  position: relative;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* your "placeholder text" */
.server-placeholder{
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-56%);   /* <-- nudges it UP (change -56% to -52% etc) */
  text-align: center;
  font-weight: 600;
  color: #777;
  pointer-events: none;          /* clicks go into the input */
  line-height: 1.2;
  font-size: 0.85rem;            /* adjust if you want */
}


.server-tags-container{
  border-right: 2px solid rgba(0,0,0,.3);
}
/* =========================================================
   RESULTS TABLE (MATCH YOUR OTHER PAGE EXACTLY)
   ========================================================= */

.rank-table {
  width: 100%;
}

/* This is the exact setup from your working page */
.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 15px; /* spacing between rows */
}

/* Each data row matches glass look */
.leaderboard-table tbody tr {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  overflow: hidden;
}

/* Table cells */
.leaderboard-table td,
.leaderboard-table th {
  text-align: center;
  padding: 15px;
  font-size: clamp(14px, 1.2vw, 18px);
  color: white;
  border: none;
}

/* Table headers with soft light style + the “divots” */
.leaderboard-table thead th {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-weight: bold;

  /* THIS is what creates the divot look between headers */
  border-radius: 10px 10px 0 0;
}

/* Ensure row corners are rounded */
.leaderboard-table tbody tr td:first-child {
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
}

.leaderboard-table tbody tr td:last-child {
  border-top-right-radius: 20px;
  border-bottom-right-radius: 20px;
}

/* Dominant Alliance / Alliance cell: ellipsis without breaking layout */
.leaderboard-table td.col-group {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0; /* allows ellipsis to work in tables */
}



/* ===========================
   Toast
   =========================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}

.modal {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 22px 24px;
  width: min(520px, 92vw);
  color: #fff;
  text-align: center;
  box-shadow: 0 10px 35px rgba(0,0,0,0.35);
}

.modal-title { margin: 0 0 10px; font-size: clamp(18px, 2.4vw, 22px); }
.modal-message { margin: 0 0 18px; color: #ddd; }

.modal-actions { display: flex; gap: 12px; justify-content: center; }

.cta-button {
  background-color: #5e60ce;
  color: white; font-weight: 700;
  padding: 12px 20px; border: none;
  border-radius: 10px; cursor: pointer;
  text-decoration: none; display: inline-block;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: transform .15s ease, background-color .2s ease;
}
.cta-button:hover { background-color: #4a4cd0; transform: scale(1.04); }

.secondary-button {
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 10px; padding: 12px 16px;
  cursor: pointer; transition: background-color .2s ease, transform .15s ease;
}
.secondary-button:hover { background: rgba(255,255,255,0.08); transform: scale(1.02); }



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

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

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

  .controls-glass { max-width: 94vw; padding: 12px; }

  .controls-grid-1,
  .controls-grid-2,
  .controls-grid-3,
  .controls-grid-4 {
    grid-template-columns: 1fr;
    max-width: 94vw;
  }

  .time-box select,
  .time-box input {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  /* Match your other page’s mobile behavior */
  .leaderboard-table td,
  .leaderboard-table th {
    font-size: 12px;
    padding: 6px 4px;
  }

  .leaderboard-table tbody tr {
    border-radius: 12px;
  }

  .scan-chip {
    min-width: 180px;   /* was 240px */
    height: 80px;       /* was 100px */

    padding: 8px 10px;
  }

  .scan-chip-title {
    font-size: 0.85rem;
  }

  .scan-chip-meta {
    font-size: 0.72rem;
  }

  .scan-chip-price {
    font-size: 0.8rem;
    margin-top: 4px;
  }
}