/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fredoka', 'Quicksand', 'Arial', sans-serif;
    background: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 50%, #FECFEF 100%);
    min-height: 100vh;
    color: #333;
    position: relative;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* 메인 페이지용 스타일 */
body.main-page {
    display: block;
    text-align: left;
}

/* 게임 페이지용 스타일 */
body.game-page {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* 배경 장식 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 182, 193, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 218, 185, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(221, 160, 221, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

#gameContainer {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(255, 107, 157, 0.2);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 화면 전환 */
.screen {
    padding: 30px;
    text-align: center;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
}

.screen.hidden {
    display: none;
}

/* 시작 화면 */
.title h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    background: linear-gradient(45deg, #FF6B9D, #FFB6C1, #FF69B4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: bounce 2s infinite;
}

.title p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* 귀여운 버블 장식 */
.cute-decoration {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.cute-decoration .bubble {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}

.cute-decoration .bubble:nth-child(1) { animation-delay: 0s; }
.cute-decoration .bubble:nth-child(2) { animation-delay: 0.5s; }
.cute-decoration .bubble:nth-child(3) { animation-delay: 1s; }

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.stats {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #FFE5F1, #FFF0F5);
    border-radius: 20px;
    width: 100%;
    border: 2px solid rgba(255, 107, 157, 0.2);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.1);
}

.stats p {
    margin: 8px 0;
    font-weight: bold;
    color: #FF6B9D;
    font-size: 1.1rem;
}

/* 버튼 스타일 */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    min-width: 150px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn.primary {
    background: linear-gradient(45deg, #FF6B9D, #FFB6C1);
    color: white;
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn.primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.6);
}

.btn.secondary {
    background: linear-gradient(45deg, #FFF0F5, #FFE5F1);
    color: #FF6B9D;
    border: 2px solid #FF6B9D;
}

.btn.secondary:hover {
    background: linear-gradient(45deg, #FF6B9D, #FFB6C1);
    color: white;
    transform: translateY(-3px) scale(1.05);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 게임 방법 화면 */
.instructions {
    margin: 30px 0;
    text-align: left;
}

.instruction-item {
    display: flex;
    align-items: center;
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #FFF0F5, #FFE5F1);
    border-radius: 15px;
    border-left: 4px solid #FF6B9D;
    box-shadow: 0 3px 10px rgba(255, 107, 157, 0.1);
    transition: transform 0.3s ease;
}

.instruction-item:hover {
    transform: translateX(5px);
}

.instruction-item .icon {
    font-size: 1.8rem;
    margin-right: 15px;
    min-width: 30px;
}

.instruction-item p {
    margin: 0;
    font-size: 1rem;
    color: #666;
}

/* 게임 화면 */
.game-header {
    background: linear-gradient(45deg, #FF6B9D, #FFB6C1);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-radius: 0 0 20px 20px;
}

.game-info {
    display: flex;
    gap: 20px;
    font-weight: bold;
}

.target-display {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    flex-grow: 1;
}

#targetNumber {
    background: rgba(255, 255, 255, 0.3);
    padding: 8px 18px;
    border-radius: 25px;
    margin: 0 5px;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

#gameCanvas {
    display: block;
    margin: 0 auto;
    background: linear-gradient(to bottom, #E0F7FA, #F3E5F5);
    border: 3px solid #FF6B9D;
    border-radius: 15px;
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.2);
}

.game-controls {
    padding: 20px;
    background: linear-gradient(135deg, #FFF0F5, #FFE5F1);
    border-radius: 0 0 20px 20px;
}

.selected-bubbles, .calculation {
    margin: 10px 0;
    padding: 12px;
    background: white;
    border-radius: 12px;
    border: 2px solid rgba(255, 107, 157, 0.2);
    box-shadow: 0 3px 10px rgba(255, 107, 157, 0.1);
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

#pauseBtn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    font-size: 0.9rem;
    background: rgba(255, 107, 157, 0.9);
    color: white;
    border: none;
    border-radius: 20px;
}

/* 게임 오버 화면 */
.final-score {
    background: linear-gradient(135deg, #FFF0F5, #FFE5F1);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    width: 100%;
    border: 2px solid rgba(255, 107, 157, 0.2);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.1);
}

.final-score p {
    font-size: 1.2rem;
    margin: 10px 0;
    font-weight: bold;
    color: #FF6B9D;
}

.share-section, .ad-section {
    margin: 20px 0;
    width: 100%;
}

/* 애니메이션 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.screen {
    animation: fadeIn 0.5s ease;
}

.btn:hover {
    animation: pulse 0.3s ease;
}

/* AdSense 컨테이너 */
.ads-container {
    margin: 20px auto;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* 반응형 디자인 */
@media (max-width: 600px) {
    #gameContainer {
        margin: 10px;
        border-radius: 20px;
    }
    
    .screen {
        padding: 20px;
        min-height: 500px;
    }
    
    .title h1 {
        font-size: 2.2rem;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .game-info {
        justify-content: center;
        gap: 15px;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 1rem;
        min-width: 120px;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
        max-width: 400px;
    }
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    #gameContainer {
        background: rgba(44, 62, 80, 0.95);
        color: white;
    }
    
    .stats, .instructions .instruction-item, .game-controls {
        background: rgba(52, 73, 94, 0.8);
        color: white;
    }
    
    .btn.secondary {
        background: rgba(52, 73, 94, 0.8);
        color: #FF6B9D;
        border-color: #FF6B9D;
    }
    
    .selected-bubbles, .calculation {
        background: rgba(52, 73, 94, 0.8);
        border-color: #555;
        color: white;
    }
}

body.has-header #gameContainer {
    margin-top: 64px !important;
}
@media (max-width: 600px) {
    body.has-header #gameContainer {
        margin-top: 58px !important;
    }
}
#globalHeader, #langSwitchBtn, #langModal h3, #langModal .langSelectBtn {
    font-family: 'Fredoka', 'Quicksand', 'Comic Neue', 'Gmarket Sans', 'UhBee Se_hyun', cursive, sans-serif !important;
} 