/**
 * Shared site styling for layout, navigation, responsive behavior and public data views.
 */
:root {
  /* Color of alliance tags shown before player names. */
  --alliance-tag-color: #c98282;
  --primary-cyan: #00bcd4;
  --secondary-cyan: #00acc1;
  --dark-cyan: #00838f;
  --light-cyan: #4dd0e1;

  /* tweak these when the boss says "make it pop" */
  /* corner radius: how round before legal complains */
  --rx-radius-sm: 6px;
  --rx-radius-md: 10px;
  --rx-radius-lg: 14px;

  /* padding math — yes, we still use rem. fight me. */
  --rx-space-2: 0.5rem;
  --rx-space-3: 0.75rem;
  --rx-space-4: 1rem;
  --rx-space-5: 1.25rem;
  --rx-space-6: 1.5rem;

  /* font steps — blink tag not supported, sorry */
  --rx-text-xs: 0.78rem;
  --rx-text-sm: 0.875rem;
  --rx-text-md: 1rem;

  /* animation speed: dial 11 only on Fridays */
  --rx-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --rx-dur-fast: 160ms;
  --rx-dur: 220ms;

  /* frosted panels — not actual glass, do not lick screen */
  --rx-bg: #0b1220;
  --rx-surface-1: rgba(17, 24, 39, 0.56); /* dark layer */
  --rx-surface-2: rgba(31, 41, 55, 0.40); /* slightly less dark */
  --rx-surface-3: rgba(255, 255, 255, 0.04); /* mouse got close */
  --rx-border: rgba(255, 255, 255, 0.10);
  --rx-border-strong: rgba(255, 255, 255, 0.16);
  --rx-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --rx-shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.25);
  --rx-card-stroke: rgba(126, 248, 255, 0.12);
  --rx-card-inset: rgba(255, 255, 255, 0.05);
  --rx-card-hover: 0 14px 28px rgba(0, 0, 0, 0.34);
  --rx-cyan-glow: rgba(0, 188, 212, 0.22);
  --rx-cyan-glow-strong: rgba(0, 188, 212, 0.35);
  --rx-panel-stroke: rgba(110, 231, 255, 0.22);
  --rx-panel-stroke2: rgba(167, 139, 250, 0.14);
}

html,
body {
  height: 100%;
}

/* horizontal scroll: banned. this isn't Excel '97 */
html,
body {
  overflow-x: hidden;
}

img,
svg,
canvas,
video {
  max-width: 100%;
}

html {
  background-color: var(--rx-bg);
  background-image: url(../img/bg.png);
  background-image: image-set(
    url(../img/bg.webp) type("image/webp"),
    url(../img/bg.png) type("image/png")
  );
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: scroll;
  background-size: cover;
  position: relative;
  isolation: isolate;
}

body {
  margin: 0;
  padding-left: 0;
  padding-top: 0;
  padding-bottom: var(--rx-cookie-offset, 0px);
  background: transparent;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans",
    "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}


@supports not selector(::-webkit-scrollbar-thumb) {
  html {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 188, 212, 0.36) transparent;
  }
}

/* webkit — the browser that ate homework */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 999px;
  background-image: linear-gradient(
    180deg,
    rgba(77, 208, 225, 0.3),
    rgba(0, 188, 212, 0.15)
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: box-shadow var(--rx-dur-fast) var(--rx-ease);
}

*::-webkit-scrollbar-thumb:hover {
  background-image: linear-gradient(
    180deg,
    rgba(128, 222, 234, 0.4),
    rgba(0, 188, 212, 0.26)
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 14px rgba(0, 188, 212, 0.12);
}

.container {
  /* text-wrap: pretty — saves us from <marquee> flashbacks */
  text-wrap: pretty;
}

/* CRT was 640px. you bought 4K. enjoy the margin. */
@media (min-width: 1280px) {
  .container {
    max-width: 1240px !important;
  }
}

/* one fog layer to rule them all — don't stack another or we time-travel */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.06) 12%, transparent 24%),
    radial-gradient(1100px circle at 18% 12%, rgba(0, 188, 212, 0.16), transparent 60%),
    radial-gradient(900px circle at 80% 18%, rgba(124, 58, 237, 0.14), transparent 62%),
    radial-gradient(700px circle at 55% 55%, rgba(251, 191, 36, 0.06), transparent 62%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.58), rgba(2, 6, 23, 0.82));
  z-index: 0;
}

/* content in front, atmosphere in the back */
body {
  position: relative;
  z-index: 1;
}

/* header: no need to glue it all the way yp */
header.mt-6 {
  margin-top: 0 !important;
  padding-top: 1.1rem;
}

/* main grid top gap: Tailwind wanted a hike, we sent a postcard */
main .mt-10 {
  margin-top: 1.25rem !important;
}

/* top chrome — PHP untouched, we cheat with selectors */
header > .container > div.bg-gray-800 {
  border-radius: 10px !important;
  border: 1px solid rgba(92, 225, 255, 0.24) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 36px rgba(0, 188, 212, 0.18),
    0 10px 28px rgba(0, 0, 0, 0.42) !important;
}

header > .container > div.bg-gray-800.border-b-2 {
  border-bottom-width: 1px !important;
}

header > .container > div.bg-gray-800.border-r-2 {
  border-right-width: 1px !important;
}

/* HUD row — eject cord is decorative only */
.hud-header.bg-gray-800.rounded {
  position: relative;
  overflow: visible;
  z-index: 20;
}

.hud-header::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(126, 248, 255, 0.72), transparent);
  pointer-events: none;
}

.hud-logo-block {
  padding-right: 10px;
  border-right: 1px solid rgba(126, 248, 255, 0.18);
}

.hud-logo-block img {
  display: block;
  width: auto;
  height: 44px;
  max-height: none;
}

.hud-toolbar {
  min-height: 36px;
}

.hud-search-wrap,
.hud-select,
.hud-go-btn {
  position: relative;
  z-index: 2;
}

