/* First visit experience (js/firstExperience.js, GAME_SPEC §4.10).
   Every painted part is a real element with its own id so the UI layer tool
   can edit it (web-ui-style.md §6); motion runs on `transform` only, so the
   tool's opacity, colour, translate and scale edits are never overridden. */

/* ---------- Game: small "first challenge n/N" chip beside the level title ---------- */
.first-challenge-badge {
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 2px solid var(--ui-gold-dark);
  border-radius: 999px;
  background: var(--ui-gold);
  box-shadow: inset 0 2px 0 var(--ui-gold-highlight), 0 2px 0 rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

/* The title capsule's outline text effect is not inherited: plain dark text on gold. */
.first-challenge-label {
  color: var(--ui-brown);
  text-shadow: none;
  -webkit-text-stroke: 0;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

/* Narrow phones: still beside the title (below it is where the first-level
   hint appears), smaller, and wrapping onto two lines rather than leaving
   the screen. 85px is half the title capsule's 170px minimum width. */
@media (max-width: 520px) {
  .first-challenge-badge {
    left: calc(100% + 4px);
    width: max-content;
    max-width: calc(50vw - 85px - 12px);
    padding: 3px 7px;
    white-space: normal;
    text-align: center;
  }

  .first-challenge-label {
    font-size: 0.72rem;
  }
}

/* ---------- Lobby: World tab highlight and one short guide bubble ---------- */
.first-world-ring {
  position: absolute;
  inset: 2px;
  z-index: 3;
  border: 3px solid var(--ui-gold);
  border-radius: 14px;
  box-shadow: 0 0 0 2px rgba(255, 220, 36, 0.35), 0 0 14px 4px rgba(255, 220, 36, 0.75);
  pointer-events: none;
  animation: first-world-ring-pulse 1.2s ease-in-out infinite;
}

/* --first-world-tab-x is the World tab's centre inside #bottom-nav and --first-world-guide-left the
   bubble's left edge, both set by js/hybridLobby.js (the tabs are centred on wide screens, edge to edge
   on phones; World is the fourth tab): a little left of the tab, never past either screen edge. */
.first-world-guide {
  position: absolute;
  left: var(--first-world-guide-left, 8px);
  bottom: calc(100% + 14px);
  z-index: 40;
  max-width: min(300px, calc(100vw - 24px));
  padding: 10px 14px;
  border: 3px solid var(--ui-gold);
  border-radius: 14px;
  background: var(--ui-cream);
  box-shadow: 0 4px 0 var(--ui-gold-depth), 0 8px 18px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  animation: first-world-guide-bob 1.6s ease-in-out infinite;
}

.first-world-guide-text {
  margin: 0;
  color: var(--ui-brown);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

/* Points down at the World tab's centre. */
.first-world-guide-tail {
  position: absolute;
  bottom: -10px;
  left: calc(var(--first-world-tab-x, 10vw) - var(--first-world-guide-left, 8px) - 11px);
  width: 16px;
  height: 16px;
  border-right: 3px solid var(--ui-gold);
  border-bottom: 3px solid var(--ui-gold);
  background: var(--ui-cream);
  transform: rotate(45deg);
}


@keyframes first-world-ring-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes first-world-guide-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  .first-world-ring,
  .first-world-guide {
    animation: none;
  }
}

/* ---------- First challenge complete popup (shared popup card) ---------- */
.popup-first-complete-art {
  width: 64px;
  height: 64px;
  margin: -8px auto -8px;
}

.popup-first-complete-body {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--ui-brown);
}

.popup-first-complete-daily {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ui-brown);
}

.popup-first-complete-daily:empty {
  display: none;
}
