/* match.css — หาแมตช์ + หน้าต่างกดพร้อม · คู่กับ match-ui.js / match-ready.js */
.mm-spin {
  display: block;
  width: calc(var(--u, 6px) * 9);
  height: calc(var(--u, 6px) * 9);
  border: 5px solid #ffffff33;
  border-top-color: #2ff3ff;
  border-radius: 50%;
  animation: mmr 1s linear infinite;
}
@keyframes mmr {
  to {
    transform: rotate(360deg);
  }
}
.rmv .rm-slot.searching {
  cursor: default;
}
.mm-modal {
  position: fixed;
  inset: 0;
  z-index: 9350;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000a;
}
.mm-box {
  width: min(92vw, 460px);
  background: linear-gradient(#241a55, #150f38);
  border: 3px solid #f2b84b;
  border-radius: 18px;
  padding: 16px 18px;
  color: #fff;
  text-align: center;
  font-family: Sarabun, sans-serif;
}
.mm-box h3 {
  margin: 0 0 6px;
  color: #ffd978;
  font-size: 20px;
}
.mm-box p {
  margin: 0 0 12px;
  color: #e6dcff;
}
.mm-box small {
  display: block;
  margin-top: 8px;
  color: #cfd3ff;
}
.mm-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.mm-btns button {
  flex: 1;
  border: 3px solid transparent;
  border-radius: 14px;
  padding: 12px 8px;
  font:
    800 15px Sarabun,
    sans-serif;
  color: #fff;
  background: linear-gradient(#a487f0, #5b3cb3);
  box-shadow: 0 4px 0 #3a2680;
  cursor: pointer;
}
.mm-btns button.on {
  border-color: #2ff3ff;
  box-shadow: 0 0 14px #2ff3ff;
}

/* หน้าต่างกดพร้อม (หาแมตช์ครบ) — ยังไม่กด = ขาวดำ · กดแล้ว = ภาพสี */
.mm-rd {
  width: min(94vw, 560px);
  animation: mmIn 0.25s cubic-bezier(0.3, 1.5, 0.5, 1);
}
@keyframes mmIn {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
}
.mm-faces {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 2.4vw, 18px);
  margin: 10px 0 12px;
}
.mm-face {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: clamp(58px, 13vw, 92px);
}
.mm-face i {
  position: relative;
  display: block;
  width: clamp(50px, 11vw, 76px);
  height: clamp(50px, 11vw, 76px);
  border-radius: 50%;
  overflow: hidden;
  background: #3a2f6b;
  box-shadow: 0 0 0 3px #6b6390;
  filter: grayscale(1) brightness(0.7);
  transition:
    filter 0.3s,
    box-shadow 0.3s,
    transform 0.3s;
}
.mm-face i > :not(.av-fc) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mm-face.on i {
  filter: none;
  box-shadow:
    0 0 0 3px #7dff9a,
    0 0 16px #7dff9a99;
  transform: scale(1.06);
}
.mm-face.me b {
  color: #ffd978;
}
.mm-face b {
  font:
    800 clamp(10px, 1.6vw, 13px) Sarabun,
    sans-serif;
  color: #e6dcff;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm-face em {
  position: absolute;
  right: 2px;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2fbf5a;
  color: #fff;
  font:
    900 13px/22px Sarabun,
    sans-serif;
  font-style: normal;
  box-shadow: 0 0 0 2px #150f38;
}
.mm-rbar {
  height: 8px;
  border-radius: 99px;
  background: #0006;
  overflow: hidden;
  margin: 0 6px 12px;
}
.mm-rbar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ff8a3d, #ffd978);
  transition: width 0.25s linear;
}
.mm-go {
  border: 0;
  border-radius: 99px;
  padding: 10px 34px;
  font:
    900 clamp(15px, 2.4vw, 19px) Sarabun,
    sans-serif;
  color: #3b1d00;
  background: linear-gradient(#fff2b8, #ffc94a);
  box-shadow:
    0 4px 0 #b4781c,
    0 0 18px #ffd97899;
  cursor: pointer;
  animation: mmPulse 1.2s ease-in-out infinite;
}
@keyframes mmPulse {
  50% {
    transform: scale(1.05);
  }
}
.mm-go.done {
  animation: none;
  background: #4d4680;
  color: #e6dcff;
  box-shadow: none;
  cursor: default;
}
