/* =========================================================
   TIỆM TRÀ MƠ ƯỚC — ĐẤU TRƯỜNG LEO RANK PHA CHẾ (v12.47.620)
   Thiết kế chuẩn vừa khung 100% + Bàn Pha Chế 3.0 Chuẩn Quán
   ========================================================= */

.rank-modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(18, 12, 10, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-sizing: border-box;
  font-family: 'Baloo 2', 'Quicksand', system-ui, sans-serif;
  overflow: hidden;
}

.rank-modal[hidden] {
  display: none !important;
}

.rank-modal-card {
  width: min(460px, 100%);
  height: 100%;
  max-height: min(860px, 100%);
  background: linear-gradient(180deg, #fffdf9 0%, #f9f1e4 100%);
  border: 2.5px solid #d9b88c;
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42), inset 0 1px 0 #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #3d271d;
  position: relative;
  box-sizing: border-box;
}

/* Khi vào trận: full-bleed chuẩn vừa khung 100%, hiển thị Bàn Pha Chế 3.0 */
.rank-modal.in-match {
  padding: 0 !important;
}

.rank-modal.in-match .rank-modal-card {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  border: 0 !important;
  background: #f6e3c3 !important;
}

.rank-modal.in-match .rank-header,
.rank-modal.in-match .rank-modal-header {
  display: none !important;
}

.rank-modal.in-match .rank-body,
.rank-modal.in-match .rank-modal-body {
  padding: 0 !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #f6e3c3;
}

/* Header Sảnh & Tổng kết */
.rank-header,
.rank-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, #432818 0%, #6f1d1b 100%);
  color: #fff8eb;
  border-bottom: 2px solid #d4a373;
  flex-shrink: 0;
}

.rank-header-title,
.rank-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.rank-season-pill {
  background: rgba(255, 214, 102, 0.2);
  border: 1px solid rgba(255, 214, 102, 0.55);
  color: #ffd166;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.rank-close-btn,
.rank-modal-close {
  background: rgba(255, 255, 255, 0.14);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.rank-close-btn:hover,
.rank-modal-close:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: scale(1.04);
}

/* Body chung (Sảnh & Kết quả) */
.rank-body,
.rank-modal-body {
  padding: 10px 12px 12px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

/* Thẻ Rank hiện tại (Sảnh) */
.rank-hero-card {
  background: linear-gradient(135deg, #2b1912 0%, #4a2511 55%, #6f1d1b 100%);
  border-radius: 16px;
  padding: 12px;
  color: #fff9f0;
  border: 2px solid #e6b87d;
  box-shadow: 0 6px 18px rgba(67, 40, 24, 0.22);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.rank-hero-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rank-emblem {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.28), rgba(0, 0, 0, 0.35));
  border: 2px solid rgba(255, 215, 130, 0.75);
  display: grid;
  place-items: center;
  font-size: 2rem;
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.rank-hero-info {
  flex: 1;
  min-width: 0;
}

.rank-tier-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #f3d5b5;
  font-weight: 700;
}

.rank-tier-name {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.15;
  color: #ffd166;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.rank-rp-num {
  font-size: 0.86rem;
  font-weight: 800;
  color: #fff;
  margin-top: 1px;
}

.rank-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rank-progress-bar {
  height: 9px;
  background: rgba(0, 0, 0, 0.42);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.rank-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b 0%, #ffd166 55%, #34d399 100%);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.rank-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #f3d5b5;
  font-weight: 600;
}

/* Chỉ số nhanh */
.rank-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  flex-shrink: 0;
}

.rank-stat-box {
  background: #fff9f2;
  border: 1.5px solid #e6ccb2;
  border-radius: 12px;
  padding: 6px 4px;
  text-align: center;
}

.rank-stat-val {
  font-size: 0.96rem;
  font-weight: 900;
  color: #582f0e;
  line-height: 1.15;
}

.rank-stat-lbl {
  font-size: 0.66rem;
  color: #7f5539;
  font-weight: 700;
}

/* Hành động Sảnh */
.rank-lobby-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.rank-start-btn {
  flex: 1;
  background: linear-gradient(135deg, #d97706 0%, #b45309 50%, #991b1b 100%);
  color: #fff;
  border: 2px solid #fde68a;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 0.96rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(180, 83, 9, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.rank-start-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.rank-start-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.rank-rules-toggle {
  background: #fff8eb;
  border: 1.5px solid #d4a373;
  color: #6f1d1b;
  border-radius: 14px;
  padding: 10px 11px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

/* Bảng Xếp Hạng Top Server */
.rank-lb-section {
  background: #fffdf9;
  border: 1.5px solid #e6ccb2;
  border-radius: 14px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 150px;
}

.rank-lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 0.85rem;
  color: #432818;
}

.rank-lb-refresh {
  background: none;
  border: 1px solid #d4a373;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6f1d1b;
  cursor: pointer;
}

.rank-lb-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  padding-right: 2px;
  flex: 1;
}

.rank-lb-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #fdf6ec;
  border: 1px solid #eddcd2;
  font-size: 0.8rem;
}

