/* 구글 폰트에서 귀여운 '개구' 폰트 가져오기 */
@import url('https://fonts.googleapis.com/css2?family=Gaegu:wght@400;700&display=swap');

* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #fff9f0; /* 따뜻하고 편안한 아이보리색 배경 */
    font-family: 'Gaegu', cursive;
    touch-action: none; /* 브라우저 기본 제스처 방지 */
}

/* 설정 화면 (시작 전 화면) */
#setup-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* 배경을 어둡게 처리하여 집중에 도움 */
    z-index: 300;
    display: flex;
    justify-content: center;
    align-items: center;
}

.setup-card {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 40px;
    border: 8px solid #ffc2d1;
    box-shadow: 0 10px 0 #ffc2d1;
    max-width: 90%;
}

h1 {
    color: #ff85a2;
    font-size: 3.5rem;
    margin: 0 0 20px 0;
}

.setting-item {
    margin-bottom: 30px;
}

label {
    display: block;
    font-size: 2rem;
    color: #333;
    margin-bottom: 15px;
}

/* 속도 조절 슬라이더 스타일 */
input[type="range"] {
    width: 100%;
    max-width: 300px;
    height: 15px;
    cursor: pointer;
}

.speed-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 300px;
    margin: 5px auto;
    color: #888;
    font-size: 1.2rem;
}

/* 시작 버튼 */
#start-btn {
    padding: 15px 50px;
    border-radius: 50px;
    border: none;
    background: #ff85a2;
    color: white;
    font-size: 2.5rem;
    font-family: 'Gaegu';
    cursor: pointer;
    box-shadow: 0 6px 0 #d46a85;
    transition: transform 0.1s;
}

#start-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #d46a85;
}

/* 게임 플레이 영역 */
#game-area {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 상단 점수 표시 바 */
/* 상단 바 전체 컨테이너 수정 */
#status-bar {
    position: absolute;
    top: 15px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center; /* 가운데로 모으기 */
    align-items: center;
    gap: 10px;               /* 요소 사이 간격 */
    padding: 0 10px;
    z-index: 100;
    pointer-events: none;    /* 빈 공간 클릭 통과 */
}

/* 홈 버튼: 크기를 고정하여 찌그러짐 방지 */
.home-btn { 
    text-decoration: none;
    font-size: 1.5rem;
    background: white; 
    width: 50px; 
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    border: 3px solid #ddd;
    pointer-events: auto;
    flex-shrink: 0;          /* 크기 고정 */
}

/* 정보 박스 공통: 화면 크기에 따라 유연하게 조절 */
.info-item {
    background: white;
    padding: 5px 15px;
    border-radius: 25px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;     /* 글자 줄바꿈 방지 */
    box-shadow: 0 4px 0 rgba(0,0,0,0.05);
}

.timer-box { border: 4px solid #81d4fa; color: #0288d1; }
.score-box { border: 4px solid #ffc2d1; color: #ff85a2; }

/* 📱 모바일 화면을 위한 작은 폰트 설정 */
@media (max-width: 450px) {
    .info-item { font-size: 1.2rem; padding: 5px 10px; }
    .home-btn { width: 45px; height: 45px; font-size: 1.2rem; }
    #status-bar { gap: 5px; }
}

/* 타이머 테두리 색상 (파랑) */
#timer-display {
    border: 4px solid #81d4fa;
    color: #0288d1;
}

/* 점수판 테두리 색상 (분홍) */
#score-display {
    border: 4px solid #ffc2d1;
    color: #ff85a2;
}

/* 풍선 기본 디자인 */
.balloon {
    position: absolute;
    cursor: pointer;
    border-radius: 50% 50% 50% 50% / 45% 45% 55% 55%;
    box-shadow: inset -10px -10px rgba(0,0,0,0.1); /* 입체감 */
    z-index: 50; /* 캔버스보다 위 */
    pointer-events: auto;
}

/* 아래쪽 풍선 꼬리(매듭) 표현 */
.balloon::after {
    content: "▲";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 15px;
    color: inherit;
    filter: brightness(0.9);
}

/* 꽃가루 효과용 캔버스 */
#particleCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* 풍선 클릭을 방해하지 않음 */
    z-index: 40; /* 풍선보다는 아래 */
}

/* 타이머 스타일 */
#timer-display {
    font-size: 2.2rem; background: white; padding: 5px 25px;
    border-radius: 30px; border: 4px solid #81d4fa; color: #0288d1;
}

/* 결과창 스타일 */
#result-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); z-index: 500;
    display: flex; justify-content: center; align-items: center;
}
.hidden { display: none !important; }

.result-card {
    background: white; padding: 50px; border-radius: 50px;
    border: 10px solid #ffd6a5; text-align: center;
}
.result-card h2 { font-size: 4rem; color: #ff85a2; margin: 0; }
.final-score { font-size: 2.5rem; margin: 30px 0; color: #333; }
.result-card button {
    padding: 15px 40px; font-size: 2rem; font-family: 'Gaegu';
    background: #caffbf; border: none; border-radius: 30px;
    cursor: pointer; box-shadow: 0 6px 0 #95d5a2;
}