/* ============================================================
   🎈 PR Celebration Balloons — bóng bay chúc mừng kỷ lục cá nhân
   Mỗi cự ly 1 màu: 5K xanh lá, 10K xanh dương, HM tím, FM đỏ
   ============================================================ */
#prBalloonLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 980;
  overflow: hidden;
}

.prb-balloon {
  position: absolute;
  left: 0;
  top: 0;
  width: 92px;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.22));
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.prb-body {
  position: relative;
  width: 92px;
  height: 108px;
  border-radius: 50% 50% 47% 47% / 56% 56% 44% 44%;
  background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.75) 0 7%, rgba(255, 255, 255, 0.18) 16%, transparent 34%), var(--prb-color);
  box-shadow: inset -9px -12px 18px rgba(0, 0, 0, 0.22), inset 6px 6px 12px rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 8px 14px;
  box-sizing: border-box;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s ease;
}

.prb-balloon:hover .prb-body {
  transform: scale(1.08);
}

.prb-tag {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.4px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--prb-color);
  text-shadow: none;
  padding: 1px 7px;
  border-radius: 999px;
  margin-bottom: 4px;
  white-space: nowrap;
}

.prb-name {
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.15;
  max-height: 2.35em;
  overflow: hidden;
  word-break: break-word;
}

.prb-time {
  font-size: 12.5px;
  font-weight: 900;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.prb-knot {
  width: 0;
  height: 0;
  margin: -3px auto 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 9px solid var(--prb-color);
  transform: rotate(180deg);
  filter: brightness(0.85);
}

.prb-string {
  display: block;
  width: 14px;
  height: 46px;
  margin: 0 auto;
  overflow: visible;
}

.prb-string path {
  fill: none;
  stroke: rgba(100, 116, 139, 0.75);
  stroke-width: 1.4;
}

.prb-balloon.prb-5k  { --prb-color: #16a34a; }
.prb-balloon.prb-10k { --prb-color: #2563eb; }
.prb-balloon.prb-hm  { --prb-color: #9333ea; }
.prb-balloon.prb-fm  { --prb-color: #dc2626; }

/* Nút bật/tắt bóng bay */
#prBalloonToggle {
  position: fixed;
  left: 12px;
  bottom: 58px;
  z-index: 981;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(255, 255, 255, 0.92);
  color: #334155;
  font-size: 11.5px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);
}

#prBalloonToggle:hover {
  background: #ffffff;
}

#prBalloonAddBtn {
  position: fixed;
  left: 12px;
  bottom: 92px;
  z-index: 981;
  border: 1px solid rgba(220, 38, 38, 0.5);
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

#prBalloonAddBtn:hover {
  filter: brightness(1.08);
}

.prb-admin-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}

.prb-btn-adm {
  flex: 1;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.prb-btn-adm.prb-btn-edit {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.prb-btn-adm.prb-btn-del {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.prb-btn-adm.prb-btn-save {
  background: #16a34a;
  border-color: #15803d;
  color: #ffffff;
}

.prb-edit-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 270px;
}

.prb-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prb-field label {
  font-size: 11px;
  font-weight: 800;
  color: #475569;
}

.prb-field input,
.prb-field select {
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #0f172a;
  background: #ffffff;
}

/* Thẻ chi tiết khi bấm vào bóng */
#prBalloonCard {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  z-index: 982;
  min-width: 260px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  color: #0f172a;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  border-top: 5px solid var(--prb-color, #16a34a);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

#prBalloonCard.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.prb-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 22px;
}

.prb-card-ava {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
}

.prb-card-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--prb-color, #16a34a);
}

.prb-card-name {
  font-size: 15px;
  font-weight: 900;
}

.prb-card-body {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.prb-card-body b {
  font-size: 16px;
}

.prb-card-close {
  position: absolute;
  top: 6px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  color: #94a3b8;
}

@media (max-width: 640px) {
  .prb-balloon { width: 64px; }
  .prb-body { width: 64px; height: 76px; padding: 7px 5px 10px; }
  .prb-tag { font-size: 8px; padding: 1px 5px; margin-bottom: 2px; }
  .prb-name { font-size: 8.5px; }
  .prb-time { font-size: 10px; margin-top: 2px; }
  .prb-string { height: 28px; }
}
