/* ===== 알림 토스트 ===== */
.toast-stack {
  position: fixed;
  right: 12px;
  bottom: calc(var(--taskbar-h) + 12px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 15000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 340px;
  padding: 12px 12px 12px 14px;
  background: rgba(32, 36, 44, 0.97);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  cursor: default;
  animation: toast-in 220ms ease-out;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 240ms ease, transform 240ms ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.toast-icon svg {
  width: 28px;
  height: 28px;
}

.toast-body {
  flex: 1 1 auto;
  min-width: 0;
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.toast-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  /* 안내 문구가 잘리지 않게 세 줄까지 보여 준다 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.toast-close {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  cursor: default;
  padding: 0 2px;
}

.toast-close:hover {
  color: #fff;
}

@media (max-width: 720px) {
  .toast { width: calc(100vw - 24px); }
}

/* ===== 챕터 카드 ===== */
.chapter-card {
  position: fixed;
  inset: 0;
  z-index: 18000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  cursor: pointer;
  animation: card-in 500ms ease-out;
}

.chapter-card.is-leaving {
  opacity: 0;
  transition: opacity 400ms ease;
  pointer-events: none;
}

@keyframes card-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.chapter-card-inner {
  text-align: center;
  animation: card-text 700ms ease-out;
}

@keyframes card-text {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chapter-card-number {
  font-size: 14px;
  letter-spacing: 6px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 12px;
}

.chapter-card-title {
  font-size: 40px;
  font-weight: 300;
  margin-bottom: 18px;
}

.chapter-card-goal {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 520px;
  padding: 0 24px;
  margin: 0 auto;
}

.chapter-card-close {
  margin-top: 28px;
  padding: 8px 32px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.chapter-card-close:hover,
.chapter-card-close:focus-visible { background: rgba(255, 255, 255, 0.15); outline: none; }

/* 사건 엔딩 그림이 있는 승인 카드: 그림은 16:9 그대로(contain), 사건명·해설은 그림 밖. 화면이 낮으면 카드 전체가 세로로 스크롤된다 */
.chapter-card.has-image { align-items: flex-start; overflow-y: auto; padding: 16px; }
.chapter-card.has-image .chapter-card-inner { margin: auto; width: min(960px, 100%); }
.chapter-card.has-image .chapter-card-number { letter-spacing: 3px; margin-bottom: 8px; }
.chapter-card.has-image .chapter-card-title { font-size: clamp(20px, 3.2vw, 30px); font-weight: 400; margin-bottom: 14px; }
.chapter-card-figure {
  width: min(100%, max(320px, calc((100vh - 280px) * 16 / 9)));
  aspect-ratio: 16 / 9;
  margin: 0 auto 16px;
  background: #111;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
}
.chapter-card-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.chapter-card.has-image .chapter-card-goal { max-width: 760px; padding: 0; font-size: 14px; line-height: 1.65; text-align: left; }
.chapter-card.has-image .chapter-card-close { margin-top: 18px; }

/* ===== 엔딩 ===== */
.ending-screen {
  position: fixed;
  inset: 0;
  z-index: 19000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0c;
  color: #e8e8e8;
  animation: card-in 1200ms ease-out;
  user-select: none;
}

.ending-inner {
  max-width: 560px;
  padding: 0 24px;
  text-align: center;
  animation: card-text 1200ms ease-out;
}

.ending-label {
  font-size: 13px;
  letter-spacing: 8px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 16px;
}

.ending-title {
  font-size: 44px;
  font-weight: 300;
  margin-bottom: 28px;
}

.ending-text {
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-line;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 28px;
}

.ending-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 32px;
}

.ending-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.ending-btn {
  min-width: 140px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  font-size: 13px;
  cursor: default;
}

.ending-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ending-btn-primary {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.ending-btn-primary:hover {
  background: #e6e6e6;
}

/* ===== 작업 표시줄 읽지 않음 배지 ===== */
.tb-pin {
  position: relative;
}

.tb-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #e81123;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  font-weight: 600;
}
