/* 24-escalation.css — Phase 8: C escalation modal + toast (items 23+24).
 *
 * Owns:
 *   - .v2-esc-modal             — modal root + backdrop tap = cancel
 *   - .v2-esc-sheet             — content sheet (bottom sheet on mobile)
 *   - .v2-esc-header/title/close — header chrome
 *   - .v2-esc-message           — optional secondary copy
 *   - .v2-esc-actions / .v2-esc-btn — action button row + primary/ghost kinds
 *   - .v2-esc-toast             — small "✓ next level" / "Слово вгадано" toast
 *   - .v2-c-more-context-wrap   — collapsed-by-default wrapper for the extra
 *                                  prev/next strips inside C3 + C4 views.
 *
 * Chip styling + per-view extra strip cosmetics live in 20-c3-view.css
 * (C3 side) and 22-c4-c5.css (C4 side).
 *
 * Loaded from base.html alongside the other v2 component sheets, AFTER
 * the C3/C4 view sheets so modal layering wins.
 */

/* ── Modal root ─────────────────────────────────────────────────────── */
.v2-esc-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: auto;
}

.v2-esc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 15, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: v2esc-fadein 140ms ease-out;
}

.v2-esc-sheet {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 420px;
  background: var(--v2-surface, #fdfcf7);
  border: 1px solid var(--v2-hairline-strong, #c9c5b9);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(20, 20, 15, 0.22);
  padding: 18px 18px 16px;
  gap: 12px;
  animation: v2esc-rise 160ms ease-out;
}

@keyframes v2esc-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes v2esc-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.v2-esc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.v2-esc-title {
  flex: 1;
  font: 700 1.02rem/1.35 Inter, system-ui, sans-serif;
  color: var(--v2-ink, #14140f);
}
.v2-esc-close {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--v2-ink-3, #8a877e);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}
.v2-esc-close:hover {
  background: var(--v2-surface-2, #f3f1ea);
  color: var(--v2-ink, #14140f);
}

.v2-esc-message {
  font: 500 0.9rem/1.5 Inter, system-ui, sans-serif;
  color: var(--v2-ink-2, #4a4842);
}

.v2-esc-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.v2-esc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 600 0.93rem/1 Inter, system-ui, sans-serif;
  padding: 11px 14px;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid var(--v2-hairline-strong, #c9c5b9);
  background: #fff;
  color: var(--v2-ink, #14140f);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  text-align: center;
}
.v2-esc-btn:focus-visible {
  outline: 2px solid var(--v2-target, #b08d34);
  outline-offset: 2px;
}
.v2-esc-btn-primary {
  background: var(--v2-ink, #14140f);
  border-color: var(--v2-ink, #14140f);
  color: #fff;
}
.v2-esc-btn-primary:hover {
  background: var(--v2-ink-2, #4a4842);
  border-color: var(--v2-ink-2, #4a4842);
}
.v2-esc-btn-ghost {
  background: transparent;
  color: var(--v2-ink-2, #4a4842);
  border-color: var(--v2-hairline, #e5e3dc);
}
.v2-esc-btn-ghost:hover {
  background: var(--v2-surface-2, #f3f1ea);
  color: var(--v2-ink, #14140f);
}

/* Mobile: bottom sheet */
@media (max-width: 480px) {
  .v2-esc-modal { align-items: flex-end; padding: 0; }
  .v2-esc-sheet {
    max-width: none;
    border-radius: 14px 14px 0 0;
    padding: 16px 16px max(16px, env(safe-area-inset-bottom));
    box-shadow: 0 -10px 32px rgba(20, 20, 15, 0.20);
  }
  .v2-esc-btn { width: 100%; }
}

/* ── Toast ──────────────────────────────────────────────────────────── */
.v2-esc-toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  z-index: 1100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--v2-ink, #14140f);
  color: #fff;
  font: 600 0.86rem/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 20px rgba(20, 20, 15, 0.25);
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.v2-esc-toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}
.v2-esc-toast-success { background: #2e7d32; }
.v2-esc-toast-info    { background: var(--v2-ink, #14140f); }

/* ── More-context wrapper visibility (shared C3 + C4) ───────────────── */
.v2-c-more-context-wrap {
  display: none;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--v2-hairline, #e5e3dc);
}
.v2-c-more-context-wrap.is-expanded { display: flex; }
.v2-c-more-context-wrap.is-prev {
  border-top: 0;
  border-bottom: 1px dashed var(--v2-hairline, #e5e3dc);
  padding-top: 0;
  padding-bottom: 4px;
  margin-top: 0;
  margin-bottom: 4px;
}