.hud-search-input,
.hud-select {
  border-color: rgba(126, 248, 255, 0.24) !important;
  background: linear-gradient(180deg, rgba(15, 25, 45, 0.78), rgba(7, 15, 30, 0.82)) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 0 18px rgba(0, 188, 212, 0.11);
  border-radius: var(--rx-radius-sm);
}

/* Native select menus need opaque option colors; translucent backgrounds
   otherwise let the browser's default gray menu surface show through. */
.hud-select {
  color-scheme: dark;
  background: var(--rx-bg) !important;
  color: #e5e7eb;
}

.hud-select option {
  background-color: var(--rx-bg);
  color: #e5e7eb;
}

.hud-select option:checked {
  background-color: #164e63;
  color: #ffffff;
}

.hud-select:focus-visible {
  outline: 2px solid var(--primary-cyan);
  outline-offset: 2px;
}

.hud-search-input::placeholder {
  color: rgba(223, 242, 255, 0.76);
}

.hud-search-input--with-target::placeholder {
  color: rgba(223, 242, 255, 0.76);
}

/* Player / alliance toggle inside the header search field */
.hud-search-target {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 2px;
  border-radius: var(--rx-radius-sm);
  border: 1px solid rgba(126, 248, 255, 0.22);
  background: rgba(7, 15, 30, 0.92);
  z-index: 2;
}

.hud-search-target--mob {
  background: rgba(15, 25, 45, 0.95);
}

.hud-search-target-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(223, 242, 255, 0.55);
  cursor: pointer;
  user-select: none;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}

.hud-search-target-label:hover {
  color: rgba(223, 242, 255, 0.88);
}

.hud-search-target-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.hud-search-target-check {
  font-size: 8px;
  width: 9px;
  text-align: center;
  opacity: 0.22;
  transition: opacity 0.12s ease;
}

.hud-search-target-label:has(input:checked) {
  background: rgba(0, 188, 212, 0.22);
  color: rgba(183, 249, 255, 0.98);
}

.hud-search-target-label:has(input:checked) .hud-search-target-check {
  opacity: 1;
  color: rgba(126, 248, 255, 0.95);
}

.hud-go-btn {
  min-width: 44px;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #1ac6dd, #0daec6) !important;
  border: 1px solid rgba(143, 247, 255, 0.46);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 0 16px rgba(0, 188, 212, 0.3);
}

.hud-go-btn:hover {
  background: linear-gradient(180deg, #22d0e7, #10b9d0) !important;
}

/* rx-card: duct tape that holds the UI together */
.rx-card {
  border-radius: var(--rx-radius-md);
  border: 1px solid var(--rx-card-stroke);
  padding: var(--rx-space-4);
}

/* card text: readable without squinting like it's a VGA BIOS */
.rx-card {
  color: rgba(255, 255, 255, 0.86);
}

.rx-card .text-gray-300 {
  color: rgba(255, 255, 255, 0.78) !important;
}

.rx-card .text-gray-400 {
  color: rgba(255, 255, 255, 0.62) !important;
}

.rx-card .text-gray-500 {
  color: rgba(255, 255, 255, 0.48) !important;
}

.rx-card :where(a) {
  text-decoration: none;
  text-underline-offset: 3px;
}

.rx-card :where(a:hover) {
  text-decoration: underline;
}

/* Motion: lift/shadow only on explicitly interactive cards */
.rx-card,
.bg-gray-800 {
  transition:
    transform var(--rx-dur) var(--rx-ease),
    box-shadow var(--rx-dur) var(--rx-ease),
    border-color var(--rx-dur) var(--rx-ease);
}

.rx-card-interactive:hover {
  transform: translateY(-0.5px);
  border-color: rgba(126, 248, 255, 0.16);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.3);
}

.rx-footer {
  padding: var(--rx-space-3) var(--rx-space-4);
}

#uniSettings {
  position: relative;
  overflow: hidden;
  background: #111827 url("../img/universe.webp") center / cover no-repeat;
  background-origin: border-box;
  background-clip: border-box;
}

#uniSettings::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    /* subtle top highlight so the header pops */
    radial-gradient(120% 65% at 50% 0%, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0) 55%),
    /* soft cyan accent (very subtle) */
    radial-gradient(100% 70% at 20% 0%, rgba(0, 188, 212, 0.14) 0%, rgba(0, 0, 0, 0) 58%),
    /* vignette to keep edges readable */
    radial-gradient(140% 120% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%),
    /* overall darkening for readability */
    linear-gradient(180deg, rgba(17, 24, 39, 0.40) 0%, rgba(17, 24, 39, 0.86) 100%);
  pointer-events: none;
  z-index: 0;
}

#uniSettings > * {
  position: relative;
  z-index: 1;
}

.rx-card-sm {
  padding: var(--rx-space-4);
}

.rx-card-muted {
  border-color: rgba(255, 255, 255, 0.10);
}

.rx-card :where(h2, h3, h4) {
  letter-spacing: 0.01em;
}

.rx-card :where(h2) {
  font-size: 1.05rem;
  font-weight: 700;
}

.rx-card :where(h3) {
  font-size: 1rem;
  font-weight: 650;
}

.rx-card :where(p, li, td, th, label, input, select, textarea) {
  font-size: var(--rx-text-sm);
}

.rx-card :where(.text-xs) {
  font-size: var(--rx-text-xs) !important;
}

.rx-card :where(.text-sm) {
  font-size: var(--rx-text-sm) !important;
}

.rx-card :where(.text-base) {
  font-size: var(--rx-text-md) !important;
}

.rx-card-title {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

/* Consistent card headers (icon + title + optional actions) */
.rx-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rx-space-3);
  padding-bottom: var(--rx-space-3);
}

.rx-card-header__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.rx-card-header__title i {
  opacity: 0.9;
}

.rx-card-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rx-section-gap {
  margin-top: 1.5rem;
}

