.mg-user-popup {
  position: absolute;
  top: var(--mg-user-popup-viewport-top, 0px);
  left: var(--mg-user-popup-viewport-left, 0px);
  width: var(--mg-user-popup-viewport-width, 100%);
  height: var(--mg-user-popup-viewport-height, 100vh);
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  align-items: safe center;
  justify-content: safe center;
  padding: 16px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: contain;
  touch-action: none;
}

.mg-user-popup.is-open {
  display: flex;
}

body.mg-user-popup-handoff .mg-user-popup,
body.mg-user-popup-handoff .mg-user-popup__backdrop,
body.mg-user-popup-handoff .mg-user-popup__dialog {
  animation: none !important;
  transition: none !important;
}

body.mg-user-popup-open .nvtooltip {
  z-index: 12020 !important;
}

body.mg-user-popup-open.mg-user-popup-tooltip-suppressed .nvtooltip {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.mg-user-popup-open.mg-user-popup-tooltip-suppressed #mgUserPopup .nv-point.hover,
body.mg-user-popup-open.mg-user-popup-tooltip-suppressed #mgUserPopup .hover .nv-point,
body.mg-user-popup-open.mg-user-popup-tooltip-suppressed #mgUserPopup .nv-interactiveGuideLine,
body.mg-user-popup-open.mg-user-popup-tooltip-suppressed #mgUserPopup line.nv-guideline {
  opacity: 0 !important;
  fill-opacity: 0 !important;
  stroke-opacity: 0 !important;
}

.mg-user-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.mg-user-popup__dialog {
  position: relative;
  container-type: inline-size;
  width: min(620px, 100%);
  max-height: min(760px, calc(var(--mg-user-popup-viewport-height, 100vh) - 32px));
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  border-radius: 8px;
  background: #fff;
  color: #111;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
  padding: 18px 20px 20px;
  box-sizing: border-box;
}

.mg-user-popup__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #111;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.mg-user-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 38px 16px 0;
}

.mg-user-popup__title {
  margin: 0;
  min-width: 0;
  flex: 0 1 auto;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
}

