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

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    font-size: 2.2em;
    text-align: center;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
    margin-bottom: 20px;
    text-align: center;
}

.game-info {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.15);
    padding: 15px 30px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.info-item {
    display: flex;
    gap: 8px;
    color: #fff;
    font-size: 1.1em;
}

.info-item .label {
    color: rgba(255, 255, 255, 0.8);
}

.info-item span:last-child {
    font-weight: bold;
    color: #ffd700;
}

.auto-speak-btn {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.auto-speak-btn:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.2));
    transform: scale(1.05);
}

.auto-speak-btn.off {
    opacity: 0.6;
    border-color: rgba(255, 100, 100, 0.5);
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 600px;
}

.card {
    width: 350px;
    height: 450px;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-front {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
}

.card-back {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    transform: rotateY(180deg);
}

.icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.italian-word {
    font-size: 2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.pronunciation {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
}

.speak-btn {
    background: linear-gradient(145deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.speak-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.gender-indicator {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.gender-indicator.masculine {
    background: linear-gradient(145deg, #4a90d9, #357abd);
    color: white;
}

.gender-indicator.feminine {
    background: linear-gradient(145deg, #e91e63, #c2185b);
    color: white;
}

.chinese-word {
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.gender-rule {
    font-size: 0.95em;
    color: #666;
    text-align: center;
    line-height: 1.5;
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.answer-buttons {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
}

.answer-btn {
    flex: 1;
    padding: 20px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.answer-btn.masculine {
    background: linear-gradient(145deg, #4a90d9, #357abd);
    color: white;
}

.answer-btn.feminine {
    background: linear-gradient(145deg, #e91e63, #c2185b);
    color: white;
}

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

.answer-btn:active {
    transform: translateY(0);
}

.gender-icon {
    font-size: 1.5em;
}

.control-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.control-btn {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.2));
    transform: scale(1.05);
}

.result-panel {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    margin-top: 20px;
    display: none;
}

.result-panel.show {
    display: block;
    animation: slideIn 0.3s ease;
}

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

.result-message {
    font-size: 1.3em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    color: white;
}

.result-message.correct {
    color: #4ade80;
}

.result-message.wrong {
    color: #f87171;
}

.result-detail {
    font-size: 1em;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
}

.progress-bar {
    width: 100%;
    max-width: 600px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.category-selector {
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.15);
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.category-selector h3 {
    color: white;
    margin-bottom: 15px;
    text-align: center;
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.category-btn {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.2));
    transform: scale(1.05);
}

.category-btn.active {
    background: linear-gradient(145deg, #ffd700, #ffb700);
    color: #333;
    border-color: #ffd700;
}

@media (max-width: 768px) {
    .card {
        width: 300px;
        height: 400px;
    }
    
    .italian-word {
        font-size: 1.6em;
    }
    
    .chinese-word {
        font-size: 1.5em;
    }
    
    .answer-buttons {
        flex-direction: column;
    }
    
    .answer-btn {
        padding: 15px;
    }
}
