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

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

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

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

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.game-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 900px;
    width: 100%;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.score {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.card {
    height: 120px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card.selected {
    border-color: #007bff;
    background: #e3f2fd;
}

.card.matched {
    border-color: #28a745;
    background: #d4edda;
    cursor: default;
}

.card.matched::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    color: #28a745;
    font-size: 1.2rem;
    font-weight: bold;
}

.fraction-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.fraction-visual {
    width: 80px;
    height: 40px;
    position: relative;
    margin: 5px 0;
}

.rectangle {
    width: 100%;
    height: 100%;
    border: 2px solid #333;
    position: relative;
    background: white;
}

.circle {
    width: 40px;
    height: 40px;
    border: 2px solid #333;
    border-radius: 50%;
    position: relative;
    background: white;
    margin: 0 auto;
}

.filled-part {
    position: absolute;
    background: #ff6b6b;
    transition: all 0.3s;
}

.message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 30px 50px;
    border-radius: 10px;
    font-size: 1.5rem;
    text-align: center;
    z-index: 1000;
    display: none;
}

@media (max-width: 768px) {
    .cards-container {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .card {
        height: 100px;
    }
    
    .fraction-text {
        font-size: 1.2rem;
    }
}