/* HOLIDAY GAME - 공통 + 인트로 + HOW TO PLAY
   디자인 기준: Figma WEB_ADER_HOLIDAY ver2 (Mobile 390 x 844). PC 도 Mobile 화면과 동일하게 보여준다. */

/* 폰트: 구글 폰트 / 외부 CDN 사용 안 함 (중국 오픈 대응). 파일은 S3(CloudFront) source/holiday 에 둔다 (외부 공용 CDN 아님).
   - 영문 · 숫자: 디자인은 Futura LT Pro Heavy(800).
     기기에 Futura 가 있으면(iOS/macOS) 그것을, 없으면 FuturaLocal 을 쓴다.
     FuturaLocal 은 Regular 파일뿐이라 굵기는 브라우저가 합성한다 (Heavy 파일 확보 시 weight 800 으로 교체).
   - 한글: Noto Sans KR 400 / 500. 페이지에서 쓰는 글자만 남긴 파일 (tools/subset-noto.py 로 생성).
     파일에 없는 글자는 다음 순서의 시스템 폰트로 표시된다. */
@font-face {
    font-family: "FuturaLocal";
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url("https://d31flwjaqugbgy.cloudfront.net/source/holiday/Futura.ttf") format("truetype");
}

@font-face {
    font-family: "NotoSansKRLocal";
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url("https://d31flwjaqugbgy.cloudfront.net/source/holiday/NotoSansKR-400.woff2") format("woff2");
}

@font-face {
    font-family: "NotoSansKRLocal";
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    src: url("https://d31flwjaqugbgy.cloudfront.net/source/holiday/NotoSansKR-500.woff2") format("woff2");
}

:root {
    --red: #b70306;
    --red-btn: rgba(183, 3, 6, 0.8);
    --ink: #191919;
    --gray: #808080;
    --line: #eaeaea;
    --font-en: "Futura LT Pro", "Futura", "FuturaLocal", "Century Gothic", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
    /* KO 도 영문 · 숫자는 Futura (QA 389:311). Futura 에는 한글이 없어 한글은 자동으로 뒤의 Noto Sans KR 로 나온다 */
    --font-ko: "Futura LT Pro", "Futura", "FuturaLocal", "NotoSansKRLocal", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "PingFang SC",
               "Microsoft YaHei", "Malgun Gothic", "Helvetica Neue", Arial, sans-serif;
    --shadow: 2px 2px 20px rgba(128, 128, 128, 0.12), inset 2px 2px 6px rgba(255, 255, 255, 0.25);
    --app-w: 430px;
}

/* EN : 본문 영문도 Futura (QA). "언어 / LANGUAGE" 의 한글은 뒤의 Noto Sans KR 로 나온다 */
html[lang="en"] {
    --font-ko: "Futura LT Pro", "Futura", "FuturaLocal", "NotoSansKRLocal", -apple-system, BlinkMacSystemFont,
               "Apple SD Gothic Neo", "Helvetica Neue", Arial, sans-serif;
}

/* CN : 영문 · 숫자는 Futura (QA), 한자는 한국어 폰트와 섞이지 않게 간체 폰트를 먼저 쓴다 (기기 기본 폰트, 파일 추가 없음)
   Futura 에는 한자가 없어 한자는 자동으로 뒤의 간체 폰트로 나온다. "언어 / LANGUAGE" 의 한글은 Noto Sans KR */
