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

:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --text-color: #2C3E50;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
}

/* 迪士尼主题 */
body[data-theme="disney"] {
    --bg-gradient: linear-gradient(135deg, #FF6B9D 0%, #C44DFF 50%, #6B5BFF 100%);
    --primary-color: #FF1493; /* 深粉色 */
    --secondary-color: #00CED1; /* 深青色 */
    --accent-color: #FFD700; /* 金色 */
}

/* 海洋主题 */
body[data-theme="ocean"] {
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #00d2ff 100%);
    --primary-color: #FF8C42;
    --secondary-color: #4ECDC4;
}

/* 太空主题 */
body[data-theme="space"] {
    --bg-gradient: linear-gradient(135deg, #2c3e50 0%, #000000 100%);
    --primary-color: #FFD700;
    --secondary-color: #4ECDC4;
    --card-bg: rgba(255, 255, 255, 0.9);
}

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#app {
    width: 100%;
    max-width: 600px;
    background: var(--card-bg);
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 1.5em;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.score-board {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 1.2em;
}

.star {
    color: #FFE66D;
    text-shadow: 0 0 10px #FFE66D;
    animation: spin 3s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.streak {
    color: #FF6B6B;
    animation: pulse 0.5s ease infinite;
}

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

.icon-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

main {
    padding: 15px 15px 5px 15px;
    text-align: center;
}

.question-container {
    margin-bottom: 15px;
}

.character {
    font-size: 3em;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
}

/* 角色图片 */
.character-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 10px;
    animation: float 3s ease-in-out infinite;
}

/* 弹窗结果图片 */
.modal-result-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    animation: bounce 0.5s ease infinite;
}

/* 角色容器 */
.character-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    margin-bottom: 20px;
}

/* 角色图片样式 */
.character-image {
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
}

/* 角色名称显示 */
.character-name {
    font-size: 1em;
    color: var(--primary-color);
    margin-top: 5px;
    margin-bottom: 10px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 迪士尼主题特有的角色动画 */
body[data-theme="disney"] .character,
body[data-theme="disney"] .character-image {
    animation: disney-bounce 2s ease-in-out infinite;
}

@keyframes disney-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    25% {
        transform: translateY(-15px) scale(1.1);
    }
    50% {
        transform: translateY(-25px) scale(1.05);
    }
    75% {
        transform: translateY(-15px) scale(1.1);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.question {
    font-size: 2.2em;
    font-weight: bold;
    color: var(--text-color);
    background: white;
    padding: 15px 25px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.question-mark {
    color: var(--primary-color);
    animation: blink 1s ease infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.answer-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

#answer-input {
    font-size: 1.8em;
    padding: 10px 20px;
    border: 3px solid var(--secondary-color);
    border-radius: 15px;
    width: 180px;
    text-align: center;
    transition: all 0.3s;
}

#answer-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

/* 移除所有按钮的焦点样式 */
button:focus {
    outline: none;
}

.num-btn:focus {
    outline: none;
    transform: scale(0.95);
}

#submit-btn {
    font-size: 1.2em;
    padding: 10px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

#submit-btn:active {
    transform: translateY(0);
}

/* 数字按钮 */
.number-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 10px;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.num-btn {
    font-size: 1.5em;
    padding: 10px;
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.num-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.num-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.num-btn.clear-btn {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.num-btn.clear-btn:hover {
    background: #e74c3c;
}

.hint {
    margin-top: 10px;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    max-width: 90%;
    animation: scaleIn 0.5s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes scaleIn {
    from {
        transform: scale(0.3);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-image {
    font-size: 6em;
    margin-bottom: 20px;
    animation: bounce 0.5s ease infinite;
}

/* 弹窗图片容器 */
.modal-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    min-height: 150px;
}

/* 弹窗真实图片样式 */
.modal-image-real {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    animation: bounce 0.5s ease infinite;
}

.modal h2 {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.modal p {
    font-size: 1.5em;
    margin-bottom: 25px;
    color: var(--text-color);
}

.btn-primary {
    font-size: 1.3em;
    padding: 15px 40px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.settings-panel.hidden {
    display: none;
}

.settings-content {
    background: white;
    padding: 40px;
    border-radius: 30px;
    max-width: 400px;
    width: 90%;
}

.settings-content h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 2em;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.2em;
    color: var(--text-color);
    font-weight: bold;
}

.setting-item select,
.setting-item input[type="checkbox"] {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    font-size: 1.1em;
    font-family: inherit;
}

.setting-item input[type="checkbox"] {
    width: 50px;
    height: 50px;
    cursor: pointer;
}

.settings-content .btn-primary {
    width: 100%;
    margin-top: 20px;
}

/* Confetti Animation */
.confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    background: #f00;
    animation: confetti-fall 3s linear forwards;
    pointer-events: none;
}

/* 迪士尼主题的星星闪烁效果 */
body[data-theme="disney"]::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 80% 20%, rgba(255, 215, 0, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 40% 70%, rgba(255, 215, 0, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 60% 40%, rgba(255, 215, 0, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 90% 80%, rgba(255, 215, 0, 0.3) 1px, transparent 1px);
    background-size: 100% 100%;
    pointer-events: none;
    animation: twinkle 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.2em;
    }

    .question {
        font-size: 1.8em;
        padding: 12px 20px;
    }

    .character {
        font-size: 2.5em;
    }

    .character-img {
        width: 80px;
        height: 80px;
    }

    .character-name {
        font-size: 0.9em;
    }

    .modal-result-img {
        width: 60px;
        height: 60px;
    }

    #answer-input {
        width: 120px;
        font-size: 1.5em;
        padding: 8px 15px;
    }

    #submit-btn {
        font-size: 1em;
        padding: 8px 25px;
    }

    .number-pad {
        max-width: 260px;
        gap: 5px;
    }

    .num-btn {
        padding: 8px;
        font-size: 1.3em;
    }

    .modal-image {
        font-size: 3em;
    }

    .modal h2 {
        font-size: 1.5em;
    }

    .modal p {
        font-size: 1.1em;
    }

    .modal-content {
        padding: 25px;
    }

    main {
        padding: 10px 10px 5px 10px;
    }
}
