/* 결과 화면 이펙트. 그림 파일 없이 CSS 와 캔버스(javascript/module/result_fx.js)로만 그려 내려받을 것이 없다. */
/* 좌표는 게임 영역(720x1280) 기준이다. */

/* 뒤 화면을 어둡게 덮는다. 게임 영역 밖 여백까지 그림자로 넓힌다. */
.result_fx_dim {
    position: absolute;
    left: 0;
    top: 0;
    width: 720px;
    height: 1280px;
    background: rgba(24, 12, 0, 0.58);
    box-shadow: 0 0 0 2000px rgba(24, 12, 0, 0.58);
    animation: result_fx_fade 0.3s ease-out both;
}

/* 색종이·반짝이를 그리는 캔버스. 터치는 밑으로 통과시킨다. */
.result_fx_canvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 720px;
    height: 1280px;
    pointer-events: none;
}

/* 판이 튀어나오듯 나타난다 (승리·무승부) / 위에서 툭 떨어진다 (패배) */
.result_fx_pop {
    animation: result_fx_pop 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.result_fx_drop {
    animation: result_fx_drop 0.6s cubic-bezier(0.3, 1.25, 0.5, 1) both;
}

/* 아이콘 뒤에서 도는 빛살. conic-gradient 를 못 쓰는 브라우저는 둥근 빛만 보인다. */
.result_fx_rays {
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 214, 90, 0.8) 0%, rgba(255, 214, 90, 0) 68%);
    background: repeating-conic-gradient(from 0deg, rgba(255, 224, 110, 0.9) 0deg 9deg, rgba(255, 224, 110, 0) 9deg 20deg);
    -webkit-mask-image: radial-gradient(circle, #000 0%, #000 18%, rgba(0, 0, 0, 0) 68%);
    mask-image: radial-gradient(circle, #000 0%, #000 18%, rgba(0, 0, 0, 0) 68%);
    animation: result_fx_fade 0.6s ease-out 0.2s both, result_fx_spin 16s linear infinite;
}

/* 아이콘 뒤 둥근 빛. 숨 쉬듯 커졌다 작아진다. 색은 kind 별로 바꾼다. */
.result_fx_glow {
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 236, 150, 0.95) 0%, rgba(255, 200, 60, 0.45) 38%, rgba(255, 200, 60, 0) 70%);
    animation: result_fx_pulse 1.8s ease-in-out infinite;
}
.result_fx_glow.is_lose {
    background: radial-gradient(circle, rgba(170, 195, 230, 0.75) 0%, rgba(120, 150, 200, 0.3) 40%, rgba(120, 150, 200, 0) 70%);
    animation-duration: 3s;
}
.result_fx_glow.is_draw {
    background: radial-gradient(circle, rgba(255, 244, 205, 0.95) 0%, rgba(215, 185, 127, 0.4) 40%, rgba(215, 185, 127, 0) 70%);
    animation-duration: 2.4s;
}

/* 결과 아이콘. 튀어나온 뒤 둥실둥실 떠 있는다 (승리) / 좌우로 흔들린다 (패배) / 두근거린다 (무승부) */
.result_fx_icon {
    pointer-events: none;
    animation: result_fx_icon_in 0.7s cubic-bezier(0.2, 1.7, 0.4, 1) 0.12s both, result_fx_float 2.2s ease-in-out 0.85s infinite;
}
.result_fx_icon.is_lose {
    animation: result_fx_icon_fall 0.7s cubic-bezier(0.3, 1.3, 0.5, 1) 0.12s both, result_fx_sway 2.8s ease-in-out 0.85s infinite;
}
.result_fx_icon.is_draw {
    animation: result_fx_icon_in 0.7s cubic-bezier(0.2, 1.7, 0.4, 1) 0.12s both, result_fx_beat 1.6s ease-in-out 0.85s infinite;
}

