/* 오락실 공통 UI 조각 (버튼, 칩, 순위 목록, 모달). 게임 페이지(common.css가 불러옴)와
   오락실·명예의 전당·내 기록·관리자 페이지가 같이 쓴다. */
:root {
  --snow: #eef2ee;
  --sky: #cfe2e8;
  --ink: #2b1d16;
  --fur: #4a3022;
  --band: #d9a25b;
  --cream: #f2e2c4;
  --berry: #c9463d;
  --pine: #2f6f57;
  --gold: #e8b83a;
}
@keyframes bj-fade { from { opacity: 0; } }
@keyframes bj-pop { from { transform: scale(.94); opacity: 0; } }
.bj-b {
  font: inherit; font-size: 1.12em; line-height: 1;
  display: inline-flex; align-items: center; gap: .35em;
  padding: .55em 1.15em .62em;
  border: 3px solid var(--ink); border-radius: 14px;
  background: var(--cream); color: var(--ink); cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
}
.bj-b svg { width: 1.05em; height: 1.05em; }
.bj-b.primary { background: var(--berry); color: #fff; }
.bj-b:hover { filter: brightness(1.05); }
.bj-b:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.bj-b:focus-visible, .bj-link:focus-visible, .bj-sbtn:focus-visible, .bj-lbtn:focus-visible { outline: 3px solid var(--band); outline-offset: 2px; }
.bj-hint { opacity: .55; font-size: .82em; margin: .7em 0 0; }
.bj-fine { opacity: .72; font-size: .86em; margin: .25em 0; }
.bj-chip { display: inline-block; padding: .18em .7em .24em; border-radius: 999px; background: var(--band); color: var(--ink); font-size: .9em; margin: .15em .1em; }
.bj-chip.gold { background: var(--gold); }
.bj-save { margin-top: .4em; min-height: 1.5em; }
.bj-ach { margin-top: .2em; }
.bj-link { font: inherit; background: none; border: 0; padding: 0 .2em; color: var(--berry); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.bj-rank { list-style: none; margin: .2em auto 0; padding: 0; max-width: 18em; text-align: left; }
.bj-rank li { display: flex; gap: .5em; align-items: baseline; padding: .12em .2em; border-bottom: 1.5px dashed rgba(43, 29, 22, .18); }
.bj-rank .n { width: 1.4em; text-align: center; color: var(--berry); }
.bj-rank .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bj-rank b { font-weight: 400; font-variant-numeric: tabular-nums; }
.bj-rank .bj-guest { align-self: center; }
/* 손님 배지: 로그인하지 않고 이름만 남긴 기록 */
.bj-guest {
  flex: none; display: inline-block; vertical-align: middle;
  font-family: "Jua", system-ui, sans-serif; font-size: 12px; line-height: 1; white-space: nowrap;
  padding: 3px 7px 4px; border-radius: 999px;
  border: 1.5px solid rgba(43, 29, 22, .45); background: #e3e9e6; color: rgba(43, 29, 22, .8);
}
/* 순위 줄의 기록 시각: 작고 흐리게 월-일. 마우스를 올리면(터치는 줄을 누르면) 연월일 시분초 말풍선(.bj-tip, body에 하나),
   명예의 전당처럼 inline이면 그 자리에서 글자가 바뀐다 */
.bj-when {
  flex: none; white-space: nowrap;
  font-family: system-ui, sans-serif; font-size: 11px; line-height: 1.2; font-variant-numeric: tabular-nums;
  color: rgba(43, 29, 22, .45); cursor: default;
}
.bj-when .f { display: none; }
.bj-when.inline { white-space: normal; }
@media (hover: hover) {
  li:hover .bj-when.inline .s, .row:hover .bj-when.inline .s { display: none; }
  li:hover .bj-when.inline .f, .row:hover .bj-when.inline .f { display: inline; }
}
.bj-when.inline.open .s { display: none; }
.bj-when.inline.open .f { display: inline; }
.bj-tip {
  position: fixed; z-index: 1000; pointer-events: none;
  padding: 5px 9px 6px; border-radius: 8px; background: var(--ink, #2b1d16); color: #fff;
  font-family: system-ui, sans-serif; font-size: 12px; line-height: 1.2; white-space: nowrap;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25);
}
.bj-tip[hidden] { display: none; }
/* 게임 끝 화면: 손님 이름 남기기 */
.bj-gname { margin: .2em auto 0; max-width: 21em; }
.bj-gname p { margin: .2em 0; }
.bj-gname-title { font-size: 1.02em; color: var(--berry); }
.bj-gname-form { display: flex; gap: .4em; justify-content: center; margin: .45em 0 .1em; }
.bj-gname-in {
  flex: 1; min-width: 0; max-width: 11em;
  font: inherit; font-size: 17px; padding: .35em .6em .4em;
  border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink);
}
.bj-gname-in:focus-visible { outline: 3px solid var(--band); outline-offset: 1px; }
.bj-gname-go { font-size: 1em; padding: .4em .8em .45em; box-shadow: 0 3px 0 var(--ink); }
.bj-gname-err { color: var(--berry); font-size: .86em; min-height: 0; }
.bj-gname-err:empty { display: none; }

/* 모달 (자랑하기, 로그인) */
.bj-modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 12px;
  background: rgba(43, 29, 22, .45);
  animation: bj-fade .15s ease-out;
}
.bj-sheet {
  width: min(100%, 420px); max-height: 100%; overflow: auto;
  background: var(--snow); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 18px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 12px 14px 14px;
  font-family: "Jua", system-ui, sans-serif;
  animation: bj-pop .18s ease-out;
}
.bj-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.bj-sheet h3 { margin: 0; font-weight: 400; font-size: 21px; }
.bj-x { width: 34px; height: 34px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); display: grid; place-items: center; padding: 0; cursor: pointer; }
.bj-x svg { width: 16px; height: 16px; }
.bj-card-img { display: block; width: 100%; aspect-ratio: 1200 / 630; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--sky); margin-bottom: 10px; }
.bj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bj-sbtn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px 9px; min-height: 64px;
  border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink);
  font: inherit; font-size: 14px; cursor: pointer; text-decoration: none;
}
.bj-sbtn svg { width: 24px; height: 24px; }
.bj-sbtn.kakao { background: #fee500; color: #191600; }
.bj-sbtn.xcom { background: #111; color: #fff; }
.bj-sbtn.fb { background: #1877f2; color: #fff; }
.bj-sbtn.native { background: var(--berry); color: #fff; }
.bj-sbtn:active { transform: translateY(2px); }
.bj-note { margin: 8px 0 0; font-size: 15px; min-height: 1.2em; word-break: break-all; }
.bj-login { display: flex; flex-direction: column; gap: 9px; }
.bj-login .bj-note { margin: 0 0 4px; }
.bj-lbtn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; border-radius: 12px; border: 2px solid var(--ink);
  font: inherit; font-size: 17px; text-decoration: none;
}
.bj-lbtn svg { width: 22px; height: 22px; }
.bj-lbtn.google { background: #fff; color: #1f1f1f; }
.bj-lbtn.github { background: #24292f; color: #fff; }
.bj-lbtn.kakao { background: #fee500; color: rgba(0, 0, 0, .85); }
.bj-lbtn.email { background: var(--cream); color: var(--ink); }
.bj-lbtn:active { transform: translateY(2px); }
.bj-sheet .bj-fine { font-size: 13px; text-align: center; margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  .bj-modal, .bj-sheet { animation: none; }
}

/* 상단 언어 선택 (BJ.langPicker). 머리글의 알약 버튼과 같은 생김새, 메뉴는 자랑하기 창처럼 굵은 테두리 */
.bj-lang { position: relative; display: inline-flex; font-family: "Jua", system-ui, sans-serif; }
.bj-lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 17px; line-height: 1; padding: 8px 11px 9px 12px;
  border: 2.5px solid var(--ink); border-radius: 999px;
  background: var(--snow); color: var(--ink); box-shadow: 0 3px 0 var(--ink); cursor: pointer; white-space: nowrap;
}
.bj-lang-btn:hover, .bj-lang-btn[aria-expanded="true"] { background: var(--cream); }
.bj-lang-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.bj-lang-btn:focus-visible { outline: 3px solid var(--berry); outline-offset: 3px; }
.bj-lang-btn svg { width: 18px; height: 18px; flex: none; }
.bj-lang-btn .bj-lang-caret { width: 15px; height: 15px; margin-left: -1px; transition: transform .15s; }
.bj-lang-btn[aria-expanded="true"] .bj-lang-caret { transform: rotate(180deg); }
.bj-lang-menu {
  position: absolute; top: calc(100% + 9px); right: 0; z-index: 60;
  min-width: 100%; margin: 0; padding: 6px; list-style: none;
  background: var(--snow); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink);
  animation: bj-pop .14s ease-out;
}
.bj-lang.left .bj-lang-menu { right: auto; left: 0; }
.bj-lang-menu[hidden] { display: none; }
.bj-lang-menu a {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 11px 10px; border-radius: 10px; color: var(--ink); text-decoration: none;
  font-size: 17px; line-height: 1; white-space: nowrap;
}
.bj-lang-menu a:hover { background: var(--cream); }
.bj-lang-menu a:focus-visible { outline: 2.5px solid var(--berry); outline-offset: -2.5px; }
.bj-lang-menu a[aria-current] { background: var(--band); }
.bj-lang-menu a svg { width: 17px; height: 17px; flex: none; }
.bj-lang-menu li + li { margin-top: 3px; }
@media (max-width: 640px) { .bj-lang-btn, .bj-lang-menu a { font-size: 15px; } .bj-lang-btn { padding: 7px 10px 8px 11px; } }
@media (prefers-reduced-motion: reduce) { .bj-lang-menu { animation: none; } .bj-lang-btn .bj-lang-caret { transition: none; } }
