/* =========================
   ROOT + BASE
========================= */
:root {
  --bg: #05060a;
  --panel: #0b1020;
  --accent: #00ffc8;
  --accent-soft: rgba(0,255,200,0.15);
  --text: #e6eef0;
  --muted: #93a3a6;
}

* {
  box-sizing: border-box;
}

body.bg {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: radial-gradient(circle at top, #0b1220, #05060a 60%);
  color: var(--text);
}

.page {
  max-width: 1400px;
  margin: auto;
  padding: 20px;
}

/* =========================
   HEADER
========================= */
.header {
  text-align: center;
  margin-bottom: 18px;
}

.header h1 {
  margin: 0;
  letter-spacing: 1px;
}

.sub {
  color: var(--muted);
  font-size: 13px;
}

/* =========================
   SEARCH
========================= */
.search-bar input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  background: #0a0f14;
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
}

/* =========================
   FILTERS
========================= */
.filter-group {
  margin-top: 20px;
}

.filter-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.filter-search {
  width: 100%;
  margin: 6px 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #0c1117;
  border: 1px solid rgba(255,255,255,0.08);
  color: #eaeaea;
  font-size: 13px;
}

.filter-cards {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.filter-card {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  transition: all .2s ease;
}

.filter-card.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 14px rgba(0,255,200,.35);
}

/* =========================
   SEGMENTS
========================= */
.segments {
  margin: 20px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.segment {
  background: linear-gradient(145deg, #0d1324, #060a14);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.06);
}

.segment span {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}

.segment small {
  display: block;
  font-size: 11px;
  opacity: .6;
}

/* =========================
   DOMINANCE
========================= */
.dominance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 14px;
}

.dominance-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px;
}

.dom-rank {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}

.dom-name {
  font-size: 16px;
  font-weight: 800;
  margin: 6px 0;
}

/* =========================
   TABLE (DESKTOP)
========================= */
.table-wrap {
  margin-top: 20px;
  background: linear-gradient(180deg, #0b1020, #060a14);
  border-radius: 16px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 10px 8px;
  color: #9fb7c0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

tbody td {
  padding: 10px 8px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  white-space: nowrap;
}

.col-rank {
  width: 44px;
  color: var(--accent);
  font-weight: 700;
}

.col-name {
  font-weight: 600;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-power {
  width: 90px;
  text-align: right;
  font-weight: 800;
  color: var(--accent);
}

.col-meta {
  width: 160px;
  text-align: right;
  color: #73e6b0;
}

.col-meta .power {
  color: var(--accent);
  font-weight: 800;
}

/* =========================
   MOBILE (FINAL)
========================= */
@media (max-width: 640px) {

  body {
    overflow-x: hidden;
  }

  /* Hide power column */
  th.col-power,
  td.col-power {
    display: none;
  }

  thead {
    display: none;
  }

  tbody td {
    font-size: 13px;
  }

  .col-meta {
    text-align: left;
    font-size: 12px;
  }
}

/* =========================
   ADMIN CARD BUTTON
========================= */
.kobra-card-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  margin: 16px 0;
  border-radius: 18px;
  text-decoration: none;
  max-width: 360px;

  background:
    linear-gradient(180deg, rgba(0,255,200,0.22), rgba(0,255,200,0.06)),
    radial-gradient(circle at top left, rgba(0,255,200,0.28), transparent 65%);
  border: 1px solid rgba(0,255,200,0.4);

  box-shadow:
    0 0 0 1px rgba(0,255,200,0.18) inset,
    0 14px 36px rgba(0,255,200,0.25);

  transition: all 0.3s ease;
}

.kobra-card-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 10px rgba(0,255,200,0.9));
}

.kobra-card-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.kobra-card-sub {
  font-size: 0.78rem;
  opacity: .7;
}
/* Visibility helpers */
.desktop-only { display: table-cell; }

@media (max-width: 640px) {
  .desktop-only { display: none; }
  .mobile-only  { display: inline; }
}
/* =========================
   ALLIANCE DOMINANCE – KOBRA
========================= */

.dominance {
  margin-top: 28px;
}

.dominance h2 {
  margin-bottom: 14px;
  font-size: 18px;
  letter-spacing: 0.5px;
}

.dominance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

/* Card */
.dominance-card {
  position: relative;
  padding: 16px 14px 14px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(0,255,200,0.10), rgba(0,0,0,0)),
    linear-gradient(145deg, #0d1324, #060a14);
  border: 1px solid rgba(255,255,255,0.08);

  box-shadow:
    inset 0 0 0 1px rgba(0,255,200,0.06),
    0 10px 26px rgba(0,0,0,0.45);

  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}

.dominance-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    inset 0 0 0 1px rgba(0,255,200,0.15),
    0 0 22px rgba(0,255,200,0.35),
    0 18px 40px rgba(0,0,0,0.6);
}

/* Rank badge */
.dom-rank {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 12px;
  font-weight: 800;
  color: #00ffc8;
  opacity: 0.85;
}

/* Alliance name */
.dom-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
  color: #eafffb;
}

/* Progress bar container */
.dom-bar {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

/* Progress bar fill */
.dom-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    #00ffc8,
    #00bfff
  );
  box-shadow: 0 0 12px rgba(0,255,200,0.6);
  transition: width .4s ease;
}

/* Percentage text */
.dom-meta {
  font-size: 12px;
  font-weight: 600;
  color: #9fb7c0;
  text-align: right;
}
.kobra-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kobra-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #eafffb;
}

.kobra-card-sub {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: rgba(200,255,245,0.65);
}
/* =========================
   SERVER OVERVIEW STATS
========================= */

.stats-overview {
  margin: 20px 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.stat-card {
  position: relative;
  padding: 18px 16px;
  border-radius: 16px;

  background:
    linear-gradient(180deg, rgba(0,255,200,0.14), rgba(0,0,0,0)),
    linear-gradient(145deg, #0d1324, #060a14);

  border: 1px solid rgba(255,255,255,0.08);

  box-shadow:
    inset 0 0 0 1px rgba(0,255,200,0.08),
    0 12px 32px rgba(0,0,0,0.55);

  text-align: center;
  transition: transform .25s ease, box-shadow .25s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(0,255,200,0.18),
    0 0 22px rgba(0,255,200,0.35),
    0 18px 40px rgba(0,0,0,0.6);
}

.stat-label {
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 700;
  color: rgba(200,255,245,0.65);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: var(--accent);
}
.kobra-card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 18px 0 24px;
}
.sub-power {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}
/* First Squad (S1) styling */
.sub-power {
  font-size: 11px;
  margin-top: 2px;

  /* DIFFERENT from total power */
  color: #9aa4b2;        /* soft grey-blue */
  font-weight: 500;
}

/* Mobile S1 */
.power.mobile-only span,
.power.mobile-only {
  color: inherit;
}

.power.mobile-only .sub-power {
  color: #9aa4b2;
}
/* S1 styling */
.sub-power,
.s1-inline {
  font-size: 11px;
  color: #7c8798;
  opacity: 0.85;
  white-space: nowrap;
}
.site-footer {
  background: rgba(10, 16, 24, 0.95);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 14px 10px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1200px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #9fb0b5;
}

.footer-inner nav {
  display: flex;
  gap: 16px;
}

.footer-inner a {
  color: #00ffae;
  text-decoration: none;
  font-weight: 500;
}

.footer-inner a:hover {
  text-decoration: underline;
}

/* Mobile */
@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
    gap: 8px;
  }
}
.top5-glory {
  margin: 26px 0;
}

.top5-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.glory-card {
  position: relative;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(145deg, #060b12, #04070c);
  border: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}

.rank-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  background: gold;
  color: #000;
  box-shadow: 0 0 14px rgba(255,215,0,.9);
}

.rank-1 {
  transform: scale(1.05);
  box-shadow: 0 0 26px rgba(255,215,0,.8);
}

.rank-2 { box-shadow: 0 0 20px rgba(192,192,192,.6); }
.rank-3 { box-shadow: 0 0 18px rgba(205,127,50,.6); }

.glory-name {
  margin-top: 16px;
  font-size: 1.05rem;
  font-weight: 700;
}

.glory-meta {
  margin-top: 6px;
  font-size: .78rem;
  opacity: .85;
  display: flex;
  justify-content: space-between;
}

.glory-power {
  margin-top: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #00ffc8;
}
.dominance-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dominance-card:hover {
  transform: translateY(-2px);
}

.dominance-card.active {
  outline: 2px solid #00ffc8;
  box-shadow: 0 0 18px rgba(0,255,200,.6);
}
.dom-insight {
  font-size: 0.8rem;
  margin-top: 4px;
  opacity: 0.9;
}

.dominance-card {
  transition: all 0.2s ease;
}

.dominance-card:hover {
  transform: translateY(-2px);
}

.dominance-card.active {
  outline: 2px solid #00ffc8;
  box-shadow: 0 0 20px rgba(0,255,200,.6);
}
/* =============================
   GLOBAL INTELLIGENCE LOADER
============================= */
.intel-loader {
  position: fixed;
  inset: 0;
  background: #05060a;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.map-layer {
  position: relative;
  width: 280px;
  height: 160px;
}