.rank-lb-row.is-me {
  background: linear-gradient(90deg, #fef3c7 0%, #ffedd5 100%);
  border-color: #f59e0b;
  font-weight: 800;
}

.rank-lb-pos {
  font-weight: 900;
  text-align: center;
  color: #7f5539;
}

.rank-lb-name {
  font-weight: 800;
  color: #3d271d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-lb-sub {
  font-size: 0.68rem;
  color: #7f5539;
  font-weight: 600;
}

.rank-lb-rp {
  text-align: right;
  font-weight: 900;
  color: #991b1b;
  font-size: 0.82rem;
}

/* =========================================================
   MÀN THI ĐẤU: HUD ĐẤU TRƯỜNG + QUẦY PHA CHẾ 3.0 CHUẨN QUÁN
   ========================================================= */

.rank-counter-hud {
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  background: linear-gradient(90deg, #2b1912 0%, #4a2511 55%, #2b1912 100%);
  border-bottom: 2px solid #d4a373;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  gap: 4px;
  color: #fff8eb;
  z-index: 40;
  box-sizing: border-box;
  flex-shrink: 0;
}

.rank-hud-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.rank-hud-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 214, 102, 0.35);
  border-radius: 9px;
  padding: 2px 7px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1.2;
}

.rank-hud-pill b {
  font-size: 0.86rem;
  color: #ffd166;
  font-variant-numeric: tabular-nums;
}

.rank-hud-pill.urgent {
  background: rgba(220, 38, 38, 0.35);
  border-color: #f87171;
  animation: rankPulse 0.8s infinite alternate;
}

.rank-hud-pill.combo-hot {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(220, 38, 38, 0.35));
  border-color: #fde047;
}

.rank-hud-exit {
  background: rgba(220, 38, 38, 0.85);
  border: 1.5px solid #fca5a5;
  color: #fff;
  border-radius: 9px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

@keyframes rankPulse {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

/* Sân khấu Bàn Pha Chế 3.0 (#rankQ3 & #rankQ3Stage) vừa khít khung */
#rankQ3 {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  overflow: clip;
  overscroll-behavior: none;
  touch-action: manipulation;
  background: #f6e3c3;
}

#rankQ3Stage {
  position: absolute;
  width: 768px;
  height: 1376px;
  transform-origin: 0 0;
  background-color: #f6e3c3;
  background-image: url(../img/bg.jpg);
  background-size: 768px 1376px;
  background-repeat: no-repeat;
  font-family: "Baloo 2", system-ui, sans-serif;
  color: #3b2a20;
  -webkit-user-select: none;
  user-select: none;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

#rankQ3Stage button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#rankQ3Stage img,
#rankQ3Stage .q3spr,
#rankQ3Stage .q3pop,
#rankQ3Stage .q3fc,
#rankQ3Stage .q3face {
  filter: none !important;
}

#rankFace {
  position: absolute !important;
  left: 44px !important;
  top: 187px !important;
  width: 144px !important;
  height: 141px !important;
  z-index: 22 !important;
  pointer-events: none;
}

#rankBub {
  z-index: 22 !important;
}

#rankWant {
  grid-row: span 2;
  width: 50px;
  height: 70px;
  align-self: end;
  position: relative;
  margin-bottom: 4px;
}

#rankSay {
  font-weight: 700;
  font-size: 20px;
  line-height: 1.18;
  max-height: 68px;
  overflow: hidden;
  display: block;
  word-break: break-word;
  align-self: center;
  color: #2b1810;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.95), 0 0 4px rgba(255, 255, 255, 0.85);
}