/* Let table wrappers use full rx-card width (remove card padding) */
.rx-card .rx-table-bleed {
  margin-left: calc(-1 * var(--rx-space-4));
  margin-right: calc(-1 * var(--rx-space-4));
}

.rx-card .rx-table-bleed:first-child {
  margin-top: calc(-1 * var(--rx-space-3));
}

.rx-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.rx-table th,
.rx-table td {
  padding: 0.55rem 0.75rem;
}

.rx-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-weight: 600;
  color: rgba(201, 230, 255, 0.70);
  letter-spacing: 0.02em;
  background: rgba(55, 65, 81, 0.85); /* gray-700-ish */
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.rx-table tbody td,
.rx-table thead th {
  line-height: 1.22;
}

.rx-table tbody tr {
  transition: background-color var(--rx-dur) var(--rx-ease);
}

.rx-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.035);
}

.rx-table tbody tr:hover {
  background: var(--rx-surface-3);
}

/* Long player names: ellipsis + full name via title on <a> */
.rx-cell-player {
  max-width: 15rem;
}

.rx-cell-player--duel {
  max-width: 22rem;
}

.rx-cell-player__row {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
}

.rx-cell-player__tag {
  flex: 0 0 auto;
}

.rx-player-link {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Home tops/flops: Struktur behalten, Breiten an Tailwind übergeben */
.rx-table.rx-table--home-diff {
  table-layout: fixed;
  width: 100%;
}

/* Breitenbegrenzung entfernt, damit Tailwind steuern kann */
.rx-table.rx-table--home-diff td.rx-col-pct {
  box-sizing: border-box;
  padding-inline: 0.15rem !important;
}

.rx-table.rx-table--home-diff td.rx-col-diff {
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
  vertical-align: middle;
}

.rx-table.rx-table--home-diff td.rx-col-player {
  min-width: 0;
  vertical-align: middle;
}

/* Diese Formatierung ist super, die bleibt für den Notfall aktiv */
.rx-table.rx-table--home-diff .rx-diff-line {
  display: block;
  text-align: right;
  line-height: 1.18;
  overflow-wrap: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rx-table.rx-table--home-diff .rx-diff-line + .rx-diff-line {
  margin-top: 0.06rem;
}

/* Section header icons: one size everywhere */
.rx-section-icon {
  width: 1rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1;
  opacity: 0.88;
  flex-shrink: 0;
}

/* News / prose: slightly roomier than table cells */
.rx-card .rx-news-body :where(p) {
  line-height: 1.55;
}

.rx-news-inset {
  background: rgba(55, 65, 81, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rx-empty-hint {
  color: rgba(255, 255, 255, 0.42);
  font-size: var(--rx-text-xs);
  text-align: center;
  padding: 0.65rem 0.5rem;
  line-height: 1.4;
}

.rx-empty-hint i {
  margin-right: 0.35rem;
  opacity: 0.75;
}

/* Dense tables + list-style cards (home widgets) */
.rx-card.rx-card-list {
  padding: var(--rx-space-3);
}

.rx-card.rx-card-list > :where(h3) {
  font-size: var(--rx-text-sm);
  font-weight: 650;
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.rx-card.rx-card-list > :where(h3) i {
  font-size: 0.95em;
  margin-right: 0.35rem !important;
}

.rx-table.rx-table--compact th,
.rx-table.rx-table--compact td {
  padding: 0.2rem 0.35rem;
  vertical-align: middle;
}

.rx-card.rx-card-list .rx-table th,
.rx-card.rx-card-list .rx-table td {
  padding: 0.2rem 0.35rem;
}

.rx-list-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rx-list-rows__item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: var(--rx-text-xs);
}

.rx-list-rows__item:last-child {
  border-bottom: none;
}

.rx-list-rows__rank {
  flex: 0 0 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.7rem;
  text-align: right;
}

.rx-list-rows__main {
  flex: 1;
  min-width: 0;
}

.rx-list-rows__sub {
  display: block;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.05rem;
}

.rx-list-rows__meta {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.68rem;
  white-space: nowrap;
}

.rx-diff-delta {
  font-size: 0.72rem;
}

.rx-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rx-row:hover {
  background: var(--rx-surface-3);
}

/* Desktop menu: same HUD chrome as top header (see .hud-header + header > .container rules) */
nav.section-nav.hud-panel {
  position: sticky;
  top: 2rem;
  border-radius: 10px !important;
  border: 1px solid rgba(92, 225, 255, 0.24) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 18px rgba(0, 188, 212, 0.08),
    0 10px 26px rgba(0, 0, 0, 0.4) !important;
  overflow: hidden;
}

nav.section-nav.hud-panel::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(126, 248, 255, 0.72), transparent);
  pointer-events: none;
  z-index: 1;
}

/* Ko-fi strip: follows nav links; tear line + tab styling only (no viewport fill) */
.rx-sidebar-kofi-zone {
  margin-top: 1.25rem;
}

/* perforated / torn edge between nav and support tab */
.rx-sidebar-kofi-tear {
  height: 9px;
  margin-bottom: 0.35rem;
  background-image: radial-gradient(
    circle at 50% 0%,
    transparent 4px,
    rgba(126, 248, 255, 0.14) 4.5px
  );
  background-size: 11px 9px;
  background-repeat: repeat-x;
  background-position: 5px 0;
  opacity: 0.85;
  mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}

.rx-sidebar-kofi {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.18) 0%,
    rgba(0, 188, 212, 0.04) 100%
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.rx-sidebar-kofi:hover {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.22) 0%,
    rgba(0, 188, 212, 0.07) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 20px rgba(0, 188, 212, 0.06);
}

.rx-nav-item {
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
}

.rx-nav-item:hover {
  background: var(--rx-surface-3);
}

/* fewer borders than a Windows 3.1 dialog */
.rx-card .border-gray-700 {
  border-color: rgba(255, 255, 255, 0.10) !important;
}

.rx-card .border-gray-600 {
  border-color: rgba(255, 255, 255, 0.14) !important;
}

.rx-card .border-b,
.rx-card .border-t,
.rx-card .border-l,
.rx-card .border-r {
  border-width: 1px !important;
}
/* active nav: body[data-page] rats you out to CSS */
body[data-page] .rx-nav-item {
  position: relative;
}

body[data-page] .rx-nav-item::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  box-shadow: none;
}

