/**
 * Tí Tốt — linh vật Vương Quốc Cờ (P6).
 * Widget góc trái dưới, bob nhẹ + chớp mắt (transform/opacity only).
 * Reduced-motion → đứng yên hoàn toàn (vẫn đổi cảm xúc + bong bóng).
 */

.ckms {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 9900; /* dưới thẻ lễ (10060) và lễ phong cấp — mascot không che lễ */
  width: 92px;
  pointer-events: none; /* không chặn bàn cờ; chỉ nút × nhận click */
}

.ckms-svg {
  width: 92px;
  height: 92px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.18));
  animation: ckmsBob 3.2s ease-in-out infinite;
}

/* chớp mắt: chỉ symbol idle gắn class tt-eye */
.ckms-svg .tt-eye {
  animation: ckmsBlink 4.6s infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.ckms-hide {
  position: absolute;
  top: -4px;
  right: -2px;
  width: 22px;
  height: 22px;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  background: #ffffff;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ckms:hover .ckms-hide,
.ckms-hide:focus-visible {
  opacity: 1;
}

.ckms-bubble {
  position: absolute;
  bottom: 96px;
  left: 4px;
  min-width: 130px;
  max-width: 210px;
  background: #ffffff;
  border: 2px solid #fcd34d;
  border-radius: 14px 14px 14px 4px;
  padding: 8px 12px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
  animation: ckmsPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.ckms-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 16px;
  border: 6px solid transparent;
  border-top-color: #fcd34d;
  border-bottom: 0;
}

@keyframes ckmsBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes ckmsBlink {
  0%, 91%, 100% { transform: scaleY(1); }
  93%, 95% { transform: scaleY(0.08); }
  97% { transform: scaleY(1); }
}

@keyframes ckmsPop {
  from { transform: scale(0.75); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Mobile: nhỏ lại + né toolbar dưới của viewer */
@media (max-width: 640px) {
  .ckms { width: 68px; left: 8px; bottom: 72px; }
  .ckms-svg { width: 68px; height: 68px; }
  .ckms-bubble { bottom: 72px; font-size: 12px; }
  .ckms-hide { opacity: 1; } /* mobile không có hover — luôn thấy nút ẩn */
}

@media (prefers-reduced-motion: reduce) {
  .ckms-svg,
  .ckms-svg .tt-eye,
  .ckms-bubble {
    animation: none !important;
  }
}

.ckms-reduced .ckms-svg,
.ckms-reduced .ckms-svg .tt-eye,
.ckms-reduced .ckms-bubble {
  animation: none !important;
}
