/* 메뉴 화면(메인·혼자하기·친구와하기) 분위기 효과 (햇살, 꽃잎, 반짝임, 찻잔 김, 숨쉬기, 인물·고양이 동작, 로고 움직임). 요소는 main_fx.js 가 만든다. */
/* .main_fx 안의 길이 단위 em 은 배경 그림 가로의 1% 이다 (main_fx.js 가 글자 크기로 맞춘다). */
/* 움직임은 위치(transform)와 투명도만 바꿔 저사양 폰에서도 가볍다. */

.main_fx {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    font-size: 4px;
}
.main_fx div {
    position: absolute;
}
.main_fx.is_paused div {
    -webkit-animation-play-state: paused;
    animation-play-state: paused;
}

/* 햇살: 왼쪽 위에서 비치는 따뜻한 빛이 천천히 밝아졌다 어두워진다. */
.main_fx_sun {
    left: -25%;
    top: -10%;
    width: 110%;
    height: 50%;
    background: radial-gradient(ellipse at 30% 25%, rgba(255, 246, 205, 0.34) 0%, rgba(255, 246, 205, 0.12) 40%, rgba(255, 246, 205, 0) 68%);
    animation: main_fx_sun 7s ease-in-out infinite alternate;
}
@keyframes main_fx_sun {
    from { opacity: 0.25; }
    to   { opacity: 1; }
}

/* 고양이 숨쉬기: 몸통 조각이 바닥을 기준으로 위아래로 살짝 부푼다. 가장자리는 투명하게 녹여 경계가 보이지 않게 한다. */
.main_fx_breath {
    background-repeat: no-repeat;
    -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 60%, rgba(0, 0, 0, 0) 100%);
    mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 60%, rgba(0, 0, 0, 0) 100%);
    -webkit-transform-origin: 50% 100%;
    transform-origin: 50% 100%;
    animation: main_fx_breath 3.4s ease-in-out infinite alternate;
    will-change: transform;
}
@keyframes main_fx_breath {
    from { transform: scale(1, 1); }
    to   { transform: scale(1.008, 1.03); }
}

/* 인물·고양이 동작 그림: 얼굴 위에 얹는 한 줄짜리 스프라이트. 어느 칸을 보일지는 main_fx.js 가 정한다. */
.main_fx_actor {
    background-repeat: no-repeat;
    opacity: 0;
}

/* 잠잘 때 떠오르는 z 글자. 깨어 있는 동안(.is_hidden)은 숨긴다. */
.main_fx_zzz {
    width: 0;
    height: 0;
    transition: opacity 0.25s;
}
.main_fx_zzz.is_hidden {
    opacity: 0;
}
.main_fx_z {
    left: 0;
    top: 0;
    font-family: 'NanumGothicBold', sans-serif;
    font-size: 3.4em;
    font-weight: bold;
    line-height: 1;
    color: #fff;
    text-shadow: 0 0 0.25em rgba(70, 40, 15, 0.95), 0 0.06em 0.12em rgba(70, 40, 15, 0.9);
    opacity: 0;
    animation: main_fx_z 4.8s ease-out infinite;
}
.main_fx_z_2 { animation-delay: 1.6s; }
.main_fx_z_3 { animation-delay: 3.2s; }
@keyframes main_fx_z {
    0%   { opacity: 0;    transform: translate(0, 0) scale(0.45) rotate(-10deg); }
    18%  { opacity: 0.95; }
    70%  { opacity: 0.7; }
    100% { opacity: 0;    transform: translate(1.5em, -2.4em) scale(1.2) rotate(12deg); }
}

/* 인물·고양이를 누르면 떠오르는 하트. */
.main_fx_heart {
    position: absolute;
    width: 6em;
    height: 6em;
    margin: -3em 0 0 -3em;
    opacity: 0;
    animation: main_fx_heart 1.3s ease-out forwards;
}
@keyframes main_fx_heart {
    0%   { opacity: 0; transform: translateY(0) scale(0.3); }
    18%  { opacity: 1; transform: translateY(-2em) scale(1.15); }
    35%  { opacity: 1; transform: translateY(-4em) scale(1); }
    100% { opacity: 0; transform: translateY(-11em) scale(0.9); }
}