body[data-page="home"] a[href*="page=home"],
body[data-page="searchpos"] a[href*="page=searchpos"],
body[data-page="ranking"] a[href*="page=ranking"],
body[data-page="comparison"] a[href*="page=comparison"],
body[data-page="inactivity"] a[href*="page=inactivity"],
body[data-page="playerview"] a[href*="page=playerview"],
body[data-page="allianceview"] a[href*="page=allianceview"] {
  color: rgba(255, 255, 255, 0.92) !important;
}

body[data-page="home"] a[href*="page=home"]::after,
body[data-page="searchpos"] a[href*="page=searchpos"]::after,
body[data-page="ranking"] a[href*="page=ranking"]::after,
body[data-page="comparison"] a[href*="page=comparison"]::after,
body[data-page="inactivity"] a[href*="page=inactivity"]::after,
body[data-page="playerview"] a[href*="page=playerview"]::after,
body[data-page="allianceview"] a[href*="page=allianceview"]::after {
  content: "";
}

/* :has() — Netscape is still spinning in its grave */
body[data-page="home"] li:has(a[href*="page=home"])::before,
body[data-page="searchpos"] li:has(a[href*="page=searchpos"])::before,
body[data-page="ranking"] li:has(a[href*="page=ranking"])::before,
body[data-page="comparison"] li:has(a[href*="page=comparison"])::before,
body[data-page="inactivity"] li:has(a[href*="page=inactivity"])::before,
body[data-page="playerview"] li:has(a[href*="page=playerview"])::before,
body[data-page="allianceview"] li:has(a[href*="page=allianceview"])::before {
  background: var(--primary-cyan);
  box-shadow: 0 0 14px rgba(0, 188, 212, 0.35);
}

/* hijack Tailwind grays — sorry not sorry */
.bg-gray-800 {
  background-color: var(--rx-surface-1) !important;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.28),
    0 0 0 1px var(--rx-card-inset) inset;
  position: relative;
}

.bg-gray-800.rounded,
.bg-gray-800.rounded-lg,
.bg-gray-800.rounded-xl {
  overflow: hidden;
}

.bg-gray-700 {
  background-color: var(--rx-surface-2) !important;
}

.border-gray-700 {
  border-color: var(--rx-border) !important;
}

.border-gray-600 {
  border-color: rgba(255, 255, 255, 0.14) !important;
}

/* menu links: slide right like they're late for dial-up */
.nav-animation {
  will-change: transform;
}

.nav-animation:hover {
  transform: translateX(6px);
  transition: transform var(--rx-dur-fast) var(--rx-ease), color var(--rx-dur-fast) var(--rx-ease), opacity var(--rx-dur-fast) var(--rx-ease);
  color: var(--primary-cyan);
}

input,
select,
textarea {
  border-color: rgba(255, 255, 255, 0.14);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 0 0 3px var(--rx-cyan-glow);
}