html[lang="zh-CN"] {
    --font-ko: "Futura LT Pro", "Futura", "FuturaLocal", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei",
               "NotoSansKRLocal", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

/* JP : 영문 · 숫자는 Futura, 가나 · 한자는 일본어 폰트 (기기 기본 폰트, 파일 추가 없음). 한자가 한국어 · 중국어 글꼴로 나오지 않게 일본어 폰트를 먼저 쓴다 */
html[lang="ja"] {
    --font-ko: "Futura LT Pro", "Futura", "FuturaLocal", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", "Meiryo",
               "NotoSansKRLocal", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

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

html,
body {
    height: 100%;
    background: #000;
    font-family: var(--font-ko);
    color: var(--ink);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body.is_locked {
    overflow: hidden;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

img {
    display: block;
}

.logo {
    width: 133px;
    height: 17px;
}

/* ---------- App frame ---------- */
.app {
    position: relative;
    width: 100%;
    max-width: var(--app-w);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    overflow: hidden;
    background: #fff;
}

/* ---------- 공통 버튼 (Futura Heavy 15px, 자간 10%) ---------- */
.btn_red,
.btn_line {
    display: block;
    height: 45px;
    line-height: 45px;
    border-radius: 8px;
    font-family: var(--font-en);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-align: center;
    text-transform: uppercase;
    box-shadow: var(--shadow);
}

.btn_red {
    background: var(--red-btn);
    color: #fff;
}

.btn_line {
    border: 1px solid var(--line);
    background: #fff;
    line-height: 43px;
}

/* ---------- INTRO (ver2) ---------- */
/* 한 화면에 다 들어오게 (스크롤 없음, QA 2026-11-12) : 높이를 화면에 고정하고
   간격은 화면 높이 664(아이폰 사파리) ~ 844(Figma) 사이에서 비례해 줄었다 늘었다 하고, 그래도 모자라면 일러스트가 줄어든다.
   일러스트는 디자인의 80% 까지만 줄어들고, 그보다 낮은 화면(아이폰 SE 사파리 · 가로 모드 등)은 스크롤된다 */
.intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    text-align: center;
}

.intro_head {
    padding-top: clamp(14px, calc(9.44vh - 48.7px), 31px);
    padding-top: clamp(14px, calc(9.44dvh - 48.7px), 31px);
}

/* 소개 문구 : Figma INTRO_02(66:617)는 로고 아래 120px 이지만 문구가 4줄 + 태그라인으로 길어져(슬라이드 40) 60px 로 줄인다 */
.intro_desc {
    margin-top: clamp(24px, calc(20.00vh - 108.8px), 60px);
    margin-top: clamp(24px, calc(20.00dvh - 108.8px), 60px);
    padding: 0 40px;
    font-size: 12px;
    font-weight: 500;
    line-height: 22px;
    white-space: pre-line;
    word-break: keep-all;
}

/* Where are the Snowmals? : 소개 문구 아래 한 줄 띄우고 기울임 (영문 Futura) */
.intro_tagline {
    display: block;
    margin-top: clamp(10px, calc(6.67vh - 34.3px), 22px);
    margin-top: clamp(10px, calc(6.67dvh - 34.3px), 22px);
    font-family: var(--font-en);
    font-style: italic;
}

/* 언어 선택 (Figma INTRO_02) : 설명 문구 아래 가운데, "언어 / LANGUAGE" + 150 x 40 드롭다운 */
.intro_lang {
    margin-top: clamp(8px, calc(6.67vh - 36.3px), 20px);
    margin-top: clamp(8px, calc(6.67dvh - 36.3px), 20px);
}

.intro_lang_label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    line-height: 25px;
    text-transform: uppercase;
}

.lang_select {
    position: relative;
    width: 150px;
    height: 40px;
    margin: clamp(8px, calc(6.67vh - 36.3px), 20px) auto 0;
    margin: clamp(8px, calc(6.67dvh - 36.3px), 20px) auto 0;
}

/* 글자는 위의 .lang_select_value 가 보여 주므로 select 안쪽 여백은 없앤다.
   윈도우 크롬은 펼친 목록에 select 의 왼쪽 여백만 적용해 글자가 오른쪽으로 쏠린다 (QA 2026-11-12) */
.lang_select select {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    box-shadow: var(--shadow);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    color: transparent;             /* 글자는 위의 .lang_select_value 가 가운데에 보여 준다 */
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.lang_select option {
    padding: 0;
    color: var(--ink);
    text-align: center;
}

.lang_select_value {
    position: absolute;
    inset: 0 30px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
}

/* ▼ : 10 x 10, 오른쪽 10px */
.lang_select::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 10px;
    width: 10px;
    height: 9px;
    margin-top: -4px;
    background: var(--ink);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    pointer-events: none;
}

/* 일러스트 (Figma INTRO_02 66:617) : 화면 너비 꽉 차게(390 기준 390 x 366), 언어 선택 위쪽 15px 지점부터 겹쳐 시작.
   남는 높이를 모두 차지하고, 높이가 모자라면 비율을 유지한 채 줄어든다(위쪽 정렬이라 사슴은 언어 선택 옆에 남는다).
   겹친 부분이 언어 선택을 가리지 않도록 일러스트는 클릭을 통과시키고 언어 선택을 위에 둔다 */
.intro_lang {
    position: relative;
    z-index: 1;
}

.intro_visual {
    flex: 1 1 0;
    min-height: calc(min(100vw, var(--app-w)) * 0.75);      /* 디자인 크기(390 기준 366)의 80% 보다 작아지지 않는다 */
    width: 100%;
    margin-top: -55px;
}

.intro_visual img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: 50% 0;
    pointer-events: none;
}

/* 일러스트 아래 29px · 화면 아래 40px (Figma) */
.intro_cta {
    width: 100%;
    padding: clamp(12px, calc(9.44vh - 50.7px), 29px) 40px calc(clamp(20px, calc(11.11vh - 53.8px), 40px) + env(safe-area-inset-bottom));
    padding: clamp(12px, calc(9.44dvh - 50.7px), 29px) 40px calc(clamp(20px, calc(11.11dvh - 53.8px), 40px) + env(safe-area-inset-bottom));
}

.btn_how {
    display: block;
    margin: clamp(8px, calc(6.67vh - 36.3px), 20px) auto 0;
    margin: clamp(8px, calc(6.67dvh - 36.3px), 20px) auto 0;
    padding: 4px;
    font-family: var(--font-en);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ---------- HOW TO PLAY (ver2, 전체 화면) ---------- */
.howto {
    position: fixed;
    inset: 0;
    z-index: 100;
    width: 100%;
    max-width: var(--app-w);
    margin: 0 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #fff;
}

.howto[hidden] {
    display: none;
}

.howto_head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 78px;
    background: #fff;
}

.howto_close {
    position: absolute;
    right: 10px;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-top: -22px;
}

.howto_body {
    padding: 10px 20px 40px;
}

.howto_box {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.howto_box + .howto_box {
    margin-top: 20px;
}

.howto_title {
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    line-height: 16px;
}

.howto_title_en {
    font-family: var(--font-en);
    font-weight: 800;
    letter-spacing: 0.05em;
}

/* 게임 방법 · 유의사항 : 번호 목록 "1." (HOLIDAY GAME 슬라이드 41~42). 번호 뒤로 줄이 바뀌어도 글 첫머리에 맞춘다 */
.rules {
    list-style: none;
    counter-reset: rule;
}

.rules > li {
    position: relative;
    padding-left: 16px;
    color: #000;
    font-size: 11px;
    line-height: 22px;
    word-break: keep-all;
    counter-increment: rule;
}

.rules > li + li {
    margin-top: 10px;
}

.rules > li::before {
    content: counter(rule) ".";
    position: absolute;
    left: 0;
}

/* 유의사항 7번 리워드 세부사항 : "*" 로 시작하는 문장이라 기호 없이 들여쓰기 없이 */
.reward_details {
    margin-top: 4px;
    list-style: none;
}

.reward_details li + li {
    margin-top: 4px;
}

/* REWARDS (Figma 366:187) : 본문 11px / 22px. 소개 → 20 → 등수(점) + 경품(들여쓰기 없음) */
.benefit_intro,
.benefit_rank,
.benefit_gift {
    font-size: 11px;
    line-height: 22px;
    color: #000;
    white-space: pre-line;
    word-break: keep-all;
}

.benefit_prizes {
    margin-top: 20px;
}

.benefit_prizes li + li {
    margin-top: 10px;
}

.benefit_rank {
    position: relative;
    padding-left: 9px;
}

.benefit_rank::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--ink);
}