.world-map {
  width: 100%;
  opacity: 0.15;
}

.intel-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  background: #00ffc8;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 20px #00ffc8;
  animation: corePulse 1.5s infinite;
}

.pulse {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #00ffc8;
  border-radius: 50%;
  animation: travel 1.8s infinite;
}

/* Approx continent positions */
.p1 { top: 30%; left: 15%; animation-delay: 0s; }
.p2 { top: 45%; left: 30%; animation-delay: .4s; }
.p3 { top: 35%; left: 70%; animation-delay: .8s; }
.p4 { top: 60%; left: 80%; animation-delay: 1.2s; }
.p5 { top: 55%; left: 45%; animation-delay: 1.6s; }

@keyframes travel {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(1);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(70px, 40px) scale(0.3);
  }
}

@keyframes corePulse {
  0%,100% { box-shadow: 0 0 14px rgba(0,255,200,.7); }
  50% { box-shadow: 0 0 26px rgba(0,255,200,1); }
}


.intel-text {
  margin-top: 18px;
  font-size: 0.8rem;
  letter-spacing: 0.8px;
  opacity: 0.85;
  min-height: 1.2em;
  text-align: center;
}

.intel-text.fade {
  animation: intelFade 0.6s ease;
}

@keyframes intelFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 0.85; transform: translateY(0); }
}
.intel-text {
  margin-top: 18px;
  font-size: 0.85rem;
  letter-spacing: 1px;
  opacity: 0.85;
}
.intel-loader,
.map-layer,
.intel-core,
.pulse,
.flow-lines,
.progress-ring {
  transform: translateZ(0);
  will-change: transform, opacity;
}

/* Hide animation */
.intel-loader.hide {
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease;
}
.flow-lines {
  position: absolute;
  inset: 0;
}

.flow-lines line {
  stroke: rgba(0,255,200,0.4);
  stroke-width: 1;
  stroke-dasharray: 4;
  animation: flow 1.5s linear infinite;
}

@keyframes flow {
  to { stroke-dashoffset: -20; }
}
.progress-ring {
  position: relative;
  margin-top: 14px;
}

.progress-ring circle {
  fill: none;
  stroke: rgba(255,255,255,0.1);
  stroke-width: 4;
}

.progress-ring .progress {
  stroke: #00ffc8;
  stroke-dasharray: 163;
  stroke-dashoffset: 163;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset .3s ease;
}

.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}
.last-updated {
  margin: 6px 0 14px;
  font-size: 0.8rem;
  opacity: 0.75;
  text-align: right;
}
/* =============================
   TOP META (LAST UPDATED + CONTACT)
============================= */
.top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 14px;
  font-size: 0.8rem;
  opacity: 0.8;
  flex-wrap: wrap;
}

.last-updated {
  white-space: nowrap;
}

.contact-icon {
  text-decoration: none;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.contact-icon.discord {
  background: rgba(88, 101, 242, 0.15);
  color: #5865F2;
}

/* 📱 Mobile polish */
@media (max-width: 480px) {
  .top-meta {
    justify-content: flex-start;
    gap: 8px;
  }
}
/* =============================
   DISCORD ICON — KOBRA STYLE
============================= */
.discord-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: linear-gradient(
    145deg,
    rgba(0,255,200,0.12),
    rgba(88,101,242,0.18)
  );
  color: #00ffc8;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.discord-icon:hover {
  box-shadow:
    0 0 14px rgba(0,255,200,0.45),
    inset 0 0 0 1px rgba(0,255,200,0.4);
  transform: translateY(-1px);
}

.discord-svg {
  width: 18px;
  height: 18px;
  display: block;
}

.discord-label {
  font-size: 0.8rem;
  letter-spacing: 0.3px;
}

/* Mobile */
@media (max-width: 480px) {
  .discord-label {
    display: none; /* icon-only on small screens */
  }
}
/* Neon rank number */
.rank-num {
  color: #00ffc8;
  font-weight: 700;
}

/* Power number */
.power,
.power-num {
  color: #00ffc8;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Small M */
.power-m {
  font-size: 0.65em;
  opacity: 0.75;
  margin-left: 1px;
}

/* Sub power */
.sub-power,
.s1-inline {
  font-size: 0.72rem;
  color: #8fa3a6;
}

/* Alliance */
.alliance {
  color: #e3b873;
  font-weight: 600;
}
/* =============================
   GLOBAL LEADERBOARD COLORS
   (Desktop + Mobile SAME)
============================= */

/* Rank number */
.rank-num {
  color: #00ffc8;
  font-weight: 700;
}

/* Power number */
.power,
.power-num {
  color: #00ffc8;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Small M */
.power-m {
  font-size: 0.65em;
  opacity: 0.75;
  margin-left: 1px;
}

/* S1 / sub power */
.sub-power,
.s1-inline {
  color: #8fa3a6;
  font-size: 0.72rem;
}

/* Alliance tag */
.alliance {
  color: #e3b873;
  font-weight: 600;
}
/* =========================
   HEADER / NAV
========================= */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(5, 10, 18, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.site-header .logo a {
  color: #00ffc8;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
  text-decoration: none;
}

/* NAV LINKS */
.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap; /* IMPORTANT: prevents hiding on small screens */
}

.nav a {
  position: relative;
  color: #d8fdf3;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.85;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.nav a:hover {
  opacity: 1;
  color: #00ffc8;
}

/* =========================
   BADGE LINK (Experimental)
========================= */
.badge-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Badge style */
.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* De-emphasize experimental link slightly */
.badge-link {
  opacity: 0.75;
}

.badge-link:hover {
  opacity: 1;
}

/* =========================
   MOBILE SAFETY
========================= */
@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav {
    width: 100%;
    gap: 14px;
  }

  .nav a {
    font-size: 13px;
  }
}
/* =========================
   LWServers Skin Overlay
========================= */

body.kobra-dark {
  background: radial-gradient(ellipse at top, #0b1320 0%, #05080f 60%);
  color: #e6f2f0;
}

/* Replace aggressive headers */
.kobra-header {
  display: none;
}

/* Constrain content like other pages */
.panel {
  max-width: 1100px;
  margin: 0 auto 24px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 18px 20px;
}

/* Buttons match LWServers */
#analyzeBtn {
  background: linear-gradient(135deg, #00ffc8, #00bfff);
  color: #022;
  font-weight: 600;
  border-radius: 10px;
  border: none;
}

/* Tone down neon glow */
.alliance-card,
.matchup-card {
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.06);
}
/* =========================
   DUAL CTA ROW
========================= */

/* =========================
   CTA GRID (AUTO-FIT)
========================= */

.kobra-card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin: 22px 0;
  align-items: stretch;
}

/* Ensure all cards fill their grid cell */
.kobra-card-row .kobra-card-btn {
  width: 100%;
  height: 100%;
}
.discord-request-card{
  max-width:420px;
  background:#0b1220;
  border:1px solid rgba(114,164,242,.25);
  border-radius:16px;
  padding:18px;
  box-shadow:0 0 20px rgba(114,164,242,.15);
}

.discord-header{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  color:#72a4f2;
  margin-bottom:10px;
}

.discord-header img{
  width:26px;
  height:26px;
}

.discord-text{
  font-size:14px;
  line-height:1.6;
  color:#cdd6f4;
  margin-bottom:14px;
}

.discord-btn{
  display:block;
  text-align:center;
  padding:12px;
  border-radius:12px;
  background:linear-gradient(135deg,#5865F2,#72a4f2);
  color:#fff;
  font-weight:700;
  text-decoration:none;
  margin-bottom:10px;
}

.discord-btn:hover{
  box-shadow:0 0 18px rgba(114,164,242,.6);
}

.discord-note{
  font-size:12px;
  opacity:.7;
  text-align:center;
}
.discord-header svg{
  width:26px;
  height:26px;
  fill:#72a4f2;
  filter:drop-shadow(0 0 6px rgba(114,164,242,.6));
}
.discord-header svg{
  width:18px;
  height:18px;
  fill:#72a4f2;
  filter:drop-shadow(0 0 4px rgba(114,164,242,.5));
}
.discord-header svg{
  width:14px;
  height:14px;
}
.discord-icon-btn{
  width:36px;
  height:36px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:rgba(114,164,242,.12);
  border:1px solid rgba(114,164,242,.35);
  transition:.2s ease;
}

.discord-icon-btn svg{
  width:16px;
  height:16px;
  fill:#72a4f2;
}

.discord-icon-btn:hover{
  background:rgba(114,164,242,.22);
  box-shadow:0 0 10px rgba(114,164,242,.6);
  transform:translateY(-1px);
}
.discord-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(88, 101, 242, 0.15);
  border: 1px solid rgba(88, 101, 242, 0.4);
  color: #e6eef0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.25s ease;
}

.discord-cta:hover {
  background: rgba(88, 101, 242, 0.35);
  box-shadow: 0 0 18px rgba(88, 101, 242, 0.6);
  transform: translateY(-1px);
}