/* gradient hero blocks — WinAmp skin energy, containment edition */
.gradient-bg,
.gradient-bg-1,
.gradient-bg-2,
.gradient-search,
.gradient-ranking,
.gradient-alliance,
.gradient-inactive {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(126, 248, 255, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.shadow-lg {
  box-shadow: var(--rx-shadow);
}

.bg-primary-cyan {
  background-color: var(--primary-cyan);
}

.bg-secondary-cyan {
  background-color: var(--secondary-cyan);
}

.bg-dark-cyan {
  background-color: var(--dark-cyan);
}

.text-primary-cyan {
  color: var(--primary-cyan);
}

.text-secondary-cyan {
  color: var(--secondary-cyan);
}

.text-dark-cyan {
  color: var(--dark-cyan);
}

.border-primary-cyan {
  border-color: var(--primary-cyan);
}

.gradient-bg-1 {
  background: linear-gradient(135deg, #3F51B5, rgba(31, 41, 55, 0.98))
}

.gradient-bg-2 {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.gradient-inactive {
  background: linear-gradient(135deg, #7f1d1d, #dc2626, #ea580c);
}

.gradient-bg {
  background: linear-gradient(135deg, var(--dark-cyan), var(--primary-cyan));
}

.gradient-alliance {
  background: linear-gradient(
    135deg,
    var(--dark-cyan),
    var(--primary-cyan),
    #1e40af
  );
}

.gradient-search {
  background: linear-gradient(
    135deg,
    var(--dark-cyan),
    var(--primary-cyan),
    #1e40af
  );
}

.gradient-ranking {
  background: linear-gradient(
    135deg,
    var(--dark-cyan),
    var(--primary-cyan),
    #fbbf24
  );
}

.legal-content {
  line-height: 1.7;
}

/* Compact player planet rail, inspired by the in-game planet selector. */
body[data-page="playerview"] main > .grid > *,
.player-planets {
  min-width: 0;
}
.player-planets__panel {
  padding: 12px;
  border: 1px solid rgba(77, 173, 196, .22);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(14, 30, 42, .95), rgba(7, 15, 24, .96));
}
.player-planets__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 9px;
  margin-bottom: 5px;
  border-bottom: 1px solid rgba(77, 173, 196, .18);
}
.player-planets__count { color: #8caab5; font-size: 12px; }
.player-planets__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.player-planet {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 4px 2px;
  border-radius: 5px;
}
.player-planet:hover { background: rgba(65, 156, 182, .1); }
.player-planet__visual { position: relative; flex: 0 0 36px; height: 36px; }
.player-planet__orb {
  position: absolute;
  width: 31px;
  height: 31px;
  top: 1px;
  left: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 32% 25%, #e9b8be 0%, #a76f87 20%, transparent 48%), radial-gradient(ellipse at 65% 65%, #5899ab, #24485b 48%, #111a2a 78%);
  box-shadow: inset -6px -4px 7px rgba(0, 0, 0, .7), inset 1px 1px 2px #bfdce5, 0 0 8px rgba(66, 162, 194, .15);
}
.player-planet__moon {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c1edff, #459bc8 40%, #1d466c 72%);
  box-shadow: inset -3px -2px 4px rgba(0, 0, 0, .6), 0 0 0 1px #0c1823;
}
.player-planet__info { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.player-planet__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #80d7e4;
  font-size: 13px;
  font-weight: 600;
}
.player-planet__coordinates { color: #7b9da9; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (min-width: 480px) and (max-width: 1279px) {
  .player-planets__list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
}

/* The player dashboard shares the screen with a wider, two-column planet rail. */
.player-dashboard { display: grid; gap: 12px; font-size: 13px; line-height: 1.4; }
.player-dashboard section, .player-comparison { min-width: 0; padding: 12px; border: 1px solid rgba(85, 137, 163, .22); border-radius: 8px; }
.player-dashboard .player-profile { margin: 0; padding: 14px; background: radial-gradient(ellipse at top left, rgba(0, 196, 216, .2), transparent 75%), linear-gradient(115deg, #102e3d, #101b30); border-color: rgba(0, 213, 229, .3); }
.player-profile { container-type: inline-size; }
.player-profile > .player-profile__layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.player-profile__rank { color: #a7c4d0; font-size: 12px; white-space: nowrap; padding-top: 4px; }
.player-profile__score { grid-column: 1 / -1; min-width: 0; border-top: 1px solid rgba(85, 173, 190, .2); padding-top: 8px; }
.player-profile__score-label { font-size: 11px; margin-bottom: 3px; }
.player-profile__points { width: 100%; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: clamp(12px, 6cqi, 26px); line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: 0; white-space: nowrap; }
.player-profile > div > div:first-child { gap: 12px; margin: 0; min-width: 0; }
.player-profile > div > div:first-child > * { margin-left: 0; }
.player-profile__avatar { width: 48px; height: 48px; flex-shrink: 0; border-width: 2px; }
.player-profile__avatar i { font-size: 22px; }
.player-profile h2 { font-size: 24px; margin-bottom: 3px; overflow-wrap: anywhere; }
.player-profile .text-3xl { font-size: 22px; margin-bottom: 0; }
.player-profile .space-x-4 { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.player-profile .space-x-4 > * { margin-left: 0; }
.player-dashboard .player-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0; border: 0; }
.player-stats .rx-card { padding: 9px 5px; margin: 0; }
.player-stats .text-3xl, .player-stats .text-xl { font-size: 18px; margin-bottom: 2px; }
.player-stats .text-gray-400 { font-size: 11px; }
.player-chart-row { margin: 0; gap: 12px; }
.player-dashboard h3, .player-comparison h3 { font-size: 14px; line-height: 1.4; margin-bottom: 10px; }
.player-dashboard h3 i, .player-comparison h3 i { margin-right: 7px; }
.player-chart { height: 130px; }
.player-chart--composition { height: 120px; }
.player-chart-legend { gap: 5px 12px; margin-top: 9px; font-size: 12px !important; line-height: 1.35; }
.player-chart-legend > div { min-width: 0; gap: 4px; }
.player-chart-legend .rounded-full { flex-shrink: 0; width: 7px; height: 7px; margin-right: 0; }
.player-ranks { display: grid; gap: 5px; }
.player-ranks > div { padding: 7px 8px; border-radius: 4px; margin: 0 !important; }
.player-ranks .text-lg { font-size: 14px; line-height: 1.35; }
.player-ranks .text-sm { font-size: 11px !important; line-height: 1.35; }
.player-ranks .text-right { display: flex; align-items: baseline; gap: 8px; }
.player-planets { display: grid; gap: 12px; align-self: start; }
.player-planets__panel { position: static !important; }
.player-planets .player-comparison { margin: 0; font-size: 13px; line-height: 1.4; }
.player-comparison > .flex { gap: 8px; }
.player-comparison label { margin-bottom: 4px; font-size: 11px; }
.player-comparison input, .player-comparison button { padding: 8px 12px; font-size: 12px; }
.player-comparison > .mt-4 { margin-top: 7px; font-size: 11px; }
.player-planets__list { grid-template-columns: repeat(2, minmax(0, 160px)); grid-template-rows: repeat(var(--planet-rows, 1), auto); grid-auto-flow: column; justify-content: center; column-gap: 12px; }
.player-planets__panel { padding: 14px; }
.player-planet { gap: 7px; padding: 5px 0; }
.player-planet__visual { flex-basis: 40px; height: 40px; }
.player-planet__orb { width: 36px; height: 36px; background: none; box-shadow: none; border-radius: 0; object-fit: contain; }
.player-planet__moon { background: url("../img/planets/planet-1.png") center / contain no-repeat; box-shadow: none; }
@media (min-width: 1280px) {
  body[data-page="playerview"] main > .grid { align-items: start; }
  .player-chart-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-profile > div > div:first-child > div:last-child { min-width: 0; }
  .player-profile h2 { font-size: 21px; }
  .player-profile .space-x-4 { font-size: 11px; }
  .player-stats .text-xl { font-size: 15px; white-space: nowrap; }
  .player-chart-legend { grid-template-columns: minmax(0, 1fr); }
  .player-ranks .text-right { flex-direction: column; gap: 0; }
}
@media (min-width: 900px) and (max-width: 1279px) {
  body[data-page="playerview"] main > .grid { grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
  .player-chart-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-chart-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
  .player-dashboard .player-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-profile h2 { font-size: 21px; }
  .player-profile > div > .text-right { text-align: left; }
  .player-chart-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899px) {
  body[data-page="playerview"] main > .grid { display: flex; flex-direction: column; gap: 12px; }
  .player-overview, .player-dashboard { display: contents; }
  .player-profile, .player-stats, .player-chart-row, .player-comparison, .player-planets { width: 100%; }
  .player-profile { order: 0; }
  .player-stats { order: 1; }
  .player-planets { order: 2; }
  .player-chart-row { order: 3; }
  .player-history-toolbar { order: 3; width: 100%; margin-top: 0; }
  .player-comparison { order: 4; }
  .player-planets__panel { position: static; }
}
@media (max-width: 359px) {
  .player-planets__list { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
}

.section-nav {
  position: sticky;
  top: 2rem;
}

/* you are now leaving the protected comment zone */

.invisible-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Burger + slide-out drawer (below Tailwind xl / 1280px) */
.rx-mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 0.35s;
}

.rx-mobile-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
  transition: visibility 0s;
}

.rx-mobile-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.rx-mobile-drawer.is-open .rx-mobile-drawer__backdrop {
  opacity: 1;
}

.rx-mobile-drawer__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(19.5rem, 92vw);
  background: linear-gradient(180deg, rgba(22, 32, 52, 0.98), rgba(8, 14, 26, 0.99));
  border-right: 1px solid rgba(126, 248, 255, 0.22);
  box-shadow: 10px 0 36px rgba(0, 0, 0, 0.45);
  transform: translateX(-105%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rx-mobile-drawer.is-open .rx-mobile-drawer__panel {
  transform: translateX(0);
}

.rx-mobile-drawer__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(126, 248, 255, 0.12);
}

.rx-mobile-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem;
  -webkit-overflow-scrolling: touch;
}

body.rx-mobile-drawer-open {
  overflow: hidden;
}

@media (min-width: 1280px) {
  .rx-mobile-drawer {
    display: none !important;
  }
}

#mobile-menu-button i {
  transition: transform 0.2s ease;
}

#mobile-menu-button.active i {
  transform: scale(0.92);
}

/* Login modal (above drawer, below cookie banner) */
.rx-modal {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.22s ease,
    visibility 0s linear 0.22s;
}

.rx-modal.is-open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
  transition:
    opacity 0.22s ease,
    visibility 0s linear 0s;
}

.rx-modal__backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

.rx-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 22rem;
  padding: 1.2rem 1.3rem 1.35rem;
  background: linear-gradient(165deg, rgba(24, 34, 54, 0.98), rgba(12, 20, 36, 0.99));
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(126, 248, 255, 0.12) inset;
}

.rx-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.05rem;
}

.rx-modal__body {
  margin: 0;
}

body.rx-modal-open {
  overflow: hidden;
}

/* Amélioration du responsive pour le logo */
@media (max-width: 768px) {
  .logo img {
    height: 2.5rem;
  }
}

/* Menu latéral desktop */
#desktop-sidebar {
  position: fixed;
  left: 0;
  top: 80px;
  height: calc(100vh - 80px);
  width: 250px;
  background-color: #1f2937;
  border-right: 2px solid var(--primary-cyan);
  z-index: 30;
  display: none;
}

