/**
 * 질병관리청 해외여행 건강정보 미니게임 - 메인 스타일시트
 * 외부 CDN/폰트 의존성 0%, 100% 순수 CSS3 (사용자 첨부 폰트 적용)
 * 모바일 퍼스트 (320px ~ 1024px+ 완벽 반응형)
 */

@font-face {
  font-family: 'ONEMobilePOP';
  src: url('../fonts/ONE Mobile POP.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ONEMobilePOP';
  src: url('../fonts/ONE Mobile POP OTF.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   1. 기본 리셋 및 전역 변수
   ========================================================================== */
:root {
  --primary-blue: #0284c7;
  --primary-blue-dark: #0369a1;
  --primary-blue-light: #e0f2fe;
  --accent-gold: #f59e0b;
  --accent-gold-light: #fef3c7;
  --success-green: #10b981;
  --danger-red: #ef4444;
  --danger-red-light: #fee2e2;
  
  --bg-sky: #f0f9ff;
  --surface-card: #ffffff;
  --surface-card-subtle: #f8fafc;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --border-color: #cbd5e1;
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 20px;
  --border-radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 10px 25px rgba(2, 132, 199, 0.18);
  --shadow-glow: 0 0 20px rgba(245, 158, 11, 0.5);

  --font-korean: 'ONEMobilePOP', "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
  --game-max-width: 480px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  background-color: #0c4a6e;
  color: var(--text-primary);
  font-family: var(--font-korean);
  -webkit-text-size-adjust: 100%;
  height: 100%;
  height: 100dvh;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top, #38bdf8 0%, #0369a1 60%, #0c4a6e 100%);
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ==========================================================================
   2. 레이아웃 구조 (상하 화면 꽉 채움 + 데스크톱 중앙 정렬)
   ========================================================================== */
.app-wrapper {
  width: 100%;
  max-width: 580px;
  height: 100%;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--surface-card);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.28);
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

@media (min-width: 580px) {
  .app-wrapper {
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    border-right: 1px solid rgba(255, 255, 255, 0.25);
  }
}

/* 상단 정부/기관 브랜딩 바 */
.agency-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  z-index: 20;
  flex-shrink: 0;
}

.agency-logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agency-logo-img {
  height: 28px;
  width: auto;
  max-width: 145px;
  object-fit: contain;
  display: block;
}

.campaign-tag {
  display: inline-block;
  background-color: var(--primary-blue-light);
  color: var(--primary-blue-dark);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--border-radius-full);
}

.sound-toggle-btn {
  background: #0284c7;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
  transition: all 0.2s ease;
}

.sound-toggle-btn:hover {
  background-color: #0369a1;
  transform: scale(1.05);
}

/* 메인 뷰 컨테이너 (위아래 꽉 채우는 Flex 설정) */
.game-main {
  flex: 1;
  min-height: 0;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   3. 화면 전환 관리 (Start / Playing / Clear View)
   ========================================================================== */
.view-screen {
  display: none !important;
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.view-screen.active {
  display: flex !important;
}

/* ==========================================================================
   4. START 화면 스타일 (사용자 첨부 스크린샷 100% 반영)
   ========================================================================== */
#start-view {
  display: none;
  padding: 0;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #75c6fc;
  overflow: hidden; /* 스크롤바 원천 제거 */
  height: 100%;
}

#start-view.active {
  display: flex !important;
}

/* 상단 3D 히어로 비주얼 아트워크 영역 (지구본 위쪽 중심) */
.start-hero-container {
  width: 100%;
  position: relative;
  background: #75c6fc;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  height: auto;
  aspect-ratio: 1220 / 500;
  max-height: 240px;
}

.start-hero-artwork {
  width: 100%;
  height: 100%;
  max-height: 240px;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* 하단 둥근 화이트 카드 시트 (투명도를 높여 뒤의 첫 화면.png 이미지가 전체 다 비치도록 함) */
.start-bottom-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  padding: 18px 16px 24px 16px;
  margin-top: 8px;
  position: relative;
  z-index: 5;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-shrink: 0;
}

.start-card-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 12px;
  word-break: keep-all;
  letter-spacing: -0.3px;
}