.discord-icon svg {
  width: 18px;
  height: 18px;
  fill: #9aa5ff;
}

.discord-text {
  white-space: nowrap;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: 360px;
  background: #0b1118;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 16px;
  color: #e6eef0;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: none;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
}

.modal-row {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
  font-size: 14px;
}

.label {
  color: #93a3a6;
}

.modal-body input {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: #05080d;
  color: #e6eef0;
}

.modal-hint {
  font-size: 12px;
  color: #ffb3b3;
  margin-top: 8px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.btn-primary {
  background: #00ffc8;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #e6eef0;
  padding: 8px 14px;
  border-radius: 8px;
}
.power-tag {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
  white-space: nowrap;
}

.power-tag.confirmed {
  color: #7dffb3;
}

.power-tag.estimated {
  color: #ffd27d;
}
.power-legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: #93a3a6;
  margin: 6px 0 10px;
}
table tr {
  height: 44px;
}

.col-name {
  font-weight: 600;
}

.sub-power {
  font-size: 11px;
  opacity: 0.7;
}

.col-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.power-num {
  font-size: 16px;
  font-weight: 800;
}

.power-m {
  font-size: 12px;
  margin-left: 2px;
  opacity: 0.8;
}
tbody tr {
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: rgba(0, 255, 200, 0.04);
}

.edit-power-btn {
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

tbody tr:hover .edit-power-btn {
  opacity: 1;
}
thead th {
  position: sticky;
  top: 0;
  background: #05080d;
  z-index: 2;
}
.table-context {
  font-size: 12px;
  color: #93a3a6;
  margin-bottom: 6px;
}
/* =========================
   MOBILE PLAYER CARDS
========================= */

.mobile-list {
  display: none;
}

  .mobile-list {
    display: block;
  }

  .mobile-card {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .m-row-1 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
  }

  .m-rank {
    color: #00ffc8;
    min-width: 22px;
  }

  .m-name {
    flex: 1;
  }

  .m-power {
    opacity: 0.9;
  }

  .m-row-2 {
    margin-top: 4px;
    font-size: 13px;
    color: #93a3a6;
  }

  .m-row-3 {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
  }

  .m-status.confirmed {
    color: #32d27c;
  }

  .m-status.estimated {
    color: #f5c26b;
  }

/* =========================
   MOBILE PLAYER CARDS (FIXED)
========================= */

.mobile-card {
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.m-row-1 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
}

.m-rank {
  color: #00ffc8;
  min-width: 22px;
  font-weight: 700;
}

.m-name {
  flex: 1;
}

.m-power {
  font-size: 15px;
  opacity: 0.9;
}

.m-row-2 {
  margin-top: 4px;
  font-size: 13px;
  color: #93a3a6;
}

.m-row-3 {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.m-status {
  margin-left: auto;
  font-size: 14px;
}

.m-status.confirmed {
  color: #32d27c;
}

.m-status.estimated {
  color: #f5c26b;
}
/* ===== MOBILE CARD FIX ===== */

.m-row-1 {
  display: flex;
  align-items: center;
  gap: 12px; /* 🔑 creates space between rank & name */
}

.m-rank {
  min-width: 26px;
  text-align: right;
  font-weight: 700;
  color: #00ffc8;
}

.m-name {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
}

.m-power {
  font-size: 15px;
  opacity: 0.9;
  color: #00ffc8;
}

/* Meta */
.m-row-2 {
  margin-left: 38px; /* aligns under name, not rank */
  font-size: 13px;
  color: #93a3a6;
  margin-top: 2px;
}

/* Squad + status */
.m-row-3 {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
}

.m-squad {
  opacity: 0.9;
}

.m-status {
  font-size: 14px;
}

.m-status.confirmed {
  color: #32d27c;
}

.m-status.estimated {
  color: #f5c26b;
}
/* ===== MOBILE LAYOUT ===== */

.m-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.m-left {
  max-width: 65%;
}

.m-name-line {
  display: flex;
  gap: 10px;
  align-items: center;
}

.m-rank {
  min-width: 22px;
  text-align: right;
  font-weight: 700;
  color: #00ffc8;
}

.m-name {
  font-size: 16px;
  font-weight: 600;
}

.m-meta {
  margin-left: 32px;
  margin-top: 2px;
  font-size: 13px;
  color: #93a3a6;
}

/* RIGHT SIDE */
.m-right {
  text-align: right;
}

.m-power {
  font-size: 16px;
  font-weight: 600;
  color: #00ffc8;
}

.m-sub {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
}

/* STATUS COLORS */
.m-status.confirmed { color: #32d27c; }
.m-status.estimated { color: #f5c26b; }

.m-status {
  position: relative;
  cursor: pointer;
}

.m-status::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 140%;
  right: 0;
  background: rgba(14, 180, 180, 0.9);
  color: #e6eef0;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: 0.15s;
}

.m-status:active::after,
.m-status:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* ================================
   MOBILE ROW GRID (FINAL)
================================ */
.mobile-cell {
  padding: 10px 0;
}

.m-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  column-gap: 12px;
}

/* RANK */
.m-rank {
  font-weight: 600;
  color: #2de6c5;
  text-align: right;
}

/* CENTER */
.m-center {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.m-name {
  font-size: 15px;
  font-weight: 600;
  color: #e9f2f1;
}

.m-meta {
  font-size: 12px;
  color: #8fa7a4;
}

/* RIGHT */
.m-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.m-power {
  font-size: 15px;
  font-weight: 700;
  color: #2de6c5;
}

.m-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9fb8b5;
}

/* STATUS ICON */
.m-status {
  font-size: 13px;
}

.m-status.confirmed {
  color: #27d17f;
}

.m-status.estimated {
  color: #9fb8b5;
}
@media (max-width: 768px) {

  .m-row {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    column-gap: 14px;
    align-items: center;
  }

  .m-rank {
    font-weight: 700;
    color: #35ffd2;
    text-align: left;
  }

  .m-center {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .m-name {
    font-size: 15px;
    font-weight: 600;
  }

  .m-meta {
    font-size: 12px;
    color: #93a3a6;
  }

  .m-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
  }

  .m-power {
    font-size: 15px;
    font-weight: 700;
    color: #35ffd2;
  }

  .m-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #bfc9cc;
  }

  .m-status.confirmed {
    color: #2ecc71;
  }

  .m-status.estimated {
    color: #f1c40f;
  }
}
.m-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* 🔑 THIS is critical */
}

.m-sub {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* 🔑 keeps squad away from center */
  gap: 8px;
  margin-top: 2px;
  font-size: 12px;
  opacity: 0.9;
}
.m-rank {
  min-width: 26px;
  margin-right: 6px;
  font-weight: 700;
  color: #35ffd2;
}
.m-status {
  cursor: help;
}
.m-power {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.1;
}

/* Confirmed = confident but not loud */
.m-power.confirmed {
  color: #2ef0c2; /* your teal */
}

/* Estimated = softer, analytical */
.m-power.estimated {
  color: #9fbfb8;
}
.m-sub {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
  text-align: right;
}
.power-legend {
  display: flex;
  gap: 12px;
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 6px;
}

.power-legend .confirmed { color: #2ef0c2; }
.power-legend .estimated { color: #e5f13b; }
/* MOBILE GRID */
.mobile-cell {
  padding: 12px 10px;
}

.m-grid {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: start;
}

/* RANK */
.m-rank {
  font-weight: 700;
  color: var(--accent);
}

/* CENTER */
.m-name {
  font-weight: 600;
  line-height: 1.2;
}

.m-meta {
  font-size: 12px;
  opacity: 0.65;
  margin-top: 2px;
}

/* RIGHT */
.m-right {
  text-align: right;
}

.m-power {
  font-weight: 700;
  font-size: 15px;
}

/* STATUS VIA COLOR */
.m-power.confirmed {
  color: #2ef2b1; /* green */
}

.m-power.estimated {
  color: #dfeb3c; /* soft blue */
}

.m-squad {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 2px;
}
/* DEFAULT */
.desktop-only { display: table-cell; }
.mobile-only  { display: none; }

/* MOBILE */
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only  { display: table-cell !important; }

  table {
    display: table !important;
  }
}
/* =============================
   ADMIN ONLY ELEMENTS
============================= */

/* Hidden everywhere by default */
.admin-only {
  display: none !important;
}

/* Visible ONLY when admin */
body.admin-view .admin-only {
  display: table-cell !important;
}

/* Never show edit on mobile */
@media (max-width: 768px) {
  body.admin-view .admin-only {
    display: none !important;
  }
}
/* ADMIN BAR */
.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  margin-bottom: 12px;
  background: rgba(255, 70, 70, 0.08);
  border: 1px solid rgba(255, 70, 70, 0.25);
  border-radius: 8px;
}

.admin-badge {
  font-weight: 700;
  color: #ff4d4d;
  letter-spacing: 0.5px;
  font-size: 13px;
}

.admin-logout-btn {
  background: #ff4d4d;
  color: #fff;
  border: none;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
}

