* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Orbit', sans-serif;
    user-select: none;
    /* 드래그 방지 */
}

body {
    background: radial-gradient(circle at center, #2a2a35, #101014);
    color: white;
    height: 100vh;
    overflow: hidden;
    transition: background 0.5s ease;
}

/* 프리미엄 우주 테마 */
body.cosmic-theme {
    background: linear-gradient(to bottom, #ff1493 0%, #4a0e4e 30%, #1a0b2e 70%, #0b0f1c 100%);
    background-size: 100% 300%;
    animation: bgGalactic 30s ease-in-out infinite alternate;
}

@keyframes bgGalactic {
    0% {
        background-position: 0% 100%;
    }

    100% {
        background-position: 0% 0%;
    }
}

body.cosmic-theme::before,
body.cosmic-theme::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

body.cosmic-theme::before {
    background-image:
        radial-gradient(3px 3px at 20px 30px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(4px 4px at 40px 70px, #ffccff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 50px 160px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(3px 3px at 90px 40px, #ccffff, rgba(0, 0, 0, 0)),
        radial-gradient(5px 5px at 130px 80px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 160px 120px, #ffddff, rgba(0, 0, 0, 0));
    background-repeat: repeat;
    background-size: 250px 250px;
    animation: starScrollDown 40s linear infinite, twinkle 3s infinite alternate;
    opacity: 0.9;
}

body.cosmic-theme::after {
    background-image:
        radial-gradient(2.5px 2.5px at 100px 150px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 20px 200px, #ffccff, rgba(0, 0, 0, 0)),
        radial-gradient(4px 4px at 180px 50px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(3px 3px at 250px 250px, #ccffff, rgba(0, 0, 0, 0));
    background-repeat: repeat;
    background-size: 350px 350px;
    animation: starScrollDown 25s linear infinite, twinkle 4s infinite alternate-reverse;
    opacity: 0.7;
}

@keyframes starScrollDown {
    0% {
        background-position: 0px 0px;
    }

    100% {
        background-position: 0px 1000px;
    }
}

@keyframes twinkle {
    0% {
        opacity: 0.2;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* 텍스트 가독성 확보를 위한 검은색 짙은 그림자 */
body.cosmic-theme h1,
body.cosmic-theme h2,
body.cosmic-theme p,
body.cosmic-theme span,
body.cosmic-theme button {
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 1), 0 0 10px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 0, 0, 0.5);
}

/* 신비로운 네온 텍스트 효과 (우주 테마 시 타이틀) */
body.cosmic-theme h1,
body.cosmic-theme h2 {
    color: #fff;
    text-shadow:
        2px 2px 5px #000,
        0 0 10px #ff3366,
        0 0 20px #ff3366,
        0 0 40px #ff1493,
        0 0 80px #ff1493;
}

/* 상점 버튼 황금빛 아우라 & 입체 효과 */
#item-shop-container .buy-btn {
    position: relative;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    border: 2px solid #fff;
    box-shadow: 0 0 15px #ffd700, 0 0 30px #ff8c00, inset 0 0 10px rgba(255, 255, 255, 0.6);
    color: #fff;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

#item-shop-container .buy-btn:hover {
    transform: translateY(-8px) scale(1.1) rotateX(15deg);
    box-shadow: 0 15px 25px rgba(255, 140, 0, 0.8), 0 0 40px #ffd700, inset 0 0 15px rgba(255, 255, 255, 0.8);
    cursor: pointer;
}

#item-shop-container .buy-btn:active {
    transform: translateY(2px) scale(0.95) rotateX(0deg);
}

/* 한국인 전용 송금 버튼 스타일 (카카오/토스) */
.korea-pay-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.korea-pay-btn.kakao {
    background-color: #FEE500;
    color: #191919;
    border: 1px solid #FEE500;
}

.korea-pay-btn.toss {
    background-color: #3182F6;
    color: #ffffff;
    border: 1px solid #3182F6;
}

.korea-pay-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.korea-pay-btn:active {
    transform: translateY(1px);
    filter: brightness(0.9);
}

/* 황금빛 펄스 애니메이션 (아우라) */
#item-shop-container .buy-btn::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    bottom: -5px;
    left: -5px;
    background: linear-gradient(45deg, #ffd700, #ff8c00, #ffcc00, #ffd700);
    background-size: 400%;
    z-index: -1;
    border-radius: 40px;
    filter: blur(8px);
    opacity: 0.7;
    animation: goldenAura 3s linear infinite;
}

@keyframes goldenAura {
    0% {
        background-position: 0 0;
    }

    50% {
        background-position: 100% 0;
    }

    100% {
        background-position: 0 0;
    }
}

/* 우주 테마 이모티콘: 잔상(trail) 효과 및 위로 떠오르는 관성 */
body.cosmic-theme .target {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, cosmicFloat 4s linear infinite;
    filter: drop-shadow(0 15px 5px rgba(255, 51, 204, 0.4)) drop-shadow(0 30px 10px rgba(255, 51, 204, 0.2)) drop-shadow(0 45px 15px rgba(255, 51, 204, 0.05));
}

body.cosmic-theme .target:hover {
    transform: scale(1.3);
}

@keyframes cosmicFloat {
    0% {
        transform: translateY(0) rotate(-5deg);
    }

    100% {
        transform: translateY(-150px) rotate(10deg);
    }
}

#game-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.screen.active {
    display: flex;
}

/* 글래스모피즘 UI 및 버튼 */
h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 51, 102, 0.8), 0 0 20px rgba(255, 51, 102, 0.5);
}

h2 {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #ff3366;
    text-shadow: 0 0 15px rgba(255, 51, 102, 0.8);
}

p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: #cccccc;
}

button {
    padding: 15px 40px;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

button:hover {
    background: rgba(255, 51, 102, 0.4);
    border-color: rgba(255, 51, 102, 0.8);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.6);
}

button:active {
    transform: translateY(1px) scale(0.95);
}

/* 플레이 화면 UI */
#ui-bar {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    z-index: 10;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 30px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* 타겟 영역 및 타겟 스타일 */
#target-area {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: crosshair;
    /* 십자선 커서로 슈팅 느낌 추가 */
}

.target {
    position: absolute;
    font-size: 4rem;
    cursor: pointer;
    transform-origin: center;
    transition: transform 0.1s;
    user-select: none;
    -webkit-user-drag: none;
    /* 약간의 떨림 애니메이션으로 짜증나는 느낌 및 팝 인 애니메이션 추가 */
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, shakeTarget 0.5s infinite alternate;
}

.target:hover {
    transform: scale(1.2);
}

/* 애니메이션 */
@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shakeTarget {
    0% {
        transform: rotate(-5deg);
    }

    100% {
        transform: rotate(5deg);
    }
}

/* 화면 전체 흔들림 (타격감) */
@keyframes screenShake {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(5px, 5px) rotate(1deg);
    }

    50% {
        transform: translate(-5px, -5px) rotate(-1deg);
    }

    75% {
        transform: translate(5px, -5px) rotate(1deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

.shake {
    animation: screenShake 0.15s ease-in-out;
}

/* 파티클 이펙트 */
.particle {
    position: absolute;
    font-size: 1.5rem;
    pointer-events: none;
    animation: explode 0.6s ease-out forwards;
}

@keyframes explode {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(var(--rot));
        opacity: 0;
    }
}