.mh-tie { }
.mh-board-wrap {
  display: flex; justify-content: center;
  padding: 8px 4px 12px;
  overflow: hidden;
}
.mh-board-wrap.is-zoomed {
  /* Zoomed: the wrap keeps its 1x height and scrolls both ways; start
     alignment so the left and top edges stay reachable by panning. */
  justify-content: flex-start;
  align-items: flex-start;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.mh-zoom-bar {
  display: flex; gap: 8px;
  justify-content: center;
  margin: 4px 0;
}
.mh-zoom-btn {
  min-width: 96px;
  min-height: 48px;
}
.mh-board {
  position: relative;
  flex: none;
  /* z-index 0 makes the board a stacking context: tile z-indexes
     (100 + layer * 40 + 2 * (200 - row), up to ~700) compete only INSIDE the
     board and can never paint over shell overlays. Without it the
     tiles covered the How to Play tour bar (z 200s) and ate its
     taps - proven live on the tablet 2026-11-17. */
  z-index: 0;
  width: calc(var(--mh-w, 16) * var(--mh-u, 46px));
  height: calc(var(--mh-h, 10) * var(--mh-u, 46px));
  background: radial-gradient(var(--mh-bg-a, #172235), var(--mh-bg-b, #0e1520));
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 8px 22px rgba(0,0,0,0.4);
  outline: none;
}
.mh-tile {
  position: absolute;
  border-radius: 8px;
  background: linear-gradient(160deg, #f9f0d8 0%, #ebd9ae 60%, #d3bc86 100%);
  box-shadow:
    inset 0 0 0 1px rgba(110, 80, 20, 0.35),
    inset 0 3px 6px rgba(255, 255, 240, 0.55),
    0 6px 10px rgba(0, 0, 0, 0.42),
    0 2px 4px rgba(0, 0, 0, 0.5);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  user-select: none;
  color: #2a1a08;
  font-family: system-ui, sans-serif;
}
.mh-tile.is-blocked {
  filter: brightness(0.7);
  opacity: 0.75;
  cursor: default;
}
.mh-tile.is-selected {
  box-shadow:
    inset 0 0 0 3px #ffcf33,
    0 0 0 3px rgba(0, 0, 0, 0.45),
    0 0 22px rgba(255, 207, 51, 0.55);
  transform: translateY(-2px);
}
.mh-tile.is-matchable {
  box-shadow:
    inset 0 0 0 2px #ff8a2a,
    0 0 0 2px rgba(0, 0, 0, 0.4),
    0 0 14px rgba(255, 138, 42, 0.42);
}
.mh-tile.is-hint {
  animation: mh-hit-pulse 0.6s ease-in-out 2;
}
@keyframes mh-hit-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.mh-face {
  width: 84%; height: 84%;
  display: flex; align-items: center; justify-content: center;
}
.mh-face svg { width: 100%; height: 100%; }
.mh-layer {
  position: absolute; top: 1px; left: 3px;
  font-size: 0.55em; font-weight: 700;
  color: rgba(20, 14, 4, 0.62);
  pointer-events: none;
  letter-spacing: 0.4px;
}
.mh-status {
  min-height: 22px;
  color: #9aa7ba;
  font-size: 0.92em;
  text-align: center;
  margin-top: 6px;
}
.mh-status.is-error { color: #e5a04a; }
.mh-tier-bar {
  display: flex; gap: 6px;
  justify-content: center;
  margin: 6px 0;
  flex-wrap: wrap;
}
.mh-tier-btn {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
  font-size: 0.9em;
}
.mh-tier-btn.is-selected { background: #c94f6d; color: #fff; }
@media (max-width: 700px) {
  .mh-face { width: 90%; height: 90%; }
}
@media (prefers-reduced-motion: reduce) {
  .mh-tile { transition: none; }
  .mh-tile.is-hint { animation: none; }
}

/* FLUX-ART-2026-11-17: mahjong table backdrop */
.mh-board { background-image: linear-gradient(rgba(3,20,14,0.35), rgba(3,20,14,0.35)), url("../img/bg-mahjong-table.jpg"); background-size: cover; background-position: center; }