.admin-logout-btn:hover {
  opacity: 0.9;
}
/* Hide admin UI by default */
.admin-only {
  display: none !important;
}
/* ============================
   ELITE LEADERBOARD (SINGLE COLUMN)
============================ */

.player-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* CARD */
.player-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px 16px;
  transition: background 0.15s ease, border 0.15s ease;
}

.player-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(0,255,200,0.35);
}

/* MAIN ROW */
.pc-main {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 12px;
}

/* RANK */
.pc-rank {
  font-weight: 700;
  font-size: 16px;
  opacity: 0.85;
}

/* INFO */
.pc-info {
  display: flex;
  flex-direction: column;
}

.pc-name {
  font-size: 16px;
  font-weight: 600;
}

.pc-meta {
  font-size: 13px;
  opacity: 0.65;
}

/* POWER */
.pc-power {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 16px;
}

/* SUB ROW */
.pc-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.85;
}

/* STATUS */
.pc-status.confirmed {
  color: #00ffc8;
}

.pc-status.estimated {
  color: #ffb84d;
}

/* SQUAD */
.pc-squad {
  opacity: 0.9;
}

/* ADMIN */
.pc-edit {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.pc-edit:hover {
  border-color: #00ffc8;
  color: #00ffc8;
}

/* MOBILE TUNING */
@media (max-width: 640px) {
  .pc-main {
    grid-template-columns: 52px 1fr auto;
  }

  .pc-name {
    font-size: 15px;
  }

  .pc-power {
    font-size: 15px;
  }
}
.pc-main {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 16px;
  align-items: center;
}

.pc-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.pc-squad {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 4px;
}
.pc-power-meta {
  font-size: 12px;
  opacity: 0.65;
  margin-top: 2px;
}

.pc-power-meta.confirmed {
  color: rgba(0, 255, 200, 0.9);
}

.pc-power-meta.estimated {
  color: rgba(255, 184, 77, 0.9);
}
.pc-rank {
  font-size: 18px;
  font-weight: 700;
  color: #00ffc8;
  letter-spacing: 0.3px;
}
.pc-name {
  font-size: 17px;
  font-weight: 700;
  color: #05d1ac;
}
.pc-power-unit {
  font-size: 13px;
  font-weight: 600;
  color: rgba(2, 187, 147, 0.75);
  margin-left: 1px;
}
@media (max-width: 640px) {
  .pc-rank {
    font-size: 16px;
  }

  .pc-name {
    font-size: 16px;
    
  }

  .pc-power-value {
    font-size: 18px;
    color: rgba(2, 187, 147, 0.75);
  }
}
.pc-squad {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.75;
  margin-top: 4px;
  cursor: help;
}
.pc-power-meta {
  font-size: 12px;
  opacity: 0.55;
  margin-top: 2px;
}
.pc-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.pc-like {
  margin-top: 6px;
}

.like-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.like-btn:hover {
  color: #ff5c8a;
}

.like-btn:active {
  transform: scale(0.95);
}
/* =============================
   WARZONE MODAL
============================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: #121212;
  width: 92%;
  max-width: 420px;
  max-height: 80vh;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.modal-header {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}

.modal input {
  padding: 10px;
  border-radius: 8px;
  border: none;
  margin-bottom: 12px;
}

.modal-list {
  overflow-y: auto;
  flex: 1;
}

.modal-list div {
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
}

.modal-list div:hover {
  background: rgba(255,255,255,0.08);
}

.modal-close {
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

/* =============================
   WARZONE TRIGGER
============================= */
.warzone-trigger {
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  width: fit-content;
}

/* =============================
   ALLIANCE PREVIEW
============================= */
.alliance-preview {
  margin: 14px 0;
}

.preview-header {
  font-size: 14px;
  font-weight: 600;
}

.preview-sub {
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 6px;
}

.alliance-preview input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
}

.preview-results {
  margin-top: 8px;
  font-size: 14px;
}

.preview-results .result {
  padding: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  margin-bottom: 6px;
}

/* =============================
   WARZONE GRID – FIXED 3 COLUMNS
============================= */
.modal-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  overflow-y: auto;
  padding: 4px;
}

/* ALL WARZONES FULL WIDTH */
.wz-card.all {
  grid-column: 1 / -1;
}


.wz-card {
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.wz-card:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-2px);
}

.wz-card .wz-title {
  font-size: 15px;
  font-weight: 600;
}

.wz-card .wz-sub {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 4px;
}

/* ALL WARZONE CARD */
.wz-card.all {
  background: linear-gradient(135deg, #2b5876, #4e4376);
}
/* =============================
   FULLSCREEN MODAL (MOBILE)
============================= */
@media (max-width: 768px) {
  .modal {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    padding: 16px;
  }

  .modal-header {
    font-size: 18px;
    text-align: center;
    margin-bottom: 14px;
  }

  .modal-close {
    font-size: 16px;
    padding: 12px;
  }
}
/* =============================
   DIVE INTO DATA BUTTON
============================= */
.dive-trigger {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dive-title {
  font-size: 15px;
  font-weight: 600;
}

.dive-sub {
  font-size: 12px;
  opacity: 0.7;
}
/* =============================
   DISCOVERY GRID (2 PRODUCTS)
============================= */
.discovery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 16px 0;
}

/* STACK ON MOBILE */
@media (max-width: 768px) {
  .discovery-grid {
    grid-template-columns: 1fr;
  }
}

/* COMMON CARD STYLE */
.discovery-card {
  background: rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* =============================
   ALLIANCE PREVIEW CARD
============================= */
.discovery-card input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
}

.preview-header {
  font-size: 14px;
  font-weight: 600;
}

.preview-sub {
  font-size: 12px;
  opacity: 0.6;
}

/* =============================
   DIVE CARD
============================= */
.dive-trigger {
  cursor: pointer;
  justify-content: center;
}

.dive-title {
  font-size: 16px;
  font-weight: 600;
}

.dive-sub {
  font-size: 13px;
  opacity: 0.75;
}

.dive-hint {
  font-size: 12px;
  opacity: 0.5;
}
/* =============================
   DISCOVERY GRID – ALWAYS 2 CARDS
============================= */
.discovery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
}

/* MOBILE COMPACT TUNING */
@media (max-width: 768px) {
  .discovery-card {
    padding: 10px;
  }

  .dive-title {
    font-size: 14px;
  }

  .dive-sub {
    font-size: 11px;
  }

  .dive-hint {
    display: none; /* keep mobile clean */
  }

  .preview-header {
    font-size: 13px;
  }

  .preview-sub {
    font-size: 11px;
  }

  .discovery-card input {
    padding: 8px;
    font-size: 13px;
  }
}
@media (max-width: 768px) {
  .modal-list {
    grid-template-columns: repeat(4, 1fr);
  }
}
.wz-card.all {
  text-align: center;
  padding: 18px 10px;
}
/* =============================
   ALLIANCE GRID (NO SCROLL)
============================= */
#allianceCards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

/* ALLIANCE CARD */
#allianceCards .filter-card {
  padding: 10px 8px;
  text-align: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  font-size: 13px;
  white-space: normal; /* 🔑 allows wrapping */
}

/* ACTIVE ALLIANCE */
#allianceCards .filter-card.active {
  background: rgba(255,255,255,0.18);
  font-weight: 600;
}

/* HOVER / TAP FEEDBACK */
#allianceCards .filter-card:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}
/* =============================
   ALLIANCE GRID – SMART MOBILE
============================= */
#allianceCards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 8px;
}

/* MOBILE TUNING */
@media (max-width: 768px) {
  #allianceCards .filter-card {
    font-size: 11px;
    padding: 8px 4px;
  }
}
/* =============================
   NEON HIGHLIGHT (NAME + POWER)
============================= */

/* PLAYER NAME */
.pc-name {
  color: #7df9ff; /* neon cyan */
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* POWER VALUE */
.pc-power-value {
  color: #1cf3bd; /* neon green */
  font-weight: 700;
  text-shadow: 0 0 6px rgba(57, 255, 20, 0.35);
}

/* POWER UNIT (m) */
.pc-power-unit {
  color: rgba(255,255,255,0.6);
  margin-left: 1px;
}
/* =============================
   GOLDEN ALLIANCE META
============================= */

/* Meta line */
.pc-meta {
  font-size: 12px;
  opacity: 0.85;
}

/* Alliance name highlight */
.pc-meta .alliance-name {
  color: #f5c542; /* premium gold */
  font-weight: 600;
  letter-spacing: 0.3px;
}
@media (max-width: 768px) {
  .pc-meta {
    font-size: 11px;
  }
}
.kobra-card-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

/* Each card takes equal space */
.kobra-card-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0; /* important for mobile */
}

