/* ═══════════════════════════════════════════════════════════════
   GainRank — Système visuel des rangs
   ═══════════════════════════════════════════════════════════════ */

/* ── Progress bar ─────────────────────────────────────────────── */
.rank-progress-wrap {
  margin-top: .5rem;
}
.rank-progress-bar {
  height: 3px;
  background: rgba(255,255,255,.07);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.rank-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.rank-progress-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
  letter-spacing: .06em;
  margin-top: .3rem;
  text-align: right;
}
.rank-progress-label span { opacity: .5; }

/* ── Tooltip ──────────────────────────────────────────────────── */
.rank-tooltip {
  display: none;
  position: absolute;
  z-index: 1000;
  background: rgba(5,8,7,.96);
  border: 1px solid rgba(0,230,122,.22);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  padding: .55rem .8rem;
  min-width: 140px;
  pointer-events: none;
}
.tip-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  margin-bottom: .2rem;
}
.tip-pts {
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem; color: #7aaa88;
}
.tip-pct {
  font-size: .62rem; color: #4d6b57;
  margin-top: .1rem;
}

/* ── Rank-up / Derank overlay ─────────────────────────────────── */
.rankup-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,8,7,.88);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .3s ease;
}
.rankup-overlay.active { opacity: 1; }
.rankup-overlay.derank { background: rgba(5,8,7,.75); }

.rankup-inner {
  text-align: center;
  padding: 2rem 1.5rem;
  background: rgba(10,20,16,.95);
  border: 1px solid rgba(0,230,122,.25);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  max-width: 340px; width: 90%;
  position: relative;
}
.rankup-overlay.derank .rankup-inner {
  border-color: rgba(255,255,255,.08);
}

.rankup-proto {
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem; letter-spacing: .15em;
  color: rgba(0,230,122,.6); text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.rankup-proto::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: #00E67A;
  box-shadow: 0 0 6px #00E67A;
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1}50%{opacity:.2} }

.rankup-badges {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; margin-bottom: 1.5rem;
}
.rankup-old { opacity: .45; }
.rankup-arrow {
  font-size: .9rem; color: rgba(0,230,122,.4);
  font-family: 'JetBrains Mono', monospace;
}
.rankup-new {
  transform: scale(.8);
  transition: transform .5s cubic-bezier(.18,.89,.32,1.28);
}
.rankup-new.pop {
  transform: scale(1);
  filter: drop-shadow(0 0 12px rgba(0,230,122,.5));
}
.derank .rankup-new {
  transition: transform .4s ease;
}
.derank .rankup-new.pop { transform: scale(1); filter: none; }

.rankup-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase;
  opacity: 0; transform: translateY(8px);
  transition: opacity .4s ease, transform .4s ease;
  margin-bottom: 1.5rem;
}
.rankup-label.show { opacity: 1; transform: none; }

/* Flash verte rankup */
.rankup-overlay.active:not(.derank)::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background: rgba(0,230,122,.04);
  animation: greenFlash .6s ease forwards;
}
@keyframes greenFlash {
  0%  { opacity: 0; }
  20% { opacity: 1; }
  100%{ opacity: 0; }
}

.rankup-close {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem; letter-spacing: .1em;
  padding: .55rem 1.5rem;
  border: 1px solid rgba(0,230,122,.3);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  background: transparent; color: #00E67A;
  cursor: pointer; transition: all .2s;
}
.rankup-close:hover {
  background: rgba(0,230,122,.08);
  border-color: #00E67A;
}
.derank .rankup-close { color: #7aaa88; border-color: rgba(255,255,255,.15); }

/* ── Page grille ──────────────────────────────────────────────── */
.ranks-page {
  background: #050807;
  min-height: 100vh;
  padding: 5rem 1rem 3rem;
  font-family: 'Space Grotesk', sans-serif;
  color: #e4efe8;
  position: relative;
}
.ranks-page::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 40%, #0a1f14 0%, #050807 75%);
}
.ranks-page::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.05) 2px, rgba(0,0,0,.05) 4px);
}

.ranks-page > * { position: relative; z-index: 1; }

/* Page header */
.rg-header {
  text-align: center;
  margin-bottom: 3rem;
}
.rg-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem; letter-spacing: .18em;
  color: rgba(0,230,122,.6); text-transform: uppercase;
  margin-bottom: .75rem;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.rg-eyebrow::before {
  content: '';
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: #00E67A; box-shadow: 0 0 5px #00E67A;
}
.rg-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700; letter-spacing: -.02em;
  margin-bottom: .4rem;
}
.rg-sub {
  font-size: .82rem; color: #4d6b57;
}

/* ── Grid layout ──────────────────────────────────────────────── */
.rg-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr) 1fr;
  gap: .6rem;
  max-width: 1100px;
  margin: 0 auto 3rem;
  align-items: end;
}

.rg-col {
  display: flex; flex-direction: column; align-items: center; gap: 0;
}
.rg-col-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: .75rem;
}