/* 안내 박스 1 & 2 (별, 경고) */
.start-info-box {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 12px;
  padding: 8px 10px;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.start-info-box.box-star {
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
}

.start-info-box.box-warn {
  background: #fff5f5;
  border: 1.5px solid #fecdd3;
}

.info-icon-col {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.info-text-col {
  flex: 1;
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #334155;
  word-break: break-all; /* 모바일 우측 텍스트 탈출 완전 봉쇄 */
  overflow-wrap: break-word;
}

.info-text-col p {
  margin: 0;
  padding: 0;
  word-break: break-all;
}

.info-line-top {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1px;
}

.info-line-bottom {
  font-weight: 600;
}

.text-blue-strong {
  color: #0284c7;
  font-weight: 800;
}

.text-red-strong {
  color: #e11d48;
  font-weight: 800;
}

/* 큼직한 주황/골드 3D 그라데이션 게임 시작 버튼 */
.btn-start-3d {
  width: 100%;
  background: linear-gradient(180deg, #ff9f1c 0%, #f77f00 50%, #d97706 100%);
  color: #ffffff;
  border: none;
  border-radius: 34px;
  padding: 10px 16px;
  font-family: var(--font-korean);
  font-size: 1.1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(247, 127, 0, 0.35), inset 0 2px 2px rgba(255, 255, 255, 0.4);
  margin-top: 10px;
  margin-bottom: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  letter-spacing: -0.3px;
}

.btn-start-3d:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(247, 127, 0, 0.42), inset 0 2px 2px rgba(255, 255, 255, 0.5);
}

.btn-start-3d:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(247, 127, 0, 0.3);
}

.btn-play-circle {
  width: 28px;
  height: 28px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.play-arrow {
  color: #f77f00;
  font-size: 0.85rem;
  margin-left: 2px;
  line-height: 1;
}

/* 파란색 알약 형태 게임 방법 버튼 */
.btn-guide-pill {
  width: 100%;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 28px;
  padding: 8px 14px;
  font-family: var(--font-korean);
  font-size: 0.88rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-guide-pill:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-guide-pill:active {
  transform: translateY(1px);
}

.guide-bulb-icon {
  font-size: 1.1rem;
}

/* 게임 방법 모달 팝업 */
.guide-modal-card {
  background: #ffffff;
  border-radius: 24px;
  width: 90%;
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.guide-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 2;
}

.guide-modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
}

.guide-modal-body {
  padding: 18px 20px 24px 20px;
  text-align: left;
}

.guide-section {
  margin-bottom: 16px;
  background: #f8fafc;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.guide-sec-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 6px;
  white-space: nowrap;
}

.guide-sec-desc {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 필수품 5종 미리보기 칩 */
.required-preview-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
}

.preview-chip {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--border-radius-full);
  padding: 5px 10px;
  font-size: 0.775rem;
  font-weight: 700;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.preview-chip .chip-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.preview-chip.special {
  background-color: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

/* 시작 버튼 */
.btn-primary {
  width: 100%;
  min-height: 52px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--border-radius-full);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-play-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.controls-hint {
  margin-top: 10px;
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* ==========================================================================
   5. PLAYING 화면 (게임 캔버스 + HUD + 카운트다운)
   ========================================================================== */
#playing-view {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  background: linear-gradient(180deg, #38bdf8 0%, #7dd3fc 45%, #2dd4bf 75%, #fde68a 100%);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* 카운트다운 오버레이 */
.countdown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 47, 73, 0.68);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.countdown-overlay.hidden {
  display: none !important;
}

.countdown-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, #0284c7 0%, #0369a1 100%);
  border: 4px solid #38bdf8;
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: countdownBounce 0.8s ease-in-out infinite;
}

.countdown-number {
  font-size: 3.4rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  line-height: 1;
  font-family: inherit;
}

.countdown-number.go {
  font-size: 2.2rem;
  color: #fde047;
  letter-spacing: -1px;
}

.countdown-text {
  margin-top: 14px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #e0f2fe;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

@keyframes countdownBounce {
  0% { transform: scale(0.85); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1.0); }
}

/* 상단 HUD (점수, 필수품 진행도) */
.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 8px 14px 14px 14px;
  background: linear-gradient(180deg, rgba(8, 47, 73, 0.95) 0%, rgba(12, 74, 110, 0.88) 65%, rgba(14, 116, 144, 0.45) 90%, transparent 100%);
  z-index: 30;
  color: #ffffff;
  pointer-events: auto;
}

.hud-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.score-display {
  display: flex;
  flex-direction: column;
}

.score-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: #bae6fd;
  letter-spacing: 0.5px;
}