/* Mobile: still single row, no wrap */
@media (max-width: 768px) {
  .kobra-card-row {
    gap: 8px;
  }

  .kobra-card-btn {
    padding: 10px;
  }

  .kobra-card-title {
    font-size: 12px;
  }

  .kobra-card-sub {
    font-size: 10px;
  }
}
@media (max-width: 768px) {
  .kobra-card-row {
    display: grid;
    grid-template-columns: 1fr 2fr; /* 1/3 + 2/3 */
    grid-template-rows: auto auto;
    gap: 10px;
  }

  /* TOP 20 — left, full height */
  #globalTopToggle {
    grid-column: 1 / 2;
    grid-row: 1 / 3; /* spans both rows */
  }

  /* COMPARISONS — top right */
  .kobra-card-row .kobra-card-btn:nth-child(2) {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
  }

  /* ALLIANCE SHOWDOWN — bottom right */
  .kobra-card-row .kobra-card-btn:nth-child(3) {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
  }

  /* Compact text for mobile */
  .kobra-card-title {
    font-size: 12px;
  }

  .kobra-card-sub {
    font-size: 10px;
  }
}
@media (max-width: 768px) {
  #globalTopToggle {
    justify-content: center;
    text-align: center;
  }
}
.hidden {
  display: none !important;
}
/* =============================
   🥇 TOP RANK – FULL ROW CARD
============================= */

.top-rank-segment {
  width: 100%;
  margin: 16px 0 10px;
}

.top-rank-card {
  display: flex;
  align-items: center;
  justify-content: space-between;

  background: linear-gradient(
    90deg,
    #0b1a17,
    #071412
  );

  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 14px;

  padding: 14px 18px;
  box-shadow:
    0 0 0 1px rgba(255, 215, 0, 0.15),
    0 10px 28px rgba(0, 0, 0, 0.45);
}

/* Left side */
.top-rank-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Crown badge */
.top-rank-crown {
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.6));
}

/* Text block */
.top-rank-text {
  display: flex;
  flex-direction: column;
}

/* Label */
.top-rank-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffd700;
  font-weight: 700;
}

/* Player name */
.top-rank-name {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
}

/* Meta */
.top-rank-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}

/* Right side – power */
.top-rank-power {
  font-size: 22px;
  font-weight: 800;
  color: #00ffc8;
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 600px) {
  .top-rank-card {
    padding: 12px 14px;
  }

  .top-rank-name {
    font-size: 18px;
  }

  .top-rank-power {
    font-size: 18px;
  }

  .top-rank-crown {
    font-size: 26px;
  }
}
/* Right side column */
.top-rank-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Total Power */
.top-rank-power {
  font-size: 22px;
  font-weight: 800;
  color: #00ffc8;
  white-space: nowrap;
}

/* Estimated Squad 1 (S1) */
.top-rank-s1 {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}
/* Base Power Segment – Value Colors */
.segment.base-power span {
  font-weight: 700;
}

/* Positive (Alliance stronger) */
.base-power-positive span {
  color: #2eea8f; /* green */
}

/* Negative (Alliance weaker) */
.base-power-negative span {
  color: #ff6b6b; /* red */
}

/* Neutral */
.base-power-neutral span {
  color: rgba(255, 255, 255, 0.8);
}
/* Tooltip wrapper */
.info-tooltip {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 12px;
  cursor: help;
  color: rgba(255, 255, 255, 0.6);
}

/* Tooltip box */
.info-tooltip .tooltip-content {
  position: absolute;
  bottom: 125%;
  right: 0;
  width: 240px;
  background: #111;
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: all 0.15s ease;
  z-index: 1000;
}

/* Tooltip arrow */
.info-tooltip .tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 12px;
  border-width: 6px;
  border-style: solid;
  border-color: #111 transparent transparent transparent;
}

/* Show on hover */
.info-tooltip:hover .tooltip-content {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.segment {
  position: relative;
}
.alliance-data-credit {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.75;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ⓘ icon */
.credit-icon {
  display: none;
  font-size: 14px;
  cursor: pointer;
}

/* Desktop text */
.credit-text {
  display: inline;
}

.discord-link {
  color: #7dd3fc;
  text-decoration: none;
  font-weight: 500;
}

.discord-link:hover {
  text-decoration: underline;
}

/* 📱 Mobile behavior */
@media (max-width: 640px) {
  .credit-text {
    display: none;
  }

  .credit-icon {
    display: inline;
  }

  .alliance-data-credit {
    opacity: 0.65;
  }
}
.credit-sub {
  font-size: 11px;
  opacity: 0.85;
}
.result.reference {
  opacity: 0.75;
  border-left: 2px solid #7dd3fc;
  padding-left: 6px;
}

.ref-label {
  font-size: 11px;
  color: #7dd3fc;
  margin-right: 6px;
}
/* =============================
   Alliance → Warzone Lookup
   ============================= */

.alliance-lookup-card {
  background: linear-gradient(
    180deg,
    rgba(14, 20, 26, 0.95),
    rgba(9, 13, 18, 0.95)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px 16px;
  margin-left: 12px;
  min-width: 280px;
  max-width: 360px;
  box-shadow:
    0 0 0 1px rgba(0, 255, 200, 0.04),
    0 12px 24px rgba(0, 0, 0, 0.35);
}

/* Header */
.al-header {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #9fffe0;
  margin-bottom: 8px;
}

/* Input */
.alliance-lookup-card input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 200, 0.18);
  background: rgba(5, 8, 12, 0.9);
  color: #eafff7;
  font-size: 13px;
  outline: none;
}

.alliance-lookup-card input::placeholder {
  color: rgba(180, 255, 230, 0.45);
}

.alliance-lookup-card input:focus {
  border-color: #4dffd8;
  box-shadow: 0 0 0 1px rgba(77, 255, 216, 0.35);
}

/* Result */
.al-result {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.al-result strong {
  color: #4dffd8;
}

.al-result.muted {
  color: rgba(200, 230, 220, 0.45);
}

/* Credit */
.al-credit {
  margin-top: 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}
/* =============================
   Alliance Lookup – UI polish
============================= */

.al-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.al-main {
  font-size: 14px;
  color: #eafff7;
}

.al-date {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(200, 230, 220, 0.55);
}

.al-discord img {
  width: 18px;
  height: 18px;
  cursor: pointer;
  opacity: 0.85;
}

.al-discord img:hover {
  opacity: 1;
}
.discord-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 14px;
  background: #5865f2;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}
/* =============================
   Compact Centered Modal
============================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: #0e141a;
  border-radius: 14px;
  width: 90%;
  max-width: 320px;        /* 🔥 keeps it compact */
  padding: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  animation: modalPop 0.18s ease-out;
}

/* Header */
.modal-header {
  font-size: 14px;
  font-weight: 600;
  color: #9fffe0;
  margin-bottom: 10px;
  text-align: center;
}

/* Body */
.modal-body {
  text-align: center;
  font-size: 13px;
  color: #eafff7;
}

/* Close button */
.modal-close {
  margin-top: 14px;
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(255,255,255,0.14);
}

/* Animation */
@keyframes modalPop {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
/* =============================
   Compact Centered Modal (FINAL)
============================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: #0e141a;
  border-radius: 14px;
  width: 88%;
  max-width: 300px;        /* 🔥 SMALL MODAL */
  padding: 16px 16px 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  animation: modalPop 0.18s ease-out;
}

/* Header */
.modal-header {
  font-size: 14px;
  font-weight: 600;
  color: #9fffe0;
  text-align: center;
  margin-bottom: 8px;
}

/* Body */
.modal-body {
  text-align: center;
  font-size: 13px;
  color: #eafff7;
}

/* Discord button */
.discord-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 12px;
  background: #5865f2;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

/* Small close text button */
.modal-close {
  margin-top: 10px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

/* Animation */
@keyframes modalPop {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
/* =============================
   TRUE CENTERED DISCORD MODAL
============================= */

.discord-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.discord-modal-overlay.hidden {
  display: none;
}

.discord-modal {
  background: #0e141a;
  border-radius: 14px;

  /* 🔥 KEY FIXES */
  width: auto;
  min-width: 240px;
  max-width: 300px;
  padding: 16px;

  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  text-align: center;

  /* 🚫 override inherited layout */
  height: auto !important;
  max-height: none !important;
  position: relative !important;
  transform: none !important;
}

/* Header */
.discord-modal-header {
  font-size: 14px;
  font-weight: 600;
  color: #9fffe0;
  margin-bottom: 8px;
}

/* Body */
.discord-modal-body {
  font-size: 13px;
  color: #eafff7;
}

.discord-modal-body #discordAllianceName {
  margin-bottom: 12px;
}

/* Button */
.discord-btn {
  display: inline-block;
  padding: 8px 12px;
  background: #5865f2;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

/* Close */
.discord-modal-close {
  margin-top: 12px;
  background: none;
  border: none;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
}

.discord-modal-close:hover {
  color: #fff;
}

/* =============================
   Discord Coordination Modal
============================= */

.discord-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.discord-modal-overlay.hidden {
  display: none;
}

.discord-modal {
  background: #0e141a;
  border-radius: 14px;
  width: auto;
  min-width: 240px;
  max-width: 300px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);

  /* Hard isolation from layout bugs */
  position: relative !important;
  height: auto !important;
  transform: none !important;
}

/* Header */
.discord-modal-header {
  font-size: 14px;
  font-weight: 600;
  color: #9fffe0;
  margin-bottom: 8px;
}

/* Body */
.discord-modal-body {
  font-size: 13px;
  color: #eafff7;
}

/* Discord DP */
.discord-dp {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 6px auto 10px;
  display: block;
  border: 2px solid rgba(88, 101, 242, 0.6);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.6);
}

/* Alliance confirmation */
.alliance-confirm {
  margin-bottom: 10px;
  font-size: 14px;
}

/* Credit */
.alliance-credit {
  margin: 10px 0;
  font-size: 12px;
  color: rgba(200,230,220,0.7);
}

.alliance-credit span {
  color: #9fffe0;
}

/* Discord button */
.discord-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 12px;
  background: #5865f2;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

/* Note */
.discord-note {
  margin-top: 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

/* Close button */
.discord-modal-close {
  margin-top: 12px;
  background: none;
  border: none;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
}

.discord-modal-close:hover {
  color: #fff;
}
/* =============================
   Alliance Lookup – Result UI
============================= */

.alliance-lookup {
  margin-top: 8px;
}

#allianceLookupInput {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: #0f1a22;
  color: #eafff7;
  font-size: 14px;
  outline: none;
}

#allianceLookupInput::placeholder {
  color: rgba(200,230,220,0.45);
}

