/* Soft "how to play" coachmark styled like a station/conductor's notice. It
   floats above the board on the daily play screen and is dismissible, so it
   teaches without trapping. */
.how-to-play {
  position: fixed;
  top: 64px;
  left: 50%;
  z-index: 60;
  width: calc(100% - 24px);
  max-width: 420px;
  transform: translateX(-50%) translateY(-8px);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.how-to-play-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* The notice floats over the top of the board, so it must not swallow clicks
   meant for the traks beneath it. Only the Next/close controls capture
   pointer events; taps anywhere else pass through to the game (and a tap on a
   hand tile dismisses the notice via the controller). */
.how-to-play-close,
.how-to-play-next {
  pointer-events: auto;
}

/* Flex/grid display rules below would otherwise defeat the [hidden] attribute
   the controller toggles, so force hidden children to stay hidden. */
.how-to-play [hidden] {
  display: none !important;
}

.how-to-play-card {
  overflow: hidden;
  background: var(--board-bg);
  border: 2px solid var(--orange);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

/* Departure-board style header strip. */
.how-to-play-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--orange);
  color: #fff;
}

.how-to-play-title {
  font-family: var(--font-flap);
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.how-to-play-close {
  padding: 2px 4px;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.how-to-play-close:hover {
  color: var(--page-bg);
}

.how-to-play-body {
  padding: 16px 16px 8px;
}

.how-to-play-page p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
  color: var(--page-text);
}

.how-to-play-page p + p {
  margin-top: 8px;
}

.how-to-play-page strong {
  color: var(--orange-dim);
}

.htp-badge {
  display: inline-block;
  padding: 0 4px;
  border-radius: 3px;
  font-family: var(--font-flap);
  font-size: 12px;
  letter-spacing: 0.5px;
}

.htp-badge-l {
  background: var(--mod-l-bg);
  color: var(--mod-l-badge);
}

.htp-badge-w {
  background: var(--mod-w-bg);
  color: var(--mod-l-badge);
}

.how-to-play-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 14px;
}

.how-to-play-dots {
  display: flex;
  gap: 6px;
}

.how-to-play-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cell-brd);
}

.how-to-play-dot.is-active {
  background: var(--orange);
}

.how-to-play-next {
  padding: 4px 8px;
  background: none;
  border: none;
  font-family: var(--font-flap);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--orange);
  cursor: pointer;
}

.how-to-play-next:hover {
  color: var(--orange-dim);
}