.score-value {
  font-size: 1.95rem;
  font-weight: 900;
  color: #fef08a;
  font-family: var(--font-korean), sans-serif;
  letter-spacing: -0.5px;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.gauge-container {
  flex: 1;
  max-width: 180px;
  margin: 0 12px;
}

.gauge-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 800;
  color: #bae6fd;
  margin-bottom: 4px;
}

.gauge-track {
  width: 100%;
  height: 10px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-full);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.gauge-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8 0%, #10b981 100%);
  border-radius: var(--border-radius-full);
  transition: width 0.3s ease;
}

.gauge-fill.complete {
  background: linear-gradient(90deg, #f59e0b 0%, #fde047 100%);
  box-shadow: 0 0 10px #fde047;
}

/* 필수품 5종 체크리스트 */
.checklist-container {
  background-color: rgba(15, 23, 42, 0.92);
  border: 1.5px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 8px 6px;
  backdrop-filter: blur(6px);
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.checklist-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #38bdf8;
  margin-bottom: 6px;
  text-align: center;
  letter-spacing: -0.2px;
}

.checklist-items {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 2px 2px;
}

.check-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 1;
  min-width: 0;
  background: rgba(30, 41, 59, 0.75);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 6px 2px;
  transition: all 0.3s ease;
}

.check-item-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: 0.55;
  filter: grayscale(90%);
  transition: all 0.3s ease;
  margin-bottom: 4px;
}

.check-item-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  letter-spacing: -0.3px;
}

.check-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid #64748b;
  background-color: #1e293b;
  font-size: 10px;
  color: transparent;
  font-weight: 900;
  transition: all 0.3s ease;
}

.check-item.collected {
  background: rgba(14, 165, 233, 0.35);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.check-item.collected .check-item-icon {
  opacity: 1;
  filter: grayscale(0%) drop-shadow(0 0 6px #38bdf8);
}

.check-item.collected .check-item-label {
  color: #ffffff;
  font-weight: 900;
}

.check-item.collected .check-dot {
  background-color: #10b981;
  border-color: #10b981;
  color: #ffffff;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
}

.btn-pause-hud {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.btn-pause-hud:active {
  transform: scale(0.92);
  background: rgba(15, 23, 42, 0.9);
}

/* 게임 캔버스 (부모 화면 100% 꽉 채움) */
#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* 게임 진행 중 팝업 알림 (특별 아이템 등장 등) */
.in-game-notice {
  position: absolute;
  top: 140px;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: rgba(8, 47, 73, 0.95);
  color: #fde047;
  border: 2px solid #f59e0b;
  border-radius: var(--border-radius-md);
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.in-game-notice.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* 모바일 전용 터치 조작 버튼 (하단 좌/우 44px 이상 터치 영역) */
.mobile-control-bar {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 35;
  pointer-events: none;
}

.btn-direction {
  pointer-events: auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(8, 47, 73, 0.75);
  border: 2.5px solid rgba(255, 255, 255, 0.95);
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  user-select: none;
  box-shadow: 0 4px 14px rgba(8, 47, 73, 0.4);
  transition: transform 0.1s ease, background-color 0.1s ease;
}

.btn-direction:active {
  transform: scale(0.92);
  background-color: #0284c7;
  border-color: #fde047;
}

/* ==========================================================================
   6. 여행 출발 연출 오버레이 (클리어 직후 비행기 출발 연출)
   ========================================================================== */
#departure-overlay {
  position: absolute;
  inset: 0;
  background: #ffffff !important;
  background-color: #ffffff !important;
  z-index: 60;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #1e293b;
  text-align: center;
  padding: 24px;
  overflow: hidden;
}

#departure-overlay.active {
  display: flex;
  animation: overlayFadeIn 0.4s ease-out forwards;
}

.closed-carrier-display {
  width: 140px;
  height: auto;
  margin-bottom: 16px;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
  animation: carrierZip 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.airplane-flying-box {
  position: absolute;
  width: 140px;
  left: -160px;
  top: 15%;
  opacity: 0;
  pointer-events: none;
  z-index: 99999;
  transition: opacity 0.3s ease;
}

#departure-overlay.takeoff-flying .airplane-flying-box {
  opacity: 1;
  animation: airplaneFlyAcrossSmooth 1.8s ease-in-out forwards;
}

.airplane-img {
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.25));
}