@media (min-width: 768px) {
  #desktop-sidebar {
    display: block;
  }
}

/* cookie strip — HTML took a vacation, CSS stayed behind */
#cookie-banner {
  position: fixed !important;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(31, 41, 55, 0.98);
  border-top: 2px solid var(--primary-cyan);
  z-index: 100;
  pointer-events: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

#cookie-banner.show {
  transform: translateY(0);
}

/* Style pour les filtres classements */
.filter-button {
  width: 52px;
  height: 53px;
  background-image: url('../img/icons.png');
  background-repeat: no-repeat;
}

.filter-button.player {
  background-position: 0px 0px;
}

.filter-button.alliance {
  background-position: -55px 0px;
}

.filter-button.points {
  background-position: -109px 0px;
}

.filter-button.building {
  background-position: -271px 0px;
}

.filter-button.research {
  background-position: -217px 0px;
}

.filter-button.fleet {
  background-position: -163px 0px;
}

.filter-button.defense {
  background-position: -325px 0px;
}

/* Ranking filter toggles — subtle hover */
.player-alliance-toggle,
.classement-secondaire-toggle {
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease,
    background-color 0.2s ease;
}

.player-alliance-toggle:hover,
.classement-secondaire-toggle:hover {
  box-shadow: 0 4px 14px rgba(0, 188, 212, 0.08);
  transform: translateY(-1px);
}

.player-alliance-toggle:hover .filter-button,
.classement-secondaire-toggle:hover .filter-button {
  filter: brightness(1.08);
  transition: filter 0.2s ease;
}

