/* 春节传统文化闯关游戏 - CSS样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'SimHei', sans-serif;
    background: linear-gradient(135deg, #b30000 0%, #ffcc00 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 春节装饰元素 */
.lantern {
    position: absolute;
    width: 60px;
    height: 90px;
    background: radial-gradient(circle at center, #ff4444, #cc0000);
    border-radius: 50%;
    z-index: -1;
    animation: float 3s ease-in-out infinite alternate;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.7);
}

.lantern::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 30px;
    background: #ffd700;
    border-radius: 5px 5px 0 0;
}

.lantern::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 30px;
    background: #ffd700;
}

.lantern-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.lantern-2 {
    top: 15%;
    right: 15%;
    animation-delay: 1.5s;
}

.firecracker {
    position: absolute;
    width: 8px;
    height: 40px;
    background: linear-gradient(to bottom, #ff6600, #ff3300);
    z-index: -1;
    animation: rotate 4s linear infinite;
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.5);
}

.firecracker-1 {
    top: 25%;
    left: 5%;
    animation-delay: 0.5s;
}

.firecracker-2 {
    top: 30%;
    right: 8%;
    animation-delay: 2s;
}

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

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

/* 添加福字和春节图案装饰 */
.fortune-symbol {
    position: absolute;
    font-size: 2em;
    color: #b30000;
    z-index: -1;
    animation: spin 10s linear infinite;
    opacity: 0.1;
}

.fortune-symbol-1 {
    top: 5%;
    right: 25%;
    animation-delay: 0s;
}

.fortune-symbol-2 {
    bottom: 10%;
    left: 20%;
    animation-delay: 5s;
}

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

/* 添加飘落的红包动画 */
.red-envelope {
    position: absolute;
    width: 30px;
    height: 40px;
    background: #ff4444;
    z-index: -1;
    animation: fall linear infinite;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.red-envelope::before {
    content: '🧧';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8em;
}

.red-envelope-1 {
    top: -40px;
    left: 15%;
    animation-duration: 8s;
    animation-delay: 0s;
}

.red-envelope-2 {
    top: -40px;
    left: 35%;
    animation-duration: 10s;
    animation-delay: 2s;
}

.red-envelope-3 {
    top: -40px;
    left: 65%;
    animation-duration: 12s;
    animation-delay: 4s;
}

.red-envelope-4 {
    top: -40px;
    left: 85%;
    animation-duration: 9s;
    animation-delay: 1s;
}

@keyframes fall {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(100vh) rotate(360deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.game-title {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #ffd700;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.screen {
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

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

.welcome-card, .result-card {
    text-align: center;
    padding: 30px;
}

.welcome-card h2 {
    color: #b30000;
    font-size: 2em;
    margin-bottom: 15px;
}

.welcome-card p {
    margin: 10px 0;
    font-size: 1.1em;
    color: #333;
}

.levels-preview {
    list-style: none;
    margin: 20px 0;
    text-align: left;
    padding-left: 20px;
}

.levels-preview li {
    margin: 10px 0;
    font-size: 1.1em;
    color: #555;
}

.btn {
    background: linear-gradient(to right, #b30000, #cc0000);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
    background: linear-gradient(to right, #cc0000, #d90000);
}

.btn-large {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(to right, #ffcc00, #ffdd44);
    border-radius: 10px;
}

.level-indicator, .score-board {
    font-size: 1.2em;
    font-weight: bold;
    color: #b30000;
}

.challenge-area {
    text-align: center;
}

.question-text {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.6;
}

.answer-input {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin: 10px 0;
}

.answer-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.option-btn {
    padding: 12px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-btn:hover {
    background: #e9ecef;
    border-color: #b30000;
}

.option-btn.selected {
    background: #b30000;
    color: white;
    border-color: #b30000;
}

.controls {
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

.success-message {
    color: #28a745;
    font-weight: bold;
    margin: 10px 0;
    font-size: 1.1em;
}

.error-message {
    color: #dc3545;
    font-weight: bold;
    margin: 10px 0;
    font-size: 1.1em;
}

.matching-pairs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.pair-item {
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.pair-item:hover {
    background: #e9ecef;
    border-color: #b30000;
}

.pair-item.selected {
    background: #b30000;
    color: white;
    border-color: #b30000;
}

.pair-item.paired {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .game-title {
        font-size: 2em;
    }
    
    .screen {
        padding: 20px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .answer-options {
        grid-template-columns: 1fr;
    }
    
    .matching-pairs {
        grid-template-columns: 1fr;
    }
}