/* 관객 긴급 알림 창(audience-alerts.js). 토큰은 mobile.css :root(DESIGN.md §2~§4)를 쓴다. */

.alert-window {
  position: fixed;
  inset: auto;
  top: calc(env(safe-area-inset-top, 0px) + var(--space-3));
  left: calc(env(safe-area-inset-left, 0px) + var(--space-3));
  z-index: 2147483000;
  box-sizing: border-box;
  width: min(calc(100vw - var(--space-3) - 56px), 400px);
  max-height: calc(100dvh - var(--space-6) - 68px);
  margin: 0;
  padding: var(--space-3) var(--space-3) var(--space-5) var(--space-5);
  overflow-y: auto;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-bright);
  box-shadow: var(--shadow-float);
  color: var(--text);
  font-family: var(--font-sans);
  word-break: keep-all;
  overflow-wrap: break-word;
  animation: alert-in 220ms ease-out;
}

.alert-window[hidden] {
  display: none;
}

.alert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.alert-heading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
}

.alert-heading::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.alert-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--surface);
  box-shadow: var(--shadow-raised-sm);
  color: var(--text);
  cursor: pointer;
}

.alert-close svg {
  width: 20px;
  height: 20px;
}

.alert-close:active {
  box-shadow: var(--shadow-inset);
  color: var(--accent-ink);
}

.alert-close:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
}

.alert-text {
  margin: var(--space-2) var(--space-2) 0 0;
  font-size: 1.875rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.01em;
  white-space: pre-line;
}

.playbar.announcing .playbar-thumb {
  color: var(--accent-ink);
}

@keyframes alert-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .alert-window { animation: none; }
}

@media (prefers-contrast: more) {
  .alert-window,
  .alert-close { outline: 1px solid var(--faint); }
}