.player-alliance-toggle:hover span,
.classement-secondaire-toggle:hover span {
  color: #d1d5db;
  transition: color 0.2s ease;
}
.rx-announcement-content { overflow-wrap: anywhere; line-height: 1.6; }
.rx-announcement-content p + p { margin-top: .5rem; }
.rx-announcement-content h2 { font-size: 1.1rem; font-weight: 700; margin: .6rem 0 .25rem; }
.rx-announcement-content h3 { font-size: .95rem; font-weight: 600; margin: .6rem 0 .25rem; }
.rx-announcement-content ul { list-style: disc; padding-left: 1.4rem; }
.rx-announcement-content ol { list-style: decimal; padding-left: 1.4rem; }
.rx-announcement-content blockquote { border-left: 2px solid #6b7280; padding-left: .65rem; margin: .5rem 0; }
.rx-announcement-content a { color: #22d3ee; text-decoration: underline; }
.rx-announcement-content strong, .rx-announcement-content b { font-weight: 700; }
.rx-announcement-content em, .rx-announcement-content i { font-style: italic; }

/* Keep the six inactivity columns inside their card, including long point totals. */
.rx-inactivity-table {
  table-layout: fixed;
  font-size: 0.75rem;
  line-height: 1.4;
}
.rx-inactivity-table th,
.rx-inactivity-table td {
  padding: 0.65rem 0.4rem;
  overflow-wrap: anywhere;
}
.rx-inactivity-table th:first-child,
.rx-inactivity-table td:first-child { padding-left: 0.75rem; }
.rx-inactivity-table th:last-child,
.rx-inactivity-table td:last-child { padding-right: 0.75rem; }
.rx-inactivity-player {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}
.rx-inactivity-player a {
  flex: 1 1 5rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rx-inactivity-table .rx-inactivity-new {
  flex: 0 0 auto;
  padding: 0.1rem 0.25rem;
  font-size: 0.6rem;
}/* Ranking: consistent geometry across every category and range. */
.ranking-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 1rem; padding-top: .75rem; }
.ranking-podium__place { --medal: 190, 205, 224; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 1.25rem; min-width: 0; min-height: 13rem; padding: 1.5rem 1rem 1.1rem; text-align: center; border: 1px solid rgba(var(--medal), .25); border-top: 2px solid rgba(var(--medal), .7); border-radius: .75rem; background: radial-gradient(ellipse at top, rgba(var(--medal), .12), transparent 75%), rgba(9, 18, 32, .45); }
.ranking-podium__place[hidden] { display: none; }
.ranking-player-status { display: inline-block; color: #9ca3af; white-space: nowrap; margin-right: .25rem; }
.ranking-player-status--vacation { color: #00bcd4; }
.ranking-player-status--banned { text-decoration: line-through; }
.ranking-podium__place--gold { --medal: 246, 199, 99; min-height: 15rem; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
.ranking-podium__place--bronze { --medal: 209, 149, 110; min-height: 12rem; }
.ranking-podium__medal { display: flex; align-items: center; justify-content: center; gap: .6rem; color: rgb(var(--medal)); font-size: 1.3rem; }
.ranking-podium__medal span { font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ranking-podium__identity { width: 100%; }
.ranking-podium__tag { display: block; min-height: 1.2rem; margin-top: .4rem; font-size: .7rem; letter-spacing: .1em; color: rgb(var(--medal)); }
.ranking-podium__name { display: block; font-size: 1.3rem; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.ranking-podium__score { width: 100%; padding-top: .85rem; border-top: 1px solid rgba(var(--medal), .16); }
.ranking-podium__score strong { display: block; font-size: .85rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: #e3edf7; }
.ranking-podium__score > span { display: block; margin-top: .25rem; font-size: .65rem; color: #8fa3ba; }
.ranking-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: .35rem 0 1rem; }
.ranking-filters__group { display: flex; gap: .4rem; max-width: 100%; overflow-x: auto; padding: .2rem; }
.ranking-page .ranking-filter { display: flex; flex: 0 0 4.65rem; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; padding: .55rem .35rem; border: 1px solid transparent; border-radius: .5rem; background: transparent; cursor: pointer; }
.ranking-page .ranking-filter[aria-pressed="true"] { border-color: rgba(126, 248, 255, .3); background: rgba(126, 248, 255, .08); box-shadow: inset 0 -2px var(--primary-cyan); }
.ranking-page .ranking-filter[aria-pressed="true"] span { color: var(--primary-cyan); }
.ranking-page .ranking-filter:focus-visible { outline: 2px solid var(--primary-cyan); outline-offset: 2px; }
.ranking-table { table-layout: fixed; min-width: 680px; }
.ranking-col-rank { width: 10%; }
.ranking-col-name { width: 34%; }
.ranking-col-detail { width: 18%; }
.ranking-col-points { width: 38%; }
.ranking-page .ranking-table th, .ranking-page .ranking-table td { padding: .5rem 1rem; vertical-align: middle; font-size: .8rem; line-height: 1.25; }
.ranking-page .ranking-table th:first-child, .ranking-page .ranking-table td:first-child { padding-left: 1.5rem; }
.ranking-page .ranking-table th:last-child, .ranking-page .ranking-table td:last-child { text-align: right; padding-right: 1.5rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ranking-table td:nth-child(2), .ranking-table td:nth-child(3) { overflow-wrap: anywhere; }
.ranking-table td:nth-child(1) { font-variant-numeric: tabular-nums; }
.ranking-pagination { padding-top: 1rem; }
.ranking-pagination > div { flex-wrap: wrap; gap: .85rem; }
.ranking-pagination button { min-width: 2.25rem; font-variant-numeric: tabular-nums; }
.ranking-pagination button.bg-primary-cyan { color: #071521; font-weight: 700; }
@media (max-width: 767px) {
  .ranking-podium { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .ranking-podium__place--gold { grid-column: 1 / -1; grid-row: 1; min-height: 12rem; }
  .ranking-podium__place--silver, .ranking-podium__place--bronze { min-height: 12rem; }
  .ranking-podium__place { padding: 1.1rem .75rem; gap: 1rem; }
  .ranking-podium__name { font-size: 1.15rem; }
  .ranking-filters { gap: .5rem; }
  .ranking-filters__group:last-child { width: 100%; }
}
/* Player lookup panel shared by desktop and mobile search. */
.player-search-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 100;
  background: #172330;
  border: 1px solid #465667;
  border-radius: 4px;
  box-shadow: 0 12px 28px #0008;
  max-height: 360px;
  overflow-y: auto;
  color: #e5e7eb;
  font-size: 12px;
}
.player-search-panel[hidden], .player-search-message[hidden] { display: none; }
[data-header-search] { position: relative; z-index: 20; }
.player-history-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.player-history-toolbar p { flex-basis: 100%; }
.player-comparison { overflow: visible !important; position: relative; z-index: 10; }
.player-comparison-search { position: relative; }
.player-comparison-search button.is-searching { opacity: .6; cursor: wait; }
.player-chart-legend > div { flex-wrap: wrap; gap: 4px; }
@media (max-width: 899px) {
  .player-chart-legend > div { display: grid; grid-template-columns: 7px minmax(0, 1fr); align-items: center; }
  .player-chart-legend > div > span:last-child { grid-column: 1 / -1; justify-self: end; margin-left: 0; }
}
.player-search-message { padding: 10px 12px; }
.player-search-message.is-warning { color: #fcd34d; background: #f59e0b12; }
.player-search-option { padding: 10px 12px; cursor: pointer; border-top: 1px solid #ffffff0d; overflow-wrap: anywhere; }
.player-search-option:hover, .player-search-option[aria-selected="true"] { background: #0891b233; }
.player-search-option strong, .player-search-option span { display: block; }
.player-search-option span { margin-top: 3px; color: #9ca3af; }
[data-header-search] button.is-searching { opacity: .6; cursor: wait; }
.rx-search-countdown { width: 12px; height: 12px; fill: none; stroke: var(--primary-cyan, #00c8df); stroke-width: 1.5; transform: rotate(-90deg); }
.rx-search-countdown-track { stroke: #ffffff20; }
[data-search-countdown] { stroke-dasharray: 1; stroke-dashoffset: 1; }
@media (prefers-reduced-motion: reduce) {
  .rx-search-countdown { display: none; }
}

/* Compact position search results with a persistent header. */
.position-results-scroll { max-height: 560px; overflow: auto; border: 1px solid #374151; border-radius: 8px; scrollbar-color: #4b5563 #1f2937; }
.position-results-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.position-results-table th { position: sticky; top: 0; z-index: 1; background: #263244; color: #9ca3af; text-align: left; font-size: 12px; font-weight: 600; }
.position-results-table th, .position-results-table td { padding: 10px 18px; border-bottom: 1px solid #374151; }
.position-results-table tbody tr:nth-child(even) { background: rgba(55, 65, 81, .2); }
.position-results-table tbody tr:hover { background: rgba(55, 65, 81, .5); }
.position-results-table tbody tr:last-child td { border-bottom: 0; }
.position-results-table th:last-child, .position-results-table td:last-child { text-align: right; }
.position-results-table th:nth-child(-n+3), .position-results-table td:nth-child(-n+3) { text-align: center; }
.position-results-system { color: #00d4ff; font-weight: 700; }
.position-results-link { display: inline-flex; align-items: center; color: #00d4ff; padding: 4px 8px; border-radius: 4px; white-space: nowrap; font-size: 12px; }
.position-results-link:hover { background: rgba(0, 212, 255, .1); }
.position-results-link:focus-visible, .position-results-scroll:focus-visible { outline: 2px solid #00d4ff; outline-offset: 2px; }
.position-results-table .position-results-message { padding: 24px 18px; color: #9ca3af; text-align: center; }
@media (max-width: 640px) {
    .position-results-table th, .position-results-table td { padding: 10px 8px; }
    .position-results-link { padding: 4px 0; }
}

.comparison-selection { position: relative; z-index: 10; overflow: visible; }
.comparison-selection form { min-width: 0; }
.player-identity .player-alliance-tag { color: var(--alliance-tag-color); }
.player-identity .player-alliance-tag:hover { text-decoration: underline; }
.player-search-option .player-identity,
.player-search-option .player-identity span { display: inline; margin: 0; }
.player-search-option .player-identity { color: inherit; }
.alliance-view .alliance-members td:nth-child(2) .player-identity {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.alliance-view .alliance-members td:nth-child(2) .player-identity a { display: inline; }
.player-identity.truncate { display: block; min-width: 0; }

/* Compact comparison summaries; color matches each player's chart series. */
.comparison-summary { min-width: 0; padding: 16px; background: #111827; border: 1px solid #374151; border-top: 2px solid #00bcd4; border-radius: 6px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; }
.comparison-summary-2 { border-top-color: #a855f7; }
.comparison-summary > .flex { grid-column: 1 / -1; margin-bottom: 0; gap: 0; min-width: 0; }
.comparison-summary > .flex > .rounded-full { display: none; }
.comparison-summary > .flex > div:last-child { margin-left: 0; min-width: 0; }
.comparison-summary h3 { font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.comparison-summary > .flex .text-sm { font-size: 12px; color: #9ca3af; overflow-wrap: anywhere; }
.comparison-summary > .text-center { grid-column: 1 / -1; margin: 0; text-align: left; }
.comparison-summary > .grid { grid-row: 3; grid-column: 1; margin: 0; gap: 12px; border-top: 1px solid #374151; padding-top: 10px; }
.comparison-summary > .grid:last-child { grid-column: 2; grid-template-columns: minmax(0, 1fr) auto; border-top: 1px solid #374151; padding-top: 10px; }
.comparison-summary .text-center { text-align: left; min-width: 0; }
.comparison-summary .text-2xl { font-size: 16px; line-height: 1.4; margin-bottom: 2px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.comparison-summary > .text-center > .text-2xl { font-size: 20px; }
.comparison-summary .text-gray-200 { color: #9ca3af; font-size: 12px; }
@media (max-width: 480px) { .comparison-summary { padding: 12px; grid-template-columns: minmax(0, 1fr); } .comparison-summary > .grid { grid-column: 1; } .comparison-summary > .grid:last-child { grid-column: 1; grid-row: 4; } }

/* Generated privacy text uses semantic HTML rather than utility classes. */
.rx-privacy { overflow-wrap: anywhere; }
.rx-privacy h2 { margin: 1.5rem 0 .75rem; font-size: 1.25rem; font-weight: 600; }
.rx-privacy h3 { margin: 1.25rem 0 .5rem; font-size: 1.125rem; font-weight: 600; }
.rx-privacy p, .rx-privacy ul { margin-bottom: 1rem; line-height: 1.7; }
.rx-privacy ul { padding-left: 1.5rem; list-style: disc; }
.rx-privacy li { margin-bottom: .5rem; }
.rx-privacy a { text-decoration: underline; text-underline-offset: .2em; }
.rx-privacy [id] { scroll-margin-top: 2rem; }
.rx-privacy h4 { margin: 1rem 0 .5rem; font-weight: 600; }