#rankSay b {
  color: #b91c1c;
  font-weight: 800;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.95);
}

.q3bub.q3idleB #rankWant {
  display: none;
}

.q3bub.q3idleB #rankSay {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  font-size: 24px !important;
}

#rankCup {
  position: absolute;
  will-change: left, top, transform;
  z-index: 15;
  pointer-events: none;
  transition: left 0.24s cubic-bezier(0.25, 1, 0.5, 1), top 0.24s cubic-bezier(0.25, 1, 0.5, 1);
}

#rankCup .q3g > img.rk-cup-skin-back,
#rankWant .q3g > img.rk-cup-skin-back {
  position: absolute;
  left: 1%;
  top: 8.5%;
  width: 125%;
  height: 91.5%;
  max-width: none;
  pointer-events: none;
  z-index: 1;
}

#rankCup .q3g > svg:first-of-type,
#rankWant .q3g > svg:first-of-type {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

#rankCup .q3g > svg:first-of-type .lq,
#rankWant .q3g > svg:first-of-type .lq {
  opacity: 0.85;
}

#rankCup .q3g > img.rk-cup-skin-front,
#rankWant .q3g > img.rk-cup-skin-front {
  position: absolute;
  left: 1%;
  top: 8.5%;
  width: 125%;
  height: 91.5%;
  max-width: none;
  pointer-events: none;
  z-index: 3;
  opacity: 0.46;
}

#rankCup .q3g > img.rk-lid-skin-overlay,
#rankWant .q3g > img.rk-lid-skin-overlay {
  position: absolute;
  left: -38%;
  top: -76%;
  width: 176%;
  height: 122%;
  max-width: none;
  pointer-events: none;
  z-index: 4;
}

#rankCup .q3g > svg.q3size-svg {
  z-index: 5;
}

#rankNoCup {
  position: absolute;
  left: 41px;
  top: 766px;
  width: 186px;
  text-align: center;
  font-weight: 900;
  font-size: 21px;
  color: #582f0e;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.92), 0 0 6px rgba(255, 255, 255, 0.85);
  line-height: 1.15;
  pointer-events: none;
}

#rankHint {
  position: absolute;
  left: 10px;
  top: 904px;
  width: 246px;
  min-height: 36px;
  max-height: 48px;
  box-sizing: border-box;
  text-align: center;
  font-weight: 700;
  font-size: 12.5px;
  color: #4a2f1b;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

/* Banner chấm điểm ly vừa giao trên quầy */
#rankToast {
  position: absolute;
  left: 50%;
  top: 302px;
  transform: translateX(-50%);
  z-index: 30;
  padding: 5px 16px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 20px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  animation: rankToastPop 0.22s ease-out;
}

#rankToast.good {
  background: #dcfce7;
  color: #166534;
  border: 2.5px solid #22c55e;
}

#rankToast.warn {
  background: #fef3c7;
  color: #92400e;
  border: 2.5px solid #f59e0b;
}

#rankToast.bad {
  background: #fee2e2;
  color: #991b1b;
  border: 2.5px solid #ef4444;
}

