/* First-run coach: compact prompt under the HUD, never over the play field. */
.coach {
  position: fixed; left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 52px);
  transform: translateX(-50%);
  z-index: 7;
  display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: calc(100vw - 24px);
  background: rgba(4, 12, 9, .9);
  border: 1px solid rgba(68, 255, 136, .3);
  border-radius: 999px;
  padding: 7px 10px 7px 12px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .5), inset 0 0 24px rgba(68, 255, 136, .03);
  backdrop-filter: blur(8px);
  contain: layout paint;
  animation: coachIn .22s ease-out;
}
@keyframes coachIn {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.coach-main {
  order: 1;
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.coach-key {
  flex: 0 0 auto;
  display: inline-grid; place-items: center;
  min-width: 38px; height: 26px; padding: 0 7px;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(68, 255, 136, .18), rgba(68, 255, 136, .04));
  border: 1px solid rgba(68, 255, 136, .5);
  box-shadow: 0 2px 0 rgba(68, 255, 136, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
  color: #eafff2; font: 700 9.5px/1 var(--mono); letter-spacing: .06em;
}
.coach-copy { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.coach-copy b {
  flex: 0 0 auto;
  font-size: 10px; letter-spacing: .14em; color: #eafff2;
}
.coach-copy p {
  flex: 1 1 auto; min-width: 0; margin: 0;
  font-size: 10.5px; line-height: 1.35; color: rgba(232, 241, 255, .68);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.coach-top {
  order: 2;
  display: flex; align-items: center; gap: 8px;
  padding-left: 9px;
  border-left: 1px solid rgba(255, 255, 255, .1);
}
.coach-step { font: 9px/1 var(--mono); letter-spacing: .12em; color: #4f8; }
.coach-skip {
  border: 0; background: transparent; padding: 0;
  color: rgba(191, 255, 216, .45); font: 9px/1 var(--mono);
  letter-spacing: .12em; cursor: pointer;
}
.coach-skip:hover { color: #bfffd8; }
.coach-dots { display: none; }

/* Landscape phones: sit the prompt between the sticks. At the top it collides
   with the wave banner on the first frames of a run. */
@media (max-height: 500px) and (orientation: landscape) {
  .coach {
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
    animation: coachUp .22s ease-out;
  }
  @keyframes coachUp {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
  }
}

/* Tiny screens: drop the counter before the instruction starts clipping. */
@media (max-width: 380px) {
  .coach-step { display: none; }
  .coach-top { padding-left: 0; border-left: 0; }
}

/* Keep the prompt clear of touch sticks by staying pinned to the top. */
.pause:not(.hidden) ~ .coach { display: none !important; }
