/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

/* 主页样式 */
.home-screen {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: fadeIn 0.8s ease-out;
}

.game-logo h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #4a5568;
}

.game-logo h2 {
    font-size: 1.5em;
    color: #718096;
    margin-bottom: 30px;
}

.game-description {
    margin-bottom: 30px;
    color: #666;
    line-height: 1.6;
}

.start-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* 游戏页面样式 */
.game-screen {
    background: white;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: fadeIn 0.8s ease-out;
}

.game-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 15px;
    position: relative;
    z-index: 20;
}

.timer, .score {
    font-size: 1.1em;
    font-weight: bold;
    color: #4a5568;
}

.game-area {
    margin: 80px 0 40px 0;
    position: relative;
}

.boss-container {
    position: relative;
    display: inline-block;
    z-index: 10;
}

.boss-avatar {
    font-size: 6em;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-radius: 20px;
    background: #f8f9fa;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.boss-avatar:hover {
    transform: scale(1.05);
}

.boss-avatar:active {
    transform: scale(0.95);
}

.boss-face {
    margin-bottom: 10px;
}

.speech-bubble {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: normal;
    z-index: 15;
    max-width: 260px;
    min-width: 160px;
    text-align: center;
    line-height: 1.2;
    word-wrap: break-word;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #333;
}

.speech-bubble.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.game-instructions {
    color: #666;
    font-size: 0.9em;
}

/* 结果页面样式 */
.result-screen {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: fadeIn 0.8s ease-out;
}

.result-header h1 {
    color: #4a5568;
    margin-bottom: 30px;
}

.result-stats {
    margin-bottom: 30px;
}

.stat-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 15px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #4a5568;
}

.rank-display {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
}

.rank-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.rank-emoji {
    font-size: 3em;
    margin: 15px 0;
}

.rank-description {
    font-size: 1.1em;
    opacity: 0.9;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.play-again-btn, .share-btn, .home-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-again-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.share-btn {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.home-btn {
    background: #f8f9fa;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.play-again-btn:hover, .share-btn:hover, .home-btn:hover {
    transform: translateY(-2px);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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

.shake {
    animation: shake 0.3s ease-in-out;
}

.bounce {
    animation: bounce 0.3s ease-in-out;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .boss-avatar {
        font-size: 5em;
    }
    
    .game-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .game-area {
        margin: 60px 0 30px 0;
    }
    
    .result-actions {
        gap: 10px;
    }
    
    /* 移动端speech bubble样式调整 */
    .speech-bubble {
        top: -40px; /* 移动端放在头像和header之间 */
        font-size: 0.7em;
        max-width: 85%; /* 使用百分比，确保不超出屏幕 */
        min-width: 140px;
        padding: 6px 10px;
        line-height: 1.1;
        z-index: 18; /* 移动端合适的z-index */
    }
    
    .speech-bubble.show {
        transform: translateX(-50%) translateY(-3px);
    }
}

/* Ad placeholder */
.ad-slot {
    width: 100%;
    height: 60px;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.8em;
    margin: 20px 0;
    border-radius: 10px;
} 