* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }

body {
    font-family: 'Apple SD Gothic Neo', 'Pretendard', 'Malgun Gothic', sans-serif;
    background-color: #f4f7f6;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 100vh; min-height: 100dvh; 
    margin: 0; padding: 15px; touch-action: manipulation;
}

.game-container {
    background: white; padding: 25px 20px; border-radius: 24px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08); width: 100%; max-width: 420px;
    text-align: center; display: flex; flex-direction: column; position: relative;
}

h1 { margin: 0 0 15px; font-size: 22px; color: #2c3e50; }
p { margin: 5px 0; color: #666; font-size: 15px; line-height: 1.5; }

.header-info {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 16px; font-weight: bold; margin-bottom: 15px;
}

#settings-btn {
    background: none; border: none; font-size: 24px; cursor: pointer; 
    padding: 0; display: flex; align-items: center; justify-content: center;
    transition: transform 0.1s ease;
}
#settings-btn:active { transform: scale(0.9); }
.start-settings-btn { position: absolute; top: 20px; left: 20px; }

/* 💡 나가기 버튼 스타일 */
.btn-exit {
    background: none; border: none; font-size: 22px; cursor: pointer;
    padding: 0; margin-left: 5px; display: flex; align-items: center; justify-content: center;
    transition: transform 0.1s ease;
}
.btn-exit:active { transform: scale(0.9); }

.volume-control { margin: 15px 0; text-align: left; padding: 0 5%; }
.volume-control label { display: block; font-weight: bold; margin-bottom: 8px; color: #34495e; font-size: 14px;}
.volume-control input[type="range"] { width: 100%; accent-color: #3498db; }

.score-text { color: #3498db; }
.lives-text { color: #e74c3c; font-size: 18px; letter-spacing: 2px;}
.progress-text { color: #8e44ad; }

.timer-bar {
    width: 100%; height: 8px; background-color: #ecf0f1;
    border-radius: 10px; margin-bottom: 25px; overflow: hidden;
}
.timer-fill { height: 100%; background-color: #2ecc71; width: 100%; transition: width 1s linear, background-color 0.3s; }

#char-container {
    width: 70px; height: 70px; margin: 0 auto 10px auto;
    animation: breathe 3s infinite ease-in-out; transform-origin: bottom center;
}
#cute-bull { width: 100%; height: 100%; }

.ticker-display { font-size: 42px; font-weight: 900; color: #2c3e50; margin: 0 0 25px 0; letter-spacing: 2px; }

.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }

button {
    background-color: #f8f9fa; color: #2c3e50; border: 2px solid #e9ecef;
    padding: 16px 10px; border-radius: 16px; font-size: 15px; font-weight: bold;
    cursor: pointer; transition: all 0.15s ease; min-height: 60px;
    display: flex; align-items: center; justify-content: center; line-height: 1.3;
}
button:active { transform: scale(0.96); background-color: #e9ecef; }
button:disabled { opacity: 0.8; cursor: not-allowed; }

.correct { background-color: #2ecc71 !important; color: white !important; border-color: #2ecc71 !important; }
.wrong { background-color: #e74c3c !important; color: white !important; border-color: #e74c3c !important; }

.action-btn { background-color: #2c3e50; color: white; border: none; font-size: 16px; box-shadow: 0 4px 15px rgba(44, 62, 80, 0.2); }
.action-btn:active { background-color: #1a252f; }
.mode-normal { background-color: #3498db; }
.mode-endless { background-color: #e67e22; }
.btn-sns { background-color: #f39c12; color: white; border: none;}
.btn-leaderboard { background-color: #9b59b6; color: white; border: none;}

.btn-credit {
    background: transparent; color: #95a5a6; border: none; box-shadow: none;
    font-size: 13px; text-decoration: underline; margin-top: 20px; padding: 10px;
    cursor: pointer; min-height: auto; width: 100%;
}
.modal-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center;
    border-radius: 24px; z-index: 50; flex-direction: column;
}
.modal-content {
    background: white; padding: 25px 20px; border-radius: 16px;
    width: 85%; box-shadow: 0 10px 30px rgba(0,0,0,0.2); text-align: center;
}
.modal-content h2 { margin-top: 0; color: #2c3e50; font-size: 20px; margin-bottom: 15px;}
.modal-content p { margin: 8px 0; font-size: 15px; color: #34495e; text-align: left; padding-left: 10%;}
.modal-content strong { color: #2c3e50; display: inline-block; width: 100px;}

#start-screen, #game-screen, #result-screen, #leaderboard-screen { display: none; }
#loading-screen { display: block; font-size: 16px; color: #7f8c8d; padding: 40px 0; }

.rank-list { list-style: none; padding: 0; margin: 20px 0; text-align: left; max-height: 200px; overflow-y: auto; }
.rank-list li { padding: 10px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; font-weight: bold;}
.rank-1 { color: #f1c40f; font-size: 18px; }
.rank-2 { color: #95a5a6; }
.rank-3 { color: #d35400; }

@keyframes breathe { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-4px) scaleY(1.03); } }
@keyframes blink { 0%, 80%, 100% { transform: scaleY(1); } 90% { transform: scaleY(0.1); } }
.eye { transform-origin: center; animation: blink 4s infinite linear; }
.char-correct { animation: bounce 0.6s ease-out !important; }
.char-wrong { animation: shake 0.6s ease-in-out !important; }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-15px); } 60% { transform: translateY(-7px); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
/* 하단 광고 영역 스타일 */
.ad-container {
    width: 100%;
    max-width: 420px;
    margin-top: 20px;
    text-align: center;
    min-height: 50px; /* 광고가 로드되기 전 레이아웃 덜컹거림 방지 */
}