@keyframes rankToastPop {
  from { transform: translate(-50%, 8px) scale(0.9); opacity: 0; }
  to { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

/* =========================================================
   MÀN TỔNG KẾT TRẬN ĐẤU
   ========================================================= */
.rank-result-card {
  background: linear-gradient(180deg, #fffbf5 0%, #fef3c7 100%);
  border: 2px solid #f59e0b;
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-result-delta {
  font-size: 1.65rem;
  font-weight: 900;
}

.rank-result-delta.pos {
  color: #15803d;
}

.rank-result-delta.neg {
  color: #b91c1c;
}

/* =========================================================
   HỆ THỐNG SKIN MÙA RANK (10 CHỦ ĐỀ THEO MÙA & BẬC RANK)
   ========================================================= */
.rank-skin-section {
  background: linear-gradient(180deg, #fffdf9 0%, #fdf4e7 100%);
  border: 1.5px solid #e6ccb2;
  border-radius: 14px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex-shrink: 0;
}

.rank-skin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 0.84rem;
  color: #432818;
}

.rank-skin-cur-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

.rank-skin-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.rank-skin-card {
  min-width: 104px;
  max-width: 104px;
  background: #fff9f2;
  border: 2px solid #e6ccb2;
  border-radius: 12px;
  padding: 6px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  flex-shrink: 0;
  position: relative;
  text-align: center;
}

.rank-skin-card:hover {
  transform: translateY(-2px);
  border-color: #d97706;
}

.rank-skin-card.active {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #d97706;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.rank-skin-card.locked {
  opacity: 0.68;
  background: #f5ebe1;
  border-color: #d6c7b8;
  cursor: not-allowed;
}

.rank-skin-card.locked .rank-skin-thumb {
  filter: grayscale(0.45);
}

.rank-skin-card.locked .rank-skin-btn-lbl {
  background: #e5d5c5;
  color: #7f5539;
}

.rank-skin-thumb {
  width: 68px;
  height: 62px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(120, 53, 15, 0.25);
  overflow: hidden;
  background-color: #f5ddaf;
}

.rank-skin-thumb img {
  pointer-events: none;
  user-select: none;
}

.rank-skin-season-tag {
  font-size: 0.6rem;
  font-weight: 800;
  color: #92400e;
  background: #fde68a;
  padding: 1px 5px;
  border-radius: 6px;
  line-height: 1.2;
}

.rank-skin-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: #3d271d;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.rank-skin-btn-lbl {
  font-size: 0.62rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eddcd2;
  color: #582f0e;
  white-space: nowrap;
}

.rank-skin-card.active .rank-skin-btn-lbl {
  background: linear-gradient(135deg, #d97706, #991b1b);
  color: #fff;
}

/* Khung Avatar theo Mùa Rank (chỉ dùng cho Avatar tròn có tâm trong suốt) */
.rk-ava-framed {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rk-ava-framed .rk-ava-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff8eb;
  border: 1.5px solid #f59e0b;
  z-index: 1;
}

.rk-ava-framed .rk-ava-ring {
  position: absolute;
  inset: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
}

.rk-hero-ava-framed {
  position: relative;
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rk-hero-ava-framed .rk-ava-img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff8eb;
  border: 2px solid #fde68a;
  z-index: 1;
}

.rk-hero-ava-framed .rk-ava-ring {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
}

/* Lớp phủ Dụng Cụ & Nguyên Liệu Mùa Rank trên Bàn Pha Chế (#rankQ3Stage) */
.rk-skin-backdrop {
  position: absolute;
  inset: 0;
  width: 768px;
  height: 1376px;
  pointer-events: none;
  z-index: 1;
}

.rk-skin-backdrop > div,
.rk-skin-backdrop img,
.rk-skin-backdrop .rk-clean-patch {
  position: absolute;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.rk-skin-tool {
  position: absolute;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  object-fit: contain;
  z-index: 3;
}

.rk-top-lbl {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 3px;
  font-size: 11.5px;
  font-weight: 900;
  color: #fff8eb;
  background: rgba(43, 25, 18, 0.78);
  border-radius: 6px;
  padding: 1px 3px;
  text-align: center;
  line-height: 1.1;
  pointer-events: none;
  z-index: 6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rk-btl-lbl {
  position: absolute;
  font-size: 11px;
  font-weight: 900;
  color: #fff8eb;
  background: rgba(43, 25, 18, 0.82);
  border: 1px solid rgba(255, 214, 102, 0.55);
  border-radius: 6px;
  padding: 1px 2px;
  text-align: center;
  line-height: 1.1;
  pointer-events: none;
  z-index: 6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   THANH FEVER, GIỜ CAO ĐIỂM, FOOD REVIEWER & SỰ CỐ QUẦY BAR
   ========================================================= */
.rank-hud-fever-pill {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 9px;
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 900;
  color: #fde68a;
  position: relative;
  overflow: hidden;
  min-width: 72px;
}

.rank-hud-fever-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.55), rgba(239, 68, 68, 0.65));
  transition: width 0.25s ease;
  z-index: 0;
}

.rank-hud-fever-pill > span,
.rank-hud-fever-pill > b {
  position: relative;
  z-index: 1;
}

.rank-hud-fever-pill.fever-on {
  border-color: #fde047;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.75);
  animation: rankPulse 0.55s infinite alternate;
}

#rankRushBanner {
  position: absolute;
  left: 50%;
  top: 78px;
  transform: translateX(-50%);
  z-index: 28;
  background: linear-gradient(90deg, #dc2626 0%, #f59e0b 50%, #dc2626 100%);
  color: #fff;
  border: 2px solid #fef08a;
  border-radius: 999px;
  padding: 3px 16px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.4px;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.5);
  pointer-events: none;
  white-space: nowrap;
  animation: rankPulse 0.65s infinite alternate;
}

#rankQ3Stage.fever-mode #rankCup {
  filter: drop-shadow(0 0 14px rgba(250, 204, 21, 0.9)) !important;
}

/* Hiệu ứng hóa đơn mờ chữ (Order viết tắt / mờ chữ ở Rank cao) */
#rankSay.faded-order {
  filter: blur(3.6px);
  opacity: 0.38;
  transition: filter 0.4s ease, opacity 0.4s ease;
  cursor: pointer;
}

.rk-unfade-hint {
  position: absolute;
  left: 50%;
  top: 26px;
  transform: translateX(-50%);
  background: rgba(124, 45, 18, 0.95);
  color: #fef3c7;
  border: 1.5px solid #f59e0b;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 800;
  z-index: 25;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

.rk-reviewer-tag {
  display: inline-block;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 6px;
  margin-right: 4px;
  border: 1px solid #fbcfe8;
}

/* Nhãn báo Hết Nguyên Liệu Tạm Thời cần bấm Ủ Trà / Nấu Trân Châu */
.rk-out-overlay {
  position: absolute;
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.97) 0%, rgba(69, 10, 10, 0.98) 100%);
  border: 2px solid #fde047;
  border-radius: 10px;
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
  z-index: 15;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  animation: rankPulse 0.65s infinite alternate;
}

