/* 汉字拼字游戏 - 简化版样式 */

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

body {
    font-family: 'Noto Sans SC', 'Ma Shan Zheng', sans-serif;
    background: #FFF8E1;
    min-height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#game-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #FFF8E1 0%, #F5F5DC 100%);
}

/* 顶部状态栏 */
#status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #4CAF50;
    color: white;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#lives {
    font-size: 20px;
    letter-spacing: 4px;
}

#score, #level {
    font-weight: bold;
}

/* 游戏区域 */
#game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 15px;
    position: relative;
    padding-top: 30px;
}

/* 拼音显示 */
#pinyin-display {
    margin-bottom: 15px;
    margin-top: 20px;
}

#pinyin-text {
    font-size: 72px;
    font-weight: bold;
    color: #3E2723;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* 汉字显示 */
#char-display {
    margin-bottom: 30px;
    animation: popIn 0.3s ease;
}

#char-text {
    font-size: 120px;
    font-family: 'Ma Shan Zheng', cursive;
    color: #4CAF50;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.2);
}

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

/* 偏旁选择区 */
#component-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.option-btn {
    width: 75px;
    height: 75px;
    font-size: 32px;
    font-family: 'Ma Shan Zheng', cursive;
    background: white;
    border: 3px solid #4CAF50;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin: 5px;
}

.option-btn:active {
    transform: scale(0.95);
    background: #E8F5E9;
}

.option-btn.correct {
    background: #4CAF50;
    color: white;
    animation: correctPulse 0.5s;
}

.option-btn.wrong {
    background: #FF5722;
    color: white;
    animation: wrongShake 0.5s;
}

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

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

/* 计时器 */
#timer-container {
    height: 8px;
    background: #E0E0E0;
    position: relative;
}

#timer-bar {
    height: 100%;
    width: 100%;
    background: #4CAF50;
    transition: width 0.1s linear, background 0.3s;
}

#timer-text {
    position: absolute;
    right: 10px;
    top: -25px;
    font-size: 14px;
    font-weight: bold;
    color: #666;
}

/* 反馈问题修复 */
#feedback {
    font-size: 20px;
    font-weight: bold;
    padding: 8px 20px;
    border-radius: 20px;
    z-index: 50;
    text-align: center;
    margin-bottom: 10px;
}

#feedback.question {
    background: #E3F2FD;
    color: #1976D2;
    font-size: 16px;
    border: 2px solid #2196F3;
}

/* 反馈 */
#feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: bold;
    padding: 20px 40px;
    border-radius: 16px;
    animation: fadeInOut 1s ease;
    z-index: 100;
}

#feedback.success {
    background: #4CAF50;
    color: white;
}

#feedback.error {
    background: #FF5722;
    color: white;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
}

/* 底部按钮 */
#action-buttons {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: white;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.action-btn {
    flex: 1;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

#read-btn {
    background: #4CAF50;
    color: white;
}

#read-btn:disabled {
    background: #CCC;
    cursor: not-allowed;
}

#next-btn {
    background: #2196F3;
    color: white;
}

#next-btn:disabled {
    background: #CCC;
    cursor: not-allowed;
}

/* 覆盖层 */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#overlay.hidden {
    display: none;
}

#start-screen, #game-over-screen {
    text-align: center;
    color: white;
    padding: 40px;
}

#start-screen h1 {
    font-size: 48px;
    font-family: 'Ma Shan Zheng', cursive;
    color: #4CAF50;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 18px;
    color: #CCC;
    margin-bottom: 30px;
}

.instructions {
    margin-bottom: 30px;
    line-height: 2;
    font-size: 16px;
}

.instructions p {
    margin: 10px 0;
}

.primary-btn {
    padding: 15px 50px;
    font-size: 22px;
    font-weight: bold;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.primary-btn:active {
    transform: scale(0.95);
}

/* 游戏结束 */
#game-over-screen h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #FF5722;
}

.final-score {
    margin: 20px 0;
}

.final-score p:first-child {
    font-size: 16px;
    color: #CCC;
}

#final-score-value {
    font-size: 64px;
    font-weight: bold;
    color: #4CAF50;
}

.chars-learned {
    margin: 20px 0;
}

.chars-learned p {
    font-size: 14px;
    color: #CCC;
    margin-bottom: 10px;
}

#learned-chars {
    font-size: 24px;
    letter-spacing: 8px;
    color: #FFF;
    min-height: 30px;
}

/* 响应式 */
@media (max-width: 480px) {
    #pinyin-text {
        font-size: 56px;
    }

    #char-text {
        font-size: 96px;
    }

    .option-btn {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    #component-options {
        gap: 10px;
    }
}

/* 工具类 */
.hidden {
    display: none !important;
}
