/* 눈썹명가 매치 — 이 페이지에서만 로드되는 게임 전용 스타일.
   색상/폰트/카드 톤은 style.css의 :root 변수를 그대로 재사용합니다. */

.bm-app {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 20px 32px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.bm-back {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 18px;
  width: fit-content;
}

.bm-back:hover {
  color: var(--pink-dark);
}

.bm-back:focus-visible {
  outline: 2px solid var(--pink-dark);
  outline-offset: 2px;
}

.bm-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.bm-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* 시작 화면 */
.bm-start h1 {
  font-size: 1.9rem;
  margin-bottom: 18px;
}

.bm-sub {
  color: var(--ink);
  font-weight: 500;
  margin: 0 0 10px;
}

.bm-sub2 {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 28px;
}

.bm-start-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 14px;
  min-width: 160px;
}

.bm-best {
  color: var(--pink-dark);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  margin: 0 0 22px;
}

.bm-start .hint {
  margin-top: 0;
}

/* 플레이 화면 */
.bm-playing {
  width: 100%;
}

.bm-header {
  width: 100%;
  max-width: 420px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bm-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}

.bm-stat-label {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.bm-stat-value {
  font-family: "Noto Serif KR", serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.bm-mute {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bm-mute:focus-visible {
  outline: 2px solid var(--pink-dark);
  outline-offset: 2px;
}

.bm-board-wrap {
  position: relative;
  width: min(92vw, 420px);
  margin: 0 auto;
}

.bm-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(43, 35, 32, 0.12);
  overflow: hidden;
  touch-action: none;
}

.bm-tile {
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
  padding: 4px;
  transition: transform 0.22s ease;
}

.bm-tile-face {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: var(--cream);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.22s ease, opacity 0.22s ease, box-shadow 0.15s ease;
}

.bm-tile.is-selected .bm-tile-face {
  box-shadow: 0 0 0 3px var(--pink-dark) inset;
}

.bm-tile.is-matched .bm-tile-face {
  transform: scale(0.2);
  opacity: 0;
}

.bm-icon {
  width: 58%;
  height: 58%;
}

.bm-combo-toast,
.bm-shuffle-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 15, 13, 0.78);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 8px 20px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 5;
  white-space: nowrap;
}

.bm-combo-toast.show {
  opacity: 1;
}

.bm-shuffle-toast {
  opacity: 1;
  font-size: 0.95rem;
}

/* 결과 화면 */
.bm-result-label {
  color: var(--pink-dark);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  font-weight: 700;
  margin: 0 0 8px;
}

.bm-result-score {
  font-family: "Noto Serif KR", serif;
  font-size: 2.1rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.bm-result-type {
  color: var(--pink-dark);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 4px;
}

.bm-result-best {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 16px;
}

.bm-result-desc {
  color: var(--ink);
  margin: 0 0 8px;
}

.bm-result-recommend {
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 18px;
}

.bm-disclaimer {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0 0 24px;
  line-height: 1.6;
}

.bm-result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 280px;
  margin: 0 0 20px;
}

.bm-result-secondary {
  display: flex;
  gap: 12px;
}

.bm-restart-btn,
.bm-share-btn {
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.bm-restart-btn:hover,
.bm-share-btn:hover {
  border-color: var(--pink-dark);
  color: var(--pink-dark);
}

.bm-restart-btn:focus-visible,
.bm-share-btn:focus-visible {
  outline: 2px solid var(--pink-dark);
  outline-offset: 2px;
}

/* 접근성: 모션 최소화 선호 시 애니메이션 단축 */
.reduced-motion .bm-tile,
.reduced-motion .bm-tile-face,
.reduced-motion .bm-combo-toast,
.reduced-motion .bm-shuffle-toast {
  transition-duration: 0.01ms !important;
}

@media (max-width: 480px) {
  .bm-app {
    padding: 16px 16px 24px;
  }

  .bm-start h1 {
    font-size: 1.6rem;
  }

  .bm-result-score {
    font-size: 1.8rem;
  }
}
