/* Coach tips and stage attention arrows. */

.stage-attention-arrows,
.stage-attention-arrows i {
  position: absolute;
  pointer-events: none;
}

.stage-attention-arrows {
  inset: 0;
  z-index: 10020;
}

.stage-attention-arrows i {
  width: 18px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(135deg, #c9d0ff 0%, #7c83ff 46%, #4f46e5 100%);
  box-shadow:
    0 7px 14px rgba(79,107,255,0.24),
    inset 0 1px 0 rgba(255,255,255,0.68),
    inset 0 -2px 4px rgba(32,42,138,0.18);
}

.stage-attention-arrows i::after {
  content: "";
  position: absolute;
  inset: 3px 4px 5px;
  background: linear-gradient(135deg, rgba(255,255,255,0.86), rgba(255,255,255,0.16));
  clip-path: inherit;
  opacity: 0.74;
}

.stage-attention-arrows i:nth-child(1) {
  left: 50%;
  top: -15px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform: translateX(-50%);
  animation: stageArrowTopPulse 1.05s ease-in-out infinite;
}

.stage-attention-arrows i:nth-child(2) {
  left: -15px;
  top: 50%;
  width: 14px;
  height: 18px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transform: translateY(-50%);
  animation: stageArrowLeftPulse 1.05s ease-in-out infinite;
}

.stage-attention-arrows i:nth-child(3) {
  right: -15px;
  top: 50%;
  width: 14px;
  height: 18px;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
  transform: translateY(-50%);
  animation: stageArrowRightPulse 1.05s ease-in-out infinite;
}

@keyframes stageArrowTopPulse {
  0%, 100% {
    opacity: 0.78;
    transform: translate(-50%, -2px) scale(0.96);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, 4px) scale(1.04);
  }
}

@keyframes stageArrowLeftPulse {
  0%, 100% {
    opacity: 0.78;
    transform: translate(-2px, -50%) scale(0.96);
  }
  50% {
    opacity: 1;
    transform: translate(4px, -50%) scale(1.04);
  }
}

@keyframes stageArrowRightPulse {
  0%, 100% {
    opacity: 0.78;
    transform: translate(2px, -50%) scale(0.96);
  }
  50% {
    opacity: 1;
    transform: translate(-4px, -50%) scale(1.04);
  }
}

/* Lightweight one-shot coach tip. Static asset, no continuous animation. */
.coach-tip {
  --coach-tip-width: 280px;
  position: absolute;
  z-index: 10030;
  display: block;
  pointer-events: auto;
  animation: coachTipIn 0.18s ease-out both;
}

.coach-tip-fixed {
  position: fixed;
  z-index: 2147483000;
  width: var(--coach-tip-width);
  min-width: min(var(--coach-tip-width), calc(100vw - 16px));
  max-width: calc(100vw - 16px);
  left: var(--coach-tip-left, 8px);
  top: var(--coach-tip-top, 8px);
  right: auto;
  bottom: auto;
}

.coach-tip-fixed .coach-tip-bubble {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
}

.coach-tip-leaderboard {
  top: var(--coach-tip-top, 38px);
  left: var(--coach-tip-left, 8px);
  right: auto;
}

.coach-tip-profile {
  left: var(--coach-tip-left, 8px);
  top: var(--coach-tip-top, calc(100% + 8px));
}

.coach-tip-auth,
.coach-tip-report,
.coach-tip-topics,
.coach-tip-navigation,
.coach-tip-stages,
.coach-tip-text-panel,
.coach-tip-text-audio,
.coach-tip-sound {
  left: var(--coach-tip-left, 8px);
  top: var(--coach-tip-top, calc(100% + 8px));
}

.coach-tip-report {
  --coach-tip-width: 250px;
}

.coach-tip-topics {
  --coach-tip-width: 252px;
}

.coach-tip-topics-header {
  position: fixed;
}

.coach-tip-navigation {
  --coach-tip-width: 312px;
}

.coach-tip-stages {
  --coach-tip-width: 326px;
}

.coach-tip-text-panel {
  --coach-tip-width: 330px;
}

.coach-tip-text-audio {
  --coach-tip-width: 308px;
}

.coach-tip-profile {
  --coach-tip-width: 270px;
}

.coach-tip-auth {
  --coach-tip-width: 292px;
}

.coach-tip-sound {
  --coach-tip-width: 292px;
}