.departure-text-wrap {
  position: relative;
  z-index: 20;
  opacity: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 360px;
  margin-top: 10px;
}

.departure-title {
  font-size: 1.65rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 8px;
}

.departure-subtitle {
  font-size: 1.02rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 18px;
}

/* ==========================================================================
   7. 이벤트 모달 팝업 & 감염병 예방정보 (프리미엄 리뉴얼)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(8, 47, 73, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-backdrop.active {
  display: flex;
  animation: modalFadeIn 0.3s ease-out forwards;
}

/* 여행 준비 완료 랜딩페이지 (#event-modal): 순백의 화이트 배경으로 쾌적하게 구성 */
#event-modal.modal-backdrop {
  background: #ffffff !important;
  background-color: #ffffff !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}

#event-modal .event-modal-card {
  width: 100%;
  max-width: 480px;
  height: 100%;
  max-height: 100%;
  border-radius: 0;
  box-shadow: none;
  border: none;
  background-color: #ffffff;
}

@media (min-width: 640px) {
  #event-modal.modal-backdrop {
    padding: 20px;
    background: #f8fafc !important;
    background-color: #f8fafc !important;
  }
  #event-modal .event-modal-card {
    height: auto;
    max-height: 94vh;
    border-radius: 20px;
    box-shadow: 0 20px 48px -12px rgba(8, 47, 73, 0.25);
    border: 1px solid #e2e8f0;
  }
}

.event-modal-card {
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  background-color: #ffffff;
  border-radius: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 24px 48px -12px rgba(8, 47, 73, 0.35);
  border: 1px solid rgba(226, 232, 240, 0.9);
  animation: modalScaleUp 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* 1. 상단 공식 여행건강알림e 브랜드 배너 (campaign-banner.png 원본 100% 반영) */
.modal-brand-banner-wrap {
  width: 100%;
  background: #ffffff;
  border-top-left-radius: 19px;
  border-top-right-radius: 19px;
  overflow: hidden;
  border-bottom: 1px solid #bae6fd;
}

.modal-brand-banner-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1126 / 300;
  object-fit: contain;
  display: block;
}

/* 2. 축하 타이틀 헤더 */
.modal-celebrate-header {
  padding: 14px 16px 8px;
  text-align: center;
  background-color: #ffffff;
}

.modal-celebrate-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: var(--border-radius-full);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  word-break: keep-all;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.45;
  word-break: keep-all;
}

.modal-subtitle strong {
  color: #0284c7;
  font-weight: 800;
}

/* 3. 모달 본문 */
.modal-body {
  padding: 0 16px 18px;
}