/* Badge card */
.rg-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: .75rem .5rem .6rem;
  width: 100%;
  border: 1px solid rgba(255,255,255,.05);
  background: rgba(255,255,255,.02);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
}
.rg-card:hover {
  border-color: rgba(0,230,122,.2);
  background: rgba(0,230,122,.03);
  transform: translateY(-2px);
}
.rg-card.active {
  border-color: rgba(0,230,122,.4);
  background: rgba(0,230,122,.05);
}
.rg-card-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: .55rem; letter-spacing: .1em;
  color: #4d6b57; margin-top: .45rem;
  text-transform: uppercase;
}

/* Connector between sub-levels */
.rg-connector {
  display: flex; flex-direction: column; align-items: center;
  color: rgba(0,230,122,.25);
  font-size: .65rem; line-height: 1;
  padding: .1rem 0;
  user-select: none;
}
.rg-connector-line {
  width: 1px; height: 14px;
  background: linear-gradient(to bottom, rgba(0,230,122,.25), rgba(0,230,122,.1));
}

/* ── Radiant special column ───────────────────────────────────── */
.rg-col.radiant-col {
  grid-column: 8;
  justify-content: center;
}
.rg-radiant-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.25rem .75rem 1rem;
  border: 1px solid rgba(0,230,122,.3);
  background: rgba(0,230,122,.04);
  box-shadow: 0 0 30px rgba(0,230,122,.08), inset 0 0 20px rgba(0,230,122,.03);
  cursor: pointer;
  transition: all .25s;
  width: 100%;
}
.rg-radiant-card:hover {
  border-color: rgba(0,230,122,.6);
  box-shadow: 0 0 50px rgba(0,230,122,.15), inset 0 0 30px rgba(0,230,122,.05);
  transform: translateY(-3px);
}
.rg-radiant-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem; letter-spacing: .12em;
  color: #00E67A; text-transform: uppercase;
  margin-top: .6rem;
}
.rg-radiant-unique {
  font-size: .58rem; color: rgba(0,230,122,.45);
  margin-top: .2rem; letter-spacing: .05em;
}

/* ── Current rank showcase ────────────────────────────────────── */
.rg-current {
  max-width: 420px; margin: 0 auto 3rem;
  background: rgba(10,20,16,.8);
  border: 1px solid rgba(0,230,122,.18);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  padding: 1.5rem;
}
.rg-current-header {
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem; letter-spacing: .15em; color: rgba(0,230,122,.5);
  text-transform: uppercase; margin-bottom: 1rem;
  display: flex; align-items: center; gap: .5rem;
}
.rg-current-header::before {
  content: '';
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: #00E67A; animation: blink 1.2s ease-in-out infinite;
}
.rg-current-body {
  display: flex; align-items: center; gap: 1.25rem;
}
.rg-current-info { flex: 1; }
.rg-current-name {
  font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em;
  margin-bottom: .2rem;
}
.rg-current-pts {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem; color: #7aaa88; margin-bottom: .75rem;
}

/* ── Demo section ─────────────────────────────────────────────── */
.rg-demo {
  max-width: 420px; margin: 0 auto;
  text-align: center;
}
.rg-demo-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem; letter-spacing: .15em; color: #4d6b57;
  text-transform: uppercase; margin-bottom: 1rem;
}
.rg-demo-btns {
  display: flex; gap: .75rem; justify-content: center;
}
.btn-demo {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem; letter-spacing: .08em;
  padding: .55rem 1rem;
  border: 1px solid rgba(0,230,122,.25);
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
  background: transparent; color: #00E67A;
  cursor: pointer; transition: all .2s;
}
.btn-demo:hover { background: rgba(0,230,122,.08); border-color: #00E67A; }
.btn-demo.derank { color: #7aaa88; border-color: rgba(255,255,255,.12); }
.btn-demo.derank:hover { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.2); }

/* ── Nav back ─────────────────────────────────────────────────── */
.rg-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: 44px;
  display: flex; align-items: center;
  padding: 0 1rem;
  background: rgba(5,8,7,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,230,122,.08);
}
.rg-nav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem; font-weight: 700; letter-spacing: .12em;
  color: #00E67A; text-decoration: none; text-transform: uppercase;
}
.rg-nav-back {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem; color: #4d6b57;
  text-decoration: none; margin-left: auto;
  transition: color .2s;
}
.rg-nav-back:hover { color: #00E67A; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .rg-grid {
    grid-template-columns: repeat(4, 1fr) 1fr;
    gap: .5rem;
  }
  .rg-col:nth-child(5),
  .rg-col:nth-child(6),
  .rg-col:nth-child(7) {
    display: none;
  }
  .rg-col.radiant-col { grid-column: 5; }
}
@media (max-width: 560px) {
  .rg-grid {
    grid-template-columns: repeat(3, 1fr) 1fr;
    gap: .4rem;
  }
  .rg-col:nth-child(4),
  .rg-col:nth-child(5),
  .rg-col:nth-child(6),
  .rg-col:nth-child(7) {
    display: none;
  }
  .rg-col.radiant-col { grid-column: 4; }
}
@media (max-width: 380px) {
  .rg-grid {
    grid-template-columns: repeat(2, 1fr) 1fr;
  }
  .rg-col:nth-child(3),
  .rg-col:nth-child(4),
  .rg-col:nth-child(5),
  .rg-col:nth-child(6),
  .rg-col:nth-child(7) {
    display: none;
  }
  .rg-col.radiant-col { grid-column: 3; }
}