/* 반짝임: 네 갈래 별 모양 빛이 잠깐 커졌다 사라진다. */
.main_fx_glint {
    width: 4.4em;
    height: 4.4em;
    margin: -2.2em 0 0 -2.2em;
    background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0.85) 16%, rgba(255, 255, 255, 0) 62%);
    -webkit-clip-path: polygon(50% 0, 55% 45%, 100% 50%, 55% 55%, 50% 100%, 45% 55%, 0 50%, 45% 45%);
    clip-path: polygon(50% 0, 55% 45%, 100% 50%, 55% 55%, 50% 100%, 45% 55%, 0 50%, 45% 45%);
    opacity: 0;
    animation: main_fx_glint 9s ease-in-out infinite;
}
@keyframes main_fx_glint {
    0%   { opacity: 0; transform: scale(0.2) rotate(0deg); }
    5%   { opacity: 1; transform: scale(1) rotate(25deg); }
    10%  { opacity: 0; transform: scale(0.2) rotate(50deg); }
    100% { opacity: 0; transform: scale(0.2) rotate(50deg); }
}

/* 찻잔 김: 차 표면 위에 놓는 작은 캔버스. 크기와 위치, 그리기는 main_fx.js 가 맡는다. */
.main_fx_steam {
    position: absolute;
}

/* 꽃잎: 바깥 요소가 위에서 아래로 떨어지고(한 바퀴의 60%), 안쪽 요소가 좌우로 흔들리며 돈다. */
.main_fx_petal {
    top: -3%;
    opacity: 0;
    animation: main_fx_fall 20s linear infinite;
    will-change: transform, opacity;
}
.main_fx_petal_in {
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 85% 12% 85% 12%;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 70%);
    box-shadow: 0 0.2em 0.5em rgba(90, 50, 20, 0.18);
    animation: main_fx_sway 3s ease-in-out infinite alternate;
}
@keyframes main_fx_fall {
    0%   { opacity: 0;    transform: translateY(0); }
    3%   { opacity: 0.95; }
    54%  { opacity: 0.95; }
    60%  { opacity: 0;    transform: translateY(190em); }
    100% { opacity: 0;    transform: translateY(190em); }
}
@keyframes main_fx_sway {
    from { transform: translateX(-5em) rotate(-50deg); }
    to   { transform: translateX(5em) rotate(70deg); }
}

/* 로고: 천천히 떠 있는 듯 오르내리고, 가끔 빛이 한 줄기 지나간다 (빛은 로고 그림 모양 안에서만 보인다). */
.main_logo_box {
    left: 105px;
    top: 132px;
    width: 510px;
    height: 340px;
    animation: main_fx_float 4.6s ease-in-out infinite alternate;
    will-change: transform;
}
.main_logo_box .main_logo {
    left: 0;
    top: 0;
}
.main_logo_shine {
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}
.main_logo_shine_bar {
    left: -45%;
    top: -10%;
    width: 24%;
    height: 120%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
    animation: main_fx_shine 7s ease-in-out infinite;
}
@keyframes main_fx_float {
    from { transform: translateY(0); }
    to   { transform: translateY(-8px); }
}
@keyframes main_fx_shine {
    0%   { transform: translateX(0) skewX(-20deg); }
    72%  { transform: translateX(0) skewX(-20deg); }
    100% { transform: translateX(700%) skewX(-20deg); }
}

/* 움직임을 줄이도록 설정한 기기에서는 효과를 쉬게 한다. */
@media (prefers-reduced-motion: reduce) {
    .main_fx { display: none; }
    .main_logo_box,
    .main_logo_shine_bar { animation: none; }
}
