/* 하늘에서 마작패가 내려온다면 — 게임 화면 스타일 */
.mj-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: #e8eaf2;
  font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  background:
    radial-gradient(700px 400px at 50% -10%, rgba(99, 102, 241, 0.25), transparent 60%),
    linear-gradient(180deg, #141327 0%, #0d0c1c 100%);
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.mj-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px 4px;
  font-size: 13px;
}
.mj-score { font-size: 17px; font-weight: 800; }
.mj-speed { color: #9aa0b8; }
.mj-hud-right { display: flex; align-items: center; gap: 8px; }
.mj-pause-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 14px;
  color: #e8eaf2;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  cursor: pointer;
}
.mj-pause-btn:active { background: rgba(255, 255, 255, 0.2); }
/* 직접 그린 SVG 아이콘 (이모지 금지 — 2026-07-07 지시) */
.mj-icon { display: block; margin: 0 auto; }
.mj-pause-btn, .mj-btn { display: inline-grid; place-items: center; }
.mj-pause-btn .mj-icon { width: 15px; height: 15px; }
.mj-btn .mj-icon { width: 24px; height: 24px; }
/* 일시정지 오버레이 — 탭하면 재개 */
.mj-pause[hidden] { display: none; }
.mj-pause {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(8, 7, 18, 0.82);
  cursor: pointer;
}
.mj-pause-title { font-size: 30px; font-weight: 900; letter-spacing: 2px; }
.mj-pause-sub { color: #9aa0b8; font-size: 13px; }
/* 중단(저장 후 메인으로) — 2026-07-07 스펙 */
.mj-quit-btn { margin-top: 18px; }
.mj-quit-confirm {
  margin-top: 14px;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(20, 16, 40, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  cursor: default;
}
.mj-quit-confirm[hidden] { display: none; }
.mj-quit-msg { color: #e8eaf2; font-size: 14px; }
.mj-quit-note { color: #9aa0b8; font-size: 12.5px; margin-top: -8px; }
/* 타이틀 재개 패널 */
.mj-resume-msg { color: #c3c8dd; font-size: 14px; margin: 0 0 6px; }

/* 유예 멘쯔 — 태그(개수)만, 보드 우상단 부유 칩
 * (2026-07-07 지시: 손패 줄에 그리면 줄이 넘쳐 보드가 밀림) */
.mj-pending-tag {
  position: absolute;
  top: 4px;
  right: 6px;
  z-index: 6;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #ffd166;
  border: 1px solid rgba(255, 209, 102, 0.6);
  background: rgba(20, 16, 40, 0.85);
  white-space: nowrap;
  pointer-events: none;
}
.mj-pending-tag[hidden] { display: none; }
/* 손패 초과분 배분 선택지 — 소거된 멘쯔의 패 이미지 행 */
.mj-choice-keys { display: inline-flex; gap: 2px; }
.mj-choice-keys .mj-mini { width: 26px; height: 35px; }

/* ── 도움말 메뉴 + 페이지형 튜토리얼 (2026-07-07) ── */
.mj-help-menu { display: flex; flex-direction: column; gap: 12px; margin-bottom: 6px; }
.mj-tut-body { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mj-tut-fig {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 4px;
}
.mj-tut-row { display: flex; align-items: center; gap: 3px; }
.mj-tut-row .mj-mini { width: 26px; height: 35px; }
.mj-tut-gap { width: 12px; }
.mj-tut-labeled { display: flex; align-items: center; gap: 10px; }
.mj-tut-label { color: #9aa0b8; font-size: 12px; min-width: 34px; text-align: right; }
.mj-tut-cap { color: #ffd166; font-size: 12px; }
.mj-tut-text { margin: 0; color: #c3c8dd; font-size: 13.5px; line-height: 1.55; text-align: center; }
.mj-tut-grid { display: grid; grid-template-columns: repeat(3, 30px); gap: 3px; }
.mj-tut-cell { width: 30px; height: 39px; border-radius: 4px; background: rgba(255, 255, 255, 0.05); display: grid; place-items: center; }
.mj-tut-cell .mj-mini { width: 26px; height: 35px; }
.mj-tut-cell.is-glow .mj-mini,
.mj-tut-row.is-glow .mj-mini { outline: 2px solid rgba(255, 209, 102, 0.95); outline-offset: 1px; border-radius: 3px; }
.mj-tut-cell.is-dim { opacity: 0.45; }
.mj-tut-row.is-foul .mj-mini { outline: 2px solid rgba(255, 84, 112, 0.95); outline-offset: 1px; border-radius: 3px; }
.mj-tut-dots { display: flex; gap: 6px; justify-content: center; margin: 10px 0 2px; }
.mj-tut-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}
.mj-tut-dot.is-on { background: #ffd166; }
.mj-tutorial .mj-btn-fantasy[disabled] { opacity: 0.35; pointer-events: none; }
.mj-dora {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mj-dora-label { color: #9aa0b8; font-size: 11px; margin-right: 2px; }

.mj-hand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 12px 6px;
  min-height: 30px;
  flex-wrap: wrap;
}
.mj-hand-label { color: #9aa0b8; font-size: 12px; }
.mj-meld {
  display: inline-flex;
  gap: 2px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}
.mj-mini {
  display: inline-block;
  width: 18px;
  height: 24px;
  background: #f8f5ec url('tiles/Front.svg') center / 100% 100% no-repeat;
  border-radius: 3px;
  overflow: hidden;
}
.mj-mini img { width: 100%; height: 100%; display: block; }

.mj-board-wrap {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 0;
  padding: 2px 0;
  position: relative; /* 유예 칩(.mj-pending-tag) 부유 기준 */
}
.mj-canvas {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
}

/* ── 3초 선택 패널 (보드 위 오버레이) ── */
.mj-choice {
  position: absolute;
  left: 50%;
  bottom: 118px;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 20px));
  background: rgba(18, 16, 38, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 10px 12px 12px;
  z-index: 30;
  box-shadow: 0 12px 34px -12px rgba(0, 0, 0, 0.8);
}
.mj-choice-title { font-size: 14px; font-weight: 700; margin-bottom: 7px; }
.mj-choice-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 9px;
}
.mj-choice-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}
.mj-choice-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.mj-choice-btn {
  flex: 1 1 auto;
  min-width: 90px;
  padding: 9px 10px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  cursor: pointer;
}
.mj-choice-btn:active { background: rgba(255, 255, 255, 0.2); }

/* ── 결과/반칙 배너 ── */
.mj-banner {
  position: absolute;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  background: rgba(18, 16, 38, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  /* 게임오버 오버레이(50)/화료 연출(70) 위에도 보여야 함 —
   * 공유의 인스타/복사 안내 토스트가 가려지던 버그 (2026-07-07) */
  z-index: 80;
  pointer-events: none;
}

/* ── 하단 조작 버튼 (왼손: 이동+소프트드롭 / 오른손: 회전) ── */
.mj-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 12px;
}
.mj-pad { display: flex; gap: 8px; }
.mj-btn {
  width: 56px;
  height: 56px;
  font-size: 22px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  cursor: pointer;
  touch-action: none;
}
.mj-btn:active { background: rgba(255, 255, 255, 0.22); }

/* ── 왼쪽 아래 응원 캐릭터 ── */
.mj-char {
  position: absolute;
  left: 6px;
  bottom: 84px; /* 조작 패드(패딩 포함 ≈76px) 바로 위 */
  /* 높이 기준 사이징 — 모드(일반/기쁨/조마조마)마다 이미지 가로 비율이
   * 달라도 캐릭터 키가 동일하게 유지된다 (폭은 비율 따라 자동) */
  height: clamp(97px, 26vw, 157px);
  width: auto;
  pointer-events: none;
  z-index: 20; /* 선택 패널(30)·오버레이(50)·화료(70) 아래 */
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
}
/* 숨쉬기(2s)·기뻐하는 들썩임(0.35s) 애니메이션은 CSS transform 이 아니라
 * mahjong.js 의 charTick() 이 canvas 에 매 프레임 세로 스케일로 그린다.
 * (CSS transform 애니메이션 레이어 + 이미지 교체 = 페인트 미갱신 버그) */
/* 캐릭터 말풍선 — 네 멘쯔 완성인데 머리 후보가 없을 때 */
.mj-char-bubble[hidden] { display: none; }
.mj-char-bubble {
  position: absolute;
  z-index: 21;
  transform: translateX(-50%);
  background: rgba(18, 16, 38, 0.92);
  border: 1.5px solid rgba(255, 209, 102, 0.9);
  color: #ffe9a8;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.8);
  animation: mj-bubble-bob 1.4s ease-in-out infinite;
}
.mj-char-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(255, 209, 102, 0.9);
  border-bottom: 0;
}
@keyframes mj-bubble-bob {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -3px; }
}

/* ── 타이틀 / 게임오버 ── */
.mj-overlay[hidden] { display: none; }
.mj-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 9, 22, 0.88);
  z-index: 50;
  padding: 16px;
}
.mj-overlay-box {
  text-align: center;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.mj-title {
  margin: 0;
  font-size: clamp(26px, 7vw, 38px);
  line-height: 1.25;
  white-space: pre-line;
  background: linear-gradient(92deg, #34d399 0%, #38bdf8 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 900;
}
.mj-rules { text-align: left; color: #c3c8dd; font-size: 13.5px; line-height: 1.55; }
.mj-rules p { margin: 0 0 7px; }
.mj-final { font-size: 34px; font-weight: 900; }
.mj-high { color: #9aa0b8; font-size: 14px; }
.mj-start {
  padding: 12px 34px;
  font-size: 17px;
  font-weight: 800;
  color: #101322;
  background: linear-gradient(92deg, #34d399, #38bdf8);
  border: none;
  border-radius: 12px;
  cursor: pointer;
}
/* 게임오버 화면 버튼 행 — 다시 + 메인 메뉴 (2026-07-07) */
.mj-over-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.mj-start-menu {
  color: #e8eaf2;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

/* ── 게임오버 낙하 연출 — GAME OVER 가 한 글자씩 위에서 떨어짐,
 *    아무 탭/키 → 결과 화면 (2026-07-07 스펙) ── */
.mj-overanim {
  position: absolute;
  inset: 0;
  z-index: 40; /* 결과 오버레이(50)보다 아래, 게임 UI 위 */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 7, 18, 0.55);
  cursor: pointer;
}
.mj-overanim-letters { display: flex; }
.mj-char-front { z-index: 41; } /* 게임오버 연출 중 캐릭터를 어두운 막 위로 */
.mj-oa-letter {
  font-size: clamp(30px, 8.5vw, 58px);
  font-weight: 900;
  letter-spacing: 2px;
  color: #ff5470;
  text-shadow: 0 3px 0 rgba(120, 10, 40, 0.85), 0 10px 24px rgba(255, 84, 112, 0.4);
  transform: translateY(-70vh);
  animation: mj-oa-fall 0.6s ease-in forwards;
}
@keyframes mj-oa-fall {
  0% { transform: translateY(-70vh); }
  62% { transform: translateY(0); }
  78% { transform: translateY(-14px); }
  100% { transform: translateY(0); }
}
.mj-share { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mj-share-btn {
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  display: inline-grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  cursor: pointer;
}

/* ── 소거 타격 이펙트 ── */
@keyframes mj-shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(2px, -2px); }
  50% { transform: translate(-2px, 2px); }
  75% { transform: translate(2px, 1px); }
}
.mj-board-wrap.is-shake .mj-canvas { animation: mj-shake 0.13s linear 2; }
.mj-fly {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(255, 230, 150, 0.95));
  transition: transform 0.38s cubic-bezier(0.3, 0.7, 0.4, 1), opacity 0.38s ease;
  opacity: 1;
}
.mj-fly img { width: 100%; height: 100%; display: block; }

/* ── 화료 전체 화면 연출 ── */
.mj-win[hidden] { display: none; }
.mj-win {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 7, 18, 0.92);
  padding: 20px;
  cursor: pointer;
}
.mj-win-box { text-align: center; width: min(360px, 100%); }
/* 완성된 패 — 종류별 정렬 일렬 (2026-07-07) */
.mj-win-tiles {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin: 2px 0 14px;
}
.mj-win-tiles .mj-mini { width: 22px; height: 29px; flex: 0 1 auto; }
.mj-win-tiles.is-many .mj-mini { width: 18px; height: 24px; }
.mj-win-title {
  font-size: 44px;
  font-weight: 900;
  margin-bottom: 16px;
  letter-spacing: 2px;
}
.mj-win-yaku { display: flex; flex-direction: column; gap: 7px; min-height: 40px; }
.mj-win-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 19px;
  font-weight: 700;
  padding: 3px 14px;
  animation: mj-win-in 0.16s ease;
}
@keyframes mj-win-in {
  from { opacity: 0; transform: translateY(8px) scale(1.15); }
  to { opacity: 1; transform: none; }
}
.mj-win-total {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: mj-win-in 0.2s ease;
}
.mj-win-hanfu { font-size: 22px; font-weight: 800; }
.mj-win-points { font-size: 40px; font-weight: 900; }
/* 등급 색 — 만관 미만 흰색 / 만관 파랑 / 하네만 보라 / 배만 주황 /
 * 삼배만 빨강 / 역만(복수 포함) 무지개 */
.mj-win.is-white  { color: #f4f4f8; }
.mj-win.is-blue   { color: #4fa8ff; }
.mj-win.is-purple { color: #b487ff; }
.mj-win.is-orange { color: #ffab4a; }
.mj-win.is-red    { color: #ff5d5d; }
.mj-win.is-rainbow .mj-win-title,
.mj-win.is-rainbow .mj-win-row,
.mj-win.is-rainbow .mj-win-hanfu,
.mj-win.is-rainbow .mj-win-points {
  background: linear-gradient(92deg, #ff5d5d, #ffab4a, #ffe94a, #4ade80, #4fa8ff, #b487ff);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: mj-rainbow 2.2s linear infinite, mj-win-in 0.16s ease;
}
@keyframes mj-rainbow {
  0% { background-position: 0% center; }
  100% { background-position: 300% center; }
}

/* ── 국사무쌍 슬롯 (13종) ── */
.mj-kokushi {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 12px 6px;
}
.mj-kokushi-label { color: #9aa0b8; font-size: 11px; margin-right: 3px; }
.mj-kokushi .mj-mini { width: 16px; height: 21px; }
.mj-kokushi .mj-mini.is-missing { opacity: 0.22; filter: grayscale(1); }

/* ── 왼쪽 사이드: 다음 패 + 머리 카운트 ── */
.mj-board-wrap { gap: 6px; }
.mj-side {
  width: auto;
  min-width: 44px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 4px;
}
/* 다다음(왼쪽, 작고 옅게) + 다음 미리보기 행 */
.mj-next-row { display: flex; align-items: flex-end; gap: 4px; }
.mj-next2 { opacity: 0.62; }
/* 아래쪽 .mj-next .mj-mini(24px) 보다 특이도 높게 */
.mj-next.mj-next2 .mj-mini { width: 18px; height: 24px; }
.mj-side-label { color: #9aa0b8; font-size: 11px; }
.mj-side-label-pairs { margin-top: 10px; }
.mj-next {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}
.mj-next .mj-mini { width: 24px; height: 32px; }
.mj-pairs {
  font-size: 15px;
  font-weight: 800;
  color: #ffd166;
}
/* 머리 카운트는 국사 슬롯 오른쪽 (2026-07-07 이동) */
.mj-pairs-label { margin-left: 8px; }

/* ── 마법 아이템 슬롯 (2026-07-07) — 사이드 '다음' 아래 5칸.
 *    미소지 = 옅게 + 비활성. 우상단 1~5 단축키 번호. ── */
.mj-items { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.mj-item {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #e8eaf2;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.mj-item .mj-mini { width: 17px; height: 23px; }
.mj-item .mj-icon { width: 19px; height: 19px; }
.mj-item:nth-child(5) .mj-icon { color: #ffd166; } /* 피버 번개는 금색 */
.mj-item.is-empty { opacity: 0.28; filter: grayscale(0.75); pointer-events: none; }
.mj-item:not(.is-empty) {
  border-color: rgba(255, 209, 102, 0.85);
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.35);
}
.mj-item:not(.is-empty):active { background: rgba(255, 255, 255, 0.2); }
.mj-item-num {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 15px;
  height: 15px;
  line-height: 15px;
  font-size: 9.5px;
  font-weight: 800;
  text-align: center;
  background: #38bdf8;
  color: #101322;
  border-radius: 50%;
}
.mj-item-x {
  position: absolute;
  right: 2px;
  bottom: 1px;
  color: #ff5470;
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
}

/* ── 아이템 발동 이펙트 — 빛 밴드 + 확산 링 + 이름 팝 (2026-07-07) ── */
.mj-itemfx {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  --fx: #ffd166;
}
.mj-itemfx-delm { --fx: #ff5c74; }
.mj-itemfx-delp { --fx: #4da3ff; }
.mj-itemfx-dels { --fx: #3fd07f; }
.mj-itemfx-shuffle { --fx: #b18bff; }
.mj-itemfx-fever { --fx: #ffb02e; }
.mj-itemfx-kokushi { --fx: #ffd166; } /* 국사무쌍 완성 표시 — 금색 */
.mj-itemfx-band {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 44px);
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg,
    transparent 0%,
    color-mix(in srgb, var(--fx) 40%, transparent) 18%,
    color-mix(in srgb, var(--fx) 62%, #000 10%) 50%,
    color-mix(in srgb, var(--fx) 40%, transparent) 82%,
    transparent 100%);
  transform: scaleX(0);
  animation: mj-fx-band 1.7s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
@keyframes mj-fx-band {
  0% { transform: scaleX(0); opacity: 0; }
  14% { transform: scaleX(1.04); opacity: 1; }
  72% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}
.mj-itemfx-name {
  font-size: clamp(28px, 9vw, 50px);
  font-weight: 900;
  letter-spacing: 7px;
  text-indent: 7px;
  color: #fff;
  text-shadow:
    0 0 14px var(--fx),
    0 0 34px var(--fx),
    0 3px 0 rgba(0, 0, 0, 0.45);
  animation: mj-fx-name 1.7s ease-out forwards;
}
@keyframes mj-fx-name {
  0% { transform: scale(2.8); opacity: 0; filter: blur(6px); }
  16% { transform: scale(0.94); opacity: 1; filter: blur(0); }
  24% { transform: scale(1.06); }
  32% { transform: scale(1); }
  74% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.25); opacity: 0; filter: blur(3px); }
}
.mj-itemfx-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border: 3px solid var(--fx);
  border-radius: 50%;
  box-shadow: 0 0 26px var(--fx), inset 0 0 18px var(--fx);
  animation: mj-fx-ring 0.9s ease-out forwards;
}
@keyframes mj-fx-ring {
  0% { transform: scale(0.4); opacity: 0.95; }
  100% { transform: scale(9); opacity: 0; }
}

/* 화료 화면 — 아이템 획득 표시 (2026-07-07) */
.mj-win-item {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 209, 102, 0.9);
  background: rgba(255, 209, 102, 0.14);
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.35);
  animation: mj-win-item-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.mj-win-item-label { color: #ffd166; font-size: 13px; font-weight: 700; }
.mj-win-item-name { color: #fff; font-size: 16px; font-weight: 900; }
@keyframes mj-win-item-pop {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.mj-pairs.is-hot { animation: mj-pairs-hot 0.8s ease-in-out infinite; }
@keyframes mj-pairs-hot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); color: #ff8a5c; }
}

/* ── 시각(타일 그림) 선택 버튼 — 모호한 멘쯔/깡 ── */
.mj-choice.at-top { top: 8px; bottom: auto; }
.mj-choice-visual {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 7px 10px;
  min-width: 0;
}
.mj-choice-visual .mj-choice-tile { width: 26px; height: 34px; border-radius: 4px; }
.mj-choice-visual .mj-choice-tile.is-dim { opacity: 0.22; filter: grayscale(0.9); }
/* 보드 배치 모양 그대로 보여주는 미니 격자 (빈 칸 = hole) */
.mj-choice-grid { display: grid; gap: 2px; justify-content: center; }
.mj-choice-hole { width: 26px; height: 34px; }
.mj-choice-sub { font-size: 12.5px; font-weight: 700; margin-left: 6px; white-space: nowrap; }

/* ── 타이틀 화면 — 판타지 타이틀 아트 + 금장 버튼 (2026-07-07) ── */
.mj-overlay.is-title {
  background: #0d0c1c url('title.jpg') center top / cover no-repeat;
  align-items: flex-end;
  padding-bottom: 30px;
}
.mj-overlay.is-title::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 42%;
  background: linear-gradient(180deg, transparent 0%, rgba(9, 11, 30, 0.55) 55%, rgba(7, 9, 24, 0.82) 100%);
  pointer-events: none;
}
/* 시작하기/도움말 은 한 줄·같은 높이 — 타이틀 그림 가림 최소화 (2026-07-07) */
.mj-overlay.is-title .mj-overlay-box {
  position: relative;
  gap: 12px;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
}
.mj-overlay.is-title .mj-btn-fantasy {
  min-width: 0;
  padding: 13px 22px;
  font-size: 17px;
  letter-spacing: 3px;
  text-indent: 3px;
}

.mj-btn-fantasy {
  position: relative;
  min-width: 230px;
  padding: 14px 40px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 6px;
  text-indent: 6px; /* letter-spacing 마지막 글자 보정 */
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', serif;
}
.mj-btn-fantasy::before { content: '✦'; margin-right: 10px; font-size: 14px; vertical-align: 2px; }
.mj-btn-fantasy::after { content: '✦'; margin-left: 4px; font-size: 14px; vertical-align: 2px; }
/* 시작하기 — 금장 */
.mj-btn-fantasy-primary {
  color: #3a2705;
  text-shadow: 0 1px 0 rgba(255, 245, 210, 0.8);
  background: linear-gradient(180deg, #fdf0bd 0%, #f0d488 28%, #d9ab4f 62%, #c08c33 100%);
  border: 1.5px solid #fff3cd;
  box-shadow:
    0 0 0 3px rgba(26, 35, 66, 0.85),
    0 0 0 4.5px rgba(232, 199, 106, 0.9),
    0 8px 24px -6px rgba(0, 0, 0, 0.65),
    0 0 26px rgba(240, 212, 136, 0.5);
  animation: mj-fantasy-glow 2.6s ease-in-out infinite;
}
@keyframes mj-fantasy-glow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(26,35,66,.85), 0 0 0 4.5px rgba(232,199,106,.9), 0 8px 24px -6px rgba(0,0,0,.65), 0 0 18px rgba(240,212,136,.35); }
  50% { box-shadow: 0 0 0 3px rgba(26,35,66,.85), 0 0 0 4.5px rgba(232,199,106,.9), 0 8px 24px -6px rgba(0,0,0,.65), 0 0 34px rgba(240,212,136,.65); }
}
.mj-btn-fantasy-primary:active { filter: brightness(0.92); }
/* 도움말/닫기 — 남색 반투명 + 금테 */
.mj-btn-fantasy-sub {
  min-width: 180px;
  padding: 11px 34px;
  font-size: 16px;
  color: #f4e8c6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  background: linear-gradient(180deg, rgba(48, 66, 122, 0.92) 0%, rgba(26, 35, 66, 0.94) 100%);
  border: 1.5px solid rgba(232, 199, 106, 0.85);
  box-shadow:
    0 0 0 3px rgba(14, 18, 40, 0.75),
    0 6px 18px -6px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.mj-btn-fantasy-sub:active { filter: brightness(1.15); }

/* ── 도움말 패널 ── */
.mj-help {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 8, 20, 0.78);
  padding: 18px;
  z-index: 5;
}
.mj-help-box {
  max-width: 380px;
  max-height: 82%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(24, 32, 64, 0.97), rgba(14, 18, 40, 0.97));
  border: 1.5px solid rgba(232, 199, 106, 0.8);
  box-shadow: 0 0 0 3px rgba(10, 13, 30, 0.8), 0 18px 50px -14px rgba(0, 0, 0, 0.85);
}
.mj-help-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #f0d488;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