.al-result {
  margin-top: 8px;
  font-size: 13px;
  color: #eafff7;
}

.al-result.muted {
  color: rgba(200,230,220,0.45);
}

.al-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.al-main {
  font-size: 14px;
}

.al-date {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(200,230,220,0.55);
}

.al-discord img {
  width: 18px;
  height: 18px;
  cursor: pointer;
  opacity: 0.85;
}

.al-discord img:hover {
  opacity: 1;
}

/* casing warning */
.al-warning {
  margin-top: 6px;
  font-size: 12px;
  color: #ffb84d;
}

/* =============================
   Discord Coordination Modal
============================= */

.discord-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.discord-modal-overlay.hidden {
  display: none;
}

.discord-modal {
  background: #0e141a;
  border-radius: 14px;
  min-width: 240px;
  max-width: 300px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);

  /* force isolation from layouts */
  position: relative !important;
  height: auto !important;
  transform: none !important;
}

.discord-modal-header {
  font-size: 14px;
  font-weight: 600;
  color: #9fffe0;
  margin-bottom: 8px;
}

.discord-modal-body {
  font-size: 13px;
  color: #eafff7;
}

/* Discord DP */
.discord-dp {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: block;
  margin: 6px auto 10px;
  border: 2px solid rgba(88,101,242,0.6);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.6);
}

/* Alliance confirmation */
.alliance-confirm {
  margin-bottom: 10px;
  font-size: 14px;
}

/* Credit */
.alliance-credit {
  margin: 10px 0;
  font-size: 12px;
  color: rgba(200,230,220,0.7);
}

.alliance-credit span {
  color: #9fffe0;
}

/* Discord button */
.discord-btn {
  display: inline-block;
  padding: 8px 12px;
  background: #5865f2;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

.discord-note {
  margin-top: 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

.discord-modal-close {
  margin-top: 12px;
  background: none;
  border: none;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
}

.discord-modal-close:hover {
  color: #fff;
}
.discord-modal-banner {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 10px;
}
/* Alliance Lookup */
.alliance-lookup {
  margin-top: 12px;
}

.alliance-lookup input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: #0f172a;
  border: 1px solid #1e293b;
  color: #e5e7eb;
  font-size: 14px;
}

.al-result {
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #020617;
  font-size: 14px;
}

.al-result.muted {
  color: #64748b;
}

.al-result.found {
  color: #22c55e;
  cursor: pointer;
}

.al-result.warn {
  color: #facc15;
}

/* Modal Overlay */
.discord-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.discord-modal-overlay.hidden {
  display: none;
}

/* Modal Box */
.discord-modal {
  width: 92%;
  max-width: 360px;
  background: #020617;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

/* Banner */
.discord-modal-banner {
  width: 100%;
  height: auto;
}

/* Body */
.discord-modal-body {
  padding: 16px;
  text-align: center;
}

.discord-modal-body h3 {
  margin: 6px 0 10px;
}

/* Info */
.modal-info {
  font-size: 14px;
  margin-bottom: 10px;
}

.modal-updated {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 4px;
}

/* Credit */
.modal-credit {
  font-size: 12px;
  color: #cbd5f5;
  margin-bottom: 12px;
}

/* Discord Button */
.discord-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #5865f2;
  color: white;
  text-decoration: none;
  padding: 10px;
  border-radius: 10px;
  font-weight: 600;
}

.discord-btn img {
  width: 20px;
  height: 20px;
}

/* Note */
.modal-note {
  margin-top: 8px;
  font-size: 11px;
  color: #94a3b8;
}

/* Close */
.discord-modal-close {
  margin-top: 10px;
  width: 100%;
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 8px;
  cursor: pointer;
}
/* Compact result row */
.al-row-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* Status icons */
.al-status.ok {
  color: #22c55e;
  font-size: 14px;
}

.al-status.warn {
  color: #facc15;
  font-size: 14px;
}

/* Main text */
.al-main {
  font-size: 14px;
}

.al-arrow {
  margin: 0 4px;
  color: #94a3b8;
}

.al-wz {
  color: #38bdf8;
  font-weight: 600;
}

/* Discord icon */
.al-discord-icon {
  width: 16px;
  height: 16px;
  opacity: 0.85;
}

/* Coordinate button */
.al-btn {
  background: #1e293b;
  color: #e5e7eb;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.al-btn:hover {
  background: #334155;
}

/* Credit line */
.al-credit {
  margin-top: 4px;
  font-size: 11px;
  color: #94a3b8;
}

/* Warning text */
.al-warning-text {
  font-size: 12px;
  color: #facc15;
}

/* Muted state */
.al-muted {
  font-size: 12px;
  color: #64748b;
}
/* =========================
   ALLIANCE LOOKUP CARD
========================= */
.alliance-lookup-card {
  background: linear-gradient(180deg, #020617, #020617cc);
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 14px;
  margin-top: 10px;
}

/* Header */
.al-header {
  margin-bottom: 10px;
}

.al-title {
  font-size: 15px;
  font-weight: 600;
  color: #e5e7eb;
}

.al-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Input */
.alliance-lookup-card input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  background: #020617;
  border: 1px solid #334155;
  color: #e5e7eb;
  font-size: 14px;
  outline: none;
}

.alliance-lookup-card input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px #38bdf8;
}

/* Helper text */
.al-helper {
  margin-top: 6px;
  font-size: 11px;
  color: #64748b;
}

/* Result container (used by JS) */
.al-result {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #020617;
  border: 1px solid #1e293b;
}

/* Result states */
.al-result.found {
  border-color: #14532d;
}

.al-result.warn {
  border-color: #78350f;
}

.al-result.muted {
  border-color: #1e293b;
}

/* Text helpers */
.al-muted {
  font-size: 13px;
  color: #94a3b8;
}

.al-credit {
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
}
/* =========================
   COMPACT ALLIANCE LOOKUP CARD
========================= */
.alliance-lookup-card {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 8px;
  max-width: 100%;
}

/* Header */
.al-header {
  margin-bottom: 4px;
}

.al-title {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Input */
.alliance-lookup-card input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: #020617;
  border: 1px solid #334155;
  color: #e5e7eb;
  font-size: 13px;
  outline: none;
}

.alliance-lookup-card input::placeholder {
  color: #64748b;
}

.alliance-lookup-card input:focus {
  border-color: #38bdf8;
}

/* Helper text */
.al-helper {
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
}

/* Result container */
.al-result {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #020617;
  border: 1px solid #1e293b;
  font-size: 12px;
  line-height: 1.3;
}

/* States (used by JS) */
.al-result.found {
  border-color: #14532d;
}

.al-result.warn {
  border-color: #78350f;
}

.al-result.muted {
  border-color: #1e293b;
}

/* Credit */
.al-credit {
  font-size: 10px;
  color: #64748b;
}

/* Mobile tightening */
@media (max-width: 480px) {
  .alliance-lookup-card {
    padding: 6px;
  }

  .al-title {
    font-size: 12px;
  }

  .al-helper {
    font-size: 10px;
  }
}
/* Match Dive into Server Data card */
.alliance-lookup-card {
  background: linear-gradient(180deg, #020617, #020617cc);
  border: 1px solid #1e293b;
  border-radius: 16px;              /* match other cards */
  padding: 14px 14px 12px;
  min-height: 120px;                /* visual symmetry */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
/* Compact centered input */
.alliance-lookup-card input {
  width: 180px;              /* perfect for 3–5 chars */
  max-width: 100%;
  margin: 6px auto 0;        /* center horizontally */
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;      /* pill style */
  background: #020617;
  border: 1px solid #334155;
  color: #e5e7eb;
  font-size: 13px;
  text-align: center;        /* short text looks better */
}

.alliance-lookup-card input::placeholder {
  color: #64748b;
  font-size: 12px;
}

.alliance-lookup-card input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px #38bdf8;
}
.al-header {
  text-align: center;
  margin-bottom: 6px;
}

.al-title {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
}
.al-helper {
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
}

.al-result {
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #020617;
  border: 1px dashed #1e293b;   /* subtle, tool-like */
  text-align: center;
}

.al-credit {
  font-size: 10px;
  color: #048da5;
}
/* =============================
   DISCOVERY GRID (FIX)
============================= */
.discovery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch; /* 🔥 THIS is mandatory */
}
.discovery-card,
.alliance-lookup-card {
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* 🔥 balances top/bottom */
}
.discovery-card,
.alliance-lookup-card {
  min-height: 132px; /* tune 120–140 if needed */
}

