/* ==========================================================================
   [Ending Stage] 200일 축하글 & 팡파레 전용 스타일시트
   ========================================================================== */

.ending-container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  position: relative;
}

/* 상단 피날레 헤더 */
.ending-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.8rem;
  border-radius: 18px;
}

.ending-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ending-badge {
  background: linear-gradient(135deg, #f43f5e, #a855f7);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.35);
}

.ending-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.fanfare-btn-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 30px;
  border: none;
  background: linear-gradient(135deg, #ff4d6d, #ff758c);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 77, 109, 0.35);
  transition: all 0.2s ease;
}

.fanfare-btn-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 77, 109, 0.5);
}

/* ==========================================================================
   메인 축하 편지 & 명예의 전당 레이아웃
   ========================================================================== */
.ending-main-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 1.75rem;
  align-items: stretch;
}

/* 좌측: 200일 감동 축하 편지 카드 */
.letter-card {
  padding: 2.5rem 2.8rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid rgba(255, 182, 193, 0.7);
  box-shadow: 0 16px 40px rgba(255, 117, 140, 0.16);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.letter-card::before {
  content: '🌸';
  position: absolute;
  top: -15px;
  right: -10px;
  font-size: 5rem;
  opacity: 0.12;
  pointer-events: none;
}

.letter-header {
  border-bottom: 2px dashed rgba(255, 182, 193, 0.7);
  padding-bottom: 1.25rem;
}

.letter-salutation {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 800;
  color: #e11d48;
  line-height: 1.35;
}

.letter-body {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.95;
  color: #334155;
  word-break: keep-all;
}

.letter-footer {
  border-top: 2px dashed rgba(255, 182, 193, 0.7);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.letter-signature {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: #e11d48;
}

.letter-seal {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, #e11d48 0%, #be123c 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.4);
  border: 2px solid #ffe4e6;
}

/* 우측 사이드 패널 (오늘의 짤드컵 1위 + 팬들의 한마디) */
.ending-side-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* 짤드컵 1위 기념 카드 */
.hall-of-fame-card {
  padding: 1.5rem;
  border-radius: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid #f59e0b;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
}

.hof-tag {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: #b45309;
  background: #fef3c7;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.hof-img-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: #0f172a;
}

.hof-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hof-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

/* 팬들의 롤링 한마디 카드 */
.fan-wishes-card {
  padding: 1.5rem;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wishes-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ff4d6d;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.wishes-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.wish-item {
  font-size: 0.86rem;
  color: #475569;
  background: rgba(255, 255, 255, 0.75);
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  border-left: 3px solid #ff758c;
  line-height: 1.45;
}

/* ==========================================================================
   하단 피날레 컨트롤 액션 바
   ========================================================================== */
.ending-actions-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem;
}

.action-btn {
  padding: 0.95rem 1.8rem;
  border-radius: 50px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: none;
}

.btn-grand-fanfare {
  background: linear-gradient(135deg, #ff4365, #ff758c 50%, #f59e0b 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 67, 101, 0.4);
}

.btn-grand-fanfare:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(255, 67, 101, 0.55);
}

.btn-capture-mode {
  background: rgba(255, 255, 255, 0.85);
  color: #334155;
  border: 1.5px solid #cbd5e1;
}

.btn-capture-mode:hover {
  background: #ffffff;
  color: #0f172a;
  transform: translateY(-2px);
}

.btn-restart-all {
  background: rgba(255, 255, 255, 0.85);
  color: #475569;
  border: 1.5px solid #cbd5e1;
}

.btn-restart-all:hover {
  background: #f8fafc;
  transform: translateY(-2px);
}

/* ==========================================================================
   캡처 모드 (클린 화면 촬영용)
   ========================================================================== */
body.clean-capture-mode .top-nav,
body.clean-capture-mode .ending-header,
body.clean-capture-mode .ending-actions-bar,
body.clean-capture-mode .test-env-bar {
  display: none !important;
}

.capture-exit-banner {
  display: none;
  position: fixed;
  top: 15px;
  right: 20px;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  padding: 0.5rem 1.2rem;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.clean-capture-mode .capture-exit-banner {
  display: flex;
}

/* ==========================================================================
   반응형 브레이크포인트
   ========================================================================== */
@media (max-width: 960px) {
  .ending-main-grid {
    grid-template-columns: 1fr;
  }
  .letter-card {
    padding: 1.75rem 1.5rem;
  }
}
