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

body {
    font-family: 'SimHei', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M50 0 L60 30 L100 30 L65 50 L75 90 L50 70 L25 90 L35 50 L0 30 L40 30 Z" fill="%23ffeb3b" opacity="0.1"/></svg>');
}

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

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    color: #d32f2f;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.2rem;
    color: #666;
}

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

.lantern-container {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    perspective: 1000px;
}

.lantern {
    width: 400px;
    animation: swing 3s ease-in-out infinite alternate;
    transform-origin: top center;
}

@keyframes swing {
    0% { transform: rotate(-5deg); }
    100% { transform: rotate(5deg); }
}

.lantern-top {
    width: 40px;
    height: 60px;
    background: #d32f2f;
    margin: 0 auto;
    border-radius: 5px 5px 0 0;
    position: relative;
}

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

.lantern-body {
    width: 400px;
    height: 300px;
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
}

.lantern-body::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.lantern-bottom {
    width: 40px;
    height: 60px;
    background: #d32f2f;
    margin: 0 auto;
    border-radius: 0 0 5px 5px;
    position: relative;
}

.lantern-bottom::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background: #ffeb3b;
    border-radius: 50%;
    box-shadow: 0 0 10px #ffeb3b;
}

.riddle {
    text-align: center;
    z-index: 1;
    padding: 20px;
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    width: 90%;
}

.riddle h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#answer-input {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.3s;
}

#answer-input:focus {
    border-color: #f44336;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

button {
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

#start-btn {
    background: #4caf50;
    color: white;
}

#submit-btn {
    background: #2196f3;
    color: white;
}

#next-btn {
    background: #ff9800;
    color: white;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.score-board {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.score-board h3 {
    text-align: center;
    color: #d32f2f;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.stats {
    display: flex;
    justify-content: space-around;
}

.stat-item {
    text-align: center;
}

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

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: #666;
    font-size: 1rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 10px;
    width: 80%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
}

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

.modal-content h2 {
    color: #d32f2f;
    margin-bottom: 20px;
}

.result-stats {
    margin-bottom: 20px;
    text-align: left;
}

.result-stats p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.result-stats span {
    font-weight: bold;
    color: #d32f2f;
}

#result-message {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 5px;
}

#restart-btn, #feedback-close {
    background: #4caf50;
    color: white;
    padding: 12px 24px;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .lantern {
        width: 300px;
    }
    
    .lantern-body {
        width: 300px;
        height: 250px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .riddle h2 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .lantern {
        width: 250px;
    }
    
    .lantern-body {
        width: 250px;
        height: 200px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .riddle h2 {
        font-size: 1rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
}