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

/* 기본 스타일 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0d2113 0%, #1c611c 50%, #F0E68C 100%);
    min-height: 100vh;
    overflow: hidden;
    user-select: none;
}

/* 게임 컨테이너 */
.game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 게임 타이틀 */
.game-title {
    position: absolute;
    top: 20px;
    z-index: 100;
    text-align: center;
    color: #2F4F2F;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.game-title h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

.game-title p {
    font-size: 1.2rem;
    font-weight: bold;
}

/* 게임 영역 */
.game-area {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 알레시 스타일 레몬 스퀴지 */
.lemon-squeezer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    width: 500px;
    height: 500px;
}

.squeezer-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0;
    z-index: 45;
    position: relative;
}

.squeezer-handle {
    width: 100px;
    height: 25px;
    background: linear-gradient(135deg, #d7b5b5, #c5b1b1);
    border-radius: 15px;
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 6px 12px rgba(211, 186, 186, 0.4);
    transition: transform 0.1s ease;
    border: 3px solid #f1eadf;
    z-index: 55;
    opacity: 0.8;
}

.squeezer-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 8px;
    background: linear-gradient(90deg, #f7afb5, #d2b2b2);
    border-radius: 4px;
}

.squeezer-base {
    width: 140px;
    height: 100px;
    background: linear-gradient(135deg, #FFD93D, #FFA502);
    border-radius: 70px 70px 25px 25px;
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 8px 16px rgba(255, 217, 61, 0.4);
    border: 4px solid #FF9500;
    z-index: 55;
    opacity: 0.8;
}

.squeezer-base::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 60px;
    background: linear-gradient(135deg, #FFE066, #FFB84D);
    border-radius: 50px 50px 20px 20px;
    border: 2px solid #FF8C00;
}

.squeezer-base::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 15px;
    background: linear-gradient(90deg, #FF8C00, #FFA500);
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.squeezer-handle.pressed {
    transform: translateX(-50%) translateY(20px);
}

/* 레몬 */
.lemon {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200%;
    height: 200px;
    z-index: 40;
    transition: all 0.3s ease;
    cursor: pointer;
}

.lemon-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.lemon.squeezed {
    transform: translate(-50%, -50%) scale(0.8) translateY(10px);
    opacity: 0.8;
}

.lemon.falling {
    animation: fallDown 2s ease-in forwards;
}

/* 레몬즙 방울 */
.juice-drops {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 60; /* 스퀴지보다 앞에 표시 */
}

.juice-drop {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #FFFACD, #FFD700);
    border-radius: 50%;
    animation: dropDown 1.5s ease-in forwards;
    box-shadow: 0 0 8px rgba(255, 255, 0, 0.8);
    z-index: 60; /* 스퀴지보다 앞에 표시 */
}

.juice-drop .score-text {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffe241;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    pointer-events: none;
}

/* 땅 (머리카락) */
.ground {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to top, #DEB887, #DEB887);
    z-index: 80;
    transition: transform 0.5s ease, height 1.2s ease-in-out;
}

.ground.rising {
    transform: translateY(-50px);
}

/* 엔딩: 땅이 줄어들며 얼굴이 드러난다 */
.ground.shrink {
    height: 40px; /* 점점 작아져서 위로 사라지듯 */
}

/* 사람 얼굴 */
.person {
    position: absolute;
    bottom: -300px; /* 처음에는 화면 아래에 숨김 */
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 300px;
    z-index: 70; /* 초기에는 땅 아래에 있도록 */
    transition: bottom 2s ease-out;
}

.person.rising {
    bottom: calc(50% - 150px); /* 세로 중앙 정렬 (컨테이너 높이 300px 기준) */
}

.person-face {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 150px;
    background: linear-gradient(135deg, #FDBCB4, #F4A460);
    border-radius: 60px 60px 40px 40px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.person-eyes {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 20px;
    display: flex;
    justify-content: space-between;
}

.eye {
    width: 15px;
    height: 15px;
    background: #000;
    border-radius: 50%;
    position: relative;
}

.eye::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
}

.person-nose {
    position: absolute;
    top: 65px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 12px;
    background: #E6A085;
    border-radius: 4px;
}

.person-mouth {
    position: absolute;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 10px;
    background: #8B0000;
    border-radius: 0 0 20px 20px;
}

.person-hair {
    position: absolute;
    bottom: calc(100px - 10px); /* 얼굴 높이(150px) 기준으로 약간 겹치게 */
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 80px;
    background: #000;
    border-radius: 70px 70px 0 0;
    overflow: hidden;
}

.person-hair::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 60px;
    background: linear-gradient(to bottom, #000, #333);
    border-radius: 50px 50px 0 0;
}

/* 머리카락 가닥들 */
.hair-strands {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hair-strand {
    position: absolute;
    background: linear-gradient(to bottom, #000000, #000000);
    border-radius: 2px;
    animation: hairGrow 3s ease-out forwards;
    opacity: 0;
}

/* 식물들 */
.plants {
    position: absolute;
    top: -50px;
    left: 0;
    width: 100%;
    height: 50px;
    overflow: hidden;
}

.plant {
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 0;
    background: linear-gradient(to top, #228B22, #32CD32);
    border-radius: 5px 5px 0 0;
    animation: plantGrow 2s ease-out forwards;
    opacity: 0;
}

.plant::before {
    content: '🌱';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
}

/* 점수 표시 (방울에 표시) */
.score-display {
    display: none; /* 기존 점수 표시 숨김 */
}

/* 게임 상태 */
.game-status {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 30px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 100;
}

.progress-bar {
    width: 200px;
    height: 10px;
    background: #E0E0E0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 5px;
}

.status-text {
    text-align: center;
    font-weight: bold;
    color: #2F4F2F;
    font-size: 1rem;
}

/* 효과음 컨트롤 */
.sound-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.sound-controls button {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.sound-controls button:hover {
    transform: scale(1.1);
}

/* 애니메이션 */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes fallDown {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, calc(-50% + 300px)) scale(0.3);
        opacity: 0;
    }
}

@keyframes dropDown {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(400px);
        opacity: 0;
    }
}

@keyframes hairGrow {
    0% {
        height: 0;
        opacity: 0;
    }
    100% {
        height: 100px;
        opacity: 1;
    }
}

@keyframes plantGrow {
    0% {
        height: 0;
        opacity: 0;
    }
    100% {
        height: 40px;
        opacity: 1;
    }
}

@keyframes scorePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .game-title h1 {
        font-size: 2rem;
    }
    
    .score-display {
        right: 15px;
        padding: 15px;
    }
    
    .score-number {
        font-size: 2.5rem;
    }
    
    .lemon-squeezer {
        width: 180px;
        height: 180px;
    }
    
    .squeezer-handle {
        width: 80px;
        height: 20px;
    }
    
    .squeezer-base {
        width: 110px;
        height: 80px;
    }
    
    .squeezer-base::before {
        width: 80px;
        height: 50px;
    }
    
    .squeezer-base::after {
        width: 60px;
        height: 12px;
    }
    
    .lemon {
        width: 60px;
        height: 60px;
    }
}