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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    padding: 20px;
    user-select: none;
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

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

.game-header h1 {
    color: #4a5568;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid #dee2e6;
    flex-wrap: wrap;
}

.info-item {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    min-width: 100px;
}

.info-label {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 600;
}

.info-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #495057;
}

.difficulty-selector {
    margin-bottom: 25px;
    text-align: center;
}

.difficulty-selector h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.difficulty-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.difficulty-btn {
    padding: 12px 18px;
    border: 3px solid #dee2e6;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    min-width: 100px;
}

.difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-color: #007bff;
}

.difficulty-btn.active {
    border-color: #007bff;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.difficulty-btn span {
    font-size: 1.5em;
    display: block;
    margin-bottom: 5px;
}

.difficulty-btn div {
    font-weight: bold;
    margin-bottom: 3px;
    font-size: 0.9em;
}

.difficulty-btn small {
    font-size: 0.75em;
    opacity: 0.8;
}

.game-status {
    text-align: center;
    margin-bottom: 25px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border: 2px solid #dee2e6;
}

.status-message {
    font-size: 1.2em;
    font-weight: bold;
    color: #495057;
    margin-bottom: 10px;
}

.progress-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 1em;
    color: #6c757d;
    flex-wrap: wrap;
}

.time-remaining {
    color: #dc3545;
    font-weight: bold;
}

.simon-board {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto 30px;
    border-radius: 50%;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.color-button {
    position: absolute;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 5px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.1);
}

.color-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.color-button.active {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.5);
    border-color: white;
}

.color-button.red {
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-top-left-radius: 200px;
    border-bottom-left-radius: 50px;
    border-top-right-radius: 50px;
    border-bottom-right-radius: 200px;
}

.color-button.green {
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #27ae60, #229954);
    border-top-right-radius: 200px;
    border-bottom-right-radius: 50px;
    border-top-left-radius: 50px;
    border-bottom-left-radius: 200px;
}

.color-button.blue {
    bottom: 0;
    left: 0;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-bottom-left-radius: 200px;
    border-top-left-radius: 50px;
    border-bottom-right-radius: 50px;
    border-top-right-radius: 200px;
}

.color-button.yellow {
    bottom: 0;
    right: 0;
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    border-bottom-right-radius: 200px;
    border-top-right-radius: 50px;
    border-bottom-left-radius: 50px;
    border-top-left-radius: 200px;
}

.button-number {
    font-size: 2em;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

.button-label {
    font-size: 0.9em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.center-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border: 5px solid rgba(255, 255, 255, 0.2);
}

.level-display {
    font-size: 2em;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
}

.start-button {
    font-size: 0.8em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
}

.start-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    min-width: 110px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

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

.btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn.secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
}

.btn.secondary:hover {
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.game-stats {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
}

.game-stats h3 {
    color: #495057;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    border: 2px solid #dee2e6;
}

.stat-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 3px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #495057;
}

/* 弹窗样式 */
.victory-popup, .help-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.victory-popup.show, .help-modal.show {
    display: flex;
}

.victory-content, .modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: popupSlideIn 0.5s ease-out;
}

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

.victory-content h2 {
    color: #28a745;
    margin-bottom: 15px;
    font-size: 2em;
}

.victory-message {
    font-size: 1.1em;
    color: #495057;
    margin-bottom: 20px;
    font-weight: 600;
}

.victory-stats {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.victory-stats p {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    color: #495057;
}

.victory-stats span {
    font-weight: bold;
    color: #007bff;
}

.victory-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* 帮助模态框 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.modal-header h2 {
    color: #495057;
    font-size: 1.5em;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    text-align: left;
}

.help-section {
    margin-bottom: 25px;
}

.help-section h3 {
    color: #495057;
    margin-bottom: 12px;
    font-size: 1.1em;
    border-left: 4px solid #007bff;
    padding-left: 12px;
}

.help-section p {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 10px;
}

.help-section ul {
    color: #6c757d;
    line-height: 1.6;
    margin-left: 20px;
}

.help-section li {
    margin-bottom: 8px;
}

.help-section strong {
    color: #495057;
    font-weight: 600;
}

/* 动画效果 */
@keyframes flashColor {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.05);
        filter: brightness(1.3);
    }
}

.color-button.flash {
    animation: flashColor 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.center-display.pulse {
    animation: pulse 1s ease-in-out infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        margin: 10px;
    }
    
    .game-header h1 {
        font-size: 2em;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .info-item {
        min-width: 120px;
    }
    
    .difficulty-buttons {
        flex-direction: column;
        align-items: center;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .difficulty-btn {
        width: 100%;
        min-width: auto;
    }
    
    .simon-board {
        width: 300px;
        height: 300px;
    }
    
    .color-button {
        width: 140px;
        height: 140px;
    }
    
    .button-number {
        font-size: 1.5em;
    }
    
    .button-label {
        font-size: 0.8em;
    }
    
    .center-display {
        width: 90px;
        height: 90px;
    }
    
    .level-display {
        font-size: 1.5em;
    }
    
    .start-button {
        font-size: 0.7em;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
        min-width: auto;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .victory-content, .modal-content {
        padding: 25px;
        margin: 15px;
    }
    
    .victory-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .simon-board {
        width: 250px;
        height: 250px;
    }
    
    .color-button {
        width: 115px;
        height: 115px;
    }
    
    .button-number {
        font-size: 1.2em;
    }
    
    .button-label {
        font-size: 0.7em;
    }
    
    .center-display {
        width: 75px;
        height: 75px;
    }
    
    .level-display {
        font-size: 1.2em;
    }
    
    .start-button {
        font-size: 0.6em;
        padding: 3px 6px;
    }
}