/* ─── 커스텀 폰트 (HSHwalkongSerif) ────────────────────────── */
@font-face {
  font-family: 'HSHwalkongSerif';
  src: url('/static/HSHwalkongSerif-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ─── Google Fonts (Noto Sans KR 보조용) ───────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

/* ─── 기본 리셋 ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'HSHwalkongSerif', 'Noto Sans KR', sans-serif;
  background: #F5EEE8;
  color: #2F2B28;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── 네비게이션 ────────────────────────────────────────────── */
.nav-link {
  position: relative;
  font-family: 'HSHwalkongSerif', 'Noto Sans KR', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  color: #4a3f38;
  transition: color 0.25s ease;
  padding-bottom: 3px;
  text-decoration: none;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: #D51E2A;
  transition: width 0.3s ease;
}
.nav-link:hover { color: #D51E2A; }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: #D51E2A; font-weight: 700; }
.nav-link.active::after { width: 100%; }

/* ─── 빙고 셀 ──────────────────────────────────────────────── */
.bingo-cell {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  user-select: none;
}
.bingo-cell:hover { transform: scale(1.03); box-shadow: 0 4px 14px rgba(0,0,0,0.15); }
.bingo-cell:active { transform: scale(0.97); }

/* ─── 빙고 라인 애니메이션 ──────────────────────────────────── */
@keyframes drawLine {
  from { stroke-dashoffset: 1000; }
  to { stroke-dashoffset: 0; }
}
.bingo-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 0.6s ease-out forwards;
}

/* ─── 사진 첨부 애니메이션 ──────────────────────────────────── */
@keyframes photoAttach {
  0% { transform: scale(0.8) rotate(-5deg); opacity: 0; }
  60% { transform: scale(1.05) rotate(1deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.photo-attach { animation: photoAttach 0.35s ease-out forwards; }

/* ─── 페이드인 애니메이션 ──────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up    { animation: fadeInUp 0.7s ease-out forwards; }
.fade-in-up-d1 { animation: fadeInUp 0.7s ease-out 0.1s  forwards; opacity: 0; }
.fade-in-up-d2 { animation: fadeInUp 0.7s ease-out 0.3s forwards; opacity: 0; }
.fade-in-up-d3 { animation: fadeInUp 0.7s ease-out 0.5s  forwards; opacity: 0; }
.fade-in-up-d4 { animation: fadeInUp 0.7s ease-out 0.65s  forwards; opacity: 0; }

/* ─── 탑승권 찢기 애니메이션 ────────────────────────────────── */
@keyframes tearPeel {
  0%   { transform: translateX(0);    opacity: 1; }
  20%  { transform: translateX(12px); opacity: 1; }
  60%  { transform: translateX(80%);  opacity: 1; }
  85%  { transform: translateX(150%); opacity: 0.6; }
  100% { transform: translateX(200%); opacity: 0; }
}
@keyframes ticketPull {
  0%   { transform: translateX(0); }
  35%  { transform: translateX(-4px); }
  70%  { transform: translateX(-1.5px); }
  100% { transform: translateX(0); }
}
.ticket-stub-tear {
  animation: tearPeel 0.55s cubic-bezier(0.4, 0, 1, 1) forwards;
  transform-origin: left center;
  position: relative;
  z-index: 10;
  overflow: visible;
}
.ticket-shake { animation: ticketPull 0.22s ease-out; }

/* ─── 빙고 완성 배너 ────────────────────────────────────────── */
@keyframes bingoIn {
  0%  { transform: translateX(-50%) scale(0.4) translateY(-30px); opacity: 0; }
  70% { transform: translateX(-50%) scale(1.05) translateY(0); opacity: 1; }
  100%{ transform: translateX(-50%) scale(1) translateY(0); opacity: 1; }
}
@keyframes bingoOut {
  from { transform: translateX(-50%) scale(1); opacity: 1; }
  to   { transform: translateX(-50%) scale(0.7) translateY(-20px); opacity: 0; }
}
.bingo-banner-in  { animation: bingoIn  0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.bingo-banner-out { animation: bingoOut 0.3s ease-in forwards; }

/* ─── 구분선 ────────────────────────────────────────────────── */
.elegant-divider {
  width: 60px; height: 1.5px;
  background: linear-gradient(to right, transparent, #D51E2A, transparent);
  margin: 0 auto;
}

/* ─── 골드 그라디언트 텍스트 ────────────────────────────────── */
.text-gold {
  background: linear-gradient(135deg, #8B5E2A, #C8860C, #D4A018, #C8860C, #8B5E2A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 6px rgba(139,94,42,0.3));
}

/* ─── 타이틀 텍스트 (레퍼런스 스타일) ───────────────────────── */
.title-serif {
  font-family: 'Noto Serif KR', serif;
  font-weight: 900;
  color: #5C3A1E;
  text-shadow: 2px 2px 0px rgba(139,94,42,0.15);
  letter-spacing: -0.02em;
}

/* ─── 크림 메시지 박스 ──────────────────────────────────────── */
.message-box {
  background: #F8F3ED;
  border: 1.5px solid #D4C5B0;
  border-radius: 0.75rem;
  box-shadow: 
    0 4px 24px rgba(139,94,42,0.10),
    inset 0 1px 0 rgba(255,255,255,0.8);
}

/* ─── 탑승권 카드 ───────────────────────────────────────────── */
.boarding-card {
  background: #F7F1EA;
  border: 1px solid #D4C5B0;
  border-radius: 0.75rem;
  box-shadow: 3px 3px 12px rgba(139,94,42,0.12);
}

/* ─── 모달 오버레이 ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(47,43,40,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeInUp 0.2s ease-out;
  backdrop-filter: blur(2px);
}
.modal-box {
  background: white;
  border-radius: 1.25rem;
  max-width: 22rem; width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

/* ─── 토스트 알림 ───────────────────────────────────────────── */
.toast-container {
  position: fixed; top: 1.25rem; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 0.5rem;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: #F8F3ED;
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  font-size: 0.875rem;
  font-weight: 500;
  color: #2F2B28;
  animation: fadeInUp 0.3s ease-out;
  white-space: nowrap;
  pointer-events: auto;
}
.toast.success { border-left: 4px solid #D51E2A; }
.toast.info    { border-left: 4px solid #61B7B2; }
.toast.error   { border-left: 4px solid #e74c3c; }

/* ─── 드래그 오버 ───────────────────────────────────────────── */
.drag-over {
  border-color: #D51E2A !important;
  background: rgba(213,30,42,0.06) !important;
  transform: scale(1.02);
}

/* ─── 진행 바 ───────────────────────────────────────────────── */
@keyframes progressBar {
  from { width: 0; }
}
.progress-bar { animation: progressBar 0.7s ease-out; }

/* ─── 모바일 드로어 ─────────────────────────────────────────── */
.mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 18rem;
  background: #F8F3ED;
  box-shadow: -4px 0 24px rgba(139,94,42,0.15);
  z-index: 50;
  transition: transform 0.3s ease-out;
  transform: translateX(100%);
}
.mobile-drawer.open { transform: translateX(0); }

/* ─── 빨간 실 장식 ──────────────────────────────────────────── */
.red-thread {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}

/* ─── 반응형 lg-show ────────────────────────────────────────── */
@media (min-width: 1024px) {
  .lg-show { display: block !important; }
}
@media (max-width: 1023px) {
  .lg-show { display: none !important; }
}
@media (min-width: 768px) {
  .md-show { display: block !important; }
}
@media (max-width: 767px) {
  .md-show { display: none !important; }
}

/* ─── 빙고 배경 ─────────────────────────────────────────────── */
.craft-paper-bg {
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(229,115,115,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(255,138,101,0.06) 0%, transparent 60%),
    linear-gradient(145deg, #d95050 0%, #c03030 50%, #a01818 100%);
}

/* ─── 스핀 애니메이션 ───────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── 티켓 카드 hover ───────────────────────────────────────── */
.ticket-card:hover { transform: translateY(-2px) !important; }
.ticket-card:active { transform: scale(0.98) !important; }