.benefit_gift {
    margin-top: 5px;
}

/* ---------- 모션 최소화 ---------- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- KEY VISUAL (첫 화면, Figma INTRO 66:613 · INTRO 02 256:115 · INTRO 3 256:127) ---------- */
.kv {
    position: fixed;
    inset: 0;
    z-index: 200;
    width: 100%;
    max-width: var(--app-w);
    margin: 0 auto;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    transition: opacity 0.6s ease;
}

.kv[hidden] {
    display: none;
}

.kv.is_out {
    opacity: 0;
    pointer-events: none;
}

/* 순서 (Figma 메모 128:266) : ① 배경 디졸브 + 눈 → ② 흐림 막 + 타이틀 디졸브. 배경을 받으면 .is_ready 가 붙는다 */
.kv_bg,
.kv_dim,
.kv_snow {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.kv_bg {
    object-fit: cover;
    object-position: 50% 50%;
    user-select: none;
    -webkit-user-drag: none;
}

/* 타이틀 뒤 막 (Figma 256:129 : #252525 15% + 배경 흐림 3). Figma 흐림 값은 CSS blur 의 약 2배라 1.5px */
.kv_dim {
    background: rgba(37, 37, 37, 0.15);
    -webkit-backdrop-filter: blur(1.5px);
    backdrop-filter: blur(1.5px);
}

.kv_snow {
    pointer-events: none;
}

/* 타이틀 이미지 : Figma 390 기준 300 x 234, 가운데 (top 300) */
.kv_title {
    position: absolute;
    top: 49.4%;
    left: 50%;
    width: 76.9%;
    height: auto;
    transform: translate(-50%, -50%);
    opacity: 0;
    user-select: none;
    -webkit-user-drag: none;
}

.kv.is_ready .kv_bg,
.kv.is_ready .kv_snow {
    animation: kvDissolve 0.8s ease forwards;
}

.kv.is_ready .kv_dim,
.kv.is_ready .kv_title {
    animation: kvDissolve 0.8s ease 1s forwards;
}

/* Tap Anywhere To Start (Figma INTRO 5 389:415) : Futura Book 13px 흰색, 아래에서 160px. 타이틀 다음에 떠서 천천히 깜빡인다 */
.kv_tap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(19% + env(safe-area-inset-bottom));
    color: #fff;
    font-family: var(--font-en);
    font-size: 13px;
    font-weight: 400;
    line-height: 25px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
}

.kv.is_ready .kv_tap {
    animation: kvDissolve 0.8s ease 1.8s forwards, kvBlink 1.6s ease-in-out 2.6s infinite;
}

@keyframes kvBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@keyframes kvDissolve {
    to { opacity: 1; }
}

/* 움직임 줄이기 설정 : 애니메이션 없이 바로 보여 준다 (눈은 effects.ts 에서 꺼진다) */
@media (prefers-reduced-motion: reduce) {
    .kv.is_ready .kv_bg,
    .kv.is_ready .kv_dim,
    .kv.is_ready .kv_title,
    .kv.is_ready .kv_tap {
        opacity: 1;
    }
}

/* START 는 React 에서 <button> 이라 전체 너비를 지정 */
.intro_cta .btn_red {
    width: 100%;
}

/* 중국어 · 일본어 : 띄어쓰기 없이 이어지는 문장이라 keep-all 이면 줄이 안 바뀌고 화면 밖으로 나간다 → 글자 단위로 줄바꿈 (금칙 처리는 strict) */
html[lang="zh-CN"] *,
html[lang="ja"] * {
    word-break: normal;
    line-break: strict;
}