.mg-user-popup__title-link {
  color: #254ead;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.mg-user-popup__title-link:hover,
.mg-user-popup__title-link:focus-visible {
  color: #254ead;
}

.mg-user-popup__header-rank {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  flex: 0 0 auto;
  margin-left: auto;
  color: #111827;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.mg-user-popup__header-rank[hidden] {
  display: none !important;
}

.mg-user-popup__header-rank-label {
  font-weight: 800;
}

.mg-user-popup__header-rank-link {
  color: #254EAD;
  font-weight: 400;
  text-decoration-line: underline !important;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  border-bottom: 0;
  -webkit-tap-highlight-color: transparent;
}

.mg-user-popup__header-rank-value {
  font-weight: 400;
}

.mg-user-popup__header-rank-link:hover,
.mg-user-popup__header-rank-link:focus {
  color: #1d4ed8;
  text-decoration-line: underline !important;
  outline: none;
}

/* 스프린트 게이트 안내 물음표 아이콘("순위" 캡션 왼쪽, SVG). 헤더는 18px/800 이라 말풍선
   글자는 따로 낮춘다. 말풍선의 기준 상자는 아이콘이 아니라 순위 블록 전체(position:relative)로
   두고 블록 오른쪽 끝에 맞춰 아래로 편다: 순위 블록은 다이얼로그 오른쪽(닫기 버튼 안쪽)에
   붙어 있어 오른쪽으로는 절대 잘리지 않고, 폭은 컨테이너 폭(cqw) 기준으로 묶어 왼쪽도
   다이얼로그 안에 머문다. 화살표만 JS(adjustMiniTipPosition)가 아이콘 중심으로 옮긴다. */
.mg-user-popup__header-rank { position: relative; }
/* 아이콘 모양은 player.php 의 unofficial 옆 물음표(play.css .local-rank-help)와 동일한 색·테두리
   (연파랑 원, #9aaee8 테두리, #254EAD 글자 ?). 헤더가 18px 라 크기만 16px 로 키운다. */
.mg-user-popup__header-rank .mg-user-popup__rank-gate {
  position: static;
  /* 글자 ? 를 원 정중앙에: grid place-items 로 놓는다(flex+line-height 만으로는 폰트마다 살짝 치우쳤다). */
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  width: 19px;
  height: 19px;
  padding: 0;
  align-self: center;
  border-radius: 50%;
  background: #eef2ff;
  border: 1px solid #9aaee8;
  color: #254EAD;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mg-user-popup__rank-gate:focus { outline: none; }
.mg-user-popup__rank-gate:focus-visible { border-color: #254EAD; }
/* 말풍선은 흰 다이얼로그 위에 뜨므로 흰 화살표가 묻힌다 → 본체에 얇은 테두리를 두고
   화살표는 테두리색(::before) 위에 흰색(::after)을 1px 작게 겹쳐 윤곽이 보이게 한다. */
.mg-user-popup__rank-gate .mg-user-popup__mini-tip-text {
  top: calc(100% + 8px);
  bottom: auto;
  left: auto;
  right: 0;
  transform: none;
  max-width: min(280px, calc(100cqw - 40px));
  border: 1px solid #cbd5e1;
  font-size: 13px;
  font-weight: 400;
  color: #333;
  overflow: visible;
}
.mg-user-popup__rank-gate .mg-user-popup__mini-tip-text::before,
.mg-user-popup__rank-gate .mg-user-popup__mini-tip-text::after {
  content: '';
  position: absolute;
  top: auto;
  bottom: 100%;
  left: var(--mg-user-popup-mini-tip-arrow-left, 50%);
  transform: translateX(-50%);
  border-style: solid;
}
.mg-user-popup__rank-gate .mg-user-popup__mini-tip-text::before {
  border-width: 7px;
  border-color: transparent transparent #cbd5e1 transparent;
}
.mg-user-popup__rank-gate .mg-user-popup__mini-tip-text::after {
  border-width: 6px;
  border-color: transparent transparent #fff transparent;
  margin-bottom: -1px;
}
.mg-user-popup__header-rank-link.is-gated,
.mg-user-popup__header-rank-value.is-gated { color: #6b7280; }

.mg-user-popup__profile {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  /* 다음 탭 구분선 위·아래를 각각 10px로 맞춘다. */
  margin-bottom: 10px;
}

.mg-user-popup__photo {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  border-radius: 8px;
  object-fit: cover;
  background: #eee;
}

/* 온라인·퍼즐 유저 기록 팝업의 프로필 사진은 다른 사진 미리보기와 같은 100px 정사각형이다. */
.mg-user-popup .mg-user-popup__photo {
  width: 100px;
  height: 100px;
  flex-basis: 100px;
}

/* 퍼즐 홈의 '내 기록'도 유저 기록 팝업과 같은 사진 크기를 사용한다. */
.puzzle-record-profile .mg-user-popup__photo {
  width: 100px;
  height: 100px;
  flex-basis: 100px;
}

.mg-user-popup__identity {
  flex: 1 1 0;
  min-width: 0;
  font-size: 16px;
  line-height: 1.55;
}

.mg-user-popup__identity div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mg-user-popup__id-line {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1px 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

/* 사진 옆 신분 정보는 닉네임 / @ID / Last를 같은 행간으로 쌓고 인증은 닉네임 행에 둔다. */
.mg-user-popup__id-line,
.mg-user-popup__nick-line,
.mg-user-popup__last-line {
  box-sizing: border-box;
  line-height: 22px;
  min-height: 22px;
}

.mg-user-popup__identity .mg-user-popup__id-line {
  overflow: hidden;
}

.mg-user-popup__id-main {
  display: inline-flex;
  align-items: center; /* baseline → center: 국기/인증마크가 ID 텍스트와 세로 중앙 정렬(국기 올라가 보이는 문제 해결) */
  gap: 4px;
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.mg-user-popup__id-main b {
  flex: 0 0 auto;
}

.mg-user-popup__id-value {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  color: #6b7280;
  font-size: 14px;
  font-weight: 400;
}

.mg-user-popup__admin-id-trigger {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: inherit;
  text-align: left;
}

.mg-user-popup__admin-id-trigger:hover .mg-user-popup__id-value,
.mg-user-popup__admin-id-trigger:focus-visible .mg-user-popup__id-value {
  color: #254ead;
}

.mg-user-popup__admin-id-trigger:focus-visible {
  border-radius: 3px;
  outline: 2px solid rgba(37, 78, 173, .35);
  outline-offset: 1px;
}

.mg-user-popup__memo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  text-decoration: none;
  line-height: 1;
  vertical-align: middle;
}

.mg-user-popup__memo-link:hover,
.mg-user-popup__memo-link:focus-visible {
  background: #f3f4f6;
  color: #4b5563;
  text-decoration: none;
}

.mg-user-popup__memo-link svg {
  width: 17px;
  height: 17px;
  display: block;
}

.mg-user-popup__ban-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: 0;
  padding: 1px 6px;
  border-radius: 999px;
  background: #b91c1c;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  vertical-align: middle;
}

.mg-user-popup__nick-line {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.mg-user-popup__identity .mg-user-popup__nick-line {
  overflow: hidden;
  white-space: nowrap;
}

.mg-user-popup__nick-line b {
  flex: 0 0 auto;
}

/* 관리자용 접속 클라이언트(Web/iOS/AOS) 배지는 ID 상세 팝업 안에서만 표시한다. */
.mg-user-popup__client-badge {
  flex: 0 0 auto;
  display: inline-block;
  /* 접속 중이면 'AOS', 끊겼으면 'AOS · 08-22'(마지막 접속일) 라 길이가 달라진다 — 줄바꿈 금지. */
  white-space: nowrap;
  padding: 1px 7px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #f9fafb;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: middle;
}

.mg-user-popup__nick-value {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.mg-user-popup__verified-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: inherit;
  text-align: left;
}

.mg-user-popup__verified-trigger:hover .mg-user-popup__nick-value,
.mg-user-popup__verified-trigger:focus-visible .mg-user-popup__nick-value {
  color: #254ead;
}

.mg-user-popup__verified-trigger:focus-visible {
  border-radius: 4px;
  outline: 2px solid rgba(37, 78, 173, .35);
  outline-offset: 2px;
}

.mg-user-popup__verification-card {
  position: fixed;
  z-index: 2147483646;
  box-sizing: border-box;
  width: min(390px, calc(100vw - 24px));
  padding: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  color: #111827;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .22);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mg-user-popup__verification-card[hidden] {
  display: none !important;
}

.mg-user-popup__verification-card::before {
  position: absolute;
  bottom: 100%;
  left: var(--urv-arrow-x, 50%);
  width: 12px;
  height: 12px;
  border-top: 1px solid #e5e7eb;
  border-left: 1px solid #e5e7eb;
  background: inherit;
  content: "";
  transform: translate(-50%, 6px) rotate(45deg);
}

.mg-user-popup__verification-card.is-above::before {
  top: 100%;
  bottom: auto;
  transform: translate(-50%, -6px) rotate(225deg);
}

.mg-user-popup__verification-title {
  margin-bottom: 16px;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.25;
}

.mg-user-popup__verification-body {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.mg-user-popup__verification-photo {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 10px;
  background: #f3f4f6;
  object-fit: cover;
}

.mg-user-popup__verification-details {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.mg-user-popup__verification-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #536273;
  font-size: 16px;
  line-height: 1.4;
}

.mg-user-popup__verification-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.mg-user-popup__verification-icon--check {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  border-radius: 50%;
  background: #18a058;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.mg-user-popup__verification-row--player {
  gap: 8px;
}

.mg-user-popup__verification-flag {
  display: block;
  width: 24px;
  height: 17px;
  flex: 0 0 24px;
  border: 1px solid #d1d5db;
  border-radius: 2px;
  object-fit: cover;
}

.mg-user-popup__verification-calendar {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.mg-user-popup__verification-player-link,
.mg-user-popup__verification-player-name {
  min-width: 0;
  overflow: hidden;
  color: #1689e6;
  font-weight: 600;
  text-overflow: ellipsis;
  text-decoration: none;
  white-space: nowrap;
}

.mg-user-popup__verification-player-link:hover,
.mg-user-popup__verification-player-link:focus-visible {
  color: #0d6efd;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mg-user-popup__verification-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 18px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #111418;
  color: #fff !important;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  text-decoration: none !important;
}

.mg-user-popup__verification-action:hover,
.mg-user-popup__verification-action:focus-visible {
  background: #20262d;
  color: #fff !important;
}

html.fs-app-theme-dark .mg-user-popup__verification-card {
  border-color: var(--fs-app-popup-border, #526174);
  background: var(--fs-app-popup-surface, #192433);
  color: #f8fafc;
  box-shadow: var(--fs-app-popup-shadow, 0 18px 45px rgba(0, 0, 0, .5));
}

html.fs-app-theme-dark .mg-user-popup__verification-card::before {
  border-color: var(--fs-app-popup-border, #526174);
}

html.fs-app-theme-dark .mg-user-popup__verification-row {
  color: #cbd5e1;
}

html.fs-app-theme-dark .mg-user-popup__verification-photo {
  background: var(--fs-app-surface-2, #1c2635);
}

html.fs-app-theme-dark .mg-user-popup__verification-flag {
  border-color: var(--fs-app-border, #3a414c);
}

html.fs-app-theme-dark .mg-user-popup__verification-player-link,
html.fs-app-theme-dark .mg-user-popup__verification-player-name {
  color: var(--fs-app-link, #93c5fd);
}

html.fs-app-theme-dark .mg-user-popup__verification-action {
  border-color: var(--fs-app-border, #3a414c);
  background: var(--fs-app-surface-2, #1c2635);
  color: var(--fs-app-text, #f1f5f9) !important;
}

html.fs-app-theme-dark .mg-user-popup__verification-action:hover,
html.fs-app-theme-dark .mg-user-popup__verification-action:focus-visible {
  border-color: var(--fs-app-popup-border, #526174);
  background: var(--fs-app-surface-3, #253247);
  color: var(--fs-app-text, #f1f5f9) !important;
}

.mg-user-popup__admin-card {
  position: fixed;
  z-index: 2147483646;
  box-sizing: border-box;
  width: min(340px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 1px solid #d5dbe5;
  border-radius: 10px;
  background: #fff;
  color: #374151;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mg-user-popup__admin-card[hidden] {
  display: none !important;
}

.mg-user-popup__admin-card::before {
  position: absolute;
  bottom: 100%;
  left: var(--urai-arrow-x, 50%);
  width: 10px;
  height: 10px;
  border-top: 1px solid #d5dbe5;
  border-left: 1px solid #d5dbe5;
  background: inherit;
  content: "";
  transform: translate(-50%, 5px) rotate(45deg);
}

.mg-user-popup__admin-card.is-above::before {
  top: 100%;
  bottom: auto;
  transform: translate(-50%, -5px) rotate(225deg);
}

.mg-user-popup__admin-card-id {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mg-user-popup__admin-card-identity {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.4;
}

.mg-user-popup__admin-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
}

.mg-user-popup__admin-card-client {
  display: inline-block;
}

.mg-user-popup__admin-card-language {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

html.fs-app-theme-dark .mg-user-popup__admin-card {
  border-color: var(--fs-app-popup-border, #526174);
  background: var(--fs-app-popup-surface, #192433);
  color: var(--fs-app-text-2, #cbd5e1);
  box-shadow: var(--fs-app-popup-shadow, 0 18px 45px rgba(0, 0, 0, .5));
}

html.fs-app-theme-dark .mg-user-popup__admin-card::before {
  border-color: var(--fs-app-popup-border, #526174);
}

html.fs-app-theme-dark .mg-user-popup__admin-card-id {
  color: var(--fs-app-muted, #94a3b8);
}

html.fs-app-theme-dark .mg-user-popup__admin-card-client {
  border-color: var(--fs-app-border, #3a414c);
  background: var(--fs-app-surface-2, #1c2635);
  color: var(--fs-app-text-2, #cbd5e1);
}

html.fs-app-theme-dark .mg-user-popup__admin-card-language {
  color: var(--fs-app-muted, #94a3b8);
}

.mg-user-popup__last-line {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #4b5563;
  font-size: 15px;
}

.mg-user-popup__last-line b {
  flex: 0 0 auto;
  color: #374151;
}

.mg-user-popup__last-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-left: 4px;
}

/* Last 아래 자기소개: 팝업 폭 안에서는 한 줄 말풍선으로만 보이고, 전체 내용은 별도 팝업에서 읽는다. */
.oc-user-bio__row {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  min-height: 22px;
  margin-top: 2px;
  line-height: 22px;
}

.mg-user-popup__identity .oc-user-bio__row {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.oc-user-bio__bubble,
.oc-user-bio__edit {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.oc-user-bio__bubble {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  height: 22px;
  margin-left: 0;
  padding: 0 10px;
  overflow: visible;
  border: 1px solid #bfcde2;
  border-radius: 11px;
  background: #f8fbff;
  color: #34445a;
  font-size: 14px;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

.oc-user-bio__bubble::before,
.oc-user-bio__bubble::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-style: solid;
  transform: translateY(-50%);
}

.oc-user-bio__bubble::before {
  left: -7px;
  border-width: 5px 7px 5px 0;
  border-color: transparent #bfcde2 transparent transparent;
}

.oc-user-bio__bubble::after {
  left: -5px;
  border-width: 4px 6px 4px 0;
  border-color: transparent #f8fbff transparent transparent;
}

.oc-user-bio__bubble-text {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Emoji fallback glyphs can extend beyond a compact Latin line box.
     Pad the ellipsis clip without changing the 22px/32px bubble layout. */
  line-height: 1.4;
  padding: 2px 0;
  margin: -2px 0;
  white-space: nowrap;
}

.oc-user-bio__bubble--empty {
  color: #9ca3af;
}

.oc-user-bio__bubble--empty:not(button) {
  cursor: default;
}

.oc-user-bio__bubble:hover,
.oc-user-bio__bubble:focus-visible {
  border-color: #94add2;
  background: #f0f6ff;
  outline: none;
}

.oc-user-bio__bubble:hover::before,
.oc-user-bio__bubble:focus-visible::before {
  border-right-color: #94add2;
}

.oc-user-bio__bubble:hover::after,
.oc-user-bio__bubble:focus-visible::after {
  border-right-color: #f0f6ff;
}

.oc-user-bio__edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 22px;
  padding: 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  line-height: 1;
}

.oc-user-bio__edit svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* 100px 프로필 사진을 쓰는 팝업에서는 소개 말풍선의 하단을 사진 하단에 맞춘다.
   신분 정보 3행(66px) + 위 여백(2px) + 말풍선(32px) = 100px. */
.mg-user-popup .oc-user-bio__row {
  min-height: 32px;
  line-height: 32px;
}

.mg-user-popup .oc-user-bio__bubble {
  height: 32px;
  border-radius: 8px;
}

.mg-user-popup .oc-user-bio__edit {
  height: 32px;
}

/* 퍼즐 홈 내 기록도 100px 사진과 같은 하단선에 맞도록 팝업의 말풍선 높이를 공유한다. */
.puzzle-record-profile .oc-user-bio__row {
  min-height: 32px;
  line-height: 32px;
}

.puzzle-record-profile .oc-user-bio__bubble {
  height: 32px;
  border-radius: 8px;
}

.puzzle-record-profile .oc-user-bio__edit {
  height: 32px;
}

.oc-user-bio__edit:hover,
.oc-user-bio__edit:focus-visible {
  background: #eef2f7;
  color: #374151;
  outline: none;
}

.oc-user-bio__edit--empty {
  flex-basis: auto;
  width: auto;
  max-width: 100%;
  gap: 4px;
  padding: 2px 6px 2px 3px;
  color: #6b7280;
  font-size: 13px;
}

.oc-user-bio__edit--empty span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oc-user-bio-modal {
  position: absolute;
  inset: 0;
  z-index: 13050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  box-sizing: border-box;
  touch-action: none;
}

.oc-user-bio-modal--standalone {
  position: fixed;
}

body.oc-user-bio-editing .fs-tabbar {
  display: none !important;
}

.oc-user-bio-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.oc-user-bio-modal__dialog {
  position: relative;
  width: min(420px, 100%);
  max-height: min(520px, calc(100% - 20px));
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  box-sizing: border-box;
  border: 1px solid #d7dce4;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.24);
}

.oc-user-bio-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #e5e7eb;
}

.oc-user-bio-modal__header h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.oc-user-bio-modal__x {
  appearance: none;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4b5563;
  font: 24px/28px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}

.oc-user-bio-modal__x:hover,
.oc-user-bio-modal__x:focus-visible {
  background: #eef2f7;
  outline: none;
}

.oc-user-bio-modal__body {
  padding: 16px;
}

.oc-user-bio-modal__message {
  min-height: 56px;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.oc-user-bio-modal__label {
  display: block;
  margin-bottom: 7px;
  color: #4b5563;
  font-size: 13px;
}

.oc-user-bio-modal__textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  resize: vertical;
  box-sizing: border-box;
  padding: 10px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  outline: none;
}

.oc-user-bio-modal__textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.oc-user-bio-modal__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 21px;
  margin-top: 5px;
  color: #6b7280;
  font-size: 12px;
}

.oc-user-bio-modal__error {
  color: #b91c1c;
}

.oc-user-bio-modal__count {
  flex: 0 0 auto;
  margin-left: auto;
}

.oc-user-bio-modal__count.is-over {
  color: #b91c1c;
  font-weight: 700;
}

.oc-user-bio-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.oc-user-bio-modal__actions button {
  appearance: none;
  min-width: 72px;
  height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  font: 600 14px/34px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}

.oc-user-bio-modal__secondary {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #374151;
}

.oc-user-bio-modal__primary {
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
}

.oc-user-bio-modal__actions button:disabled {
  cursor: default;
  opacity: 0.58;
}

.mg-user-popup__record-history-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: #254EAD;
  cursor: pointer;
  font: inherit;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mg-user-popup__record-history-link:hover,
.mg-user-popup__record-history-link:focus {
  color: #1d4ed8;
  outline: none;
}

.mg-user-popup__verified-link {
  align-items: center;
  color: #254EAD;
  display: inline-flex;
  gap: 4px;
  font-weight: 400;
  text-decoration: none;
  flex: 0 0 auto;
  white-space: nowrap;
}

.mg-user-popup__verified-link:hover,
.mg-user-popup__verified-link:focus {
  color: #0d6efd;
  text-decoration: none;
}

.mg-user-popup__verified-meta {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  max-width: 100%;
  white-space: nowrap;
}

.mg-user-popup__verified-line {
  align-items: center;
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.mg-user-popup__verified-meta .ocpv-verified-badge {
  margin-left: 0 !important;
}

/* 후원 배지: SVG viewBox 가 글리프에 맞게 크롭되어(oc_donor.lib.php 2026-08-10) 박스=실폭.
   간격은 등간격 규칙(배지 마진 = 체크 마진)을 따른다 — nick-line 은 체크가 기본(4px)이라 그대로,
   verified-meta 는 체크가 0(flex gap 5px 사용)이라 배지도 0 으로 미러링. 크기만 팝업 기준 17px. */
.mg-user-popup__verified-meta .oc-donor-badge {
  margin-left: 0 !important;
}

/* 온라인 유저 기록은 비링크 대국방 배지를 실제 후원 페이지 링크로 감싼다.
   배지의 인라인 cursor:default가 링크 커서를 덮지 않도록 링크 내부에서만 손 모양을 복원한다. */
.mg-user-popup__donor-link,
.mg-user-popup__donor-link .oc-donor-badge {
  cursor: pointer !important;
}

/* 링크 래퍼가 nick-line의 flex item이므로 간격은 부모 gap 하나만 사용한다.
   배지 인라인 margin-right까지 남기면 링크 전환 뒤 닉네임 앞 여백이 4px+4px로 겹친다. */
.mg-user-popup__donor-link .oc-donor-badge {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* 국가 순위 링크는 국기 이미지 자체만 클릭된다.
   oc_flag_html()의 기본 오른쪽 여백이 <img> 안에 있으면 그 4px까지 <a>의 클릭 영역이 되므로,
   이미지 여백은 제거하고 같은 간격을 링크의 margin(클릭 박스 바깥)으로 옮긴다.
   국기 크기가 18×14px인 압축 화면도 링크가 콘텐츠 크기를 따르므로 별도 고정 폭을 주지 않는다. */
a.oc-country-leaderboard-link {
  box-sizing: border-box;
  line-height: 0;
  margin: 0 4px 0 0;
  padding: 0;
}

a.oc-country-leaderboard-link > img.oc-flag {
  display: block;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* 유저 기록 팝업은 flex gap이 간격을 소유하므로 링크 바깥 margin도 없애고 20×15px로 고정한다. */
.mg-user-popup .oc-country-leaderboard-link {
  box-sizing: border-box;
  display: inline-flex;
  flex: 0 0 20px;
  height: 15px;
  line-height: 0;
  margin: 0 !important;
  overflow: hidden;
  padding: 0;
  width: 20px;
}

.mg-user-popup .oc-country-leaderboard-link > .oc-flag {
  display: block;
  height: 15px !important;
  width: 20px !important;
}

/* 인증 배지가 없어 후원 배지가 gap 있는 flex 컨테이너의 직접 자식이 되는 경우:
   컨테이너 gap 이 이미 간격을 주므로 자체 margin 을 0 으로 — 아니면 gap+margin 이 겹쳐
   인증이 있을 때(5px)보다 넓어진다(2026-08-11 실측 9px). */
/* ★규칙: gap 을 쓰는 flex 컨테이너에서는 국기·배지의 자체 마진을 모두 0 으로 두고 간격은 gap 하나로만
   준다. 둘 중 하나라도 마진이 남으면 gap 과 합산돼 요소마다 간격이 달라진다(2026-08-11 반복 사고). */
/* 국기는 자손 셀렉터로 잡는다 — 국가 리더보드 링크(.oc-country-leaderboard-link)로 감싸이면
   `>` 로는 안 걸려 팝업 JS 의 margin-right:-2px 가 살아남았고, 국기만 2px 당겨져
   "배지 오른쪽에만 여백이 남은" 것처럼 보였다(2026-08-11). JS 쪽 -2px 자체도 제거함. */
.mg-user-popup__nick-line > .oc-donor-badge,
.mg-user-popup__id-line > .oc-donor-badge,
.mg-user-popup__nick-line > .oc-country-leaderboard-link,
.mg-user-popup__id-line > .oc-country-leaderboard-link,
.mg-user-popup__nick-line .oc-flag,
.mg-user-popup__id-line .oc-flag {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.mg-user-popup__id-line > .ocpv-verified-badge {
  display: none !important;
}

.mg-user-popup__id-line > .mg-user-popup__verified-link:not(.mg-user-popup__verified-flag)::before {
  align-items: center;
  background: #18a058;
  border-radius: 50%;
  color: #fff;
  content: "\2713";
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  height: 15px;
  justify-content: center;
  line-height: 1;
  margin-right: 5px;
  vertical-align: middle;
  width: 15px;
}

.mg-user-popup__stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 16px;
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.45;
  overflow: visible;
}

.mg-user-popup__stat {
  min-width: 0;
  color: #374151;
  white-space: nowrap;     /* 라벨이 길어도 값이 다음 줄로 내려가지 않게 */
}

.mg-user-popup__reactivation-progress {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  white-space: nowrap;
}

.mg-user-popup__streak {
  grid-column: 1;
}

.mg-user-popup__rank {
  grid-column: 1 / -1;
}

.mg-user-popup__label {
  font-weight: 800;
  color: #111;
}

.mg-user-popup__count-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  min-width: 0;
}

.mg-user-popup__loss-row {
  grid-column: 1 / -1;
}

.mg-user-popup__mini-tip {
  position: relative;
  display: inline-block;
  pointer-events: auto;
}

.mg-user-popup__mini-tip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12030;
  padding: 6px 10px;
  border-radius: 4px;
  background: #fff;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-weight: 400;
  /* 긴 설명(예: 독일어 LDiscs 툴팁)이 한 줄로 화면 밖에 잘리던 것 → 줄바꿈 허용하고 폭 상한 안에서 2줄+ 로 */
  white-space: normal;
  width: max-content;
  max-width: min(280px, 90vw);
  text-align: left;
  line-height: 1.35;
  transition: opacity 0.15s ease-in-out;
}

.mg-user-popup__mini-tip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: var(--mg-user-popup-mini-tip-arrow-left, 50%);
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
}

.mg-user-popup__loss-row > span:first-child .mg-user-popup__mini-tip-text {
  left: 0;
  transform: translateX(0);
}

.mg-user-popup__loss-row > span:first-child .mg-user-popup__mini-tip-text::after {
  left: var(--mg-user-popup-mini-tip-arrow-left, 14px);
}

.mg-user-popup__mini-tip:hover .mg-user-popup__mini-tip-text,
.mg-user-popup__mini-tip:focus-within .mg-user-popup__mini-tip-text {
  visibility: visible;
  opacity: 1;
}

.mg-user-popup__chart-wrap {
  position: relative;
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
  overflow: visible;
}

.mg-user-popup__chart {
  display: block;
  width: 100%;
  height: 100px;
  overflow: visible;
}

/* 유저 기록 팝업은 그래프 데이터가 없어도 실제 SVG와 같은 100px을 예약한다.
   퍼즐 홈의 축약 그래프(80/72px)는 .mg-user-popup 밖이므로 이 규칙의 영향을 받지 않는다. */
.mg-user-popup .mg-user-popup__chart-wrap > .mg-user-popup__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100px;
  padding: 0 8px;
  box-sizing: border-box;
}

svg.mg-user-popup__chart,
svg.mg-user-popup__chart.nvd3-svg {
  height: 100px !important;
}

.mg-user-popup__rating-summary {
  display: grid;
  grid-template-columns: repeat(var(--mg-user-popup-tab-count, 4), minmax(0, 1fr));
  gap: 8px;
  /* 활성 모드명을 탭에서 5px 내리되 다음 기록 행과의 기존 간격도 유지한다. */
  margin: 10px 0 31px;
  padding-top: 10px;
  border-top: 1px solid #edf0f3;
}

.mg-user-popup__rating-summary-item {
  position: relative;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  text-align: center;
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.mg-user-popup__presence-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
  vertical-align: middle;
}

.mg-user-popup__presence-dot.is-online {
  background: #22c55e;
}

.mg-user-popup__presence-dot.is-away {
  background: #9ca3af;
}

.mg-user-popup__presence-dot.is-puzzle {
  background: #8b5cf6;
}

.mg-user-popup__presence-dot.is-ingame {
  background: #f97316;
}

.mg-user-popup__presence-dot--tab {
  position: absolute;
  top: 5px;
  right: 5px;
  transform: none;
}

.mg-user-popup__rating-summary-item.active {
  background: #eef2ff;
  border-color: #c7d2fe;
}

/* 활성 모드명은 전체 탭줄 중앙이 아니라 선택된 탭 자체의 중앙 바로 아래에 붙인다. */
.mg-user-popup__rating-summary-active-label {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  color: #64748b;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  pointer-events: none;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .mg-user-popup__rating-summary-item:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
  }
}

.mg-user-popup__rating-summary-item:focus,
.mg-user-popup__rating-summary-item:focus-visible {
  outline: none;
  box-shadow: none;
}

/* 2026-09-09 스프린트 탭 추가로 타일이 6개가 되면서 360px 화면에서 4자리 레이팅이 잘렸다.
   실측(360px, 타일 줄 312px): 15px 글자에 좌우 10px 여백이면 6칸에 424px 필요 → 잘림.
   13px 글자에 좌우 4px 여백이면 312px 로 정확히 들어간다. 350px 이하 전용이던 규칙을 420px 로 넓힌다. */
@media (max-width: 420px) {
  .mg-user-popup__rating-summary { gap: 6px; }
  .mg-user-popup__rating-summary-item { padding-left: 4px; padding-right: 4px; }
}

.mg-user-popup__rating-summary-icon,
.mg-user-popup__rating-summary-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0 auto 3px;
  color: #6b7280;
}

.mg-user-popup__rating-summary-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.mg-user-popup__rating-summary-icon-fallback {
  width: auto;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-user-popup__rating-summary-item.active .mg-user-popup__rating-summary-icon,
.mg-user-popup__rating-summary-item.active .mg-user-popup__rating-summary-icon-fallback {
  color: #111827;
}

.mg-user-popup__rating-summary-value {
  display: flex;
  justify-content: center;
  white-space: nowrap;
  color: #111827;
  font-size: 15px;
  line-height: 1.25;
}

/* 좁은 화면(6탭)에서 4자리 레이팅이 잘리지 않게 축소. 기본 font-size 선언 뒤에 두어야 적용된다
   (미디어쿼리는 특이성을 올리지 않으므로 앞에 두면 아래 15px 선언에 덮인다 — 2026-09-09 실측 확인). */
@media (max-width: 420px) {
  .mg-user-popup__rating-summary-value { font-size: 13px; }
}

/* Keep the full rating + ? centered even when it exceeds a narrow tab's content box. */
.mg-user-popup__rating-summary-value > span {
  flex: 0 0 auto;
}

.mg-user-popup__rating-summary-empty {
  color: #9ca3af;
}

.mg-user-popup__empty,
.mg-user-popup__loading,
.mg-user-popup__error {
  padding: 18px 0;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

.mg-user-popup__error {
  color: #b91c1c;
}

/* 기록이 없는 탭도 정상 탭의 통계+그래프 영역 높이를 그대로 유지한다.
   JS가 현재 viewport에서 실제로 렌더된 가장 큰 기록 영역을 갱신하며,
   아직 정상 탭을 한 번도 그리지 않은 경우에만 260px을 안전한 초기값으로 쓴다. */
.mg-user-popup__record-detail {
  min-height: var(--mg-user-popup-record-detail-height, 260px);
}

.mg-user-popup__record-detail--empty {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.mg-user-popup__record-detail--empty > .mg-user-popup__no-data {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 18px 8px;
  box-sizing: border-box;
}

[data-midgame-user] {
  cursor: pointer;
}

[data-midgame-user] * {
  cursor: pointer;
}

.midgame-player[data-midgame-user],
.pz-player-cell[data-midgame-user] {
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.midgame-player[data-midgame-user]:hover,
.midgame-player[data-midgame-user]:focus,
.pz-player-cell[data-midgame-user]:hover,
.pz-player-cell[data-midgame-user]:focus {
  background: #eff6ff;
}

.midgame-player[data-midgame-user]:hover .midgame-id-text,
.midgame-player[data-midgame-user]:focus .midgame-id-text,
.pz-player-cell[data-midgame-user]:hover .pz-id-text,
.pz-player-cell[data-midgame-user]:focus .pz-id-text {
  color: #1d4ed8;
  text-decoration: underline;
}

#midgame-leaderboard-ko .midgame-id-text,
#endgame-leaderboard-ko .midgame-id-text,
#daily-games-ko .midgame-id-text,
#xot-leaderboard-ko .midgame-id-text,
#midgame-leaderboard .midgame-id-text,
#endgame-leaderboard .midgame-id-text,
#daily-games .midgame-id-text,
#xot-leaderboard .midgame-id-text,
.pz-rank-table .pz-id-text {
  color: #254EAD;
}

#midgame-leaderboard-ko .midgame-id-text > [data-midgame-user]:hover,
#midgame-leaderboard-ko .midgame-id-text > [data-midgame-user]:focus,
#endgame-leaderboard-ko .midgame-id-text > [data-midgame-user]:hover,
#endgame-leaderboard-ko .midgame-id-text > [data-midgame-user]:focus,
#daily-games-ko .midgame-id-text > [data-midgame-user]:hover,
#daily-games-ko .midgame-id-text > [data-midgame-user]:focus,
#xot-leaderboard-ko .midgame-id-text > [data-midgame-user]:hover,
#xot-leaderboard-ko .midgame-id-text > [data-midgame-user]:focus,
#midgame-leaderboard .midgame-id-text > [data-midgame-user]:hover,
#midgame-leaderboard .midgame-id-text > [data-midgame-user]:focus,
#endgame-leaderboard .midgame-id-text > [data-midgame-user]:hover,
#endgame-leaderboard .midgame-id-text > [data-midgame-user]:focus,
#daily-games .midgame-id-text > [data-midgame-user]:hover,
#daily-games .midgame-id-text > [data-midgame-user]:focus,
#xot-leaderboard .midgame-id-text > [data-midgame-user]:hover,
#xot-leaderboard .midgame-id-text > [data-midgame-user]:focus,
.pz-rank-table .pz-id-text > [data-midgame-user]:hover,
.pz-rank-table .pz-id-text > [data-midgame-user]:focus {
  color: #0d6efd;
  text-decoration: none;
}

/* 배지 크기: 체크·후원 배지는 --oc-badge-size(기본 .9em) 하나로 폰트를 따라 함께 스케일된다.
   px 선언·개별 width/height 오버라이드 금지 — 같은 폰트인데 배지 크기가 갈라지는 원인이 된다.
   전체 배율을 바꾸려면 oc_donor.lib.php/player_verify.lib.php 의 기본값만 조정. */

#midgame-leaderboard-ko .midgame-player[data-midgame-user]:hover,
#midgame-leaderboard-ko .midgame-player[data-midgame-user]:focus,
#endgame-leaderboard-ko .midgame-player[data-midgame-user]:hover,
#endgame-leaderboard-ko .midgame-player[data-midgame-user]:focus,
#daily-games-ko .midgame-player[data-midgame-user]:hover,
#daily-games-ko .midgame-player[data-midgame-user]:focus,
#xot-leaderboard-ko .midgame-player[data-midgame-user]:hover,
#xot-leaderboard-ko .midgame-player[data-midgame-user]:focus,
#midgame-leaderboard .midgame-player[data-midgame-user]:hover,
#midgame-leaderboard .midgame-player[data-midgame-user]:focus,
#endgame-leaderboard .midgame-player[data-midgame-user]:hover,
#endgame-leaderboard .midgame-player[data-midgame-user]:focus,
#daily-games .midgame-player[data-midgame-user]:hover,
#daily-games .midgame-player[data-midgame-user]:focus,
#xot-leaderboard .midgame-player[data-midgame-user]:hover,
#xot-leaderboard .midgame-player[data-midgame-user]:focus,
.pz-rank-table .pz-player-cell[data-midgame-user]:hover,
.pz-rank-table .pz-player-cell[data-midgame-user]:focus {
  background: transparent;
}

#midgame-leaderboard-ko .midgame-player[data-midgame-user]:hover .midgame-id-text,
#midgame-leaderboard-ko .midgame-player[data-midgame-user]:focus .midgame-id-text,
#endgame-leaderboard-ko .midgame-player[data-midgame-user]:hover .midgame-id-text,
#endgame-leaderboard-ko .midgame-player[data-midgame-user]:focus .midgame-id-text,
#daily-games-ko .midgame-player[data-midgame-user]:hover .midgame-id-text,
#daily-games-ko .midgame-player[data-midgame-user]:focus .midgame-id-text,
#xot-leaderboard-ko .midgame-player[data-midgame-user]:hover .midgame-id-text,
#xot-leaderboard-ko .midgame-player[data-midgame-user]:focus .midgame-id-text,
#midgame-leaderboard .midgame-player[data-midgame-user]:hover .midgame-id-text,
#midgame-leaderboard .midgame-player[data-midgame-user]:focus .midgame-id-text,
#endgame-leaderboard .midgame-player[data-midgame-user]:hover .midgame-id-text,
#endgame-leaderboard .midgame-player[data-midgame-user]:focus .midgame-id-text,
#daily-games .midgame-player[data-midgame-user]:hover .midgame-id-text,
#daily-games .midgame-player[data-midgame-user]:focus .midgame-id-text,
#xot-leaderboard .midgame-player[data-midgame-user]:hover .midgame-id-text,
#xot-leaderboard .midgame-player[data-midgame-user]:focus .midgame-id-text,
.pz-rank-table .pz-player-cell[data-midgame-user]:hover .pz-id-text,
.pz-rank-table .pz-player-cell[data-midgame-user]:focus .pz-id-text {
  color: #0d6efd;
  text-decoration: none;
}

@media (max-width: 480px) {
  .mg-user-popup {
    padding: 10px;
  }

  .mg-user-popup__dialog {
    padding: 16px 14px 18px;
  }

  .mg-user-popup__header {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-right: 36px;
    margin-bottom: 14px;
  }

  .mg-user-popup__title {
    flex: 0 1 auto;
    font-size: 18px;
    max-width: 100%;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .mg-user-popup__identity,
  .mg-user-popup__stat,
  .mg-user-popup__rating-summary-item,
  .mg-user-popup__rating-summary-icon,
  .mg-user-popup__rating-summary-icon-fallback,
  .mg-user-popup__rating-summary-value {
    min-width: 0;
  }

  .mg-user-popup__stat {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .mg-user-popup__stats .mg-user-popup__stat:nth-child(1),
  .mg-user-popup__stats .mg-user-popup__stat:nth-child(2) {
    overflow-wrap: normal;
    white-space: nowrap;
  }

  .mg-user-popup__nick-line {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .mg-user-popup__identity .mg-user-popup__nick-line {
    overflow: hidden;
    white-space: nowrap;
  }

  .mg-user-popup__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
  }

  .mg-user-popup__stats .mg-user-popup__stat:nth-child(3),
  .mg-user-popup__stats .mg-user-popup__stat:nth-child(4) {
    grid-column: 1 / -1;
  }

  .mg-user-popup__streak {
    grid-column: 1 / -1;
  }

  .mg-user-popup__count-row {
    flex-wrap: wrap;
    gap: 6px 12px;
  }

}

@container (max-width: 560px) {
  .mg-user-popup__header {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-right: 36px;
    margin-bottom: 14px;
  }

  .mg-user-popup__title {
    flex: 0 1 auto;
    font-size: 18px;
    max-width: 100%;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

}

@media (max-width: 412px) {
  /* 좁은 폭에서도 좌/우를 정확히 반씩(50/50). 예전 1.15:0.85 는 우측 칸이 좁아
     '연속 : +2 (최대:+8/-7)' 같은 값이 잘렸다(2026-08-05). */
  .mg-user-popup__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container (max-width: 290px) {
  .mg-user-popup__stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .mg-user-popup__stats .mg-user-popup__stat {
    grid-column: 1 / -1;
  }
}

@media (max-width: 325px) {
  .mg-user-popup__stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .mg-user-popup__stats .mg-user-popup__stat {
    grid-column: 1 / -1;
  }
}


/* 레이팅 단계 색(첨부 범례) — 퍼즐/리더보드/유저기록 팝업 공용. official 한정 적용. bold 포함. */
.pz-rt-red{ color:#e53935; font-weight:450; }
.pz-rt-orange{ color:#fb8c00; font-weight:450; }
.pz-rt-purple{ color:#8e24aa; font-weight:450; }
.pz-rt-blue{ color:#1e88e5; font-weight:450; }
.pz-rt-green{ color:#43a047; font-weight:450; }
.pz-rating-unofficial{ color:#999; font-weight:450; }
#pzResult .pz-difficulty-rating{ font-weight:450; } /* 패널의 유저 레이팅 숫자와 동일 */
.mg-user-popup__rating-summary-item.active .mg-user-popup__rating-summary-value,
.mg-user-popup__rating-summary-item.active .mg-user-popup__rating-summary-value > .pz-rt-red,
.mg-user-popup__rating-summary-item.active .mg-user-popup__rating-summary-value > .pz-rt-orange,
.mg-user-popup__rating-summary-item.active .mg-user-popup__rating-summary-value > .pz-rt-purple,
.mg-user-popup__rating-summary-item.active .mg-user-popup__rating-summary-value > .pz-rt-blue,
.mg-user-popup__rating-summary-item.active .mg-user-popup__rating-summary-value > .pz-rt-green,
.mg-user-popup__rating-summary-item.active .mg-user-popup__rating-summary-value > .pz-rating-unofficial {
  font-weight:700;
}
#pzPanel #pzMyRating{ font-weight:500; }  /* 퍼즐 컨트롤 패널 레이팅 weight (override #pzPanel .pz-rating) */

/* ── 팝업 상단 유저 검색(홈 검색창과 동일 동작 — 결과 클릭 시 현재 탭 유지로 해당 유저 로드) ── */
.mg-user-popup__search{position:relative;margin:0 0 12px}
.mg-user-popup__search-input{display:block;width:100%;height:40px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#111827;font:16px/1.2 -apple-system,system-ui,'Segoe UI',sans-serif;padding:0 40px 0 12px;outline:none;appearance:none;-webkit-appearance:none;box-sizing:border-box}
.mg-user-popup__search-input:focus{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.13)}
.mg-user-popup__search-icon{position:absolute;top:11px;right:12px;width:18px;height:18px;color:#64748b;pointer-events:none}
.mg-user-popup__search-clear{display:none;position:absolute;top:5px;right:6px;width:30px;height:30px;border:0;border-radius:50%;background:transparent;color:#64748b;font:24px/28px -apple-system,system-ui,sans-serif;padding:0;text-align:center;cursor:pointer;-webkit-tap-highlight-color:transparent}
.mg-user-popup__search-clear:hover,.mg-user-popup__search-clear:focus{background:#e2e8f0;color:#334155;outline:none}
.mg-user-popup__search.has-value .mg-user-popup__search-icon{display:none}
.mg-user-popup__search.has-value .mg-user-popup__search-clear{display:block}
.mg-user-popup__search-results{position:absolute;z-index:40;top:45px;left:0;right:0;max-height:260px;overflow-y:auto;background:#fff;border:1px solid #dbe2ea;border-radius:9px;box-shadow:0 10px 24px rgba(15,23,42,.16);padding:4px}
.mg-user-popup__search-results[hidden]{display:none!important}
.mg-user-popup__search-item{display:flex;align-items:center;gap:9px;width:100%;min-height:40px;border:0;border-radius:7px;background:#fff;color:#111827;padding:6px 9px;text-align:left;cursor:pointer;font:inherit}
.mg-user-popup__search-item:hover,.mg-user-popup__search-item:focus,.mg-user-popup__search-item.is-active{background:#eff6ff;outline:none}
.mg-user-popup__search-nick{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
.mg-user-popup__search-id{margin-left:auto;max-width:48%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#64748b;font-size:13px}
.mg-user-popup__search-status{padding:10px;color:#64748b;font-size:13px;text-align:center}

/* 온라인 기록 배치 — 전적·오늘은 각각 한 줄, '연속 | 아레나' 는 같은 행. 좁은 폭에서도
   stat 을 1/-1 로 펴지 않고 2열 50/50(minmax(0,1fr) x2)을 유지한다. 값이 길면 셀 안에서 줄바꿈.
   미디어쿼리 규칙들과 특이도가 같으므로 반드시 파일 끝(그 뒤)에 두어야 이긴다. */
.bup-online-stats .mg-user-popup__stat.bup-record-stat { grid-column: 1 / -1; }
.bup-online-stats .mg-user-popup__stat.bup-today-stat { grid-column: 1 / -1; }
.bup-online-stats .mg-user-popup__stat.mg-user-popup__streak { grid-column: 1; }
.bup-online-stats .mg-user-popup__stat.bup-arena-stat { grid-column: 2; }
.bup-arena-medals{color:#254ead;font-weight:400;text-decoration:none;white-space:nowrap}
.bup-arena-medal-count{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}
.bup-arena-medals:hover,.bup-arena-medals:focus{color:#1d4ed8}
html.fs-app-theme-dark .bup-arena-medals{color:#93c5fd}
html.fs-app-theme-dark .bup-arena-medals:hover,html.fs-app-theme-dark .bup-arena-medals:focus{color:#bfdbfe}

/* 온라인 STD/XOT는 화면 폭과 무관하게 같은 한 줄의 좌우 2열을 유지한다.
   팝업과 퍼즐 홈 카드가 모두 inline-size container이므로 실제 컨테이너 폭에 따라
   전체 전적 → 레이팅(승률) → 레이팅 순서로 내용을 줄인다. */
.bup-online-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
#bupUserPopup .mg-user-popup__stat.bup-opening-stat,
.record-card .mg-user-popup__stat.bup-opening-stat {
  grid-column: auto !important;
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
/* 앞 행의 오른쪽 칸(Arena 등)이 비어 있어도 STD가 그 빈칸으로 올라가지 않게
   두 모드의 열을 명시한다. STD가 새 행을 시작하고 XOT가 같은 행을 완성한다. */
#bupUserPopup .mg-user-popup__stat.bup-opening-stat--std,
.record-card .mg-user-popup__stat.bup-opening-stat--std {
  grid-column: 1 !important;
}
#bupUserPopup .mg-user-popup__stat.bup-opening-stat--xot,
.record-card .mg-user-popup__stat.bup-opening-stat--xot {
  grid-column: 2 !important;
}
#bupUserPopup .bup-opening-stat__mode,
#bupUserPopup .bup-opening-stat__rating,
.record-card .bup-opening-stat__mode,
.record-card .bup-opening-stat__rating {
  flex: 0 0 auto;
}
#bupUserPopup .bup-opening-stat__record,
.record-card .bup-opening-stat__record {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  margin-left: 0;
  white-space: nowrap;
}

/* 전체 형식이 들어가는 폭에서는 기존 STD/XOT 레이팅·승무패·승률을 모두 표시한다. */
@container (min-width: 540px) {
  /* 폭이 넉넉하면 '전적 | 오늘', 다음 행 '연속 | Arena' 배치도 유지한다. */
  #bupUserPopup .mg-user-popup__stat.bup-record-stat,
  .record-card .mg-user-popup__stat.bup-record-stat,
  #bupUserPopup .mg-user-popup__stat.bup-today-stat,
  .record-card .mg-user-popup__stat.bup-today-stat {
    grid-column: auto;
  }
  /* 연속과 아레나는 같은 행에 두고, 그 다음 STD/XOT가 한 쌍으로 시작한다. */
  #bupUserPopup .mg-user-popup__stat.mg-user-popup__streak,
  .record-card .mg-user-popup__stat.mg-user-popup__streak {
    grid-column: 1;
  }
  #bupUserPopup .mg-user-popup__stat.bup-arena-stat,
  .record-card .mg-user-popup__stat.bup-arena-stat {
    grid-column: 2;
  }
}

/* 중간 폭은 승무패 숫자를 먼저 빼고 레이팅과 승률만 남긴다. */
@container (max-width: 539px) {
  #bupUserPopup .bup-opening-stat__wld,
  .record-card .bup-opening-stat__wld {
    display: none;
  }
}

/* 가장 좁은 폭은 승률까지 빼고 STD/XOT 레이팅만 남긴다. */
@container (max-width: 299px) {
  #bupUserPopup .bup-opening-stat__record,
  .record-card .bup-opening-stat__record {
    display: none;
  }
}

/* 엔드 탭 LDiscs 는 '연속' 우측이 아니라 그 아래 한 줄로. */
.mg-user-popup__stat.bup-ldiscs-row {
  grid-column: 1 / -1;
}