/* =========================================================
   CÔNG THỨC ĐỘC QUYỀN & PHẦN THƯỞNG MÙA RANK (SEASON REWARDS)
   ========================================================= */
.rank-sig-section {
  background: linear-gradient(180deg, #fffdf9 0%, #fef7ec 100%);
  border: 1.5px solid #e6ccb2;
  border-radius: 14px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.rank-sig-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.rank-sig-card {
  background: #fff9f2;
  border: 1.5px solid #e6ccb2;
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.72rem;
}

.rank-sig-card.unlocked {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #f59e0b;
}

.rank-sig-title {
  font-weight: 900;
  color: #432818;
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.rank-sig-desc {
  color: #7f5539;
  font-size: 0.66rem;
  line-height: 1.25;
}

.rank-sig-claim-btn {
  margin-top: 2px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  border: 1px solid #86efac;
  border-radius: 7px;
  padding: 3px 6px;
  font-size: 0.66rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}

.rank-sig-claim-btn:disabled {
  background: #e5d5c5;
  color: #7f5539;
  border-color: #d6c7b8;
  cursor: default;
}

/* Tabs BXH Mùa Giải / Tuần & Huy hiệu Hạng S/A/B/C */
.rank-lb-tabs {
  display: flex;
  gap: 5px;
}

.rank-lb-tab-btn {
  background: #fdf6ec;
  border: 1px solid #d4a373;
  color: #7f5539;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
}

.rank-lb-tab-btn.active {
  background: linear-gradient(135deg, #d97706, #991b1b);
  color: #fff;
  border-color: #fde68a;
}

.rank-grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 1.7rem;
  font-weight: 900;
  margin: 0 auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.rank-grade-S {
  background: linear-gradient(135deg, #facc15 0%, #f59e0b 50%, #dc2626 100%);
  color: #fff;
  border: 2px solid #fef08a;
}

.rank-grade-A {
  background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
  color: #fff;
  border: 2px solid #bae6fd;
}

.rank-grade-B {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  color: #fff;
  border: 2px solid #a7f3d0;
}

.rank-grade-C {
  background: linear-gradient(135deg, #94a3b8 0%, #475569 100%);
  color: #fff;
  border: 2px solid #e2e8f0;
}

.rank-up-banner {
  background: linear-gradient(90deg, #f59e0b, #dc2626, #f59e0b);
  color: #fff;
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 900;
  border: 1.5px solid #fef08a;
  animation: rankPulse 0.7s infinite alternate;
}