.server-tools-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}
.server-dive-card,
.alliance-lookup-card {
  min-width: 0;        /* CRITICAL for grid children */
  overflow: hidden;
}
@media (max-width: 420px) {
  .alliance-lookup-card input {
    width: 150px;     /* still centered, still usable */
  }

  .al-helper {
    font-size: 10px;
  }
}
/* =============================
   ALIGN ALLIANCE LOOKUP
   WITH DISCOVERY CARDS
============================= */

/* Make it behave like discovery-card */
.alliance-lookup-card {
  background: linear-gradient(180deg, #020617, #020617cc);
  border: 1px solid #1e293b;
  border-radius: 18px;
  padding: 14px;
  min-height: 130px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

/* Header = same weight as dive-title */
.alliance-lookup-card .al-title {
  font-size: 15px;
  font-weight: 600;
  color: #e5e7eb;
}

/* Helper = same tone as dive-sub */
.alliance-lookup-card .al-helper {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Input = primary content line (like activeWarzoneLabel) */
.alliance-lookup-card input {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  padding: 0 12px;

  background: rgba(255,255,255,0.06);
  border: 1px solid #334155;
  color: #e5e7eb;

  font-size: 14px;
}

.alliance-lookup-card input::placeholder {
  color: #64748b;
}

.alliance-lookup-card input:focus {
  outline: none;
  border-color: #38bdf8;
}

/* Result area — subtle like preview text */
.alliance-lookup-card .al-result {
  margin-top: 6px;
  padding: 6px 0;
  font-size: 13px;
  color: #94a3b8;
  border: none;
  background: transparent;
}

/* Credit = same visual weight as dive-hint */
.alliance-lookup-card .al-credit {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

/* Grid behavior — keep side by side always */
.discovery-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 14px;
}

.discovery-card,
.alliance-lookup-card {
  min-width: 0;
}
/* =============================
   WARZONE MODAL – CENTERED
============================= */

/* Overlay centers modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Modal box */
.modal {
  width: min(92vw, 420px);
  max-height: 80vh;

  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 14px;

  display: flex;
  flex-direction: column;
}

/* Header */
.modal-header {
  font-size: 15px;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 8px;
  text-align: center;
}

/* Search input */
#warzoneSearchInput {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  margin-bottom: 10px;

  border-radius: 10px;
  background: #020617;
  border: 1px solid #334155;
  color: #e5e7eb;
  font-size: 13px;
}

#warzoneSearchInput::placeholder {
  color: #64748b;
}

#warzoneSearchInput:focus {
  outline: none;
  border-color: #38bdf8;
}

/* =============================
   WARZONE GRID – 4 PER ROW
============================= */

.modal-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;

  overflow-y: auto;
  padding: 4px;
  margin-bottom: 10px;
}

/* Individual warzone item */
.modal-list > div {
  padding: 8px 0;
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  cursor: pointer;

  background: #020617;
  border: 1px solid #1e293b;
  color: #e5e7eb;
}

.modal-list > div:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

/* Close button */
.modal-close {
  margin-top: auto;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(255,255,255,0.06);
}

/* =============================
   MOBILE SAFETY
============================= */

@media (max-width: 420px) {
  .modal {
    width: 94vw;
  }

  .modal-list {
    grid-template-columns: repeat(4, 1fr); /* still 4 */
    gap: 6px;
  }

  .modal-list > div {
    font-size: 12px;
    padding: 6px 0;
  }
}
/* =============================
   WARZONE MODAL – CENTERED
============================= */

/* Overlay centers modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Modal box */
.modal {
  width: min(92vw, 420px);
  max-height: 80vh;

  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 14px;

  display: flex;
  flex-direction: column;
}

/* Header */
.modal-header {
  font-size: 15px;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 8px;
  text-align: center;
}

/* Search input */
#warzoneSearchInput {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  margin-bottom: 10px;

  border-radius: 10px;
  background: #020617;
  border: 1px solid #334155;
  color: #e5e7eb;
  font-size: 13px;
}

#warzoneSearchInput::placeholder {
  color: #64748b;
}

#warzoneSearchInput:focus {
  outline: none;
  border-color: #38bdf8;
}

/* =============================
   WARZONE GRID – 4 PER ROW
============================= */

.modal-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;

  overflow-y: auto;
  padding: 4px;
  margin-bottom: 10px;
}

/* Individual warzone item */
.modal-list > div {
  padding: 8px 0;
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  cursor: pointer;

  background: #020617;
  border: 1px solid #1e293b;
  color: #e5e7eb;
}

.modal-list > div:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

/* Close button */
.modal-close {
  margin-top: auto;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(255,255,255,0.06);
}

/* =============================
   MOBILE SAFETY
============================= */

@media (max-width: 420px) {
  .modal {
    width: 94vw;
  }

  .modal-list {
    grid-template-columns: repeat(4, 1fr); /* still 4 */
    gap: 6px;
  }

  .modal-list > div {
    font-size: 12px;
    padding: 6px 0;
  }
}
/* =============================
   MODAL OVERLAY — TRUE CENTER
============================= */
.modal-overlay {
  position: fixed;
  inset: 0;

  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(6px);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 9999;
}

/* =============================
   MODAL BOX — LOCKED CENTER
============================= */
.modal {
  position: relative; /* important */

  width: min(92vw, 420px);
  max-height: 80vh;

  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 16px;

  padding: 14px;

  display: flex;
  flex-direction: column;

  /* 🚫 remove any margin / translate / left rules */
  margin: 0;
  left: auto;
  right: auto;
  top: auto;
  transform: none;
}

/* =============================
   MODAL HEADER
============================= */
.modal-header {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 8px;
}

/* =============================
   SEARCH INPUT
============================= */
#warzoneSearchInput {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  margin-bottom: 10px;

  border-radius: 10px;
  background: #020617;
  border: 1px solid #334155;
  color: #e5e7eb;
  font-size: 13px;
}

#warzoneSearchInput:focus {
  outline: none;
  border-color: #38bdf8;
}

/* =============================
   WARZONE GRID — 4 PER ROW
============================= */
.modal-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;

  overflow-y: auto;
  padding: 4px;
}

/* Individual warzone card */
.modal-list > div {
  text-align: center;
  padding: 8px 0;

  border-radius: 8px;
  border: 1px solid #1e293b;
  background: #020617;

  color: #e5e7eb;
  font-size: 13px;
  cursor: pointer;
}

.modal-list > div:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: #38bdf8;
}

/* =============================
   CLOSE BUTTON
============================= */
.modal-close {
  margin-top: 12px;
  padding: 8px;

  border-radius: 10px;
  border: 1px solid #334155;
  background: transparent;

  color: #e5e7eb;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(255,255,255,0.06);
}

/* =============================
   MOBILE — STILL CENTERED
============================= */
@media (max-width: 420px) {
  .modal {
    width: 94vw;
    max-height: 85vh;
  }

  .modal-list {
    gap: 6px;
  }
}
/* =============================
   ACTIVE WARZONE HIGHLIGHT
============================= */
#activeWarzoneLabel {
  display: inline-block;

  font-size: 16px;          /* bigger than surrounding text */
  font-weight: 700;         /* strong emphasis */

  color: #38bdf8;           /* LWServers accent blue */

  margin-left: 4px;

  /* subtle glow for importance */
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.35);
}
#activeWarzoneLabel {
  padding: 2px 8px;
  border-radius: 999px;

  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
}
/* Keep sub content centered and aligned */
.dive-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  text-align: center;
}
/* Keep sub content centered and aligned */
.dive-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  text-align: center;
}
#activeWarzoneLabel {
  font-size: 16px;
  font-weight: 700;
  color: #38bdf8;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.35);
}
/* =============================
   MOBILE WARZONE HIERARCHY
============================= */
@media (max-width: 480px) {

  .dive-sub {
    display: flex;
    flex-direction: column-reverse; /* 🔥 key trick */
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
  }

  /* Primary — warzone value */
  #activeWarzoneLabel {
    font-size: 18px;
    font-weight: 800;
    color: #38bdf8;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
    margin: 0;
  }

  /* Secondary — helper text */
  .dive-sub::before {
    content: "Currently viewing";
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
  }

  /* Hide original inline text */
  .dive-sub {
    font-size: 0;
  }
}
@media (max-width: 480px) {
  #activeWarzoneLabel {
    cursor: pointer;
  }
}
/* Neon green brand highlight */
.al-credit-brand {
  color: #22f7a6; /* neon green */
  font-weight: 600;
  text-shadow:
    0 0 6px rgba(34, 247, 166, 0.6),
    0 0 12px rgba(34, 247, 166, 0.35);
}