.coach-tip-mascot {
  width: 64px;
  height: auto;
  flex: 0 0 auto;
  align-self: flex-end;
  transform: translateY(4px);
  filter: drop-shadow(0 8px 14px rgba(24,35,63,0.18));
}

.coach-tip-bus {
  width: 78px;
  transform: translateY(6px);
}

.coach-tip-cab {
  width: 96px;
  transform: translateY(7px);
}

.coach-tip-raven {
  width: 74px;
  transform: translateY(7px);
}

.coach-tip-phone {
  width: 54px;
  transform: translateY(5px);
}

.coach-tip-mic {
  width: 54px;
  transform: translateY(5px);
}

.coach-tip-bubble {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 280px;
  padding: 9px 13px 9px 8px;
  border: 1px solid rgba(79,107,255,0.20);
  border-radius: 18px 18px 18px 9px;
  background: rgba(255,255,255,0.88);
  box-shadow: 0 12px 26px rgba(24,35,63,0.12);
  color: #24345f;
  font: 700 0.82rem/1.28 "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
  letter-spacing: 0;
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: coachTipPulse 2.2s ease-in-out infinite;
}

.coach-tip-pointer-raven {
  position: absolute;
  right: 18px;
  bottom: calc(100% - 8px);
  width: 42px;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 5px 9px rgba(24,35,63,0.18));
  transform: rotate(-3deg);
}

.coach-tip-bubble::after {
  content: "";
  position: absolute;
  left: 26px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border-right: 1px solid rgba(79,107,255,0.18);
  border-bottom: 1px solid rgba(79,107,255,0.18);
  background: rgba(255,255,255,0.88);
  transform: rotate(45deg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.coach-tip-above .coach-tip-bubble::after {
  left: auto;
  right: 42px;
  top: auto;
  bottom: -7px;
}

.coach-tip-bubble strong,
.coach-tip-bubble span {
  display: block;
}

.coach-tip-copy {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: break-word;
  word-break: normal;
}

.coach-tip-bubble strong {
  margin-bottom: 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
}

.coach-tip-bubble span {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

.coach-tip-confirming .coach-tip-bubble {
  border-color: rgba(99,102,241,0.34);
  box-shadow:
    0 18px 42px rgba(79,70,229,0.16),
    0 0 0 3px rgba(99,102,241,0.08);
}

.coach-tip-bubble .coach-tip-dismiss-note {
  margin-top: 7px;
  padding: 5px 9px;
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 999px;
  background: rgba(99,102,241,0.10);
  color: #4f46e5;
  font-family: var(--font-ui, system-ui, sans-serif);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
}

.coach-tip-hiding {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

body.practice-focus-mode .coach-tip {
  display: none !important;
}

@keyframes coachTipIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes coachTipPulse {
  0%, 100% {
    box-shadow: 0 12px 26px rgba(24,35,63,0.14);
  }
  50% {
    box-shadow: 0 12px 26px rgba(24,35,63,0.14), 0 0 0 5px rgba(79,107,255,0.12);
  }
}

@media (max-width: 800px) {

  .coach-tip {
    --coach-tip-width: 310px;
  }

  .coach-tip-auth,
  .coach-tip-report,
  .coach-tip-topics,
  .coach-tip-navigation,
  .coach-tip-stages,
  .coach-tip-text-panel,
  .coach-tip-text-audio,
  .coach-tip-profile,
  .coach-tip-sound {
    --coach-tip-width: 286px;
    left: var(--coach-tip-left, 8px);
    top: var(--coach-tip-top, calc(100% + 8px));
    right: auto;
    bottom: auto;
  }

  .coach-tip-leaderboard {
    top: 42px;
    left: 8px;
    right: auto;
  }

  .coach-tip-bubble {
    margin: 0 auto;
    padding: 8px 11px 8px 7px;
  }

  .coach-tip-mascot {
    width: 60px;
  }

  .coach-tip-pointer-raven {
    right: 14px;
    width: 36px;
  }

  .coach-tip-bus {
    width: 72px;
  }

  .coach-tip-cab {
    width: 86px;
  }

  .coach-tip-raven {
    width: 64px;
  }

  .coach-tip-phone,
  .coach-tip-mic {
    width: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .coach-tip,
  .coach-tip-bubble {
    animation: none;
  }

  .coach-tip-hiding {
    transition: none;
  }
}
