.leave-guard-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--surface-scrim);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
}

.leave-guard-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90%, 460px);
  background: var(--palette-warm-white);
  border: 3px solid var(--palette-teal-dark);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--elev-modal);
  animation: stampSlamCentered 0.35s var(--ease-out-expo) forwards;
  box-sizing: border-box;
}

.leave-guard-title {
  font-family: var(--font-family-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--palette-brown-dark);
  margin-bottom: 0.5rem;
}

.leave-guard-desc {
  font-family: var(--font-family-body);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--palette-text-muted);
  margin-bottom: 1.5rem;
}

.leave-guard-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.shared-btn {
  background: var(--surface-hud-btn);
  color: var(--text-inverse);
  border: 1.5px solid var(--hairline-light);
  font-family: var(--font-family-display);
  font-size: 0.92rem;
  font-weight: 700;
  height: 40px;
  padding: 0 1.2rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--elev-2);
  cursor: pointer;
}

.shared-btn:hover,
.shared-btn:focus-visible {
  background: var(--surface-hud-btn-hover);
  border-color: var(--hairline-light-strong);
}

.shared-btn.is-primary {
  background: var(--color-heat);
  color: var(--text-inverse);
  border: 2px solid var(--color-amber-tint);
  font-weight: 800;
}

.shared-btn.is-primary:hover,
.shared-btn.is-primary:focus-visible {
  background: var(--color-heat-hover);
  border-color: var(--palette-warm-white);
}

.shared-btn:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-on-light);
  outline-offset: var(--focus-ring-offset);
}

@media (prefers-reduced-motion: reduce) {
  .leave-guard-card {
    animation-duration: 0.01s;
    animation-delay: 0s;
  }
}

.act-marker-pill {
  white-space: nowrap;
  background: var(--surface-hud);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid var(--hairline-light);
  color: var(--text-inverse);
  font-family: var(--font-family-display);
  font-size: 0.88rem;
  font-weight: 700;
  height: 38px;
  padding: 0 1rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--elev-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .act-marker-pill {
    height: 32px;
    font-size: 0.78rem;
  }
}

/* On a phone the act HUDs are already full; the marker would squeeze every pill onto two
   lines. Lives here, not in an act file, because this file loads after the act stylesheets. */
@media (max-width: 480px) {
  .act-marker-pill {
    display: none;
  }
}

/* A modal dialog makes the HUD and nav bars behind it inert (js/a11y-focus.js containFocusIn).
   Those bars sit above the dialog's scrim, so without this they stayed at full strength — a
   row of buttons that looked live and did nothing. Fade them so the state reads honestly.
   (Act 3 solves the same thing by lifting its speech layer above the HUD; see beatHasModal.) */
:is(.act0-nav-bar, .act1-hud-bar, .act1-nav-bar, .act2-hud-bar, .act2-nav-bar, .act3-hud-bar, .act3-nav-bar)[data-inert-by-dialog] {
  opacity: 0.35;
  filter: saturate(0.4);
  transition: opacity var(--dur-fast) var(--ease-out-expo);
}

.click-advance { cursor: pointer; }
.click-advance :is(button, a, [role="button"], [role="switch"], .act1-hud-bar, .act1-nav-bar) { cursor: auto; }
.click-advance :is(.act0-hud-bar, .act0-nav-bar, .act2-hud-bar, .act2-nav-bar, .act3-hud-bar, .act3-nav-bar) { cursor: auto; }


/* "Click anywhere to continue" at the foot of the newest speech bubble, in every part
   (added and removed by syncBubbleClickHints in js/shared-ui.js). Moved here from Act 1. */
.bubble-click-hint {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-top: 0.6rem;
  padding-top: 0.4rem;
  border-top: 1px dashed rgba(56, 36, 24, 0.18);
  font-family: var(--font-family-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--palette-brown-light);
  letter-spacing: 0.02em;
  opacity: 0.85;
  transition: opacity 0.2s ease, color 0.2s ease;
  user-select: none;
}

.speech-bubble:hover .bubble-click-hint {
  opacity: 1;
  color: var(--palette-brown-dark);
}

.bubble-click-hint .hint-arrow {
  font-size: 0.68rem;
  animation: hintArrowBounce 1.2s infinite ease-in-out;
}

@keyframes hintArrowBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}

/* On Dana's dark phone bubble the rule and text go light. */
.phone-radio-bubble .bubble-click-hint {
  border-top-color: var(--hairline-light);
  color: var(--text-radio);
}
.phone-radio-bubble:hover .bubble-click-hint {
  color: var(--text-inverse);
}
@media (prefers-reduced-motion: reduce) {
  .bubble-click-hint .hint-arrow { animation: none; }
}

/* ---- "Turn your phone sideways" (js/rotate-prompt.js) --------------------------------
   §6.4 light system card over the §2.2 scrim; the primary button per §6.2. Only ever shown
   on a phone held upright, and always dismissible. */
.rotate-prompt {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--surface-scrim);
  backdrop-filter: blur(8px);
}
.rotate-prompt[hidden] {
  display: none;
}
.rotate-prompt-card {
  width: min(100%, 360px);
  padding: 1.5rem 1.5rem 1.35rem;
  background: var(--palette-warm-white);
  border: 3px solid var(--palette-teal-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-modal);
  text-align: center;
  /* grid-centred, so not stampSlamCentered (that one carries a translate(-50%,-50%)) */
  animation: bubblePop 0.3s var(--ease-back) both;
}
.rotate-prompt-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 0.5rem;
  display: block;
  fill: none;
  stroke: var(--palette-teal-dark);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rotate-prompt-phone {
  transform-box: fill-box;
  transform-origin: center;
  animation: rotatePromptTurn 2.4s var(--ease-out-expo) infinite;
}
.rotate-prompt-arrow {
  stroke: var(--color-heat);
}
@keyframes rotatePromptTurn {
  0%, 20% { transform: rotate(0deg); }
  55%, 85% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}
.rotate-prompt-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-family-display);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--palette-brown-dark);
}
.rotate-prompt-text {
  margin: 0 0 1.1rem;
  font-family: var(--font-family-body);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--palette-text-muted);
}
.rotate-prompt-btn {
  min-height: 44px;
  padding: 0 1.4rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--color-amber-tint);
  background: var(--color-heat);
  color: var(--text-inverse);
  font-family: var(--font-family-display);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}
.rotate-prompt-btn:hover,
.rotate-prompt-btn:focus-visible {
  background: var(--color-heat-hover);
  border-color: var(--text-inverse);
}
.rotate-prompt-btn:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-on-light);
  outline-offset: var(--focus-ring-offset);
}
@media (prefers-reduced-motion: reduce) {
  .rotate-prompt-card { animation-duration: 0.01s; }
  .rotate-prompt-phone { animation: none; transform: rotate(-90deg); }
}
