* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background-color: #FFF9E6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
    text-align: center;
}

.header {
    margin-bottom: 30px;
}

.title {
    font-size: 64px;
    font-weight: bold;
    color: #FF6B35;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1);
    letter-spacing: 8px;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.grade-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.grade-selector label {
    font-size: 18px;
    color: #333;
    font-weight: bold;
}

.grade-select {
    padding: 12px 20px;
    font-size: 18px;
    border: 3px solid #FF6B35;
    border-radius: 10px;
    background-color: white;
    color: #333;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.grade-select:hover {
    border-color: #FF8C42;
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.2);
}

.btn {
    padding: 12px 30px;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.6);
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
}

.info-item {
    background: white;
    padding: 15px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.info-label {
    font-size: 18px;
    color: #666;
    margin-right: 10px;
}

.info-value {
    font-size: 24px;
    font-weight: bold;
    color: #FF6B35;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    margin: 0 auto;
    min-height: 500px;
    align-content: center;
}

.bubble {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 36px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    box-shadow: 
        inset -10px -10px 20px rgba(0, 0, 0, 0.2),
        inset 10px 10px 20px rgba(255, 255, 255, 0.3),
        0 10px 20px rgba(0, 0, 0, 0.3);
    animation: float 3s ease-in-out infinite;
}

.bubble::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 20%;
    width: 30%;
    height: 20%;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    filter: blur(2px);
}

.bubble:hover {
    transform: scale(1.1) translateY(-5px);
}

.bubble.selected {
    transform: scale(1.15);
    box-shadow: 
        inset -10px -10px 20px rgba(0, 0, 0, 0.2),
        inset 10px 10px 20px rgba(255, 255, 255, 0.3),
        0 0 30px rgba(255, 107, 53, 0.8),
        0 15px 30px rgba(0, 0, 0, 0.4);
    border: 4px solid white;
}

.bubble.matched {
    animation: disappear 0.5s ease-out forwards;
}

.bubble.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes disappear {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(0);
    }
}

@keyframes wrong {
    0%, 100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-10px);
    }
    40% {
        transform: translateX(10px);
    }
    60% {
        transform: translateX(-10px);
    }
    80% {
        transform: translateX(10px);
    }
}

.bubble.wrong {
    animation: wrong 0.5s ease-in-out;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 500px;
}

.modal-title {
    font-size: 36px;
    color: white;
    margin-bottom: 20px;
}

.modal-text {
    font-size: 24px;
    color: white;
    margin-bottom: 30px;
}

#final-time {
    font-weight: bold;
    color: #FFD700;
}

@media (max-width: 768px) {
    .title {
        font-size: 36px;
        letter-spacing: 4px;
    }

    .game-board {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        padding: 20px;
    }

    .bubble {
        width: 80px;
        height: 80px;
        font-size: 24px;
    }

    .game-info {
        flex-direction: column;
        gap: 10px;
    }

    .controls {
        flex-direction: column;
    }
}