/* 결과 제목 글자 */
.result_fx_title {
    pointer-events: none;
    animation: result_fx_title_in 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) 0.32s both;
}
.result_fx_title.is_win {
    color: #ff9d1c;
    -webkit-text-stroke: 2px #8a3b00;
    text-shadow: 0 5px 0 #8a3b00, 0 0 22px rgba(255, 205, 70, 0.95);
    animation: result_fx_title_in 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) 0.32s both, result_fx_title_glow 1.6s ease-in-out 0.9s infinite;
}
.result_fx_title.is_lose {
    color: #7d8ba0;
    -webkit-text-stroke: 2px #39465a;
    text-shadow: 0 4px 0 #39465a;
}
.result_fx_title.is_draw {
    color: #b98a3c;
    -webkit-text-stroke: 2px #5a3a10;
    text-shadow: 0 4px 0 #5a3a10;
}

/* 아래 칸들이 차례로 올라온다 */
.result_fx_rise1 {
    animation: result_fx_rise 0.45s ease-out 0.45s both;
}
.result_fx_rise2 {
    animation: result_fx_rise 0.45s ease-out 0.58s both;
}
.result_fx_rise3 {
    animation: result_fx_rise 0.45s ease-out 0.71s both;
}

/* 경험치 막대. 너비는 result_fx.js 가 0 에서 목표까지 늘리고, 그 위로 빛이 지나간다. */
.result_fx_bar {
    transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
    background-image: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.75) 50%, rgba(255, 255, 255, 0) 70%), linear-gradient(#ffe487, #f3a826);
    background-size: 200% 100%, 100% 100%;
    background-repeat: no-repeat;
    animation: result_fx_shine 1.8s linear 1.2s infinite;
}

/* 숫자가 올라가는 동안 통통 튄다 */
.result_fx_count {
    animation: result_fx_count 0.5s ease-out 1;
}

/* 급수 상승·하락 표시 */
.result_fx_level {
    transform-origin: 30px 50%;
    animation: result_fx_beat 1s ease-in-out infinite;
}

@keyframes result_fx_fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes result_fx_pop {
    0% { opacity: 0; transform: scale(0.55); }
    60% { opacity: 1; }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes result_fx_drop {
    0% { opacity: 0; transform: translateY(-160px) rotate(-3deg); }
    60% { opacity: 1; transform: translateY(8px) rotate(1deg); }
    100% { opacity: 1; transform: translateY(0) rotate(0deg); }
}
@keyframes result_fx_spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes result_fx_pulse {
    0%, 100% { transform: scale(0.88); opacity: 0.75; }
    50% { transform: scale(1.08); opacity: 1; }
}
@keyframes result_fx_icon_in {
    0% { opacity: 0; transform: scale(0.1) rotate(-25deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes result_fx_icon_fall {
    0% { opacity: 0; transform: translateY(-120px) rotate(18deg); }
    100% { opacity: 1; transform: translateY(0) rotate(0deg); }
}
@keyframes result_fx_float {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-12px) rotate(3deg); }
}
@keyframes result_fx_sway {
    0%, 100% { transform: rotate(-7deg); }
    50% { transform: rotate(7deg); }
}
@keyframes result_fx_beat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
@keyframes result_fx_title_in {
    0% { opacity: 0; transform: scale(2.2); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes result_fx_title_glow {
    0%, 100% { text-shadow: 0 5px 0 #8a3b00, 0 0 14px rgba(255, 205, 70, 0.7); }
    50% { text-shadow: 0 5px 0 #8a3b00, 0 0 34px rgba(255, 235, 130, 1); }
}
@keyframes result_fx_rise {
    0% { opacity: 0; transform: translateY(36px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes result_fx_shine {
    0% { background-position: 200% 0, 0 0; }
    60%, 100% { background-position: -100% 0, 0 0; }
}
@keyframes result_fx_count {
    0% { transform: scale(1); }
    40% { transform: scale(1.35); }
    100% { transform: scale(1); }
}
