* { margin: 0; padding: 0; box-sizing: border-box; }

/* Gmarket Sans (눈누/jsdelivr 웹폰트) */
@font-face {
  font-family: "Gmarket Sans"; font-weight: 300; font-style: normal; font-display: swap;
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansLight.woff") format("woff");
}
@font-face {
  font-family: "Gmarket Sans"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff") format("woff");
}
@font-face {
  font-family: "Gmarket Sans"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansBold.woff") format("woff");
}

/* 아이리스 전환용 커스텀 프로퍼티 */
@property --iris {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 150%;
}

:root {
  --blue-grad: linear-gradient(180deg, #1a13ff 0%, #3673ff 50%, #6f13ff 100%);
  --lang-bg: radial-gradient(216.51% 51.66% at 50% 50%, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 59.13%, rgba(0,0,0,0.2) 100%), linear-gradient(180deg, #1a13ff 0%, #3673ff 50%, #6f13ff 100%);
}

html, body {
  height: 100%;
  background: #000;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body {
  height: 100dvh; /* .app과 동일 기준 → 모바일 주소창 때문에 생기던 상단 여백/하단 잘림 방지 */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 모바일: 화면 전체를 꽉 채움(full-bleed) / PC: 375×812 폰 프레임 중앙 */
.app {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #000;
}
@media (min-width: 480px) {
  .app { max-width: 375px; height: 812px; }
}

.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ===== 인트로 ===== */
.intro { background: #000; }
.intro.is-hidden { opacity: 0; pointer-events: none; }

.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* 영상이 9:19.5라 대부분 폰 화면을 잘림 없이 꽉 채움 */
  pointer-events: none; /* 모바일에서 영상 직접 탭(재생/정지) 차단 — 재생은 JS가 제어 */
}

/* 봉투 강조용 딤 */
.intro-dim {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 46%, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.55) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.intro-dim.is-visible { opacity: 1; }

/* ===== 초대장(봉투) 버튼 ===== */
.invite-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit; /* 버튼이 Pretendard를 상속하도록 */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.invite-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.intro.is-opened .invite-btn {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -60%) scale(0.92);
}
.intro.is-opened .intro-dim { opacity: 0; }

/* ===== AG 워드마크 버튼 (글자만) ===== */
.ag {
  display: flex;
  align-items: center;
  gap: 4px;
  transform-origin: center;
  will-change: transform, opacity, filter;
}
.invite-btn.is-visible .ag { animation: floaty 2.8s ease-in-out infinite; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* AG 글자 — 입체 양각 느낌의 흰색 워드마크 */
.ag-mark {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}
.ag-chevron {
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
}

/* 클릭 → 슉 빨려 들어가듯 사라짐 (가속 ease-in) */
.invite-btn.is-opening .ag {
  animation: agWhoosh 0.42s cubic-bezier(0.6, 0.04, 0.98, 0.34) forwards;
}
@keyframes agWhoosh {
  0%   { transform: scale(1);    opacity: 1; filter: blur(0); }
  100% { transform: scale(0.18); opacity: 0; filter: blur(4px); }
}

.invite-label {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

/* ===== 언어 선택 ===== */
.language {
  background: var(--lang-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 20px calc(14px + env(safe-area-inset-bottom));
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.language::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("./image/background2.svg") center / cover no-repeat;
  pointer-events: none;
}
.language.is-visible { opacity: 1; pointer-events: auto; }
.language.is-leaving { opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
.language > * { position: relative; z-index: 1; }

.lang-logo { width: 200px; margin-top: 0; flex-shrink: 0; transform: translateX(-16px); -webkit-user-select: none; user-select: none; }
.lang-date { margin-top: 8px; color: #939393; font-family: "dunkel-sans-expanded-rounded", sans-serif; font-size: 12px; font-weight: 900; font-style: normal; letter-spacing: 0.2px; }

.lang-list {
  list-style: none;
  width: 100%;
  max-width: 250px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.lang-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 10px;
  border-radius: 8px;
  /* Fill ACACAC 30% + Glass(미세 대각선 하이라이트) */
  background: rgba(172,172,172,.30);
  box-shadow:
    inset 1px 1px 1px rgba(255,255,255,.5),
    inset -1px -1px 1px rgba(255,255,255,.28);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.lang-item:active { transform: scale(0.99); }

.flag { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

.lang-text { display: flex; flex-direction: column; line-height: 1.2; }
.lang-text .nm { color: #0C0C0C; font-size: 14px; font-weight: 800; }
.lang-text .cd { color: #6E6E6E; font-size: 12px; font-weight: 600; }

.lang-item.is-selected { background: #FF36A1; position: relative; box-shadow: none; }
.lang-item.is-selected .flag { width: 24px; height: 24px; }
.lang-item.is-selected .lang-text .nm { color: #fff; }
.lang-item.is-selected .lang-text .cd { color: rgba(255, 255, 255, 0.85); }
.lang-item.is-selected::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5.2L4 7.5L8.5 2.5' stroke='%23FF36A1' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.lang-help {
  margin-top: 10px;
  text-align: center;
  color: #000000;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}

/* ===== 전환 커버 (바깥 → 중앙 아이리스) ===== */
.cover {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: none;
  background: var(--lang-bg);
  --iris: 150%;
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent calc(var(--iris) - 0.6%), #000 var(--iris));
          mask: radial-gradient(circle at 50% 50%, transparent calc(var(--iris) - 0.6%), #000 var(--iris));
  transition: --iris 0.85s cubic-bezier(.7, 0, .3, 1);
}
.cover.is-active  { display: block; }
.cover.is-closing { --iris: 0%; }    /* 바깥 → 중앙으로 덮임 */
.cover.is-opening { --iris: 150%; }  /* 중앙 → 바깥으로 열림(언어화면 공개) */

@media (prefers-reduced-motion: reduce) {
  .cover { transition: none; }
  .invite-btn.is-opening .env-flap { animation: none; }
}

/* ===== 메인 (언어 선택 후, 같은 페이지) ===== */
.main-screen {
  position: absolute; inset: 0; z-index: 20;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #F9F9F9;
  color: #fff; opacity: 0; visibility: hidden; transition: opacity .5s ease;
}
.main-screen.is-visible { opacity: 1; visibility: visible; }

.m-lang {
  position: absolute; top: 14px; right: 16px; z-index: 30; /* .app 프레임 기준 고정 */
  display: flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: 999px; cursor: pointer;
  /* 글래스 — 반투명+blur, 대각선 광택 + 연한 회색 가장자리 */
  background: rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(0,0,0,.12);
  box-shadow:
    inset 1.5px 1.5px 1.5px rgba(255,255,255,.7),
    inset -1.5px -1.5px 1.5px rgba(255,255,255,.4),
    0 3px 8px rgba(0,0,0,.10);
  color: #000;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 12px; font-weight: 800; letter-spacing: 0;
  opacity: 0; pointer-events: none; /* 기본 숨김 — 메인 화면에서만 노출 */
  transition: transform .32s ease, opacity .32s ease;
}
/* 메인 화면 활성 시 표시 */
.m-lang.is-active { opacity: 1; pointer-events: auto; }
/* 스크롤 내릴 때 숨김 / 올릴 때 다시 표시 (is-active 이후 정의 → 우선 적용) */
.m-lang.is-hidden {
  transform: translateY(-160%);
  opacity: 0;
  pointer-events: none;
}
.m-flag {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: #fff; border: 1.3px solid #c5c5c5;
}

.m-hero {
  display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(180deg, #2b4efd 0%, #3564ff 100%);
}
.m-poster { width: 100%; display: block; }
/* 카운트다운 아래 구름 — 여백 없이 시트로 이어짐 (투명부는 히어로 블루가 비침) */
.m-cloud { width: 100%; display: block; margin-top: -12px; margin-bottom: -1px; }
.m-count { display: flex; flex-direction: column; align-items: center; margin-top: 40px; padding: 0 20px; }
.m-count-title { font-family: "Gmarket Sans", sans-serif; font-size: 20px; font-weight: 500; letter-spacing: .02em; color: #fff; opacity: .95; margin-bottom: 16px; }
.m-count-grid { display: flex; align-items: flex-start; gap: 8px; width: 100%; max-width: 330px; }
.m-cell {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
}
/* 숫자 = 파란 박스 안 흰 글자 */
.m-num {
  width: 100%; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  background: #1347df; border-radius: 8px; padding: 8px 12px;
  font-family: "Pretendard", Arial, sans-serif;
  font-size: 24px; font-weight: 600; line-height: 1; color: #fff;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 8px 20px rgba(15,10,80,.25);
}
/* 라벨 = 박스 밖(아래) 연한 파랑 */
.m-lab { font-family: "Pretendard", Arial, sans-serif; font-size: 14px; font-weight: 300; line-height: normal; letter-spacing: .04em; color: #aab6f2; }
.m-colon { align-self: flex-start; height: 45px; margin-top: -3px; display: flex; align-items: center; font-size: 22px; font-weight: 800; color: #fff; }

/* 콘텐츠 시트 — 블루 그라데이션 위 라벤더 카드 */
.m-sheet { background: transparent; margin-top: 8px; padding: 8px 20px 24px; color: #1a1340; }
.m-block {
  background: #f1f0ff; border-radius: 16px; padding: 32px 20px; margin-bottom: 28px;
}
.m-block:last-child { margin-bottom: 0; }
.m-kicker {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-weight: 800; font-size: 16px; letter-spacing: .12em; color: #5b54ff;
}
/* INVITATION 키커 — DunkelSans / 20px / 블루 */
#mInviteKicker { font-family: "dunkel-sans-expanded-rounded", sans-serif; font-weight: 900; font-style: normal; font-size: 20px; color: #3164ff; }
#mScheduleKicker { font-family: "dunkel-sans-expanded-rounded", sans-serif; font-weight: 900; font-style: normal; font-size: 20px; color: #3164ff; }
.m-star { width: 16px; height: 16px; object-fit: contain; }
.m-invite { position: relative; margin-top: 21px; text-align: center; font-family: "Gmarket Sans", Pretendard, Arial, sans-serif; font-size: 14px; line-height: 150%; color: #1a1340; font-weight: 500; }
.m-sign { display: block; margin: 21px auto 0; height: 14px; width: auto; }
.m-note { text-align: center; font-size: 11px; color: #8e8ab0; margin-top: 10px; margin-bottom: 22px; }

/* 일정 — DAY별 색상 타임라인 (--day-color는 JS가 주입) */
.m-days { display: flex; flex-direction: column; gap: 26px; margin-top: 21px; }
.m-day-head { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.m-day-no {
  width: 19px; height: 19px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--day-color, #ff1493); color: #fff; font-weight: 600; font-size: 13px; line-height: 1;
}
.m-day-name { font-weight: 800; font-size: 16px; color: var(--day-color, #ff1493); }
.m-day-sub { font-weight: 800; font-size: 16px; color: #1a1340; }
.m-chev { margin-left: auto; width: 24px; height: 24px; transition: transform .3s; }
/* 열림=원본(▲), 닫힘=뒤집기(▼) */
.m-day:not(.is-open) .m-chev { transform: rotate(180deg); }

.m-day-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; }
.m-day.is-open .m-day-body { grid-template-rows: 1fr; }
.m-day-inner { overflow: hidden; padding: 12px 0 0 9px; }
.m-timeline {
  list-style: none; margin: 0; padding: 4px 0 4px 18px;
  border-left: 1.5px solid var(--day-color, #ff1493);
  display: flex; flex-direction: column; gap: 16px;
}
.m-timeline li { display: flex; gap: 8px; align-items: baseline; }
.m-day-time { font-weight: 600; font-size: 15px; color: var(--day-color, #ff1493); min-width: 44px; flex-shrink: 0; }
.m-day-ev { font-size: 15px; color: #1a1340; line-height: 1.4; font-weight: 500; }

/* DAY별 이미지 — SVG에 둥근모서리/그림자/4px여백 내장. CSS 그림자·라운드 제거(이중방지), 4px 보정해 세로줄~카드폭 정렬 */
.m-day-img {
  display: block; margin: 16px 0 0 -4px; width: calc(100% + 8px); height: auto;
}

.m-footer { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 20px 44px; background: transparent; }
.m-flogo {
  display: block; width: 96px; height: auto;
  filter: brightness(0) invert(0.75); /* AG_logo(#333) → 회색 #c0c0c0 */
}
.m-fsub {
  width: 100%; position: relative; display: inline-block;
  font-family: Pretendard, Arial, sans-serif; font-size: 8px; font-weight: 500;
  color: #c0c0c0; text-align: center;
}