/* 플레이 결과 3구 스탯 덱 */
.result-stats-deck {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.stat-icon-wrap {
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.stat-label {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
}

.stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.stat-value.text-blue {
  color: #0284c7;
}

.stat-value.text-green {
  color: #16a34a;
}

.stat-value.text-amber {
  color: #d97706;
}

/* 4. 럭키드로우 특전 프로모션 박스 (프리미엄 골드 하이라이트) */
.luckydraw-promo-box {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 60%, #fed7aa 100%);
  border: 1.5px solid #f59e0b;
  border-radius: 14px;
  padding: 12px 14px;
  text-align: center;
  margin-bottom: 12px;
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.16);
  position: relative;
  overflow: hidden;
}

.luckydraw-promo-box::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 60%);
  pointer-events: none;
}

.promo-badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
}

.promo-tag {
  background: #b45309;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.promo-subtag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #92400e;
}

.promo-prize {
  font-size: 1.18rem;
  font-weight: 900;
  color: #78350f;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  word-break: keep-all;
}

.promo-desc {
  font-size: 0.8rem;
  color: #92400e;
  line-height: 1.4;
  word-break: keep-all;
}

.promo-desc strong {
  color: #b45309;
  font-weight: 900;
}

/* 5. 액션 버튼 */
.modal-actions-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-apply-draw {
  width: 100%;
  min-height: 50px;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--border-radius-full);
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(234, 88, 12, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  padding: 10px 16px;
}

.btn-apply-draw:hover {
  box-shadow: 0 8px 22px rgba(234, 88, 12, 0.48);
}

.btn-apply-draw:active {
  transform: scale(0.98);
}

.btn-gift-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.btn-restart {
  width: 100%;
  min-height: 42px;
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: var(--border-radius-full);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-restart:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

/* 6. 여행건강알림e 핵심 안내 배너 (간결하고 정돈된 카드) */
.health-summary-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1.5px solid #bae6fd;
  border-radius: 16px;
  padding: 18px 18px;
  text-align: left;
  margin-bottom: 18px;
}

.health-summary-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.health-summary-text {
  flex: 1;
}

.health-summary-text strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 900;
  color: #0369a1;
  margin-bottom: 4px;
  word-break: keep-all;
}

.health-summary-text p {
  font-size: 0.88rem;
  color: #0284c7;
  line-height: 1.5;
  margin: 0;
  word-break: keep-all;
}

/* ==========================================================================
   8. 푸터 영역 (슬림 & 컴팩트 공공기관 브랜딩)
   ========================================================================== */
