/* =============================================================================
   감자 마이닝 누적 랭킹 오버레이 (mining-rank.js) — 다크 프리미엄 카드
   ============================================================================= */
.mr-overlay {
  position: fixed; inset: 0; z-index: 4600;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(0, 0, 0, 0); pointer-events: none; transition: background .22s ease;
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}
.mr-overlay.open { background: rgba(4, 6, 14, .62); pointer-events: auto; }
.mr-box {
  position: relative; width: min(100%, 360px); max-height: 82vh; overflow-y: auto;
  background: linear-gradient(180deg, #161d31, #10151f);
  border: 1px solid rgba(255, 227, 154, .16); border-radius: 18px;
  padding: 20px 16px 16px; color: #eef1f7;
  box-shadow: 0 20px 52px rgba(4, 8, 20, .6);
  transform: translateY(16px) scale(.97); opacity: 0;
  transition: transform .24s ease, opacity .24s ease;
  -webkit-overflow-scrolling: touch;
}
.mr-overlay.open .mr-box { transform: none; opacity: 1; }

.mr-close {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px;
  background: rgba(255, 255, 255, .06); border: none; border-radius: 50%;
  color: rgba(255, 255, 255, .55); font-size: 15px; cursor: pointer; line-height: 1;
}
.mr-close:active { transform: scale(.9); }

.mr-head { text-align: center; margin-bottom: 12px; }
.mr-title { font-size: 18px; font-weight: 900; letter-spacing: -.3px; color: #ffe6a6; }
.mr-sub { margin-top: 3px; font-size: 11.5px; color: #9aa6c2; }
.mr-preview {
  display: inline-block; margin-top: 8px; font-size: 10.5px; font-weight: 800; letter-spacing: .3px;
  padding: 3px 9px; border-radius: 6px; color: #9ec0ff;
  background: rgba(120, 160, 255, .14); border: 1px solid rgba(120, 160, 255, .28);
}

.mr-loading, .mr-empty {
  text-align: center; color: #8a95b2; font-size: 13px; padding: 34px 10px; line-height: 1.6;
}
.mr-empty { font-size: 30px; }
.mr-empty div { font-size: 13px; margin-top: 8px; }

/* 리스트 */
.mr-list { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.mr-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 11px;
  background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .05);
}
.mr-row.mr-top { background: rgba(255, 210, 90, .07); border-color: rgba(255, 210, 90, .18); }
.mr-row.mr-me { background: rgba(90, 200, 130, .1); border-color: rgba(90, 200, 130, .32); }

.mr-row-rank { flex: 0 0 30px; display: flex; justify-content: center; }
.mr-rankno { font-size: 13px; font-weight: 800; color: #9aa6c2; font-variant-numeric: tabular-nums; }
.mr-medal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 12px; font-weight: 900; color: #3a2600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}
.mr-gold   { background: linear-gradient(180deg, #ffe58a, #f0b818); }
.mr-silver { background: linear-gradient(180deg, #eef2f8, #b9c3d4); }
.mr-bronze { background: linear-gradient(180deg, #f0c08a, #c9873f); color: #3a1e00; }

.mr-row-name {
  flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column;
  font-size: 13.5px; font-weight: 700; color: #e7ecf6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mr-row-sub { font-size: 10.5px; font-weight: 600; color: #7e8aa6; margin-top: 1px; }
.mr-row-val {
  flex: 0 0 auto; font-size: 13.5px; font-weight: 900; color: #ffd873;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.mr-row-val .mr-po { font-size: 12px; }

/* 내 순위 (하단 고정 강조) */
.mr-mine { margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(255, 255, 255, .08); }
.mr-mine-label { font-size: 10.5px; font-weight: 800; letter-spacing: .4px; color: #8a95b2; margin-bottom: 6px; }
.mr-unranked { text-align: center; font-size: 12.5px; color: #8a95b2; padding: 10px; }

/* 홈 농장 헤더 CCTV 옆 랭킹 버튼(플로팅) — .cctv-btn 과 동일 앵커링(라벨은 .farm-header 기준)으로
   두 버튼 라벨 세로 정렬 일치. 아이콘 48px로 CCTV와 크기 매칭. */
.mr-farm-btn {
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; align-self: center; margin-right: 22px;
  transition: transform .2s;
}
.mr-farm-btn svg {
  width: 48px; height: 48px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .7));
}
.mr-farm-btn .label {
  position: absolute; bottom: -14px;
  font-size: 11px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 1), 0 0 6px rgba(0, 0, 0, .8);
  white-space: nowrap; pointer-events: none;
}
.mr-farm-btn:active { transform: scale(.9); }

@media (prefers-reduced-motion: reduce) {
  .mr-overlay, .mr-box, .mr-farm-btn { transition: none !important; }
}