/* Keep rest subtle */
.al-credit {
  font-size: 11px;
  color: #64748b;
}
/* Credit container */
.al-credit {
  margin-top: 10px;
  font-size: 11.5px;
  color: #6b7280;
  text-align: center;
}

/* MAIN EMPHASIS */
.al-credit-brand {
  color: #22f7a6; /* LW neon green */
  font-weight: 700;
  margin: 0 2px;
  text-shadow:
    0 0 6px rgba(34, 247, 166, 0.65),
    0 0 14px rgba(34, 247, 166, 0.35);
}

/* Secondary label */
.al-credit-muted {
  color: #8b9bb4;
  font-weight: 500;
}

/* Optional micro polish */
.al-credit-brand:hover {
  text-shadow:
    0 0 10px rgba(34, 247, 166, 0.9),
    0 0 22px rgba(34, 247, 166, 0.6);
}
.al-row-compact {
  display: flex;
  align-items: center;
  gap: 10px;
}

.al-action {
  margin-left: auto;
}
.al-row-compact {
  display: flex;
  align-items: center;
  gap: 10px;
}

.al-action {
  margin-left: auto;
}
@media (max-width: 640px) {
  .al-row-compact {
    flex-wrap: wrap;
  }

  .al-action {
    width: 100%;
    margin-top: 10px;
  }

  .al-action .al-btn {
    width: 100%;
    padding: 10px 0;
    font-size: 14px;
  }
}
/* =============================
   ADMIN LINKS / ACTIONS
============================= */

.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  margin-top: 10px;
  padding: 8px 12px;

  background: #2c2c2c;
  color: #f5f5f5;

  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;

  border: 1px solid #3a3a3a;
  cursor: pointer;

  transition: background 0.2s ease, border-color 0.2s ease;
}

.admin-link:hover {
  background: #3a3a3a;
  border-color: #555;
}

.admin-link:active {
  transform: translateY(1px);
}

/* Optional warning emphasis for conflicts */
.admin-link.conflicts {
  background: #3b1f1f;
  border-color: #5a2a2a;
}

.admin-link.conflicts:hover {
  background: #4a2626;
}

/* =============================
   HIDDEN UTILITY
============================= */
.hidden {
  display: none !important;
}
.pc-g1 {
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.9;
}

.g1-positive {
  color: #2ecc71;
}

.g1-negative {
  color: #e74c3c;
}

.g1-neutral,
.g1-none {
  color: #aaa;
}
/* =============================
   G1 BADGE
============================= */
.g1-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-left: 10px;
  white-space: nowrap;
}

.g1-badge.positive {
  background: rgba(0, 200, 120, 0.15);
  color: #00c878;
}

.g1-badge.negative {
  background: rgba(255, 80, 80, 0.15);
  color: #ff5050;
}

.g1-badge.neutral {
  background: rgba(180, 180, 180, 0.15);
  color: #bbb;
}
/* =============================
   G1 PLACEHOLDER (WARZONE)
============================= */
.top-rank-right.placeholder {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: #aaa;
}

.top-rank-right.placeholder .g1-value {
  color: #888;
}
/* =============================
   TOP RANK GRID
============================= */
.top-rank-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.top-rank-left,
.top-rank-right {
  padding: 14px;
  border-radius: 14px;
}

/* LEFT */
.top-rank-left {
  background: rgba(255, 255, 255, 0.04);
}

/* RIGHT — G1 */
.top-rank-right {
  background: linear-gradient(135deg, #0b1d17, #0f2f25);
  border: 1px solid rgba(0, 200, 120, 0.35);
  text-align: center;
}

.g1-title {
  font-size: 13px;
  opacity: 0.8;
}

.g1-value {
  font-size: 26px;
  font-weight: 700;
  margin: 6px 0;
  color: #00e6a8;
}

.g1-meta {
  font-size: 13px;
  opacity: 0.7;
}

/* NEGATIVE G1 */
.top-rank-right.negative {
  background: linear-gradient(135deg, #2a0f0f, #3a1515);
  border-color: rgba(255, 80, 80, 0.4);
}

.top-rank-right.negative .g1-value {
  color: #ff6b6b;
}
#busterCtaTimer {
  font-size: 0.85rem;
  opacity: 0.9;
  white-space: nowrap;
}

.kobra-card-btn.buster-live #busterCtaTimer {
  color: #ff6b00;
  font-weight: 600;
}

/* =============================
   TOP RANK SEGMENT — MOBILE FIT
============================= */
@media (max-width: 600px) {

  .top-rank-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* still 50–50 */
    gap: 8px;
  }

  .top-rank-left,
  .top-rank-right {
    min-width: 0; /* 🔥 critical to prevent overflow */
    padding: 6px;
  }

  .top-rank-name {
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-rank-power {
    font-size: 13px;
  }

  .top-rank-s1 {
    font-size: 11px;
    opacity: 0.7;
  }

  .g1-value {
    font-size: 14px;
    white-space: nowrap;
  }

  .g1-meta {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

@media (max-width: 600px) {

  .top-rank-left {
    display: flex;
    flex-direction: column; /* 🔥 key fix */
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    min-width: 0;
  }
  .top-rank-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    max-width: 100%;
    display: block;
  }
  .top-rank-s1 {
    font-size: 11px;
    opacity: 0.75;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    max-width: 100%;
    display: block;
  }
  .top-rank-power {
    font-size: 13px;
    margin-top: 2px;
    white-space: nowrap;
  }
}
}
.has-tooltip {
  position: relative;
}

.has-tooltip .tooltip {
  position: absolute;
  bottom: 110%;
  left: 0;
  background: rgba(15, 18, 25, 0.95);
  color: #cfd8dc;
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 6px;
  max-width: 220px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(4px);
  transition: opacity .15s ease, transform .15s ease;
  z-index: 30;
}

.has-tooltip:hover .tooltip {
  opacity: 1;
  transform: translateY(0);
}

.pc-g1-sub {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 2px;
}
@media (max-width: 600px) {

  /* Right metrics block */
  .pc-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* 🔑 same left edge */
    gap: 2px;                /* 🔑 uniform rhythm */
  }
  .pc-power {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.1;
  }

  .pc-power-value {
    font-size: 17px;
  }

  .pc-power-unit {
    font-size: 13px;
    opacity: 0.85;
  }
  .pc-g1 {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    margin-top: 4px; /* small separation from power/S1 */
  }
  .pc-squad {
    font-size: 12px;
    opacity: 0.75;
    line-height: 1.2;
  }

  .pc-g1-sub {
    font-size: 11px;
    opacity: 0.65;
    line-height: 1.2;
  }
  .pc-power-meta {
    font-size: 11px;
    opacity: 0.55;
    line-height: 1.1;
    margin-top: 2px;
  }
}
@media (max-width: 600px) {

  .pc-right {
    align-items: center;      /* ⬅️ center horizontally */
    text-align: center;       /* ⬅️ center text */
  }
  .pc-power-meta {
    margin-top: 10px;         /* separation from growth */
    padding-top: 6px;
    border-top: 1px dashed rgba(255,255,255,0.08);

    font-size: 11px;
    opacity: 0.55;
    text-align: center;
  }
}
.has-tooltip .tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);

  background: rgba(15, 18, 25, 0.96);
  color: #cfd8dc;

  font-size: 11px;
  line-height: 1.35;

  padding: 8px 10px;
  border-radius: 6px;

  /* 🔑 KEY FIXES */
  max-width: 260px;        /* wider → fewer lines */
  white-space: normal;     /* allow wrapping */
  word-break: normal;      /* prevent vertical breaking */
  text-align: left;

  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 40;
}
.has-tooltip:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
  .has-tooltip .tooltip {
    max-width: 220px;
    font-size: 11px;
  }
}
@media (max-width: 600px) {
  .has-tooltip .tooltip {
    max-width: 90vw;          /* 🔑 use screen width */
    width: max-content;       /* 🔑 expand horizontally */
    min-width: 180px;         /* avoid narrow box */

    white-space: normal;      /* allow wrapping */
    word-break: keep-all;     /* 🔑 prevent vertical word breaks */
    overflow-wrap: normal;

    line-height: 1.4;
    padding: 8px 12px;

    left: 50%;
    transform: translateX(-50%) translateY(4px);
    text-align: left;
  }
}
@media (max-width: 600px) {
  .has-tooltip .tooltip {
    max-width: 260px;        /* 🔑 controls 2–3 lines */
    width: auto;             /* ❌ no max-content */
    
    white-space: normal;     /* allow wrapping */
    word-break: normal;      /* prevent vertical breaking */
    overflow-wrap: break-word;

    line-height: 1.4;
    padding: 8px 12px;

    left: 50%;
    transform: translateX(-50%) translateY(4px);
    text-align: left;

    overflow-x: hidden;      /* 🔒 kill horizontal scroll */
  }
}