.campaign-footer {
  margin-top: auto;
  background-color: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 8px 16px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
  flex-shrink: 0;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.campaign-footer * {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.footer-logo-img {
  height: 20px;
  width: auto;
  object-fit: contain;
  display: block;
}

.footer-campaign-text {
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.agency-links {
  margin-bottom: 3px;
  font-size: 0.7rem;
}

.footer-link {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover {
  text-decoration: underline;
}

.divider {
  margin: 0 6px;
  color: #cbd5e1;
}

.copyright {
  font-size: 0.68rem;
  color: #94a3b8;
}

/* ==========================================================================
   9. 애니메이션 키프레임 정의
   ========================================================================== */
@keyframes floatBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes floatItem {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-6px);
  }
}

@keyframes carrierZip {
  0% {
    transform: scale(0.8) rotate(-10deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.05) rotate(4deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

@keyframes airplaneFlyAcrossSmooth {
  0% {
    left: -160px;
    top: 15%;
    transform: scale(0.8) rotate(-5deg);
  }
  100% {
    left: 110%;
    top: 5%;
    transform: scale(0.9) rotate(0deg);
  }
}

@keyframes airplaneFlyAcross {
  0% {
    left: -240px;
    top: 35%;
    transform: scale(0.7) rotate(-12deg);
  }
  50% {
    top: 25%;
    transform: scale(1) rotate(-6deg);
  }
  100% {
    left: 110%;
    top: 15%;
    transform: scale(1.1) rotate(0deg);
  }
}

@keyframes airplaneFlyDiagonal {
  0% {
    left: -260px;
    top: 75%;
    transform: scale(0.6) rotate(-28deg);
  }
  50% {
    top: 40%;
    transform: scale(0.95) rotate(-16deg);
  }
  100% {
    left: 115%;
    top: 5%;
    transform: scale(1.2) rotate(-8deg);
  }
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes textSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScaleUp {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(15px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ==========================================================================
   10. 모바일 320px 대응 및 접근성 미디어 쿼리
   ========================================================================== */
@media (max-width: 360px) {
  .main-title {
    font-size: 1.35rem;
  }
  .main-subtitle {
    font-size: 0.85rem;
  }
  .preview-chip {
    padding: 3px 8px;
    font-size: 0.725rem;
  }
  .check-item {
    font-size: 0.65rem;
  }
  .btn-direction {
    width: 46px;
    height: 46px;
    font-size: 1.2rem;
  }
  .modal-title {
    font-size: 1.3rem;
  }
  .promo-prize {
    font-size: 1.15rem;
  }
}

/* 첫 화면 3D 여행 일러스트 카드 스타일 (지구본, 캐리어, 항공권, 여권, 카메라 등) */
.start-hero-gallery-card {
  width: 100%;
  padding: 2px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #75c6fc;
  flex-shrink: 0;
}

.start-hero-gallery-img {
  width: 100%;
  max-width: 480px;
  height: auto;
  max-height: 140px;
  object-fit: contain;
  object-position: center center;
  border-radius: var(--border-radius-md);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
  display: block;
  background: #ffffff;
  border: 2px solid #bae6fd;
}

/* 첫 화면 상단 캠페인 배너 (campaign-banner.png) */
.start-banner-container {
  width: 100%;
  padding: 6px 16px 2px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #75c6fc;
  flex-shrink: 0;
}

.start-campaign-banner-img {
  width: 100%;
  max-width: 480px;
  height: auto;
  max-height: 95px;
  object-fit: contain;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-sm);
  display: block;
}

/* 게임 진행 화면 및 모달 내 아이콘 배경 렌더링 최적화 (투명 백그라운드 깨짐 방지) */
.check-item-icon, .chip-icon {
  background: #ffffff !important;
  border-radius: 50% !important;
  padding: 3px !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15) !important;
  object-fit: contain !important;
  border: 1px solid #e2e8f0 !important;
}

.start-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
}

/* 첫 화면 상단 캠페인 배너 (campaign-banner.png) */
.start-banner-container {
  width: 100%;
  padding: 8px 16px 2px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ffffff;
  flex-shrink: 0;
}

.start-campaign-banner-img {
  width: 100%;
  max-width: 480px;
  height: auto;
  max-height: 58px;
  object-fit: contain;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-sm);
  display: block;
}

/* 게임 진행 화면 및 모달 내 아이콘 배경 렌더링 최적화 (투명 백그라운드 깨짐 방지) */
.check-item-icon, .chip-icon {
  background: #ffffff !important;
  border-radius: 50% !important;
  padding: 2px !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12) !important;
  object-fit: contain !important;
}

.result-footer {
  margin-top: 14px;
  border-radius: 0 0 19px 19px !important;
  background-color: #f8fafc;
  padding: 12px 16px 14px 16px;
}

/* 터치 지연 방지 및 필수 스타일 */
.force-interactive {
  touch-action: manipulation !important;
  position: relative !important;
  z-index: 9999 !important;
  pointer-events: auto !important;
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 12px 20px !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* 기존 버튼 클래스들에 클래스 추가 */
.btn-start-3d, .btn-primary, .btn-direction, .btn-apply-draw, .btn-guide-pill, .btn-pause-hud, .btn-close-modal, .btn-restart {
  pointer-events: auto !important;
  z-index: 1000 !important;
  -webkit-tap-highlight-color: transparent !important;
}
