/* 手绘卡通风格答题游戏样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'ZCOOL KuaiLe', 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #fff5e6 0%, #ffe4cc 50%, #ffd4b3 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 主容器 */
.game-container {
    max-width: 500px;
    width: 100%;
    background: #fffbf5;
    border-radius: 30px;
    padding: 30px;
    box-shadow: 
        8px 8px 0px #e8d4c4,
        12px 12px 0px #d4c0b0;
    border: 4px solid #5c4033;
    position: relative;
}

/* 手绘边框效果 */
.game-container::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 3px dashed #8b6914;
    border-radius: 35px;
    pointer-events: none;
}

/* 屏幕切换 */
.screen {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* 开始页面 */
.game-title {
    font-size: 3em;
    color: #ff6b35;
    text-shadow: 
        3px 3px 0px #ffd93d,
        -1px -1px 0px #5c4033;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    font-size: 1.2em;
    color: #6b4423;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* 按钮样式 - 手绘风格 */
.btn-start, .btn-submit, .btn-restart {
    font-family: inherit;
    font-size: 1.5em;
    padding: 15px 40px;
    border: 4px solid #5c4033;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.btn-start {
    background: linear-gradient(180deg, #ff6b35 0%, #e55a2b 100%);
    color: white;
    text-shadow: 2px 2px 0px #c44a1e;
    box-shadow: 
        4px 4px 0px #c44a1e,
        6px 6px 0px #5c4033;
}

.btn-submit {
    background: linear-gradient(180deg, #4ecdc4 0%, #3db8b0 100%);
    color: white;
    text-shadow: 2px 2px 0px #2a9d8f;
    box-shadow: 
        4px 4px 0px #2a9d8f,
        6px 6px 0px #5c4033;
    margin-top: 20px;
}

.btn-restart {
    background: linear-gradient(180deg, #f9c74f 0%, #e8b445 100%);
    color: #5c4033;
    box-shadow: 
        4px 4px 0px #d4a03a,
        6px 6px 0px #5c4033;
}

.btn-start:hover, .btn-submit:hover, .btn-restart:hover {
    transform: translate(2px, 2px);
    box-shadow: 
        2px 2px 0px currentColor,
        4px 4px 0px #5c4033;
}

.btn-start:active, .btn-submit:active, .btn-restart:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

/* 游戏页面头部 */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #ffecd2;
    border: 3px solid #5c4033;
    border-radius: 15px;
    position: relative;
}

.btn-back-small {
    position: absolute;
    left: 10px;
    font-family: inherit;
    font-size: 1.2em;
    padding: 5px 12px;
    border: 3px solid #5c4033;
    border-radius: 10px;
    background: #f9c74f;
    color: #5c4033;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back-small:hover {
    background: #e8b445;
    transform: scale(1.05);
}

.btn-hint-small {
    position: absolute;
    right: 10px;
    font-family: inherit;
    font-size: 1.2em;
    width: 32px;
    height: 32px;
    border: 3px solid #5c4033;
    border-radius: 50%;
    background: #4ecdc4;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
}

.btn-hint-small:hover {
    background: #3db8b0;
    transform: scale(1.05);
}

.level-info {
    font-size: 1.3em;
    color: #5c4033;
}

#current-level {
    color: #ff6b35;
    font-weight: bold;
}

/* 图片框架 - 手绘相框风格 */
.image-frame {
    background: white;
    border: 5px solid #5c4033;
    border-radius: 15px;
    padding: 10px;
    margin: 10px auto;
    max-width: 280px;
    box-shadow: 
        inset 0 0 20px rgba(92, 64, 51, 0.1),
        4px 4px 0px #d4c0b0;
    position: relative;
}

.image-frame::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 2px dashed #ccc;
    border-radius: 10px;
    pointer-events: none;
}

.image-frame img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.hint-frame {
    border-color: #4ecdc4;
}

.question-frame {
    border-color: #ff6b35;
}

/* 提示和问题文字 */
.hint-text, .question-text {
    font-size: 1.3em;
    color: #5c4033;
    margin: 10px 0;
}

.hint-text {
    color: #2a9d8f;
}

.question-text .blank {
    color: #ff6b35;
    border-bottom: 3px dashed #ff6b35;
    padding: 0 10px;
}

/* 答案输入区域 */
.answer-section {
    margin-top: 20px;
}

.input-boxes {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.input-box {
    width: 50px;
    height: 55px;
    border: 4px solid #5c4033;
    border-radius: 10px;
    background: #fffbf5;
    font-size: 1.5em;
    font-family: inherit;
    text-align: center;
    color: #5c4033;
    box-shadow: 
        inset 2px 2px 5px rgba(0,0,0,0.1),
        3px 3px 0px #d4c0b0;
    transition: all 0.2s ease;
}

.input-box:focus {
    outline: none;
    border-color: #ff6b35;
    background: #fff5ee;
    transform: scale(1.05);
}

.input-box.correct {
    border-color: #4ecdc4;
    background: #e8fff9;
}

.input-box.wrong {
    border-color: #ff4757;
    background: #ffe8e8;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(50, 50, 50, 0.9);
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.2em;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* 成功弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #fffbf5;
    border: 4px solid #5c4033;
    border-radius: 20px;
    padding: 30px 40px;
    text-align: center;
    box-shadow: 8px 8px 0px #d4c0b0;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 1.8em;
    color: #4ecdc4;
    margin-bottom: 20px;
}

.btn-next {
    font-family: inherit;
    font-size: 1.3em;
    padding: 12px 35px;
    border: 4px solid #5c4033;
    border-radius: 15px;
    background: linear-gradient(180deg, #ff6b35 0%, #e55a2b 100%);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 4px 4px 0px #c44a1e;
}

.btn-next:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #c44a1e;
}

.hint-title {
    color: #ff6b35;
}

.hint-answer {
    font-size: 2em;
    color: #5c4033;
    margin-bottom: 20px;
    letter-spacing: 5px;
}

.btn-close {
    font-family: inherit;
    font-size: 1.2em;
    padding: 10px 30px;
    border: 3px solid #5c4033;
    border-radius: 12px;
    background: #f9c74f;
    color: #5c4033;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 3px 3px 0px #d4a03a;
}

.btn-close:hover {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0px #d4a03a;
}

/* 结果页面 */
.result-title {
    font-size: 2.5em;
    color: #ff6b35;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px #ffd93d;
}

.result-content {
    background: #ffecd2;
    border: 4px solid #5c4033;
    border-radius: 20px;
    padding: 20px;
    margin: 20px 0;
}

.result-content p {
    font-size: 1.4em;
    color: #5c4033;
    margin: 10px 0;
}

#final-score, #accuracy {
    color: #ff6b35;
    font-size: 1.2em;
}

/* 分隔装饰 */
.hint-section, .question-section {
    position: relative;
    padding: 15px 0;
}

/* 选关页面 */
.select-title {
    font-size: 2em;
    color: #ff6b35;
    margin-bottom: 25px;
    text-shadow: 2px 2px 0px #ffd93d;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.level-btn {
    aspect-ratio: 1 / 1;
    border: 4px solid #ccc;
    border-radius: 15px;
    background: #f5f5f5;
    font-family: inherit;
    font-size: 1.5em;
    color: #999;
    cursor: not-allowed;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.level-btn.unlocked {
    border-color: #ccc;
    background: #fff;
    color: #5c4033;
    cursor: pointer;
}

.level-btn.unlocked:hover {
    transform: scale(1.05);
    box-shadow: 3px 3px 0px #d4c0b0;
}

.level-btn.completed {
    border-color: #ff6b35;
    background: #fff5ee;
    color: #ff6b35;
    cursor: pointer;
}

.level-btn.completed:hover {
    transform: scale(1.05);
    box-shadow: 3px 3px 0px #e55a2b;
}

.level-btn .lock-icon {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: rgba(100, 100, 100, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
}

.level-btn.unlocked .lock-icon,
.level-btn.completed .lock-icon {
    display: none;
}

.btn-back {
    font-family: inherit;
    font-size: 1.2em;
    padding: 12px 30px;
    border: 3px solid #5c4033;
    border-radius: 15px;
    background: #f9c74f;
    color: #5c4033;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 3px 3px 0px #d4a03a;
}

.btn-back:hover {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0px #d4a03a;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .game-container {
        padding: 20px;
        border-radius: 20px;
    }
    
    .game-title {
        font-size: 2.2em;
    }
    
    .input-box {
        width: 40px;
        height: 45px;
        font-size: 1.2em;
    }
    
    .image-frame {
        max-width: 200px;
    }
    
    .level-grid {
        max-width: 240px;
    }
    
    .level-btn {
        font-size: 1.2em;
    }
}
