/* ===== RANKING 5 ===== */
#page-ranking { overflow-x: clip; }
#page-ranking .container { max-width: 620px; }

.rk-category-badge {
  width: 100%;
  background: rgba(245,200,66,0.08);
  border: 1.5px solid rgba(245,200,66,0.3);
  border-radius: 12px;
  padding: 10px 16px;
  text-align: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(14px, 3.5vw, 20px);
  letter-spacing: 2px;
  color: var(--gold);
  line-height: 1.3;
}
.rk-category-badge small {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(245,200,66,0.5);
  margin-top: 2px;
}

.rk-instruction {
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(240,244,239,0.35);
  text-align: center;
  text-transform: uppercase;
}

.rk-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  user-select: none;
  position: relative;
}

.rk-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  cursor: grab;
  transition: transform 0.22s cubic-bezier(.25,.8,.25,1),
              opacity 0.18s,
              margin-top 0.22s cubic-bezier(.25,.8,.25,1),
              margin-bottom 0.22s cubic-bezier(.25,.8,.25,1),
              background 0.15s, border-color 0.15s, box-shadow 0.15s;
  position: relative;
  touch-action: none;
  will-change: transform;
}
.rk-card:active { cursor: grabbing; }

/* Karta którą ciągniemy — znika z listy (placeholder zostaje) */
.rk-card.rk-dragging {
  opacity: 0;
  pointer-events: none;
}

/* Slot — otwieranie miejsca przed/po karcie */
.rk-card.rk-slot-before { margin-top: 52px; }
.rk-card.rk-slot-after  { margin-bottom: 52px; }

.rk-card.rk-correct {
  border-color: #2ecc71;
  background: rgba(46,204,113,0.1);
  cursor: default;
}
.rk-card.rk-wrong {
  border-color: #e74c3c;
  background: rgba(231,76,60,0.09);
  cursor: default;
}
.rk-card.rk-disabled { cursor: default; }

.rk-pos {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: rgba(245,200,66,0.4);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}
.rk-card.rk-correct .rk-pos { color: #2ecc71; }
.rk-card.rk-wrong   .rk-pos { color: #e74c3c; }

.rk-drag-handle {
  color: rgba(240,244,239,0.2);
  font-size: 16px;
  flex-shrink: 0;
  cursor: grab;
}

.rk-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(14px, 3vw, 18px);
  font-weight: 700;
  color: rgba(240,244,239,0.9);
  flex: 1;
  line-height: 1.2;
}

.rk-result-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.4s;
  flex-shrink: 0;
}
.rk-result-val.visible { opacity: 1; }

.rk-correct-badge {
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.4s;
  flex-shrink: 0;
}
.rk-correct-badge.visible { opacity: 1; }

.rk-score-row .rk-pts { font-size: 28px; color: var(--gold); }

.rk-feedback {
  min-height: 26px;
  text-align: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
}
.rk-feedback.good { color: #2ecc71; }
.rk-feedback.bad  { color: #e74c3c; }
.rk-feedback.ok   { color: #e67e22; }

.rk-progress-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}
.rk-prog-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  transition: background 0.3s;
}
.rk-prog-dot.done    { background: #2ecc71; }
.rk-prog-dot.current { background: var(--gold); transform: scale(1.2); }
.rk-prog-dot.partial { background: #e67e22; }
.rk-prog-dot.bad     { background: #e74c3c; }

/* Ghost — karta podążająca za kursorem */
.rk-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.92;
  transform: rotate(1.5deg) scale(1.03);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1.5px rgba(245,200,66,0.5);
  border-radius: 10px;
  background: #0f2a18;
  border: 1.5px solid rgba(245,200,66,0.6);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  min-width: 220px;
  transition: none;
}

/* ===== RANKING SORT ANIMATION ===== */
.rk-card {
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
}
.rk-card.rk-animating {
  position: relative;
  z-index: 10;
}
.rk-card.rk-moving {
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.rk-card.rk-correct-anim {
  animation: rkCorrectFlash 0.5s ease 0.4s both;
}
@keyframes rkCorrectFlash {
  0%   { background: rgba(46,204,113,0.3); }
  100% { background: ''; }
}

